@pi-oxide/extension-js 0.13.0 → 0.13.2

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 (145) hide show
  1. package/content-script.js +3 -3
  2. package/extension_js.d.ts +51 -48
  3. package/extension_js.js +104019 -26171
  4. package/index.js +1067 -949
  5. package/package.json +2 -5
  6. package/worker.js +367 -359
  7. package/content-script/action-result.d.ts +0 -4
  8. package/content-script/dom-tree.d.ts +0 -28
  9. package/content-script/dom-utils.d.ts +0 -37
  10. package/content-script/file-resolution.d.ts +0 -22
  11. package/content-script/form-validation.d.ts +0 -12
  12. package/content-script/handlers.d.ts +0 -3
  13. package/content-script/index.d.ts +0 -6
  14. package/content-script/listbox.d.ts +0 -7
  15. package/content-script/logger.d.ts +0 -12
  16. package/content-script/message-router.d.ts +0 -1
  17. package/content-script/observation-lease.d.ts +0 -55
  18. package/content-script/registry.d.ts +0 -24
  19. package/content-script/schemas.d.ts +0 -5
  20. package/content-script/snapshot.d.ts +0 -3
  21. package/main/index.d.ts +0 -8
  22. package/main/runner/chrome/internals.d.ts +0 -9
  23. package/main/runner/chrome/native.d.ts +0 -6
  24. package/main/runner/command.d.ts +0 -3
  25. package/main/runner/dom/snapshot.d.ts +0 -8
  26. package/main/runner/fetch.d.ts +0 -4
  27. package/main/runner/host.d.ts +0 -3
  28. package/main/runner/index.d.ts +0 -2
  29. package/main/runner/lib/constants.d.ts +0 -14
  30. package/main/runner/lib/host-registry.d.ts +0 -6
  31. package/main/runner/lib/network-tracker.d.ts +0 -16
  32. package/main/runner/lib/params-helpers.d.ts +0 -2
  33. package/main/runner/lib/params.d.ts +0 -5
  34. package/main/runner/lib/types.d.ts +0 -116
  35. package/main/runner/runtime.d.ts +0 -15
  36. package/main/runner/sidepanel/dom.d.ts +0 -6
  37. package/main/runner/snapshot-merge.d.ts +0 -8
  38. package/main/runner/tab/execute.d.ts +0 -24
  39. package/main/runner/tools/aliases.d.ts +0 -1
  40. package/main/runner/tools/chrome/action.d.ts +0 -1
  41. package/main/runner/tools/chrome/alarms.d.ts +0 -1
  42. package/main/runner/tools/chrome/bookmarks.d.ts +0 -1
  43. package/main/runner/tools/chrome/browsing-data.d.ts +0 -1
  44. package/main/runner/tools/chrome/capability.d.ts +0 -30
  45. package/main/runner/tools/chrome/context-menus.d.ts +0 -1
  46. package/main/runner/tools/chrome/cookies.d.ts +0 -1
  47. package/main/runner/tools/chrome/declarative-net-request.d.ts +0 -1
  48. package/main/runner/tools/chrome/desktop-capture.d.ts +0 -1
  49. package/main/runner/tools/chrome/downloads.d.ts +0 -1
  50. package/main/runner/tools/chrome/history.d.ts +0 -1
  51. package/main/runner/tools/chrome/identity.d.ts +0 -1
  52. package/main/runner/tools/chrome/idle.d.ts +0 -1
  53. package/main/runner/tools/chrome/index.d.ts +0 -1
  54. package/main/runner/tools/chrome/management.d.ts +0 -1
  55. package/main/runner/tools/chrome/notifications.d.ts +0 -1
  56. package/main/runner/tools/chrome/offscreen.d.ts +0 -1
  57. package/main/runner/tools/chrome/page-capture.d.ts +0 -1
  58. package/main/runner/tools/chrome/permissions.d.ts +0 -1
  59. package/main/runner/tools/chrome/register-helpers.d.ts +0 -9
  60. package/main/runner/tools/chrome/runtime.d.ts +0 -1
  61. package/main/runner/tools/chrome/scripting.d.ts +0 -1
  62. package/main/runner/tools/chrome/sessions.d.ts +0 -1
  63. package/main/runner/tools/chrome/side-panel.d.ts +0 -1
  64. package/main/runner/tools/chrome/system.d.ts +0 -1
  65. package/main/runner/tools/chrome/tab-groups.d.ts +0 -1
  66. package/main/runner/tools/chrome/tabs.d.ts +0 -1
  67. package/main/runner/tools/chrome/top-sites.d.ts +0 -1
  68. package/main/runner/tools/chrome/windows.d.ts +0 -1
  69. package/main/runner/tools/chrome-storage.d.ts +0 -1
  70. package/main/runner/tools/clipboard.d.ts +0 -1
  71. package/main/runner/tools/dom.d.ts +0 -1
  72. package/main/runner/tools/host-call.d.ts +0 -1
  73. package/main/runner/tools/network.d.ts +0 -1
  74. package/main/runner/tools/page.d.ts +0 -1
  75. package/main/runner/tools/sidepanel.d.ts +0 -1
  76. package/main/runner/tools/storage.d.ts +0 -1
  77. package/main/runner/tools/tab.d.ts +0 -1
  78. package/main/session/extension-session.d.ts +0 -106
  79. package/main/tab-context.d.ts +0 -12
  80. package/shared/array-buffer.d.ts +0 -4
  81. package/shared/collect-inline-snapshot.d.ts +0 -50
  82. package/shared/cross/agent-errors.d.ts +0 -28
  83. package/shared/cross/array-buffer.d.ts +0 -4
  84. package/shared/cross/collect-inline-snapshot.d.ts +0 -58
  85. package/shared/cross/content-script-actions.d.ts +0 -7
  86. package/shared/cross/content-script-tools.d.ts +0 -3
  87. package/shared/cross/dispatch.d.ts +0 -5
  88. package/shared/cross/fetch-response.d.ts +0 -12
  89. package/shared/cross/format-types.d.ts +0 -43
  90. package/shared/cross/fs-types.d.ts +0 -81
  91. package/shared/cross/generated.d.ts +0 -328
  92. package/shared/cross/manifest.d.ts +0 -130
  93. package/shared/cross/normalize-agent-error.d.ts +0 -17
  94. package/shared/cross/page-specs.d.ts +0 -7
  95. package/shared/cross/schemas/chrome.d.ts +0 -56
  96. package/shared/cross/schemas/clipboard.d.ts +0 -19
  97. package/shared/cross/schemas/fs.d.ts +0 -65
  98. package/shared/cross/schemas/helpers.d.ts +0 -71
  99. package/shared/cross/schemas/host.d.ts +0 -15
  100. package/shared/cross/schemas/network.d.ts +0 -34
  101. package/shared/cross/schemas/page.d.ts +0 -494
  102. package/shared/cross/schemas/returns.d.ts +0 -8791
  103. package/shared/cross/schemas/sidepanel.d.ts +0 -284
  104. package/shared/cross/schemas/snapshot.d.ts +0 -272
  105. package/shared/cross/schemas/storage.d.ts +0 -60
  106. package/shared/cross/schemas/tab.d.ts +0 -597
  107. package/shared/cross/schemas.d.ts +0 -12
  108. package/shared/cross/snapshot-filter.d.ts +0 -15
  109. package/shared/cross/tab-specs.d.ts +0 -3
  110. package/shared/cross/types.d.ts +0 -12
  111. package/shared/cross/zod-to-docs.d.ts +0 -28
  112. package/shared/cs/ref-id.d.ts +0 -5
  113. package/shared/cs/snapshot-dom.d.ts +0 -47
  114. package/shared/fetch-response.d.ts +0 -12
  115. package/shared/fs-types.d.ts +0 -81
  116. package/shared/generated.d.ts +0 -241
  117. package/shared/log-levels.d.ts +0 -5
  118. package/shared/logger.d.ts +0 -18
  119. package/shared/main/content-script-response.d.ts +0 -5
  120. package/shared/main/define-content-script-tool.d.ts +0 -7
  121. package/shared/main/log-levels.d.ts +0 -5
  122. package/shared/main/logger.d.ts +0 -18
  123. package/shared/main/routes.d.ts +0 -14
  124. package/shared/main/tool-registry.d.ts +0 -19
  125. package/shared/ref-id.d.ts +0 -5
  126. package/shared/registry/agent-errors.d.ts +0 -27
  127. package/shared/registry/content-script-actions.d.ts +0 -7
  128. package/shared/registry/content-script-response.d.ts +0 -5
  129. package/shared/registry/content-script-tools.d.ts +0 -13
  130. package/shared/registry/define-content-script-tool.d.ts +0 -7
  131. package/shared/registry/dispatch.d.ts +0 -5
  132. package/shared/registry/manifest.d.ts +0 -130
  133. package/shared/registry/normalize-agent-error.d.ts +0 -17
  134. package/shared/registry/routes.d.ts +0 -14
  135. package/shared/registry/types.d.ts +0 -12
  136. package/shared/registry/zod-to-docs.d.ts +0 -28
  137. package/shared/schemas.d.ts +0 -10663
  138. package/shared/snapshot-dom.d.ts +0 -47
  139. package/shared/snapshot-filter.d.ts +0 -15
  140. package/shared/tool-registry.d.ts +0 -19
  141. package/worker/binary-blob-store.d.ts +0 -12
  142. package/worker/fetch-store.d.ts +0 -1
  143. package/worker/resolve-set-files.d.ts +0 -22
  144. package/worker/vfs-write-cache.d.ts +0 -3
  145. package/worker/worker.d.ts +0 -84
package/worker.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import sr, { setLogLevel as Ye, ExtensionSession as ir, registerJsCallBatch as ar, takeCachedVfsWriteBase64 as or, webFsReadBase64 as dr, clearVfsWriteCache as cr } from "./extension_js.js";
2
- function he(t) {
2
+ function me(t) {
3
3
  return t == null ? {} : t instanceof Map ? Object.fromEntries(
4
4
  [...t.entries()].map(([e, r]) => [
5
5
  e,
6
- he(r)
6
+ me(r)
7
7
  ])
8
- ) : Array.isArray(t) ? t.map(he) : t;
8
+ ) : Array.isArray(t) ? t.map(me) : t;
9
9
  }
