@walkeros/cli 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -9,6 +9,27 @@ var __export = (target, all) => {
9
9
  __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
11
 
12
+ // src/core/client-context.ts
13
+ function setClientContext(input) {
14
+ const envType = process.env.WALKEROS_CLIENT_TYPE;
15
+ const type = envType ?? input.type ?? "cli";
16
+ context = { type, version: input.version };
17
+ }
18
+ function clientContextHeaders() {
19
+ if (!context) return {};
20
+ return {
21
+ "User-Agent": `walkeros-${context.type}/${context.version}`,
22
+ "X-WalkerOS-Client": context.type,
23
+ "X-WalkerOS-Client-Version": context.version
24
+ };
25
+ }
26
+ var context;
27
+ var init_client_context = __esm({
28
+ "src/core/client-context.ts"() {
29
+ "use strict";
30
+ }
31
+ });
32
+
12
33
  // ../core/dist/index.mjs
13
34
  function x(e3) {
14
35
  return { _meta: { hops: 0, path: [e3] } };
@@ -195,13 +216,13 @@ function D(e3, t, n3) {
195
216
  }
196
217
  return i2;
197
218
  }
198
- function W(e3) {
219
+ function F(e3) {
199
220
  return void 0 !== e3.web ? "web" : void 0 !== e3.server ? "server" : void S("Settings must have web or server key");
200
221
  }
201
222
  function B(e3) {
202
223
  return Array.isArray(e3);
203
224
  }
204
- function J(e3) {
225
+ function q(e3) {
205
226
  return void 0 !== e3;
206
227
  }
207
228
  function Q(e3) {
@@ -222,7 +243,7 @@ function ne(e3, t = "", n3) {
222
243
  }
223
244
  if (r2 = r2 instanceof Object ? r2[t2] : void 0, void 0 === r2) break;
224
245
  }
225
- return J(r2) ? r2 : n3;
246
+ return q(r2) ? r2 : n3;
226
247
  }
227
248
  function be(e3) {
228
249
  return { message: e3.message, name: e3.name, stack: e3.stack, cause: e3.cause };
@@ -605,22 +626,35 @@ function mergeAuthHeaders(token, headers) {
605
626
  if (token) normalized.Authorization = `Bearer ${token}`;
606
627
  return normalized;
607
628
  }
629
+ function buildHeaders(token, headers) {
630
+ return {
631
+ ...clientContextHeaders(),
632
+ ...mergeAuthHeaders(token, headers)
633
+ };
634
+ }
608
635
  async function apiFetch(path18, init) {
609
636
  const baseUrl = resolveAppUrl();
610
637
  const token = resolveToken()?.token;
611
638
  return fetch(`${baseUrl}${path18}`, {
612
639
  ...init,
613
- headers: mergeAuthHeaders(token, init?.headers)
640
+ headers: buildHeaders(token, init?.headers)
614
641
  });
615
642
  }
616
643
  async function publicFetch(path18, init) {
617
644
  const baseUrl = resolveAppUrl();
618
- return fetch(`${baseUrl}${path18}`, init);
645
+ return fetch(`${baseUrl}${path18}`, {
646
+ ...init,
647
+ headers: {
648
+ ...clientContextHeaders(),
649
+ ...normalizeHeaders(init?.headers)
650
+ }
651
+ });
619
652
  }
620
653
  var init_http = __esm({
621
654
  "src/core/http.ts"() {
622
655
  "use strict";
623
656
  init_config_file();
657
+ init_client_context();
624
658
  }
625
659
  });
626
660
 
@@ -1656,8 +1690,8 @@ var init_util = __esm({
1656
1690
  return false;
1657
1691
  }
1658
1692
  try {
1659
- const F2 = Function;
1660
- new F2("");
1693
+ const F3 = Function;
1694
+ new F3("");
1661
1695
  return true;
1662
1696
  } catch (_3) {
1663
1697
  return false;
@@ -2721,11 +2755,11 @@ var init_doc = __esm({
2721
2755
  }
2722
2756
  }
2723
2757
  compile() {
2724
- const F2 = Function;
2758
+ const F3 = Function;
2725
2759
  const args = this?.args;
2726
2760
  const content = this?.content ?? [``];
2727
2761
  const lines = [...content.map((x3) => ` ${x3}`)];
2728
- return new F2(...args, lines.join("\n"));
2762
+ return new F3(...args, lines.join("\n"));
2729
2763
  }
2730
2764
  };
2731
2765
  }
@@ -4664,9 +4698,9 @@ var init_schemas = __esm({
4664
4698
  return payload;
4665
4699
  };
4666
4700
  inst.input = (...args) => {
4667
- const F2 = inst.constructor;
4701
+ const F3 = inst.constructor;
4668
4702
  if (Array.isArray(args[0])) {
4669
- return new F2({
4703
+ return new F3({
4670
4704
  type: "function",
4671
4705
  input: new $ZodTuple({
4672
4706
  type: "tuple",
@@ -4676,15 +4710,15 @@ var init_schemas = __esm({
4676
4710
  output: inst._def.output
4677
4711
  });
4678
4712
  }
4679
- return new F2({
4713
+ return new F3({
4680
4714
  type: "function",
4681
4715
  input: args[0],
4682
4716
  output: inst._def.output
4683
4717
  });
4684
4718
  };
4685
4719
  inst.output = (output) => {
4686
- const F2 = inst.constructor;
4687
- return new F2({
4720
+ const F3 = inst.constructor;
4721
+ return new F3({
4688
4722
  type: "function",
4689
4723
  input: inst._def.input,
4690
4724
  output
@@ -15359,28 +15393,28 @@ function o(e3, n3, i2 = "draft-7") {
15359
15393
  function N2(e3, n3) {
15360
15394
  return external_exports.object({ data: external_exports.union([e3, n3]).optional().describe("Data transformation rules") }).partial();
15361
15395
  }
15362
- function L(e3) {
15396
+ function M2(e3) {
15363
15397
  return external_exports.object({ mapping: e3.optional().describe("Event mapping rules") }).partial();
15364
15398
  }
15365
- function z3(e3) {
15399
+ function T2(e3) {
15366
15400
  return external_exports.object({ policy: e3.optional().describe("Pre-processing policy rules") }).partial();
15367
15401
  }
15368
- function M2(e3) {
15402
+ function L(e3) {
15369
15403
  return external_exports.object({ consent: e3.optional().describe("Required consent states") }).partial();
15370
15404
  }
15371
- function fi(e3) {
15372
- return gi.parse(e3);
15405
+ function Ei(e3) {
15406
+ return ji.parse(e3);
15373
15407
  }
15374
- function hi(e3) {
15375
- return gi.safeParse(e3);
15408
+ function Ri(e3) {
15409
+ return ji.safeParse(e3);
15376
15410
  }
15377
- function vi(e3) {
15378
- return bi.parse(e3);
15411
+ function Pi(e3) {
15412
+ return xi.parse(e3);
15379
15413
  }
15380
- function Si(e3) {
15381
- return bi.safeParse(e3);
15414
+ function Ji(e3) {
15415
+ return xi.safeParse(e3);
15382
15416
  }
15383
- function Ni(e3) {
15417
+ function $i(e3) {
15384
15418
  let n3;
15385
15419
  try {
15386
15420
  n3 = JSON.parse(e3);
@@ -15389,7 +15423,7 @@ function Ni(e3) {
15389
15423
  if (e4 instanceof SyntaxError) {
15390
15424
  const i4 = e4.message.match(/position\s+(\d+)/);
15391
15425
  if (i4) {
15392
- return Li(n5, parseInt(i4[1], 10));
15426
+ return Vi(n5, parseInt(i4[1], 10));
15393
15427
  }
15394
15428
  const t3 = e4.message.match(/line\s+(\d+)\s+column\s+(\d+)/);
15395
15429
  if (t3) return { line: parseInt(t3[1], 10), column: parseInt(t3[2], 10) };
@@ -15398,33 +15432,33 @@ function Ni(e3) {
15398
15432
  })(n4, e3);
15399
15433
  return { valid: false, errors: [{ message: n4 instanceof Error ? n4.message : "Invalid JSON", severity: "error", line: i3, column: t2 }], warnings: [] };
15400
15434
  }
15401
- const i2 = [], t = [], o2 = gi.safeParse(n3);
15435
+ const i2 = [], t = [], o2 = ji.safeParse(n3);
15402
15436
  if (!o2.success) for (const n4 of o2.error.issues) {
15403
- const t2 = n4.path.join("."), o3 = Mi(e3, n4.path);
15437
+ const t2 = n4.path.join("."), o3 = Fi(e3, n4.path);
15404
15438
  i2.push({ message: n4.message, severity: "error", path: t2 || "root", ...o3 });
15405
15439
  }
15406
15440
  const r2 = (function(e4) {
15407
- if (!(Ti(e4) && "version" in e4 && "flows" in e4 && Ti(e4.flows))) return;
15441
+ if (!(Gi(e4) && "version" in e4 && "flows" in e4 && Gi(e4.flows))) return;
15408
15442
  const n4 = {}, i3 = {}, t2 = [], o3 = [], r3 = [], a2 = [], s2 = [];
15409
15443
  let c3;
15410
- Ui(n4, e4.variables), Bi(i3, e4.definitions), (function(e5, n5) {
15411
- if (!Ti(n5)) return;
15444
+ Ki(n4, e4.variables), Qi(i3, e4.definitions), (function(e5, n5) {
15445
+ if (!Gi(n5)) return;
15412
15446
  for (const [, i4] of Object.entries(n5)) {
15413
- if (!Ti(i4)) continue;
15447
+ if (!Gi(i4)) continue;
15414
15448
  const n6 = i4.events;
15415
- if (Ti(n6)) for (const [i5, t3] of Object.entries(n6)) {
15416
- if (!Ti(t3)) continue;
15449
+ if (Gi(n6)) for (const [i5, t3] of Object.entries(n6)) {
15450
+ if (!Gi(t3)) continue;
15417
15451
  const n7 = e5.find((e6) => e6.entity === i5), o4 = Object.keys(t3);
15418
15452
  if (n7) for (const e6 of o4) n7.actions.includes(e6) || n7.actions.push(e6);
15419
15453
  else e5.push({ entity: i5, actions: o4 });
15420
15454
  }
15421
15455
  }
15422
15456
  })(s2, e4.contract);
15423
- for (const s3 of Object.values(e4.flows)) if (Ti(s3)) {
15424
- c3 || ("web" in s3 ? c3 = "web" : "server" in s3 && (c3 = "server")), Ui(n4, s3.variables), Bi(i3, s3.definitions);
15457
+ for (const s3 of Object.values(e4.flows)) if (Gi(s3)) {
15458
+ c3 || ("web" in s3 ? c3 = "web" : "server" in s3 && (c3 = "server")), Ki(n4, s3.variables), Qi(i3, s3.definitions);
15425
15459
  for (const e5 of ["sources", "destinations", "transformers"]) {
15426
15460
  const l3 = "sources" === e5 ? "source" : "destinations" === e5 ? "destination" : "transformer", d2 = "sources" === e5 ? t2 : "destinations" === e5 ? o3 : r3;
15427
- if (Ti(s3[e5])) for (const [t3, o4] of Object.entries(s3[e5])) d2.push(t3), Ti(o4) && (Ui(n4, o4.variables), Bi(i3, o4.definitions), "string" == typeof o4.package && a2.push({ package: o4.package, shortName: t3, type: l3, platform: c3 || "web" }));
15461
+ if (Gi(s3[e5])) for (const [t3, o4] of Object.entries(s3[e5])) d2.push(t3), Gi(o4) && (Ki(n4, o4.variables), Qi(i3, o4.definitions), "string" == typeof o4.package && a2.push({ package: o4.package, shortName: t3, type: l3, platform: c3 || "web" }));
15428
15462
  }
15429
15463
  }
15430
15464
  const l2 = { variables: n4, definitions: i3, stepNames: { sources: t2, destinations: o3, transformers: r3 } };
@@ -15440,7 +15474,7 @@ function Ni(e3) {
15440
15474
  const t2 = /\$var\.(\w+)/g;
15441
15475
  let o3;
15442
15476
  for (; null !== (o3 = t2.exec(e4)); ) if (!(o3[1] in n5.variables)) {
15443
- const t3 = zi(e4, o3.index, o3[0].length);
15477
+ const t3 = Hi(e4, o3.index, o3[0].length);
15444
15478
  i3.push({ message: `Unknown variable "$var.${o3[1]}". Defined: ${Object.keys(n5.variables).join(", ") || "none"}`, severity: "warning", path: `$var.${o3[1]}`, ...t3 });
15445
15479
  }
15446
15480
  }
@@ -15448,7 +15482,7 @@ function Ni(e3) {
15448
15482
  const t2 = /\$def\.(\w+)/g;
15449
15483
  let o3;
15450
15484
  for (; null !== (o3 = t2.exec(e4)); ) if (!(o3[1] in n5.definitions)) {
15451
- const t3 = zi(e4, o3.index, o3[0].length);
15485
+ const t3 = Hi(e4, o3.index, o3[0].length);
15452
15486
  i3.push({ message: `Unknown definition "$def.${o3[1]}". Defined: ${Object.keys(n5.definitions).join(", ") || "none"}`, severity: "warning", path: `$def.${o3[1]}`, ...t3 });
15453
15487
  }
15454
15488
  }
@@ -15458,75 +15492,75 @@ function Ni(e3) {
15458
15492
  }
15459
15493
  return { valid: 0 === i2.length, errors: i2, warnings: t, context: r2 };
15460
15494
  }
15461
- function Li(e3, n3) {
15495
+ function Vi(e3, n3) {
15462
15496
  let i2 = 1, t = 1;
15463
15497
  for (let o2 = 0; o2 < n3 && o2 < e3.length; o2++) "\n" === e3[o2] ? (i2++, t = 1) : t++;
15464
15498
  return { line: i2, column: t };
15465
15499
  }
15466
- function zi(e3, n3, i2) {
15467
- const t = Li(e3, n3), o2 = Li(e3, n3 + i2);
15500
+ function Hi(e3, n3, i2) {
15501
+ const t = Vi(e3, n3), o2 = Vi(e3, n3 + i2);
15468
15502
  return { line: t.line, column: t.column, endLine: o2.line, endColumn: o2.column };
15469
15503
  }
15470
- function Mi(e3, n3) {
15504
+ function Fi(e3, n3) {
15471
15505
  if (0 === n3.length) return { line: 1, column: 1 };
15472
15506
  const i2 = n3[n3.length - 1];
15473
15507
  if ("string" == typeof i2) {
15474
15508
  const n4 = `"${i2}"`, t = e3.lastIndexOf(n4);
15475
- if (-1 !== t) return Li(e3, t);
15509
+ if (-1 !== t) return Vi(e3, t);
15476
15510
  }
15477
15511
  return { line: 1, column: 1 };
15478
15512
  }
15479
- function Ti(e3) {
15513
+ function Gi(e3) {
15480
15514
  return "object" == typeof e3 && null !== e3 && !Array.isArray(e3);
15481
15515
  }
15482
- function qi(e3) {
15516
+ function _i(e3) {
15483
15517
  return "string" == typeof e3 || "number" == typeof e3 || "boolean" == typeof e3;
15484
15518
  }
15485
- function Ui(e3, n3) {
15486
- if (Ti(n3)) for (const [i2, t] of Object.entries(n3)) qi(t) && (e3[i2] = t);
15519
+ function Ki(e3, n3) {
15520
+ if (Gi(n3)) for (const [i2, t] of Object.entries(n3)) _i(t) && (e3[i2] = t);
15487
15521
  }
15488
- function Bi(e3, n3) {
15489
- if (Ti(n3)) for (const [i2, t] of Object.entries(n3)) e3[i2] = t;
15522
+ function Qi(e3, n3) {
15523
+ if (Gi(n3)) for (const [i2, t] of Object.entries(n3)) e3[i2] = t;
15490
15524
  }
15491
- function Wi(e3, n3) {
15525
+ function Xi(e3, n3) {
15492
15526
  const i2 = [], t = {};
15493
15527
  for (const [n4, o3] of Object.entries(e3)) {
15494
15528
  o3.required && i2.push(n4);
15495
15529
  const e4 = { type: o3.type };
15496
15530
  if (o3.description && (e4.description = o3.description), o3.pattern && (e4.pattern = o3.pattern), void 0 !== o3.minLength && (e4.minLength = o3.minLength), void 0 !== o3.maxLength && (e4.maxLength = o3.maxLength), void 0 !== o3.minimum && (e4.minimum = o3.minimum), void 0 !== o3.maximum && (e4.maximum = o3.maximum), o3.enum && (e4.enum = [...o3.enum]), void 0 !== o3.default && (e4.default = o3.default), "object" === o3.type && o3.properties) {
15497
15531
  const n5 = {};
15498
- for (const [e5, i3] of Object.entries(o3.properties)) n5[e5] = Ai(i3);
15532
+ for (const [e5, i3] of Object.entries(o3.properties)) n5[e5] = Yi(i3);
15499
15533
  e4.properties = n5;
15500
15534
  }
15501
- "array" === o3.type && o3.items && (e4.items = Ai(o3.items)), t[n4] = e4;
15535
+ "array" === o3.type && o3.items && (e4.items = Yi(o3.items)), t[n4] = e4;
15502
15536
  }
15503
15537
  const o2 = { type: "object", properties: t };
15504
15538
  return n3 && (o2.title = n3), i2.length > 0 && (o2.required = i2), o2;
15505
15539
  }
15506
- function Ai(e3) {
15540
+ function Yi(e3) {
15507
15541
  const n3 = { type: e3.type };
15508
15542
  if (e3.description && (n3.description = e3.description), e3.pattern && (n3.pattern = e3.pattern), void 0 !== e3.minLength && (n3.minLength = e3.minLength), void 0 !== e3.maxLength && (n3.maxLength = e3.maxLength), void 0 !== e3.minimum && (n3.minimum = e3.minimum), void 0 !== e3.maximum && (n3.maximum = e3.maximum), e3.enum && (n3.enum = [...e3.enum]), void 0 !== e3.default && (n3.default = e3.default), "object" === e3.type && e3.properties) {
15509
15543
  const i2 = {};
15510
- for (const [n4, t] of Object.entries(e3.properties)) i2[n4] = Ai(t);
15544
+ for (const [n4, t] of Object.entries(e3.properties)) i2[n4] = Yi(t);
15511
15545
  n3.properties = i2;
15512
15546
  }
15513
- return "array" === e3.type && e3.items && (n3.items = Ai(e3.items)), n3;
15547
+ return "array" === e3.type && e3.items && (n3.items = Yi(e3.items)), n3;
15514
15548
  }
15515
- function $i(e3, n3) {
15516
- const i2 = { type: "array", items: Ai(e3) };
15549
+ function Zi(e3, n3) {
15550
+ const i2 = { type: "array", items: Yi(e3) };
15517
15551
  return void 0 !== n3?.minItems && (i2.minItems = n3.minItems), void 0 !== n3?.maxItems && (i2.maxItems = n3.maxItems), n3?.description && (i2.description = n3.description), n3?.title && (i2.title = n3.title), i2;
15518
15552
  }
15519
- function Vi(e3, n3 = "string", i2) {
15553
+ function et2(e3, n3 = "string", i2) {
15520
15554
  const t = { type: n3, enum: [...e3] };
15521
15555
  return i2?.description && (t.description = i2.description), i2?.title && (t.title = i2.title), t;
15522
15556
  }
15523
- function Hi(e3, n3, i2) {
15524
- return $i({ type: "object" }, { minItems: 2, maxItems: 2, description: i2 || "Tuple with exactly 2 elements [source, transform]" });
15557
+ function nt(e3, n3, i2) {
15558
+ return Zi({ type: "object" }, { minItems: 2, maxItems: 2, description: i2 || "Tuple with exactly 2 elements [source, transform]" });
15525
15559
  }
15526
- function Fi(e3) {
15560
+ function it2(e3) {
15527
15561
  return external_exports.toJSONSchema(e3, { target: "draft-7" });
15528
15562
  }
15529
- var e2, n, i, r, a, s, c2, l, d, p, u2, m, b, g, f, h, v, S2, y, w, k, x2, C2, j, E2, J2, P2, R2, I2, D2, O, T2, q, U2, B2, W2, A2, $, V, H2, F, G, _2, Q2, K, X, Y, Z, ee, ne2, ie, te, oe, re, ae, se, ce, le, de, pe, ue, me, be2, ge, fe, he2, ve2, Se2, ye, we2, ke, xe, Ce, je2, Ee, Je, Pe, Re, Ie, De2, Oe, Ne, Le, ze, Me, Te, qe, Ue, Be, We, Ae, $e, Ve, He, Fe, Ge, _e, Qe2, Ke, Xe2, Ye2, Ze, en, nn, tn, on, rn, an, sn, cn, ln, dn, pn, un, mn, bn, gn, fn, hn, vn, Sn, yn, wn, kn, xn, Cn, jn, En, Jn, Pn, Rn, In, Dn, On, Nn, Ln, zn, Mn, Tn, qn, Un, Bn, Wn, An, $n, Vn, Hn, Fn, Gn, _n, Qn, Kn, Xn, Yn, Zn, ei, ni, ii, ti, oi, ri, ai, si, ci, li, di, pi, ui, mi, bi, gi, yi, wi, ki, xi, Ci, ji, Ei, Ji, Ri, Ii, Di, Oi, _i;
15563
+ var e2, n, i, r, a, s, c2, l, d, p, u2, m, b, f, g, h, v, S2, y, w, k, C2, x2, j, E2, R2, P2, J, O, I2, D2, z3, q2, U2, W, B2, A2, $, V, H2, F2, G, _2, K, Q2, X, Y, Z, ee, ne2, ie, te, oe, re, ae, se, ce, le, de, pe, ue, me, be2, fe, ge, he2, ve2, Se2, ye, we2, ke, Ce, xe, je2, Ee, Re, Pe, Je, Oe, Ie, De2, Ne, Me, Te, Le, ze, qe, Ue, We, Be, Ae, $e, Ve, He, Fe, Ge, _e, Ke, Qe2, Xe2, Ye2, Ze, en, nn, tn, on, rn, an, sn, cn, ln, dn, pn, un, mn, bn, fn, gn, hn, vn, Sn, yn, wn, kn, Cn, xn, jn, En, Rn, Pn, Jn, On, In, Dn, Nn, Mn, Tn, Ln, zn, qn, Un, Wn, Bn, An, $n, Vn, Hn, Fn, Gn, _n, Kn, Qn, Xn, Yn, Zn, ei, ni, ii, ti, oi, ri, ai, si, ci, li, di, pi, ui, mi, bi, fi, gi, hi, vi, Si, yi, wi, ki, Ci, xi, ji, Oi, Ii, Di, Ni, Mi, Ti, Li, zi, Ui, Wi, Bi, Ai, ot;
15530
15564
  var init_dev = __esm({
15531
15565
  "../core/dist/dev.mjs"() {
15532
15566
  "use strict";
@@ -15537,7 +15571,7 @@ var init_dev = __esm({
15537
15571
  for (var t in i2) e2(n3, t, { get: i2[t], enumerable: true });
15538
15572
  };
15539
15573
  i = {};
15540
- n(i, { BaseContextConfig: () => q, BatchConfig: () => U2, CacheRuleSchema: () => Hn, CacheSchema: () => Fn, CacheSchemas: () => Vn, ClickIdEntrySchema: () => Oi, CodeSchema: () => Ri, CollectorSchemas: () => sn, ConsentSchema: () => K, ContractActionsSchema: () => di, ContractSchema: () => mi, ContractSchemaEntry: () => li, Counter: () => d, DeepPartialEventSchema: () => oe, DestinationReferenceSchema: () => si, DestinationSchemas: () => Le, DestinationsMapConfig: () => A2, EntitiesSchema: () => ne2, EntitySchema: () => ee, EventSchema: () => ie, FlowConfigSchema: () => gi, FlowSchemas: () => Mn, FlowSettingsSchema: () => bi, GenericEnvConfig: () => O, GenericSettingsConfig: () => D2, HandlersConfig: () => j, HintSchema: () => Ii, HintsSchema: () => Di, IdConfig: () => P2, Identifier: () => c2, InitConfig: () => R2, LoopSchema: () => fe, MapSchema: () => ve2, MappingResultSchema: () => Ce, MappingSchemas: () => me, MatchExpressionSchema: () => Bn, MatcherSchemas: () => Tn, NextRuleSchema: () => $n, OptionalPrimitiveValue: () => m, OrderedPropertiesSchema: () => _2, PartialEventSchema: () => te, PolicySchema: () => ye, PrimaryConfig: () => I2, PrimitiveSchema: () => Gn, PrimitiveValue: () => u2, ProcessingControlConfig: () => B2, PropertiesSchema: () => G, PropertySchema: () => F, PropertyTypeSchema: () => H2, QueueConfig: () => J2, RequiredBoolean: () => s, RequiredNumber: () => a, RequiredString: () => r, RoutableNextSchema: () => An, RuleSchema: () => we2, RulesSchema: () => ke, RuntimeInstanceConfig: () => T2, SetSchema: () => he2, SourceReferenceSchema: () => ri, SourceSchema: () => Z, SourceSchemas: () => kn, SourceTypeSchema: () => Q2, SourcesMapConfig: () => W2, StoreReferenceSchema: () => ci, TaggingVersion: () => p, Timestamp: () => l, TransformerReferenceSchema: () => ai, UserSchema: () => X, UtilitySchemas: () => b, ValueConfigSchema: () => Se2, ValueSchema: () => be2, ValuesSchema: () => ge, VerboseConfig: () => E2, VersionSchema: () => Y, WalkerOSSchemas: () => $, configJsonSchema: () => yi, consentJsonSchema: () => ue, contractEntryJsonSchema: () => Ei, contractJsonSchema: () => Ji, createArraySchema: () => $i, createConsentConfig: () => M2, createDataTransformationConfig: () => N2, createEnumSchema: () => Vi, createMappingRulesConfig: () => L, createObjectSchema: () => Wi, createPolicyConfig: () => z3, createTupleSchema: () => Hi, destinationReferenceJsonSchema: () => xi, entityJsonSchema: () => de, eventJsonSchema: () => re, loopJsonSchema: () => Je, mapJsonSchema: () => Re, orderedPropertiesJsonSchema: () => le, parseConfig: () => fi, parseSettings: () => vi, partialEventJsonSchema: () => ae, policyJsonSchema: () => Ie, propertiesJsonSchema: () => ce, ruleJsonSchema: () => De2, rulesJsonSchema: () => Oe, safeParseConfig: () => hi, safeParseSettings: () => Si, setJsonSchema: () => Pe, settingsJsonSchema: () => wi, sourceReferenceJsonSchema: () => ki, sourceTypeJsonSchema: () => pe, storeReferenceJsonSchema: () => ji, transformerReferenceJsonSchema: () => Ci, userJsonSchema: () => se, validateFlowConfig: () => Ni, valueConfigJsonSchema: () => Ee, valueJsonSchema: () => je2, z: () => external_exports, zodToSchema: () => Fi });
15574
+ n(i, { BaseContextConfig: () => q2, BatchConfig: () => U2, CacheRuleSchema: () => $e, CacheSchema: () => Ve, CacheSchemas: () => Ae, ClickIdEntrySchema: () => Ai, CodeSchema: () => Ui, CollectorSchemas: () => hn, ConsentSchema: () => Q2, ContractActionsSchema: () => yi, ContractSchema: () => Ci, ContractSchemaEntry: () => Si, Counter: () => d, DeepPartialEventSchema: () => oe, DestinationReferenceSchema: () => hi, DestinationSchemas: () => Me, DestinationsMapConfig: () => A2, EntitiesSchema: () => ne2, EntitySchema: () => ee, EventSchema: () => ie, FlowConfigSchema: () => ji, FlowSchemas: () => ii, FlowSettingsSchema: () => xi, GenericEnvConfig: () => D2, GenericSettingsConfig: () => I2, HandlersConfig: () => j, HintSchema: () => Wi, HintsSchema: () => Bi, IdConfig: () => P2, Identifier: () => c2, InitConfig: () => J, LoopSchema: () => ge, MapSchema: () => ve2, MappingResultSchema: () => xe, MappingSchemas: () => me, MatchExpressionSchema: () => qe, MatcherSchemas: () => Te, NextRuleSchema: () => Be, OptionalPrimitiveValue: () => m, OrderedPropertiesSchema: () => _2, PartialEventSchema: () => te, PolicySchema: () => ye, PrimaryConfig: () => O, PrimitiveSchema: () => ti, PrimitiveValue: () => u2, ProcessingControlConfig: () => W, PropertiesSchema: () => G, PropertySchema: () => F2, PropertyTypeSchema: () => H2, QueueConfig: () => R2, RequiredBoolean: () => s, RequiredNumber: () => a, RequiredString: () => r, RoutableNextSchema: () => We, RuleSchema: () => we2, RulesSchema: () => ke, RuntimeInstanceConfig: () => z3, SetSchema: () => he2, SourceReferenceSchema: () => fi, SourceSchema: () => Z, SourceSchemas: () => Dn, SourceTypeSchema: () => K, SourcesMapConfig: () => B2, StoreReferenceSchema: () => vi, StoreSchemas: () => Xn, TaggingVersion: () => p, Timestamp: () => l, TransformerReferenceSchema: () => gi, TransformerSchemas: () => Fn, UserSchema: () => X, UtilitySchemas: () => b, ValueConfigSchema: () => Se2, ValueSchema: () => be2, ValuesSchema: () => fe, VerboseConfig: () => E2, VersionSchema: () => Y, WalkerOSSchemas: () => $, configJsonSchema: () => Oi, consentJsonSchema: () => ue, contractEntryJsonSchema: () => Li, contractJsonSchema: () => zi, createArraySchema: () => Zi, createConsentConfig: () => L, createDataTransformationConfig: () => N2, createEnumSchema: () => et2, createMappingRulesConfig: () => M2, createObjectSchema: () => Xi, createPolicyConfig: () => T2, createTupleSchema: () => nt, destinationReferenceJsonSchema: () => Ni, entityJsonSchema: () => de, eventJsonSchema: () => re, loopJsonSchema: () => Re, mapJsonSchema: () => Je, orderedPropertiesJsonSchema: () => le, parseConfig: () => Ei, parseSettings: () => Pi, partialEventJsonSchema: () => ae, policyJsonSchema: () => Oe, propertiesJsonSchema: () => ce, ruleJsonSchema: () => Ie, rulesJsonSchema: () => De2, safeParseConfig: () => Ri, safeParseSettings: () => Ji, setJsonSchema: () => Pe, settingsJsonSchema: () => Ii, sourceReferenceJsonSchema: () => Di, sourceTypeJsonSchema: () => pe, storeReferenceJsonSchema: () => Ti, transformerReferenceJsonSchema: () => Mi, userJsonSchema: () => se, validateFlowConfig: () => $i, valueConfigJsonSchema: () => Ee, valueJsonSchema: () => je2, z: () => external_exports, zodToSchema: () => it2 });
15541
15575
  r = external_exports.string();
15542
15576
  a = external_exports.number();
15543
15577
  s = external_exports.boolean();
@@ -15548,45 +15582,45 @@ var init_dev = __esm({
15548
15582
  u2 = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]);
15549
15583
  m = u2.optional();
15550
15584
  b = {};
15551
- n(b, { ErrorHandlerSchema: () => h, HandlerSchema: () => S2, LogHandlerSchema: () => v, StorageSchema: () => f, StorageTypeSchema: () => g, errorHandlerJsonSchema: () => k, handlerJsonSchema: () => C2, logHandlerJsonSchema: () => x2, storageJsonSchema: () => w, storageTypeJsonSchema: () => y });
15552
- g = external_exports.enum(["local", "session", "cookie"]).describe("Storage mechanism: local, session, or cookie");
15553
- f = external_exports.object({ Local: external_exports.literal("local"), Session: external_exports.literal("session"), Cookie: external_exports.literal("cookie") }).describe("Storage type constants for type-safe references");
15585
+ n(b, { ErrorHandlerSchema: () => h, HandlerSchema: () => S2, LogHandlerSchema: () => v, StorageSchema: () => g, StorageTypeSchema: () => f, errorHandlerJsonSchema: () => k, handlerJsonSchema: () => x2, logHandlerJsonSchema: () => C2, storageJsonSchema: () => w, storageTypeJsonSchema: () => y });
15586
+ f = external_exports.enum(["local", "session", "cookie"]).describe("Storage mechanism: local, session, or cookie");
15587
+ g = external_exports.object({ Local: external_exports.literal("local"), Session: external_exports.literal("session"), Cookie: external_exports.literal("cookie") }).describe("Storage type constants for type-safe references");
15554
15588
  h = external_exports.any().describe("Error handler function: (error, state?) => void");
15555
15589
  v = external_exports.any().describe("Log handler function: (message, verbose?) => void");
15556
15590
  S2 = external_exports.object({ Error: h.describe("Error handler function"), Log: v.describe("Log handler function") }).describe("Handler interface with error and log functions");
15557
- y = o(g);
15558
- w = o(f);
15591
+ y = o(f);
15592
+ w = o(g);
15559
15593
  k = o(h);
15560
- x2 = o(v);
15561
- C2 = o(S2);
15594
+ C2 = o(v);
15595
+ x2 = o(S2);
15562
15596
  j = external_exports.object({ onError: h.optional().describe("Error handler function: (error, state?) => void"), onLog: v.optional().describe("Log handler function: (message, verbose?) => void") }).partial();
15563
15597
  E2 = external_exports.object({ verbose: external_exports.boolean().describe("Enable verbose logging for debugging").optional() }).partial();
15564
- J2 = external_exports.object({ queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional() }).partial();
15598
+ R2 = external_exports.object({ queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional() }).partial();
15565
15599
  P2 = external_exports.object({}).partial();
15566
- R2 = external_exports.object({ init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional() }).partial();
15567
- I2 = external_exports.object({ primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional() }).partial();
15568
- D2 = external_exports.object({ settings: external_exports.any().optional().describe("Implementation-specific configuration") }).partial();
15569
- O = external_exports.object({ env: external_exports.any().optional().describe("Environment dependencies (platform-specific)") }).partial();
15570
- T2 = external_exports.object({ type: external_exports.string().optional().describe("Instance type identifier"), config: external_exports.unknown().describe("Instance configuration") }).partial();
15571
- q = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config: external_exports.unknown().describe("Configuration"), env: external_exports.unknown().describe("Environment dependencies") }).partial();
15600
+ J = external_exports.object({ init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional() }).partial();
15601
+ O = external_exports.object({ primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional() }).partial();
15602
+ I2 = external_exports.object({ settings: external_exports.any().optional().describe("Implementation-specific configuration") }).partial();
15603
+ D2 = external_exports.object({ env: external_exports.any().optional().describe("Environment dependencies (platform-specific)") }).partial();
15604
+ z3 = external_exports.object({ type: external_exports.string().optional().describe("Instance type identifier"), config: external_exports.unknown().describe("Instance configuration") }).partial();
15605
+ q2 = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config: external_exports.unknown().describe("Configuration"), env: external_exports.unknown().describe("Environment dependencies") }).partial();
15572
15606
  U2 = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), batched: external_exports.unknown().optional().describe("Batch of events to be processed") }).partial();
15573
- B2 = external_exports.object({ ignore: external_exports.boolean().describe("Set to true to skip processing").optional(), condition: external_exports.string().optional().describe("Condition function: return true to process") }).partial();
15574
- W2 = external_exports.object({ sources: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of source instances") }).partial();
15607
+ W = external_exports.object({ ignore: external_exports.boolean().describe("Set to true to skip processing").optional(), condition: external_exports.string().optional().describe("Condition function: return true to process") }).partial();
15608
+ B2 = external_exports.object({ sources: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of source instances") }).partial();
15575
15609
  A2 = external_exports.object({ destinations: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of destination instances") }).partial();
15576
15610
  $ = {};
15577
- n($, { ConsentSchema: () => K, DeepPartialEventSchema: () => oe, EntitiesSchema: () => ne2, EntitySchema: () => ee, EventSchema: () => ie, OrderedPropertiesSchema: () => _2, PartialEventSchema: () => te, PropertiesSchema: () => G, PropertySchema: () => F, PropertyTypeSchema: () => H2, SourceSchema: () => Z, SourceTypeSchema: () => Q2, UserSchema: () => X, VersionSchema: () => Y, consentJsonSchema: () => ue, entityJsonSchema: () => de, eventJsonSchema: () => re, orderedPropertiesJsonSchema: () => le, partialEventJsonSchema: () => ae, propertiesJsonSchema: () => ce, sourceTypeJsonSchema: () => pe, userJsonSchema: () => se });
15578
- H2 = external_exports.lazy(() => external_exports.union([external_exports.boolean(), external_exports.string(), external_exports.number(), external_exports.record(external_exports.string(), F)]));
15579
- F = external_exports.lazy(() => external_exports.union([H2, external_exports.array(H2)]));
15580
- G = external_exports.record(external_exports.string(), F.optional()).describe("Flexible property collection with optional values");
15581
- _2 = external_exports.record(external_exports.string(), external_exports.tuple([F, external_exports.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control");
15582
- Q2 = external_exports.union([external_exports.enum(["web", "server", "app", "other"]), external_exports.string()]).describe("Source type: web, server, app, other, or custom");
15583
- K = external_exports.record(external_exports.string(), external_exports.boolean()).describe("Consent requirement mapping (group name \u2192 state)");
15611
+ n($, { ConsentSchema: () => Q2, DeepPartialEventSchema: () => oe, EntitiesSchema: () => ne2, EntitySchema: () => ee, EventSchema: () => ie, OrderedPropertiesSchema: () => _2, PartialEventSchema: () => te, PropertiesSchema: () => G, PropertySchema: () => F2, PropertyTypeSchema: () => H2, SourceSchema: () => Z, SourceTypeSchema: () => K, UserSchema: () => X, VersionSchema: () => Y, consentJsonSchema: () => ue, entityJsonSchema: () => de, eventJsonSchema: () => re, orderedPropertiesJsonSchema: () => le, partialEventJsonSchema: () => ae, propertiesJsonSchema: () => ce, sourceTypeJsonSchema: () => pe, userJsonSchema: () => se });
15612
+ H2 = external_exports.lazy(() => external_exports.union([external_exports.boolean(), external_exports.string(), external_exports.number(), external_exports.record(external_exports.string(), F2)]));
15613
+ F2 = external_exports.lazy(() => external_exports.union([H2, external_exports.array(H2)]));
15614
+ G = external_exports.record(external_exports.string(), F2.optional()).describe("Flexible property collection with optional values");
15615
+ _2 = external_exports.record(external_exports.string(), external_exports.tuple([F2, external_exports.number()]).optional()).describe("Ordered properties with [value, order] tuples for priority control");
15616
+ K = external_exports.union([external_exports.enum(["web", "server", "app", "other"]), external_exports.string()]).describe("Source type: web, server, app, other, or custom");
15617
+ Q2 = external_exports.record(external_exports.string(), external_exports.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)");
15584
15618
  X = G.and(external_exports.object({ id: external_exports.string().optional().describe("User identifier"), device: external_exports.string().optional().describe("Device identifier"), session: external_exports.string().optional().describe("Session identifier"), hash: external_exports.string().optional().describe("Hashed identifier"), address: external_exports.string().optional().describe("User address"), email: external_exports.string().email().optional().describe("User email address"), phone: external_exports.string().optional().describe("User phone number"), userAgent: external_exports.string().optional().describe("Browser user agent string"), browser: external_exports.string().optional().describe("Browser name"), browserVersion: external_exports.string().optional().describe("Browser version"), deviceType: external_exports.string().optional().describe("Device type (mobile, desktop, tablet)"), os: external_exports.string().optional().describe("Operating system"), osVersion: external_exports.string().optional().describe("Operating system version"), screenSize: external_exports.string().optional().describe("Screen dimensions"), language: external_exports.string().optional().describe("User language"), country: external_exports.string().optional().describe("User country"), region: external_exports.string().optional().describe("User region/state"), city: external_exports.string().optional().describe("User city"), zip: external_exports.string().optional().describe("User postal code"), timezone: external_exports.string().optional().describe("User timezone"), ip: external_exports.string().optional().describe("User IP address"), internal: external_exports.boolean().optional().describe("Internal user flag (employee, test user)") })).describe("User identification and properties");
15585
15619
  Y = G.and(external_exports.object({ source: r.describe('Walker implementation version (e.g., "2.0.0")'), tagging: p })).describe("Walker version information");
15586
- Z = G.and(external_exports.object({ type: Q2.describe("Source type identifier"), id: r.describe("Source identifier (typically URL on web)"), previous_id: r.describe("Previous source identifier (typically referrer on web)") })).describe("Event source information");
15620
+ Z = G.and(external_exports.object({ type: K.describe("Source type identifier"), id: r.describe("Source identifier (typically URL on web)"), previous_id: r.describe("Previous source identifier (typically referrer on web)") })).describe("Event source information");
15587
15621
  ee = external_exports.lazy(() => external_exports.object({ entity: external_exports.string().describe("Entity name"), data: G.describe("Entity-specific properties"), nested: external_exports.array(ee).describe("Nested child entities"), context: _2.describe("Entity context data") })).describe("Nested entity structure with recursive nesting support");
15588
15622
  ne2 = external_exports.array(ee).describe("Array of nested entities");
15589
- ie = external_exports.object({ name: external_exports.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'), data: G.describe("Event-specific properties"), context: _2.describe("Ordered context properties with priorities"), globals: G.describe("Global properties shared across events"), custom: G.describe("Custom implementation-specific properties"), user: X.describe("User identification and attributes"), nested: ne2.describe("Related nested entities"), consent: K.describe("Consent states at event time"), id: c2.describe("Unique event identifier (timestamp-based)"), trigger: r.describe("Event trigger identifier"), entity: r.describe("Parsed entity from event name"), action: r.describe("Parsed action from event name"), timestamp: l.describe("Unix timestamp in milliseconds since epoch"), timing: a.describe("Event processing timing information"), group: r.describe("Event grouping identifier"), count: d.describe("Event count in session"), version: Y.describe("Walker version information"), source: Z.describe("Event source information") }).describe("Complete walkerOS event structure");
15623
+ ie = external_exports.object({ name: external_exports.string().describe('Event name in "entity action" format (e.g., "page view", "product add")'), data: G.describe("Event-specific properties"), context: _2.describe("Ordered context properties with priorities"), globals: G.describe("Global properties shared across events"), custom: G.describe("Custom implementation-specific properties"), user: X.describe("User identification and attributes"), nested: ne2.describe("Related nested entities"), consent: Q2.describe("Consent states at event time"), id: c2.describe("Unique event identifier (timestamp-based)"), trigger: r.describe("Event trigger identifier"), entity: r.describe("Parsed entity from event name"), action: r.describe("Parsed action from event name"), timestamp: l.describe("Unix timestamp in milliseconds since epoch"), timing: a.describe("Event processing timing information"), group: r.describe("Event grouping identifier"), count: d.describe("Event count in session"), version: Y.describe("Walker version information"), source: Z.describe("Event source information") }).describe("Complete walkerOS event structure");
15590
15624
  te = ie.partial().describe("Partial event structure with all fields optional");
15591
15625
  oe = ie.partial().describe("Partial event structure with all top-level fields optional");
15592
15626
  re = o(ie);
@@ -15595,141 +15629,153 @@ var init_dev = __esm({
15595
15629
  ce = o(G);
15596
15630
  le = o(_2);
15597
15631
  de = o(ee);
15598
- pe = o(Q2);
15599
- ue = o(K);
15632
+ pe = o(K);
15633
+ ue = o(Q2);
15600
15634
  me = {};
15601
- n(me, { ConfigSchema: () => xe, LoopSchema: () => fe, MapSchema: () => ve2, PolicySchema: () => ye, ResultSchema: () => Ce, RuleSchema: () => we2, RulesSchema: () => ke, SetSchema: () => he2, ValueConfigSchema: () => Se2, ValueSchema: () => be2, ValuesSchema: () => ge, configJsonSchema: () => Ne, loopJsonSchema: () => Je, mapJsonSchema: () => Re, policyJsonSchema: () => Ie, ruleJsonSchema: () => De2, rulesJsonSchema: () => Oe, setJsonSchema: () => Pe, valueConfigJsonSchema: () => Ee, valueJsonSchema: () => je2 });
15602
- be2 = external_exports.lazy(() => external_exports.union([external_exports.string().describe('String value or property path (e.g., "data.id")'), external_exports.number().describe("Numeric value"), external_exports.boolean().describe("Boolean value"), external_exports.lazy(() => V), external_exports.array(be2).describe("Array of values")]));
15603
- ge = external_exports.array(be2).describe("Array of transformation values");
15604
- fe = external_exports.lazy(() => external_exports.tuple([be2, be2]).describe("Loop transformation: [source, transform] tuple for array processing"));
15635
+ n(me, { ConfigSchema: () => Ce, LoopSchema: () => ge, MapSchema: () => ve2, PolicySchema: () => ye, ResultSchema: () => xe, RuleSchema: () => we2, RulesSchema: () => ke, SetSchema: () => he2, ValueConfigSchema: () => Se2, ValueSchema: () => be2, ValuesSchema: () => fe, configJsonSchema: () => Ne, loopJsonSchema: () => Re, mapJsonSchema: () => Je, policyJsonSchema: () => Oe, ruleJsonSchema: () => Ie, rulesJsonSchema: () => De2, setJsonSchema: () => Pe, valueConfigJsonSchema: () => Ee, valueJsonSchema: () => je2 });
15636
+ be2 = external_exports.lazy(() => external_exports.union([external_exports.string().describe('String value or property path (e.g., "data.id")'), external_exports.number().describe("Numeric value"), external_exports.boolean().describe("Boolean value"), external_exports.lazy(() => V), external_exports.array(be2).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." });
15637
+ fe = external_exports.array(be2).describe("Array of transformation values");
15638
+ ge = external_exports.lazy(() => external_exports.tuple([be2, be2]).describe("Loop transformation: [source, transform] tuple for array processing"));
15605
15639
  he2 = external_exports.lazy(() => external_exports.array(be2).describe("Set: Array of values for selection or combination"));
15606
15640
  ve2 = external_exports.lazy(() => external_exports.record(external_exports.string(), be2).describe("Map: Object mapping keys to transformation values"));
15607
- Se2 = V = external_exports.object({ key: external_exports.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional().describe("Static primitive value"), fn: external_exports.string().optional().describe("Custom transformation function as string (serialized)"), map: ve2.optional().describe("Object mapping: transform event data to structured output"), loop: fe.optional().describe("Loop transformation: [source, transform] for array processing"), set: he2.optional().describe("Set of values: combine or select from multiple values"), consent: K.optional().describe("Required consent states to include this value"), condition: external_exports.string().optional().describe("Condition function as string: return true to include value"), validate: external_exports.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e3) => Object.keys(e3).length > 0, { message: "ValueConfig must have at least one property" }).describe("Value transformation configuration with multiple strategies");
15641
+ Se2 = V = external_exports.object({ key: external_exports.string().optional().describe('Property path to extract from event (e.g., "data.id", "user.email")'), value: external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).optional().describe("Static primitive value"), fn: external_exports.string().optional().describe("Custom transformation function as string (serialized)"), map: ve2.optional().describe("Object mapping: transform event data to structured output"), loop: ge.optional().describe("Loop transformation: [source, transform] for array processing"), set: he2.optional().describe("Set of values: combine or select from multiple values"), consent: Q2.optional().describe("Required consent states to include this value"), condition: external_exports.string().optional().describe("Condition function as string: return true to include value"), validate: external_exports.string().optional().describe("Validation function as string: return true if value is valid") }).refine((e3) => Object.keys(e3).length > 0, { message: "ValueConfig must have at least one property" }).describe("Value transformation configuration with multiple strategies");
15608
15642
  ye = external_exports.record(external_exports.string(), be2).describe("Policy rules for event pre-processing (key \u2192 value mapping)");
15609
- we2 = external_exports.object({ batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), condition: external_exports.string().optional().describe("Condition function as string: return true to process event"), consent: K.optional().describe("Required consent states to process this event"), settings: external_exports.any().optional().describe("Destination-specific settings for this event mapping"), data: external_exports.union([be2, ge]).optional().describe("Data transformation rules for event"), ignore: external_exports.boolean().optional().describe("Set to true to skip processing this event"), name: external_exports.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), policy: ye.optional().describe("Event-level policy overrides (applied after config-level policy)") }).describe("Mapping rule for specific entity-action combination");
15643
+ we2 = external_exports.object({ name: external_exports.string().optional().describe('Custom event name override (e.g., "view_item" for "product view")'), data: external_exports.union([be2, fe]).optional().describe("Data transformation rules for event"), settings: external_exports.any().optional().describe("Destination-specific settings for this event mapping"), condition: external_exports.string().optional().describe("Condition function as string: return true to process event"), consent: Q2.optional().describe("Required consent states to process this event"), policy: ye.optional().describe("Event-level policy overrides (applied after config-level policy)"), batch: external_exports.number().optional().describe("Batch size: bundle N events for batch processing"), include: external_exports.array(external_exports.string()).optional().describe('Event sections (e.g. ["context", "globals"]) flattened into context.data'), ignore: external_exports.boolean().optional().describe("Skip the event entirely. No push, no side effects. Use for suppression."), skip: external_exports.boolean().optional().describe("Run side effects (settings.identify, ...) but skip the default push call.") }).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");
15610
15644
  ke = external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.union([we2, external_exports.array(we2)])).optional()).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*).');
15611
- xe = external_exports.object({ consent: K.optional().describe("Required consent states to process any events"), data: external_exports.union([be2, ge]).optional().describe("Global data transformation applied to all events"), mapping: ke.optional().describe("Entity-action specific mapping rules"), policy: ye.optional().describe("Pre-processing policy rules applied before mapping") }).describe("Shared mapping configuration for sources and destinations");
15612
- Ce = external_exports.object({ eventMapping: we2.optional().describe("Resolved mapping rule for event"), mappingKey: external_exports.string().optional().describe('Mapping key used (e.g., "product.view")') }).describe("Mapping resolution result");
15645
+ Ce = external_exports.object({ consent: Q2.optional().describe("Required consent states to process any events"), data: external_exports.union([be2, fe]).optional().describe("Global data transformation applied to all events"), include: external_exports.array(external_exports.string()).optional().describe("Event sections to flatten into context.data"), mapping: ke.optional().describe("Entity-action specific mapping rules"), policy: ye.optional().describe("Pre-processing policy rules applied before mapping") }).describe("Shared mapping configuration for sources and destinations");
15646
+ xe = external_exports.object({ eventMapping: we2.optional().describe("Resolved mapping rule for event"), mappingKey: external_exports.string().optional().describe('Mapping key used (e.g., "product.view")') }).describe("Mapping resolution result");
15613
15647
  je2 = o(be2);
15614
15648
  Ee = o(Se2);
15615
- Je = o(fe);
15649
+ Re = o(ge);
15616
15650
  Pe = o(he2);
15617
- Re = o(ve2);
15618
- Ie = o(ye);
15619
- De2 = o(we2);
15620
- Oe = o(ke);
15621
- Ne = o(xe);
15622
- Le = {};
15623
- n(Le, { BatchSchema: () => $e, ConfigSchema: () => ze, ContextSchema: () => qe, DLQSchema: () => Ye2, DataSchema: () => Ve, DestinationPolicySchema: () => Te, DestinationsSchema: () => _e, InitDestinationsSchema: () => Ge, InitSchema: () => Fe, InstanceSchema: () => He, PartialConfigSchema: () => Me, PushBatchContextSchema: () => Be, PushContextSchema: () => Ue, PushEventSchema: () => We, PushEventsSchema: () => Ae, PushResultSchema: () => Ke, RefSchema: () => Qe2, ResultSchema: () => Xe2, batchJsonSchema: () => on, configJsonSchema: () => Ze, contextJsonSchema: () => nn, instanceJsonSchema: () => rn, partialConfigJsonSchema: () => en, pushContextJsonSchema: () => tn, resultJsonSchema: () => an });
15624
- ze = external_exports.object({ consent: K.optional().describe("Required consent states to send events to this destination"), settings: external_exports.any().describe("Implementation-specific configuration").optional(), data: external_exports.union([be2, ge]).optional().describe("Global data transformation applied to all events for this destination"), env: external_exports.any().describe("Environment dependencies (platform-specific)").optional(), id: c2.describe("Destination instance identifier (defaults to destination key)").optional(), init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional(), mapping: ke.optional().describe("Entity-action specific mapping rules for this destination"), policy: ye.optional().describe("Pre-processing policy rules applied before event mapping"), queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional(), require: external_exports.array(external_exports.string()).optional().describe('Defer destination initialization until these collector events fire (e.g., ["consent"])'), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler) to override the collector defaults"), onError: h.optional(), onLog: v.optional() }).describe("Destination configuration");
15625
- Me = ze.partial().describe("Partial destination configuration with all fields optional");
15626
- Te = ye.describe("Destination policy rules for event pre-processing");
15627
- qe = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config: ze.describe("Destination configuration"), data: external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional().describe("Transformed event data"), env: external_exports.unknown().describe("Environment dependencies") }).describe("Destination context for init and push functions");
15628
- Ue = qe.extend({ mapping: we2.optional().describe("Resolved mapping rule for this specific event") }).describe("Push context with event-specific mapping");
15629
- Be = Ue.describe("Batch push context with event-specific mapping");
15630
- We = external_exports.object({ event: ie.describe("The event to process"), mapping: we2.optional().describe("Mapping rule for this event") }).describe("Event with optional mapping for batch processing");
15631
- Ae = external_exports.array(We).describe("Array of events with mappings");
15632
- $e = external_exports.object({ key: external_exports.string().describe('Batch key (usually mapping key like "product.view")'), events: external_exports.array(ie).describe("Array of events in batch"), data: external_exports.array(external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional()).describe("Transformed data for each event"), mapping: we2.optional().describe("Shared mapping rule for batch") }).describe("Batch of events grouped by mapping key");
15633
- Ve = external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)");
15634
- He = external_exports.object({ config: ze.describe("Destination configuration"), queue: external_exports.array(ie).optional().describe("Queued events awaiting consent"), dlq: external_exports.array(external_exports.tuple([ie, external_exports.unknown()])).optional().describe("Dead letter queue (failed events with errors)"), type: external_exports.string().optional().describe("Destination type identifier"), env: external_exports.unknown().optional().describe("Environment dependencies"), init: external_exports.unknown().optional().describe("Initialization function"), push: external_exports.unknown().describe("Push function for single events"), pushBatch: external_exports.unknown().optional().describe("Batch push function"), on: external_exports.unknown().optional().describe("Event lifecycle hook function") }).describe("Destination instance (runtime object with functions)");
15635
- Fe = external_exports.object({ code: He.describe("Destination instance with implementation"), config: Me.optional().describe("Partial configuration overrides"), env: external_exports.unknown().optional().describe("Partial environment overrides") }).describe("Destination initialization configuration");
15636
- Ge = external_exports.record(external_exports.string(), Fe).describe("Map of destination IDs to initialization configurations");
15637
- _e = external_exports.record(external_exports.string(), He).describe("Map of destination IDs to runtime instances");
15638
- Qe2 = external_exports.object({ type: external_exports.string().describe('Destination type ("gtag", "meta", "bigquery")'), data: external_exports.unknown().optional().describe("Response from push()"), error: external_exports.unknown().optional().describe("Error if failed") }).describe("Destination reference with type and response data");
15639
- Ke = external_exports.object({ queue: external_exports.array(ie).optional().describe("Events queued (awaiting consent)"), error: external_exports.unknown().optional().describe("Error if push failed") }).describe("Push operation result");
15640
- Xe2 = external_exports.object({ ok: external_exports.boolean().describe("True if nothing failed"), event: external_exports.unknown().optional().describe("The processed event"), done: external_exports.record(external_exports.string(), Qe2).optional().describe("Destinations that processed successfully"), queued: external_exports.record(external_exports.string(), Qe2).optional().describe("Destinations that queued events"), failed: external_exports.record(external_exports.string(), Qe2).optional().describe("Destinations that failed to process") }).describe("Push result with destination outcomes");
15641
- Ye2 = external_exports.array(external_exports.tuple([ie, external_exports.unknown()])).describe("Dead letter queue: [(event, error), ...]");
15642
- Ze = o(ze);
15643
- en = o(Me);
15644
- nn = o(qe);
15645
- tn = o(Ue);
15646
- on = o($e);
15647
- rn = o(He);
15648
- an = o(Xe2);
15649
- sn = {};
15650
- n(sn, { CommandTypeSchema: () => cn, ConfigSchema: () => ln, DestinationsSchema: () => bn, InitConfigSchema: () => pn, InstanceSchema: () => gn, PushContextSchema: () => un, SessionDataSchema: () => dn, SourcesSchema: () => mn, commandTypeJsonSchema: () => fn, configJsonSchema: () => hn, initConfigJsonSchema: () => Sn, instanceJsonSchema: () => wn, pushContextJsonSchema: () => yn, sessionDataJsonSchema: () => vn });
15651
- cn = external_exports.union([external_exports.enum(["action", "config", "consent", "context", "destination", "elb", "globals", "hook", "init", "link", "run", "user", "walker"]), external_exports.string()]).describe("Collector command type: standard commands or custom string for extensions");
15652
- ln = external_exports.object({ run: external_exports.boolean().describe("Whether to run collector automatically on initialization").optional(), tagging: p, globalsStatic: G.describe("Static global properties that persist across collector runs"), sessionStatic: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Static session data that persists across collector runs"), verbose: external_exports.boolean().describe("Enable verbose logging for debugging"), onError: h.optional(), onLog: v.optional() }).describe("Core collector configuration");
15653
- dn = G.and(external_exports.object({ isStart: external_exports.boolean().describe("Whether this is a new session start"), storage: external_exports.boolean().describe("Whether storage is available"), id: c2.describe("Session identifier").optional(), start: l.describe("Session start timestamp").optional(), marketing: external_exports.literal(true).optional().describe("Marketing attribution flag"), updated: l.describe("Last update timestamp").optional(), isNew: external_exports.boolean().describe("Whether this is a new session").optional(), device: c2.describe("Device identifier").optional(), count: d.describe("Event count in session").optional(), runs: d.describe("Number of runs").optional() })).describe("Session state and tracking data");
15654
- pn = ln.partial().extend({ consent: K.optional().describe("Initial consent state"), user: X.optional().describe("Initial user data"), globals: G.optional().describe("Initial global properties"), sources: external_exports.unknown().optional().describe("Source configurations"), destinations: external_exports.unknown().optional().describe("Destination configurations"), custom: G.optional().describe("Initial custom implementation-specific properties") }).describe("Collector initialization configuration with initial state");
15655
- un = external_exports.object({ mapping: xe.optional().describe("Source-level mapping configuration") }).describe("Push context with optional source mapping");
15656
- mn = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of source IDs to source instances");
15657
- bn = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of destination IDs to destination instances");
15658
- gn = external_exports.object({ push: external_exports.unknown().describe("Push function for processing events"), command: external_exports.unknown().describe("Command function for walker commands"), allowed: external_exports.boolean().describe("Whether event processing is allowed"), config: ln.describe("Current collector configuration"), consent: K.describe("Current consent state"), count: external_exports.number().describe("Event count (increments with each event)"), custom: G.describe("Custom implementation-specific properties"), sources: mn.describe("Registered source instances"), destinations: bn.describe("Registered destination instances"), globals: G.describe("Current global properties"), group: external_exports.string().describe("Event grouping identifier"), hooks: external_exports.unknown().describe("Lifecycle hook functions"), on: external_exports.unknown().describe("Event lifecycle configuration"), queue: external_exports.array(ie).describe("Queued events awaiting processing"), round: external_exports.number().describe("Collector run count (increments with each run)"), session: external_exports.union([dn]).describe("Current session state"), timing: external_exports.number().describe("Event processing timing information"), user: X.describe("Current user data"), version: external_exports.string().describe("Walker implementation version") }).describe("Collector instance with state and methods");
15659
- fn = o(cn);
15660
- hn = o(ln);
15661
- vn = o(dn);
15662
- Sn = o(pn);
15663
- yn = o(un);
15664
- wn = o(gn);
15665
- kn = {};
15666
- n(kn, { BaseEnvSchema: () => xn, ConfigSchema: () => Cn, InitSchema: () => Jn, InitSourceSchema: () => Pn, InitSourcesSchema: () => Rn, InstanceSchema: () => En, PartialConfigSchema: () => jn, baseEnvJsonSchema: () => In, configJsonSchema: () => Dn, initSourceJsonSchema: () => Ln, initSourcesJsonSchema: () => zn, instanceJsonSchema: () => Nn, partialConfigJsonSchema: () => On });
15667
- xn = external_exports.object({ push: external_exports.unknown().describe("Collector push function"), command: external_exports.unknown().describe("Collector command function"), sources: external_exports.unknown().optional().describe("Map of registered source instances"), elb: external_exports.unknown().describe("Public API function (alias for collector.push)") }).catchall(external_exports.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this");
15668
- Cn = xe.extend({ settings: external_exports.any().describe("Implementation-specific configuration").optional(), env: xn.optional().describe("Environment dependencies (platform-specific)"), id: c2.describe("Source identifier (defaults to source key)").optional(), onError: h.optional(), primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional(), require: external_exports.array(external_exports.string()).optional().describe('Defer source initialization until these collector events fire (e.g., ["consent"])'), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler) to override the collector defaults"), ingest: external_exports.union([be2, ge]).optional().describe("Ingest metadata extraction mapping. Extracts values from raw request objects (Express req, Lambda event) using mapping syntax.") }).describe("Source configuration with mapping and environment");
15669
- jn = Cn.partial().describe("Partial source configuration with all fields optional");
15670
- En = external_exports.object({ type: external_exports.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: Cn.describe("Current source configuration"), push: external_exports.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: external_exports.any().optional().describe("Cleanup function called when source is removed"), on: external_exports.unknown().optional().describe("Lifecycle hook function for event types") }).describe("Source instance with push handler and lifecycle methods");
15671
- Jn = external_exports.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
15672
- Pn = external_exports.object({ code: Jn.describe("Source initialization function"), config: jn.optional().describe("Partial configuration overrides"), env: xn.partial().optional().describe("Partial environment overrides"), primary: external_exports.boolean().optional().describe("Mark as primary source (only one can be primary)") }).describe("Source initialization configuration");
15673
- Rn = external_exports.record(external_exports.string(), Pn).describe("Map of source IDs to initialization configurations");
15674
- In = o(xn);
15675
- Dn = o(Cn);
15676
- On = o(jn);
15677
- Nn = o(En);
15678
- Ln = o(Pn);
15679
- zn = o(Rn);
15680
- Mn = {};
15681
- n(Mn, { BundleSchema: () => Zn, ConfigSchema: () => gi, ContractActionsSchema: () => di, ContractEntrySchema: () => ui, ContractEventsSchema: () => pi, ContractSchema: () => mi, ContractSchemaEntry: () => li, DefinitionsSchema: () => Qn, DestinationReferenceSchema: () => si, InlineCodeSchema: () => ii, OverridesSchema: () => Yn, PackagesSchema: () => Xn, PrimitiveSchema: () => Gn, ServerSchema: () => ni, SettingsSchema: () => bi, SourceReferenceSchema: () => ri, StepExampleSchema: () => ti, StepExamplesSchema: () => oi, StoreReferenceSchema: () => ci, TransformerReferenceSchema: () => ai, VariablesSchema: () => _n, WebSchema: () => ei, configJsonSchema: () => yi, contractEntryJsonSchema: () => Ei, contractJsonSchema: () => Ji, destinationReferenceJsonSchema: () => xi, parseConfig: () => fi, parseSettings: () => vi, safeParseConfig: () => hi, safeParseSettings: () => Si, settingsJsonSchema: () => wi, sourceReferenceJsonSchema: () => ki, storeReferenceJsonSchema: () => ji, transformerReferenceJsonSchema: () => Ci });
15682
- Tn = {};
15683
- n(Tn, { MatchExpressionSchema: () => Bn, NextRuleSchema: () => $n, RoutableNextSchema: () => An });
15684
- qn = external_exports.enum(["eq", "contains", "prefix", "suffix", "regex", "gt", "lt", "exists"]);
15685
- Un = external_exports.object({ key: external_exports.string(), operator: qn, value: external_exports.string(), not: external_exports.boolean().optional() });
15686
- Bn = external_exports.union([Un, external_exports.object({ and: external_exports.array(external_exports.lazy(() => Bn)) }), external_exports.object({ or: external_exports.array(external_exports.lazy(() => Bn)) })]);
15687
- Wn = external_exports.union([Bn, external_exports.literal("*")]);
15688
- An = external_exports.union([external_exports.string(), external_exports.array(external_exports.string()), external_exports.array(external_exports.object({ match: Wn, next: external_exports.lazy(() => An) }))]);
15689
- $n = external_exports.object({ match: Wn, next: external_exports.lazy(() => An) });
15690
- Vn = {};
15691
- n(Vn, { CacheRuleSchema: () => Hn, CacheSchema: () => Fn });
15692
- Hn = external_exports.object({ match: external_exports.union([Bn, external_exports.literal("*")]).describe("Match expression or wildcard to determine when this rule applies"), key: external_exports.array(external_exports.string()).min(1).describe("Dot-path fields used to build the cache key"), ttl: external_exports.number().positive().describe("Time-to-live in seconds for cached entries"), update: external_exports.record(external_exports.string(), be2).optional().describe("Response mutations applied on cache hit (key \u2192 Value mapping)") });
15693
- Fn = external_exports.object({ full: external_exports.boolean().optional().describe("Stop flow on cache HIT (default: false). When true, skip remaining steps and return cached value."), store: external_exports.string().optional().describe("Store ID for persistent caching (references a configured store)"), rules: external_exports.array(Hn).min(1).describe("Cache rules \u2014 at least one required") });
15694
- Gn = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).describe("Primitive value: string, number, or boolean");
15695
- _n = external_exports.record(external_exports.string(), Gn).describe("Variables for interpolation");
15696
- Qn = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Reusable configuration definitions");
15697
- Kn = /^(@[a-z0-9\-~][a-z0-9\-._~]*\/)?[a-z0-9\-~][a-z0-9\-._~]*$/;
15698
- Xn = external_exports.record(external_exports.string().regex(Kn, "Invalid npm package name"), external_exports.object({ version: external_exports.string().optional(), imports: external_exports.array(external_exports.string()).optional(), path: external_exports.string().optional() })).describe("NPM packages to bundle");
15699
- Yn = external_exports.record(external_exports.string().regex(Kn, "Invalid npm package name"), external_exports.string().min(1, "Override version cannot be empty")).describe("Transitive dependency version overrides");
15700
- Zn = external_exports.object({ packages: Xn.optional().describe("NPM packages to bundle"), overrides: Yn.optional().describe("Transitive dependency overrides") }).strict().describe("Bundle configuration (packages + overrides)");
15701
- ei = external_exports.object({ windowCollector: external_exports.string().default("collector").optional().describe('Window property name for the collector instance (default: "collector")'), windowElb: external_exports.string().default("elb").optional().describe('Window property name for the elb command queue (default: "elb")') }).describe("Web platform configuration");
15702
- ni = external_exports.object({}).passthrough().describe("Server platform configuration (reserved for future options)");
15703
- ii = external_exports.object({ push: external_exports.string().min(1, "Push function cannot be empty").describe('JavaScript function for processing events. Must start with "$code:" prefix. Example: "$code:(event) => { console.log(event); }"'), type: external_exports.string().optional().describe("Optional type identifier for the inline instance"), init: external_exports.string().optional().describe("Optional initialization function. Use $code: prefix for inline JavaScript.") }).describe("Inline code for custom sources/transformers/destinations");
15704
- ti = external_exports.object({ description: external_exports.string().optional().describe("Human-readable description"), in: external_exports.unknown().optional().describe("Input to the step"), trigger: external_exports.object({ type: external_exports.string().optional().describe("Trigger mechanism (e.g., click, POST, load)"), options: external_exports.unknown().optional().describe("Mechanism-specific options") }).optional().describe("Source trigger metadata"), mapping: external_exports.unknown().optional().describe("Mapping configuration"), out: external_exports.unknown().optional().describe("Expected output from the step"), command: external_exports.enum(["config", "consent", "user", "run"]).optional().describe("Invoke elb('walker <command>', in) instead of pushing in as an event") }).describe("Named example with input/output pair");
15705
- oi = external_exports.record(external_exports.string(), ti).describe("Named step examples for testing and documentation");
15706
- ri = external_exports.object({ package: external_exports.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: external_exports.union([external_exports.string(), ii]).optional().describe('Either a named export string (e.g., "sourceExpress") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Source-specific configuration object"), env: external_exports.unknown().optional().describe("Source environment configuration"), primary: external_exports.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."), variables: _n.optional().describe("Source-level variables (highest priority in cascade)"), definitions: Qn.optional().describe("Source-level definitions (highest priority in cascade)"), next: An.optional().describe("Pre-collector transformer chain. String, string[], or NextRule[] for conditional routing based on ingest data."), before: An.optional().describe("Pre-source transformer chain (consent-exempt). Handles transport-level preprocessing."), examples: oi.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Fn.optional().describe("Cache configuration for this source (match \u2192 key \u2192 ttl rules)") }).describe("Source package reference with configuration");
15707
- ai = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'), code: external_exports.union([external_exports.string(), ii]).optional().describe('Either a named export string (e.g., "transformerEnricher") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Transformer-specific configuration object"), env: external_exports.unknown().optional().describe("Transformer environment configuration"), before: An.optional().describe("Pre-transformer chain. Runs before this transformer push function."), next: An.optional().describe("Next transformer in chain. String, string[], or NextRule[] for conditional routing."), variables: _n.optional().describe("Transformer-level variables (highest priority in cascade)"), definitions: Qn.optional().describe("Transformer-level definitions (highest priority in cascade)"), examples: oi.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Fn.optional().describe("Cache configuration for this transformer (match \u2192 key \u2192 ttl rules)") }).describe("Transformer package reference with configuration");
15708
- si = external_exports.object({ package: external_exports.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: external_exports.union([external_exports.string(), ii]).optional().describe('Either a named export string (e.g., "destinationAnalytics") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Destination-specific configuration object"), env: external_exports.unknown().optional().describe("Destination environment configuration"), variables: _n.optional().describe("Destination-level variables (highest priority in cascade)"), definitions: Qn.optional().describe("Destination-level definitions (highest priority in cascade)"), before: An.optional().describe("Post-collector transformer chain. String, string[], or NextRule[] for conditional routing."), next: An.optional().describe("Post-push transformer chain. Push response available at context.ingest._response."), examples: oi.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Fn.optional().describe("Cache configuration for this destination (match \u2192 key \u2192 ttl rules)") }).describe("Destination package reference with configuration");
15709
- ci = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe("Store package specifier with optional version"), code: external_exports.union([external_exports.string(), ii]).optional().describe("Named export string or inline code definition"), config: external_exports.unknown().optional().describe("Store-specific configuration object"), env: external_exports.unknown().optional().describe("Store environment configuration"), variables: _n.optional().describe("Store-level variables (highest priority in cascade)"), definitions: Qn.optional().describe("Store-level definitions (highest priority in cascade)"), examples: oi.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).describe("Store package reference with configuration");
15710
- li = external_exports.record(external_exports.string(), external_exports.unknown()).describe("JSON Schema object for event validation with description/examples annotations");
15711
- di = external_exports.record(external_exports.string(), li).describe("Action-level contract entries");
15712
- pi = external_exports.record(external_exports.string(), di).describe("Entity-action event schemas");
15713
- ui = external_exports.object({ extends: external_exports.string().optional().describe("Inherit from another named contract"), tagging: external_exports.number().int().min(0).optional().describe("Contract version number"), description: external_exports.string().optional().describe("Human-readable description"), globals: li.optional().describe("JSON Schema for event.globals"), context: li.optional().describe("JSON Schema for event.context"), custom: li.optional().describe("JSON Schema for event.custom"), user: li.optional().describe("JSON Schema for event.user"), consent: li.optional().describe("JSON Schema for event.consent"), events: pi.optional().describe("Entity-action event schemas") }).describe("Named contract entry with optional sections and events");
15714
- mi = external_exports.record(external_exports.string(), ui).describe("Named contracts with optional extends inheritance");
15715
- bi = external_exports.object({ web: ei.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."), server: ni.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."), sources: external_exports.record(external_exports.string(), ri).optional().describe("Source configurations (data capture) keyed by unique identifier"), destinations: external_exports.record(external_exports.string(), si).optional().describe("Destination configurations (data output) keyed by unique identifier"), transformers: external_exports.record(external_exports.string(), ai).optional().describe("Transformer configurations (event transformation) keyed by unique identifier"), stores: external_exports.record(external_exports.string(), ci).optional().describe("Store configurations (key-value storage) keyed by unique identifier"), collector: external_exports.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"), bundle: Zn.optional().describe("Build-time configuration (packages + overrides)"), packages: external_exports.unknown().optional().refine((e3) => void 0 === e3, { message: "`packages` must live under `bundle.packages`. Move your packages block to `flow.<name>.bundle.packages`. This is a breaking change \u2014 see CHANGELOG migration guide." }).describe("Legacy top-level packages (moved to bundle.packages)"), variables: _n.optional().describe("Flow-level variables (override Config.variables, overridden by source/destination variables)"), definitions: Qn.optional().describe("Flow-level definitions (extend Config.definitions, overridden by source/destination definitions)") }).refine((e3) => {
15651
+ Je = o(ve2);
15652
+ Oe = o(ye);
15653
+ Ie = o(we2);
15654
+ De2 = o(ke);
15655
+ Ne = o(Ce);
15656
+ Me = {};
15657
+ n(Me, { BatchSchema: () => Ze, ConfigSchema: () => He, ContextSchema: () => _e, DLQSchema: () => ln, DataSchema: () => en, DestinationPolicySchema: () => Ge, DestinationsSchema: () => rn, InitDestinationsSchema: () => on, InitSchema: () => tn, InstanceSchema: () => nn, PartialConfigSchema: () => Fe, PushBatchContextSchema: () => Qe2, PushContextSchema: () => Ke, PushEventSchema: () => Xe2, PushEventsSchema: () => Ye2, PushResultSchema: () => sn, RefSchema: () => an, ResultSchema: () => cn, batchJsonSchema: () => bn, configJsonSchema: () => dn, contextJsonSchema: () => un, instanceJsonSchema: () => fn, partialConfigJsonSchema: () => pn, pushContextJsonSchema: () => mn, resultJsonSchema: () => gn });
15658
+ Te = {};
15659
+ n(Te, { MatchExpressionSchema: () => qe, NextRuleSchema: () => Be, RoutableNextSchema: () => We });
15660
+ Le = external_exports.enum(["eq", "contains", "prefix", "suffix", "regex", "gt", "lt", "exists"]);
15661
+ ze = external_exports.object({ key: external_exports.string(), operator: Le, value: external_exports.string(), not: external_exports.boolean().optional() });
15662
+ qe = external_exports.union([ze, external_exports.object({ and: external_exports.array(external_exports.lazy(() => qe)) }), external_exports.object({ or: external_exports.array(external_exports.lazy(() => qe)) })]);
15663
+ Ue = external_exports.union([qe, external_exports.literal("*")]);
15664
+ We = external_exports.union([external_exports.string(), external_exports.array(external_exports.string()), external_exports.array(external_exports.object({ match: Ue, next: external_exports.lazy(() => We) }))]);
15665
+ Be = external_exports.object({ match: Ue, next: external_exports.lazy(() => We) });
15666
+ Ae = {};
15667
+ n(Ae, { CacheRuleSchema: () => $e, CacheSchema: () => Ve });
15668
+ $e = external_exports.object({ match: external_exports.union([qe, external_exports.literal("*")]).describe("Match expression or wildcard to determine when this rule applies"), key: external_exports.array(external_exports.string()).min(1).describe("Dot-path fields used to build the cache key"), ttl: external_exports.number().positive().describe("Time-to-live in seconds for cached entries"), update: external_exports.record(external_exports.string(), be2).optional().describe("Response mutations applied on cache hit (key \u2192 Value mapping)") });
15669
+ Ve = external_exports.object({ full: external_exports.boolean().optional().describe("Stop flow on cache HIT (default: false). When true, skip remaining steps and return cached value."), store: external_exports.string().optional().describe("Store ID for persistent caching (references a configured store)"), rules: external_exports.array($e).min(1).describe("Cache rules \u2014 at least one required") });
15670
+ He = external_exports.object({ consent: Q2.optional().describe("Required consent states to send events to this destination"), settings: external_exports.any().describe("Implementation-specific configuration").optional(), data: external_exports.union([be2, fe]).optional().describe("Global data transformation applied to all events for this destination"), include: external_exports.array(external_exports.string()).optional().describe("Event sections to flatten into context.data"), env: external_exports.any().describe("Environment dependencies (platform-specific)").optional(), id: c2.describe("Destination instance identifier (defaults to destination key)").optional(), init: external_exports.boolean().describe("Whether to initialize immediately").optional(), loadScript: external_exports.boolean().describe("Whether to load external script (for web destinations)").optional(), mapping: ke.optional().describe("Entity-action specific mapping rules for this destination"), policy: ye.optional().describe("Pre-processing policy rules applied before event mapping"), queue: external_exports.boolean().describe("Whether to queue events when consent is not granted").optional(), require: external_exports.array(external_exports.string()).optional().describe('Defer destination initialization until these collector events fire (e.g., ["consent"])'), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler) to override the collector defaults"), before: We.optional().describe("Post-collector transformer chain applied before this destination receives the event"), next: We.optional().describe("Post-push transformer chain. Runs after destination push completes; push response is available at ingest._response"), cache: Ve.optional().describe("Cache configuration for deduplication; skip push on cache HIT"), disabled: external_exports.boolean().describe("Completely skip this destination (no init, no push, no queue)").optional(), mock: external_exports.unknown().optional().describe("Return this value instead of calling push(). Dev/testing only.") }).describe("Destination configuration");
15671
+ Fe = He.partial().describe("Partial destination configuration with all fields optional");
15672
+ Ge = ye.describe("Destination policy rules for event pre-processing");
15673
+ _e = external_exports.object({ collector: external_exports.unknown().describe("Collector instance (runtime object)"), config: He.describe("Destination configuration"), data: external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional().describe("Transformed event data"), env: external_exports.unknown().describe("Environment dependencies") }).describe("Destination context for init and push functions");
15674
+ Ke = _e.extend({ mapping: we2.optional().describe("Resolved mapping rule for this specific event") }).describe("Push context with event-specific mapping");
15675
+ Qe2 = Ke.describe("Batch push context with event-specific mapping");
15676
+ Xe2 = external_exports.object({ event: ie.describe("The event to process"), mapping: we2.optional().describe("Mapping rule for this event") }).describe("Event with optional mapping for batch processing");
15677
+ Ye2 = external_exports.array(Xe2).describe("Array of events with mappings");
15678
+ Ze = external_exports.object({ key: external_exports.string().describe('Batch key (usually mapping key like "product.view")'), events: external_exports.array(ie).describe("Array of events in batch"), data: external_exports.array(external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional()).describe("Transformed data for each event"), mapping: we2.optional().describe("Shared mapping rule for batch") }).describe("Batch of events grouped by mapping key");
15679
+ en = external_exports.union([external_exports.unknown(), external_exports.array(external_exports.unknown())]).optional().describe("Transformed event data (Property, undefined, or array)");
15680
+ nn = external_exports.object({ config: He.describe("Destination configuration"), queue: external_exports.array(ie).optional().describe("Queued events awaiting consent"), dlq: external_exports.array(external_exports.tuple([ie, external_exports.unknown()])).optional().describe("Dead letter queue (failed events with errors)"), type: external_exports.string().optional().describe("Destination type identifier"), env: external_exports.unknown().optional().describe("Environment dependencies"), init: external_exports.unknown().optional().describe("Initialization function"), push: external_exports.unknown().describe("Push function for single events"), pushBatch: external_exports.unknown().optional().describe("Batch push function"), on: external_exports.unknown().optional().describe("Event lifecycle hook function") }).describe("Destination instance (runtime object with functions)");
15681
+ tn = external_exports.object({ code: nn.describe("Destination instance with implementation"), config: Fe.optional().describe("Partial configuration overrides"), env: external_exports.unknown().optional().describe("Partial environment overrides") }).describe("Destination initialization configuration");
15682
+ on = external_exports.record(external_exports.string(), tn).describe("Map of destination IDs to initialization configurations");
15683
+ rn = external_exports.record(external_exports.string(), nn).describe("Map of destination IDs to runtime instances");
15684
+ an = external_exports.object({ type: external_exports.string().describe('Destination type ("gtag", "meta", "bigquery")'), data: external_exports.unknown().optional().describe("Response from push()"), error: external_exports.unknown().optional().describe("Error if failed") }).describe("Destination reference with type and response data");
15685
+ sn = external_exports.object({ queue: external_exports.array(ie).optional().describe("Events queued (awaiting consent)"), error: external_exports.unknown().optional().describe("Error if push failed") }).describe("Push operation result");
15686
+ cn = external_exports.object({ ok: external_exports.boolean().describe("True if nothing failed"), event: external_exports.unknown().optional().describe("The processed event"), done: external_exports.record(external_exports.string(), an).optional().describe("Destinations that processed successfully"), queued: external_exports.record(external_exports.string(), an).optional().describe("Destinations that queued events"), failed: external_exports.record(external_exports.string(), an).optional().describe("Destinations that failed to process") }).describe("Push result with destination outcomes");
15687
+ ln = external_exports.array(external_exports.tuple([ie, external_exports.unknown()])).describe("Dead letter queue: [(event, error), ...]");
15688
+ dn = o(He);
15689
+ pn = o(Fe);
15690
+ un = o(_e);
15691
+ mn = o(Ke);
15692
+ bn = o(Ze);
15693
+ fn = o(nn);
15694
+ gn = o(cn);
15695
+ hn = {};
15696
+ n(hn, { CommandTypeSchema: () => vn, ConfigSchema: () => Sn, DestinationsSchema: () => xn, InitConfigSchema: () => wn, InstanceSchema: () => jn, PushContextSchema: () => kn, SessionDataSchema: () => yn, SourcesSchema: () => Cn, commandTypeJsonSchema: () => En, configJsonSchema: () => Rn, initConfigJsonSchema: () => Jn, instanceJsonSchema: () => In, pushContextJsonSchema: () => On, sessionDataJsonSchema: () => Pn });
15697
+ vn = external_exports.union([external_exports.enum(["action", "config", "consent", "context", "destination", "elb", "globals", "hook", "init", "link", "run", "user", "walker"]), external_exports.string()]).describe("Collector command type: standard commands or custom string for extensions");
15698
+ Sn = external_exports.object({ run: external_exports.boolean().describe("Whether to run collector automatically on initialization").optional(), tagging: p, globalsStatic: G.describe("Static global properties that persist across collector runs"), sessionStatic: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Static session data that persists across collector runs"), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler)") }).describe("Core collector configuration");
15699
+ yn = G.and(external_exports.object({ isStart: external_exports.boolean().describe("Whether this is a new session start"), storage: external_exports.boolean().describe("Whether storage is available"), id: c2.describe("Session identifier").optional(), start: l.describe("Session start timestamp").optional(), marketing: external_exports.literal(true).optional().describe("Marketing attribution flag"), updated: l.describe("Last update timestamp").optional(), isNew: external_exports.boolean().describe("Whether this is a new session").optional(), device: c2.describe("Device identifier").optional(), count: d.describe("Event count in session").optional(), runs: d.describe("Number of runs").optional() })).describe("Session state and tracking data");
15700
+ wn = Sn.partial().extend({ consent: Q2.optional().describe("Initial consent state"), user: X.optional().describe("Initial user data"), globals: G.optional().describe("Initial global properties"), sources: external_exports.unknown().optional().describe("Source configurations"), destinations: external_exports.unknown().optional().describe("Destination configurations"), transformers: external_exports.unknown().optional().describe("Transformer configurations"), stores: external_exports.unknown().optional().describe("Store configurations"), custom: G.optional().describe("Initial custom implementation-specific properties"), hooks: external_exports.unknown().optional().describe("Pipeline observation hooks") }).describe("Collector initialization configuration with initial state");
15701
+ kn = external_exports.object({ mapping: Ce.optional().describe("Source-level mapping configuration") }).describe("Push context with optional source mapping");
15702
+ Cn = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of source IDs to source instances");
15703
+ xn = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Map of destination IDs to destination instances");
15704
+ jn = external_exports.object({ push: external_exports.unknown().describe("Push function for processing events"), command: external_exports.unknown().describe("Command function for walker commands"), allowed: external_exports.boolean().describe("Whether event processing is allowed"), config: Sn.describe("Current collector configuration"), consent: Q2.describe("Current consent state"), count: external_exports.number().describe("Event count (increments with each event)"), custom: G.describe("Custom implementation-specific properties"), sources: Cn.describe("Registered source instances"), destinations: xn.describe("Registered destination instances"), globals: G.describe("Current global properties"), group: external_exports.string().describe("Event grouping identifier"), hooks: external_exports.unknown().describe("Lifecycle hook functions"), on: external_exports.unknown().describe("Event lifecycle configuration"), queue: external_exports.array(ie).describe("Queued events awaiting processing"), round: external_exports.number().describe("Collector run count (increments with each run)"), session: external_exports.union([yn]).describe("Current session state"), timing: external_exports.number().describe("Event processing timing information"), user: X.describe("Current user data"), version: external_exports.string().describe("Walker implementation version") }).describe("Collector instance with state and methods");
15705
+ En = o(vn);
15706
+ Rn = o(Sn);
15707
+ Pn = o(yn);
15708
+ Jn = o(wn);
15709
+ On = o(kn);
15710
+ In = o(jn);
15711
+ Dn = {};
15712
+ n(Dn, { BaseEnvSchema: () => Nn, ConfigSchema: () => Mn, InitSchema: () => zn, InitSourceSchema: () => qn, InitSourcesSchema: () => Un, InstanceSchema: () => Ln, PartialConfigSchema: () => Tn, baseEnvJsonSchema: () => Wn, configJsonSchema: () => Bn, initSourceJsonSchema: () => Vn, initSourcesJsonSchema: () => Hn, instanceJsonSchema: () => $n, partialConfigJsonSchema: () => An });
15713
+ Nn = external_exports.object({ push: external_exports.unknown().describe("Collector push function"), command: external_exports.unknown().describe("Collector command function"), sources: external_exports.unknown().optional().describe("Map of registered source instances"), elb: external_exports.unknown().describe("Public API function (alias for collector.push)") }).catchall(external_exports.unknown()).describe("Base environment for dependency injection - platform-specific sources extend this");
15714
+ Mn = Ce.extend({ settings: external_exports.any().describe("Implementation-specific configuration").optional(), env: Nn.optional().describe("Environment dependencies (platform-specific)"), id: c2.describe("Source identifier (defaults to source key)").optional(), primary: external_exports.boolean().describe("Mark as primary (only one can be primary)").optional(), require: external_exports.array(external_exports.string()).optional().describe('Defer source initialization until these collector events fire (e.g., ["consent"])'), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler) to override the collector defaults"), ingest: external_exports.union([be2, fe]).optional().describe("Ingest metadata extraction mapping. Extracts values from raw request objects (Express req, Lambda event) using mapping syntax."), disabled: external_exports.boolean().describe("Completely skip this source (no init, no event capture)").optional() }).describe("Source configuration with mapping and environment");
15715
+ Tn = Mn.partial().describe("Partial source configuration with all fields optional");
15716
+ Ln = external_exports.object({ type: external_exports.string().describe('Source type identifier (e.g., "browser", "dataLayer")'), config: Mn.describe("Current source configuration"), push: external_exports.any().describe("Push function - THE HANDLER (flexible signature for platform compatibility)"), destroy: external_exports.any().optional().describe("Cleanup function called when source is removed"), on: external_exports.unknown().optional().describe("Lifecycle hook function for event types") }).describe("Source instance with push handler and lifecycle methods");
15717
+ zn = external_exports.any().describe("Source initialization function: (config, env) => Instance | Promise<Instance>");
15718
+ qn = external_exports.object({ code: zn.describe("Source initialization function"), config: Tn.optional().describe("Partial configuration overrides"), env: Nn.partial().optional().describe("Partial environment overrides"), primary: external_exports.boolean().optional().describe("Mark as primary source (only one can be primary)") }).describe("Source initialization configuration");
15719
+ Un = external_exports.record(external_exports.string(), qn).describe("Map of source IDs to initialization configurations");
15720
+ Wn = o(Nn);
15721
+ Bn = o(Mn);
15722
+ An = o(Tn);
15723
+ $n = o(Ln);
15724
+ Vn = o(qn);
15725
+ Hn = o(Un);
15726
+ Fn = {};
15727
+ n(Fn, { ConfigSchema: () => Gn, PartialConfigSchema: () => _n, configJsonSchema: () => Kn, partialConfigJsonSchema: () => Qn });
15728
+ Gn = external_exports.object({ settings: external_exports.any().describe("Implementation-specific configuration").optional(), env: external_exports.any().describe("Environment dependencies (platform-specific)").optional(), id: c2.describe("Transformer instance identifier (defaults to transformer key)").optional(), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler) to override the collector defaults"), before: We.optional().describe("Pre-transformer chain that runs before this transformer pushes"), next: We.optional().describe("Graph wiring to the next transformer in the chain"), cache: Ve.optional().describe("Step-level cache configuration for this transformer"), init: external_exports.boolean().describe("Whether to initialize immediately").optional(), disabled: external_exports.boolean().describe("Completely skip this transformer in chains").optional(), mock: external_exports.unknown().optional().describe("Return this value instead of calling push(). Global mock for all chains. Dev/testing only."), chainMocks: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("Path-specific mock values keyed by chain path. Takes precedence over global mock. Dev/testing only.") }).describe("Transformer configuration");
15729
+ _n = Gn.partial().describe("Partial transformer configuration with all fields optional");
15730
+ Kn = o(Gn);
15731
+ Qn = o(_n);
15732
+ Xn = {};
15733
+ n(Xn, { ConfigSchema: () => Yn, PartialConfigSchema: () => Zn, configJsonSchema: () => ei, partialConfigJsonSchema: () => ni });
15734
+ Yn = external_exports.object({ settings: external_exports.any().describe("Implementation-specific configuration").optional(), env: external_exports.any().describe("Environment dependencies (platform-specific)").optional(), id: c2.describe("Store instance identifier (defaults to store key)").optional(), logger: external_exports.object({ level: external_exports.union([external_exports.number(), external_exports.enum(["ERROR", "WARN", "INFO", "DEBUG"])]).optional().describe("Minimum log level (default: ERROR)"), handler: external_exports.any().optional().describe("Custom log handler function") }).optional().describe("Logger configuration (level, handler) to override the collector defaults") }).describe("Store configuration");
15735
+ Zn = Yn.partial().describe("Partial store configuration with all fields optional");
15736
+ ei = o(Yn);
15737
+ ni = o(Zn);
15738
+ ii = {};
15739
+ n(ii, { BundleSchema: () => li, ConfigSchema: () => ji, ContractActionsSchema: () => yi, ContractEntrySchema: () => ki, ContractEventsSchema: () => wi, ContractSchema: () => Ci, ContractSchemaEntry: () => Si, DefinitionsSchema: () => ri, DestinationReferenceSchema: () => hi, InlineCodeSchema: () => ui, OverridesSchema: () => ci, PackagesSchema: () => si, PrimitiveSchema: () => ti, ServerSchema: () => pi, SettingsSchema: () => xi, SourceReferenceSchema: () => fi, StepExampleSchema: () => mi, StepExamplesSchema: () => bi, StoreReferenceSchema: () => vi, TransformerReferenceSchema: () => gi, VariablesSchema: () => oi, WebSchema: () => di, configJsonSchema: () => Oi, contractEntryJsonSchema: () => Li, contractJsonSchema: () => zi, destinationReferenceJsonSchema: () => Ni, parseConfig: () => Ei, parseSettings: () => Pi, safeParseConfig: () => Ri, safeParseSettings: () => Ji, settingsJsonSchema: () => Ii, sourceReferenceJsonSchema: () => Di, storeReferenceJsonSchema: () => Ti, transformerReferenceJsonSchema: () => Mi });
15740
+ ti = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()]).describe("Primitive value: string, number, or boolean");
15741
+ oi = external_exports.record(external_exports.string(), ti).describe("Variables for interpolation");
15742
+ ri = external_exports.record(external_exports.string(), external_exports.unknown()).describe("Reusable configuration definitions");
15743
+ ai = /^(@[a-z0-9\-~][a-z0-9\-._~]*\/)?[a-z0-9\-~][a-z0-9\-._~]*$/;
15744
+ si = external_exports.record(external_exports.string().regex(ai, "Invalid npm package name"), external_exports.object({ version: external_exports.string().optional(), imports: external_exports.array(external_exports.string()).optional(), path: external_exports.string().optional() })).describe("NPM packages to bundle");
15745
+ ci = external_exports.record(external_exports.string().regex(ai, "Invalid npm package name"), external_exports.string().min(1, "Override version cannot be empty")).describe("Transitive dependency version overrides");
15746
+ li = external_exports.object({ packages: si.optional().describe("NPM packages to bundle"), overrides: ci.optional().describe("Transitive dependency overrides") }).strict().describe("Bundle configuration (packages + overrides)");
15747
+ di = external_exports.object({ windowCollector: external_exports.string().default("collector").optional().describe('Window property name for the collector instance (default: "collector")'), windowElb: external_exports.string().default("elb").optional().describe('Window property name for the elb command queue (default: "elb")') }).describe("Web platform configuration");
15748
+ pi = external_exports.object({}).passthrough().describe("Server platform configuration (reserved for future options)");
15749
+ ui = external_exports.object({ push: external_exports.string().min(1, "Push function cannot be empty").describe('JavaScript function for processing events. Must start with "$code:" prefix. Example: "$code:(event) => { console.log(event); }"'), type: external_exports.string().optional().describe("Optional type identifier for the inline instance"), init: external_exports.string().optional().describe("Optional initialization function. Use $code: prefix for inline JavaScript.") }).describe("Inline code for custom sources/transformers/destinations");
15750
+ mi = external_exports.object({ description: external_exports.string().optional().describe("Human-readable description"), in: external_exports.unknown().optional().describe("Input to the step"), trigger: external_exports.object({ type: external_exports.string().optional().describe("Trigger mechanism (e.g., click, POST, load)"), options: external_exports.unknown().optional().describe("Mechanism-specific options") }).optional().describe("Source trigger metadata"), mapping: external_exports.unknown().optional().describe("Mapping configuration"), out: external_exports.unknown().optional().describe("Expected output from the step"), command: external_exports.enum(["config", "consent", "user", "run"]).optional().describe("Invoke elb('walker <command>', in) instead of pushing in as an event") }).describe("Named example with input/output pair");
15751
+ bi = external_exports.record(external_exports.string(), mi).describe("Named step examples for testing and documentation");
15752
+ fi = external_exports.object({ package: external_exports.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: external_exports.union([external_exports.string(), ui]).optional().describe('Either a named export string (e.g., "sourceExpress") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Source-specific configuration object"), env: external_exports.unknown().optional().describe("Source environment configuration"), primary: external_exports.boolean().optional().describe("Mark as primary source (provides main elb). Only one source should be primary."), variables: oi.optional().describe("Source-level variables (highest priority in cascade)"), definitions: ri.optional().describe("Source-level definitions (highest priority in cascade)"), next: We.optional().describe("Pre-collector transformer chain. String, string[], or NextRule[] for conditional routing based on ingest data."), before: We.optional().describe("Pre-source transformer chain (consent-exempt). Handles transport-level preprocessing."), examples: bi.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ve.optional().describe("Cache configuration for this source (match \u2192 key \u2192 ttl rules)") }).describe("Source package reference with configuration");
15753
+ gi = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe('Package specifier with optional version (e.g., "@walkeros/transformer-enricher@1.0.0")'), code: external_exports.union([external_exports.string(), ui]).optional().describe('Either a named export string (e.g., "transformerEnricher") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Transformer-specific configuration object"), env: external_exports.unknown().optional().describe("Transformer environment configuration"), before: We.optional().describe("Pre-transformer chain. Runs before this transformer push function."), next: We.optional().describe("Next transformer in chain. String, string[], or NextRule[] for conditional routing."), variables: oi.optional().describe("Transformer-level variables (highest priority in cascade)"), definitions: ri.optional().describe("Transformer-level definitions (highest priority in cascade)"), examples: bi.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ve.optional().describe("Cache configuration for this transformer (match \u2192 key \u2192 ttl rules)") }).describe("Transformer package reference with configuration");
15754
+ hi = external_exports.object({ package: external_exports.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: external_exports.union([external_exports.string(), ui]).optional().describe('Either a named export string (e.g., "destinationAnalytics") or an inline code object with push function'), config: external_exports.unknown().optional().describe("Destination-specific configuration object"), env: external_exports.unknown().optional().describe("Destination environment configuration"), variables: oi.optional().describe("Destination-level variables (highest priority in cascade)"), definitions: ri.optional().describe("Destination-level definitions (highest priority in cascade)"), before: We.optional().describe("Post-collector transformer chain. String, string[], or NextRule[] for conditional routing."), next: We.optional().describe("Post-push transformer chain. Push response available at context.ingest._response."), examples: bi.optional().describe("Named step examples for testing and documentation (stripped during bundling)"), cache: Ve.optional().describe("Cache configuration for this destination (match \u2192 key \u2192 ttl rules)") }).describe("Destination package reference with configuration");
15755
+ vi = external_exports.object({ package: external_exports.string().min(1, "Package name cannot be empty").optional().describe("Store package specifier with optional version"), code: external_exports.union([external_exports.string(), ui]).optional().describe("Named export string or inline code definition"), config: external_exports.unknown().optional().describe("Store-specific configuration object"), env: external_exports.unknown().optional().describe("Store environment configuration"), variables: oi.optional().describe("Store-level variables (highest priority in cascade)"), definitions: ri.optional().describe("Store-level definitions (highest priority in cascade)"), examples: bi.optional().describe("Named step examples for testing and documentation (stripped during bundling)") }).describe("Store package reference with configuration");
15756
+ Si = external_exports.record(external_exports.string(), external_exports.unknown()).describe("JSON Schema object for event validation with description/examples annotations");
15757
+ yi = external_exports.record(external_exports.string(), Si).describe("Action-level contract entries");
15758
+ wi = external_exports.record(external_exports.string(), yi).describe("Entity-action event schemas");
15759
+ ki = external_exports.object({ extends: external_exports.string().optional().describe("Inherit from another named contract"), tagging: external_exports.number().int().min(0).optional().describe("Contract version number"), description: external_exports.string().optional().describe("Human-readable description"), globals: Si.optional().describe("JSON Schema for event.globals"), context: Si.optional().describe("JSON Schema for event.context"), custom: Si.optional().describe("JSON Schema for event.custom"), user: Si.optional().describe("JSON Schema for event.user"), consent: Si.optional().describe("JSON Schema for event.consent"), events: wi.optional().describe("Entity-action event schemas") }).describe("Named contract entry with optional sections and events");
15760
+ Ci = external_exports.record(external_exports.string(), ki).describe("Named contracts with optional extends inheritance");
15761
+ xi = external_exports.object({ web: di.optional().describe("Web platform configuration (browser-based tracking). Mutually exclusive with server."), server: pi.optional().describe("Server platform configuration (Node.js). Mutually exclusive with web."), sources: external_exports.record(external_exports.string(), fi).optional().describe("Source configurations (data capture) keyed by unique identifier"), destinations: external_exports.record(external_exports.string(), hi).optional().describe("Destination configurations (data output) keyed by unique identifier"), transformers: external_exports.record(external_exports.string(), gi).optional().describe("Transformer configurations (event transformation) keyed by unique identifier"), stores: external_exports.record(external_exports.string(), vi).optional().describe("Store configurations (key-value storage) keyed by unique identifier"), collector: external_exports.unknown().optional().describe("Collector configuration for event processing (uses Collector.InitConfig)"), bundle: li.optional().describe("Build-time configuration (packages + overrides)"), packages: external_exports.unknown().optional().refine((e3) => void 0 === e3, { message: "`packages` must live under `bundle.packages`. Move your packages block to `flow.<name>.bundle.packages`. This is a breaking change \u2014 see CHANGELOG migration guide." }).describe("Legacy top-level packages (moved to bundle.packages)"), variables: oi.optional().describe("Flow-level variables (override Config.variables, overridden by source/destination variables)"), definitions: ri.optional().describe("Flow-level definitions (extend Config.definitions, overridden by source/destination definitions)") }).refine((e3) => {
15716
15762
  const n3 = void 0 !== e3.web, i2 = void 0 !== e3.server;
15717
15763
  return (n3 || i2) && !(n3 && i2);
15718
15764
  }, { message: 'Exactly one of "web" or "server" must be present' }).describe("Single flow settings for one deployment target");
15719
- gi = external_exports.object({ $schema: external_exports.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v2.json")'), include: external_exports.array(external_exports.string()).optional().describe("Folders to include in the bundle output"), variables: _n.optional().describe("Shared variables for interpolation across all flows (use $var.name syntax)"), definitions: Qn.optional().describe("Reusable configuration definitions (use $def.name syntax)"), flows: external_exports.record(external_exports.string(), bi).refine((e3) => Object.keys(e3).length > 0, { message: "At least one flow is required" }).describe("Named flow configurations (e.g., production, staging, development)") }).extend({ version: external_exports.literal(3).describe("Configuration schema version"), contract: mi.optional().describe("Named contracts with extends inheritance and dot-path references") }).describe("walkerOS flow configuration (walkeros.config.json)");
15720
- yi = external_exports.toJSONSchema(gi, { target: "draft-7" });
15721
- wi = o(bi);
15722
- ki = o(ri);
15723
- xi = o(si);
15724
- Ci = o(ai);
15725
- ji = o(ci);
15726
- Ei = o(ui);
15727
- Ji = o(mi);
15728
- Ri = external_exports.object({ lang: external_exports.string().optional().describe("Language identifier (e.g. json, sql, bash, typescript)"), code: external_exports.string().describe("Code snippet") });
15729
- Ii = external_exports.object({ text: external_exports.string().describe("Short actionable hint text focused on walkerOS usage"), code: external_exports.array(Ri).optional().describe("Optional code snippets") });
15730
- Di = external_exports.record(external_exports.string(), Ii).describe("Keyed hints for AI consumption \u2014 lightweight context beyond schemas and examples");
15731
- Oi = external_exports.object({ param: external_exports.string().describe("Lowercase URL parameter name. Match is case-insensitive on lookup."), platform: external_exports.string().describe("Canonical platform identifier (lowercase, kebab-case).") });
15732
- _i = { source: kn.configJsonSchema, destination: Le.configJsonSchema };
15765
+ ji = external_exports.object({ $schema: external_exports.string().url("Schema URL must be a valid URL").optional().describe('JSON Schema reference for IDE validation (e.g., "https://walkeros.io/schema/flow/v2.json")'), include: external_exports.array(external_exports.string()).optional().describe("Folders to include in the bundle output"), variables: oi.optional().describe("Shared variables for interpolation across all flows (use $var.name syntax)"), definitions: ri.optional().describe("Reusable configuration definitions (use $def.name syntax)"), flows: external_exports.record(external_exports.string(), xi).refine((e3) => Object.keys(e3).length > 0, { message: "At least one flow is required" }).describe("Named flow configurations (e.g., production, staging, development)") }).extend({ version: external_exports.literal(3).describe("Configuration schema version"), contract: Ci.optional().describe("Named contracts with extends inheritance and dot-path references") }).describe("walkerOS flow configuration (walkeros.config.json)");
15766
+ Oi = external_exports.toJSONSchema(ji, { target: "draft-7" });
15767
+ Ii = o(xi);
15768
+ Di = o(fi);
15769
+ Ni = o(hi);
15770
+ Mi = o(gi);
15771
+ Ti = o(vi);
15772
+ Li = o(ki);
15773
+ zi = o(Ci);
15774
+ Ui = external_exports.object({ lang: external_exports.string().optional().describe("Language identifier (e.g. json, sql, bash, typescript)"), code: external_exports.string().describe("Code snippet") });
15775
+ Wi = external_exports.object({ text: external_exports.string().describe("Short actionable hint text focused on walkerOS usage"), code: external_exports.array(Ui).optional().describe("Optional code snippets") });
15776
+ Bi = external_exports.record(external_exports.string(), Wi).describe("Keyed hints for AI consumption \u2014 lightweight context beyond schemas and examples");
15777
+ Ai = external_exports.object({ param: external_exports.string().describe("Lowercase URL parameter name. Match is case-insensitive on lookup."), platform: external_exports.string().describe("Canonical platform identifier (lowercase, kebab-case).") });
15778
+ ot = { source: Dn.configJsonSchema, destination: Me.configJsonSchema };
15733
15779
  }
15734
15780
  });
15735
15781
 
@@ -15923,7 +15969,7 @@ function loadBundleConfig(rawConfig, options) {
15923
15969
  const availableFlows = getAvailableFlows(config2);
15924
15970
  const flowName = resolveFlow(config2, options.flowName, availableFlows);
15925
15971
  let flowSettings = D(config2, flowName, { deferred: true });
15926
- const platform = W(flowSettings);
15972
+ const platform = F(flowSettings);
15927
15973
  if (!platform) {
15928
15974
  throw new Error(
15929
15975
  `Invalid configuration: flow "${flowName}" must have a "web" or "server" key.`
@@ -16910,7 +16956,8 @@ ${dataDeclaration}`;
16910
16956
  } else {
16911
16957
  const stage2Entry = (buildOptions.platform || "node") === "browser" ? generateWebEntry(stage1Path, dataPayload, {
16912
16958
  windowCollector: buildOptions.windowCollector,
16913
- windowElb: buildOptions.windowElb
16959
+ windowElb: buildOptions.windowElb,
16960
+ platform: buildOptions.platform
16914
16961
  }) : generateServerEntry(stage1Path, dataPayload);
16915
16962
  const stage2EntryPath = path10.join(TEMP_DIR, "stage2.mjs");
16916
16963
  await fs9.writeFile(stage2EntryPath, stage2Entry);
@@ -17300,6 +17347,7 @@ async function createEntryPoint(flowSettings, buildOptions, packagePaths) {
17300
17347
  validateComponentNames(flowWithSections.transformers, "transformers");
17301
17348
  if (flowWithSections.stores)
17302
17349
  validateComponentNames(flowWithSections.stores, "stores");
17350
+ const withDev = buildOptions.withDev !== void 0 ? buildOptions.withDev === true : buildOptions.skipWrapper === true;
17303
17351
  const { importStatements, devExportEntries } = await generateImportStatements(
17304
17352
  buildOptions.packages,
17305
17353
  destinationPackages,
@@ -17308,7 +17356,7 @@ async function createEntryPoint(flowSettings, buildOptions, packagePaths) {
17308
17356
  storePackages,
17309
17357
  explicitCodeImports,
17310
17358
  packagePaths,
17311
- buildOptions.skipWrapper === true
17359
+ withDev
17312
17360
  );
17313
17361
  const importsCode = importStatements.join("\n");
17314
17362
  const hasFlow = Object.values(flowSettings.sources || {}).some(
@@ -17577,12 +17625,24 @@ function generateWebEntry(stage1Path, dataPayload, options = {}) {
17577
17625
  );
17578
17626
  }
17579
17627
  const assignmentCode = assignments.length > 0 ? "\n" + assignments.join("\n") : "";
17628
+ const platform = options.platform ?? "browser";
17629
+ const envBlock = platform === "browser" ? `
17630
+ if (config.sources) {
17631
+ for (const key of Object.keys(config.sources)) {
17632
+ const source = config.sources[key];
17633
+ if (!source) continue;
17634
+ const env = source.env ?? (source.env = {});
17635
+ env.window = env.window ?? (typeof window !== 'undefined' ? window : undefined);
17636
+ env.document = env.document ?? (typeof document !== 'undefined' ? document : undefined);
17637
+ }
17638
+ }` : "";
17580
17639
  return `import { startFlow, wireConfig } from '${stage1Path}';
17581
17640
 
17582
17641
  const __configData = ${dataPayload};
17583
17642
 
17584
17643
  (async () => {
17585
- const { collector, elb } = await startFlow(wireConfig(__configData));${assignmentCode}
17644
+ const config = wireConfig(__configData);${envBlock}
17645
+ const { collector, elb } = await startFlow(config);${assignmentCode}
17586
17646
  })();`;
17587
17647
  }
17588
17648
  function processConfigValue(value) {
@@ -17665,6 +17725,55 @@ var init_bundler = __esm({
17665
17725
  }
17666
17726
  });
17667
17727
 
17728
+ // src/commands/bundle/targets.ts
17729
+ function resolveTarget(target) {
17730
+ const preset = BUNDLE_TARGETS[target];
17731
+ if (!preset) {
17732
+ throw new Error(
17733
+ `Unknown target: ${target}. Valid: ${Object.keys(BUNDLE_TARGETS).join(", ")}`
17734
+ );
17735
+ }
17736
+ return preset;
17737
+ }
17738
+ var BUNDLE_TARGETS;
17739
+ var init_targets = __esm({
17740
+ "src/commands/bundle/targets.ts"() {
17741
+ "use strict";
17742
+ BUNDLE_TARGETS = Object.freeze({
17743
+ cdn: Object.freeze({
17744
+ skipWrapper: false,
17745
+ withDev: false,
17746
+ platform: "browser",
17747
+ injectEnv: true
17748
+ }),
17749
+ "cdn-skeleton": Object.freeze({
17750
+ skipWrapper: true,
17751
+ withDev: false,
17752
+ platform: "browser",
17753
+ injectEnv: false
17754
+ }),
17755
+ runner: Object.freeze({
17756
+ skipWrapper: true,
17757
+ withDev: false,
17758
+ platform: "node",
17759
+ injectEnv: false
17760
+ }),
17761
+ simulate: Object.freeze({
17762
+ skipWrapper: true,
17763
+ withDev: true,
17764
+ platform: "node",
17765
+ injectEnv: false
17766
+ }),
17767
+ push: Object.freeze({
17768
+ skipWrapper: true,
17769
+ withDev: true,
17770
+ platform: "node",
17771
+ injectEnv: false
17772
+ })
17773
+ });
17774
+ }
17775
+ });
17776
+
17668
17777
  // src/commands/bundle/upload.ts
17669
17778
  import fs10 from "fs-extra";
17670
17779
  function sanitizeUrl(url2) {
@@ -17737,7 +17846,8 @@ function createApiClient() {
17737
17846
  baseUrl: resolveAppUrl(),
17738
17847
  headers: {
17739
17848
  Authorization: `Bearer ${token}`,
17740
- "Content-Type": "application/json"
17849
+ "Content-Type": "application/json",
17850
+ ...clientContextHeaders()
17741
17851
  }
17742
17852
  });
17743
17853
  }
@@ -17746,6 +17856,7 @@ var init_api_client = __esm({
17746
17856
  "use strict";
17747
17857
  init_auth();
17748
17858
  init_config_file();
17859
+ init_client_context();
17749
17860
  }
17750
17861
  });
17751
17862
 
@@ -17892,7 +18003,7 @@ async function bundleCommand(options) {
17892
18003
  }
17893
18004
  }
17894
18005
  if (options.dockerfile && options.output) {
17895
- const platform = W(flowSettings);
18006
+ const platform = F(flowSettings);
17896
18007
  if (platform) {
17897
18008
  const outputDir = path12.dirname(buildOptions.output);
17898
18009
  const customFile = typeof options.dockerfile === "string" ? options.dockerfile : void 0;
@@ -17964,6 +18075,20 @@ Build Summary: ${successCount}/${results.length} succeeded`
17964
18075
  }
17965
18076
  }
17966
18077
  async function bundle(configOrPath, options = {}) {
18078
+ let effectiveTarget;
18079
+ if (options.target) {
18080
+ effectiveTarget = options.target;
18081
+ } else if (options.buildOverrides?.skipWrapper === true) {
18082
+ effectiveTarget = "simulate";
18083
+ } else {
18084
+ effectiveTarget = "cdn";
18085
+ }
18086
+ const preset = resolveTarget(effectiveTarget);
18087
+ if (options.buildOverrides?.skipWrapper !== void 0 && !options.target && process.env.WALKEROS_SUPPRESS_DEPRECATIONS !== "1") {
18088
+ console.warn(
18089
+ "[@walkeros/cli] buildOverrides.skipWrapper is deprecated. Pass `target: 'cdn' | 'cdn-skeleton' | 'runner' | 'simulate' | 'push'` instead. Set WALKEROS_SUPPRESS_DEPRECATIONS=1 to silence this warning."
18090
+ );
18091
+ }
17967
18092
  let rawConfig;
17968
18093
  let configPath = path12.resolve(process.cwd(), "walkeros.config.json");
17969
18094
  if (typeof configOrPath === "string") {
@@ -17972,10 +18097,15 @@ async function bundle(configOrPath, options = {}) {
17972
18097
  } else {
17973
18098
  rawConfig = configOrPath;
17974
18099
  }
18100
+ const mergedOverrides = {
18101
+ ...options.buildOverrides ?? {},
18102
+ skipWrapper: preset.skipWrapper,
18103
+ withDev: preset.withDev
18104
+ };
17975
18105
  const { flowSettings, buildOptions } = loadBundleConfig(rawConfig, {
17976
18106
  configPath,
17977
18107
  flowName: options.flowName,
17978
- buildOverrides: options.buildOverrides
18108
+ buildOverrides: mergedOverrides
17979
18109
  });
17980
18110
  if (options.cache !== void 0) {
17981
18111
  buildOptions.cache = options.cache;
@@ -17997,6 +18127,7 @@ var init_bundle = __esm({
17997
18127
  init_config();
17998
18128
  init_utils();
17999
18129
  init_bundler();
18130
+ init_targets();
18000
18131
  init_upload();
18001
18132
  init_stats();
18002
18133
  init_api_client();
@@ -18122,6 +18253,64 @@ function findPackageJson() {
18122
18253
  }
18123
18254
  var VERSION = JSON.parse(findPackageJson()).version;
18124
18255
 
18256
+ // src/cli.ts
18257
+ init_client_context();
18258
+
18259
+ // src/core/api-error.ts
18260
+ var ApiError = class extends Error {
18261
+ code;
18262
+ details;
18263
+ // Populated only for CLIENT_OUTDATED responses (HTTP 426).
18264
+ minVersion;
18265
+ clientVersion;
18266
+ client;
18267
+ upgrade;
18268
+ docs;
18269
+ constructor(message, options) {
18270
+ super(message);
18271
+ this.name = "ApiError";
18272
+ this.code = options?.code;
18273
+ this.details = options?.details;
18274
+ this.minVersion = options?.minVersion;
18275
+ this.clientVersion = options?.clientVersion;
18276
+ this.client = options?.client;
18277
+ this.upgrade = options?.upgrade;
18278
+ this.docs = options?.docs;
18279
+ }
18280
+ };
18281
+ function throwApiError(error48, fallbackMessage) {
18282
+ if (error48 && typeof error48 === "object" && "error" in error48 && typeof error48.error === "object") {
18283
+ const inner = error48.error;
18284
+ const message = inner.message || fallbackMessage;
18285
+ const code = inner.code;
18286
+ const details = inner.details?.errors;
18287
+ const options = { code, details };
18288
+ if (code === "CLIENT_OUTDATED") {
18289
+ options.minVersion = inner.minVersion;
18290
+ options.clientVersion = inner.clientVersion;
18291
+ options.client = inner.client;
18292
+ options.upgrade = inner.upgrade;
18293
+ options.docs = inner.docs;
18294
+ }
18295
+ throw new ApiError(message, options);
18296
+ }
18297
+ throw new ApiError(fallbackMessage);
18298
+ }
18299
+ function handleCliError(err) {
18300
+ if (err instanceof ApiError && err.code === "CLIENT_OUTDATED") {
18301
+ console.error(`
18302
+ ${err.message}
18303
+ `);
18304
+ if (err.upgrade) console.error(` Upgrade: ${err.upgrade}`);
18305
+ if (err.docs) console.error(` Docs: ${err.docs}
18306
+ `);
18307
+ process.exit(2);
18308
+ }
18309
+ const message = err instanceof Error ? err.message : String(err);
18310
+ console.error(message);
18311
+ process.exit(1);
18312
+ }
18313
+
18125
18314
  // src/core/banner.ts
18126
18315
  import chalk from "chalk";
18127
18316
  var BRAND_COLOR = "#01b5e2";
@@ -18762,7 +18951,7 @@ async function prepareFlow(input) {
18762
18951
  configPath: process.cwd(),
18763
18952
  flowName: input.flow
18764
18953
  });
18765
- const platform = W(flowSettings);
18954
+ const platform = F(flowSettings);
18766
18955
  const overrides = buildOverrides(
18767
18956
  { simulate: input.simulate, mock: input.mock },
18768
18957
  flowSettings
@@ -19019,7 +19208,7 @@ async function executeConfigPush(options, validatedEvent, logger, setTempDir, sn
19019
19208
  flowName: options.flow,
19020
19209
  logger
19021
19210
  });
19022
- const platform = W(flowSettings);
19211
+ const platform = F(flowSettings);
19023
19212
  const overrides = buildOverrides({ mock: options.mock }, flowSettings);
19024
19213
  logger.debug("Bundling flow configuration");
19025
19214
  const tempDir = getTmpPath(
@@ -19754,7 +19943,7 @@ import { resolve as resolve2, dirname as dirname3 } from "path";
19754
19943
  // src/runtime/load-bundle.ts
19755
19944
  import { resolve } from "path";
19756
19945
  import { pathToFileURL as pathToFileURL2 } from "url";
19757
- async function loadBundle(file2, context, logger) {
19946
+ async function loadBundle(file2, context2, logger) {
19758
19947
  const absolutePath = resolve(file2);
19759
19948
  const fileUrl = pathToFileURL2(absolutePath).href;
19760
19949
  logger?.debug?.(`Importing bundle: ${absolutePath}`);
@@ -19765,7 +19954,7 @@ async function loadBundle(file2, context, logger) {
19765
19954
  );
19766
19955
  }
19767
19956
  logger?.debug?.("Calling factory function...");
19768
- const result = await module.default(context ?? {});
19957
+ const result = await module.default(context2 ?? {});
19769
19958
  if (!result || !result.collector || typeof result.collector.push !== "function") {
19770
19959
  throw new Error(
19771
19960
  `Invalid bundle: factory must return { collector } with a push function`
@@ -20710,7 +20899,7 @@ function buildConnectionGraph(config2) {
20710
20899
  return connections;
20711
20900
  }
20712
20901
  function checkCompatibility(conn, errors, warnings) {
20713
- const fromOuts = Object.entries(conn.from.examples).filter(([, ex]) => ex.out !== void 0 && ex.out !== false).map(([name, ex]) => ({ name, value: ex.out }));
20902
+ const fromOuts = Object.entries(conn.from.examples).filter(([, ex]) => ex.out !== void 0 && ex.out.length > 0).map(([name, ex]) => ({ name, value: ex.out }));
20714
20903
  const toIns = Object.entries(conn.to.examples).filter(([, ex]) => ex.in !== void 0).map(([name, ex]) => ({ name, value: ex.in }));
20715
20904
  const path18 = `${conn.from.type}.${conn.from.name} \u2192 ${conn.to.type}.${conn.to.name}`;
20716
20905
  if (fromOuts.length === 0 || toIns.length === 0) {
@@ -21243,15 +21432,13 @@ async function whoamiCommand(options) {
21243
21432
  if (data.projectId) logger.info(`Project: ${data.projectId}`);
21244
21433
  }
21245
21434
  } catch (error48) {
21246
- logger.error(error48 instanceof Error ? error48.message : String(error48));
21247
- process.exit(1);
21435
+ handleCliError(error48);
21248
21436
  }
21249
21437
  }
21250
21438
 
21251
21439
  // src/commands/projects/index.ts
21252
21440
  init_api_client();
21253
21441
  init_auth();
21254
- init_cli_logger();
21255
21442
  init_output();
21256
21443
  async function listProjects() {
21257
21444
  const client = createApiClient();
@@ -21299,13 +21486,11 @@ async function deleteProject(options = {}) {
21299
21486
  return data ?? { success: true };
21300
21487
  }
21301
21488
  async function handleResult(fn2, options) {
21302
- const logger = createCLILogger(options);
21303
21489
  try {
21304
21490
  const result = await fn2();
21305
21491
  await writeResult(JSON.stringify(result, null, 2), options);
21306
21492
  } catch (error48) {
21307
- logger.error(error48 instanceof Error ? error48.message : String(error48));
21308
- process.exit(1);
21493
+ handleCliError(error48);
21309
21494
  }
21310
21495
  }
21311
21496
  async function listProjectsCommand(options) {
@@ -21342,32 +21527,7 @@ async function deleteProjectCommand(projectId, options) {
21342
21527
 
21343
21528
  // src/commands/flows/index.ts
21344
21529
  init_api_client();
21345
-
21346
- // src/core/api-error.ts
21347
- var ApiError = class extends Error {
21348
- code;
21349
- details;
21350
- constructor(message, options) {
21351
- super(message);
21352
- this.name = "ApiError";
21353
- this.code = options?.code;
21354
- this.details = options?.details;
21355
- }
21356
- };
21357
- function throwApiError(error48, fallbackMessage) {
21358
- if (error48 && typeof error48 === "object" && "error" in error48 && typeof error48.error === "object") {
21359
- const inner = error48.error;
21360
- const message = inner.message || fallbackMessage;
21361
- const code = inner.code;
21362
- const details = inner.details?.errors;
21363
- throw new ApiError(message, { code, details });
21364
- }
21365
- throw new ApiError(fallbackMessage);
21366
- }
21367
-
21368
- // src/commands/flows/index.ts
21369
21530
  init_auth();
21370
- init_cli_logger();
21371
21531
  init_output();
21372
21532
  init_stdin();
21373
21533
  async function listFlows(options = {}) {
@@ -21458,13 +21618,11 @@ async function duplicateFlow(options) {
21458
21618
  return data;
21459
21619
  }
21460
21620
  async function handleResult2(fn2, options) {
21461
- const logger = createCLILogger(options);
21462
21621
  try {
21463
21622
  const result = await fn2();
21464
21623
  await writeResult(JSON.stringify(result, null, 2), options);
21465
21624
  } catch (error48) {
21466
- logger.error(error48 instanceof Error ? error48.message : String(error48));
21467
- process.exit(1);
21625
+ handleCliError(error48);
21468
21626
  }
21469
21627
  }
21470
21628
  async function listFlowsCommand(options) {
@@ -21707,8 +21865,7 @@ async function deployCommand(flowId, options) {
21707
21865
  log.info(`Status: ${r2.status}`);
21708
21866
  }
21709
21867
  } catch (err) {
21710
- log.error(err instanceof Error ? err.message : "Deploy failed");
21711
- process.exit(1);
21868
+ handleCliError(err);
21712
21869
  }
21713
21870
  }
21714
21871
 
@@ -21772,13 +21929,11 @@ async function deleteDeployment(options) {
21772
21929
  return data ?? { success: true };
21773
21930
  }
21774
21931
  async function handleResult3(fn2, options) {
21775
- const logger = createCLILogger(options);
21776
21932
  try {
21777
21933
  const result = await fn2();
21778
21934
  await writeResult(JSON.stringify(result, null, 2), options);
21779
21935
  } catch (error48) {
21780
- logger.error(error48 instanceof Error ? error48.message : String(error48));
21781
- process.exit(1);
21936
+ handleCliError(error48);
21782
21937
  }
21783
21938
  }
21784
21939
  async function listDeploymentsCommand(options) {
@@ -21838,7 +21993,7 @@ async function createDeployCommand(config2, options) {
21838
21993
  const result2 = await loadFlowConfig(config2, {
21839
21994
  flowName: options.flow
21840
21995
  });
21841
- type = W(result2.flowSettings);
21996
+ type = F(result2.flowSettings);
21842
21997
  }
21843
21998
  const deployment = await createDeployment({
21844
21999
  type,
@@ -21870,18 +22025,15 @@ async function createDeployCommand(config2, options) {
21870
22025
  log.info(" -e WALKEROS_APP_URL=https://app.walkeros.io \\");
21871
22026
  log.info(" walkeros/flow:latest");
21872
22027
  } catch (err) {
21873
- log.error(
21874
- err instanceof Error ? err.message : "Failed to create deployment"
21875
- );
21876
- process.exit(1);
22028
+ handleCliError(err);
21877
22029
  }
21878
22030
  }
21879
22031
 
21880
22032
  // src/commands/feedback/index.ts
21881
22033
  init_config_file();
21882
22034
  init_http();
21883
- init_cli_logger();
21884
22035
  import { createInterface } from "readline";
22036
+ init_cli_logger();
21885
22037
  async function feedback(text, options) {
21886
22038
  const config2 = readConfig();
21887
22039
  const anonymous = options?.anonymous ?? config2?.anonymousFeedback ?? true;
@@ -21934,8 +22086,7 @@ async function feedbackCommand(text) {
21934
22086
  await feedback(text, { anonymous });
21935
22087
  logger.info("Feedback sent. Thanks!");
21936
22088
  } catch (error48) {
21937
- logger.error(error48 instanceof Error ? error48.message : String(error48));
21938
- process.exit(1);
22089
+ handleCliError(error48);
21939
22090
  }
21940
22091
  }
21941
22092
  function promptUser(question) {
@@ -21952,6 +22103,9 @@ function promptUser(question) {
21952
22103
  }
21953
22104
 
21954
22105
  // src/cli.ts
22106
+ setClientContext({ type: "cli", version: VERSION });
22107
+ process.on("uncaughtException", handleCliError);
22108
+ process.on("unhandledRejection", handleCliError);
21955
22109
  var program = new Command();
21956
22110
  program.name("walkeros").description("walkerOS CLI - Bundle and deploy walkerOS components").version(VERSION);
21957
22111
  program.command("bundle [file]").description("Bundle NPM packages with custom code").option("-o, --output <path>", "write bundle to file or directory").option("-f, --flow <name>", "flow name for multi-flow configs").option("--all", "build all flows for multi-flow configs").option("--stats", "show bundle statistics").option("--json", "output as JSON (implies --stats)").option("--no-cache", "disable package caching").option("-v, --verbose", "verbose output").option("-s, --silent", "suppress output").option(