@agiflowai/agent-cli 0.1.7 → 0.1.9

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.
@@ -1,7 +1,7 @@
1
- import * as oo from "os";
2
- import Nr, { homedir as $o } from "os";
1
+ import * as no from "os";
2
+ import Nr, { homedir as Ao } from "os";
3
3
  import * as Kn from "path";
4
- import ze, { join as Xt, resolve as En, basename as so, dirname as ai, parse as uS } from "path";
4
+ import ze, { join as Xt, resolve as En, basename as io, dirname as ai, parse as uS } from "path";
5
5
  import { execSync as $t, exec as cS, spawn as Ip } from "child_process";
6
6
  import * as Yt from "fs";
7
7
  import Te, { promises as Tp, existsSync as tr, mkdir as Sh, stat as lS, statSync as pS, mkdirSync as bh } from "fs";
@@ -21,10 +21,10 @@ import gS from "node:fs";
21
21
  import Ap from "pino";
22
22
  import { createServer as mS } from "node:http";
23
23
  import _S, { createServer as vS } from "node:net";
24
- import Zt, { WebSocketServer as Ro, WebSocket as jr } from "ws";
24
+ import Zt, { WebSocketServer as $o, WebSocket as jr } from "ws";
25
25
  import { promisify as yS } from "util";
26
26
  import cc, { randomUUID as Za } from "crypto";
27
- import wo from "fs/promises";
27
+ import Eo from "fs/promises";
28
28
  import { execa as SS } from "execa";
29
29
  import lc, { createContext as bS, useContext as xS, useState as dn, useEffect as Yr, useLayoutEffect as kS, useMemo as ES, useRef as Ja } from "react";
30
30
  import { QueryClient as wS, QueryClientProvider as CS } from "@tanstack/react-query";
@@ -874,7 +874,7 @@ function Jt(t) {
874
874
  }
875
875
  }
876
876
  const Vs = Symbol.for("@inversifyjs/common/islazyServiceIdentifier");