10
10
  function lr(t) {
11
11
  return {
@@ -145,7 +145,7 @@ const g = E.arrayToEnum([
145
145
  "not_multiple_of",
146
146
  "not_finite"
147
147
  ]);
148
- class D extends Error {
148
+ class Z extends Error {
149
149
  get errors() {
150
150
  return this.issues;
151
151
  }
@@ -174,15 +174,15 @@ class D extends Error {
174
174
  else {
175
175
  let o = n, p = 0;
176
176
  for (; p < d.path.length; ) {
177
- const c = d.path[p];
178
- p === d.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(r(d))) : o[c] = o[c] || { _errors: [] }, o = o[c], p++;
177
+ const l = d.path[p];
178
+ p === d.path.length - 1 ? (o[l] = o[l] || { _errors: [] }, o[l]._errors.push(r(d))) : o[l] = o[l] || { _errors: [] }, o = o[l], p++;
179
179
  }
180
180
  }
181
181
  };
182
182
  return s(this), n;
183
183
  }
184
184
  static assert(e) {
185
- if (!(e instanceof D))
185
+ if (!(e instanceof Z))
186
186
  throw new Error(`Not a ZodError: ${e}`);
187
187
  }
188
188
  toString() {
@@ -208,8 +208,8 @@ class D extends Error {
208
208
  return this.flatten();
209
209
  }
210
210
  }
211
- D.create = (t) => new D(t);
212
- const Te = (t, e) => {
211
+ Z.create = (t) => new Z(t);
212
+ const Se = (t, e) => {
213
213
  let r;
214
214
  switch (t.code) {
215
215
  case u.invalid_type:
@@ -265,7 +265,7 @@ const Te = (t, e) => {
265
265
  }
266
266
  return { message: r };
267
267
  };
268
- let ur = Te;
268
+ let ur = Se;
269
269
  function Ke() {
270
270
  return ur;
271
271
  }
@@ -281,9 +281,9 @@ const Qe = (t) => {
281
281
  message: s.message
282
282
  };
283
283
  let o = "";
284
- const p = n.filter((c) => !!c).slice().reverse();
285
- for (const c of p)
286
- o = c(d, { data: e, defaultError: o }).message;
284
+ const p = n.filter((l) => !!l).slice().reverse();
285
+ for (const l of p)
286
+ o = l(d, { data: e, defaultError: o }).message;
287
287
  return {
288
288
  ...s,
289
289
  path: i,
@@ -302,7 +302,7 @@ function h(t, e) {
302
302
  // then schema-bound map if available
303
303
  r,
304
304
  // then global override map
305
- r === Te ? void 0 : Te
305
+ r === Se ? void 0 : Se
306
306
  // then global default map
307
307
  ].filter((s) => !!s)
308
308
  });
@@ -351,7 +351,7 @@ class L {
351
351
  }
352
352
  const k = Object.freeze({
353
353
  status: "aborted"
354
- }), ve = (t) => ({ status: "dirty", value: t }), P = (t) => ({ status: "valid", value: t }), vt = (t) => t.status === "aborted", kt = (t) => t.status === "dirty", me = (t) => t.status === "valid", je = (t) => typeof Promise < "u" && t instanceof Promise;
354
+ }), ke = (t) => ({ status: "dirty", value: t }), P = (t) => ({ status: "valid", value: t }), vt = (t) => t.status === "aborted", kt = (t) => t.status === "dirty", ge = (t) => t.status === "valid", je = (t) => typeof Promise < "u" && t instanceof Promise;
355
355
  var y;
356
356
  (function(t) {
357
357
  t.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, t.toString = (e) => typeof e == "string" ? e : e == null ? void 0 : e.message;
@@ -365,7 +365,7 @@ class H {
365
365
  }
366
366
  }
367
367
  const wt = (t, e) => {
368
- if (me(e))
368
+ if (ge(e))
369
369
  return { success: !0, data: e.value };
370
370
  if (!t.common.issues.length)
371
371
  throw new Error("Validation failed but no issues detected.");
@@ -374,7 +374,7 @@ const wt = (t, e) => {
374
374
  get error() {
375
375
  if (this._error)
376
376
  return this._error;
377
- const r = new D(t.common.issues);
377
+ const r = new Z(t.common.issues);
378
378
  return this._error = r, this._error;
379
379
  }
380
380
  };
@@ -467,7 +467,7 @@ class S {
467
467
  if (!this["~standard"].async)
468
468
  try {
469
469
  const i = this._parseSync({ data: e, path: [], parent: r });
470
- return me(i) ? {
470
+ return ge(i) ? {
471
471
  value: i.value
472
472
  } : {
473
473
  issues: r.common.issues
@@ -478,7 +478,7 @@ class S {
478
478
  async: !0
479
479
  };
480
480
  }
481
- return this._parseAsync({ data: e, path: [], parent: r }).then((i) => me(i) ? {
481
+ return this._parseAsync({ data: e, path: [], parent: r }).then((i) => ge(i) ? {
482
482
  value: i.value
483
483
  } : {
484
484
  issues: r.common.issues
@@ -548,13 +548,13 @@ class S {
548
548
  return F.create(this);
549
549
  }
550
550
  promise() {
551
- return ye.create(this, this._def);
551
+ return be.create(this, this._def);
552
552
  }
553
553
  or(e) {
554
- return Ee.create([this, e], this._def);
554
+ return Re.create([this, e], this._def);
555
555
  }
556
556
  and(e) {
557
- return Re.create(this, e, this._def);
557
+ return Ce.create(this, e, this._def);
558
558
  }
559
559
  transform(e) {
560
560
  return new X({
@@ -566,7 +566,7 @@ class S {
566
566
  }
567
567
  default(e) {
568
568
  const r = typeof e == "function" ? e : () => e;
569
- return new Me({
569
+ return new Ne({
570
570
  ...x(this._def),
571
571
  innerType: this,
572
572
  defaultValue: r,
@@ -582,7 +582,7 @@ class S {
582
582
  }
583
583
  catch(e) {
584
584
  const r = typeof e == "function" ? e : () => e;
585
- return new Ne({
585
+ return new $e({
586
586
  ...x(this._def),
587
587
  innerType: this,
588
588
  catchValue: r,
@@ -600,7 +600,7 @@ class S {
600
600
  return qe.create(this, e);
601
601
  }
602
602
  readonly() {
603
- return $e.create(this);
603
+ return Le.create(this);
604
604
  }
605
605
  isOptional() {
606
606
  return this.safeParse(void 0).success;
@@ -1355,7 +1355,7 @@ De.create = (t) => new De({
1355
1355
  coerce: (t == null ? void 0 : t.coerce) || !1,
1356
1356
  ...x(t)
1357
1357
  });
1358
- class Se extends S {
1358
+ class Ie extends S {
1359
1359
  _parse(e) {
1360
1360
  if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
1361
1361
  const i = this._getOrReturnCtx(e);
@@ -1395,7 +1395,7 @@ class Se extends S {
1395
1395
  };
1396
1396
  }
1397
1397
  _addCheck(e) {
1398
- return new Se({
1398
+ return new Ie({
1399
1399
  ...this._def,
1400
1400
  checks: [...this._def.checks, e]
1401
1401
  });
@@ -1427,7 +1427,7 @@ class Se extends S {
1427
1427
  return e != null ? new Date(e) : null;
1428
1428
  }
1429
1429
  }
1430
- Se.create = (t) => new Se({
1430
+ Ie.create = (t) => new Ie({
1431
1431
  checks: [],
1432
1432
  coerce: (t == null ? void 0 : t.coerce) || !1,
1433
1433
  typeName: w.ZodDate,
@@ -1467,7 +1467,7 @@ Ze.create = (t) => new Ze({
1467
1467
  typeName: w.ZodUndefined,
1468
1468
  ...x(t)
1469
1469
  });
1470
- class Ie extends S {
1470
+ class Ee extends S {
1471
1471
  _parse(e) {
1472
1472
  if (this._getType(e) !== g.null) {
1473
1473
  const n = this._getOrReturnCtx(e);
@@ -1480,7 +1480,7 @@ class Ie extends S {
1480
1480
  return P(e.data);
1481
1481
  }
1482
1482
  }
1483
- Ie.create = (t) => new Ie({
1483
+ Ee.create = (t) => new Ee({
1484
1484
  typeName: w.ZodNull,
1485
1485
  ...x(t)
1486
1486
  });
@@ -1612,12 +1612,12 @@ F.create = (t, e) => new F({
1612
1612
  typeName: w.ZodArray,
1613
1613
  ...x(e)
1614
1614
  });
1615
- function fe(t) {
1615
+ function pe(t) {
1616
1616
  if (t instanceof A) {
1617
1617
  const e = {};
1618
1618
  for (const r in t.shape) {
1619
1619
  const n = t.shape[r];
1620
- e[r] = U.create(fe(n));
1620
+ e[r] = U.create(pe(n));
1621
1621
  }
1622
1622
  return new A({
1623
1623
  ...t._def,
@@ -1625,8 +1625,8 @@ function fe(t) {
1625
1625
  });
1626
1626
  } else return t instanceof F ? new F({
1627
1627
  ...t._def,
1628
- type: fe(t.element)
1629
- }) : t instanceof U ? U.create(fe(t.unwrap())) : t instanceof ie ? ie.create(fe(t.unwrap())) : t instanceof G ? G.create(t.items.map((e) => fe(e))) : t;
1628
+ type: pe(t.element)
1629
+ }) : t instanceof U ? U.create(pe(t.unwrap())) : t instanceof ie ? ie.create(pe(t.unwrap())) : t instanceof G ? G.create(t.items.map((e) => pe(e))) : t;
1630
1630
  }
1631
1631
  class A extends S {
1632
1632
  constructor() {
@@ -1640,47 +1640,47 @@ class A extends S {
1640
1640
  }
1641
1641
  _parse(e) {
1642
1642
  if (this._getType(e) !== g.object) {
1643
- const c = this._getOrReturnCtx(e);
1644
- return h(c, {
1643
+ const l = this._getOrReturnCtx(e);
1644
+ return h(l, {
1645
1645
  code: u.invalid_type,
1646
1646
  expected: g.object,
1647
- received: c.parsedType
1647
+ received: l.parsedType
1648
1648
  }), k;
1649
1649
  }
1650
1650
  const { status: n, ctx: s } = this._processInputParams(e), { shape: i, keys: d } = this._getCached(), o = [];
1651
1651
  if (!(this._def.catchall instanceof ne && this._def.unknownKeys === "strip"))
1652
- for (const c in s.data)
1653
- d.includes(c) || o.push(c);
1652
+ for (const l in s.data)
1653
+ d.includes(l) || o.push(l);
1654
1654
  const p = [];
1655
- for (const c of d) {
1656
- const m = i[c], R = s.data[c];
1655
+ for (const l of d) {
1656
+ const m = i[l], R = s.data[l];
1657
1657
  p.push({
1658
- key: { status: "valid", value: c },
1659
- value: m._parse(new H(s, R, s.path, c)),
1660
- alwaysSet: c in s.data
1658
+ key: { status: "valid", value: l },
1659
+ value: m._parse(new H(s, R, s.path, l)),
1660
+ alwaysSet: l in s.data
1661
1661
  });
1662
1662
  }
1663
1663
  if (this._def.catchall instanceof ne) {
1664
- const c = this._def.unknownKeys;
1665
- if (c === "passthrough")
1664
+ const l = this._def.unknownKeys;
1665
+ if (l === "passthrough")
1666
1666
  for (const m of o)
1667
1667
  p.push({
1668
1668
  key: { status: "valid", value: m },
1669
1669
  value: { status: "valid", value: s.data[m] }
1670
1670
  });
1671
- else if (c === "strict")
1671
+ else if (l === "strict")
1672
1672
  o.length > 0 && (h(s, {
1673
1673
  code: u.unrecognized_keys,
1674
1674
  keys: o
1675
1675
  }), n.dirty());
1676
- else if (c !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1676
+ else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
1677
1677
  } else {
1678
- const c = this._def.catchall;
1678
+ const l = this._def.catchall;
1679
1679
  for (const m of o) {
1680
1680
  const R = s.data[m];
1681
1681
  p.push({
1682
1682
  key: { status: "valid", value: m },
1683
- value: c._parse(
1683
+ value: l._parse(
1684
1684
  new H(s, R, s.path, m)
1685
1685
  //, ctx.child(key), value, getParsedType(value)
1686
1686
  ),
@@ -1689,17 +1689,17 @@ class A extends S {
1689
1689
  }
1690
1690
  }
1691
1691
  return s.common.async ? Promise.resolve().then(async () => {
1692
- const c = [];
1692
+ const l = [];
1693
1693
  for (const m of p) {
1694
1694
  const R = await m.key, $ = await m.value;
1695
- c.push({
1695
+ l.push({
1696
1696
  key: R,
1697
1697
  value: $,
1698
1698
  alwaysSet: m.alwaysSet
1699
1699
  });
1700
1700
  }
1701
- return c;
1702
- }).then((c) => L.mergeObjectSync(n, c)) : L.mergeObjectSync(n, p);
1701
+ return l;
1702
+ }).then((l) => L.mergeObjectSync(n, l)) : L.mergeObjectSync(n, p);
1703
1703
  }
1704
1704
  get shape() {
1705
1705
  return this._def.shape();
@@ -1862,7 +1862,7 @@ class A extends S {
1862
1862
  * @deprecated
1863
1863
  */
1864
1864
  deepPartial() {
1865
- return fe(this);
1865
+ return pe(this);
1866
1866
  }
1867
1867
  partial(e) {
1868
1868
  const r = {};
@@ -1916,7 +1916,7 @@ A.lazycreate = (t, e) => new A({
1916
1916
  typeName: w.ZodObject,
1917
1917
  ...x(e)
1918
1918
  });
1919
- class Ee extends S {
1919
+ class Re extends S {
1920
1920
  _parse(e) {
1921
1921
  const { ctx: r } = this._processInputParams(e), n = this._def.options;
1922
1922
  function s(i) {
@@ -1926,7 +1926,7 @@ class Ee extends S {
1926
1926
  for (const o of i)
1927
1927
  if (o.result.status === "dirty")
1928
1928
  return r.common.issues.push(...o.ctx.common.issues), o.result;
1929
- const d = i.map((o) => new D(o.ctx.common.issues));
1929
+ const d = i.map((o) => new Z(o.ctx.common.issues));
1930
1930
  return h(r, {
1931
1931
  code: u.invalid_union,
1932
1932
  unionErrors: d
@@ -1955,7 +1955,7 @@ class Ee extends S {
1955
1955
  let i;
1956
1956
  const d = [];
1957
1957
  for (const p of n) {
1958
- const c = {
1958
+ const l = {
1959
1959
  ...r,
1960
1960
  common: {
1961
1961
  ...r.common,
@@ -1965,15 +1965,15 @@ class Ee extends S {
1965
1965
  }, m = p._parseSync({
1966
1966
  data: r.data,
1967
1967
  path: r.path,
1968
- parent: c
1968
+ parent: l
1969
1969
  });
1970
1970
  if (m.status === "valid")
1971
1971
  return m;
1972
- m.status === "dirty" && !i && (i = { result: m, ctx: c }), c.common.issues.length && d.push(c.common.issues);
1972
+ m.status === "dirty" && !i && (i = { result: m, ctx: l }), l.common.issues.length && d.push(l.common.issues);
1973
1973
  }
1974
1974
  if (i)
1975
1975
  return r.common.issues.push(...i.ctx.common.issues), i.result;
1976
- const o = d.map((p) => new D(p));
1976
+ const o = d.map((p) => new Z(p));
1977
1977
  return h(r, {
1978
1978
  code: u.invalid_union,
1979
1979
  unionErrors: o
@@ -1984,12 +1984,12 @@ class Ee extends S {
1984
1984
  return this._def.options;
1985
1985
  }
1986
1986
  }
1987
- Ee.create = (t, e) => new Ee({
1987
+ Re.create = (t, e) => new Re({
1988
1988
  options: t,
1989
1989
  typeName: w.ZodUnion,
1990
1990
  ...x(e)
1991
1991
  });
1992
- const Q = (t) => t instanceof Ae ? Q(t.schema) : t instanceof X ? Q(t.innerType()) : t instanceof Oe ? [t.value] : t instanceof se ? t.options : t instanceof nt ? E.objectValues(t.enum) : t instanceof Me ? Q(t._def.innerType) : t instanceof Ze ? [void 0] : t instanceof Ie ? [null] : t instanceof U ? [void 0, ...Q(t.unwrap())] : t instanceof ie ? [null, ...Q(t.unwrap())] : t instanceof ct || t instanceof $e ? Q(t.unwrap()) : t instanceof Ne ? Q(t._def.innerType) : [];
1992
+ const Q = (t) => t instanceof Oe ? Q(t.schema) : t instanceof X ? Q(t.innerType()) : t instanceof Me ? [t.value] : t instanceof se ? t.options : t instanceof nt ? E.objectValues(t.enum) : t instanceof Ne ? Q(t._def.innerType) : t instanceof Ze ? [void 0] : t instanceof Ee ? [null] : t instanceof U ? [void 0, ...Q(t.unwrap())] : t instanceof ie ? [null, ...Q(t.unwrap())] : t instanceof ct || t instanceof Le ? Q(t.unwrap()) : t instanceof $e ? Q(t._def.innerType) : [];
1993
1993
  class ze extends S {
1994
1994
  _parse(e) {
1995
1995
  const { ctx: r } = this._processInputParams(e);
@@ -2078,7 +2078,7 @@ function tt(t, e) {
2078
2078
  return { valid: !0, data: s };
2079
2079
  } else return r === g.date && n === g.date && +t == +e ? { valid: !0, data: t } : { valid: !1 };
2080
2080
  }
2081
- class Re extends S {
2081
+ class Ce extends S {
2082
2082
  _parse(e) {
2083
2083
  const { status: r, ctx: n } = this._processInputParams(e), s = (i, d) => {
2084
2084
  if (vt(i) || vt(d))
@@ -2110,7 +2110,7 @@ class Re extends S {
2110
2110
  }));
2111
2111
  }
2112
2112
  }
2113
- Re.create = (t, e, r) => new Re({
2113
+ Ce.create = (t, e, r) => new Ce({
2114
2114
  left: t,
2115
2115
  right: e,
2116
2116
  typeName: w.ZodIntersection,
@@ -2166,7 +2166,7 @@ G.create = (t, e) => {
2166
2166
  ...x(e)
2167
2167
  });
2168
2168
  };
2169
- class Ce extends S {
2169
+ class Ae extends S {
2170
2170
  get keySchema() {
2171
2171
  return this._def.keyType;
2172
2172
  }
@@ -2194,12 +2194,12 @@ class Ce extends S {
2194
2194
  return this._def.valueType;
2195
2195
  }
2196
2196
  static create(e, r, n) {
2197
- return r instanceof S ? new Ce({
2197
+ return r instanceof S ? new Ae({
2198
2198
  keyType: e,
2199
2199
  valueType: r,
2200
2200
  typeName: w.ZodRecord,
2201
2201
  ...x(n)
2202
- }) : new Ce({
2202
+ }) : new Ae({
2203
2203
  keyType: q.create(),
2204
2204
  valueType: e,
2205
2205
  typeName: w.ZodRecord,
@@ -2222,28 +2222,28 @@ class rt extends S {
2222
2222
  expected: g.map,
2223
2223
  received: n.parsedType
2224
2224
  }), k;
2225
- const s = this._def.keyType, i = this._def.valueType, d = [...n.data.entries()].map(([o, p], c) => ({
2226
- key: s._parse(new H(n, o, n.path, [c, "key"])),
2227
- value: i._parse(new H(n, p, n.path, [c, "value"]))
2225
+ const s = this._def.keyType, i = this._def.valueType, d = [...n.data.entries()].map(([o, p], l) => ({
2226
+ key: s._parse(new H(n, o, n.path, [l, "key"])),
2227
+ value: i._parse(new H(n, p, n.path, [l, "value"]))
2228
2228
  }));
2229
2229
  if (n.common.async) {
2230
2230
  const o = /* @__PURE__ */ new Map();
2231
2231
  return Promise.resolve().then(async () => {
2232
2232
  for (const p of d) {
2233
- const c = await p.key, m = await p.value;
2234
- if (c.status === "aborted" || m.status === "aborted")
2233
+ const l = await p.key, m = await p.value;
2234
+ if (l.status === "aborted" || m.status === "aborted")
2235
2235
  return k;
2236
- (c.status === "dirty" || m.status === "dirty") && r.dirty(), o.set(c.value, m.value);
2236
+ (l.status === "dirty" || m.status === "dirty") && r.dirty(), o.set(l.value, m.value);
2237
2237
  }
2238
2238
  return { status: r.value, value: o };
2239
2239
  });
2240
2240
  } else {
2241
2241
  const o = /* @__PURE__ */ new Map();
2242
2242
  for (const p of d) {
2243
- const c = p.key, m = p.value;
2244
- if (c.status === "aborted" || m.status === "aborted")
2243
+ const l = p.key, m = p.value;
2244
+ if (l.status === "aborted" || m.status === "aborted")
2245
2245
  return k;
2246
- (c.status === "dirty" || m.status === "dirty") && r.dirty(), o.set(c.value, m.value);
2246
+ (l.status === "dirty" || m.status === "dirty") && r.dirty(), o.set(l.value, m.value);
2247
2247
  }
2248
2248
  return { status: r.value, value: o };
2249
2249
  }
@@ -2255,7 +2255,7 @@ rt.create = (t, e, r) => new rt({
2255
2255
  typeName: w.ZodMap,
2256
2256
  ...x(r)
2257
2257
  });
2258
- class ge extends S {
2258
+ class ye extends S {
2259
2259
  _parse(e) {
2260
2260
  const { status: r, ctx: n } = this._processInputParams(e);
2261
2261
  if (n.parsedType !== g.set)
@@ -2282,25 +2282,25 @@ class ge extends S {
2282
2282
  }), r.dirty());
2283
2283
  const i = this._def.valueType;
2284
2284
  function d(p) {
2285
- const c = /* @__PURE__ */ new Set();
2285
+ const l = /* @__PURE__ */ new Set();
2286
2286
  for (const m of p) {
2287
2287
  if (m.status === "aborted")
2288
2288
  return k;
2289
- m.status === "dirty" && r.dirty(), c.add(m.value);
2289
+ m.status === "dirty" && r.dirty(), l.add(m.value);
2290
2290
  }
2291
- return { status: r.value, value: c };
2291
+ return { status: r.value, value: l };
2292
2292
  }
2293
- const o = [...n.data.values()].map((p, c) => i._parse(new H(n, p, n.path, c)));
2293
+ const o = [...n.data.values()].map((p, l) => i._parse(new H(n, p, n.path, l)));
2294
2294
  return n.common.async ? Promise.all(o).then((p) => d(p)) : d(o);
2295
2295
  }
2296
2296
  min(e, r) {
2297
- return new ge({
2297
+ return new ye({
2298
2298
  ...this._def,
2299
2299
  minSize: { value: e, message: y.toString(r) }
2300
2300
  });
2301
2301
  }
2302
2302
  max(e, r) {
2303
- return new ge({
2303
+ return new ye({
2304
2304
  ...this._def,
2305
2305
  maxSize: { value: e, message: y.toString(r) }
2306
2306
  });
@@ -2312,14 +2312,14 @@ class ge extends S {
2312
2312
  return this.min(1, e);
2313
2313
  }
2314
2314
  }
2315
- ge.create = (t, e) => new ge({
2315
+ ye.create = (t, e) => new ye({
2316
2316
  valueType: t,
2317
2317
  minSize: null,
2318
2318
  maxSize: null,
2319
2319
  typeName: w.ZodSet,
2320
2320
  ...x(e)
2321
2321
  });
2322
- class we extends S {
2322
+ class xe extends S {
2323
2323
  constructor() {
2324
2324
  super(...arguments), this.validate = this.implement;
2325
2325
  }
@@ -2335,7 +2335,7 @@ class we extends S {
2335
2335
  return Qe({
2336
2336
  data: o,
2337
2337
  path: r.path,
2338
- errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Ke(), Te].filter((c) => !!c),
2338
+ errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Ke(), Se].filter((l) => !!l),
2339
2339
  issueData: {
2340
2340
  code: u.invalid_arguments,
2341
2341
  argumentsError: p
@@ -2346,7 +2346,7 @@ class we extends S {
2346
2346
  return Qe({
2347
2347
  data: o,
2348
2348
  path: r.path,
2349
- errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Ke(), Te].filter((c) => !!c),
2349
+ errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, Ke(), Se].filter((l) => !!l),
2350
2350
  issueData: {
2351
2351
  code: u.invalid_return_type,
2352
2352
  returnTypeError: p
@@ -2354,25 +2354,25 @@ class we extends S {
2354
2354
  });
2355
2355
  }
2356
2356
  const i = { errorMap: r.common.contextualErrorMap }, d = r.data;
2357
- if (this._def.returns instanceof ye) {
2357
+ if (this._def.returns instanceof be) {
2358
2358
  const o = this;
2359
2359
  return P(async function(...p) {
2360
- const c = new D([]), m = await o._def.args.parseAsync(p, i).catch((te) => {
2361
- throw c.addIssue(n(p, te)), c;
2360
+ const l = new Z([]), m = await o._def.args.parseAsync(p, i).catch((te) => {
2361
+ throw l.addIssue(n(p, te)), l;
2362
2362
  }), R = await Reflect.apply(d, this, m);
2363
2363
  return await o._def.returns._def.type.parseAsync(R, i).catch((te) => {
2364
- throw c.addIssue(s(R, te)), c;
2364
+ throw l.addIssue(s(R, te)), l;
2365
2365
  });
2366
2366
  });
2367
2367
  } else {
2368
2368
  const o = this;
2369
2369
  return P(function(...p) {
2370
- const c = o._def.args.safeParse(p, i);
2371
- if (!c.success)
2372
- throw new D([n(p, c.error)]);
2373
- const m = Reflect.apply(d, this, c.data), R = o._def.returns.safeParse(m, i);
2370
+ const l = o._def.args.safeParse(p, i);
2371
+ if (!l.success)
2372
+ throw new Z([n(p, l.error)]);
2373
+ const m = Reflect.apply(d, this, l.data), R = o._def.returns.safeParse(m, i);
2374
2374
  if (!R.success)
2375
- throw new D([s(m, R.error)]);
2375
+ throw new Z([s(m, R.error)]);
2376
2376
  return R.data;
2377
2377
  });
2378
2378
  }
@@ -2384,13 +2384,13 @@ class we extends S {
2384
2384
  return this._def.returns;
2385
2385
  }
2386
2386
  args(...e) {
2387
- return new we({
2387
+ return new xe({
2388
2388
  ...this._def,
2389
2389
  args: G.create(e).rest(ae.create())
2390
2390
  });
2391
2391
  }
2392
2392
  returns(e) {
2393
- return new we({
2393
+ return new xe({
2394
2394
  ...this._def,
2395
2395
  returns: e
2396
2396
  });
@@ -2402,7 +2402,7 @@ class we extends S {
2402
2402
  return this.parse(e);
2403
2403
  }
2404
2404
  static create(e, r, n) {
2405
- return new we({
2405
+ return new xe({
2406
2406
  args: e || G.create([]).rest(ae.create()),
2407
2407
  returns: r || ae.create(),
2408
2408
  typeName: w.ZodFunction,
@@ -2410,7 +2410,7 @@ class we extends S {
2410
2410
  });
2411
2411
  }
2412
2412
  }
2413
- class Ae extends S {
2413
+ class Oe extends S {
2414
2414
  get schema() {
2415
2415
  return this._def.getter();
2416
2416
  }
@@ -2419,12 +2419,12 @@ class Ae extends S {
2419
2419
  return this._def.getter()._parse({ data: r.data, path: r.path, parent: r });
2420
2420
  }
2421
2421
  }
2422
- Ae.create = (t, e) => new Ae({
2422
+ Oe.create = (t, e) => new Oe({
2423
2423
  getter: t,
2424
2424
  typeName: w.ZodLazy,
2425
2425
  ...x(e)
2426
2426
  });
2427
- class Oe extends S {
2427
+ class Me extends S {
2428
2428
  _parse(e) {
2429
2429
  if (e.data !== this._def.value) {
2430
2430
  const r = this._getOrReturnCtx(e);
@@ -2440,7 +2440,7 @@ class Oe extends S {
2440
2440
  return this._def.value;
2441
2441
  }
2442
2442
  }
2443
- Oe.create = (t, e) => new Oe({
2443
+ Me.create = (t, e) => new Me({
2444
2444
  value: t,
2445
2445
  typeName: w.ZodLiteral,
2446
2446
  ...x(e)
@@ -2537,7 +2537,7 @@ nt.create = (t, e) => new nt({
2537
2537
  typeName: w.ZodNativeEnum,
2538
2538
  ...x(e)
2539
2539
  });
2540
- class ye extends S {
2540
+ class be extends S {
2541
2541
  unwrap() {
2542
2542
  return this._def.type;
2543
2543
  }
@@ -2556,7 +2556,7 @@ class ye extends S {
2556
2556
  })));
2557
2557
  }
2558
2558
  }
2559
- ye.create = (t, e) => new ye({
2559
+ be.create = (t, e) => new be({
2560
2560
  type: t,
2561
2561
  typeName: w.ZodPromise,
2562
2562
  ...x(e)
@@ -2588,7 +2588,7 @@ class X extends S {
2588
2588
  path: n.path,
2589
2589
  parent: n
2590
2590
  });
2591
- return p.status === "aborted" ? k : p.status === "dirty" || r.value === "dirty" ? ve(p.value) : p;
2591
+ return p.status === "aborted" ? k : p.status === "dirty" || r.value === "dirty" ? ke(p.value) : p;
2592
2592
  });
2593
2593
  {
2594
2594
  if (r.value === "aborted")
@@ -2598,7 +2598,7 @@ class X extends S {
2598
2598
  path: n.path,
2599
2599
  parent: n
2600
2600
  });
2601
- return o.status === "aborted" ? k : o.status === "dirty" || r.value === "dirty" ? ve(o.value) : o;
2601
+ return o.status === "aborted" ? k : o.status === "dirty" || r.value === "dirty" ? ke(o.value) : o;
2602
2602
  }
2603
2603
  }
2604
2604
  if (s.type === "refinement") {
@@ -2627,14 +2627,14 @@ class X extends S {
2627
2627
  path: n.path,
2628
2628
  parent: n
2629
2629
  });
2630
- if (!me(d))
2630
+ if (!ge(d))
2631
2631
  return k;
2632
2632
  const o = s.transform(d.value, i);
2633
2633
  if (o instanceof Promise)
2634
2634
  throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
2635
2635
  return { status: r.value, value: o };
2636
2636
  } else
2637
- return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((d) => me(d) ? Promise.resolve(s.transform(d.value, i)).then((o) => ({
2637
+ return this._def.schema._parseAsync({ data: n.data, path: n.path, parent: n }).then((d) => ge(d) ? Promise.resolve(s.transform(d.value, i)).then((o) => ({
2638
2638
  status: r.value,
2639
2639
  value: o
2640
2640
  })) : k);
@@ -2679,7 +2679,7 @@ ie.create = (t, e) => new ie({
2679
2679
  typeName: w.ZodNullable,
2680
2680
  ...x(e)
2681
2681
  });
2682
- class Me extends S {
2682
+ class Ne extends S {
2683
2683
  _parse(e) {
2684
2684
  const { ctx: r } = this._processInputParams(e);
2685
2685
  let n = r.data;
@@ -2693,13 +2693,13 @@ class Me extends S {
2693
2693
  return this._def.innerType;
2694
2694
  }
2695
2695
  }
2696
- Me.create = (t, e) => new Me({
2696
+ Ne.create = (t, e) => new Ne({
2697
2697
  innerType: t,
2698
2698
  typeName: w.ZodDefault,
2699
2699
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
2700
2700
  ...x(e)
2701
2701
  });
2702
- class Ne extends S {
2702
+ class $e extends S {
2703
2703
  _parse(e) {
2704
2704
  const { ctx: r } = this._processInputParams(e), n = {
2705
2705
  ...r,
@@ -2718,7 +2718,7 @@ class Ne extends S {
2718
2718
  status: "valid",
2719
2719
  value: i.status === "valid" ? i.value : this._def.catchValue({
2720
2720
  get error() {
2721
- return new D(n.common.issues);
2721
+ return new Z(n.common.issues);
2722
2722
  },
2723
2723
  input: n.data
2724
2724
  })
@@ -2726,7 +2726,7 @@ class Ne extends S {
2726
2726
  status: "valid",
2727
2727
  value: s.status === "valid" ? s.value : this._def.catchValue({
2728
2728
  get error() {
2729
- return new D(n.common.issues);
2729
+ return new Z(n.common.issues);
2730
2730
  },
2731
2731
  input: n.data
2732
2732
  })
@@ -2736,7 +2736,7 @@ class Ne extends S {
2736
2736
  return this._def.innerType;
2737
2737
  }
2738
2738
  }
2739
- Ne.create = (t, e) => new Ne({
2739
+ $e.create = (t, e) => new $e({
2740
2740
  innerType: t,
2741
2741
  typeName: w.ZodCatch,
2742
2742
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
@@ -2782,7 +2782,7 @@ class qe extends S {
2782
2782
  path: n.path,
2783
2783
  parent: n
2784
2784
  });
2785
- return i.status === "aborted" ? k : i.status === "dirty" ? (r.dirty(), ve(i.value)) : this._def.out._parseAsync({
2785
+ return i.status === "aborted" ? k : i.status === "dirty" ? (r.dirty(), ke(i.value)) : this._def.out._parseAsync({
2786
2786
  data: i.value,
2787
2787
  path: n.path,
2788
2788
  parent: n
@@ -2812,16 +2812,16 @@ class qe extends S {
2812
2812
  });
2813
2813
  }
2814
2814
  }
2815
- class $e extends S {
2815
+ class Le extends S {
2816
2816
  _parse(e) {
2817
- const r = this._def.innerType._parse(e), n = (s) => (me(s) && (s.value = Object.freeze(s.value)), s);
2817
+ const r = this._def.innerType._parse(e), n = (s) => (ge(s) && (s.value = Object.freeze(s.value)), s);
2818
2818
  return je(r) ? r.then((s) => n(s)) : n(r);
2819
2819
  }
2820
2820
  unwrap() {
2821
2821
  return this._def.innerType;
2822
2822
  }
2823
2823
  }
2824
- $e.create = (t, e) => new $e({
2824
+ Le.create = (t, e) => new Le({
2825
2825
  innerType: t,
2826
2826
  typeName: w.ZodReadonly,
2827
2827
  ...x(e)
@@ -2830,12 +2830,12 @@ var w;
2830
2830
  (function(t) {
2831
2831
  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";
2832
2832
  })(w || (w = {}));
2833
- const a = q.create, f = oe.create, Y = de.create, _ = De.create, Lt = Ie.create, v = ae.create;
2833
+ const a = q.create, f = oe.create, Y = de.create, _ = De.create, Lt = Ee.create, v = ae.create;
2834
2834
  ne.create;
2835
- const I = F.create, l = A.create, T = Ee.create, $r = ze.create;
2836
- Re.create;
2837
- const Lr = G.create, b = Ce.create, Pr = Ae.create, xe = Oe.create, Le = se.create;
2838
- ye.create;
2835
+ const I = F.create, c = A.create, T = Re.create, $r = ze.create;
2836
+ Ce.create;
2837
+ const Lr = G.create, b = Ae.create, Pr = Oe.create, Te = Me.create, _e = se.create;
2838
+ be.create;
2839
2839
  U.create;
2840
2840
  ie.create;
2841
2841
  const ee = X.createWithPreprocess;
@@ -2844,24 +2844,24 @@ function N(t, e = 0, r = 2) {
2844
2844
  if (t instanceof A) {
2845
2845
  const n = t.shape, s = Object.keys(n).filter((d) => !d.startsWith("__"));
2846
2846
  return s.length === 0 ? "{ }" : e >= r - 1 ? "{ ... }" : `{ ${s.map((d) => {
2847
- const o = n[d], p = o instanceof U, c = N(p ? o.unwrap() : o, e + 1, r);
2848
- return `${d}${p ? "?" : ""}: ${c}`;
2847
+ const o = n[d], p = o instanceof U, l = N(p ? o.unwrap() : o, e + 1, r);
2848
+ return `${d}${p ? "?" : ""}: ${l}`;
2849
2849
  }).join(", ")} }`;
2850
2850
  }
2851
- if (t instanceof Ee)
2851
+ if (t instanceof Re)
2852
2852
  return t.options.map((n) => N(n, e, r)).join(" or ");
2853
2853
  if (t instanceof q) return "string";
2854
2854
  if (t instanceof oe) return "number";
2855
2855
  if (t instanceof De) return "boolean";
2856
2856
  if (t instanceof de) return "bigint";
2857
- if (t instanceof Ie) return "null";
2857
+ if (t instanceof Ee) return "null";
2858
2858
  if (t instanceof F) {
2859
2859
  const n = N(t.element, e + 1, r);
2860
2860
  return n === "unknown" || n === "any" ? "array" : `${n}[]`;
2861
2861
  }
2862
2862
  if (t instanceof G)
2863
2863
  return `[${t.items.map((n) => N(n, e + 1, r)).join(", ")}]`;
2864
- if (t instanceof Ce) {
2864
+ if (t instanceof Ae) {
2865
2865
  const n = N(
2866
2866
  t._def.valueType,
2867
2867
  e + 1,
@@ -2869,7 +2869,7 @@ function N(t, e = 0, r = 2) {
2869
2869
  );
2870
2870
  return n === "unknown" || n === "any" ? "{ [key: string]: unknown }" : `{ [key: string]: ${n} }`;
2871
2871
  }
2872
- return t instanceof U ? `${N(t.unwrap(), e, r)}?` : t instanceof Oe ? JSON.stringify(t.value) : t instanceof se ? t.options.map((n) => `"${n}"`).join(" | ") : t instanceof Xe ? "any" : t instanceof ae ? "unknown" : t instanceof et ? "void" : t instanceof Ze ? "undefined" : t instanceof X ? N(t.innerType(), e, r) : t instanceof Me ? N(t.removeDefault(), e, r) : t instanceof ie ? `${N(t.unwrap(), e, r)} | null` : t instanceof Ae ? "lazy" : t instanceof ye ? `Promise<${N(t.unwrap(), e + 1, r)}>` : t instanceof we ? "function" : t instanceof Se ? "Date" : t instanceof rt ? "Map" : t instanceof ge ? "Set" : t instanceof Re ? `${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 ct ? N(t.unwrap(), e, r) : t instanceof st ? "NaN" : t instanceof Ne ? N(t.removeCatch(), e, r) : t instanceof qe ? N(t._def.in, e, r) : t instanceof $e ? `readonly ${N(t.unwrap(), e, r)}` : "unknown";
2872
+ return t instanceof U ? `${N(t.unwrap(), e, r)}?` : t instanceof Me ? JSON.stringify(t.value) : t instanceof se ? t.options.map((n) => `"${n}"`).join(" | ") : t instanceof Xe ? "any" : t instanceof ae ? "unknown" : t instanceof et ? "void" : t instanceof Ze ? "undefined" : t instanceof X ? N(t.innerType(), e, r) : t instanceof Ne ? N(t.removeDefault(), e, r) : t instanceof ie ? `${N(t.unwrap(), e, r)} | null` : t instanceof Oe ? "lazy" : t instanceof be ? `Promise<${N(t.unwrap(), e + 1, r)}>` : t instanceof xe ? "function" : t instanceof Ie ? "Date" : t instanceof rt ? "Map" : t instanceof ye ? "Set" : t instanceof Ce ? `${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 ct ? N(t.unwrap(), e, r) : t instanceof st ? "NaN" : t instanceof $e ? N(t.removeCatch(), e, r) : t instanceof qe ? N(t._def.in, e, r) : t instanceof Le ? `readonly ${N(t.unwrap(), e, r)}` : "unknown";
2873
2873
  }
2874
2874
  function jr(t) {
2875
2875
  return t === null ? "null" : t === void 0 ? "undefined" : Array.isArray(t) ? "array" : typeof t;
@@ -2877,12 +2877,12 @@ function jr(t) {
2877
2877
  function Dr(t, e, r, n) {
2878
2878
  const s = r.filter((o) => o.path.length === 0), i = r.filter((o) => o.path.length > 0);
2879
2879
  if (s.length > 0 && i.length === 0) {
2880
- const o = s.some((c) => c.code === "custom"), p = s.some(
2881
- (c) => c.code !== "invalid_type" && c.code !== "invalid_literal" && c.code !== "invalid_union"
2880
+ const o = s.some((l) => l.code === "custom"), p = s.some(
2881
+ (l) => l.code !== "invalid_type" && l.code !== "invalid_literal" && l.code !== "invalid_union"
2882
2882
  );
2883
2883
  if (!o && !p) {
2884
- const c = N(e), m = jr(n);
2885
- return `Invalid parameters for ${t}: expected ${c}${c === "{ }" ? " or no args" : ""}, received ${m}`;
2884
+ const l = N(e), m = jr(n);
2885
+ return `Invalid parameters for ${t}: expected ${l}${l === "{ }" ? " or no args" : ""}, received ${m}`;
2886
2886
  }
2887
2887
  }
2888
2888
  const d = r.map((o) => `at '${o.path.length > 0 ? o.path.join(".") : "root"}': ${o.message}`);
@@ -2998,12 +2998,12 @@ T([
2998
2998
  b(v());
2999
2999
  b(v());
3000
3000
  b(v());
3001
- l({});
3001
+ c({});
3002
3002
  T([
3003
- Lr([T([l({ text: a() }), a()])]),
3004
- l({ text: a().optional(), value: a().optional() })
3003
+ Lr([T([c({ text: a() }), a()])]),
3004
+ c({ text: a().optional(), value: a().optional() })
3005
3005
  ]);
3006
- const Z = () => T([Y(), f().finite()]).transform((t) => BigInt(t)), J = () => a().regex(/^(?:f\d+_)?e\d+$/), Zr = 'use { refId: "e2" } or { label: "..." } object form, not positional arguments', lt = (t, e) => {
3006
+ const j = () => T([Y(), f().finite()]).transform((t) => BigInt(t)), J = () => a().regex(/^(?:f\d+_)?e\d+$/), Zr = 'use { refId: "e2" } or { label: "..." } object form, not positional arguments', lt = (t, e) => {
3007
3007
  if (t.__invalidPositional !== void 0) {
3008
3008
  e.addIssue({
3009
3009
  code: u.custom,
@@ -3019,46 +3019,46 @@ const Z = () => T([Y(), f().finite()]).transform((t) => BigInt(t)), J = () => a(
3019
3019
  t.x !== void 0 || t.y !== void 0 || lt(t, e);
3020
3020
  }, M = (t) => ee(
3021
3021
  (e) => typeof e == "string" || typeof e == "number" ? { __invalidPositional: e } : e,
3022
- l({
3022
+ c({
3023
3023
  __invalidPositional: T([a(), f()]).optional().describe("Internal flag for positional argument rejection"),
3024
3024
  refId: J().optional().describe("Element reference ID (e.g. e2)"),
3025
3025
  label: a().optional().describe("Human-readable element label"),
3026
3026
  ...t
3027
3027
  }).superRefine(lt)
3028
- ), be = {
3028
+ ), le = {
3029
3029
  tabId: T([f(), Y()]).optional().describe("Target tab ID")
3030
3030
  }, B = (t) => ee(
3031
3031
  (e) => typeof e == "string" || typeof e == "number" ? { __invalidPositional: e } : e,
3032
- l({
3032
+ c({
3033
3033
  __invalidPositional: T([a(), f()]).optional().describe("Internal flag for positional argument rejection"),
3034
- ...be,
3034
+ ...le,
3035
3035
  refId: J().optional().describe("Element reference ID (e.g. e2)"),
3036
3036
  label: a().optional().describe("Human-readable element label"),
3037
3037
  ...t
3038
3038
  }).superRefine(lt)
3039
- ), j = l({
3039
+ ), D = c({
3040
3040
  path: a().describe("File or directory path")
3041
- }), Tt = l({
3041
+ }), Tt = c({
3042
3042
  from: a().describe("Source path"),
3043
3043
  to: a().describe("Destination path")
3044
- }), ue = l({
3044
+ }), fe = c({
3045
3045
  path: a().describe("File path to write to"),
3046
3046
  data: a().describe("Data to write")
3047
- }), Wr = l({
3047
+ }), Wr = c({
3048
3048
  path: a().describe("File path to read from"),
3049
- offset: Z().describe("Byte offset to start reading"),
3049
+ offset: j().describe("Byte offset to start reading"),
3050
3050
  len: f().describe("Number of bytes to read")
3051
- }), Vr = l({
3051
+ }), Vr = c({
3052
3052
  path: a().describe("File path to update"),
3053
- offset: Z().describe("Byte offset to start writing"),
3053
+ offset: j().describe("Byte offset to start writing"),
3054
3054
  data: a().describe("Data to write")
3055
- }), Fr = l({
3055
+ }), Fr = c({
3056
3056
  path: a().describe("File path to hash"),
3057
3057
  algo: a().default("sha256").describe("Hash algorithm (e.g. sha256, md5)")
3058
3058
  });
3059
- l({
3059
+ c({
3060
3060
  action: a().describe("Host action name"),
3061
- params: l({}).passthrough().optional().describe("Parameters for the host action")
3061
+ params: c({}).passthrough().optional().describe("Parameters for the host action")
3062
3062
  }).passthrough();
3063
3063
  T([
3064
3064
  a(),
@@ -3068,34 +3068,34 @@ T([
3068
3068
  I(v()),
3069
3069
  b(v())
3070
3070
  ]);
3071
- l({
3071
+ c({
3072
3072
  url: a().describe("URL to fetch"),
3073
3073
  method: a().default("GET").describe("HTTP method (GET, POST, PUT, DELETE, etc.)"),
3074
3074
  headers: b(a()).default({}).describe("Request headers as key-value pairs"),
3075
3075
  body: a().nullable().default(null).describe("Request body string"),
3076
- timeout: Z().default(30000n).describe("Timeout in milliseconds"),
3076
+ timeout: j().default(30000n).describe("Timeout in milliseconds"),
3077
3077
  store: _().optional().describe(
3078
3078
  "When true, store binary responses as a handle instead of returning body bytes"
3079
3079
  ),
3080
- options: l({}).passthrough().optional().describe("Fetch options")
3080
+ options: c({}).passthrough().optional().describe("Fetch options")
3081
3081
  }).passthrough();
3082
- l({
3083
- duration: Z().describe("Duration to sleep in milliseconds")
3082
+ c({
3083
+ duration: j().describe("Duration to sleep in milliseconds")
3084
3084
  });
3085
- l({});
3086
- l({});
3087
- l({
3085
+ c({});
3086
+ c({});
3087
+ c({
3088
3088
  url: a().describe("URL to navigate to"),
3089
- timeout: Z().optional().describe("Navigation timeout in milliseconds"),
3090
- waitUntil: Le(["load", "networkidle"]).optional().describe(
3089
+ timeout: j().optional().describe("Navigation timeout in milliseconds"),
3090
+ waitUntil: _e(["load", "networkidle"]).optional().describe(
3091
3091
  "When to consider navigation complete: 'load' (tab status complete) or 'networkidle' (no in-flight requests for 500ms)"
3092
3092
  )
3093
3093
  });
3094
- l({});
3095
- l({});
3096
- l({});
3097
- l({
3098
- duration: Z().default(1000n).describe("Duration to wait in milliseconds")
3094
+ c({});
3095
+ c({});
3096
+ c({});
3097
+ c({
3098
+ duration: j().default(1000n).describe("Duration to wait in milliseconds")
3099
3099
  });
3100
3100
  M();
3101
3101
  const Ur = (t, e) => {
@@ -3105,21 +3105,21 @@ const Ur = (t, e) => {
3105
3105
  code: u.custom,
3106
3106
  message: "Each file entry requires exactly one of url, path, or handle"
3107
3107
  });
3108
- }, jt = l({
3108
+ }, jt = c({
3109
3109
  name: a().optional().describe("File name including extension"),
3110
3110
  mimeType: a().optional().describe("MIME type (defaults to application/octet-stream)"),
3111
3111
  url: a().url().optional().describe("HTTP(S) URL to fetch in the target tab"),
3112
3112
  path: a().min(1).optional().describe("Virtual filesystem path (resolved in worker)"),
3113
3113
  handle: a().min(1).optional().describe("Binary handle from page.fetch({ store: true })")
3114
3114
  }).superRefine(Ur), Dt = $r("kind", [
3115
- l({
3116
- kind: xe("bytes"),
3115
+ c({
3116
+ kind: Te("bytes"),
3117
3117
  name: a().min(1),
3118
3118
  data: a().min(1),
3119
3119
  mimeType: a().optional()
3120
3120
  }),
3121
- l({
3122
- kind: xe("url"),
3121
+ c({
3122
+ kind: Te("url"),
3123
3123
  url: a().url(),
3124
3124
  name: a().min(1),
3125
3125
  mimeType: a().optional()
@@ -3140,7 +3140,7 @@ M({
3140
3140
  M({
3141
3141
  text: a().describe("Text to append into the element")
3142
3142
  });
3143
- l({
3143
+ c({
3144
3144
  refId: J().optional().describe(
3145
3145
  "Element reference ID to dispatch the key on (e.g. e2). Omit to dispatch on document."
3146
3146
  ),
@@ -3163,20 +3163,20 @@ M({
3163
3163
  M({
3164
3164
  checked: _().optional().describe("Desired checked state (true to check, false to uncheck)")
3165
3165
  });
3166
- l({
3166
+ c({
3167
3167
  name: a().min(1).describe("The `name` attribute of the radio group to pick from"),
3168
3168
  value: a().describe("The `value` of the radio option to check")
3169
3169
  });
3170
3170
  M();
3171
- l({});
3171
+ c({});
3172
3172
  M();
3173
- l({
3173
+ c({
3174
3174
  direction: a().default("down").describe("Scroll direction: up, down, left, or right"),
3175
3175
  amount: f().default(300).describe("Pixels to scroll")
3176
3176
  });
3177
3177
  ee(
3178
3178
  (t) => typeof t == "string" || typeof t == "number" ? { __invalidPositional: t } : t,
3179
- l({
3179
+ c({
3180
3180
  __invalidPositional: T([a(), f()]).optional().describe("Internal flag for positional argument rejection"),
3181
3181
  refId: J().optional().describe("Element reference ID (e.g. e2)"),
3182
3182
  label: a().optional().describe("Human-readable element label"),
@@ -3185,21 +3185,21 @@ ee(
3185
3185
  }).superRefine(Pt)
3186
3186
  );
3187
3187
  M();
3188
- l({
3188
+ c({
3189
3189
  selector: a().describe("CSS selector to find elements")
3190
3190
  });
3191
- l({
3191
+ c({
3192
3192
  selector: a().describe("CSS selector for the root element(s) to introspect"),
3193
3193
  depth: f().int().min(0).max(10).default(2).describe("How many descendant levels to include (0 = root only)"),
3194
3194
  includeHidden: _().default(!0).describe(
3195
3195
  "Include elements hidden by CSS/aria (default true — this tool's purpose is to see what the curated snapshot filters out)"
3196
3196
  )
3197
3197
  });
3198
- l({
3198
+ c({
3199
3199
  selector: a().describe("CSS selector to wait for"),
3200
- timeout: Z().default(30000n).describe("Timeout in milliseconds")
3200
+ timeout: j().default(30000n).describe("Timeout in milliseconds")
3201
3201
  });
3202
- const zr = l({
3202
+ const zr = c({
3203
3203
  fields: I(a()).describe("Array of field names to extract")
3204
3204
  });
3205
3205
  ee(
@@ -3208,12 +3208,12 @@ ee(
3208
3208
  );
3209
3209
  T([
3210
3210
  f(),
3211
- I(l({}).passthrough()),
3212
- l({}).passthrough()
3211
+ I(c({}).passthrough()),
3212
+ c({}).passthrough()
3213
3213
  ]);
3214
- l({});
3215
- const qr = l({
3216
- ok: xe(!0).describe("Whether the action succeeded"),
3214
+ c({});
3215
+ const qr = c({
3216
+ ok: Te(!0).describe("Whether the action succeeded"),
3217
3217
  action: a().describe("Action identifier (e.g. 'page_fill')"),
3218
3218
  refId: J().optional().describe("Element reference ID that was acted upon (e.g. e2)"),
3219
3219
  tag: a().optional().describe("HTML tag name of the element"),
@@ -3230,7 +3230,7 @@ const qr = l({
3230
3230
  invalid: _().optional().describe("Inverse validity / aria-invalid state after the action"),
3231
3231
  validationMessage: a().optional().describe("Browser validation message when the element is invalid"),
3232
3232
  invalidControls: I(
3233
- l({
3233
+ c({
3234
3234
  refId: J().optional(),
3235
3235
  tag: a(),
3236
3236
  role: a().optional(),
@@ -3254,41 +3254,41 @@ const qr = l({
3254
3254
  observationId: a().optional().describe(
3255
3255
  "Opaque ID of the observation lease authorizing this action (snapshot-scoped)"
3256
3256
  ),
3257
- dispatched: xe(!0).optional().describe(
3257
+ dispatched: Te(!0).optional().describe(
3258
3258
  "True if the action was dispatched to the DOM. Does NOT prove the application accepted it."
3259
3259
  ),
3260
- verification: xe("required").optional().describe(
3260
+ verification: Te("required").optional().describe(
3261
3261
  "Always 'required': a fresh observation is required to verify the effect."
3262
3262
  )
3263
3263
  });
3264
3264
  T([qr, Lt()]);
3265
- l({
3265
+ c({
3266
3266
  status: f().describe("HTTP response status code"),
3267
3267
  ok: _().describe("Whether the response status is 2xx"),
3268
3268
  headers: b(a()).describe("Response headers as key-value pairs"),
3269
3269
  body: a().optional().describe("Response body (omitted when bodyEncoding is handle)"),
3270
- bodyEncoding: Le(["text", "base64", "handle"]).describe("Encoding of the body field"),
3270
+ bodyEncoding: _e(["text", "base64", "handle"]).describe("Encoding of the body field"),
3271
3271
  handle: a().optional().describe("Binary handle when bodyEncoding is handle"),
3272
3272
  byteLength: f().describe("Length of the body in bytes"),
3273
3273
  contentType: a().describe("Response Content-Type header"),
3274
3274
  finalUrl: a().describe("Final URL after redirects")
3275
3275
  });
3276
- l({
3277
- data: l({}).passthrough().describe("Structured snapshot data"),
3276
+ c({
3277
+ data: c({}).passthrough().describe("Structured snapshot data"),
3278
3278
  text: a().describe("Plain text representation of the snapshot")
3279
3279
  });
3280
- l({});
3281
- l({
3280
+ c({});
3281
+ c({
3282
3282
  tabId: f(),
3283
3283
  url: a(),
3284
3284
  title: a(),
3285
- contentScript: Le(["connected", "missing"]),
3286
- domApis: Le(["ok", "blocked"]),
3285
+ contentScript: _e(["connected", "missing"]),
3286
+ domApis: _e(["ok", "blocked"]),
3287
3287
  mutationsReady: _(),
3288
3288
  hint: a().optional(),
3289
3289
  recovery: I(a()).optional()
3290
3290
  });
3291
- const Hr = l({
3291
+ const Hr = c({
3292
3292
  refId: J().describe("Element reference ID (e.g. e2)"),
3293
3293
  role: a().describe("ARIA role of the element"),
3294
3294
  tag: a().describe("HTML tag name"),
@@ -3321,7 +3321,7 @@ const Hr = l({
3321
3321
  permalink: a().optional().describe("Stable permalink URL from anchor element"),
3322
3322
  imageUrls: I(a()).optional().describe("Image URLs contained within this element")
3323
3323
  });
3324
- l({
3324
+ c({
3325
3325
  text: a().describe(
3326
3326
  "Broad text-first representation of the page, including visible text, form values, and validation/error text"
3327
3327
  ),
@@ -3329,7 +3329,7 @@ l({
3329
3329
  "Broad snapshot nodes with refIds where possible; not limited to interactive elements"
3330
3330
  ),
3331
3331
  formErrors: I(
3332
- l({
3332
+ c({
3333
3333
  field: a().describe("Field label or refId"),
3334
3334
  error: a().describe("Linked visible error text"),
3335
3335
  refId: a().describe("refId of the invalid control")
@@ -3337,7 +3337,7 @@ l({
3337
3337
  ).optional().describe("Visible linked form errors grouped by field"),
3338
3338
  url: a().describe("Current page URL"),
3339
3339
  title: a().describe("Current page title"),
3340
- viewport: l({
3340
+ viewport: c({
3341
3341
  width: f().describe("Viewport width in pixels"),
3342
3342
  height: f().describe("Viewport height in pixels")
3343
3343
  }).describe("Viewport dimensions"),
@@ -3345,7 +3345,7 @@ l({
3345
3345
  "Opaque ID of the observation lease granted by this snapshot. Pass to subsequent actions to prove they act on fresh observations."
3346
3346
  )
3347
3347
  });
3348
- const Zt = l({
3348
+ const Zt = c({
3349
3349
  refId: J().optional(),
3350
3350
  tag: a(),
3351
3351
  role: a().optional(),
@@ -3353,7 +3353,7 @@ const Zt = l({
3353
3353
  text: a().optional(),
3354
3354
  attributes: b(a()).optional().describe("All HTML attributes (raw)"),
3355
3355
  hidden: _().optional(),
3356
- hiddenReason: Le([
3356
+ hiddenReason: _e([
3357
3357
  "display-none",
3358
3358
  "visibility-hidden",
3359
3359
  "aria-hidden",
@@ -3377,12 +3377,12 @@ const Zt = l({
3377
3377
  expanded: _().optional(),
3378
3378
  children: I(Pr(() => Zt)).optional().describe("Nested descendants up to `depth`")
3379
3379
  });
3380
- l({
3380
+ c({
3381
3381
  nodes: I(Zt),
3382
3382
  url: a(),
3383
3383
  title: a()
3384
3384
  });
3385
- const Wt = l({
3385
+ const Wt = c({
3386
3386
  id: f().optional().describe("Tab ID"),
3387
3387
  tabId: f().optional().describe("Tab ID (added by runner)"),
3388
3388
  index: f().optional().describe("Tab index in the window"),
@@ -3403,7 +3403,7 @@ const Wt = l({
3403
3403
  width: f().optional().describe("Tab width"),
3404
3404
  height: f().optional().describe("Tab height"),
3405
3405
  sessionId: a().optional().describe("Session ID")
3406
- }).passthrough(), Gr = I(Wt), Vt = l({
3406
+ }).passthrough(), Gr = I(Wt), Vt = c({
3407
3407
  id: f().optional().describe("Window ID"),
3408
3408
  focused: _().optional().describe("Whether the window is focused"),
3409
3409
  top: f().optional().describe("Window top position"),
@@ -3420,7 +3420,7 @@ const Wt = l({
3420
3420
  sessionId: a().optional().describe("Session ID")
3421
3421
  }).passthrough();
3422
3422
  I(Vt);
3423
- const Jr = l({
3423
+ const Jr = c({
3424
3424
  name: a().describe("Cookie name"),
3425
3425
  value: a().describe("Cookie value"),
3426
3426
  domain: a().optional().describe("Cookie domain"),
@@ -3436,7 +3436,7 @@ const Jr = l({
3436
3436
  I(
3437
3437
  Jr.nullable().unwrap()
3438
3438
  );
3439
- const Yr = l({
3439
+ const Yr = c({
3440
3440
  id: a().describe("Bookmark ID"),
3441
3441
  parentId: a().optional().describe("Parent folder ID"),
3442
3442
  index: f().optional().describe("Bookmark index"),
@@ -3444,10 +3444,10 @@ const Yr = l({
3444
3444
  title: a().describe("Bookmark title"),
3445
3445
  dateAdded: f().optional().describe("Date added"),
3446
3446
  dateGroupModified: f().optional().describe("Date group modified"),
3447
- children: I(l({ id: a() }).passthrough()).optional().describe("Child bookmarks")
3447
+ children: I(c({ id: a() }).passthrough()).optional().describe("Child bookmarks")
3448
3448
  }).passthrough();
3449
3449
  I(Yr);
3450
- const Kr = l({
3450
+ const Kr = c({
3451
3451
  id: a().describe("History item ID"),
3452
3452
  url: a().optional().describe("URL"),
3453
3453
  title: a().optional().describe("Title"),
@@ -3456,7 +3456,7 @@ const Kr = l({
3456
3456
  typedCount: f().optional().describe("Typed count")
3457
3457
  }).passthrough();
3458
3458
  I(Kr);
3459
- const Qr = l({
3459
+ const Qr = c({
3460
3460
  frameId: f().describe("Frame ID"),
3461
3461
  result: v().optional().describe("Script result")
3462
3462
  });
@@ -3465,7 +3465,7 @@ a();
3465
3465
  _();
3466
3466
  T([a(), f()]);
3467
3467
  _();
3468
- const Xr = l({
3468
+ const Xr = c({
3469
3469
  id: f().optional().describe("Group ID"),
3470
3470
  collapsed: _().optional().describe("Whether the group is collapsed"),
3471
3471
  color: a().optional().describe("Group color"),
@@ -3473,16 +3473,16 @@ const Xr = l({
3473
3473
  windowId: f().optional().describe("Window ID")
3474
3474
  }).passthrough();
3475
3475
  I(Xr);
3476
- const en = l({
3476
+ const en = c({
3477
3477
  lastModified: f().optional().describe("Last modified time"),
3478
3478
  tab: Wt.optional().describe("Tab info"),
3479
3479
  window: Vt.optional().describe("Window info")
3480
- }).passthrough(), tn = I(en), rn = l({
3480
+ }).passthrough(), tn = I(en), rn = c({
3481
3481
  deviceName: a().optional().describe("Device name"),
3482
3482
  sessions: tn.optional().describe("Sessions")
3483
3483
  }).passthrough();
3484
3484
  I(rn);
3485
- const nn = l({
3485
+ const nn = c({
3486
3486
  id: f().optional().describe("Download ID"),
3487
3487
  url: a().optional().describe("Download URL"),
3488
3488
  filename: a().optional().describe("Filename"),
@@ -3503,18 +3503,18 @@ const nn = l({
3503
3503
  }).passthrough();
3504
3504
  I(nn);
3505
3505
  f();
3506
- l({
3506
+ c({
3507
3507
  archName: a().describe("CPU architecture"),
3508
3508
  modelName: a().describe("CPU model"),
3509
3509
  numOfProcessors: f().describe("Number of processors"),
3510
3510
  features: I(a()).describe("CPU features")
3511
3511
  });
3512
- l({
3512
+ c({
3513
3513
  capacity: f().describe("Total memory capacity"),
3514
3514
  availableCapacity: f().describe("Available memory capacity")
3515
3515
  });
3516
3516
  I(
3517
- l({
3517
+ c({
3518
3518
  id: a().describe("Storage ID"),
3519
3519
  name: a().describe("Storage name"),
3520
3520
  type: a().describe("Storage type"),
@@ -3529,7 +3529,7 @@ M({
3529
3529
  M({
3530
3530
  text: a().optional().describe("Text to type into the element")
3531
3531
  });
3532
- l({
3532
+ c({
3533
3533
  key: a().optional().describe("Key to press (e.g. Enter, Escape, ArrowDown)")
3534
3534
  });
3535
3535
  M({
@@ -3539,8 +3539,8 @@ M({
3539
3539
  checked: _().optional().describe("Desired checked state (true to check, false to uncheck)")
3540
3540
  });
3541
3541
  M();
3542
- l({});
3543
- l({
3542
+ c({});
3543
+ c({
3544
3544
  direction: a().optional().describe("Scroll direction: up, down, left, or right"),
3545
3545
  amount: f().optional().describe("Pixels to scroll")
3546
3546
  });
@@ -3548,44 +3548,44 @@ M();
3548
3548
  M({
3549
3549
  text: a().optional().describe("Text to append into the element")
3550
3550
  });
3551
- l({});
3552
- l({});
3553
- l({
3554
- duration: Z().default(1000n).describe("Duration to wait in milliseconds")
3551
+ c({});
3552
+ c({});
3553
+ c({
3554
+ duration: j().default(1000n).describe("Duration to wait in milliseconds")
3555
3555
  });
3556
- l({
3556
+ c({
3557
3557
  interactive_only: _().default(!1).describe("Only include interactive elements"),
3558
- max_nodes: Z().default(500n).describe("Maximum number of nodes to include in snapshot")
3558
+ max_nodes: j().default(500n).describe("Maximum number of nodes to include in snapshot")
3559
3559
  });
3560
- l({
3560
+ c({
3561
3561
  interactive_only: _().default(!1).describe("Only include interactive elements"),
3562
- max_nodes: Z().default(500n).describe("Maximum number of nodes to include in snapshot")
3562
+ max_nodes: j().default(500n).describe("Maximum number of nodes to include in snapshot")
3563
3563
  });
3564
- l({
3564
+ c({
3565
3565
  interactive_only: _().default(!1).describe("Only include interactive elements"),
3566
- max_nodes: Z().default(500n).describe("Maximum number of nodes to include in snapshot")
3566
+ max_nodes: j().default(500n).describe("Maximum number of nodes to include in snapshot")
3567
3567
  });
3568
- l({
3568
+ c({
3569
3569
  interactive_only: _().default(!1).describe("Only include interactive elements"),
3570
- max_nodes: Z().default(500n).describe("Maximum number of nodes to include in snapshot")
3570
+ max_nodes: j().default(500n).describe("Maximum number of nodes to include in snapshot")
3571
3571
  });
3572
- l({
3573
- snapshot: l({}).passthrough().describe("Raw DOM snapshot data to format"),
3572
+ c({
3573
+ snapshot: c({}).passthrough().describe("Raw DOM snapshot data to format"),
3574
3574
  format: a().optional().describe("Output format (e.g. markdown, html)")
3575
3575
  });
3576
- l({
3576
+ c({
3577
3577
  max_nodes: f().optional().describe("Maximum nodes to include"),
3578
- options: l({}).passthrough().optional().describe("Snapshot options")
3578
+ options: c({}).passthrough().optional().describe("Snapshot options")
3579
3579
  }).passthrough();
3580
- l({
3580
+ c({
3581
3581
  max_nodes: f().optional().describe("Maximum nodes to include"),
3582
- options: l({}).passthrough().optional().describe("Snapshot options")
3582
+ options: c({}).passthrough().optional().describe("Snapshot options")
3583
3583
  }).passthrough();
3584
- l({
3584
+ c({
3585
3585
  max_nodes: f().optional().describe("Maximum nodes to include"),
3586
- options: l({}).passthrough().optional().describe("Snapshot options")
3586
+ options: c({}).passthrough().optional().describe("Snapshot options")
3587
3587
  }).passthrough();
3588
- const sn = l({
3588
+ const sn = c({
3589
3589
  role: T([a(), I(a())]).optional().describe("Filter by ARIA role"),
3590
3590
  tag: T([a(), I(a())]).optional().describe("Filter by HTML tag"),
3591
3591
  text: a().optional().describe("Filter by text content (case-insensitive substring)"),
@@ -3594,7 +3594,7 @@ const sn = l({
3594
3594
  href: a().optional().describe("Filter by href pattern (case-insensitive substring)"),
3595
3595
  src: a().optional().describe("Filter by src pattern (case-insensitive substring)"),
3596
3596
  limit: f().positive().optional().describe("Maximum filtered nodes to return")
3597
- }).passthrough(), an = l({
3597
+ }).passthrough(), an = c({
3598
3598
  filter: sn.optional().describe(
3599
3599
  "Semantic filter criteria"
3600
3600
  ),
@@ -3603,22 +3603,22 @@ const sn = l({
3603
3603
  an.extend({
3604
3604
  tabId: f().describe("Tab ID")
3605
3605
  });
3606
- l({
3606
+ c({
3607
3607
  key: a().describe("Storage key to retrieve")
3608
3608
  });
3609
- l({
3609
+ c({
3610
3610
  key: a().describe("Storage key to set"),
3611
3611
  value: a().describe("Value to store")
3612
3612
  });
3613
- l({
3613
+ c({
3614
3614
  key: a().describe("Storage key to delete")
3615
3615
  });
3616
- l({});
3617
- const on = l({
3616
+ c({});
3617
+ const on = c({
3618
3618
  items: b(a()).describe("Record of key-value string pairs to store")
3619
3619
  });
3620
3620
  ee((t) => t !== null && typeof t == "object" && !Array.isArray(t) && !("items" in t) ? { items: t } : t, on);
3621
- const dn = l({
3621
+ const dn = c({
3622
3622
  keys: I(a()).describe("Array of storage keys to retrieve"),
3623
3623
  defaults: b(a()).optional().describe("Default string values for missing keys")
3624
3624
  });
@@ -3626,23 +3626,23 @@ ee(
3626
3626
  (t) => Array.isArray(t) ? { keys: t } : t,
3627
3627
  dn
3628
3628
  );
3629
- l({});
3630
- const cn = l({
3629
+ c({});
3630
+ const cn = c({
3631
3631
  keys: I(a()).describe("Array of storage keys to delete")
3632
3632
  });
3633
3633
  ee(
3634
3634
  (t) => Array.isArray(t) ? { keys: t } : t,
3635
3635
  cn
3636
3636
  );
3637
- l({});
3638
- l({
3637
+ c({});
3638
+ c({
3639
3639
  active: _().optional().describe("Whether the tabs are active"),
3640
3640
  currentWindow: _().optional().describe("Whether the tabs are in the current window"),
3641
3641
  url: a().optional().describe("URL pattern to match tabs against")
3642
3642
  }).passthrough();
3643
3643
  ee(
3644
3644
  (t) => typeof t == "string" ? { url: t } : t,
3645
- l({
3645
+ c({
3646
3646
  url: a().optional().describe("URL to open in the new tab"),
3647
3647
  active: _().optional().describe("Whether to focus the new tab")
3648
3648
  })
@@ -3650,13 +3650,13 @@ ee(
3650
3650
  T([
3651
3651
  f(),
3652
3652
  I(
3653
- l({
3653
+ c({
3654
3654
  id: f().optional(),
3655
3655
  tabId: f().optional(),
3656
3656
  tab_id: f().optional()
3657
3657
  }).passthrough()
3658
3658
  ),
3659
- l({
3659
+ c({
3660
3660
  id: f().optional(),
3661
3661
  tabId: f().optional(),
3662
3662
  tab_id: f().optional()
@@ -3674,9 +3674,9 @@ B({
3674
3674
  });
3675
3675
  ee(
3676
3676
  (t) => typeof t == "string" || typeof t == "number" ? { __invalidPositional: t } : t,
3677
- l({
3677
+ c({
3678
3678
  __invalidPositional: T([a(), f()]).optional().describe("Internal flag for positional argument rejection"),
3679
- ...be,
3679
+ ...le,
3680
3680
  refId: J().optional().describe("Element reference ID (e.g. e2)"),
3681
3681
  label: a().optional().describe("Human-readable element label"),
3682
3682
  x: f().optional().describe("X coordinate to scroll to"),
@@ -3686,8 +3686,8 @@ ee(
3686
3686
  B({
3687
3687
  text: a().describe("Text to type into the element")
3688
3688
  });
3689
- l({
3690
- ...be,
3689
+ c({
3690
+ ...le,
3691
3691
  key: a().describe("Key to press (e.g. Enter, Escape, ArrowDown)")
3692
3692
  });
3693
3693
  B({
@@ -3703,55 +3703,63 @@ B({
3703
3703
  });
3704
3704
  B();
3705
3705
  B();
3706
- l({
3707
- ...be,
3706
+ c({
3707
+ ...le,
3708
3708
  name: a().min(1).describe("The `name` attribute of the radio group to pick from"),
3709
3709
  value: a().describe("The `value` of the radio option to check")
3710
3710
  });
3711
- l({
3712
- ...be
3711
+ c({
3712
+ ...le
3713
3713
  });
3714
- l({
3715
- ...be,
3714
+ c({
3715
+ ...le,
3716
3716
  direction: a().default("down").describe("Scroll direction: up, down, left, or right"),
3717
3717
  amount: f().default(300).describe("Pixels to scroll")
3718
3718
  });
3719
3719
  B();
3720
- l({
3720
+ c({
3721
3721
  tabId: T([f(), Y()]).optional().describe("Target tab ID"),
3722
3722
  script: a().optional().describe("Script to evaluate"),
3723
3723
  code: a().optional().describe("Alternative script code"),
3724
3724
  js: a().optional().describe("Alternative JS code")
3725
3725
  }).passthrough();
3726
- l({
3726
+ c({
3727
3727
  tabId: T([f(), Y()]).optional().describe("Target tab ID")
3728
3728
  }).passthrough();
3729
- l({
3729
+ c({
3730
3730
  tabId: T([f(), Y()]).optional().describe("Target tab ID")
3731
3731
  }).passthrough();
3732
- l({
3732
+ c({
3733
3733
  tabId: T([f(), Y()]).optional().describe("Target tab ID"),
3734
3734
  timeout: f().optional().describe("Timeout in milliseconds")
3735
3735
  }).passthrough();
3736
- l({
3736
+ c({
3737
3737
  tabId: T([f(), Y()]).optional().describe("Target tab ID"),
3738
3738
  url: a().optional().describe("URL to fetch"),
3739
- options: l({}).passthrough().optional().describe("Fetch options")
3739
+ options: c({}).passthrough().optional().describe("Fetch options")
3740
3740
  }).passthrough();
3741
- l({
3741
+ c({
3742
3742
  tabId: T([f(), Y()]).optional().describe("Target tab ID"),
3743
3743
  max_nodes: f().optional().describe("Maximum nodes to include"),
3744
- options: l({}).passthrough().optional().describe("Snapshot options")
3744
+ options: c({}).passthrough().optional().describe("Snapshot options")
3745
3745
  }).passthrough();
3746
- l({
3746
+ c({
3747
3747
  tabId: T([f(), Y()]).optional().describe("Target tab ID"),
3748
3748
  max_nodes: f().optional().describe("Maximum nodes to include"),
3749
- options: l({}).passthrough().optional().describe("Snapshot options")
3749
+ options: c({}).passthrough().optional().describe("Snapshot options")
3750
3750
  }).passthrough();
3751
- l({
3751
+ c({
3752
3752
  tabId: T([f(), Y()]).optional().describe("Target tab ID"),
3753
3753
  max_nodes: f().optional().describe("Maximum nodes to include"),
3754
- options: l({}).passthrough().optional().describe("Snapshot options")
3754
+ options: c({}).passthrough().optional().describe("Snapshot options")
3755
+ }).passthrough();
3756
+ c({
3757
+ ...le,
3758
+ url: a().describe("URL to navigate the tab to"),
3759
+ timeout: j().optional().describe("Navigation timeout in milliseconds"),
3760
+ waitUntil: _e(["load", "networkidle"]).optional().describe(
3761
+ "When to consider navigation complete: 'load' (tab status complete) or 'networkidle' (no in-flight requests for 500ms)"
3762
+ )
3755
3763
  }).passthrough();
3756
3764
  const We = {
3757
3765
  trace: 0,
@@ -3819,7 +3827,7 @@ function yn(t, e) {
3819
3827
  }
3820
3828
  return r.length > 0 ? ` ${r.join(" ")}` : "";
3821
3829
  }
3822
- function _e(t, e) {
3830
+ function ve(t, e) {
3823
3831
  return e.length === 0 ? { event: t } : e.length === 1 && typeof e[0] == "object" && e[0] !== null && !Array.isArray(e[0]) ? { event: t, metadata: e[0] } : {
3824
3832
  event: t,
3825
3833
  metadata: { _args: e.map((r) => Ft(r)).join(" ") }
@@ -3856,23 +3864,23 @@ class ft {
3856
3864
  }
3857
3865
  }
3858
3866
  trace(e, ...r) {
3859
- const { event: n, metadata: s } = _e(e, r);
3867
+ const { event: n, metadata: s } = ve(e, r);
3860
3868
  this.log("trace", n, s);
3861
3869
  }
3862
3870
  debug(e, ...r) {
3863
- const { event: n, metadata: s } = _e(e, r);
3871
+ const { event: n, metadata: s } = ve(e, r);
3864
3872
  this.log("debug", n, s);
3865
3873
  }
3866
3874
  info(e, ...r) {
3867
- const { event: n, metadata: s } = _e(e, r);
3875
+ const { event: n, metadata: s } = ve(e, r);
3868
3876
  this.log("info", n, s);
3869
3877
  }
3870
3878
  warn(e, ...r) {
3871
- const { event: n, metadata: s } = _e(e, r);
3879
+ const { event: n, metadata: s } = ve(e, r);
3872
3880
  this.log("warn", n, s);
3873
3881
  }
3874
3882
  error(e, ...r) {
3875
- const { event: n, metadata: s } = _e(e, r);
3883
+ const { event: n, metadata: s } = ve(e, r);
3876
3884
  this.log("error", n, s);
3877
3885
  }
3878
3886
  child(e) {
@@ -3882,12 +3890,12 @@ class ft {
3882
3890
  const s = typeof performance < "u" && performance.now, i = s ? performance.now() : Date.now();
3883
3891
  return (d) => {
3884
3892
  try {
3885
- const o = s ? performance.now() : Date.now(), p = Math.round(o - i), c = {
3893
+ const o = s ? performance.now() : Date.now(), p = Math.round(o - i), l = {
3886
3894
  ...r,
3887
3895
  ...d,
3888
3896
  duration_ms: p
3889
3897
  };
3890
- this.log(n, e, c);
3898
+ this.log(n, e, l);
3891
3899
  } catch {
3892
3900
  }
3893
3901
  };
@@ -4015,40 +4023,40 @@ async function Nn(t, e, r, n) {
4015
4023
  ((p = i.error.issues[0]) == null ? void 0 : p.message) ?? "Invalid setFiles params"
4016
4024
  );
4017
4025
  const d = i.data, o = [];
4018
- for (const c of d.files) {
4019
- if (c.url) {
4026
+ for (const l of d.files) {
4027
+ if (l.url) {
4020
4028
  o.push({
4021
4029
  kind: "url",
4022
- url: c.url,
4023
- name: c.name ?? Et(c.url, "upload.bin"),
4024
- mimeType: c.mimeType
4030
+ url: l.url,
4031
+ name: l.name ?? Et(l.url, "upload.bin"),
4032
+ mimeType: l.mimeType
4025
4033
  });
4026
4034
  continue;
4027
4035
  }
4028
- if (c.path) {
4036
+ if (l.path) {
4029
4037
  try {
4030
- const m = await n(c.path);
4038
+ const m = await n(l.path);
4031
4039
  o.push({
4032
4040
  kind: "bytes",
4033
- name: c.name ?? Et(c.path, "upload.bin"),
4041
+ name: l.name ?? Et(l.path, "upload.bin"),
4034
4042
  data: m,
4035
- mimeType: c.mimeType
4043
+ mimeType: l.mimeType
4036
4044
  });
4037
4045
  } catch (m) {
4038
4046
  const R = m instanceof Error ? m.message : String(m);
4039
- return Je(`Failed to read path ${c.path}: ${R}`);
4047
+ return Je(`Failed to read path ${l.path}: ${R}`);
4040
4048
  }
4041
4049
  continue;
4042
4050
  }
4043
- if (c.handle) {
4044
- const m = Rn(r, c.handle);
4051
+ if (l.handle) {
4052
+ const m = Rn(r, l.handle);
4045
4053
  if (!m)
4046
- return Je(`Unknown or expired handle: ${c.handle}`);
4054
+ return Je(`Unknown or expired handle: ${l.handle}`);
4047
4055
  o.push({
4048
4056
  kind: "bytes",
4049
- name: c.name ?? c.handle,
4057
+ name: l.name ?? l.handle,
4050
4058
  data: On(m.bytes),
4051
- mimeType: c.mimeType ?? m.mimeType ?? m.contentType
4059
+ mimeType: l.mimeType ?? m.mimeType ?? m.contentType
4052
4060
  });
4053
4061
  }
4054
4062
  }
@@ -4073,7 +4081,7 @@ function Pn() {
4073
4081
  }
4074
4082
  const qt = /* @__PURE__ */ new Set(["page_set_files", "tab_set_files"]), Ht = /* @__PURE__ */ new Set(["page_fetch", "tab_fetch"]);
4075
4083
  let W = null, at = !1;
4076
- const pe = /* @__PURE__ */ new Map();
4084
+ const he = /* @__PURE__ */ new Map();
4077
4085
  function Be(t, e) {
4078
4086
  try {
4079
4087
  return t.postMessage(e), !0;
@@ -4087,11 +4095,11 @@ function Gt(t, e, r) {
4087
4095
  e === "main-thread" || e === "content-script" ? Be(r, { type: "relayCancel", id: t, owner: e }) : Be(r, { type: "registryCallCancel", id: t });
4088
4096
  }
4089
4097
  function Ct(t, e) {
4090
- for (const [r, n] of pe)
4098
+ for (const [r, n] of he)
4091
4099
  clearTimeout(n.timeoutId), Gt(r, n.owner, n.port), n.settle({
4092
4100
  ok: !1,
4093
4101
  error: { message: e, code: t }
4094
- }), pe.delete(r);
4102
+ }), he.delete(r);
4095
4103
  }
4096
4104
  const ce = /* @__PURE__ */ new Map(), Jt = /* @__PURE__ */ new Map(), Yt = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new Map(), Qt = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
4097
4105
  let At = Promise.resolve(), V = null;
@@ -4132,7 +4140,7 @@ function C(t, e, r, n = ce) {
4132
4140
  Dn(
4133
4141
  t,
4134
4142
  async (s, i) => {
4135
- const d = e.safeParse(he(s));
4143
+ const d = e.safeParse(me(s));
4136
4144
  if (!d.success) {
4137
4145
  const o = Dr(
4138
4146
  t,
@@ -4178,9 +4186,9 @@ function Vn(t, e) {
4178
4186
  const d = s.id, o = new AbortController();
4179
4187
  Pe.set(d, o);
4180
4188
  const p = ce.get(s.action);
4181
- let c;
4189
+ let l;
4182
4190
  if (!p)
4183
- c = {
4191
+ l = {
4184
4192
  ok: !1,
4185
4193
  error: {
4186
4194
  message: `Unknown worker action: ${s.action}`,
@@ -4195,12 +4203,12 @@ function Vn(t, e) {
4195
4203
  runId: s.runId,
4196
4204
  signal: o.signal
4197
4205
  });
4198
- c = o.signal.aborted ? {
4206
+ l = o.signal.aborted ? {
4199
4207
  ok: !1,
4200
4208
  error: { message: "Relay aborted", code: "E_ABORT" }
4201
4209
  } : { ok: !0, value: m };
4202
4210
  } catch (m) {
4203
- c = {
4211
+ l = {
4204
4212
  ok: !1,
4205
4213
  error: {
4206
4214
  message: m instanceof Error ? m.message : String(m),
@@ -4208,7 +4216,7 @@ function Vn(t, e) {
4208
4216
  }
4209
4217
  };
4210
4218
  }
4211
- Pe.delete(d), Be(e, { type: "registryCallResult", id: d, result: c }) || dt(d, {
4219
+ Pe.delete(d), Be(e, { type: "registryCallResult", id: d, result: l }) || dt(d, {
4212
4220
  ok: !1,
4213
4221
  error: {
4214
4222
  message: "Failed to deliver worker handler response",
@@ -4220,7 +4228,7 @@ function Vn(t, e) {
4220
4228
  }
4221
4229
  function dt(t, e) {
4222
4230
  O.trace("resolveAsyncRelayResult", { id: t });
4223
- const r = pe.get(t);
4231
+ const r = he.get(t);
4224
4232
  return r ? (r.settle(e), !0) : (O.warn("asyncRelayResult_no_pending_relay", { id: t }), !1);
4225
4233
  }
4226
4234
  function Fn(t) {
@@ -4230,7 +4238,7 @@ function Fn(t) {
4230
4238
  return e || null;
4231
4239
  }
4232
4240
  function er(t) {
4233
- const { owner: e, action: r, tabPolicy: n, resolveTimeoutMs: s } = t, i = t.timeoutMs ?? ke;
4241
+ const { owner: e, action: r, tabPolicy: n, resolveTimeoutMs: s } = t, i = t.timeoutMs ?? we;
4234
4242
  return (d, o) => {
4235
4243
  O.trace("safePostAsCall_invoke", {
4236
4244
  owner: e,
@@ -4239,7 +4247,7 @@ function er(t) {
4239
4247
  runId: o == null ? void 0 : o.runId
4240
4248
  });
4241
4249
  const p = (s == null ? void 0 : s(d)) ?? i;
4242
- return new Promise((c, m) => {
4250
+ return new Promise((l, m) => {
4243
4251
  var bt;
4244
4252
  if ((bt = o == null ? void 0 : o.signal) != null && bt.aborted) {
4245
4253
  const K = new Error(`Relay aborted for action: ${r}`);
@@ -4251,7 +4259,7 @@ function er(t) {
4251
4259
  m(new Error(`No port available for action: ${r}`));
4252
4260
  return;
4253
4261
  }
4254
- if (pe.size >= Rt) {
4262
+ if (he.size >= Rt) {
4255
4263
  m(
4256
4264
  new Error(
4257
4265
  `Too many pending calls (${Rt} limit exceeded). Action: ${r}`
@@ -4261,21 +4269,21 @@ function er(t) {
4261
4269
  }
4262
4270
  const $ = Zn();
4263
4271
  let te = !1;
4264
- const le = (K) => {
4265
- te || (te = !0, clearTimeout(mt), o != null && o.signal && o.signal.removeEventListener("abort", He), pe.delete($), K());
4272
+ const ue = (K) => {
4273
+ te || (te = !0, clearTimeout(mt), o != null && o.signal && o.signal.removeEventListener("abort", He), he.delete($), K());
4266
4274
  }, ht = () => {
4267
4275
  Gt($, e, R);
4268
4276
  }, He = () => {
4269
4277
  ht();
4270
4278
  const K = new Error(`Relay aborted for action: ${r}`);
4271
- K.code = "E_ABORT", le(() => m(K));
4279
+ K.code = "E_ABORT", ue(() => m(K));
4272
4280
  };
4273
4281
  o != null && o.signal && o.signal.addEventListener("abort", He);
4274
4282
  const mt = setTimeout(() => {
4275
- ht(), le(() => m(new Error(`Relay timeout for action: ${r}`)));
4283
+ ht(), ue(() => m(new Error(`Relay timeout for action: ${r}`)));
4276
4284
  }, p);
4277
- pe.set($, {
4278
- settle: (K) => le(() => c(K)),
4285
+ he.set($, {
4286
+ settle: (K) => ue(() => l(K)),
4279
4287
  timeoutId: mt,
4280
4288
  abort: He,
4281
4289
  owner: e,
@@ -4292,13 +4300,13 @@ function er(t) {
4292
4300
  tabPolicy: n,
4293
4301
  command: { action: r, params: d, runId: gt, callId: yt },
4294
4302
  runId: gt
4295
- }) || le(
4303
+ }) || ue(
4296
4304
  () => m(new Error(`Failed to post relay for action: ${r}`))
4297
4305
  );
4298
4306
  });
4299
4307
  };
4300
4308
  }
4301
- const Un = "worker", ke = 3e4, Ot = 5e3, Bn = 500, zn = {
4309
+ const Un = "worker", we = 3e4, Ot = 5e3, Bn = 500, zn = {
4302
4310
  page_goto: "timeout",
4303
4311
  page_wait_for: "timeout",
4304
4312
  tab_wait_for_load: "timeout",
@@ -4321,10 +4329,10 @@ function rr(t, e) {
4321
4329
  if (qt.has(t))
4322
4330
  return Gn;
4323
4331
  const r = zn[t];
4324
- if (!r) return ke;
4332
+ if (!r) return we;
4325
4333
  let n = qn(e, r);
4326
- return n === null && tr.has(t) && (n = ke), n === null ? ke : Math.max(
4327
- ke,
4334
+ return n === null && tr.has(t) && (n = we), n === null ? we : Math.max(
4335
+ we,
4328
4336
  Hn(t, n)
4329
4337
  );
4330
4338
  }
@@ -4351,7 +4359,7 @@ async function nr(t, e, r) {
4351
4359
  return n.ok ? { ok: !0, params: n.value } : n;
4352
4360
  }
4353
4361
  function ns(t, e) {
4354
- t = he(t);
4362
+ t = me(t);
4355
4363
  const r = e == null ? void 0 : e.action;
4356
4364
  if (O.trace("extensionDispatch", {
4357
4365
  action: r,
@@ -4367,7 +4375,7 @@ function ns(t, e) {
4367
4375
  });
4368
4376
  const n = t;
4369
4377
  return (async () => {
4370
- var p, c;
4378
+ var p, l;
4371
4379
  const s = await nr(
4372
4380
  r,
4373
4381
  t,
@@ -4381,8 +4389,8 @@ function ns(t, e) {
4381
4389
  try {
4382
4390
  return { ok: !0, value: await m(t, { ...e, signal: R }) };
4383
4391
  } catch ($) {
4384
- const te = $ instanceof Error ? $.message : String($), le = typeof $ == "object" && $ !== null && "code" in $ && typeof $.code == "string" ? $.code : "E_WORKER_HANDLER";
4385
- return { ok: !1, error: { message: te, code: le } };
4392
+ const te = $ instanceof Error ? $.message : String($), ue = typeof $ == "object" && $ !== null && "code" in $ && typeof $.code == "string" ? $.code : "E_WORKER_HANDLER";
4393
+ return { ok: !1, error: { message: te, code: ue } };
4386
4394
  }
4387
4395
  })();
4388
4396
  }
@@ -4402,7 +4410,7 @@ function ns(t, e) {
4402
4410
  tabPolicy: i.tabPolicy
4403
4411
  })(t, {
4404
4412
  ...e,
4405
- signal: (e == null ? void 0 : e.signal) ?? (e != null && e.runId ? (c = z.get(e.runId)) == null ? void 0 : c.signal : void 0)
4413
+ signal: (e == null ? void 0 : e.signal) ?? (e != null && e.runId ? (l = z.get(e.runId)) == null ? void 0 : l.signal : void 0)
4406
4414
  });
4407
4415
  return Ht.has(r) && typeof o == "object" && o !== null && "ok" in o && o.ok ? {
4408
4416
  ok: !0,
@@ -4423,7 +4431,7 @@ function Jn(t) {
4423
4431
  );
4424
4432
  return async (r, n) => {
4425
4433
  var i;
4426
- r = he(r);
4434
+ r = me(r);
4427
4435
  const s = (n == null ? void 0 : n.signal) ?? (n != null && n.runId ? (i = z.get(n.runId)) == null ? void 0 : i.signal : void 0);
4428
4436
  try {
4429
4437
  return { ok: !0, value: await e(r, {
@@ -4444,7 +4452,7 @@ function Jn(t) {
4444
4452
  });
4445
4453
  return async (r, n) => {
4446
4454
  var d;
4447
- const s = he(r), i = await nr(
4455
+ const s = me(r), i = await nr(
4448
4456
  t.action,
4449
4457
  s,
4450
4458
  n == null ? void 0 : n.runId
@@ -4465,8 +4473,8 @@ function Jn(t) {
4465
4473
  )
4466
4474
  } : o;
4467
4475
  } catch (o) {
4468
- const p = o instanceof Error ? o.message : String(o), c = typeof o == "object" && o !== null && "code" in o && typeof o.code == "string" ? o.code : t.errorCode || "E_RELAY";
4469
- return { ok: !1, error: { message: p, code: c } };
4476
+ const p = o instanceof Error ? o.message : String(o), l = typeof o == "object" && o !== null && "code" in o && typeof o.code == "string" ? o.code : t.errorCode || "E_RELAY";
4477
+ return { ok: !1, error: { message: p, code: l } };
4470
4478
  }
4471
4479
  };
4472
4480
  }
@@ -4474,35 +4482,35 @@ function Jn(t) {
4474
4482
  function Yn(t) {
4475
4483
  C(
4476
4484
  "exists",
4477
- j,
4485
+ D,
4478
4486
  (e) => t.fsExists(e)
4479
4487
  ), C(
4480
4488
  "stat",
4481
- j,
4489
+ D,
4482
4490
  (e) => t.fsStat(e)
4483
4491
  ), C(
4484
4492
  "read",
4485
- j,
4493
+ D,
4486
4494
  (e) => t.fsRead(e)
4487
4495
  ), C(
4488
4496
  "readText",
4489
- j,
4497
+ D,
4490
4498
  (e) => t.fsReadText(e)
4491
4499
  ), C(
4492
4500
  "readBase64",
4493
- j,
4501
+ D,
4494
4502
  (e) => t.fsReadBase64(e)
4495
4503
  ), C(
4496
4504
  "list",
4497
- j,
4505
+ D,
4498
4506
  (e) => t.fsList(e)
4499
4507
  ), C(
4500
4508
  "mkdir",
4501
- j,
4509
+ D,
4502
4510
  (e) => t.fsMkdir(e)
4503
4511
  ), C(
4504
4512
  "delete",
4505
- j,
4513
+ D,
4506
4514
  (e) => t.fsDelete(e)
4507
4515
  ), C(
4508
4516
  "copy",
@@ -4514,30 +4522,30 @@ function Yn(t) {
4514
4522
  (e) => t.fsMove(e)
4515
4523
  ), C(
4516
4524
  "write",
4517
- ue,
4525
+ fe,
4518
4526
  (e) => t.fsWrite(e)
4519
4527
  ), C(
4520
4528
  "writeText",
4521
- ue,
4529
+ fe,
4522
4530
  (e) => t.fsWriteText(e)
4523
4531
  ), C(
4524
4532
  "writeBase64",
4525
- ue,
4533
+ fe,
4526
4534
  async (e) => {
4527
4535
  const r = e;
4528
4536
  return $n(r.path, r.data), t.fsWriteBase64(r);
4529
4537
  }
4530
4538
  ), C(
4531
4539
  "append",
4532
- ue,
4540
+ fe,
4533
4541
  (e) => t.fsAppend(e)
4534
4542
  ), C(
4535
4543
  "appendText",
4536
- ue,
4544
+ fe,
4537
4545
  (e) => t.fsAppendText(e)
4538
4546
  ), C(
4539
4547
  "appendBase64",
4540
- ue,
4548
+ fe,
4541
4549
  (e) => t.fsAppendBase64(e)
4542
4550
  ), C(
4543
4551
  "readRange",
@@ -4556,7 +4564,7 @@ function Yn(t) {
4556
4564
  function Kn(t) {
4557
4565
  C(
4558
4566
  "parse",
4559
- j,
4567
+ D,
4560
4568
  (e) => t.csvParse(e),
4561
4569
  Jt
4562
4570
  );
@@ -4564,7 +4572,7 @@ function Kn(t) {
4564
4572
  function Qn(t) {
4565
4573
  C(
4566
4574
  "list",
4567
- j,
4575
+ D,
4568
4576
  (e) => t.zipList(e),
4569
4577
  Yt
4570
4578
  );
@@ -4572,7 +4580,7 @@ function Qn(t) {
4572
4580
  function Xn(t) {
4573
4581
  C(
4574
4582
  "read",
4575
- j,
4583
+ D,
4576
4584
  (e) => t.xlsxRead(e),
4577
4585
  Kt
4578
4586
  );
@@ -4580,7 +4588,7 @@ function Xn(t) {
4580
4588
  function es(t) {
4581
4589
  C(
4582
4590
  "text",
4583
- j,
4591
+ D,
4584
4592
  (e) => t.pdfText(e),
4585
4593
  Qt
4586
4594
  );
@@ -4685,17 +4693,17 @@ self.onmessage = async (t) => {
4685
4693
  });
4686
4694
  } catch (i) {
4687
4695
  const d = i instanceof Error ? i.message : String(i), o = i instanceof Error ? i.name : void 0, p = i instanceof Error ? i.stack : void 0;
4688
- let c;
4696
+ let l;
4689
4697
  if (p) {
4690
4698
  const R = p.match(/:(\d+):\d+\)?$/m);
4691
- R && (c = parseInt(R[1], 10));
4699
+ R && (l = parseInt(R[1], 10));
4692
4700
  }
4693
- O.error("runCell_error", { runId: n, error: d, name: o, line: c });
4701
+ O.error("runCell_error", { runId: n, error: d, name: o, line: l });
4694
4702
  const m = i instanceof Error ? {
4695
4703
  name: o,
4696
4704
  message: d,
4697
4705
  stack: p,
4698
- ...c !== void 0 ? { line: c } : {}
4706
+ ...l !== void 0 ? { line: l } : {}
4699
4707
  } : { message: d };
4700
4708
  self.postMessage({
4701
4709
  type: "error",
@@ -4878,7 +4886,7 @@ self.onmessage = async (t) => {
4878
4886
  });
4879
4887
  };
4880
4888
  export {
4881
- ke as DEFAULT_RELAY_TIMEOUT_MS,
4889
+ we as DEFAULT_RELAY_TIMEOUT_MS,
4882
4890
  Jn as createExecutableCallback,
4883
4891
  ns as extensionDispatch,
4884
4892
  Dn as registerWorkerHandler,