@agiflowai/agent-cli 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claudeNotification.js +1 -1
- package/dist/claudePermissionRequest.js +1 -1
- package/dist/claudePostToolUse.js +1 -1
- package/dist/claudePreToolUse.js +1 -1
- package/dist/claudeSessionEnd.js +1 -1
- package/dist/claudeSessionStart.js +1 -1
- package/dist/claudeStop.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/daemon.js +1 -1
- package/dist/{index-B3zbGK0T.mjs → index-D-edidE4.mjs} +2 -2
- package/dist/index-D-edidE4.mjs.map +1 -0
- package/dist/{index-DBPWFpwa.mjs → index-qm8Y_t_Z.mjs} +138 -188
- package/dist/{index-DBPWFpwa.mjs.map → index-qm8Y_t_Z.mjs.map} +1 -1
- package/dist/{index-Cm-TlnID.mjs → index-qyLMfqDP.mjs} +2 -2
- package/dist/index-qyLMfqDP.mjs.map +1 -0
- package/dist/index.js +2 -2
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/index-B3zbGK0T.mjs.map +0 -1
- package/dist/index-Cm-TlnID.mjs.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as so from "os";
|
|
2
|
-
import
|
|
2
|
+
import Nr, { homedir as Yn, tmpdir as pS } from "os";
|
|
3
3
|
import * as Wn from "path";
|
|
4
|
-
import
|
|
4
|
+
import ze, { join as zt, resolve as En, basename as ao, dirname as ci, parse as dS } from "path";
|
|
5
5
|
import { execSync as Ot, exec as fS, spawn as Ap } from "child_process";
|
|
6
6
|
import * as Qt from "fs";
|
|
7
7
|
import Te, { promises as $p, mkdtempSync as hS, writeFileSync as gS, unlinkSync as mS, existsSync as rr, mkdir as Sh, stat as _S, statSync as vS, mkdirSync as bh } from "fs";
|
|
8
8
|
import { createSlice as dc, createAsyncThunk as fs, configureStore as yS } from "@reduxjs/toolkit";
|
|
9
9
|
import * as sn from "node:fs/promises";
|
|
10
|
-
import * as
|
|
10
|
+
import * as Ar from "node:os";
|
|
11
11
|
import { homedir as Hs } from "node:os";
|
|
12
|
-
import * as
|
|
12
|
+
import * as $r from "node:path";
|
|
13
13
|
import fc from "node:path";
|
|
14
14
|
import * as SS from "node:crypto";
|
|
15
15
|
import { randomUUID as bS } from "node:crypto";
|
|
16
16
|
import "@inquirer/prompts";
|
|
17
17
|
import { ulid as pt } from "ulidx";
|
|
18
18
|
import { fileURLToPath as xh } from "node:url";
|
|
19
|
-
import * as
|
|
19
|
+
import * as Rr from "node:fs";
|
|
20
20
|
import xS from "node:fs";
|
|
21
21
|
import uo from "pino";
|
|
22
22
|
import { createServer as kS } from "node:http";
|
|
@@ -467,13 +467,13 @@ function zS() {
|
|
|
467
467
|
if (Y.isProviderFor(xe, Ve))
|
|
468
468
|
return W;
|
|
469
469
|
if (!pe(ce))
|
|
470
|
-
for (var
|
|
471
|
-
var Ge = ye(
|
|
470
|
+
for (var Le = we(ce); ; ) {
|
|
471
|
+
var Ge = ye(Le);
|
|
472
472
|
if (!Ge)
|
|
473
473
|
return;
|
|
474
474
|
var lt = X(Ge);
|
|
475
475
|
if (lt.isProviderFor(xe, Ve))
|
|
476
|
-
return Ne(
|
|
476
|
+
return Ne(Le), lt;
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
}
|
|
@@ -481,23 +481,23 @@ function zS() {
|
|
|
481
481
|
return V;
|
|
482
482
|
}
|
|
483
483
|
function de(xe, Ve) {
|
|
484
|
-
var
|
|
485
|
-
return pe(
|
|
484
|
+
var Le = Ie.get(xe), Ge;
|
|
485
|
+
return pe(Le) || (Ge = Le.get(Ve)), pe(Ge) && (Ge = Be(xe, Ve), pe(Ge) || (pe(Le) && (Le = new d(), Ie.set(xe, Le)), Le.set(Ve, Ge))), Ge;
|
|
486
486
|
}
|
|
487
487
|
function ge(xe) {
|
|
488
488
|
if (pe(xe))
|
|
489
489
|
throw new TypeError();
|
|
490
490
|
return W === xe || Y === xe || !pe(ce) && ce.has(xe);
|
|
491
491
|
}
|
|
492
|
-
function Se(xe, Ve,
|
|
493
|
-
if (!ge(
|
|
492
|
+
function Se(xe, Ve, Le) {
|
|
493
|
+
if (!ge(Le))
|
|
494
494
|
throw new Error("Metadata provider not registered.");
|
|
495
495
|
var Ge = de(xe, Ve);
|
|
496
|
-
if (Ge !==
|
|
496
|
+
if (Ge !== Le) {
|
|
497
497
|
if (!pe(Ge))
|
|
498
498
|
return !1;
|
|
499
499
|
var lt = Ie.get(xe);
|
|
500
|
-
pe(lt) && (lt = new d(), Ie.set(xe, lt)), lt.set(Ve,
|
|
500
|
+
pe(lt) && (lt = new d(), Ie.set(xe, lt)), lt.set(Ve, Le);
|
|
501
501
|
}
|
|
502
502
|
return !0;
|
|
503
503
|
}
|
|
@@ -525,18 +525,18 @@ function zS() {
|
|
|
525
525
|
};
|
|
526
526
|
return l.registerProvider(Y), Y;
|
|
527
527
|
function ce(ge, Se, xe) {
|
|
528
|
-
var Ve = W.get(ge),
|
|
528
|
+
var Ve = W.get(ge), Le = !1;
|
|
529
529
|
if (pe(Ve)) {
|
|
530
530
|
if (!xe)
|
|
531
531
|
return;
|
|
532
|
-
Ve = new d(), W.set(ge, Ve),
|
|
532
|
+
Ve = new d(), W.set(ge, Ve), Le = !0;
|
|
533
533
|
}
|
|
534
534
|
var Ge = Ve.get(Se);
|
|
535
535
|
if (pe(Ge)) {
|
|
536
536
|
if (!xe)
|
|
537
537
|
return;
|
|
538
538
|
if (Ge = new d(), Ve.set(Se, Ge), !V.setProvider(ge, Se, Y))
|
|
539
|
-
throw Ve.delete(Se),
|
|
539
|
+
throw Ve.delete(Se), Le && W.delete(ge), new Error("Wrong provider for target.");
|
|
540
540
|
}
|
|
541
541
|
return Ge;
|
|
542
542
|
}
|
|
@@ -560,13 +560,13 @@ function zS() {
|
|
|
560
560
|
return Ve.get(ge);
|
|
561
561
|
}
|
|
562
562
|
function ct(ge, Se, xe, Ve) {
|
|
563
|
-
var
|
|
563
|
+
var Le = ce(
|
|
564
564
|
xe,
|
|
565
565
|
Ve,
|
|
566
566
|
/*Create*/
|
|
567
567
|
!0
|
|
568
568
|
);
|
|
569
|
-
|
|
569
|
+
Le.set(ge, Se);
|
|
570
570
|
}
|
|
571
571
|
function Be(ge, Se) {
|
|
572
572
|
var xe = [], Ve = ce(
|
|
@@ -577,7 +577,7 @@ function zS() {
|
|
|
577
577
|
);
|
|
578
578
|
if (pe(Ve))
|
|
579
579
|
return xe;
|
|
580
|
-
for (var
|
|
580
|
+
for (var Le = Ve.keys(), Ge = we(Le), lt = 0; ; ) {
|
|
581
581
|
var Pt = ye(Ge);
|
|
582
582
|
if (!Pt)
|
|
583
583
|
return xe.length = lt, xe;
|
|
@@ -604,8 +604,8 @@ function zS() {
|
|
|
604
604
|
if (pe(Ve) || !Ve.delete(ge))
|
|
605
605
|
return !1;
|
|
606
606
|
if (Ve.size === 0) {
|
|
607
|
-
var
|
|
608
|
-
pe(
|
|
607
|
+
var Le = W.get(Se);
|
|
608
|
+
pe(Le) || (Le.delete(xe), Le.size === 0 && W.delete(Le));
|
|
609
609
|
}
|
|
610
610
|
return !0;
|
|
611
611
|
}
|
|
@@ -902,7 +902,7 @@ function pn() {
|
|
|
902
902
|
const t = $n(Object, Js) ?? 0;
|
|
903
903
|
return t === Number.MAX_SAFE_INTEGER ? gc(Object, Js, Number.MIN_SAFE_INTEGER) : hn(Object, Js, () => t, (e) => e + 1), t;
|
|
904
904
|
}
|
|
905
|
-
const
|
|
905
|
+
const Er = { Request: "Request", Singleton: "Singleton", Transient: "Transient" }, nt = { ConstantValue: "ConstantValue", DynamicValue: "DynamicValue", Factory: "Factory", Instance: "Instance", Provider: "Provider", ResolvedValue: "ResolvedValue", ServiceRedirection: "ServiceRedirection" };
|
|
906
906
|
function* Ih(...t) {
|
|
907
907
|
for (const e of t) yield* e;
|
|
908
908
|
}
|
|
@@ -2113,14 +2113,14 @@ function kc(t, e) {
|
|
|
2113
2113
|
return (r, i) => {
|
|
2114
2114
|
const n = t(i);
|
|
2115
2115
|
switch (n.scope) {
|
|
2116
|
-
case
|
|
2116
|
+
case Er.Singleton:
|
|
2117
2117
|
return n.cache.isRight ? n.cache.value : Kh(n, Ao(r, n, e(r, i)));
|
|
2118
|
-
case
|
|
2118
|
+
case Er.Request: {
|
|
2119
2119
|
if (r.requestScopeCache.has(n.id)) return r.requestScopeCache.get(n.id);
|
|
2120
2120
|
const o = Ao(r, n, e(r, i));
|
|
2121
2121
|
return r.requestScopeCache.set(n.id, o), o;
|
|
2122
2122
|
}
|
|
2123
|
-
case
|
|
2123
|
+
case Er.Transient:
|
|
2124
2124
|
return Ao(r, n, e(r, i));
|
|
2125
2125
|
}
|
|
2126
2126
|
};
|
|
@@ -2308,7 +2308,7 @@ function Bo(t, e) {
|
|
|
2308
2308
|
if (e === void 0) return;
|
|
2309
2309
|
const r = function(n) {
|
|
2310
2310
|
const o = [];
|
|
2311
|
-
for (const s of n) Sb(s) && s.scope ===
|
|
2311
|
+
for (const s of n) Sb(s) && s.scope === Er.Singleton && s.cache.isRight && o.push(s);
|
|
2312
2312
|
return o;
|
|
2313
2313
|
}(e), i = [];
|
|
2314
2314
|
for (const n of r) {
|
|
@@ -2414,13 +2414,13 @@ class Cb {
|
|
|
2414
2414
|
return Ec(this.#e);
|
|
2415
2415
|
}
|
|
2416
2416
|
inRequestScope() {
|
|
2417
|
-
return this.#e.scope =
|
|
2417
|
+
return this.#e.scope = Er.Request, new In(this.#e);
|
|
2418
2418
|
}
|
|
2419
2419
|
inSingletonScope() {
|
|
2420
|
-
return this.#e.scope =
|
|
2420
|
+
return this.#e.scope = Er.Singleton, new In(this.#e);
|
|
2421
2421
|
}
|
|
2422
2422
|
inTransientScope() {
|
|
2423
|
-
return this.#e.scope =
|
|
2423
|
+
return this.#e.scope = Er.Transient, new In(this.#e);
|
|
2424
2424
|
}
|
|
2425
2425
|
}
|
|
2426
2426
|
class Zh {
|
|
@@ -2440,7 +2440,7 @@ class Zh {
|
|
|
2440
2440
|
return this.to(this.#r);
|
|
2441
2441
|
}
|
|
2442
2442
|
toConstantValue(e) {
|
|
2443
|
-
const r = { cache: { isRight: !1, value: void 0 }, id: pn(), isSatisfiedBy: bn.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope:
|
|
2443
|
+
const r = { cache: { isRight: !1, value: void 0 }, id: pn(), isSatisfiedBy: bn.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: Er.Singleton, serviceIdentifier: this.#r, type: nt.ConstantValue, value: e };
|
|
2444
2444
|
return this.#e(r), new In(r);
|
|
2445
2445
|
}
|
|
2446
2446
|
toDynamicValue(e) {
|
|
@@ -2452,11 +2452,11 @@ class Zh {
|
|
|
2452
2452
|
return this.#e(i), new ra(i);
|
|
2453
2453
|
}
|
|
2454
2454
|
toFactory(e) {
|
|
2455
|
-
const r = { cache: { isRight: !1, value: void 0 }, factory: e, id: pn(), isSatisfiedBy: bn.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope:
|
|
2455
|
+
const r = { cache: { isRight: !1, value: void 0 }, factory: e, id: pn(), isSatisfiedBy: bn.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: Er.Singleton, serviceIdentifier: this.#r, type: nt.Factory };
|
|
2456
2456
|
return this.#e(r), new In(r);
|
|
2457
2457
|
}
|
|
2458
2458
|
toProvider(e) {
|
|
2459
|
-
const r = { cache: { isRight: !1, value: void 0 }, id: pn(), isSatisfiedBy: bn.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, provider: e, scope:
|
|
2459
|
+
const r = { cache: { isRight: !1, value: void 0 }, id: pn(), isSatisfiedBy: bn.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, provider: e, scope: Er.Singleton, serviceIdentifier: this.#r, type: nt.Provider };
|
|
2460
2460
|
return this.#e(r), new In(r);
|
|
2461
2461
|
}
|
|
2462
2462
|
toService(e) {
|
|
@@ -2483,7 +2483,7 @@ class Jh {
|
|
|
2483
2483
|
return this.#e.onActivation = e, new cu(this.#e);
|
|
2484
2484
|
}
|
|
2485
2485
|
onDeactivation(e) {
|
|
2486
|
-
if (this.#e.onDeactivation = e, this.#e.scope !==
|
|
2486
|
+
if (this.#e.onDeactivation = e, this.#e.scope !== Er.Singleton) throw new Ur(Mr.invalidOperation, `Binding for service "${Yt(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);
|
|
2487
2487
|
return new cu(this.#e);
|
|
2488
2488
|
}
|
|
2489
2489
|
}
|
|
@@ -2899,7 +2899,7 @@ class Ob {
|
|
|
2899
2899
|
this.#t.push({ activationService: this.#e.activationService.clone(), bindingService: this.#e.bindingService.clone(), deactivationService: this.#e.deactivationService.clone() });
|
|
2900
2900
|
}
|
|
2901
2901
|
}
|
|
2902
|
-
const Db =
|
|
2902
|
+
const Db = Er.Transient;
|
|
2903
2903
|
class ys {
|
|
2904
2904
|
#e;
|
|
2905
2905
|
#t;
|
|
@@ -3204,7 +3204,7 @@ const Kb = (t) => {
|
|
|
3204
3204
|
function gn(t) {
|
|
3205
3205
|
return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3206
3206
|
}
|
|
3207
|
-
function
|
|
3207
|
+
function wr(t, e, r) {
|
|
3208
3208
|
const i = new t._zod.constr(e ?? t._zod.def);
|
|
3209
3209
|
return (!e || r?.parent) && (i._zod.parent = t), i;
|
|
3210
3210
|
}
|
|
@@ -3276,7 +3276,7 @@ function og(t, e) {
|
|
|
3276
3276
|
},
|
|
3277
3277
|
checks: []
|
|
3278
3278
|
});
|
|
3279
|
-
return
|
|
3279
|
+
return wr(t, i);
|
|
3280
3280
|
}
|
|
3281
3281
|
function sg(t, e) {
|
|
3282
3282
|
const r = t._zod.def, i = tn(t._zod.def, {
|
|
@@ -3291,7 +3291,7 @@ function sg(t, e) {
|
|
|
3291
3291
|
},
|
|
3292
3292
|
checks: []
|
|
3293
3293
|
});
|
|
3294
|
-
return
|
|
3294
|
+
return wr(t, i);
|
|
3295
3295
|
}
|
|
3296
3296
|
function ag(t, e) {
|
|
3297
3297
|
if (!Pn(e))
|
|
@@ -3306,7 +3306,7 @@ function ag(t, e) {
|
|
|
3306
3306
|
},
|
|
3307
3307
|
checks: []
|
|
3308
3308
|
});
|
|
3309
|
-
return
|
|
3309
|
+
return wr(t, n);
|
|
3310
3310
|
}
|
|
3311
3311
|
function ug(t, e) {
|
|
3312
3312
|
if (!Pn(e))
|
|
@@ -3319,7 +3319,7 @@ function ug(t, e) {
|
|
|
3319
3319
|
},
|
|
3320
3320
|
checks: t._zod.def.checks
|
|
3321
3321
|
};
|
|
3322
|
-
return
|
|
3322
|
+
return wr(t, r);
|
|
3323
3323
|
}
|
|
3324
3324
|
function cg(t, e) {
|
|
3325
3325
|
const r = tn(t._zod.def, {
|
|
@@ -3333,7 +3333,7 @@ function cg(t, e) {
|
|
|
3333
3333
|
checks: []
|
|
3334
3334
|
// delete existing checks
|
|
3335
3335
|
});
|
|
3336
|
-
return
|
|
3336
|
+
return wr(t, r);
|
|
3337
3337
|
}
|
|
3338
3338
|
function lg(t, e, r) {
|
|
3339
3339
|
const i = tn(e._zod.def, {
|
|
@@ -3358,7 +3358,7 @@ function lg(t, e, r) {
|
|
|
3358
3358
|
},
|
|
3359
3359
|
checks: []
|
|
3360
3360
|
});
|
|
3361
|
-
return
|
|
3361
|
+
return wr(e, i);
|
|
3362
3362
|
}
|
|
3363
3363
|
function pg(t, e, r) {
|
|
3364
3364
|
const i = tn(e._zod.def, {
|
|
@@ -3383,7 +3383,7 @@ function pg(t, e, r) {
|
|
|
3383
3383
|
},
|
|
3384
3384
|
checks: []
|
|
3385
3385
|
});
|
|
3386
|
-
return
|
|
3386
|
+
return wr(e, i);
|
|
3387
3387
|
}
|
|
3388
3388
|
function wn(t, e = 0) {
|
|
3389
3389
|
if (t.aborted === !0)
|
|
@@ -3482,7 +3482,7 @@ const hg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3482
3482
|
captureStackTrace: Cc,
|
|
3483
3483
|
cleanEnum: Zb,
|
|
3484
3484
|
cleanRegex: bs,
|
|
3485
|
-
clone:
|
|
3485
|
+
clone: wr,
|
|
3486
3486
|
cloneDef: jb,
|
|
3487
3487
|
createTransparentProxy: Wb,
|
|
3488
3488
|
defineLazy: et,
|
|
@@ -11406,7 +11406,7 @@ const V1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
11406
11406
|
_uuidv7: rl,
|
|
11407
11407
|
_void: l_,
|
|
11408
11408
|
_xid: ul,
|
|
11409
|
-
clone:
|
|
11409
|
+
clone: wr,
|
|
11410
11410
|
config: ir,
|
|
11411
11411
|
decode: rx,
|
|
11412
11412
|
decodeAsync: ix,
|
|
@@ -11506,7 +11506,7 @@ const q1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
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) =>
|
|
11509
|
+
})), t.clone = (r, i) => wr(t, r, i), t.brand = () => t, t.register = (r, i) => (r.add(t, i), t), t.parse = (r, i) => N_(t, r, i, { callee: t.parse }), t.safeParse = (r, i) => O_(t, r, i), t.parseAsync = async (r, i) => P_(t, r, i, { callee: t.parseAsync }), t.safeParseAsync = async (r, i) => D_(t, r, i), t.spa = t.safeParseAsync, t.encode = (r, i) => B_(t, r, i), t.decode = (r, i) => U_(t, r, i), t.encodeAsync = async (r, i) => M_(t, r, i), t.decodeAsync = async (r, i) => L_(t, r, i), t.safeEncode = (r, i) => z_(t, r, i), t.safeDecode = (r, i) => F_(t, r, i), t.safeEncodeAsync = async (r, i) => j_(t, r, i), t.safeDecodeAsync = async (r, i) => V_(t, r, i), t.refine = (r, i) => t.check(Ev(r, i)), t.superRefine = (r) => t.check(wv(r)), t.overwrite = (r) => t.check(zn(r)), t.optional = () => Go(t), t.nullable = () => qo(t), t.nullish = () => Go(qo(t)), t.nonoptional = (r) => fv(t, r), t.array = () => sr(t), t.or = (r) => or([t, r]), t.and = (r) => ev(t, r), t.transform = (r) => Ho(t, rp(r)), t.default = (r) => lv(t, r), t.prefault = (r) => dv(t, r), t.catch = (r) => mv(t, r), t.pipe = (r) => Ho(t, r), t.readonly = () => yv(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", {
|
|
@@ -11873,7 +11873,7 @@ function _r(t, e, r) {
|
|
|
11873
11873
|
});
|
|
11874
11874
|
}
|
|
11875
11875
|
function OE(t, e, r) {
|
|
11876
|
-
const i =
|
|
11876
|
+
const i = wr(t);
|
|
11877
11877
|
return i._zod.values = void 0, new tp({
|
|
11878
11878
|
type: "record",
|
|
11879
11879
|
keyType: i,
|
|
@@ -12327,7 +12327,7 @@ const st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
12327
12327
|
check: qE,
|
|
12328
12328
|
cidrv4: cE,
|
|
12329
12329
|
cidrv6: lE,
|
|
12330
|
-
clone:
|
|
12330
|
+
clone: wr,
|
|
12331
12331
|
codec: jE,
|
|
12332
12332
|
coerce: rw,
|
|
12333
12333
|
config: ir,
|
|
@@ -12493,7 +12493,7 @@ let Ko = class {
|
|
|
12493
12493
|
this.runtimeConfig = Cv.parse(t), this.appConfig = sw.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.2.
|
|
12496
|
+
VITE_AGENT_CLI_DOCKER_IMAGE: "agiflowai/agent-cli:v0.2.4",
|
|
12497
12497
|
VITE_AGENT_CLI_DOCKER_NETWORK: "",
|
|
12498
12498
|
VITE_SAVE_RAW: "",
|
|
12499
12499
|
VITE_MULTIPLEX_SOCKET_PATH: process.env.VITE_MULTIPLEX_SOCKET_PATH
|
|
@@ -13549,13 +13549,13 @@ let Su = class {
|
|
|
13549
13549
|
checkHostAuth(t) {
|
|
13550
13550
|
if (t !== ft.CLAUDE_CODE)
|
|
13551
13551
|
return !1;
|
|
13552
|
-
const e =
|
|
13552
|
+
const e = Nr.homedir(), r = Nr.platform() === "darwin";
|
|
13553
13553
|
try {
|
|
13554
13554
|
if (r) {
|
|
13555
|
-
const i =
|
|
13555
|
+
const i = ze.join(e, ".claude_tmp.json"), n = ze.join(e, ".claude_tmp");
|
|
13556
13556
|
return Te.existsSync(i) || Te.existsSync(n);
|
|
13557
13557
|
} else {
|
|
13558
|
-
const i =
|
|
13558
|
+
const i = ze.join(e, ".claude.json"), n = ze.join(e, ".claude");
|
|
13559
13559
|
return Te.existsSync(i) || Te.existsSync(n);
|
|
13560
13560
|
}
|
|
13561
13561
|
} catch (i) {
|
|
@@ -13569,13 +13569,13 @@ let Su = class {
|
|
|
13569
13569
|
checkDockerAuth(t) {
|
|
13570
13570
|
if (t !== ft.CLAUDE_CODE || !this.isDockerAvailableSync())
|
|
13571
13571
|
return !1;
|
|
13572
|
-
const e =
|
|
13572
|
+
const e = Nr.homedir(), r = Nr.platform() === "darwin";
|
|
13573
13573
|
try {
|
|
13574
13574
|
if (r) {
|
|
13575
|
-
const i =
|
|
13575
|
+
const i = ze.join(e, ".claude_tmp.json"), n = ze.join(e, ".claude_tmp");
|
|
13576
13576
|
return Te.existsSync(i) || Te.existsSync(n);
|
|
13577
13577
|
} else {
|
|
13578
|
-
const i =
|
|
13578
|
+
const i = ze.join(e, ".claude.json"), n = ze.join(e, ".claude");
|
|
13579
13579
|
return Te.existsSync(i) || Te.existsSync(n);
|
|
13580
13580
|
}
|
|
13581
13581
|
} catch (i) {
|
|
@@ -14393,7 +14393,7 @@ class tt {
|
|
|
14393
14393
|
/**
|
|
14394
14394
|
* Default Agiflow configuration directory
|
|
14395
14395
|
*/
|
|
14396
|
-
static AGIFLOW_DIR =
|
|
14396
|
+
static AGIFLOW_DIR = $r.join(Hs(), ".agiflow");
|
|
14397
14397
|
/**
|
|
14398
14398
|
* Ensure a directory exists, creating it if necessary
|
|
14399
14399
|
*/
|
|
@@ -14421,7 +14421,7 @@ class tt {
|
|
|
14421
14421
|
* Write an object to a JSON file
|
|
14422
14422
|
*/
|
|
14423
14423
|
static async writeJson(e, r, i) {
|
|
14424
|
-
await sn.mkdir(
|
|
14424
|
+
await sn.mkdir($r.dirname(e), { recursive: !0 });
|
|
14425
14425
|
const n = JSON.stringify(r, null, i?.spaces ?? 2);
|
|
14426
14426
|
await sn.writeFile(e, n, "utf-8");
|
|
14427
14427
|
}
|
|
@@ -14447,7 +14447,7 @@ class tt {
|
|
|
14447
14447
|
* Resolve a path relative to the current working directory
|
|
14448
14448
|
*/
|
|
14449
14449
|
static resolvePath(...e) {
|
|
14450
|
-
return
|
|
14450
|
+
return $r.resolve(process.cwd(), ...e);
|
|
14451
14451
|
}
|
|
14452
14452
|
/**
|
|
14453
14453
|
* Get files in a directory matching a pattern
|
|
@@ -14462,7 +14462,7 @@ class tt {
|
|
|
14462
14462
|
* @returns Resolved absolute path
|
|
14463
14463
|
*/
|
|
14464
14464
|
static getAbsolutePath(e) {
|
|
14465
|
-
return e ? e.startsWith("~/") ?
|
|
14465
|
+
return e ? e.startsWith("~/") ? $r.join(Hs(), e.slice(2)) : e === "~" ? Hs() : $r.isAbsolute(e) ? e : $r.resolve(process.cwd(), e) : process.cwd();
|
|
14466
14466
|
}
|
|
14467
14467
|
}
|
|
14468
14468
|
const oC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -14470,7 +14470,7 @@ const oC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
14470
14470
|
FileSystemUtils: tt
|
|
14471
14471
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
14472
14472
|
function NN(t = !0, e) {
|
|
14473
|
-
const i =
|
|
14473
|
+
const i = Ar.hostname().replace(/[^a-zA-Z0-9-]/g, "-");
|
|
14474
14474
|
if (t) {
|
|
14475
14475
|
const n = e || process.cwd(), o = SS.createHash("sha256").update(n).digest("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "").slice(0, 8);
|
|
14476
14476
|
return `claude-daemon-${i}-${o}`;
|
|
@@ -14479,13 +14479,13 @@ function NN(t = !0, e) {
|
|
|
14479
14479
|
}
|
|
14480
14480
|
function sC() {
|
|
14481
14481
|
return {
|
|
14482
|
-
hostname:
|
|
14483
|
-
platform:
|
|
14484
|
-
arch:
|
|
14485
|
-
release:
|
|
14486
|
-
cpus:
|
|
14487
|
-
totalMemory:
|
|
14488
|
-
type:
|
|
14482
|
+
hostname: Ar.hostname(),
|
|
14483
|
+
platform: Ar.platform(),
|
|
14484
|
+
arch: Ar.arch(),
|
|
14485
|
+
release: Ar.release(),
|
|
14486
|
+
cpus: Ar.cpus().length,
|
|
14487
|
+
totalMemory: Ar.totalmem(),
|
|
14488
|
+
type: Ar.type()
|
|
14489
14489
|
};
|
|
14490
14490
|
}
|
|
14491
14491
|
function PN(t) {
|
|
@@ -14512,7 +14512,7 @@ function aC(t, e = 3e5, r) {
|
|
|
14512
14512
|
return { start: o, stop: s };
|
|
14513
14513
|
}
|
|
14514
14514
|
class uC {
|
|
14515
|
-
static SESSIONS_FILE =
|
|
14515
|
+
static SESSIONS_FILE = ze.join(tt.AGIFLOW_DIR, "sessions.json");
|
|
14516
14516
|
/**
|
|
14517
14517
|
* Get model settings for a specific session
|
|
14518
14518
|
*/
|
|
@@ -15324,7 +15324,7 @@ var wC = Object.getOwnPropertyDescriptor, CC = (t, e, r, i) => {
|
|
|
15324
15324
|
(s = t[o]) && (n = s(n) || n);
|
|
15325
15325
|
return n;
|
|
15326
15326
|
};
|
|
15327
|
-
const IC = xh(import.meta.url), ia =
|
|
15327
|
+
const IC = xh(import.meta.url), ia = ze.dirname(IC);
|
|
15328
15328
|
let wu = class {
|
|
15329
15329
|
distFolderCache = null;
|
|
15330
15330
|
hookFileCache = /* @__PURE__ */ new Map();
|
|
@@ -15336,13 +15336,13 @@ let wu = class {
|
|
|
15336
15336
|
if (this.distFolderCache !== null)
|
|
15337
15337
|
return this.distFolderCache;
|
|
15338
15338
|
const t = [
|
|
15339
|
-
|
|
15339
|
+
ze.join(ia, "..", "..", "dist"),
|
|
15340
15340
|
// Development structure (src/services/core -> dist)
|
|
15341
|
-
|
|
15341
|
+
ze.join(ia, "..", "dist"),
|
|
15342
15342
|
// One level up (services -> dist)
|
|
15343
|
-
|
|
15343
|
+
ze.join(ia, "dist"),
|
|
15344
15344
|
// Same level
|
|
15345
|
-
|
|
15345
|
+
ze.join(process.cwd(), "dist")
|
|
15346
15346
|
// From current working directory
|
|
15347
15347
|
];
|
|
15348
15348
|
for (const e of t)
|
|
@@ -15363,7 +15363,7 @@ let wu = class {
|
|
|
15363
15363
|
const e = this.findDistFolder();
|
|
15364
15364
|
if (!e)
|
|
15365
15365
|
return this.hookFileCache.set(t, null), null;
|
|
15366
|
-
const r =
|
|
15366
|
+
const r = ze.join(e, t);
|
|
15367
15367
|
return Te.existsSync(r) ? (this.hookFileCache.set(t, r), r) : (this.hookFileCache.set(t, null), null);
|
|
15368
15368
|
}
|
|
15369
15369
|
};
|
|
@@ -15388,9 +15388,9 @@ let At = class {
|
|
|
15388
15388
|
* Uses pino-roll for automatic size-based rotation (max 10MB per file)
|
|
15389
15389
|
*/
|
|
15390
15390
|
createMultiTransportLogger(t) {
|
|
15391
|
-
const e =
|
|
15392
|
-
|
|
15393
|
-
const r =
|
|
15391
|
+
const e = $r.join(Ar.tmpdir(), "agiflow-agents", "logs", `session-${process.pid}`);
|
|
15392
|
+
Rr.existsSync(e) || Rr.mkdirSync(e, { recursive: !0 });
|
|
15393
|
+
const r = $r.join(e, "app.log"), i = uo({
|
|
15394
15394
|
level: t,
|
|
15395
15395
|
formatters: {
|
|
15396
15396
|
level: (n) => ({ level: n })
|
|
@@ -15430,8 +15430,8 @@ let At = class {
|
|
|
15430
15430
|
* Get the log file path if file transport is configured
|
|
15431
15431
|
*/
|
|
15432
15432
|
getLogFilePath() {
|
|
15433
|
-
const t =
|
|
15434
|
-
return
|
|
15433
|
+
const t = $r.join(Ar.tmpdir(), "agiflow-agents", "logs", `session-${process.pid}`);
|
|
15434
|
+
return $r.join(t, "app.log");
|
|
15435
15435
|
}
|
|
15436
15436
|
/**
|
|
15437
15437
|
* Log an informational message
|
|
@@ -16013,7 +16013,7 @@ let Un = class {
|
|
|
16013
16013
|
const t = this.config.unixSocketPath;
|
|
16014
16014
|
this.actualSocketPath = t;
|
|
16015
16015
|
const e = fc.dirname(t);
|
|
16016
|
-
|
|
16016
|
+
Rr.existsSync(e) || Rr.mkdirSync(e, { recursive: !0 }), Rr.existsSync(t) && Rr.unlinkSync(t), this.wsServer = new Po({ path: t }), this.logger.info(`MessageMultiplexBroker WebSocket started on Unix socket ${t}`);
|
|
16017
16017
|
} else {
|
|
16018
16018
|
const t = this.config.wsPort === 0 || this.config.wsPort === null ? await qC() : this.config.wsPort;
|
|
16019
16019
|
this.actualPort = t, this.actualHttpPort = t, this.httpServer = kS(async (e, r) => {
|
|
@@ -16057,7 +16057,7 @@ let Un = class {
|
|
|
16057
16057
|
t.close();
|
|
16058
16058
|
this.remoteConnections.clear(), this.wsServer && await new Promise((t) => {
|
|
16059
16059
|
this.wsServer.close(() => {
|
|
16060
|
-
this.actualSocketPath &&
|
|
16060
|
+
this.actualSocketPath && Rr.existsSync(this.actualSocketPath) && Rr.unlinkSync(this.actualSocketPath), t();
|
|
16061
16061
|
});
|
|
16062
16062
|
}), this.httpServer && await new Promise((t) => {
|
|
16063
16063
|
this.httpServer.close(() => {
|
|
@@ -19393,7 +19393,7 @@ let Bu = class {
|
|
|
19393
19393
|
const t = this.agentConfigService.getStoredAgentSessionId();
|
|
19394
19394
|
if (t)
|
|
19395
19395
|
try {
|
|
19396
|
-
const { createGetAgentStatus: e } = await Promise.resolve().then(() => pT), { createSendAgentStatus: r } = await Promise.resolve().then(() => fI), { AGENT_STATUS: i } = await import("./index-
|
|
19396
|
+
const { createGetAgentStatus: e } = await Promise.resolve().then(() => pT), { createSendAgentStatus: r } = await Promise.resolve().then(() => fI), { AGENT_STATUS: i } = await import("./index-qyLMfqDP.mjs"), n = e(t, t), a = (await this.multiplexClient.request(n))?.payload?.result || i.IDLE;
|
|
19397
19397
|
await this.multiplexClient.publish(
|
|
19398
19398
|
r(t, {
|
|
19399
19399
|
agentType: this.agentConfigService.getAgentType() ?? void 0,
|
|
@@ -21305,7 +21305,7 @@ let ts = class {
|
|
|
21305
21305
|
* Middleware layers wrap around this with setup (BEFORE) and cleanup (AFTER)
|
|
21306
21306
|
*/
|
|
21307
21307
|
async launchPty(t) {
|
|
21308
|
-
const { AGENT_STATUS: e } = await import("./index-
|
|
21308
|
+
const { AGENT_STATUS: e } = await import("./index-qyLMfqDP.mjs"), r = t.metadata.agentCommand, i = t.metadata.agentArgs;
|
|
21309
21309
|
if (!r)
|
|
21310
21310
|
throw new Error("launchPty requires metadata.agentCommand to be set by middleware");
|
|
21311
21311
|
const n = await this.getAgentEnvironmentVariablesForContext(t);
|
|
@@ -21499,14 +21499,14 @@ class cy {
|
|
|
21499
21499
|
* Write JSON file to temporary directory
|
|
21500
21500
|
*/
|
|
21501
21501
|
async writeTempJsonFile(e, r) {
|
|
21502
|
-
const i =
|
|
21502
|
+
const i = ze.join(Nr.tmpdir(), e);
|
|
21503
21503
|
return await To.writeFile(i, JSON.stringify(r, null, 2), "utf8"), this.logger.info(`Created temp file: ${i}`), i;
|
|
21504
21504
|
}
|
|
21505
21505
|
/**
|
|
21506
21506
|
* Write JSON file synchronously to temporary directory
|
|
21507
21507
|
*/
|
|
21508
21508
|
writeTempJsonFileSync(e, r) {
|
|
21509
|
-
const i =
|
|
21509
|
+
const i = ze.join(Nr.tmpdir(), e);
|
|
21510
21510
|
return Te.writeFileSync(i, JSON.stringify(r, null, 2), "utf8"), this.logger.info(`Created temp file: ${i}`), i;
|
|
21511
21511
|
}
|
|
21512
21512
|
/**
|
|
@@ -21523,13 +21523,13 @@ class cy {
|
|
|
21523
21523
|
* Find git repository root starting from directory
|
|
21524
21524
|
*/
|
|
21525
21525
|
async findGitRepoRoot(e) {
|
|
21526
|
-
let r =
|
|
21527
|
-
const i =
|
|
21526
|
+
let r = ze.resolve(e);
|
|
21527
|
+
const i = ze.parse(r).root;
|
|
21528
21528
|
for (; r !== i; ) {
|
|
21529
|
-
const n =
|
|
21529
|
+
const n = ze.join(r, ".git");
|
|
21530
21530
|
if (Te.existsSync(n))
|
|
21531
21531
|
return r;
|
|
21532
|
-
r =
|
|
21532
|
+
r = ze.dirname(r);
|
|
21533
21533
|
}
|
|
21534
21534
|
return null;
|
|
21535
21535
|
}
|
|
@@ -21537,7 +21537,7 @@ class cy {
|
|
|
21537
21537
|
* Ensure .gitignore contains the specified entry
|
|
21538
21538
|
*/
|
|
21539
21539
|
async ensureGitignoreEntry(e, r) {
|
|
21540
|
-
const i =
|
|
21540
|
+
const i = ze.join(e, ".gitignore");
|
|
21541
21541
|
try {
|
|
21542
21542
|
let n = "";
|
|
21543
21543
|
if (Te.existsSync(i) && (n = Te.readFileSync(i, "utf8")), n.split(`
|
|
@@ -21604,7 +21604,7 @@ class hT extends cy {
|
|
|
21604
21604
|
r ? (n = await this.createTempSettingsFile(e), n && (e.metadata.tempSettingsPath = n, e.registerTempFile(n))) : await this.addPostToolUseHook(e);
|
|
21605
21605
|
const o = this.writeMcpConfigFile(i, e.agentSessionId);
|
|
21606
21606
|
o && (e.metadata.mcpConfigPath = o, e.registerTempFile(o));
|
|
21607
|
-
const s =
|
|
21607
|
+
const s = ze.join(e.workingDir, ".mcp.json"), a = this.writeProjectMcpConfigFile(
|
|
21608
21608
|
s,
|
|
21609
21609
|
i,
|
|
21610
21610
|
e.agentSessionId
|
|
@@ -21682,69 +21682,19 @@ class hT extends cy {
|
|
|
21682
21682
|
}
|
|
21683
21683
|
/**
|
|
21684
21684
|
* Write MCP server configuration file
|
|
21685
|
-
* Handles special processing for one-mcp servers with remote config
|
|
21686
21685
|
*/
|
|
21687
21686
|
writeMcpConfigFile(e, r) {
|
|
21688
21687
|
if (e)
|
|
21689
21688
|
try {
|
|
21690
21689
|
const i = this.normalizeMcpServers(e);
|
|
21691
21690
|
if (Object.keys(i).length === 0) return;
|
|
21692
|
-
const
|
|
21693
|
-
return this.writeTempJsonFileSync(
|
|
21691
|
+
const n = { mcpServers: i }, o = `claude-mcps-${r}.json`;
|
|
21692
|
+
return this.writeTempJsonFileSync(o, n);
|
|
21694
21693
|
} catch (i) {
|
|
21695
21694
|
this.logger.warn("Failed to write MCP config file", i);
|
|
21696
21695
|
return;
|
|
21697
21696
|
}
|
|
21698
21697
|
}
|
|
21699
|
-
/**
|
|
21700
|
-
* Process MCP servers, creating YAML configs for one-mcp servers with remote config
|
|
21701
|
-
*/
|
|
21702
|
-
processOneMcpServers(e, r) {
|
|
21703
|
-
const i = {};
|
|
21704
|
-
for (const [n, o] of Object.entries(e))
|
|
21705
|
-
this.isOneMcpWithRemoteConfig(o) ? i[n] = this.createOneMcpConfigWithYaml(o, r, n) : i[n] = o;
|
|
21706
|
-
return i;
|
|
21707
|
-
}
|
|
21708
|
-
/**
|
|
21709
|
-
* Check if a server config is one-mcp with AGIFLOW_MCP_CONFIG_URL
|
|
21710
|
-
*/
|
|
21711
|
-
isOneMcpWithRemoteConfig(e) {
|
|
21712
|
-
if (!e.command || !e.args) return !1;
|
|
21713
|
-
const r = e.args.includes("@agiflowai/one-mcp") || e.args.some((n) => n.includes("one-mcp")), i = e.env?.AGIFLOW_MCP_CONFIG_URL;
|
|
21714
|
-
return r && i;
|
|
21715
|
-
}
|
|
21716
|
-
/**
|
|
21717
|
-
* Create one-mcp config with YAML file and updated args
|
|
21718
|
-
*/
|
|
21719
|
-
createOneMcpConfigWithYaml(e, r, i) {
|
|
21720
|
-
const n = e.env.AGIFLOW_MCP_CONFIG_URL, o = e.env.AGIFLOW_MCP_API_KEY || "${AGIFLOW_MCP_API_KEY}", s = this.generateOneMcpYamlConfig(n, o), a = `one-mcp-config-${i}-${r}.yaml`, u = Le.join(Er.tmpdir(), a);
|
|
21721
|
-
Te.writeFileSync(u, s, "utf8"), this.logger.info(`Created one-mcp YAML config: ${u}`);
|
|
21722
|
-
const f = [...e.args || [], "--config", u], _ = {};
|
|
21723
|
-
if (e.env)
|
|
21724
|
-
for (const [m, d] of Object.entries(e.env))
|
|
21725
|
-
m !== "AGIFLOW_MCP_CONFIG_URL" && (_[m] = d);
|
|
21726
|
-
return {
|
|
21727
|
-
...e,
|
|
21728
|
-
args: f,
|
|
21729
|
-
env: Object.keys(_).length > 0 ? _ : void 0
|
|
21730
|
-
};
|
|
21731
|
-
}
|
|
21732
|
-
/**
|
|
21733
|
-
* Generate YAML content for one-mcp remote config
|
|
21734
|
-
*/
|
|
21735
|
-
generateOneMcpYamlConfig(e, r) {
|
|
21736
|
-
return `# Auto-generated one-mcp config for Agiflow remote MCP servers
|
|
21737
|
-
mcpServers: {}
|
|
21738
|
-
remoteConfigs:
|
|
21739
|
-
- url: "${e}"
|
|
21740
|
-
headers:
|
|
21741
|
-
x-api-key: "${r}"
|
|
21742
|
-
security:
|
|
21743
|
-
allowPrivateIPs: true
|
|
21744
|
-
enforceHttps: false
|
|
21745
|
-
mergeStrategy: remote-priority
|
|
21746
|
-
`;
|
|
21747
|
-
}
|
|
21748
21698
|
/**
|
|
21749
21699
|
* Write merged project MCP config (removes duplicates with agent config)
|
|
21750
21700
|
*/
|
|
@@ -21806,7 +21756,7 @@ remoteConfigs:
|
|
|
21806
21756
|
* Add PostToolUse hook to local settings file (Legacy Claude Code < 2.0)
|
|
21807
21757
|
*/
|
|
21808
21758
|
async addPostToolUseHook(e) {
|
|
21809
|
-
const r =
|
|
21759
|
+
const r = ze.join(e.workingDir, ".claude", "settings.local.json"), i = ze.dirname(r);
|
|
21810
21760
|
try {
|
|
21811
21761
|
await To.mkdir(i, { recursive: !0 });
|
|
21812
21762
|
let n = {};
|
|
@@ -21861,9 +21811,9 @@ class gT extends cy {
|
|
|
21861
21811
|
try {
|
|
21862
21812
|
const n = this.convertToGeminiFormat(e);
|
|
21863
21813
|
if (Object.keys(n).length === 0) return null;
|
|
21864
|
-
const o = await this.findGitRepoRoot(r), s = o ||
|
|
21814
|
+
const o = await this.findGitRepoRoot(r), s = o || Nr.homedir();
|
|
21865
21815
|
this.logger.debug(`Using base directory for Gemini extension: ${s}`);
|
|
21866
|
-
const a =
|
|
21816
|
+
const a = ze.join(s, ".gemini", "extensions");
|
|
21867
21817
|
Te.existsSync(a) || (Te.mkdirSync(a, { recursive: !0 }), this.logger.debug(`Created directory: ${a}`));
|
|
21868
21818
|
const u = {
|
|
21869
21819
|
name: "agiflow-mcps",
|
|
@@ -21871,7 +21821,7 @@ class gT extends cy {
|
|
|
21871
21821
|
mcpServers: n,
|
|
21872
21822
|
contextFileName: "GEMINI.md",
|
|
21873
21823
|
excludeTools: ["run_shell_command"]
|
|
21874
|
-
}, f =
|
|
21824
|
+
}, f = ze.join(a, "agiflow-extension.json");
|
|
21875
21825
|
return Te.writeFileSync(f, JSON.stringify(u, null, 2), "utf8"), this.logger.info(`Gemini extension config written to: ${f}`), o && await this.ensureGitignoreEntry(o, ".gemini/extensions/agiflow-extension.json"), f;
|
|
21876
21826
|
} catch (n) {
|
|
21877
21827
|
return this.logger.warn("Failed to write Gemini extension config file", n), null;
|
|
@@ -21933,13 +21883,13 @@ class tr {
|
|
|
21933
21883
|
// Getters to compute paths at runtime (not at module load time)
|
|
21934
21884
|
// This ensures os.homedir() returns the correct value inside Docker containers
|
|
21935
21885
|
static get credentialsDir() {
|
|
21936
|
-
return
|
|
21886
|
+
return ze.join(Nr.homedir(), ".claude_credentials");
|
|
21937
21887
|
}
|
|
21938
21888
|
static get sourceFile() {
|
|
21939
|
-
return
|
|
21889
|
+
return ze.join(tr.credentialsDir, ".claude.json");
|
|
21940
21890
|
}
|
|
21941
21891
|
static get targetFile() {
|
|
21942
|
-
return
|
|
21892
|
+
return ze.join(Nr.homedir(), ".claude.json");
|
|
21943
21893
|
}
|
|
21944
21894
|
/**
|
|
21945
21895
|
* Before: Copy credentials from mounted folder to home directory
|
|
@@ -22506,7 +22456,7 @@ class ET extends dy {
|
|
|
22506
22456
|
if (!e.length) return;
|
|
22507
22457
|
const i = (/* @__PURE__ */ new Date()).toISOString();
|
|
22508
22458
|
try {
|
|
22509
|
-
const { createSelectComponent: n, createToolInvocationInput: o } = await import("./index-
|
|
22459
|
+
const { createSelectComponent: n, createToolInvocationInput: o } = await import("./index-D-edidE4.mjs"), { createRequestApproval: s } = await Promise.resolve().then(() => Bi), a = e.map((_) => ({ label: _.text, value: _.number, selected: !!_.selected })), u = n(a), c = o(!1, u), f = s(r.agentSessionId, {
|
|
22510
22460
|
toolName: "selectOption",
|
|
22511
22461
|
toolArgs: { timestamp: i, options: a },
|
|
22512
22462
|
input: c
|
|
@@ -22909,7 +22859,7 @@ let rs = class extends ts {
|
|
|
22909
22859
|
this.logger.info(`Sending autonomous prompt: ${o}`), this.sendInputToPty(o), setTimeout(() => {
|
|
22910
22860
|
this.sendInputToPty("\r");
|
|
22911
22861
|
}, 50);
|
|
22912
|
-
},
|
|
22862
|
+
}, 15e3));
|
|
22913
22863
|
}
|
|
22914
22864
|
}
|
|
22915
22865
|
/**
|
|
@@ -22940,7 +22890,7 @@ let rs = class extends ts {
|
|
|
22940
22890
|
*/
|
|
22941
22891
|
writeSessionSettings(t, e, r, i, n) {
|
|
22942
22892
|
try {
|
|
22943
|
-
const o =
|
|
22893
|
+
const o = ze.join(Nr.homedir(), ".agiflow"), s = ze.join(o, "sessions.json");
|
|
22944
22894
|
Te.existsSync(o) || Te.mkdirSync(o, { recursive: !0 });
|
|
22945
22895
|
let a = {};
|
|
22946
22896
|
if (Te.existsSync(s))
|
|
@@ -23233,7 +23183,7 @@ let is = class {
|
|
|
23233
23183
|
const d = `agiflow_node_modules_${hs.createHash("md5").update(e.workingDir).digest("hex").substring(0, 12)}`;
|
|
23234
23184
|
n.push("-v", `${d}:/workspace/node_modules`), this.logger.debug(`Mounting node_modules as named volume: ${d} -> /workspace/node_modules`);
|
|
23235
23185
|
}
|
|
23236
|
-
const f =
|
|
23186
|
+
const f = ze.join(Nr.homedir(), ".agiflow");
|
|
23237
23187
|
if (Qt.existsSync(f) ? (n.push("-v", `${f}:/home/node/.agiflow:ro`), this.logger.debug(`Mounting credentials directory: ${f} -> /home/node/.agiflow`)) : this.logger.warn(`Credentials directory not found at: ${f}`), e.additionalVolumes && e.additionalVolumes.length > 0)
|
|
23238
23188
|
for (const m of e.additionalVolumes) {
|
|
23239
23189
|
let d;
|
|
@@ -25478,7 +25428,7 @@ let Hu = class {
|
|
|
25478
25428
|
const r = ["api-key.json", "credentials.json"];
|
|
25479
25429
|
let i = 0;
|
|
25480
25430
|
for (const n of r) {
|
|
25481
|
-
const o =
|
|
25431
|
+
const o = ze.join(tt.AGIFLOW_DIR, n);
|
|
25482
25432
|
await tt.exists(o) && (await tt.remove(o), i++, t.verbose && console.log(Qe.blue("ℹ"), `Removed: ${n}`));
|
|
25483
25433
|
}
|
|
25484
25434
|
i === 0 ? console.log(Qe.blue("ℹ"), "No credential files found. You are already logged out.") : console.log(Qe.green("✓"), `Successfully logged out and removed ${i} credential file(s)`);
|
|
@@ -28056,11 +28006,11 @@ let kr = class {
|
|
|
28056
28006
|
*/
|
|
28057
28007
|
readAuthFile() {
|
|
28058
28008
|
try {
|
|
28059
|
-
if (!
|
|
28009
|
+
if (!Rr.existsSync(kr.AUTH_FILE_PATH))
|
|
28060
28010
|
return this.logger?.warn("[CodexAuth] Auth file does not exist", {
|
|
28061
28011
|
path: kr.AUTH_FILE_PATH
|
|
28062
28012
|
}), null;
|
|
28063
|
-
const t =
|
|
28013
|
+
const t = Rr.readFileSync(kr.AUTH_FILE_PATH, "utf-8");
|
|
28064
28014
|
return JSON.parse(t);
|
|
28065
28015
|
} catch (t) {
|
|
28066
28016
|
return this.logger?.error("[CodexAuth] Failed to read auth file", t), null;
|
|
@@ -28140,13 +28090,13 @@ let kr = class {
|
|
|
28140
28090
|
this.logger?.error("[CodexAuth] Cannot save tokens - auth file not found");
|
|
28141
28091
|
return;
|
|
28142
28092
|
}
|
|
28143
|
-
e.tokens = t, e.last_refresh = (/* @__PURE__ */ new Date()).toISOString(),
|
|
28093
|
+
e.tokens = t, e.last_refresh = (/* @__PURE__ */ new Date()).toISOString(), Rr.writeFileSync(kr.AUTH_FILE_PATH, JSON.stringify(e, null, 2), "utf-8");
|
|
28144
28094
|
} catch (e) {
|
|
28145
28095
|
this.logger?.error("[CodexAuth] Failed to save tokens", e);
|
|
28146
28096
|
}
|
|
28147
28097
|
}
|
|
28148
28098
|
};
|
|
28149
|
-
fp(kr, "AUTH_FILE_PATH",
|
|
28099
|
+
fp(kr, "AUTH_FILE_PATH", $r.join(Ar.homedir(), ".codex", "auth.json"));
|
|
28150
28100
|
fp(kr, "TOKEN_REFRESH_URL", "https://auth.openai.com/oauth/token");
|
|
28151
28101
|
fp(kr, "CLIENT_ID", "app_EMoamEEZ73f0CkXaXp7hrann");
|
|
28152
28102
|
kr = u2([
|
|
@@ -31759,12 +31709,12 @@ function Ls() {
|
|
|
31759
31709
|
gt > 0 ? (j.lShiftTo(gt, se), ee.lShiftTo(gt, D)) : (j.copyTo(se), ee.copyTo(D));
|
|
31760
31710
|
var Zt = se.t, yr = se.data[Zt - 1];
|
|
31761
31711
|
if (yr != 0) {
|
|
31762
|
-
var cr = yr * (1 << this.F1) + (Zt > 1 ? se.data[Zt - 2] >> this.F2 : 0), Zr = this.FV / cr, io = (1 << this.F1) / cr,
|
|
31712
|
+
var cr = yr * (1 << this.F1) + (Zt > 1 ? se.data[Zt - 2] >> this.F2 : 0), Zr = this.FV / cr, io = (1 << this.F1) / cr, Ir = 1 << this.F2, Tr = D.t, oo = Tr - Zt, on = $ ?? i();
|
|
31763
31713
|
for (se.dlShiftTo(oo, on), D.compareTo(on) >= 0 && (D.data[D.t++] = 1, D.subTo(on, D)), r.ONE.dlShiftTo(Zt, on), on.subTo(se, se); se.t < Zt; ) se.data[se.t++] = 0;
|
|
31764
31714
|
for (; --oo >= 0; ) {
|
|
31765
|
-
var qs = D.data[--
|
|
31766
|
-
if ((D.data[
|
|
31767
|
-
for (se.dlShiftTo(oo, on), D.subTo(on, D); D.data[
|
|
31715
|
+
var qs = D.data[--Tr] == yr ? this.DM : Math.floor(D.data[Tr] * Zr + (D.data[Tr - 1] + Ir) * io);
|
|
31716
|
+
if ((D.data[Tr] += se.am(0, qs, D, oo, 0, Zt)) < qs)
|
|
31717
|
+
for (se.dlShiftTo(oo, on), D.subTo(on, D); D.data[Tr] < --qs; ) D.subTo(on, D);
|
|
31768
31718
|
}
|
|
31769
31719
|
$ != null && (D.drShiftTo(Zt, $), be != me && r.ZERO.subTo($, $)), D.t = Zt, D.clamp(), gt > 0 && D.rShiftTo(gt, D), be < 0 && r.ZERO.subTo(D, D);
|
|
31770
31720
|
}
|
|
@@ -32000,7 +31950,7 @@ function Ls() {
|
|
|
32000
31950
|
var D = r.ONE.shiftLeft(C);
|
|
32001
31951
|
return this.bitwiseTo(D, $, D), D;
|
|
32002
31952
|
}
|
|
32003
|
-
function
|
|
31953
|
+
function Le(C) {
|
|
32004
31954
|
return this.changeBit(C, It);
|
|
32005
31955
|
}
|
|
32006
31956
|
function Ge(C) {
|
|
@@ -32121,7 +32071,7 @@ function Ls() {
|
|
|
32121
32071
|
for (se.sqrTo(be[1], yr); me <= Zt; )
|
|
32122
32072
|
be[me] = i(), se.mulTo(yr, be[me - 2], be[me]), me += 2;
|
|
32123
32073
|
}
|
|
32124
|
-
var cr = C.t - 1, Zr, io = !0,
|
|
32074
|
+
var cr = C.t - 1, Zr, io = !0, Ir = i(), Tr;
|
|
32125
32075
|
for (D = g(C.data[cr]) - 1; cr >= 0; ) {
|
|
32126
32076
|
for (D >= gt ? Zr = C.data[cr] >> D - gt & Zt : (Zr = (C.data[cr] & (1 << D + 1) - 1) << gt - D, cr > 0 && (Zr |= C.data[cr - 1] >> this.DB + D - gt)), me = j; (Zr & 1) == 0; )
|
|
32127
32077
|
Zr >>= 1, --me;
|
|
@@ -32129,11 +32079,11 @@ function Ls() {
|
|
|
32129
32079
|
be[Zr].copyTo(ee), io = !1;
|
|
32130
32080
|
else {
|
|
32131
32081
|
for (; me > 1; )
|
|
32132
|
-
se.sqrTo(ee,
|
|
32133
|
-
me > 0 ? se.sqrTo(ee,
|
|
32082
|
+
se.sqrTo(ee, Ir), se.sqrTo(Ir, ee), me -= 2;
|
|
32083
|
+
me > 0 ? se.sqrTo(ee, Ir) : (Tr = ee, ee = Ir, Ir = Tr), se.mulTo(Ir, be[Zr], ee);
|
|
32134
32084
|
}
|
|
32135
32085
|
for (; cr >= 0 && (C.data[cr] & 1 << D) == 0; )
|
|
32136
|
-
se.sqrTo(ee,
|
|
32086
|
+
se.sqrTo(ee, Ir), Tr = ee, ee = Ir, Ir = Tr, --D < 0 && (D = this.DB - 1, --cr);
|
|
32137
32087
|
}
|
|
32138
32088
|
return se.revert(ee);
|
|
32139
32089
|
}
|
|
@@ -32173,18 +32123,18 @@ function Ls() {
|
|
|
32173
32123
|
else return me;
|
|
32174
32124
|
return me.signum() < 0 ? me.add(C) : me;
|
|
32175
32125
|
}
|
|
32176
|
-
var
|
|
32126
|
+
var Cr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509], aS = (1 << 26) / Cr[Cr.length - 1];
|
|
32177
32127
|
function uS(C) {
|
|
32178
32128
|
var $, D = this.abs();
|
|
32179
|
-
if (D.t == 1 && D.data[0] <=
|
|
32180
|
-
for ($ = 0; $ <
|
|
32181
|
-
if (D.data[0] ==
|
|
32129
|
+
if (D.t == 1 && D.data[0] <= Cr[Cr.length - 1]) {
|
|
32130
|
+
for ($ = 0; $ < Cr.length; ++$)
|
|
32131
|
+
if (D.data[0] == Cr[$]) return !0;
|
|
32182
32132
|
return !1;
|
|
32183
32133
|
}
|
|
32184
32134
|
if (D.isEven()) return !1;
|
|
32185
|
-
for ($ = 1; $ <
|
|
32186
|
-
for (var j =
|
|
32187
|
-
for (j = D.modInt(j); $ < ee; ) if (j %
|
|
32135
|
+
for ($ = 1; $ < Cr.length; ) {
|
|
32136
|
+
for (var j = Cr[$], ee = $ + 1; ee < Cr.length && j < aS; ) j *= Cr[ee++];
|
|
32137
|
+
for (j = D.modInt(j); $ < ee; ) if (j % Cr[$++] == 0) return !1;
|
|
32188
32138
|
}
|
|
32189
32139
|
return D.millerRabin(C);
|
|
32190
32140
|
}
|
|
@@ -32213,7 +32163,7 @@ function Ls() {
|
|
|
32213
32163
|
}
|
|
32214
32164
|
};
|
|
32215
32165
|
}
|
|
32216
|
-
return r.prototype.chunkSize = we, r.prototype.toRadix = ye, r.prototype.fromRadix = Ne, r.prototype.fromNumber = Ye, r.prototype.bitwiseTo = dt, r.prototype.changeBit = Ve, r.prototype.addTo = Pt, r.prototype.dMultiply = qt, r.prototype.dAddOffset = Ht, r.prototype.multiplyLowerTo = Jy, r.prototype.multiplyUpperTo = Yy, r.prototype.modInt = oS, r.prototype.millerRabin = cS, r.prototype.clone = L, r.prototype.intValue = B, r.prototype.byteValue = Q, r.prototype.shortValue = ve, r.prototype.signum = X, 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 = ce, r.prototype.not = Ie, r.prototype.shiftLeft = rt, r.prototype.shiftRight = ct, r.prototype.getLowestSetBit = de, r.prototype.bitCount = Se, r.prototype.testBit = xe, r.prototype.setBit =
|
|
32166
|
+
return r.prototype.chunkSize = we, r.prototype.toRadix = ye, r.prototype.fromRadix = Ne, r.prototype.fromNumber = Ye, r.prototype.bitwiseTo = dt, r.prototype.changeBit = Ve, r.prototype.addTo = Pt, r.prototype.dMultiply = qt, r.prototype.dAddOffset = Ht, r.prototype.multiplyLowerTo = Jy, r.prototype.multiplyUpperTo = Yy, r.prototype.modInt = oS, r.prototype.millerRabin = cS, r.prototype.clone = L, r.prototype.intValue = B, r.prototype.byteValue = Q, r.prototype.shortValue = ve, r.prototype.signum = X, 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 = ce, r.prototype.not = Ie, r.prototype.shiftLeft = rt, r.prototype.shiftRight = ct, r.prototype.getLowestSetBit = de, r.prototype.bitCount = Se, 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 = Ft, r.prototype.divide = jt, r.prototype.remainder = Vt, r.prototype.divideAndRemainder = Gt, r.prototype.modPow = nS, r.prototype.modInverse = sS, r.prototype.pow = Zy, r.prototype.gcd = iS, r.prototype.isProbablePrime = uS, Aa;
|
|
32217
32167
|
}
|
|
32218
32168
|
var $a = { exports: {} }, Ra = { exports: {} }, Ef;
|
|
32219
32169
|
function to() {
|
|
@@ -38593,8 +38543,8 @@ function _2() {
|
|
|
38593
38543
|
Me(E, N, N);
|
|
38594
38544
|
}
|
|
38595
38545
|
function Me(E, N, R) {
|
|
38596
|
-
var v, A, L = 0, B = 0, Q = 0, ve = 0, we = 0, X = 0, ye = 0, Ne = 0, Ye = 0, je = 0, bt = 0, Ct = 0, Et = 0, dt = 0, vt = 0, yt = 0, It = 0, Nt = 0, V = 0, W = 0, Y = 0, ce = 0, Ie = 0, rt = 0, ct = 0, Be = 0, de = 0, ge = 0, Se = 0, xe = 0, Ve = 0,
|
|
38597
|
-
v = N[0], L += v *
|
|
38546
|
+
var v, A, L = 0, B = 0, Q = 0, ve = 0, we = 0, X = 0, ye = 0, Ne = 0, Ye = 0, je = 0, bt = 0, Ct = 0, Et = 0, dt = 0, vt = 0, yt = 0, It = 0, Nt = 0, V = 0, W = 0, Y = 0, ce = 0, Ie = 0, rt = 0, ct = 0, Be = 0, de = 0, ge = 0, Se = 0, xe = 0, Ve = 0, Le = R[0], Ge = R[1], lt = R[2], Pt = R[3], Dt = R[4], Bt = R[5], Ft = R[6], jt = R[7], Vt = R[8], Gt = R[9], qt = R[10], Ht = R[11], Tt = R[12], Mt = R[13], Kt = R[14], Wt = R[15];
|
|
38547
|
+
v = N[0], L += v * Le, B += v * Ge, Q += v * lt, ve += v * Pt, we += v * Dt, X += v * Bt, ye += v * Ft, Ne += v * jt, Ye += v * Vt, je += v * Gt, bt += v * qt, Ct += v * Ht, Et += v * Tt, dt += v * Mt, vt += v * Kt, yt += v * Wt, v = N[1], B += v * Le, Q += v * Ge, ve += v * lt, we += v * Pt, X += v * Dt, ye += v * Bt, Ne += v * Ft, Ye += v * jt, je += v * Vt, bt += v * Gt, Ct += v * qt, Et += v * Ht, dt += v * Tt, vt += v * Mt, yt += v * Kt, It += v * Wt, v = N[2], Q += v * Le, ve += v * Ge, we += v * lt, X += v * Pt, ye += v * Dt, Ne += v * Bt, Ye += v * Ft, je += v * jt, bt += v * Vt, Ct += v * Gt, Et += v * qt, dt += v * Ht, vt += v * Tt, yt += v * Mt, It += v * Kt, Nt += v * Wt, v = N[3], ve += v * Le, we += v * Ge, X += v * lt, ye += v * Pt, Ne += v * Dt, Ye += v * Bt, je += v * Ft, bt += v * jt, Ct += v * Vt, Et += v * Gt, dt += v * qt, vt += v * Ht, yt += v * Tt, It += v * Mt, Nt += v * Kt, V += v * Wt, v = N[4], we += v * Le, X += v * Ge, ye += v * lt, Ne += v * Pt, Ye += v * Dt, je += v * Bt, bt += v * Ft, Ct += v * jt, Et += v * Vt, dt += v * Gt, vt += v * qt, yt += v * Ht, It += v * Tt, Nt += v * Mt, V += v * Kt, W += v * Wt, v = N[5], X += v * Le, ye += v * Ge, Ne += v * lt, Ye += v * Pt, je += v * Dt, bt += v * Bt, Ct += v * Ft, Et += v * jt, dt += v * Vt, vt += v * Gt, yt += v * qt, It += v * Ht, Nt += v * Tt, V += v * Mt, W += v * Kt, Y += v * Wt, v = N[6], ye += v * Le, Ne += v * Ge, Ye += v * lt, je += v * Pt, bt += v * Dt, Ct += v * Bt, Et += v * Ft, dt += v * jt, vt += v * Vt, yt += v * Gt, It += v * qt, Nt += v * Ht, V += v * Tt, W += v * Mt, Y += v * Kt, ce += v * Wt, v = N[7], Ne += v * Le, Ye += v * Ge, je += v * lt, bt += v * Pt, Ct += v * Dt, Et += v * Bt, dt += v * Ft, vt += v * jt, yt += v * Vt, It += v * Gt, Nt += v * qt, V += v * Ht, W += v * Tt, Y += v * Mt, ce += v * Kt, Ie += v * Wt, v = N[8], Ye += v * Le, je += v * Ge, bt += v * lt, Ct += v * Pt, Et += v * Dt, dt += v * Bt, vt += v * Ft, yt += v * jt, It += v * Vt, Nt += v * Gt, V += v * qt, W += v * Ht, Y += v * Tt, ce += v * Mt, Ie += v * Kt, rt += v * Wt, v = N[9], je += v * Le, bt += v * Ge, Ct += v * lt, Et += v * Pt, dt += v * Dt, vt += v * Bt, yt += v * Ft, It += v * jt, Nt += v * Vt, V += v * Gt, W += v * qt, Y += v * Ht, ce += v * Tt, Ie += v * Mt, rt += v * Kt, ct += v * Wt, v = N[10], bt += v * Le, Ct += v * Ge, Et += v * lt, dt += v * Pt, vt += v * Dt, yt += v * Bt, It += v * Ft, Nt += v * jt, V += v * Vt, W += v * Gt, Y += v * qt, ce += v * Ht, Ie += v * Tt, rt += v * Mt, ct += v * Kt, Be += v * Wt, v = N[11], Ct += v * Le, Et += v * Ge, dt += v * lt, vt += v * Pt, yt += v * Dt, It += v * Bt, Nt += v * Ft, V += v * jt, W += v * Vt, Y += v * Gt, ce += v * qt, Ie += v * Ht, rt += v * Tt, ct += v * Mt, Be += v * Kt, de += v * Wt, v = N[12], Et += v * Le, dt += v * Ge, vt += v * lt, yt += v * Pt, It += v * Dt, Nt += v * Bt, V += v * Ft, W += v * jt, Y += v * Vt, ce += v * Gt, Ie += v * qt, rt += v * Ht, ct += v * Tt, Be += v * Mt, de += v * Kt, ge += v * Wt, v = N[13], dt += v * Le, vt += v * Ge, yt += v * lt, It += v * Pt, Nt += v * Dt, V += v * Bt, W += v * Ft, Y += v * jt, ce += v * Vt, Ie += v * Gt, rt += v * qt, ct += v * Ht, Be += v * Tt, de += v * Mt, ge += v * Kt, Se += v * Wt, v = N[14], vt += v * Le, yt += v * Ge, It += v * lt, Nt += v * Pt, V += v * Dt, W += v * Bt, Y += v * Ft, ce += v * jt, Ie += v * Vt, rt += v * Gt, ct += v * qt, Be += v * Ht, de += v * Tt, ge += v * Mt, Se += v * Kt, xe += v * Wt, v = N[15], yt += v * Le, It += v * Ge, Nt += v * lt, V += v * Pt, W += v * Dt, Y += v * Bt, ce += v * Ft, Ie += v * jt, rt += v * Vt, ct += v * Gt, Be += v * qt, de += v * Ht, ge += v * Tt, Se += v * Mt, xe += v * Kt, Ve += v * Wt, L += 38 * It, B += 38 * Nt, Q += 38 * V, ve += 38 * W, we += 38 * Y, X += 38 * ce, ye += 38 * Ie, Ne += 38 * rt, Ye += 38 * ct, je += 38 * Be, bt += 38 * de, Ct += 38 * ge, Et += 38 * Se, dt += 38 * xe, vt += 38 * Ve, A = 1, v = L + A + 65535, A = Math.floor(v / 65536), L = v - A * 65536, v = B + A + 65535, A = Math.floor(v / 65536), B = v - A * 65536, v = Q + A + 65535, A = Math.floor(v / 65536), Q = v - A * 65536, v = ve + A + 65535, A = Math.floor(v / 65536), ve = v - A * 65536, v = we + A + 65535, A = Math.floor(v / 65536), we = v - A * 65536, v = X + A + 65535, A = Math.floor(v / 65536), X = v - A * 65536, v = ye + A + 65535, A = Math.floor(v / 65536), ye = v - A * 65536, v = Ne + A + 65535, A = Math.floor(v / 65536), Ne = v - A * 65536, v = Ye + A + 65535, A = Math.floor(v / 65536), Ye = v - A * 65536, v = je + A + 65535, A = Math.floor(v / 65536), je = v - A * 65536, v = bt + A + 65535, A = Math.floor(v / 65536), bt = v - A * 65536, v = Ct + A + 65535, A = Math.floor(v / 65536), Ct = v - A * 65536, v = Et + A + 65535, A = Math.floor(v / 65536), Et = v - A * 65536, v = dt + A + 65535, A = Math.floor(v / 65536), dt = v - A * 65536, v = vt + A + 65535, A = Math.floor(v / 65536), vt = v - A * 65536, v = yt + A + 65535, A = Math.floor(v / 65536), yt = v - A * 65536, L += A - 1 + 37 * (A - 1), A = 1, v = L + A + 65535, A = Math.floor(v / 65536), L = v - A * 65536, v = B + A + 65535, A = Math.floor(v / 65536), B = v - A * 65536, v = Q + A + 65535, A = Math.floor(v / 65536), Q = v - A * 65536, v = ve + A + 65535, A = Math.floor(v / 65536), ve = v - A * 65536, v = we + A + 65535, A = Math.floor(v / 65536), we = v - A * 65536, v = X + A + 65535, A = Math.floor(v / 65536), X = v - A * 65536, v = ye + A + 65535, A = Math.floor(v / 65536), ye = v - A * 65536, v = Ne + A + 65535, A = Math.floor(v / 65536), Ne = v - A * 65536, v = Ye + A + 65535, A = Math.floor(v / 65536), Ye = v - A * 65536, v = je + A + 65535, A = Math.floor(v / 65536), je = v - A * 65536, v = bt + A + 65535, A = Math.floor(v / 65536), bt = v - A * 65536, v = Ct + A + 65535, A = Math.floor(v / 65536), Ct = v - A * 65536, v = Et + A + 65535, A = Math.floor(v / 65536), Et = v - A * 65536, v = dt + A + 65535, A = Math.floor(v / 65536), dt = v - A * 65536, v = vt + A + 65535, A = Math.floor(v / 65536), vt = v - A * 65536, v = yt + A + 65535, A = Math.floor(v / 65536), yt = v - A * 65536, L += A - 1 + 37 * (A - 1), E[0] = L, E[1] = B, E[2] = Q, E[3] = ve, E[4] = we, E[5] = X, E[6] = ye, E[7] = Ne, E[8] = Ye, E[9] = je, E[10] = bt, E[11] = Ct, E[12] = Et, E[13] = dt, E[14] = vt, E[15] = yt;
|
|
38598
38548
|
}
|
|
38599
38549
|
return ja;
|
|
38600
38550
|
}
|
|
@@ -41460,10 +41410,10 @@ class Tp {
|
|
|
41460
41410
|
logger;
|
|
41461
41411
|
static create(e, r, i) {
|
|
41462
41412
|
const n = new Tp();
|
|
41463
|
-
n.logger = r, n.baseCAFolder = e, n.certsFolder =
|
|
41413
|
+
n.logger = r, n.baseCAFolder = e, n.certsFolder = ze.join(n.baseCAFolder, "certs"), n.keysFolder = ze.join(n.baseCAFolder, "keys"), Qa.sync(n.baseCAFolder), Qa.sync(n.certsFolder), Qa.sync(n.keysFolder), er.series(
|
|
41464
41414
|
[
|
|
41465
41415
|
(o) => {
|
|
41466
|
-
Te.existsSync(
|
|
41416
|
+
Te.existsSync(ze.join(n.certsFolder, "ca.pem")) ? n.loadCA(o) : n.generateCA(o);
|
|
41467
41417
|
}
|
|
41468
41418
|
],
|
|
41469
41419
|
(o) => o ? i(o) : i(null, n)
|
|
@@ -41485,9 +41435,9 @@ class Tp {
|
|
|
41485
41435
|
const n = ar.createCertificate();
|
|
41486
41436
|
n.publicKey = i.publicKey, n.serialNumber = this.randomSerialNumber(), n.validity.notBefore = /* @__PURE__ */ new Date(), n.validity.notBefore.setDate(n.validity.notBefore.getDate() - 1), n.validity.notAfter = /* @__PURE__ */ new Date(), n.validity.notAfter.setFullYear(n.validity.notBefore.getFullYear() + 1), n.setSubject(vh), n.setIssuer(vh), n.setExtensions(xR), n.sign(i.privateKey, _h.sha256.create()), this.CAcert = n, this.CAkeys = i;
|
|
41487
41437
|
const o = [
|
|
41488
|
-
Te.writeFile.bind(null,
|
|
41489
|
-
Te.writeFile.bind(null,
|
|
41490
|
-
Te.writeFile.bind(null,
|
|
41438
|
+
Te.writeFile.bind(null, ze.join(this.certsFolder, "ca.pem"), ar.certificateToPem(n)),
|
|
41439
|
+
Te.writeFile.bind(null, ze.join(this.keysFolder, "ca.private.key"), ar.privateKeyToPem(i.privateKey)),
|
|
41440
|
+
Te.writeFile.bind(null, ze.join(this.keysFolder, "ca.public.key"), ar.publicKeyToPem(i.publicKey))
|
|
41491
41441
|
];
|
|
41492
41442
|
er.parallel(o, e);
|
|
41493
41443
|
});
|
|
@@ -41497,13 +41447,13 @@ class Tp {
|
|
|
41497
41447
|
er.auto(
|
|
41498
41448
|
{
|
|
41499
41449
|
certPEM(i) {
|
|
41500
|
-
Te.readFile(
|
|
41450
|
+
Te.readFile(ze.join(r.certsFolder, "ca.pem"), "utf-8", i);
|
|
41501
41451
|
},
|
|
41502
41452
|
keyPrivatePEM(i) {
|
|
41503
|
-
Te.readFile(
|
|
41453
|
+
Te.readFile(ze.join(r.keysFolder, "ca.private.key"), "utf-8", i);
|
|
41504
41454
|
},
|
|
41505
41455
|
keyPublicPEM(i) {
|
|
41506
|
-
Te.readFile(
|
|
41456
|
+
Te.readFile(ze.join(r.keysFolder, "ca.public.key"), "utf-8", i);
|
|
41507
41457
|
}
|
|
41508
41458
|
},
|
|
41509
41459
|
(i, n) => i ? e(i) : (r.CAcert = ar.certificateFromPem(n.certPEM), r.CAkeys = {
|
|
@@ -41627,7 +41577,7 @@ let eu = class Kn {
|
|
|
41627
41577
|
}
|
|
41628
41578
|
listen(e, r = () => {
|
|
41629
41579
|
}) {
|
|
41630
|
-
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 Ks.Agent({ keepAlive: this.keepAlive }), this.httpsAgent = typeof e.httpsAgent < "u" ? e.httpsAgent : new Ws.Agent({ keepAlive: this.keepAlive }), this.forceSNI = !!e.forceSNI, this.forceSNI, this.httpsPort = this.forceSNI ? e.httpsPort : void 0, this.sslCaDir = e.sslCaDir ||
|
|
41580
|
+
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 Ks.Agent({ keepAlive: this.keepAlive }), this.httpsAgent = typeof e.httpsAgent < "u" ? e.httpsAgent : new Ws.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"), Tp.create(this.sslCaDir, this.logger, (i, n) => {
|
|
41631
41581
|
if (i)
|
|
41632
41582
|
return r(i);
|
|
41633
41583
|
this.ca = n, this.sslServers = {}, this.sslSemaphores = {}, this.connectRequests = {}, this.httpServer = Ks.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 Po({ server: this.httpServer }), this.wsServer.on("error", this._onError.bind(this, "HTTP_SERVER_ERROR", null)), this.wsServer.on("connection", (s, a) => {
|
|
@@ -42920,4 +42870,4 @@ export {
|
|
|
42920
42870
|
gw as y,
|
|
42921
42871
|
$v as z
|
|
42922
42872
|
};
|
|
42923
|
-
//# sourceMappingURL=index-
|
|
42873
|
+
//# sourceMappingURL=index-qm8Y_t_Z.mjs.map
|