@pi-oxide/extension-js 0.9.1 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. package/content-script.js +2 -2
  2. package/extension_js.js +63532 -63088
  3. package/index.js +1536 -1439
  4. package/package.json +1 -1
  5. package/worker.js +189 -172
package/worker.js CHANGED
@@ -1,4 +1,4 @@
1
- import Xt, { setLogLevel as Je, ExtensionSession as er, registerJsCallBatch as tr, takeCachedVfsWriteBase64 as rr, clearVfsWriteCache as nr } from "./extension_js.js";
1
+ import Xt, { setLogLevel as Ye, ExtensionSession as er, registerJsCallBatch as tr, takeCachedVfsWriteBase64 as rr, clearVfsWriteCache as nr } from "./extension_js.js";
2
2
  const $e = {
3
3
  trace: 0,
4
4
  debug: 1,
@@ -18,12 +18,12 @@ function ir(t) {
18
18
  const e = Math.max(0, Math.min(5, Math.round(t)));
19
19
  return sr[e] ?? "error";
20
20
  }
21
- let dt = "trace", Ye = null;
21
+ let dt = "trace", Ke = null;
22
22
  function ar(t) {
23
- dt = t, Ye && Ye($e[t]);
23
+ dt = t, Ke && Ke($e[t]);
24
24
  }
25
25
  function or(t) {
26
- Ye = t, t($e[dt]);
26
+ Ke = t, t($e[dt]);
27
27
  }
28
28
  function cr(t) {
29
29
  return $e[t] >= $e[dt];
@@ -350,7 +350,7 @@ class j extends Error {
350
350
  }
351
351
  }
352
352
  j.create = (t) => new j(t);
353
- const we = (t, e) => {
353
+ const Te = (t, e) => {
354
354
  let r;
355
355
  switch (t.code) {
356
356
  case u.invalid_type:
@@ -406,11 +406,11 @@ const we = (t, e) => {
406
406
  }
407
407
  return { message: r };
408
408
  };
409
- let fr = we;
410
- function Ke() {
409
+ let fr = Te;
410
+ function Qe() {
411
411
  return fr;
412
412
  }
413
- const Qe = (t) => {
413
+ const Xe = (t) => {
414
414
  const { data: e, path: r, errorMaps: n, issueData: s } = t, i = [...r, ...s.path || []], o = {
415
415
  ...s,
416
416
  path: i
@@ -432,7 +432,7 @@ const Qe = (t) => {
432
432
  };
433
433
  };
434
434
  function p(t, e) {
435
- const r = Ke(), n = Qe({
435
+ const r = Qe(), n = Xe({
436
436
  issueData: e,
437
437
  data: t.data,
438
438
  path: t.path,
@@ -443,13 +443,13 @@ function p(t, e) {
443
443
  // then schema-bound map if available
444
444
  r,
445
445
  // then global override map
446
- r === we ? void 0 : we
446
+ r === Te ? void 0 : Te
447
447
  // then global default map
448
448
  ].filter((s) => !!s)
449
449
  });
450
450
  t.common.issues.push(n);
451
451
  }
452
- class P {
452
+ class $ {
453
453
  constructor() {
454
454
  this.value = "valid";
455
455
  }
@@ -477,7 +477,7 @@ class P {
477
477
  value: o
478
478
  });
479
479
  }
480
- return P.mergeObjectSync(e, n);
480
+ return $.mergeObjectSync(e, n);
481
481
  }
482
482
  static mergeObjectSync(e, r) {
483
483
  const n = {};
@@ -492,7 +492,7 @@ class P {
492
492
  }
493
493
  const v = Object.freeze({
494
494
  status: "aborted"
495
- }), _e = (t) => ({ status: "dirty", value: t }), L = (t) => ({ status: "valid", value: t }), vt = (t) => t.status === "aborted", kt = (t) => t.status === "dirty", me = (t) => t.status === "valid", Pe = (t) => typeof Promise < "u" && t instanceof Promise;
495
+ }), _e = (t) => ({ status: "dirty", value: t }), L = (t) => ({ status: "valid", value: t }), vt = (t) => t.status === "aborted", kt = (t) => t.status === "dirty", me = (t) => t.status === "valid", Le = (t) => typeof Promise < "u" && t instanceof Promise;
496
496
  var y;
497
497
  (function(t) {
498
498
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
@@ -550,7 +550,7 @@ class S {
550
550
  }
551
551
  _processInputParams(e) {
552
552
  return {
553
- status: new P(),
553
+ status: new $(),
554
554
  ctx: {
555
555
  common: e.parent.common,
556
556
  data: e.data,
@@ -563,7 +563,7 @@ class S {
563
563
  }
564
564
  _parseSync(e) {
565
565
  const r = this._parse(e);
566
- if (Pe(r))
566
+ if (Le(r))
567
567
  throw new Error("Synchronous parse encountered promise.");
568
568
  return r;
569
569
  }
@@ -643,7 +643,7 @@ class S {
643
643
  parent: null,
644
644
  data: e,
645
645
  parsedType: ee(e)
646
- }, s = this._parse({ data: e, path: n.path, parent: n }), i = await (Pe(s) ? s : Promise.resolve(s));
646
+ }, s = this._parse({ data: e, path: n.path, parent: n }), i = await (Le(s) ? s : Promise.resolve(s));
647
647
  return wt(n, i);
648
648
  }
649
649
  refine(e, r) {
@@ -692,10 +692,10 @@ class S {
692
692
  return ye.create(this, this._def);
693
693
  }
694
694
  or(e) {
695
- return Se.create([this, e], this._def);
695
+ return Ie.create([this, e], this._def);
696
696
  }
697
697
  and(e) {
698
- return Ie.create(this, e, this._def);
698
+ return Ee.create(this, e, this._def);
699
699
  }
700
700
  transform(e) {
701
701
  return new J({
@@ -707,7 +707,7 @@ class S {
707
707
  }
708
708
  default(e) {
709
709
  const r = typeof e == "function" ? e : () => e;
710
- return new Ae({
710
+ return new Ce({
711
711
  ...w(this._def),
712
712
  innerType: this,
713
713
  defaultValue: r,
@@ -723,7 +723,7 @@ class S {
723
723
  }
724
724
  catch(e) {
725
725
  const r = typeof e == "function" ? e : () => e;
726
- return new Ce({
726
+ return new Oe({
727
727
  ...w(this._def),
728
728
  innerType: this,
729
729
  catchValue: r,
@@ -738,10 +738,10 @@ class S {
738
738
  });
739
739
  }
740
740
  pipe(e) {
741
- return ze.create(this, e);
741
+ return qe.create(this, e);
742
742
  }
743
743
  readonly() {
744
- return Oe.create(this);
744
+ return Ne.create(this);
745
745
  }
746
746
  isOptional() {
747
747
  return this.safeParse(void 0).success;
@@ -751,19 +751,19 @@ class S {
751
751
  }
752
752
  }
753
753
  const hr = /^c[^\s-]{8,}$/i, pr = /^[0-9a-z]+$/, mr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, gr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, yr = /^[a-z0-9_-]{21}$/i, br = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, _r = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, vr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, kr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
754
- let He;
754
+ let Ge;
755
755
  const wr = /^(?:(?: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])$/, Tr = /^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/, xr = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Sr = /^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ir = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Er = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Mt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Rr = new RegExp(`^${Mt}$`);
756
- function $t(t) {
756
+ function Pt(t) {
757
757
  let e = "[0-5]\\d";
758
758
  t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
759
759
  const r = t.precision ? "+" : "?";
760
760
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`;
761
761
  }
762
762
  function Ar(t) {
763
- return new RegExp(`^${$t(t)}$`);
763
+ return new RegExp(`^${Pt(t)}$`);
764
764
  }
765
765
  function Cr(t) {
766
- let e = `${Mt}T${$t(t)}`;
766
+ let e = `${Mt}T${Pt(t)}`;
767
767
  const r = [];
768
768
  return r.push(t.local ? "Z?" : "Z"), t.offset && r.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${r.join("|")})`, new RegExp(`^${e}$`);
769
769
  }
@@ -796,7 +796,7 @@ class U extends S {
796
796
  received: i.parsedType
797
797
  }), v;
798
798
  }
799
- const n = new P();
799
+ const n = new $();
800
800
  let s;
801
801
  for (const i of this._def.checks)
802
802
  if (i.kind === "min")
@@ -841,7 +841,7 @@ class U extends S {
841
841
  message: i.message
842
842
  }), n.dirty());
843
843
  else if (i.kind === "emoji")
844
- He || (He = new RegExp(kr, "u")), He.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
844
+ Ge || (Ge = new RegExp(kr, "u")), Ge.test(e.data) || (s = this._getOrReturnCtx(e, s), p(s, {
845
845
  validation: "emoji",
846
846
  code: u.invalid_string,
847
847
  message: i.message
@@ -1169,7 +1169,7 @@ U.create = (t) => new U({
1169
1169
  coerce: (t == null ? void 0 : t.coerce) ?? !1,
1170
1170
  ...w(t)
1171
1171
  });
1172
- function $r(t, e) {
1172
+ function Pr(t, e) {
1173
1173
  const r = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, s = r > n ? r : n, i = Number.parseInt(t.toFixed(s).replace(".", "")), o = Number.parseInt(e.toFixed(s).replace(".", ""));
1174
1174
  return i % o / 10 ** s;
1175
1175
  }
@@ -1187,7 +1187,7 @@ class ae extends S {
1187
1187
  }), v;
1188
1188
  }
1189
1189
  let n;
1190
- const s = new P();
1190
+ const s = new $();
1191
1191
  for (const i of this._def.checks)
1192
1192
  i.kind === "int" ? I.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), p(n, {
1193
1193
  code: u.invalid_type,
@@ -1208,7 +1208,7 @@ class ae extends S {
1208
1208
  inclusive: i.inclusive,
1209
1209
  exact: !1,
1210
1210
  message: i.message
1211
- }), s.dirty()) : i.kind === "multipleOf" ? $r(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), p(n, {
1211
+ }), s.dirty()) : i.kind === "multipleOf" ? Pr(e.data, i.value) !== 0 && (n = this._getOrReturnCtx(e, n), p(n, {
1212
1212
  code: u.not_multiple_of,
1213
1213
  multipleOf: i.value,
1214
1214
  message: i.message
@@ -1359,7 +1359,7 @@ class oe extends S {
1359
1359
  if (this._getType(e) !== g.bigint)
1360
1360
  return this._getInvalidInput(e);
1361
1361
  let n;
1362
- const s = new P();
1362
+ const s = new $();
1363
1363
  for (const i of this._def.checks)
1364
1364
  i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (n = this._getOrReturnCtx(e, n), p(n, {
1365
1365
  code: u.too_small,
@@ -1478,7 +1478,7 @@ oe.create = (t) => new oe({
1478
1478
  coerce: (t == null ? void 0 : t.coerce) ?? !1,
1479
1479
  ...w(t)
1480
1480
  });
1481
- class Le extends S {
1481
+ class je extends S {
1482
1482
  _parse(e) {
1483
1483
  if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
1484
1484
  const n = this._getOrReturnCtx(e);
@@ -1491,12 +1491,12 @@ class Le extends S {
1491
1491
  return L(e.data);
1492
1492
  }
1493
1493
  }
1494
- Le.create = (t) => new Le({
1494
+ je.create = (t) => new je({
1495
1495
  typeName: k.ZodBoolean,
1496
1496
  coerce: (t == null ? void 0 : t.coerce) || !1,
1497
1497
  ...w(t)
1498
1498
  });
1499
- class Te extends S {
1499
+ class xe extends S {
1500
1500
  _parse(e) {
1501
1501
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
1502
1502
  const i = this._getOrReturnCtx(e);
@@ -1512,7 +1512,7 @@ class Te extends S {
1512
1512
  code: u.invalid_date
1513
1513
  }), v;
1514
1514
  }
1515
- const n = new P();
1515
+ const n = new $();
1516
1516
  let s;
1517
1517
  for (const i of this._def.checks)
1518
1518
  i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), p(s, {
@@ -1536,7 +1536,7 @@ class Te extends S {
1536
1536
  };
1537
1537
  }
1538
1538
  _addCheck(e) {
1539
- return new Te({
1539
+ return new xe({
1540
1540
  ...this._def,
1541
1541
  checks: [...this._def.checks, e]
1542
1542
  });
@@ -1568,7 +1568,7 @@ class Te extends S {
1568
1568
  return e != null ? new Date(e) : null;
1569
1569
  }
1570
1570
  }
1571
- Te.create = (t) => new Te({
1571
+ xe.create = (t) => new xe({
1572
1572
  checks: [],
1573
1573
  coerce: (t == null ? void 0 : t.coerce) || !1,
1574
1574
  typeName: k.ZodDate,
@@ -1591,7 +1591,7 @@ Tt.create = (t) => new Tt({
1591
1591
  typeName: k.ZodSymbol,
1592
1592
  ...w(t)
1593
1593
  });
1594
- class je extends S {
1594
+ class De extends S {
1595
1595
  _parse(e) {
1596
1596
  if (this._getType(e) !== g.undefined) {
1597
1597
  const n = this._getOrReturnCtx(e);
@@ -1604,11 +1604,11 @@ class je extends S {
1604
1604
  return L(e.data);
1605
1605
  }
1606
1606
  }
1607
- je.create = (t) => new je({
1607
+ De.create = (t) => new De({
1608
1608
  typeName: k.ZodUndefined,
1609
1609
  ...w(t)
1610
1610
  });
1611
- class xe extends S {
1611
+ class Se extends S {
1612
1612
  _parse(e) {
1613
1613
  if (this._getType(e) !== g.null) {
1614
1614
  const n = this._getOrReturnCtx(e);
@@ -1621,11 +1621,11 @@ class xe extends S {
1621
1621
  return L(e.data);
1622
1622
  }
1623
1623
  }
1624
- xe.create = (t) => new xe({
1624
+ Se.create = (t) => new Se({
1625
1625
  typeName: k.ZodNull,
1626
1626
  ...w(t)
1627
1627
  });
1628
- class Xe extends S {
1628
+ class et extends S {
1629
1629
  constructor() {
1630
1630
  super(...arguments), this._any = !0;
1631
1631
  }
@@ -1633,7 +1633,7 @@ class Xe extends S {
1633
1633
  return L(e.data);
1634
1634
  }
1635
1635
  }
1636
- Xe.create = (t) => new Xe({
1636
+ et.create = (t) => new et({
1637
1637
  typeName: k.ZodAny,
1638
1638
  ...w(t)
1639
1639
  });
@@ -1663,7 +1663,7 @@ te.create = (t) => new te({
1663
1663
  typeName: k.ZodNever,
1664
1664
  ...w(t)
1665
1665
  });
1666
- class et extends S {
1666
+ class tt extends S {
1667
1667
  _parse(e) {
1668
1668
  if (this._getType(e) !== g.undefined) {
1669
1669
  const n = this._getOrReturnCtx(e);
@@ -1676,7 +1676,7 @@ class et extends S {
1676
1676
  return L(e.data);
1677
1677
  }
1678
1678
  }
1679
- et.create = (t) => new et({
1679
+ tt.create = (t) => new tt({
1680
1680
  typeName: k.ZodVoid,
1681
1681
  ...w(t)
1682
1682
  });
@@ -1716,9 +1716,9 @@ class W extends S {
1716
1716
  exact: !1,
1717
1717
  message: s.maxLength.message
1718
1718
  }), n.dirty()), r.common.async)
1719
- return Promise.all([...r.data].map((o, a) => s.type._parseAsync(new B(r, o, r.path, a)))).then((o) => P.mergeArray(n, o));
1719
+ return Promise.all([...r.data].map((o, a) => s.type._parseAsync(new B(r, o, r.path, a)))).then((o) => $.mergeArray(n, o));
1720
1720
  const i = [...r.data].map((o, a) => s.type._parseSync(new B(r, o, r.path, a)));
1721
- return P.mergeArray(n, i);
1721
+ return $.mergeArray(n, i);
1722
1722
  }
1723
1723
  get element() {
1724
1724
  return this._def.type;
@@ -1832,15 +1832,15 @@ class A extends S {
1832
1832
  return s.common.async ? Promise.resolve().then(async () => {
1833
1833
  const d = [];
1834
1834
  for (const m of h) {
1835
- const R = await m.key, $ = await m.value;
1835
+ const R = await m.key, P = await m.value;
1836
1836
  d.push({
1837
1837
  key: R,
1838
- value: $,
1838
+ value: P,
1839
1839
  alwaysSet: m.alwaysSet
1840
1840
  });
1841
1841
  }
1842
1842
  return d;
1843
- }).then((d) => P.mergeObjectSync(n, d)) : P.mergeObjectSync(n, h);
1843
+ }).then((d) => $.mergeObjectSync(n, d)) : $.mergeObjectSync(n, h);
1844
1844
  }
1845
1845
  get shape() {
1846
1846
  return this._def.shape();
@@ -2033,7 +2033,7 @@ class A extends S {
2033
2033
  });
2034
2034
  }
2035
2035
  keyof() {
2036
- return Pt(I.objectKeys(this.shape));
2036
+ return $t(I.objectKeys(this.shape));
2037
2037
  }
2038
2038
  }
2039
2039
  A.create = (t, e) => new A({
@@ -2057,7 +2057,7 @@ A.lazycreate = (t, e) => new A({
2057
2057
  typeName: k.ZodObject,
2058
2058
  ...w(e)
2059
2059
  });
2060
- class Se extends S {
2060
+ class Ie extends S {
2061
2061
  _parse(e) {
2062
2062
  const { ctx: r } = this._processInputParams(e), n = this._def.options;
2063
2063
  function s(i) {
@@ -2125,13 +2125,13 @@ class Se extends S {
2125
2125
  return this._def.options;
2126
2126
  }
2127
2127
  }
2128
- Se.create = (t, e) => new Se({
2128
+ Ie.create = (t, e) => new Ie({
2129
2129
  options: t,
2130
2130
  typeName: k.ZodUnion,
2131
2131
  ...w(e)
2132
2132
  });
2133
- const G = (t) => t instanceof De ? G(t.schema) : t instanceof J ? G(t.innerType()) : t instanceof Re ? [t.value] : t instanceof re ? t.options : t instanceof nt ? I.objectValues(t.enum) : t instanceof Ae ? G(t._def.innerType) : t instanceof je ? [void 0] : t instanceof xe ? [null] : t instanceof V ? [void 0, ...G(t.unwrap())] : t instanceof ne ? [null, ...G(t.unwrap())] : t instanceof ut || t instanceof Oe ? G(t.unwrap()) : t instanceof Ce ? G(t._def.innerType) : [];
2134
- class Be extends S {
2133
+ const G = (t) => t instanceof Ze ? G(t.schema) : t instanceof J ? G(t.innerType()) : t instanceof Ae ? [t.value] : t instanceof re ? t.options : t instanceof st ? I.objectValues(t.enum) : t instanceof Ce ? G(t._def.innerType) : t instanceof De ? [void 0] : t instanceof Se ? [null] : t instanceof V ? [void 0, ...G(t.unwrap())] : t instanceof ne ? [null, ...G(t.unwrap())] : t instanceof ut || t instanceof Ne ? G(t.unwrap()) : t instanceof Oe ? G(t._def.innerType) : [];
2134
+ class ze extends S {
2135
2135
  _parse(e) {
2136
2136
  const { ctx: r } = this._processInputParams(e);
2137
2137
  if (r.parsedType !== g.object)
@@ -2184,7 +2184,7 @@ class Be extends S {
2184
2184
  s.set(a, i);
2185
2185
  }
2186
2186
  }
2187
- return new Be({
2187
+ return new ze({
2188
2188
  typeName: k.ZodDiscriminatedUnion,
2189
2189
  discriminator: e,
2190
2190
  options: r,
@@ -2193,14 +2193,14 @@ class Be extends S {
2193
2193
  });
2194
2194
  }
2195
2195
  }
2196
- function tt(t, e) {
2196
+ function rt(t, e) {
2197
2197
  const r = ee(t), n = ee(e);
2198
2198
  if (t === e)
2199
2199
  return { valid: !0, data: t };
2200
2200
  if (r === g.object && n === g.object) {
2201
2201
  const s = I.objectKeys(e), i = I.objectKeys(t).filter((a) => s.indexOf(a) !== -1), o = { ...t, ...e };
2202
2202
  for (const a of i) {
2203
- const h = tt(t[a], e[a]);
2203
+ const h = rt(t[a], e[a]);
2204
2204
  if (!h.valid)
2205
2205
  return { valid: !1 };
2206
2206
  o[a] = h.data;
@@ -2211,7 +2211,7 @@ function tt(t, e) {
2211
2211
  return { valid: !1 };
2212
2212
  const s = [];
2213
2213
  for (let i = 0; i < t.length; i++) {
2214
- const o = t[i], a = e[i], h = tt(o, a);
2214
+ const o = t[i], a = e[i], h = rt(o, a);
2215
2215
  if (!h.valid)
2216
2216
  return { valid: !1 };
2217
2217
  s.push(h.data);
@@ -2219,12 +2219,12 @@ function tt(t, e) {
2219
2219
  return { valid: !0, data: s };
2220
2220
  } else return r === g.date && n === g.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2221
2221
  }
2222
- class Ie extends S {
2222
+ class Ee extends S {
2223
2223
  _parse(e) {
2224
2224
  const { status: r, ctx: n } = this._processInputParams(e), s = (i, o) => {
2225
2225
  if (vt(i) || vt(o))
2226
2226
  return v;
2227
- const a = tt(i.value, o.value);
2227
+ const a = rt(i.value, o.value);
2228
2228
  return a.valid ? ((kt(i) || kt(o)) && r.dirty(), { status: r.value, value: a.data }) : (p(n, {
2229
2229
  code: u.invalid_intersection_types
2230
2230
  }), v);
@@ -2251,7 +2251,7 @@ class Ie extends S {
2251
2251
  }));
2252
2252
  }
2253
2253
  }
2254
- Ie.create = (t, e, r) => new Ie({
2254
+ Ee.create = (t, e, r) => new Ee({
2255
2255
  left: t,
2256
2256
  right: e,
2257
2257
  typeName: k.ZodIntersection,
@@ -2285,7 +2285,7 @@ class z extends S {
2285
2285
  const h = this._def.items[a] || this._def.rest;
2286
2286
  return h ? h._parse(new B(n, o, n.path, a)) : null;
2287
2287
  }).filter((o) => !!o);
2288
- return n.common.async ? Promise.all(i).then((o) => P.mergeArray(r, o)) : P.mergeArray(r, i);
2288
+ return n.common.async ? Promise.all(i).then((o) => $.mergeArray(r, o)) : $.mergeArray(r, i);
2289
2289
  }
2290
2290
  get items() {
2291
2291
  return this._def.items;
@@ -2307,7 +2307,7 @@ z.create = (t, e) => {
2307
2307
  ...w(e)
2308
2308
  });
2309
2309
  };
2310
- class Ee extends S {
2310
+ class Re extends S {
2311
2311
  get keySchema() {
2312
2312
  return this._def.keyType;
2313
2313
  }
@@ -2329,18 +2329,18 @@ class Ee extends S {
2329
2329
  value: o._parse(new B(n, n.data[a], n.path, a)),
2330
2330
  alwaysSet: a in n.data
2331
2331
  });
2332
- return n.common.async ? P.mergeObjectAsync(r, s) : P.mergeObjectSync(r, s);
2332
+ return n.common.async ? $.mergeObjectAsync(r, s) : $.mergeObjectSync(r, s);
2333
2333
  }
2334
2334
  get element() {
2335
2335
  return this._def.valueType;
2336
2336
  }
2337
2337
  static create(e, r, n) {
2338
- return r instanceof S ? new Ee({
2338
+ return r instanceof S ? new Re({
2339
2339
  keyType: e,
2340
2340
  valueType: r,
2341
2341
  typeName: k.ZodRecord,
2342
2342
  ...w(n)
2343
- }) : new Ee({
2343
+ }) : new Re({
2344
2344
  keyType: U.create(),
2345
2345
  valueType: e,
2346
2346
  typeName: k.ZodRecord,
@@ -2348,7 +2348,7 @@ class Ee extends S {
2348
2348
  });
2349
2349
  }
2350
2350
  }
2351
- class rt extends S {
2351
+ class nt extends S {
2352
2352
  get keySchema() {
2353
2353
  return this._def.keyType;
2354
2354
  }
@@ -2390,7 +2390,7 @@ class rt extends S {
2390
2390
  }
2391
2391
  }
2392
2392
  }
2393
- rt.create = (t, e, r) => new rt({
2393
+ nt.create = (t, e, r) => new nt({
2394
2394
  valueType: e,
2395
2395
  keyType: t,
2396
2396
  typeName: k.ZodMap,
@@ -2473,10 +2473,10 @@ class ke extends S {
2473
2473
  received: r.parsedType
2474
2474
  }), v;
2475
2475
  function n(a, h) {
2476
- return Qe({
2476
+ return Xe({
2477
2477
  data: a,
2478
2478
  path: r.path,
2479
- errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Ke(), we].filter((d) => !!d),
2479
+ errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Qe(), Te].filter((d) => !!d),
2480
2480
  issueData: {
2481
2481
  code: u.invalid_arguments,
2482
2482
  argumentsError: h
@@ -2484,10 +2484,10 @@ class ke extends S {
2484
2484
  });
2485
2485
  }
2486
2486
  function s(a, h) {
2487
- return Qe({
2487
+ return Xe({
2488
2488
  data: a,
2489
2489
  path: r.path,
2490
- errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Ke(), we].filter((d) => !!d),
2490
+ errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Qe(), Te].filter((d) => !!d),
2491
2491
  issueData: {
2492
2492
  code: u.invalid_return_type,
2493
2493
  returnTypeError: h
@@ -2551,7 +2551,7 @@ class ke extends S {
2551
2551
  });
2552
2552
  }
2553
2553
  }
2554
- class De extends S {
2554
+ class Ze extends S {
2555
2555
  get schema() {
2556
2556
  return this._def.getter();
2557
2557
  }
@@ -2560,12 +2560,12 @@ class De extends S {
2560
2560
  return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
2561
2561
  }
2562
2562
  }
2563
- De.create = (t, e) => new De({
2563
+ Ze.create = (t, e) => new Ze({
2564
2564
  getter: t,
2565
2565
  typeName: k.ZodLazy,
2566
2566
  ...w(e)
2567
2567
  });
2568
- class Re extends S {
2568
+ class Ae extends S {
2569
2569
  _parse(e) {
2570
2570
  if (e.data !== this._def.value) {
2571
2571
  const r = this._getOrReturnCtx(e);
@@ -2581,12 +2581,12 @@ class Re extends S {
2581
2581
  return this._def.value;
2582
2582
  }
2583
2583
  }
2584
- Re.create = (t, e) => new Re({
2584
+ Ae.create = (t, e) => new Ae({
2585
2585
  value: t,
2586
2586
  typeName: k.ZodLiteral,
2587
2587
  ...w(e)
2588
2588
  });
2589
- function Pt(t, e) {
2589
+ function $t(t, e) {
2590
2590
  return new re({
2591
2591
  values: t,
2592
2592
  typeName: k.ZodEnum,
@@ -2647,8 +2647,8 @@ class re extends S {
2647
2647
  });
2648
2648
  }
2649
2649
  }
2650
- re.create = Pt;
2651
- class nt extends S {
2650
+ re.create = $t;
2651
+ class st extends S {
2652
2652
  _parse(e) {
2653
2653
  const r = I.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
2654
2654
  if (n.parsedType !== g.string && n.parsedType !== g.number) {
@@ -2673,7 +2673,7 @@ class nt extends S {
2673
2673
  return this._def.values;
2674
2674
  }
2675
2675
  }
2676
- nt.create = (t, e) => new nt({
2676
+ st.create = (t, e) => new st({
2677
2677
  values: t,
2678
2678
  typeName: k.ZodNativeEnum,
2679
2679
  ...w(e)
@@ -2820,7 +2820,7 @@ ne.create = (t, e) => new ne({
2820
2820
  typeName: k.ZodNullable,
2821
2821
  ...w(e)
2822
2822
  });
2823
- class Ae extends S {
2823
+ class Ce extends S {
2824
2824
  _parse(e) {
2825
2825
  const { ctx: r } = this._processInputParams(e);
2826
2826
  let n = r.data;
@@ -2834,13 +2834,13 @@ class Ae extends S {
2834
2834
  return this._def.innerType;
2835
2835
  }
2836
2836
  }
2837
- Ae.create = (t, e) => new Ae({
2837
+ Ce.create = (t, e) => new Ce({
2838
2838
  innerType: t,
2839
2839
  typeName: k.ZodDefault,
2840
2840
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2841
2841
  ...w(e)
2842
2842
  });
2843
- class Ce extends S {
2843
+ class Oe extends S {
2844
2844
  _parse(e) {
2845
2845
  const { ctx: r } = this._processInputParams(e), n = {
2846
2846
  ...r,
@@ -2855,7 +2855,7 @@ class Ce extends S {
2855
2855
  ...n
2856
2856
  }
2857
2857
  });
2858
- return Pe(s) ? s.then((i) => ({
2858
+ return Le(s) ? s.then((i) => ({
2859
2859
  status: "valid",
2860
2860
  value: i.status === "valid" ? i.value : this._def.catchValue({
2861
2861
  get error() {
@@ -2877,13 +2877,13 @@ class Ce extends S {
2877
2877
  return this._def.innerType;
2878
2878
  }
2879
2879
  }
2880
- Ce.create = (t, e) => new Ce({
2880
+ Oe.create = (t, e) => new Oe({
2881
2881
  innerType: t,
2882
2882
  typeName: k.ZodCatch,
2883
2883
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2884
2884
  ...w(e)
2885
2885
  });
2886
- class st extends S {
2886
+ class it extends S {
2887
2887
  _parse(e) {
2888
2888
  if (this._getType(e) !== g.nan) {
2889
2889
  const n = this._getOrReturnCtx(e);
@@ -2896,7 +2896,7 @@ class st extends S {
2896
2896
  return { status: "valid", value: e.data };
2897
2897
  }
2898
2898
  }
2899
- st.create = (t) => new st({
2899
+ it.create = (t) => new it({
2900
2900
  typeName: k.ZodNaN,
2901
2901
  ...w(t)
2902
2902
  });
@@ -2913,7 +2913,7 @@ class ut extends S {
2913
2913
  return this._def.type;
2914
2914
  }
2915
2915
  }
2916
- class ze extends S {
2916
+ class qe extends S {
2917
2917
  _parse(e) {
2918
2918
  const { status: r, ctx: n } = this._processInputParams(e);
2919
2919
  if (n.common.async)
@@ -2946,23 +2946,23 @@ class ze extends S {
2946
2946
  }
2947
2947
  }
2948
2948
  static create(e, r) {
2949
- return new ze({
2949
+ return new qe({
2950
2950
  in: e,
2951
2951
  out: r,
2952
2952
  typeName: k.ZodPipeline
2953
2953
  });
2954
2954
  }
2955
2955
  }
2956
- class Oe extends S {
2956
+ class Ne extends S {
2957
2957
  _parse(e) {
2958
2958
  const r = this._def.innerType._parse(e), n = (s) => (me(s) && (s.value = Object.freeze(s.value)), s);
2959
- return Pe(r) ? r.then((s) => n(s)) : n(r);
2959
+ return Le(r) ? r.then((s) => n(s)) : n(r);
2960
2960
  }
2961
2961
  unwrap() {
2962
2962
  return this._def.innerType;
2963
2963
  }
2964
2964
  }
2965
- Oe.create = (t, e) => new Oe({
2965
+ Ne.create = (t, e) => new Ne({
2966
2966
  innerType: t,
2967
2967
  typeName: k.ZodReadonly,
2968
2968
  ...w(e)
@@ -2971,11 +2971,11 @@ var k;
2971
2971
  (function(t) {
2972
2972
  t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly";
2973
2973
  })(k || (k = {}));
2974
- const c = U.create, f = ae.create, q = oe.create, T = Le.create, Lt = xe.create, _ = ie.create;
2974
+ const c = U.create, f = ae.create, q = oe.create, T = je.create, Lt = Se.create, _ = ie.create;
2975
2975
  te.create;
2976
- const E = W.create, l = A.create, x = Se.create, Pr = Be.create;
2977
- Ie.create;
2978
- const Lr = z.create, b = Ee.create, it = Re.create, Ze = re.create;
2976
+ const E = W.create, l = A.create, x = Ie.create, $r = ze.create;
2977
+ Ee.create;
2978
+ const Lr = z.create, b = Re.create, we = Ae.create, We = re.create;
2979
2979
  ye.create;
2980
2980
  V.create;
2981
2981
  ne.create;
@@ -2989,20 +2989,20 @@ function N(t, e = 0, r = 2) {
2989
2989
  return `${o}${h ? "?" : ""}: ${d}`;
2990
2990
  }).join(", ")} }`;
2991
2991
  }
2992
- if (t instanceof Se)
2992
+ if (t instanceof Ie)
2993
2993
  return t.options.map((n) => N(n, e, r)).join(" or ");
2994
2994
  if (t instanceof U) return "string";
2995
2995
  if (t instanceof ae) return "number";
2996
- if (t instanceof Le) return "boolean";
2996
+ if (t instanceof je) return "boolean";
2997
2997
  if (t instanceof oe) return "bigint";
2998
- if (t instanceof xe) return "null";
2998
+ if (t instanceof Se) return "null";
2999
2999
  if (t instanceof W) {
3000
3000
  const n = N(t.element, e + 1, r);
3001
3001
  return n === "unknown" || n === "any" ? "array" : `${n}[]`;
3002
3002
  }
3003
3003
  if (t instanceof z)
3004
3004
  return `[${t.items.map((n) => N(n, e + 1, r)).join(", ")}]`;
3005
- if (t instanceof Ee) {
3005
+ if (t instanceof Re) {
3006
3006
  const n = N(
3007
3007
  t._def.valueType,
3008
3008
  e + 1,
@@ -3010,7 +3010,7 @@ function N(t, e = 0, r = 2) {
3010
3010
  );
3011
3011
  return n === "unknown" || n === "any" ? "{ [key: string]: unknown }" : `{ [key: string]: ${n} }`;
3012
3012
  }
3013
- return t instanceof V ? `${N(t.unwrap(), e, r)}?` : t instanceof Re ? JSON.stringify(t.value) : t instanceof re ? t.options.map((n) => `"${n}"`).join(" | ") : t instanceof Xe ? "any" : t instanceof ie ? "unknown" : t instanceof et ? "void" : t instanceof je ? "undefined" : t instanceof J ? N(t.innerType(), e, r) : t instanceof Ae ? N(t.removeDefault(), e, r) : t instanceof ne ? `${N(t.unwrap(), e, r)} | null` : t instanceof De ? "lazy" : t instanceof ye ? `Promise<${N(t.unwrap(), e + 1, r)}>` : t instanceof ke ? "function" : t instanceof Te ? "Date" : t instanceof rt ? "Map" : t instanceof ge ? "Set" : t instanceof Ie ? `${N(t._def.left, e, r)} & ${N(t._def.right, e, r)}` : t instanceof Be ? t.options.map((n) => N(n, e, r)).join(" or ") : t instanceof ut ? N(t.unwrap(), e, r) : t instanceof st ? "NaN" : t instanceof Ce ? N(t.removeCatch(), e, r) : t instanceof ze ? N(t._def.in, e, r) : t instanceof Oe ? `readonly ${N(t.unwrap(), e, r)}` : "unknown";
3013
+ return t instanceof V ? `${N(t.unwrap(), e, r)}?` : t instanceof Ae ? JSON.stringify(t.value) : t instanceof re ? t.options.map((n) => `"${n}"`).join(" | ") : t instanceof et ? "any" : t instanceof ie ? "unknown" : t instanceof tt ? "void" : t instanceof De ? "undefined" : t instanceof J ? N(t.innerType(), e, r) : t instanceof Ce ? N(t.removeDefault(), e, r) : t instanceof ne ? `${N(t.unwrap(), e, r)} | null` : t instanceof Ze ? "lazy" : t instanceof ye ? `Promise<${N(t.unwrap(), e + 1, r)}>` : t instanceof ke ? "function" : t instanceof xe ? "Date" : t instanceof nt ? "Map" : t instanceof ge ? "Set" : t instanceof Ee ? `${N(t._def.left, e, r)} & ${N(t._def.right, e, r)}` : t instanceof ze ? t.options.map((n) => N(n, e, r)).join(" or ") : t instanceof ut ? N(t.unwrap(), e, r) : t instanceof it ? "NaN" : t instanceof Oe ? N(t.removeCatch(), e, r) : t instanceof qe ? N(t._def.in, e, r) : t instanceof Ne ? `readonly ${N(t.unwrap(), e, r)}` : "unknown";
3014
3014
  }
3015
3015
  function jr(t) {
3016
3016
  return t === null ? "null" : t === void 0 ? "undefined" : Array.isArray(t) ? "array" : typeof t;
@@ -3133,13 +3133,13 @@ const ce = () => c().regex(/^e\d+$/), Kr = 'use { refId: "e2" } or { label: "...
3133
3133
  label: c().optional().describe("Human-readable element label"),
3134
3134
  ...t
3135
3135
  }).superRefine(ft)
3136
- ), Ne = {
3136
+ ), Me = {
3137
3137
  tabId: x([f(), q()]).optional().describe("Target tab ID")
3138
3138
  }, K = (t) => Y(
3139
3139
  (e) => typeof e == "string" || typeof e == "number" ? { __invalidPositional: e } : e,
3140
3140
  l({
3141
3141
  __invalidPositional: x([c(), f()]).optional().describe("Internal flag for positional argument rejection"),
3142
- ...Ne,
3142
+ ...Me,
3143
3143
  refId: ce().optional().describe("Element reference ID (e.g. e2)"),
3144
3144
  label: c().optional().describe("Human-readable element label"),
3145
3145
  ...t
@@ -3150,7 +3150,7 @@ l({});
3150
3150
  l({
3151
3151
  url: c().describe("URL to navigate to"),
3152
3152
  timeout: D().optional().describe("Navigation timeout in milliseconds"),
3153
- waitUntil: Ze(["load", "networkidle"]).optional().describe(
3153
+ waitUntil: We(["load", "networkidle"]).optional().describe(
3154
3154
  "When to consider navigation complete: 'load' (tab status complete) or 'networkidle' (no in-flight requests for 500ms)"
3155
3155
  )
3156
3156
  });
@@ -3174,15 +3174,15 @@ const Qr = (t, e) => {
3174
3174
  url: c().url().optional().describe("HTTP(S) URL to fetch in the target tab"),
3175
3175
  path: c().min(1).optional().describe("Virtual filesystem path (resolved in worker)"),
3176
3176
  handle: c().min(1).optional().describe("Binary handle from page.fetch({ store: true })")
3177
- }).superRefine(Qr), Wt = Pr("kind", [
3177
+ }).superRefine(Qr), Wt = $r("kind", [
3178
3178
  l({
3179
- kind: it("bytes"),
3179
+ kind: we("bytes"),
3180
3180
  name: c().min(1),
3181
3181
  data: c().min(1),
3182
3182
  mimeType: c().optional()
3183
3183
  }),
3184
3184
  l({
3185
- kind: it("url"),
3185
+ kind: we("url"),
3186
3186
  url: c().url(),
3187
3187
  name: c().min(1),
3188
3188
  mimeType: c().optional()
@@ -3290,7 +3290,7 @@ Y(
3290
3290
  (t) => typeof t == "string" || typeof t == "number" ? { __invalidPositional: t } : t,
3291
3291
  l({
3292
3292
  __invalidPositional: x([c(), f()]).optional().describe("Internal flag for positional argument rejection"),
3293
- ...Ne,
3293
+ ...Me,
3294
3294
  refId: ce().optional().describe("Element reference ID (e.g. e2)"),
3295
3295
  label: c().optional().describe("Human-readable element label"),
3296
3296
  x: f().optional().describe("X coordinate to scroll to"),
@@ -3301,7 +3301,7 @@ K({
3301
3301
  text: c().describe("Text to type into the element")
3302
3302
  });
3303
3303
  l({
3304
- ...Ne,
3304
+ ...Me,
3305
3305
  key: c().describe("Key to press (e.g. Enter, Escape, ArrowDown)")
3306
3306
  });
3307
3307
  K({
@@ -3312,10 +3312,10 @@ K({
3312
3312
  });
3313
3313
  K();
3314
3314
  l({
3315
- ...Ne
3315
+ ...Me
3316
3316
  });
3317
3317
  l({
3318
- ...Ne,
3318
+ ...Me,
3319
3319
  direction: c().default("down").describe("Scroll direction: up, down, left, or right"),
3320
3320
  amount: f().default(300).describe("Pixels to scroll")
3321
3321
  });
@@ -3581,7 +3581,7 @@ x([
3581
3581
  b(_())
3582
3582
  ]);
3583
3583
  const cn = l({
3584
- ok: it(!0).describe("Whether the action succeeded"),
3584
+ ok: we(!0).describe("Whether the action succeeded"),
3585
3585
  action: c().describe("Action identifier (e.g. 'page_fill')"),
3586
3586
  refId: ce().optional().describe("Element reference ID that was acted upon (e.g. e2)"),
3587
3587
  tag: c().optional().describe("HTML tag name of the element"),
@@ -3596,7 +3596,16 @@ const cn = l({
3596
3596
  direction: c().optional().describe("Scroll direction (for scroll actions)"),
3597
3597
  amount: f().optional().describe("Scroll amount in pixels (for scroll actions)"),
3598
3598
  fileCount: f().optional().describe("Number of files attached (for setFiles actions)"),
3599
- fileNames: E(c()).optional().describe("Names of attached files (for setFiles actions)")
3599
+ fileNames: E(c()).optional().describe("Names of attached files (for setFiles actions)"),
3600
+ observationId: c().optional().describe(
3601
+ "Opaque ID of the observation lease authorizing this action (snapshot-scoped)"
3602
+ ),
3603
+ dispatched: we(!0).optional().describe(
3604
+ "True if the action was dispatched to the DOM. Does NOT prove the application accepted it."
3605
+ ),
3606
+ verification: we("required").optional().describe(
3607
+ "Always 'required': a fresh observation is required to verify the effect."
3608
+ )
3600
3609
  });
3601
3610
  x([cn, Lt()]);
3602
3611
  l({
@@ -3604,7 +3613,7 @@ l({
3604
3613
  ok: T().describe("Whether the response status is 2xx"),
3605
3614
  headers: b(c()).describe("Response headers as key-value pairs"),
3606
3615
  body: c().optional().describe("Response body (omitted when bodyEncoding is handle)"),
3607
- bodyEncoding: Ze(["text", "base64", "handle"]).describe("Encoding of the body field"),
3616
+ bodyEncoding: We(["text", "base64", "handle"]).describe("Encoding of the body field"),
3608
3617
  handle: c().optional().describe("Binary handle when bodyEncoding is handle"),
3609
3618
  byteLength: f().describe("Length of the body in bytes"),
3610
3619
  contentType: c().describe("Response Content-Type header"),
@@ -3619,8 +3628,8 @@ l({
3619
3628
  tabId: f(),
3620
3629
  url: c(),
3621
3630
  title: c(),
3622
- contentScript: Ze(["connected", "missing"]),
3623
- domApis: Ze(["ok", "blocked"]),
3631
+ contentScript: We(["connected", "missing"]),
3632
+ domApis: We(["ok", "blocked"]),
3624
3633
  mutationsReady: T(),
3625
3634
  hint: c().optional(),
3626
3635
  recovery: E(c()).optional()
@@ -3652,7 +3661,10 @@ l({
3652
3661
  viewport: l({
3653
3662
  width: f().describe("Viewport width in pixels"),
3654
3663
  height: f().describe("Viewport height in pixels")
3655
- }).describe("Viewport dimensions")
3664
+ }).describe("Viewport dimensions"),
3665
+ observationId: c().optional().describe(
3666
+ "Opaque ID of the observation lease granted by this snapshot. Pass to subsequent actions to prove they act on fresh observations."
3667
+ )
3656
3668
  });
3657
3669
  const Vt = l({
3658
3670
  id: f().optional().describe("Tab ID"),
@@ -3794,18 +3806,18 @@ E(
3794
3806
  })
3795
3807
  );
3796
3808
  C.child("tool-registry");
3797
- const We = /* @__PURE__ */ new Map(), Ve = /* @__PURE__ */ new Map();
3809
+ const Ve = /* @__PURE__ */ new Map(), Fe = /* @__PURE__ */ new Map();
3798
3810
  function ht(t) {
3799
3811
  return t && t.length > 0 ? t : "__default__";
3800
3812
  }
3801
3813
  function Ut(t) {
3802
3814
  const e = ht(t);
3803
- let r = We.get(e);
3804
- return r || (r = /* @__PURE__ */ new Map(), We.set(e, r)), r;
3815
+ let r = Ve.get(e);
3816
+ return r || (r = /* @__PURE__ */ new Map(), Ve.set(e, r)), r;
3805
3817
  }
3806
3818
  function vn(t, e, r) {
3807
- const n = ht(t), s = (Ve.get(n) ?? 0) + 1;
3808
- Ve.set(n, s);
3819
+ const n = ht(t), s = (Fe.get(n) ?? 0) + 1;
3820
+ Fe.set(n, s);
3809
3821
  const i = `blob_${s}`;
3810
3822
  return Ut(t).set(i, {
3811
3823
  bytes: e,
@@ -3819,10 +3831,10 @@ function kn(t, e) {
3819
3831
  }
3820
3832
  function wn(t) {
3821
3833
  const e = ht(t);
3822
- We.delete(e), Ve.delete(e);
3834
+ Ve.delete(e), Fe.delete(e);
3823
3835
  }
3824
3836
  function St() {
3825
- We.clear(), Ve.clear();
3837
+ Ve.clear(), Fe.clear();
3826
3838
  }
3827
3839
  const It = 8 * 1024;
3828
3840
  function Tn(t) {
@@ -3867,7 +3879,7 @@ function Et(t, e) {
3867
3879
  const n = (t.split(/[?#]/)[0] ?? t).split("/").filter(Boolean).pop();
3868
3880
  return n && n.length > 0 ? n : e;
3869
3881
  }
3870
- function Ge(t) {
3882
+ function Je(t) {
3871
3883
  return {
3872
3884
  ok: !1,
3873
3885
  error: {
@@ -3881,7 +3893,7 @@ async function In(t, e, r, n) {
3881
3893
  var h;
3882
3894
  const i = (t === "tab_set_files" ? tn : Xr).safeParse(e);
3883
3895
  if (!i.success)
3884
- return Ge(
3896
+ return Je(
3885
3897
  ((h = i.error.issues[0]) == null ? void 0 : h.message) ?? "Invalid setFiles params"
3886
3898
  );
3887
3899
  const o = i.data, a = [];
@@ -3906,14 +3918,14 @@ async function In(t, e, r, n) {
3906
3918
  });
3907
3919
  } catch (m) {
3908
3920
  const R = m instanceof Error ? m.message : String(m);
3909
- return Ge(`Failed to read path ${d.path}: ${R}`);
3921
+ return Je(`Failed to read path ${d.path}: ${R}`);
3910
3922
  }
3911
3923
  continue;
3912
3924
  }
3913
3925
  if (d.handle) {
3914
3926
  const m = kn(r, d.handle);
3915
3927
  if (!m)
3916
- return Ge(`Unknown or expired handle: ${d.handle}`);
3928
+ return Je(`Unknown or expired handle: ${d.handle}`);
3917
3929
  a.push({
3918
3930
  kind: "bytes",
3919
3931
  name: d.name ?? d.handle,
@@ -3930,21 +3942,21 @@ async function In(t, e, r, n) {
3930
3942
  }
3931
3943
  };
3932
3944
  }
3933
- const Fe = /* @__PURE__ */ new Map();
3945
+ const Ue = /* @__PURE__ */ new Map();
3934
3946
  function En(t, e) {
3935
- Fe.set(t, e);
3947
+ Ue.set(t, e);
3936
3948
  }
3937
3949
  function Rn(t) {
3938
- const e = Fe.get(t);
3939
- return e !== void 0 && Fe.delete(t), e;
3950
+ const e = Ue.get(t);
3951
+ return e !== void 0 && Ue.delete(t), e;
3940
3952
  }
3941
3953
  function An() {
3942
- Fe.clear();
3954
+ Ue.clear();
3943
3955
  }
3944
3956
  const zt = /* @__PURE__ */ new Set(["page_set_files", "tab_set_files"]), qt = /* @__PURE__ */ new Set(["page_fetch", "tab_fetch"]);
3945
3957
  let se = null, at = !1;
3946
3958
  const he = /* @__PURE__ */ new Map();
3947
- function Ue(t, e) {
3959
+ function Be(t, e) {
3948
3960
  try {
3949
3961
  return t.postMessage(e), !0;
3950
3962
  } catch (r) {
@@ -3954,7 +3966,7 @@ function Ue(t, e) {
3954
3966
  }
3955
3967
  const Rt = 1e3;
3956
3968
  function Ht(t, e, r) {
3957
- e === "main-thread" || e === "content-script" ? Ue(r, { type: "relayCancel", id: t, owner: e }) : Ue(r, { type: "registryCallCancel", id: t });
3969
+ e === "main-thread" || e === "content-script" ? Be(r, { type: "relayCancel", id: t, owner: e }) : Be(r, { type: "registryCallCancel", id: t });
3958
3970
  }
3959
3971
  function At(t, e) {
3960
3972
  for (const [r, n] of he)
@@ -4020,8 +4032,8 @@ function Nn() {
4020
4032
  function Mn(t) {
4021
4033
  return ir(t);
4022
4034
  }
4023
- const ot = /* @__PURE__ */ new Map(), Me = /* @__PURE__ */ new Map();
4024
- function $n(t, e) {
4035
+ const ot = /* @__PURE__ */ new Map(), Pe = /* @__PURE__ */ new Map();
4036
+ function Pn(t, e) {
4025
4037
  var r;
4026
4038
  if (ot.has(t))
4027
4039
  throw new Error(`Worker port already registered for owner: ${t}`);
@@ -4037,12 +4049,12 @@ function $n(t, e) {
4037
4049
  return;
4038
4050
  }
4039
4051
  if (s !== null && s.type === "registryCallCancel" && typeof s.id == "string") {
4040
- (i = Me.get(s.id)) == null || i.abort(), Me.delete(s.id);
4052
+ (i = Pe.get(s.id)) == null || i.abort(), Pe.delete(s.id);
4041
4053
  return;
4042
4054
  }
4043
4055
  if (s !== null && s.type === "registryCall" && typeof s.id == "string" && typeof s.action == "string") {
4044
4056
  const o = s.id, a = new AbortController();
4045
- Me.set(o, a);
4057
+ Pe.set(o, a);
4046
4058
  const h = de.get(s.action);
4047
4059
  let d;
4048
4060
  if (!h)
@@ -4074,7 +4086,7 @@ function $n(t, e) {
4074
4086
  }
4075
4087
  };
4076
4088
  }
4077
- Me.delete(o), Ue(e, { type: "registryCallResult", id: o, result: d }) || ct(o, {
4089
+ Pe.delete(o), Be(e, { type: "registryCallResult", id: o, result: d }) || ct(o, {
4078
4090
  ok: !1,
4079
4091
  error: {
4080
4092
  message: "Failed to deliver worker handler response",
@@ -4089,7 +4101,7 @@ function ct(t, e) {
4089
4101
  const r = he.get(t);
4090
4102
  return r ? (r.settle(e), !0) : (C.warn("asyncRelayResult_no_pending_relay", { id: t }), !1);
4091
4103
  }
4092
- function Pn(t) {
4104
+ function $n(t) {
4093
4105
  if (t === "main-thread" || t === "content-script")
4094
4106
  return self;
4095
4107
  const e = ot.get(t);
@@ -4112,7 +4124,7 @@ function Jt(t) {
4112
4124
  H.code = "E_ABORT", m(H);
4113
4125
  return;
4114
4126
  }
4115
- const R = Pn(e);
4127
+ const R = $n(e);
4116
4128
  if (!R) {
4117
4129
  m(new Error(`No port available for action: ${r}`));
4118
4130
  return;
@@ -4125,32 +4137,32 @@ function Jt(t) {
4125
4137
  );
4126
4138
  return;
4127
4139
  }
4128
- const $ = Nn();
4140
+ const P = Nn();
4129
4141
  let Q = !1;
4130
4142
  const le = (H) => {
4131
- Q || (Q = !0, clearTimeout(mt), a != null && a.signal && a.signal.removeEventListener("abort", qe), he.delete($), H());
4143
+ Q || (Q = !0, clearTimeout(mt), a != null && a.signal && a.signal.removeEventListener("abort", He), he.delete(P), H());
4132
4144
  }, pt = () => {
4133
- Ht($, e, R);
4134
- }, qe = () => {
4145
+ Ht(P, e, R);
4146
+ }, He = () => {
4135
4147
  pt();
4136
4148
  const H = new Error(`Relay aborted for action: ${r}`);
4137
4149
  H.code = "E_ABORT", le(() => m(H));
4138
4150
  };
4139
- a != null && a.signal && a.signal.addEventListener("abort", qe);
4151
+ a != null && a.signal && a.signal.addEventListener("abort", He);
4140
4152
  const mt = setTimeout(() => {
4141
4153
  pt(), le(() => m(new Error(`Relay timeout for action: ${r}`)));
4142
4154
  }, h);
4143
- he.set($, {
4155
+ he.set(P, {
4144
4156
  settle: (H) => le(() => d(H)),
4145
4157
  timeoutId: mt,
4146
- abort: qe,
4158
+ abort: He,
4147
4159
  owner: e,
4148
4160
  port: R
4149
4161
  });
4150
4162
  const gt = a == null ? void 0 : a.runId, yt = a == null ? void 0 : a.callId;
4151
- Ue(R, {
4163
+ Be(R, {
4152
4164
  type: e === "main-thread" || e === "content-script" ? "asyncRelay" : "registryCall",
4153
- id: $,
4165
+ id: P,
4154
4166
  owner: e,
4155
4167
  action: r,
4156
4168
  params: o,
@@ -4251,8 +4263,8 @@ function qn(t, e) {
4251
4263
  return (async () => {
4252
4264
  try {
4253
4265
  return { ok: !0, value: await m(t, { ...e, signal: R }) };
4254
- } catch ($) {
4255
- const Q = $ instanceof Error ? $.message : String($), le = typeof $ == "object" && $ !== null && "code" in $ && typeof $.code == "string" ? $.code : "E_WORKER_HANDLER";
4266
+ } catch (P) {
4267
+ const Q = P instanceof Error ? P.message : String(P), le = typeof P == "object" && P !== null && "code" in P && typeof P.code == "string" ? P.code : "E_WORKER_HANDLER";
4256
4268
  return { ok: !1, error: { message: Q, code: le } };
4257
4269
  }
4258
4270
  })();
@@ -4314,7 +4326,7 @@ function Fn(t) {
4314
4326
  resolveTimeoutMs: (r) => Kt(t.action, r)
4315
4327
  });
4316
4328
  return async (r, n) => {
4317
- var a;
4329
+ var o;
4318
4330
  const s = pe(r), i = await Qt(
4319
4331
  t.action,
4320
4332
  s,
@@ -4322,18 +4334,23 @@ function Fn(t) {
4322
4334
  );
4323
4335
  if (!i.ok)
4324
4336
  return i;
4325
- const o = await e(i.params, {
4326
- ...n,
4327
- signal: (n == null ? void 0 : n.signal) ?? (n != null && n.runId ? (a = F.get(n.runId)) == null ? void 0 : a.signal : void 0)
4328
- });
4329
- return typeof o == "object" && o !== null && "ok" in o && o.ok && qt.has(t.action) ? {
4330
- ok: !0,
4331
- value: Bt(
4332
- s,
4333
- o.value,
4334
- n == null ? void 0 : n.runId
4335
- )
4336
- } : o;
4337
+ try {
4338
+ const a = await e(i.params, {
4339
+ ...n,
4340
+ signal: (n == null ? void 0 : n.signal) ?? (n != null && n.runId ? (o = F.get(n.runId)) == null ? void 0 : o.signal : void 0)
4341
+ });
4342
+ return typeof a == "object" && a !== null && "ok" in a && a.ok && qt.has(t.action) ? {
4343
+ ok: !0,
4344
+ value: Bt(
4345
+ s,
4346
+ a.value,
4347
+ n == null ? void 0 : n.runId
4348
+ )
4349
+ } : a;
4350
+ } catch (a) {
4351
+ const h = a instanceof Error ? a.message : String(a), d = typeof a == "object" && a !== null && "code" in a && typeof a.code == "string" ? a.code : t.errorCode || "E_RELAY";
4352
+ return { ok: !1, error: { message: h, code: d } };
4353
+ }
4337
4354
  };
4338
4355
  }
4339
4356
  }
@@ -4421,7 +4438,7 @@ function Un(t) {
4421
4438
  }
4422
4439
  async function Bn(t, e) {
4423
4440
  if (at) return;
4424
- await Xt(), se = new er(), Je(0), or(Je), C.trace("initWasm_start"), Un(se), Hr(t);
4441
+ await Xt(), se = new er(), Ye(0), or(Ye), C.trace("initWasm_start"), Un(se), Hr(t);
4425
4442
  const n = t.map((i) => ({
4426
4443
  entry: ur(i),
4427
4444
  callback: Fn(i)
@@ -4464,7 +4481,7 @@ self.onmessage = async (t) => {
4464
4481
  C.error("register_worker_port_missing", { owner: e.owner });
4465
4482
  return;
4466
4483
  }
4467
- $n(e.owner, n);
4484
+ Pn(e.owner, n);
4468
4485
  return;
4469
4486
  }
4470
4487
  if (e.type === "init") {
@@ -4480,7 +4497,7 @@ self.onmessage = async (t) => {
4480
4497
  return;
4481
4498
  }
4482
4499
  if (e.type === "setLogLevel") {
4483
- Je(e.level), ar(Mn(e.level)), C.trace("set_log_level", { level: e.level });
4500
+ Ye(e.level), ar(Mn(e.level)), C.trace("set_log_level", { level: e.level });
4484
4501
  return;
4485
4502
  }
4486
4503
  if (!at || !se) {
@@ -4641,7 +4658,7 @@ export {
4641
4658
  qn as extensionDispatch,
4642
4659
  On as registerWorkerHandler,
4643
4660
  O as registerWorkerHandlerValidated,
4644
- $n as registerWorkerPort,
4661
+ Pn as registerWorkerPort,
4645
4662
  ct as resolveAsyncRelayResult,
4646
4663
  Kt as resolveRelayTimeoutMs,
4647
4664
  Jt as safePostAsCall,