@xyo-network/xl1-cli 1.16.25 → 1.16.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli-min.mjs +510 -239
  2. package/package.json +7 -7
package/dist/cli-min.mjs CHANGED
@@ -20860,21 +20860,30 @@ const NEVER = Object.freeze({
20860
20860
  });
20861
20861
  function $constructor(name, initializer, params) {
20862
20862
  function init(inst, def) {
20863
- var _a;
20864
- Object.defineProperty(inst, "_zod", {
20865
- value: inst._zod ?? {},
20866
- enumerable: false,
20867
- });
20868
- (_a = inst._zod).traits ?? (_a.traits = new Set());
20863
+ if (!inst._zod) {
20864
+ Object.defineProperty(inst, "_zod", {
20865
+ value: {
20866
+ def,
20867
+ constr: _,
20868
+ traits: new Set(),
20869
+ },
20870
+ enumerable: false,
20871
+ });
20872
+ }
20873
+ if (inst._zod.traits.has(name)) {
20874
+ return;
20875
+ }
20869
20876
  inst._zod.traits.add(name);
20870
20877
  initializer(inst, def);
20871
20878
  // support prototype modifications
20872
- for (const k in _.prototype) {
20873
- if (!(k in inst))
20874
- Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
20879
+ const proto = _.prototype;
20880
+ const keys = Object.keys(proto);
20881
+ for (let i = 0; i < keys.length; i++) {
20882
+ const k = keys[i];
20883
+ if (!(k in inst)) {
20884
+ inst[k] = proto[k].bind(inst);
20885
+ }
20875
20886
  }
20876
- inst._zod.constr = _;
20877
- inst._zod.def = def;
20878
20887
  }
20879
20888
  // doesn't work if Parent has a constructor with arguments
20880
20889
  const Parent = params?.Parent ?? Object;
@@ -21057,6 +21066,14 @@ function randomString(length = 10) {
21057
21066
  function esc(str) {
21058
21067
  return JSON.stringify(str);
21059
21068
  }
21069
+ function slugify$1(input) {
21070
+ return input
21071
+ .toLowerCase()
21072
+ .trim()
21073
+ .replace(/[^\w\s-]/g, "")
21074
+ .replace(/[\s_-]+/g, "-")
21075
+ .replace(/^-+|-+$/g, "");
21076
+ }
21060
21077
  const captureStackTrace = ("captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { });
21061
21078
  function isObject$3(data) {
21062
21079
  return typeof data === "object" && data !== null && !Array.isArray(data);
@@ -21082,6 +21099,8 @@ function isPlainObject$1(o) {
21082
21099
  const ctor = o.constructor;
21083
21100
  if (ctor === undefined)
21084
21101
  return true;
21102
+ if (typeof ctor !== "function")
21103
+ return true;
21085
21104
  // modified prototype
21086
21105
  const prot = ctor.prototype;
21087
21106
  if (isObject$3(prot) === false)
@@ -21579,6 +21598,7 @@ var util$4 = /*#__PURE__*/Object.freeze({
21579
21598
  required: required$2,
21580
21599
  safeExtend: safeExtend,
21581
21600
  shallowClone: shallowClone,
21601
+ slugify: slugify$1,
21582
21602
  stringifyPrimitive: stringifyPrimitive,
21583
21603
  uint8ArrayToBase64: uint8ArrayToBase64,
21584
21604
  uint8ArrayToBase64url: uint8ArrayToBase64url,
@@ -21898,6 +21918,10 @@ function emoji$1() {
21898
21918
  }
21899
21919
  const ipv4$2 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
21900
21920
  const ipv6$2 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
21921
+ const mac$1 = (delimiter) => {
21922
+ const escapedDelim = escapeRegex(delimiter ?? ":");
21923
+ return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);
21924
+ };
21901
21925
  const cidrv4$1 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
21902
21926
  const cidrv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
21903
21927
  // https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
@@ -22013,6 +22037,7 @@ var regexes$1 = /*#__PURE__*/Object.freeze({
22013
22037
  ipv6: ipv6$2,
22014
22038
  ksuid: ksuid$1,
22015
22039
  lowercase: lowercase,
22040
+ mac: mac$1,
22016
22041
  md5_base64: md5_base64,
22017
22042
  md5_base64url: md5_base64url,
22018
22043
  md5_hex: md5_hex,
@@ -22651,7 +22676,7 @@ class Doc {
22651
22676
  const version$8 = {
22652
22677
  major: 4,
22653
22678
  minor: 1,
22654
- patch: 12,
22679
+ patch: 13,
22655
22680
  };
22656
22681
 
22657
22682
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
@@ -22854,7 +22879,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
22854
22879
  code: "invalid_format",
22855
22880
  format: "url",
22856
22881
  note: "Invalid hostname",
22857
- pattern: hostname$5.source,
22882
+ pattern: def.hostname.source,
22858
22883
  input: payload.value,
22859
22884
  inst,
22860
22885
  continue: !def.abort,
@@ -22944,18 +22969,12 @@ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def
22944
22969
  const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
22945
22970
  def.pattern ?? (def.pattern = ipv4$2);
22946
22971
  $ZodStringFormat.init(inst, def);
22947
- inst._zod.onattach.push((inst) => {
22948
- const bag = inst._zod.bag;
22949
- bag.format = `ipv4`;
22950
- });
22972
+ inst._zod.bag.format = `ipv4`;
22951
22973
  });
22952
22974
  const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
22953
22975
  def.pattern ?? (def.pattern = ipv6$2);
22954
22976
  $ZodStringFormat.init(inst, def);
22955
- inst._zod.onattach.push((inst) => {
22956
- const bag = inst._zod.bag;
22957
- bag.format = `ipv6`;
22958
- });
22977
+ inst._zod.bag.format = `ipv6`;
22959
22978
  inst._zod.check = (payload) => {
22960
22979
  try {
22961
22980
  // @ts-ignore
@@ -22973,6 +22992,11 @@ const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
22973
22992
  }
22974
22993
  };
22975
22994
  });
22995
+ const $ZodMAC = /*@__PURE__*/ $constructor("$ZodMAC", (inst, def) => {
22996
+ def.pattern ?? (def.pattern = mac$1(def.delimiter));
22997
+ $ZodStringFormat.init(inst, def);
22998
+ inst._zod.bag.format = `mac`;
22999
+ });
22976
23000
  const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
22977
23001
  def.pattern ?? (def.pattern = cidrv4$1);
22978
23002
  $ZodStringFormat.init(inst, def);
@@ -23025,9 +23049,7 @@ function isValidBase64(data) {
23025
23049
  const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
23026
23050
  def.pattern ?? (def.pattern = base64$2);
23027
23051
  $ZodStringFormat.init(inst, def);
23028
- inst._zod.onattach.push((inst) => {
23029
- inst._zod.bag.contentEncoding = "base64";
23030
- });
23052
+ inst._zod.bag.contentEncoding = "base64";
23031
23053
  inst._zod.check = (payload) => {
23032
23054
  if (isValidBase64(payload.value))
23033
23055
  return;
@@ -23051,9 +23073,7 @@ function isValidBase64URL(data) {
23051
23073
  const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
23052
23074
  def.pattern ?? (def.pattern = base64url$1);
23053
23075
  $ZodStringFormat.init(inst, def);
23054
- inst._zod.onattach.push((inst) => {
23055
- inst._zod.bag.contentEncoding = "base64url";
23056
- });
23076
+ inst._zod.bag.contentEncoding = "base64url";
23057
23077
  inst._zod.check = (payload) => {
23058
23078
  if (isValidBase64URL(payload.value))
23059
23079
  return;
@@ -23151,9 +23171,9 @@ const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
23151
23171
  return payload;
23152
23172
  };
23153
23173
  });
23154
- const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
23174
+ const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
23155
23175
  $ZodCheckNumberFormat.init(inst, def);
23156
- $ZodNumber.init(inst, def); // no format checksp
23176
+ $ZodNumber.init(inst, def); // no format checks
23157
23177
  });
23158
23178
  const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
23159
23179
  $ZodType.init(inst, def);
@@ -23196,7 +23216,7 @@ const $ZodBigInt = /*@__PURE__*/ $constructor("$ZodBigInt", (inst, def) => {
23196
23216
  return payload;
23197
23217
  };
23198
23218
  });
23199
- const $ZodBigIntFormat = /*@__PURE__*/ $constructor("$ZodBigInt", (inst, def) => {
23219
+ const $ZodBigIntFormat = /*@__PURE__*/ $constructor("$ZodBigIntFormat", (inst, def) => {
23200
23220
  $ZodCheckBigIntFormat.init(inst, def);
23201
23221
  $ZodBigInt.init(inst, def); // no format checks
23202
23222
  });
@@ -23385,7 +23405,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
23385
23405
  const keySet = def.keySet;
23386
23406
  const _catchall = def.catchall._zod;
23387
23407
  const t = _catchall.def.type;
23388
- for (const key of Object.keys(input)) {
23408
+ for (const key in input) {
23389
23409
  if (keySet.has(key))
23390
23410
  continue;
23391
23411
  if (t === "never") {
@@ -23773,7 +23793,6 @@ function handleIntersectionResults(result, left, right) {
23773
23793
  const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
23774
23794
  $ZodType.init(inst, def);
23775
23795
  const items = def.items;
23776
- const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
23777
23796
  inst._zod.parse = (payload, ctx) => {
23778
23797
  const input = payload.value;
23779
23798
  if (!Array.isArray(input)) {
@@ -23787,6 +23806,8 @@ const $ZodTuple = /*@__PURE__*/ $constructor("$ZodTuple", (inst, def) => {
23787
23806
  }
23788
23807
  payload.value = [];
23789
23808
  const proms = [];
23809
+ const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
23810
+ const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
23790
23811
  if (!def.rest) {
23791
23812
  const tooBig = input.length > items.length;
23792
23813
  const tooSmall = input.length < optStart - 1;
@@ -23858,11 +23879,13 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
23858
23879
  return payload;
23859
23880
  }
23860
23881
  const proms = [];
23861
- if (def.keyType._zod.values) {
23862
- const values = def.keyType._zod.values;
23882
+ const values = def.keyType._zod.values;
23883
+ if (values) {
23863
23884
  payload.value = {};
23885
+ const recordKeys = new Set();
23864
23886
  for (const key of values) {
23865
23887
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
23888
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
23866
23889
  const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
23867
23890
  if (result instanceof Promise) {
23868
23891
  proms.push(result.then((result) => {
@@ -23882,7 +23905,7 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
23882
23905
  }
23883
23906
  let unrecognized;
23884
23907
  for (const key in input) {
23885
- if (!values.has(key)) {
23908
+ if (!recordKeys.has(key)) {
23886
23909
  unrecognized = unrecognized ?? [];
23887
23910
  unrecognized.push(key);
23888
23911
  }
@@ -24066,13 +24089,14 @@ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
24066
24089
  if (def.values.length === 0) {
24067
24090
  throw new Error("Cannot create literal schema with no valid values");
24068
24091
  }
24069
- inst._zod.values = new Set(def.values);
24092
+ const values = new Set(def.values);
24093
+ inst._zod.values = values;
24070
24094
  inst._zod.pattern = new RegExp(`^(${def.values
24071
24095
  .map((o) => (typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)))
24072
24096
  .join("|")})$`);
24073
24097
  inst._zod.parse = (payload, _ctx) => {
24074
24098
  const input = payload.value;
24075
- if (inst._zod.values.has(input)) {
24099
+ if (values.has(input)) {
24076
24100
  return payload;
24077
24101
  }
24078
24102
  payload.issues.push({
@@ -24400,8 +24424,8 @@ const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
24400
24424
  $ZodType.init(inst, def);
24401
24425
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
24402
24426
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
24403
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
24404
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
24427
+ defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
24428
+ defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
24405
24429
  inst._zod.parse = (payload, ctx) => {
24406
24430
  if (ctx.direction === "backward") {
24407
24431
  return def.innerType._zod.run(payload, ctx);
@@ -24561,10 +24585,10 @@ const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
24561
24585
  // return () => _innerType;
24562
24586
  // });
24563
24587
  defineLazy(inst._zod, "innerType", () => def.getter());
24564
- defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
24565
- defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
24566
- defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin ?? undefined);
24567
- defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout ?? undefined);
24588
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
24589
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
24590
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined);
24591
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined);
24568
24592
  inst._zod.parse = (payload, ctx) => {
24569
24593
  const inner = inst._zod.innerType;
24570
24594
  return inner._zod.run(payload, ctx);
@@ -25676,6 +25700,7 @@ const error$E = () => {
25676
25700
  duration: "ISO duration",
25677
25701
  ipv4: "IPv4 address",
25678
25702
  ipv6: "IPv6 address",
25703
+ mac: "MAC address",
25679
25704
  cidrv4: "IPv4 range",
25680
25705
  cidrv6: "IPv6 range",
25681
25706
  base64: "base64-encoded string",
@@ -26485,111 +26510,222 @@ function frCA () {
26485
26510
  }
26486
26511
 
26487
26512
  const error$x = () => {
26513
+ // Hebrew labels + grammatical gender
26514
+ const TypeNames = {
26515
+ string: { label: "מחרוזת", gender: "f" },
26516
+ number: { label: "מספר", gender: "m" },
26517
+ boolean: { label: "ערך בוליאני", gender: "m" },
26518
+ bigint: { label: "BigInt", gender: "m" },
26519
+ date: { label: "תאריך", gender: "m" },
26520
+ array: { label: "מערך", gender: "m" },
26521
+ object: { label: "אובייקט", gender: "m" },
26522
+ null: { label: "ערך ריק (null)", gender: "m" },
26523
+ undefined: { label: "ערך לא מוגדר (undefined)", gender: "m" },
26524
+ symbol: { label: "סימבול (Symbol)", gender: "m" },
26525
+ function: { label: "פונקציה", gender: "f" },
26526
+ map: { label: "מפה (Map)", gender: "f" },
26527
+ set: { label: "קבוצה (Set)", gender: "f" },
26528
+ file: { label: "קובץ", gender: "m" },
26529
+ promise: { label: "Promise", gender: "m" },
26530
+ NaN: { label: "NaN", gender: "m" },
26531
+ unknown: { label: "ערך לא ידוע", gender: "m" },
26532
+ value: { label: "ערך", gender: "m" },
26533
+ };
26534
+ // Sizing units for size-related messages + localized origin labels
26488
26535
  const Sizable = {
26489
- string: { unit: "אותיות", verb: "לכלול" },
26490
- file: { unit: "בייטים", verb: "לכלול" },
26491
- array: { unit: "פריטים", verb: "לכלול" },
26492
- set: { unit: "פריטים", verb: "לכלול" },
26536
+ string: { unit: "תווים", shortLabel: "קצר", longLabel: "ארוך" },
26537
+ file: { unit: "בייטים", shortLabel: "קטן", longLabel: "גדול" },
26538
+ array: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
26539
+ set: { unit: "פריטים", shortLabel: "קטן", longLabel: "גדול" },
26540
+ number: { unit: "", shortLabel: "קטן", longLabel: "גדול" }, // no unit
26493
26541
  };
26494
- function getSizing(origin) {
26542
+ // Helpers — labels, articles, and verbs
26543
+ const typeEntry = (t) => (t ? TypeNames[t] : undefined);
26544
+ const typeLabel = (t) => {
26545
+ const e = typeEntry(t);
26546
+ if (e)
26547
+ return e.label;
26548
+ // fallback: show raw string if unknown
26549
+ return t ?? TypeNames.unknown.label;
26550
+ };
26551
+ const withDefinite = (t) => `ה${typeLabel(t)}`;
26552
+ const verbFor = (t) => {
26553
+ const e = typeEntry(t);
26554
+ const gender = e?.gender ?? "m";
26555
+ return gender === "f" ? "צריכה להיות" : "צריך להיות";
26556
+ };
26557
+ const getSizing = (origin) => {
26558
+ if (!origin)
26559
+ return null;
26495
26560
  return Sizable[origin] ?? null;
26496
- }
26561
+ };
26562
+ // Robust type parser for "received" — returns a key we understand or a constructor name
26497
26563
  const parsedType = (data) => {
26498
26564
  const t = typeof data;
26499
26565
  switch (t) {
26500
- case "number": {
26566
+ case "number":
26501
26567
  return Number.isNaN(data) ? "NaN" : "number";
26502
- }
26503
26568
  case "object": {
26504
- if (Array.isArray(data)) {
26569
+ if (Array.isArray(data))
26505
26570
  return "array";
26506
- }
26507
- if (data === null) {
26571
+ if (data === null)
26508
26572
  return "null";
26509
- }
26510
26573
  if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
26511
- return data.constructor.name;
26574
+ return data.constructor.name; // keep as-is (e.g., "Date")
26512
26575
  }
26576
+ return "object";
26513
26577
  }
26578
+ default:
26579
+ return t;
26514
26580
  }
26515
- return t;
26516
26581
  };
26517
26582
  const Nouns = {
26518
- regex: "קלט",
26519
- email: "כתובת אימייל",
26520
- url: "כתובת רשת",
26521
- emoji: "אימוג'י",
26522
- uuid: "UUID",
26523
- uuidv4: "UUIDv4",
26524
- uuidv6: "UUIDv6",
26525
- nanoid: "nanoid",
26526
- guid: "GUID",
26527
- cuid: "cuid",
26528
- cuid2: "cuid2",
26529
- ulid: "ULID",
26530
- xid: "XID",
26531
- ksuid: "KSUID",
26532
- datetime: "תאריך וזמן ISO",
26533
- date: "תאריך ISO",
26534
- time: "זמן ISO",
26535
- duration: "משך זמן ISO",
26536
- ipv4: "כתובת IPv4",
26537
- ipv6: "כתובת IPv6",
26538
- cidrv4: "טווח IPv4",
26539
- cidrv6: "טווח IPv6",
26540
- base64: "מחרוזת בבסיס 64",
26541
- base64url: "מחרוזת בבסיס 64 לכתובות רשת",
26542
- json_string: "מחרוזת JSON",
26543
- e164: "מספר E.164",
26544
- jwt: "JWT",
26545
- template_literal: "קלט",
26583
+ regex: { label: "קלט", gender: "m" },
26584
+ email: { label: "כתובת אימייל", gender: "f" },
26585
+ url: { label: "כתובת רשת", gender: "f" },
26586
+ emoji: { label: "אימוג'י", gender: "m" },
26587
+ uuid: { label: "UUID", gender: "m" },
26588
+ nanoid: { label: "nanoid", gender: "m" },
26589
+ guid: { label: "GUID", gender: "m" },
26590
+ cuid: { label: "cuid", gender: "m" },
26591
+ cuid2: { label: "cuid2", gender: "m" },
26592
+ ulid: { label: "ULID", gender: "m" },
26593
+ xid: { label: "XID", gender: "m" },
26594
+ ksuid: { label: "KSUID", gender: "m" },
26595
+ datetime: { label: "תאריך וזמן ISO", gender: "m" },
26596
+ date: { label: "תאריך ISO", gender: "m" },
26597
+ time: { label: "זמן ISO", gender: "m" },
26598
+ duration: { label: "משך זמן ISO", gender: "m" },
26599
+ ipv4: { label: "כתובת IPv4", gender: "f" },
26600
+ ipv6: { label: "כתובת IPv6", gender: "f" },
26601
+ cidrv4: { label: "טווח IPv4", gender: "m" },
26602
+ cidrv6: { label: "טווח IPv6", gender: "m" },
26603
+ base64: { label: "מחרוזת בבסיס 64", gender: "f" },
26604
+ base64url: { label: "מחרוזת בבסיס 64 לכתובות רשת", gender: "f" },
26605
+ json_string: { label: "מחרוזת JSON", gender: "f" },
26606
+ e164: { label: "מספר E.164", gender: "m" },
26607
+ jwt: { label: "JWT", gender: "m" },
26608
+ ends_with: { label: "קלט", gender: "m" },
26609
+ includes: { label: "קלט", gender: "m" },
26610
+ lowercase: { label: "קלט", gender: "m" },
26611
+ starts_with: { label: "קלט", gender: "m" },
26612
+ uppercase: { label: "קלט", gender: "m" },
26546
26613
  };
26547
26614
  return (issue) => {
26548
26615
  switch (issue.code) {
26549
- case "invalid_type":
26550
- return `קלט לא תקין: צריך ${issue.expected}, התקבל ${parsedType(issue.input)}`;
26551
- // return `Invalid input: expected ${issue.expected}, received ${util.getParsedType(issue.input)}`;
26552
- case "invalid_value":
26553
- if (issue.values.length === 1)
26554
- return `קלט לא תקין: צריך ${stringifyPrimitive(issue.values[0])}`;
26555
- return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue.values, "|")}`;
26616
+ case "invalid_type": {
26617
+ // Expected type: show without definite article for clearer Hebrew
26618
+ const expectedKey = issue.expected;
26619
+ const expected = typeLabel(expectedKey);
26620
+ // Received: show localized label if known, otherwise constructor/raw
26621
+ const receivedKey = parsedType(issue.input);
26622
+ const received = TypeNames[receivedKey]?.label ?? receivedKey;
26623
+ return `קלט לא תקין: צריך להיות ${expected}, התקבל ${received}`;
26624
+ }
26625
+ case "invalid_value": {
26626
+ if (issue.values.length === 1) {
26627
+ return `ערך לא תקין: הערך חייב להיות ${stringifyPrimitive(issue.values[0])}`;
26628
+ }
26629
+ // Join values with proper Hebrew formatting
26630
+ const stringified = issue.values.map((v) => stringifyPrimitive(v));
26631
+ if (issue.values.length === 2) {
26632
+ return `ערך לא תקין: האפשרויות המתאימות הן ${stringified[0]} או ${stringified[1]}`;
26633
+ }
26634
+ // For 3+ values: "a", "b" או "c"
26635
+ const lastValue = stringified[stringified.length - 1];
26636
+ const restValues = stringified.slice(0, -1).join(", ");
26637
+ return `ערך לא תקין: האפשרויות המתאימות הן ${restValues} או ${lastValue}`;
26638
+ }
26556
26639
  case "too_big": {
26557
- const adj = issue.inclusive ? "<=" : "<";
26558
26640
  const sizing = getSizing(issue.origin);
26559
- if (sizing)
26560
- return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
26561
- return `גדול מדי: ${issue.origin ?? "value"} צריך להיות ${adj}${issue.maximum.toString()}`;
26641
+ const subject = withDefinite(issue.origin ?? "value");
26642
+ if (issue.origin === "string") {
26643
+ // Special handling for strings - more natural Hebrew
26644
+ return `${sizing?.longLabel ?? "ארוך"} מדי: ${subject} צריכה להכיל ${issue.maximum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או פחות" : "לכל היותר"}`.trim();
26645
+ }
26646
+ if (issue.origin === "number") {
26647
+ // Natural Hebrew for numbers
26648
+ const comparison = issue.inclusive ? `קטן או שווה ל-${issue.maximum}` : `קטן מ-${issue.maximum}`;
26649
+ return `גדול מדי: ${subject} צריך להיות ${comparison}`;
26650
+ }
26651
+ if (issue.origin === "array" || issue.origin === "set") {
26652
+ // Natural Hebrew for arrays and sets
26653
+ const verb = issue.origin === "set" ? "צריכה" : "צריך";
26654
+ const comparison = issue.inclusive
26655
+ ? `${issue.maximum} ${sizing?.unit ?? ""} או פחות`
26656
+ : `פחות מ-${issue.maximum} ${sizing?.unit ?? ""}`;
26657
+ return `גדול מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
26658
+ }
26659
+ const adj = issue.inclusive ? "<=" : "<";
26660
+ const be = verbFor(issue.origin ?? "value");
26661
+ if (sizing?.unit) {
26662
+ return `${sizing.longLabel} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()} ${sizing.unit}`;
26663
+ }
26664
+ return `${sizing?.longLabel ?? "גדול"} מדי: ${subject} ${be} ${adj}${issue.maximum.toString()}`;
26562
26665
  }
26563
26666
  case "too_small": {
26564
- const adj = issue.inclusive ? ">=" : ">";
26565
26667
  const sizing = getSizing(issue.origin);
26566
- if (sizing) {
26567
- return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()} ${sizing.unit}`;
26668
+ const subject = withDefinite(issue.origin ?? "value");
26669
+ if (issue.origin === "string") {
26670
+ // Special handling for strings - more natural Hebrew
26671
+ return `${sizing?.shortLabel ?? "קצר"} מדי: ${subject} צריכה להכיל ${issue.minimum.toString()} ${sizing?.unit ?? ""} ${issue.inclusive ? "או יותר" : "לפחות"}`.trim();
26672
+ }
26673
+ if (issue.origin === "number") {
26674
+ // Natural Hebrew for numbers
26675
+ const comparison = issue.inclusive ? `גדול או שווה ל-${issue.minimum}` : `גדול מ-${issue.minimum}`;
26676
+ return `קטן מדי: ${subject} צריך להיות ${comparison}`;
26677
+ }
26678
+ if (issue.origin === "array" || issue.origin === "set") {
26679
+ // Natural Hebrew for arrays and sets
26680
+ const verb = issue.origin === "set" ? "צריכה" : "צריך";
26681
+ // Special case for singular (minimum === 1)
26682
+ if (issue.minimum === 1 && issue.inclusive) {
26683
+ const singularPhrase = issue.origin === "set" ? "לפחות פריט אחד" : "לפחות פריט אחד";
26684
+ return `קטן מדי: ${subject} ${verb} להכיל ${singularPhrase}`;
26685
+ }
26686
+ const comparison = issue.inclusive
26687
+ ? `${issue.minimum} ${sizing?.unit ?? ""} או יותר`
26688
+ : `יותר מ-${issue.minimum} ${sizing?.unit ?? ""}`;
26689
+ return `קטן מדי: ${subject} ${verb} להכיל ${comparison}`.trim();
26690
+ }
26691
+ const adj = issue.inclusive ? ">=" : ">";
26692
+ const be = verbFor(issue.origin ?? "value");
26693
+ if (sizing?.unit) {
26694
+ return `${sizing.shortLabel} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
26568
26695
  }
26569
- return `קטן מדי: ${issue.origin} צריך להיות ${adj}${issue.minimum.toString()}`;
26696
+ return `${sizing?.shortLabel ?? "קטן"} מדי: ${subject} ${be} ${adj}${issue.minimum.toString()}`;
26570
26697
  }
26571
26698
  case "invalid_format": {
26572
26699
  const _issue = issue;
26700
+ // These apply to strings — use feminine grammar + ה׳ הידיעה
26573
26701
  if (_issue.format === "starts_with")
26574
- return `מחרוזת לא תקינה: חייבת להתחיל ב"${_issue.prefix}"`;
26702
+ return `המחרוזת חייבת להתחיל ב "${_issue.prefix}"`;
26575
26703
  if (_issue.format === "ends_with")
26576
- return `מחרוזת לא תקינה: חייבת להסתיים ב "${_issue.suffix}"`;
26704
+ return `המחרוזת חייבת להסתיים ב "${_issue.suffix}"`;
26577
26705
  if (_issue.format === "includes")
26578
- return `מחרוזת לא תקינה: חייבת לכלול "${_issue.includes}"`;
26706
+ return `המחרוזת חייבת לכלול "${_issue.includes}"`;
26579
26707
  if (_issue.format === "regex")
26580
- return `מחרוזת לא תקינה: חייבת להתאים לתבנית ${_issue.pattern}`;
26581
- return `${Nouns[_issue.format] ?? issue.format} לא תקין`;
26708
+ return `המחרוזת חייבת להתאים לתבנית ${_issue.pattern}`;
26709
+ // Handle gender agreement for formats
26710
+ const nounEntry = Nouns[_issue.format];
26711
+ const noun = nounEntry?.label ?? _issue.format;
26712
+ const gender = nounEntry?.gender ?? "m";
26713
+ const adjective = gender === "f" ? "תקינה" : "תקין";
26714
+ return `${noun} לא ${adjective}`;
26582
26715
  }
26583
26716
  case "not_multiple_of":
26584
26717
  return `מספר לא תקין: חייב להיות מכפלה של ${issue.divisor}`;
26585
26718
  case "unrecognized_keys":
26586
26719
  return `מפתח${issue.keys.length > 1 ? "ות" : ""} לא מזוה${issue.keys.length > 1 ? "ים" : "ה"}: ${joinValues(issue.keys, ", ")}`;
26587
- case "invalid_key":
26588
- return `מפתח לא תקין ב${issue.origin}`;
26720
+ case "invalid_key": {
26721
+ return `שדה לא תקין באובייקט`;
26722
+ }
26589
26723
  case "invalid_union":
26590
26724
  return "קלט לא תקין";
26591
- case "invalid_element":
26592
- return `ערך לא תקין ב${issue.origin}`;
26725
+ case "invalid_element": {
26726
+ const place = withDefinite(issue.origin ?? "array");
26727
+ return `ערך לא תקין ב${place}`;
26728
+ }
26593
26729
  default:
26594
26730
  return `קלט לא תקין`;
26595
26731
  }
@@ -28017,10 +28153,10 @@ function ms$1 () {
28017
28153
 
28018
28154
  const error$l = () => {
28019
28155
  const Sizable = {
28020
- string: { unit: "tekens" },
28021
- file: { unit: "bytes" },
28022
- array: { unit: "elementen" },
28023
- set: { unit: "elementen" },
28156
+ string: { unit: "tekens", verb: "te hebben" },
28157
+ file: { unit: "bytes", verb: "te hebben" },
28158
+ array: { unit: "elementen", verb: "te hebben" },
28159
+ set: { unit: "elementen", verb: "te hebben" },
28024
28160
  };
28025
28161
  function getSizing(origin) {
28026
28162
  return Sizable[origin] ?? null;
@@ -28087,16 +28223,16 @@ const error$l = () => {
28087
28223
  const adj = issue.inclusive ? "<=" : "<";
28088
28224
  const sizing = getSizing(issue.origin);
28089
28225
  if (sizing)
28090
- return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"} bevat`;
28091
- return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
28226
+ return `Te groot: verwacht dat ${issue.origin ?? "waarde"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"}`;
28227
+ return `Te groot: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
28092
28228
  }
28093
28229
  case "too_small": {
28094
28230
  const adj = issue.inclusive ? ">=" : ">";
28095
28231
  const sizing = getSizing(issue.origin);
28096
28232
  if (sizing) {
28097
- return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} bevat`;
28233
+ return `Te klein: verwacht dat ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
28098
28234
  }
28099
- return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
28235
+ return `Te klein: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
28100
28236
  }
28101
28237
  case "invalid_format": {
28102
28238
  const _issue = issue;
@@ -30222,6 +30358,7 @@ var index$2 = /*#__PURE__*/Object.freeze({
30222
30358
  zhTW: zhTW
30223
30359
  });
30224
30360
 
30361
+ var _a$3;
30225
30362
  const $output = Symbol("ZodOutput");
30226
30363
  const $input = Symbol("ZodInput");
30227
30364
  class $ZodRegistry {
@@ -30273,7 +30410,8 @@ class $ZodRegistry {
30273
30410
  function registry() {
30274
30411
  return new $ZodRegistry();
30275
30412
  }
30276
- const globalRegistry = /*@__PURE__*/ registry();
30413
+ (_a$3 = globalThis).__zod_globalRegistry ?? (_a$3.__zod_globalRegistry = registry());
30414
+ const globalRegistry = globalThis.__zod_globalRegistry;
30277
30415
 
30278
30416
  function _string(Class, params) {
30279
30417
  return new Class({
@@ -30435,6 +30573,15 @@ function _ipv6(Class, params) {
30435
30573
  ...normalizeParams(params),
30436
30574
  });
30437
30575
  }
30576
+ function _mac(Class, params) {
30577
+ return new Class({
30578
+ type: "string",
30579
+ format: "mac",
30580
+ check: "string_format",
30581
+ abort: false,
30582
+ ...normalizeParams(params),
30583
+ });
30584
+ }
30438
30585
  function _cidrv4(Class, params) {
30439
30586
  return new Class({
30440
30587
  type: "string",
@@ -30875,6 +31022,10 @@ function _toLowerCase() {
30875
31022
  function _toUpperCase() {
30876
31023
  return _overwrite((input) => input.toUpperCase());
30877
31024
  }
31025
+ // slugify
31026
+ function _slugify() {
31027
+ return _overwrite((input) => slugify$1(input));
31028
+ }
30878
31029
  function _array(Class, element, params) {
30879
31030
  return new Class({
30880
31031
  type: "array",
@@ -31122,6 +31273,28 @@ function _check(fn, params) {
31122
31273
  ch._zod.check = fn;
31123
31274
  return ch;
31124
31275
  }
31276
+ function describe$1(description) {
31277
+ const ch = new $ZodCheck({ check: "describe" });
31278
+ ch._zod.onattach = [
31279
+ (inst) => {
31280
+ const existing = globalRegistry.get(inst) ?? {};
31281
+ globalRegistry.add(inst, { ...existing, description });
31282
+ },
31283
+ ];
31284
+ ch._zod.check = () => { }; // no-op check
31285
+ return ch;
31286
+ }
31287
+ function meta$1(metadata) {
31288
+ const ch = new $ZodCheck({ check: "meta" });
31289
+ ch._zod.onattach = [
31290
+ (inst) => {
31291
+ const existing = globalRegistry.get(inst) ?? {};
31292
+ globalRegistry.add(inst, { ...existing, ...metadata });
31293
+ },
31294
+ ];
31295
+ ch._zod.check = () => { }; // no-op check
31296
+ return ch;
31297
+ }
31125
31298
  function _stringbool(Classes, _params) {
31126
31299
  const params = normalizeParams(_params);
31127
31300
  let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
@@ -31440,11 +31613,19 @@ class JSONSchemaGenerator {
31440
31613
  }
31441
31614
  case "union": {
31442
31615
  const json = _json;
31616
+ // Discriminated unions use oneOf (exactly one match) instead of anyOf (one or more matches)
31617
+ // because the discriminator field ensures mutual exclusivity between options in JSON Schema
31618
+ const isDiscriminated = def.discriminator !== undefined;
31443
31619
  const options = def.options.map((x, i) => this.process(x, {
31444
31620
  ...params,
31445
- path: [...params.path, "anyOf", i],
31621
+ path: [...params.path, isDiscriminated ? "oneOf" : "anyOf", i],
31446
31622
  }));
31447
- json.anyOf = options;
31623
+ if (isDiscriminated) {
31624
+ json.oneOf = options;
31625
+ }
31626
+ else {
31627
+ json.anyOf = options;
31628
+ }
31448
31629
  break;
31449
31630
  }
31450
31631
  case "intersection": {
@@ -31997,100 +32178,57 @@ function isTransforming(_schema, _ctx) {
31997
32178
  if (ctx.seen.has(_schema))
31998
32179
  return false;
31999
32180
  ctx.seen.add(_schema);
32000
- const schema = _schema;
32001
- const def = schema._zod.def;
32002
- switch (def.type) {
32003
- case "string":
32004
- case "number":
32005
- case "bigint":
32006
- case "boolean":
32007
- case "date":
32008
- case "symbol":
32009
- case "undefined":
32010
- case "null":
32011
- case "any":
32012
- case "unknown":
32013
- case "never":
32014
- case "void":
32015
- case "literal":
32016
- case "enum":
32017
- case "nan":
32018
- case "file":
32019
- case "template_literal":
32020
- return false;
32021
- case "array": {
32022
- return isTransforming(def.element, ctx);
32023
- }
32024
- case "object": {
32025
- for (const key in def.shape) {
32026
- if (isTransforming(def.shape[key], ctx))
32027
- return true;
32028
- }
32029
- return false;
32030
- }
32031
- case "union": {
32032
- for (const option of def.options) {
32033
- if (isTransforming(option, ctx))
32034
- return true;
32035
- }
32036
- return false;
32037
- }
32038
- case "intersection": {
32039
- return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
32040
- }
32041
- case "tuple": {
32042
- for (const item of def.items) {
32043
- if (isTransforming(item, ctx))
32044
- return true;
32045
- }
32046
- if (def.rest && isTransforming(def.rest, ctx))
32181
+ const def = _schema._zod.def;
32182
+ if (def.type === "transform")
32183
+ return true;
32184
+ if (def.type === "array")
32185
+ return isTransforming(def.element, ctx);
32186
+ if (def.type === "set")
32187
+ return isTransforming(def.valueType, ctx);
32188
+ if (def.type === "lazy")
32189
+ return isTransforming(def.getter(), ctx);
32190
+ if (def.type === "promise" ||
32191
+ def.type === "optional" ||
32192
+ def.type === "nonoptional" ||
32193
+ def.type === "nullable" ||
32194
+ def.type === "readonly" ||
32195
+ def.type === "default" ||
32196
+ def.type === "prefault") {
32197
+ return isTransforming(def.innerType, ctx);
32198
+ }
32199
+ if (def.type === "intersection") {
32200
+ return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
32201
+ }
32202
+ if (def.type === "record" || def.type === "map") {
32203
+ return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
32204
+ }
32205
+ if (def.type === "pipe") {
32206
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
32207
+ }
32208
+ if (def.type === "object") {
32209
+ for (const key in def.shape) {
32210
+ if (isTransforming(def.shape[key], ctx))
32047
32211
  return true;
32048
- return false;
32049
- }
32050
- case "record": {
32051
- return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
32052
- }
32053
- case "map": {
32054
- return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
32055
- }
32056
- case "set": {
32057
- return isTransforming(def.valueType, ctx);
32058
32212
  }
32059
- // inner types
32060
- case "promise":
32061
- case "optional":
32062
- case "nonoptional":
32063
- case "nullable":
32064
- case "readonly":
32065
- return isTransforming(def.innerType, ctx);
32066
- case "lazy":
32067
- return isTransforming(def.getter(), ctx);
32068
- case "default": {
32069
- return isTransforming(def.innerType, ctx);
32070
- }
32071
- case "prefault": {
32072
- return isTransforming(def.innerType, ctx);
32213
+ return false;
32214
+ }
32215
+ if (def.type === "union") {
32216
+ for (const option of def.options) {
32217
+ if (isTransforming(option, ctx))
32218
+ return true;
32073
32219
  }
32074
- case "custom": {
32075
- return false;
32220
+ return false;
32221
+ }
32222
+ if (def.type === "tuple") {
32223
+ for (const item of def.items) {
32224
+ if (isTransforming(item, ctx))
32225
+ return true;
32076
32226
  }
32077
- case "transform": {
32227
+ if (def.rest && isTransforming(def.rest, ctx))
32078
32228
  return true;
32079
- }
32080
- case "pipe": {
32081
- return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
32082
- }
32083
- case "success": {
32084
- return false;
32085
- }
32086
- case "catch": {
32087
- return false;
32088
- }
32089
- case "function": {
32090
- return false;
32091
- }
32229
+ return false;
32092
32230
  }
32093
- throw new Error(`Unknown schema type: ${def.type}`);
32231
+ return false;
32094
32232
  }
32095
32233
 
32096
32234
  var jsonSchema = /*#__PURE__*/Object.freeze({
@@ -32160,6 +32298,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
32160
32298
  $ZodKSUID: $ZodKSUID,
32161
32299
  $ZodLazy: $ZodLazy,
32162
32300
  $ZodLiteral: $ZodLiteral,
32301
+ $ZodMAC: $ZodMAC,
32163
32302
  $ZodMap: $ZodMap,
32164
32303
  $ZodNaN: $ZodNaN,
32165
32304
  $ZodNanoID: $ZodNanoID,
@@ -32260,6 +32399,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
32260
32399
  _lowercase: _lowercase,
32261
32400
  _lt: _lt,
32262
32401
  _lte: _lte,
32402
+ _mac: _mac,
32263
32403
  _map: _map,
32264
32404
  _max: _lte,
32265
32405
  _maxLength: _maxLength,
@@ -32301,6 +32441,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
32301
32441
  _safeParseAsync: _safeParseAsync,
32302
32442
  _set: _set,
32303
32443
  _size: _size,
32444
+ _slugify: _slugify,
32304
32445
  _startsWith: _startsWith,
32305
32446
  _string: _string,
32306
32447
  _stringFormat: _stringFormat,
@@ -32332,6 +32473,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
32332
32473
  config: config$2,
32333
32474
  decode: decode$3,
32334
32475
  decodeAsync: decodeAsync$1,
32476
+ describe: describe$1,
32335
32477
  encode: encode$2,
32336
32478
  encodeAsync: encodeAsync$1,
32337
32479
  flattenError: flattenError,
@@ -32342,6 +32484,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
32342
32484
  isValidBase64URL: isValidBase64URL,
32343
32485
  isValidJWT: isValidJWT,
32344
32486
  locales: index$2,
32487
+ meta: meta$1,
32345
32488
  parse: parse$3,
32346
32489
  parseAsync: parseAsync$1,
32347
32490
  prettifyError: prettifyError,
@@ -32564,6 +32707,7 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
32564
32707
  inst.normalize = (...args) => inst.check(_normalize(...args));
32565
32708
  inst.toLowerCase = () => inst.check(_toLowerCase());
32566
32709
  inst.toUpperCase = () => inst.check(_toUpperCase());
32710
+ inst.slugify = () => inst.check(_slugify());
32567
32711
  });
32568
32712
  const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
32569
32713
  $ZodString.init(inst, def);
@@ -32718,6 +32862,14 @@ const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
32718
32862
  function ipv4$1(params) {
32719
32863
  return _ipv4(ZodIPv4, params);
32720
32864
  }
32865
+ const ZodMAC = /*@__PURE__*/ $constructor("ZodMAC", (inst, def) => {
32866
+ // ZodStringFormat.init(inst, def);
32867
+ $ZodMAC.init(inst, def);
32868
+ ZodStringFormat.init(inst, def);
32869
+ });
32870
+ function mac(params) {
32871
+ return _mac(ZodMAC, params);
32872
+ }
32721
32873
  const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
32722
32874
  // ZodStringFormat.init(inst, def);
32723
32875
  $ZodIPv6.init(inst, def);
@@ -33459,6 +33611,9 @@ function refine$1(fn, _params = {}) {
33459
33611
  function superRefine(fn) {
33460
33612
  return _superRefine(fn);
33461
33613
  }
33614
+ // Re-export describe and meta from core
33615
+ const describe = describe$1;
33616
+ const meta = meta$1;
33462
33617
  function _instanceof(cls, params = {
33463
33618
  error: `Input not instance of ${cls.name}`,
33464
33619
  }) {
@@ -33593,6 +33748,7 @@ var z = /*#__PURE__*/Object.freeze({
33593
33748
  ZodKSUID: ZodKSUID,
33594
33749
  ZodLazy: ZodLazy,
33595
33750
  ZodLiteral: ZodLiteral,
33751
+ ZodMAC: ZodMAC,
33596
33752
  ZodMap: ZodMap,
33597
33753
  ZodNaN: ZodNaN,
33598
33754
  ZodNanoID: ZodNanoID,
@@ -33651,6 +33807,7 @@ var z = /*#__PURE__*/Object.freeze({
33651
33807
  date: date$1,
33652
33808
  decode: decode$2,
33653
33809
  decodeAsync: decodeAsync,
33810
+ describe: describe,
33654
33811
  discriminatedUnion: discriminatedUnion,
33655
33812
  e164: e164,
33656
33813
  email: email,
@@ -33695,9 +33852,11 @@ var z = /*#__PURE__*/Object.freeze({
33695
33852
  lowercase: _lowercase,
33696
33853
  lt: _lt,
33697
33854
  lte: _lte,
33855
+ mac: mac,
33698
33856
  map: map$3,
33699
33857
  maxLength: _maxLength,
33700
33858
  maxSize: _maxSize,
33859
+ meta: meta,
33701
33860
  mime: _mime,
33702
33861
  minLength: _minLength,
33703
33862
  minSize: _minSize,
@@ -33743,6 +33902,7 @@ var z = /*#__PURE__*/Object.freeze({
33743
33902
  set: set$1,
33744
33903
  setErrorMap: setErrorMap,
33745
33904
  size: _size,
33905
+ slugify: _slugify,
33746
33906
  startsWith: _startsWith,
33747
33907
  strictObject: strictObject,
33748
33908
  string: string$2,
@@ -67402,7 +67562,7 @@ function zodAsFactory(zod, name) {
67402
67562
  function asFunc(value, assert) {
67403
67563
  const result = zod.safeParse(value);
67404
67564
  if (result.success) {
67405
- return result.data;
67565
+ return value;
67406
67566
  }
67407
67567
  if (assert !== void 0) {
67408
67568
  let assertConfig;
@@ -67437,10 +67597,59 @@ function zodAsFactory(zod, name) {
67437
67597
  function zodIsFactory(zod) {
67438
67598
  return (value) => zod.safeParse(value).success;
67439
67599
  }
67440
-
67441
- // src/zodToFactory.ts
67442
67600
  function zodToFactory(zod, name) {
67443
- return zodAsFactory(zod, name);
67601
+ const as = zodAsFactory(zod, name);
67602
+ function toFunc(value, assert) {
67603
+ if (isDefined(assert)) {
67604
+ return as(value, assert);
67605
+ }
67606
+ return as(value);
67607
+ }
67608
+ return toFunc;
67609
+ }
67610
+ function zodAsAsyncFactory(zod, name) {
67611
+ async function asFunc(value, assert) {
67612
+ const result = await zod.safeParseAsync(value);
67613
+ if (result.success) {
67614
+ return value;
67615
+ }
67616
+ if (assert !== void 0) {
67617
+ let assertConfig;
67618
+ switch (typeof assert) {
67619
+ case "string": {
67620
+ assertConfig = `[${name}][${value}] ${assert}`;
67621
+ break;
67622
+ }
67623
+ case "object": {
67624
+ assertConfig = `[${name}][${assert.name}][${value}] ${result.error.message}`;
67625
+ break;
67626
+ }
67627
+ case "boolean": {
67628
+ assertConfig = `[${name}][${value}] ${result.error.message}`;
67629
+ break;
67630
+ }
67631
+ case "function": {
67632
+ assertConfig = assert(value, result.error.message);
67633
+ break;
67634
+ }
67635
+ default: {
67636
+ assertConfig = true;
67637
+ }
67638
+ }
67639
+ return assertError(value, assertConfig, result.error.message);
67640
+ }
67641
+ }
67642
+ return asFunc;
67643
+ }
67644
+ function zodToAsyncFactory(zod, name) {
67645
+ const as = zodAsAsyncFactory(zod, name);
67646
+ async function toFunc(value, assert) {
67647
+ if (isDefined(assert)) {
67648
+ return await as(value, assert);
67649
+ }
67650
+ return await as(value);
67651
+ }
67652
+ return toFunc;
67444
67653
  }
67445
67654
 
67446
67655
  var object_model_star = /*#__PURE__*/Object.freeze({
@@ -71319,7 +71528,7 @@ function WithHashMetaZod(valueZod) {
71319
71528
  }
71320
71529
  var PayloadZodStrict = z.strictObject({ schema: SchemaZod });
71321
71530
  var PayloadZodLoose = z.looseObject({ schema: SchemaZod });
71322
- var PayloadZodOfSchema$1 = (schema) => PayloadZod.extend({ schema: z.literal(schema) });
71531
+ var PayloadZodOfSchema = (schema) => PayloadZod.extend({ schema: z.literal(schema) });
71323
71532
  var PayloadZodStrictOfSchema = (schema) => PayloadZodStrict.extend({ schema: z.literal(schema) });
71324
71533
  var PayloadZodLooseOfSchema = (schema) => PayloadZodLoose.extend({ schema: z.literal(schema) });
71325
71534
 
@@ -71329,7 +71538,7 @@ var PayloadBundleFieldsZod = z.object({
71329
71538
  payloads: PayloadZodLoose.array(),
71330
71539
  root: HashZod
71331
71540
  });
71332
- PayloadZodOfSchema$1(PayloadBundleSchema).extend(PayloadBundleFieldsZod.shape);
71541
+ PayloadZodOfSchema(PayloadBundleSchema).extend(PayloadBundleFieldsZod.shape);
71333
71542
 
71334
71543
  // src/Builder.ts
71335
71544
  var omitSchema = (payload) => {
@@ -73639,20 +73848,6 @@ var isExecutable = (value) => {
73639
73848
  var HashSchema = "network.xyo.hash";
73640
73849
  var isHashPayload = isPayloadOfSchemaType(HashSchema);
73641
73850
  var StepCompleteSchema = "network.xyo.chain.step.complete";
73642
- var TransferSchema = "network.xyo.transfer";
73643
- var TransferFieldsZod = z.object({
73644
- $opCodes: z.array(z.string()).optional(),
73645
- context: JsonObjectZod.optional(),
73646
- epoch: z.number(),
73647
- from: AddressZod,
73648
- transfers: z.record(AddressZod, HexZod)
73649
- });
73650
- var PayloadZodOfSchema = (schema) => PayloadZod.extend({ schema: z.literal(schema) });
73651
- var TransferZod = PayloadZodOfSchema(TransferSchema).extend(TransferFieldsZod.shape);
73652
- var isTransfer = isPayloadOfSchemaType(TransferSchema);
73653
- var asTransfer = AsObjectFactory.create(isTransfer);
73654
-
73655
- // src/payload/elevatable/Time.ts
73656
73851
  var TimeSchema = "network.xyo.time";
73657
73852
  var XL1TimeFieldsZod = z.object({
73658
73853
  // block number
@@ -73679,6 +73874,17 @@ var isTimePayload = (value) => {
73679
73874
  return isPayloadOfSchemaType(TimeSchema)(value) && isSafeEpoch(value.epoch);
73680
73875
  };
73681
73876
  var asTimePayload = AsObjectFactory.create(isTimePayload);
73877
+ var TransferSchema = "network.xyo.transfer";
73878
+ var TransferFieldsZod = z.object({
73879
+ $opCodes: z.array(z.string()).optional(),
73880
+ context: JsonObjectZod.optional(),
73881
+ epoch: z.number(),
73882
+ from: AddressZod,
73883
+ transfers: z.record(AddressZod, HexZod)
73884
+ });
73885
+ var TransferZod = PayloadZodOfSchema(TransferSchema).extend(TransferFieldsZod.shape);
73886
+ var isTransfer = isPayloadOfSchemaType(TransferSchema);
73887
+ var asTransfer = AsObjectFactory.create(isTransfer);
73682
73888
  var NumberishZod = z.union([z.number(), z.string(), z.bigint()]).transform((v) => typeof v === "bigint" ? Number(v) : typeof v === "string" ? Number(v) : v).pipe(z.number());
73683
73889
 
73684
73890
  // src/model/BlockNumber/BlockNumber.ts
@@ -73741,7 +73947,7 @@ var JsonToArrayBufferZod = string$2().transform((x) => {
73741
73947
  });
73742
73948
  var ChainZod = string$2().toLowerCase().regex(AddressRegEx).transform((v) => toAddress(v));
73743
73949
 
73744
- // src/zod/BlockBoundWitness.ts
73950
+ // src/zod/block/BlockBoundWitness.ts
73745
73951
  var BlockBoundWitnessFieldsZod = object$3({
73746
73952
  block: XL1BlockNumberZod,
73747
73953
  chain: ChainZod,
@@ -73758,19 +73964,36 @@ var isBlockBoundWitnessWithHashMeta = zodIsFactory(BlockBoundWitnessWithHashMeta
73758
73964
  var asBlockBoundWitnessWithHashMeta = zodAsFactory(BlockBoundWitnessWithHashMetaZod, "asBlockBoundWitnessWithHashMeta");
73759
73965
  var BlockBoundWitnessWithStorageMetaZod = BlockBoundWitnessZod.safeExtend(StorageMetaZod.shape);
73760
73966
  var asBlockBoundWitnessWithStorageMeta = zodAsFactory(BlockBoundWitnessWithStorageMetaZod, "asBlockBoundWitnessWithStorageMeta");
73761
- var UnsignedBlockBoundWitnessZod = UnsignedBoundWitnessZod.safeExtend(BlockBoundWitnessFieldsZod.shape).safeExtend(BlockBoundWitnessMetaZod.shape);
73762
- UnsignedBlockBoundWitnessZod.safeExtend(HashMetaZod.shape);
73763
- UnsignedBlockBoundWitnessZod.safeExtend(StorageMetaZod.shape);
73764
73967
  var SignedBlockBoundWitnessZod = SignedBoundWitnessZod.safeExtend(BlockBoundWitnessFieldsZod.shape).safeExtend(BlockBoundWitnessMetaZod.shape);
73968
+ var isSignedBlockBoundWitness = zodIsFactory(SignedBlockBoundWitnessZod);
73765
73969
  var asSignedBlockBoundWitness = zodAsFactory(SignedBlockBoundWitnessZod, "asSignedBlockBoundWitness");
73766
73970
  var SignedBlockBoundWitnessWithHashMetaZod = SignedBlockBoundWitnessZod.safeExtend(HashMetaZod.shape);
73767
73971
  var isSignedBlockBoundWitnessWithHashMeta = zodIsFactory(SignedBlockBoundWitnessWithHashMetaZod);
73972
+ SignedBlockBoundWitnessZod.transform(async (data) => {
73973
+ if (isSignedBlockBoundWitnessWithHashMeta(data)) {
73974
+ return data;
73975
+ }
73976
+ if (isSignedBlockBoundWitness(data)) {
73977
+ return await PayloadBuilder.addHashMeta(data);
73978
+ }
73979
+ throw new Error("Invalid SignedBlockBoundWitnessWithHashMetaish format");
73980
+ });
73768
73981
  var SignedBlockBoundWitnessWithStorageMetaZod = SignedBlockBoundWitnessZod.safeExtend(StorageMetaZod.shape);
73769
73982
  var isSignedBlockBoundWitnessWithStorageMeta = zodIsFactory(SignedBlockBoundWitnessWithStorageMetaZod);
73770
73983
  var asSignedBlockBoundWitnessWithStorageMeta = zodAsFactory(
73771
73984
  SignedBlockBoundWitnessWithStorageMetaZod,
73772
73985
  "asSignedBlockBoundWitnessWithStorageMeta"
73773
73986
  );
73987
+ SignedBlockBoundWitnessZod.transform(async (data) => {
73988
+ if (isSignedBlockBoundWitnessWithStorageMeta(data)) {
73989
+ return data;
73990
+ }
73991
+ if (isSignedBlockBoundWitness(data)) {
73992
+ return await PayloadBuilder.addStorageMeta(data);
73993
+ }
73994
+ throw new Error("Invalid SignedBlockBoundWitnessWithStorageMetaish format");
73995
+ });
73996
+ UnsignedBoundWitnessZod.safeExtend(BlockBoundWitnessFieldsZod.shape).safeExtend(BlockBoundWitnessMetaZod.shape);
73774
73997
  tuple([
73775
73998
  BlockBoundWitnessZod,
73776
73999
  array$1(PayloadZodLoose)
@@ -73787,6 +74010,7 @@ var SignedHydratedBlockZod = tuple([
73787
74010
  SignedBlockBoundWitnessZod,
73788
74011
  array$1(PayloadZodLoose)
73789
74012
  ]);
74013
+ var isSignedHydratedBlock = zodIsFactory(SignedHydratedBlockZod);
73790
74014
  tuple([
73791
74015
  SignedBlockBoundWitnessZod,
73792
74016
  array$1(PayloadZodLoose)
@@ -73795,11 +74019,20 @@ var SignedHydratedBlockWithHashMetaZod = tuple([
73795
74019
  WithHashMetaZod(SignedBlockBoundWitnessZod),
73796
74020
  array$1(WithHashMetaZod(PayloadZodLoose))
73797
74021
  ]);
74022
+ tuple([
74023
+ union$1([WithHashMetaZod(SignedBlockBoundWitnessZod)]),
74024
+ array$1(WithHashMetaZod(PayloadZodLoose))
74025
+ ]);
74026
+ var isSignedHydratedBlockWithHashMeta = zodIsFactory(SignedHydratedBlockWithHashMetaZod);
73798
74027
  var asSignedHydratedBlockWithHashMeta = zodAsFactory(SignedHydratedBlockWithHashMetaZod, "asSignedHydratedBlockWithHashMeta");
73799
74028
  tuple([
73800
74029
  WithStorageMetaZod(SignedBlockBoundWitnessZod),
73801
74030
  array$1(WithStorageMetaZod(PayloadZodLoose))
73802
74031
  ]);
74032
+ tuple([
74033
+ union$1([WithStorageMetaZod(SignedBlockBoundWitnessZod)]),
74034
+ array$1(WithStorageMetaZod(PayloadZodLoose))
74035
+ ]);
73803
74036
  var AttoZod = bigint$1();
73804
74037
  var JsonToAttoZod = JsonToBigIntZod.transform((v) => asAttoXL1(v));
73805
74038
  var AttoToJsonZod = BigIntToJsonZod;
@@ -73890,6 +74123,28 @@ tuple([
73890
74123
  WithStorageMetaZod(SignedTransactionBoundWitnessZod),
73891
74124
  array$1(WithStorageMetaZod(PayloadZodLoose))
73892
74125
  ]);
74126
+ var WithHashMetaishZod = PayloadZodLoose.transform(async (data) => {
74127
+ if (isAnyPayload(data)) {
74128
+ if (isHashMeta(data)) {
74129
+ return data;
74130
+ }
74131
+ return await PayloadBuilder.addHashMeta(data);
74132
+ }
74133
+ throw new Error("Invalid WithHashMetaish format");
74134
+ });
74135
+ var toWithHashMeta = zodToAsyncFactory(
74136
+ WithHashMetaishZod,
74137
+ "toWithHashMeta"
74138
+ );
74139
+ PayloadZodLoose.transform(async (data) => {
74140
+ if (isAnyPayload(data)) {
74141
+ if (isStorageMeta(data)) {
74142
+ return data;
74143
+ }
74144
+ return await PayloadBuilder.addStorageMeta(data);
74145
+ }
74146
+ throw new Error("Invalid WithStorageMetaish format");
74147
+ });
73893
74148
  var CaveatTypesZod = _enum$1(["chain", "expiration", "filteredResponse", "rateLimit", "restrictReturnedAccounts"]);
73894
74149
  var CaveatsZod = object$3({
73895
74150
  type: CaveatTypesZod,
@@ -365289,6 +365544,19 @@ var JsonRpcTimeSyncViewerMethods = class {
365289
365544
  super(transport);
365290
365545
  }
365291
365546
  });
365547
+ async function fixSignedHydratedBlockWithHashMeta(block) {
365548
+ if (isSignedHydratedBlockWithHashMeta(block)) {
365549
+ return block;
365550
+ }
365551
+ if (isSignedHydratedBlock(block)) {
365552
+ return [
365553
+ await toWithHashMeta(block[0], true),
365554
+ await Promise.all(block[1].map((p) => toWithHashMeta(p, true)))
365555
+ ];
365556
+ }
365557
+ throw new Error("Invalid block format");
365558
+ }
365559
+ __name$5(fixSignedHydratedBlockWithHashMeta, "fixSignedHydratedBlockWithHashMeta");
365292
365560
  var JsonRpcXyoViewer = class {
365293
365561
  static {
365294
365562
  __name$5(this, "JsonRpcXyoViewer");
@@ -365343,20 +365611,22 @@ var JsonRpcXyoViewer = class {
365343
365611
  throw new Error("Method not implemented.");
365344
365612
  }
365345
365613
  async blockByHash(hash) {
365346
- return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByHash", [
365614
+ const returned = await this.transport.sendRequest("xyoViewer_blockByHash", [
365347
365615
  hash
365348
- ])) ?? null;
365616
+ ]);
365617
+ return returned === null ? null : fixSignedHydratedBlockWithHashMeta(returned);
365349
365618
  }
365350
365619
  async blockByNumber(blockNumber) {
365351
- return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByNumber", [
365620
+ const returned = asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_blockByNumber", [
365352
365621
  blockNumber
365353
365622
  ])) ?? null;
365623
+ return returned === null ? null : fixSignedHydratedBlockWithHashMeta(returned);
365354
365624
  }
365355
365625
  async blocksByHash(hash, limit) {
365356
- return (await this.transport.sendRequest("xyoViewer_blocksByHash", [
365626
+ return await Promise.all((await this.transport.sendRequest("xyoViewer_blocksByHash", [
365357
365627
  hash,
365358
365628
  limit
365359
- ])).map((b) => asSignedHydratedBlockWithHashMeta(b, true));
365629
+ ])).map((b) => fixSignedHydratedBlockWithHashMeta(b)));
365360
365630
  }
365361
365631
  async chainId() {
365362
365632
  return await this.transport.sendRequest("xyoViewer_chainId");
@@ -365367,7 +365637,8 @@ var JsonRpcXyoViewer = class {
365367
365637
  ]);
365368
365638
  }
365369
365639
  async currentBlock() {
365370
- return asSignedHydratedBlockWithHashMeta(await this.transport.sendRequest("xyoViewer_currentBlock"), true);
365640
+ const result = await this.transport.sendRequest("xyoViewer_currentBlock");
365641
+ return fixSignedHydratedBlockWithHashMeta(result);
365371
365642
  }
365372
365643
  async currentBlockHash() {
365373
365644
  return await this.transport.sendRequest("xyoViewer_currentBlockHash");
@@ -376153,7 +376424,7 @@ var waitForHostPort = /* @__PURE__ */ __name((host, port) => {
376153
376424
 
376154
376425
  // src/runCLI.ts
376155
376426
  var configuration;
376156
- var version = isDefined("1.16.24") ? "1.16.24" : "unknown";
376427
+ var version = isDefined("1.16.25") ? "1.16.25" : "unknown";
376157
376428
  var getContextFromConfig = /* @__PURE__ */ __name((configuration2) => {
376158
376429
  const logger = initLogger(configuration2);
376159
376430
  const orchestrator = new Orchestrator(logger);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/xl1-cli",
3
- "version": "1.16.25",
3
+ "version": "1.16.26",
4
4
  "description": "XYO Layer One CLI",
5
5
  "homepage": "https://xylabs.com",
6
6
  "bugs": {
@@ -62,11 +62,11 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@rollup/plugin-node-resolve": "^16.0.3",
65
- "@xylabs/sdk-js": "~5.0.42",
66
- "@xylabs/telemetry": "~5.0.42",
65
+ "@xylabs/sdk-js": "~5.0.46",
66
+ "@xylabs/telemetry": "~5.0.46",
67
67
  "@xylabs/ts-scripts-yarn3": "~7.2.8",
68
68
  "@xylabs/tsconfig": "~7.2.8",
69
- "@xylabs/vitest-extended": "~5.0.42",
69
+ "@xylabs/vitest-extended": "~5.0.46",
70
70
  "@xyo-network/account-model": "~5.2.10",
71
71
  "@xyo-network/archivist-lmdb": "~5.2.10",
72
72
  "@xyo-network/archivist-memory": "~5.2.10",
@@ -75,8 +75,8 @@
75
75
  "@xyo-network/payload-model": "~5.2.10",
76
76
  "@xyo-network/wallet": "~5.2.10",
77
77
  "@xyo-network/wallet-model": "~5.2.10",
78
- "@xyo-network/xl1-cli-lib": "~1.16.25",
79
- "@xyo-network/xl1-protocol": "~1.14.13",
78
+ "@xyo-network/xl1-cli-lib": "~1.16.26",
79
+ "@xyo-network/xl1-protocol": "~1.14.15",
80
80
  "async-mutex": "~0.5.0",
81
81
  "dotenv": "~17.2.3",
82
82
  "eslint": "^9.39.1",
@@ -88,7 +88,7 @@
88
88
  "vitest": "~4.0.13",
89
89
  "vitest-mock-extended": "~3.1.0",
90
90
  "yargs": "~18.0.0",
91
- "zod": "~4.1.12"
91
+ "zod": "~4.1.13"
92
92
  },
93
93
  "peerDependencies": {
94
94
  "typescript": "~5"