877
- class No {
877
+ class Ro {
878
878
  [Vs];
879
879
  #e;
880
880
  constructor(e) {
@@ -906,7 +906,7 @@ const kr = { Request: "Request", Singleton: "Singleton", Transient: "Transient"
906
906
  function* Ch(...t) {
907
907
  for (const e of t) yield* e;
908
908
  }
909
- class Mi {
909
+ class Bi {
910
910
  #e;
911
911
  #t;
912
912
  #n;
@@ -943,7 +943,7 @@ class Mi {
943
943
  }
944
944
  }
945
945
  _buildNewInstance(e) {
946
- return new Mi(e);
946
+ return new Bi(e);
947
947
  }
948
948
  _cloneModel(e) {
949
949
  return e;
@@ -1010,40 +1010,40 @@ class Mi {
1010
1010
  }
1011
1011
  }
1012
1012
  }
1013
- var xi;
1013
+ var bi;
1014
1014
  (function(t) {
1015
1015
  t.moduleId = "moduleId", t.serviceId = "serviceId";
1016
- })(xi || (xi = {}));
1017
- class Ti {
1016
+ })(bi || (bi = {}));
1017
+ class Ii {
1018
1018
  #e;
1019
1019
  #t;
1020
1020
  constructor(e, r) {
1021
- this.#e = r ?? new Mi({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e;
1021
+ this.#e = r ?? new Bi({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e;
1022
1022
  }
1023
1023
  static build(e) {
1024
- return new Ti(e);
1024
+ return new Ii(e);
1025
1025
  }
1026
1026
  add(e, r) {
1027
1027
  this.#e.add(e, r);
1028
1028
  }
1029
1029
  clone() {
1030
- return new Ti(this.#t, this.#e.clone());
1030
+ return new Ii(this.#t, this.#e.clone());
1031
1031
  }
1032
1032
  get(e) {
1033
- const r = [], i = this.#e.get(xi.serviceId, e);
1033
+ const r = [], i = this.#e.get(bi.serviceId, e);
1034
1034
  i !== void 0 && r.push(i);
1035
1035
  const n = this.#t()?.get(e);
1036
1036
  if (n !== void 0 && r.push(n), r.length !== 0) return Ch(...r);
1037
1037
  }
1038
1038
  removeAllByModuleId(e) {
1039
- this.#e.removeByRelation(xi.moduleId, e);
1039
+ this.#e.removeByRelation(bi.moduleId, e);
1040
1040
  }
1041
1041
  removeAllByServiceId(e) {
1042
- this.#e.removeByRelation(xi.serviceId, e);
1042
+ this.#e.removeByRelation(bi.serviceId, e);
1043
1043
  }
1044
1044
  }
1045
- const ki = "@inversifyjs/core/classMetadataReflectKey";
1046
- function Ei() {
1045
+ const xi = "@inversifyjs/core/classMetadataReflectKey";
1046
+ function ki() {
1047
1047
  return { constructorArguments: [], lifecycle: { postConstructMethodNames: /* @__PURE__ */ new Set(), preDestroyMethodNames: /* @__PURE__ */ new Set() }, properties: /* @__PURE__ */ new Map(), scope: void 0 };
1048
1048
  }
1049
1049
  const dc = "@inversifyjs/core/pendingClassMetadataCountReflectKey", qs = Symbol.for("@inversifyjs/core/InversifyCoreError");
@@ -1060,9 +1060,9 @@ class at extends Error {
1060
1060
  return at.is(e) && e.kind === r;
1061
1061
  }
1062
1062
  }
1063
- var ut, Rn, lr, wi, rr;
1063
+ var ut, Rn, lr, Ei, rr;
1064
1064
  function ls(t) {
1065
- const e = $n(t, ki) ?? Ei();
1065
+ const e = $n(t, xi) ?? ki();
1066
1066
  if (!function(r) {
1067
1067
  const i = $n(r, dc);
1068
1068
  return i !== void 0 && i !== 0;
@@ -1142,7 +1142,7 @@ function DS(t) {
1142
1142
  }(Rn || (Rn = {})), function(t) {
1143
1143
  t.id = "id", t.moduleId = "moduleId", t.serviceId = "serviceId";
1144
1144
  }(lr || (lr = {}));
1145
- let BS = class Th extends Mi {
1145
+ let BS = class Th extends Bi {
1146
1146
  _buildNewInstance(e) {
1147
1147
  return new Th(e);
1148
1148
  }
@@ -1217,12 +1217,12 @@ let BS = class Th extends Mi {
1217
1217
  };
1218
1218
  (function(t) {
1219
1219
  t.moduleId = "moduleId", t.serviceId = "serviceId";
1220
- })(wi || (wi = {}));
1220
+ })(Ei || (Ei = {}));
1221
1221
  let Pp = class Xa {
1222
1222
  #e;
1223
1223
  #t;
1224
1224
  constructor(e, r) {
1225
- this.#e = r ?? new Mi({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e;
1225
+ this.#e = r ?? new Bi({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e;
1226
1226
  }
1227
1227
  static build(e) {
1228
1228
  return new Xa(e);
@@ -1234,16 +1234,16 @@ let Pp = class Xa {
1234
1234
  return new Xa(this.#t, this.#e.clone());
1235
1235
  }
1236
1236
  get(e) {
1237
- const r = [], i = this.#e.get(wi.serviceId, e);
1237
+ const r = [], i = this.#e.get(Ei.serviceId, e);
1238
1238
  i !== void 0 && r.push(i);
1239
1239
  const n = this.#t()?.get(e);
1240
1240
  if (n !== void 0 && r.push(n), r.length !== 0) return Ch(...r);
1241
1241
  }
1242
1242
  removeAllByModuleId(e) {
1243
- this.#e.removeByRelation(wi.moduleId, e);
1243
+ this.#e.removeByRelation(Ei.moduleId, e);
1244
1244
  }
1245
1245
  removeAllByServiceId(e) {
1246
- this.#e.removeByRelation(wi.serviceId, e);
1246
+ this.#e.removeByRelation(Ei.serviceId, e);
1247
1247
  }
1248
1248
  };
1249
1249
  function Ah() {
@@ -1315,7 +1315,7 @@ function fc(t, e) {
1315
1315
  n === void 0 ? function(o, s) {
1316
1316
  const a = Hs(o, s);
1317
1317
  return (u, c) => {
1318
- fn(u.constructor, ki, Ei, Op(a(u), c));
1318
+ fn(u.constructor, xi, ki, Op(a(u), c));
1319
1319
  };
1320
1320
  }(t, e)(r, i) : typeof n == "number" ? function(o, s) {
1321
1321
  const a = Hs(o, s);
@@ -1324,7 +1324,7 @@ function fc(t, e) {
1324
1324
  return typeof S == "function" && m === void 0;
1325
1325
  }(u, c)) throw new at(ut.injectionDecoratorConflict, `Found an @inject decorator in a non constructor parameter.
1326
1326
  Found @inject decorator at method "${c?.toString() ?? ""}" at class "${u.constructor.name}"`);
1327
- fn(u, ki, Ei, /* @__PURE__ */ function(S, m) {
1327
+ fn(u, xi, ki, /* @__PURE__ */ function(S, m) {
1328
1328
  return (d) => {
1329
1329
  const h = d.constructorArguments[m];
1330
1330
  return d.constructorArguments[m] = S(h), d;
@@ -1338,7 +1338,7 @@ Found @inject decorator at method "${c?.toString() ?? ""}" at class "${u.constru
1338
1338
  return S.set !== void 0;
1339
1339
  }(f)) throw new at(ut.injectionDecoratorConflict, `Found an @inject decorator in a non setter property method.
1340
1340
  Found @inject decorator at method "${c.toString()}" at class "${u.constructor.name}"`);
1341
- fn(u.constructor, ki, Ei, Op(a(u), c));
1341
+ fn(u.constructor, xi, ki, Op(a(u), c));
1342
1342
  };
1343
1343
  }(t, e)(r, i, n);
1344
1344
  } catch (o) {
@@ -1361,7 +1361,7 @@ function H(t) {
1361
1361
  const Dp = "@inversifyjs/core/classIsInjectableFlagReflectKey", LS = [Array, BigInt, Boolean, Function, Number, Object, String];
1362
1362
  function zS(t) {
1363
1363
  const e = $n(t, "design:paramtypes");
1364
- e !== void 0 && fn(t, ki, Ei, /* @__PURE__ */ function(r) {
1364
+ e !== void 0 && fn(t, xi, ki, /* @__PURE__ */ function(r) {
1365
1365
  return (i) => (r.forEach((n, o) => {
1366
1366
  var s;
1367
1367
  i.constructorArguments[o] !== void 0 || (s = n, LS.includes(s)) || (i.constructorArguments[o] = function(a) {
@@ -1589,7 +1589,7 @@ function mc(t, e, r) {
1589
1589
  Oh(t.bindings, e, r, []);
1590
1590
  }
1591
1591
  function ds(t) {
1592
- return No.is(t) ? t.unwrap() : t;
1592
+ return Ro.is(t) ? t.unwrap() : t;
1593
1593
  }
1594
1594
  function Lh(t) {
1595
1595
  return (e, r, i) => {
@@ -1697,7 +1697,7 @@ function jh(t, e, r, i) {
1697
1697
  y = { key: w, value: I };
1698
1698
  }
1699
1699
  }
1700
- const x = No.is(l.value) ? l.value.unwrap() : l.value;
1700
+ const x = Ro.is(l.value) ? l.value.unwrap() : l.value;
1701
1701
  return l.kind === rr.multipleInjection ? { chained: l.chained, isMultiple: !0, name: l.name, optional: l.optional, serviceIdentifier: x, tag: y } : { isMultiple: !1, name: l.name, optional: l.optional, serviceIdentifier: x, tag: y };
1702
1702
  }(d);
1703
1703
  if (h !== void 0) {
@@ -1730,7 +1730,7 @@ function jh(t, e, r, i) {
1730
1730
  y = { key: w, value: I };
1731
1731
  }
1732
1732
  }
1733
- const x = No.is(l.value) ? l.value.unwrap() : l.value;
1733
+ const x = Ro.is(l.value) ? l.value.unwrap() : l.value;
1734
1734
  return l.kind === Qr.multipleInjection ? { chained: l.chained, isMultiple: !0, name: l.name, optional: l.optional, serviceIdentifier: x, tag: y } : { isMultiple: !1, name: l.name, optional: l.optional, serviceIdentifier: x, tag: y };
1735
1735
  }(d);
1736
1736
  if (h !== void 0) {
@@ -2092,7 +2092,7 @@ async function Vp(t, e, r) {
2092
2092
  for (; n.done !== !0; ) i = await n.value(t.context, i), n = r.next();
2093
2093
  return i;
2094
2094
  }
2095
- function Co(t, e, r) {
2095
+ function wo(t, e, r) {
2096
2096
  let i = r;
2097
2097
  if (e.onActivation !== void 0) {
2098
2098
  const n = e.onActivation;
@@ -2101,7 +2101,7 @@ function Co(t, e, r) {
2101
2101
  return tb(t, e.serviceIdentifier, i);
2102
2102
  }
2103
2103
  function vc(t) {
2104
- return (e, r) => r.cache.isRight ? r.cache.value : Hh(r, Co(e, r, t(e, r)));
2104
+ return (e, r) => r.cache.isRight ? r.cache.value : Hh(r, wo(e, r, t(e, r)));
2105
2105
  }
2106
2106
  const rb = vc(function(t, e) {
2107
2107
  return e.value;
@@ -2114,14 +2114,14 @@ function yc(t, e) {
2114
2114
  const n = t(i);
2115
2115
  switch (n.scope) {
2116
2116
  case kr.Singleton:
2117
- return n.cache.isRight ? n.cache.value : Hh(n, Co(r, n, e(r, i)));
2117
+ return n.cache.isRight ? n.cache.value : Hh(n, wo(r, n, e(r, i)));
2118
2118
  case kr.Request: {
2119
2119
  if (r.requestScopeCache.has(n.id)) return r.requestScopeCache.get(n.id);
2120
- const o = Co(r, n, e(r, i));
2120
+ const o = wo(r, n, e(r, i));
2121
2121
  return r.requestScopeCache.set(n.id, o), o;
2122
2122
  }
2123
2123
  case kr.Transient:
2124
- return Co(r, n, e(r, i));
2124
+ return wo(r, n, e(r, i));
2125
2125
  }
2126
2126
  };
2127
2127
  }
@@ -2304,7 +2304,7 @@ function ed(t, e, r) {
2304
2304
  let i;
2305
2305
  return e.onDeactivation !== void 0 && (i = (0, e.onDeactivation)(r)), i === void 0 ? Yp(t, e.serviceIdentifier, r) : i.then(() => Yp(t, e.serviceIdentifier, r));
2306
2306
  }
2307
- function Po(t, e) {
2307
+ function No(t, e) {
2308
2308
  if (e === void 0) return;
2309
2309
  const r = function(n) {
2310
2310
  const o = [];
@@ -2320,11 +2320,11 @@ function Po(t, e) {
2320
2320
  }
2321
2321
  function mb(t, e) {
2322
2322
  const r = t.getBindingsFromModule(e);
2323
- return Po(t, r);
2323
+ return No(t, r);
2324
2324
  }
2325
2325
  function _b(t, e) {
2326
2326
  const r = t.getBindings(e);
2327
- return Po(t, r);
2327
+ return No(t, r);
2328
2328
  }
2329
2329
  const vb = Symbol.for("@inversifyjs/plugin/isPlugin"), Ws = "@inversifyjs/container/bindingId";
2330
2330
  class Hr {
@@ -2368,7 +2368,7 @@ var Ur;
2368
2368
  function Sc(t) {
2369
2369
  return { [Kh]: !0, id: t.id };
2370
2370
  }
2371
- function vi(t) {
2371
+ function _i(t) {
2372
2372
  return (e) => {
2373
2373
  for (let r = e.getAncestor(); r !== void 0; r = r.getAncestor()) if (t(r)) return !0;
2374
2374
  return !1;
@@ -2377,7 +2377,7 @@ function vi(t) {
2377
2377
  function fi(t) {
2378
2378
  return (e) => e.name === t;
2379
2379
  }
2380
- function ao(t) {
2380
+ function oo(t) {
2381
2381
  return (e) => e.serviceIdentifier === t;
2382
2382
  }
2383
2383
  function hi(t, e) {
@@ -2386,17 +2386,17 @@ function hi(t, e) {
2386
2386
  function yb(t) {
2387
2387
  return t.name === void 0 && t.tags.size === 0;
2388
2388
  }
2389
- function uo(t) {
2390
- const e = vi(t);
2389
+ function so(t) {
2390
+ const e = _i(t);
2391
2391
  return (r) => !e(r);
2392
2392
  }
2393
- function co(t) {
2393
+ function ao(t) {
2394
2394
  return (e) => {
2395
2395
  const r = e.getAncestor();
2396
2396
  return r === void 0 || !t(r);
2397
2397
  };
2398
2398
  }
2399
- function lo(t) {
2399
+ function uo(t) {
2400
2400
  return (e) => {
2401
2401
  const r = e.getAncestor();
2402
2402
  return r !== void 0 && t(r);
@@ -2465,7 +2465,7 @@ class Wh {
2465
2465
  }
2466
2466
  #i(e) {
2467
2467
  return { arguments: (e ?? []).map((r) => function(i) {
2468
- return typeof i == "object" && !No.is(i);
2468
+ return typeof i == "object" && !Ro.is(i);
2469
2469
  }(r) ? function(i) {
2470
2470
  return i.isMultiple === !0;
2471
2471
  }(r) ? { chained: r.chained ?? !1, kind: Qr.multipleInjection, name: r.name, optional: r.optional ?? !1, tags: new Map((r.tags ?? []).map((i) => [i.key, i.value])), value: r.serviceIdentifier } : { kind: Qr.singleInjection, name: r.name, optional: r.optional ?? !1, tags: new Map((r.tags ?? []).map((i) => [i.key, i.value])), value: r.serviceIdentifier } : { kind: Qr.singleInjection, name: void 0, optional: !1, tags: /* @__PURE__ */ new Map(), value: r }) };
@@ -2499,19 +2499,19 @@ class iu {
2499
2499
  return this.#e.isSatisfiedBy = e, new Zh(this.#e);
2500
2500
  }
2501
2501
  whenAnyAncestor(e) {
2502
- return this.when(vi(e));
2502
+ return this.when(_i(e));
2503
2503
  }
2504
2504
  whenAnyAncestorIs(e) {
2505
- return this.when(vi(ao(e)));
2505
+ return this.when(_i(oo(e)));
2506
2506
  }
2507
2507
  whenAnyAncestorNamed(e) {
2508
2508
  return this.when(function(r) {
2509
- return vi(fi(r));
2509
+ return _i(fi(r));
2510
2510
  }(e));
2511
2511
  }
2512
2512
  whenAnyAncestorTagged(e, r) {
2513
2513
  return this.when(function(i, n) {
2514
- return vi(hi(i, n));
2514
+ return _i(hi(i, n));
2515
2515
  }(e, r));
2516
2516
  }
2517
2517
  whenDefault() {
@@ -2521,54 +2521,54 @@ class iu {
2521
2521
  return this.when(fi(e));
2522
2522
  }
2523
2523
  whenNoParent(e) {
2524
- return this.when(co(e));
2524
+ return this.when(ao(e));
2525
2525
  }
2526
2526
  whenNoParentIs(e) {
2527
- return this.when(co(ao(e)));
2527
+ return this.when(ao(oo(e)));
2528
2528
  }
2529
2529
  whenNoParentNamed(e) {
2530
2530
  return this.when(function(r) {
2531
- return co(fi(r));
2531
+ return ao(fi(r));
2532
2532
  }(e));
2533
2533
  }
2534
2534
  whenNoParentTagged(e, r) {
2535
2535
  return this.when(function(i, n) {
2536
- return co(hi(i, n));
2536
+ return ao(hi(i, n));
2537
2537
  }(e, r));
2538
2538
  }
2539
2539
  whenParent(e) {
2540
- return this.when(lo(e));
2540
+ return this.when(uo(e));
2541
2541
  }
2542
2542
  whenParentIs(e) {
2543
- return this.when(lo(ao(e)));
2543
+ return this.when(uo(oo(e)));
2544
2544
  }
2545
2545
  whenParentNamed(e) {
2546
2546
  return this.when(function(r) {
2547
- return lo(fi(r));
2547
+ return uo(fi(r));
2548
2548
  }(e));
2549
2549
  }
2550
2550
  whenParentTagged(e, r) {
2551
2551
  return this.when(function(i, n) {
2552
- return lo(hi(i, n));
2552
+ return uo(hi(i, n));
2553
2553
  }(e, r));
2554
2554
  }
2555
2555
  whenTagged(e, r) {
2556
2556
  return this.when(hi(e, r));
2557
2557
  }
2558
2558
  whenNoAncestor(e) {
2559
- return this.when(uo(e));
2559
+ return this.when(so(e));
2560
2560
  }
2561
2561
  whenNoAncestorIs(e) {
2562
- return this.when(uo(ao(e)));
2562
+ return this.when(so(oo(e)));
2563
2563
  }
2564
2564
  whenNoAncestorNamed(e) {
2565
2565
  return this.when(function(r) {
2566
- return uo(fi(r));
2566
+ return so(fi(r));
2567
2567
  }(e));
2568
2568
  }
2569
2569
  whenNoAncestorTagged(e, r) {
2570
2570
  return this.when(function(i, n) {
2571
- return uo(hi(i, n));
2571
+ return so(hi(i, n));
2572
2572
  }(e, r));
2573
2573
  }
2574
2574
  }
@@ -2658,7 +2658,7 @@ class bb {
2658
2658
  return td(e) ? this.#c(e) : this.#a(e);
2659
2659
  }
2660
2660
  #c(e) {
2661
- const r = this.#r.bindingService.getById(e.id), i = r === void 0 ? void 0 : [...r], n = Po(this.#e, r);
2661
+ const r = this.#r.bindingService.getById(e.id), i = r === void 0 ? void 0 : [...r], n = No(this.#e, r);
2662
2662
  if (n !== void 0) return n.then(() => {
2663
2663
  this.#u(i, e);
2664
2664
  });
@@ -2668,7 +2668,7 @@ class bb {
2668
2668
  if (this.#r.bindingService.removeById(r.id), e !== void 0) for (const i of e) this.#n.invalidateService({ binding: i, kind: Pr.bindingRemoved });
2669
2669
  }
2670
2670
  #a(e) {
2671
- const r = this.#r.bindingService.get(e), i = r === void 0 ? void 0 : [...r], n = Po(this.#e, r);
2671
+ const r = this.#r.bindingService.get(e), i = r === void 0 ? void 0 : [...r], n = No(this.#e, r);
2672
2672
  if (n !== void 0) return n.then(() => {
2673
2673
  this.#p(e, i);
2674
2674
  });
@@ -2981,12 +2981,12 @@ class hs {
2981
2981
  }
2982
2982
  #c(e, r, i) {
2983
2983
  const n = this.#s(r, i);
2984
- if (e?.parent === void 0) return new rd(Ti.build(() => {
2984
+ if (e?.parent === void 0) return new rd(Ii.build(() => {
2985
2985
  }), Np.build(() => {
2986
2986
  }, n), Pp.build(() => {
2987
2987
  }), new Fp());
2988
2988
  const o = new Fp(), s = e.parent;
2989
- return s.#r.planResultCacheService.subscribe(o), new rd(Ti.build(() => s.#r.activationService), Np.build(() => s.#r.bindingService, n), Pp.build(() => s.#r.deactivationService), o);
2989
+ return s.#r.planResultCacheService.subscribe(o), new rd(Ii.build(() => s.#r.activationService), Np.build(() => s.#r.bindingService, n), Pp.build(() => s.#r.deactivationService), o);
2990
2990
  }
2991
2991
  }
2992
2992
  const Jh = Object.freeze({
@@ -3030,9 +3030,9 @@ class gs extends Error {
3030
3030
  super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
3031
3031
  }
3032
3032
  }
3033
- const Oo = {};
3033
+ const Po = {};
3034
3034
  function nr(t) {
3035
- return t && Object.assign(Oo, t), Oo;
3035
+ return t && Object.assign(Po, t), Po;
3036
3036
  }
3037
3037
  function $b(t) {
3038
3038
  return t;
@@ -3054,10 +3054,10 @@ function bc(t) {
3054
3054
  function le(t, e = "|") {
3055
3055
  return t.map((r) => Be(r)).join(e);
3056
3056
  }
3057
- function Do(t, e) {
3057
+ function Oo(t, e) {
3058
3058
  return typeof e == "bigint" ? e.toString() : e;
3059
3059
  }
3060
- function Li(t) {
3060
+ function Ui(t) {
3061
3061
  return {
3062
3062
  get value() {
3063
3063
  {
@@ -3150,7 +3150,7 @@ const xc = "captureStackTrace" in Error ? Error.captureStackTrace : (...t) => {
3150
3150
  function Jn(t) {
3151
3151
  return typeof t == "object" && t !== null && !Array.isArray(t);
3152
3152
  }
3153
- const Xh = Li(() => {
3153
+ const Xh = Ui(() => {
3154
3154
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
3155
3155
  return !1;
3156
3156
  try {
@@ -3200,7 +3200,7 @@ const Fb = (t) => {
3200
3200
  default:
3201
3201
  throw new Error(`Unknown data type: ${e}`);
3202
3202
  }
3203
- }, Bo = /* @__PURE__ */ new Set(["string", "number", "symbol"]), eg = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
3203
+ }, Do = /* @__PURE__ */ new Set(["string", "number", "symbol"]), eg = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
3204
3204
  function hn(t) {
3205
3205
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3206
3206
  }
@@ -3399,13 +3399,13 @@ function Or(t, e) {
3399
3399
  return (i = r).path ?? (i.path = []), r.path.unshift(t), r;
3400
3400
  });
3401
3401
  }
3402
- function yi(t) {
3402
+ function vi(t) {
3403
3403
  return typeof t == "string" ? t : t?.message;
3404
3404
  }
3405
3405
  function Mr(t, e, r) {
3406
3406
  const i = { ...t, path: t.path ?? [] };
3407
3407
  if (!t.message) {
3408
- const n = yi(t.inst?._zod.def?.error?.(t)) ?? yi(e?.error?.(t)) ?? yi(r.customError?.(t)) ?? yi(r.localeError?.(t)) ?? "Invalid input";
3408
+ const n = vi(t.inst?._zod.def?.error?.(t)) ?? vi(e?.error?.(t)) ?? vi(r.customError?.(t)) ?? vi(r.localeError?.(t)) ?? "Invalid input";
3409
3409
  i.message = n;
3410
3410
  }
3411
3411
  return delete i.inst, delete i.continue, e?.reportInput || delete i.input, i;
@@ -3478,7 +3478,7 @@ const fg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3478
3478
  assignProp: mn,
3479
3479
  base64ToUint8Array: pg,
3480
3480
  base64urlToUint8Array: Gb,
3481
- cached: Li,
3481
+ cached: Ui,
3482
3482
  captureStackTrace: xc,
3483
3483
  cleanEnum: Vb,
3484
3484
  cleanRegex: ms,
@@ -3501,7 +3501,7 @@ const fg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3501
3501
  isPlainObject: Pn,
3502
3502
  issue: Yn,
3503
3503
  joinValues: le,
3504
- jsonStringifyReplacer: Do,
3504
+ jsonStringifyReplacer: Oo,
3505
3505
  merge: ug,
3506
3506
  mergeDefs: en,
3507
3507
  normalizeParams: ne,
@@ -3515,7 +3515,7 @@ const fg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3515
3515
  prefixIssues: Or,
3516
3516
  primitiveTypes: eg,
3517
3517
  promiseAllObject: Mb,
3518
- propertyKeyTypes: Bo,
3518
+ propertyKeyTypes: Do,
3519
3519
  randomString: Lb,
3520
3520
  required: lg,
3521
3521
  safeExtend: ag,
@@ -3524,7 +3524,7 @@ const fg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3524
3524
  uint8ArrayToBase64: dg,
3525
3525
  uint8ArrayToBase64url: qb,
3526
3526
  uint8ArrayToHex: Kb,
3527
- unwrapMessage: yi
3527
+ unwrapMessage: vi
3528
3528
  }, Symbol.toStringTag, { value: "Module" })), hg = (t, e) => {
3529
3529
  t.name = "$ZodError", Object.defineProperty(t, "_zod", {
3530
3530
  value: t._zod,
@@ -3532,7 +3532,7 @@ const fg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3532
3532
  }), Object.defineProperty(t, "issues", {
3533
3533
  value: e,
3534
3534
  enumerable: !1
3535
- }), t.message = JSON.stringify(e, Do, 2), Object.defineProperty(t, "toString", {
3535
+ }), t.message = JSON.stringify(e, Oo, 2), Object.defineProperty(t, "toString", {
3536
3536
  value: () => t.message,
3537
3537
  enumerable: !1
3538
3538
  });
@@ -3602,7 +3602,7 @@ function _g(t) {
3602
3602
  return e.join(`
3603
3603
  `);
3604
3604
  }
3605
- const zi = (t) => (e, r, i, n) => {
3605
+ const Mi = (t) => (e, r, i, n) => {
3606
3606
  const o = i ? Object.assign(i, { async: !1 }) : { async: !1 }, s = e._zod.run({ value: r, issues: [] }, o);
3607
3607
  if (s instanceof Promise)
3608
3608
  throw new Tn();
@@ -3611,7 +3611,7 @@ const zi = (t) => (e, r, i, n) => {
3611
3611
  throw xc(a, n?.callee), a;
3612
3612
  }
3613
3613
  return s.value;
3614
- }, su = /* @__PURE__ */ zi(gr), Fi = (t) => async (e, r, i, n) => {
3614
+ }, su = /* @__PURE__ */ Mi(gr), Li = (t) => async (e, r, i, n) => {
3615
3615
  const o = i ? Object.assign(i, { async: !0 }) : { async: !0 };
3616
3616
  let s = e._zod.run({ value: r, issues: [] }, o);
3617
3617
  if (s instanceof Promise && (s = await s), s.issues.length) {
@@ -3619,7 +3619,7 @@ const zi = (t) => (e, r, i, n) => {
3619
3619
  throw xc(a, n?.callee), a;
3620
3620
  }
3621
3621
  return s.value;
3622
- }, au = /* @__PURE__ */ Fi(gr), ji = (t) => (e, r, i) => {
3622
+ }, au = /* @__PURE__ */ Li(gr), zi = (t) => (e, r, i) => {
3623
3623
  const n = i ? { ...i, async: !1 } : { async: !1 }, o = e._zod.run({ value: r, issues: [] }, n);
3624
3624
  if (o instanceof Promise)
3625
3625
  throw new Tn();
@@ -3627,26 +3627,26 @@ const zi = (t) => (e, r, i, n) => {
3627
3627
  success: !1,
3628
3628
  error: new (t ?? kc)(o.issues.map((s) => Mr(s, n, nr())))
3629
3629
  } : { success: !0, data: o.value };
3630
- }, vg = /* @__PURE__ */ ji(gr), Vi = (t) => async (e, r, i) => {
3630
+ }, vg = /* @__PURE__ */ zi(gr), Fi = (t) => async (e, r, i) => {
3631
3631
  const n = i ? Object.assign(i, { async: !0 }) : { async: !0 };
3632
3632
  let o = e._zod.run({ value: r, issues: [] }, n);
3633
3633
  return o instanceof Promise && (o = await o), o.issues.length ? {
3634
3634
  success: !1,
3635
3635
  error: new t(o.issues.map((s) => Mr(s, n, nr())))
3636
3636
  } : { success: !0, data: o.value };
3637
- }, yg = /* @__PURE__ */ Vi(gr), Cc = (t) => (e, r, i) => {
3637
+ }, yg = /* @__PURE__ */ Fi(gr), Cc = (t) => (e, r, i) => {
3638
3638
  const n = i ? Object.assign(i, { direction: "backward" }) : { direction: "backward" };
3639
- return zi(t)(e, r, n);
3640
- }, Zb = /* @__PURE__ */ Cc(gr), Ic = (t) => (e, r, i) => zi(t)(e, r, i), Jb = /* @__PURE__ */ Ic(gr), Tc = (t) => async (e, r, i) => {
3639
+ return Mi(t)(e, r, n);
3640
+ }, Zb = /* @__PURE__ */ Cc(gr), Ic = (t) => (e, r, i) => Mi(t)(e, r, i), Jb = /* @__PURE__ */ Ic(gr), Tc = (t) => async (e, r, i) => {
3641
3641
  const n = i ? Object.assign(i, { direction: "backward" }) : { direction: "backward" };
3642
- return Fi(t)(e, r, n);
3643
- }, Yb = /* @__PURE__ */ Tc(gr), Ac = (t) => async (e, r, i) => Fi(t)(e, r, i), Qb = /* @__PURE__ */ Ac(gr), $c = (t) => (e, r, i) => {
3642
+ return Li(t)(e, r, n);
3643
+ }, Yb = /* @__PURE__ */ Tc(gr), Ac = (t) => async (e, r, i) => Li(t)(e, r, i), Qb = /* @__PURE__ */ Ac(gr), $c = (t) => (e, r, i) => {
3644
3644
  const n = i ? Object.assign(i, { direction: "backward" }) : { direction: "backward" };
3645
- return ji(t)(e, r, n);
3646
- }, Xb = /* @__PURE__ */ $c(gr), Rc = (t) => (e, r, i) => ji(t)(e, r, i), ex = /* @__PURE__ */ Rc(gr), Nc = (t) => async (e, r, i) => {
3645
+ return zi(t)(e, r, n);
3646
+ }, Xb = /* @__PURE__ */ $c(gr), Rc = (t) => (e, r, i) => zi(t)(e, r, i), ex = /* @__PURE__ */ Rc(gr), Nc = (t) => async (e, r, i) => {
3647
3647
  const n = i ? Object.assign(i, { direction: "backward" }) : { direction: "backward" };
3648
- return Vi(t)(e, r, n);
3649
- }, tx = /* @__PURE__ */ Nc(gr), Pc = (t) => async (e, r, i) => Vi(t)(e, r, i), rx = /* @__PURE__ */ Pc(gr), Sg = /^[cC][^\s-]{8,}$/, bg = /^[0-9a-z]+$/, xg = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, kg = /^[0-9a-vA-V]{20}$/, Eg = /^[A-Za-z0-9]{27}$/, wg = /^[a-zA-Z0-9_-]{21}$/, Cg = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, nx = /^[-+]?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)?)??$/, Ig = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Qn = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, ix = /* @__PURE__ */ Qn(4), ox = /* @__PURE__ */ Qn(6), sx = /* @__PURE__ */ Qn(7), Tg = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ax = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, ux = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Ag = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u, cx = Ag, lx = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, px = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
3648
+ return Fi(t)(e, r, n);
3649
+ }, tx = /* @__PURE__ */ Nc(gr), Pc = (t) => async (e, r, i) => Fi(t)(e, r, i), rx = /* @__PURE__ */ Pc(gr), Sg = /^[cC][^\s-]{8,}$/, bg = /^[0-9a-z]+$/, xg = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, kg = /^[0-9a-vA-V]{20}$/, Eg = /^[A-Za-z0-9]{27}$/, wg = /^[a-zA-Z0-9_-]{21}$/, Cg = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, nx = /^[-+]?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)?)??$/, Ig = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Qn = (t) => t ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, ix = /* @__PURE__ */ Qn(4), ox = /* @__PURE__ */ Qn(6), sx = /* @__PURE__ */ Qn(7), Tg = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, ax = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, ux = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Ag = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u, cx = Ag, lx = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, px = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
3650
3650
  function $g() {
3651
3651
  return new RegExp(px, "u");
3652
3652
  }
@@ -3668,13 +3668,13 @@ const Vg = (t) => {
3668
3668
  const e = t ? `[\\s\\S]{${t?.minimum ?? 0},${t?.maximum ?? ""}}` : "[\\s\\S]*";
3669
3669
  return new RegExp(`^${e}$`);
3670
3670
  }, Gg = /^-?\d+n?$/, qg = /^-?\d+$/, Hg = /^-?\d+(?:\.\d+)?/, Kg = /^(?:true|false)$/i, Wg = /^null$/i, Zg = /^undefined$/i, Jg = /^[^A-Z]*$/, Yg = /^[^a-z]*$/, Qg = /^[0-9a-fA-F]*$/;
3671
- function Gi(t, e) {
3671
+ function ji(t, e) {
3672
3672
  return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`);
3673
3673
  }
3674
- function qi(t) {
3674
+ function Vi(t) {
3675
3675
  return new RegExp(`^[A-Za-z0-9_-]{${t}}$`);
3676
3676
  }
3677
- const dx = /^[0-9a-fA-F]{32}$/, fx = /* @__PURE__ */ Gi(22, "=="), hx = /* @__PURE__ */ qi(22), gx = /^[0-9a-fA-F]{40}$/, mx = /* @__PURE__ */ Gi(27, "="), _x = /* @__PURE__ */ qi(27), vx = /^[0-9a-fA-F]{64}$/, yx = /* @__PURE__ */ Gi(43, "="), Sx = /* @__PURE__ */ qi(43), bx = /^[0-9a-fA-F]{96}$/, xx = /* @__PURE__ */ Gi(64, ""), kx = /* @__PURE__ */ qi(64), Ex = /^[0-9a-fA-F]{128}$/, wx = /* @__PURE__ */ Gi(86, "=="), Cx = /* @__PURE__ */ qi(86), Bc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3677
+ const dx = /^[0-9a-fA-F]{32}$/, fx = /* @__PURE__ */ ji(22, "=="), hx = /* @__PURE__ */ Vi(22), gx = /^[0-9a-fA-F]{40}$/, mx = /* @__PURE__ */ ji(27, "="), _x = /* @__PURE__ */ Vi(27), vx = /^[0-9a-fA-F]{64}$/, yx = /* @__PURE__ */ ji(43, "="), Sx = /* @__PURE__ */ Vi(43), bx = /^[0-9a-fA-F]{96}$/, xx = /* @__PURE__ */ ji(64, ""), kx = /* @__PURE__ */ Vi(64), Ex = /^[0-9a-fA-F]{128}$/, wx = /* @__PURE__ */ ji(86, "=="), Cx = /* @__PURE__ */ Vi(86), Bc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3678
3678
  __proto__: null,
3679
3679
  base64: Dg,
3680
3680
  base64url: Oc,
@@ -4003,7 +4003,7 @@ const dx = /^[0-9a-fA-F]{32}$/, fx = /* @__PURE__ */ Gi(22, "=="), hx = /* @__PU
4003
4003
  continue: !e.abort
4004
4004
  });
4005
4005
  };
4006
- }), Hi = /* @__PURE__ */ K("$ZodCheckStringFormat", (t, e) => {
4006
+ }), Gi = /* @__PURE__ */ K("$ZodCheckStringFormat", (t, e) => {
4007
4007
  var r, i;
4008
4008
  Rt.init(t, e), t._zod.onattach.push((n) => {
4009
4009
  const o = n._zod.bag;
@@ -4021,7 +4021,7 @@ const dx = /^[0-9a-fA-F]{32}$/, fx = /* @__PURE__ */ Gi(22, "=="), hx = /* @__PU
4021
4021
  }) : (i = t._zod).check ?? (i.check = () => {
4022
4022
  });
4023
4023
  }), cm = /* @__PURE__ */ K("$ZodCheckRegex", (t, e) => {
4024
- Hi.init(t, e), t._zod.check = (r) => {
4024
+ Gi.init(t, e), t._zod.check = (r) => {
4025
4025
  e.pattern.lastIndex = 0, !e.pattern.test(r.value) && r.issues.push({
4026
4026
  origin: "string",
4027
4027
  code: "invalid_format",
@@ -4033,9 +4033,9 @@ const dx = /^[0-9a-fA-F]{32}$/, fx = /* @__PURE__ */ Gi(22, "=="), hx = /* @__PU
4033
4033
  });
4034
4034
  };
4035
4035
  }), lm = /* @__PURE__ */ K("$ZodCheckLowerCase", (t, e) => {
4036
- e.pattern ?? (e.pattern = Jg), Hi.init(t, e);
4036
+ e.pattern ?? (e.pattern = Jg), Gi.init(t, e);
4037
4037
  }), pm = /* @__PURE__ */ K("$ZodCheckUpperCase", (t, e) => {
4038
- e.pattern ?? (e.pattern = Yg), Hi.init(t, e);
4038
+ e.pattern ?? (e.pattern = Yg), Gi.init(t, e);
4039
4039
  }), dm = /* @__PURE__ */ K("$ZodCheckIncludes", (t, e) => {
4040
4040
  Rt.init(t, e);
4041
4041
  const r = hn(e.includes), i = new RegExp(typeof e.position == "number" ? `^.{${e.position}}${r}` : r);
@@ -4221,7 +4221,7 @@ const ym = {
4221
4221
  vendor: "zod",
4222
4222
  version: 1
4223
4223
  };
4224
- }), Ki = /* @__PURE__ */ K("$ZodString", (t, e) => {
4224
+ }), qi = /* @__PURE__ */ K("$ZodString", (t, e) => {
4225
4225
  Fe.init(t, e), t._zod.pattern = [...t?._zod.bag?.patterns ?? []].pop() ?? Vg(t._zod.bag), t._zod.parse = (r, i) => {
4226
4226
  if (e.coerce)
4227
4227
  try {
@@ -4236,7 +4236,7 @@ const ym = {
4236
4236
  }), r;
4237
4237
  };
4238
4238
  }), _t = /* @__PURE__ */ K("$ZodStringFormat", (t, e) => {
4239
- Hi.init(t, e), Ki.init(t, e);
4239
+ Gi.init(t, e), qi.init(t, e);
4240
4240
  }), Sm = /* @__PURE__ */ K("$ZodGUID", (t, e) => {
4241
4241
  e.pattern ?? (e.pattern = Ig), _t.init(t, e);
4242
4242
  }), bm = /* @__PURE__ */ K("$ZodUUID", (t, e) => {
@@ -4587,7 +4587,7 @@ const r_ = /* @__PURE__ */ K("$ZodArray", (t, e) => {
4587
4587
  return o.length ? Promise.all(o).then(() => r) : r;
4588
4588
  };
4589
4589
  });
4590
- function Uo(t, e, r, i) {
4590
+ function Bo(t, e, r, i) {
4591
4591
  t.issues.length && e.issues.push(...Or(r, t.issues)), t.value === void 0 ? r in i && (e.value[r] = void 0) : e.value[r] = t.value;
4592
4592
  }
4593
4593
  function n_(t) {
@@ -4614,7 +4614,7 @@ function i_(t, e, r, i, n, o) {
4614
4614
  continue;
4615
4615
  }
4616
4616
  const S = u.run({ value: e[f], issues: [] }, i);
4617
- S instanceof Promise ? t.push(S.then((m) => Uo(m, r, f, e))) : Uo(S, r, f, e);
4617
+ S instanceof Promise ? t.push(S.then((m) => Bo(m, r, f, e))) : Bo(S, r, f, e);
4618
4618
  }
4619
4619
  return s.length && r.issues.push({
4620
4620
  code: "unrecognized_keys",
@@ -4635,7 +4635,7 @@ const o_ = /* @__PURE__ */ K("$ZodObject", (t, e) => {
4635
4635
  }
4636
4636
  });
4637
4637
  }
4638
- const i = Li(() => n_(e));
4638
+ const i = Ui(() => n_(e));
4639
4639
  et(t._zod, "propValues", () => {
4640
4640
  const a = e.shape, u = {};
4641
4641
  for (const c in a) {
@@ -4664,13 +4664,13 @@ const o_ = /* @__PURE__ */ K("$ZodObject", (t, e) => {
4664
4664
  const f = [], S = s.shape;
4665
4665
  for (const m of s.keys) {
4666
4666
  const h = S[m]._zod.run({ value: c[m], issues: [] }, u);
4667
- h instanceof Promise ? f.push(h.then((v) => Uo(v, a, m, c))) : Uo(h, a, m, c);
4667
+ h instanceof Promise ? f.push(h.then((v) => Bo(v, a, m, c))) : Bo(h, a, m, c);
4668
4668
  }
4669
4669
  return o ? i_(f, c, a, u, i.value, t) : f.length ? Promise.all(f).then(() => a) : a;
4670
4670
  };
4671
4671
  }), s_ = /* @__PURE__ */ K("$ZodObjectJIT", (t, e) => {
4672
4672
  o_.init(t, e);
4673
- const r = t._zod.parse, i = Li(() => n_(e)), n = (m) => {
4673
+ const r = t._zod.parse, i = Ui(() => n_(e)), n = (m) => {
4674
4674
  const d = new vm(["shape", "payload", "ctx"]), h = i.value, v = (x) => {
4675
4675
  const w = ou(x);
4676
4676
  return `shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`;
@@ -4707,7 +4707,7 @@ const o_ = /* @__PURE__ */ K("$ZodObject", (t, e) => {
4707
4707
  return (x, w) => y(m, x, w);
4708
4708
  };
4709
4709
  let o;
4710
- const s = Jn, a = !Oo.jitless, c = a && Xh.value, f = e.catchall;
4710
+ const s = Jn, a = !Po.jitless, c = a && Xh.value, f = e.catchall;
4711
4711
  let S;
4712
4712
  t._zod.parse = (m, d) => {
4713
4713
  S ?? (S = i.value);
@@ -4780,7 +4780,7 @@ const Vc = /* @__PURE__ */ K("$ZodUnion", (t, e) => {
4780
4780
  }
4781
4781
  return n;
4782
4782
  });
4783
- const i = Li(() => {
4783
+ const i = Ui(() => {
4784
4784
  const n = e.options, o = /* @__PURE__ */ new Map();
4785
4785
  for (const s of n) {
4786
4786
  const a = s._zod.propValues?.[e.discriminator];
@@ -4895,7 +4895,7 @@ const Gc = /* @__PURE__ */ K("$ZodTuple", (t, e) => {
4895
4895
  value: s[u],
4896
4896
  issues: []
4897
4897
  }, o);
4898
- f instanceof Promise ? a.push(f.then((S) => po(S, n, u))) : po(f, n, u);
4898
+ f instanceof Promise ? a.push(f.then((S) => co(S, n, u))) : co(f, n, u);
4899
4899
  }
4900
4900
  if (e.rest) {
4901
4901
  const c = s.slice(r.length);
@@ -4905,13 +4905,13 @@ const Gc = /* @__PURE__ */ K("$ZodTuple", (t, e) => {
4905
4905
  value: f,
4906
4906
  issues: []
4907
4907
  }, o);
4908
- S instanceof Promise ? a.push(S.then((m) => po(m, n, u))) : po(S, n, u);
4908
+ S instanceof Promise ? a.push(S.then((m) => co(m, n, u))) : co(S, n, u);
4909
4909
  }
4910
4910
  }
4911
4911
  return a.length ? Promise.all(a).then(() => n) : n;
4912
4912
  };
4913
4913
  });
4914
- function po(t, e, r) {
4914
+ function co(t, e, r) {
4915
4915
  t.issues.length && e.issues.push(...Or(r, t.issues)), e.value[r] = t.value;
4916
4916
  }
4917
4917
  const c_ = /* @__PURE__ */ K("$ZodRecord", (t, e) => {
@@ -4993,13 +4993,13 @@ const c_ = /* @__PURE__ */ K("$ZodRecord", (t, e) => {
4993
4993
  };
4994
4994
  });
4995
4995
  function ud(t, e, r, i, n, o, s) {
4996
- t.issues.length && (Bo.has(typeof i) ? r.issues.push(...Or(i, t.issues)) : r.issues.push({
4996
+ t.issues.length && (Do.has(typeof i) ? r.issues.push(...Or(i, t.issues)) : r.issues.push({
4997
4997
  code: "invalid_key",
4998
4998
  origin: "map",
4999
4999
  input: n,
5000
5000
  inst: o,
5001
5001
  issues: t.issues.map((a) => Mr(a, s, nr()))
5002
- })), e.issues.length && (Bo.has(typeof i) ? r.issues.push(...Or(i, e.issues)) : r.issues.push({
5002
+ })), e.issues.length && (Do.has(typeof i) ? r.issues.push(...Or(i, e.issues)) : r.issues.push({
5003
5003
  origin: "map",
5004
5004
  code: "invalid_element",
5005
5005
  input: n,
@@ -5033,7 +5033,7 @@ function cd(t, e) {
5033
5033
  const d_ = /* @__PURE__ */ K("$ZodEnum", (t, e) => {
5034
5034
  Fe.init(t, e);
5035
5035
  const r = bc(e.entries), i = new Set(r);
5036
- t._zod.values = i, t._zod.pattern = new RegExp(`^(${r.filter((n) => Bo.has(typeof n)).map((n) => typeof n == "string" ? hn(n) : n.toString()).join("|")})$`), t._zod.parse = (n, o) => {
5036
+ t._zod.values = i, t._zod.pattern = new RegExp(`^(${r.filter((n) => Do.has(typeof n)).map((n) => typeof n == "string" ? hn(n) : n.toString()).join("|")})$`), t._zod.parse = (n, o) => {
5037
5037
  const s = n.value;
5038
5038
  return i.has(s) || n.issues.push({
5039
5039
  code: "invalid_value",
@@ -5164,38 +5164,38 @@ const b_ = /* @__PURE__ */ K("$ZodSuccess", (t, e) => {
5164
5164
  Fe.init(t, e), et(t._zod, "values", () => e.in._zod.values), et(t._zod, "optin", () => e.in._zod.optin), et(t._zod, "optout", () => e.out._zod.optout), et(t._zod, "propValues", () => e.in._zod.propValues), t._zod.parse = (r, i) => {
5165
5165
  if (i.direction === "backward") {
5166
5166
  const o = e.out._zod.run(r, i);
5167
- return o instanceof Promise ? o.then((s) => fo(s, e.in, i)) : fo(o, e.in, i);
5167
+ return o instanceof Promise ? o.then((s) => lo(s, e.in, i)) : lo(o, e.in, i);
5168
5168
  }
5169
5169
  const n = e.in._zod.run(r, i);
5170
- return n instanceof Promise ? n.then((o) => fo(o, e.out, i)) : fo(n, e.out, i);
5170
+ return n instanceof Promise ? n.then((o) => lo(o, e.out, i)) : lo(n, e.out, i);
5171
5171
  };
5172
5172
  });
5173
- function fo(t, e, r) {
5173
+ function lo(t, e, r) {
5174
5174
  return t.issues.length ? (t.aborted = !0, t) : e._zod.run({ value: t.value, issues: t.issues }, r);
5175
5175
  }
5176
5176
  const qc = /* @__PURE__ */ K("$ZodCodec", (t, e) => {
5177
5177
  Fe.init(t, e), et(t._zod, "values", () => e.in._zod.values), et(t._zod, "optin", () => e.in._zod.optin), et(t._zod, "optout", () => e.out._zod.optout), et(t._zod, "propValues", () => e.in._zod.propValues), t._zod.parse = (r, i) => {
5178
5178
  if ((i.direction || "forward") === "forward") {
5179
5179
  const o = e.in._zod.run(r, i);
5180
- return o instanceof Promise ? o.then((s) => ho(s, e, i)) : ho(o, e, i);
5180
+ return o instanceof Promise ? o.then((s) => po(s, e, i)) : po(o, e, i);
5181
5181
  } else {
5182
5182
  const o = e.out._zod.run(r, i);
5183
- return o instanceof Promise ? o.then((s) => ho(s, e, i)) : ho(o, e, i);
5183
+ return o instanceof Promise ? o.then((s) => po(s, e, i)) : po(o, e, i);
5184
5184
  }
5185
5185
  };
5186
5186
  });
5187
- function ho(t, e, r) {
5187
+ function po(t, e, r) {
5188
5188
  if (t.issues.length)
5189
5189
  return t.aborted = !0, t;
5190
5190
  if ((r.direction || "forward") === "forward") {
5191
5191
  const n = e.transform(t.value, t);
5192
- return n instanceof Promise ? n.then((o) => go(t, o, e.out, r)) : go(t, n, e.out, r);
5192
+ return n instanceof Promise ? n.then((o) => fo(t, o, e.out, r)) : fo(t, n, e.out, r);
5193
5193
  } else {
5194
5194
  const n = e.reverseTransform(t.value, t);
5195
- return n instanceof Promise ? n.then((o) => go(t, o, e.in, r)) : go(t, n, e.in, r);
5195
+ return n instanceof Promise ? n.then((o) => fo(t, o, e.in, r)) : fo(t, n, e.in, r);
5196
5196
  }
5197
5197
  }
5198
- function go(t, e, r, i) {
5198
+ function fo(t, e, r, i) {
5199
5199
  return t.issues.length ? (t.aborted = !0, t) : r._zod.run({ value: e, issues: t.issues }, i);
5200
5200
  }
5201
5201
  const w_ = /* @__PURE__ */ K("$ZodReadonly", (t, e) => {
@@ -7645,7 +7645,7 @@ function Ek() {
7645
7645
  localeError: kk()
7646
7646
  };
7647
7647
  }
7648
- const wk = (t) => Si(typeof t, t), Si = (t, e = void 0) => {
7648
+ const wk = (t) => yi(typeof t, t), yi = (t, e = void 0) => {
7649
7649
  switch (t) {
7650
7650
  case "number":
7651
7651
  return Number.isNaN(e) ? "NaN" : "skaičius";
@@ -7785,18 +7785,18 @@ const Ck = () => {
7785
7785
  return (i) => {
7786
7786
  switch (i.code) {
7787
7787
  case "invalid_type":
7788
- return `Gautas tipas ${wk(i.input)}, o tikėtasi - ${Si(i.expected)}`;
7788
+ return `Gautas tipas ${wk(i.input)}, o tikėtasi - ${yi(i.expected)}`;
7789
7789
  case "invalid_value":
7790
7790
  return i.values.length === 1 ? `Privalo būti ${Be(i.values[0])}` : `Privalo būti vienas iš ${le(i.values, "|")} pasirinkimų`;
7791
7791
  case "too_big": {
7792
- const n = Si(i.origin), o = e(i.origin, md(Number(i.maximum)), i.inclusive ?? !1, "smaller");
7792
+ const n = yi(i.origin), o = e(i.origin, md(Number(i.maximum)), i.inclusive ?? !1, "smaller");
7793
7793
  if (o?.verb)
7794
7794
  return `${gi(n ?? i.origin ?? "reikšmė")} ${o.verb} ${i.maximum.toString()} ${o.unit ?? "elementų"}`;
7795
7795
  const s = i.inclusive ? "ne didesnis kaip" : "mažesnis kaip";
7796
7796
  return `${gi(n ?? i.origin ?? "reikšmė")} turi būti ${s} ${i.maximum.toString()} ${o?.unit}`;
7797
7797
  }
7798
7798
  case "too_small": {
7799
- const n = Si(i.origin), o = e(i.origin, md(Number(i.minimum)), i.inclusive ?? !1, "bigger");
7799
+ const n = yi(i.origin), o = e(i.origin, md(Number(i.minimum)), i.inclusive ?? !1, "bigger");
7800
7800
  if (o?.verb)
7801
7801
  return `${gi(n ?? i.origin ?? "reikšmė")} ${o.verb} ${i.minimum.toString()} ${o.unit ?? "elementų"}`;
7802
7802
  const s = i.inclusive ? "ne mažesnis kaip" : "didesnis kaip";
@@ -7815,7 +7815,7 @@ const Ck = () => {
7815
7815
  case "invalid_union":
7816
7816
  return "Klaidinga įvestis";
7817
7817
  case "invalid_element": {
7818
- const n = Si(i.origin);
7818
+ const n = yi(i.origin);
7819
7819
  return `${gi(n ?? i.origin ?? "reikšmė")} turi klaidingą įvestį`;
7820
7820
  }
7821
7821
  default:
@@ -9844,7 +9844,7 @@ function Wc(t, e) {
9844
9844
  ...ne(e)
9845
9845
  });
9846
9846
  }
9847
- function Mo(t, e) {
9847
+ function Uo(t, e) {
9848
9848
  return new t({
9849
9849
  type: "string",
9850
9850
  format: "guid",
@@ -10286,7 +10286,7 @@ function g0(t) {
10286
10286
  function m0(t) {
10287
10287
  return dr(0, t);
10288
10288
  }
10289
- function Ai(t, e) {
10289
+ function Ti(t, e) {
10290
10290
  return new em({
10291
10291
  check: "multiple_of",
10292
10292
  ...ne(e),
@@ -10300,7 +10300,7 @@ function bs(t, e) {
10300
10300
  maximum: t
10301
10301
  });
10302
10302
  }
10303
- function $i(t, e) {
10303
+ function Ai(t, e) {
10304
10304
  return new im({
10305
10305
  check: "min_size",
10306
10306
  ...ne(e),
@@ -10624,7 +10624,7 @@ function E0(t, e) {
10624
10624
  const r = ne(e);
10625
10625
  let i = r.truthy ?? ["true", "1", "yes", "on", "y", "enabled"], n = r.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
10626
10626
  r.case !== "sensitive" && (i = i.map((d) => typeof d == "string" ? d.toLowerCase() : d), n = n.map((d) => typeof d == "string" ? d.toLowerCase() : d));
10627
- const o = new Set(i), s = new Set(n), a = t.Codec ?? qc, u = t.Boolean ?? Fc, c = t.String ?? Ki, f = new c({ type: "string", error: r.error }), S = new u({ type: "boolean", error: r.error }), m = new a({
10627
+ const o = new Set(i), s = new Set(n), a = t.Codec ?? qc, u = t.Boolean ?? Fc, c = t.String ?? qi, f = new c({ type: "string", error: r.error }), S = new u({ type: "boolean", error: r.error }), m = new a({
10628
10628
  type: "pipe",
10629
10629
  in: f,
10630
10630
  out: S,
@@ -10644,7 +10644,7 @@ function E0(t, e) {
10644
10644
  });
10645
10645
  return m;
10646
10646
  }
10647
- function Wi(t, e, r, i = {}) {
10647
+ function Hi(t, e, r, i = {}) {
10648
10648
  const n = ne(i), o = {
10649
10649
  ...ne(i),
10650
10650
  check: "string_format",
@@ -11210,7 +11210,7 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11210
11210
  $ZodCheckRegex: cm,
11211
11211
  $ZodCheckSizeEquals: om,
11212
11212
  $ZodCheckStartsWith: fm,
11213
- $ZodCheckStringFormat: Hi,
11213
+ $ZodCheckStringFormat: Gi,
11214
11214
  $ZodCheckUpperCase: pm,
11215
11215
  $ZodCodec: qc,
11216
11216
  $ZodCustom: $_,
@@ -11258,7 +11258,7 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11258
11258
  $ZodRecord: c_,
11259
11259
  $ZodRegistry: Hc,
11260
11260
  $ZodSet: p_,
11261
- $ZodString: Ki,
11261
+ $ZodString: qi,
11262
11262
  $ZodStringFormat: _t,
11263
11263
  $ZodSuccess: b_,
11264
11264
  $ZodSymbol: Wm,
@@ -11318,7 +11318,7 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11318
11318
  _float64: W_,
11319
11319
  _gt: Dn,
11320
11320
  _gte: dr,
11321
- _guid: Mo,
11321
+ _guid: Uo,
11322
11322
  _includes: vl,
11323
11323
  _int: H_,
11324
11324
  _int32: Z_,
@@ -11345,8 +11345,8 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11345
11345
  _mime: bl,
11346
11346
  _min: dr,
11347
11347
  _minLength: Xn,
11348
- _minSize: $i,
11349
- _multipleOf: Ai,
11348
+ _minSize: Ai,
11349
+ _multipleOf: Ti,
11350
11350
  _nan: d0,
11351
11351
  _nanoid: el,
11352
11352
  _nativeEnum: k1,
@@ -11361,8 +11361,8 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11361
11361
  _number: G_,
11362
11362
  _optional: C1,
11363
11363
  _overwrite: zn,
11364
- _parse: zi,
11365
- _parseAsync: Fi,
11364
+ _parse: Mi,
11365
+ _parseAsync: Li,
11366
11366
  _pipe: N1,
11367
11367
  _positive: f0,
11368
11368
  _promise: B1,
@@ -11375,13 +11375,13 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11375
11375
  _safeDecodeAsync: Pc,
11376
11376
  _safeEncode: $c,
11377
11377
  _safeEncodeAsync: Nc,
11378
- _safeParse: ji,
11379
- _safeParseAsync: Vi,
11378
+ _safeParse: zi,
11379
+ _safeParseAsync: Fi,
11380
11380
  _set: b1,
11381
11381
  _size: hl,
11382
11382
  _startsWith: yl,
11383
11383
  _string: U_,
11384
- _stringFormat: Wi,
11384
+ _stringFormat: Hi,
11385
11385
  _stringbool: E0,
11386
11386
  _success: $1,
11387
11387
  _superRefine: x0,
@@ -11414,7 +11414,7 @@ const U1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11414
11414
  encodeAsync: Yb,
11415
11415
  flattenError: Ec,
11416
11416
  formatError: wc,
11417
- globalConfig: Oo,
11417
+ globalConfig: Po,
11418
11418
  globalRegistry: Cn,
11419
11419
  isValidBase64: Lc,
11420
11420
  isValidBase64URL: zm,
@@ -11482,13 +11482,13 @@ const L1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11482
11482
  },
11483
11483
  addIssue: {
11484
11484
  value: (r) => {
11485
- t.issues.push(r), t.message = JSON.stringify(t.issues, Do, 2);
11485
+ t.issues.push(r), t.message = JSON.stringify(t.issues, Oo, 2);
11486
11486
  }
11487
11487
  // enumerable: false,
11488
11488
  },
11489
11489
  addIssues: {
11490
11490
  value: (r) => {
11491
- t.issues.push(...r), t.message = JSON.stringify(t.issues, Do, 2);
11491
+ t.issues.push(...r), t.message = JSON.stringify(t.issues, Oo, 2);
11492
11492
  }
11493
11493
  // enumerable: false,
11494
11494
  },
@@ -11499,14 +11499,14 @@ const L1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11499
11499
  // enumerable: false,
11500
11500
  }
11501
11501
  });
11502
- }, Lo = K("ZodError", $0), mr = K("ZodError", $0, {
11502
+ }, Mo = K("ZodError", $0), mr = K("ZodError", $0, {
11503
11503
  Parent: Error
11504
- }), R0 = /* @__PURE__ */ zi(mr), N0 = /* @__PURE__ */ Fi(mr), P0 = /* @__PURE__ */ ji(mr), O0 = /* @__PURE__ */ Vi(mr), D0 = /* @__PURE__ */ Cc(mr), B0 = /* @__PURE__ */ Ic(mr), U0 = /* @__PURE__ */ Tc(mr), M0 = /* @__PURE__ */ Ac(mr), L0 = /* @__PURE__ */ $c(mr), z0 = /* @__PURE__ */ Rc(mr), F0 = /* @__PURE__ */ Nc(mr), j0 = /* @__PURE__ */ Pc(mr), He = /* @__PURE__ */ K("ZodType", (t, e) => (Fe.init(t, e), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...r) => t.clone(en(e, {
11504
+ }), R0 = /* @__PURE__ */ Mi(mr), N0 = /* @__PURE__ */ Li(mr), P0 = /* @__PURE__ */ zi(mr), O0 = /* @__PURE__ */ Fi(mr), D0 = /* @__PURE__ */ Cc(mr), B0 = /* @__PURE__ */ Ic(mr), U0 = /* @__PURE__ */ Tc(mr), M0 = /* @__PURE__ */ Ac(mr), L0 = /* @__PURE__ */ $c(mr), z0 = /* @__PURE__ */ Rc(mr), F0 = /* @__PURE__ */ Nc(mr), j0 = /* @__PURE__ */ Pc(mr), He = /* @__PURE__ */ K("ZodType", (t, e) => (Fe.init(t, e), t.def = e, t.type = e.type, Object.defineProperty(t, "_def", { value: e }), t.check = (...r) => t.clone(en(e, {
11505
11505
  checks: [
11506
11506
  ...e.checks ?? [],
11507
11507
  ...r.map((i) => typeof i == "function" ? { _zod: { check: i, def: { check: "custom" }, onattach: [] } } : i)
11508
11508
  ]
11509
- })), t.clone = (r, i) => Er(t, r, i), t.brand = () => t, t.register = (r, i) => (r.add(t, i), t), t.parse = (r, i) => R0(t, r, i, { callee: t.parse }), t.safeParse = (r, i) => P0(t, r, i), t.parseAsync = async (r, i) => N0(t, r, i, { callee: t.parseAsync }), t.safeParseAsync = async (r, i) => O0(t, r, i), t.spa = t.safeParseAsync, t.encode = (r, i) => D0(t, r, i), t.decode = (r, i) => B0(t, r, i), t.encodeAsync = async (r, i) => U0(t, r, i), t.decodeAsync = async (r, i) => M0(t, r, i), t.safeEncode = (r, i) => L0(t, r, i), t.safeDecode = (r, i) => z0(t, r, i), t.safeEncodeAsync = async (r, i) => F0(t, r, i), t.safeDecodeAsync = async (r, i) => j0(t, r, i), t.refine = (r, i) => t.check(kv(r, i)), t.superRefine = (r) => t.check(Ev(r)), t.overwrite = (r) => t.check(zn(r)), t.optional = () => Fo(t), t.nullable = () => jo(t), t.nullish = () => Fo(jo(t)), t.nonoptional = (r) => dv(t, r), t.array = () => or(t), t.or = (r) => ir([t, r]), t.and = (r) => X0(t, r), t.transform = (r) => Vo(t, Ql(r)), t.default = (r) => cv(t, r), t.prefault = (r) => pv(t, r), t.catch = (r) => gv(t, r), t.pipe = (r) => Vo(t, r), t.readonly = () => vv(t), t.describe = (r) => {
11509
+ })), t.clone = (r, i) => Er(t, r, i), t.brand = () => t, t.register = (r, i) => (r.add(t, i), t), t.parse = (r, i) => R0(t, r, i, { callee: t.parse }), t.safeParse = (r, i) => P0(t, r, i), t.parseAsync = async (r, i) => N0(t, r, i, { callee: t.parseAsync }), t.safeParseAsync = async (r, i) => O0(t, r, i), t.spa = t.safeParseAsync, t.encode = (r, i) => D0(t, r, i), t.decode = (r, i) => B0(t, r, i), t.encodeAsync = async (r, i) => U0(t, r, i), t.decodeAsync = async (r, i) => M0(t, r, i), t.safeEncode = (r, i) => L0(t, r, i), t.safeDecode = (r, i) => z0(t, r, i), t.safeEncodeAsync = async (r, i) => F0(t, r, i), t.safeDecodeAsync = async (r, i) => j0(t, r, i), t.refine = (r, i) => t.check(kv(r, i)), t.superRefine = (r) => t.check(Ev(r)), t.overwrite = (r) => t.check(zn(r)), t.optional = () => zo(t), t.nullable = () => Fo(t), t.nullish = () => zo(Fo(t)), t.nonoptional = (r) => dv(t, r), t.array = () => or(t), t.or = (r) => ir([t, r]), t.and = (r) => X0(t, r), t.transform = (r) => jo(t, Ql(r)), t.default = (r) => cv(t, r), t.prefault = (r) => pv(t, r), t.catch = (r) => gv(t, r), t.pipe = (r) => jo(t, r), t.readonly = () => vv(t), t.describe = (r) => {
11510
11510
  const i = t.clone();
11511
11511
  return Cn.add(i, { description: r }), i;
11512
11512
  }, Object.defineProperty(t, "description", {
@@ -11520,11 +11520,11 @@ const L1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11520
11520
  const i = t.clone();
11521
11521
  return Cn.add(i, r[0]), i;
11522
11522
  }, t.isOptional = () => t.safeParse(void 0).success, t.isNullable = () => t.safeParse(null).success, t)), $l = /* @__PURE__ */ K("_ZodString", (t, e) => {
11523
- Ki.init(t, e), He.init(t, e);
11523
+ qi.init(t, e), He.init(t, e);
11524
11524
  const r = t._zod.bag;
11525
11525
  t.format = r.format ?? null, t.minLength = r.minimum ?? null, t.maxLength = r.maximum ?? null, t.regex = (...i) => t.check(gl(...i)), t.includes = (...i) => t.check(vl(...i)), t.startsWith = (...i) => t.check(yl(...i)), t.endsWith = (...i) => t.check(Sl(...i)), t.min = (...i) => t.check(Xn(...i)), t.max = (...i) => t.check(xs(...i)), t.length = (...i) => t.check(ks(...i)), t.nonempty = (...i) => t.check(Xn(1, ...i)), t.lowercase = (i) => t.check(ml(i)), t.uppercase = (i) => t.check(_l(i)), t.trim = () => t.check(kl()), t.normalize = (...i) => t.check(xl(...i)), t.toLowerCase = () => t.check(El()), t.toUpperCase = () => t.check(wl());
11526
11526
  }), Es = /* @__PURE__ */ K("ZodString", (t, e) => {
11527
- Ki.init(t, e), $l.init(t, e), t.email = (r) => t.check(Wc(Rl, r)), t.url = (r) => t.check(Ss(ws, r)), t.jwt = (r) => t.check(fl(Hl, r)), t.emoji = (r) => t.check(Xc(Nl, r)), t.guid = (r) => t.check(Mo(zo, r)), t.uuid = (r) => t.check(Zc(Jr, r)), t.uuidv4 = (r) => t.check(Jc(Jr, r)), t.uuidv6 = (r) => t.check(Yc(Jr, r)), t.uuidv7 = (r) => t.check(Qc(Jr, r)), t.nanoid = (r) => t.check(el(Pl, r)), t.guid = (r) => t.check(Mo(zo, r)), t.cuid = (r) => t.check(tl(Ol, r)), t.cuid2 = (r) => t.check(rl(Dl, r)), t.ulid = (r) => t.check(nl(Bl, r)), t.base64 = (r) => t.check(ll(Vl, r)), t.base64url = (r) => t.check(pl(Gl, r)), t.xid = (r) => t.check(il(Ul, r)), t.ksuid = (r) => t.check(ol(Ml, r)), t.ipv4 = (r) => t.check(sl(Ll, r)), t.ipv6 = (r) => t.check(al(zl, r)), t.cidrv4 = (r) => t.check(ul(Fl, r)), t.cidrv6 = (r) => t.check(cl(jl, r)), t.e164 = (r) => t.check(dl(ql, r)), t.datetime = (r) => t.check(C0(r)), t.date = (r) => t.check(I0(r)), t.time = (r) => t.check(T0(r)), t.duration = (r) => t.check(A0(r));
11527
+ qi.init(t, e), $l.init(t, e), t.email = (r) => t.check(Wc(Rl, r)), t.url = (r) => t.check(Ss(ws, r)), t.jwt = (r) => t.check(fl(Hl, r)), t.emoji = (r) => t.check(Xc(Nl, r)), t.guid = (r) => t.check(Uo(Lo, r)), t.uuid = (r) => t.check(Zc(Jr, r)), t.uuidv4 = (r) => t.check(Jc(Jr, r)), t.uuidv6 = (r) => t.check(Yc(Jr, r)), t.uuidv7 = (r) => t.check(Qc(Jr, r)), t.nanoid = (r) => t.check(el(Pl, r)), t.guid = (r) => t.check(Uo(Lo, r)), t.cuid = (r) => t.check(tl(Ol, r)), t.cuid2 = (r) => t.check(rl(Dl, r)), t.ulid = (r) => t.check(nl(Bl, r)), t.base64 = (r) => t.check(ll(Vl, r)), t.base64url = (r) => t.check(pl(Gl, r)), t.xid = (r) => t.check(il(Ul, r)), t.ksuid = (r) => t.check(ol(Ml, r)), t.ipv4 = (r) => t.check(sl(Ll, r)), t.ipv6 = (r) => t.check(al(zl, r)), t.cidrv4 = (r) => t.check(ul(Fl, r)), t.cidrv6 = (r) => t.check(cl(jl, r)), t.e164 = (r) => t.check(dl(ql, r)), t.datetime = (r) => t.check(C0(r)), t.date = (r) => t.check(I0(r)), t.time = (r) => t.check(T0(r)), t.duration = (r) => t.check(A0(r));
11528
11528
  });
11529
11529
  function z(t) {
11530
11530
  return U_(Es, t);
@@ -11537,11 +11537,11 @@ const St = /* @__PURE__ */ K("ZodStringFormat", (t, e) => {
11537
11537
  function z1(t) {
11538
11538
  return Wc(Rl, t);
11539
11539
  }
11540
- const zo = /* @__PURE__ */ K("ZodGUID", (t, e) => {
11540
+ const Lo = /* @__PURE__ */ K("ZodGUID", (t, e) => {
11541
11541
  Sm.init(t, e), St.init(t, e);
11542
11542
  });
11543
11543
  function F1(t) {
11544
- return Mo(zo, t);
11544
+ return Uo(Lo, t);
11545
11545
  }
11546
11546
  const Jr = /* @__PURE__ */ K("ZodUUID", (t, e) => {
11547
11547
  bm.init(t, e), St.init(t, e);
@@ -11661,26 +11661,26 @@ const Hl = /* @__PURE__ */ K("ZodJWT", (t, e) => {
11661
11661
  function uE(t) {
11662
11662
  return fl(Hl, t);
11663
11663
  }
11664
- const Zi = /* @__PURE__ */ K("ZodCustomStringFormat", (t, e) => {
11664
+ const Ki = /* @__PURE__ */ K("ZodCustomStringFormat", (t, e) => {
11665
11665
  qm.init(t, e), St.init(t, e);
11666
11666
  });
11667
11667
  function cE(t, e, r = {}) {
11668
- return Wi(Zi, t, e, r);
11668
+ return Hi(Ki, t, e, r);
11669
11669
  }
11670
11670
  function lE(t) {
11671
- return Wi(Zi, "hostname", Dc, t);
11671
+ return Hi(Ki, "hostname", Dc, t);
11672
11672
  }
11673
11673
  function pE(t) {
11674
- return Wi(Zi, "hex", Qg, t);
11674
+ return Hi(Ki, "hex", Qg, t);
11675
11675
  }
11676
11676
  function dE(t, e) {
11677
11677
  const r = e?.enc ?? "hex", i = `${t}_${r}`, n = Bc[i];
11678
11678
  if (!n)
11679
11679
  throw new Error(`Unrecognized hash format: ${i}`);
11680
- return Wi(Zi, i, n, e);
11680
+ return Hi(Ki, i, n, e);
11681
11681
  }
11682
11682
  const Cs = /* @__PURE__ */ K("ZodNumber", (t, e) => {
11683
- zc.init(t, e), He.init(t, e), t.gt = (i, n) => t.check(Dn(i, n)), t.gte = (i, n) => t.check(dr(i, n)), t.min = (i, n) => t.check(dr(i, n)), t.lt = (i, n) => t.check(On(i, n)), t.lte = (i, n) => t.check(Dr(i, n)), t.max = (i, n) => t.check(Dr(i, n)), t.int = (i) => t.check(lu(i)), t.safe = (i) => t.check(lu(i)), t.positive = (i) => t.check(Dn(0, i)), t.nonnegative = (i) => t.check(dr(0, i)), t.negative = (i) => t.check(On(0, i)), t.nonpositive = (i) => t.check(Dr(0, i)), t.multipleOf = (i, n) => t.check(Ai(i, n)), t.step = (i, n) => t.check(Ai(i, n)), t.finite = () => t;
11683
+ zc.init(t, e), He.init(t, e), t.gt = (i, n) => t.check(Dn(i, n)), t.gte = (i, n) => t.check(dr(i, n)), t.min = (i, n) => t.check(dr(i, n)), t.lt = (i, n) => t.check(On(i, n)), t.lte = (i, n) => t.check(Dr(i, n)), t.max = (i, n) => t.check(Dr(i, n)), t.int = (i) => t.check(lu(i)), t.safe = (i) => t.check(lu(i)), t.positive = (i) => t.check(Dn(0, i)), t.nonnegative = (i) => t.check(dr(0, i)), t.negative = (i) => t.check(On(0, i)), t.nonpositive = (i) => t.check(Dr(0, i)), t.multipleOf = (i, n) => t.check(Ti(i, n)), t.step = (i, n) => t.check(Ti(i, n)), t.finite = () => t;
11684
11684
  const r = t._zod.bag;
11685
11685
  t.minValue = Math.max(r.minimum ?? Number.NEGATIVE_INFINITY, r.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, t.maxValue = Math.min(r.maximum ?? Number.POSITIVE_INFINITY, r.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, t.isInt = (r.format ?? "").includes("int") || Number.isSafeInteger(r.multipleOf ?? 0.5), t.isFinite = !0, t.format = r.format ?? null;
11686
11686
  });
@@ -11712,7 +11712,7 @@ function fr(t) {
11712
11712
  return Y_(Is, t);
11713
11713
  }
11714
11714
  const Ts = /* @__PURE__ */ K("ZodBigInt", (t, e) => {
11715
- jc.init(t, e), He.init(t, e), t.gte = (i, n) => t.check(dr(i, n)), t.min = (i, n) => t.check(dr(i, n)), t.gt = (i, n) => t.check(Dn(i, n)), t.gte = (i, n) => t.check(dr(i, n)), t.min = (i, n) => t.check(dr(i, n)), t.lt = (i, n) => t.check(On(i, n)), t.lte = (i, n) => t.check(Dr(i, n)), t.max = (i, n) => t.check(Dr(i, n)), t.positive = (i) => t.check(Dn(BigInt(0), i)), t.negative = (i) => t.check(On(BigInt(0), i)), t.nonpositive = (i) => t.check(Dr(BigInt(0), i)), t.nonnegative = (i) => t.check(dr(BigInt(0), i)), t.multipleOf = (i, n) => t.check(Ai(i, n));
11715
+ jc.init(t, e), He.init(t, e), t.gte = (i, n) => t.check(dr(i, n)), t.min = (i, n) => t.check(dr(i, n)), t.gt = (i, n) => t.check(Dn(i, n)), t.gte = (i, n) => t.check(dr(i, n)), t.min = (i, n) => t.check(dr(i, n)), t.lt = (i, n) => t.check(On(i, n)), t.lte = (i, n) => t.check(Dr(i, n)), t.max = (i, n) => t.check(Dr(i, n)), t.positive = (i) => t.check(Dn(BigInt(0), i)), t.negative = (i) => t.check(On(BigInt(0), i)), t.nonpositive = (i) => t.check(Dr(BigInt(0), i)), t.nonnegative = (i) => t.check(dr(BigInt(0), i)), t.multipleOf = (i, n) => t.check(Ti(i, n));
11716
11716
  const r = t._zod.bag;
11717
11717
  t.minValue = r.minimum ?? null, t.maxValue = r.maximum ?? null, t.format = r.format ?? null;
11718
11718
  });
@@ -11743,7 +11743,7 @@ function bE(t) {
11743
11743
  const q0 = /* @__PURE__ */ K("ZodNull", (t, e) => {
11744
11744
  Jm.init(t, e), He.init(t, e);
11745
11745
  });
11746
- function Ji(t) {
11746
+ function Wi(t) {
11747
11747
  return o0(q0, t);
11748
11748
  }
11749
11749
  const H0 = /* @__PURE__ */ K("ZodAny", (t, e) => {
@@ -11893,7 +11893,7 @@ function AE(t, e, r) {
11893
11893
  });
11894
11894
  }
11895
11895
  const nv = /* @__PURE__ */ K("ZodSet", (t, e) => {
11896
- p_.init(t, e), He.init(t, e), t.min = (...r) => t.check($i(...r)), t.nonempty = (r) => t.check($i(1, r)), t.max = (...r) => t.check(bs(...r)), t.size = (...r) => t.check(hl(...r));
11896
+ p_.init(t, e), He.init(t, e), t.min = (...r) => t.check(Ai(...r)), t.nonempty = (r) => t.check(Ai(1, r)), t.max = (...r) => t.check(bs(...r)), t.size = (...r) => t.check(hl(...r));
11897
11897
  });
11898
11898
  function $E(t, e) {
11899
11899
  return new nv({
@@ -11902,7 +11902,7 @@ function $E(t, e) {
11902
11902
  ...ne(e)
11903
11903
  });
11904
11904
  }
11905
- const Ri = /* @__PURE__ */ K("ZodEnum", (t, e) => {
11905
+ const $i = /* @__PURE__ */ K("ZodEnum", (t, e) => {
11906
11906
  d_.init(t, e), He.init(t, e), t.enum = e.entries, t.options = Object.values(e.entries);
11907
11907
  const r = new Set(Object.keys(e.entries));
11908
11908
  t.extract = (i, n) => {
@@ -11912,7 +11912,7 @@ const Ri = /* @__PURE__ */ K("ZodEnum", (t, e) => {
11912
11912
  o[s] = e.entries[s];
11913
11913
  else
11914
11914
  throw new Error(`Key ${s} not found in enum`);
11915
- return new Ri({
11915
+ return new $i({
11916
11916
  ...e,
11917
11917
  checks: [],
11918
11918
  ...ne(n),
@@ -11925,7 +11925,7 @@ const Ri = /* @__PURE__ */ K("ZodEnum", (t, e) => {
11925
11925
  delete o[s];
11926
11926
  else
11927
11927
  throw new Error(`Key ${s} not found in enum`);
11928
- return new Ri({
11928
+ return new $i({
11929
11929
  ...e,
11930
11930
  checks: [],
11931
11931
  ...ne(n),
@@ -11935,14 +11935,14 @@ const Ri = /* @__PURE__ */ K("ZodEnum", (t, e) => {
11935
11935
  });
11936
11936
  function ft(t, e) {
11937
11937
  const r = Array.isArray(t) ? Object.fromEntries(t.map((i) => [i, i])) : t;
11938
- return new Ri({
11938
+ return new $i({
11939
11939
  type: "enum",
11940
11940
  entries: r,
11941
11941
  ...ne(e)
11942
11942
  });
11943
11943
  }
11944
11944
  function RE(t, e) {
11945
- return new Ri({
11945
+ return new $i({
11946
11946
  type: "enum",
11947
11947
  entries: t,
11948
11948
  ...ne(e)
@@ -11965,7 +11965,7 @@ function ie(t, e) {
11965
11965
  });
11966
11966
  }
11967
11967
  const ov = /* @__PURE__ */ K("ZodFile", (t, e) => {
11968
- h_.init(t, e), He.init(t, e), t.min = (r, i) => t.check($i(r, i)), t.max = (r, i) => t.check(bs(r, i)), t.mime = (r, i) => t.check(bl(Array.isArray(r) ? r : [r], i));
11968
+ h_.init(t, e), He.init(t, e), t.min = (r, i) => t.check(Ai(r, i)), t.max = (r, i) => t.check(bs(r, i)), t.mime = (r, i) => t.check(bl(Array.isArray(r) ? r : [r], i));
11969
11969
  });
11970
11970
  function NE(t) {
11971
11971
  return y0(ov, t);
@@ -11995,7 +11995,7 @@ function Ql(t) {
11995
11995
  const Xl = /* @__PURE__ */ K("ZodOptional", (t, e) => {
11996
11996
  m_.init(t, e), He.init(t, e), t.unwrap = () => t._zod.def.innerType;
11997
11997
  });
11998
- function Fo(t) {
11998
+ function zo(t) {
11999
11999
  return new Xl({
12000
12000
  type: "optional",
12001
12001
  innerType: t
@@ -12004,14 +12004,14 @@ function Fo(t) {
12004
12004
  const av = /* @__PURE__ */ K("ZodNullable", (t, e) => {
12005
12005
  __.init(t, e), He.init(t, e), t.unwrap = () => t._zod.def.innerType;
12006
12006
  });
12007
- function jo(t) {
12007
+ function Fo(t) {
12008
12008
  return new av({
12009
12009
  type: "nullable",
12010
12010
  innerType: t
12011
12011
  });
12012
12012
  }
12013
12013
  function PE(t) {
12014
- return Fo(jo(t));
12014
+ return zo(Fo(t));
12015
12015
  }
12016
12016
  const uv = /* @__PURE__ */ K("ZodDefault", (t, e) => {
12017
12017
  v_.init(t, e), He.init(t, e), t.unwrap = () => t._zod.def.innerType, t.removeDefault = t.unwrap;
@@ -12075,7 +12075,7 @@ function DE(t) {
12075
12075
  const tp = /* @__PURE__ */ K("ZodPipe", (t, e) => {
12076
12076
  E_.init(t, e), He.init(t, e), t.in = e.in, t.out = e.out;
12077
12077
  });
12078
- function Vo(t, e) {
12078
+ function jo(t, e) {
12079
12079
  return new tp({
12080
12080
  type: "pipe",
12081
12081
  in: t,
@@ -12179,11 +12179,11 @@ const jE = (...t) => E0({
12179
12179
  String: Es
12180
12180
  }, ...t);
12181
12181
  function VE(t) {
12182
- const e = np(() => ir([z(t), Ye(), fr(), Ji(), or(e), _r(z(), e)]));
12182
+ const e = np(() => ir([z(t), Ye(), fr(), Wi(), or(e), _r(z(), e)]));
12183
12183
  return e;
12184
12184
  }
12185
12185
  function GE(t, e) {
12186
- return Vo(Ql(t), e);
12186
+ return jo(Ql(t), e);
12187
12187
  }
12188
12188
  const qE = {
12189
12189
  invalid_type: "invalid_type",
@@ -12220,14 +12220,14 @@ function WE(t) {
12220
12220
  function ZE(t) {
12221
12221
  return e0(Ts, t);
12222
12222
  }
12223
- function Io(t) {
12223
+ function Co(t) {
12224
12224
  return p0(Zl, t);
12225
12225
  }
12226
12226
  const JE = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12227
12227
  __proto__: null,
12228
12228
  bigint: ZE,
12229
12229
  boolean: WE,
12230
- date: Io,
12230
+ date: Co,
12231
12231
  number: fu,
12232
12232
  string: du
12233
12233
  }, Symbol.toStringTag, { value: "Module" }));
@@ -12253,21 +12253,21 @@ const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12253
12253
  ZodCatch: hv,
12254
12254
  ZodCodec: rp,
12255
12255
  ZodCustom: $s,
12256
- ZodCustomStringFormat: Zi,
12256
+ ZodCustomStringFormat: Ki,
12257
12257
  ZodDate: Zl,
12258
12258
  ZodDefault: uv,
12259
12259
  ZodDiscriminatedUnion: Y0,
12260
12260
  ZodE164: ql,
12261
12261
  ZodEmail: Rl,
12262
12262
  ZodEmoji: Nl,
12263
- ZodEnum: Ri,
12264
- ZodError: Lo,
12263
+ ZodEnum: $i,
12264
+ ZodError: Mo,
12265
12265
  ZodFile: ov,
12266
12266
  get ZodFirstPartyTypeKind() {
12267
12267
  return pu;
12268
12268
  },
12269
12269
  ZodFunction: xv,
12270
- ZodGUID: zo,
12270
+ ZodGUID: Lo,
12271
12271
  ZodIPv4: Ll,
12272
12272
  ZodIPv6: zl,
12273
12273
  ZodISODate: Il,
@@ -12387,8 +12387,8 @@ const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12387
12387
  maxSize: bs,
12388
12388
  mime: bl,
12389
12389
  minLength: Xn,
12390
- minSize: $i,
12391
- multipleOf: Ai,
12390
+ minSize: Ai,
12391
+ multipleOf: Ti,
12392
12392
  nan: DE,
12393
12393
  nanoid: Z1,
12394
12394
  nativeEnum: RE,
@@ -12398,17 +12398,17 @@ const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12398
12398
  nonoptional: dv,
12399
12399
  nonpositive: g0,
12400
12400
  normalize: xl,
12401
- null: Ji,
12402
- nullable: jo,
12401
+ null: Wi,
12402
+ nullable: Fo,
12403
12403
  nullish: PE,
12404
12404
  number: Ye,
12405
12405
  object: $e,
12406
- optional: Fo,
12406
+ optional: zo,
12407
12407
  overwrite: zn,
12408
12408
  parse: R0,
12409
12409
  parseAsync: N0,
12410
12410
  partialRecord: TE,
12411
- pipe: Vo,
12411
+ pipe: jo,
12412
12412
  positive: f0,
12413
12413
  prefault: pv,
12414
12414
  preprocess: GE,
@@ -12481,7 +12481,7 @@ const wv = $e({
12481
12481
  verbose: fr().default(!1),
12482
12482
  logLevel: z().default("info")
12483
12483
  }), ew = YE, fN = wv;
12484
- let Ni = class {
12484
+ let Vo = class {
12485
12485
  runtimeConfig;
12486
12486
  appConfig;
12487
12487
  constructor() {
@@ -12493,7 +12493,7 @@ let Ni = class {
12493
12493
  this.runtimeConfig = wv.parse(t), this.appConfig = ew.parse({
12494
12494
  VITE_INJECT_AGIFLOW_APP_ENDPOINT: "https://agiflow.io",
12495
12495
  VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT: "https://agiflow.io",
12496
- VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.1.6",
12496
+ VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.1.8",
12497
12497
  VITE_AGENT_CLI_DOCKER_NETWORK: "",
12498
12498
  VITE_SAVE_RAW: "",
12499
12499
  VITE_MULTIPLEX_SOCKET_PATH: process.env.VITE_MULTIPLEX_SOCKET_PATH
@@ -12521,14 +12521,14 @@ let Ni = class {
12521
12521
  * @returns Path to credentials.json in ~/.agiflow directory
12522
12522
  */
12523
12523
  getCredentialsPath() {
12524
- return Xt($o(), ".agiflow", "credentials.json");
12524
+ return Xt(Ao(), ".agiflow", "credentials.json");
12525
12525
  }
12526
12526
  /**
12527
12527
  * Get Claude agents directory path
12528
12528
  * @returns Path to .claude/agents directory
12529
12529
  */
12530
12530
  getClaudeAgentsPath() {
12531
- return Xt($o(), ".claude", "agents");
12531
+ return Xt(Ao(), ".claude", "agents");
12532
12532
  }
12533
12533
  /**
12534
12534
  * Get the appropriate server URL based on the environment
@@ -12560,9 +12560,9 @@ let Ni = class {
12560
12560
  return `ws://${e ? "host.docker.internal" : "localhost"}:${t}`;
12561
12561
  }
12562
12562
  };
12563
- Ni = XE([
12563
+ Vo = XE([
12564
12564
  Ae()
12565
- ], Ni);
12565
+ ], Vo);
12566
12566
  var tw = Object.getOwnPropertyDescriptor, rw = (t, e, r, i) => {
12567
12567
  for (var n = i > 1 ? void 0 : i ? tw(e, r) : e, o = t.length - 1, s; o >= 0; o--)
12568
12568
  (s = t[o]) && (n = s(n) || n);
@@ -12732,7 +12732,7 @@ const kt = {
12732
12732
  // Raw data saving
12733
12733
  VITE_SAVE_RAW: sn().default(!1)
12734
12734
  });
12735
- function mo(t = !1) {
12735
+ function ho(t = !1) {
12736
12736
  return t ? "https://agiflow.io" : "https://agiflow.io";
12737
12737
  }
12738
12738
  let hu = class {
@@ -12761,7 +12761,7 @@ let hu = class {
12761
12761
  return this.parsedEnv.AGENT_SESSION_ID || process.env.AGENT_SESSION_ID;
12762
12762
  }
12763
12763
  get serverUrl() {
12764
- return this.parsedEnv.AGENT_SERVER_URL || process.env.AGENT_SERVER_URL || mo(this.isContainerMode);
12764
+ return this.parsedEnv.AGENT_SERVER_URL || process.env.AGENT_SERVER_URL || ho(this.isContainerMode);
12765
12765
  }
12766
12766
  get brokerWsUrl() {
12767
12767
  return this.parsedEnv.MULTIPLEX_BROKER_WS_URL || process.env.MULTIPLEX_BROKER_WS_URL;
@@ -12845,15 +12845,15 @@ let hu = class {
12845
12845
  }
12846
12846
  toChildProcess() {
12847
12847
  const t = this.serializeEnv();
12848
- return t.AGENT_SERVER_URL || (t.AGENT_SERVER_URL = mo(this.isContainerMode)), t.LOG_LEVEL || (t.LOG_LEVEL = this.logLevel), t;
12848
+ return t.AGENT_SERVER_URL || (t.AGENT_SERVER_URL = ho(this.isContainerMode)), t.LOG_LEVEL || (t.LOG_LEVEL = this.logLevel), t;
12849
12849
  }
12850
12850
  toDocker() {
12851
12851
  const t = this.serializeEnv();
12852
- return t.AGENT_CONTAINER_MODE = "true", t.AGENT_SERVER_URL || (t.AGENT_SERVER_URL = mo(!0)), t.LOG_LEVEL || (t.LOG_LEVEL = this.logLevel), t;
12852
+ return t.AGENT_CONTAINER_MODE = "true", t.AGENT_SERVER_URL || (t.AGENT_SERVER_URL = ho(!0)), t.LOG_LEVEL || (t.LOG_LEVEL = this.logLevel), t;
12853
12853
  }
12854
12854
  toPty() {
12855
12855
  const t = this.serializeEnv();
12856
- return t.AGENT_SERVER_URL || (t.AGENT_SERVER_URL = mo(this.isContainerMode)), t.LOG_LEVEL || (t.LOG_LEVEL = this.logLevel), t;
12856
+ return t.AGENT_SERVER_URL || (t.AGENT_SERVER_URL = ho(this.isContainerMode)), t.LOG_LEVEL || (t.LOG_LEVEL = this.logLevel), t;
12857
12857
  }
12858
12858
  getEnvs() {
12859
12859
  return this.parsedEnv;
@@ -12862,7 +12862,7 @@ let hu = class {
12862
12862
  hu = iw([
12863
12863
  Ae()
12864
12864
  ], hu);
12865
- const Cv = new Ni(), Pi = Cv.getAppConfig(), hN = (t) => Cv.getWebSocketUrl(t), F = {
12865
+ const Cv = new Vo(), Ri = Cv.getAppConfig(), hN = (t) => Cv.getWebSocketUrl(t), F = {
12866
12866
  // ============================================================================
12867
12867
  // Core Services
12868
12868
  // ============================================================================
@@ -13266,7 +13266,7 @@ const it = $e({
13266
13266
  eventType: ie(qe.STATUS).default(qe.STATUS),
13267
13267
  command: ie(ce.REQUEST).default(ce.REQUEST),
13268
13268
  payload: it.shape.payload.extend({ data: z().default("") })
13269
- }), To = it.extend({
13269
+ }), Io = it.extend({
13270
13270
  eventType: ie(qe.STATUS).default(qe.STATUS),
13271
13271
  command: ie(ce.RESPONSE).default(ce.RESPONSE),
13272
13272
  payload: it.shape.payload.extend({
@@ -13408,7 +13408,7 @@ const it = $e({
13408
13408
  });
13409
13409
  ir([
13410
13410
  Dv,
13411
- To,
13411
+ Io,
13412
13412
  Iw,
13413
13413
  Bv,
13414
13414
  Uv,
@@ -13842,17 +13842,17 @@ function ei(t) {
13842
13842
  const e = t.toLowerCase();
13843
13843
  return e === "gemini" || e === dt.GEMINI_CLI.toLowerCase() ? dt.GEMINI_CLI : (e === "claude" || e === dt.CLAUDE_CODE.toLowerCase(), dt.CLAUDE_CODE);
13844
13844
  }
13845
- class Ci extends Error {
13845
+ class wi extends Error {
13846
13846
  constructor(e, r, i) {
13847
13847
  super(e), this.agentSessionId = r, this.cause = i, this.name = "AgentManagerError";
13848
13848
  }
13849
13849
  }
13850
- class Kw extends Ci {
13850
+ class Kw extends wi {
13851
13851
  constructor(e) {
13852
13852
  super(`Agent with sessionId ${e} already exists`, e), this.name = "AgentAlreadyExistsError";
13853
13853
  }
13854
13854
  }
13855
- class SN extends Ci {
13855
+ class SN extends wi {
13856
13856
  constructor(e) {
13857
13857
  super(`Agent with sessionId ${e} not found`, e), this.name = "AgentNotFoundError";
13858
13858
  }
@@ -13861,7 +13861,7 @@ var Ww = Object.getOwnPropertyDescriptor, Zw = (t, e, r, i) => {
13861
13861
  for (var n = i > 1 ? void 0 : i ? Ww(e, r) : e, o = t.length - 1, s; o >= 0; o--)
13862
13862
  (s = t[o]) && (n = s(n) || n);
13863
13863
  return n;
13864
- }, _o = (t, e) => (r, i) => e(r, i, t);
13864
+ }, go = (t, e) => (r, i) => e(r, i, t);
13865
13865
  let mu = class {
13866
13866
  constructor(t, e, r, i) {
13867
13867
  this.logger = t, this.broker = e, this.disposableRegistry = r, this.store = i, this.logger.debug("AgentManager initialized");
@@ -13890,7 +13890,7 @@ let mu = class {
13890
13890
  async launchAgent(t) {
13891
13891
  const e = t.payload.agentSessionId;
13892
13892
  if (!e)
13893
- throw new Ci("agentSessionId is required in request payload");
13893
+ throw new wi("agentSessionId is required in request payload");
13894
13894
  if (this.hasAgent(e))
13895
13895
  throw new Kw(e);
13896
13896
  this.logger.debug(`Launching agent: ${e}`);
@@ -13931,7 +13931,7 @@ let mu = class {
13931
13931
  };
13932
13932
  return this.logger.success(`Agent launched successfully: ${e}`), S;
13933
13933
  } catch (r) {
13934
- throw this.logger.error(`Failed to launch agent ${e}:`, r), await this.cleanupFailedLaunch(e), new Ci(
13934
+ throw this.logger.error(`Failed to launch agent ${e}:`, r), await this.cleanupFailedLaunch(e), new wi(
13935
13935
  `Failed to launch agent: ${r instanceof Error ? r.message : String(r)}`,
13936
13936
  e,
13937
13937
  r instanceof Error ? r : void 0
@@ -13969,7 +13969,7 @@ let mu = class {
13969
13969
  }
13970
13970
  this.broker.unregisterSession(t), this.logger.debug(`Unregistered session from broker: ${t}`), r && (this.unbindContainerServices(r), this.logger.debug(`Container services unbound for ${t}`)), this.workers.delete(t), this.containers.delete(t), this.logger.success(`Agent cleanup complete: ${t}`);
13971
13971
  } catch (i) {
13972
- throw this.logger.error(`Error during agent termination ${t}:`, i), this.workers.delete(t), this.containers.delete(t), this.registeredServices.delete(t), new Ci(
13972
+ throw this.logger.error(`Error during agent termination ${t}:`, i), this.workers.delete(t), this.containers.delete(t), this.registeredServices.delete(t), new wi(
13973
13973
  `Failed to terminate agent: ${i instanceof Error ? i.message : String(i)}`,
13974
13974
  t,
13975
13975
  i instanceof Error ? i : void 0
@@ -14058,10 +14058,10 @@ let mu = class {
14058
14058
  };
14059
14059
  mu = Zw([
14060
14060
  Ae(),
14061
- _o(0, H(F.Logger)),
14062
- _o(1, H(F.MessageMultiplexBroker)),
14063
- _o(2, H(F.DisposableRegistry)),
14064
- _o(3, H(F.Store))
14061
+ go(0, H(F.Logger)),
14062
+ go(1, H(F.MessageMultiplexBroker)),
14063
+ go(2, H(F.DisposableRegistry)),
14064
+ go(3, H(F.Store))
14065
14065
  ], mu);
14066
14066
  var Jw = Object.getOwnPropertyDescriptor, Yw = (t, e, r, i) => {
14067
14067
  for (var n = i > 1 ? void 0 : i ? Jw(e, r) : e, o = t.length - 1, s; o >= 0; o--)
@@ -14191,7 +14191,7 @@ Ho = Yw([
14191
14191
  Ed(0, H(F.CredentialsService)),
14192
14192
  Ed(1, H(F.Logger))
14193
14193
  ], Ho);
14194
- class Yi {
14194
+ class Zi {
14195
14195
  args = [];
14196
14196
  /**
14197
14197
  * Create a new CommandBuilder instance
@@ -14342,7 +14342,7 @@ class Yi {
14342
14342
  * @returns A new CommandBuilder instance
14343
14343
  */
14344
14344
  clone() {
14345
- return new Yi([...this.args]);
14345
+ return new Zi([...this.args]);
14346
14346
  }
14347
14347
  /**
14348
14348
  * Clear all arguments
@@ -14367,7 +14367,7 @@ class Yi {
14367
14367
  }
14368
14368
  }
14369
14369
  function bN(t = []) {
14370
- return new Yi(t);
14370
+ return new Zi(t);
14371
14371
  }
14372
14372
  class tt {
14373
14373
  /**
@@ -14558,10 +14558,11 @@ let Ko = class {
14558
14558
  cache = null;
14559
14559
  dirty = !1;
14560
14560
  subEnvManager;
14561
+ // Session-scoped credentials map (in-memory only, keyed by agentSessionId)
14562
+ // These are short-lived API keys (48h) that should NOT overwrite the daemon's long-lived API key
14563
+ sessionCredentialsMap = /* @__PURE__ */ new Map();
14561
14564
  constructor(t, e) {
14562
- this.subEnvManager = e;
14563
- const r = t ?? new Ni();
14564
- this.filePath = r.getCredentialsPath();
14565
+ this.subEnvManager = e, this.filePath = t.getCredentialsPath();
14565
14566
  }
14566
14567
  // Load from disk (cached)
14567
14568
  async load() {
@@ -14653,6 +14654,39 @@ let Ko = class {
14653
14654
  const n = await this.getDeviceId();
14654
14655
  return n && (r["x-device-id"] = n), r;
14655
14656
  }
14657
+ // Session-scoped credentials methods (in-memory only, keyed by agentSessionId)
14658
+ // These methods manage short-lived session API keys without affecting the global daemon credentials
14659
+ /**
14660
+ * Set session-scoped credentials for a specific agent session
14661
+ * These are stored in-memory only and do NOT persist to disk
14662
+ */
14663
+ setSessionCredentials(t, e) {
14664
+ this.sessionCredentialsMap.set(t, e);
14665
+ }
14666
+ /**
14667
+ * Get session-scoped credentials for a specific agent session
14668
+ */
14669
+ getSessionCredentials(t) {
14670
+ return this.sessionCredentialsMap.get(t) || null;
14671
+ }
14672
+ /**
14673
+ * Get session API key for a specific agent session
14674
+ */
14675
+ getSessionApiKey(t) {
14676
+ return this.sessionCredentialsMap.get(t)?.apiKey || null;
14677
+ }
14678
+ /**
14679
+ * Get session organization ID for a specific agent session
14680
+ */
14681
+ getSessionOrganizationId(t) {
14682
+ return this.sessionCredentialsMap.get(t)?.organizationId || null;
14683
+ }
14684
+ /**
14685
+ * Clear session-scoped credentials for a specific agent session
14686
+ */
14687
+ clearSessionCredentials(t) {
14688
+ this.sessionCredentialsMap.delete(t);
14689
+ }
14656
14690
  };
14657
14691
  Ko = nC([
14658
14692
  Ae(),
@@ -15770,7 +15804,7 @@ const sr = $e({
15770
15804
  jsonrpc: ie("2.0").default("2.0"),
15771
15805
  method: z(),
15772
15806
  params: ir([or(mt()), _r(z(), mt())]).optional(),
15773
- id: ir([z(), Ye(), Ji()])
15807
+ id: ir([z(), Ye(), Wi()])
15774
15808
  })
15775
15809
  }), RC = $e({
15776
15810
  eventType: ie("agent-rpc-request").default("agent-rpc-request"),
@@ -15786,7 +15820,7 @@ const sr = $e({
15786
15820
  message: z(),
15787
15821
  data: mt().optional()
15788
15822
  }).optional(),
15789
- id: ir([z(), Ye(), Ji()])
15823
+ id: ir([z(), Ye(), Wi()])
15790
15824
  })
15791
15825
  });
15792
15826
  var NC = Object.defineProperty, PC = Object.getOwnPropertyDescriptor, OC = (t, e, r) => e in t ? NC(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, DC = (t, e, r, i) => {
@@ -15861,12 +15895,12 @@ let Un = class {
15861
15895
  const t = this.config.unixSocketPath;
15862
15896
  this.actualSocketPath = t;
15863
15897
  const e = uc.dirname(t);
15864
- Rr.existsSync(e) || Rr.mkdirSync(e, { recursive: !0 }), Rr.existsSync(t) && Rr.unlinkSync(t), this.wsServer = new Ro({ path: t }), this.logger.info(`MessageMultiplexBroker WebSocket started on Unix socket ${t}`);
15898
+ Rr.existsSync(e) || Rr.mkdirSync(e, { recursive: !0 }), Rr.existsSync(t) && Rr.unlinkSync(t), this.wsServer = new $o({ path: t }), this.logger.info(`MessageMultiplexBroker WebSocket started on Unix socket ${t}`);
15865
15899
  } else {
15866
15900
  const t = this.config.wsPort === 0 || this.config.wsPort === null ? await UC() : this.config.wsPort;
15867
15901
  this.actualPort = t, this.actualHttpPort = t, this.httpServer = mS(async (e, r) => {
15868
15902
  await this.handleHttpRequest(e, r);
15869
- }), this.wsServer = new Ro({ server: this.httpServer }), this.httpServer.listen(t, () => {
15903
+ }), this.wsServer = new $o({ server: this.httpServer }), this.httpServer.listen(t, () => {
15870
15904
  this.logger.info(`MessageMultiplexBroker started on port ${t} (HTTP + WebSocket)`);
15871
15905
  });
15872
15906
  }
@@ -16357,7 +16391,7 @@ const CN = {
16357
16391
  backoffMultiplier: 2,
16358
16392
  maxBackoffMs: 3e4
16359
16393
  };
16360
- let Oi = class {
16394
+ let Ni = class {
16361
16395
  constructor(t, e) {
16362
16396
  this.logger = t, this.config = e;
16363
16397
  }
@@ -16419,17 +16453,17 @@ let Oi = class {
16419
16453
  }
16420
16454
  }
16421
16455
  };
16422
- Oi = LC([
16456
+ Ni = LC([
16423
16457
  Ae(),
16424
16458
  Ad(0, H(F.Logger)),
16425
16459
  Ad(1, H(F.MultiplexClientConfig))
16426
- ], Oi);
16460
+ ], Ni);
16427
16461
  var zC = Object.getOwnPropertyDescriptor, FC = (t, e, r, i) => {
16428
16462
  for (var n = i > 1 ? void 0 : i ? zC(e, r) : e, o = t.length - 1, s; o >= 0; o--)
16429
16463
  (s = t[o]) && (n = s(n) || n);
16430
16464
  return n;
16431
16465
  }, $d = (t, e) => (r, i) => e(r, i, t);
16432
- let Wo = class extends Oi {
16466
+ let Wo = class extends Ni {
16433
16467
  connected = !1;
16434
16468
  brokerHandlers = /* @__PURE__ */ new Map();
16435
16469
  constructor(t, e) {
@@ -16593,7 +16627,7 @@ var GC = Object.getOwnPropertyDescriptor, qC = (t, e, r, i) => {
16593
16627
  (s = t[o]) && (n = s(n) || n);
16594
16628
  return n;
16595
16629
  }, Nd = (t, e) => (r, i) => e(r, i, t);
16596
- let Eu = class extends Oi {
16630
+ let Eu = class extends Ni {
16597
16631
  ws = null;
16598
16632
  reconnectTimer = null;
16599
16633
  connected = !1;
@@ -16789,7 +16823,7 @@ var HC = Object.getOwnPropertyDescriptor, KC = (t, e, r, i) => {
16789
16823
  (s = t[o]) && (n = s(n) || n);
16790
16824
  return n;
16791
16825
  }, Pd = (t, e) => (r, i) => e(r, i, t);
16792
- let Od = class extends Oi {
16826
+ let Od = class extends Ni {
16793
16827
  MAX_BUFFER_SIZE = 10 * 1024 * 1024;
16794
16828
  // 10MB limit
16795
16829
  connected = !1;
@@ -17059,7 +17093,7 @@ const Bd = yS(cS);
17059
17093
  let wu = class {
17060
17094
  constructor(t) {
17061
17095
  this.logger = t;
17062
- const e = $o();
17096
+ const e = Ao();
17063
17097
  this.searchPaths = [
17064
17098
  `"${e}/workspace"`,
17065
17099
  `"${e}/projects"`,
@@ -17073,7 +17107,7 @@ let wu = class {
17073
17107
  const t = [];
17074
17108
  for (const e of this.searchPaths)
17075
17109
  try {
17076
- const r = e.includes($o() + '"') && !e.includes("/") ? 1 : 3, i = `find ${e} -maxdepth ${r} -name "package.json" -type f -not -path "*/node_modules/*" 2>/dev/null`, n = `find ${e} -maxdepth ${r} -name "pyproject.toml" -type f 2>/dev/null`, [o, s] = await Promise.allSettled([Bd(i), Bd(n)]);
17110
+ const r = e.includes(Ao() + '"') && !e.includes("/") ? 1 : 3, i = `find ${e} -maxdepth ${r} -name "package.json" -type f -not -path "*/node_modules/*" 2>/dev/null`, n = `find ${e} -maxdepth ${r} -name "pyproject.toml" -type f 2>/dev/null`, [o, s] = await Promise.allSettled([Bd(i), Bd(n)]);
17077
17111
  o.status === "fulfilled" && o.value.stdout.trim() && t.push(...o.value.stdout.trim().split(`
17078
17112
  `).filter(Boolean)), s.status === "fulfilled" && s.value.stdout.trim() && t.push(...s.value.stdout.trim().split(`
17079
17113
  `).filter(Boolean));
@@ -17193,7 +17227,7 @@ Cu = eI([
17193
17227
  const vr = new hs({
17194
17228
  defaultScope: "Singleton"
17195
17229
  });
17196
- vr.bind(F.ConfigManager).to(Ni).inSingletonScope();
17230
+ vr.bind(F.ConfigManager).to(Vo).inSingletonScope();
17197
17231
  vr.bind(F.SubEnvManager).to(hu).inSingletonScope();
17198
17232
  vr.bind(F.Logger).to(At).inSingletonScope();
17199
17233
  vr.bind(F.CredentialsService).to(Ko).inSingletonScope();
@@ -17412,25 +17446,30 @@ let Tu = class {
17412
17446
  this.currentSessionId = t;
17413
17447
  const e = await this.buildWebSocketUrl(t);
17414
17448
  this.logger.info(`🔌 WebSocket connecting to: ${e}`);
17415
- const r = {}, i = await this.context.getApiKey();
17416
- i ? (r["x-api-key"] = i, this.logger.info(`🔑 API key found: ${i.substring(0, 10)}...`)) : this.logger.warn("⚠️ No API key found - WebSocket connection will fail with 401");
17417
- const n = await this.context.getOrganizationId();
17418
- return this.logger.info(`🏢 Organization ID: ${n}`), new Promise((o, s) => {
17449
+ const r = {}, i = this.credentialsService.getSessionApiKey(t), n = i || await this.context.getApiKey();
17450
+ if (n) {
17451
+ r["x-api-key"] = n;
17452
+ const a = i ? "session" : "global";
17453
+ this.logger.info(`🔑 API key found (${a}): ${n.substring(0, 10)}...`);
17454
+ } else
17455
+ this.logger.warn("⚠️ No API key found - WebSocket connection will fail with 401");
17456
+ const o = this.credentialsService.getSessionOrganizationId(t), s = o || await this.context.getOrganizationId();
17457
+ return this.logger.info(`🏢 Organization ID (${o ? "session" : "global"}): ${s}`), new Promise((a, u) => {
17419
17458
  this.ws = new Zt(e, { headers: r }), this.ws.on("open", () => {
17420
- this.isConnected = !0, this.connectionAttempts = 0, this.logger.info(`🔌 WebSocket connected to ${e}`), o();
17421
- }), this.ws.on("message", (a) => {
17459
+ this.isConnected = !0, this.connectionAttempts = 0, this.logger.info(`🔌 WebSocket connected to ${e}`), a();
17460
+ }), this.ws.on("message", (c) => {
17422
17461
  try {
17423
- const u = JSON.parse(a.toString());
17424
- this.handleMessage(u);
17425
- } catch (u) {
17426
- this.log(`Error parsing message: ${u}`);
17462
+ const f = JSON.parse(c.toString());
17463
+ this.handleMessage(f);
17464
+ } catch (f) {
17465
+ this.log(`Error parsing message: ${f}`);
17427
17466
  }
17428
17467
  }), this.ws.on("close", () => {
17429
17468
  this.isConnected = !1, this.currentSessionId = null, this.shouldReconnect && this.scheduleReconnect(t);
17430
- }), this.ws.on("error", (a) => {
17431
- this.logger.error("WebSocket connection error:", new Error(`${a.message}. URL: ${e}`)), a.message.includes("401") && this.log("Authentication error - invalid or expired API key"), (a.message.includes("ECONNREFUSED") || a.message.includes("ENOTFOUND")) && this.logger.error("🐳 Docker networking issue - check if server is accessible from container"), this.isConnected || s(a);
17469
+ }), this.ws.on("error", (c) => {
17470
+ this.logger.error("WebSocket connection error:", new Error(`${c.message}. URL: ${e}`)), c.message.includes("401") && this.log("Authentication error - invalid or expired API key"), (c.message.includes("ECONNREFUSED") || c.message.includes("ENOTFOUND")) && this.logger.error("🐳 Docker networking issue - check if server is accessible from container"), this.isConnected || u(c);
17432
17471
  }), setTimeout(() => {
17433
- this.isConnected || s(new Error("WebSocket connection timeout"));
17472
+ this.isConnected || u(new Error("WebSocket connection timeout"));
17434
17473
  }, 1e4);
17435
17474
  });
17436
17475
  }
@@ -17637,12 +17676,12 @@ let Tu = class {
17637
17676
  throw new Error("Server URL is required for WebSocket connection");
17638
17677
  const e = new URL(this.serverUrl);
17639
17678
  e.protocol === "http:" ? e.protocol = "ws:" : e.protocol === "https:" && (e.protocol = "wss:");
17640
- const r = await this.context.getOrganizationId();
17641
- if (!r)
17679
+ const i = this.credentialsService.getSessionOrganizationId(t) || await this.context.getOrganizationId();
17680
+ if (!i)
17642
17681
  throw new Error("Organization ID is required for WebSocket connection");
17643
- e.pathname = `/api/v1/organizations/${r}/agent-sessions/${t}/ws`, e.searchParams.set("clientType", "agent");
17644
- const i = await this.credentialsService.getDeviceId();
17645
- return e.searchParams.set("deviceId", i || "unknown"), e.toString();
17682
+ e.pathname = `/api/v1/organizations/${i}/agent-sessions/${t}/ws`, e.searchParams.set("clientType", "agent");
17683
+ const n = await this.credentialsService.getDeviceId();
17684
+ return e.searchParams.set("deviceId", n || "unknown"), e.toString();
17646
17685
  }
17647
17686
  /**
17648
17687
  * Stop connection health monitoring
@@ -18040,7 +18079,7 @@ var _I = Object.getOwnPropertyDescriptor, vI = (t, e, r, i) => {
18040
18079
  (s = t[o]) && (n = s(n) || n);
18041
18080
  return n;
18042
18081
  }, yI = (t, e) => (r, i) => e(r, i, t);
18043
- let Di = class {
18082
+ let Pi = class {
18044
18083
  // Cache push capability check
18045
18084
  constructor(t, e) {
18046
18085
  if (this.logger = e, this.originalRepositoryPath = En(t), this.repositoryPath = this.originalRepositoryPath, !this.isGitRepository())
@@ -18121,7 +18160,7 @@ let Di = class {
18121
18160
  branch: s || "detached",
18122
18161
  commit: a,
18123
18162
  isActive: o === this.repositoryPath,
18124
- name: so(o)
18163
+ name: io(o)
18125
18164
  });
18126
18165
  }
18127
18166
  return e;
@@ -18133,7 +18172,7 @@ let Di = class {
18133
18172
  * Create a new worktree
18134
18173
  */
18135
18174
  async createWorktree(t) {
18136
- const { branch: e, worktreeName: r } = t, i = this.repositoryPath, n = so(i), o = e || this.generateUniqueBranchName(), s = this.sanitizeBranchName(o), a = `${n}-worktrees`, u = r || s, c = Xt(this.repositoryPath, ".."), f = Xt(c, a), S = Xt(f, u);
18175
+ const { branch: e, worktreeName: r } = t, i = this.repositoryPath, n = io(i), o = e || this.generateUniqueBranchName(), s = this.sanitizeBranchName(o), a = `${n}-worktrees`, u = r || s, c = Xt(this.repositoryPath, ".."), f = Xt(c, a), S = Xt(f, u);
18137
18176
  if (tr(f) || await (await import("fs/promises")).mkdir(f, { recursive: !0 }), tr(S)) {
18138
18177
  this.logger.info(`Worktree already exists at ${S}, reusing it`);
18139
18178
  const m = this.getWorktreeInfo(S);
@@ -18251,7 +18290,7 @@ let Di = class {
18251
18290
  branch: r || "detached",
18252
18291
  commit: e,
18253
18292
  isActive: !0,
18254
- name: so(t)
18293
+ name: io(t)
18255
18294
  };
18256
18295
  return this.logger.info(`Switched to worktree: ${t} (${r})`), i;
18257
18296
  } catch (e) {
@@ -18269,7 +18308,7 @@ let Di = class {
18269
18308
  branch: r || "detached",
18270
18309
  commit: e,
18271
18310
  isActive: !1,
18272
- name: so(t)
18311
+ name: io(t)
18273
18312
  };
18274
18313
  } catch {
18275
18314
  return null;
@@ -18484,10 +18523,10 @@ Please review the changes carefully before merging. The AI agent has attempted t
18484
18523
  }
18485
18524
  }
18486
18525
  };
18487
- Di = vI([
18526
+ Pi = vI([
18488
18527
  Ae(),
18489
18528
  yI(1, H(F.Logger))
18490
- ], Di);
18529
+ ], Pi);
18491
18530
  class SI {
18492
18531
  constructor(e) {
18493
18532
  this.logger = e;
@@ -18506,7 +18545,7 @@ class SI {
18506
18545
  async before(e) {
18507
18546
  const r = e.workingDir || process.cwd();
18508
18547
  try {
18509
- this.gitWorktreeService = new Di(r, this.logger);
18548
+ this.gitWorktreeService = new Pi(r, this.logger);
18510
18549
  } catch (i) {
18511
18550
  this.logger.debug(`Git worktree service not available for cleanup: ${i}`);
18512
18551
  }
@@ -18524,7 +18563,7 @@ class SI {
18524
18563
  if (!this.gitWorktreeService)
18525
18564
  try {
18526
18565
  const i = r.path.replace(/\/\.worktrees\/[^/]+$/, "");
18527
- this.gitWorktreeService = new Di(i, this.logger);
18566
+ this.gitWorktreeService = new Pi(i, this.logger);
18528
18567
  } catch (i) {
18529
18568
  this.logger.warn(`Cannot initialize GitWorktreeService for cleanup: ${i}`);
18530
18569
  return;
@@ -18629,7 +18668,7 @@ class xI {
18629
18668
  return;
18630
18669
  const i = e.workingDir || process.cwd();
18631
18670
  try {
18632
- this.gitWorktreeService = new Di(i, this.logger);
18671
+ this.gitWorktreeService = new Pi(i, this.logger);
18633
18672
  } catch (u) {
18634
18673
  this.logger.debug(`Git worktree service not available - not in a git repository: ${u}`);
18635
18674
  return;
@@ -18833,7 +18872,7 @@ let Ru = class {
18833
18872
  const t = this.agentConfigService.getStoredAgentSessionId();
18834
18873
  if (t)
18835
18874
  try {
18836
- const { createGetAgentStatus: e } = await Promise.resolve().then(() => rT), { createSendAgentStatus: r } = await Promise.resolve().then(() => tT), { AGENT_STATUS: i } = await import("./index-BW0p4wl1.mjs"), n = e(t, t), a = (await this.multiplexClient.request(n))?.payload?.result || i.IDLE;
18875
+ const { createGetAgentStatus: e } = await Promise.resolve().then(() => rT), { createSendAgentStatus: r } = await Promise.resolve().then(() => tT), { AGENT_STATUS: i } = await import("./index-qXAhghID.mjs"), n = e(t, t), a = (await this.multiplexClient.request(n))?.payload?.result || i.IDLE;
18837
18876
  await this.multiplexClient.publish(
18838
18877
  r(t, {
18839
18878
  agentType: this.agentConfigService.getAgentType() ?? void 0,
@@ -19249,7 +19288,7 @@ let Nu = class {
19249
19288
  };
19250
19289
  return Zr.parse(s);
19251
19290
  } catch (i) {
19252
- if (i instanceof Lo) {
19291
+ if (i instanceof Mo) {
19253
19292
  const n = i.issues.map((o) => `${o.path.join(".") || "root"}: ${o.message}`).join(", ");
19254
19293
  throw new Error(`Invalid agent configuration: ${n}`);
19255
19294
  }
@@ -19264,7 +19303,7 @@ let Nu = class {
19264
19303
  };
19265
19304
  return Zr.parse(s);
19266
19305
  } catch (n) {
19267
- if (n instanceof Lo) {
19306
+ if (n instanceof Mo) {
19268
19307
  const o = n.issues.map((s) => `${s.path.join(".") || "root"}: ${s.message}`).join(", ");
19269
19308
  throw new Error(`Invalid agent configuration: ${o}`);
19270
19309
  }
@@ -19350,7 +19389,7 @@ Nu = CI([
19350
19389
  ], Nu);
19351
19390
  const Ld = np(
19352
19391
  () => ir([
19353
- Ji(),
19392
+ Wi(),
19354
19393
  z(),
19355
19394
  Ye(),
19356
19395
  fr(),
@@ -19456,13 +19495,13 @@ $e({
19456
19495
  agentTypeId: z(),
19457
19496
  messageType: ap,
19458
19497
  contentSize: Ye().nullable(),
19459
- timestamp: Io(),
19498
+ timestamp: Co(),
19460
19499
  metadata: z().nullable(),
19461
19500
  parts: z().nullable().optional(),
19462
19501
  // JSON string of MessagePart[]
19463
19502
  raw: mt().nullable().optional(),
19464
- createdAt: Io(),
19465
- updatedAt: Io()
19503
+ createdAt: Co(),
19504
+ updatedAt: Co()
19466
19505
  });
19467
19506
  const VI = $e({
19468
19507
  messageType: ft(["output"]).default("output"),
@@ -19530,7 +19569,7 @@ var WI = Object.getOwnPropertyDescriptor, ZI = (t, e, r, i) => {
19530
19569
  for (var n = i > 1 ? void 0 : i ? WI(e, r) : e, o = t.length - 1, s; o >= 0; o--)
19531
19570
  (s = t[o]) && (n = s(n) || n);
19532
19571
  return n;
19533
- }, mi = (t, e) => (r, i) => e(r, i, t);
19572
+ }, mo = (t, e) => (r, i) => e(r, i, t);
19534
19573
  $e({
19535
19574
  limit: Ye().min(1).max(100).optional(),
19536
19575
  offset: Ye().min(0).optional(),
@@ -19539,8 +19578,8 @@ $e({
19539
19578
  order: ft(["asc", "desc"]).optional()
19540
19579
  });
19541
19580
  let Pu = class {
19542
- constructor(t, e, r, i, n) {
19543
- this.config = t, this.context = e, this.agentConfig = r, this.authService = i, this.logger = n, this.apiUrl = this.agentConfig.getApiUrl() || this.config.getServerUrl();
19581
+ constructor(t, e, r, i) {
19582
+ this.config = t, this.context = e, this.agentConfig = r, this.logger = i, this.apiUrl = this.agentConfig.getApiUrl() || this.config.getServerUrl();
19544
19583
  }
19545
19584
  apiUrl;
19546
19585
  /**
@@ -19553,34 +19592,33 @@ let Pu = class {
19553
19592
  throw new Error("Authentication token is required for agent message operations");
19554
19593
  }
19555
19594
  /**
19556
- * Make HTTP request with automatic token refresh on 401 errors
19595
+ * Make HTTP request with error handling for 401/429 responses
19596
+ *
19597
+ * IMPORTANT: We do NOT clear credentials on 401 errors automatically.
19598
+ * Only the specific "Invalid API key" error from the server indicates the API key
19599
+ * is truly invalid/expired and should trigger credential clearing.
19600
+ * Other 401 errors (e.g., network issues, server errors) should NOT log the user out.
19557
19601
  */
19558
19602
  async makeAuthenticatedRequest(t, e, r = !0) {
19559
19603
  const i = await fetch(t, e);
19560
- if (i.status === 401 && r && this.authService) {
19561
- const n = await i.text();
19562
- if (n.includes("Invalid API key")) {
19563
- this.logger.info("= API key expired or invalid, clearing tokens and retrying authentication...");
19604
+ if (i.status === 401) {
19605
+ const o = await i.clone().text();
19606
+ if (o.includes("Invalid API key") || o.includes("API key not found")) {
19607
+ this.logger.warn("🔑 API key is invalid or expired. Please re-authenticate using: agiflow auth login");
19564
19608
  try {
19565
19609
  await this.context.clearAuth();
19566
19610
  } catch {
19567
19611
  }
19568
- this.logger.info("= Retrying authentication...");
19569
- const o = await this.getAuthHeaders(), s = {
19570
- ...e,
19571
- headers: { ...e.headers, ...o }
19572
- };
19573
- return await this.makeAuthenticatedRequest(t, s, !1);
19612
+ return i;
19574
19613
  }
19575
- if (n.includes("Invalid or expired session"))
19576
- return this.logger.error(
19577
- "🚫 Session validation failed:",
19578
- new Error(
19579
- `Session validation failed for ${t}. Method: ${e.method || "GET"}, Timestamp: ${(/* @__PURE__ */ new Date()).toISOString()}`
19580
- )
19581
- ), this.logger.warn("Session timing issue detected, waiting and retrying..."), await new Promise((o) => setTimeout(o, 2e3)), await this.makeAuthenticatedRequest(t, e, !1);
19614
+ return o.includes("Invalid or expired session") && r ? (this.logger.error(
19615
+ "🚫 Session validation failed:",
19616
+ new Error(
19617
+ `Session validation failed for ${t}. Method: ${e.method || "GET"}, Timestamp: ${(/* @__PURE__ */ new Date()).toISOString()}`
19618
+ )
19619
+ ), this.logger.warn("Session timing issue detected, waiting and retrying..."), await new Promise((s) => setTimeout(s, 2e3)), await this.makeAuthenticatedRequest(t, e, !1)) : (this.logger.warn(`🔐 Authentication failed (401): ${o.substring(0, 100)}`), i);
19582
19620
  }
19583
- return i.status === 429 && this.logger.warn("= Rate limit exceeded, keeping credentials but not retrying"), i;
19621
+ return i.status === 429 && this.logger.warn("🚫 Rate limit exceeded, keeping credentials but not retrying"), i;
19584
19622
  }
19585
19623
  /**
19586
19624
  * Send agent message to the API
@@ -20086,11 +20124,10 @@ let Pu = class {
20086
20124
  };
20087
20125
  Pu = ZI([
20088
20126
  Ae(),
20089
- mi(0, H(F.ConfigManager)),
20090
- mi(1, H(F.ContextService)),
20091
- mi(2, H(Pe.AgentConfigService)),
20092
- mi(3, H(F.DeviceCodeAuthService)),
20093
- mi(4, H(F.Logger))
20127
+ mo(0, H(F.ConfigManager)),
20128
+ mo(1, H(F.ContextService)),
20129
+ mo(2, H(Pe.AgentConfigService)),
20130
+ mo(3, H(F.Logger))
20094
20131
  ], Pu);
20095
20132
  var JI = Object.getOwnPropertyDescriptor, YI = (t, e, r, i) => {
20096
20133
  for (var n = i > 1 ? void 0 : i ? JI(e, r) : e, o = t.length - 1, s; o >= 0; o--)
@@ -20263,7 +20300,7 @@ function XI({ onlyFirst: t = !1 } = {}) {
20263
20300
  return new RegExp(n, t ? void 0 : "g");
20264
20301
  }
20265
20302
  const eT = XI();
20266
- function Bi(t) {
20303
+ function Oi(t) {
20267
20304
  if (typeof t != "string")
20268
20305
  throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
20269
20306
  return t.replace(eT, "");
@@ -20673,7 +20710,7 @@ let Yo = class {
20673
20710
  * Middleware layers wrap around this with setup (BEFORE) and cleanup (AFTER)
20674
20711
  */
20675
20712
  async launchPty(t) {
20676
- const { AGENT_STATUS: e } = await import("./index-BW0p4wl1.mjs"), r = t.metadata.agentCommand, i = t.metadata.agentArgs;
20713
+ const { AGENT_STATUS: e } = await import("./index-qXAhghID.mjs"), r = t.metadata.agentCommand, i = t.metadata.agentArgs;
20677
20714
  if (!r)
20678
20715
  throw new Error("launchPty requires metadata.agentCommand to be set by middleware");
20679
20716
  const n = await this.getAgentEnvironmentVariablesForContext(t);
@@ -20868,7 +20905,7 @@ class sy {
20868
20905
  */
20869
20906
  async writeTempJsonFile(e, r) {
20870
20907
  const i = ze.join(Nr.tmpdir(), e);
20871
- return await wo.writeFile(i, JSON.stringify(r, null, 2), "utf8"), this.logger.info(`Created temp file: ${i}`), i;
20908
+ return await Eo.writeFile(i, JSON.stringify(r, null, 2), "utf8"), this.logger.info(`Created temp file: ${i}`), i;
20872
20909
  }
20873
20910
  /**
20874
20911
  * Write JSON file synchronously to temporary directory
@@ -21119,10 +21156,10 @@ class oT extends sy {
21119
21156
  async addPostToolUseHook(e) {
21120
21157
  const r = ze.join(e.workingDir, ".claude", "settings.local.json"), i = ze.dirname(r);
21121
21158
  try {
21122
- await wo.mkdir(i, { recursive: !0 });
21159
+ await Eo.mkdir(i, { recursive: !0 });
21123
21160
  let n = {};
21124
21161
  try {
21125
- const u = await wo.readFile(r, "utf-8");
21162
+ const u = await Eo.readFile(r, "utf-8");
21126
21163
  n = JSON.parse(u);
21127
21164
  } catch (u) {
21128
21165
  this.logger.debug("No existing settings.local.json found, creating new one", u);
@@ -21137,7 +21174,7 @@ class oT extends sy {
21137
21174
  matcher: "*",
21138
21175
  hooks: [{ type: "command", command: `node ${o}` }]
21139
21176
  };
21140
- n.hooks.PostToolUse.some((u) => u.hooks && Array.isArray(u.hooks) ? u.hooks.some((c) => c.type === "command" && c.command === `node ${o}`) : !1) || (n.hooks.PostToolUse.push(s), await wo.writeFile(r, JSON.stringify(n, null, 2)), this.logger.info(`Added PostToolUse hook to ${r}`));
21177
+ n.hooks.PostToolUse.some((u) => u.hooks && Array.isArray(u.hooks) ? u.hooks.some((c) => c.type === "command" && c.command === `node ${o}`) : !1) || (n.hooks.PostToolUse.push(s), await Eo.writeFile(r, JSON.stringify(n, null, 2)), this.logger.info(`Added PostToolUse hook to ${r}`));
21141
21178
  } catch (n) {
21142
21179
  this.logger.error(`Failed to add PostToolUse hook: ${n}`);
21143
21180
  }
@@ -21218,7 +21255,7 @@ class aT {
21218
21255
  }
21219
21256
  name = "BuildClaudeArgs";
21220
21257
  async before(e) {
21221
- const r = this.request.payload?.agentConfig?.conversationSessionId, i = this.request.payload?.agentConfig?.args || [], n = e.metadata.agentArgs || [], o = new Yi().addArgs(i).addOptionIfDefined("--session-id", r).build(), s = [...this.initialArgs, ...n, ...o];
21258
+ const r = this.request.payload?.agentConfig?.conversationSessionId, i = this.request.payload?.agentConfig?.args || [], n = e.metadata.agentArgs || [], o = new Zi().addArgs(i).addOptionIfDefined("--session-id", r).build(), s = [...this.initialArgs, ...n, ...o];
21222
21259
  e.metadata.agentCommand = this.claudePath, e.metadata.agentArgs = s;
21223
21260
  }
21224
21261
  async after(e) {
@@ -21230,7 +21267,7 @@ class uT {
21230
21267
  }
21231
21268
  name = "BuildGeminiArgs";
21232
21269
  async before(e) {
21233
- const r = this.request.payload?.agentConfig?.conversationSessionId, i = this.request.payload?.agentConfig?.args || [], n = new Yi().addArgs(i).addOptionIfDefined("--session-id", r).build();
21270
+ const r = this.request.payload?.agentConfig?.conversationSessionId, i = this.request.payload?.agentConfig?.args || [], n = new Zi().addArgs(i).addOptionIfDefined("--session-id", r).build();
21234
21271
  e.metadata.agentCommand = "gemini", e.metadata.agentArgs = n;
21235
21272
  }
21236
21273
  async after(e) {
@@ -21750,7 +21787,7 @@ class fT extends cy {
21750
21787
  async handlePtyData(e, r) {
21751
21788
  if (this.bypassPermissionsHandled)
21752
21789
  return;
21753
- const i = Bi(e);
21790
+ const i = Oi(e);
21754
21791
  i.includes("Bypass Permissions mode") && i.includes("Yes, I accept") && i.includes("No, exit") && (this.logger.info("Detected Bypass Permissions prompt, auto-accepting..."), this.bypassPermissionsHandled = !0, await new Promise((o) => setTimeout(o, 100)), this.ptyRunner.sendInput("2"), await new Promise((o) => setTimeout(o, 50)), this.ptyRunner.sendInput("\r"), this.logger.info("Bypass Permissions prompt accepted"));
21755
21792
  }
21756
21793
  }
@@ -21781,7 +21818,7 @@ class hT extends cy {
21781
21818
  */
21782
21819
  processDataForOptions(e, r) {
21783
21820
  this.optionBuffer += e;
21784
- const i = Bi(e);
21821
+ const i = Oi(e);
21785
21822
  (/Do you want to proceed\?/m.test(i) || /●\s*\d+\.\s+/.test(i) || /\n\s{0,4}\d+\.\s+[^\n]+/.test(i)) && !this.isCollectingOptions && this.startOptionCollection(r);
21786
21823
  }
21787
21824
  /**
@@ -21796,7 +21833,7 @@ class hT extends cy {
21796
21833
  * After timeout, extract and send detected options
21797
21834
  */
21798
21835
  async processCollectedOptions(e) {
21799
- const r = Bi(this.optionBuffer), i = this.extractOptions(r);
21836
+ const r = Oi(this.optionBuffer), i = this.extractOptions(r);
21800
21837
  i.length && await this.handleDetectedOptions(i, e), this.resetOptionState();
21801
21838
  }
21802
21839
  /**
@@ -21830,7 +21867,7 @@ class hT extends cy {
21830
21867
  if (!e.length) return;
21831
21868
  const i = (/* @__PURE__ */ new Date()).toISOString();
21832
21869
  try {
21833
- const { createSelectComponent: n, createToolInvocationInput: o } = await import("./index-CLbzXWKM.mjs"), { createRequestApproval: s } = await Promise.resolve().then(() => ti), a = e.map((S) => ({ label: S.text, value: S.number, selected: !!S.selected })), u = n(a), c = o(!1, u), f = s(r.agentSessionId, {
21870
+ const { createSelectComponent: n, createToolInvocationInput: o } = await import("./index-CxP6kLM9.mjs"), { createRequestApproval: s } = await Promise.resolve().then(() => ti), a = e.map((S) => ({ label: S.text, value: S.number, selected: !!S.selected })), u = n(a), c = o(!1, u), f = s(r.agentSessionId, {
21834
21871
  toolName: "selectOption",
21835
21872
  toolArgs: { timestamp: i, options: a },
21836
21873
  input: c
@@ -22076,7 +22113,7 @@ let Qo = class extends Yo {
22076
22113
  * Complex inputs include: prompts, menus, selection dialogs, etc.
22077
22114
  */
22078
22115
  detectComplexInputPattern(t) {
22079
- const e = Bi(t);
22116
+ const e = Oi(t);
22080
22117
  return [
22081
22118
  /select|choose|pick/i,
22082
22119
  // Selection prompts
@@ -22110,7 +22147,7 @@ let Qo = class extends Yo {
22110
22147
  */
22111
22148
  verifyAgentReady(t) {
22112
22149
  if (this.detectComplexInputPattern(t) && !this.complexInputDetected && (this.complexInputDetected = !0, this.logger.debug("Complex input pattern detected in Claude Code output")), this.agentInputReady) return;
22113
- const r = Bi(t);
22150
+ const r = Oi(t);
22114
22151
  if ([
22115
22152
  /Type (your )?(message|prompt)/i,
22116
22153
  /Enter (your )?(message|prompt)/i,
@@ -22760,7 +22797,7 @@ let rs = class extends ts {
22760
22797
  * Get Claude-specific Docker options
22761
22798
  */
22762
22799
  async getDockerOptions(t) {
22763
- const { payload: e } = t, r = e.agentSessionId, i = e.agentConfig?.workingDirectory ? tt.getAbsolutePath(e.agentConfig.workingDirectory) : process.cwd(), n = Pi.VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT || this.serverUrl, o = n ? n.replace(/^http/, "ws") : void 0;
22800
+ const { payload: e } = t, r = e.agentSessionId, i = e.agentConfig?.workingDirectory ? tt.getAbsolutePath(e.agentConfig.workingDirectory) : process.cwd(), n = Ri.VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT || this.serverUrl, o = n ? n.replace(/^http/, "ws") : void 0;
22764
22801
  let s = null;
22765
22802
  e.agentConfig?.mcps && (s = this.processAgentConfig(e.agentConfig.mcps));
22766
22803
  const a = e.agentConfig ? this.agentConfigService.createChildAgentConfig(e.agentConfig, {
@@ -22803,7 +22840,7 @@ let rs = class extends ts {
22803
22840
  additionalEnvVars: f,
22804
22841
  // Use proxy-configured environment
22805
22842
  additionalVolumes: S,
22806
- networkMode: Pi.VITE_AGENT_CLI_DOCKER_NETWORK,
22843
+ networkMode: Ri.VITE_AGENT_CLI_DOCKER_NETWORK,
22807
22844
  // Use configured network mode
22808
22845
  user: void 0
22809
22846
  // Use default user from DockerRunnerService
@@ -23030,7 +23067,7 @@ let ns = class extends ts {
23030
23067
  * Get Gemini-specific Docker options
23031
23068
  */
23032
23069
  async getDockerOptions(t) {
23033
- const { payload: e } = t, r = e.agentSessionId, i = e.agentConfig?.workingDirectory ? tt.getAbsolutePath(e.agentConfig.workingDirectory) : process.cwd(), n = Pi.VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT || this.serverUrl, o = n ? n.replace(/^http/, "ws") : void 0, s = e.agentConfig ? this.agentConfigService.createChildAgentConfig(e.agentConfig, {
23070
+ const { payload: e } = t, r = e.agentSessionId, i = e.agentConfig?.workingDirectory ? tt.getAbsolutePath(e.agentConfig.workingDirectory) : process.cwd(), n = Ri.VITE_INJECT_AGIFLOW_APP_DOCKER_ENDPOINT || this.serverUrl, o = n ? n.replace(/^http/, "ws") : void 0, s = e.agentConfig ? this.agentConfigService.createChildAgentConfig(e.agentConfig, {
23034
23071
  workingDirectory: "/workspace"
23035
23072
  // Always use container path, not host path
23036
23073
  }) : { workingDirectory: "/workspace", docker: !1 }, a = {
@@ -23061,7 +23098,7 @@ let ns = class extends ts {
23061
23098
  // Additional Docker-specific options with proxy configuration
23062
23099
  additionalEnvVars: u,
23063
23100
  additionalVolumes: this.getAdditionalVolumes(),
23064
- networkMode: Pi.VITE_AGENT_CLI_DOCKER_NETWORK,
23101
+ networkMode: Ri.VITE_AGENT_CLI_DOCKER_NETWORK,
23065
23102
  // Use configured network mode
23066
23103
  user: void 0
23067
23104
  // Use default user from DockerRunnerService
@@ -23336,7 +23373,7 @@ function DT(t, e, r, i) {
23336
23373
  } while (i !== -1);
23337
23374
  return o += t.slice(n), o;
23338
23375
  }
23339
- const { stdout: Zd, stderr: Jd } = PT, Bu = Symbol("GENERATOR"), ri = Symbol("STYLER"), Ui = Symbol("IS_EMPTY"), Yd = [
23376
+ const { stdout: Zd, stderr: Jd } = PT, Bu = Symbol("GENERATOR"), ri = Symbol("STYLER"), Di = Symbol("IS_EMPTY"), Yd = [
23340
23377
  "ansi",
23341
23378
  "ansi",
23342
23379
  "ansi256",
@@ -23348,16 +23385,16 @@ const { stdout: Zd, stderr: Jd } = PT, Bu = Symbol("GENERATOR"), ri = Symbol("ST
23348
23385
  t.level = e.level === void 0 ? r : e.level;
23349
23386
  }, UT = (t) => {
23350
23387
  const e = (...r) => r.join(" ");
23351
- return BT(e, t), Object.setPrototypeOf(e, Qi.prototype), e;
23388
+ return BT(e, t), Object.setPrototypeOf(e, Ji.prototype), e;
23352
23389
  };
23353
- function Qi(t) {
23390
+ function Ji(t) {
23354
23391
  return UT(t);
23355
23392
  }
23356
- Object.setPrototypeOf(Qi.prototype, Function.prototype);
23393
+ Object.setPrototypeOf(Ji.prototype, Function.prototype);
23357
23394
  for (const [t, e] of Object.entries(Vr))
23358
23395
  ni[t] = {
23359
23396
  get() {
23360
- const r = is(this, Mu(e.open, e.close, this[ri]), this[Ui]);
23397
+ const r = is(this, Mu(e.open, e.close, this[ri]), this[Di]);
23361
23398
  return Object.defineProperty(this, t, { value: r }), r;
23362
23399
  }
23363
23400
  };
@@ -23374,7 +23411,7 @@ for (const t of MT) {
23374
23411
  const { level: r } = this;
23375
23412
  return function(...i) {
23376
23413
  const n = Mu(Uu(t, Yd[r], "color", ...i), Vr.color.close, this[ri]);
23377
- return is(this, n, this[Ui]);
23414
+ return is(this, n, this[Di]);
23378
23415
  };
23379
23416
  }
23380
23417
  };
@@ -23384,7 +23421,7 @@ for (const t of MT) {
23384
23421
  const { level: r } = this;
23385
23422
  return function(...i) {
23386
23423
  const n = Mu(Uu(t, Yd[r], "bgColor", ...i), Vr.bgColor.close, this[ri]);
23387
- return is(this, n, this[Ui]);
23424
+ return is(this, n, this[Di]);
23388
23425
  };
23389
23426
  }
23390
23427
  };
@@ -23412,10 +23449,10 @@ const LT = Object.defineProperties(() => {
23412
23449
  };
23413
23450
  }, is = (t, e, r) => {
23414
23451
  const i = (...n) => zT(i, n.length === 1 ? "" + n[0] : n.join(" "));
23415
- return Object.setPrototypeOf(i, LT), i[Bu] = t, i[ri] = e, i[Ui] = r, i;
23452
+ return Object.setPrototypeOf(i, LT), i[Bu] = t, i[ri] = e, i[Di] = r, i;
23416
23453
  }, zT = (t, e) => {
23417
23454
  if (t.level <= 0 || !e)
23418
- return t[Ui] ? "" : e;
23455
+ return t[Di] ? "" : e;
23419
23456
  let r = t[ri];
23420
23457
  if (r === void 0)
23421
23458
  return e;
@@ -23427,9 +23464,9 @@ const LT = Object.defineProperties(() => {
23427
23464
  `);
23428
23465
  return o !== -1 && (e = DT(e, n, i, o)), i + e + n;
23429
23466
  };
23430
- Object.defineProperties(Qi.prototype, ni);
23431
- const Xe = Qi();
23432
- Qi({ level: Jd ? Jd.level : 0 });
23467
+ Object.defineProperties(Ji.prototype, ni);
23468
+ const Xe = Ji();
23469
+ Ji({ level: Jd ? Jd.level : 0 });
23433
23470
  const FT = {
23434
23471
  status: "idle",
23435
23472
  daemonId: null,
@@ -23509,7 +23546,7 @@ const FT = {
23509
23546
  }
23510
23547
  })
23511
23548
  });
23512
- var vo = { exports: {} }, yo = {};
23549
+ var _o = { exports: {} }, vo = {};
23513
23550
  /**
23514
23551
  * @license React
23515
23552
  * react-jsx-dev-runtime.production.js
@@ -23521,12 +23558,12 @@ var vo = { exports: {} }, yo = {};
23521
23558
  */
23522
23559
  var Xd;
23523
23560
  function VT() {
23524
- if (Xd) return yo;
23561
+ if (Xd) return vo;
23525
23562
  Xd = 1;
23526
23563
  var t = Symbol.for("react.fragment");
23527
- return yo.Fragment = t, yo.jsxDEV = void 0, yo;
23564
+ return vo.Fragment = t, vo.jsxDEV = void 0, vo;
23528
23565
  }
23529
- var So = {};
23566
+ var yo = {};
23530
23567
  /**
23531
23568
  * @license React
23532
23569
  * react-jsx-dev-runtime.development.js
@@ -23744,7 +23781,7 @@ React keys must be passed directly to JSX without using spread:
23744
23781
  d,
23745
23782
  o
23746
23783
  )(), fe = G(i(o)), Ee = {};
23747
- So.Fragment = b, So.jsxDEV = function(Z, me, pe, re) {
23784
+ yo.Fragment = b, yo.jsxDEV = function(Z, me, pe, re) {
23748
23785
  var Re = 1e4 > O.recentlyCreatedOwnerStacks++;
23749
23786
  return f(
23750
23787
  Z,
@@ -23755,11 +23792,11 @@ React keys must be passed directly to JSX without using spread:
23755
23792
  Re ? G(i(Z)) : fe
23756
23793
  );
23757
23794
  };
23758
- }()), So;
23795
+ }()), yo;
23759
23796
  }
23760
23797
  var tf;
23761
23798
  function qT() {
23762
- return tf || (tf = 1, process.env.NODE_ENV === "production" ? vo.exports = VT() : vo.exports = GT()), vo.exports;
23799
+ return tf || (tf = 1, process.env.NODE_ENV === "production" ? _o.exports = VT() : _o.exports = GT()), _o.exports;
23763
23800
  }
23764
23801
  var ke = qT();
23765
23802
  const dy = bS(null), HT = ({ children: t }) => {
@@ -24411,7 +24448,7 @@ let Lu = class {
24411
24448
  const h = ["codex", "gpt", "openai", "chatgpt"], v = t.llmProvider.toLowerCase();
24412
24449
  h.includes(v) || (console.error(Xe.red("✗"), `Invalid LLM provider: ${t.llmProvider}`), console.error(Xe.red("✗"), `Allowed providers: ${h.join(", ")}`), process.exit(1));
24413
24450
  }
24414
- const e = t.apiUrl || Pi.VITE_INJECT_AGIFLOW_APP_ENDPOINT;
24451
+ const e = t.apiUrl || Ri.VITE_INJECT_AGIFLOW_APP_ENDPOINT;
24415
24452
  let r = t.agentSessionId || this.subEnvManager?.sessionId;
24416
24453
  if (r || (r = Za()), e)
24417
24454
  try {
@@ -24420,10 +24457,10 @@ let Lu = class {
24420
24457
  console.error(Xe.red("✗"), `Invalid API URL. Must be a valid HTTP URL: ${h}`), process.exit(1);
24421
24458
  }
24422
24459
  const i = t.alias || Hw(t.llmProvider, t.llmModel);
24423
- if (t.apiKey && t.organizationId && (await Ce.get(F.CredentialsService).setApiKey({
24460
+ if (t.apiKey && t.organizationId && (Ce.get(F.CredentialsService).setSessionCredentials(r, {
24424
24461
  apiKey: t.apiKey,
24425
24462
  organizationId: t.organizationId
24426
- }), t.verbose && console.log(Xe.blue("ℹ"), "CLI credentials stored for agent session")), Ce.isBound(F.MessageMultiplexBroker) && Ce.unbind(F.MessageMultiplexBroker), Ce.bind(F.MessageMultiplexBroker).to(Un).inSingletonScope(), !Ce.isBound(F.MessageMultiplexBrokerConfig)) {
24463
+ }), t.verbose && console.log(Xe.blue("ℹ"), `Session credentials stored for agent session: ${r}`)), Ce.isBound(F.MessageMultiplexBroker) && Ce.unbind(F.MessageMultiplexBroker), Ce.bind(F.MessageMultiplexBroker).to(Un).inSingletonScope(), !Ce.isBound(F.MessageMultiplexBrokerConfig)) {
24427
24464
  const v = Ce.get(F.ConfigManager).getAppConfig().VITE_MULTIPLEX_SOCKET_PATH;
24428
24465
  Ce.bind(F.MessageMultiplexBrokerConfig).toConstantValue({
24429
24466
  wsPort: v ? null : 0,
@@ -24539,7 +24576,7 @@ let Lu = class {
24539
24576
  configJson: t.agentConfig
24540
24577
  });
24541
24578
  } catch (S) {
24542
- S instanceof Lo ? (console.error(Xe.red("✗"), "Invalid agent configuration:"), S.issues.forEach((m) => {
24579
+ S instanceof Mo ? (console.error(Xe.red("✗"), "Invalid agent configuration:"), S.issues.forEach((m) => {
24543
24580
  const d = m.path.join(".") || "config";
24544
24581
  console.error(Xe.red(" -"), `${d}: ${m.message}`);
24545
24582
  })) : console.error(Xe.red("✗"), S instanceof Error ? S.message : String(S)), process.exit(1);
@@ -24871,24 +24908,28 @@ let Vu = class {
24871
24908
  return { "Content-Type": "application/json", Authorization: `Bearer ${r}` };
24872
24909
  }
24873
24910
  /**
24874
- * Make HTTP request with automatic token refresh on 401 errors
24875
- */
24876
- async makeAuthenticatedRequest(t, e, r = !0) {
24877
- const i = await fetch(t, e);
24878
- if (i.status === 401 && r && this.authService && (await i.text()).includes("Invalid API key")) {
24879
- this.logger.info("🔑 API key expired or invalid, clearing tokens and retrying authentication...");
24880
- try {
24881
- await this.credentials.clear();
24882
- } catch {
24883
- }
24884
- this.logger.info("🔄 Retrying authentication...");
24885
- const o = await this.getAuthHeaders(), s = {
24886
- ...e,
24887
- headers: { ...e.headers, ...o }
24888
- };
24889
- return await fetch(t, s);
24911
+ * Make HTTP request with error handling for 401/429 responses
24912
+ *
24913
+ * IMPORTANT: We do NOT clear credentials on 401 errors automatically.
24914
+ * Only the specific "Invalid API key" error from the server indicates the API key
24915
+ * is truly invalid/expired and should trigger credential clearing.
24916
+ * Other 401 errors (e.g., network issues, server errors) should NOT log the user out.
24917
+ */
24918
+ async makeAuthenticatedRequest(t, e) {
24919
+ const r = await fetch(t, e);
24920
+ if (r.status === 401) {
24921
+ const n = await r.clone().text();
24922
+ if (n.includes("Invalid API key") || n.includes("API key not found")) {
24923
+ this.logger.warn("🔑 API key is invalid or expired. Please re-authenticate using: agiflow auth login");
24924
+ try {
24925
+ await this.credentials.clear();
24926
+ } catch {
24927
+ }
24928
+ } else
24929
+ this.logger.warn(`🔐 Authentication failed (401): ${n.substring(0, 100)}`);
24930
+ return r;
24890
24931
  }
24891
- return i.status === 429 && this.logger.warn("🚫 Rate limit exceeded, keeping credentials but not retrying"), i;
24932
+ return r.status === 429 && this.logger.warn("🚫 Rate limit exceeded, keeping credentials but not retrying"), r;
24892
24933
  }
24893
24934
  /**
24894
24935
  * Register daemon with HTTP API
@@ -24962,16 +25003,11 @@ let Vu = class {
24962
25003
  headers: o,
24963
25004
  body: i
24964
25005
  });
24965
- const s = await this.makeAuthenticatedRequest(
24966
- n,
24967
- {
24968
- method: "PATCH",
24969
- headers: e,
24970
- body: JSON.stringify(i)
24971
- },
24972
- !0
24973
- // Allow retry on auth errors for heartbeat to handle token refresh
24974
- );
25006
+ const s = await this.makeAuthenticatedRequest(n, {
25007
+ method: "PATCH",
25008
+ headers: e,
25009
+ body: JSON.stringify(i)
25010
+ });
24975
25011
  if (!s.ok) {
24976
25012
  const a = await s.text().catch(() => "Unknown error");
24977
25013
  this.logger.warn(`⚠️ Failed to send heartbeat: ${s.status} ${a}`, {
@@ -25050,7 +25086,7 @@ var CA = Object.getOwnPropertyDescriptor, IA = (t, e, r, i) => {
25050
25086
  for (var n = i > 1 ? void 0 : i ? CA(e, r) : e, o = t.length - 1, s; o >= 0; o--)
25051
25087
  (s = t[o]) && (n = s(n) || n);
25052
25088
  return n;
25053
- }, _i = (t, e) => (r, i) => e(r, i, t);
25089
+ }, mi = (t, e) => (r, i) => e(r, i, t);
25054
25090
  let Gu = class {
25055
25091
  constructor(t, e, r, i, n) {
25056
25092
  this.logger = t, this.credentials = e, this.context = r, this.configService = n, this.reduxStore = i;
@@ -25084,7 +25120,7 @@ let Gu = class {
25084
25120
  return;
25085
25121
  }
25086
25122
  try {
25087
- const e = To.parse({
25123
+ const e = Io.parse({
25088
25124
  eventType: qe.STATUS,
25089
25125
  command: ce.RESPONSE,
25090
25126
  payload: {
@@ -25162,7 +25198,7 @@ let Gu = class {
25162
25198
  return this.logger.info(`Connecting to daemon WebSocket: ${i.toString()}`), new Promise((s, a) => {
25163
25199
  this.ws = new Zt(i.toString(), { headers: o }), this.ws.on("open", () => {
25164
25200
  this.isConnected = !0, this.logger.info("Daemon WebSocket connection established");
25165
- const u = To.parse({
25201
+ const u = Io.parse({
25166
25202
  payload: {
25167
25203
  sessionId: n,
25168
25204
  data: "Daemon ready",
@@ -25229,7 +25265,7 @@ let Gu = class {
25229
25265
  command: e.command,
25230
25266
  sessionId: e.payload.sessionId
25231
25267
  });
25232
- const r = To.parse({
25268
+ const r = Io.parse({
25233
25269
  traceId: e.traceId,
25234
25270
  eventType: qe.STATUS,
25235
25271
  command: ce.RESPONSE,
@@ -25385,11 +25421,11 @@ let Gu = class {
25385
25421
  };
25386
25422
  Gu = IA([
25387
25423
  Ae(),
25388
- _i(0, H(F.Logger)),
25389
- _i(1, H(F.CredentialsService)),
25390
- _i(2, H(F.ContextService)),
25391
- _i(3, H(F.Store)),
25392
- _i(4, H(wt.DaemonConfigService))
25424
+ mi(0, H(F.Logger)),
25425
+ mi(1, H(F.CredentialsService)),
25426
+ mi(2, H(F.ContextService)),
25427
+ mi(3, H(F.Store)),
25428
+ mi(4, H(wt.DaemonConfigService))
25393
25429
  ], Gu);
25394
25430
  function TA() {
25395
25431
  return new Hr((t) => {
@@ -27370,7 +27406,7 @@ var t2 = Object.getOwnPropertyDescriptor, r2 = (t, e, r, i) => {
27370
27406
  for (var n = i > 1 ? void 0 : i ? t2(e, r) : e, o = t.length - 1, s; o >= 0; o--)
27371
27407
  (s = t[o]) && (n = s(n) || n);
27372
27408
  return n;
27373
- }, bo = (t, e) => (r, i) => e(r, i, t);
27409
+ }, So = (t, e) => (r, i) => e(r, i, t);
27374
27410
  let Ju = class {
27375
27411
  // Limit to prevent memory leaks
27376
27412
  constructor(t, e, r, i) {
@@ -27561,10 +27597,10 @@ let Ju = class {
27561
27597
  };
27562
27598
  Ju = r2([
27563
27599
  Ae(),
27564
- bo(0, H(Oe.LlmProvider)),
27565
- bo(1, H(wt.MultiplexGlobalClient)),
27566
- bo(2, H(F.SubEnvManager)),
27567
- bo(3, H(F.Logger))
27600
+ So(0, H(Oe.LlmProvider)),
27601
+ So(1, H(wt.MultiplexGlobalClient)),
27602
+ So(2, H(F.SubEnvManager)),
27603
+ So(3, H(F.Logger))
27568
27604
  ], Ju);
27569
27605
  var ia, of;
27570
27606
  function Ke() {
@@ -29419,7 +29455,7 @@ function tn() {
29419
29455
  return ha = t.md = t.md || {}, t.md.algorithms = t.md.algorithms || {}, ha;
29420
29456
  }
29421
29457
  var hf;
29422
- function Xi() {
29458
+ function Yi() {
29423
29459
  if (hf) return fa.exports;
29424
29460
  hf = 1;
29425
29461
  var t = Ke();
@@ -29872,7 +29908,7 @@ function hp() {
29872
29908
  if (vf) return ya;
29873
29909
  vf = 1;
29874
29910
  var t = Ke();
29875
- Xi(), tn(), ot();
29911
+ Yi(), tn(), ot();
29876
29912
  var e = t.pkcs5 = t.pkcs5 || {}, r;
29877
29913
  return t.util.isNodejs && !t.options.usePureJavaScript && (r = cc), ya = t.pbkdf2 = e.pbkdf2 = function(i, n, o, s, a, u) {
29878
29914
  if (typeof a == "function" && (u = a, a = null), t.util.isNodejs && !t.options.usePureJavaScript && r.pbkdf2 && (a === null || typeof a != "object") && (r.pbkdf2Sync.length > 4 || !a || a === "sha1"))
@@ -29923,7 +29959,7 @@ function hp() {
29923
29959
  w();
29924
29960
  }, ya;
29925
29961
  }
29926
- var xo = { exports: {} }, Sa = { exports: {} }, yf;
29962
+ var bo = { exports: {} }, Sa = { exports: {} }, yf;
29927
29963
  function gy() {
29928
29964
  if (yf) return Sa.exports;
29929
29965
  yf = 1;
@@ -30215,12 +30251,12 @@ function my() {
30215
30251
  }
30216
30252
  var bf;
30217
30253
  function zr() {
30218
- if (bf) return xo.exports;
30254
+ if (bf) return bo.exports;
30219
30255
  bf = 1;
30220
30256
  var t = Ke();
30221
30257
  return Fn(), gy(), my(), ot(), function() {
30222
30258
  if (t.random && t.random.getBytes) {
30223
- xo.exports = t.random;
30259
+ bo.exports = t.random;
30224
30260
  return;
30225
30261
  }
30226
30262
  (function(e) {
@@ -30268,9 +30304,9 @@ function zr() {
30268
30304
  else
30269
30305
  for (var S in s)
30270
30306
  t.random[S] = s[S];
30271
- t.random.createInstance = o, xo.exports = t.random;
30307
+ t.random.createInstance = o, bo.exports = t.random;
30272
30308
  })(typeof jQuery < "u" ? jQuery : null);
30273
- }(), xo.exports;
30309
+ }(), bo.exports;
30274
30310
  }
30275
30311
  var xa, xf;
30276
30312
  function _y() {
@@ -30842,12 +30878,12 @@ function Ps() {
30842
30878
  ht > 0 ? (j.lShiftTo(ht, se), ee.lShiftTo(ht, D)) : (j.copyTo(se), ee.copyTo(D));
30843
30879
  var Wt = se.t, yr = se.data[Wt - 1];
30844
30880
  if (yr != 0) {
30845
- var ur = yr * (1 << this.F1) + (Wt > 1 ? se.data[Wt - 2] >> this.F2 : 0), Wr = this.FV / ur, no = (1 << this.F1) / ur, Cr = 1 << this.F2, Ir = D.t, io = Ir - Wt, nn = $ ?? i();
30846
- for (se.dlShiftTo(io, nn), D.compareTo(nn) >= 0 && (D.data[D.t++] = 1, D.subTo(nn, D)), r.ONE.dlShiftTo(Wt, nn), nn.subTo(se, se); se.t < Wt; ) se.data[se.t++] = 0;
30847
- for (; --io >= 0; ) {
30848
- var Ls = D.data[--Ir] == yr ? this.DM : Math.floor(D.data[Ir] * Wr + (D.data[Ir - 1] + Cr) * no);
30849
- if ((D.data[Ir] += se.am(0, Ls, D, io, 0, Wt)) < Ls)
30850
- for (se.dlShiftTo(io, nn), D.subTo(nn, D); D.data[Ir] < --Ls; ) D.subTo(nn, D);
30881
+ var ur = yr * (1 << this.F1) + (Wt > 1 ? se.data[Wt - 2] >> this.F2 : 0), Wr = this.FV / ur, to = (1 << this.F1) / ur, Cr = 1 << this.F2, Ir = D.t, ro = Ir - Wt, nn = $ ?? i();
30882
+ for (se.dlShiftTo(ro, nn), D.compareTo(nn) >= 0 && (D.data[D.t++] = 1, D.subTo(nn, D)), r.ONE.dlShiftTo(Wt, nn), nn.subTo(se, se); se.t < Wt; ) se.data[se.t++] = 0;
30883
+ for (; --ro >= 0; ) {
30884
+ var Ls = D.data[--Ir] == yr ? this.DM : Math.floor(D.data[Ir] * Wr + (D.data[Ir - 1] + Cr) * to);
30885
+ if ((D.data[Ir] += se.am(0, Ls, D, ro, 0, Wt)) < Ls)
30886
+ for (se.dlShiftTo(ro, nn), D.subTo(nn, D); D.data[Ir] < --Ls; ) D.subTo(nn, D);
30851
30887
  }
30852
30888
  $ != null && (D.drShiftTo(Wt, $), be != ge && r.ZERO.subTo($, $)), D.t = Wt, D.clamp(), ht > 0 && D.rShiftTo(ht, D), be < 0 && r.ZERO.subTo(D, D);
30853
30889
  }
@@ -31204,12 +31240,12 @@ function Ps() {
31204
31240
  for (se.sqrTo(be[1], yr); ge <= Wt; )
31205
31241
  be[ge] = i(), se.mulTo(yr, be[ge - 2], be[ge]), ge += 2;
31206
31242
  }
31207
- var ur = C.t - 1, Wr, no = !0, Cr = i(), Ir;
31243
+ var ur = C.t - 1, Wr, to = !0, Cr = i(), Ir;
31208
31244
  for (D = g(C.data[ur]) - 1; ur >= 0; ) {
31209
31245
  for (D >= ht ? Wr = C.data[ur] >> D - ht & Wt : (Wr = (C.data[ur] & (1 << D + 1) - 1) << ht - D, ur > 0 && (Wr |= C.data[ur - 1] >> this.DB + D - ht)), ge = j; (Wr & 1) == 0; )
31210
31246
  Wr >>= 1, --ge;
31211
- if ((D -= ge) < 0 && (D += this.DB, --ur), no)
31212
- be[Wr].copyTo(ee), no = !1;
31247
+ if ((D -= ge) < 0 && (D += this.DB, --ur), to)
31248
+ be[Wr].copyTo(ee), to = !1;
31213
31249
  else {
31214
31250
  for (; ge > 1; )
31215
31251
  se.sqrTo(ee, Cr), se.sqrTo(Cr, ee), ge -= 2;
@@ -31299,7 +31335,7 @@ function Ps() {
31299
31335
  return r.prototype.chunkSize = we, r.prototype.toRadix = ve, r.prototype.fromRadix = Ne, r.prototype.fromNumber = Je, r.prototype.bitwiseTo = pt, r.prototype.changeBit = Ve, r.prototype.addTo = Pt, r.prototype.dMultiply = Gt, r.prototype.dAddOffset = qt, r.prototype.multiplyLowerTo = Ky, r.prototype.multiplyUpperTo = Wy, r.prototype.modInt = rS, r.prototype.millerRabin = sS, r.prototype.clone = L, r.prototype.intValue = B, r.prototype.byteValue = X, r.prototype.shortValue = _e, r.prototype.signum = Q, r.prototype.toByteArray = je, r.prototype.equals = bt, r.prototype.min = Ct, r.prototype.max = Et, r.prototype.and = yt, r.prototype.or = Nt, r.prototype.xor = W, r.prototype.andNot = ue, r.prototype.not = Ie, r.prototype.shiftLeft = rt, r.prototype.shiftRight = ct, r.prototype.getLowestSetBit = de, r.prototype.bitCount = ye, r.prototype.testBit = xe, r.prototype.setBit = Le, r.prototype.clearBit = Ge, r.prototype.flipBit = lt, r.prototype.add = Dt, r.prototype.subtract = Bt, r.prototype.multiply = zt, r.prototype.divide = Ft, r.prototype.remainder = jt, r.prototype.divideAndRemainder = Vt, r.prototype.modPow = eS, r.prototype.modInverse = nS, r.prototype.pow = Hy, r.prototype.gcd = tS, r.prototype.isProbablePrime = oS, ka;
31300
31336
  }
31301
31337
  var Ea = { exports: {} }, wa = { exports: {} }, Ef;
31302
- function eo() {
31338
+ function Qi() {
31303
31339
  if (Ef) return wa.exports;
31304
31340
  Ef = 1;
31305
31341
  var t = Ke();
@@ -31384,7 +31420,7 @@ function vy() {
31384
31420
  if (wf) return Ea.exports;
31385
31421
  wf = 1;
31386
31422
  var t = Ke();
31387
- ot(), zr(), eo();
31423
+ ot(), zr(), Qi();
31388
31424
  var e = Ea.exports = t.pkcs1 = t.pkcs1 || {};
31389
31425
  e.encode_rsa_oaep = function(i, n, o) {
31390
31426
  var s, a, u, c;
@@ -31442,17 +31478,17 @@ function vy() {
31442
31478
  }
31443
31479
  return Ea.exports;
31444
31480
  }
31445
- var ko = { exports: {} }, Cf;
31481
+ var xo = { exports: {} }, Cf;
31446
31482
  function yy() {
31447
- if (Cf) return ko.exports;
31483
+ if (Cf) return xo.exports;
31448
31484
  Cf = 1;
31449
31485
  var t = Ke();
31450
31486
  return ot(), Ps(), zr(), function() {
31451
31487
  if (t.prime) {
31452
- ko.exports = t.prime;
31488
+ xo.exports = t.prime;
31453
31489
  return;
31454
31490
  }
31455
- var e = ko.exports = t.prime = t.prime || {}, r = t.jsbn.BigInteger, i = [6, 4, 2, 4, 2, 4, 6, 2], n = new r(null);
31491
+ var e = xo.exports = t.prime = t.prime || {}, r = t.jsbn.BigInteger, i = [6, 4, 2, 4, 2, 4, 6, 2], n = new r(null);
31456
31492
  n.fromInt(30);
31457
31493
  var o = function(m, d) {
31458
31494
  return m | d;
@@ -31533,7 +31569,7 @@ function yy() {
31533
31569
  function S(m) {
31534
31570
  return m <= 100 ? 27 : m <= 150 ? 18 : m <= 200 ? 15 : m <= 250 ? 12 : m <= 300 ? 9 : m <= 350 ? 8 : m <= 400 ? 7 : m <= 500 ? 6 : m <= 600 ? 5 : m <= 800 ? 4 : m <= 1250 ? 3 : 2;
31535
31571
  }
31536
- }(), ko.exports;
31572
+ }(), xo.exports;
31537
31573
  }
31538
31574
  var Ca, If;
31539
31575
  function Os() {
@@ -34803,7 +34839,7 @@ function ky() {
34803
34839
  if (Of) return Ta.exports;
34804
34840
  Of = 1;
34805
34841
  var t = Ke();
34806
- Kr(), Xi(), jn(), by(), Sy(), zr(), Os(), eo(), ot(), mp();
34842
+ Kr(), Yi(), jn(), by(), Sy(), zr(), Os(), Qi(), ot(), mp();
34807
34843
  var e = t.asn1, r = t.pki, i = Ta.exports = t.pkcs12 = t.pkcs12 || {}, n = {
34808
34844
  name: "ContentInfo",
34809
34845
  tagClass: e.Class.UNIVERSAL,
@@ -35543,7 +35579,7 @@ function wy() {
35543
35579
  if (Bf) return Oa;
35544
35580
  Bf = 1;
35545
35581
  var t = Ke();
35546
- Kr(), Xi(), fp(), li(), Ey(), zr(), eo(), ot();
35582
+ Kr(), Yi(), fp(), li(), Ey(), zr(), Qi(), ot();
35547
35583
  var e = function(E, N, R, _) {
35548
35584
  var A = t.util.createBuffer(), L = E.length >> 1, B = L + (E.length & 1), X = E.substr(0, B), _e = E.substr(L, B), we = t.util.createBuffer(), Q = t.hmac.create();
35549
35585
  R = N + R;
@@ -37134,14 +37170,14 @@ function Cy() {
37134
37170
  }
37135
37171
  return Da.exports;
37136
37172
  }
37137
- var Eo = {}, Lf;
37173
+ var ko = {}, Lf;
37138
37174
  function s2() {
37139
- if (Lf) return Eo;
37175
+ if (Lf) return ko;
37140
37176
  Lf = 1;
37141
37177
  var t = Ke();
37142
37178
  Kr();
37143
37179
  var e = t.asn1;
37144
- return Eo.privateKeyValidator = {
37180
+ return ko.privateKeyValidator = {
37145
37181
  // PrivateKeyInfo
37146
37182
  name: "PrivateKeyInfo",
37147
37183
  tagClass: e.Class.UNIVERSAL,
@@ -37175,7 +37211,7 @@ function s2() {
37175
37211
  constructed: !1,
37176
37212
  capture: "privateKey"
37177
37213
  }]
37178
- }, Eo.publicKeyValidator = {
37214
+ }, ko.publicKeyValidator = {
37179
37215
  name: "SubjectPublicKeyInfo",
37180
37216
  tagClass: e.Class.UNIVERSAL,
37181
37217
  type: e.Type.SEQUENCE,
@@ -37222,7 +37258,7 @@ function s2() {
37222
37258
  }]
37223
37259
  } */
37224
37260
  ]
37225
- }, Eo;
37261
+ }, ko;
37226
37262
  }
37227
37263
  var Ba, zf;
37228
37264
  function a2() {
@@ -37847,7 +37883,7 @@ function c2() {
37847
37883
  }
37848
37884
  var La, Vf;
37849
37885
  function l2() {
37850
- return Vf || (Vf = 1, La = tn(), fp(), eo(), gy(), Cy()), La;
37886
+ return Vf || (Vf = 1, La = tn(), fp(), Qi(), gy(), Cy()), La;
37851
37887
  }
37852
37888
  var za = { exports: {} }, Gf;
37853
37889
  function p2() {
@@ -38665,7 +38701,7 @@ function d2() {
38665
38701
  if (qf) return Fa.exports;
38666
38702
  qf = 1;
38667
38703
  var t = Ke();
38668
- Fn(), Xi(), fp(), eo(), ot();
38704
+ Fn(), Yi(), fp(), Qi(), ot();
38669
38705
  var e = Fa.exports = t.ssh = t.ssh || {};
38670
38706
  e.privateKeyToPutty = function(o, s, a) {
38671
38707
  a = a || "", s = s || "";
@@ -38750,7 +38786,7 @@ Private-MAC: ` + g.digest().toHex() + `\r
38750
38786
  }
38751
38787
  var ja, Hf;
38752
38788
  function f2() {
38753
- return Hf || (Hf = 1, ja = Ke(), Fn(), o2(), Kr(), dp(), Ns(), a2(), Xi(), u2(), c2(), l2(), xy(), hp(), li(), vy(), ky(), p2(), Ey(), yy(), my(), gp(), zr(), _y(), d2(), wy(), ot()), ja;
38789
+ return Hf || (Hf = 1, ja = Ke(), Fn(), o2(), Kr(), dp(), Ns(), a2(), Yi(), u2(), c2(), l2(), xy(), hp(), li(), vy(), ky(), p2(), Ey(), yy(), my(), gp(), zr(), _y(), d2(), wy(), ot()), ja;
38754
38790
  }
38755
38791
  var qn = f2();
38756
38792
  const h2 = /* @__PURE__ */ wh(qn);
@@ -38828,7 +38864,7 @@ let Yu = class {
38828
38864
  * Check if the CA certificate is already installed in the system trust store
38829
38865
  */
38830
38866
  async isCaInstalled() {
38831
- const t = oo.platform();
38867
+ const t = no.platform();
38832
38868
  try {
38833
38869
  if (t === "darwin")
38834
38870
  try {
@@ -38880,7 +38916,7 @@ ${r}`;
38880
38916
  * Get the path to the system CA bundle
38881
38917
  */
38882
38918
  getSystemCaBundlePath() {
38883
- const t = oo.platform();
38919
+ const t = no.platform();
38884
38920
  if (t === "darwin") {
38885
38921
  const e = [
38886
38922
  "/etc/ssl/cert.pem",
@@ -38909,7 +38945,7 @@ ${r}`;
38909
38945
  const t = this.getSystemCaBundlePath();
38910
38946
  if (Yt.existsSync(t))
38911
38947
  return Yt.readFileSync(t, "utf8");
38912
- if (oo.platform() === "darwin")
38948
+ if (no.platform() === "darwin")
38913
38949
  try {
38914
38950
  return $t(
38915
38951
  "security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain",
@@ -38931,7 +38967,7 @@ ${r}`;
38931
38967
  async installCaToSystem() {
38932
38968
  if (!Yt.existsSync(this.caCertPath))
38933
38969
  throw new Error("CA certificate not found. Generate it first.");
38934
- const t = oo.platform();
38970
+ const t = no.platform();
38935
38971
  this.logger.info("Attempting to install CA certificate to system trust store...");
38936
38972
  try {
38937
38973
  if (t === "darwin")
@@ -38958,7 +38994,7 @@ Yu = m2([
38958
38994
  function v2(t, ...e) {
38959
38995
  return (...r) => t(...e, ...r);
38960
38996
  }
38961
- function to(t) {
38997
+ function Xi(t) {
38962
38998
  return function(...e) {
38963
38999
  var r = e.pop();
38964
39000
  return t.call(this, e, r);
@@ -38971,14 +39007,14 @@ function Ay(t) {
38971
39007
  function $y(t) {
38972
39008
  return (e, ...r) => t(() => e(...r));
38973
39009
  }
38974
- var bi;
38975
- y2 ? bi = queueMicrotask : Iy ? bi = setImmediate : Ty ? bi = process.nextTick : bi = Ay;
38976
- var An = $y(bi);
39010
+ var Si;
39011
+ y2 ? Si = queueMicrotask : Iy ? Si = setImmediate : Ty ? Si = process.nextTick : Si = Ay;
39012
+ var An = $y(Si);
38977
39013
  function Qu(t) {
38978
- return ro(t) ? function(...e) {
39014
+ return eo(t) ? function(...e) {
38979
39015
  const r = e.pop(), i = t.apply(this, e);
38980
39016
  return Kf(i, r);
38981
- } : to(function(e, r) {
39017
+ } : Xi(function(e, r) {
38982
39018
  var i;
38983
39019
  try {
38984
39020
  i = t.apply(this, e);
@@ -39006,7 +39042,7 @@ function Wf(t, e, r) {
39006
39042
  }, i);
39007
39043
  }
39008
39044
  }
39009
- function ro(t) {
39045
+ function eo(t) {
39010
39046
  return t[Symbol.toStringTag] === "AsyncFunction";
39011
39047
  }
39012
39048
  function S2(t) {
@@ -39017,7 +39053,7 @@ function b2(t) {
39017
39053
  }
39018
39054
  function Qe(t) {
39019
39055
  if (typeof t != "function") throw new Error("expected a function");
39020
- return ro(t) ? Qu(t) : t;
39056
+ return eo(t) ? Qu(t) : t;
39021
39057
  }
39022
39058
  function We(t, e) {
39023
39059
  if (e || (e = t.length), !e) throw new Error("arity is undefined");
@@ -39326,7 +39362,7 @@ Source:
39326
39362
  function j2(t, e) {
39327
39363
  var r = {};
39328
39364
  return Object.keys(t).forEach((i) => {
39329
- var n = t[i], o, s = ro(n), a = !s && n.length === 1 || s && n.length === 0;
39365
+ var n = t[i], o, s = eo(n), a = !s && n.length === 1 || s && n.length === 0;
39330
39366
  if (Array.isArray(n))
39331
39367
  o = [...n], n = o.pop(), r[i] = o.concat(o.length > 0 ? u : n);
39332
39368
  else if (a)
@@ -39571,12 +39607,12 @@ function H2(t, e, r, i) {
39571
39607
  });
39572
39608
  }, (o) => i(o, e));
39573
39609
  }
39574
- var Ii = We(H2, 4);
39610
+ var Ci = We(H2, 4);
39575
39611
  function Oy(...t) {
39576
39612
  var e = t.map(Qe);
39577
39613
  return function(...r) {
39578
39614
  var i = this, n = r[r.length - 1];
39579
- return typeof n == "function" ? r.pop() : n = oi(), Ii(
39615
+ return typeof n == "function" ? r.pop() : n = oi(), Ci(
39580
39616
  e,
39581
39617
  r,
39582
39618
  (o, s, a) => {
@@ -39695,7 +39731,7 @@ function a$(t, e, r) {
39695
39731
  }
39696
39732
  var tc = We(a$, 3);
39697
39733
  function Uy(t) {
39698
- return ro(t) ? t : function(...e) {
39734
+ return eo(t) ? t : function(...e) {
39699
39735
  var r = e.pop(), i = !0;
39700
39736
  e.push((...n) => {
39701
39737
  i ? An(() => r(...n)) : r(...n);
@@ -39803,7 +39839,7 @@ function E$(t, e, r) {
39803
39839
  return bp(t, 1, e, r);
39804
39840
  }
39805
39841
  function w$(t, e = (r) => r) {
39806
- var r = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null), n = Qe(t), o = to((s, a) => {
39842
+ var r = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null), n = Qe(t), o = Xi((s, a) => {
39807
39843
  var u = e(...s);
39808
39844
  u in r ? An(() => a(null, ...r[u])) : u in i ? i[u].push(a) : (i[u] = [a], n(...s, (c, ...f) => {
39809
39845
  c || (r[u] = f);
@@ -39815,9 +39851,9 @@ function w$(t, e = (r) => r) {
39815
39851
  });
39816
39852
  return o.memo = r, o.unmemoized = t, o;
39817
39853
  }
39818
- var Ao;
39819
- Ty ? Ao = process.nextTick : Iy ? Ao = setImmediate : Ao = Ay;
39820
- var C$ = $y(Ao), xp = We((t, e, r) => {
39854
+ var To;
39855
+ Ty ? To = process.nextTick : Iy ? To = setImmediate : To = Ay;
39856
+ var C$ = $y(To), xp = We((t, e, r) => {
39821
39857
  var i = Ds(e) ? [] : {};
39822
39858
  t(e, (n, o, s) => {
39823
39859
  Qe(n)((a, ...u) => {
@@ -39925,11 +39961,11 @@ function N$(t, e) {
39925
39961
  var P$ = We(N$, 2);
39926
39962
  function lh(t, e, r, i) {
39927
39963
  var n = [...t].reverse();
39928
- return Ii(n, e, r, i);
39964
+ return Ci(n, e, r, i);
39929
39965
  }
39930
39966
  function rc(t) {
39931
39967
  var e = Qe(t);
39932
- return to(function(i, n) {
39968
+ return Xi(function(i, n) {
39933
39969
  return i.push((o, ...s) => {
39934
39970
  let a = {};
39935
39971
  if (o && (a.error = o), s.length > 0) {
@@ -39998,9 +40034,9 @@ function F$(t, e) {
39998
40034
  function j$(t, e) {
39999
40035
  e || (e = t, t = null);
40000
40036
  let r = t && t.arity || e.length;
40001
- ro(e) && (r += 1);
40037
+ eo(e) && (r += 1);
40002
40038
  var i = Qe(e);
40003
- return to((n, o) => {
40039
+ return Xi((n, o) => {
40004
40040
  (n.length < r - 1 || o == null) && (n.push(o), o = oi());
40005
40041
  function s(a) {
40006
40042
  i(...n, a);
@@ -40042,7 +40078,7 @@ function K$(t, e, r) {
40042
40078
  var W$ = We(K$, 3);
40043
40079
  function Z$(t, e, r) {
40044
40080
  var i = Qe(t);
40045
- return to((n, o) => {
40081
+ return Xi((n, o) => {
40046
40082
  var s = !1, a;
40047
40083
  function u() {
40048
40084
  var c = t.name || "anonymous", f = new Error('Callback function "' + c + '" timed out.');
@@ -40177,7 +40213,7 @@ var sR = We(oR), Qt = {
40177
40213
  priorityQueue: R$,
40178
40214
  queue: My,
40179
40215
  race: P$,
40180
- reduce: Ii,
40216
+ reduce: Ci,
40181
40217
  reduceRight: lh,
40182
40218
  reflect: rc,
40183
40219
  reflectAll: O$,
@@ -40222,8 +40258,8 @@ var sR = We(oR), Qt = {
40222
40258
  forEachOf: Lr,
40223
40259
  forEachOfSeries: Xr,
40224
40260
  forEachOfLimit: ss,
40225
- inject: Ii,
40226
- foldl: Ii,
40261
+ inject: Ci,
40262
+ foldl: Ci,
40227
40263
  foldr: lh,
40228
40264
  select: sh,
40229
40265
  selectLimit: ah,
@@ -40713,7 +40749,7 @@ let Wa = class Hn {
40713
40749
  return this.options = e || {}, this.httpPort = e.port || e.port === 0 ? e.port : 8080, this.httpHost = e.host || "localhost", this.timeout = e.timeout || 0, this.keepAlive = !!e.keepAlive, this.httpAgent = typeof e.httpAgent < "u" ? e.httpAgent : new Fs.Agent({ keepAlive: this.keepAlive }), this.httpsAgent = typeof e.httpsAgent < "u" ? e.httpsAgent : new js.Agent({ keepAlive: this.keepAlive }), this.forceSNI = !!e.forceSNI, this.forceSNI, this.httpsPort = this.forceSNI ? e.httpsPort : void 0, this.sslCaDir = e.sslCaDir || ze.resolve(process.cwd(), ".http-mitm-proxy"), Cp.create(this.sslCaDir, this.logger, (i, n) => {
40714
40750
  if (i)
40715
40751
  return r(i);
40716
- this.ca = n, this.sslServers = {}, this.sslSemaphores = {}, this.connectRequests = {}, this.httpServer = Fs.createServer(), this.httpServer.timeout = this.timeout, this.httpServer.on("connect", this._onHttpServerConnect.bind(this)), this.httpServer.on("request", this._onHttpServerRequest.bind(this, !1)), this.wsServer = new Ro({ server: this.httpServer }), this.wsServer.on("error", this._onError.bind(this, "HTTP_SERVER_ERROR", null)), this.wsServer.on("connection", (s, a) => {
40752
+ this.ca = n, this.sslServers = {}, this.sslSemaphores = {}, this.connectRequests = {}, this.httpServer = Fs.createServer(), this.httpServer.timeout = this.timeout, this.httpServer.on("connect", this._onHttpServerConnect.bind(this)), this.httpServer.on("request", this._onHttpServerRequest.bind(this, !1)), this.wsServer = new $o({ server: this.httpServer }), this.wsServer.on("error", this._onError.bind(this, "HTTP_SERVER_ERROR", null)), this.wsServer.on("connection", (s, a) => {
40717
40753
  s.upgradeReq = a, this._onWebSocketServerConnect.call(this, !1, s, a);
40718
40754
  });
40719
40755
  const o = {
@@ -40736,7 +40772,7 @@ let Wa = class Hn {
40736
40772
  ...e
40737
40773
  });
40738
40774
  i.timeout = this.timeout, i.on("error", this._onError.bind(this, "HTTPS_SERVER_ERROR", null)), i.on("clientError", this._onError.bind(this, "HTTPS_CLIENT_ERROR", null)), i.on("connect", this._onHttpServerConnect.bind(this)), i.on("request", this._onHttpServerRequest.bind(this, !0));
40739
- const n = new Ro({ server: i });
40775
+ const n = new $o({ server: i });
40740
40776
  n.on("connection", (s, a) => {
40741
40777
  s.upgradeReq = a, this._onWebSocketServerConnect.call(this, !0, s, a);
40742
40778
  });
@@ -41852,7 +41888,7 @@ export {
41852
41888
  ip as O,
41853
41889
  Tw as P,
41854
41890
  Dv as Q,
41855
- To as R,
41891
+ Io as R,
41856
41892
  Cw as S,
41857
41893
  $w as T,
41858
41894
  Fv as U,
@@ -41878,7 +41914,7 @@ export {
41878
41914
  wv as aB,
41879
41915
  Go as aC,
41880
41916
  kt as aD,
41881
- mo as aE,
41917
+ ho as aE,
41882
41918
  hu as aF,
41883
41919
  yd as aG,
41884
41920
  xu as aH,
@@ -41886,7 +41922,7 @@ export {
41886
41922
  gu as aJ,
41887
41923
  mu as aK,
41888
41924
  Kw as aL,
41889
- Ci as aM,
41925
+ wi as aM,
41890
41926
  SN as aN,
41891
41927
  Ho as aO,
41892
41928
  Ko as aP,
@@ -41923,19 +41959,19 @@ export {
41923
41959
  Wv as at,
41924
41960
  zu as au,
41925
41961
  Fu as av,
41926
- Pi as aw,
41962
+ Ri as aw,
41927
41963
  hN as ax,
41928
41964
  ew as ay,
41929
- Ni as az,
41965
+ Vo as az,
41930
41966
  dt as b,
41931
41967
  Wo as b0,
41932
41968
  Eu as b1,
41933
41969
  Od as b2,
41934
41970
  CN as b3,
41935
- Oi as b4,
41971
+ Ni as b4,
41936
41972
  wu as b5,
41937
41973
  Cu as b6,
41938
- Yi as b7,
41974
+ Zi as b7,
41939
41975
  bN as b8,
41940
41976
  tt as b9,
41941
41977
  xN as ba,
@@ -41985,4 +42021,4 @@ export {
41985
42021
  Av as y,
41986
42022
  Sw as z
41987
42023
  };
41988
- //# sourceMappingURL=index-B0CN_utb.mjs.map
42024
+ //# sourceMappingURL=index-rQIAEgB9.mjs.map