@walkeros/cli 4.2.1-next-1781682752679 → 4.2.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
@@ -171,16 +171,16 @@ async function k(e4, t4) {
171
171
  function E(e4) {
172
172
  return { _meta: { hops: 0, path: [e4] } };
173
173
  }
174
- function T(e4) {
174
+ function C(e4) {
175
175
  throw new Error(String(e4));
176
176
  }
177
177
  function z(e4, t4) {
178
178
  const n5 = false !== t4?.stripAnnotations, r5 = {}, o4 = /* @__PURE__ */ new Set();
179
179
  function i4(t5) {
180
180
  if (r5[t5]) return r5[t5];
181
- o4.has(t5) && T(`Circular extend chain detected: ${[...o4, t5].join(" \u2192 ")}`);
181
+ o4.has(t5) && C(`Circular extend chain detected: ${[...o4, t5].join(" \u2192 ")}`);
182
182
  const a4 = e4[t5];
183
- a4 || T(`Contract "${t5}" not found`), o4.add(t5);
183
+ a4 || C(`Contract "${t5}" not found`), o4.add(t5);
184
184
  let s6 = {};
185
185
  if (a4.extend) {
186
186
  s6 = (function(e5, t6) {
@@ -267,12 +267,12 @@ function Y(e4, t4, n5) {
267
267
  const i4 = r5[e5];
268
268
  if (null == o4 || "object" != typeof o4) {
269
269
  const o5 = r5.slice(0, e5).join(".");
270
- T(`Path "${t4}" not found in "${n5}": "${i4}" does not exist${o5 ? ` in "${o5}"` : ""}`);
270
+ C(`Path "${t4}" not found in "${n5}": "${i4}" does not exist${o5 ? ` in "${o5}"` : ""}`);
271
271
  }
272
272
  const a4 = o4;
273
273
  if (!(i4 in a4)) {
274
274
  const o5 = r5.slice(0, e5).join(".");
275
- T(`Path "${t4}" not found in "${n5}": "${i4}" does not exist${o5 ? ` in "${o5}"` : ""}`);
275
+ C(`Path "${t4}" not found in "${n5}": "${i4}" does not exist${o5 ? ` in "${o5}"` : ""}`);
276
276
  }
277
277
  o4 = a4[i4];
278
278
  }
@@ -283,10 +283,10 @@ function Q(e4, t4, n5, r5, o4, i4) {
283
283
  const a4 = e4.match(U);
284
284
  if (a4) {
285
285
  const e5 = a4[1].split("."), s7 = e5[0], c3 = e5.slice(1).join(".");
286
- void 0 === t4[s7] && T(`Variable "${s7}" not found`);
286
+ void 0 === t4[s7] && C(`Variable "${s7}" not found`);
287
287
  const u3 = i4 ?? /* @__PURE__ */ new Set();
288
288
  if (u3.has(s7)) {
289
- T(`Cyclic $var reference: ${[...u3, s7].join(" -> ")}`);
289
+ C(`Cyclic $var reference: ${[...u3, s7].join(" -> ")}`);
290
290
  }
291
291
  let f4;
292
292
  u3.add(s7);
@@ -300,18 +300,18 @@ function Q(e4, t4, n5, r5, o4, i4) {
300
300
  const s6 = e4.match(Z);
301
301
  if (s6 && r5) {
302
302
  const e5 = s6[1], t5 = s6[2];
303
- e5 in r5 || T(`Contract "${e5}" not found`);
303
+ e5 in r5 || C(`Contract "${e5}" not found`);
304
304
  let n6 = r5[e5];
305
305
  return t5 && (n6 = Y(n6, t5, `$contract.${e5}`)), n6;
306
306
  }
307
307
  const c2 = e4.match(B);
308
308
  if (c2) {
309
309
  const t5 = c2[1], r6 = c2[2], i5 = false === n5?.strictFlowRefs;
310
- o4 || T(`$flow.${t5}${r6 ? `.${r6}` : ""} cannot be resolved without a flow resolver`);
310
+ o4 || C(`$flow.${t5}${r6 ? `.${r6}` : ""} cannot be resolved without a flow resolver`);
311
311
  const a5 = o4(t5);
312
312
  if (!a5) {
313
313
  if (i5) return n5?.onWarning?.(X(t5, r6, "unknown-flow")), e4;
314
- T(`Flow "${t5}" not found in $flow.${t5}`);
314
+ C(`Flow "${t5}" not found in $flow.${t5}`);
315
315
  }
316
316
  let s7 = a5;
317
317
  if (r6) if (i5) {
@@ -328,14 +328,14 @@ function Q(e4, t4, n5, r5, o4, i4) {
328
328
  if (u2) {
329
329
  const e5 = u2[1];
330
330
  if (n5?.deferred) return `${G}${e5}`;
331
- T(`Secret "$secret.${e5}" cannot be used in a web flow \u2014 secrets are never sent to the browser. Use a server flow.`);
331
+ C(`Secret "$secret.${e5}" cannot be used in a web flow \u2014 secrets are never sent to the browser. Use a server flow.`);
332
332
  }
333
333
  let f3 = e4.replace(D, (e5, a5) => {
334
334
  const s7 = a5.split("."), c3 = s7[0], u3 = s7.slice(1).join(".");
335
- void 0 === t4[c3] && T(`Variable "${c3}" not found`);
335
+ void 0 === t4[c3] && C(`Variable "${c3}" not found`);
336
336
  const f4 = i4 ?? /* @__PURE__ */ new Set();
337
337
  if (f4.has(c3)) {
338
- T(`Cyclic $var reference: ${[...f4, c3].join(" -> ")}`);
338
+ C(`Cyclic $var reference: ${[...f4, c3].join(" -> ")}`);
339
339
  }
340
340
  let l3;
341
341
  f4.add(c3);
@@ -345,11 +345,11 @@ function Q(e4, t4, n5, r5, o4, i4) {
345
345
  f4.delete(c3);
346
346
  }
347
347
  if (u3 && (l3 = Y(l3, u3, `$var.${c3}`)), null === l3 || "string" != typeof l3 && "number" != typeof l3 && "boolean" != typeof l3) {
348
- T(`Variable "${a5}" resolves to non-scalar (${Array.isArray(l3) ? "array" : typeof l3}) and cannot be inlined into a string. Use it as a whole-string reference: "$var.${a5}"`);
348
+ C(`Variable "${a5}" resolves to non-scalar (${Array.isArray(l3) ? "array" : typeof l3}) and cannot be inlined into a string. Use it as a whole-string reference: "$var.${a5}"`);
349
349
  }
350
350
  return String(l3);
351
351
  });
352
- return f3 = f3.replace(F, (e5, t5, r6) => n5?.deferred ? void 0 !== r6 ? `${J}${t5}:${r6}` : `${J}${t5}` : "undefined" != typeof process && void 0 !== process.env?.[t5] ? process.env[t5] : void 0 !== r6 ? r6 : void T(`Environment variable "${t5}" not found and no default provided`)), f3;
352
+ return f3 = f3.replace(F, (e5, t5, r6) => n5?.deferred ? void 0 !== r6 ? `${J}${t5}:${r6}` : `${J}${t5}` : "undefined" != typeof process && void 0 !== process.env?.[t5] ? process.env[t5] : void 0 !== r6 ? r6 : void C(`Environment variable "${t5}" not found and no default provided`)), f3;
353
353
  }
354
354
  if (Array.isArray(e4)) return e4.map((e5) => Q(e5, t4, n5, r5, o4, i4));
355
355
  if (null !== e4 && "object" == typeof e4) {
@@ -369,7 +369,7 @@ function te(e4, t4, n5) {
369
369
  const s7 = e4.flows[t5];
370
370
  if (s7) {
371
371
  if (o4.has(t5)) {
372
- T(`Cyclic $flow reference: ${[...i4, t5].join(" -> ")}`);
372
+ C(`Cyclic $flow reference: ${[...i4, t5].join(" -> ")}`);
373
373
  }
374
374
  o4.add(t5), i4.push(t5);
375
375
  try {
@@ -380,9 +380,9 @@ function te(e4, t4, n5) {
380
380
  }
381
381
  }
382
382
  }, s6 = Object.keys(e4.flows);
383
- t4 || (1 === s6.length ? t4 = s6[0] : T(`Multiple flows found (${s6.join(", ")}). Please specify a flow.`));
383
+ t4 || (1 === s6.length ? t4 = s6[0] : C(`Multiple flows found (${s6.join(", ")}). Please specify a flow.`));
384
384
  const c2 = e4.flows[t4];
385
- c2 || T(`Flow "${t4}" not found. Available: ${s6.join(", ")}`), o4.add(t4), i4.push(t4);
385
+ c2 || C(`Flow "${t4}" not found. Available: ${s6.join(", ")}`), o4.add(t4), i4.push(t4);
386
386
  try {
387
387
  return (function(e5, t5, n6, r6) {
388
388
  const o5 = JSON.parse(JSON.stringify(t5));
@@ -424,7 +424,7 @@ function te(e4, t4, n5) {
424
424
  function ne(e4) {
425
425
  const t4 = e4.config?.platform;
426
426
  if ("web" === t4 || "server" === t4) return t4;
427
- T('Flow must have config.platform set to "web" or "server"');
427
+ C('Flow must have config.platform set to "web" or "server"');
428
428
  }
429
429
  function oe(e4, t4 = {}, n5 = {}) {
430
430
  n5 = { ...re, ...n5 };
@@ -553,27 +553,45 @@ function je(e4, t4 = {}, n5 = {}) {
553
553
  r5[t5] && (o4[t5] = true, e4 && e4[t5] && (i4 = true));
554
554
  }), !!i4 && o4;
555
555
  }
556
- function Oe() {
557
- let e4 = "";
558
- for (let t4 = 0; t4 < 16; t4++) e4 += (16 * Math.random() | 0).toString(16);
559
- return e4;
556
+ function Oe(e4 = 6, t4 = "0123456789abcdefghijklmnopqrstuvwxyz") {
557
+ const n5 = t4.length;
558
+ if (e4 <= 0 || 0 === n5) return "";
559
+ let r5 = "";
560
+ if (n5 <= 256) {
561
+ const o4 = 256 - 256 % n5;
562
+ for (; r5.length < e4; ) {
563
+ const i4 = e4 - r5.length, a4 = new Uint8Array(Math.ceil(1.3 * i4) + 4);
564
+ if (!Se(a4)) break;
565
+ for (let i5 = 0; i5 < a4.length && r5.length < e4; i5++) a4[i5] < o4 && (r5 += t4[a4[i5] % n5]);
566
+ }
567
+ }
568
+ for (; r5.length < e4; ) r5 += t4[Math.random() * n5 | 0];
569
+ return r5;
560
570
  }
561
- function Ee(e4 = 6, t4) {
562
- if (t4) {
563
- const n6 = t4.length;
564
- let r5 = "";
565
- for (let o4 = 0; o4 < e4; o4++) r5 += t4[Math.random() * n6 | 0];
566
- return r5;
571
+ function Se(e4) {
572
+ try {
573
+ const t4 = globalThis.crypto;
574
+ if (t4 && "function" == typeof t4.getRandomValues) return t4.getRandomValues(e4), true;
575
+ } catch {
567
576
  }
568
- let n5 = "";
569
- for (let t5 = 36; n5.length < e4; ) n5 += (Math.random() * t5 | 0).toString(t5);
570
- return n5;
577
+ return false;
578
+ }
579
+ function Ee(e4) {
580
+ let t4 = Oe(e4, _e);
581
+ for (; /^0+$/.test(t4); ) t4 = Oe(e4, _e);
582
+ return t4;
583
+ }
584
+ function Ne() {
585
+ return Ee(16);
586
+ }
587
+ function Ie() {
588
+ return Ee(32);
571
589
  }
572
- function Te(e4, t4) {
590
+ function Me(e4, t4) {
573
591
  return "number" == typeof e4 ? { wait: e4 } : e4 ? { wait: e4.wait ?? t4, size: e4.size, age: e4.age } : { wait: t4 };
574
592
  }
575
- function Ie(e4, t4 = 1e3, n5 = false) {
576
- const { wait: r5, size: o4, age: i4 } = Te(t4, 1e3);
593
+ function Re(e4, t4 = 1e3, n5 = false) {
594
+ const { wait: r5, size: o4, age: i4 } = Me(t4, 1e3);
577
595
  let a4, s6, c2 = null, u2 = null, f3 = false, l3 = [], p3 = 0;
578
596
  const d2 = () => {
579
597
  c2 && (clearTimeout(c2), c2 = null), u2 && (clearTimeout(u2), u2 = null), p3 = 0, s6 = void 0;
@@ -601,39 +619,39 @@ function Ie(e4, t4 = 1e3, n5 = false) {
601
619
  l3 = [], d2(), a4 = void 0, e5.forEach((e6) => e6(void 0));
602
620
  }, g3.size = () => p3, g3;
603
621
  }
604
- function Pe(e4) {
622
+ function De(e4) {
605
623
  return { message: e4.message, name: e4.name, stack: e4.stack, cause: e4.cause };
606
624
  }
607
- function Me(e4, t4) {
625
+ function Fe(e4, t4) {
608
626
  let n5, r5 = {};
609
- return e4 instanceof Error ? (n5 = e4.message, r5.error = Pe(e4)) : n5 = e4, void 0 !== t4 && (t4 instanceof Error ? r5.error = Pe(t4) : "object" == typeof t4 && null !== t4 ? (r5 = { ...r5, ...t4 }, "error" in r5 && r5.error instanceof Error && (r5.error = Pe(r5.error))) : r5.value = t4), { message: n5, context: r5 };
627
+ return e4 instanceof Error ? (n5 = e4.message, r5.error = De(e4)) : n5 = e4, void 0 !== t4 && (t4 instanceof Error ? r5.error = De(t4) : "object" == typeof t4 && null !== t4 ? (r5 = { ...r5, ...t4 }, "error" in r5 && r5.error instanceof Error && (r5.error = De(r5.error))) : r5.value = t4), { message: n5, context: r5 };
610
628
  }
611
- function Ue(e4 = {}) {
612
- return De({ level: void 0 !== e4.level ? (function(e5) {
629
+ function Be(e4 = {}) {
630
+ return We({ level: void 0 !== e4.level ? (function(e5) {
613
631
  return "string" == typeof e5 ? l[e5] : e5;
614
632
  })(e4.level) : 0, handler: e4.handler, jsonHandler: e4.jsonHandler, scope: [] });
615
633
  }
616
- function De(e4) {
634
+ function We(e4) {
617
635
  const { level: t4, handler: n5, jsonHandler: r5, scope: o4 } = e4, i4 = (e5, r6, i5) => {
618
636
  if (e5 <= t4) {
619
- const t5 = Me(r6, i5);
620
- n5 ? n5(e5, t5.message, t5.context, o4, Re) : Re(e5, t5.message, t5.context, o4);
637
+ const t5 = Fe(r6, i5);
638
+ n5 ? n5(e5, t5.message, t5.context, o4, Ze) : Ze(e5, t5.message, t5.context, o4);
621
639
  }
622
640
  };
623
641
  return { error: (e5, t5) => i4(0, e5, t5), warn: (e5, t5) => i4(1, e5, t5), info: (e5, t5) => i4(2, e5, t5), debug: (e5, t5) => i4(3, e5, t5), throw: (e5, t5) => {
624
- const r6 = Me(e5, t5);
625
- throw n5 ? n5(0, r6.message, r6.context, o4, Re) : Re(0, r6.message, r6.context, o4), new Error(r6.message);
642
+ const r6 = Fe(e5, t5);
643
+ throw n5 ? n5(0, r6.message, r6.context, o4, Ze) : Ze(0, r6.message, r6.context, o4), new Error(r6.message);
626
644
  }, json: (e5) => {
627
645
  r5 ? r5(e5) : console.log(JSON.stringify(e5, null, 2));
628
- }, scope: (e5) => De({ level: t4, handler: n5, jsonHandler: r5, scope: [...o4, e5] }) };
646
+ }, scope: (e5) => We({ level: t4, handler: n5, jsonHandler: r5, scope: [...o4, e5] }) };
629
647
  }
630
- function Fe(e4) {
631
- return se(e4) || ge(e4) || pe(e4) || !ue(e4) || ae(e4) && e4.every(Fe) || de(e4) && Object.values(e4).every(Fe);
648
+ function Le(e4) {
649
+ return se(e4) || ge(e4) || pe(e4) || !ue(e4) || ae(e4) && e4.every(Le) || de(e4) && Object.values(e4).every(Le);
632
650
  }
633
- function Be(e4) {
634
- return Fe(e4) ? e4 : void 0;
651
+ function Ve(e4) {
652
+ return Le(e4) ? e4 : void 0;
635
653
  }
636
- function We(e4, t4, n5) {
654
+ function Ke(e4, t4, n5) {
637
655
  return function(...r5) {
638
656
  try {
639
657
  return e4(...r5);
@@ -645,7 +663,7 @@ function We(e4, t4, n5) {
645
663
  }
646
664
  };
647
665
  }
648
- function Le(e4, t4, n5) {
666
+ function qe(e4, t4, n5) {
649
667
  return async function(...r5) {
650
668
  try {
651
669
  return await e4(...r5);
@@ -657,7 +675,7 @@ function Le(e4, t4, n5) {
657
675
  }
658
676
  };
659
677
  }
660
- async function Ke(e4, t4, n5) {
678
+ async function Ge(e4, t4, n5) {
661
679
  const [r5, o4] = (e4.name || "").split(" ");
662
680
  if (!t4 || !r5 || !o4) return {};
663
681
  let i4, a4 = "", s6 = r5, c2 = o4;
@@ -674,66 +692,66 @@ async function Ke(e4, t4, n5) {
674
692
  const f3 = t4[s6];
675
693
  return f3 && (f3[c2] || (c2 = "*"), i4 = u2(f3[c2])), i4 || (s6 = "*", c2 = "*", i4 = u2(t4[s6]?.[c2])), i4 && (a4 = `${s6} ${c2}`), { eventMapping: i4, mappingKey: a4 };
676
694
  }
677
- async function Ve(e4, t4 = {}, n5 = {}) {
695
+ async function Xe(e4, t4 = {}, n5 = {}) {
678
696
  if (!ue(e4)) return;
679
697
  const r5 = de(e4) && e4.consent || n5.consent || n5.collector?.consent, o4 = n5.event ?? (de(e4) ? e4 : {});
680
698
  if (!n5.collector) throw new Error("getMappingValue: context.collector is required");
681
699
  const i4 = { event: o4, mapping: t4, collector: n5.collector, logger: n5.collector.logger, consent: r5 }, a4 = ae(t4) ? t4 : [t4];
682
700
  for (const t5 of a4) {
683
- const r6 = await Le(qe, (e5) => {
684
- if (e5 instanceof He) throw e5;
701
+ const r6 = await qe(Ye, (e5) => {
702
+ if (e5 instanceof Je) throw e5;
685
703
  n5.collector && n5.collector.status.failed++, i4.logger.error("mapping processing failed", { event: o4, error: e5 });
686
704
  })(e4, t5, { ...i4, mapping: t5 });
687
705
  if (ue(r6)) return r6;
688
706
  }
689
707
  }
690
- async function qe(e4, t4, n5) {
708
+ async function Ye(e4, t4, n5) {
691
709
  return (ae(t4) ? t4 : [t4]).reduce(async (t5, r5) => {
692
710
  const o4 = await t5;
693
711
  if (o4) return o4;
694
712
  const i4 = ge(r5) ? { key: r5 } : r5;
695
713
  if (!Object.keys(i4).length) return;
696
714
  const { condition: a4, consent: s6, fn: c2, key: u2, loop: f3, map: l3, set: p3, validate: d2, value: m3 } = i4, g3 = { ...n5, mapping: r5 };
697
- if (a4 && !await Le(a4, (e5) => {
698
- if (e5 instanceof He) throw e5;
715
+ if (a4 && !await qe(a4, (e5) => {
716
+ if (e5 instanceof Je) throw e5;
699
717
  return g3.logger.error("mapping condition failed", { event: g3.event, error: e5 }), false;
700
718
  })(e4, g3)) return;
701
719
  if (s6 && !je(s6, g3.consent)) return m3;
702
720
  let y2 = ue(m3) ? m3 : e4;
703
- if (c2 && (y2 = await Le(c2, (e5) => {
704
- if (e5 instanceof He) throw e5;
721
+ if (c2 && (y2 = await qe(c2, (e5) => {
722
+ if (e5 instanceof Je) throw e5;
705
723
  g3.logger.error("mapping fn failed", { event: g3.event, error: e5 });
706
724
  })(e4, g3)), u2 && (y2 = he(e4, u2, m3)), f3) {
707
- const [t6, n6] = f3, r6 = "this" === t6 ? [e4] : await Ve(e4, t6, g3);
708
- ae(r6) && (y2 = (await Promise.all(r6.map((e5) => Ve(e5, n6, g3)))).filter(ue));
725
+ const [t6, n6] = f3, r6 = "this" === t6 ? [e4] : await Xe(e4, t6, g3);
726
+ ae(r6) && (y2 = (await Promise.all(r6.map((e5) => Xe(e5, n6, g3)))).filter(ue));
709
727
  } else l3 ? y2 = await Object.entries(l3).reduce(async (t6, [n6, r6]) => {
710
- const o5 = await t6, i5 = await Ve(e4, r6, g3);
728
+ const o5 = await t6, i5 = await Xe(e4, r6, g3);
711
729
  return ue(i5) && (o5[n6] = i5), o5;
712
- }, Promise.resolve({})) : p3 && (y2 = await Promise.all(p3.map((t6) => qe(e4, t6, g3))));
713
- d2 && !await Le(d2, (e5) => {
714
- if (e5 instanceof He) throw e5;
730
+ }, Promise.resolve({})) : p3 && (y2 = await Promise.all(p3.map((t6) => Ye(e4, t6, g3))));
731
+ d2 && !await qe(d2, (e5) => {
732
+ if (e5 instanceof Je) throw e5;
715
733
  return g3.logger.error("mapping validate failed", { event: g3.event, error: e5 }), false;
716
734
  })(y2, g3) && (y2 = void 0);
717
- const h3 = Be(y2);
718
- return ue(h3) ? h3 : Be(m3);
735
+ const h3 = Ve(y2);
736
+ return ue(h3) ? h3 : Ve(m3);
719
737
  }, Promise.resolve(void 0));
720
738
  }
721
- async function Je(e4, t4, n5) {
739
+ async function Qe(e4, t4, n5) {
722
740
  t4.policy && await Promise.all(Object.entries(t4.policy).map(async ([t5, r6]) => {
723
- const o5 = await Ve(e4, r6, { collector: n5, event: e4 });
741
+ const o5 = await Xe(e4, r6, { collector: n5, event: e4 });
724
742
  e4 = ve(e4, t5, o5);
725
743
  }));
726
- const { eventMapping: r5, mappingKey: o4 } = await Ke(e4, t4.mapping, n5);
744
+ const { eventMapping: r5, mappingKey: o4 } = await Ge(e4, t4.mapping, n5);
727
745
  r5?.policy && await Promise.all(Object.entries(r5.policy).map(async ([t5, r6]) => {
728
- const o5 = await Ve(e4, r6, { collector: n5, event: e4 });
746
+ const o5 = await Xe(e4, r6, { collector: n5, event: e4 });
729
747
  e4 = ve(e4, t5, o5);
730
748
  }));
731
- let i4 = t4.data && await Ve(e4, t4.data, { collector: n5, event: e4 });
749
+ let i4 = t4.data && await Xe(e4, t4.data, { collector: n5, event: e4 });
732
750
  const a4 = Boolean(r5?.silent);
733
751
  if (r5) {
734
752
  if (r5.ignore) return { event: e4, data: i4, mapping: r5, mappingKey: o4, ignore: true, silent: a4 };
735
753
  if (r5.name && (e4.name = r5.name), r5.data) {
736
- const t5 = r5.data && await Ve(e4, r5.data, { collector: n5, event: e4 });
754
+ const t5 = r5.data && await Xe(e4, r5.data, { collector: n5, event: e4 });
737
755
  i4 = de(i4) && de(t5) ? oe(i4, t5) : t5;
738
756
  }
739
757
  }
@@ -745,13 +763,13 @@ async function Je(e4, t4, n5) {
745
763
  if (r5?.remove && de(i4)) for (const e5 of r5.remove) i4 = be(i4, e5);
746
764
  return { event: e4, data: i4, mapping: r5, mappingKey: o4, ignore: false, silent: a4 };
747
765
  }
748
- function ot(e4) {
766
+ function ct(e4) {
749
767
  return void 0 === e4 || me(e4, "") ? e4 : JSON.stringify(e4);
750
768
  }
751
- function it(e4 = {}) {
769
+ function ut(e4 = {}) {
752
770
  return oe({ "Content-Type": "application/json; charset=utf-8" }, e4);
753
771
  }
754
- function ct(e4, t4, n5, r5) {
772
+ function pt(e4, t4, n5, r5) {
755
773
  const o4 = e4;
756
774
  return function(...e5) {
757
775
  let i4;
@@ -772,7 +790,7 @@ function ct(e4, t4, n5, r5) {
772
790
  return i4;
773
791
  };
774
792
  }
775
- function ut(e4, t4) {
793
+ function dt(e4, t4) {
776
794
  if (t4 >= 1) return true;
777
795
  if (t4 <= 0) return false;
778
796
  return (function(e5) {
@@ -781,7 +799,7 @@ function ut(e4, t4) {
781
799
  return t5 >>> 0;
782
800
  })(e4) / 4294967295 < t4;
783
801
  }
784
- function ft(e4, t4) {
802
+ function mt(e4, t4) {
785
803
  const n5 = "function" == typeof t4 ? t4 : () => t4;
786
804
  return function(t5) {
787
805
  const r5 = n5();
@@ -789,7 +807,7 @@ function ft(e4, t4) {
789
807
  const o4 = r5.level ?? "standard";
790
808
  if ("off" === o4) return;
791
809
  const i4 = r5.sample, a4 = "number" == typeof i4 && Number.isFinite(i4) ? i4 : 1;
792
- if (t5.eventId && !ut(t5.eventId, a4)) return;
810
+ if (t5.eventId && !dt(t5.eventId, a4)) return;
793
811
  const s6 = r5.includeIn ?? "trace" === o4, c2 = r5.includeOut ?? "trace" === o4, u2 = r5.includeMappingKey ?? "trace" === o4, f3 = { ...t5 };
794
812
  s6 || delete f3.inEvent, c2 || delete f3.outEvent, u2 || delete f3.mappingKey, "trace" !== o4 && f3.error?.message && f3.error.message.length > 256 && (f3.error = { ...f3.error, message: f3.error.message.slice(0, 256) + "\u2026" });
795
813
  try {
@@ -798,7 +816,7 @@ function ft(e4, t4) {
798
816
  }
799
817
  };
800
818
  }
801
- function pt(e4) {
819
+ function yt(e4) {
802
820
  const t4 = e4.now ?? (() => Date.now()), { traceUntil: n5 } = e4;
803
821
  if ("string" == typeof n5 && n5.length > 0) {
804
822
  const r6 = Date.parse(n5);
@@ -809,13 +827,13 @@ function pt(e4) {
809
827
  const o4 = e4.observe?.sample ?? 1;
810
828
  return { flowId: e4.flowId, level: r5, sample: o4 };
811
829
  }
812
- function mt() {
813
- return dt;
830
+ function vt() {
831
+ return ht;
814
832
  }
815
- function gt(e4) {
816
- dt = e4;
833
+ function bt(e4) {
834
+ ht = e4;
817
835
  }
818
- function yt(e4, t4) {
836
+ function wt(e4, t4) {
819
837
  if (0 === e4.observers.size) return;
820
838
  const n5 = Array.from(e4.observers);
821
839
  for (const e5 of n5) try {
@@ -823,7 +841,7 @@ function yt(e4, t4) {
823
841
  } catch {
824
842
  }
825
843
  }
826
- function ht(e4) {
844
+ function kt(e4) {
827
845
  const t4 = e4.batchMs, n5 = "number" == typeof t4 && Number.isFinite(t4) && t4 > 0 ? Math.floor(t4) : 50, r5 = e4.batchSize, o4 = "number" == typeof r5 && Number.isFinite(r5) && r5 >= 1 ? Math.floor(r5) : 50, i4 = e4.fetch ?? ((e5, t5) => globalThis.fetch(e5, t5)), a4 = e4.onError ?? (() => {
828
846
  });
829
847
  let s6 = [], c2 = null;
@@ -840,10 +858,10 @@ function ht(e4) {
840
858
  s6.push(e5), s6.length >= o4 ? u2() : null === c2 && (c2 = setTimeout(u2, n5));
841
859
  };
842
860
  }
843
- function _t(e4) {
861
+ function Ct(e4) {
844
862
  return "string" == typeof e4 || Array.isArray(e4) && e4.every((e5) => "string" == typeof e5) ? e4 : void 0;
845
863
  }
846
- async function Et(e4, t4) {
864
+ async function It(e4, t4) {
847
865
  const n5 = t4?.version || "latest", r5 = t4?.timeout || 1e4, o4 = new AbortController(), i4 = setTimeout(() => o4.abort(), r5), a4 = o4.signal, s6 = t4?.client ? { "X-Walkeros-Client": t4.client } : void 0;
848
866
  try {
849
867
  if (t4?.baseUrl) {
@@ -854,7 +872,7 @@ async function Et(e4, t4) {
854
872
  return { packageName: n6.package || e5, version: "string" == typeof n6.version ? n6.version : t5, ...void 0 !== n6.description && { description: n6.description }, ...void 0 !== n6.type && { type: n6.type }, ...void 0 !== c2 && { platform: c2 }, schemas: r8, examples: o7, ...void 0 !== n6.docs && { docs: n6.docs }, ...void 0 !== n6.source && { source: n6.source }, ...i5 && Object.keys(i5).length > 0 ? { hints: i5 } : {}, hintKeys: a5, exampleSummaries: s7 };
855
873
  })(e4, n5, await o6.json());
856
874
  }
857
- const r6 = `https://cdn.jsdelivr.net/npm/${e4}@${n5}`, o5 = await Nt(`${r6}/package.json`, a4, s6);
875
+ const r6 = `https://cdn.jsdelivr.net/npm/${e4}@${n5}`, o5 = await zt(`${r6}/package.json`, a4, s6);
858
876
  return (function(e5, t5, n6, r7) {
859
877
  const o6 = r7.$meta || {}, i5 = r7.schemas || {}, a5 = r7.examples || {}, s7 = r7.hints, c2 = s7 ? Object.keys(s7) : [], u2 = [], f3 = a5.step || {};
860
878
  for (const [e6, t6] of Object.entries(f3)) {
@@ -862,29 +880,29 @@ async function Et(e4, t4) {
862
880
  "string" == typeof n7?.description && (r8.description = n7.description), u2.push(r8);
863
881
  }
864
882
  const l3 = "string" == typeof o6.docs ? o6.docs : void 0, p3 = "string" == typeof o6.source ? o6.source : void 0;
865
- return { packageName: e5, version: "string" == typeof n6.version ? n6.version : t5, description: "string" == typeof n6.description ? n6.description : void 0, type: "string" == typeof o6.type ? o6.type : void 0, platform: _t(o6.platform), schemas: i5, examples: a5, ...l3 ? { docs: l3 } : {}, ...p3 ? { source: p3 } : {}, ...s7 && Object.keys(s7).length > 0 ? { hints: s7 } : {}, hintKeys: c2, exampleSummaries: u2 };
866
- })(e4, n5, o5, await Nt(`${r6}/dist/walkerOS.json`, a4, s6));
883
+ return { packageName: e5, version: "string" == typeof n6.version ? n6.version : t5, description: "string" == typeof n6.description ? n6.description : void 0, type: "string" == typeof o6.type ? o6.type : void 0, platform: Ct(o6.platform), schemas: i5, examples: a5, ...l3 ? { docs: l3 } : {}, ...p3 ? { source: p3 } : {}, ...s7 && Object.keys(s7).length > 0 ? { hints: s7 } : {}, hintKeys: c2, exampleSummaries: u2 };
884
+ })(e4, n5, o5, await zt(`${r6}/dist/walkerOS.json`, a4, s6));
867
885
  } finally {
868
886
  clearTimeout(i4);
869
887
  }
870
888
  }
871
- async function Nt(e4, t4, n5) {
889
+ async function zt(e4, t4, n5) {
872
890
  const r5 = await fetch(e4, { signal: t4, ...n5 && { headers: n5 } });
873
891
  if (!r5.ok) throw new Error(`Failed to fetch ${e4} (HTTP ${r5.status})`);
874
892
  return await r5.json();
875
893
  }
876
- async function Ct(e4, t4) {
877
- const n5 = await Et(e4, t4);
894
+ async function Pt(e4, t4) {
895
+ const n5 = await It(e4, t4);
878
896
  return { packageName: n5.packageName, version: n5.version, type: n5.type, platform: n5.platform, schemas: n5.schemas, examples: n5.examples, ...n5.hints ? { hints: n5.hints } : {} };
879
897
  }
880
- function Pt(e4) {
898
+ function Dt(e4) {
881
899
  if (void 0 === e4 || "*" === e4) return () => true;
882
900
  if ("and" in e4) {
883
- const t4 = e4.and.map(Pt);
901
+ const t4 = e4.and.map(Dt);
884
902
  return (e5) => t4.every((t5) => t5(e5));
885
903
  }
886
904
  if ("or" in e4) {
887
- const t4 = e4.or.map(Pt);
905
+ const t4 = e4.or.map(Dt);
888
906
  return (e5) => t4.some((t5) => t5(e5));
889
907
  }
890
908
  return (function(e5) {
@@ -920,70 +938,70 @@ function Pt(e4) {
920
938
  };
921
939
  })(e4);
922
940
  }
923
- function Mt(e4) {
941
+ function Ft(e4) {
924
942
  return "object" == typeof e4 && null !== e4 && !Array.isArray(e4) && ("match" in e4 || "next" in e4 || "one" in e4 || "many" in e4);
925
943
  }
926
- function Rt(e4) {
927
- return Array.isArray(e4) && e4.length > 0 && e4.every((e5) => Mt(e5));
944
+ function Zt(e4) {
945
+ return Array.isArray(e4) && e4.length > 0 && e4.every((e5) => Ft(e5));
928
946
  }
929
- function Ut(e4) {
947
+ function Bt(e4) {
930
948
  return e4.map((e5) => {
931
949
  if ("string" == typeof e5) return { match: () => true, next: { type: "static", value: e5 } };
932
- if (Array.isArray(e5)) return { match: () => true, next: Dt(e5) ?? { type: "chain", value: [] } };
950
+ if (Array.isArray(e5)) return { match: () => true, next: Wt(e5) ?? { type: "chain", value: [] } };
933
951
  const t4 = e5;
934
- return { match: t4.match ? Pt(t4.match) : () => true, next: Dt(t4) ?? { type: "chain", value: [] } };
952
+ return { match: t4.match ? Dt(t4.match) : () => true, next: Wt(t4) ?? { type: "chain", value: [] } };
935
953
  });
936
954
  }
937
- function Dt(e4) {
955
+ function Wt(e4) {
938
956
  if (null == e4) return;
939
957
  if ("string" == typeof e4) return { type: "static", value: e4 };
940
958
  if (Array.isArray(e4)) {
941
959
  if (0 === e4.length) return;
942
- if (Rt(e4)) return Dt({ one: e4 });
960
+ if (Zt(e4)) return Wt({ one: e4 });
943
961
  if (e4.every((e5) => "string" == typeof e5)) return { type: "chain", value: e4 };
944
962
  const t5 = [];
945
963
  for (const n5 of e4) {
946
- const e5 = Dt(n5);
964
+ const e5 = Wt(n5);
947
965
  void 0 !== e5 && t5.push(e5);
948
966
  }
949
967
  if (0 === t5.length) return;
950
968
  return { type: "sequence", value: t5 };
951
969
  }
952
970
  const t4 = e4;
953
- if ("next" in t4 && void 0 !== t4.next) return t4.match ? { type: "gate", match: Pt(t4.match), next: Dt(t4.next) } : Dt(t4.next);
971
+ if ("next" in t4 && void 0 !== t4.next) return t4.match ? { type: "gate", match: Dt(t4.match), next: Wt(t4.next) } : Wt(t4.next);
954
972
  if ("one" in t4 && t4.one) {
955
- const e5 = Ut(t4.one);
956
- return t4.match ? { type: "gate", match: Pt(t4.match), next: { type: "one", routes: e5 } } : { type: "one", routes: e5 };
973
+ const e5 = Bt(t4.one);
974
+ return t4.match ? { type: "gate", match: Dt(t4.match), next: { type: "one", routes: e5 } } : { type: "one", routes: e5 };
957
975
  }
958
976
  if ("many" in t4 && t4.many) {
959
- const e5 = Ut(t4.many);
960
- return t4.match ? { type: "gate", match: Pt(t4.match), next: { type: "many", routes: e5 } } : { type: "many", routes: e5 };
977
+ const e5 = Bt(t4.many);
978
+ return t4.match ? { type: "gate", match: Dt(t4.match), next: { type: "many", routes: e5 } } : { type: "many", routes: e5 };
961
979
  }
962
- return t4.match ? { type: "gate", match: Pt(t4.match) } : void 0;
980
+ return t4.match ? { type: "gate", match: Dt(t4.match) } : void 0;
963
981
  }
964
- function Zt(e4, t4 = {}) {
982
+ function Ht(e4, t4 = {}) {
965
983
  if (null == e4) return [];
966
984
  let n5;
967
985
  if ("object" == typeof e4) {
968
- const t5 = Ft.get(e4);
969
- t5 ? n5 = t5 : (n5 = Dt(e4), n5 && Ft.set(e4, n5));
970
- } else n5 = Dt(e4);
986
+ const t5 = Lt.get(e4);
987
+ t5 ? n5 = t5 : (n5 = Wt(e4), n5 && Lt.set(e4, n5));
988
+ } else n5 = Wt(e4);
971
989
  if (!n5) return [];
972
- const r5 = Bt(n5, t4);
990
+ const r5 = Vt(n5, t4);
973
991
  return void 0 === r5 ? [] : Array.isArray(r5) ? r5 : [r5];
974
992
  }
975
- function Bt(e4, t4 = {}) {
993
+ function Vt(e4, t4 = {}) {
976
994
  if (e4) {
977
995
  if ("static" === e4.type) return e4.value;
978
996
  if ("chain" === e4.type) return e4.value;
979
997
  if ("gate" === e4.type) {
980
998
  if (!e4.match(t4)) return;
981
- return Bt(e4.next, t4);
999
+ return Vt(e4.next, t4);
982
1000
  }
983
1001
  if ("sequence" === e4.type) {
984
1002
  const n5 = [];
985
1003
  for (const r5 of e4.value) {
986
- const e5 = Bt(r5, t4);
1004
+ const e5 = Vt(r5, t4);
987
1005
  void 0 !== e5 && (Array.isArray(e5) ? n5.push(...e5) : n5.push(e5));
988
1006
  }
989
1007
  return n5.length > 0 ? n5 : void 0;
@@ -992,44 +1010,44 @@ function Bt(e4, t4 = {}) {
992
1010
  const n5 = [];
993
1011
  for (const r5 of e4.routes) {
994
1012
  if (!r5.match(t4)) continue;
995
- const e5 = Bt(r5.next, t4);
1013
+ const e5 = Vt(r5.next, t4);
996
1014
  void 0 !== e5 && (Array.isArray(e5) ? n5.push(...e5) : n5.push(e5));
997
1015
  }
998
1016
  return n5.length > 0 ? n5 : void 0;
999
1017
  }
1000
- for (const n5 of e4.routes) if (n5.match(t4)) return Bt(n5.next, t4);
1018
+ for (const n5 of e4.routes) if (n5.match(t4)) return Vt(n5.next, t4);
1001
1019
  }
1002
1020
  }
1003
- function Ht(e4, t4, n5 = Date.now) {
1004
- const r5 = { [Wt]: e4 };
1005
- return void 0 !== t4 && (r5[Lt] = n5() + t4), r5;
1021
+ function Jt(e4, t4, n5 = Date.now) {
1022
+ const r5 = { [Kt]: e4 };
1023
+ return void 0 !== t4 && (r5[qt] = n5() + t4), r5;
1006
1024
  }
1007
- function Kt(e4, t4 = Date.now) {
1025
+ function Gt(e4, t4 = Date.now) {
1008
1026
  if (void 0 === e4) return;
1009
- if (null === (n5 = e4) || "object" != typeof n5 || Array.isArray(n5) || !(Wt in e4)) return { value: e4 };
1027
+ if (null === (n5 = e4) || "object" != typeof n5 || Array.isArray(n5) || !(Kt in e4)) return { value: e4 };
1010
1028
  var n5;
1011
- const r5 = e4[Lt];
1012
- return "number" == typeof r5 && t4() > r5 ? { expired: true } : { value: e4[Wt] };
1029
+ const r5 = e4[qt];
1030
+ return "number" == typeof r5 && t4() > r5 ? { expired: true } : { value: e4[Kt] };
1013
1031
  }
1014
- function Jt(e4) {
1032
+ function Qt(e4) {
1015
1033
  return null !== e4 && "object" == typeof e4 && !Array.isArray(e4);
1016
1034
  }
1017
- function Qt(e4) {
1018
- return null === e4 || "string" == typeof e4 || "number" == typeof e4 || "boolean" == typeof e4 || e4 instanceof Uint8Array || (Array.isArray(e4) ? e4.every((e5) => void 0 === e5 || Qt(e5)) : !!Jt(e4) && Object.values(e4).every((e5) => void 0 === e5 || Qt(e5)));
1035
+ function rn(e4) {
1036
+ return null === e4 || "string" == typeof e4 || "number" == typeof e4 || "boolean" == typeof e4 || e4 instanceof Uint8Array || (Array.isArray(e4) ? e4.every((e5) => void 0 === e5 || rn(e5)) : !!Qt(e4) && Object.values(e4).every((e5) => void 0 === e5 || rn(e5)));
1019
1037
  }
1020
- function nn(e4, t4) {
1038
+ function sn(e4, t4) {
1021
1039
  const n5 = { ingest: e4 ?? {} };
1022
1040
  return void 0 !== t4 && (n5.event = t4), n5;
1023
1041
  }
1024
- function rn(e4) {
1025
- return { stop: e4.stop ?? false, storeId: e4.store, namespace: e4.namespace, rules: e4.rules.map((e5) => ({ match: e5.match ? Pt(e5.match) : () => true, key: e5.key, ttl: e5.ttl, update: e5.update })) };
1042
+ function cn(e4) {
1043
+ return { stop: e4.stop ?? false, storeId: e4.store, namespace: e4.namespace, rules: e4.rules.map((e5) => ({ match: e5.match ? Dt(e5.match) : () => true, key: e5.key, ttl: e5.ttl, update: e5.update })) };
1026
1044
  }
1027
- async function on(e4, t4, n5, r5) {
1045
+ async function un(e4, t4, n5, r5) {
1028
1046
  const o4 = e4.rules.find((e5) => e5.match(n5));
1029
1047
  if (!o4) return null;
1030
1048
  const i4 = o4.key.map((e5) => String(he(n5, e5) ?? ""));
1031
1049
  if (i4.every((e5) => "" === e5)) return null;
1032
- const a4 = i4.join(":"), s6 = r5 ?? e4.namespace, c2 = s6 ? `${s6}:${a4}` : a4, u2 = Kt(await t4.get(c2));
1050
+ const a4 = i4.join(":"), s6 = r5 ?? e4.namespace, c2 = s6 ? `${s6}:${a4}` : a4, u2 = Gt(await t4.get(c2));
1033
1051
  if (void 0 === u2) return { status: "MISS", key: c2, rule: o4 };
1034
1052
  if ("expired" in u2) {
1035
1053
  try {
@@ -1040,33 +1058,33 @@ async function on(e4, t4, n5, r5) {
1040
1058
  }
1041
1059
  return { status: "HIT", key: c2, value: u2.value, rule: o4 };
1042
1060
  }
1043
- function an(e4, t4, n5, r5) {
1044
- if (!Qt(n5)) return;
1045
- const o4 = 1e3 * r5, i4 = e4.set(t4, Ht(n5, o4), o4);
1061
+ function fn(e4, t4, n5, r5) {
1062
+ if (!rn(n5)) return;
1063
+ const o4 = 1e3 * r5, i4 = e4.set(t4, Jt(n5, o4), o4);
1046
1064
  i4 instanceof Promise && i4.catch(() => {
1047
1065
  });
1048
1066
  }
1049
- async function sn(e4, t4, n5, r5) {
1067
+ async function ln(e4, t4, n5, r5) {
1050
1068
  if (!t4) return e4;
1051
1069
  let o4 = e4;
1052
1070
  for (const [e5, i4] of Object.entries(t4)) {
1053
- o4 = ve(o4, e5, await Ve(n5, i4, { collector: r5 }));
1071
+ o4 = ve(o4, e5, await Xe(n5, i4, { collector: r5 }));
1054
1072
  }
1055
1073
  return o4;
1056
1074
  }
1057
- function cn(e4) {
1075
+ function pn(e4) {
1058
1076
  return ae(e4) ? e4 : [e4];
1059
1077
  }
1060
- async function un(e4, t4, n5, r5) {
1078
+ async function dn(e4, t4, n5, r5) {
1061
1079
  let o4 = n5;
1062
- for (const n6 of e4) await Le(async () => {
1080
+ for (const n6 of e4) await qe(async () => {
1063
1081
  const e5 = t4(n6.store);
1064
1082
  if (!e5) return;
1065
- const i4 = await Ve(o4, n6.key, { collector: r5, event: o4 });
1083
+ const i4 = await Xe(o4, n6.key, { collector: r5, event: o4 });
1066
1084
  if (!ge(i4)) return;
1067
1085
  const a4 = n6.store ? i4 : `state:${i4}`;
1068
1086
  if ("set" === n6.mode) {
1069
- const t5 = await Ve(o4, n6.value, { collector: r5, event: o4 });
1087
+ const t5 = await Xe(o4, n6.value, { collector: r5, event: o4 });
1070
1088
  if (!ue(t5)) return;
1071
1089
  await e5.set(a4, t5);
1072
1090
  } else {
@@ -1078,23 +1096,23 @@ async function un(e4, t4, n5, r5) {
1078
1096
  }
1079
1097
  var s6;
1080
1098
  }, (e5) => {
1081
- if (e5 instanceof He) throw e5;
1099
+ if (e5 instanceof Je) throw e5;
1082
1100
  r5.logger?.error?.("[state] operation failed", e5);
1083
1101
  })();
1084
1102
  return o4;
1085
1103
  }
1086
- function mn(e4, t4) {
1104
+ function vn(e4, t4) {
1087
1105
  const n5 = (function(e5) {
1088
- return /* @__PURE__ */ new Set([...fn[e5], ...ln, ...pn[e5]]);
1106
+ return /* @__PURE__ */ new Set([...mn[e5], ...gn, ...yn[e5]]);
1089
1107
  })(t4);
1090
1108
  for (const r6 of Object.keys(e4)) if (!n5.has(r6)) return { ok: false, code: "UNKNOWN_KEY", key: r6, reason: `Unknown key "${r6}" on ${t4}. Allowed: ${[...n5].sort().join(", ")}.` };
1091
1109
  const r5 = void 0 !== e4.package, o4 = void 0 !== e4.import, i4 = void 0 !== e4.code;
1092
- return i4 && "string" == typeof e4.code ? { ok: false, code: "OBSOLETE_CODE_STRING", key: "code", reason: `code: "<name>" is no longer supported. Use import: "${e4.code}" with the package field instead.` } : i4 && ("object" != typeof e4.code && "function" != typeof e4.code || null === e4.code || Array.isArray(e4.code)) ? { ok: false, code: "INVALID_CODE_SHAPE", key: "code", reason: "code must be an object ({ push, type?, init? }) or a resolved function value." } : i4 && r5 ? { ok: false, code: "CONFLICT", key: "package", reason: "Cannot specify both `code` and `package`. Use one or the other." } : i4 && o4 ? { ok: false, code: "CONFLICT", key: "import", reason: "Cannot specify both `code` and `import`." } : o4 && !r5 ? { ok: false, code: "MISSING_PACKAGE", key: "import", reason: "`import` requires `package` to be set." } : !o4 || "string" == typeof e4.import && dn.test(e4.import) ? { ok: true } : { ok: false, code: "INVALID_IMPORT", key: "import", reason: `import must match ${dn.source}. Got: ${JSON.stringify(e4.import)}.` };
1110
+ return i4 && "string" == typeof e4.code ? { ok: false, code: "OBSOLETE_CODE_STRING", key: "code", reason: `code: "<name>" is no longer supported. Use import: "${e4.code}" with the package field instead.` } : i4 && ("object" != typeof e4.code && "function" != typeof e4.code || null === e4.code || Array.isArray(e4.code)) ? { ok: false, code: "INVALID_CODE_SHAPE", key: "code", reason: "code must be an object ({ push, type?, init? }) or a resolved function value." } : i4 && r5 ? { ok: false, code: "CONFLICT", key: "package", reason: "Cannot specify both `code` and `package`. Use one or the other." } : i4 && o4 ? { ok: false, code: "CONFLICT", key: "import", reason: "Cannot specify both `code` and `import`." } : o4 && !r5 ? { ok: false, code: "MISSING_PACKAGE", key: "import", reason: "`import` requires `package` to be set." } : !o4 || "string" == typeof e4.import && hn.test(e4.import) ? { ok: true } : { ok: false, code: "INVALID_IMPORT", key: "import", reason: `import must match ${hn.source}. Got: ${JSON.stringify(e4.import)}.` };
1093
1111
  }
1094
- function gn(e4, t4) {
1112
+ function bn(e4, t4) {
1095
1113
  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.state || void 0 !== e4.mapping));
1096
1114
  }
1097
- var e, t, r, a, f, l, m, h, b, I, U, D, F, Z, B, L, J, G, re, we, Re, He, dt, Ft, Wt, Lt, fn, ln, pn, dn;
1115
+ var e, t, r, a, f, l, m, h, b, I, U, D, F, Z, B, L, J, G, re, we, _e, Ze, Je, ht, Lt, Kt, qt, mn, gn, yn, hn;
1098
1116
  var init_dist = __esm({
1099
1117
  "../core/dist/index.mjs"() {
1100
1118
  "use strict";
@@ -1126,23 +1144,24 @@ var init_dist = __esm({
1126
1144
  G = "__WALKEROS_SECRET:";
1127
1145
  re = { merge: true, shallow: true, extend: true };
1128
1146
  we = { 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 }) };
1129
- Re = (e4, t4, n5, r5) => {
1147
+ _e = "0123456789abcdef";
1148
+ Ze = (e4, t4, n5, r5) => {
1130
1149
  const o4 = `${l[e4]}${r5.length > 0 ? ` [${r5.join(":")}]` : ""}`, i4 = Object.keys(n5).length > 0, a4 = 0 === e4 ? console.error : 1 === e4 ? console.warn : console.log;
1131
1150
  i4 ? a4(o4, t4, n5) : a4(o4, t4);
1132
1151
  };
1133
- He = class e2 extends Error {
1152
+ Je = class e2 extends Error {
1134
1153
  constructor(t4, n5) {
1135
1154
  super(t4, n5), this.name = "FatalError", Object.setPrototypeOf(this, e2.prototype);
1136
1155
  }
1137
1156
  };
1138
- dt = null;
1139
- Ft = /* @__PURE__ */ new WeakMap();
1140
- Wt = "__walkeros_cache_v__";
1141
- Lt = "__walkeros_cache_exp__";
1142
- fn = { Source: ["code", "package", "import", "before", "next", "cache", "state"], Transformer: ["code", "package", "import", "before", "next", "cache", "state", "mapping"], Destination: ["code", "package", "import", "before", "next", "cache", "state"], Store: ["code", "package", "import", "cache"] };
1143
- ln = ["config", "env", "variables", "examples", "disabled", "id", "logger", "mock", "chainMocks"];
1144
- pn = { Source: ["primary"], Transformer: [], Destination: [], Store: [] };
1145
- dn = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
1157
+ ht = null;
1158
+ Lt = /* @__PURE__ */ new WeakMap();
1159
+ Kt = "__walkeros_cache_v__";
1160
+ qt = "__walkeros_cache_exp__";
1161
+ mn = { Source: ["code", "package", "import", "before", "next", "cache", "state"], Transformer: ["code", "package", "import", "before", "next", "cache", "state", "mapping"], Destination: ["code", "package", "import", "before", "next", "cache", "state"], Store: ["code", "package", "import", "cache"] };
1162
+ gn = ["config", "env", "variables", "examples", "disabled", "id", "logger", "mock", "chainMocks"];
1163
+ yn = { Source: ["primary"], Transformer: [], Destination: [], Store: [] };
1164
+ hn = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
1146
1165
  }
1147
1166
  });
1148
1167
 
@@ -1151,14 +1170,14 @@ import * as r2 from "http";
1151
1170
  import * as s3 from "https";
1152
1171
  import { createHash as n2 } from "crypto";
1153
1172
  function a2(a4, n5, i4 = {}) {
1154
- const u2 = it(i4.headers), c2 = ot(n5), m3 = i4.method || "POST", d2 = i4.timeout || 5e3;
1173
+ const u2 = ut(i4.headers), c2 = ct(n5), m3 = i4.method || "POST", d2 = i4.timeout || 5e3;
1155
1174
  return new Promise((t4) => {
1156
1175
  const e4 = new URL(a4), n6 = "https:" === e4.protocol ? s3 : r2, i5 = { method: m3, headers: u2 }, p3 = n6.request(e4, i5, (e5) => {
1157
1176
  const r5 = [];
1158
1177
  e5.on("data", (t5) => {
1159
1178
  r5.push(t5);
1160
1179
  }), e5.on("end", () => {
1161
- const s6 = !!(e5.statusCode && e5.statusCode >= 200 && e5.statusCode < 300), a5 = Buffer.concat(r5).toString(), n7 = We(JSON.parse, () => a5)(a5);
1180
+ const s6 = !!(e5.statusCode && e5.statusCode >= 200 && e5.statusCode < 300), a5 = Buffer.concat(r5).toString(), n7 = Ke(JSON.parse, () => a5)(a5);
1162
1181
  t4({ ok: s6, data: n7, error: s6 ? void 0 : `${e5.statusCode} ${e5.statusMessage}` });
1163
1182
  });
1164
1183
  });
@@ -1416,7 +1435,7 @@ function createCLILoggerConfig(options = {}) {
1416
1435
  };
1417
1436
  }
1418
1437
  function createCLILogger(options = {}) {
1419
- return Ue(createCLILoggerConfig(options));
1438
+ return Be(createCLILoggerConfig(options));
1420
1439
  }
1421
1440
  var init_cli_logger = __esm({
1422
1441
  "src/core/cli-logger.ts"() {
@@ -1903,7 +1922,7 @@ function R3(e4, t4) {
1903
1922
  function M2(e4) {
1904
1923
  return n3.object({ mapping: e4.optional().describe("Event mapping rules") }).partial();
1905
1924
  }
1906
- function T2(e4) {
1925
+ function T(e4) {
1907
1926
  return n3.object({ policy: e4.optional().describe("Pre-processing policy rules") }).partial();
1908
1927
  }
1909
1928
  function F2(e4) {
@@ -2070,8 +2089,8 @@ function mn2(e4, t4) {
2070
2089
  return a4 && (t4?.secrets && (a4.secrets = t4.secrets), (function(e5, t5, i5, n6, o5) {
2071
2090
  (function(e6, t6, i6) {
2072
2091
  let n7;
2073
- bn.lastIndex = 0;
2074
- for (; null !== (n7 = bn.exec(e6)); ) {
2092
+ bn2.lastIndex = 0;
2093
+ for (; null !== (n7 = bn2.exec(e6)); ) {
2075
2094
  const t7 = n7[0], o6 = n7[1], r6 = n7[2], a5 = Dn(e6, n7.index, t7.length);
2076
2095
  i6.push({ message: `Malformed reference "${t7}", use a dot, not a colon: "$${o6}.${r6}".`, severity: "warning", path: t7, ...a5 });
2077
2096
  }
@@ -2102,8 +2121,8 @@ function mn2(e4, t4) {
2102
2121
  const n7 = t6.flowNames ?? [];
2103
2122
  if (0 === n7.length) return;
2104
2123
  let o6;
2105
- hn.lastIndex = 0;
2106
- for (; null !== (o6 = hn.exec(e6)); ) {
2124
+ hn2.lastIndex = 0;
2125
+ for (; null !== (o6 = hn2.exec(e6)); ) {
2107
2126
  const t7 = o6[0], r6 = o6[1];
2108
2127
  if (!n7.includes(r6)) {
2109
2128
  const a5 = Dn(e6, o6.index, t7.length);
@@ -2117,7 +2136,7 @@ function mn2(e4, t4) {
2117
2136
  if (!On(i7)) continue;
2118
2137
  const t7 = i7.config, a5 = !On(t7) || "web" !== t7.platform && "server" !== t7.platform ? void 0 : t7.platform, s6 = JSON.stringify(i7);
2119
2138
  let c2;
2120
- for (vn.lastIndex = 0; null !== (c2 = vn.exec(s6)); ) {
2139
+ for (vn2.lastIndex = 0; null !== (c2 = vn2.exec(s6)); ) {
2121
2140
  const t8 = c2[0], i8 = c2[1], s7 = e6.indexOf(t8), l3 = -1 === s7 ? { line: 1, column: 1 } : Dn(e6, s7, t8.length);
2122
2141
  "web" !== a5 ? r6 && !r6.includes(i8) && o6.push({ message: `Unknown secret "$secret.${i8}"; not in the project's registered secrets.`, severity: "warning", path: t8, ...l3 }) : n7.push({ message: `Secret "$secret.${i8}" cannot be used in a web flow \u2014 secrets are never sent to the browser; use a server flow.`, severity: "error", path: t8, ...l3 });
2123
2142
  }
@@ -2141,7 +2160,7 @@ function Cn(e4, t4, i4) {
2141
2160
  function xn(e4, t4, i4, n5) {
2142
2161
  for (const o4 of Object.values(t4)) {
2143
2162
  if (!On(o4)) continue;
2144
- if (o4.package !== yn) continue;
2163
+ if (o4.package !== yn2) continue;
2145
2164
  if (!On(o4.env)) continue;
2146
2165
  const t5 = o4.env.store;
2147
2166
  if ("string" != typeof t5) continue;
@@ -2243,7 +2262,7 @@ function An(e4) {
2243
2262
  for (const [e5, i4] of Object.entries(t4)) i4 && "object" == typeof i4 && ("object" === i4.type && i4.properties && "string" != typeof i4.title && (i4.title = e5), An(i4));
2244
2263
  }
2245
2264
  }
2246
- var e3, t3, i2, r3, a3, s4, c, l2, d, p, u, m2, f2, g2, h2, b2, v2, S, y, w2, k2, C, x, j2, P3, D2, E2, O, I2, J2, $, z3, A, L3, q2, N2, W2, B3, U3, _2, H2, V2, Z2, G3, K, Q2, X2, Y2, ee2, te2, ie, ne2, oe2, re2, ae2, se2, ce, le2, de2, pe2, ue2, me2, fe, ge2, he2, be2, ve2, Se2, ye2, we2, ke2, Ce, xe2, je3, Pe3, De3, Ee3, Oe3, Ie3, Je3, Re3, Me3, Te3, Fe3, $e2, ze2, Ae2, Le3, qe3, Ne2, We3, Be3, Ue3, _e2, He3, Ve3, Ze2, Ge2, Ke3, Qe2, Xe2, Ye2, et2, tt2, it3, nt2, ot3, rt2, at2, st2, ct3, lt2, dt3, pt3, ut3, mt3, ft3, gt3, ht3, bt2, vt2, St, yt3, wt2, kt, Ct2, xt2, jt2, Pt2, Dt3, Et3, Ot2, It, Jt2, Rt3, Mt3, Tt2, Ft2, $t2, zt, At2, Lt3, qt, Nt2, Wt2, Bt2, Ut2, _t2, Ht2, Vt, Zt3, Gt, Kt2, Qt2, 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, Pi, Di, Ei, Oi, Ii, Ji, Ri, Mi, Ti, Fi, $i, zi, Wi, Bi, Ui, _i, Hi, Vi, Zi, Gi, Ki, Qi, Yi, en2, tn2, nn3, on3, rn3, an2, cn2, fn2, gn2, hn, bn, vn, Sn, yn, wn, qn;
2265
+ var e3, t3, i2, r3, a3, s4, c, l2, d, p, u, m2, f2, g2, h2, b2, v2, S, y, w2, k2, C2, x, j2, P3, D2, E2, O, I2, J2, $, z3, A, L3, q2, N2, W2, B3, U3, _2, H2, V2, Z2, G3, K, Q2, X2, Y2, ee2, te2, ie, ne2, oe2, re2, ae2, se2, ce, le2, de2, pe2, ue2, me2, fe, ge2, he2, be2, ve2, Se3, ye2, we2, ke2, Ce, xe2, je3, Pe2, De3, Ee3, Oe3, Ie3, Je3, Re3, Me3, Te2, Fe3, $e2, ze2, Ae2, Le3, qe3, Ne3, We3, Be3, Ue2, _e3, He2, Ve3, Ze3, Ge3, Ke3, Qe3, Xe3, Ye3, et2, tt2, it2, nt2, ot2, rt2, at2, st2, ct3, lt2, dt3, pt3, ut3, mt3, ft2, gt2, ht3, bt3, vt3, St, yt3, wt3, kt2, Ct2, xt, jt2, Pt3, Dt3, Et2, Ot2, It2, Jt2, Rt, Mt2, Tt2, Ft2, $t2, zt2, At2, Lt2, qt2, Nt, Wt2, Bt2, Ut, _t, Ht2, Vt2, Zt2, Gt3, Kt2, Qt2, Xt, Yt2, 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, Pi, Di, Ei, Oi, Ii, Ji, Ri, Mi, Ti, Fi, $i, zi, Wi, Bi, Ui, _i, Hi, Vi, Zi, Gi, Ki, Qi, Yi, en2, tn2, nn2, on2, rn3, an2, cn2, fn2, gn2, hn2, bn2, vn2, Sn, yn2, wn, qn;
2247
2266
  var init_dev = __esm({
2248
2267
  "../core/dist/dev.mjs"() {
2249
2268
  "use strict";
@@ -2252,7 +2271,7 @@ var init_dev = __esm({
2252
2271
  for (var n5 in i4) e3(t4, n5, { get: i4[n5], enumerable: true });
2253
2272
  };
2254
2273
  i2 = {};
2255
- t3(i2, { BaseContextConfig: () => z3, CacheRuleSchema: () => Xe2, CacheSchema: () => Ye2, CacheSchemas: () => Ve3, ClickIdEntrySchema: () => nn3, CodeSchema: () => Yi, CollectorSchemas: () => Et3, ConsentSchema: () => Z2, ContractActionsSchema: () => Ji, ContractRuleSchema: () => Mi, ContractSchema: () => Ti, ContractSchemaEntry: () => Ii, Counter: () => d, CredentialsSchema: () => rn3, DeepPartialEventSchema: () => te2, DestinationSchemas: () => Re3, DestinationsMapConfig: () => q2, EntitiesSchema: () => X2, EntitySchema: () => Q2, EventCacheRuleSchema: () => Ze2, EventCacheSchema: () => Ge2, EventSchema: () => Y2, FlowBundlePackageSchema: () => bi, FlowBundleSchema: () => vi, FlowCodeSchema: () => Si, FlowConfigSchema: () => Fi, FlowDestinationSchema: () => Ei, FlowJsonSchema: () => zi, FlowSchema: () => $i, FlowSchemas: () => mi, FlowSourceSchema: () => Pi, FlowStoreSchema: () => Oi, FlowTransformerSchema: () => Di, GenericEnvConfig: () => J2, GenericSettingsConfig: () => I2, HandlersConfig: () => x, HintSchema: () => en2, HintsSchema: () => tn2, IdConfig: () => D2, Identifier: () => c, InitConfig: () => E2, LoggerConfigSchema: () => it3, LoggerHandlerSchema: () => tt2, LoopSchema: () => me2, MapSchema: () => ge2, MappingResultSchema: () => ke2, MappingSchemas: () => de2, MatchExpressionSchema: () => $e2, MatcherSchemas: () => Me3, OptionalPrimitiveValue: () => u, OrderedPropertiesSchema: () => H2, PartialEventSchema: () => ee2, PolicySchema: () => be2, PrimaryConfig: () => O, PrimitiveValue: () => p, ProcessingControlConfig: () => A, PropertiesSchema: () => _2, PropertySchema: () => U3, PropertyTypeSchema: () => B3, QueueConfig: () => P3, RequiredBoolean: () => s4, RequiredNumber: () => a3, RequiredString: () => r3, RouteSchema: () => We3, RouteWithoutManySchema: () => He3, RuleSchema: () => Se2, RulesSchema: () => ye2, RuntimeInstanceConfig: () => $, ServiceAccountSchema: () => on3, SetSchema: () => fe, SourceSchema: () => K, SourceSchemas: () => Bt2, SourceTypeSchema: () => V2, SourcesMapConfig: () => L3, StateSchema: () => et2, StoreCacheRuleSchema: () => Ke3, StoreCacheSchema: () => Qe2, StoreSchemas: () => ci, Timestamp: () => l2, TransformerSchemas: () => ni, UserSchema: () => G3, UtilitySchemas: () => m2, ValidateEventsSchema: () => xi, ValueConfigSchema: () => he2, ValueSchema: () => pe2, ValuesSchema: () => ue2, VerboseConfig: () => j2, WalkerOSSchemas: () => N2, configJsonSchema: () => Wi, consentJsonSchema: () => le2, contractJsonSchema: () => Ki, contractRuleJsonSchema: () => Gi, createArraySchema: () => Tn, createConsentConfig: () => F2, createDataTransformationConfig: () => R3, createEnumSchema: () => Fn, createMappingRulesConfig: () => M2, createObjectSchema: () => Rn, createPolicyConfig: () => T2, createTupleSchema: () => $n, credentialsJsonSchema: () => an2, destinationJsonSchema: () => Hi, entityJsonSchema: () => se2, eventJsonSchema: () => ie, flowConfigJsonSchema: () => Ui, flowJsonSchema: () => Bi, loopJsonSchema: () => je3, mapJsonSchema: () => De3, orderedPropertiesJsonSchema: () => ae2, parseConfig: () => Ai, parseFlow: () => qi, partialEventJsonSchema: () => ne2, policyJsonSchema: () => Ee3, propertiesJsonSchema: () => re2, ruleJsonSchema: () => Oe3, rulesJsonSchema: () => Ie3, safeParseConfig: () => Li, safeParseFlow: () => Ni, setJsonSchema: () => Pe3, sourceJsonSchema: () => _i, sourceTypeJsonSchema: () => ce, storeJsonSchema: () => Zi, transformerJsonSchema: () => Vi, userJsonSchema: () => oe2, validateEventsJsonSchema: () => Qi, validateFlowConfig: () => mn2, valueConfigJsonSchema: () => xe2, valueJsonSchema: () => Ce, z: () => n3, zodToSchema: () => zn });
2274
+ t3(i2, { BaseContextConfig: () => z3, CacheRuleSchema: () => Xe3, CacheSchema: () => Ye3, CacheSchemas: () => Ve3, ClickIdEntrySchema: () => nn2, CodeSchema: () => Yi, CollectorSchemas: () => Et2, ConsentSchema: () => Z2, ContractActionsSchema: () => Ji, ContractRuleSchema: () => Mi, ContractSchema: () => Ti, ContractSchemaEntry: () => Ii, Counter: () => d, CredentialsSchema: () => rn3, DeepPartialEventSchema: () => te2, DestinationSchemas: () => Re3, DestinationsMapConfig: () => q2, EntitiesSchema: () => X2, EntitySchema: () => Q2, EventCacheRuleSchema: () => Ze3, EventCacheSchema: () => Ge3, EventSchema: () => Y2, FlowBundlePackageSchema: () => bi, FlowBundleSchema: () => vi, FlowCodeSchema: () => Si, FlowConfigSchema: () => Fi, FlowDestinationSchema: () => Ei, FlowJsonSchema: () => zi, FlowSchema: () => $i, FlowSchemas: () => mi, FlowSourceSchema: () => Pi, FlowStoreSchema: () => Oi, FlowTransformerSchema: () => Di, GenericEnvConfig: () => J2, GenericSettingsConfig: () => I2, HandlersConfig: () => x, HintSchema: () => en2, HintsSchema: () => tn2, IdConfig: () => D2, Identifier: () => c, InitConfig: () => E2, LoggerConfigSchema: () => it2, LoggerHandlerSchema: () => tt2, LoopSchema: () => me2, MapSchema: () => ge2, MappingResultSchema: () => ke2, MappingSchemas: () => de2, MatchExpressionSchema: () => $e2, MatcherSchemas: () => Me3, OptionalPrimitiveValue: () => u, OrderedPropertiesSchema: () => H2, PartialEventSchema: () => ee2, PolicySchema: () => be2, PrimaryConfig: () => O, PrimitiveValue: () => p, ProcessingControlConfig: () => A, PropertiesSchema: () => _2, PropertySchema: () => U3, PropertyTypeSchema: () => B3, QueueConfig: () => P3, RequiredBoolean: () => s4, RequiredNumber: () => a3, RequiredString: () => r3, RouteSchema: () => We3, RouteWithoutManySchema: () => He2, RuleSchema: () => Se3, RulesSchema: () => ye2, RuntimeInstanceConfig: () => $, ServiceAccountSchema: () => on2, SetSchema: () => fe, SourceSchema: () => K, SourceSchemas: () => Bt2, SourceTypeSchema: () => V2, SourcesMapConfig: () => L3, StateSchema: () => et2, StoreCacheRuleSchema: () => Ke3, StoreCacheSchema: () => Qe3, StoreSchemas: () => ci, Timestamp: () => l2, TransformerSchemas: () => ni, UserSchema: () => G3, UtilitySchemas: () => m2, ValidateEventsSchema: () => xi, ValueConfigSchema: () => he2, ValueSchema: () => pe2, ValuesSchema: () => ue2, VerboseConfig: () => j2, WalkerOSSchemas: () => N2, configJsonSchema: () => Wi, consentJsonSchema: () => le2, contractJsonSchema: () => Ki, contractRuleJsonSchema: () => Gi, createArraySchema: () => Tn, createConsentConfig: () => F2, createDataTransformationConfig: () => R3, createEnumSchema: () => Fn, createMappingRulesConfig: () => M2, createObjectSchema: () => Rn, createPolicyConfig: () => T, createTupleSchema: () => $n, credentialsJsonSchema: () => an2, destinationJsonSchema: () => Hi, entityJsonSchema: () => se2, eventJsonSchema: () => ie, flowConfigJsonSchema: () => Ui, flowJsonSchema: () => Bi, loopJsonSchema: () => je3, mapJsonSchema: () => De3, orderedPropertiesJsonSchema: () => ae2, parseConfig: () => Ai, parseFlow: () => qi, partialEventJsonSchema: () => ne2, policyJsonSchema: () => Ee3, propertiesJsonSchema: () => re2, ruleJsonSchema: () => Oe3, rulesJsonSchema: () => Ie3, safeParseConfig: () => Li, safeParseFlow: () => Ni, setJsonSchema: () => Pe2, sourceJsonSchema: () => _i, sourceTypeJsonSchema: () => ce, storeJsonSchema: () => Zi, transformerJsonSchema: () => Vi, userJsonSchema: () => oe2, validateEventsJsonSchema: () => Qi, validateFlowConfig: () => mn2, valueConfigJsonSchema: () => xe2, valueJsonSchema: () => Ce, z: () => n3, zodToSchema: () => zn });
2256
2275
  r3 = n3.string();
2257
2276
  a3 = n3.number();
2258
2277
  s4 = n3.boolean();
@@ -2262,7 +2281,7 @@ var init_dev = __esm({
2262
2281
  p = n3.union([n3.string(), n3.number(), n3.boolean()]);
2263
2282
  u = p.optional();
2264
2283
  m2 = {};
2265
- t3(m2, { ErrorHandlerSchema: () => h2, HandlerSchema: () => v2, LogHandlerSchema: () => b2, StorageSchema: () => g2, StorageTypeSchema: () => f2, errorHandlerJsonSchema: () => w2, handlerJsonSchema: () => C, logHandlerJsonSchema: () => k2, storageJsonSchema: () => y, storageTypeJsonSchema: () => S });
2284
+ t3(m2, { ErrorHandlerSchema: () => h2, HandlerSchema: () => v2, LogHandlerSchema: () => b2, StorageSchema: () => g2, StorageTypeSchema: () => f2, errorHandlerJsonSchema: () => w2, handlerJsonSchema: () => C2, logHandlerJsonSchema: () => k2, storageJsonSchema: () => y, storageTypeJsonSchema: () => S });
2266
2285
  f2 = n3.enum(["local", "session", "cookie"]).meta({ id: "StorageType", title: "Storage.Type", description: "Storage mechanism: local, session, or cookie." }).describe("Storage mechanism: local, session, or cookie");
2267
2286
  g2 = n3.object({ Local: n3.literal("local"), Session: n3.literal("session"), Cookie: n3.literal("cookie") }).meta({ id: "StorageConstants", title: "Storage", description: "Storage type constants for type-safe references." }).describe("Storage type constants for type-safe references");
2268
2287
  h2 = n3.unknown().meta({ id: "ErrorHandler", title: "Error.Handler", description: "Error handler function: (error, state?) => void." }).describe("Error handler function: (error, state?) => void");
@@ -2272,7 +2291,7 @@ var init_dev = __esm({
2272
2291
  y = o2(g2);
2273
2292
  w2 = o2(h2);
2274
2293
  k2 = o2(b2);
2275
- C = o2(v2);
2294
+ C2 = o2(v2);
2276
2295
  x = n3.object({ onError: h2.optional().describe("Error handler function: (error, state?) => void"), onLog: b2.optional().describe("Log handler function: (message, verbose?) => void") }).partial();
2277
2296
  j2 = n3.object({ verbose: n3.boolean().describe("Enable verbose logging for debugging").optional() }).partial();
2278
2297
  P3 = n3.object({ queue: n3.boolean().describe("Whether to queue events when consent is not granted").optional() }).partial();
@@ -2295,7 +2314,7 @@ var init_dev = __esm({
2295
2314
  V2 = n3.union([n3.enum(["web", "server", "app", "other"]), n3.string()]).meta({ id: "WalkerOSSourceType", title: "WalkerOS.SourceType", description: "Source type identifier. Standard: web, server, app, other. Extensible to custom strings." }).describe("Source type: web, server, app, other, or custom");
2296
2315
  Z2 = n3.record(n3.string(), n3.boolean()).meta({ id: "WalkerOSConsent", title: "WalkerOS.Consent", description: "Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied." }).describe("Consent requirement mapping (group name to state)");
2297
2316
  G3 = _2.and(n3.object({ id: n3.string().optional().describe("User identifier"), device: n3.string().optional().describe("Device identifier"), session: n3.string().optional().describe("Session identifier"), hash: n3.string().optional().describe("Hashed identifier"), address: n3.string().optional().describe("User address"), email: n3.string().email().optional().describe("User email address"), phone: n3.string().optional().describe("User phone number"), userAgent: n3.string().optional().describe("Browser user agent string"), browser: n3.string().optional().describe("Browser name"), browserVersion: n3.string().optional().describe("Browser version"), deviceType: n3.string().optional().describe("Device type (mobile, desktop, tablet)"), os: n3.string().optional().describe("Operating system"), osVersion: n3.string().optional().describe("Operating system version"), screenSize: n3.string().optional().describe("Screen dimensions"), language: n3.string().optional().describe("User language"), country: n3.string().optional().describe("User country"), region: n3.string().optional().describe("User region/state"), city: n3.string().optional().describe("User city"), zip: n3.string().optional().describe("User postal code"), timezone: n3.string().optional().describe("User timezone"), ip: n3.string().optional().describe("User IP address"), internal: n3.boolean().optional().describe("Internal user flag (employee, test user)") })).meta({ id: "WalkerOSUser", title: "WalkerOS.User", description: "User identification and attributes." }).describe("User identification and properties");
2298
- K = _2.and(n3.object({ type: n3.string().describe("Source kind (browser, dataLayer, gtag, ...)"), platform: n3.string().optional().describe("Runtime platform (web, server, app, ios, android, terminal, ...)"), version: n3.string().optional().describe("Deployment version of the source emitter"), schema: n3.string().optional().describe('Event model spec version (collector defaults to "4")'), count: n3.number().int().nonnegative().optional().describe("Emission sequence per run"), trace: n3.string().optional().describe("W3C traceparent full string"), url: n3.string().optional(), referrer: n3.string().optional(), tool: n3.string().optional(), command: n3.string().optional() })).meta({ id: "WalkerOSSource", title: "WalkerOS.Source", description: "Event source information (origin of the event)." }).describe("Event source information");
2317
+ K = _2.and(n3.object({ type: n3.string().describe("Source kind (browser, dataLayer, gtag, ...)"), platform: n3.string().optional().describe("Runtime platform (web, server, app, ios, android, terminal, ...)"), version: n3.string().optional().describe("Deployment version of the source emitter"), schema: n3.string().optional().describe('Event model spec version (collector defaults to "4")'), count: n3.number().int().nonnegative().optional().describe("Emission sequence per run"), trace: n3.string().optional().describe("Trace id shared by every event of a run (W3C trace-id shape)"), url: n3.string().optional(), referrer: n3.string().optional(), tool: n3.string().optional(), command: n3.string().optional() })).meta({ id: "WalkerOSSource", title: "WalkerOS.Source", description: "Event source information (origin of the event)." }).describe("Event source information");
2299
2318
  Q2 = n3.lazy(() => n3.object({ entity: n3.string().describe("Entity name"), data: _2.describe("Entity-specific properties"), nested: n3.array(Q2).optional().describe("Nested child entities"), context: H2.optional().describe("Entity context data") })).meta({ id: "WalkerOSEntity", title: "WalkerOS.Entity", description: "Nested entity structure with recursive nesting support." }).describe("Nested entity structure with recursive nesting support");
2300
2319
  X2 = n3.array(Q2).meta({ id: "WalkerOSEntities", title: "WalkerOS.Entities", description: "Array of nested entities." }).describe("Array of nested entities");
2301
2320
  Y2 = n3.object({ name: n3.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'), data: _2.describe("Event-specific properties"), context: H2.describe("Ordered context properties with priorities"), globals: _2.describe("Global properties shared across events"), custom: _2.describe("Custom implementation-specific properties"), user: G3.describe("User identification and attributes"), nested: X2.describe("Related nested entities"), consent: Z2.describe("Consent states at event time"), id: c.describe("W3C span_id, 16 lowercase hex characters"), trigger: r3.describe("Event trigger identifier"), entity: r3.describe("Parsed entity from event name"), action: r3.describe("Parsed action from event name"), timestamp: l2.describe("Unix timestamp in milliseconds since epoch"), timing: a3.describe("Event processing timing information"), source: K.describe("Event source information") }).meta({ id: "WalkerOSEvent", title: "WalkerOS.Event", description: "Complete walkerOS event structure." }).describe("Complete walkerOS event structure");
@@ -2310,7 +2329,7 @@ var init_dev = __esm({
2310
2329
  ce = o2(V2);
2311
2330
  le2 = o2(Z2);
2312
2331
  de2 = {};
2313
- t3(de2, { ConfigSchema: () => we2, LoopSchema: () => me2, MapSchema: () => ge2, PolicySchema: () => be2, ResultSchema: () => ke2, RulePatchSchema: () => ve2, RuleSchema: () => Se2, RulesSchema: () => ye2, SetSchema: () => fe, ValueConfigSchema: () => he2, ValueSchema: () => pe2, ValuesSchema: () => ue2, configJsonSchema: () => Je3, loopJsonSchema: () => je3, mapJsonSchema: () => De3, policyJsonSchema: () => Ee3, ruleJsonSchema: () => Oe3, rulesJsonSchema: () => Ie3, setJsonSchema: () => Pe3, valueConfigJsonSchema: () => xe2, valueJsonSchema: () => Ce });
2332
+ t3(de2, { ConfigSchema: () => we2, LoopSchema: () => me2, MapSchema: () => ge2, PolicySchema: () => be2, ResultSchema: () => ke2, RulePatchSchema: () => ve2, RuleSchema: () => Se3, RulesSchema: () => ye2, SetSchema: () => fe, ValueConfigSchema: () => he2, ValueSchema: () => pe2, ValuesSchema: () => ue2, configJsonSchema: () => Je3, loopJsonSchema: () => je3, mapJsonSchema: () => De3, policyJsonSchema: () => Ee3, ruleJsonSchema: () => Oe3, rulesJsonSchema: () => Ie3, setJsonSchema: () => Pe2, valueConfigJsonSchema: () => xe2, valueJsonSchema: () => Ce });
2314
2333
  pe2 = 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(pe2).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." });
2315
2334
  ue2 = n3.array(pe2).meta({ id: "MappingValues", title: "Mapping.Values", description: "Array of transformation values." }).describe("Array of transformation values");
2316
2335
  me2 = n3.lazy(() => n3.tuple([pe2, pe2]).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." });
@@ -2319,44 +2338,44 @@ var init_dev = __esm({
2319
2338
  he2 = 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: ge2.optional().describe("Object mapping: transform event data to structured output"), loop: me2.optional().describe("Loop transformation: [source, transform] for array processing"), set: fe.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");
2320
2339
  be2 = n3.record(n3.string(), pe2).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)");
2321
2340
  ve2 = n3.object({ name: n3.string().nullable().optional(), data: n3.union([pe2, ue2]).nullable().optional(), settings: n3.unknown().nullable().optional(), condition: n3.string().nullable().optional(), consent: Z2.nullable().optional(), policy: be2.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");
2322
- Se2 = n3.object({ name: n3.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), data: n3.union([pe2, ue2]).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: be2.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");
2323
- ye2 = n3.record(n3.string(), n3.record(n3.string(), n3.union([Se2, n3.array(Se2)])).optional()).meta({ id: "MappingRules", title: "Mapping.Rules", description: 'Event mapping rules tree: entity \u2192 action \u2192 Rule (or Rule[]). Use "*" as wildcard for entity or action.' }).describe('Event mapping rules: entity \u2192 action \u2192 Rule. Keys match event name split by space. Use "*" as wildcard for entity or action. Priority: exact > entity wildcard > action wildcard > global wildcard (*\u2192*).');
2341
+ Se3 = n3.object({ name: n3.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), data: n3.union([pe2, ue2]).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: be2.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");
2342
+ ye2 = n3.record(n3.string(), n3.record(n3.string(), n3.union([Se3, n3.array(Se3)])).optional()).meta({ id: "MappingRules", title: "Mapping.Rules", description: 'Event mapping rules tree: entity \u2192 action \u2192 Rule (or Rule[]). Use "*" as wildcard for entity or action.' }).describe('Event mapping rules: entity \u2192 action \u2192 Rule. Keys match event name split by space. Use "*" as wildcard for entity or action. Priority: exact > entity wildcard > action wildcard > global wildcard (*\u2192*).');
2324
2343
  we2 = n3.object({ consent: Z2.optional().describe("Required consent states to process any events"), data: n3.union([pe2, ue2]).optional().describe("Global data transformation applied to all events"), include: n3.array(n3.string()).optional().describe("Event sections to flatten into context.data"), mapping: ye2.optional().describe("Entity-action specific mapping rules"), policy: be2.optional().describe("Pre-processing policy rules applied before mapping") }).meta({ id: "MappingConfig", title: "Mapping.Config", description: "Shared mapping configuration (consent, data, include, mapping, policy)." }).describe("Shared mapping configuration for sources and destinations");
2325
- ke2 = n3.object({ eventMapping: Se2.optional().describe("Resolved mapping rule for event"), mappingKey: n3.string().optional().describe('Mapping key used (e.g., "product.view")') }).meta({ id: "MappingResult", title: "Mapping.Result", description: "Mapping resolution result (matched rule + key)." }).describe("Mapping resolution result");
2344
+ ke2 = n3.object({ eventMapping: Se3.optional().describe("Resolved mapping rule for event"), mappingKey: n3.string().optional().describe('Mapping key used (e.g., "product.view")') }).meta({ id: "MappingResult", title: "Mapping.Result", description: "Mapping resolution result (matched rule + key)." }).describe("Mapping resolution result");
2326
2345
  Ce = o2(pe2);
2327
2346
  xe2 = o2(he2);
2328
2347
  je3 = o2(me2);
2329
- Pe3 = o2(fe);
2348
+ Pe2 = o2(fe);
2330
2349
  De3 = o2(ge2);
2331
2350
  Ee3 = o2(be2);
2332
- Oe3 = o2(Se2);
2351
+ Oe3 = o2(Se3);
2333
2352
  Ie3 = o2(ye2);
2334
2353
  Je3 = o2(we2);
2335
2354
  Re3 = {};
2336
- t3(Re3, { BatchSchema: () => pt3, ConfigSchema: () => nt2, ContextSchema: () => at2, DLQSchema: () => yt3, DataSchema: () => ut3, DestinationPolicySchema: () => rt2, DestinationsSchema: () => ht3, InitDestinationsSchema: () => gt3, InitSchema: () => ft3, InstanceSchema: () => mt3, PartialConfigSchema: () => ot3, PushBatchContextSchema: () => ct3, PushContextSchema: () => st2, PushEventSchema: () => lt2, PushEventsSchema: () => dt3, PushResultSchema: () => vt2, RefSchema: () => bt2, ResultSchema: () => St, batchJsonSchema: () => jt2, configJsonSchema: () => wt2, contextJsonSchema: () => Ct2, instanceJsonSchema: () => Pt2, partialConfigJsonSchema: () => kt, pushContextJsonSchema: () => xt2, resultJsonSchema: () => Dt3 });
2355
+ t3(Re3, { BatchSchema: () => pt3, ConfigSchema: () => nt2, ContextSchema: () => at2, DLQSchema: () => yt3, DataSchema: () => ut3, DestinationPolicySchema: () => rt2, DestinationsSchema: () => ht3, InitDestinationsSchema: () => gt2, InitSchema: () => ft2, InstanceSchema: () => mt3, PartialConfigSchema: () => ot2, PushBatchContextSchema: () => ct3, PushContextSchema: () => st2, PushEventSchema: () => lt2, PushEventsSchema: () => dt3, PushResultSchema: () => vt3, RefSchema: () => bt3, ResultSchema: () => St, batchJsonSchema: () => jt2, configJsonSchema: () => wt3, contextJsonSchema: () => Ct2, instanceJsonSchema: () => Pt3, partialConfigJsonSchema: () => kt2, pushContextJsonSchema: () => xt, resultJsonSchema: () => Dt3 });
2337
2356
  Me3 = {};
2338
- t3(Me3, { MatchExpressionSchema: () => $e2, RouteSchema: () => We3, RouteWithoutManySchema: () => He3 });
2339
- Te3 = n3.enum(["eq", "contains", "prefix", "suffix", "regex", "gt", "lt", "exists"]).meta({ id: "MatcherOperator", title: "Matcher.Operator", description: "Supported operators for a match condition." });
2340
- Fe3 = n3.object({ key: n3.string(), operator: Te3, value: n3.string(), not: n3.boolean().optional() }).meta({ id: "MatcherCondition", title: "Matcher.Condition", description: "Single match condition (key, operator, value, optional not)." });
2357
+ t3(Me3, { MatchExpressionSchema: () => $e2, RouteSchema: () => We3, RouteWithoutManySchema: () => He2 });
2358
+ Te2 = n3.enum(["eq", "contains", "prefix", "suffix", "regex", "gt", "lt", "exists"]).meta({ id: "MatcherOperator", title: "Matcher.Operator", description: "Supported operators for a match condition." });
2359
+ Fe3 = n3.object({ key: n3.string(), operator: Te2, value: n3.string(), not: n3.boolean().optional() }).meta({ id: "MatcherCondition", title: "Matcher.Condition", description: "Single match condition (key, operator, value, optional not)." });
2341
2360
  $e2 = n3.union([Fe3, n3.object({ and: n3.array(n3.lazy(() => $e2)) }), n3.object({ or: n3.array(n3.lazy(() => $e2)) })]).meta({ id: "MatcherExpression", title: "Matcher.Expression", description: "Boolean expression tree of match conditions (leaf, and, or)." });
2342
2361
  ze2 = n3.strictObject({ match: $e2.optional(), next: n3.lazy(() => We3) });
2343
2362
  Ae2 = n3.strictObject({ match: $e2.optional(), one: n3.array(n3.lazy(() => We3)) });
2344
2363
  Le3 = n3.strictObject({ match: $e2.optional(), many: n3.array(n3.lazy(() => We3)) });
2345
2364
  qe3 = n3.strictObject({ match: $e2 });
2346
- Ne2 = n3.union([ze2, Ae2, Le3, qe3]);
2347
- We3 = n3.union([n3.string(), n3.array(n3.lazy(() => We3)), Ne2]).meta({ id: "Route", title: "Route", description: "Recursive route: string ID, sequence of routes, or a RouteConfig (next/one/many/gate)." });
2348
- Be3 = n3.strictObject({ match: $e2.optional(), next: n3.lazy(() => He3) });
2349
- Ue3 = n3.strictObject({ match: $e2.optional(), one: n3.array(n3.lazy(() => He3)) });
2350
- _e2 = n3.union([Be3, Ue3, qe3]);
2351
- He3 = n3.union([n3.string(), n3.array(n3.lazy(() => He3)), _e2]).meta({ id: "RouteWithoutMany", title: "RouteWithoutMany", description: "Route variant for post-collector positions (destination.before). Excludes the many operator \u2014 post-collector fan-out uses the destinations map." });
2365
+ Ne3 = n3.union([ze2, Ae2, Le3, qe3]);
2366
+ We3 = n3.union([n3.string(), n3.array(n3.lazy(() => We3)), Ne3]).meta({ id: "Route", title: "Route", description: "Recursive route: string ID, sequence of routes, or a RouteConfig (next/one/many/gate)." });
2367
+ Be3 = n3.strictObject({ match: $e2.optional(), next: n3.lazy(() => He2) });
2368
+ Ue2 = n3.strictObject({ match: $e2.optional(), one: n3.array(n3.lazy(() => He2)) });
2369
+ _e3 = n3.union([Be3, Ue2, qe3]);
2370
+ He2 = n3.union([n3.string(), n3.array(n3.lazy(() => He2)), _e3]).meta({ id: "RouteWithoutMany", title: "RouteWithoutMany", description: "Route variant for post-collector positions (destination.before). Excludes the many operator \u2014 post-collector fan-out uses the destinations map." });
2352
2371
  Ve3 = {};
2353
- t3(Ve3, { CacheRuleSchema: () => Xe2, CacheSchema: () => Ye2, EventCacheRuleSchema: () => Ze2, EventCacheSchema: () => Ge2, StoreCacheRuleSchema: () => Ke3, StoreCacheSchema: () => Qe2 });
2354
- Ze2 = n3.object({ match: $e2.optional().describe("Optional match expression \u2014 omit for always-match."), key: n3.array(n3.string()).min(1).describe("Dot-path fields used to build the cache key"), ttl: n3.number().positive().describe("Time-to-live in seconds"), update: n3.record(n3.string(), pe2).optional().describe("Response mutations applied on cache hit (key \u2192 Value mapping)") }).meta({ id: "EventCacheRule", title: "EventCache.Rule", description: "Single event-cache rule: when it applies (match), what event fields it keys off, TTL, and optional response mutations on hit." });
2355
- Ge2 = n3.object({ stop: n3.boolean().optional().describe("Stop the chain on cache HIT (default: false). When true, skip remaining steps and return cached value."), store: n3.string().optional().describe("Store ID for persistent caching (references a configured store)"), namespace: n3.string().optional().describe("Optional key prefix. Omit to write keys directly to the store. Same store + same key + same namespace = same cache entry."), rules: n3.array(Ze2).min(1).describe("Cache rules \u2014 at least one required") }).meta({ id: "EventCacheConfig", title: "EventCache.Config", description: "Top-level cache configuration for an event-context pipeline step (source / transformer / destination)." });
2372
+ t3(Ve3, { CacheRuleSchema: () => Xe3, CacheSchema: () => Ye3, EventCacheRuleSchema: () => Ze3, EventCacheSchema: () => Ge3, StoreCacheRuleSchema: () => Ke3, StoreCacheSchema: () => Qe3 });
2373
+ Ze3 = n3.object({ match: $e2.optional().describe("Optional match expression \u2014 omit for always-match."), key: n3.array(n3.string()).min(1).describe("Dot-path fields used to build the cache key"), ttl: n3.number().positive().describe("Time-to-live in seconds"), update: n3.record(n3.string(), pe2).optional().describe("Response mutations applied on cache hit (key \u2192 Value mapping)") }).meta({ id: "EventCacheRule", title: "EventCache.Rule", description: "Single event-cache rule: when it applies (match), what event fields it keys off, TTL, and optional response mutations on hit." });
2374
+ Ge3 = n3.object({ stop: n3.boolean().optional().describe("Stop the chain on cache HIT (default: false). When true, skip remaining steps and return cached value."), store: n3.string().optional().describe("Store ID for persistent caching (references a configured store)"), namespace: n3.string().optional().describe("Optional key prefix. Omit to write keys directly to the store. Same store + same key + same namespace = same cache entry."), rules: n3.array(Ze3).min(1).describe("Cache rules \u2014 at least one required") }).meta({ id: "EventCacheConfig", title: "EventCache.Config", description: "Top-level cache configuration for an event-context pipeline step (source / transformer / destination)." });
2356
2375
  Ke3 = n3.strictObject({ match: $e2.optional().describe("Optional match expression evaluated against `{ key, value? }`. Omit for always-match."), ttl: n3.number().positive().describe("Time-to-live in seconds") }).meta({ id: "StoreCacheRule", title: "StoreCache.Rule", description: "Single store-cache rule: optional match against `{ key, value? }` and a TTL. No `key` (caller provides it) and no `update` (no event to mutate)." });
2357
- Qe2 = n3.strictObject({ store: n3.string().optional().describe("Store ID for persistent caching (references a configured store)"), namespace: n3.string().min(1).optional().describe("Optional key prefix. Omit to default to the host store id. Empty string is rejected."), rules: n3.array(Ke3).min(1).describe("Cache rules \u2014 at least one required") }).meta({ id: "StoreCacheConfig", title: "StoreCache.Config", description: "Top-level cache configuration for a store wrapper. No `stop` (always falls through on miss); namespace defaults to the host store id." });
2358
- Xe2 = Ze2;
2359
- Ye2 = Ge2;
2376
+ Qe3 = n3.strictObject({ store: n3.string().optional().describe("Store ID for persistent caching (references a configured store)"), namespace: n3.string().min(1).optional().describe("Optional key prefix. Omit to default to the host store id. Empty string is rejected."), rules: n3.array(Ke3).min(1).describe("Cache rules \u2014 at least one required") }).meta({ id: "StoreCacheConfig", title: "StoreCache.Config", description: "Top-level cache configuration for a store wrapper. No `stop` (always falls through on miss); namespace defaults to the host store id." });
2377
+ Xe3 = Ze3;
2378
+ Ye3 = Ge3;
2360
2379
  et2 = n3.object({ mode: n3.enum(["get", "set"]).describe("Direction: 'get' reads from the store, 'set' writes to it"), store: n3.string().optional().describe("Store id; defaults to the in-memory __cache store when omitted"), key: pe2.describe("Resolves against the event to the store key"), value: pe2.optional().describe("set: resolves to the payload to store. get: its key/bare-string path is the event write-target.") }).superRefine((e4, t4) => {
2361
2380
  if (void 0 !== e4.value) {
2362
2381
  if ("get" === e4.mode) {
@@ -2373,72 +2392,72 @@ var init_dev = __esm({
2373
2392
  } else t4.addIssue({ code: "custom", message: `\`value\` is required for mode "${e4.mode}".`, path: ["value"] });
2374
2393
  }).meta({ id: "StateConfig", title: "State.Config", description: "Declarative store operation: stash (set) or fetch (get) a value against a store. key = store side, value = event side, mode = direction." });
2375
2394
  tt2 = n3.any().meta({ id: "LoggerHandler", title: "Logger.Handler", description: "Custom log handler function (level, ...args) => void" });
2376
- it3 = n3.object({ level: n3.union([n3.number(), n3.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: tt2.optional().describe("Custom log handler function") }).meta({ id: "LoggerConfig", title: "Logger.Config", description: "Logger configuration (level, handler) to override the collector defaults" });
2377
- nt2 = n3.object({ consent: Z2.optional().describe("Required consent states to send events to this destination"), settings: n3.any().meta({ id: "DestinationSettings", title: "Destination.Settings", description: "Implementation-specific configuration (destination-defined shape)." }).describe("Implementation-specific configuration").optional(), credentials: n3.any().meta({ id: "DestinationCredentials", title: "Destination.Credentials", description: "Optional credentials slot (destination-defined shape); supports $env. The per-package shape is supplied via mergeConfigSchema." }).describe("Optional credentials (destination-defined shape)").optional(), data: n3.union([pe2, ue2]).optional().describe("Global data transformation applied to all events for this destination"), include: n3.array(n3.string()).optional().describe("Event sections to flatten into context.data"), env: n3.any().meta({ id: "DestinationEnv", title: "Destination.Env", description: "Environment dependencies (destination-defined shape) \u2014 platform, SDK, or mock hook." }).describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Destination instance identifier (defaults to destination key)").optional(), init: n3.boolean().describe("Whether to initialize immediately").optional(), loadScript: n3.boolean().describe("Whether to load external script (for web destinations)").optional(), mapping: ye2.optional().describe("Entity-action specific mapping rules for this destination"), policy: be2.optional().describe("Pre-processing policy rules applied before event mapping"), queue: n3.boolean().describe("Whether to queue events when consent is not granted").optional(), require: n3.array(n3.string()).optional().describe('Defer destination initialization until these collector events fire (e.g., ["consent"])'), logger: it3.optional().describe("Logger configuration (level, handler) to override the collector defaults"), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during destination registration (boolean enables defaults, object configures specifics)"), before: He3.optional().describe("Post-collector transformer chain applied before this destination receives the event. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), next: He3.optional().describe("Post-push transformer chain. Runs after destination push completes; push response is available at ingest._response. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), cache: Ge2.optional().describe("Cache configuration for deduplication; skip push on cache HIT"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this destination"), disabled: n3.boolean().describe("Completely skip this destination (no init, no push, no queue)").optional(), mock: n3.unknown().meta({ id: "DestinationMock", title: "Destination.Mock", description: "Return this value instead of calling push(). Dev/testing only." }).optional().describe("Return this value instead of calling push(). Dev/testing only."), queueMax: n3.number().optional().describe("Maximum consent-denied events retained in queuePush for this destination. FIFO drop on overflow. Default 1000."), dlqMax: n3.number().optional().describe("Maximum failed-push entries retained in dlq for this destination. FIFO drop on overflow. Default 100."), timeout: n3.number().optional().describe("Per-destination delivery timeout in ms (default 10000); a delivery that does not settle in this window is routed to the DLQ like a thrown push."), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).optional().describe("Enables batching for all of this destination's events into one shared default buffer; a mapping rule's own batch splits that entity-action into its own buffer and overrides per field. Bare number is the debounce wait window; object form supports wait (debounce ms), size (count cap, default 1000), age (max ms since first entry, default 30000)."), breaker: n3.union([n3.number(), n3.object({ threshold: n3.number().optional(), cooldown: n3.number().optional() })]).optional().describe("Per-destination circuit breaker (presence-gated). After threshold consecutive transport failures the breaker opens and events are skipped until cooldown ms elapse, then one probe is admitted; success closes it, failure re-opens it. Partial-batch row failures are breaker-neutral. Bare number is the threshold; object form supports threshold (default 5) and cooldown (default 30000ms).") }).meta({ id: "DestinationConfig", title: "Destination.Config", description: "Destination configuration: consent, settings, data, env, mapping rules, policy, queue, logger, before/next chains, cache." }).describe("Destination configuration");
2378
- ot3 = nt2.partial().meta({ id: "DestinationPartialConfig", title: "Destination.PartialConfig", description: "Partial destination configuration with all fields optional." }).describe("Partial destination configuration with all fields optional");
2395
+ it2 = n3.object({ level: n3.union([n3.number(), n3.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: tt2.optional().describe("Custom log handler function") }).meta({ id: "LoggerConfig", title: "Logger.Config", description: "Logger configuration (level, handler) to override the collector defaults" });
2396
+ nt2 = n3.object({ consent: Z2.optional().describe("Required consent states to send events to this destination"), settings: n3.any().meta({ id: "DestinationSettings", title: "Destination.Settings", description: "Implementation-specific configuration (destination-defined shape)." }).describe("Implementation-specific configuration").optional(), credentials: n3.any().meta({ id: "DestinationCredentials", title: "Destination.Credentials", description: "Optional credentials slot (destination-defined shape); supports $env. The per-package shape is supplied via mergeConfigSchema." }).describe("Optional credentials (destination-defined shape)").optional(), data: n3.union([pe2, ue2]).optional().describe("Global data transformation applied to all events for this destination"), include: n3.array(n3.string()).optional().describe("Event sections to flatten into context.data"), env: n3.any().meta({ id: "DestinationEnv", title: "Destination.Env", description: "Environment dependencies (destination-defined shape) \u2014 platform, SDK, or mock hook." }).describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Destination instance identifier (defaults to destination key)").optional(), init: n3.boolean().describe("Whether to initialize immediately").optional(), loadScript: n3.boolean().describe("Whether to load external script (for web destinations)").optional(), mapping: ye2.optional().describe("Entity-action specific mapping rules for this destination"), policy: be2.optional().describe("Pre-processing policy rules applied before event mapping"), queue: n3.boolean().describe("Whether to queue events when consent is not granted").optional(), require: n3.array(n3.string()).optional().describe('Defer destination initialization until these collector events fire (e.g., ["consent"])'), logger: it2.optional().describe("Logger configuration (level, handler) to override the collector defaults"), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during destination registration (boolean enables defaults, object configures specifics)"), before: He2.optional().describe("Post-collector transformer chain applied before this destination receives the event. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), next: He2.optional().describe("Post-push transformer chain. Runs after destination push completes; push response is available at ingest._response. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), cache: Ge3.optional().describe("Cache configuration for deduplication; skip push on cache HIT"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this destination"), disabled: n3.boolean().describe("Completely skip this destination (no init, no push, no queue)").optional(), mock: n3.unknown().meta({ id: "DestinationMock", title: "Destination.Mock", description: "Return this value instead of calling push(). Dev/testing only." }).optional().describe("Return this value instead of calling push(). Dev/testing only."), queueMax: n3.number().optional().describe("Maximum consent-denied events retained in queuePush for this destination. FIFO drop on overflow. Default 1000."), dlqMax: n3.number().optional().describe("Maximum failed-push entries retained in dlq for this destination. FIFO drop on overflow. Default 100."), timeout: n3.number().optional().describe("Per-destination delivery timeout in ms (default 10000); a delivery that does not settle in this window is routed to the DLQ like a thrown push."), batch: n3.union([n3.number(), n3.object({ wait: n3.number().optional(), size: n3.number().optional(), age: n3.number().optional() })]).optional().describe("Enables batching for all of this destination's events into one shared default buffer; a mapping rule's own batch splits that entity-action into its own buffer and overrides per field. Bare number is the debounce wait window; object form supports wait (debounce ms), size (count cap, default 1000), age (max ms since first entry, default 30000)."), breaker: n3.union([n3.number(), n3.object({ threshold: n3.number().optional(), cooldown: n3.number().optional() })]).optional().describe("Per-destination circuit breaker (presence-gated). After threshold consecutive transport failures the breaker opens and events are skipped until cooldown ms elapse, then one probe is admitted; success closes it, failure re-opens it. Partial-batch row failures are breaker-neutral. Bare number is the threshold; object form supports threshold (default 5) and cooldown (default 30000ms).") }).meta({ id: "DestinationConfig", title: "Destination.Config", description: "Destination configuration: consent, settings, data, env, mapping rules, policy, queue, logger, before/next chains, cache." }).describe("Destination configuration");
2397
+ ot2 = nt2.partial().meta({ id: "DestinationPartialConfig", title: "Destination.PartialConfig", description: "Partial destination configuration with all fields optional." }).describe("Partial destination configuration with all fields optional");
2379
2398
  rt2 = be2.describe("Destination policy rules for event pre-processing");
2380
2399
  at2 = n3.object({ collector: n3.unknown().meta({ id: "DestinationContextCollector", title: "Collector.Instance", description: "Collector instance handed to the destination (runtime object)." }).describe("Collector instance (runtime object)"), config: nt2.describe("Destination configuration"), data: n3.union([n3.unknown(), n3.array(n3.unknown())]).optional().describe("Transformed event data"), env: n3.unknown().meta({ id: "DestinationContextEnv", title: "Destination.Env", description: "Environment dependencies (destination-defined shape)." }).describe("Environment dependencies") }).meta({ id: "DestinationContext", title: "Destination.Context", description: "Destination context passed to init and push functions." }).describe("Destination context for init and push functions");
2381
- st2 = at2.extend({ mapping: Se2.optional().describe("Resolved mapping rule for this specific event") }).meta({ id: "DestinationPushContext", title: "Destination.PushContext", description: "Destination context for push() with the resolved event mapping rule." }).describe("Push context with event-specific mapping");
2400
+ st2 = at2.extend({ mapping: Se3.optional().describe("Resolved mapping rule for this specific event") }).meta({ id: "DestinationPushContext", title: "Destination.PushContext", description: "Destination context for push() with the resolved event mapping rule." }).describe("Push context with event-specific mapping");
2382
2401
  ct3 = st2.describe("Batch push context with event-specific mapping");
2383
- lt2 = n3.object({ event: Y2.describe("The event to process"), mapping: Se2.optional().describe("Mapping rule for this event") }).meta({ id: "DestinationPushEvent", title: "Destination.PushEvent", description: "Single event paired with its resolved mapping rule (batch element)." }).describe("Event with optional mapping for batch processing");
2402
+ lt2 = n3.object({ event: Y2.describe("The event to process"), mapping: Se3.optional().describe("Mapping rule for this event") }).meta({ id: "DestinationPushEvent", title: "Destination.PushEvent", description: "Single event paired with its resolved mapping rule (batch element)." }).describe("Event with optional mapping for batch processing");
2384
2403
  dt3 = n3.array(lt2).meta({ id: "DestinationPushEvents", title: "Destination.PushEvents", description: "Array of events with mappings (batch input)." }).describe("Array of events with mappings");
2385
- pt3 = n3.object({ key: n3.string().describe('Batch key (usually mapping key like "product.view")'), events: n3.array(Y2).describe("Array of events in batch"), data: n3.array(n3.union([n3.unknown(), n3.array(n3.unknown())]).optional()).describe("Transformed data for each event"), mapping: Se2.optional().describe("Shared mapping rule for batch") }).meta({ id: "DestinationBatch", title: "Destination.Batch", description: "Batch of events grouped by mapping key for batch delivery." }).describe("Batch of events grouped by mapping key");
2404
+ pt3 = n3.object({ key: n3.string().describe('Batch key (usually mapping key like "product.view")'), events: n3.array(Y2).describe("Array of events in batch"), data: n3.array(n3.union([n3.unknown(), n3.array(n3.unknown())]).optional()).describe("Transformed data for each event"), mapping: Se3.optional().describe("Shared mapping rule for batch") }).meta({ id: "DestinationBatch", title: "Destination.Batch", description: "Batch of events grouped by mapping key for batch delivery." }).describe("Batch of events grouped by mapping key");
2386
2405
  ut3 = n3.union([n3.unknown(), n3.array(n3.unknown())]).meta({ id: "DestinationData", title: "Destination.Data", description: "Transformed event data delivered to the destination (Property, undefined, or array)." }).optional().describe("Transformed event data (Property, undefined, or array)");
2387
2406
  mt3 = n3.object({ config: nt2.describe("Destination configuration"), queue: n3.array(Y2).optional().describe("Queued events awaiting consent"), dlq: n3.array(n3.tuple([Y2, n3.unknown()])).optional().describe("Dead letter queue (failed events with errors)"), type: n3.string().optional().describe("Destination type identifier"), env: n3.unknown().optional().describe("Environment dependencies"), init: n3.unknown().optional().describe("Initialization function"), push: n3.unknown().describe("Push function for single events"), pushBatch: n3.unknown().optional().describe("Batch push function"), on: n3.unknown().optional().describe("Event lifecycle hook function") }).meta({ id: "DestinationInstance", title: "Destination.Instance", description: "Destination instance (runtime object with init/push/pushBatch/on)." }).describe("Destination instance (runtime object with functions)");
2388
- ft3 = n3.object({ code: mt3.describe("Destination instance with implementation"), config: ot3.optional().describe("Partial configuration overrides"), env: n3.unknown().optional().describe("Partial environment overrides") }).meta({ id: "DestinationInit", title: "Destination.Init", description: "Destination initialization bundle (instance code + config + env)." }).describe("Destination initialization configuration");
2389
- gt3 = n3.record(n3.string(), ft3).meta({ id: "DestinationInitDestinations", title: "Destination.InitDestinations", description: "Map of destination IDs to initialization configurations." }).describe("Map of destination IDs to initialization configurations");
2407
+ ft2 = n3.object({ code: mt3.describe("Destination instance with implementation"), config: ot2.optional().describe("Partial configuration overrides"), env: n3.unknown().optional().describe("Partial environment overrides") }).meta({ id: "DestinationInit", title: "Destination.Init", description: "Destination initialization bundle (instance code + config + env)." }).describe("Destination initialization configuration");
2408
+ gt2 = n3.record(n3.string(), ft2).meta({ id: "DestinationInitDestinations", title: "Destination.InitDestinations", description: "Map of destination IDs to initialization configurations." }).describe("Map of destination IDs to initialization configurations");
2390
2409
  ht3 = n3.record(n3.string(), mt3).meta({ id: "DestinationDestinations", title: "Destination.Destinations", description: "Map of destination IDs to runtime destination instances." }).describe("Map of destination IDs to runtime instances");
2391
- bt2 = n3.object({ type: n3.string().describe('Destination type ("gtag", "meta", "bigquery")'), data: n3.unknown().optional().describe("Response from push()"), error: n3.unknown().optional().describe("Error if failed") }).meta({ id: "DestinationRef", title: "Destination.Ref", description: "Reference to a destination outcome (type + response data or error)." }).describe("Destination reference with type and response data");
2392
- vt2 = n3.object({ queue: n3.array(Y2).optional().describe("Events queued (awaiting consent)"), error: n3.unknown().optional().describe("Error if push failed") }).meta({ id: "DestinationPushResult", title: "Destination.PushResult", description: "Result of a single destination push (queued events, optional error)." }).describe("Push operation result");
2393
- St = n3.object({ ok: n3.boolean().describe("True if nothing failed"), event: n3.unknown().optional().describe("The processed event"), done: n3.record(n3.string(), bt2).optional().describe("Destinations that processed successfully"), queued: n3.record(n3.string(), bt2).optional().describe("Destinations that queued events"), failed: n3.record(n3.string(), bt2).optional().describe("Destinations that failed to process") }).meta({ id: "DestinationResult", title: "Destination.Result", description: "Overall push result aggregated across all destinations (done/queued/failed maps)." }).describe("Push result with destination outcomes");
2410
+ bt3 = n3.object({ type: n3.string().describe('Destination type ("gtag", "meta", "bigquery")'), data: n3.unknown().optional().describe("Response from push()"), error: n3.unknown().optional().describe("Error if failed") }).meta({ id: "DestinationRef", title: "Destination.Ref", description: "Reference to a destination outcome (type + response data or error)." }).describe("Destination reference with type and response data");
2411
+ vt3 = n3.object({ queue: n3.array(Y2).optional().describe("Events queued (awaiting consent)"), error: n3.unknown().optional().describe("Error if push failed") }).meta({ id: "DestinationPushResult", title: "Destination.PushResult", description: "Result of a single destination push (queued events, optional error)." }).describe("Push operation result");
2412
+ St = n3.object({ ok: n3.boolean().describe("True if nothing failed"), event: n3.unknown().optional().describe("The processed event"), done: n3.record(n3.string(), bt3).optional().describe("Destinations that processed successfully"), queued: n3.record(n3.string(), bt3).optional().describe("Destinations that queued events"), failed: n3.record(n3.string(), bt3).optional().describe("Destinations that failed to process") }).meta({ id: "DestinationResult", title: "Destination.Result", description: "Overall push result aggregated across all destinations (done/queued/failed maps)." }).describe("Push result with destination outcomes");
2394
2413
  yt3 = n3.array(n3.tuple([Y2, n3.unknown()])).meta({ id: "DestinationDLQ", title: "Destination.DLQ", description: "Dead-letter queue: list of [event, error] tuples." }).describe("Dead letter queue: [(event, error), ...]");
2395
- wt2 = o2(nt2);
2396
- kt = o2(ot3);
2414
+ wt3 = o2(nt2);
2415
+ kt2 = o2(ot2);
2397
2416
  Ct2 = o2(at2);
2398
- xt2 = o2(st2);
2417
+ xt = o2(st2);
2399
2418
  jt2 = o2(pt3);
2400
- Pt2 = o2(mt3);
2419
+ Pt3 = o2(mt3);
2401
2420
  Dt3 = o2(St);
2402
- Et3 = {};
2403
- t3(Et3, { CommandTypeSchema: () => Ot2, ConfigSchema: () => It, DestinationsSchema: () => Ft2, InitConfigSchema: () => Rt3, InstanceSchema: () => $t2, PushContextSchema: () => Mt3, SessionDataSchema: () => Jt2, SourcesSchema: () => Tt2, commandTypeJsonSchema: () => zt, configJsonSchema: () => At2, initConfigJsonSchema: () => qt, instanceJsonSchema: () => Wt2, pushContextJsonSchema: () => Nt2, sessionDataJsonSchema: () => Lt3 });
2421
+ Et2 = {};
2422
+ t3(Et2, { CommandTypeSchema: () => Ot2, ConfigSchema: () => It2, DestinationsSchema: () => Ft2, InitConfigSchema: () => Rt, InstanceSchema: () => $t2, PushContextSchema: () => Mt2, SessionDataSchema: () => Jt2, SourcesSchema: () => Tt2, commandTypeJsonSchema: () => zt2, configJsonSchema: () => At2, initConfigJsonSchema: () => qt2, instanceJsonSchema: () => Wt2, pushContextJsonSchema: () => Nt, sessionDataJsonSchema: () => Lt2 });
2404
2423
  Ot2 = n3.union([n3.enum(["action", "config", "consent", "context", "destination", "elb", "globals", "hook", "init", "link", "run", "user", "walker"]), n3.string()]).meta({ id: "CollectorCommandType", title: "Collector.CommandType", description: "Collector command type identifier (standard or extension string)." }).describe("Collector command type: standard commands or custom string for extensions");
2405
- It = n3.object({ run: n3.boolean().describe("Whether to run collector automatically on initialization").optional(), globalsStatic: _2.describe("Static global properties that persist across collector runs"), sessionStatic: n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorSessionStatic", title: "Collector.SessionStatic", description: "Static session data that persists across collector runs." }).describe("Static session data that persists across collector runs"), logger: it3.optional().describe("Logger configuration (level, handler)"), queueMax: n3.number().optional().describe("Maximum events retained in collector.queue (late-registration replay). FIFO drop on overflow. Default 1000.") }).meta({ id: "CollectorConfig", title: "Collector.Config", description: "Core collector configuration (globals/session statics, logger, buffer bounds)." }).describe("Core collector configuration");
2424
+ It2 = n3.object({ run: n3.boolean().describe("Whether to run collector automatically on initialization").optional(), globalsStatic: _2.describe("Static global properties that persist across collector runs"), sessionStatic: n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorSessionStatic", title: "Collector.SessionStatic", description: "Static session data that persists across collector runs." }).describe("Static session data that persists across collector runs"), logger: it2.optional().describe("Logger configuration (level, handler)"), queueMax: n3.number().optional().describe("Maximum events retained in collector.queue (late-registration replay). FIFO drop on overflow. Default 1000.") }).meta({ id: "CollectorConfig", title: "Collector.Config", description: "Core collector configuration (globals/session statics, logger, buffer bounds)." }).describe("Core collector configuration");
2406
2425
  Jt2 = _2.and(n3.object({ isStart: n3.boolean().describe("Whether this is a new session start"), storage: n3.boolean().describe("Whether storage is available"), id: c.describe("Session identifier").optional(), start: l2.describe("Session start timestamp").optional(), marketing: n3.literal(true).optional().describe("Marketing attribution flag"), updated: l2.describe("Last update timestamp").optional(), isNew: n3.boolean().describe("Whether this is a new session").optional(), device: c.describe("Device identifier").optional(), count: d.describe("Event count in session").optional(), runs: d.describe("Number of runs").optional() })).meta({ id: "CollectorSessionData", title: "Collector.SessionData", description: "Session state and tracking data." }).describe("Session state and tracking data");
2407
- Rt3 = It.partial().extend({ consent: Z2.optional().describe("Initial consent state"), user: G3.optional().describe("Initial user data"), globals: _2.optional().describe("Initial global properties"), sources: n3.unknown().meta({ id: "CollectorInitSources", title: "Source.InitSources", description: "Source configurations map (id \u2192 InitSource)." }).optional().describe("Source configurations"), destinations: n3.unknown().meta({ id: "CollectorInitDestinations", title: "Destination.InitDestinations", description: "Destination configurations map (id \u2192 Init)." }).optional().describe("Destination configurations"), transformers: n3.unknown().meta({ id: "CollectorInitTransformers", title: "Transformer.Configs", description: "Transformer configurations map (id \u2192 Config)." }).optional().describe("Transformer configurations"), stores: n3.unknown().meta({ id: "CollectorInitStores", title: "Store.Configs", description: "Store configurations map (id \u2192 Config)." }).optional().describe("Store configurations"), custom: _2.optional().describe("Initial custom implementation-specific properties"), hooks: n3.unknown().meta({ id: "CollectorHooks", title: "Collector.Hooks", description: "Pipeline observation hooks." }).optional().describe("Pipeline observation hooks") }).meta({ id: "CollectorInitConfig", title: "Collector.InitConfig", description: "Collector initialization configuration with initial state (consent, user, globals, components, hooks)." }).describe("Collector initialization configuration with initial state");
2408
- Mt3 = n3.object({ mapping: we2.optional().describe("Source-level mapping configuration") }).meta({ id: "CollectorPushContext", title: "Collector.PushContext", description: "Push context with optional source-level mapping." }).describe("Push context with optional source mapping");
2426
+ Rt = It2.partial().extend({ consent: Z2.optional().describe("Initial consent state"), user: G3.optional().describe("Initial user data"), globals: _2.optional().describe("Initial global properties"), sources: n3.unknown().meta({ id: "CollectorInitSources", title: "Source.InitSources", description: "Source configurations map (id \u2192 InitSource)." }).optional().describe("Source configurations"), destinations: n3.unknown().meta({ id: "CollectorInitDestinations", title: "Destination.InitDestinations", description: "Destination configurations map (id \u2192 Init)." }).optional().describe("Destination configurations"), transformers: n3.unknown().meta({ id: "CollectorInitTransformers", title: "Transformer.Configs", description: "Transformer configurations map (id \u2192 Config)." }).optional().describe("Transformer configurations"), stores: n3.unknown().meta({ id: "CollectorInitStores", title: "Store.Configs", description: "Store configurations map (id \u2192 Config)." }).optional().describe("Store configurations"), custom: _2.optional().describe("Initial custom implementation-specific properties"), hooks: n3.unknown().meta({ id: "CollectorHooks", title: "Collector.Hooks", description: "Pipeline observation hooks." }).optional().describe("Pipeline observation hooks") }).meta({ id: "CollectorInitConfig", title: "Collector.InitConfig", description: "Collector initialization configuration with initial state (consent, user, globals, components, hooks)." }).describe("Collector initialization configuration with initial state");
2427
+ Mt2 = n3.object({ mapping: we2.optional().describe("Source-level mapping configuration") }).meta({ id: "CollectorPushContext", title: "Collector.PushContext", description: "Push context with optional source-level mapping." }).describe("Push context with optional source mapping");
2409
2428
  Tt2 = n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorSources", title: "Collector.Sources", description: "Map of source IDs to runtime source instances." }).describe("Map of source IDs to source instances");
2410
2429
  Ft2 = n3.record(n3.string(), n3.unknown()).meta({ id: "CollectorDestinations", title: "Collector.Destinations", description: "Map of destination IDs to runtime destination instances." }).describe("Map of destination IDs to destination instances");
2411
- $t2 = n3.object({ push: n3.unknown().describe("Push function for processing events"), command: n3.unknown().describe("Command function for walker commands"), allowed: n3.boolean().describe("Whether event processing is allowed"), config: It.describe("Current collector configuration"), consent: Z2.describe("Current consent state"), custom: _2.describe("Custom implementation-specific properties"), sources: Tt2.describe("Registered source instances"), destinations: Ft2.describe("Registered destination instances"), globals: _2.describe("Current global properties"), hooks: n3.unknown().describe("Lifecycle hook functions"), on: n3.unknown().describe("Event lifecycle configuration"), queue: n3.array(Y2).describe("Queued events awaiting processing"), round: n3.number().describe("Collector run count (increments with each run)"), session: n3.union([Jt2]).describe("Current session state"), timing: n3.number().describe("Event processing timing information"), user: G3.describe("Current user data") }).meta({ id: "CollectorInstance", title: "Collector.Instance", description: "Collector instance (runtime object with push/command + full state and component maps)." }).describe("Collector instance with state and methods");
2412
- zt = o2(Ot2);
2413
- At2 = o2(It);
2414
- Lt3 = o2(Jt2);
2415
- qt = o2(Rt3);
2416
- Nt2 = o2(Mt3);
2430
+ $t2 = n3.object({ push: n3.unknown().describe("Push function for processing events"), command: n3.unknown().describe("Command function for walker commands"), allowed: n3.boolean().describe("Whether event processing is allowed"), config: It2.describe("Current collector configuration"), consent: Z2.describe("Current consent state"), custom: _2.describe("Custom implementation-specific properties"), sources: Tt2.describe("Registered source instances"), destinations: Ft2.describe("Registered destination instances"), globals: _2.describe("Current global properties"), hooks: n3.unknown().describe("Lifecycle hook functions"), on: n3.unknown().describe("Event lifecycle configuration"), queue: n3.array(Y2).describe("Queued events awaiting processing"), round: n3.number().describe("Collector run count (increments with each run)"), session: n3.union([Jt2]).describe("Current session state"), timing: n3.number().describe("Event processing timing information"), user: G3.describe("Current user data") }).meta({ id: "CollectorInstance", title: "Collector.Instance", description: "Collector instance (runtime object with push/command + full state and component maps)." }).describe("Collector instance with state and methods");
2431
+ zt2 = o2(Ot2);
2432
+ At2 = o2(It2);
2433
+ Lt2 = o2(Jt2);
2434
+ qt2 = o2(Rt);
2435
+ Nt = o2(Mt2);
2417
2436
  Wt2 = o2($t2);
2418
2437
  Bt2 = {};
2419
- t3(Bt2, { BaseEnvSchema: () => Ut2, ConfigSchema: () => _t2, InitSchema: () => Zt3, InitSourceSchema: () => Gt, InitSourcesSchema: () => Kt2, InstanceSchema: () => Vt, PartialConfigSchema: () => Ht2, baseEnvJsonSchema: () => Qt2, configJsonSchema: () => Xt, initSourceJsonSchema: () => ti, initSourcesJsonSchema: () => ii, instanceJsonSchema: () => ei, partialConfigJsonSchema: () => Yt });
2420
- Ut2 = n3.object({ push: n3.unknown().meta({ id: "SourcePushFn", title: "Source.PushFn", description: "Collector push function passed to the source via dependency injection." }).describe("Collector push function"), command: n3.unknown().meta({ id: "SourceCommandFn", title: "Source.CommandFn", description: "Collector command function passed to the source." }).describe("Collector command function"), sources: n3.unknown().optional().describe("Map of registered source instances"), elb: n3.unknown().meta({ id: "ElbFn", title: "Elb.Fn", description: "Public `elb(...)` API function alias for collector.push." }).describe("Public API function (alias for collector.push)") }).catchall(n3.unknown()).meta({ id: "SourceBaseEnv", title: "Source.BaseEnv", description: "Base environment for source dependency injection; platform-specific sources extend this." }).describe("Base environment for dependency injection - platform-specific sources extend this");
2421
- _t2 = we2.extend({ settings: n3.any().meta({ id: "SourceSettings", title: "Source.Settings", description: "Implementation-specific configuration (source-defined shape)." }).describe("Implementation-specific configuration").optional(), credentials: n3.any().meta({ id: "SourceCredentials", title: "Source.Credentials", description: "Optional credentials slot (source-defined shape); supports $env. The per-package shape is supplied via mergeConfigSchema." }).describe("Optional credentials (source-defined shape)").optional(), env: Ut2.optional().describe("Environment dependencies (platform-specific)"), id: c.describe("Source identifier (defaults to source key)").optional(), primary: n3.boolean().describe("Mark as primary (only one can be primary)").optional(), require: n3.array(n3.string()).optional().describe('Defer source initialization until these collector events fire (e.g., ["consent"])'), logger: it3.optional().describe("Logger configuration (level, handler) to override the collector defaults"), async: n3.boolean().optional().describe('Respond-first acknowledgement for response-producing server sources (express today; future fetch/lambda). When true (the default for such sources) the source responds 2xx ("accepted") before the event is delivered; when false it waits for delivery to settle. Browser/dataLayer sources have no HTTP response to defer and ignore it. A 2xx means accepted, not delivered. Default is per source type.'), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during source registration (boolean enables defaults, object configures specifics)"), ingest: n3.union([pe2, ue2]).optional().describe("Ingest metadata extraction mapping. Extracts values from raw request objects (Express req, Lambda event) using mapping syntax."), disabled: n3.boolean().describe("Completely skip this source (no init, no event capture)").optional(), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this source"), init: n3.boolean().optional().describe("Init lifecycle flag set by collector to true after Instance.init() runs") }).meta({ id: "SourceConfig", title: "Source.Config", description: "Source configuration with mapping, environment, and lifecycle hooks." }).describe("Source configuration with mapping and environment");
2422
- Ht2 = _t2.partial().meta({ id: "SourcePartialConfig", title: "Source.PartialConfig", description: "Partial source configuration with all fields optional." }).describe("Partial source configuration with all fields optional");
2423
- Vt = n3.object({ type: n3.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: _t2.describe("Current source configuration"), push: n3.any().meta({ id: "SourceInstancePushFn", title: "Source.PushFn", description: "Push function \u2014 THE HANDLER (flexible signature for platform compatibility)." }).describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: n3.any().meta({ id: "SourceDestroyFn", title: "Source.DestroyFn", description: "Cleanup function called when the source is removed." }).optional().describe("Cleanup function called when source is removed"), on: n3.unknown().optional().describe("Lifecycle hook function for event types") }).meta({ id: "SourceInstance", title: "Source.Instance", description: "Source instance (runtime object with push handler and lifecycle methods)." }).describe("Source instance with push handler and lifecycle methods");
2424
- Zt3 = n3.any().meta({ id: "SourceInit", title: "Source.Init", description: "Source initialization function: (config, env) => Instance | Promise<Instance>." }).describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
2425
- Gt = n3.object({ code: Zt3.describe("Source initialization function"), config: Ht2.optional().describe("Partial configuration overrides"), env: Ut2.partial().optional().describe("Partial environment overrides"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this source"), primary: n3.boolean().optional().describe("Mark as primary source (only one can be primary)") }).meta({ id: "SourceInitSource", title: "Source.InitSource", description: "Source initialization bundle (init function + config + env + primary flag)." }).describe("Source initialization configuration");
2426
- Kt2 = n3.record(n3.string(), Gt).meta({ id: "SourceInitSources", title: "Source.InitSources", description: "Map of source IDs to initialization configurations." }).describe("Map of source IDs to initialization configurations");
2427
- Qt2 = o2(Ut2);
2428
- Xt = o2(_t2);
2429
- Yt = o2(Ht2);
2430
- ei = o2(Vt);
2431
- ti = o2(Gt);
2438
+ t3(Bt2, { BaseEnvSchema: () => Ut, ConfigSchema: () => _t, InitSchema: () => Zt2, InitSourceSchema: () => Gt3, InitSourcesSchema: () => Kt2, InstanceSchema: () => Vt2, PartialConfigSchema: () => Ht2, baseEnvJsonSchema: () => Qt2, configJsonSchema: () => Xt, initSourceJsonSchema: () => ti, initSourcesJsonSchema: () => ii, instanceJsonSchema: () => ei, partialConfigJsonSchema: () => Yt2 });
2439
+ Ut = n3.object({ push: n3.unknown().meta({ id: "SourcePushFn", title: "Source.PushFn", description: "Collector push function passed to the source via dependency injection." }).describe("Collector push function"), command: n3.unknown().meta({ id: "SourceCommandFn", title: "Source.CommandFn", description: "Collector command function passed to the source." }).describe("Collector command function"), sources: n3.unknown().optional().describe("Map of registered source instances"), elb: n3.unknown().meta({ id: "ElbFn", title: "Elb.Fn", description: "Public `elb(...)` API function alias for collector.push." }).describe("Public API function (alias for collector.push)") }).catchall(n3.unknown()).meta({ id: "SourceBaseEnv", title: "Source.BaseEnv", description: "Base environment for source dependency injection; platform-specific sources extend this." }).describe("Base environment for dependency injection - platform-specific sources extend this");
2440
+ _t = we2.extend({ settings: n3.any().meta({ id: "SourceSettings", title: "Source.Settings", description: "Implementation-specific configuration (source-defined shape)." }).describe("Implementation-specific configuration").optional(), credentials: n3.any().meta({ id: "SourceCredentials", title: "Source.Credentials", description: "Optional credentials slot (source-defined shape); supports $env. The per-package shape is supplied via mergeConfigSchema." }).describe("Optional credentials (source-defined shape)").optional(), env: Ut.optional().describe("Environment dependencies (platform-specific)"), id: c.describe("Source identifier (defaults to source key)").optional(), primary: n3.boolean().describe("Mark as primary (only one can be primary)").optional(), require: n3.array(n3.string()).optional().describe('Defer source initialization until these collector events fire (e.g., ["consent"])'), logger: it2.optional().describe("Logger configuration (level, handler) to override the collector defaults"), async: n3.boolean().optional().describe('Respond-first acknowledgement for response-producing server sources (express today; future fetch/lambda). When true (the default for such sources) the source responds 2xx ("accepted") before the event is delivered; when false it waits for delivery to settle. Browser/dataLayer sources have no HTTP response to defer and ignore it. A 2xx means accepted, not delivered. Default is per source type.'), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during source registration (boolean enables defaults, object configures specifics)"), ingest: n3.union([pe2, ue2]).optional().describe("Ingest metadata extraction mapping. Extracts values from raw request objects (Express req, Lambda event) using mapping syntax."), disabled: n3.boolean().describe("Completely skip this source (no init, no event capture)").optional(), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this source"), init: n3.boolean().optional().describe("Init lifecycle flag set by collector to true after Instance.init() runs") }).meta({ id: "SourceConfig", title: "Source.Config", description: "Source configuration with mapping, environment, and lifecycle hooks." }).describe("Source configuration with mapping and environment");
2441
+ Ht2 = _t.partial().meta({ id: "SourcePartialConfig", title: "Source.PartialConfig", description: "Partial source configuration with all fields optional." }).describe("Partial source configuration with all fields optional");
2442
+ Vt2 = n3.object({ type: n3.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: _t.describe("Current source configuration"), push: n3.any().meta({ id: "SourceInstancePushFn", title: "Source.PushFn", description: "Push function \u2014 THE HANDLER (flexible signature for platform compatibility)." }).describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: n3.any().meta({ id: "SourceDestroyFn", title: "Source.DestroyFn", description: "Cleanup function called when the source is removed." }).optional().describe("Cleanup function called when source is removed"), on: n3.unknown().optional().describe("Lifecycle hook function for event types") }).meta({ id: "SourceInstance", title: "Source.Instance", description: "Source instance (runtime object with push handler and lifecycle methods)." }).describe("Source instance with push handler and lifecycle methods");
2443
+ Zt2 = n3.any().meta({ id: "SourceInit", title: "Source.Init", description: "Source initialization function: (config, env) => Instance | Promise<Instance>." }).describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
2444
+ Gt3 = n3.object({ code: Zt2.describe("Source initialization function"), config: Ht2.optional().describe("Partial configuration overrides"), env: Ut.partial().optional().describe("Partial environment overrides"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this source"), primary: n3.boolean().optional().describe("Mark as primary source (only one can be primary)") }).meta({ id: "SourceInitSource", title: "Source.InitSource", description: "Source initialization bundle (init function + config + env + primary flag)." }).describe("Source initialization configuration");
2445
+ Kt2 = n3.record(n3.string(), Gt3).meta({ id: "SourceInitSources", title: "Source.InitSources", description: "Map of source IDs to initialization configurations." }).describe("Map of source IDs to initialization configurations");
2446
+ Qt2 = o2(Ut);
2447
+ Xt = o2(_t);
2448
+ Yt2 = o2(Ht2);
2449
+ ei = o2(Vt2);
2450
+ ti = o2(Gt3);
2432
2451
  ii = o2(Kt2);
2433
2452
  ni = {};
2434
2453
  t3(ni, { ConfigSchema: () => oi, PartialConfigSchema: () => ri, configJsonSchema: () => ai, partialConfigJsonSchema: () => si });
2435
- oi = n3.object({ settings: n3.any().meta({ id: "TransformerSettings", title: "Transformer.Settings", description: "Implementation-specific configuration (transformer-defined shape)." }).describe("Implementation-specific configuration").optional(), env: n3.any().meta({ id: "TransformerEnv", title: "Transformer.Env", description: "Environment dependencies (transformer-defined shape)." }).describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Transformer instance identifier (defaults to transformer key)").optional(), logger: it3.optional().describe("Logger configuration (level, handler) to override the collector defaults"), before: We3.optional().describe("Pre-transformer chain that runs before this transformer pushes"), next: We3.optional().describe("Graph wiring to the next transformer in the chain"), cache: Ge2.optional().describe("Step-level cache configuration for this transformer"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this transformer"), init: n3.boolean().describe("Whether to initialize immediately").optional(), disabled: n3.boolean().describe("Completely skip this transformer in chains").optional(), mock: n3.unknown().meta({ id: "TransformerMock", title: "Transformer.Mock", description: "Return this value instead of calling push(). Dev/testing only." }).optional().describe("Return this value instead of calling push(). Global mock for all chains. Dev/testing only."), chainMocks: n3.record(n3.string(), n3.unknown().meta({ id: "TransformerChainMock", title: "Transformer.ChainMock", description: "Chain-path-specific mock value. Dev/testing only." })).optional().describe("Path-specific mock values keyed by chain path. Takes precedence over global mock. Dev/testing only."), mapping: we2.optional().describe("Declarative event-to-event mapping applied when this transformer step has no code. At this position, only event-mutating fields apply (policy, mapping[].policy, mapping[].name, mapping[].ignore, mapping[].consent, include); vendor-payload fields are ignored.") }).strict().meta({ id: "TransformerConfig", title: "Transformer.Config", description: "Transformer configuration (settings, env, chain wiring, cache, mocks)." }).describe("Transformer configuration");
2454
+ oi = n3.object({ settings: n3.any().meta({ id: "TransformerSettings", title: "Transformer.Settings", description: "Implementation-specific configuration (transformer-defined shape)." }).describe("Implementation-specific configuration").optional(), env: n3.any().meta({ id: "TransformerEnv", title: "Transformer.Env", description: "Environment dependencies (transformer-defined shape)." }).describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Transformer instance identifier (defaults to transformer key)").optional(), logger: it2.optional().describe("Logger configuration (level, handler) to override the collector defaults"), before: We3.optional().describe("Pre-transformer chain that runs before this transformer pushes"), next: We3.optional().describe("Graph wiring to the next transformer in the chain"), cache: Ge3.optional().describe("Step-level cache configuration for this transformer"), state: n3.union([et2, n3.array(et2)]).optional().describe("Declarative store get/set operations applied around this transformer"), init: n3.boolean().describe("Whether to initialize immediately").optional(), disabled: n3.boolean().describe("Completely skip this transformer in chains").optional(), mock: n3.unknown().meta({ id: "TransformerMock", title: "Transformer.Mock", description: "Return this value instead of calling push(). Dev/testing only." }).optional().describe("Return this value instead of calling push(). Global mock for all chains. Dev/testing only."), chainMocks: n3.record(n3.string(), n3.unknown().meta({ id: "TransformerChainMock", title: "Transformer.ChainMock", description: "Chain-path-specific mock value. Dev/testing only." })).optional().describe("Path-specific mock values keyed by chain path. Takes precedence over global mock. Dev/testing only."), mapping: we2.optional().describe("Declarative event-to-event mapping applied when this transformer step has no code. At this position, only event-mutating fields apply (policy, mapping[].policy, mapping[].name, mapping[].ignore, mapping[].consent, include); vendor-payload fields are ignored.") }).strict().meta({ id: "TransformerConfig", title: "Transformer.Config", description: "Transformer configuration (settings, env, chain wiring, cache, mocks)." }).describe("Transformer configuration");
2436
2455
  ri = oi.partial().meta({ id: "TransformerPartialConfig", title: "Transformer.PartialConfig", description: "Partial transformer configuration with all fields optional." }).describe("Partial transformer configuration with all fields optional");
2437
2456
  ai = o2(oi);
2438
2457
  si = o2(ri);
2439
2458
  ci = {};
2440
2459
  t3(ci, { ConfigSchema: () => li, PartialConfigSchema: () => di, configJsonSchema: () => pi, partialConfigJsonSchema: () => ui });
2441
- li = n3.object({ settings: n3.unknown().meta({ id: "StoreSettings", title: "Store.Settings", description: "Implementation-specific configuration (store-defined shape)." }).describe("Implementation-specific configuration").optional(), credentials: n3.unknown().meta({ id: "StoreCredentials", title: "Store.Credentials", description: "Optional credentials slot (store-defined shape); supports $env. The per-package shape is supplied via mergeConfigSchema." }).describe("Optional credentials (store-defined shape)").optional(), env: n3.unknown().meta({ id: "StoreEnv", title: "Store.Env", description: "Environment dependencies (store-defined shape)." }).describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Store instance identifier (defaults to store key)").optional(), logger: it3.optional().describe("Logger configuration (level, handler) to override the collector defaults"), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during store registration (boolean enables defaults, object configures specifics)"), file: n3.boolean().optional().describe("Persist values as raw bytes (byte-exact), bypassing the structured codec. Default false (structured). Set true only on byte-native stores for asset serving; sheets rejects it.") }).meta({ id: "StoreConfig", title: "Store.Config", description: "Store configuration (settings, env, logger): key-value infrastructure component." }).describe("Store configuration");
2460
+ li = n3.object({ settings: n3.unknown().meta({ id: "StoreSettings", title: "Store.Settings", description: "Implementation-specific configuration (store-defined shape)." }).describe("Implementation-specific configuration").optional(), credentials: n3.unknown().meta({ id: "StoreCredentials", title: "Store.Credentials", description: "Optional credentials slot (store-defined shape); supports $env. The per-package shape is supplied via mergeConfigSchema." }).describe("Optional credentials (store-defined shape)").optional(), env: n3.unknown().meta({ id: "StoreEnv", title: "Store.Env", description: "Environment dependencies (store-defined shape)." }).describe("Environment dependencies (platform-specific)").optional(), id: c.describe("Store instance identifier (defaults to store key)").optional(), logger: it2.optional().describe("Logger configuration (level, handler) to override the collector defaults"), setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during store registration (boolean enables defaults, object configures specifics)"), file: n3.boolean().optional().describe("Persist values as raw bytes (byte-exact), bypassing the structured codec. Default false (structured). Set true only on byte-native stores for asset serving; sheets rejects it.") }).meta({ id: "StoreConfig", title: "Store.Config", description: "Store configuration (settings, env, logger): key-value infrastructure component." }).describe("Store configuration");
2442
2461
  di = li.partial().meta({ id: "StorePartialConfig", title: "Store.PartialConfig", description: "Partial store configuration with all fields optional." }).describe("Partial store configuration with all fields optional");
2443
2462
  pi = o2(li);
2444
2463
  ui = o2(di);
@@ -2455,10 +2474,10 @@ var init_dev = __esm({
2455
2474
  ki = n3.record(n3.string(), wi).meta({ id: "FlowStepExamples", title: "Flow.StepExamples", description: "Named step examples keyed by scenario name." }).describe("Named step examples for testing and documentation");
2456
2475
  Ci = n3.record(n3.string(), n3.unknown()).meta({ id: "JsonSchema", title: "JsonSchema", description: "Structural JSON Schema fragment (Record<string, unknown>)" });
2457
2476
  xi = n3.record(n3.string(), n3.record(n3.string(), Ci)).meta({ id: "ValidateEvents", title: "ValidateEvents", description: "Entity-action keyed JSON Schemas" }).describe("Entity-action keyed JSON Schemas");
2458
- Pi = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.looseObject({ setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during source registration (boolean enables defaults, object configures specifics)") }).meta({ id: "FlowSourceConfig", title: "Source.Config", description: "Source-specific configuration object (Source.Config)." }).optional().describe("Source-specific configuration object"), env: n3.unknown().meta({ id: "FlowSourceEnv", title: "Source.BaseEnv", description: "Source environment configuration (Source.BaseEnv overrides)." }).optional().describe("Source environment configuration"), primary: n3.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."), variables: fi.optional().describe("Source-level variables (highest priority in cascade)"), next: We3.optional().describe("Pre-collector transformer chain. String, string[], or Route[] for conditional routing based on ingest data."), before: We3.optional().describe("Pre-source transformer chain (consent-exempt). Handles transport-level preprocessing."), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ge2.optional().describe("Cache configuration for this source (match \u2192 key \u2192 ttl rules)") }).meta({ id: "FlowSource", title: "Flow.Source", description: "Source package reference with configuration, env, chains, and examples." }).describe("Source package reference with configuration").superRefine(ji);
2459
- Di = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.unknown().meta({ id: "FlowTransformerConfig", title: "Transformer.Config", description: "Transformer-specific configuration object." }).optional().describe("Transformer-specific configuration object"), env: n3.unknown().meta({ id: "FlowTransformerEnv", title: "Transformer.Env", description: "Transformer environment configuration." }).optional().describe("Transformer environment configuration"), before: We3.optional().describe("Pre-transformer chain. Runs before this transformer push function."), next: We3.optional().describe("Next transformer in chain. String, string[], or Route[] for conditional routing."), variables: fi.optional().describe("Transformer-level variables (highest priority in cascade)"), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ge2.optional().describe("Cache configuration for this transformer (match \u2192 key \u2192 ttl rules)") }).meta({ id: "FlowTransformer", title: "Flow.Transformer", description: "Transformer package reference with configuration, env, chains, and cache." }).describe("Transformer package reference with configuration").superRefine(ji);
2460
- Ei = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.looseObject({ setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during destination registration (boolean enables defaults, object configures specifics)") }).meta({ id: "FlowDestinationConfig", title: "Destination.Config", description: "Destination-specific configuration object." }).optional().describe("Destination-specific configuration object"), env: n3.unknown().meta({ id: "FlowDestinationEnv", title: "Destination.Env", description: "Destination environment configuration." }).optional().describe("Destination environment configuration"), variables: fi.optional().describe("Destination-level variables (highest priority in cascade)"), before: He3.optional().describe("Post-collector transformer chain. String, string[], or Route[] for conditional routing. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), next: He3.optional().describe("Post-push transformer chain. Push response available at context.ingest._response. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ge2.optional().describe("Cache configuration for this destination (match \u2192 key \u2192 ttl rules)") }).meta({ id: "FlowDestination", title: "Flow.Destination", description: "Destination package reference with configuration, env, chains, and cache." }).describe("Destination package reference with configuration").superRefine(ji);
2461
- Oi = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe("Store package specifier with optional version"), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.looseObject({ setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during store registration (boolean enables defaults, object configures specifics)") }).meta({ id: "FlowStoreConfig", title: "Store.Config", description: "Store-specific configuration object." }).optional().describe("Store-specific configuration object"), env: n3.unknown().meta({ id: "FlowStoreEnv", title: "Store.Env", description: "Store environment configuration." }).optional().describe("Store environment configuration"), cache: Qe2.optional().describe("Cache configuration for this store (TTL-only rules, optional recursive `cache.store`)"), variables: fi.optional().describe("Store-level variables (highest priority in cascade)"), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).meta({ id: "FlowStore", title: "Flow.Store", description: "Store package reference with configuration, env, cache, and examples." }).describe("Store package reference with configuration").superRefine(ji);
2477
+ Pi = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-source-browser@2.0.0")'), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.looseObject({ setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during source registration (boolean enables defaults, object configures specifics)") }).meta({ id: "FlowSourceConfig", title: "Source.Config", description: "Source-specific configuration object (Source.Config)." }).optional().describe("Source-specific configuration object"), env: n3.unknown().meta({ id: "FlowSourceEnv", title: "Source.BaseEnv", description: "Source environment configuration (Source.BaseEnv overrides)." }).optional().describe("Source environment configuration"), primary: n3.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."), variables: fi.optional().describe("Source-level variables (highest priority in cascade)"), next: We3.optional().describe("Pre-collector transformer chain. String, string[], or Route[] for conditional routing based on ingest data."), before: We3.optional().describe("Pre-source transformer chain (consent-exempt). Handles transport-level preprocessing."), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ge3.optional().describe("Cache configuration for this source (match \u2192 key \u2192 ttl rules)") }).meta({ id: "FlowSource", title: "Flow.Source", description: "Source package reference with configuration, env, chains, and examples." }).describe("Source package reference with configuration").superRefine(ji);
2478
+ Di = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.unknown().meta({ id: "FlowTransformerConfig", title: "Transformer.Config", description: "Transformer-specific configuration object." }).optional().describe("Transformer-specific configuration object"), env: n3.unknown().meta({ id: "FlowTransformerEnv", title: "Transformer.Env", description: "Transformer environment configuration." }).optional().describe("Transformer environment configuration"), before: We3.optional().describe("Pre-transformer chain. Runs before this transformer push function."), next: We3.optional().describe("Next transformer in chain. String, string[], or Route[] for conditional routing."), variables: fi.optional().describe("Transformer-level variables (highest priority in cascade)"), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ge3.optional().describe("Cache configuration for this transformer (match \u2192 key \u2192 ttl rules)") }).meta({ id: "FlowTransformer", title: "Flow.Transformer", description: "Transformer package reference with configuration, env, chains, and cache." }).describe("Transformer package reference with configuration").superRefine(ji);
2479
+ Ei = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/web-destination-gtag@2.0.0")'), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.looseObject({ setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during destination registration (boolean enables defaults, object configures specifics)") }).meta({ id: "FlowDestinationConfig", title: "Destination.Config", description: "Destination-specific configuration object." }).optional().describe("Destination-specific configuration object"), env: n3.unknown().meta({ id: "FlowDestinationEnv", title: "Destination.Env", description: "Destination environment configuration." }).optional().describe("Destination environment configuration"), variables: fi.optional().describe("Destination-level variables (highest priority in cascade)"), before: He2.optional().describe("Post-collector transformer chain. String, string[], or Route[] for conditional routing. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), next: He2.optional().describe("Post-push transformer chain. Push response available at context.ingest._response. `many` is not valid here \u2014 use multiple destinations for post-collector fan-out."), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ge3.optional().describe("Cache configuration for this destination (match \u2192 key \u2192 ttl rules)") }).meta({ id: "FlowDestination", title: "Flow.Destination", description: "Destination package reference with configuration, env, chains, and cache." }).describe("Destination package reference with configuration").superRefine(ji);
2480
+ Oi = n3.object({ package: n3.string().min(1, "Package name cannot be empty").optional().describe("Store package specifier with optional version"), code: Si.optional().describe("Inline code definition (object form). For a named export from a package, use `import` instead."), import: n3.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, "import must be a valid JavaScript identifier").optional().describe("Named export from `package` to import as this step's implementation. Top-level identifier only. Requires `package`. Mutually exclusive with `code`."), config: n3.looseObject({ setup: n3.union([n3.boolean(), n3.record(n3.string(), n3.unknown())]).optional().describe("One-time setup options applied during store registration (boolean enables defaults, object configures specifics)") }).meta({ id: "FlowStoreConfig", title: "Store.Config", description: "Store-specific configuration object." }).optional().describe("Store-specific configuration object"), env: n3.unknown().meta({ id: "FlowStoreEnv", title: "Store.Env", description: "Store environment configuration." }).optional().describe("Store environment configuration"), cache: Qe3.optional().describe("Cache configuration for this store (TTL-only rules, optional recursive `cache.store`)"), variables: fi.optional().describe("Store-level variables (highest priority in cascade)"), examples: ki.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).meta({ id: "FlowStore", title: "Flow.Store", description: "Store package reference with configuration, env, cache, and examples." }).describe("Store package reference with configuration").superRefine(ji);
2462
2481
  Ii = n3.record(n3.string(), n3.unknown()).meta({ id: "FlowContractSchemaEntry", title: "Flow.ContractSchemaEntry", description: "JSON Schema object for event validation with description/examples annotations." }).describe("JSON Schema object for event validation with description/examples annotations");
2463
2482
  Ji = n3.record(n3.string(), Ii).meta({ id: "FlowContractActions", title: "Flow.ContractActions", description: "Action-level contract entries keyed by action name." }).describe("Action-level contract entries");
2464
2483
  Ri = n3.record(n3.string(), Ji).meta({ id: "FlowContractEvents", title: "Flow.ContractEvents", description: "Entity-action event schemas (entity \u2192 action \u2192 schema)." }).describe("Entity-action event schemas");
@@ -2480,18 +2499,18 @@ var init_dev = __esm({
2480
2499
  Yi = Xi.object({ lang: Xi.string().optional().describe("Language identifier (e.g. json, sql, bash, typescript)"), code: Xi.string().describe("Code snippet") });
2481
2500
  en2 = Xi.object({ text: Xi.string().describe("Short actionable hint text focused on walkerOS usage"), code: Xi.array(Yi).optional().describe("Optional code snippets") });
2482
2501
  tn2 = Xi.record(Xi.string(), en2).describe("Keyed hints for AI consumption \u2014 lightweight context beyond schemas and examples");
2483
- nn3 = n3.object({ param: n3.string().describe("Lowercase URL parameter name. Match is case-insensitive on lookup."), platform: n3.string().describe("Canonical platform identifier (lowercase, kebab-case).") });
2484
- on3 = n3.object({ client_email: n3.string().describe("Service account client email"), private_key: n3.string().describe("Service account private key (PEM)"), project_id: n3.string().optional().describe("GCP project id (derived from environment when omitted)") }).meta({ id: "ServiceAccount", title: "ServiceAccount", description: "Google-style service account credentials (client_email, private_key, optional project_id)." }).describe("Google-style service account credentials");
2485
- rn3 = n3.union([n3.string(), on3]).meta({ id: "Credentials", title: "Credentials", description: "Service account credentials: a JSON string (often $env) or a parsed service account object." }).describe("Service account credentials: a JSON string (often $env) or a parsed object");
2502
+ nn2 = n3.object({ param: n3.string().describe("Lowercase URL parameter name. Match is case-insensitive on lookup."), platform: n3.string().describe("Canonical platform identifier (lowercase, kebab-case).") });
2503
+ on2 = n3.object({ client_email: n3.string().describe("Service account client email"), private_key: n3.string().describe("Service account private key (PEM)"), project_id: n3.string().optional().describe("GCP project id (derived from environment when omitted)") }).meta({ id: "ServiceAccount", title: "ServiceAccount", description: "Google-style service account credentials (client_email, private_key, optional project_id)." }).describe("Google-style service account credentials");
2504
+ rn3 = n3.union([n3.string(), on2]).meta({ id: "Credentials", title: "Credentials", description: "Service account credentials: a JSON string (often $env) or a parsed service account object." }).describe("Service account credentials: a JSON string (often $env) or a parsed object");
2486
2505
  an2 = o2(rn3);
2487
2506
  cn2 = /* @__PURE__ */ new Set(["description", "examples", "title", "$comment"]);
2488
2507
  fn2 = /\$store\.([a-zA-Z_][a-zA-Z0-9_]*)/g;
2489
2508
  gn2 = /\$env\.([A-Za-z_]\w*)(=[^"}\s]*)?/g;
2490
- hn = /\$flow\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z0-9_.]+))?/g;
2491
- bn = /\$(var|store|flow|secret):([a-zA-Z_][a-zA-Z0-9_]*)/g;
2492
- vn = /\$secret\.([A-Z0-9_]+)/g;
2509
+ hn2 = /\$flow\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z0-9_.]+))?/g;
2510
+ bn2 = /\$(var|store|flow|secret):([a-zA-Z_][a-zA-Z0-9_]*)/g;
2511
+ vn2 = /\$secret\.([A-Z0-9_]+)/g;
2493
2512
  Sn = ["@walkeros/server-store-fs", "@walkeros/server-store-s3", "@walkeros/server-store-gcs"];
2494
- yn = "@walkeros/server-transformer-file";
2513
+ yn2 = "@walkeros/server-transformer-file";
2495
2514
  wn = /^\$store\.([a-zA-Z_][a-zA-Z0-9_]*)$/;
2496
2515
  qn = { source: Bt2.configJsonSchema, destination: Re3.configJsonSchema, store: ci.configJsonSchema };
2497
2516
  }
@@ -2936,7 +2955,7 @@ function hasCodeReference(code) {
2936
2955
  }
2937
2956
  function validateReference(type, name, ref) {
2938
2957
  if (type === "Transformer") {
2939
- const r5 = mn({ ...ref }, "Transformer");
2958
+ const r5 = vn({ ...ref }, "Transformer");
2940
2959
  if (!r5.ok) {
2941
2960
  throw new Error(`Transformer "${name}": ${r5.reason ?? "invalid entry."}`);
2942
2961
  }
@@ -4735,12 +4754,12 @@ function buildSplitConfigObject(flowSettings, namedImports) {
4735
4754
  return buildSplitStepEntry("destinations", key, dest);
4736
4755
  });
4737
4756
  const transformersEntries = Object.entries(transformers).filter(
4738
- ([, transformer]) => transformer.package || hasCodeReference2(transformer.code) || gn({ ...transformer }, "Transformer")
4757
+ ([, transformer]) => transformer.package || hasCodeReference2(transformer.code) || bn({ ...transformer }, "Transformer")
4739
4758
  ).map(([key, transformer]) => {
4740
4759
  if (isInlineCode2(transformer.code)) {
4741
4760
  return ` ${key}: ${generateInlineCode(transformer.code, transformer.config || {}, transformer.env, { before: transformer.before, next: transformer.next })}`;
4742
4761
  }
4743
- if (gn({ ...transformer }, "Transformer")) {
4762
+ if (bn({ ...transformer }, "Transformer")) {
4744
4763
  const chainLines = [];
4745
4764
  if (transformer.before !== void 0) {
4746
4765
  chainLines.push(`before: ${JSON.stringify(transformer.before)}`);
@@ -6132,7 +6151,7 @@ function L2(e4, t4, n5, o4, s6) {
6132
6151
  const o6 = t6.config.id || n6;
6133
6152
  G2(e5.status.breakers, o("destination", o6), "transport-failure", d2.threshold, d2.cooldown);
6134
6153
  }
6135
- })(e4, s6, n5, i4, t5, o4) : e4.status.failed++, void o4.error("reportError", { error: t5 instanceof Error ? t5.message : String(t5), event: i4.name });
6154
+ })(e4, s6, n5, i4, t5, o4) : e4.status.failed++, void o4.error("report error", { error: t5 instanceof Error ? t5.message : String(t5), event: i4.name });
6136
6155
  e4.status.connectionErrors[r5] = (e4.status.connectionErrors[r5] ?? 0) + 1, o4.error("connection error", { error: t5 instanceof Error ? t5.message : String(t5) });
6137
6156
  } catch {
6138
6157
  }
@@ -6144,7 +6163,7 @@ function Ie2(e4, t4) {
6144
6163
  function qe2(e4, t4) {
6145
6164
  return e4 ? t4.stores[e4] : t4.stores.__cache;
6146
6165
  }
6147
- function Se(e4) {
6166
+ function Se2(e4) {
6148
6167
  const t4 = {};
6149
6168
  for (const [n5, o4] of Object.entries(e4)) {
6150
6169
  const e5 = o4.config?.next;
@@ -6176,7 +6195,7 @@ async function Ee2(e4, t4, n5) {
6176
6195
  if (t4.init && !t4.config.init) {
6177
6196
  const o4 = t4.type || "unknown", s6 = e4.logger.scope(`transformer:${o4}`), r5 = { collector: e4, logger: s6, id: n5, ingest: E(n5), config: t4.config, env: Ae(t4.config.env), reportError: L2(e4, "transformer", n5, s6) };
6178
6197
  s6.debug("init");
6179
- const i4 = await ct(t4.init, "TransformerInit", e4.hooks, e4.logger)(r5);
6198
+ const i4 = await pt(t4.init, "TransformerInit", e4.hooks, e4.logger)(r5);
6180
6199
  if (false === i4) return false;
6181
6200
  t4.config = { ...i4 || t4.config, env: i4?.env || t4.config.env, init: true }, s6.debug("init done");
6182
6201
  }
@@ -6186,13 +6205,13 @@ async function je2(e4, t4, n5, o4, s6, r5) {
6186
6205
  const i4 = t4.type || "unknown", a4 = e4.logger.scope(`transformer:${i4}`), c2 = { collector: e4, logger: a4, id: n5, ingest: s6, config: t4.config, env: { ...Ae(t4.config.env), ...r5 ? { respond: r5 } : {} }, reportError: L2(e4, "transformer", n5, a4) };
6187
6206
  a4.debug("push", { event: o4.name });
6188
6207
  const u2 = "string" == typeof o4.id ? o4.id : "", d2 = Date.now(), l3 = j(e4, { stepId: o("transformer", n5), stepType: "transformer", phase: "in", eventId: u2, now: d2 });
6189
- l3.inEvent = o4, yt(e4, l3);
6208
+ l3.inEvent = o4, wt(e4, l3);
6190
6209
  try {
6191
- const s7 = await ct(t4.push, "TransformerPush", e4.hooks, e4.logger)(o4, c2), r6 = Date.now(), i5 = j(e4, { stepId: o("transformer", n5), stepType: "transformer", phase: "out", eventId: u2, now: r6 });
6192
- return i5.durationMs = r6 - d2, i5.outEvent = s7, yt(e4, i5), a4.debug("push done"), s7;
6210
+ const s7 = await pt(t4.push, "TransformerPush", e4.hooks, e4.logger)(o4, c2), r6 = Date.now(), i5 = j(e4, { stepId: o("transformer", n5), stepType: "transformer", phase: "out", eventId: u2, now: r6 });
6211
+ return i5.durationMs = r6 - d2, i5.outEvent = s7, wt(e4, i5), a4.debug("push done"), s7;
6193
6212
  } catch (t5) {
6194
6213
  const o5 = Date.now(), s7 = j(e4, { stepId: o("transformer", n5), stepType: "transformer", phase: "error", eventId: u2, now: o5 });
6195
- throw s7.durationMs = o5 - d2, s7.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, yt(e4, s7), t5;
6214
+ throw s7.durationMs = o5 - d2, s7.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, wt(e4, s7), t5;
6196
6215
  }
6197
6216
  }
6198
6217
  function De2(e4, t4) {
@@ -6209,8 +6228,8 @@ async function $e(e4, t4, n5, o4, s6, r5, i4) {
6209
6228
  }
6210
6229
  if (s6 && s6._meta && s6._meta.path.length > 256) return e4.logger.error(`Max path length exceeded at ${o5}`), { event: null, respond: c2 };
6211
6230
  s6 && s6._meta && (s6._meta.hops++, s6._meta.path.push(o5));
6212
- if (!await Le(Ee2, (t5) => {
6213
- if (t5 instanceof He) throw t5;
6231
+ if (!await qe(Ee2, (t5) => {
6232
+ if (t5 instanceof Je) throw t5;
6214
6233
  return e4.status.failed++, e4.logger.scope(`transformer:${r6.type || "unknown"}`).error("transformer init failed", { transformer: o5, error: t5 }), false;
6215
6234
  })(e4, r6, o5)) return { event: null, respond: c2 };
6216
6235
  if (i4 && void 0 !== r6.config?.chainMocks?.[i4]) {
@@ -6223,10 +6242,10 @@ async function $e(e4, t4, n5, o4, s6, r5, i4) {
6223
6242
  continue;
6224
6243
  }
6225
6244
  if (r6.config?.disabled) continue;
6226
- const u2 = r6.config?.cache, d2 = u2 ? rn(u2) : void 0, l3 = d2 ? Ie2(d2, e4) : void 0, f3 = r6.config?.state ? cn(r6.config.state) : void 0, p3 = f3?.filter((e5) => "get" === e5.mode), g3 = f3?.filter((e5) => "set" === e5.mode), m3 = async (t5) => g3 && 0 !== g3.length ? un(g3, (t6) => qe2(t6, e4), t5, e4) : t5;
6245
+ const u2 = r6.config?.cache, d2 = u2 ? cn(u2) : void 0, l3 = d2 ? Ie2(d2, e4) : void 0, f3 = r6.config?.state ? pn(r6.config.state) : void 0, p3 = f3?.filter((e5) => "get" === e5.mode), g3 = f3?.filter((e5) => "set" === e5.mode), m3 = async (t5) => g3 && 0 !== g3.length ? dn(g3, (t6) => qe2(t6, e4), t5, e4) : t5;
6227
6246
  let h3;
6228
6247
  if (d2 && l3) {
6229
- const e5 = nn(s6, a4), t5 = await on(d2, l3, e5);
6248
+ const e5 = sn(s6, a4), t5 = await un(d2, l3, e5);
6230
6249
  if ("HIT" === t5?.status && t5.value) {
6231
6250
  if (a4 = t5.value, d2.stop) return { event: a4, respond: c2, stopped: true };
6232
6251
  continue;
@@ -6235,31 +6254,31 @@ async function $e(e4, t4, n5, o4, s6, r5, i4) {
6235
6254
  }
6236
6255
  const y2 = r6.config.before;
6237
6256
  if (y2) {
6238
- const n6 = Zt(y2, nn(s6, a4));
6257
+ const n6 = Ht(y2, sn(s6, a4));
6239
6258
  if (1 === n6.length) {
6240
- const o6 = Oe2(n6[0], Se(t4));
6259
+ const o6 = Oe2(n6[0], Se2(t4));
6241
6260
  if (o6.length > 0) {
6242
6261
  const n7 = await $e(e4, t4, o6, a4, s6, c2, i4);
6243
6262
  if (null === n7.event) return { event: null, respond: n7.respond ?? c2 };
6244
6263
  if (n7.stopped) return { event: Array.isArray(n7.event) ? n7.event[0] : n7.event, respond: n7.respond ?? c2, stopped: true };
6245
6264
  n7.respond && (c2 = n7.respond), a4 = Array.isArray(n7.event) ? n7.event[0] : n7.event;
6246
6265
  }
6247
- } else n6.length > 1 && await Promise.all(n6.map((n7) => Le($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se(t4)), a4, De2(s6, n7), void 0, i4)));
6266
+ } else n6.length > 1 && await Promise.all(n6.map((n7) => qe($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se2(t4)), a4, De2(s6, n7), void 0, i4)));
6248
6267
  }
6249
- p3 && p3.length > 0 && (a4 = await un(p3, (t5) => qe2(t5, e4), a4, e4));
6250
- const w3 = await Le(je2, (t5) => (e4.logger.scope(`transformer:${r6.type || "unknown"}`).error("Push failed", { error: t5 }), false))(e4, r6, o5, a4, s6, c2);
6268
+ p3 && p3.length > 0 && (a4 = await dn(p3, (t5) => qe2(t5, e4), a4, e4));
6269
+ const w3 = await qe(je2, (t5) => (e4.logger.scope(`transformer:${r6.type || "unknown"}`).error("Push failed", { error: t5 }), false))(e4, r6, o5, a4, s6, c2);
6251
6270
  if (false === w3) return { event: null, respond: c2 };
6252
6271
  if (Array.isArray(w3)) {
6253
6272
  const r7 = n5.slice(n5.indexOf(o5) + 1), u3 = await Promise.all(w3.map(async (n6) => {
6254
6273
  const o6 = await m3(n6.event || a4), u4 = De2(s6, "unknown");
6255
6274
  if (n6.next) {
6256
- const s7 = Zt(n6.next, nn(u4, o6));
6275
+ const s7 = Ht(n6.next, sn(u4, o6));
6257
6276
  if (0 === s7.length) return { event: o6, respond: c2 };
6258
6277
  if (1 === s7.length) {
6259
- const n7 = Oe2(s7[0], Se(t4));
6278
+ const n7 = Oe2(s7[0], Se2(t4));
6260
6279
  return n7.length > 0 ? $e(e4, t4, n7, o6, u4, c2, i4) : { event: o6, respond: c2 };
6261
6280
  }
6262
- return (await Promise.all(s7.map((n7) => Le($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se(t4)), o6, De2(u4, n7), void 0, i4)))).map((e5) => ({ event: e5.event, respond: void 0 }));
6281
+ return (await Promise.all(s7.map((n7) => qe($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se2(t4)), o6, De2(u4, n7), void 0, i4)))).map((e5) => ({ event: e5.event, respond: void 0 }));
6263
6282
  }
6264
6283
  return r7.length > 0 ? $e(e4, t4, r7, o6, u4, c2, i4) : { event: o6, respond: c2 };
6265
6284
  }));
@@ -6275,28 +6294,28 @@ async function $e(e4, t4, n5, o4, s6, r5, i4) {
6275
6294
  if (w3 && "object" == typeof w3) {
6276
6295
  const { event: n6, respond: o6, next: r7 } = w3;
6277
6296
  if (o6 && (c2 = o6), void 0 !== r7) {
6278
- const o7 = await m3(n6 || a4), u3 = Zt(r7, nn(s6, o7));
6297
+ const o7 = await m3(n6 || a4), u3 = Ht(r7, sn(s6, o7));
6279
6298
  if (0 === u3.length) {
6280
6299
  a4 = o7;
6281
6300
  continue;
6282
6301
  }
6283
6302
  if (1 === u3.length) {
6284
- const n7 = Oe2(u3[0], Se(t4));
6303
+ const n7 = Oe2(u3[0], Se2(t4));
6285
6304
  return n7.length > 0 ? $e(e4, t4, n7, o7, s6, c2, i4) : (e4.logger.warn(`Branch target not found: ${JSON.stringify(r7)}`), { event: null, respond: c2 });
6286
6305
  }
6287
- return await Promise.all(u3.map((n7) => Le($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se(t4)), o7, De2(s6, n7), void 0, i4))), { event: null, respond: void 0 };
6306
+ return await Promise.all(u3.map((n7) => qe($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se2(t4)), o7, De2(s6, n7), void 0, i4))), { event: null, respond: void 0 };
6288
6307
  }
6289
6308
  n6 && (a4 = n6);
6290
6309
  }
6291
- g3 && g3.length > 0 && (a4 = await un(g3, (t5) => qe2(t5, e4), a4, e4)), h3 && l3 && an(l3, h3.key, a4, h3.ttl);
6310
+ g3 && g3.length > 0 && (a4 = await dn(g3, (t5) => qe2(t5, e4), a4, e4)), h3 && l3 && fn(l3, h3.key, a4, h3.ttl);
6292
6311
  const v3 = r6.config.next, b3 = "string" == typeof v3 || Array.isArray(v3) && v3.every((e5) => "string" == typeof e5), k3 = void 0 !== v3 && !b3;
6293
6312
  if ((!w3 || "object" == typeof w3 && !w3.next) && k3) {
6294
- const n6 = Zt(r6.config.next, nn(s6, a4));
6313
+ const n6 = Ht(r6.config.next, sn(s6, a4));
6295
6314
  if (1 === n6.length) {
6296
- const o6 = Oe2(n6[0], Se(t4));
6315
+ const o6 = Oe2(n6[0], Se2(t4));
6297
6316
  return o6.length > 0 ? $e(e4, t4, o6, a4, s6, c2, i4) : { event: a4, respond: c2 };
6298
6317
  }
6299
- return n6.length > 1 ? (await Promise.all(n6.map((n7) => Le($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se(t4)), a4, De2(s6, n7), void 0, i4))), { event: null, respond: void 0 }) : { event: a4, respond: c2 };
6318
+ return n6.length > 1 ? (await Promise.all(n6.map((n7) => qe($e, (t5) => (e4.logger.scope("transformer:many").error(`many branch ${n7} failed`, { error: t5 }), { event: null, respond: void 0 }))(e4, t4, Oe2(n7, Se2(t4)), a4, De2(s6, n7), void 0, i4))), { event: null, respond: void 0 }) : { event: a4, respond: c2 };
6300
6319
  }
6301
6320
  }
6302
6321
  return { event: a4, respond: c2 };
@@ -6307,26 +6326,26 @@ function Ae(e4) {
6307
6326
  function Me2(e4) {
6308
6327
  return "string" == typeof e4 || !(!Array.isArray(e4) || !e4.every((e5) => "string" == typeof e5));
6309
6328
  }
6310
- async function Te2(e4, t4, n5) {
6329
+ async function Te(e4, t4, n5) {
6311
6330
  if (!t4.on || !t4.queueOn?.length) return;
6312
6331
  const o4 = t4.queueOn;
6313
6332
  t4.queueOn = [];
6314
6333
  const s6 = n5 || t4.config?.id || "unknown";
6315
- for (const { type: n6, data: r5 } of o4) Ke2(n6) && !Ye(e4, t4, n6) || (await Le(t4.on, (t5) => {
6316
- if (t5 instanceof He) throw t5;
6334
+ for (const { type: n6, data: r5 } of o4) Ke2(n6) && !Ye2(e4, t4, n6) || (await qe(t4.on, (t5) => {
6335
+ if (t5 instanceof Je) throw t5;
6317
6336
  e4.status.failed++, e4.logger.scope("source").error("source on flush failed", { sourceId: s6, type: n6, error: t5 });
6318
6337
  })(n6, r5), Ke2(n6) && Le2(e4, t4, n6));
6319
6338
  }
6320
- function Pe2(e4) {
6339
+ function Pe(e4) {
6321
6340
  return Boolean(e4.config.init) && !e4.config.require?.length;
6322
6341
  }
6323
- async function _e(e4, t4, n5) {
6324
- const { code: o4, config: s6 = {}, env: r5 = {}, primary: i4, next: a4, before: c2, cache: u2 } = n5, d2 = s6.state ?? n5.state, l3 = d2 ? cn(d2) : void 0, f3 = u2, p3 = f3 ? rn({ ...f3, stop: f3.stop ?? true }) : void 0, g3 = Me2(a4) ? Oe2(a4, Se(e4.transformers)) : void 0, m3 = Me2(c2) ? Oe2(c2, Se(e4.transformers)) : void 0, h3 = r5.push, y2 = h3 ?? e4.push, w3 = Boolean(h3), v3 = async (n6, o5, r6) => {
6342
+ async function _e2(e4, t4, n5) {
6343
+ const { code: o4, config: s6 = {}, env: r5 = {}, primary: i4, next: a4, before: c2, cache: u2 } = n5, d2 = s6.state ?? n5.state, l3 = d2 ? pn(d2) : void 0, f3 = u2, p3 = f3 ? cn({ ...f3, stop: f3.stop ?? true }) : void 0, g3 = Me2(a4) ? Oe2(a4, Se2(e4.transformers)) : void 0, m3 = Me2(c2) ? Oe2(c2, Se2(e4.transformers)) : void 0, h3 = r5.push, y2 = h3 ?? e4.push, w3 = Boolean(h3), v3 = async (n6, o5, r6) => {
6325
6344
  let i5;
6326
6345
  const u3 = m3 ?? (void 0 !== c2 ? (() => {
6327
- const t5 = Zt(c2, nn(r6.ingest));
6346
+ const t5 = Ht(c2, sn(r6.ingest));
6328
6347
  if (0 === t5.length) return [];
6329
- return Oe2(1 === t5.length ? t5[0] : t5, Se(e4.transformers));
6348
+ return Oe2(1 === t5.length ? t5[0] : t5, Se2(e4.transformers));
6330
6349
  })() : []);
6331
6350
  let d3 = [n6];
6332
6351
  if (u3.length > 0 && e4.transformers && Object.keys(e4.transformers).length > 0) {
@@ -6338,56 +6357,56 @@ async function _e(e4, t4, n5) {
6338
6357
  if (p3) {
6339
6358
  const t5 = Ie2(p3, e4);
6340
6359
  if (t5) {
6341
- const n7 = nn(r6.ingest), o6 = await on(p3, t5, n7);
6360
+ const n7 = sn(r6.ingest), o6 = await un(p3, t5, n7);
6342
6361
  if (o6) {
6343
6362
  if ("HIT" === o6.status && void 0 !== o6.value && p3.stop) {
6344
6363
  let t6 = o6.value;
6345
- return o6.rule.update && (t6 = await sn(t6, o6.rule.update, { ...n7, cache: { status: "HIT" } }, e4)), r6.respond?.(t6), { ok: true };
6364
+ return o6.rule.update && (t6 = await ln(t6, o6.rule.update, { ...n7, cache: { status: "HIT" } }, e4)), r6.respond?.(t6), { ok: true };
6346
6365
  }
6347
6366
  if ("MISS" === o6.status && p3.stop && r6.respond) {
6348
6367
  const s7 = r6.respond, a5 = o6.rule.update, c3 = { ...n7, cache: { status: "MISS" } }, u4 = o6.key, d4 = o6.rule.ttl, l4 = (n8) => {
6349
- an(t5, u4, n8, d4), a5 ? i5 = (async () => {
6350
- const t6 = await sn(n8, a5, c3, e4);
6368
+ fn(t5, u4, n8, d4), a5 ? i5 = (async () => {
6369
+ const t6 = await ln(n8, a5, c3, e4);
6351
6370
  s7(t6);
6352
6371
  })() : s7(n8);
6353
6372
  };
6354
6373
  r6.respond = l4;
6355
6374
  }
6356
- "MISS" !== o6.status || p3.stop || an(t5, o6.key, true, o6.rule.ttl);
6375
+ "MISS" !== o6.status || p3.stop || fn(t5, o6.key, true, o6.rule.ttl);
6357
6376
  }
6358
6377
  }
6359
6378
  }
6360
6379
  const f4 = g3 ? { kind: "single", preChain: g3 } : void 0 !== a4 ? (() => {
6361
- const t5 = Zt(a4, nn(r6.ingest));
6362
- return 0 === t5.length ? { kind: "single", preChain: [] } : 1 === t5.length ? { kind: "single", preChain: Oe2(t5[0], Se(e4.transformers)) } : { kind: "many", branches: t5.map((t6) => Oe2(t6, Se(e4.transformers))) };
6380
+ const t5 = Ht(a4, sn(r6.ingest));
6381
+ return 0 === t5.length ? { kind: "single", preChain: [] } : 1 === t5.length ? { kind: "single", preChain: Oe2(t5[0], Se2(e4.transformers)) } : { kind: "many", branches: t5.map((t6) => Oe2(t6, Se2(e4.transformers))) };
6363
6382
  })() : { kind: "single", preChain: [] };
6364
- !w3 && l3 && l3.length > 0 && (d3 = await Promise.all(d3.map((t5) => un(l3, (t6) => qe2(t6, e4), t5, e4))));
6383
+ !w3 && l3 && l3.length > 0 && (d3 = await Promise.all(d3.map((t5) => dn(l3, (t6) => qe2(t6, e4), t5, e4))));
6365
6384
  let h4 = { ok: true };
6366
- for (const n7 of d3) "many" === f4.kind ? (await Promise.all(f4.branches.map((i6, a5) => Le(async () => w3 ? y2(n7) : y2(n7, { ...o5, id: t4, ingest: De2(r6.ingest, `${t4}.${a5}`), respond: void 0, mapping: s6, preChain: i6 }), (t5) => (e4.logger.scope("source:many").error(`many branch ${a5} failed`, { error: t5 }), { ok: true }))())), h4 = { ok: true }) : h4 = w3 ? await y2(n7) : await y2(n7, { ...o5, id: t4, ingest: r6.ingest, respond: r6.respond, mapping: s6, preChain: f4.preChain });
6385
+ for (const n7 of d3) "many" === f4.kind ? (await Promise.all(f4.branches.map((i6, a5) => qe(async () => w3 ? y2(n7) : y2(n7, { ...o5, id: t4, ingest: De2(r6.ingest, `${t4}.${a5}`), respond: void 0, mapping: s6, preChain: i6 }), (t5) => (e4.logger.scope("source:many").error(`many branch ${a5} failed`, { error: t5 }), { ok: true }))())), h4 = { ok: true }) : h4 = w3 ? await y2(n7) : await y2(n7, { ...o5, id: t4, ingest: r6.ingest, respond: r6.respond, mapping: s6, preChain: f4.preChain });
6367
6386
  return i5 && await i5, h4;
6368
6387
  }, b3 = async (n6) => {
6369
6388
  const o5 = E(t4);
6370
6389
  if (!s6.ingest || void 0 === n6) return o5;
6371
- const r6 = await Ve(n6, s6.ingest, { collector: e4 });
6390
+ const r6 = await Xe(n6, s6.ingest, { collector: e4 });
6372
6391
  return { ...o5, ...r6, _meta: o5._meta };
6373
- }, k3 = e4.logger.scope("source").scope(t4), C2 = { command: e4.command, sources: e4.sources, elb: e4.sources.elb.push, logger: k3, ...r5, push: async (e5, n6 = {}) => {
6392
+ }, k3 = e4.logger.scope("source").scope(t4), C3 = { command: e4.command, sources: e4.sources, elb: e4.sources.elb.push, logger: k3, ...r5, push: async (e5, n6 = {}) => {
6374
6393
  const o5 = { ingest: E(t4), respond: void 0 };
6375
6394
  return v3(e5, n6, o5);
6376
- } }, I3 = { collector: e4, logger: k3, id: t4, config: s6, env: C2, withScope: async (e5, t5, n6) => {
6395
+ } }, I3 = { collector: e4, logger: k3, id: t4, config: s6, env: C3, withScope: async (e5, t5, n6) => {
6377
6396
  const o5 = { ingest: await b3(e5), respond: t5 };
6378
- return n6({ ...C2, push: (e6, t6 = {}) => v3(e6, t6, o5), ingest: o5.ingest, respond: o5.respond });
6379
- }, reportError: L2(e4, "source", t4, k3) }, q3 = await Le(o4, (n6) => {
6380
- if (n6 instanceof He) throw n6;
6397
+ return n6({ ...C3, push: (e6, t6 = {}) => v3(e6, t6, o5), ingest: o5.ingest, respond: o5.respond });
6398
+ }, reportError: L2(e4, "source", t4, k3) }, q3 = await qe(o4, (n6) => {
6399
+ if (n6 instanceof Je) throw n6;
6381
6400
  e4.status.failed++, e4.logger.scope("source").error("source factory failed", { sourceId: t4, error: n6 });
6382
6401
  })(I3);
6383
6402
  if (!q3) return;
6384
6403
  const S2 = q3.type || "unknown", x2 = e4.logger.scope(S2).scope(t4);
6385
- return C2.logger = x2, i4 && (q3.config = { ...q3.config, primary: i4 }), q3;
6404
+ return C3.logger = x2, i4 && (q3.config = { ...q3.config, primary: i4 }), q3;
6386
6405
  }
6387
6406
  async function ze(e4, t4 = {}) {
6388
6407
  const n5 = {};
6389
6408
  for (const [o4, s6] of Object.entries(t4)) {
6390
- const t5 = await _e(e4, o4, s6);
6409
+ const t5 = await _e2(e4, o4, s6);
6391
6410
  if (!t5) continue;
6392
6411
  const r5 = s6.config?.require;
6393
6412
  t5.config = { ...t5.config, init: false, ...r5 ? { require: [...r5] } : {} }, n5[o4] = t5;
@@ -6396,20 +6415,20 @@ async function ze(e4, t4 = {}) {
6396
6415
  for (const t5 of Object.keys(n5)) {
6397
6416
  const n6 = e4.sources[t5];
6398
6417
  let o4 = false;
6399
- n6.init && await Le(n6.init.bind(n6), (n7) => {
6400
- if (n7 instanceof He) throw n7;
6418
+ n6.init && await qe(n6.init.bind(n6), (n7) => {
6419
+ if (n7 instanceof Je) throw n7;
6401
6420
  o4 = true, e4.status.failed++, e4.logger.scope("source").error("source init failed", { sourceId: t5, error: n7 });
6402
- })(), o4 || (n6.config.init = true, Pe2(n6) && await Te2(e4, n6, t5));
6421
+ })(), o4 || (n6.config.init = true, Pe(n6) && await Te(e4, n6, t5));
6403
6422
  }
6404
- return await Ue2(e4), n5;
6423
+ return await Ue(e4), n5;
6405
6424
  }
6406
- async function Ue2(e4) {
6425
+ async function Ue(e4) {
6407
6426
  for (const [t4, n5] of Object.entries(e4.sources)) {
6408
- if (Pe2(n5)) continue;
6427
+ if (Pe(n5)) continue;
6409
6428
  const o4 = n5.config.require;
6410
6429
  if (!o4?.length) continue;
6411
6430
  const s6 = o4.filter((t5) => !Ve2(e4, t5));
6412
- s6.length !== o4.length && (n5.config.require = s6, Pe2(n5) && await Te2(e4, n5, t4));
6431
+ s6.length !== o4.length && (n5.config.require = s6, Pe(n5) && await Te(e4, n5, t4));
6413
6432
  }
6414
6433
  for (const [t4, n5] of Object.entries(e4.pending.destinations)) {
6415
6434
  if (!e4.pending.destinations[t4] || e4.destinations[t4]) continue;
@@ -6418,7 +6437,7 @@ async function Ue2(e4) {
6418
6437
  const s6 = o4.filter((t5) => !Ve2(e4, t5));
6419
6438
  if (n5.config && (n5.config.require = s6), s6.length > 0) continue;
6420
6439
  delete e4.pending.destinations[t4];
6421
- const r5 = wt(n5);
6440
+ const r5 = wt2(n5);
6422
6441
  false !== r5.config.queue && (r5.queuePush = [...e4.queue]), e4.destinations[t4] = r5;
6423
6442
  }
6424
6443
  }
@@ -6429,16 +6448,16 @@ function Fe2(e4) {
6429
6448
  return "object" == typeof t4 && null !== t4 && ("scope" in t4 && "function" == typeof t4.scope);
6430
6449
  }
6431
6450
  var Be2 = false;
6432
- function He2() {
6451
+ function He() {
6433
6452
  Be2 || (Be2 = true, "undefined" != typeof console && "function" == typeof console.warn && console.warn("walkerOS: ignored an on-dispatch call with a non-collector argument"));
6434
6453
  }
6435
6454
  function Re2(e4, t4, n5, o4) {
6436
- if (n5 instanceof He) throw n5;
6455
+ if (n5 instanceof Je) throw n5;
6437
6456
  e4.logger.scope("on").error("on callback failed", { kind: t4, ...o4, error: n5 });
6438
6457
  }
6439
- var Ge = [n.Commands.Consent, n.Commands.User, n.Commands.Globals, n.Commands.Custom];
6458
+ var Ge2 = [n.Commands.Consent, n.Commands.User, n.Commands.Globals, n.Commands.Custom];
6440
6459
  function Ke2(e4) {
6441
- return Ge.includes(e4);
6460
+ return Ge2.includes(e4);
6442
6461
  }
6443
6462
  function We2(e4, t4) {
6444
6463
  switch (t4) {
@@ -6468,15 +6487,15 @@ function Ve2(e4, t4) {
6468
6487
  return e4.seenEvents.has(String(t4));
6469
6488
  }
6470
6489
  }
6471
- function Ne(e4, t4) {
6490
+ function Ne2(e4, t4) {
6472
6491
  return e4.cellVersion[String(t4)] ?? 0;
6473
6492
  }
6474
6493
  function Le2(e4, t4, n5) {
6475
6494
  let o4 = e4.delivery.get(t4);
6476
- o4 || (o4 = {}, e4.delivery.set(t4, o4)), o4[String(n5)] = Ne(e4, n5);
6495
+ o4 || (o4 = {}, e4.delivery.set(t4, o4)), o4[String(n5)] = Ne2(e4, n5);
6477
6496
  }
6478
- function Ye(e4, t4, n5) {
6479
- return e4.allowed && Ne(e4, n5) > (function(e5, t5, n6) {
6497
+ function Ye2(e4, t4, n5) {
6498
+ return e4.allowed && Ne2(e4, n5) > (function(e5, t5, n6) {
6480
6499
  const o4 = e5.delivery.get(t5), s6 = o4?.[String(n6)];
6481
6500
  return void 0 === s6 ? -1 : s6;
6482
6501
  })(e4, t4, n5);
@@ -6487,7 +6506,7 @@ function Je2(e4) {
6487
6506
  e4.cascade = void 0;
6488
6507
  });
6489
6508
  }
6490
- function Qe(e4, t4, n5) {
6509
+ function Qe2(e4, t4, n5) {
6491
6510
  const o4 = e4.cascade;
6492
6511
  if (!o4) return true;
6493
6512
  let s6 = o4.counts.get(t4);
@@ -6495,11 +6514,11 @@ function Qe(e4, t4, n5) {
6495
6514
  const r5 = String(n5), i4 = (s6[r5] || 0) + 1;
6496
6515
  return s6[r5] = i4, i4 <= 8 || (9 === i4 && e4.logger.error("state delivery did not converge", { type: r5 }), false);
6497
6516
  }
6498
- function Xe(e4, t4) {
6517
+ function Xe2(e4, t4) {
6499
6518
  return { collector: e4, logger: e4.logger.scope("on").scope(String(t4)) };
6500
6519
  }
6501
- async function Ze(e4, t4, n5) {
6502
- if (!Fe2(e4)) return void He2();
6520
+ async function Ze2(e4, t4, n5) {
6521
+ if (!Fe2(e4)) return void He();
6503
6522
  const o4 = e4.on, s6 = o4[t4] || [], r5 = ae(n5) ? n5 : [n5];
6504
6523
  r5.forEach((e5) => {
6505
6524
  s6.push(e5);
@@ -6507,19 +6526,19 @@ async function Ze(e4, t4, n5) {
6507
6526
  }
6508
6527
  function et(e4, t4, n5, o4, s6) {
6509
6528
  if (!t4.on) return;
6510
- const r5 = t4.type || "unknown", i4 = e4.logger.scope(r5).scope("on").scope(o4), a4 = { collector: e4, logger: i4, id: n5, config: t4.config, data: s6, env: bt(t4.env, t4.config.env), reportError: L2(e4, "destination", n5, i4, t4) };
6511
- We(t4.on, (t5) => Re2(e4, "destination", t5, { destId: n5, type: o4 }))(o4, a4);
6529
+ const r5 = t4.type || "unknown", i4 = e4.logger.scope(r5).scope("on").scope(o4), a4 = { collector: e4, logger: i4, id: n5, config: t4.config, data: s6, env: bt2(t4.env, t4.config.env), reportError: L2(e4, "destination", n5, i4, t4) };
6530
+ Ke(t4.on, (t5) => Re2(e4, "destination", t5, { destId: n5, type: o4 }))(o4, a4);
6512
6531
  }
6513
6532
  function tt(e4, t4, o4, s6) {
6514
- if (!Fe2(e4)) return void He2();
6533
+ if (!Fe2(e4)) return void He();
6515
6534
  const r5 = nt(e4, t4, s6);
6516
6535
  if (o4.length) switch (t4) {
6517
6536
  case n.Commands.Consent:
6518
6537
  !(function(e5, t5, o5) {
6519
- const s7 = o5 || e5.consent, r6 = Xe(e5, n.Commands.Consent);
6538
+ const s7 = o5 || e5.consent, r6 = Xe2(e5, n.Commands.Consent);
6520
6539
  t5.forEach((t6) => {
6521
- Ye(e5, t6, n.Commands.Consent) && Qe(e5, t6, n.Commands.Consent) && (Object.keys(s7).filter((e6) => e6 in t6).forEach((n5) => {
6522
- We(t6[n5], (t7) => Re2(e5, "consent", t7, { key: n5 }))(s7, r6);
6540
+ Ye2(e5, t6, n.Commands.Consent) && Qe2(e5, t6, n.Commands.Consent) && (Object.keys(s7).filter((e6) => e6 in t6).forEach((n5) => {
6541
+ Ke(t6[n5], (t7) => Re2(e5, "consent", t7, { key: n5 }))(s7, r6);
6523
6542
  }), Le2(e5, t6, n.Commands.Consent));
6524
6543
  });
6525
6544
  })(e4, o4, s6);
@@ -6527,34 +6546,34 @@ function tt(e4, t4, o4, s6) {
6527
6546
  case n.Commands.Ready:
6528
6547
  !(function(e5, t5) {
6529
6548
  if (!e5.allowed) return;
6530
- const o5 = Xe(e5, n.Commands.Ready);
6549
+ const o5 = Xe2(e5, n.Commands.Ready);
6531
6550
  t5.forEach((t6) => {
6532
- We(t6, (t7) => Re2(e5, "ready", t7))(void 0, o5);
6551
+ Ke(t6, (t7) => Re2(e5, "ready", t7))(void 0, o5);
6533
6552
  });
6534
6553
  })(e4, o4);
6535
6554
  break;
6536
6555
  case n.Commands.Run:
6537
6556
  !(function(e5, t5) {
6538
6557
  if (!e5.allowed) return;
6539
- const o5 = Xe(e5, n.Commands.Run);
6558
+ const o5 = Xe2(e5, n.Commands.Run);
6540
6559
  t5.forEach((t6) => {
6541
- We(t6, (t7) => Re2(e5, "run", t7))(void 0, o5);
6560
+ Ke(t6, (t7) => Re2(e5, "run", t7))(void 0, o5);
6542
6561
  });
6543
6562
  })(e4, o4);
6544
6563
  break;
6545
6564
  case n.Commands.Session:
6546
6565
  !(function(e5, t5) {
6547
6566
  if (!e5.session) return;
6548
- const o5 = Xe(e5, n.Commands.Session);
6567
+ const o5 = Xe2(e5, n.Commands.Session);
6549
6568
  t5.forEach((t6) => {
6550
- We(t6, (t7) => Re2(e5, "session", t7))(e5.session, o5);
6569
+ Ke(t6, (t7) => Re2(e5, "session", t7))(e5.session, o5);
6551
6570
  });
6552
6571
  })(e4, o4);
6553
6572
  break;
6554
6573
  default: {
6555
- const n5 = Xe(e4, t4), s7 = Ke2(t4);
6574
+ const n5 = Xe2(e4, t4), s7 = Ke2(t4);
6556
6575
  o4.forEach((o5) => {
6557
- "function" == typeof o5 && (s7 && !Ye(e4, o5, t4) || s7 && !Qe(e4, o5, t4) || (We(o5, (n6) => Re2(e4, "generic", n6, { type: t4 }))(r5, n5), s7 && Le2(e4, o5, t4)));
6576
+ "function" == typeof o5 && (s7 && !Ye2(e4, o5, t4) || s7 && !Qe2(e4, o5, t4) || (Ke(o5, (n6) => Re2(e4, "generic", n6, { type: t4 }))(r5, n5), s7 && Le2(e4, o5, t4)));
6558
6577
  });
6559
6578
  break;
6560
6579
  }
@@ -6578,24 +6597,24 @@ function nt(e4, t4, o4) {
6578
6597
  return;
6579
6598
  }
6580
6599
  }
6581
- async function ot2(e4, t4, n5, o4, s6) {
6600
+ async function ot(e4, t4, n5, o4, s6) {
6582
6601
  if (!t4.on) return false;
6583
- if (Ke2(o4) && !Ye(e4, t4, o4)) return false;
6584
- if (Ke2(o4) && !Qe(e4, t4, o4)) return false;
6585
- const r5 = await Le(t4.on, (t5) => Re2(e4, "source", t5, { sourceId: n5, type: o4 }))(o4, s6);
6602
+ if (Ke2(o4) && !Ye2(e4, t4, o4)) return false;
6603
+ if (Ke2(o4) && !Qe2(e4, t4, o4)) return false;
6604
+ const r5 = await qe(t4.on, (t5) => Re2(e4, "source", t5, { sourceId: n5, type: o4 }))(o4, s6);
6586
6605
  return Ke2(o4) && Le2(e4, t4, o4), false === r5;
6587
6606
  }
6588
6607
  async function st(e4) {
6589
- if (Fe2(e4)) for (const t4 of Ge) {
6608
+ if (Fe2(e4)) for (const t4 of Ge2) {
6590
6609
  if (!We2(e4, t4)) continue;
6591
6610
  const n5 = nt(e4, t4);
6592
6611
  tt(e4, t4, e4.on[t4] || []);
6593
- for (const [o4, s6] of Object.entries(e4.sources)) Pe2(s6) && await ot2(e4, s6, o4, t4, n5);
6612
+ for (const [o4, s6] of Object.entries(e4.sources)) Pe(s6) && await ot(e4, s6, o4, t4, n5);
6594
6613
  }
6595
- else He2();
6614
+ else He();
6596
6615
  }
6597
6616
  async function rt(e4, t4, n5, o4) {
6598
- if (!Fe2(e4)) return He2(), true;
6617
+ if (!Fe2(e4)) return He(), true;
6599
6618
  e4.seenEvents.add(String(t4));
6600
6619
  let s6 = n5 || [];
6601
6620
  n5 || (s6 = e4.on[t4] || []);
@@ -6606,8 +6625,8 @@ async function rt(e4, t4, n5, o4) {
6606
6625
  const e5 = o5.config.require.indexOf(t4);
6607
6626
  -1 !== e5 && o5.config.require.splice(e5, 1);
6608
6627
  }
6609
- if (o5.on) if (Pe2(o5)) {
6610
- await ot2(e4, o5, n6, t4, r5) && (i4 = true);
6628
+ if (o5.on) if (Pe(o5)) {
6629
+ await ot(e4, o5, n6, t4, r5) && (i4 = true);
6611
6630
  } else o5.queueOn = o5.queueOn || [], o5.queueOn.push({ type: t4, data: r5 });
6612
6631
  }
6613
6632
  Object.entries(e4.destinations).forEach(([n6, o5]) => {
@@ -6616,11 +6635,11 @@ async function rt(e4, t4, n5, o4) {
6616
6635
  et(e4, o5, n6, t4, r5);
6617
6636
  }
6618
6637
  });
6619
- for (const [t5, n6] of Object.entries(e4.sources)) Pe2(n6) && n6.queueOn?.length && await Te2(e4, n6, t5);
6620
- const a4 = Object.values(e4.sources).some((e5) => !Pe2(e5) && e5.config.require?.length);
6621
- return (Object.keys(e4.pending.destinations).length > 0 || a4) && await Ue2(e4), tt(e4, t4, s6, o4), !i4;
6638
+ for (const [t5, n6] of Object.entries(e4.sources)) Pe(n6) && n6.queueOn?.length && await Te(e4, n6, t5);
6639
+ const a4 = Object.values(e4.sources).some((e5) => !Pe(e5) && e5.config.require?.length);
6640
+ return (Object.keys(e4.pending.destinations).length > 0 || a4) && await Ue(e4), tt(e4, t4, s6, o4), !i4;
6622
6641
  }
6623
- function it2(e4) {
6642
+ function it(e4) {
6624
6643
  return "number" == typeof e4 && e4 > 0 ? e4 : 1e4;
6625
6644
  }
6626
6645
  var at = class extends Error {
@@ -6644,11 +6663,11 @@ function dt2(e4) {
6644
6663
  function lt(e4) {
6645
6664
  return void 0 === e4 ? {} : "number" == typeof e4 ? { wait: e4 } : { wait: e4.wait, size: e4.size, age: e4.age };
6646
6665
  }
6647
- function ft2(e4, t4, n5) {
6666
+ function ft(e4, t4, n5) {
6648
6667
  if (!e4) return [];
6649
6668
  if (Array.isArray(e4) && e4.every((e5) => "string" == typeof e5)) return Oe2(e4, t4);
6650
6669
  if ("string" == typeof e4) return Oe2(e4, t4);
6651
- const o4 = Zt(e4, nn(n5));
6670
+ const o4 = Ht(e4, sn(n5));
6652
6671
  return 0 === o4.length ? [] : 1 === o4.length ? Oe2(o4[0], t4) : Oe2(o4, t4);
6653
6672
  }
6654
6673
  async function pt2(e4, t4) {
@@ -6659,17 +6678,17 @@ async function pt2(e4, t4) {
6659
6678
  i4 && (d2 = { ...d2, next: i4 }), a4 && (d2 = { ...d2, cache: a4 }), void 0 !== c2 && void 0 === d2.state && (d2 = { ...d2, state: c2 });
6660
6679
  let l3 = d2.id;
6661
6680
  if (!l3) do {
6662
- l3 = Ee(5, "abcdefghijklmnopqrstuvwxyz");
6681
+ l3 = Oe(5, "abcdefghijklmnopqrstuvwxyz");
6663
6682
  } while (e4.destinations[l3] || e4.pending.destinations[l3]);
6664
6683
  if (d2.require?.length) {
6665
- e4.pending.destinations[l3] = t4, await Ue2(e4);
6684
+ e4.pending.destinations[l3] = t4, await Ue(e4);
6666
6685
  const n6 = e4.destinations[l3];
6667
- return n6 ? gt2(e4, void 0, {}, { [l3]: n6 }) : yt2({ ok: true });
6686
+ return n6 ? gt(e4, void 0, {}, { [l3]: n6 }) : yt2({ ok: true });
6668
6687
  }
6669
- const f3 = { ...n5, config: d2, env: bt(n5.env, s6) };
6670
- return e4.destinations[l3] = f3, false !== f3.config.queue && (f3.queuePush = [...e4.queue]), gt2(e4, void 0, {}, { [l3]: f3 });
6688
+ const f3 = { ...n5, config: d2, env: bt2(n5.env, s6) };
6689
+ return e4.destinations[l3] = f3, false !== f3.config.queue && (f3.queuePush = [...e4.queue]), gt(e4, void 0, {}, { [l3]: f3 });
6671
6690
  }
6672
- async function gt2(e4, t4, n5 = {}, o4) {
6691
+ async function gt(e4, t4, n5 = {}, o4) {
6673
6692
  const { allowed: s6, consent: r5, globals: i4, user: g3 } = e4;
6674
6693
  if (!s6) return yt2({ ok: false });
6675
6694
  if (t4) {
@@ -6683,7 +6702,7 @@ async function gt2(e4, t4, n5 = {}, o4) {
6683
6702
  e4.status.in++;
6684
6703
  }
6685
6704
  o4 || (o4 = e4.destinations);
6686
- const h3 = e4.transformers ? Se(e4.transformers) : {}, w3 = await Promise.all(Object.entries(o4 || {}).map(async ([o5, s7]) => {
6705
+ const h3 = e4.transformers ? Se2(e4.transformers) : {}, w3 = await Promise.all(Object.entries(o4 || {}).map(async ([o5, s7]) => {
6687
6706
  if (s7.config.disabled) return { id: o5, destination: s7, skipped: true };
6688
6707
  const w4 = s7.config.id || o5, v4 = o("destination", w4), b4 = R2(s7.config.breaker);
6689
6708
  if (b4 && (function(e5, t5, n6) {
@@ -6695,7 +6714,7 @@ async function gt2(e4, t4, n5 = {}, o4) {
6695
6714
  })(e4.status.breakers, v4, b4.cooldown)) return { id: o5, destination: s7, skipped: true };
6696
6715
  const k4 = (t5) => {
6697
6716
  b4 && G2(e4.status.breakers, v4, t5, b4.threshold, b4.cooldown);
6698
- }, C2 = () => {
6717
+ }, C3 = () => {
6699
6718
  b4 && (function(e5, t5) {
6700
6719
  const n6 = e5[t5];
6701
6720
  n6 && "half-open" === n6.state && true === n6.probing && (n6.state = "open", n6.probing = false);
@@ -6704,9 +6723,9 @@ async function gt2(e4, t4, n5 = {}, o4) {
6704
6723
  let S2 = (s7.queuePush || []).map((e5) => ({ ...e5, consent: r5 }));
6705
6724
  s7.queuePush = [], t4 && S2.push(ye(t4));
6706
6725
  const E3 = n5.ingest ? { ...n5.ingest, _meta: { ...n5.ingest._meta, path: [...n5.ingest._meta.path] } } : E("unknown");
6707
- if (!S2.length && !s7.queueOn?.length) return C2(), { id: o5, destination: s7, skipped: true };
6726
+ if (!S2.length && !s7.queueOn?.length) return C3(), { id: o5, destination: s7, skipped: true };
6708
6727
  if (!S2.length && s7.queueOn?.length) {
6709
- if (!je(s7.config.consent, r5)) return C2(), { id: o5, destination: s7, skipped: true };
6728
+ if (!je(s7.config.consent, r5)) return C3(), { id: o5, destination: s7, skipped: true };
6710
6729
  let t5 = false;
6711
6730
  try {
6712
6731
  t5 = await mt2(e4, s7, o5, true);
@@ -6715,13 +6734,13 @@ async function gt2(e4, t4, n5 = {}, o4) {
6715
6734
  const n6 = s7.type || "unknown";
6716
6735
  e4.logger.scope(n6).error("destination init failed", { error: t6 instanceof Error ? t6.message : String(t6) }), k4("transport-failure");
6717
6736
  }
6718
- return C2(), { id: o5, destination: s7, skipped: !t5 };
6737
+ return C3(), { id: o5, destination: s7, skipped: !t5 };
6719
6738
  }
6720
6739
  const D3 = [], $2 = S2.filter((t5) => {
6721
6740
  const n6 = je(s7.config.consent, r5, t5.consent);
6722
6741
  if (n6) return t5.consent = n6, D3.push(t5), false;
6723
6742
  const i5 = j(e4, { stepId: o("destination", o5), stepType: "destination", phase: "skip", eventId: "string" == typeof t5.id ? t5.id : "", now: Date.now() });
6724
- return i5.skipReason = "consent", r5 && (i5.consent = { ...r5 }), s7.config.consent && (i5.meta = { required: { ...s7.config.consent } }), yt(e4, i5), true;
6743
+ return i5.skipReason = "consent", r5 && (i5.consent = { ...r5 }), s7.config.consent && (i5.meta = { required: { ...s7.config.consent } }), wt(e4, i5), true;
6725
6744
  });
6726
6745
  if ($2.length > 0) {
6727
6746
  const t5 = s7.queuePush, n6 = s7.config.id || o5, r6 = { max: s7.config.queueMax ?? 1e3 };
@@ -6735,23 +6754,23 @@ async function gt2(e4, t4, n5 = {}, o4) {
6735
6754
  z2(t5, e4.logger.scope(s7.type || "unknown"), "destination.queuePush overflow; oldest events dropped", { buffer: "queuePush", destination: n6, cap: r6.max, droppedCount: o6 });
6736
6755
  } else t5.length < r6.max && U2(t5);
6737
6756
  }
6738
- if (!D3.length) return C2(), { id: o5, destination: s7, queue: S2 };
6739
- let A2, M3, T3 = false;
6757
+ if (!D3.length) return C3(), { id: o5, destination: s7, queue: S2 };
6758
+ let A2, M3, T2 = false;
6740
6759
  try {
6741
- T3 = await mt2(e4, s7, o5, true);
6760
+ T2 = await mt2(e4, s7, o5, true);
6742
6761
  } catch (t5) {
6743
6762
  e4.status.failed++;
6744
6763
  const n6 = s7.type || "unknown";
6745
6764
  e4.logger.scope(n6).error("destination init failed", { error: t5 instanceof Error ? t5.message : String(t5) }), k4("transport-failure");
6746
6765
  }
6747
- if (!T3) return C2(), { id: o5, destination: s7, queue: S2 };
6766
+ if (!T2) return C3(), { id: o5, destination: s7, queue: S2 };
6748
6767
  s7.dlq || (s7.dlq = []);
6749
- const _3 = ft2(s7.config.before, h3, E3), F3 = s7.config.next, B4 = s7.config?.cache, K2 = B4 ? rn(B4) : void 0, L4 = K2 ? Ie2(K2, e4) : void 0, Y3 = s7.config?.state ? cn(s7.config.state) : void 0, J3 = Y3?.filter((e5) => "get" === e5.mode), Q3 = Y3?.filter((e5) => "set" === e5.mode);
6768
+ const _3 = ft(s7.config.before, h3, E3), F3 = s7.config.next, B4 = s7.config?.cache, K2 = B4 ? cn(B4) : void 0, L4 = K2 ? Ie2(K2, e4) : void 0, Y3 = s7.config?.state ? pn(s7.config.state) : void 0, J3 = Y3?.filter((e5) => "get" === e5.mode), Q3 = Y3?.filter((e5) => "set" === e5.mode);
6750
6769
  let X3 = 0, Z3 = 0;
6751
6770
  return await Promise.all(D3.map(async (t5) => {
6752
6771
  let r6;
6753
6772
  if (t5.globals = oe(i4, t5.globals), t5.user = oe(g3, t5.user), K2?.stop && L4) {
6754
- const e5 = nn(E3, t5), n6 = await on(K2, L4, e5);
6773
+ const e5 = sn(E3, t5), n6 = await un(K2, L4, e5);
6755
6774
  if ("HIT" === n6?.status) return t5;
6756
6775
  "MISS" === n6?.status && (r6 = { key: n6.key, ttl: n6.rule.ttl });
6757
6776
  }
@@ -6762,14 +6781,14 @@ async function gt2(e4, t4, n5 = {}, o4) {
6762
6781
  s8.respond && (d2 = s8.respond), u2 = Array.isArray(s8.event) ? s8.event[0] : s8.event;
6763
6782
  }
6764
6783
  if (K2 && !K2.stop && L4) {
6765
- const e5 = nn(E3, u2), n6 = await on(K2, L4, e5);
6784
+ const e5 = sn(E3, u2), n6 = await un(K2, L4, e5);
6766
6785
  if ("HIT" === n6?.status) return t5;
6767
6786
  "MISS" === n6?.status && (r6 = { key: n6.key, ttl: n6.rule.ttl });
6768
6787
  }
6769
- J3 && J3.length > 0 && u2 && (u2 = await un(J3, (t6) => qe2(t6, e4), u2, e4));
6788
+ J3 && J3.length > 0 && u2 && (u2 = await dn(J3, (t6) => qe2(t6, e4), u2, e4));
6770
6789
  const p3 = Date.now();
6771
6790
  let m3 = false;
6772
- const y2 = await Le(ht2, (t6) => {
6791
+ const y2 = await qe(ht2, (t6) => {
6773
6792
  const n6 = s7.type || "unknown";
6774
6793
  e4.logger.scope(n6).error("Push failed", { error: t6, event: u2.name }), A2 = t6, m3 = true;
6775
6794
  const r7 = s7.dlq, i5 = s7.config.id || o5, a4 = { max: s7.config.dlqMax ?? W }, c2 = P2(r7, [u2, t6], a4);
@@ -6779,9 +6798,9 @@ async function gt2(e4, t4, n5 = {}, o4) {
6779
6798
  z2(r7, e4.logger.scope(s7.type || "unknown"), "destination.dlq overflow; oldest entries dropped", { buffer: "dlq", destination: i5, cap: a4.max, droppedCount: t7 });
6780
6799
  } else r7.length < a4.max && U2(r7);
6781
6800
  })(e4, s7, o5, u2, E3, d2);
6782
- if (X3 += Date.now() - p3, r6 && L4 && void 0 === s7.config.mock && an(L4, r6.key, y2 ?? true, r6.ttl), !m3 && !dt2(y2) && Q3 && Q3.length > 0 && u2 && (u2 = await un(Q3, (t6) => qe2(t6, e4), u2, e4)), void 0 === y2 || dt2(y2) || (M3 = y2), dt2(y2) && Z3++, !m3 && F3) {
6801
+ if (X3 += Date.now() - p3, r6 && L4 && void 0 === s7.config.mock && fn(L4, r6.key, y2 ?? true, r6.ttl), !m3 && !dt2(y2) && Q3 && Q3.length > 0 && u2 && (u2 = await dn(Q3, (t6) => qe2(t6, e4), u2, e4)), void 0 === y2 || dt2(y2) || (M3 = y2), dt2(y2) && Z3++, !m3 && F3) {
6783
6802
  void 0 !== y2 && (E3._response = y2);
6784
- const t6 = ft2(F3, h3, E3);
6803
+ const t6 = ft(F3, h3, E3);
6785
6804
  if (t6.length > 0 && e4.transformers && Object.keys(e4.transformers).length > 0) {
6786
6805
  const n6 = await $e(e4, e4.transformers, t6, u2, E3, d2, `destination.${o5}.next`);
6787
6806
  n6.respond && (d2 = n6.respond);
@@ -6814,16 +6833,16 @@ async function mt2(e4, t4, n5, o4 = false) {
6814
6833
  const t5 = e5.config.consent;
6815
6834
  return !!t5 && Object.keys(t5).length > 0;
6816
6835
  })(t4)) return e4.logger.scope(t4.type || "unknown").debug("init blocked: consent gate not cleared"), false;
6817
- const s6 = t4.type || "unknown", r5 = e4.logger.scope(s6), i4 = { collector: e4, logger: r5, id: n5, config: t4.config, env: bt(t4.env, t4.config.env), reportError: L2(e4, "destination", n5, r5, t4) };
6836
+ const s6 = t4.type || "unknown", r5 = e4.logger.scope(s6), i4 = { collector: e4, logger: r5, id: n5, config: t4.config, env: bt2(t4.env, t4.config.env), reportError: L2(e4, "destination", n5, r5, t4) };
6818
6837
  r5.debug("init");
6819
6838
  const a4 = Date.now();
6820
6839
  let c2;
6821
- yt(e4, j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "init", eventId: "", now: a4 }));
6840
+ wt(e4, j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "init", eventId: "", now: a4 }));
6822
6841
  try {
6823
- c2 = await ct(t4.init, "DestinationInit", e4.hooks, e4.logger)(i4);
6842
+ c2 = await pt(t4.init, "DestinationInit", e4.hooks, e4.logger)(i4);
6824
6843
  } catch (t5) {
6825
6844
  const o5 = Date.now(), s7 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "error", eventId: "", now: o5 });
6826
- throw s7.durationMs = o5 - a4, s7.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, yt(e4, s7), t5;
6845
+ throw s7.durationMs = o5 - a4, s7.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, wt(e4, s7), t5;
6827
6846
  }
6828
6847
  if (false === c2) return c2;
6829
6848
  if (t4.config = { ...c2 || t4.config, init: true }, t4.queueOn?.length) {
@@ -6836,14 +6855,14 @@ async function mt2(e4, t4, n5, o4 = false) {
6836
6855
  return true;
6837
6856
  }
6838
6857
  async function ht2(e4, t4, n5, o4, s6, r5) {
6839
- const { config: i4 } = t4, a4 = await Je(o4, i4, e4);
6858
+ const { config: i4 } = t4, a4 = await Qe(o4, i4, e4);
6840
6859
  if (a4.ignore) return false;
6841
- const c2 = t4.type || "unknown", u2 = e4.logger.scope(c2), d2 = { collector: e4, logger: u2, id: n5, config: i4, data: a4.data, rule: a4.mapping, ingest: s6, env: { ...bt(t4.env, i4.env), ...r5 ? { respond: r5 } : {} }, reportError: L2(e4, "destination", n5, u2, t4) };
6860
+ const c2 = t4.type || "unknown", u2 = e4.logger.scope(c2), d2 = { collector: e4, logger: u2, id: n5, config: i4, data: a4.data, rule: a4.mapping, ingest: s6, env: { ...bt2(t4.env, i4.env), ...r5 ? { respond: r5 } : {} }, reportError: L2(e4, "destination", n5, u2, t4) };
6842
6861
  if (void 0 !== i4.mock) return u2.debug("mock", { event: a4.event.name }), i4.mock;
6843
6862
  const l3 = a4.mapping, f3 = void 0 !== l3?.batch, p3 = f3 ? a4.mappingKey || "* *" : " batch-all";
6844
6863
  if ((f3 || void 0 !== i4.batch) && t4.pushBatch && void 0 === i4.mock) {
6845
6864
  if (t4.batches = t4.batches || {}, !t4.batches[p3]) {
6846
- const o6 = { key: p3, entries: [], events: [], data: [] }, s7 = lt(l3?.batch), r6 = lt(i4.batch), a5 = s7.wait ?? r6.wait ?? 3e4, c4 = s7.size ?? r6.size ?? 1e3, d4 = s7.age ?? r6.age ?? 3e4, h3 = bt(t4.env, i4.env), y2 = Ie(async () => {
6865
+ const o6 = { key: p3, entries: [], events: [], data: [] }, s7 = lt(l3?.batch), r6 = lt(i4.batch), a5 = s7.wait ?? r6.wait ?? 3e4, c4 = s7.size ?? r6.size ?? 1e3, d4 = s7.age ?? r6.age ?? 3e4, h3 = bt2(t4.env, i4.env), y2 = Re(async () => {
6847
6866
  const o7 = t4.batches[p3], s8 = o7.batched;
6848
6867
  if (0 === s8.entries.length) return;
6849
6868
  const r7 = { key: s8.key, entries: s8.entries, events: s8.events, data: s8.data };
@@ -6853,7 +6872,7 @@ async function ht2(e4, t4, n5, o4, s6, r5) {
6853
6872
  const d5 = t4.config.id || n5, l4 = V(e4, d5), f4 = R2(t4.config.breaker), g3 = o("destination", d5), y3 = (t5) => {
6854
6873
  f4 && G2(e4.status.breakers, g3, t5, f4.threshold, f4.cooldown);
6855
6874
  }, w3 = Date.now(), v3 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "flush", eventId: "", now: w3 });
6856
- v3.batch = { size: r7.entries.length, index: 0 }, yt(e4, v3);
6875
+ v3.batch = { size: r7.entries.length, index: 0 }, wt(e4, v3);
6857
6876
  const b3 = (n6) => {
6858
6877
  const o8 = t4.dlq = t4.dlq || [], s9 = { max: t4.config.dlqMax ?? W };
6859
6878
  let r8 = 0;
@@ -6866,11 +6885,11 @@ async function ht2(e4, t4, n5, o4, s6, r5) {
6866
6885
  } else o8.length < s9.max && U2(o8);
6867
6886
  l4.failed += n6.length, l4.dlqSize = o8.length, e4.status.failed += n6.length;
6868
6887
  };
6869
- let C2 = r7.entries.length;
6870
- const x2 = it2(i4.timeout), O2 = await Le((o8, s9) => ct2(Promise.resolve(ct(t4.pushBatch, "DestinationPushBatch", e4.hooks, e4.logger)(o8, s9)), x2, `Destination "${n5}" batch delivery timed out after ${x2}ms`), (t5) => {
6871
- C2 = 0;
6888
+ let C3 = r7.entries.length;
6889
+ const x2 = it(i4.timeout), O2 = await qe((o8, s9) => ct2(Promise.resolve(pt(t4.pushBatch, "DestinationPushBatch", e4.hooks, e4.logger)(o8, s9)), x2, `Destination "${n5}" batch delivery timed out after ${x2}ms`), (t5) => {
6890
+ C3 = 0;
6872
6891
  const o8 = Date.now(), s9 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "error", eventId: "", now: o8 });
6873
- s9.durationMs = o8 - w3, s9.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, s9.batch = { size: r7.entries.length, index: 0 }, yt(e4, s9), b3(r7.entries.map((e5) => [e5.event, t5])), y3("transport-failure"), u2.error("Push batch failed", { error: t5 instanceof Error ? t5.message : String(t5), entries: r7.entries.length });
6892
+ s9.durationMs = o8 - w3, s9.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, s9.batch = { size: r7.entries.length, index: 0 }, wt(e4, s9), b3(r7.entries.map((e5) => [e5.event, t5])), y3("transport-failure"), u2.error("Push batch failed", { error: t5 instanceof Error ? t5.message : String(t5), entries: r7.entries.length });
6874
6893
  })(r7, c5);
6875
6894
  if (de(E3 = O2) && Array.isArray(E3.failed) && O2.failed.length > 0) {
6876
6895
  const e5 = [], t5 = /* @__PURE__ */ new Set();
@@ -6878,10 +6897,10 @@ async function ht2(e4, t4, n5, o4, s6, r5) {
6878
6897
  const o8 = r7.entries[n6.index];
6879
6898
  o8 && !t5.has(n6.index) && (t5.add(n6.index), e5.push([o8.event, n6.error ?? new Error(`Push batch entry ${n6.index} failed (no per-row error provided)`)]));
6880
6899
  }
6881
- e5.length > 0 && (b3(e5), C2 = Math.max(0, r7.entries.length - e5.length), u2.error("Push batch partial failure", { failed: e5.length, delivered: C2, entries: r7.entries.length }));
6900
+ e5.length > 0 && (b3(e5), C3 = Math.max(0, r7.entries.length - e5.length), u2.error("Push batch partial failure", { failed: e5.length, delivered: C3, entries: r7.entries.length }));
6882
6901
  }
6883
6902
  var E3;
6884
- u2.debug("push batch done"), l4.inFlightBatch = Math.max(0, (l4.inFlightBatch ?? 0) - r7.entries.length), C2 > 0 && (l4.count += C2, l4.lastAt = Date.now(), e4.status.out += C2, y3("success"));
6903
+ u2.debug("push batch done"), l4.inFlightBatch = Math.max(0, (l4.inFlightBatch ?? 0) - r7.entries.length), C3 > 0 && (l4.count += C3, l4.lastAt = Date.now(), e4.status.out += C3, y3("success"));
6885
6904
  }, { wait: a5, size: c4, age: d4 });
6886
6905
  t4.batches[p3] = { batched: o6, isDefault: !f3, batchFn: () => {
6887
6906
  y2();
@@ -6897,37 +6916,37 @@ async function ht2(e4, t4, n5, o4, s6, r5) {
6897
6916
  {
6898
6917
  u2.debug("push", { event: a4.event.name });
6899
6918
  const o5 = "string" == typeof a4.event.id ? a4.event.id : "", s7 = Date.now(), r6 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "in", eventId: o5, now: s7 });
6900
- a4.mappingKey && (r6.mappingKey = a4.mappingKey), a4.event.consent && (r6.consent = { ...a4.event.consent }), r6.inEvent = a4.event, yt(e4, r6);
6919
+ a4.mappingKey && (r6.mappingKey = a4.mappingKey), a4.event.consent && (r6.consent = { ...a4.event.consent }), r6.inEvent = a4.event, wt(e4, r6);
6901
6920
  try {
6902
- const r7 = it2(i4.timeout), c3 = await ct2(Promise.resolve(ct(t4.push, "DestinationPush", e4.hooks, e4.logger)(a4.event, d2)), r7, `Destination "${n5}" delivery timed out after ${r7}ms`), l4 = Date.now(), f4 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "out", eventId: o5, now: l4 });
6903
- return f4.durationMs = l4 - s7, f4.outEvent = a4.event, ue(c3) && (f4.meta = { ...f4.meta, response: c3 }), a4.mappingKey && (f4.mappingKey = a4.mappingKey), yt(e4, f4), u2.debug("push done"), c3;
6921
+ const r7 = it(i4.timeout), c3 = await ct2(Promise.resolve(pt(t4.push, "DestinationPush", e4.hooks, e4.logger)(a4.event, d2)), r7, `Destination "${n5}" delivery timed out after ${r7}ms`), l4 = Date.now(), f4 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "out", eventId: o5, now: l4 });
6922
+ return f4.durationMs = l4 - s7, f4.outEvent = a4.event, ue(c3) && (f4.meta = { ...f4.meta, response: c3 }), a4.mappingKey && (f4.mappingKey = a4.mappingKey), wt(e4, f4), u2.debug("push done"), c3;
6904
6923
  } catch (t5) {
6905
6924
  const r7 = Date.now(), i5 = j(e4, { stepId: o("destination", n5), stepType: "destination", phase: "error", eventId: o5, now: r7 });
6906
- throw i5.durationMs = r7 - s7, i5.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, a4.mappingKey && (i5.mappingKey = a4.mappingKey), yt(e4, i5), t5;
6925
+ throw i5.durationMs = r7 - s7, i5.error = t5 instanceof Error ? { name: t5.name, message: t5.message } : { message: String(t5) }, a4.mappingKey && (i5.mappingKey = a4.mappingKey), wt(e4, i5), t5;
6907
6926
  }
6908
6927
  }
6909
6928
  }
6910
6929
  function yt2(e4) {
6911
6930
  return { ok: !e4?.failed, ...e4 };
6912
6931
  }
6913
- function wt(e4) {
6932
+ function wt2(e4) {
6914
6933
  const { code: t4, config: n5 = {}, env: o4 = {}, cache: s6, state: r5 } = e4, { config: i4 } = xe(e4, "before"), { config: a4 } = xe({ ...e4, config: i4 }, "next"), c2 = { ...t4.config, ...n5, ...a4 };
6915
6934
  s6 && (c2.cache = s6), void 0 !== r5 && void 0 === c2.state && (c2.state = r5);
6916
- const u2 = bt(t4.env, o4);
6935
+ const u2 = bt2(t4.env, o4);
6917
6936
  return { ...t4, config: c2, env: u2 };
6918
6937
  }
6919
- async function vt(e4, t4 = {}) {
6938
+ async function vt2(e4, t4 = {}) {
6920
6939
  const n5 = {};
6921
- for (const [o4, s6] of Object.entries(t4)) s6.config?.require?.length ? e4.pending.destinations[o4] = s6 : n5[o4] = wt(s6);
6940
+ for (const [o4, s6] of Object.entries(t4)) s6.config?.require?.length ? e4.pending.destinations[o4] = s6 : n5[o4] = wt2(s6);
6922
6941
  return n5;
6923
6942
  }
6924
- function bt(e4, t4) {
6943
+ function bt2(e4, t4) {
6925
6944
  return e4 || t4 ? t4 ? e4 && de(e4) && de(t4) ? { ...e4, ...t4 } : t4 : e4 : {};
6926
6945
  }
6927
- var xt = 5e3;
6928
- async function Ot(e4) {
6946
+ var Ot = 5e3;
6947
+ async function Et(e4) {
6929
6948
  const t4 = e4.logger;
6930
- await Et2(e4.sources, "source", t4), await (async function(e5, t5) {
6949
+ await jt(e4.sources, "source", t4), await (async function(e5, t5) {
6931
6950
  const n5 = Object.entries(e5).flatMap(([e6, n6]) => {
6932
6951
  const o4 = n6.batches;
6933
6952
  if (!o4) return [];
@@ -6936,7 +6955,7 @@ async function Ot(e4) {
6936
6955
  let n7;
6937
6956
  try {
6938
6957
  await Promise.race([t6.flush(), new Promise((t7, o5) => {
6939
- n7 = setTimeout(() => o5(new Error(`destination '${e6}' batch flush timed out`)), xt);
6958
+ n7 = setTimeout(() => o5(new Error(`destination '${e6}' batch flush timed out`)), Ot);
6940
6959
  })]);
6941
6960
  } catch (t7) {
6942
6961
  s6.error(`destination '${e6}' batch flush failed: ${t7}`);
@@ -6946,9 +6965,9 @@ async function Ot(e4) {
6946
6965
  });
6947
6966
  });
6948
6967
  await Promise.allSettled(n5);
6949
- })(e4.destinations, t4), await Et2(e4.destinations, "destination", t4), await Et2(e4.transformers, "transformer", t4), await Et2(e4.stores, "store", t4);
6968
+ })(e4.destinations, t4), await jt(e4.destinations, "destination", t4), await jt(e4.transformers, "transformer", t4), await jt(e4.stores, "store", t4);
6950
6969
  }
6951
- async function Et2(e4, t4, n5) {
6970
+ async function jt(e4, t4, n5) {
6952
6971
  const o4 = Object.entries(e4).map(async ([e5, o5]) => {
6953
6972
  const s6 = o5.destroy;
6954
6973
  if (!s6) return;
@@ -6956,7 +6975,7 @@ async function Et2(e4, t4, n5) {
6956
6975
  let c2;
6957
6976
  try {
6958
6977
  await Promise.race([s6(a4), new Promise((n6, o6) => {
6959
- c2 = setTimeout(() => o6(new Error(`${t4} '${e5}' destroy timed out`)), xt);
6978
+ c2 = setTimeout(() => o6(new Error(`${t4} '${e5}' destroy timed out`)), Ot);
6960
6979
  })]);
6961
6980
  } catch (n6) {
6962
6981
  i4.error(`${t4} '${e5}' destroy failed: ${n6}`);
@@ -6966,10 +6985,10 @@ async function Et2(e4, t4, n5) {
6966
6985
  });
6967
6986
  await Promise.allSettled(o4);
6968
6987
  }
6969
- function jt(e4, t4) {
6988
+ function Dt2(e4, t4) {
6970
6989
  e4.stateVersion++, e4.cellVersion[t4] = e4.stateVersion;
6971
6990
  }
6972
- async function Dt2(e4, t4, o4) {
6991
+ async function $t(e4, t4, o4) {
6973
6992
  let r5, i4, a4 = false;
6974
6993
  const c2 = Je2(e4);
6975
6994
  try {
@@ -6981,17 +7000,17 @@ async function Dt2(e4, t4, o4) {
6981
7000
  case n.Commands.Consent:
6982
7001
  if (de(o4)) {
6983
7002
  const { update: t5 } = s2(e4, o4);
6984
- jt(e4, n.Commands.Consent), i4 = t5, a4 = true;
7003
+ Dt2(e4, n.Commands.Consent), i4 = t5, a4 = true;
6985
7004
  }
6986
7005
  break;
6987
7006
  case n.Commands.Custom:
6988
- de(o4) && (e4.custom = oe(e4.custom, o4), jt(e4, n.Commands.Custom), i4 = o4, a4 = true);
7007
+ de(o4) && (e4.custom = oe(e4.custom, o4), Dt2(e4, n.Commands.Custom), i4 = o4, a4 = true);
6989
7008
  break;
6990
7009
  case n.Commands.Destination:
6991
7010
  de(o4) && "code" in o4 && de(o4.code) && (r5 = await pt2(e4, o4));
6992
7011
  break;
6993
7012
  case n.Commands.Globals:
6994
- de(o4) && (e4.globals = oe(e4.globals, o4), jt(e4, n.Commands.Globals), i4 = o4, a4 = true);
7013
+ de(o4) && (e4.globals = oe(e4.globals, o4), Dt2(e4, n.Commands.Globals), i4 = o4, a4 = true);
6995
7014
  break;
6996
7015
  case n.Commands.Hook:
6997
7016
  if (de(o4) && ge(o4.name) && le(o4.fn)) {
@@ -7002,52 +7021,52 @@ async function Dt2(e4, t4, o4) {
7002
7021
  case n.Commands.On:
7003
7022
  if (de(o4) && ge(o4.type)) {
7004
7023
  const { type: t5, rules: n5 } = o4;
7005
- await Ze(e4, t5, n5);
7024
+ await Ze2(e4, t5, n5);
7006
7025
  }
7007
7026
  break;
7008
7027
  case n.Commands.Ready:
7009
7028
  a4 = true;
7010
7029
  break;
7011
7030
  case n.Commands.Run:
7012
- r5 = await Tt(e4, o4), a4 = true;
7031
+ r5 = await Pt2(e4, o4), a4 = true;
7013
7032
  break;
7014
7033
  case n.Commands.Session:
7015
7034
  a4 = true;
7016
7035
  break;
7017
7036
  case n.Commands.Shutdown:
7018
- e4.hasShutdown || (e4.hasShutdown = true, await Ot(e4));
7037
+ e4.hasShutdown || (e4.hasShutdown = true, await Et(e4));
7019
7038
  break;
7020
7039
  case n.Commands.User:
7021
- de(o4) && (oe(e4.user, o4, { shallow: false }), jt(e4, n.Commands.User), i4 = o4, a4 = true);
7040
+ de(o4) && (oe(e4.user, o4, { shallow: false }), Dt2(e4, n.Commands.User), i4 = o4, a4 = true);
7022
7041
  }
7023
- a4 && (await rt(e4, t4, void 0, i4), r5 = await gt2(e4));
7042
+ a4 && (await rt(e4, t4, void 0, i4), r5 = await gt(e4));
7024
7043
  return r5 || yt2({ ok: true });
7025
7044
  })();
7026
7045
  } finally {
7027
7046
  c2();
7028
7047
  }
7029
7048
  }
7030
- function $t(e4, t4) {
7031
- return { timing: Math.round((Date.now() - e4.timing) / 10) / 100, source: { type: "collector", schema: "4", version: "4.2.1-next-1781682752679" }, ...t4 };
7032
- }
7033
7049
  function At(e4, t4) {
7050
+ return { timing: Math.round((Date.now() - e4.timing) / 10) / 100, source: { type: "collector", schema: "4", version: "4.2.1" }, ...t4 };
7051
+ }
7052
+ function Mt(e4, t4) {
7034
7053
  if (!t4.name) throw new Error("Event name is required");
7035
7054
  const [n5, o4] = t4.name.split(" ");
7036
7055
  if (!n5 || !o4) throw new Error("Event name is invalid");
7037
- const { timestamp: s6 = Date.now(), name: r5 = `${n5} ${o4}`, data: i4 = {}, context: a4 = {}, globals: c2 = e4.globals, custom: u2 = {}, user: d2 = e4.user, nested: l3 = [], consent: f3 = e4.consent, id: p3 = Oe(), trigger: g3 = "", entity: m3 = n5, action: h3 = o4, timing: y2 = 0, source: w3 = { type: "collector", schema: "4" } } = t4;
7038
- return { name: r5, data: i4, context: a4, globals: c2, custom: u2, user: d2, nested: l3, consent: f3, id: p3, trigger: g3, entity: m3, action: h3, timestamp: s6, timing: y2, source: w3 };
7056
+ const { timestamp: s6 = Date.now(), name: r5 = `${n5} ${o4}`, data: i4 = {}, context: a4 = {}, globals: c2 = e4.globals, custom: u2 = {}, user: d2 = e4.user, nested: l3 = [], consent: f3 = e4.consent, id: p3 = Ne(), trigger: g3 = "", entity: m3 = n5, action: h3 = o4, timing: y2 = 0, source: w3 = { type: "collector", schema: "4" } } = t4, v3 = w3.count ?? (e4.count += 1), b3 = w3.trace ?? e4.trace, k3 = { ...w3, count: v3 };
7057
+ return void 0 !== b3 && (k3.trace = b3), { name: r5, data: i4, context: a4, globals: c2, custom: u2, user: d2, nested: l3, consent: f3, id: p3, trigger: g3, entity: m3, action: h3, timestamp: s6, timing: y2, source: k3 };
7039
7058
  }
7040
- function Mt2(e4, t4) {
7041
- return At(e4, $t(e4, t4));
7059
+ function Tt(e4, t4) {
7060
+ return Mt(e4, At(e4, t4));
7042
7061
  }
7043
- async function Tt(e4, t4) {
7044
- e4.allowed = true, e4.timing = Date.now(), t4 && (t4.consent && (e4.consent = oe(e4.consent, t4.consent), jt(e4, n.Commands.Consent)), t4.user && (e4.user = oe(e4.user, t4.user), jt(e4, n.Commands.User)), t4.globals && (e4.globals = oe(e4.config.globalsStatic || {}, t4.globals), jt(e4, n.Commands.Globals)), t4.custom && (e4.custom = oe(e4.custom, t4.custom), jt(e4, n.Commands.Custom))), Object.values(e4.destinations).forEach((e5) => {
7062
+ async function Pt2(e4, t4) {
7063
+ e4.allowed = true, e4.timing = Date.now(), e4.trace = Ie(), e4.count = 0, t4 && (t4.consent && (e4.consent = oe(e4.consent, t4.consent), Dt2(e4, n.Commands.Consent)), t4.user && (e4.user = oe(e4.user, t4.user), Dt2(e4, n.Commands.User)), t4.globals && (e4.globals = oe(e4.config.globalsStatic || {}, t4.globals), Dt2(e4, n.Commands.Globals)), t4.custom && (e4.custom = oe(e4.custom, t4.custom), Dt2(e4, n.Commands.Custom))), Object.values(e4.destinations).forEach((e5) => {
7045
7064
  e5.queuePush = [];
7046
- }), e4.queue = [], e4.round++, await Ue2(e4), await st(e4);
7047
- return await gt2(e4);
7065
+ }), e4.queue = [], e4.round++, await Ue(e4), await st(e4);
7066
+ return await gt(e4);
7048
7067
  }
7049
- function Rt2(e4, t4) {
7050
- const n5 = ct(async (n6, o4 = {}) => await Le(async () => {
7068
+ function Gt2(e4, t4) {
7069
+ const n5 = pt(async (n6, o4 = {}) => await qe(async () => {
7051
7070
  const s6 = Date.now(), { id: r5, ingest: i4, respond: a4, mapping: c2, preChain: u2, include: d2, exclude: l3 } = o4;
7052
7071
  let f3 = a4, p3 = n6;
7053
7072
  const g3 = d2 || l3 ? (function(e5, t5, n7) {
@@ -7055,7 +7074,7 @@ function Rt2(e4, t4) {
7055
7074
  return t5 && (o5 = Object.fromEntries(Object.entries(o5).filter(([e6]) => t5.includes(e6)))), n7 && (o5 = Object.fromEntries(Object.entries(o5).filter(([e6]) => !n7.includes(e6)))), o5;
7056
7075
  })(e4.destinations, d2, l3) : void 0, m3 = i4 ?? E(r5 || "unknown");
7057
7076
  if (c2) {
7058
- const t5 = await Je(p3, c2, e4);
7077
+ const t5 = await Qe(p3, c2, e4);
7059
7078
  if (t5.ignore) return yt2({ ok: true });
7060
7079
  if (c2.consent) {
7061
7080
  if (!je(c2.consent, e4.consent, t5.event.consent)) return yt2({ ok: true });
@@ -7068,8 +7087,8 @@ function Rt2(e4, t4) {
7068
7087
  if (n7.stopped) return n7.respond && (f3 = n7.respond), yt2({ ok: true });
7069
7088
  if (n7.respond && (f3 = n7.respond), Array.isArray(n7.event)) {
7070
7089
  const o5 = await Promise.all(n7.event.map(async (n8) => {
7071
- const o6 = t4(n8), s7 = At(e4, o6);
7072
- return gt2(e4, s7, { id: r5, ingest: m3, respond: f3 }, g3);
7090
+ const o6 = t4(n8), s7 = Mt(e4, o6);
7091
+ return gt(e4, s7, { id: r5, ingest: m3, respond: f3 }, g3);
7073
7092
  }));
7074
7093
  if (r5) {
7075
7094
  e4.status.sources[r5] || (e4.status.sources[r5] = { count: 0, duration: 0 });
@@ -7080,7 +7099,7 @@ function Rt2(e4, t4) {
7080
7099
  }
7081
7100
  p3 = n7.event;
7082
7101
  }
7083
- const h3 = Mt2(e4, p3), y2 = await gt2(e4, h3, { id: r5, ingest: m3, respond: f3 }, g3);
7102
+ const h3 = Tt(e4, p3), y2 = await gt(e4, h3, { id: r5, ingest: m3, respond: f3 }, g3);
7084
7103
  if (r5) {
7085
7104
  e4.status.sources[r5] || (e4.status.sources[r5] = { count: 0, duration: 0 });
7086
7105
  const t5 = e4.status.sources[r5];
@@ -7088,22 +7107,22 @@ function Rt2(e4, t4) {
7088
7107
  }
7089
7108
  return y2;
7090
7109
  }, (t5) => {
7091
- if (t5 instanceof He) throw t5;
7110
+ if (t5 instanceof Je) throw t5;
7092
7111
  return e4.status.failed++, e4.logger.error("push failed", { event: n6, ingest: o4.ingest, error: t5 }), yt2({ ok: false });
7093
7112
  })(), "Push", e4.hooks, e4.logger);
7094
7113
  return async (t5, o4) => {
7095
7114
  const s6 = "string" == typeof t5.id ? t5.id : "", r5 = Date.now(), i4 = j(e4, { stepId: "collector.push", stepType: "collector", phase: "in", eventId: s6, now: r5 });
7096
- i4.inEvent = t5, yt(e4, i4);
7115
+ i4.inEvent = t5, wt(e4, i4);
7097
7116
  try {
7098
7117
  const i5 = await n5(t5, o4), a4 = Date.now(), c2 = j(e4, { stepId: "collector.push", stepType: "collector", phase: "out", eventId: s6, now: a4 });
7099
- return c2.durationMs = a4 - r5, c2.outEvent = i5, yt(e4, c2), i5;
7118
+ return c2.durationMs = a4 - r5, c2.outEvent = i5, wt(e4, c2), i5;
7100
7119
  } catch (t6) {
7101
7120
  const n6 = Date.now(), o5 = j(e4, { stepId: "collector.push", stepType: "collector", phase: "error", eventId: s6, now: n6 });
7102
- throw o5.durationMs = n6 - r5, o5.error = t6 instanceof Error ? { name: t6.name, message: t6.message } : { message: String(t6) }, yt(e4, o5), t6;
7121
+ throw o5.durationMs = n6 - r5, o5.error = t6 instanceof Error ? { name: t6.name, message: t6.message } : { message: String(t6) }, wt(e4, o5), t6;
7103
7122
  }
7104
7123
  };
7105
7124
  }
7106
- function Lt2(e4 = {}) {
7125
+ function Yt(e4 = {}) {
7107
7126
  const t4 = e4.maxEntries ?? 1e4, n5 = e4.lowWaterMark ?? 0.8, o4 = e4.sweepIntervalMs ?? 6e4, s6 = Math.floor(t4 * n5), r5 = /* @__PURE__ */ new Map(), i4 = { hits: 0, misses: 0, populates: 0, writes: 0, deletes: 0, evictions_entries: 0, evictions_ttl: 0 };
7108
7127
  let a4;
7109
7128
  o4 > 0 && (a4 = setInterval(function() {
@@ -7136,12 +7155,12 @@ function Lt2(e4 = {}) {
7136
7155
  void 0 !== a4 && (clearInterval(a4), a4 = void 0), r5.clear();
7137
7156
  } };
7138
7157
  }
7139
- function Zt2(e4, t4) {
7158
+ function en(e4, t4) {
7140
7159
  const { cacheConfig: n5, cacheStore: o4, namespace: s6, logger: r5, storeId: i4, collector: a4 } = t4, c2 = (e5, t5) => {
7141
7160
  if (!a4) return;
7142
7161
  const n6 = j(a4, { stepId: `store.${i4}`, stepType: "store", phase: "in", eventId: "", now: Date.now() });
7143
- n6.meta = { op: "cache", cached: "hit" === t5, status: t5, key: e5 }, yt(a4, n6);
7144
- }, u2 = { hits: 0, misses: 0, populates: 0, writes: 0, deletes: 0, inflight_dedups: 0 }, d2 = n5.rules.map((e5) => ({ match: e5.match ? Pt(e5.match) : () => true, ttl: e5.ttl })), l3 = (e5) => `${s6}:${e5}`;
7162
+ n6.meta = { op: "cache", cached: "hit" === t5, status: t5, key: e5 }, wt(a4, n6);
7163
+ }, u2 = { hits: 0, misses: 0, populates: 0, writes: 0, deletes: 0, inflight_dedups: 0 }, d2 = n5.rules.map((e5) => ({ match: e5.match ? Dt(e5.match) : () => true, ttl: e5.ttl })), l3 = (e5) => `${s6}:${e5}`;
7145
7164
  function f3(e5, t5) {
7146
7165
  const n6 = void 0 === t5 ? { key: e5 } : { key: e5, value: t5 };
7147
7166
  return d2.find((e6) => e6.match(n6));
@@ -7150,7 +7169,7 @@ function Zt2(e4, t4) {
7150
7169
  return { type: e4.type, config: e4.config, setup: e4.setup, get counters() {
7151
7170
  return { ...u2 };
7152
7171
  }, async get(t5) {
7153
- const n6 = l3(t5), s7 = await o4.get(n6), r6 = Kt(s7);
7172
+ const n6 = l3(t5), s7 = await o4.get(n6), r6 = Gt(s7);
7154
7173
  if (void 0 !== r6) {
7155
7174
  if (!("expired" in r6)) return u2.hits++, c2(t5, "hit"), r6.value;
7156
7175
  try {
@@ -7169,7 +7188,7 @@ function Zt2(e4, t4) {
7169
7188
  const r7 = f3(t5, s8);
7170
7189
  if (r7) try {
7171
7190
  const e5 = 1e3 * r7.ttl;
7172
- await o4.set(n6, Ht(s8, e5), e5), u2.populates++;
7191
+ await o4.set(n6, Jt(s8, e5), e5), u2.populates++;
7173
7192
  } catch (e5) {
7174
7193
  g3("set", t5, e5);
7175
7194
  }
@@ -7184,7 +7203,7 @@ function Zt2(e4, t4) {
7184
7203
  const r6 = f3(t5, n6);
7185
7204
  if (r6) try {
7186
7205
  const e5 = 1e3 * r6.ttl;
7187
- await o4.set(l3(t5), Ht(n6, e5), e5);
7206
+ await o4.set(l3(t5), Jt(n6, e5), e5);
7188
7207
  } catch (e5) {
7189
7208
  g3("set", t5, e5);
7190
7209
  }
@@ -7201,43 +7220,43 @@ function Zt2(e4, t4) {
7201
7220
  r5 ? r5.warn(o5, { error: n6 }) : console.warn(o5, n6);
7202
7221
  }
7203
7222
  }
7204
- function en(e4, t4, n5) {
7205
- const o4 = `store.${n5}`, s6 = ct(t4.get, "StoreGet", e4.hooks, e4.logger), r5 = ct(t4.set, "StoreSet", e4.hooks, e4.logger), i4 = ct(t4.delete, "StoreDelete", e4.hooks, e4.logger);
7223
+ function tn(e4, t4, n5) {
7224
+ const o4 = `store.${n5}`, s6 = pt(t4.get, "StoreGet", e4.hooks, e4.logger), r5 = pt(t4.set, "StoreSet", e4.hooks, e4.logger), i4 = pt(t4.delete, "StoreDelete", e4.hooks, e4.logger);
7206
7225
  t4.get = async (t5) => {
7207
7226
  const n6 = Date.now(), r6 = j(e4, { stepId: o4, stepType: "store", phase: "in", eventId: "", now: n6 });
7208
- r6.meta = { op: "get", key: t5 }, yt(e4, r6);
7227
+ r6.meta = { op: "get", key: t5 }, wt(e4, r6);
7209
7228
  try {
7210
7229
  const r7 = await s6(t5), i5 = Date.now(), a4 = j(e4, { stepId: o4, stepType: "store", phase: "out", eventId: "", now: i5 });
7211
- return a4.durationMs = i5 - n6, a4.meta = { op: "get", key: t5 }, yt(e4, a4), r7;
7230
+ return a4.durationMs = i5 - n6, a4.meta = { op: "get", key: t5 }, wt(e4, a4), r7;
7212
7231
  } catch (s7) {
7213
7232
  const r7 = Date.now(), i5 = j(e4, { stepId: o4, stepType: "store", phase: "error", eventId: "", now: r7 });
7214
- throw i5.durationMs = r7 - n6, i5.meta = { op: "get", key: t5 }, i5.error = s7 instanceof Error ? { name: s7.name, message: s7.message } : { message: String(s7) }, yt(e4, i5), s7;
7233
+ throw i5.durationMs = r7 - n6, i5.meta = { op: "get", key: t5 }, i5.error = s7 instanceof Error ? { name: s7.name, message: s7.message } : { message: String(s7) }, wt(e4, i5), s7;
7215
7234
  }
7216
7235
  }, t4.set = async (t5, n6, s7) => {
7217
7236
  const i5 = Date.now(), a4 = j(e4, { stepId: o4, stepType: "store", phase: "in", eventId: "", now: i5 });
7218
- a4.meta = { op: "set", key: t5 }, yt(e4, a4);
7237
+ a4.meta = { op: "set", key: t5 }, wt(e4, a4);
7219
7238
  try {
7220
7239
  await r5(t5, n6, s7);
7221
7240
  const a5 = Date.now(), c2 = j(e4, { stepId: o4, stepType: "store", phase: "out", eventId: "", now: a5 });
7222
- c2.durationMs = a5 - i5, c2.meta = { op: "set", key: t5 }, yt(e4, c2);
7241
+ c2.durationMs = a5 - i5, c2.meta = { op: "set", key: t5 }, wt(e4, c2);
7223
7242
  } catch (n7) {
7224
7243
  const s8 = Date.now(), r6 = j(e4, { stepId: o4, stepType: "store", phase: "error", eventId: "", now: s8 });
7225
- throw r6.durationMs = s8 - i5, r6.meta = { op: "set", key: t5 }, r6.error = n7 instanceof Error ? { name: n7.name, message: n7.message } : { message: String(n7) }, yt(e4, r6), n7;
7244
+ throw r6.durationMs = s8 - i5, r6.meta = { op: "set", key: t5 }, r6.error = n7 instanceof Error ? { name: n7.name, message: n7.message } : { message: String(n7) }, wt(e4, r6), n7;
7226
7245
  }
7227
7246
  }, t4.delete = async (t5) => {
7228
7247
  const n6 = Date.now(), s7 = j(e4, { stepId: o4, stepType: "store", phase: "in", eventId: "", now: n6 });
7229
- s7.meta = { op: "delete", key: t5 }, yt(e4, s7);
7248
+ s7.meta = { op: "delete", key: t5 }, wt(e4, s7);
7230
7249
  try {
7231
7250
  await i4(t5);
7232
7251
  const s8 = Date.now(), r6 = j(e4, { stepId: o4, stepType: "store", phase: "out", eventId: "", now: s8 });
7233
- r6.durationMs = s8 - n6, r6.meta = { op: "delete", key: t5 }, yt(e4, r6);
7252
+ r6.durationMs = s8 - n6, r6.meta = { op: "delete", key: t5 }, wt(e4, r6);
7234
7253
  } catch (s8) {
7235
7254
  const r6 = Date.now(), i5 = j(e4, { stepId: o4, stepType: "store", phase: "error", eventId: "", now: r6 });
7236
- throw i5.durationMs = r6 - n6, i5.meta = { op: "delete", key: t5 }, i5.error = s8 instanceof Error ? { name: s8.name, message: s8.message } : { message: String(s8) }, yt(e4, i5), s8;
7255
+ throw i5.durationMs = r6 - n6, i5.meta = { op: "delete", key: t5 }, i5.error = s8 instanceof Error ? { name: s8.name, message: s8.message } : { message: String(s8) }, wt(e4, i5), s8;
7237
7256
  }
7238
7257
  };
7239
7258
  }
7240
- async function tn(e4, t4 = {}) {
7259
+ async function nn(e4, t4 = {}) {
7241
7260
  const n5 = {};
7242
7261
  for (const [o5, s7] of Object.entries(t4)) {
7243
7262
  const { code: t5, config: r5 = {}, env: i4 = {} } = s7, a4 = e4.logger.scope("store").scope(o5), c2 = { collector: e4, logger: a4, id: o5, config: r5, env: i4, reportError: L2(e4, "store", o5, a4) }, u2 = await t5(c2);
@@ -7269,23 +7288,23 @@ async function tn(e4, t4 = {}) {
7269
7288
  const s7 = o4[t5].cache;
7270
7289
  if (!s7) continue;
7271
7290
  let r5, i4;
7272
- void 0 !== s7.store ? (r5 = n5[s7.store], i4 = s7.store) : (n5.__cache || (n5.__cache = Lt2()), r5 = n5.__cache, i4 = "__cache");
7291
+ void 0 !== s7.store ? (r5 = n5[s7.store], i4 = s7.store) : (n5.__cache || (n5.__cache = Yt()), r5 = n5.__cache, i4 = "__cache");
7273
7292
  const a4 = s7.namespace ?? t5;
7274
- e4.logger.scope("store-cache").scope(t5).info(`store "${t5}" caches with namespace "${a4}:" via ${i4}`), n5[t5] = Zt2(n5[t5], { storeId: t5, cacheConfig: s7, cacheStore: r5, namespace: a4, logger: e4.logger.scope("store-cache").scope(t5), collector: e4 });
7293
+ e4.logger.scope("store-cache").scope(t5).info(`store "${t5}" caches with namespace "${a4}:" via ${i4}`), n5[t5] = en(n5[t5], { storeId: t5, cacheConfig: s7, cacheStore: r5, namespace: a4, logger: e4.logger.scope("store-cache").scope(t5), collector: e4 });
7275
7294
  }
7276
- for (const [t5, o5] of Object.entries(n5)) "__cache" !== t5 && en(e4, o5, t5);
7295
+ for (const [t5, o5] of Object.entries(n5)) "__cache" !== t5 && tn(e4, o5, t5);
7277
7296
  return n5;
7278
7297
  }
7279
- async function nn2(e4) {
7280
- const t4 = oe({ globalsStatic: {}, sessionStatic: {}, run: true, queueMax: 1e3 }, e4, { merge: false, extend: false }), n5 = { level: e4.logger?.level, handler: e4.logger?.handler }, o4 = Ue(n5), s6 = { ...t4.globalsStatic, ...e4.globals }, a4 = { allowed: false, config: t4, consent: e4.consent || {}, custom: e4.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s6, hooks: e4.hooks || {}, observers: /* @__PURE__ */ new Set(), logger: o4, on: {}, queue: [], round: 0, stateVersion: 0, cellVersion: {}, delivery: /* @__PURE__ */ new WeakMap(), session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {}, dropped: {}, connectionErrors: {}, breakers: {} }, timing: Date.now(), user: e4.user || {}, sources: {}, pending: { destinations: {} }, hasShutdown: false, seenEvents: /* @__PURE__ */ new Set(), push: void 0, command: void 0 };
7281
- a4.push = Rt2(a4, (e5) => $t(a4, e5)), a4.command = (function(e5, t5) {
7282
- return ct(async (n6, o5, s7) => await Le(async () => await t5(e5, n6, o5, s7), (t6) => {
7283
- if (t6 instanceof He) throw t6;
7298
+ async function on(e4) {
7299
+ const t4 = oe({ globalsStatic: {}, sessionStatic: {}, run: true, queueMax: 1e3 }, e4, { merge: false, extend: false }), n5 = { level: e4.logger?.level, handler: e4.logger?.handler }, o4 = Be(n5), s6 = { ...t4.globalsStatic, ...e4.globals }, a4 = { allowed: false, config: t4, consent: e4.consent || {}, custom: e4.custom || {}, destinations: {}, transformers: {}, stores: {}, globals: s6, hooks: e4.hooks || {}, observers: /* @__PURE__ */ new Set(), logger: o4, on: {}, queue: [], round: 0, count: 0, stateVersion: 0, cellVersion: {}, delivery: /* @__PURE__ */ new WeakMap(), session: void 0, status: { startedAt: Date.now(), in: 0, out: 0, failed: 0, sources: {}, destinations: {}, dropped: {}, connectionErrors: {}, breakers: {} }, timing: Date.now(), user: e4.user || {}, sources: {}, pending: { destinations: {} }, hasShutdown: false, seenEvents: /* @__PURE__ */ new Set(), push: void 0, command: void 0 };
7300
+ a4.push = Gt2(a4, (e5) => At(a4, e5)), a4.command = (function(e5, t5) {
7301
+ return pt(async (n6, o5, s7) => await qe(async () => await t5(e5, n6, o5, s7), (t6) => {
7302
+ if (t6 instanceof Je) throw t6;
7284
7303
  return e5.status.failed++, e5.logger.error("command failed", { command: n6, data: o5, error: t6 }), yt2({ ok: false });
7285
7304
  })(), "Command", e5.hooks, e5.logger);
7286
- })(a4, Dt2);
7305
+ })(a4, $t);
7287
7306
  const c2 = e4.stores || {};
7288
- return a4.stores = await tn(a4, c2), (function(e5, t5, n6) {
7307
+ return a4.stores = await nn(a4, c2), (function(e5, t5, n6) {
7289
7308
  const o5 = /* @__PURE__ */ new Map();
7290
7309
  for (const [n7, s8] of Object.entries(e5)) t5[n7] && o5.set(s8, t5[n7]);
7291
7310
  if (0 !== o5.size) {
@@ -7299,10 +7318,10 @@ async function nn2(e4) {
7299
7318
  }
7300
7319
  }
7301
7320
  }
7302
- })(c2, a4.stores, e4), a4.stores.__cache || (a4.stores.__cache = Lt2()), a4.destinations = await vt(a4, e4.destinations || {}), a4.transformers = await (async function(e5, t5 = {}) {
7321
+ })(c2, a4.stores, e4), a4.stores.__cache || (a4.stores.__cache = Yt()), a4.destinations = await vt2(a4, e4.destinations || {}), a4.transformers = await (async function(e5, t5 = {}) {
7303
7322
  const n6 = {};
7304
7323
  for (const [o5, s7] of Object.entries(t5)) {
7305
- const { code: t6, env: r5 = {} } = s7, i4 = mn(s7, "Transformer");
7324
+ const { code: t6, env: r5 = {} } = s7, i4 = vn(s7, "Transformer");
7306
7325
  if (!i4.ok) {
7307
7326
  e5.logger.warn(`Transformer ${o5} invalid (${i4.code}): ${i4.reason}. Skipping.`);
7308
7327
  continue;
@@ -7319,7 +7338,7 @@ async function nn2(e4) {
7319
7338
  }
7320
7339
  }
7321
7340
  return n7.length > 0 && e6.collector.logger.warn(`Transformer ${o5}: \`${n7.join(", ")}\` ignored at transformer position (only event-mutating fields apply).`), { type: "pass", config: e6.config, push: async (n8) => {
7322
- const o6 = await Je(n8, t7, e6.collector);
7341
+ const o6 = await Qe(n8, t7, e6.collector);
7323
7342
  return !o6.ignore && { event: o6.event };
7324
7343
  } };
7325
7344
  }
@@ -7330,9 +7349,9 @@ async function nn2(e4) {
7330
7349
  return n6;
7331
7350
  })(a4, e4.transformers || {}), a4;
7332
7351
  }
7333
- async function on2(e4) {
7352
+ async function sn2(e4) {
7334
7353
  e4 = e4 || {};
7335
- const t4 = await nn2(e4), n5 = (o4 = t4, { type: "elb", config: {}, push: async (e5, t5, n6, s7, r6) => {
7354
+ const t4 = await on(e4), n5 = (o4 = t4, { type: "elb", config: {}, push: async (e5, t5, n6, s7, r6) => {
7336
7355
  if ("string" == typeof e5 && e5.startsWith("walker ")) {
7337
7356
  const n7 = e5.replace("walker ", "");
7338
7357
  return o4.command(n7, t5);
@@ -7353,15 +7372,15 @@ async function on2(e4) {
7353
7372
  const u2 = Object.values(t4.sources).filter((e5) => "elb" !== e5.type), d2 = u2.find((e5) => e5.config.primary);
7354
7373
  return d2 ? c2 = d2.push : u2.length > 0 && (c2 = u2[0].push), { collector: t4, elb: c2 };
7355
7374
  }
7356
- function sn2(e4) {
7375
+ function rn2(e4) {
7357
7376
  if (null === e4 || "object" != typeof e4) return e4;
7358
- if (Array.isArray(e4)) return e4.map(sn2);
7377
+ if (Array.isArray(e4)) return e4.map(rn2);
7359
7378
  const t4 = {};
7360
- for (const [n5, o4] of Object.entries(e4)) t4[n5] = "function" == typeof o4 ? o4 : sn2(o4);
7379
+ for (const [n5, o4] of Object.entries(e4)) t4[n5] = "function" == typeof o4 ? o4 : rn2(o4);
7361
7380
  return t4;
7362
7381
  }
7363
- function rn2(e4) {
7364
- const t4 = [], { simulation: n5, ...o4 } = e4, s6 = sn2(o4);
7382
+ function an(e4) {
7383
+ const t4 = [], { simulation: n5, ...o4 } = e4, s6 = rn2(o4);
7365
7384
  for (const e5 of n5) {
7366
7385
  const n6 = e5.startsWith("call:") ? e5.slice(5) : e5, o5 = n6.split(".");
7367
7386
  let r5 = s6;
@@ -7514,7 +7533,7 @@ async function createEmitter(opts) {
7514
7533
  }
7515
7534
  }
7516
7535
  };
7517
- const { elb } = await on2(collectorConfig);
7536
+ const { elb } = await sn2(collectorConfig);
7518
7537
  elbFn = elb;
7519
7538
  return elbFn;
7520
7539
  }
@@ -8380,7 +8399,7 @@ function resolveBeforeChain(before, transformers, ingest, event) {
8380
8399
  if (Array.isArray(before) && before.every(isString)) {
8381
8400
  return before;
8382
8401
  }
8383
- const ids = Zt(before, nn(ingest, event));
8402
+ const ids = Ht(before, sn(ingest, event));
8384
8403
  if (ids.length === 0) return [];
8385
8404
  if (ids.length === 1) return walkStaticChain(ids[0], transformers);
8386
8405
  return ids;
@@ -8981,7 +9000,7 @@ async function simulateCollector(configOrPath, event, options) {
8981
9000
  if (options.state.timing !== void 0)
8982
9001
  collector.timing = options.state.timing;
8983
9002
  }
8984
- const enriched = Mt2(collector, event);
9003
+ const enriched = Tt(collector, event);
8985
9004
  const captured = [{ event: enriched, timestamp: Date.now() }];
8986
9005
  await collector.command("shutdown");
8987
9006
  return buildSimulationResult({
@@ -9087,7 +9106,7 @@ async function simulateDestination(configOrPath, event, options) {
9087
9106
  ...devEnv.push,
9088
9107
  simulation: devEnv.simulation
9089
9108
  };
9090
- const { wrappedEnv, calls } = rn2(combined);
9109
+ const { wrappedEnv, calls } = an(combined);
9091
9110
  if (destConfig) destConfig.env = wrappedEnv;
9092
9111
  trackedCalls = calls;
9093
9112
  }
@@ -10173,9 +10192,9 @@ function createTracePoller(config, logger) {
10173
10192
  if (!("traceUntil" in parsed)) return;
10174
10193
  const value = parsed.traceUntil;
10175
10194
  if (typeof value === "string" && value.length > 0) {
10176
- gt(value);
10195
+ bt(value);
10177
10196
  } else if (value === null) {
10178
- gt(null);
10197
+ bt(null);
10179
10198
  }
10180
10199
  } finally {
10181
10200
  inFlight = false;
@@ -10534,12 +10553,12 @@ function buildTelemetryObservers(flowId, observeLevel) {
10534
10553
  const deploymentId = process.env.WALKEROS_DEPLOYMENT_ID;
10535
10554
  if (!base || !token || !deploymentId) return void 0;
10536
10555
  const url = `${base}/ingest/${deploymentId}`;
10537
- const emit = ht({ url, token });
10556
+ const emit = kt({ url, token });
10538
10557
  const observe = observeLevel !== void 0 ? { level: observeLevel } : void 0;
10539
10558
  return [
10540
- ft(
10559
+ mt(
10541
10560
  emit,
10542
- () => pt({ flowId, observe, traceUntil: mt() })
10561
+ () => yt({ flowId, observe, traceUntil: vt() })
10543
10562
  )
10544
10563
  ];
10545
10564
  }
@@ -12278,7 +12297,7 @@ var Validator = class {
12278
12297
  };
12279
12298
 
12280
12299
  // ../transformers/validate/dist/index.mjs
12281
- var r4 = Object.freeze({ $schema: "http://json-schema.org/draft-07/schema#", description: "Partial event structure with all fields optional", allOf: [{ $ref: "#/definitions/WalkerOSPartialEvent" }], definitions: { WalkerOSProperty: { title: "WalkerOS.Property", description: "PropertyType or an array of PropertyType. Recursive structure for nested objects and arrays.", anyOf: [{ $ref: "#/definitions/WalkerOSPropertyType" }, { type: "array", items: { $ref: "#/definitions/WalkerOSPropertyType" } }] }, WalkerOSPropertyType: { title: "WalkerOS.PropertyType", description: "Base property value types (boolean, string, number, or nested Property record).", anyOf: [{ type: "boolean" }, { type: "string" }, { type: "number" }, { type: "object", propertyNames: { type: "string" }, additionalProperties: { $ref: "#/definitions/WalkerOSProperty" } }] }, WalkerOSProperties: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Flexible property collection with optional values." }, WalkerOSOrderedProperties: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "array", items: [{ $ref: "#/definitions/WalkerOSProperty" }, { type: "number" }] }, title: "WalkerOS.OrderedProperties", description: "Ordered properties with [value, order] tuples for priority control." }, WalkerOSUser: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { id: { description: "User identifier", type: "string" }, device: { description: "Device identifier", type: "string" }, session: { description: "Session identifier", type: "string" }, hash: { description: "Hashed identifier", type: "string" }, address: { description: "User address", type: "string" }, email: { description: "User email address", type: "string", format: "email", pattern: "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, phone: { description: "User phone number", type: "string" }, userAgent: { description: "Browser user agent string", type: "string" }, browser: { description: "Browser name", type: "string" }, browserVersion: { description: "Browser version", type: "string" }, deviceType: { description: "Device type (mobile, desktop, tablet)", type: "string" }, os: { description: "Operating system", type: "string" }, osVersion: { description: "Operating system version", type: "string" }, screenSize: { description: "Screen dimensions", type: "string" }, language: { description: "User language", type: "string" }, country: { description: "User country", type: "string" }, region: { description: "User region/state", type: "string" }, city: { description: "User city", type: "string" }, zip: { description: "User postal code", type: "string" }, timezone: { description: "User timezone", type: "string" }, ip: { description: "User IP address", type: "string" }, internal: { description: "Internal user flag (employee, test user)", type: "boolean" } }, additionalProperties: false }], title: "WalkerOS.User", description: "User identification and attributes." }, __schema0: { description: "Nested entity structure with recursive nesting support", $ref: "#/definitions/WalkerOSEntity" }, WalkerOSEntity: { title: "WalkerOS.Entity", description: "Nested entity structure with recursive nesting support.", type: "object", properties: { entity: { type: "string", description: "Entity name" }, data: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Entity-specific properties", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, nested: { description: "Nested child entities", type: "array", items: { $ref: "#/definitions/__schema0" } }, context: { description: "Entity context data", allOf: [{ $ref: "#/definitions/WalkerOSOrderedProperties" }] } }, required: ["entity", "data"], additionalProperties: false }, WalkerOSEntities: { type: "array", items: { $ref: "#/definitions/__schema0" }, title: "WalkerOS.Entities", description: "Array of nested entities." }, WalkerOSConsent: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "boolean" }, title: "WalkerOS.Consent", description: "Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied." }, WalkerOSSource: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { type: { type: "string", description: "Source kind (browser, dataLayer, gtag, ...)" }, platform: { description: "Runtime platform (web, server, app, ios, android, terminal, ...)", type: "string" }, version: { description: "Deployment version of the source emitter", type: "string" }, schema: { description: 'Event model spec version (collector defaults to "4")', type: "string" }, count: { description: "Emission sequence per run", type: "integer", minimum: 0, maximum: 9007199254740991 }, trace: { description: "W3C traceparent full string", type: "string" }, url: { type: "string" }, referrer: { type: "string" }, tool: { type: "string" }, command: { type: "string" } }, required: ["type"], additionalProperties: false }], title: "WalkerOS.Source", description: "Event source information (origin of the event)." }, WalkerOSPartialEvent: { type: "object", properties: { name: { type: "string", description: 'Event name in "entity action" format (e.g., "page view", "product add")' }, data: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Event-specific properties", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, context: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "array", items: [{ $ref: "#/definitions/WalkerOSProperty" }, { type: "number" }] }, title: "WalkerOS.OrderedProperties", description: "Ordered context properties with priorities", allOf: [{ $ref: "#/definitions/WalkerOSOrderedProperties" }] }, globals: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Global properties shared across events", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, custom: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Custom implementation-specific properties", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, user: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { id: { description: "User identifier", type: "string" }, device: { description: "Device identifier", type: "string" }, session: { description: "Session identifier", type: "string" }, hash: { description: "Hashed identifier", type: "string" }, address: { description: "User address", type: "string" }, email: { description: "User email address", type: "string", format: "email", pattern: "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, phone: { description: "User phone number", type: "string" }, userAgent: { description: "Browser user agent string", type: "string" }, browser: { description: "Browser name", type: "string" }, browserVersion: { description: "Browser version", type: "string" }, deviceType: { description: "Device type (mobile, desktop, tablet)", type: "string" }, os: { description: "Operating system", type: "string" }, osVersion: { description: "Operating system version", type: "string" }, screenSize: { description: "Screen dimensions", type: "string" }, language: { description: "User language", type: "string" }, country: { description: "User country", type: "string" }, region: { description: "User region/state", type: "string" }, city: { description: "User city", type: "string" }, zip: { description: "User postal code", type: "string" }, timezone: { description: "User timezone", type: "string" }, ip: { description: "User IP address", type: "string" }, internal: { description: "Internal user flag (employee, test user)", type: "boolean" } }, additionalProperties: false }], title: "WalkerOS.User", description: "User identification and attributes" }, nested: { type: "array", items: { $ref: "#/definitions/__schema0" }, title: "WalkerOS.Entities", description: "Related nested entities", allOf: [{ $ref: "#/definitions/WalkerOSEntities" }] }, consent: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "boolean" }, title: "WalkerOS.Consent", description: "Consent states at event time", allOf: [{ $ref: "#/definitions/WalkerOSConsent" }] }, id: { type: "string", minLength: 1, description: "W3C span_id, 16 lowercase hex characters" }, trigger: { type: "string", description: "Event trigger identifier" }, entity: { type: "string", description: "Parsed entity from event name" }, action: { type: "string", description: "Parsed action from event name" }, timestamp: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991, description: "Unix timestamp in milliseconds since epoch" }, timing: { type: "number", description: "Event processing timing information" }, source: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { type: { type: "string", description: "Source kind (browser, dataLayer, gtag, ...)" }, platform: { description: "Runtime platform (web, server, app, ios, android, terminal, ...)", type: "string" }, version: { description: "Deployment version of the source emitter", type: "string" }, schema: { description: 'Event model spec version (collector defaults to "4")', type: "string" }, count: { description: "Emission sequence per run", type: "integer", minimum: 0, maximum: 9007199254740991 }, trace: { description: "W3C traceparent full string", type: "string" }, url: { type: "string" }, referrer: { type: "string" }, tool: { type: "string" }, command: { type: "string" } }, required: ["type"], additionalProperties: false }], title: "WalkerOS.Source", description: "Event source information" } }, additionalProperties: false, title: "WalkerOS.PartialEvent", description: "Partial event structure with all fields optional." } } });
12300
+ var r4 = Object.freeze({ $schema: "http://json-schema.org/draft-07/schema#", description: "Partial event structure with all fields optional", allOf: [{ $ref: "#/definitions/WalkerOSPartialEvent" }], definitions: { WalkerOSProperty: { title: "WalkerOS.Property", description: "PropertyType or an array of PropertyType. Recursive structure for nested objects and arrays.", anyOf: [{ $ref: "#/definitions/WalkerOSPropertyType" }, { type: "array", items: { $ref: "#/definitions/WalkerOSPropertyType" } }] }, WalkerOSPropertyType: { title: "WalkerOS.PropertyType", description: "Base property value types (boolean, string, number, or nested Property record).", anyOf: [{ type: "boolean" }, { type: "string" }, { type: "number" }, { type: "object", propertyNames: { type: "string" }, additionalProperties: { $ref: "#/definitions/WalkerOSProperty" } }] }, WalkerOSProperties: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Flexible property collection with optional values." }, WalkerOSOrderedProperties: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "array", items: [{ $ref: "#/definitions/WalkerOSProperty" }, { type: "number" }] }, title: "WalkerOS.OrderedProperties", description: "Ordered properties with [value, order] tuples for priority control." }, WalkerOSUser: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { id: { description: "User identifier", type: "string" }, device: { description: "Device identifier", type: "string" }, session: { description: "Session identifier", type: "string" }, hash: { description: "Hashed identifier", type: "string" }, address: { description: "User address", type: "string" }, email: { description: "User email address", type: "string", format: "email", pattern: "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, phone: { description: "User phone number", type: "string" }, userAgent: { description: "Browser user agent string", type: "string" }, browser: { description: "Browser name", type: "string" }, browserVersion: { description: "Browser version", type: "string" }, deviceType: { description: "Device type (mobile, desktop, tablet)", type: "string" }, os: { description: "Operating system", type: "string" }, osVersion: { description: "Operating system version", type: "string" }, screenSize: { description: "Screen dimensions", type: "string" }, language: { description: "User language", type: "string" }, country: { description: "User country", type: "string" }, region: { description: "User region/state", type: "string" }, city: { description: "User city", type: "string" }, zip: { description: "User postal code", type: "string" }, timezone: { description: "User timezone", type: "string" }, ip: { description: "User IP address", type: "string" }, internal: { description: "Internal user flag (employee, test user)", type: "boolean" } }, additionalProperties: false }], title: "WalkerOS.User", description: "User identification and attributes." }, __schema0: { description: "Nested entity structure with recursive nesting support", $ref: "#/definitions/WalkerOSEntity" }, WalkerOSEntity: { title: "WalkerOS.Entity", description: "Nested entity structure with recursive nesting support.", type: "object", properties: { entity: { type: "string", description: "Entity name" }, data: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Entity-specific properties", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, nested: { description: "Nested child entities", type: "array", items: { $ref: "#/definitions/__schema0" } }, context: { description: "Entity context data", allOf: [{ $ref: "#/definitions/WalkerOSOrderedProperties" }] } }, required: ["entity", "data"], additionalProperties: false }, WalkerOSEntities: { type: "array", items: { $ref: "#/definitions/__schema0" }, title: "WalkerOS.Entities", description: "Array of nested entities." }, WalkerOSConsent: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "boolean" }, title: "WalkerOS.Consent", description: "Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied." }, WalkerOSSource: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { type: { type: "string", description: "Source kind (browser, dataLayer, gtag, ...)" }, platform: { description: "Runtime platform (web, server, app, ios, android, terminal, ...)", type: "string" }, version: { description: "Deployment version of the source emitter", type: "string" }, schema: { description: 'Event model spec version (collector defaults to "4")', type: "string" }, count: { description: "Emission sequence per run", type: "integer", minimum: 0, maximum: 9007199254740991 }, trace: { description: "Trace id shared by every event of a run (W3C trace-id shape)", type: "string" }, url: { type: "string" }, referrer: { type: "string" }, tool: { type: "string" }, command: { type: "string" } }, required: ["type"], additionalProperties: false }], title: "WalkerOS.Source", description: "Event source information (origin of the event)." }, WalkerOSPartialEvent: { type: "object", properties: { name: { type: "string", description: 'Event name in "entity action" format (e.g., "page view", "product add")' }, data: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Event-specific properties", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, context: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "array", items: [{ $ref: "#/definitions/WalkerOSProperty" }, { type: "number" }] }, title: "WalkerOS.OrderedProperties", description: "Ordered context properties with priorities", allOf: [{ $ref: "#/definitions/WalkerOSOrderedProperties" }] }, globals: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Global properties shared across events", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, custom: { type: "object", propertyNames: { type: "string" }, additionalProperties: { allOf: [{ $ref: "#/definitions/WalkerOSProperty" }] }, title: "WalkerOS.Properties", description: "Custom implementation-specific properties", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, user: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { id: { description: "User identifier", type: "string" }, device: { description: "Device identifier", type: "string" }, session: { description: "Session identifier", type: "string" }, hash: { description: "Hashed identifier", type: "string" }, address: { description: "User address", type: "string" }, email: { description: "User email address", type: "string", format: "email", pattern: "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" }, phone: { description: "User phone number", type: "string" }, userAgent: { description: "Browser user agent string", type: "string" }, browser: { description: "Browser name", type: "string" }, browserVersion: { description: "Browser version", type: "string" }, deviceType: { description: "Device type (mobile, desktop, tablet)", type: "string" }, os: { description: "Operating system", type: "string" }, osVersion: { description: "Operating system version", type: "string" }, screenSize: { description: "Screen dimensions", type: "string" }, language: { description: "User language", type: "string" }, country: { description: "User country", type: "string" }, region: { description: "User region/state", type: "string" }, city: { description: "User city", type: "string" }, zip: { description: "User postal code", type: "string" }, timezone: { description: "User timezone", type: "string" }, ip: { description: "User IP address", type: "string" }, internal: { description: "Internal user flag (employee, test user)", type: "boolean" } }, additionalProperties: false }], title: "WalkerOS.User", description: "User identification and attributes" }, nested: { type: "array", items: { $ref: "#/definitions/__schema0" }, title: "WalkerOS.Entities", description: "Related nested entities", allOf: [{ $ref: "#/definitions/WalkerOSEntities" }] }, consent: { type: "object", propertyNames: { type: "string" }, additionalProperties: { type: "boolean" }, title: "WalkerOS.Consent", description: "Consent states at event time", allOf: [{ $ref: "#/definitions/WalkerOSConsent" }] }, id: { type: "string", minLength: 1, description: "W3C span_id, 16 lowercase hex characters" }, trigger: { type: "string", description: "Event trigger identifier" }, entity: { type: "string", description: "Parsed entity from event name" }, action: { type: "string", description: "Parsed action from event name" }, timestamp: { type: "integer", exclusiveMinimum: 0, maximum: 9007199254740991, description: "Unix timestamp in milliseconds since epoch" }, timing: { type: "number", description: "Event processing timing information" }, source: { allOf: [{ description: "Flexible property collection with optional values", allOf: [{ $ref: "#/definitions/WalkerOSProperties" }] }, { type: "object", properties: { type: { type: "string", description: "Source kind (browser, dataLayer, gtag, ...)" }, platform: { description: "Runtime platform (web, server, app, ios, android, terminal, ...)", type: "string" }, version: { description: "Deployment version of the source emitter", type: "string" }, schema: { description: 'Event model spec version (collector defaults to "4")', type: "string" }, count: { description: "Emission sequence per run", type: "integer", minimum: 0, maximum: 9007199254740991 }, trace: { description: "Trace id shared by every event of a run (W3C trace-id shape)", type: "string" }, url: { type: "string" }, referrer: { type: "string" }, tool: { type: "string" }, command: { type: "string" } }, required: ["type"], additionalProperties: false }], title: "WalkerOS.Source", description: "Event source information" } }, additionalProperties: false, title: "WalkerOS.PartialEvent", description: "Partial event structure with all fields optional." } } });
12282
12301
  var i3 = /* @__PURE__ */ new Map();
12283
12302
  function n4(e4) {
12284
12303
  const r5 = JSON.stringify(e4), n5 = i3.get(r5);
@@ -12365,7 +12384,7 @@ function validateFlow(input, options = {}) {
12365
12384
  transformersValue
12366
12385
  )) {
12367
12386
  if (!de(transformerValue)) continue;
12368
- const result = mn(transformerValue, "Transformer");
12387
+ const result = vn(transformerValue, "Transformer");
12369
12388
  if (!result.ok) {
12370
12389
  errors.push({
12371
12390
  path: `flows.${flowName}.transformers.${name}`,
@@ -12826,7 +12845,7 @@ function validateMapping(input) {
12826
12845
  // src/commands/validate/validators/entry.ts
12827
12846
  init_dist();
12828
12847
  import Ajv from "ajv";
12829
- var CLIENT_HEADER = "walkeros-cli/4.2.1-next-1781682752679";
12848
+ var CLIENT_HEADER = "walkeros-cli/4.2.1";
12830
12849
  var SECTIONS = ["destinations", "sources", "transformers"];
12831
12850
  function resolveEntry(path19, flowConfig) {
12832
12851
  const flows = flowConfig.flows;
@@ -12902,7 +12921,7 @@ async function validateEntry(path19, flowConfig) {
12902
12921
  }
12903
12922
  let schemas;
12904
12923
  try {
12905
- const info = await Ct(packageName, {
12924
+ const info = await Pt(packageName, {
12906
12925
  client: CLIENT_HEADER
12907
12926
  });
12908
12927
  schemas = info.schemas;