page-agent-sdk 4.24.0 → 4.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/page-agent-sdk.headless.js +1142 -1138
- package/dist/page-agent-sdk.iife.js +10 -10
- package/dist/page-agent-sdk.js +882 -878
- package/dist/page-agent-sdk.legacy.js +583 -576
- package/dist/page-agent-sdk.umd.cjs +8 -8
- package/package.json +1 -1
- package/types/headless.d.ts +2 -2
- package/types/index.d.ts +5 -2
|
@@ -462,9 +462,9 @@ function ne(e) {
|
|
|
462
462
|
t?.response_metadata?.token_usage,
|
|
463
463
|
t?.response_metadata?.tokenUsage
|
|
464
464
|
];
|
|
465
|
-
for (let e of n) if (e && typeof e == "object" &&
|
|
465
|
+
for (let e of n) if (e && typeof e == "object" && A(e)) return e;
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function A(e) {
|
|
468
468
|
return [
|
|
469
469
|
"prompt_tokens",
|
|
470
470
|
"completion_tokens",
|
|
@@ -478,7 +478,7 @@ function re(e) {
|
|
|
478
478
|
"outputTokens"
|
|
479
479
|
].some((t) => typeof e[t] == "number" && e[t] > 0);
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function re(e) {
|
|
482
482
|
let t = ne(e);
|
|
483
483
|
if (!t || typeof t != "object") return null;
|
|
484
484
|
let n = t, r = Number(n.prompt_tokens ?? n.promptTokens ?? n.input_tokens ?? n.inputTokens ?? 0) || 0, i = Number(n.completion_tokens ?? n.completionTokens ?? n.output_tokens ?? n.outputTokens ?? 0) || 0, a = Number(n.total_tokens ?? n.totalTokens ?? r + i) || 0;
|
|
@@ -496,129 +496,129 @@ function ie(e) {
|
|
|
496
496
|
//#endregion
|
|
497
497
|
//#region node_modules/@vue/shared/dist/shared.esm-bundler.js
|
|
498
498
|
// @__NO_SIDE_EFFECTS__
|
|
499
|
-
function
|
|
499
|
+
function ie(e) {
|
|
500
500
|
let t = /* @__PURE__ */ Object.create(null);
|
|
501
501
|
for (let n of e.split(",")) t[n] = 1;
|
|
502
502
|
return (e) => e in t;
|
|
503
503
|
}
|
|
504
|
-
var
|
|
504
|
+
var ae = process.env.NODE_ENV === "production" ? {} : Object.freeze({});
|
|
505
505
|
process.env.NODE_ENV === "production" || Object.freeze([]);
|
|
506
|
-
var
|
|
506
|
+
var j = () => {}, M = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), oe = (e) => e.startsWith("onUpdate:"), N = Object.assign, se = (e, t) => {
|
|
507
507
|
let n = e.indexOf(t);
|
|
508
508
|
n > -1 && e.splice(n, 1);
|
|
509
|
-
},
|
|
509
|
+
}, P = Object.prototype.hasOwnProperty, F = (e, t) => P.call(e, t), I = Array.isArray, ce = (e) => me(e) === "[object Map]", L = (e) => me(e) === "[object Set]", R = (e) => typeof e == "function", le = (e) => typeof e == "string", ue = (e) => typeof e == "symbol", de = (e) => typeof e == "object" && !!e, fe = (e) => (de(e) || R(e)) && R(e.then) && R(e.catch), pe = Object.prototype.toString, me = (e) => pe.call(e), z = (e) => me(e).slice(8, -1), B = (e) => me(e) === "[object Object]", V = (e) => le(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, he = ((e) => {
|
|
510
510
|
let t = /* @__PURE__ */ Object.create(null);
|
|
511
511
|
return ((n) => t[n] || (t[n] = e(n)));
|
|
512
|
-
})((e) => e.charAt(0).toUpperCase() + e.slice(1)),
|
|
512
|
+
})((e) => e.charAt(0).toUpperCase() + e.slice(1)), ge = (e, t) => !Object.is(e, t), _e = (e, t, n, r = !1) => {
|
|
513
513
|
Object.defineProperty(e, t, {
|
|
514
514
|
configurable: !0,
|
|
515
515
|
enumerable: !1,
|
|
516
516
|
writable: r,
|
|
517
517
|
value: n
|
|
518
518
|
});
|
|
519
|
-
},
|
|
520
|
-
function
|
|
521
|
-
if (
|
|
519
|
+
}, ve, ye = () => ve ||= typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
520
|
+
function H(e) {
|
|
521
|
+
if (I(e)) {
|
|
522
522
|
let t = {};
|
|
523
523
|
for (let n = 0; n < e.length; n++) {
|
|
524
|
-
let r = e[n], i =
|
|
524
|
+
let r = e[n], i = le(r) ? Se(r) : H(r);
|
|
525
525
|
if (i) for (let e in i) t[e] = i[e];
|
|
526
526
|
}
|
|
527
527
|
return t;
|
|
528
|
-
} else if (
|
|
528
|
+
} else if (le(e) || de(e)) return e;
|
|
529
529
|
}
|
|
530
|
-
var
|
|
531
|
-
function
|
|
530
|
+
var be = /;(?![^(]*\))/g, U = /:([^]+)/, xe = /\/\*[^]*?\*\//g;
|
|
531
|
+
function Se(e) {
|
|
532
532
|
let t = {};
|
|
533
|
-
return e.replace(
|
|
533
|
+
return e.replace(xe, "").split(be).forEach((e) => {
|
|
534
534
|
if (e) {
|
|
535
|
-
let n = e.split(
|
|
535
|
+
let n = e.split(U);
|
|
536
536
|
n.length > 1 && (t[n[0].trim()] = n[1].trim());
|
|
537
537
|
}
|
|
538
538
|
}), t;
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function W(e) {
|
|
541
541
|
let t = "";
|
|
542
|
-
if (
|
|
543
|
-
else if (
|
|
544
|
-
let r =
|
|
542
|
+
if (le(e)) t = e;
|
|
543
|
+
else if (I(e)) for (let n = 0; n < e.length; n++) {
|
|
544
|
+
let r = W(e[n]);
|
|
545
545
|
r && (t += r + " ");
|
|
546
546
|
}
|
|
547
|
-
else if (
|
|
547
|
+
else if (de(e)) for (let n in e) e[n] && (t += n + " ");
|
|
548
548
|
return t.trim();
|
|
549
549
|
}
|
|
550
550
|
//#endregion
|
|
551
551
|
//#region node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
552
|
-
function
|
|
552
|
+
function Ce(e, ...t) {
|
|
553
553
|
console.warn(`[Vue warn] ${e}`, ...t);
|
|
554
554
|
}
|
|
555
|
-
var
|
|
556
|
-
function
|
|
557
|
-
return
|
|
555
|
+
var we;
|
|
556
|
+
function Te() {
|
|
557
|
+
return we;
|
|
558
558
|
}
|
|
559
|
-
var
|
|
559
|
+
var G, Ee = /* @__PURE__ */ new WeakSet(), De = class {
|
|
560
560
|
constructor(e) {
|
|
561
|
-
this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0,
|
|
561
|
+
this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0, we && (we.active ? we.effects.push(this) : this.flags &= -2);
|
|
562
562
|
}
|
|
563
563
|
pause() {
|
|
564
564
|
this.flags |= 64;
|
|
565
565
|
}
|
|
566
566
|
resume() {
|
|
567
|
-
this.flags & 64 && (this.flags &= -65,
|
|
567
|
+
this.flags & 64 && (this.flags &= -65, Ee.has(this) && (Ee.delete(this), this.trigger()));
|
|
568
568
|
}
|
|
569
569
|
notify() {
|
|
570
|
-
this.flags & 2 && !(this.flags & 32) || this.flags & 8 ||
|
|
570
|
+
this.flags & 2 && !(this.flags & 32) || this.flags & 8 || je(this);
|
|
571
571
|
}
|
|
572
572
|
run() {
|
|
573
573
|
if (!(this.flags & 1)) return this.fn();
|
|
574
|
-
this.flags |= 2,
|
|
575
|
-
let e =
|
|
576
|
-
|
|
574
|
+
this.flags |= 2, We(this), Pe(this);
|
|
575
|
+
let e = G, t = Be;
|
|
576
|
+
G = this, Be = !0;
|
|
577
577
|
try {
|
|
578
578
|
return this.fn();
|
|
579
579
|
} finally {
|
|
580
|
-
process.env.NODE_ENV !== "production" &&
|
|
580
|
+
process.env.NODE_ENV !== "production" && G !== this && Ce("Active effect was not restored correctly - this is likely a Vue internal bug."), Fe(this), G = e, Be = t, this.flags &= -3;
|
|
581
581
|
}
|
|
582
582
|
}
|
|
583
583
|
stop() {
|
|
584
584
|
if (this.flags & 1) {
|
|
585
|
-
for (let e = this.deps; e; e = e.nextDep)
|
|
586
|
-
this.deps = this.depsTail = void 0,
|
|
585
|
+
for (let e = this.deps; e; e = e.nextDep) Re(e);
|
|
586
|
+
this.deps = this.depsTail = void 0, We(this), this.onStop && this.onStop(), this.flags &= -2;
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
trigger() {
|
|
590
|
-
this.flags & 64 ?
|
|
590
|
+
this.flags & 64 ? Ee.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
|
|
591
591
|
}
|
|
592
592
|
runIfDirty() {
|
|
593
|
-
|
|
593
|
+
Ie(this) && this.run();
|
|
594
594
|
}
|
|
595
595
|
get dirty() {
|
|
596
|
-
return
|
|
596
|
+
return Ie(this);
|
|
597
597
|
}
|
|
598
|
-
},
|
|
599
|
-
function
|
|
598
|
+
}, Oe = 0, ke, Ae;
|
|
599
|
+
function je(e, t = !1) {
|
|
600
600
|
if (e.flags |= 8, t) {
|
|
601
|
-
e.next =
|
|
601
|
+
e.next = Ae, Ae = e;
|
|
602
602
|
return;
|
|
603
603
|
}
|
|
604
|
-
e.next =
|
|
604
|
+
e.next = ke, ke = e;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
606
|
+
function Me() {
|
|
607
|
+
Oe++;
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
if (--
|
|
611
|
-
if (
|
|
612
|
-
let e =
|
|
613
|
-
for (
|
|
609
|
+
function Ne() {
|
|
610
|
+
if (--Oe > 0) return;
|
|
611
|
+
if (Ae) {
|
|
612
|
+
let e = Ae;
|
|
613
|
+
for (Ae = void 0; e;) {
|
|
614
614
|
let t = e.next;
|
|
615
615
|
e.next = void 0, e.flags &= -9, e = t;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
let e;
|
|
619
|
-
for (;
|
|
620
|
-
let t =
|
|
621
|
-
for (
|
|
619
|
+
for (; ke;) {
|
|
620
|
+
let t = ke;
|
|
621
|
+
for (ke = void 0; t;) {
|
|
622
622
|
let n = t.next;
|
|
623
623
|
if (t.next = void 0, t.flags &= -9, t.flags & 1) try {
|
|
624
624
|
t.trigger();
|
|
@@ -630,127 +630,127 @@ function Pe() {
|
|
|
630
630
|
}
|
|
631
631
|
if (e) throw e;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Pe(e) {
|
|
634
634
|
for (let t = e.deps; t; t = t.nextDep) t.version = -1, t.prevActiveLink = t.dep.activeLink, t.dep.activeLink = t;
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function Fe(e) {
|
|
637
637
|
let t, n = e.depsTail, r = n;
|
|
638
638
|
for (; r;) {
|
|
639
639
|
let e = r.prevDep;
|
|
640
|
-
r.version === -1 ? (r === n && (n = e),
|
|
640
|
+
r.version === -1 ? (r === n && (n = e), Re(r), ze(r)) : t = r, r.dep.activeLink = r.prevActiveLink, r.prevActiveLink = void 0, r = e;
|
|
641
641
|
}
|
|
642
642
|
e.deps = t, e.depsTail = n;
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (
|
|
644
|
+
function Ie(e) {
|
|
645
|
+
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (Le(t.dep.computed) || t.dep.version !== t.version)) return !0;
|
|
646
646
|
return !!e._dirty;
|
|
647
647
|
}
|
|
648
|
-
function
|
|
649
|
-
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion ===
|
|
648
|
+
function Le(e) {
|
|
649
|
+
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion === Ge) || (e.globalVersion = Ge, !e.isSSR && e.flags & 128 && (!e.deps && !e._dirty || !Ie(e)))) return;
|
|
650
650
|
e.flags |= 2;
|
|
651
|
-
let t = e.dep, n =
|
|
652
|
-
|
|
651
|
+
let t = e.dep, n = G, r = Be;
|
|
652
|
+
G = e, Be = !0;
|
|
653
653
|
try {
|
|
654
|
-
|
|
654
|
+
Pe(e);
|
|
655
655
|
let n = e.fn(e._value);
|
|
656
|
-
(t.version === 0 ||
|
|
656
|
+
(t.version === 0 || ge(n, e._value)) && (e.flags |= 128, e._value = n, t.version++);
|
|
657
657
|
} catch (e) {
|
|
658
658
|
throw t.version++, e;
|
|
659
659
|
} finally {
|
|
660
|
-
|
|
660
|
+
G = n, Be = r, Fe(e), e.flags &= -3;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Re(e, t = !1) {
|
|
664
664
|
let { dep: n, prevSub: r, nextSub: i } = e;
|
|
665
665
|
if (r && (r.nextSub = i, e.prevSub = void 0), i && (i.prevSub = r, e.nextSub = void 0), process.env.NODE_ENV !== "production" && n.subsHead === e && (n.subsHead = i), n.subs === e && (n.subs = r, !r && n.computed)) {
|
|
666
666
|
n.computed.flags &= -5;
|
|
667
|
-
for (let e = n.computed.deps; e; e = e.nextDep)
|
|
667
|
+
for (let e = n.computed.deps; e; e = e.nextDep) Re(e, !0);
|
|
668
668
|
}
|
|
669
669
|
!t && !--n.sc && n.map && n.map.delete(n.key);
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function ze(e) {
|
|
672
672
|
let { prevDep: t, nextDep: n } = e;
|
|
673
673
|
t && (t.nextDep = n, e.prevDep = void 0), n && (n.prevDep = t, e.nextDep = void 0);
|
|
674
674
|
}
|
|
675
|
-
var
|
|
676
|
-
function
|
|
677
|
-
|
|
675
|
+
var Be = !0, Ve = [];
|
|
676
|
+
function He() {
|
|
677
|
+
Ve.push(Be), Be = !1;
|
|
678
678
|
}
|
|
679
|
-
function
|
|
680
|
-
let e =
|
|
681
|
-
|
|
679
|
+
function Ue() {
|
|
680
|
+
let e = Ve.pop();
|
|
681
|
+
Be = e === void 0 || e;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function We(e) {
|
|
684
684
|
let { cleanup: t } = e;
|
|
685
685
|
if (e.cleanup = void 0, t) {
|
|
686
|
-
let e =
|
|
687
|
-
|
|
686
|
+
let e = G;
|
|
687
|
+
G = void 0;
|
|
688
688
|
try {
|
|
689
689
|
t();
|
|
690
690
|
} finally {
|
|
691
|
-
|
|
691
|
+
G = e;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
var
|
|
695
|
+
var Ge = 0, Ke = class {
|
|
696
696
|
constructor(e, t) {
|
|
697
697
|
this.sub = e, this.dep = t, this.version = t.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
698
698
|
}
|
|
699
|
-
},
|
|
699
|
+
}, qe = class {
|
|
700
700
|
constructor(e) {
|
|
701
701
|
this.computed = e, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
|
|
702
702
|
}
|
|
703
703
|
track(e) {
|
|
704
|
-
if (!
|
|
704
|
+
if (!G || !Be || G === this.computed) return;
|
|
705
705
|
let t = this.activeLink;
|
|
706
|
-
if (t === void 0 || t.sub !==
|
|
706
|
+
if (t === void 0 || t.sub !== G) t = this.activeLink = new Ke(G, this), G.deps ? (t.prevDep = G.depsTail, G.depsTail.nextDep = t, G.depsTail = t) : G.deps = G.depsTail = t, Je(t);
|
|
707
707
|
else if (t.version === -1 && (t.version = this.version, t.nextDep)) {
|
|
708
708
|
let e = t.nextDep;
|
|
709
|
-
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep =
|
|
709
|
+
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep = G.depsTail, t.nextDep = void 0, G.depsTail.nextDep = t, G.depsTail = t, G.deps === t && (G.deps = e);
|
|
710
710
|
}
|
|
711
|
-
return process.env.NODE_ENV !== "production" &&
|
|
711
|
+
return process.env.NODE_ENV !== "production" && G.onTrack && G.onTrack(N({ effect: G }, e)), t;
|
|
712
712
|
}
|
|
713
713
|
trigger(e) {
|
|
714
|
-
this.version++,
|
|
714
|
+
this.version++, Ge++, this.notify(e);
|
|
715
715
|
}
|
|
716
716
|
notify(e) {
|
|
717
|
-
|
|
717
|
+
Me();
|
|
718
718
|
try {
|
|
719
|
-
if (process.env.NODE_ENV !== "production") for (let t = this.subsHead; t; t = t.nextSub) t.sub.onTrigger && !(t.sub.flags & 8) && t.sub.onTrigger(
|
|
719
|
+
if (process.env.NODE_ENV !== "production") for (let t = this.subsHead; t; t = t.nextSub) t.sub.onTrigger && !(t.sub.flags & 8) && t.sub.onTrigger(N({ effect: t.sub }, e));
|
|
720
720
|
for (let e = this.subs; e; e = e.prevSub) e.sub.notify() && e.sub.dep.notify();
|
|
721
721
|
} finally {
|
|
722
|
-
|
|
722
|
+
Ne();
|
|
723
723
|
}
|
|
724
724
|
}
|
|
725
725
|
};
|
|
726
|
-
function
|
|
726
|
+
function Je(e) {
|
|
727
727
|
if (e.dep.sc++, e.sub.flags & 4) {
|
|
728
728
|
let t = e.dep.computed;
|
|
729
729
|
if (t && !e.dep.subs) {
|
|
730
730
|
t.flags |= 20;
|
|
731
|
-
for (let e = t.deps; e; e = e.nextDep)
|
|
731
|
+
for (let e = t.deps; e; e = e.nextDep) Je(e);
|
|
732
732
|
}
|
|
733
733
|
let n = e.dep.subs;
|
|
734
734
|
n !== e && (e.prevSub = n, n && (n.nextSub = e)), process.env.NODE_ENV !== "production" && e.dep.subsHead === void 0 && (e.dep.subsHead = e), e.dep.subs = e;
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
var
|
|
738
|
-
function
|
|
739
|
-
if (
|
|
740
|
-
let r =
|
|
741
|
-
r ||
|
|
737
|
+
var Ye = /* @__PURE__ */ new WeakMap(), Xe = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Object iterate"), Ze = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Map keys iterate"), Qe = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Array iterate");
|
|
738
|
+
function $e(e, t, n) {
|
|
739
|
+
if (Be && G) {
|
|
740
|
+
let r = Ye.get(e);
|
|
741
|
+
r || Ye.set(e, r = /* @__PURE__ */ new Map());
|
|
742
742
|
let i = r.get(n);
|
|
743
|
-
i || (r.set(n, i = new
|
|
743
|
+
i || (r.set(n, i = new qe()), i.map = r, i.key = n), process.env.NODE_ENV === "production" ? i.track() : i.track({
|
|
744
744
|
target: e,
|
|
745
745
|
type: t,
|
|
746
746
|
key: n
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
let o =
|
|
750
|
+
function et(e, t, n, r, i, a) {
|
|
751
|
+
let o = Ye.get(e);
|
|
752
752
|
if (!o) {
|
|
753
|
-
|
|
753
|
+
Ge++;
|
|
754
754
|
return;
|
|
755
755
|
}
|
|
756
756
|
let s = (o) => {
|
|
@@ -763,173 +763,173 @@ function tt(e, t, n, r, i, a) {
|
|
|
763
763
|
oldTarget: a
|
|
764
764
|
}));
|
|
765
765
|
};
|
|
766
|
-
if (
|
|
766
|
+
if (Me(), t === "clear") o.forEach(s);
|
|
767
767
|
else {
|
|
768
|
-
let i =
|
|
768
|
+
let i = I(e), a = i && V(n);
|
|
769
769
|
if (i && n === "length") {
|
|
770
770
|
let e = Number(r);
|
|
771
771
|
o.forEach((t, n) => {
|
|
772
|
-
(n === "length" || n ===
|
|
772
|
+
(n === "length" || n === Qe || !ue(n) && n >= e) && s(t);
|
|
773
773
|
});
|
|
774
|
-
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(
|
|
774
|
+
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(Qe)), t) {
|
|
775
775
|
case "add":
|
|
776
|
-
i ? a && s(o.get("length")) : (s(o.get(
|
|
776
|
+
i ? a && s(o.get("length")) : (s(o.get(Xe)), ce(e) && s(o.get(Ze)));
|
|
777
777
|
break;
|
|
778
778
|
case "delete":
|
|
779
|
-
i || (s(o.get(
|
|
779
|
+
i || (s(o.get(Xe)), ce(e) && s(o.get(Ze)));
|
|
780
780
|
break;
|
|
781
781
|
case "set":
|
|
782
|
-
|
|
782
|
+
ce(e) && s(o.get(Xe));
|
|
783
783
|
break;
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
|
-
|
|
786
|
+
Ne();
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
let t = /* @__PURE__ */
|
|
790
|
-
return t === e ? t : (
|
|
788
|
+
function tt(e) {
|
|
789
|
+
let t = /* @__PURE__ */ J(e);
|
|
790
|
+
return t === e ? t : ($e(t, "iterate", Qe), /* @__PURE__ */ q(e) ? t : t.map(Ht));
|
|
791
791
|
}
|
|
792
|
-
function
|
|
793
|
-
return
|
|
792
|
+
function nt(e) {
|
|
793
|
+
return $e(e = /* @__PURE__ */ J(e), "iterate", Qe), e;
|
|
794
794
|
}
|
|
795
|
-
function
|
|
796
|
-
return /* @__PURE__ */ zt(e) ?
|
|
795
|
+
function K(e, t) {
|
|
796
|
+
return /* @__PURE__ */ zt(e) ? Ut(/* @__PURE__ */ Rt(e) ? Ht(t) : t) : Ht(t);
|
|
797
797
|
}
|
|
798
|
-
var
|
|
798
|
+
var rt = {
|
|
799
799
|
__proto__: null,
|
|
800
800
|
[Symbol.iterator]() {
|
|
801
|
-
return
|
|
801
|
+
return it(this, Symbol.iterator, (e) => K(this, e));
|
|
802
802
|
},
|
|
803
803
|
concat(...e) {
|
|
804
|
-
return
|
|
804
|
+
return tt(this).concat(...e.map((e) => I(e) ? tt(e) : e));
|
|
805
805
|
},
|
|
806
806
|
entries() {
|
|
807
|
-
return
|
|
807
|
+
return it(this, "entries", (e) => (e[1] = K(this, e[1]), e));
|
|
808
808
|
},
|
|
809
809
|
every(e, t) {
|
|
810
|
-
return
|
|
810
|
+
return ot(this, "every", e, t, void 0, arguments);
|
|
811
811
|
},
|
|
812
812
|
filter(e, t) {
|
|
813
|
-
return
|
|
813
|
+
return ot(this, "filter", e, t, (e) => e.map((e) => K(this, e)), arguments);
|
|
814
814
|
},
|
|
815
815
|
find(e, t) {
|
|
816
|
-
return
|
|
816
|
+
return ot(this, "find", e, t, (e) => K(this, e), arguments);
|
|
817
817
|
},
|
|
818
818
|
findIndex(e, t) {
|
|
819
|
-
return
|
|
819
|
+
return ot(this, "findIndex", e, t, void 0, arguments);
|
|
820
820
|
},
|
|
821
821
|
findLast(e, t) {
|
|
822
|
-
return
|
|
822
|
+
return ot(this, "findLast", e, t, (e) => K(this, e), arguments);
|
|
823
823
|
},
|
|
824
824
|
findLastIndex(e, t) {
|
|
825
|
-
return
|
|
825
|
+
return ot(this, "findLastIndex", e, t, void 0, arguments);
|
|
826
826
|
},
|
|
827
827
|
forEach(e, t) {
|
|
828
|
-
return
|
|
828
|
+
return ot(this, "forEach", e, t, void 0, arguments);
|
|
829
829
|
},
|
|
830
830
|
includes(...e) {
|
|
831
|
-
return
|
|
831
|
+
return ct(this, "includes", e);
|
|
832
832
|
},
|
|
833
833
|
indexOf(...e) {
|
|
834
|
-
return
|
|
834
|
+
return ct(this, "indexOf", e);
|
|
835
835
|
},
|
|
836
836
|
join(e) {
|
|
837
|
-
return
|
|
837
|
+
return tt(this).join(e);
|
|
838
838
|
},
|
|
839
839
|
lastIndexOf(...e) {
|
|
840
|
-
return
|
|
840
|
+
return ct(this, "lastIndexOf", e);
|
|
841
841
|
},
|
|
842
842
|
map(e, t) {
|
|
843
|
-
return
|
|
843
|
+
return ot(this, "map", e, t, void 0, arguments);
|
|
844
844
|
},
|
|
845
845
|
pop() {
|
|
846
|
-
return
|
|
846
|
+
return lt(this, "pop");
|
|
847
847
|
},
|
|
848
848
|
push(...e) {
|
|
849
|
-
return
|
|
849
|
+
return lt(this, "push", e);
|
|
850
850
|
},
|
|
851
851
|
reduce(e, ...t) {
|
|
852
|
-
return
|
|
852
|
+
return st(this, "reduce", e, t);
|
|
853
853
|
},
|
|
854
854
|
reduceRight(e, ...t) {
|
|
855
|
-
return
|
|
855
|
+
return st(this, "reduceRight", e, t);
|
|
856
856
|
},
|
|
857
857
|
shift() {
|
|
858
|
-
return
|
|
858
|
+
return lt(this, "shift");
|
|
859
859
|
},
|
|
860
860
|
some(e, t) {
|
|
861
|
-
return
|
|
861
|
+
return ot(this, "some", e, t, void 0, arguments);
|
|
862
862
|
},
|
|
863
863
|
splice(...e) {
|
|
864
|
-
return
|
|
864
|
+
return lt(this, "splice", e);
|
|
865
865
|
},
|
|
866
866
|
toReversed() {
|
|
867
|
-
return
|
|
867
|
+
return tt(this).toReversed();
|
|
868
868
|
},
|
|
869
869
|
toSorted(e) {
|
|
870
|
-
return
|
|
870
|
+
return tt(this).toSorted(e);
|
|
871
871
|
},
|
|
872
872
|
toSpliced(...e) {
|
|
873
|
-
return
|
|
873
|
+
return tt(this).toSpliced(...e);
|
|
874
874
|
},
|
|
875
875
|
unshift(...e) {
|
|
876
|
-
return
|
|
876
|
+
return lt(this, "unshift", e);
|
|
877
877
|
},
|
|
878
878
|
values() {
|
|
879
|
-
return
|
|
879
|
+
return it(this, "values", (e) => K(this, e));
|
|
880
880
|
}
|
|
881
881
|
};
|
|
882
|
-
function
|
|
883
|
-
let r =
|
|
884
|
-
return r !== e && !/* @__PURE__ */
|
|
882
|
+
function it(e, t, n) {
|
|
883
|
+
let r = nt(e), i = r[t]();
|
|
884
|
+
return r !== e && !/* @__PURE__ */ q(e) && (i._next = i.next, i.next = () => {
|
|
885
885
|
let e = i._next();
|
|
886
886
|
return e.done || (e.value = n(e.value)), e;
|
|
887
887
|
}), i;
|
|
888
888
|
}
|
|
889
|
-
var
|
|
890
|
-
function
|
|
891
|
-
let o =
|
|
892
|
-
if (c !==
|
|
889
|
+
var at = Array.prototype;
|
|
890
|
+
function ot(e, t, n, r, i, a) {
|
|
891
|
+
let o = nt(e), s = o !== e && !/* @__PURE__ */ q(e), c = o[t];
|
|
892
|
+
if (c !== at[t]) {
|
|
893
893
|
let t = c.apply(e, a);
|
|
894
|
-
return s ?
|
|
894
|
+
return s ? Ht(t) : t;
|
|
895
895
|
}
|
|
896
896
|
let l = n;
|
|
897
897
|
o !== e && (s ? l = function(t, r) {
|
|
898
|
-
return n.call(this,
|
|
898
|
+
return n.call(this, K(e, t), r, e);
|
|
899
899
|
} : n.length > 2 && (l = function(t, r) {
|
|
900
900
|
return n.call(this, t, r, e);
|
|
901
901
|
}));
|
|
902
902
|
let u = c.call(o, l, r);
|
|
903
903
|
return s && i ? i(u) : u;
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
let i =
|
|
905
|
+
function st(e, t, n, r) {
|
|
906
|
+
let i = nt(e), a = i !== e && !/* @__PURE__ */ q(e), o = n, s = !1;
|
|
907
907
|
i !== e && (a ? (s = r.length === 0, o = function(t, r, i) {
|
|
908
|
-
return s && (s = !1, t =
|
|
908
|
+
return s && (s = !1, t = K(e, t)), n.call(this, t, K(e, r), i, e);
|
|
909
909
|
}) : n.length > 3 && (o = function(t, r, i) {
|
|
910
910
|
return n.call(this, t, r, i, e);
|
|
911
911
|
}));
|
|
912
912
|
let c = i[t](o, ...r);
|
|
913
|
-
return s ?
|
|
913
|
+
return s ? K(e, c) : c;
|
|
914
914
|
}
|
|
915
|
-
function
|
|
916
|
-
let r = /* @__PURE__ */
|
|
917
|
-
|
|
915
|
+
function ct(e, t, n) {
|
|
916
|
+
let r = /* @__PURE__ */ J(e);
|
|
917
|
+
$e(r, "iterate", Qe);
|
|
918
918
|
let i = r[t](...n);
|
|
919
|
-
return (i === -1 || i === !1) && /* @__PURE__ */
|
|
919
|
+
return (i === -1 || i === !1) && /* @__PURE__ */ Bt(n[0]) ? (n[0] = /* @__PURE__ */ J(n[0]), r[t](...n)) : i;
|
|
920
920
|
}
|
|
921
|
-
function
|
|
922
|
-
|
|
923
|
-
let r = (/* @__PURE__ */
|
|
924
|
-
return
|
|
921
|
+
function lt(e, t, n = []) {
|
|
922
|
+
He(), Me();
|
|
923
|
+
let r = (/* @__PURE__ */ J(e))[t].apply(e, n);
|
|
924
|
+
return Ne(), Ue(), r;
|
|
925
925
|
}
|
|
926
|
-
var
|
|
927
|
-
function
|
|
928
|
-
|
|
929
|
-
let t = /* @__PURE__ */
|
|
930
|
-
return
|
|
926
|
+
var ut = /* @__PURE__ */ ie("__proto__,__v_isRef,__isVue"), dt = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(ue));
|
|
927
|
+
function ft(e) {
|
|
928
|
+
ue(e) || (e = String(e));
|
|
929
|
+
let t = /* @__PURE__ */ J(this);
|
|
930
|
+
return $e(t, "has", e), t.hasOwnProperty(e);
|
|
931
931
|
}
|
|
932
|
-
var
|
|
932
|
+
var pt = class {
|
|
933
933
|
constructor(e = !1, t = !1) {
|
|
934
934
|
this._isReadonly = e, this._isShallow = t;
|
|
935
935
|
}
|
|
@@ -939,60 +939,60 @@ var mt = class {
|
|
|
939
939
|
if (t === "__v_isReactive") return !r;
|
|
940
940
|
if (t === "__v_isReadonly") return r;
|
|
941
941
|
if (t === "__v_isShallow") return i;
|
|
942
|
-
if (t === "__v_raw") return n === (r ? i ?
|
|
943
|
-
let a =
|
|
942
|
+
if (t === "__v_raw") return n === (r ? i ? Mt : jt : i ? At : kt).get(e) || Object.getPrototypeOf(e) === Object.getPrototypeOf(n) ? e : void 0;
|
|
943
|
+
let a = I(e);
|
|
944
944
|
if (!r) {
|
|
945
945
|
let e;
|
|
946
|
-
if (a && (e =
|
|
947
|
-
if (t === "hasOwnProperty") return
|
|
946
|
+
if (a && (e = rt[t])) return e;
|
|
947
|
+
if (t === "hasOwnProperty") return ft;
|
|
948
948
|
}
|
|
949
|
-
let o = Reflect.get(e, t, /* @__PURE__ */
|
|
950
|
-
if ((
|
|
951
|
-
if (/* @__PURE__ */
|
|
952
|
-
let e = a &&
|
|
953
|
-
return r &&
|
|
949
|
+
let o = Reflect.get(e, t, /* @__PURE__ */ Wt(e) ? e : n);
|
|
950
|
+
if ((ue(t) ? dt.has(t) : ut(t)) || (r || $e(e, "get", t), i)) return o;
|
|
951
|
+
if (/* @__PURE__ */ Wt(o)) {
|
|
952
|
+
let e = a && V(t) ? o : o.value;
|
|
953
|
+
return r && de(e) ? /* @__PURE__ */ Ft(e) : e;
|
|
954
954
|
}
|
|
955
|
-
return
|
|
955
|
+
return de(o) ? r ? /* @__PURE__ */ Ft(o) : /* @__PURE__ */ Pt(o) : o;
|
|
956
956
|
}
|
|
957
|
-
},
|
|
957
|
+
}, mt = class extends pt {
|
|
958
958
|
constructor(e = !1) {
|
|
959
959
|
super(!1, e);
|
|
960
960
|
}
|
|
961
961
|
set(e, t, n, r) {
|
|
962
|
-
let i = e[t], a =
|
|
962
|
+
let i = e[t], a = I(e) && V(t);
|
|
963
963
|
if (!this._isShallow) {
|
|
964
964
|
let r = /* @__PURE__ */ zt(i);
|
|
965
|
-
if (!/* @__PURE__ */
|
|
965
|
+
if (!/* @__PURE__ */ q(n) && !/* @__PURE__ */ zt(n) && (i = /* @__PURE__ */ J(i), n = /* @__PURE__ */ J(n)), !a && /* @__PURE__ */ Wt(i) && !/* @__PURE__ */ Wt(n)) return r ? (process.env.NODE_ENV !== "production" && Ce(`Set operation on key "${String(t)}" failed: target is readonly.`, e[t]), !0) : (i.value = n, !0);
|
|
966
966
|
}
|
|
967
|
-
let o = a ? Number(t) < e.length :
|
|
968
|
-
return e === /* @__PURE__ */
|
|
967
|
+
let o = a ? Number(t) < e.length : F(e, t), s = Reflect.set(e, t, n, /* @__PURE__ */ Wt(e) ? e : r);
|
|
968
|
+
return e === /* @__PURE__ */ J(r) && s && (o ? ge(n, i) && et(e, "set", t, n, i) : et(e, "add", t, n)), s;
|
|
969
969
|
}
|
|
970
970
|
deleteProperty(e, t) {
|
|
971
|
-
let n =
|
|
972
|
-
return i && n &&
|
|
971
|
+
let n = F(e, t), r = e[t], i = Reflect.deleteProperty(e, t);
|
|
972
|
+
return i && n && et(e, "delete", t, void 0, r), i;
|
|
973
973
|
}
|
|
974
974
|
has(e, t) {
|
|
975
975
|
let n = Reflect.has(e, t);
|
|
976
|
-
return (!
|
|
976
|
+
return (!ue(t) || !dt.has(t)) && $e(e, "has", t), n;
|
|
977
977
|
}
|
|
978
978
|
ownKeys(e) {
|
|
979
|
-
return
|
|
979
|
+
return $e(e, "iterate", I(e) ? "length" : Xe), Reflect.ownKeys(e);
|
|
980
980
|
}
|
|
981
|
-
},
|
|
981
|
+
}, ht = class extends pt {
|
|
982
982
|
constructor(e = !1) {
|
|
983
983
|
super(!0, e);
|
|
984
984
|
}
|
|
985
985
|
set(e, t) {
|
|
986
|
-
return process.env.NODE_ENV !== "production" &&
|
|
986
|
+
return process.env.NODE_ENV !== "production" && Ce(`Set operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
987
987
|
}
|
|
988
988
|
deleteProperty(e, t) {
|
|
989
|
-
return process.env.NODE_ENV !== "production" &&
|
|
989
|
+
return process.env.NODE_ENV !== "production" && Ce(`Delete operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
990
990
|
}
|
|
991
|
-
},
|
|
992
|
-
function
|
|
991
|
+
}, gt = /* @__PURE__ */ new mt(), _t = /* @__PURE__ */ new ht(), vt = /* @__PURE__ */ new ht(!0), yt = (e) => e, bt = (e) => Reflect.getPrototypeOf(e);
|
|
992
|
+
function xt(e, t, n) {
|
|
993
993
|
return function(...r) {
|
|
994
|
-
let i = this.__v_raw, a = /* @__PURE__ */
|
|
995
|
-
return !t &&
|
|
994
|
+
let i = this.__v_raw, a = /* @__PURE__ */ J(i), o = ce(a), s = e === "entries" || e === Symbol.iterator && o, c = e === "keys" && o, l = i[e](...r), u = n ? yt : t ? Ut : Ht;
|
|
995
|
+
return !t && $e(a, "iterate", c ? Ze : Xe), N(Object.create(l), { next() {
|
|
996
996
|
let { value: e, done: t } = l.next();
|
|
997
997
|
return t ? {
|
|
998
998
|
value: e,
|
|
@@ -1004,64 +1004,64 @@ function St(e, t, n) {
|
|
|
1004
1004
|
} });
|
|
1005
1005
|
};
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function St(e) {
|
|
1008
1008
|
return function(...t) {
|
|
1009
1009
|
if (process.env.NODE_ENV !== "production") {
|
|
1010
1010
|
let n = t[0] ? `on key "${t[0]}" ` : "";
|
|
1011
|
-
|
|
1011
|
+
Ce(`${he(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */ J(this));
|
|
1012
1012
|
}
|
|
1013
1013
|
return e === "delete" ? !1 : e === "clear" ? void 0 : this;
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1016
|
+
function Ct(e, t) {
|
|
1017
1017
|
let n = {
|
|
1018
1018
|
get(n) {
|
|
1019
|
-
let r = this.__v_raw, i = /* @__PURE__ */
|
|
1020
|
-
e || (
|
|
1021
|
-
let { has: o } =
|
|
1019
|
+
let r = this.__v_raw, i = /* @__PURE__ */ J(r), a = /* @__PURE__ */ J(n);
|
|
1020
|
+
e || (ge(n, a) && $e(i, "get", n), $e(i, "get", a));
|
|
1021
|
+
let { has: o } = bt(i), s = t ? yt : e ? Ut : Ht;
|
|
1022
1022
|
if (o.call(i, n)) return s(r.get(n));
|
|
1023
1023
|
if (o.call(i, a)) return s(r.get(a));
|
|
1024
1024
|
r !== i && r.get(n);
|
|
1025
1025
|
},
|
|
1026
1026
|
get size() {
|
|
1027
1027
|
let t = this.__v_raw;
|
|
1028
|
-
return !e &&
|
|
1028
|
+
return !e && $e(/* @__PURE__ */ J(t), "iterate", Xe), t.size;
|
|
1029
1029
|
},
|
|
1030
1030
|
has(t) {
|
|
1031
|
-
let n = this.__v_raw, r = /* @__PURE__ */
|
|
1032
|
-
return e || (
|
|
1031
|
+
let n = this.__v_raw, r = /* @__PURE__ */ J(n), i = /* @__PURE__ */ J(t);
|
|
1032
|
+
return e || (ge(t, i) && $e(r, "has", t), $e(r, "has", i)), t === i ? n.has(t) : n.has(t) || n.has(i);
|
|
1033
1033
|
},
|
|
1034
1034
|
forEach(n, r) {
|
|
1035
|
-
let i = this, a = i.__v_raw, o = /* @__PURE__ */
|
|
1036
|
-
return !e &&
|
|
1035
|
+
let i = this, a = i.__v_raw, o = /* @__PURE__ */ J(a), s = t ? yt : e ? Ut : Ht;
|
|
1036
|
+
return !e && $e(o, "iterate", Xe), a.forEach((e, t) => n.call(r, s(e), s(t), i));
|
|
1037
1037
|
}
|
|
1038
1038
|
};
|
|
1039
|
-
return
|
|
1040
|
-
add:
|
|
1041
|
-
set:
|
|
1042
|
-
delete:
|
|
1043
|
-
clear:
|
|
1039
|
+
return N(n, e ? {
|
|
1040
|
+
add: St("add"),
|
|
1041
|
+
set: St("set"),
|
|
1042
|
+
delete: St("delete"),
|
|
1043
|
+
clear: St("clear")
|
|
1044
1044
|
} : {
|
|
1045
1045
|
add(e) {
|
|
1046
|
-
let n = /* @__PURE__ */
|
|
1047
|
-
return r.has.call(n, a) ||
|
|
1046
|
+
let n = /* @__PURE__ */ J(this), r = bt(n), i = /* @__PURE__ */ J(e), a = !t && !/* @__PURE__ */ q(e) && !/* @__PURE__ */ zt(e) ? i : e;
|
|
1047
|
+
return r.has.call(n, a) || ge(e, a) && r.has.call(n, e) || ge(i, a) && r.has.call(n, i) || (n.add(a), et(n, "add", a, a)), this;
|
|
1048
1048
|
},
|
|
1049
1049
|
set(e, n) {
|
|
1050
|
-
!t && !/* @__PURE__ */
|
|
1051
|
-
let r = /* @__PURE__ */
|
|
1052
|
-
o ? process.env.NODE_ENV !== "production" &&
|
|
1050
|
+
!t && !/* @__PURE__ */ q(n) && !/* @__PURE__ */ zt(n) && (n = /* @__PURE__ */ J(n));
|
|
1051
|
+
let r = /* @__PURE__ */ J(this), { has: i, get: a } = bt(r), o = i.call(r, e);
|
|
1052
|
+
o ? process.env.NODE_ENV !== "production" && Ot(r, i, e) : (e = /* @__PURE__ */ J(e), o = i.call(r, e));
|
|
1053
1053
|
let s = a.call(r, e);
|
|
1054
|
-
return r.set(e, n), o ?
|
|
1054
|
+
return r.set(e, n), o ? ge(n, s) && et(r, "set", e, n, s) : et(r, "add", e, n), this;
|
|
1055
1055
|
},
|
|
1056
1056
|
delete(e) {
|
|
1057
|
-
let t = /* @__PURE__ */
|
|
1058
|
-
i ? process.env.NODE_ENV !== "production" &&
|
|
1057
|
+
let t = /* @__PURE__ */ J(this), { has: n, get: r } = bt(t), i = n.call(t, e);
|
|
1058
|
+
i ? process.env.NODE_ENV !== "production" && Ot(t, n, e) : (e = /* @__PURE__ */ J(e), i = n.call(t, e));
|
|
1059
1059
|
let a = r ? r.call(t, e) : void 0, o = t.delete(e);
|
|
1060
|
-
return i &&
|
|
1060
|
+
return i && et(t, "delete", e, void 0, a), o;
|
|
1061
1061
|
},
|
|
1062
1062
|
clear() {
|
|
1063
|
-
let e = /* @__PURE__ */
|
|
1064
|
-
return t &&
|
|
1063
|
+
let e = /* @__PURE__ */ J(this), t = e.size !== 0, n = process.env.NODE_ENV === "production" ? void 0 : ce(e) ? new Map(e) : new Set(e), r = e.clear();
|
|
1064
|
+
return t && et(e, "clear", void 0, void 0, n), r;
|
|
1065
1065
|
}
|
|
1066
1066
|
}), [
|
|
1067
1067
|
"keys",
|
|
@@ -1069,23 +1069,23 @@ function wt(e, t) {
|
|
|
1069
1069
|
"entries",
|
|
1070
1070
|
Symbol.iterator
|
|
1071
1071
|
].forEach((r) => {
|
|
1072
|
-
n[r] =
|
|
1072
|
+
n[r] = xt(r, e, t);
|
|
1073
1073
|
}), n;
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1076
|
-
let n =
|
|
1077
|
-
return (t, r, i) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? t : Reflect.get(
|
|
1075
|
+
function wt(e, t) {
|
|
1076
|
+
let n = Ct(e, t);
|
|
1077
|
+
return (t, r, i) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? t : Reflect.get(F(n, r) && r in t ? n : t, r, i);
|
|
1078
1078
|
}
|
|
1079
|
-
var
|
|
1080
|
-
function
|
|
1081
|
-
let r = /* @__PURE__ */
|
|
1079
|
+
var Tt = { get: /* @__PURE__ */ wt(!1, !1) }, Et = { get: /* @__PURE__ */ wt(!0, !1) }, Dt = { get: /* @__PURE__ */ wt(!0, !0) };
|
|
1080
|
+
function Ot(e, t, n) {
|
|
1081
|
+
let r = /* @__PURE__ */ J(n);
|
|
1082
1082
|
if (r !== n && t.call(e, r)) {
|
|
1083
|
-
let t =
|
|
1084
|
-
|
|
1083
|
+
let t = z(e);
|
|
1084
|
+
Ce(`Reactive ${t} contains both the raw and reactive versions of the same object${t === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
|
-
var
|
|
1088
|
-
function
|
|
1087
|
+
var kt = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), jt = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap();
|
|
1088
|
+
function Nt(e) {
|
|
1089
1089
|
switch (e) {
|
|
1090
1090
|
case "Object":
|
|
1091
1091
|
case "Array": return 1;
|
|
@@ -1097,70 +1097,70 @@ function Pt(e) {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
// @__NO_SIDE_EFFECTS__
|
|
1100
|
-
function
|
|
1101
|
-
return /* @__PURE__ */ zt(e) ? e :
|
|
1100
|
+
function Pt(e) {
|
|
1101
|
+
return /* @__PURE__ */ zt(e) ? e : Lt(e, !1, gt, Tt, kt);
|
|
1102
1102
|
}
|
|
1103
1103
|
// @__NO_SIDE_EFFECTS__
|
|
1104
|
-
function
|
|
1105
|
-
return
|
|
1104
|
+
function Ft(e) {
|
|
1105
|
+
return Lt(e, !0, _t, Et, jt);
|
|
1106
1106
|
}
|
|
1107
1107
|
// @__NO_SIDE_EFFECTS__
|
|
1108
|
-
function
|
|
1109
|
-
return
|
|
1108
|
+
function It(e) {
|
|
1109
|
+
return Lt(e, !0, vt, Dt, Mt);
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
if (!
|
|
1111
|
+
function Lt(e, t, n, r, i) {
|
|
1112
|
+
if (!de(e)) return process.env.NODE_ENV !== "production" && Ce(`value cannot be made ${t ? "readonly" : "reactive"}: ${String(e)}`), e;
|
|
1113
1113
|
if (e.__v_raw && !(t && e.__v_isReactive) || e.__v_skip || !Object.isExtensible(e)) return e;
|
|
1114
1114
|
let a = i.get(e);
|
|
1115
1115
|
if (a) return a;
|
|
1116
|
-
let o =
|
|
1116
|
+
let o = Nt(z(e));
|
|
1117
1117
|
if (o === 0) return e;
|
|
1118
1118
|
let s = new Proxy(e, o === 2 ? r : n);
|
|
1119
1119
|
return i.set(e, s), s;
|
|
1120
1120
|
}
|
|
1121
1121
|
// @__NO_SIDE_EFFECTS__
|
|
1122
|
-
function
|
|
1123
|
-
return /* @__PURE__ */ zt(e) ? /* @__PURE__ */
|
|
1122
|
+
function Rt(e) {
|
|
1123
|
+
return /* @__PURE__ */ zt(e) ? /* @__PURE__ */ Rt(e.__v_raw) : !!(e && e.__v_isReactive);
|
|
1124
1124
|
}
|
|
1125
1125
|
// @__NO_SIDE_EFFECTS__
|
|
1126
1126
|
function zt(e) {
|
|
1127
1127
|
return !!(e && e.__v_isReadonly);
|
|
1128
1128
|
}
|
|
1129
1129
|
// @__NO_SIDE_EFFECTS__
|
|
1130
|
-
function
|
|
1130
|
+
function q(e) {
|
|
1131
1131
|
return !!(e && e.__v_isShallow);
|
|
1132
1132
|
}
|
|
1133
1133
|
// @__NO_SIDE_EFFECTS__
|
|
1134
|
-
function
|
|
1134
|
+
function Bt(e) {
|
|
1135
1135
|
return e ? !!e.__v_raw : !1;
|
|
1136
1136
|
}
|
|
1137
1137
|
// @__NO_SIDE_EFFECTS__
|
|
1138
|
-
function
|
|
1138
|
+
function J(e) {
|
|
1139
1139
|
let t = e && e.__v_raw;
|
|
1140
|
-
return t ? /* @__PURE__ */
|
|
1140
|
+
return t ? /* @__PURE__ */ J(t) : e;
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
return !
|
|
1142
|
+
function Vt(e) {
|
|
1143
|
+
return !F(e, "__v_skip") && Object.isExtensible(e) && _e(e, "__v_skip", !0), e;
|
|
1144
1144
|
}
|
|
1145
|
-
var
|
|
1145
|
+
var Ht = (e) => de(e) ? /* @__PURE__ */ Pt(e) : e, Ut = (e) => de(e) ? /* @__PURE__ */ Ft(e) : e;
|
|
1146
1146
|
// @__NO_SIDE_EFFECTS__
|
|
1147
|
-
function
|
|
1147
|
+
function Wt(e) {
|
|
1148
1148
|
return e ? e.__v_isRef === !0 : !1;
|
|
1149
1149
|
}
|
|
1150
1150
|
// @__NO_SIDE_EFFECTS__
|
|
1151
|
-
function
|
|
1151
|
+
function Gt(e) {
|
|
1152
1152
|
return Kt(e, !1);
|
|
1153
1153
|
}
|
|
1154
1154
|
// @__NO_SIDE_EFFECTS__
|
|
1155
|
-
function
|
|
1155
|
+
function Y(e) {
|
|
1156
1156
|
return Kt(e, !0);
|
|
1157
1157
|
}
|
|
1158
1158
|
function Kt(e, t) {
|
|
1159
|
-
return /* @__PURE__ */
|
|
1159
|
+
return /* @__PURE__ */ Wt(e) ? e : new qt(e, t);
|
|
1160
1160
|
}
|
|
1161
1161
|
var qt = class {
|
|
1162
1162
|
constructor(e, t) {
|
|
1163
|
-
this.dep = new
|
|
1163
|
+
this.dep = new qe(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = t ? e : /* @__PURE__ */ J(e), this._value = t ? e : Ht(e), this.__v_isShallow = t;
|
|
1164
1164
|
}
|
|
1165
1165
|
get value() {
|
|
1166
1166
|
return process.env.NODE_ENV === "production" ? this.dep.track() : this.dep.track({
|
|
@@ -1170,8 +1170,8 @@ var qt = class {
|
|
|
1170
1170
|
}), this._value;
|
|
1171
1171
|
}
|
|
1172
1172
|
set value(e) {
|
|
1173
|
-
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */
|
|
1174
|
-
e = n ? e : /* @__PURE__ */
|
|
1173
|
+
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */ q(e) || /* @__PURE__ */ zt(e);
|
|
1174
|
+
e = n ? e : /* @__PURE__ */ J(e), ge(e, t) && (this._rawValue = e, this._value = n ? e : Ht(e), process.env.NODE_ENV === "production" ? this.dep.trigger() : this.dep.trigger({
|
|
1175
1175
|
target: this,
|
|
1176
1176
|
type: "set",
|
|
1177
1177
|
key: "value",
|
|
@@ -1189,24 +1189,24 @@ function Jt(e) {
|
|
|
1189
1189
|
}));
|
|
1190
1190
|
}
|
|
1191
1191
|
function Yt(e) {
|
|
1192
|
-
return /* @__PURE__ */
|
|
1192
|
+
return /* @__PURE__ */ Wt(e) ? e.value : e;
|
|
1193
1193
|
}
|
|
1194
1194
|
var Xt = {
|
|
1195
1195
|
get: (e, t, n) => t === "__v_raw" ? e : Yt(Reflect.get(e, t, n)),
|
|
1196
1196
|
set: (e, t, n, r) => {
|
|
1197
1197
|
let i = e[t];
|
|
1198
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ Wt(i) && !/* @__PURE__ */ Wt(n) ? (i.value = n, !0) : Reflect.set(e, t, n, r);
|
|
1199
1199
|
}
|
|
1200
1200
|
};
|
|
1201
1201
|
function Zt(e) {
|
|
1202
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ Rt(e) ? e : new Proxy(e, Xt);
|
|
1203
1203
|
}
|
|
1204
1204
|
var Qt = class {
|
|
1205
1205
|
constructor(e, t, n) {
|
|
1206
|
-
this.fn = e, this.setter = t, this._value = void 0, this.dep = new
|
|
1206
|
+
this.fn = e, this.setter = t, this._value = void 0, this.dep = new qe(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = Ge - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !t, this.isSSR = n;
|
|
1207
1207
|
}
|
|
1208
1208
|
notify() {
|
|
1209
|
-
if (this.flags |= 16, !(this.flags & 8) &&
|
|
1209
|
+
if (this.flags |= 16, !(this.flags & 8) && G !== this) return je(this, !0), !0;
|
|
1210
1210
|
process.env.NODE_ENV;
|
|
1211
1211
|
}
|
|
1212
1212
|
get value() {
|
|
@@ -1215,16 +1215,16 @@ var Qt = class {
|
|
|
1215
1215
|
type: "get",
|
|
1216
1216
|
key: "value"
|
|
1217
1217
|
});
|
|
1218
|
-
return
|
|
1218
|
+
return Le(this), e && (e.version = this.dep.version), this._value;
|
|
1219
1219
|
}
|
|
1220
1220
|
set value(e) {
|
|
1221
|
-
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" &&
|
|
1221
|
+
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" && Ce("Write operation failed: computed value is readonly");
|
|
1222
1222
|
}
|
|
1223
1223
|
};
|
|
1224
1224
|
// @__NO_SIDE_EFFECTS__
|
|
1225
1225
|
function $t(e, t, n = !1) {
|
|
1226
1226
|
let r, i;
|
|
1227
|
-
|
|
1227
|
+
R(e) ? r = e : (r = e.get, i = e.set);
|
|
1228
1228
|
let a = new Qt(r, i, n);
|
|
1229
1229
|
return process.env.NODE_ENV !== "production" && t && !n && (a.onTrack = t.onTrack, a.onTrigger = t.onTrigger), a;
|
|
1230
1230
|
}
|
|
@@ -1233,24 +1233,24 @@ function rn(e, t = !1, n = nn) {
|
|
|
1233
1233
|
if (n) {
|
|
1234
1234
|
let t = tn.get(n);
|
|
1235
1235
|
t || tn.set(n, t = []), t.push(e);
|
|
1236
|
-
} else process.env.NODE_ENV !== "production" && !t &&
|
|
1236
|
+
} else process.env.NODE_ENV !== "production" && !t && Ce("onWatcherCleanup() was called when there was no active watcher to associate with.");
|
|
1237
1237
|
}
|
|
1238
|
-
function an(e, t, n =
|
|
1238
|
+
function an(e, t, n = ae) {
|
|
1239
1239
|
let { immediate: r, deep: i, once: a, scheduler: o, augmentJob: s, call: c } = n, l = (e) => {
|
|
1240
|
-
(n.onWarn ||
|
|
1241
|
-
}, u = (e) => i ? e : /* @__PURE__ */
|
|
1242
|
-
if (/* @__PURE__ */
|
|
1243
|
-
if (/* @__PURE__ */
|
|
1244
|
-
if (/* @__PURE__ */
|
|
1245
|
-
if (
|
|
1240
|
+
(n.onWarn || Ce)("Invalid watch source: ", e, "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.");
|
|
1241
|
+
}, u = (e) => i ? e : /* @__PURE__ */ q(e) || i === !1 || i === 0 ? on(e, 1) : on(e), d, f, p, m, h = !1, g = !1;
|
|
1242
|
+
if (/* @__PURE__ */ Wt(e) ? (f = () => e.value, h = /* @__PURE__ */ q(e)) : /* @__PURE__ */ Rt(e) ? (f = () => u(e), h = !0) : I(e) ? (g = !0, h = e.some((e) => /* @__PURE__ */ Rt(e) || /* @__PURE__ */ q(e)), f = () => e.map((e) => {
|
|
1243
|
+
if (/* @__PURE__ */ Wt(e)) return e.value;
|
|
1244
|
+
if (/* @__PURE__ */ Rt(e)) return u(e);
|
|
1245
|
+
if (R(e)) return c ? c(e, 2) : e();
|
|
1246
1246
|
process.env.NODE_ENV !== "production" && l(e);
|
|
1247
|
-
})) :
|
|
1247
|
+
})) : R(e) ? f = t ? c ? () => c(e, 2) : e : () => {
|
|
1248
1248
|
if (p) {
|
|
1249
|
-
|
|
1249
|
+
He();
|
|
1250
1250
|
try {
|
|
1251
1251
|
p();
|
|
1252
1252
|
} finally {
|
|
1253
|
-
|
|
1253
|
+
Ue();
|
|
1254
1254
|
}
|
|
1255
1255
|
}
|
|
1256
1256
|
let t = nn;
|
|
@@ -1260,12 +1260,12 @@ function an(e, t, n = oe) {
|
|
|
1260
1260
|
} finally {
|
|
1261
1261
|
nn = t;
|
|
1262
1262
|
}
|
|
1263
|
-
} : (f =
|
|
1263
|
+
} : (f = j, process.env.NODE_ENV !== "production" && l(e)), t && i) {
|
|
1264
1264
|
let e = f, t = i === !0 ? Infinity : i;
|
|
1265
1265
|
f = () => on(e(), t);
|
|
1266
1266
|
}
|
|
1267
|
-
let _ =
|
|
1268
|
-
d.stop(), _ && _.active &&
|
|
1267
|
+
let _ = Te(), v = () => {
|
|
1268
|
+
d.stop(), _ && _.active && se(_.effects, d);
|
|
1269
1269
|
};
|
|
1270
1270
|
if (a && t) {
|
|
1271
1271
|
let e = t;
|
|
@@ -1277,7 +1277,7 @@ function an(e, t, n = oe) {
|
|
|
1277
1277
|
let y = g ? Array(e.length).fill(en) : en, b = (e) => {
|
|
1278
1278
|
if (!(!(d.flags & 1) || !d.dirty && !e)) if (t) {
|
|
1279
1279
|
let n = d.run();
|
|
1280
|
-
if (e || i || h || (g ? n.some((e, t) =>
|
|
1280
|
+
if (e || i || h || (g ? n.some((e, t) => ge(e, y[t])) : ge(n, y))) {
|
|
1281
1281
|
p && p();
|
|
1282
1282
|
let e = nn;
|
|
1283
1283
|
nn = d;
|
|
@@ -1294,7 +1294,7 @@ function an(e, t, n = oe) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
} else d.run();
|
|
1296
1296
|
};
|
|
1297
|
-
return s && s(b), d = new
|
|
1297
|
+
return s && s(b), d = new De(f), d.scheduler = o ? () => o(b, !1) : b, m = (e) => rn(e, !1, d), p = d.onStop = () => {
|
|
1298
1298
|
let e = tn.get(d);
|
|
1299
1299
|
if (e) {
|
|
1300
1300
|
if (c) c(e, 4);
|
|
@@ -1304,13 +1304,13 @@ function an(e, t, n = oe) {
|
|
|
1304
1304
|
}, process.env.NODE_ENV !== "production" && (d.onTrack = n.onTrack, d.onTrigger = n.onTrigger), t ? r ? b(!0) : y = d.run() : o ? o(b.bind(null, !0), !0) : d.run(), v.pause = d.pause.bind(d), v.resume = d.resume.bind(d), v.stop = v, v;
|
|
1305
1305
|
}
|
|
1306
1306
|
function on(e, t = Infinity, n) {
|
|
1307
|
-
if (t <= 0 || !
|
|
1308
|
-
if (n.set(e, t), t--, /* @__PURE__ */
|
|
1309
|
-
else if (
|
|
1310
|
-
else if (
|
|
1307
|
+
if (t <= 0 || !de(e) || e.__v_skip || (n ||= /* @__PURE__ */ new Map(), (n.get(e) || 0) >= t)) return e;
|
|
1308
|
+
if (n.set(e, t), t--, /* @__PURE__ */ Wt(e)) on(e.value, t, n);
|
|
1309
|
+
else if (I(e)) for (let r = 0; r < e.length; r++) on(e[r], t, n);
|
|
1310
|
+
else if (L(e) || ce(e)) e.forEach((e) => {
|
|
1311
1311
|
on(e, t, n);
|
|
1312
1312
|
});
|
|
1313
|
-
else if (
|
|
1313
|
+
else if (B(e)) {
|
|
1314
1314
|
for (let r in e) on(e[r], t, n);
|
|
1315
1315
|
for (let r of Object.getOwnPropertySymbols(e)) Object.prototype.propertyIsEnumerable.call(e, r) && on(e[r], t, n);
|
|
1316
1316
|
}
|
|
@@ -1325,11 +1325,11 @@ function cn(e) {
|
|
|
1325
1325
|
function ln() {
|
|
1326
1326
|
sn.pop();
|
|
1327
1327
|
}
|
|
1328
|
-
var
|
|
1329
|
-
function
|
|
1330
|
-
if (
|
|
1331
|
-
|
|
1332
|
-
let n = sn.length ? sn[sn.length - 1].component : null, r = n && n.appContext.config.warnHandler, i =
|
|
1328
|
+
var un = !1;
|
|
1329
|
+
function dn(e, ...t) {
|
|
1330
|
+
if (un) return;
|
|
1331
|
+
un = !0, He();
|
|
1332
|
+
let n = sn.length ? sn[sn.length - 1].component : null, r = n && n.appContext.config.warnHandler, i = X();
|
|
1333
1333
|
if (r) _n(r, n, 11, [
|
|
1334
1334
|
e + t.map((e) => e.toString?.call(e) ?? JSON.stringify(e)).join(""),
|
|
1335
1335
|
n && n.proxy,
|
|
@@ -1340,9 +1340,9 @@ function un(e, ...t) {
|
|
|
1340
1340
|
let n = [`[Vue warn]: ${e}`, ...t];
|
|
1341
1341
|
i.length && n.push("\n", ...fn(i)), console.warn(...n);
|
|
1342
1342
|
}
|
|
1343
|
-
|
|
1343
|
+
Ue(), un = !1;
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function X() {
|
|
1346
1346
|
let e = sn[sn.length - 1];
|
|
1347
1347
|
if (!e) return [];
|
|
1348
1348
|
let t = [];
|
|
@@ -1378,11 +1378,11 @@ function mn(e) {
|
|
|
1378
1378
|
}), n.length > 3 && t.push(" ..."), t;
|
|
1379
1379
|
}
|
|
1380
1380
|
function hn(e, t, n) {
|
|
1381
|
-
return
|
|
1381
|
+
return le(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ Wt(t) ? (t = hn(e, /* @__PURE__ */ J(t.value), !0), n ? t : [
|
|
1382
1382
|
`${e}=Ref<`,
|
|
1383
1383
|
t,
|
|
1384
1384
|
">"
|
|
1385
|
-
]) :
|
|
1385
|
+
]) : R(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */ J(t), n ? t : [`${e}=`, t]);
|
|
1386
1386
|
}
|
|
1387
1387
|
var gn = {
|
|
1388
1388
|
sp: "serverPrefetch hook",
|
|
@@ -1425,20 +1425,20 @@ function _n(e, t, n, r) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
function vn(e, t, n, r) {
|
|
1428
|
-
if (
|
|
1428
|
+
if (R(e)) {
|
|
1429
1429
|
let i = _n(e, t, n, r);
|
|
1430
|
-
return i &&
|
|
1430
|
+
return i && fe(i) && i.catch((e) => {
|
|
1431
1431
|
yn(e, t, n);
|
|
1432
1432
|
}), i;
|
|
1433
1433
|
}
|
|
1434
|
-
if (
|
|
1434
|
+
if (I(e)) {
|
|
1435
1435
|
let i = [];
|
|
1436
1436
|
for (let a = 0; a < e.length; a++) i.push(vn(e[a], t, n, r));
|
|
1437
1437
|
return i;
|
|
1438
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
1438
|
+
} else process.env.NODE_ENV !== "production" && dn(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`);
|
|
1439
1439
|
}
|
|
1440
1440
|
function yn(e, t, n, r = !0) {
|
|
1441
|
-
let i = t ? t.vnode : null, { errorHandler: a, throwUnhandledErrorInProduction: o } = t && t.appContext.config ||
|
|
1441
|
+
let i = t ? t.vnode : null, { errorHandler: a, throwUnhandledErrorInProduction: o } = t && t.appContext.config || ae;
|
|
1442
1442
|
if (t) {
|
|
1443
1443
|
let r = t.parent, i = t.proxy, o = process.env.NODE_ENV === "production" ? `https://vuejs.org/error-reference/#runtime-${n}` : gn[n];
|
|
1444
1444
|
for (; r;) {
|
|
@@ -1449,11 +1449,11 @@ function yn(e, t, n, r = !0) {
|
|
|
1449
1449
|
r = r.parent;
|
|
1450
1450
|
}
|
|
1451
1451
|
if (a) {
|
|
1452
|
-
|
|
1452
|
+
He(), _n(a, null, 10, [
|
|
1453
1453
|
e,
|
|
1454
1454
|
i,
|
|
1455
1455
|
o
|
|
1456
|
-
]),
|
|
1456
|
+
]), Ue();
|
|
1457
1457
|
return;
|
|
1458
1458
|
}
|
|
1459
1459
|
}
|
|
@@ -1462,7 +1462,7 @@ function yn(e, t, n, r = !0) {
|
|
|
1462
1462
|
function bn(e, t, n, r = !0, i = !1) {
|
|
1463
1463
|
if (process.env.NODE_ENV !== "production") {
|
|
1464
1464
|
let i = gn[t];
|
|
1465
|
-
if (n && cn(n),
|
|
1465
|
+
if (n && cn(n), dn(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && ln(), r) throw e;
|
|
1466
1466
|
console.error(e);
|
|
1467
1467
|
} else if (i) throw e;
|
|
1468
1468
|
else console.error(e);
|
|
@@ -1490,7 +1490,7 @@ function Mn() {
|
|
|
1490
1490
|
Dn ||= En.then(In);
|
|
1491
1491
|
}
|
|
1492
1492
|
function Nn(e) {
|
|
1493
|
-
|
|
1493
|
+
I(e) ? Cn.push(...e) : wn && e.id === -1 ? wn.splice(Tn + 1, 0, e) : e.flags & 1 || (Cn.push(e), e.flags |= 1), Mn();
|
|
1494
1494
|
}
|
|
1495
1495
|
function Pn(e) {
|
|
1496
1496
|
if (Cn.length) {
|
|
@@ -1509,7 +1509,7 @@ function Pn(e) {
|
|
|
1509
1509
|
var Fn = (e) => e.id == null ? e.flags & 2 ? -1 : Infinity : e.id;
|
|
1510
1510
|
function In(e) {
|
|
1511
1511
|
process.env.NODE_ENV !== "production" && (e ||= /* @__PURE__ */ new Map());
|
|
1512
|
-
let t = process.env.NODE_ENV === "production" ?
|
|
1512
|
+
let t = process.env.NODE_ENV === "production" ? j : (t) => Ln(e, t);
|
|
1513
1513
|
try {
|
|
1514
1514
|
for (Sn = 0; Sn < xn.length; Sn++) {
|
|
1515
1515
|
let e = xn[Sn];
|
|
@@ -1535,7 +1535,7 @@ function Ln(e, t) {
|
|
|
1535
1535
|
return e.set(t, n + 1), !1;
|
|
1536
1536
|
}
|
|
1537
1537
|
var Rn = /* @__PURE__ */ new Map();
|
|
1538
|
-
process.env.NODE_ENV !== "production" && (
|
|
1538
|
+
process.env.NODE_ENV !== "production" && (ye().__VUE_HMR_RUNTIME__ = {
|
|
1539
1539
|
createRecord: Gn(Bn),
|
|
1540
1540
|
rerender: Gn(Hn),
|
|
1541
1541
|
reload: Gn(Un)
|
|
@@ -1572,7 +1572,7 @@ function Un(e, t) {
|
|
|
1572
1572
|
});
|
|
1573
1573
|
}
|
|
1574
1574
|
function Wn(e, t) {
|
|
1575
|
-
|
|
1575
|
+
N(e, t);
|
|
1576
1576
|
for (let n in e) n !== "__file" && !(n in t) && delete e[n];
|
|
1577
1577
|
}
|
|
1578
1578
|
function Gn(e) {
|
|
@@ -1598,21 +1598,21 @@ function Zn(e, t, n = !1) {
|
|
|
1598
1598
|
if (r || Sr) {
|
|
1599
1599
|
let i = Sr ? Sr._context.provides : r ? r.parent == null || r.ce ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : void 0;
|
|
1600
1600
|
if (i && e in i) return i[e];
|
|
1601
|
-
if (arguments.length > 1) return n &&
|
|
1602
|
-
process.env.NODE_ENV !== "production" &&
|
|
1603
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
1601
|
+
if (arguments.length > 1) return n && R(t) ? t.call(r && r.proxy) : t;
|
|
1602
|
+
process.env.NODE_ENV !== "production" && dn(`injection "${String(e)}" not found.`);
|
|
1603
|
+
} else process.env.NODE_ENV !== "production" && dn("inject() can only be used inside setup() or functional components.");
|
|
1604
1604
|
}
|
|
1605
1605
|
var Qn = /* @__PURE__ */ Symbol.for("v-scx"), $n = () => {
|
|
1606
1606
|
{
|
|
1607
1607
|
let e = Zn(Qn);
|
|
1608
|
-
return e || process.env.NODE_ENV !== "production" &&
|
|
1608
|
+
return e || process.env.NODE_ENV !== "production" && dn("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."), e;
|
|
1609
1609
|
}
|
|
1610
1610
|
};
|
|
1611
|
-
function er(e, t, n =
|
|
1611
|
+
function er(e, t, n = ae) {
|
|
1612
1612
|
let { immediate: r, deep: i, flush: a, once: o } = n;
|
|
1613
|
-
process.env.NODE_ENV !== "production" && !t && (r !== void 0 &&
|
|
1614
|
-
let s =
|
|
1615
|
-
process.env.NODE_ENV !== "production" && (s.onWarn =
|
|
1613
|
+
process.env.NODE_ENV !== "production" && !t && (r !== void 0 && dn("watch() \"immediate\" option is only respected when using the watch(source, callback, options?) signature."), i !== void 0 && dn("watch() \"deep\" option is only respected when using the watch(source, callback, options?) signature."), o !== void 0 && dn("watch() \"once\" option is only respected when using the watch(source, callback, options?) signature."));
|
|
1614
|
+
let s = N({}, n);
|
|
1615
|
+
process.env.NODE_ENV !== "production" && (s.onWarn = dn);
|
|
1616
1616
|
let c = t && r || !t && a !== "post", l;
|
|
1617
1617
|
if (Xr) {
|
|
1618
1618
|
if (a === "sync") {
|
|
@@ -1620,7 +1620,7 @@ function er(e, t, n = oe) {
|
|
|
1620
1620
|
l = e.__watcherHandles ||= [];
|
|
1621
1621
|
} else if (!c) {
|
|
1622
1622
|
let e = () => {};
|
|
1623
|
-
return e.stop =
|
|
1623
|
+
return e.stop = j, e.resume = j, e.pause = j, e;
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
let u = Gr;
|
|
@@ -1637,8 +1637,8 @@ function er(e, t, n = oe) {
|
|
|
1637
1637
|
return Xr && (l ? l.push(f) : c && f()), f;
|
|
1638
1638
|
}
|
|
1639
1639
|
function tr(e, t, n) {
|
|
1640
|
-
let r = this.proxy, i =
|
|
1641
|
-
|
|
1640
|
+
let r = this.proxy, i = le(e) ? e.includes(".") ? nr(r, e) : () => r[e] : e.bind(r, r), a;
|
|
1641
|
+
R(t) ? a = t : (a = t.handler, n = t);
|
|
1642
1642
|
let o = Jr(this), s = er(i, a.bind(r), n);
|
|
1643
1643
|
return o(), s;
|
|
1644
1644
|
}
|
|
@@ -1654,15 +1654,15 @@ var rr = (e) => e.__isTeleport;
|
|
|
1654
1654
|
function ir(e, t) {
|
|
1655
1655
|
e.shapeFlag & 6 && e.component ? (e.transition = t, ir(e.component.subTree, t)) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
|
|
1656
1656
|
}
|
|
1657
|
-
|
|
1658
|
-
var ar = /* @__PURE__ */ Symbol.for("v-ndc"), or = (e) => e ? Yr(e) ? Zr(e) : or(e.parent) : null, sr = /* @__PURE__ */
|
|
1657
|
+
ye().requestIdleCallback, ye().cancelIdleCallback;
|
|
1658
|
+
var ar = /* @__PURE__ */ Symbol.for("v-ndc"), or = (e) => e ? Yr(e) ? Zr(e) : or(e.parent) : null, sr = /* @__PURE__ */ N(/* @__PURE__ */ Object.create(null), {
|
|
1659
1659
|
$: (e) => e,
|
|
1660
1660
|
$el: (e) => e.vnode.el,
|
|
1661
1661
|
$data: (e) => e.data,
|
|
1662
|
-
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */
|
|
1663
|
-
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */
|
|
1664
|
-
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */
|
|
1665
|
-
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */
|
|
1662
|
+
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */ It(e.props),
|
|
1663
|
+
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */ It(e.attrs),
|
|
1664
|
+
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */ It(e.slots),
|
|
1665
|
+
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */ It(e.refs),
|
|
1666
1666
|
$parent: (e) => or(e.parent),
|
|
1667
1667
|
$root: (e) => or(e.root),
|
|
1668
1668
|
$host: (e) => e.ce,
|
|
@@ -1673,7 +1673,7 @@ var ar = /* @__PURE__ */ Symbol.for("v-ndc"), or = (e) => e ? Yr(e) ? Zr(e) : or
|
|
|
1673
1673
|
},
|
|
1674
1674
|
$nextTick: (e) => e.n ||= kn.bind(e.proxy),
|
|
1675
1675
|
$watch: (e) => tr.bind(e)
|
|
1676
|
-
}), cr = (e, t) => e !==
|
|
1676
|
+
}), cr = (e, t) => e !== ae && !e.__isScriptSetup && F(e, t), lr = {
|
|
1677
1677
|
get({ _: e }, t) {
|
|
1678
1678
|
if (t === "__v_skip") return !0;
|
|
1679
1679
|
let { ctx: n, setupState: r, data: i, props: a, accessCache: o, type: s, appContext: c } = e;
|
|
@@ -1687,21 +1687,21 @@ var ar = /* @__PURE__ */ Symbol.for("v-ndc"), or = (e) => e ? Yr(e) ? Zr(e) : or
|
|
|
1687
1687
|
case 3: return a[t];
|
|
1688
1688
|
}
|
|
1689
1689
|
else if (cr(r, t)) return o[t] = 1, r[t];
|
|
1690
|
-
else if (i !==
|
|
1691
|
-
else if (
|
|
1692
|
-
else if (n !==
|
|
1690
|
+
else if (i !== ae && F(i, t)) return o[t] = 2, i[t];
|
|
1691
|
+
else if (F(a, t)) return o[t] = 3, a[t];
|
|
1692
|
+
else if (n !== ae && F(n, t)) return o[t] = 4, n[t];
|
|
1693
1693
|
else dr && (o[t] = 0);
|
|
1694
1694
|
}
|
|
1695
1695
|
let l = sr[t], u, d;
|
|
1696
|
-
if (l) return t === "$attrs" ? (
|
|
1696
|
+
if (l) return t === "$attrs" ? ($e(e.attrs, "get", ""), process.env.NODE_ENV) : process.env.NODE_ENV !== "production" && t === "$slots" && $e(e, "get", t), l(e);
|
|
1697
1697
|
if ((u = s.__cssModules) && (u = u[t])) return u;
|
|
1698
|
-
if (n !==
|
|
1699
|
-
if (d = c.config.globalProperties,
|
|
1698
|
+
if (n !== ae && F(n, t)) return o[t] = 4, n[t];
|
|
1699
|
+
if (d = c.config.globalProperties, F(d, t)) return d[t];
|
|
1700
1700
|
process.env.NODE_ENV;
|
|
1701
1701
|
},
|
|
1702
1702
|
set({ _: e }, t, n) {
|
|
1703
1703
|
let { data: r, setupState: i, ctx: a } = e;
|
|
1704
|
-
return cr(i, t) ? (i[t] = n, !0) : process.env.NODE_ENV !== "production" && i.__isScriptSetup &&
|
|
1704
|
+
return cr(i, t) ? (i[t] = n, !0) : process.env.NODE_ENV !== "production" && i.__isScriptSetup && F(i, t) ? (dn(`Cannot mutate <script setup> binding "${t}" from Options API.`), !1) : r !== ae && F(r, t) ? (r[t] = n, !0) : F(e.props, t) ? (process.env.NODE_ENV !== "production" && dn(`Attempting to mutate prop "${t}". Props are readonly.`), !1) : t[0] === "$" && t.slice(1) in e ? (process.env.NODE_ENV !== "production" && dn(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`), !1) : (process.env.NODE_ENV !== "production" && t in e.appContext.config.globalProperties ? Object.defineProperty(a, t, {
|
|
1705
1705
|
enumerable: !0,
|
|
1706
1706
|
configurable: !0,
|
|
1707
1707
|
value: n
|
|
@@ -1709,25 +1709,25 @@ var ar = /* @__PURE__ */ Symbol.for("v-ndc"), or = (e) => e ? Yr(e) ? Zr(e) : or
|
|
|
1709
1709
|
},
|
|
1710
1710
|
has({ _: { data: e, setupState: t, accessCache: n, ctx: r, appContext: i, props: a, type: o } }, s) {
|
|
1711
1711
|
let c;
|
|
1712
|
-
return !!(n[s] || e !==
|
|
1712
|
+
return !!(n[s] || e !== ae && s[0] !== "$" && F(e, s) || cr(t, s) || F(a, s) || F(r, s) || F(sr, s) || F(i.config.globalProperties, s) || (c = o.__cssModules) && c[s]);
|
|
1713
1713
|
},
|
|
1714
1714
|
defineProperty(e, t, n) {
|
|
1715
|
-
return n.get == null ?
|
|
1715
|
+
return n.get == null ? F(n, "value") && this.set(e, t, n.value, null) : e._.accessCache[t] = 0, Reflect.defineProperty(e, t, n);
|
|
1716
1716
|
}
|
|
1717
1717
|
};
|
|
1718
|
-
process.env.NODE_ENV !== "production" && (lr.ownKeys = (e) => (
|
|
1718
|
+
process.env.NODE_ENV !== "production" && (lr.ownKeys = (e) => (dn("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."), Reflect.ownKeys(e)));
|
|
1719
1719
|
function ur(e) {
|
|
1720
|
-
return
|
|
1720
|
+
return I(e) ? e.reduce((e, t) => (e[t] = null, e), {}) : e;
|
|
1721
1721
|
}
|
|
1722
1722
|
var dr = !0;
|
|
1723
1723
|
function fr(e) {
|
|
1724
1724
|
let t = e.type, { mixins: n, extends: r } = t, { mixins: i, optionsCache: a, config: { optionMergeStrategies: o } } = e.appContext, s = a.get(t), c;
|
|
1725
|
-
return s ? c = s : !i.length && !n && !r ? c = t : (c = {}, i.length && i.forEach((e) => pr(c, e, o, !0)), pr(c, t, o)),
|
|
1725
|
+
return s ? c = s : !i.length && !n && !r ? c = t : (c = {}, i.length && i.forEach((e) => pr(c, e, o, !0)), pr(c, t, o)), de(t) && a.set(t, c), c;
|
|
1726
1726
|
}
|
|
1727
1727
|
function pr(e, t, n, r = !1) {
|
|
1728
1728
|
let { mixins: i, extends: a } = t;
|
|
1729
1729
|
a && pr(e, a, n, !0), i && i.forEach((t) => pr(e, t, n, !0));
|
|
1730
|
-
for (let i in t) if (r && i === "expose") process.env.NODE_ENV !== "production" &&
|
|
1730
|
+
for (let i in t) if (r && i === "expose") process.env.NODE_ENV !== "production" && dn("\"expose\" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.");
|
|
1731
1731
|
else {
|
|
1732
1732
|
let r = mr[i] || n && n[i];
|
|
1733
1733
|
e[i] = r ? r(e[i], t[i]) : t[i];
|
|
@@ -1762,14 +1762,14 @@ var mr = {
|
|
|
1762
1762
|
};
|
|
1763
1763
|
function hr(e, t) {
|
|
1764
1764
|
return t ? e ? function() {
|
|
1765
|
-
return
|
|
1765
|
+
return N(R(e) ? e.call(this, this) : e, R(t) ? t.call(this, this) : t);
|
|
1766
1766
|
} : t : e;
|
|
1767
1767
|
}
|
|
1768
1768
|
function gr(e, t) {
|
|
1769
1769
|
return yr(_r(e), _r(t));
|
|
1770
1770
|
}
|
|
1771
1771
|
function _r(e) {
|
|
1772
|
-
if (
|
|
1772
|
+
if (I(e)) {
|
|
1773
1773
|
let t = {};
|
|
1774
1774
|
for (let n = 0; n < e.length; n++) t[e[n]] = e[n];
|
|
1775
1775
|
return t;
|
|
@@ -1780,27 +1780,27 @@ function vr(e, t) {
|
|
|
1780
1780
|
return e ? [...new Set([].concat(e, t))] : t;
|
|
1781
1781
|
}
|
|
1782
1782
|
function yr(e, t) {
|
|
1783
|
-
return e ?
|
|
1783
|
+
return e ? N(/* @__PURE__ */ Object.create(null), e, t) : t;
|
|
1784
1784
|
}
|
|
1785
1785
|
function br(e, t) {
|
|
1786
|
-
return e ?
|
|
1786
|
+
return e ? I(e) && I(t) ? [.../* @__PURE__ */ new Set([...e, ...t])] : N(/* @__PURE__ */ Object.create(null), ur(e), ur(t ?? {})) : t;
|
|
1787
1787
|
}
|
|
1788
1788
|
function xr(e, t) {
|
|
1789
1789
|
if (!e) return t;
|
|
1790
1790
|
if (!t) return e;
|
|
1791
|
-
let n =
|
|
1791
|
+
let n = N(/* @__PURE__ */ Object.create(null), e);
|
|
1792
1792
|
for (let r in t) n[r] = vr(e[r], t[r]);
|
|
1793
1793
|
return n;
|
|
1794
1794
|
}
|
|
1795
1795
|
var Sr = null, Cr = {}, wr = (e) => Object.getPrototypeOf(e) === Cr, Tr = Dr, Er = (e) => e.__isSuspense;
|
|
1796
1796
|
function Dr(e, t) {
|
|
1797
|
-
t && t.pendingBranch ?
|
|
1797
|
+
t && t.pendingBranch ? I(e) ? t.effects.push(...e) : t.effects.push(e) : Nn(e);
|
|
1798
1798
|
}
|
|
1799
1799
|
var Or = /* @__PURE__ */ Symbol.for("v-fgt"), kr = /* @__PURE__ */ Symbol.for("v-txt"), Ar = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
1800
1800
|
function jr(e) {
|
|
1801
1801
|
return e ? e.__v_isVNode === !0 : !1;
|
|
1802
1802
|
}
|
|
1803
|
-
var Mr, Nr = (...e) => Rr(...Mr ? Mr(e, Yn) : e), Pr = ({ key: e }) => e ?? null, Fr = ({ ref: e, ref_key: t, ref_for: n }) => (typeof e == "number" && (e = "" + e), e == null ? null :
|
|
1803
|
+
var Mr, Nr = (...e) => Rr(...Mr ? Mr(e, Yn) : e), Pr = ({ key: e }) => e ?? null, Fr = ({ ref: e, ref_key: t, ref_for: n }) => (typeof e == "number" && (e = "" + e), e == null ? null : le(e) || /* @__PURE__ */ Wt(e) || R(e) ? {
|
|
1804
1804
|
i: Yn,
|
|
1805
1805
|
r: e,
|
|
1806
1806
|
k: t,
|
|
@@ -1836,24 +1836,24 @@ function Ir(e, t = null, n = null, r = 0, i = null, a = e === Or ? 0 : 1, o = !1
|
|
|
1836
1836
|
appContext: null,
|
|
1837
1837
|
ctx: Yn
|
|
1838
1838
|
};
|
|
1839
|
-
return s ? (Ur(c, n), a & 128 && e.normalize(c)) : n && (c.shapeFlag |=
|
|
1839
|
+
return s ? (Ur(c, n), a & 128 && e.normalize(c)) : n && (c.shapeFlag |= le(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && dn("VNode created with invalid key (NaN). VNode type:", c.type), c;
|
|
1840
1840
|
}
|
|
1841
1841
|
var Lr = process.env.NODE_ENV === "production" ? Rr : Nr;
|
|
1842
1842
|
function Rr(e, t = null, n = null, r = 0, i = null, a = !1) {
|
|
1843
|
-
if ((!e || e === ar) && (process.env.NODE_ENV !== "production" && !e &&
|
|
1843
|
+
if ((!e || e === ar) && (process.env.NODE_ENV !== "production" && !e && dn(`Invalid vnode type when creating vnode: ${e}.`), e = Ar), jr(e)) {
|
|
1844
1844
|
let r = Br(e, t, !0);
|
|
1845
1845
|
return n && Ur(r, n), r.patchFlag = -2, r;
|
|
1846
1846
|
}
|
|
1847
1847
|
if (ni(e) && (e = e.__vccOpts), t) {
|
|
1848
1848
|
t = zr(t);
|
|
1849
1849
|
let { class: e, style: n } = t;
|
|
1850
|
-
e && !
|
|
1850
|
+
e && !le(e) && (t.class = W(e)), de(n) && (/* @__PURE__ */ Bt(n) && !I(n) && (n = N({}, n)), t.style = H(n));
|
|
1851
1851
|
}
|
|
1852
|
-
let o =
|
|
1853
|
-
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */
|
|
1852
|
+
let o = le(e) ? 1 : Er(e) ? 128 : rr(e) ? 64 : de(e) ? 4 : R(e) ? 2 : 0;
|
|
1853
|
+
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ Bt(e) && (e = /* @__PURE__ */ J(e), dn("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.", "\nComponent that was made reactive: ", e)), Ir(e, t, n, r, i, o, a, !0);
|
|
1854
1854
|
}
|
|
1855
1855
|
function zr(e) {
|
|
1856
|
-
return e ? /* @__PURE__ */
|
|
1856
|
+
return e ? /* @__PURE__ */ Bt(e) || wr(e) ? N({}, e) : e : null;
|
|
1857
1857
|
}
|
|
1858
1858
|
function Br(e, t, n = !1, r = !1) {
|
|
1859
1859
|
let { props: i, ref: a, patchFlag: o, children: s, transition: c } = e, l = t ? Wr(i || {}, t) : i, u = {
|
|
@@ -1862,10 +1862,10 @@ function Br(e, t, n = !1, r = !1) {
|
|
|
1862
1862
|
type: e.type,
|
|
1863
1863
|
props: l,
|
|
1864
1864
|
key: l && Pr(l),
|
|
1865
|
-
ref: t && t.ref ? n && a ?
|
|
1865
|
+
ref: t && t.ref ? n && a ? I(a) ? a.concat(Fr(t)) : [a, Fr(t)] : Fr(t) : a,
|
|
1866
1866
|
scopeId: e.scopeId,
|
|
1867
1867
|
slotScopeIds: e.slotScopeIds,
|
|
1868
|
-
children: process.env.NODE_ENV !== "production" && o === -1 &&
|
|
1868
|
+
children: process.env.NODE_ENV !== "production" && o === -1 && I(s) ? s.map(Vr) : s,
|
|
1869
1869
|
target: e.target,
|
|
1870
1870
|
targetStart: e.targetStart,
|
|
1871
1871
|
targetAnchor: e.targetAnchor,
|
|
@@ -1891,7 +1891,7 @@ function Br(e, t, n = !1, r = !1) {
|
|
|
1891
1891
|
}
|
|
1892
1892
|
function Vr(e) {
|
|
1893
1893
|
let t = Br(e);
|
|
1894
|
-
return
|
|
1894
|
+
return I(e.children) && (t.children = e.children.map(Vr)), t;
|
|
1895
1895
|
}
|
|
1896
1896
|
function Hr(e = " ", t = 0) {
|
|
1897
1897
|
return Lr(kr, null, e, t);
|
|
@@ -1899,13 +1899,13 @@ function Hr(e = " ", t = 0) {
|
|
|
1899
1899
|
function Ur(e, t) {
|
|
1900
1900
|
let n = 0, { shapeFlag: r } = e;
|
|
1901
1901
|
if (t == null) t = null;
|
|
1902
|
-
else if (
|
|
1902
|
+
else if (I(t)) n = 16;
|
|
1903
1903
|
else if (typeof t == "object") if (r & 65) {
|
|
1904
1904
|
let n = t.default;
|
|
1905
1905
|
n && (n._c && (n._d = !1), Ur(e, n()), n._c && (n._d = !0));
|
|
1906
1906
|
return;
|
|
1907
1907
|
} else n = 32, !t._ && !wr(t) && (t._ctx = Yn);
|
|
1908
|
-
else if (
|
|
1908
|
+
else if (R(t)) {
|
|
1909
1909
|
if (r & 65) {
|
|
1910
1910
|
Ur(e, { default: t });
|
|
1911
1911
|
return;
|
|
@@ -1921,18 +1921,18 @@ function Wr(...e) {
|
|
|
1921
1921
|
let t = {};
|
|
1922
1922
|
for (let n = 0; n < e.length; n++) {
|
|
1923
1923
|
let r = e[n];
|
|
1924
|
-
for (let e in r) if (e === "class") t.class !== r.class && (t.class =
|
|
1925
|
-
else if (e === "style") t.style =
|
|
1926
|
-
else if (
|
|
1924
|
+
for (let e in r) if (e === "class") t.class !== r.class && (t.class = W([t.class, r.class]));
|
|
1925
|
+
else if (e === "style") t.style = H([t.style, r.style]);
|
|
1926
|
+
else if (M(e)) {
|
|
1927
1927
|
let n = t[e], i = r[e];
|
|
1928
|
-
i && n !== i && !(
|
|
1928
|
+
i && n !== i && !(I(n) && n.includes(i)) ? t[e] = n ? [].concat(n, i) : i : i == null && n == null && !oe(e) && (t[e] = i);
|
|
1929
1929
|
} else e !== "" && (t[e] = r[e]);
|
|
1930
1930
|
}
|
|
1931
1931
|
return t;
|
|
1932
1932
|
}
|
|
1933
1933
|
var Gr = null, Kr = () => Gr || Yn, qr;
|
|
1934
1934
|
{
|
|
1935
|
-
let e =
|
|
1935
|
+
let e = ye(), t = (t, n) => {
|
|
1936
1936
|
let r;
|
|
1937
1937
|
return (r = e[t]) || (r = e[t] = []), r.push(n), (e) => {
|
|
1938
1938
|
r.length > 1 ? r.forEach((t) => t(e)) : r[0](e);
|
|
@@ -1952,7 +1952,7 @@ function Yr(e) {
|
|
|
1952
1952
|
var Xr = !1;
|
|
1953
1953
|
process.env.NODE_ENV;
|
|
1954
1954
|
function Zr(e) {
|
|
1955
|
-
return e.exposed ? e.exposeProxy ||= new Proxy(Zt(
|
|
1955
|
+
return e.exposed ? e.exposeProxy ||= new Proxy(Zt(Vt(e.exposed)), {
|
|
1956
1956
|
get(t, n) {
|
|
1957
1957
|
if (n in t) return t[n];
|
|
1958
1958
|
if (n in sr) return sr[n](e);
|
|
@@ -1964,7 +1964,7 @@ function Zr(e) {
|
|
|
1964
1964
|
}
|
|
1965
1965
|
var Qr = /(?:^|[-_])\w/g, $r = (e) => e.replace(Qr, (e) => e.toUpperCase()).replace(/[-_]/g, "");
|
|
1966
1966
|
function ei(e, t = !0) {
|
|
1967
|
-
return
|
|
1967
|
+
return R(e) ? e.displayName || e.name : e.name || t && e.__name;
|
|
1968
1968
|
}
|
|
1969
1969
|
function ti(e, t, n = !1) {
|
|
1970
1970
|
let r = ei(t);
|
|
@@ -1981,7 +1981,7 @@ function ti(e, t, n = !1) {
|
|
|
1981
1981
|
return r ? $r(r) : n ? "App" : "Anonymous";
|
|
1982
1982
|
}
|
|
1983
1983
|
function ni(e) {
|
|
1984
|
-
return
|
|
1984
|
+
return R(e) && "__vccOpts" in e;
|
|
1985
1985
|
}
|
|
1986
1986
|
var ri = (e, t) => {
|
|
1987
1987
|
let n = /* @__PURE__ */ $t(e, t, Xr);
|
|
@@ -1996,16 +1996,16 @@ function ii() {
|
|
|
1996
1996
|
let e = { style: "color:#3ba776" }, t = { style: "color:#1677ff" }, n = { style: "color:#f5222d" }, r = { style: "color:#eb2f96" }, i = {
|
|
1997
1997
|
__vue_custom_formatter: !0,
|
|
1998
1998
|
header(t) {
|
|
1999
|
-
if (!
|
|
1999
|
+
if (!de(t)) return null;
|
|
2000
2000
|
if (t.__isVue) return [
|
|
2001
2001
|
"div",
|
|
2002
2002
|
e,
|
|
2003
2003
|
"VueInstance"
|
|
2004
2004
|
];
|
|
2005
|
-
if (/* @__PURE__ */
|
|
2006
|
-
|
|
2005
|
+
if (/* @__PURE__ */ Wt(t)) {
|
|
2006
|
+
He();
|
|
2007
2007
|
let n = t.value;
|
|
2008
|
-
return
|
|
2008
|
+
return Ue(), [
|
|
2009
2009
|
"div",
|
|
2010
2010
|
{},
|
|
2011
2011
|
[
|
|
@@ -2017,13 +2017,13 @@ function ii() {
|
|
|
2017
2017
|
s(n),
|
|
2018
2018
|
">"
|
|
2019
2019
|
];
|
|
2020
|
-
} else if (/* @__PURE__ */
|
|
2020
|
+
} else if (/* @__PURE__ */ Rt(t)) return [
|
|
2021
2021
|
"div",
|
|
2022
2022
|
{},
|
|
2023
2023
|
[
|
|
2024
2024
|
"span",
|
|
2025
2025
|
e,
|
|
2026
|
-
/* @__PURE__ */
|
|
2026
|
+
/* @__PURE__ */ q(t) ? "ShallowReactive" : "Reactive"
|
|
2027
2027
|
],
|
|
2028
2028
|
"<",
|
|
2029
2029
|
s(t),
|
|
@@ -2035,7 +2035,7 @@ function ii() {
|
|
|
2035
2035
|
[
|
|
2036
2036
|
"span",
|
|
2037
2037
|
e,
|
|
2038
|
-
/* @__PURE__ */
|
|
2038
|
+
/* @__PURE__ */ q(t) ? "ShallowReadonly" : "Readonly"
|
|
2039
2039
|
],
|
|
2040
2040
|
"<",
|
|
2041
2041
|
s(t),
|
|
@@ -2056,7 +2056,7 @@ function ii() {
|
|
|
2056
2056
|
};
|
|
2057
2057
|
function a(e) {
|
|
2058
2058
|
let t = [];
|
|
2059
|
-
e.type.props && e.props && t.push(o("props", /* @__PURE__ */
|
|
2059
|
+
e.type.props && e.props && t.push(o("props", /* @__PURE__ */ J(e.props))), e.setupState !== ae && t.push(o("setup", e.setupState)), e.data !== ae && t.push(o("data", /* @__PURE__ */ J(e.data)));
|
|
2060
2060
|
let n = c(e, "computed");
|
|
2061
2061
|
n && t.push(o("computed", n));
|
|
2062
2062
|
let i = c(e, "inject");
|
|
@@ -2072,7 +2072,7 @@ function ii() {
|
|
|
2072
2072
|
]), t;
|
|
2073
2073
|
}
|
|
2074
2074
|
function o(e, t) {
|
|
2075
|
-
return t =
|
|
2075
|
+
return t = N({}, t), Object.keys(t).length ? [
|
|
2076
2076
|
"div",
|
|
2077
2077
|
{ style: "line-height:1.25em;margin-bottom:0.6em" },
|
|
2078
2078
|
[
|
|
@@ -2109,7 +2109,7 @@ function ii() {
|
|
|
2109
2109
|
"span",
|
|
2110
2110
|
r,
|
|
2111
2111
|
e
|
|
2112
|
-
] :
|
|
2112
|
+
] : de(e) ? ["object", { object: i ? /* @__PURE__ */ J(e) : e }] : [
|
|
2113
2113
|
"span",
|
|
2114
2114
|
n,
|
|
2115
2115
|
String(e)
|
|
@@ -2117,17 +2117,17 @@ function ii() {
|
|
|
2117
2117
|
}
|
|
2118
2118
|
function c(e, t) {
|
|
2119
2119
|
let n = e.type;
|
|
2120
|
-
if (
|
|
2120
|
+
if (R(n)) return;
|
|
2121
2121
|
let r = {};
|
|
2122
2122
|
for (let i in e.ctx) l(n, i, t) && (r[i] = e.ctx[i]);
|
|
2123
2123
|
return r;
|
|
2124
2124
|
}
|
|
2125
2125
|
function l(e, t, n) {
|
|
2126
2126
|
let r = e[n];
|
|
2127
|
-
if (
|
|
2127
|
+
if (I(r) && r.includes(t) || de(r) && t in r || e.extends && l(e.extends, t, n) || e.mixins && e.mixins.some((e) => l(e, t, n))) return !0;
|
|
2128
2128
|
}
|
|
2129
2129
|
function u(e) {
|
|
2130
|
-
return /* @__PURE__ */
|
|
2130
|
+
return /* @__PURE__ */ q(e) ? "ShallowRef" : e.effect ? "ComputedRef" : "Ref";
|
|
2131
2131
|
}
|
|
2132
2132
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i];
|
|
2133
2133
|
}
|
|
@@ -3996,52 +3996,52 @@ function js(e) {
|
|
|
3996
3996
|
return Array.isArray(r) && r.length && r[0] && typeof r[0].jsonPath == "string" ? r[0].jsonPath : "";
|
|
3997
3997
|
}
|
|
3998
3998
|
function Ms(e) {
|
|
3999
|
-
let { apiKey: t, baseUrl: s, model: c = "deepseek-v4-flash", temperature: l = .7, maxTokens: u, extraBody: d, extraConfig: f, systemPrompt: p, tools: m = [], middleware: h = [], maxToolRounds: g, maxIterations: _, maxRetries: S = 2, retryDelayMs: C = 500, stallMs: E = fa, streamMaxMs: D = ma, toolTimeoutMs: O, maxParallelTools: k = 1, maxVerifyAttempts: ne = 0, roundTokenBudget:
|
|
4000
|
-
(!Number.isFinite(
|
|
4001
|
-
let
|
|
3999
|
+
let { apiKey: t, baseUrl: s, model: c = "deepseek-v4-flash", temperature: l = .7, maxTokens: u, extraBody: d, extraConfig: f, systemPrompt: p, tools: m = [], middleware: h = [], maxToolRounds: g, maxIterations: _, maxRetries: S = 2, retryDelayMs: C = 500, stallMs: E = fa, streamMaxMs: D = ma, toolTimeoutMs: O, maxParallelTools: k = 1, maxVerifyAttempts: ne = 0, roundTokenBudget: A = 0, onLog: ie, onLlmChange: ae, imageContentFormat: j = "openai", staleReadInvalidation: M = !0, debug: oe = !1 } = e, N = g ?? xs;
|
|
4000
|
+
(!Number.isFinite(N) || N < 1) && (console.warn(`[page-agent-sdk] maxToolRounds=${N} 非法(须 ≥1 正整数),已 clamp 到 1(0/负数致主循环 while 不进 → agent 不调 LLM 静默返回兜底文案)`), N = 1);
|
|
4001
|
+
let se = v({
|
|
4002
4002
|
model: c,
|
|
4003
4003
|
contextWindow: e.contextWindow,
|
|
4004
4004
|
maxOutputTokens: e.maxOutputTokens,
|
|
4005
4005
|
vision: e.vision
|
|
4006
|
-
}),
|
|
4007
|
-
function
|
|
4008
|
-
|
|
4006
|
+
}), P = u ?? se.maxOutputTokens, F = b(se.contextWindow), I = x(se.contextWindow);
|
|
4007
|
+
function ce(e) {
|
|
4008
|
+
se = e, F = b(se.contextWindow), I = x(se.contextWindow);
|
|
4009
4009
|
}
|
|
4010
|
-
let
|
|
4010
|
+
let L = /* @__PURE__ */ Y([]), R = 0, le = () => ({
|
|
4011
4011
|
retries: 0,
|
|
4012
4012
|
exhausted: 0
|
|
4013
|
-
}),
|
|
4014
|
-
transitional_retry:
|
|
4015
|
-
completion_gate:
|
|
4016
|
-
evidence_audit_gate:
|
|
4017
|
-
zero_tool_gate:
|
|
4018
|
-
status_query_gate:
|
|
4019
|
-
...e.pageAssertionGate === !0 ? { page_assertion_gate:
|
|
4020
|
-
},
|
|
4013
|
+
}), ue = {
|
|
4014
|
+
transitional_retry: le(),
|
|
4015
|
+
completion_gate: le(),
|
|
4016
|
+
evidence_audit_gate: le(),
|
|
4017
|
+
zero_tool_gate: le(),
|
|
4018
|
+
status_query_gate: le(),
|
|
4019
|
+
...e.pageAssertionGate === !0 ? { page_assertion_gate: le() } : {}
|
|
4020
|
+
}, de = {
|
|
4021
4021
|
ZERO_TOOL_GATE_EXHAUSTED: "zero_tool_gate",
|
|
4022
4022
|
AUDIT_GATE_EXHAUSTED: "evidence_audit_gate",
|
|
4023
4023
|
COMPLETION_GATE_EXHAUSTED: "completion_gate",
|
|
4024
4024
|
PAGE_ASSERTION_GATE_EXHAUSTED: "page_assertion_gate"
|
|
4025
|
-
},
|
|
4026
|
-
function
|
|
4025
|
+
}, fe = [], pe = 0, me = 0, z = /* @__PURE__ */ new Set();
|
|
4026
|
+
function B(e, t) {
|
|
4027
4027
|
let n = {
|
|
4028
4028
|
timestamp: Date.now(),
|
|
4029
4029
|
type: e,
|
|
4030
4030
|
data: Es(t)
|
|
4031
4031
|
};
|
|
4032
|
-
|
|
4032
|
+
L.value.push(n), L.value.length > Ss && L.value.splice(0, L.value.length - Ss), Jt(L), ie?.(n), oe && console.log(`%c[Agent] ${e}`, "color:#667eea;font-weight:bold", t);
|
|
4033
4033
|
}
|
|
4034
|
-
let
|
|
4035
|
-
|
|
4034
|
+
let V = (e) => {
|
|
4035
|
+
L.value.push({
|
|
4036
4036
|
...e,
|
|
4037
4037
|
timestamp: typeof e.timestamp == "number" ? e.timestamp : Date.now(),
|
|
4038
4038
|
data: Es(e.data)
|
|
4039
|
-
}),
|
|
4040
|
-
},
|
|
4039
|
+
}), L.value.length > Ss && L.value.splice(0, L.value.length - Ss), Jt(L);
|
|
4040
|
+
}, he = [...h.flatMap((e) => e.tools || []), ...m], ge = e.llm ?? new n({
|
|
4041
4041
|
apiKey: t,
|
|
4042
4042
|
model: c,
|
|
4043
4043
|
temperature: l,
|
|
4044
|
-
maxTokens:
|
|
4044
|
+
maxTokens: P,
|
|
4045
4045
|
maxRetries: 0,
|
|
4046
4046
|
configuration: {
|
|
4047
4047
|
...s ? { baseURL: T(s) } : {},
|
|
@@ -4049,16 +4049,16 @@ function Ms(e) {
|
|
|
4049
4049
|
...f
|
|
4050
4050
|
},
|
|
4051
4051
|
...d ? { modelKwargs: d } : {}
|
|
4052
|
-
}),
|
|
4053
|
-
let e =
|
|
4052
|
+
}), _e = he.length > 0 ? ge.bindTools?.(he) ?? ge : ge, ve = () => {
|
|
4053
|
+
let e = ge;
|
|
4054
4054
|
return (typeof e.model == "string" && e.model ? e.model : typeof e.modelName == "string" && e.modelName ? e.modelName : "") || c;
|
|
4055
4055
|
};
|
|
4056
|
-
function
|
|
4057
|
-
|
|
4056
|
+
function ye() {
|
|
4057
|
+
_e = he.length > 0 ? ge.bindTools?.(he) ?? ge : ge;
|
|
4058
4058
|
}
|
|
4059
|
-
let
|
|
4060
|
-
e.__pgIsSubagent && (
|
|
4061
|
-
let
|
|
4059
|
+
let H = ia();
|
|
4060
|
+
e.__pgIsSubagent && (H.__pgIsSubagent = !0);
|
|
4061
|
+
let be = .25, U = /* @__PURE__ */ new Set([
|
|
4062
4062
|
"mission",
|
|
4063
4063
|
"workingMemory",
|
|
4064
4064
|
"intentGuard",
|
|
@@ -4067,52 +4067,52 @@ function Ms(e) {
|
|
|
4067
4067
|
"hostNotice",
|
|
4068
4068
|
"proposalNotice"
|
|
4069
4069
|
]);
|
|
4070
|
-
function
|
|
4070
|
+
function xe() {
|
|
4071
4071
|
let e = p || "你是一个智能助手。", t = [];
|
|
4072
4072
|
for (let e of h) if (e.augmentPrompt) {
|
|
4073
|
-
let n = e.augmentPrompt(
|
|
4073
|
+
let n = e.augmentPrompt(H);
|
|
4074
4074
|
n && t.push({
|
|
4075
4075
|
name: e.name,
|
|
4076
4076
|
text: n,
|
|
4077
4077
|
tokens: y(n),
|
|
4078
|
-
pin:
|
|
4078
|
+
pin: U.has(e.name)
|
|
4079
4079
|
});
|
|
4080
4080
|
}
|
|
4081
|
-
let n = Math.max(2e3, Math.round(
|
|
4081
|
+
let n = Math.max(2e3, Math.round(se.contextWindow * be)), r = y(e) + t.reduce((e, t) => e + t.tokens, 0), i = /* @__PURE__ */ new Set();
|
|
4082
4082
|
if (r > n) {
|
|
4083
4083
|
let e = r, a = [];
|
|
4084
4084
|
for (let e of t.filter((e) => !e.pin).sort((e, t) => t.tokens - e.tokens)) {
|
|
4085
4085
|
if (r <= n) break;
|
|
4086
4086
|
a.push(`${e.name}(${e.tokens})`), i.add(e.name), r -= e.tokens, e.text = "";
|
|
4087
4087
|
}
|
|
4088
|
-
a.length && console.warn(`[page-agent-sdk] 系统段超预算(${e} > ${n} tokens,窗口 ${
|
|
4088
|
+
a.length && console.warn(`[page-agent-sdk] 系统段超预算(${e} > ${n} tokens,窗口 ${se.contextWindow} 的 ${be * 100}%),drop 非核心段:${a.join(", ")}(保 base/mission/workingMemory)`);
|
|
4089
4089
|
}
|
|
4090
|
-
return
|
|
4090
|
+
return fe = t.map((e) => ({
|
|
4091
4091
|
name: e.name,
|
|
4092
4092
|
tokens: e.tokens,
|
|
4093
4093
|
dropped: i.has(e.name)
|
|
4094
4094
|
})), [e, ...t.filter((e) => e.text).map((e) => e.text)].join("\n\n");
|
|
4095
4095
|
}
|
|
4096
|
-
function
|
|
4097
|
-
let t = [new a(
|
|
4096
|
+
function Se(e) {
|
|
4097
|
+
let t = [new a(xe())];
|
|
4098
4098
|
for (let n of e) if (n.role === "user") {
|
|
4099
|
-
let e = n.quote ? Pi(n.content, n.quote) : n.content, r =
|
|
4099
|
+
let e = n.quote ? Pi(n.content, n.quote) : n.content, r = se.vision && n.images?.length ? yi(e, n.images, j) : null;
|
|
4100
4100
|
r ? t.push(new i({ content: r })) : n.images?.some((e) => e.description) ? t.push(new i(bi(e, n.images))) : t.push(new i(e));
|
|
4101
4101
|
} else n.role === "assistant" ? t.push(new r(n.content)) : n.role === "system" && t.push(new a(n.content));
|
|
4102
4102
|
return t;
|
|
4103
4103
|
}
|
|
4104
|
-
function
|
|
4105
|
-
let n = e[0] &&
|
|
4104
|
+
function W(e, t) {
|
|
4105
|
+
let n = e[0] && Te(e[0]) === "system" ? e.slice(1) : e.slice(), r = xe();
|
|
4106
4106
|
return [new a(t ? `${r}\n\n${t}` : r), ...n];
|
|
4107
4107
|
}
|
|
4108
|
-
async function
|
|
4109
|
-
let a = i ??
|
|
4108
|
+
async function Ce(e, t, n, i) {
|
|
4109
|
+
let a = i ?? _e, o = {
|
|
4110
4110
|
signal: n,
|
|
4111
4111
|
maxRetries: S,
|
|
4112
4112
|
baseDelayMs: C,
|
|
4113
4113
|
onRetry: ({ attempt: e, error: t, waitMs: n }) => {
|
|
4114
4114
|
let r = t?.message ?? String(t);
|
|
4115
|
-
|
|
4115
|
+
pe += 1, B("error", {
|
|
4116
4116
|
stage: "model_retry",
|
|
4117
4117
|
at: "launch",
|
|
4118
4118
|
attempt: e,
|
|
@@ -4145,23 +4145,23 @@ function Ms(e) {
|
|
|
4145
4145
|
};
|
|
4146
4146
|
if (ga(a) && !e._ctxRetry) {
|
|
4147
4147
|
e._ctxRetry = !0;
|
|
4148
|
-
let r = (e) => y(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + r(t), 0), o =
|
|
4149
|
-
return
|
|
4148
|
+
let r = (e) => y(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + r(t), 0), o = G(e.messages, Math.round(se.contextWindow * .3)), s = o.reduce((e, t) => e + r(t), 0);
|
|
4149
|
+
return B("error", {
|
|
4150
4150
|
stage: "context_overflow_retry",
|
|
4151
4151
|
at: "launch",
|
|
4152
4152
|
beforeTokens: a,
|
|
4153
4153
|
afterTokens: s,
|
|
4154
|
-
window:
|
|
4155
|
-
}), console.warn(`[page-agent-sdk] 上下文超限(启动)→ 激进 trim 重试:${a} → ${s} tokens`),
|
|
4154
|
+
window: se.contextWindow
|
|
4155
|
+
}), console.warn(`[page-agent-sdk] 上下文超限(启动)→ 激进 trim 重试:${a} → ${s} tokens`), Ce({
|
|
4156
4156
|
...e,
|
|
4157
4157
|
messages: o
|
|
4158
4158
|
}, t, n, i);
|
|
4159
4159
|
}
|
|
4160
|
-
throw ya(a) ? (
|
|
4160
|
+
throw ya(a) ? (me += 1, B("error", {
|
|
4161
4161
|
stage: "model_unavailable",
|
|
4162
4162
|
at: "launch",
|
|
4163
4163
|
status: a?.status
|
|
4164
|
-
})) : (
|
|
4164
|
+
})) : (me += 1, B("error", {
|
|
4165
4165
|
stage: "model_call_failed",
|
|
4166
4166
|
at: "launch",
|
|
4167
4167
|
retries: S,
|
|
@@ -4190,7 +4190,7 @@ function Ms(e) {
|
|
|
4190
4190
|
});
|
|
4191
4191
|
}
|
|
4192
4192
|
} catch (a) {
|
|
4193
|
-
if (a instanceof ua) throw s.abort(),
|
|
4193
|
+
if (a instanceof ua) throw s.abort(), me += 1, B("error", {
|
|
4194
4194
|
stage: a instanceof da ? "stream_max_duration" : "stream_stalled",
|
|
4195
4195
|
waitedMs: a.waitedMs,
|
|
4196
4196
|
stallMs: E,
|
|
@@ -4204,22 +4204,22 @@ function Ms(e) {
|
|
|
4204
4204
|
};
|
|
4205
4205
|
if (ga(a) && l === null && u === "" && !e._ctxRetry) {
|
|
4206
4206
|
e._ctxRetry = !0;
|
|
4207
|
-
let r = (e) => y(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + r(t), 0), o =
|
|
4208
|
-
return
|
|
4207
|
+
let r = (e) => y(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + r(t), 0), o = G(e.messages, Math.round(se.contextWindow * .3)), s = o.reduce((e, t) => e + r(t), 0);
|
|
4208
|
+
return B("error", {
|
|
4209
4209
|
stage: "context_overflow_retry",
|
|
4210
4210
|
beforeTokens: a,
|
|
4211
4211
|
afterTokens: s,
|
|
4212
|
-
window:
|
|
4213
|
-
}), console.warn(`[page-agent-sdk] 上下文超限 → 激进 trim 重试:${a} → ${s} tokens(窗口 ${
|
|
4212
|
+
window: se.contextWindow
|
|
4213
|
+
}), console.warn(`[page-agent-sdk] 上下文超限 → 激进 trim 重试:${a} → ${s} tokens(窗口 ${se.contextWindow})`), Ce({
|
|
4214
4214
|
...e,
|
|
4215
4215
|
messages: o
|
|
4216
4216
|
}, t, n, i);
|
|
4217
4217
|
}
|
|
4218
4218
|
let o = (e._iterRetries ?? 0) + 1;
|
|
4219
4219
|
if (l === null && u === "" && o <= S && oa(a, n)) {
|
|
4220
|
-
e._iterRetries = o,
|
|
4220
|
+
e._iterRetries = o, pe += 1;
|
|
4221
4221
|
let s = C * 2 ** (o - 1);
|
|
4222
|
-
if (
|
|
4222
|
+
if (B("error", {
|
|
4223
4223
|
stage: "model_retry",
|
|
4224
4224
|
at: "iterate",
|
|
4225
4225
|
attempt: o,
|
|
@@ -4247,13 +4247,13 @@ function Ms(e) {
|
|
|
4247
4247
|
aborted: !0
|
|
4248
4248
|
};
|
|
4249
4249
|
}
|
|
4250
|
-
return
|
|
4250
|
+
return Ce(e, t, n, i);
|
|
4251
4251
|
}
|
|
4252
|
-
throw ya(a) ? (
|
|
4252
|
+
throw ya(a) ? (me += 1, B("error", {
|
|
4253
4253
|
stage: "model_unavailable",
|
|
4254
4254
|
at: "iterate",
|
|
4255
4255
|
status: a?.status
|
|
4256
|
-
})) : (
|
|
4256
|
+
})) : (me += 1, B("error", {
|
|
4257
4257
|
stage: "model_call_failed",
|
|
4258
4258
|
at: "iterate",
|
|
4259
4259
|
emitted: l !== null || u !== "",
|
|
@@ -4261,15 +4261,15 @@ function Ms(e) {
|
|
|
4261
4261
|
})), a;
|
|
4262
4262
|
}
|
|
4263
4263
|
if (l === null) {
|
|
4264
|
-
if (!e._emptyRetry) return e._emptyRetry = !0,
|
|
4264
|
+
if (!e._emptyRetry) return e._emptyRetry = !0, B("error", {
|
|
4265
4265
|
stage: "empty_llm_response_retry",
|
|
4266
4266
|
hint: "流正常结束但零 chunk(网关 200+错误体形态),自动重试 1 次"
|
|
4267
|
-
}),
|
|
4268
|
-
throw
|
|
4267
|
+
}), Ce(e, t, n, i);
|
|
4268
|
+
throw B("error", {
|
|
4269
4269
|
stage: "empty_llm_response",
|
|
4270
4270
|
retried: !0,
|
|
4271
4271
|
hint: "重试后仍零 chunk,抛 EmptyLLMResponseError 显式报错"
|
|
4272
|
-
}),
|
|
4272
|
+
}), me += 1, new pa();
|
|
4273
4273
|
}
|
|
4274
4274
|
let d = l;
|
|
4275
4275
|
return {
|
|
@@ -4278,10 +4278,10 @@ function Ms(e) {
|
|
|
4278
4278
|
content: u
|
|
4279
4279
|
};
|
|
4280
4280
|
}
|
|
4281
|
-
async function
|
|
4282
|
-
let t =
|
|
4281
|
+
async function we(e) {
|
|
4282
|
+
let t = he.find((t) => t.name === e.name);
|
|
4283
4283
|
if (!t) {
|
|
4284
|
-
let t =
|
|
4284
|
+
let t = he.map((e) => e.name).filter((e) => !e.startsWith("__"));
|
|
4285
4285
|
return {
|
|
4286
4286
|
content: `工具 "${e.name}" 不存在(当前上下文可用工具:${t.join(", ")})`,
|
|
4287
4287
|
status: "error"
|
|
@@ -4295,7 +4295,7 @@ function Ms(e) {
|
|
|
4295
4295
|
if (r > 0) try {
|
|
4296
4296
|
i = await ra(Promise.resolve().then(() => t.invoke(e.args, { configurable: n })), r);
|
|
4297
4297
|
} catch (t) {
|
|
4298
|
-
if (t instanceof ea) return
|
|
4298
|
+
if (t instanceof ea) return B("error", {
|
|
4299
4299
|
stage: "tool_timeout",
|
|
4300
4300
|
name: e.name,
|
|
4301
4301
|
timeoutMs: r,
|
|
@@ -4307,13 +4307,13 @@ function Ms(e) {
|
|
|
4307
4307
|
throw t;
|
|
4308
4308
|
}
|
|
4309
4309
|
else i = await t.invoke(e.args, { configurable: n });
|
|
4310
|
-
let a = typeof i == "string" ? i : JSON.stringify(i), o =
|
|
4310
|
+
let a = typeof i == "string" ? i : JSON.stringify(i), o = he.some((e) => e.name === "vfs_read");
|
|
4311
4311
|
return a = Zi(a, {
|
|
4312
4312
|
files: e.state.files,
|
|
4313
4313
|
vfsAvailable: !!e.state.files && o,
|
|
4314
4314
|
toolName: e.name,
|
|
4315
|
-
threshold:
|
|
4316
|
-
passThroughChars:
|
|
4315
|
+
threshold: F,
|
|
4316
|
+
passThroughChars: I
|
|
4317
4317
|
}).content, {
|
|
4318
4318
|
content: a,
|
|
4319
4319
|
status: "done"
|
|
@@ -4325,15 +4325,15 @@ function Ms(e) {
|
|
|
4325
4325
|
};
|
|
4326
4326
|
}
|
|
4327
4327
|
}
|
|
4328
|
-
function
|
|
4328
|
+
function Te(e) {
|
|
4329
4329
|
return e instanceof i ? "human" : e instanceof r ? "ai" : e instanceof a ? "system" : e instanceof o ? "tool" : "unknown";
|
|
4330
4330
|
}
|
|
4331
|
-
function
|
|
4331
|
+
function G(e, t) {
|
|
4332
4332
|
return Ds(e, t);
|
|
4333
4333
|
}
|
|
4334
|
-
function
|
|
4335
|
-
return !
|
|
4336
|
-
let t =
|
|
4334
|
+
function Ee(e) {
|
|
4335
|
+
return !oe && !ie ? [] : e.map((e) => {
|
|
4336
|
+
let t = Te(e), n = { role: t === "human" ? "user" : t === "ai" ? "assistant" : t }, r = typeof e.content == "string" ? e.content : JSON.stringify(e.content);
|
|
4337
4337
|
r && (n.content = r.length > Cs ? r.slice(0, Cs) + `…(截断 ${r.length - Cs} 字符)` : r);
|
|
4338
4338
|
let i = e.tool_calls;
|
|
4339
4339
|
Array.isArray(i) && i.length && (n.tool_calls = i.map((e) => ({
|
|
@@ -4348,21 +4348,21 @@ function Ms(e) {
|
|
|
4348
4348
|
return a && (n.tool_call_id = a), n;
|
|
4349
4349
|
});
|
|
4350
4350
|
}
|
|
4351
|
-
async function
|
|
4352
|
-
|
|
4351
|
+
async function De(t, n, r) {
|
|
4352
|
+
H = ia(), e.__pgIsSubagent && (H.__pgIsSubagent = !0), H.messages = t, H = await cs(h, H);
|
|
4353
4353
|
try {
|
|
4354
4354
|
let s = t;
|
|
4355
4355
|
for (let e of h) if (e.compressInput) {
|
|
4356
4356
|
let t = await e.compressInput(s);
|
|
4357
|
-
s = Array.isArray(t) ? t : t.messages, t && !Array.isArray(t) && t.stats && (
|
|
4358
|
-
...
|
|
4357
|
+
s = Array.isArray(t) ? t : t.messages, t && !Array.isArray(t) && t.stats && (H = {
|
|
4358
|
+
...H,
|
|
4359
4359
|
lastCompression: t.stats
|
|
4360
4360
|
});
|
|
4361
4361
|
}
|
|
4362
4362
|
{
|
|
4363
|
-
let e = y(p || "你是一个智能助手。"), t = Math.max(2e3, Math.round(
|
|
4363
|
+
let e = y(p || "你是一个智能助手。"), t = Math.max(2e3, Math.round(se.contextWindow * be));
|
|
4364
4364
|
if (e > t) {
|
|
4365
|
-
let r = `[page-agent-sdk] systemPrompt 本身(${e} tokens)超过系统段预算(${t} tokens,窗口 ${
|
|
4365
|
+
let r = `[page-agent-sdk] systemPrompt 本身(${e} tokens)超过系统段预算(${t} tokens,窗口 ${se.contextWindow} 的 ${be * 100}%);请缩减 systemPrompt 或换更大窗口模型`;
|
|
4366
4366
|
return console.error(r), n({
|
|
4367
4367
|
type: "error",
|
|
4368
4368
|
message: r,
|
|
@@ -4374,15 +4374,15 @@ function Ms(e) {
|
|
|
4374
4374
|
}), "";
|
|
4375
4375
|
}
|
|
4376
4376
|
}
|
|
4377
|
-
let c =
|
|
4378
|
-
|
|
4379
|
-
model:
|
|
4380
|
-
tools:
|
|
4377
|
+
let c = Se(s);
|
|
4378
|
+
B("context", {
|
|
4379
|
+
model: ve(),
|
|
4380
|
+
tools: he.map((e) => e.name),
|
|
4381
4381
|
middleware: h.map((e) => e.name)
|
|
4382
4382
|
});
|
|
4383
|
-
let l = ps(h, (e) =>
|
|
4383
|
+
let l = ps(h, (e) => Ce(e, n, r)), u = ms(h, we), d = {
|
|
4384
4384
|
rounds: 0,
|
|
4385
|
-
maxToolRounds:
|
|
4385
|
+
maxToolRounds: N,
|
|
4386
4386
|
invokeUsage: {
|
|
4387
4387
|
prompt_tokens: 0,
|
|
4388
4388
|
completion_tokens: 0,
|
|
@@ -4390,25 +4390,25 @@ function Ms(e) {
|
|
|
4390
4390
|
},
|
|
4391
4391
|
writeFailures: {}
|
|
4392
4392
|
};
|
|
4393
|
-
|
|
4393
|
+
H.loopProgress = d;
|
|
4394
4394
|
let f = {
|
|
4395
4395
|
counts: {},
|
|
4396
4396
|
writePaths: [],
|
|
4397
4397
|
failures: 0
|
|
4398
|
-
}, m = Zo(), g = new Map((
|
|
4398
|
+
}, m = Zo(), g = new Map((H.todos ?? []).map((e) => [e.id, {
|
|
4399
4399
|
status: e.status,
|
|
4400
4400
|
content: e.content
|
|
4401
4401
|
}])), v = /* @__PURE__ */ new Map(), b = 0, x = (e) => {
|
|
4402
|
-
let t =
|
|
4402
|
+
let t = he.find((t) => t.name === e);
|
|
4403
4403
|
return t && "writeCapable" in t ? typeof t.writeCapable == "function" || t.writeCapable === !0 : As.has(e);
|
|
4404
|
-
}, S = 0, C = 0, w = Os(
|
|
4405
|
-
for (; (S <
|
|
4406
|
-
if (
|
|
4407
|
-
let e = `本轮 token 预算(约 ${
|
|
4408
|
-
return
|
|
4404
|
+
}, S = 0, C = 0, w = Os(N, _), T = null, E = 0, D = !1, O = !1;
|
|
4405
|
+
for (; (S < N || O) && C < w && (C++, !r?.aborted);) {
|
|
4406
|
+
if (A > 0 && d.invokeUsage.total_tokens > A) {
|
|
4407
|
+
let e = `本轮 token 预算(约 ${A})已用尽:任务在 ${S} 轮工具调用后中断,已完成的部分均保留。可继续对话,指定下一步(如「继续完成」/「只改 X」/「提高预算重试」)。`;
|
|
4408
|
+
return B("error", {
|
|
4409
4409
|
stage: "round_token_budget_exceeded",
|
|
4410
4410
|
used: d.invokeUsage.total_tokens,
|
|
4411
|
-
budget:
|
|
4411
|
+
budget: A,
|
|
4412
4412
|
rounds: S
|
|
4413
4413
|
}), n({
|
|
4414
4414
|
type: "error",
|
|
@@ -4417,7 +4417,7 @@ function Ms(e) {
|
|
|
4417
4417
|
code: "ROUND_TOKEN_BUDGET_EXCEEDED",
|
|
4418
4418
|
context: {
|
|
4419
4419
|
used: d.invokeUsage.total_tokens,
|
|
4420
|
-
budget:
|
|
4420
|
+
budget: A
|
|
4421
4421
|
}
|
|
4422
4422
|
}), n({
|
|
4423
4423
|
type: "done",
|
|
@@ -4427,39 +4427,39 @@ function Ms(e) {
|
|
|
4427
4427
|
n({
|
|
4428
4428
|
type: "round_start",
|
|
4429
4429
|
round: C
|
|
4430
|
-
}),
|
|
4430
|
+
}), H = ls(h, {
|
|
4431
4431
|
messages: c,
|
|
4432
|
-
state:
|
|
4433
|
-
}), c =
|
|
4432
|
+
state: H
|
|
4433
|
+
}), c = W(c, ks(S, N, e.hasSubagent)), c = G(c, Math.round(se.contextWindow * .6)), B("llm_request", {
|
|
4434
4434
|
round: S + 1,
|
|
4435
|
-
model:
|
|
4436
|
-
tools:
|
|
4437
|
-
messages:
|
|
4435
|
+
model: ve(),
|
|
4436
|
+
tools: he.map((e) => e.name),
|
|
4437
|
+
messages: Ee(c)
|
|
4438
4438
|
});
|
|
4439
4439
|
let t = await l({
|
|
4440
4440
|
messages: c,
|
|
4441
|
-
state:
|
|
4441
|
+
state: H
|
|
4442
4442
|
});
|
|
4443
4443
|
c.push(t.message);
|
|
4444
|
-
let a =
|
|
4445
|
-
if (
|
|
4444
|
+
let a = re(t.message);
|
|
4445
|
+
if (B("llm_response", {
|
|
4446
4446
|
round: S + 1,
|
|
4447
4447
|
content: t.content,
|
|
4448
4448
|
toolCalls: t.toolCalls,
|
|
4449
4449
|
...a ? { usage: a } : {}
|
|
4450
|
-
}), a && (d.invokeUsage.prompt_tokens += a.prompt_tokens ?? 0, d.invokeUsage.completion_tokens += a.completion_tokens ?? 0, d.invokeUsage.total_tokens += a.total_tokens ?? 0),
|
|
4450
|
+
}), a && (d.invokeUsage.prompt_tokens += a.prompt_tokens ?? 0, d.invokeUsage.completion_tokens += a.completion_tokens ?? 0, d.invokeUsage.total_tokens += a.total_tokens ?? 0), H = us(h, t, H), t.aborted) return n({
|
|
4451
4451
|
type: "done",
|
|
4452
4452
|
content: t.content
|
|
4453
4453
|
}), t.content;
|
|
4454
4454
|
if (!t.toolCalls.length) {
|
|
4455
4455
|
{
|
|
4456
|
-
let e = t.message?.response_metadata ?? t.message?.responseMetadata, n = e?.stop_reason ?? e?.finish_reason, r =
|
|
4456
|
+
let e = t.message?.response_metadata ?? t.message?.responseMetadata, n = e?.stop_reason ?? e?.finish_reason, r = re(t.message);
|
|
4457
4457
|
if ((n === "length" || !t.content && (r?.completion_tokens ?? 0) >= 4e3) && !D) {
|
|
4458
|
-
D = !0, O = !0,
|
|
4458
|
+
D = !0, O = !0, B("error", {
|
|
4459
4459
|
stage: "completion_truncated_retry",
|
|
4460
4460
|
completionTokens: r?.completion_tokens,
|
|
4461
4461
|
stopReason: n ?? null,
|
|
4462
|
-
maxTokens:
|
|
4462
|
+
maxTokens: ge?.maxTokens ?? null,
|
|
4463
4463
|
hint: "空输出且 completion 达上限,疑似 max_tokens 截断;回灌分步写入指引"
|
|
4464
4464
|
}), c.push(new i("⚠️ 你上一轮输出为空(疑似被 max_tokens 截断:单次输出过长,常见于把完整大段代码塞进一次工具调用参数)。必须改用分块输出,不要一次性输出完整大段内容:① 先写小体积骨架 —— 大 code 场景先 write 组件、code 字段只含开头一小段(≤800 字符);② 用增量追加逐块补全 —— write({ patch:{ op:\"append\", jsonPath:\"<该组件 code 的路径>\", value:\"<后续代码块,每段 ≤1500 字符>\" } })(append 对字符串是尾接,可连续多次直至完整);③ 已写入部分勿在后续调用重传全文。其他大内容同理:先骨架后增量。"));
|
|
4465
4465
|
continue;
|
|
@@ -4474,21 +4474,21 @@ function Ms(e) {
|
|
|
4474
4474
|
name: e.name,
|
|
4475
4475
|
args: e.args,
|
|
4476
4476
|
type: "tool_call"
|
|
4477
|
-
}))),
|
|
4477
|
+
}))), B("middleware", {
|
|
4478
4478
|
stage: "dsml_parsed",
|
|
4479
4479
|
count: a.length,
|
|
4480
4480
|
names: a.map((e) => e.name)
|
|
4481
4481
|
});
|
|
4482
4482
|
} else {
|
|
4483
4483
|
if (r && E < 2) {
|
|
4484
|
-
E += 1, O = !0,
|
|
4484
|
+
E += 1, O = !0, B("middleware", {
|
|
4485
4485
|
stage: "format_retry",
|
|
4486
4486
|
attempt: E,
|
|
4487
4487
|
content: t.content.slice(0, 200)
|
|
4488
4488
|
}), c.push(new i("⚠️ 你刚才把工具调用写成了文本(伪 XML/标签/DSML 标记,如 <|tool_calls|>、<||DSML||>、<invoke name=...>),未被系统识别为工具调用,因此未执行,页面无变化。请直接用标准 function calling(工具调用)格式重新发起工具调用,不要在回复正文里输出这些标签或 JSON 文本。"));
|
|
4489
4489
|
continue;
|
|
4490
4490
|
}
|
|
4491
|
-
r && (
|
|
4491
|
+
r && (B("error", {
|
|
4492
4492
|
stage: "garbled_exhausted",
|
|
4493
4493
|
retries: E,
|
|
4494
4494
|
content: t.content.slice(0, 200)
|
|
@@ -4504,12 +4504,12 @@ function Ms(e) {
|
|
|
4504
4504
|
garbled: r,
|
|
4505
4505
|
rounds: S,
|
|
4506
4506
|
finalContent: t.content,
|
|
4507
|
-
todos:
|
|
4508
|
-
isSubagent: !!
|
|
4507
|
+
todos: H.todos,
|
|
4508
|
+
isSubagent: !!H.__pgIsSubagent,
|
|
4509
4509
|
turnUsage: f,
|
|
4510
4510
|
isWriteToolByName: x,
|
|
4511
4511
|
messages: c,
|
|
4512
|
-
sessionWritePaths:
|
|
4512
|
+
sessionWritePaths: z,
|
|
4513
4513
|
todosStatusAtStart: g,
|
|
4514
4514
|
pageGate: e.pageAssertionGate === !0,
|
|
4515
4515
|
pageReadTools: e.pageReadTools,
|
|
@@ -4517,8 +4517,8 @@ function Ms(e) {
|
|
|
4517
4517
|
});
|
|
4518
4518
|
if (a?.kind === "feedback") {
|
|
4519
4519
|
O = !0;
|
|
4520
|
-
let e =
|
|
4521
|
-
e && (e.retries += 1),
|
|
4520
|
+
let e = ue[a.gate.stage];
|
|
4521
|
+
e && (e.retries += 1), B("middleware", {
|
|
4522
4522
|
stage: a.gate.stage,
|
|
4523
4523
|
attempt: a.gate.attempt,
|
|
4524
4524
|
...a.gate.logData ?? {},
|
|
@@ -4527,8 +4527,8 @@ function Ms(e) {
|
|
|
4527
4527
|
continue;
|
|
4528
4528
|
}
|
|
4529
4529
|
if (a?.kind === "observable") {
|
|
4530
|
-
let e =
|
|
4531
|
-
e &&
|
|
4530
|
+
let e = de[a.obs.code];
|
|
4531
|
+
e && ue[e] && (ue[e].exhausted += 1), B("error", {
|
|
4532
4532
|
stage: a.obs.code,
|
|
4533
4533
|
...a.obs.context,
|
|
4534
4534
|
content: t.content.slice(0, 160)
|
|
@@ -4540,17 +4540,17 @@ function Ms(e) {
|
|
|
4540
4540
|
context: a.obs.context
|
|
4541
4541
|
});
|
|
4542
4542
|
}
|
|
4543
|
-
if (!r && ne > 0 &&
|
|
4543
|
+
if (!r && ne > 0 && H.verifyAttempts < ne) {
|
|
4544
4544
|
let e = await fs(h, {
|
|
4545
4545
|
messages: c,
|
|
4546
|
-
state:
|
|
4546
|
+
state: H,
|
|
4547
4547
|
response: t,
|
|
4548
|
-
log: (e, t) =>
|
|
4548
|
+
log: (e, t) => B(e, t)
|
|
4549
4549
|
});
|
|
4550
4550
|
if (e) {
|
|
4551
|
-
T = t.content,
|
|
4551
|
+
T = t.content, H.verifyAttempts += 1, c.push(new i(`⚠️ 验证未通过,请修正:${e}`)), B("middleware", {
|
|
4552
4552
|
stage: "verify_retry",
|
|
4553
|
-
attempt:
|
|
4553
|
+
attempt: H.verifyAttempts,
|
|
4554
4554
|
feedback: e
|
|
4555
4555
|
});
|
|
4556
4556
|
continue;
|
|
@@ -4578,10 +4578,10 @@ function Ms(e) {
|
|
|
4578
4578
|
id: t,
|
|
4579
4579
|
name: e.name,
|
|
4580
4580
|
args: e.args,
|
|
4581
|
-
state:
|
|
4581
|
+
state: H,
|
|
4582
4582
|
signal: r,
|
|
4583
4583
|
emit: n,
|
|
4584
|
-
logSink:
|
|
4584
|
+
logSink: V
|
|
4585
4585
|
}
|
|
4586
4586
|
};
|
|
4587
4587
|
});
|
|
@@ -4601,7 +4601,7 @@ function Ms(e) {
|
|
|
4601
4601
|
name: e.call.name,
|
|
4602
4602
|
args: e.call.args,
|
|
4603
4603
|
id: e.id
|
|
4604
|
-
}),
|
|
4604
|
+
}), B("tool_call", {
|
|
4605
4605
|
round: S + 1,
|
|
4606
4606
|
name: e.call.name,
|
|
4607
4607
|
args: e.call.args,
|
|
@@ -4625,7 +4625,7 @@ function Ms(e) {
|
|
|
4625
4625
|
status: i.status,
|
|
4626
4626
|
durationMs: a,
|
|
4627
4627
|
id: e.id
|
|
4628
|
-
}),
|
|
4628
|
+
}), B("tool_result", {
|
|
4629
4629
|
round: S + 1,
|
|
4630
4630
|
name: e.call.name,
|
|
4631
4631
|
result: i.content,
|
|
@@ -4663,7 +4663,7 @@ function Ms(e) {
|
|
|
4663
4663
|
let t = _[e];
|
|
4664
4664
|
if (!t) continue;
|
|
4665
4665
|
let n = p[e].call.name;
|
|
4666
|
-
if (f.counts[n] = (f.counts[n] ?? 0) + 1, t.status === "error" && (f.failures += 1), oo.test(n) && String(t.content || "").startsWith("ERROR:") && (f.rejectedDelegations = f.rejectedDelegations ?? {}, f.rejectedDelegations[n] = (f.rejectedDelegations[n] ?? 0) + 1), Ro(
|
|
4666
|
+
if (f.counts[n] = (f.counts[n] ?? 0) + 1, t.status === "error" && (f.failures += 1), oo.test(n) && String(t.content || "").startsWith("ERROR:") && (f.rejectedDelegations = f.rejectedDelegations ?? {}, f.rejectedDelegations[n] = (f.rejectedDelegations[n] ?? 0) + 1), Ro(he.find((e) => e.name === n), p[e].call.args, t)) {
|
|
4667
4667
|
let t = js(p[e].call.args);
|
|
4668
4668
|
f.writePaths.push(t || "(整体)"), y.push({
|
|
4669
4669
|
name: n,
|
|
@@ -4675,15 +4675,15 @@ function Ms(e) {
|
|
|
4675
4675
|
args: p[e].call.args,
|
|
4676
4676
|
callIndex: e
|
|
4677
4677
|
});
|
|
4678
|
-
if (r) for (let e of r.paths)
|
|
4678
|
+
if (r) for (let e of r.paths) z.add(e);
|
|
4679
4679
|
}
|
|
4680
4680
|
}
|
|
4681
|
-
if (
|
|
4681
|
+
if (M && y.length) {
|
|
4682
4682
|
let e = to(c, y, {
|
|
4683
4683
|
round: S + 1,
|
|
4684
4684
|
maxParallelTools: k
|
|
4685
4685
|
});
|
|
4686
|
-
e.invalidatedCount > 0 && (c = e.messages,
|
|
4686
|
+
e.invalidatedCount > 0 && (c = e.messages, R += e.invalidatedCount, B("middleware", {
|
|
4687
4687
|
stage: "stale_read_invalidated",
|
|
4688
4688
|
round: S + 1,
|
|
4689
4689
|
writtenPaths: y.map((e) => js(e.args) || "(整体)"),
|
|
@@ -4697,33 +4697,33 @@ function Ms(e) {
|
|
|
4697
4697
|
type: "done",
|
|
4698
4698
|
content: ""
|
|
4699
4699
|
}), "";
|
|
4700
|
-
let ee = `\n\n(提示:工具调用次数已达上限(${
|
|
4701
|
-
|
|
4700
|
+
let ee = `\n\n(提示:工具调用次数已达上限(${N} 轮 / ${w} 次迭代),以上为基于已完成操作的阶段性结果,任务可能未完成。回复「继续」或告诉我下一步重点,即可接着做。)`;
|
|
4701
|
+
B("error", {
|
|
4702
4702
|
stage: "react_call_limit_exceeded",
|
|
4703
4703
|
rounds: S,
|
|
4704
|
-
maxToolRounds:
|
|
4704
|
+
maxToolRounds: N,
|
|
4705
4705
|
iterations: C,
|
|
4706
4706
|
maxIterations: w
|
|
4707
4707
|
}), n({
|
|
4708
4708
|
type: "error",
|
|
4709
|
-
message: `ReAct 循环达到调用上限(rounds=${S}/${
|
|
4709
|
+
message: `ReAct 循环达到调用上限(rounds=${S}/${N},iterations=${C}/${w}),已强制收口,可回复「继续」。`,
|
|
4710
4710
|
severity: "observable",
|
|
4711
4711
|
code: "REACT_CALL_LIMIT_EXCEEDED",
|
|
4712
4712
|
context: {
|
|
4713
4713
|
rounds: S,
|
|
4714
|
-
maxToolRounds:
|
|
4714
|
+
maxToolRounds: N,
|
|
4715
4715
|
iterations: C,
|
|
4716
4716
|
maxIterations: w
|
|
4717
4717
|
}
|
|
4718
4718
|
});
|
|
4719
|
-
let te = is(
|
|
4719
|
+
let te = is(H.todos ?? [], g, z);
|
|
4720
4720
|
if (te.length) {
|
|
4721
|
-
|
|
4721
|
+
ue.evidence_audit_gate.exhausted += 1;
|
|
4722
4722
|
let e = te.map((e) => ({
|
|
4723
4723
|
id: e.id,
|
|
4724
4724
|
evidence: e.evidence
|
|
4725
4725
|
}));
|
|
4726
|
-
|
|
4726
|
+
B("middleware", {
|
|
4727
4727
|
stage: "evidence_audit_flagged",
|
|
4728
4728
|
offenders: e
|
|
4729
4729
|
}), n({
|
|
@@ -4741,20 +4741,20 @@ function Ms(e) {
|
|
|
4741
4741
|
content: e
|
|
4742
4742
|
}), e;
|
|
4743
4743
|
}
|
|
4744
|
-
let
|
|
4745
|
-
if (
|
|
4746
|
-
let e = c[0] &&
|
|
4747
|
-
|
|
4744
|
+
let ie = c[c.length - 1];
|
|
4745
|
+
if (ie && Te(ie) === "tool") {
|
|
4746
|
+
let e = c[0] && Te(c[0]) === "system" ? c.slice(1) : c.slice(), t = [new a(xe() + "\n\n工具调用次数已达上限,请基于已有工具结果直接给出最终回答,不要再调用工具。"), ...e];
|
|
4747
|
+
B("llm_request", {
|
|
4748
4748
|
round: "wrap_up",
|
|
4749
|
-
model:
|
|
4749
|
+
model: ve(),
|
|
4750
4750
|
tools: [],
|
|
4751
|
-
messages:
|
|
4751
|
+
messages: Ee(t)
|
|
4752
4752
|
});
|
|
4753
|
-
let i = await ps(h, (e) =>
|
|
4753
|
+
let i = await ps(h, (e) => Ce(e, n, r, ge))({
|
|
4754
4754
|
messages: t,
|
|
4755
|
-
state:
|
|
4755
|
+
state: H
|
|
4756
4756
|
});
|
|
4757
|
-
if (
|
|
4757
|
+
if (H = us(h, i, H), B("llm_response", {
|
|
4758
4758
|
round: "wrap_up",
|
|
4759
4759
|
content: i.content
|
|
4760
4760
|
}), i.aborted) return n({
|
|
@@ -4765,7 +4765,7 @@ function Ms(e) {
|
|
|
4765
4765
|
let e = i.content;
|
|
4766
4766
|
if (hs(e)) {
|
|
4767
4767
|
let t = gs(e);
|
|
4768
|
-
|
|
4768
|
+
B("error", {
|
|
4769
4769
|
stage: "garbled_wrapup",
|
|
4770
4770
|
content: e.slice(0, 200)
|
|
4771
4771
|
}), n({
|
|
@@ -4782,53 +4782,53 @@ function Ms(e) {
|
|
|
4782
4782
|
}), e + ee;
|
|
4783
4783
|
}
|
|
4784
4784
|
}
|
|
4785
|
-
let
|
|
4785
|
+
let ae = "我已完成本轮能做的操作,但未能综合出最终结论。请基于上方已完成的工具操作结果继续,或告诉我下一步重点。";
|
|
4786
4786
|
return n({
|
|
4787
4787
|
type: "done",
|
|
4788
|
-
content:
|
|
4789
|
-
}),
|
|
4788
|
+
content: ae + ee
|
|
4789
|
+
}), ae + ee;
|
|
4790
4790
|
} finally {
|
|
4791
4791
|
try {
|
|
4792
|
-
await ds(h,
|
|
4792
|
+
await ds(h, H);
|
|
4793
4793
|
} catch (e) {
|
|
4794
4794
|
let t = ui(e, "observable");
|
|
4795
4795
|
console.warn("[Agent] afterAgent 清理出错(observable,已忽略):", t.message);
|
|
4796
4796
|
}
|
|
4797
4797
|
}
|
|
4798
4798
|
}
|
|
4799
|
-
async function
|
|
4799
|
+
async function Oe(e, t, n) {
|
|
4800
4800
|
let r = "";
|
|
4801
|
-
return await
|
|
4801
|
+
return await De(e, (e) => {
|
|
4802
4802
|
e.type === "done" && (r = e.content), n?.(e);
|
|
4803
4803
|
}, t), r;
|
|
4804
4804
|
}
|
|
4805
|
-
function
|
|
4806
|
-
|
|
4805
|
+
function ke(e) {
|
|
4806
|
+
he = [...h.flatMap((e) => e.tools || []), ...e], ye();
|
|
4807
4807
|
}
|
|
4808
|
-
function
|
|
4809
|
-
|
|
4808
|
+
function Ae(e) {
|
|
4809
|
+
ge = e, ye(), ae?.(e);
|
|
4810
4810
|
}
|
|
4811
4811
|
return {
|
|
4812
|
-
invoke:
|
|
4813
|
-
stream:
|
|
4814
|
-
getState: () =>
|
|
4812
|
+
invoke: Oe,
|
|
4813
|
+
stream: De,
|
|
4814
|
+
getState: () => H,
|
|
4815
4815
|
get allTools() {
|
|
4816
|
-
return
|
|
4816
|
+
return he;
|
|
4817
4817
|
},
|
|
4818
|
-
getStaleReadsInvalidated: () =>
|
|
4819
|
-
getLlmRetries: () =>
|
|
4820
|
-
getLlmCallFailures: () =>
|
|
4821
|
-
getGateStats: () =>
|
|
4822
|
-
getLastSystemSegments: () =>
|
|
4818
|
+
getStaleReadsInvalidated: () => R,
|
|
4819
|
+
getLlmRetries: () => pe,
|
|
4820
|
+
getLlmCallFailures: () => me,
|
|
4821
|
+
getGateStats: () => ue,
|
|
4822
|
+
getLastSystemSegments: () => fe,
|
|
4823
4823
|
resetSessionCounters: () => {
|
|
4824
|
-
|
|
4825
|
-
for (let e of Object.keys(
|
|
4824
|
+
R = 0, pe = 0, me = 0;
|
|
4825
|
+
for (let e of Object.keys(ue)) ue[e] = le();
|
|
4826
4826
|
},
|
|
4827
|
-
setTools:
|
|
4828
|
-
setLlm:
|
|
4829
|
-
setModelCaps:
|
|
4830
|
-
debugLogs:
|
|
4831
|
-
getEffectiveSystemPrompt: () =>
|
|
4827
|
+
setTools: ke,
|
|
4828
|
+
setLlm: Ae,
|
|
4829
|
+
setModelCaps: ce,
|
|
4830
|
+
debugLogs: L,
|
|
4831
|
+
getEffectiveSystemPrompt: () => xe()
|
|
4832
4832
|
};
|
|
4833
4833
|
}
|
|
4834
4834
|
//#endregion
|
|
@@ -5321,6 +5321,8 @@ var dc = {
|
|
|
5321
5321
|
" → 直接给判断和理由;笔记口径与个人观点分开说(「本页的立场是…;我的看法是…」)。",
|
|
5322
5322
|
" 页面没写不构成不答的理由。",
|
|
5323
5323
|
"",
|
|
5324
|
+
"已懂不查:已是通用知识或对话里已读过的内容,直接用 —— 不必为同一信息再读页面;",
|
|
5325
|
+
"只有要断言「页面上写了什么」时才需要读页核实。",
|
|
5324
5326
|
"出处密度:只有「对页面内容的断言」才标出处(句末括注即可);概念解释、个人观点、",
|
|
5325
5327
|
"过渡句一律不标。「没找到」的说明压成一句,不报检索过程。"
|
|
5326
5328
|
].join("\n"),
|
|
@@ -5336,6 +5338,8 @@ var dc = {
|
|
|
5336
5338
|
" → Give your judgment and reasoning directly; keep the notes' stance and your own view separate (\"this page's position is ...; my take is ...\").",
|
|
5337
5339
|
" The page not covering it is never a reason to refuse.",
|
|
5338
5340
|
"",
|
|
5341
|
+
"Known means no lookup: use general knowledge you already master, and anything already read in this conversation,",
|
|
5342
|
+
"directly — never re-read the page for information you already have; only claims about \"what the page says\" require reading to verify.",
|
|
5339
5343
|
"Citation density: only claims about page content get a citation (a short parenthetical); concept explanations,",
|
|
5340
5344
|
"personal opinions, and transitions get none. Compress \"not found\" statements to one sentence; never narrate the search process."
|
|
5341
5345
|
].join("\n"),
|
|
@@ -6534,7 +6538,7 @@ async function ru(e, t, n, r, i, a) {
|
|
|
6534
6538
|
} : { contextWindow: y.contextWindow }), x = t.onUsage ? {
|
|
6535
6539
|
name: "sub-usage",
|
|
6536
6540
|
afterModel: (e) => {
|
|
6537
|
-
let n =
|
|
6541
|
+
let n = re(e.message);
|
|
6538
6542
|
n && t.onUsage(n);
|
|
6539
6543
|
}
|
|
6540
6544
|
} : void 0;
|
|
@@ -6620,16 +6624,16 @@ async function ru(e, t, n, r, i, a) {
|
|
|
6620
6624
|
} finally {
|
|
6621
6625
|
ee();
|
|
6622
6626
|
}
|
|
6623
|
-
let
|
|
6624
|
-
|
|
6627
|
+
let A, ie = new Promise((e, t) => {
|
|
6628
|
+
A = setTimeout(() => {
|
|
6625
6629
|
D.abort(), t(/* @__PURE__ */ Error(`子 agent 执行超时(${ne}ms),已中止。可简化子任务或拆更小的子任务重试,或经 subagent.timeoutMs 调整(0=不限制)`));
|
|
6626
6630
|
}, ne);
|
|
6627
6631
|
});
|
|
6628
6632
|
te.catch(() => {});
|
|
6629
6633
|
try {
|
|
6630
|
-
return nu(await Promise.race([te,
|
|
6634
|
+
return nu(await Promise.race([te, ie]), E.getState());
|
|
6631
6635
|
} finally {
|
|
6632
|
-
clearTimeout(
|
|
6636
|
+
clearTimeout(A), ee();
|
|
6633
6637
|
}
|
|
6634
6638
|
}
|
|
6635
6639
|
function iu(e) {
|
|
@@ -7252,7 +7256,7 @@ function wu(e, t = {}) {
|
|
|
7252
7256
|
//#endregion
|
|
7253
7257
|
//#region src/core/utils/rawRead.ts
|
|
7254
7258
|
function Tu(e) {
|
|
7255
|
-
return /* @__PURE__ */
|
|
7259
|
+
return /* @__PURE__ */ J(e);
|
|
7256
7260
|
}
|
|
7257
7261
|
//#endregion
|
|
7258
7262
|
//#region src/core/harness/checkpoint.ts
|
|
@@ -9369,7 +9373,7 @@ function hf(e, n = {}) {
|
|
|
9369
9373
|
let n = t ?? y;
|
|
9370
9374
|
e === void 0 ? v.delete(n) : v.set(n, e);
|
|
9371
9375
|
}, E = n.conflictWatchFields ?? [], D = !E.includes("*") && E.length ? new Set(E) : void 0, O = E.length > 0, k = () => D ? Fc(l(), D) : Pc(l()), ee = (n.maxParallelTools ?? 1) > 1 && O, te = !1, ne = [];
|
|
9372
|
-
async function
|
|
9376
|
+
async function A() {
|
|
9373
9377
|
if (!ee) return {
|
|
9374
9378
|
release: () => {},
|
|
9375
9379
|
reacquire: async () => {}
|
|
@@ -9389,35 +9393,35 @@ function hf(e, n = {}) {
|
|
|
9389
9393
|
};
|
|
9390
9394
|
}
|
|
9391
9395
|
(n.maxParallelTools ?? 1) > 1 && !O && console.warn("[page-agent-sdk] maxParallelTools>1 且未声明 conflictWatchFields:并发写不互锁(后写覆盖前写,既有明文语义);声明 conflictWatchFields 后自动启用写互锁与乐观锁校验");
|
|
9392
|
-
let
|
|
9396
|
+
let re = (e) => {
|
|
9393
9397
|
let t = k();
|
|
9394
9398
|
return T(t, e), t;
|
|
9395
|
-
},
|
|
9399
|
+
}, ie = n.largeTextThreshold ?? 200, ae = (n.largeTextPaths ?? []).map((e) => {
|
|
9396
9400
|
let t = e.lastIndexOf(".");
|
|
9397
9401
|
return t > 0 ? {
|
|
9398
9402
|
arrayPath: e.slice(0, t),
|
|
9399
9403
|
field: e.slice(t + 1)
|
|
9400
9404
|
} : null;
|
|
9401
|
-
}).filter((e) => e !== null),
|
|
9402
|
-
function
|
|
9403
|
-
|
|
9405
|
+
}).filter((e) => e !== null), j = !0;
|
|
9406
|
+
function M() {
|
|
9407
|
+
j = !0;
|
|
9404
9408
|
}
|
|
9405
|
-
let
|
|
9409
|
+
let oe = {
|
|
9406
9410
|
get: () => ({
|
|
9407
9411
|
schema: o,
|
|
9408
9412
|
bind: c,
|
|
9409
9413
|
description: u
|
|
9410
9414
|
}),
|
|
9411
9415
|
set: (e) => {
|
|
9412
|
-
o = r.length ? sc(e.schema, r).schema : e.schema, c = e.bind, u = e.description ?? "主数据对象", d = Ns(o), g.length = 0, v.clear(), m(e.resources), p?.clear(),
|
|
9416
|
+
o = r.length ? sc(e.schema, r).schema : e.schema, c = e.bind, u = e.description ?? "主数据对象", d = Ns(o), g.length = 0, v.clear(), m(e.resources), p?.clear(), M();
|
|
9413
9417
|
},
|
|
9414
9418
|
update: (e) => {
|
|
9415
|
-
c = e, g.length = 0, v.clear(),
|
|
9419
|
+
c = e, g.length = 0, v.clear(), M();
|
|
9416
9420
|
},
|
|
9417
|
-
markDataDirty:
|
|
9421
|
+
markDataDirty: M,
|
|
9418
9422
|
consumeDataDirty: () => {
|
|
9419
|
-
let e =
|
|
9420
|
-
return
|
|
9423
|
+
let e = j;
|
|
9424
|
+
return j = !1, e;
|
|
9421
9425
|
},
|
|
9422
9426
|
enterScope: (e) => {
|
|
9423
9427
|
let t = y;
|
|
@@ -9471,14 +9475,14 @@ function hf(e, n = {}) {
|
|
|
9471
9475
|
} : void 0,
|
|
9472
9476
|
updateResource: p ? (e, t) => {
|
|
9473
9477
|
let n = Id(e);
|
|
9474
|
-
p.update(n, t), Ec(c, n, t),
|
|
9478
|
+
p.update(n, t), Ec(c, n, t), M(), T(k(), "");
|
|
9475
9479
|
} : void 0,
|
|
9476
9480
|
deleteResource: p ? (e) => p.delete(e) : void 0,
|
|
9477
9481
|
listResources: p ? () => p.list() : void 0
|
|
9478
|
-
},
|
|
9482
|
+
}, N = (e) => {
|
|
9479
9483
|
n.onAudit?.(e);
|
|
9480
9484
|
};
|
|
9481
|
-
function
|
|
9485
|
+
function se(e, t) {
|
|
9482
9486
|
let n = Oc(l()), r = g.length ? g[g.length - 1].id + 1 : 1;
|
|
9483
9487
|
for (g.push({
|
|
9484
9488
|
id: r,
|
|
@@ -9489,7 +9493,7 @@ function hf(e, n = {}) {
|
|
|
9489
9493
|
}); g.length > _;) g.shift();
|
|
9490
9494
|
return r;
|
|
9491
9495
|
}
|
|
9492
|
-
async function
|
|
9496
|
+
async function P(e, t, r, i, a) {
|
|
9493
9497
|
if (!t || t === "") return null;
|
|
9494
9498
|
let o = k();
|
|
9495
9499
|
if (o === t) return null;
|
|
@@ -9511,7 +9515,7 @@ function hf(e, n = {}) {
|
|
|
9511
9515
|
if (u.action === "restore") {
|
|
9512
9516
|
await i?.reacquire();
|
|
9513
9517
|
let e = k();
|
|
9514
|
-
if (e !== o) return
|
|
9518
|
+
if (e !== o) return N({
|
|
9515
9519
|
op: "conflict_recheck",
|
|
9516
9520
|
detail: `restore 裁决基于 ${o} 恢复时 ${e}(ask 窗口新修改落地,回退被拦)`,
|
|
9517
9521
|
timestamp: Date.now()
|
|
@@ -9527,13 +9531,13 @@ function hf(e, n = {}) {
|
|
|
9527
9531
|
message: `restore 裁决所锚定的快照 #${s} 已不在快照栈(可能被 maxSnapshots 淘汰)`,
|
|
9528
9532
|
hint: "重新 read 拿最新值,或用 restore_data 显式指定快照 id 回退"
|
|
9529
9533
|
});
|
|
9530
|
-
Bc(c, Oc(t.value)),
|
|
9534
|
+
Bc(c, Oc(t.value)), M();
|
|
9531
9535
|
let n = k();
|
|
9532
9536
|
return T(n, a), `已回退主数据到历史快照 #${t.id}[${t.op}]。当前值:${$(l(), 400)} (hash=${n})。请基于回退后的值重写或停止。`;
|
|
9533
9537
|
}
|
|
9534
9538
|
await i?.reacquire();
|
|
9535
9539
|
let d = k();
|
|
9536
|
-
return d === o ? (T(d, a), null) : (
|
|
9540
|
+
return d === o ? (T(d, a), null) : (N({
|
|
9537
9541
|
op: "conflict_recheck",
|
|
9538
9542
|
detail: `裁决基于 ${o} 恢复时 ${d}(ask 窗口新修改落地,overwrite 被拦)`,
|
|
9539
9543
|
timestamp: Date.now()
|
|
@@ -9543,10 +9547,10 @@ function hf(e, n = {}) {
|
|
|
9543
9547
|
hint: "重新 read 拿最新值与 hash,基于最新值修改后再写入(单次校验,不再二次挂起)。"
|
|
9544
9548
|
}));
|
|
9545
9549
|
}
|
|
9546
|
-
let
|
|
9550
|
+
let F = (e, t = !0) => {
|
|
9547
9551
|
e.writeCapable = t;
|
|
9548
|
-
},
|
|
9549
|
-
let n = b(t), r = await
|
|
9552
|
+
}, I = s(async ({ id: e }, t) => {
|
|
9553
|
+
let n = b(t), r = await A();
|
|
9550
9554
|
try {
|
|
9551
9555
|
if (!g.length) return Z({
|
|
9552
9556
|
code: "NO_SNAPSHOT",
|
|
@@ -9560,7 +9564,7 @@ function hf(e, n = {}) {
|
|
|
9560
9564
|
hint: "用 history_data({list:true}) 查看可用快照序号"
|
|
9561
9565
|
});
|
|
9562
9566
|
let r = o.safeParse(t.value);
|
|
9563
|
-
r.success ||
|
|
9567
|
+
r.success || N({
|
|
9564
9568
|
op: "restore",
|
|
9565
9569
|
detail: `#${t.id} 快照含当前 schema 违例 ${r.error.issues.length} 处(历史既有数据非本次写入,放行回退)`,
|
|
9566
9570
|
timestamp: Date.now()
|
|
@@ -9573,7 +9577,7 @@ function hf(e, n = {}) {
|
|
|
9573
9577
|
cur: n
|
|
9574
9578
|
});
|
|
9575
9579
|
}
|
|
9576
|
-
if (!i.length) return Bc(c, Oc(t.value)),
|
|
9580
|
+
if (!i.length) return Bc(c, Oc(t.value)), M(), N({
|
|
9577
9581
|
op: "restore",
|
|
9578
9582
|
detail: `#${t.id}`,
|
|
9579
9583
|
timestamp: Date.now()
|
|
@@ -9606,7 +9610,7 @@ function hf(e, n = {}) {
|
|
|
9606
9610
|
}
|
|
9607
9611
|
e.val === void 0 ? l.push(e.p) : Ec(c, n, e.val), s.push(e.p);
|
|
9608
9612
|
}
|
|
9609
|
-
|
|
9613
|
+
M(), N({
|
|
9610
9614
|
op: "restore",
|
|
9611
9615
|
detail: `#${t.id}(保护字段保留 ${s.length}${l.length ? `,未能回填 ${l.length}` : ""})`,
|
|
9612
9616
|
timestamp: Date.now()
|
|
@@ -9621,8 +9625,8 @@ function hf(e, n = {}) {
|
|
|
9621
9625
|
description: "把主数据回退到某个快照(不传 id 回退最近一次)。快照列表用 history_data({list:true})。",
|
|
9622
9626
|
schema: t.object({ id: t.number().int().optional().describe("快照序号;不传回退最近一次") })
|
|
9623
9627
|
});
|
|
9624
|
-
|
|
9625
|
-
let
|
|
9628
|
+
F(I);
|
|
9629
|
+
let ce = s(async ({ id: e, jsonPath: t, list: n }) => {
|
|
9626
9630
|
if (n) {
|
|
9627
9631
|
if (!g.length) return "无快照。set/edit/delete 会自动存快照。";
|
|
9628
9632
|
let e = g.map((e) => {
|
|
@@ -9667,7 +9671,7 @@ function hf(e, n = {}) {
|
|
|
9667
9671
|
jsonPath: t.string().optional().describe("只看快照的某子路径"),
|
|
9668
9672
|
list: t.boolean().optional().describe("true 列出快照时间线(序号/操作/标签/时间/大小)")
|
|
9669
9673
|
})
|
|
9670
|
-
}),
|
|
9674
|
+
}), L = s(async ({ expr: e, queries: t, limit: n }, r) => {
|
|
9671
9675
|
let i = b(r);
|
|
9672
9676
|
if (typeof c != "object" || !c) return Z({
|
|
9673
9677
|
code: "NOT_OBJECT",
|
|
@@ -9686,7 +9690,7 @@ function hf(e, n = {}) {
|
|
|
9686
9690
|
details: { expr: e }
|
|
9687
9691
|
});
|
|
9688
9692
|
}
|
|
9689
|
-
let r = n ?? 50, o = t.slice(0, r), c = o.map((e) => `{"path":${JSON.stringify(e.path)},"index":${e.index === void 0 ? "null" : e.index},"value":${$(uf(e.value, i === "",
|
|
9693
|
+
let r = n ?? 50, o = t.slice(0, r), c = o.map((e) => `{"path":${JSON.stringify(e.path)},"index":${e.index === void 0 ? "null" : e.index},"value":${$(uf(e.value, i === "", ae, ie, {
|
|
9690
9694
|
rootExempt: !1,
|
|
9691
9695
|
rootPath: String(e.path ?? ""),
|
|
9692
9696
|
fullTextPrefixes: s,
|
|
@@ -9710,7 +9714,7 @@ function hf(e, n = {}) {
|
|
|
9710
9714
|
queries: t.array(t.string()).min(2).max(10).optional().describe("批量模式:2-10 条 JSONPath 一次取回(与 expr 同传按 queries);逐条独立返回,单条失败该项标 error 不整批"),
|
|
9711
9715
|
limit: t.number().int().min(1).max(200).optional().describe("返回结果上限(批量时逐条适用),默认 50")
|
|
9712
9716
|
})
|
|
9713
|
-
}),
|
|
9717
|
+
}), R = s(async ({ query: e, mode: t, fuzzyThreshold: n, matchKey: r, limit: i }) => {
|
|
9714
9718
|
if (c == null) return Z({
|
|
9715
9719
|
code: "EMPTY",
|
|
9716
9720
|
message: "主数据为空,无可搜索内容"
|
|
@@ -9748,7 +9752,7 @@ function hf(e, n = {}) {
|
|
|
9748
9752
|
matchKey: t.boolean().optional().describe("是否同时匹配 key 名,默认 true"),
|
|
9749
9753
|
limit: t.number().int().min(1).max(200).optional().describe("返回上限,默认 50")
|
|
9750
9754
|
})
|
|
9751
|
-
}),
|
|
9755
|
+
}), le = s(async ({ script: e, mode: t, jsonPath: n }, r) => {
|
|
9752
9756
|
let s = b(r);
|
|
9753
9757
|
if (e.length > 8e3) return Z({
|
|
9754
9758
|
code: "SCRIPT_TOO_LARGE",
|
|
@@ -9789,9 +9793,9 @@ function hf(e, n = {}) {
|
|
|
9789
9793
|
details: { scriptLen: e.length }
|
|
9790
9794
|
});
|
|
9791
9795
|
if (u) {
|
|
9792
|
-
let e = await
|
|
9796
|
+
let e = await A();
|
|
9793
9797
|
try {
|
|
9794
|
-
let n = await
|
|
9798
|
+
let n = await P("edit", O ? w(s) : void 0, void 0, e, s);
|
|
9795
9799
|
if (n !== null) return n;
|
|
9796
9800
|
let r = rf({
|
|
9797
9801
|
bindRef: c,
|
|
@@ -9804,13 +9808,13 @@ function hf(e, n = {}) {
|
|
|
9804
9808
|
allowKeys: d,
|
|
9805
9809
|
snapshots: g,
|
|
9806
9810
|
maxSnapshots: _,
|
|
9807
|
-
markDataDirty:
|
|
9811
|
+
markDataDirty: M,
|
|
9808
9812
|
schemaErrorMode: "schema_invalid",
|
|
9809
9813
|
snapshotLabel: "eval_transform_subtree",
|
|
9810
9814
|
internalAfterWrite: a,
|
|
9811
9815
|
protectedCtx: h
|
|
9812
9816
|
});
|
|
9813
|
-
return r.ok ? (
|
|
9817
|
+
return r.ok ? (N({
|
|
9814
9818
|
op: "edit",
|
|
9815
9819
|
detail: `eval_transform_subtree @ ${u}`,
|
|
9816
9820
|
timestamp: Date.now()
|
|
@@ -9825,9 +9829,9 @@ function hf(e, n = {}) {
|
|
|
9825
9829
|
message: `主数据 bind 为原始类型(${c === null ? "null" : typeof c}),eval transform(patches) 无法就地替换`,
|
|
9826
9830
|
hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹或集成方通过 sdk.setData 替换 bind"
|
|
9827
9831
|
});
|
|
9828
|
-
let e = await
|
|
9832
|
+
let e = await A();
|
|
9829
9833
|
try {
|
|
9830
|
-
let n = await
|
|
9834
|
+
let n = await P("edit", O ? w(s) : void 0, void 0, e, s);
|
|
9831
9835
|
if (n !== null) return n;
|
|
9832
9836
|
let r = rf({
|
|
9833
9837
|
bindRef: c,
|
|
@@ -9836,13 +9840,13 @@ function hf(e, n = {}) {
|
|
|
9836
9840
|
allowKeys: d,
|
|
9837
9841
|
snapshots: g,
|
|
9838
9842
|
maxSnapshots: _,
|
|
9839
|
-
markDataDirty:
|
|
9843
|
+
markDataDirty: M,
|
|
9840
9844
|
schemaErrorMode: "schema_invalid",
|
|
9841
9845
|
snapshotLabel: "eval_transform",
|
|
9842
9846
|
internalAfterWrite: a,
|
|
9843
9847
|
protectedCtx: h
|
|
9844
9848
|
});
|
|
9845
|
-
return r.ok ? (
|
|
9849
|
+
return r.ok ? (N({
|
|
9846
9850
|
op: "edit",
|
|
9847
9851
|
detail: `eval_transform(${r.applied.length} patches)`,
|
|
9848
9852
|
timestamp: Date.now()
|
|
@@ -9866,9 +9870,9 @@ function hf(e, n = {}) {
|
|
|
9866
9870
|
message: `主数据 bind 为原始类型(${c === null ? "null" : typeof c}),eval transform 无法就地替换外部持有的值引用`,
|
|
9867
9871
|
hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹或集成方通过 sdk.setData 替换 bind"
|
|
9868
9872
|
});
|
|
9869
|
-
let i = await
|
|
9873
|
+
let i = await A();
|
|
9870
9874
|
try {
|
|
9871
|
-
let e = await
|
|
9875
|
+
let e = await P("set", O ? w(s) : void 0, n, i, s);
|
|
9872
9876
|
if (e !== null) return e;
|
|
9873
9877
|
let t = a ? Oc(l()) : null, r = ef({
|
|
9874
9878
|
schema: o,
|
|
@@ -9876,7 +9880,7 @@ function hf(e, n = {}) {
|
|
|
9876
9880
|
value: n,
|
|
9877
9881
|
bindRef: c
|
|
9878
9882
|
});
|
|
9879
|
-
return r.ok ? (
|
|
9883
|
+
return r.ok ? (se("edit", "eval_transform"), r.wholeParsed ? Vc(c, r.assembly) : r.assembly !== null && typeof r.assembly == "object" && Tc(c, r.assembly), M(), a && (a(c, t), M()), N({
|
|
9880
9884
|
op: "edit",
|
|
9881
9885
|
detail: "eval_transform",
|
|
9882
9886
|
timestamp: Date.now()
|
|
@@ -9904,8 +9908,8 @@ function hf(e, n = {}) {
|
|
|
9904
9908
|
jsonPath: t.string().optional().describe("子树模式:仅对该子树执行;transform 返回值作为子树新值")
|
|
9905
9909
|
})
|
|
9906
9910
|
});
|
|
9907
|
-
|
|
9908
|
-
let
|
|
9911
|
+
F(le, (e) => e?.mode === "transform");
|
|
9912
|
+
let ue = s(async ({ jsonPath: e, jsonPaths: t, fields: n, depth: r, offset: i, limit: a }, s) => {
|
|
9909
9913
|
let c = b(s), f = x(s), p = l(), m, g = () => m ??= k();
|
|
9910
9914
|
if (t && t.length) {
|
|
9911
9915
|
let e = !1, i = t.map((t) => {
|
|
@@ -9924,7 +9928,7 @@ function hf(e, n = {}) {
|
|
|
9924
9928
|
resolved: s,
|
|
9925
9929
|
resourcesByPath: h.resourcesByPath,
|
|
9926
9930
|
resourceStore: h.resourceStore
|
|
9927
|
-
})), n && n.length && (s = jc(s, n)), r != null && (s = Mc(s, r)), s = uf(s, c === "",
|
|
9931
|
+
})), n && n.length && (s = jc(s, n)), r != null && (s = Mc(s, r)), s = uf(s, c === "", ae, ie, {
|
|
9928
9932
|
rootExempt: !0,
|
|
9929
9933
|
rootPath: i,
|
|
9930
9934
|
fullTextPrefixes: f,
|
|
@@ -9972,7 +9976,7 @@ function hf(e, n = {}) {
|
|
|
9972
9976
|
resolved: S,
|
|
9973
9977
|
resourcesByPath: h.resourcesByPath,
|
|
9974
9978
|
resourceStore: h.resourceStore
|
|
9975
|
-
})), T(g(), c), n && n.length && (S = jc(S, n)), r != null && (S = Mc(S, r)), S = uf(S, c === "",
|
|
9979
|
+
})), T(g(), c), n && n.length && (S = jc(S, n)), r != null && (S = Mc(S, r)), S = uf(S, c === "", ae, ie, {
|
|
9976
9980
|
rootExempt: !0,
|
|
9977
9981
|
rootPath: _,
|
|
9978
9982
|
fullTextPrefixes: f,
|
|
@@ -9995,10 +9999,10 @@ function hf(e, n = {}) {
|
|
|
9995
9999
|
offset: t.number().int().min(0).optional().describe("数组分页起始偏移(仅数组目标,默认 0)"),
|
|
9996
10000
|
limit: t.number().int().min(1).max(200).optional().describe("数组分页每页条数(默认 50,上限 200),返回切片+total/hasMore")
|
|
9997
10001
|
})
|
|
9998
|
-
}),
|
|
10002
|
+
}), de = s(async ({ value: e, patch: t, patches: n, del: i, dryRun: s }, u) => {
|
|
9999
10003
|
let f = b(u), p = "set";
|
|
10000
10004
|
i ? p = "delete" : (n && n.length || t) && (p = "edit");
|
|
10001
|
-
let m = t?.value === void 0 ? e : t.value, v = await
|
|
10005
|
+
let m = t?.value === void 0 ? e : t.value, v = await A();
|
|
10002
10006
|
try {
|
|
10003
10007
|
let e = O ? w(f) : void 0;
|
|
10004
10008
|
if (s && e !== void 0) {
|
|
@@ -10033,19 +10037,19 @@ function hf(e, n = {}) {
|
|
|
10033
10037
|
hint: e.spec.mode === "freeze" ? "冻结字段不可删" : "verbatim 字段不可直接删;先 resource_delete 释放"
|
|
10034
10038
|
});
|
|
10035
10039
|
}
|
|
10036
|
-
let n = await
|
|
10040
|
+
let n = await P("delete", e, void 0, v, f);
|
|
10037
10041
|
if (n !== null) return n;
|
|
10038
10042
|
if (s) {
|
|
10039
10043
|
let e = Oc(l());
|
|
10040
10044
|
return Dc(e, t.jsonPath) ? `dryRun(delete): 将删除 @ ${t.jsonPath}。预览剩余:${$(e, 600)}。未实际写入、未入快照。` : `dryRun(delete): @ ${t.jsonPath} 不存在(无需删除)。未实际写入。`;
|
|
10041
10045
|
}
|
|
10042
|
-
|
|
10046
|
+
se("delete");
|
|
10043
10047
|
let r = Dc(c, t.jsonPath);
|
|
10044
|
-
return
|
|
10048
|
+
return M(), N({
|
|
10045
10049
|
op: "delete",
|
|
10046
10050
|
detail: t.jsonPath,
|
|
10047
10051
|
timestamp: Date.now()
|
|
10048
|
-
}), a && (a(c, null),
|
|
10052
|
+
}), a && (a(c, null), M()), T(k(), f), r ? `已删除主数据 @ ${t.jsonPath}` : `主数据 @ ${t.jsonPath} 不存在(无需删除)`;
|
|
10049
10053
|
}
|
|
10050
10054
|
if (p === "edit") {
|
|
10051
10055
|
if (typeof c != "object" || !c) return Z({
|
|
@@ -10053,7 +10057,7 @@ function hf(e, n = {}) {
|
|
|
10053
10057
|
message: `edit 仅适用于对象/数组主数据,当前是 ${c === void 0 ? "undefined" : typeof c}`,
|
|
10054
10058
|
hint: "叶子用 write(value) 整体设置"
|
|
10055
10059
|
});
|
|
10056
|
-
let r = await
|
|
10060
|
+
let r = await P("edit", e, void 0, v, f);
|
|
10057
10061
|
if (r !== null) return r;
|
|
10058
10062
|
let i = n && n.length ? n : [{
|
|
10059
10063
|
op: t.op ?? "set",
|
|
@@ -10066,7 +10070,7 @@ function hf(e, n = {}) {
|
|
|
10066
10070
|
allowKeys: d,
|
|
10067
10071
|
snapshots: g,
|
|
10068
10072
|
maxSnapshots: _,
|
|
10069
|
-
markDataDirty:
|
|
10073
|
+
markDataDirty: M,
|
|
10070
10074
|
schemaErrorMode: "zod",
|
|
10071
10075
|
dryRun: s,
|
|
10072
10076
|
internalAfterWrite: a,
|
|
@@ -10074,18 +10078,18 @@ function hf(e, n = {}) {
|
|
|
10074
10078
|
});
|
|
10075
10079
|
if (!l.ok) return l.error;
|
|
10076
10080
|
if (s) return `dryRun(edit): ${l.applied.length} 个 patch 预检通过(schema 校验 OK)。预览结果:${$(l.clone, 600)}。未实际写入、未入快照。`;
|
|
10077
|
-
|
|
10081
|
+
N({
|
|
10078
10082
|
op: "edit",
|
|
10079
10083
|
detail: `${l.applied.length} 个 patch${l.applied.length > 1 ? "(批量)" : ""}`,
|
|
10080
10084
|
value: l.applied.map((e) => `${e.op}@${e.jp}`),
|
|
10081
10085
|
timestamp: Date.now()
|
|
10082
10086
|
});
|
|
10083
|
-
let u =
|
|
10087
|
+
let u = re(f);
|
|
10084
10088
|
return mf(l.clone), `已 write(edit) 主数据(${l.applied.length} 个 patch)。当前值:${$(l.clone, 600)} (新 hash=${u})`;
|
|
10085
10089
|
}
|
|
10086
10090
|
let i = Ac(m);
|
|
10087
10091
|
if (i.parseError) return ci("", m, i.parseError);
|
|
10088
|
-
let u = await
|
|
10092
|
+
let u = await P("set", e, m, v, f);
|
|
10089
10093
|
if (u !== null) return u;
|
|
10090
10094
|
let y = nf({
|
|
10091
10095
|
bindRef: c,
|
|
@@ -10094,9 +10098,9 @@ function hf(e, n = {}) {
|
|
|
10094
10098
|
allowKeys: d,
|
|
10095
10099
|
snapshots: g,
|
|
10096
10100
|
maxSnapshots: _,
|
|
10097
|
-
audit:
|
|
10101
|
+
audit: N,
|
|
10098
10102
|
dryRun: s,
|
|
10099
|
-
onWrite:
|
|
10103
|
+
onWrite: M,
|
|
10100
10104
|
internalAfterWrite: a,
|
|
10101
10105
|
protectedCtx: h,
|
|
10102
10106
|
hashFn: k
|
|
@@ -10141,8 +10145,8 @@ function hf(e, n = {}) {
|
|
|
10141
10145
|
dryRun: t.boolean().optional().describe("预检:走完整校验链但不落盘不入快照;冲突返回 VERSION_CONFLICT 不挂起")
|
|
10142
10146
|
})
|
|
10143
10147
|
});
|
|
10144
|
-
|
|
10145
|
-
let
|
|
10148
|
+
F(de);
|
|
10149
|
+
let fe = s(async ({ jsonPath: e }) => {
|
|
10146
10150
|
let t = e || "", n = t ? Is(o, t) : o;
|
|
10147
10151
|
return n ? `schema${t ? ` @ ${t}` : ""} = ${$(nc(n))}` : Z({
|
|
10148
10152
|
code: "PATH_DENIED",
|
|
@@ -10153,7 +10157,7 @@ function hf(e, n = {}) {
|
|
|
10153
10157
|
name: "schema_data",
|
|
10154
10158
|
description: "查看主数据(或子路径)的字段约束:类型/min/max/enum/必填/默认值/嵌套 shape。写前查约束,避免写错重试。不传 jsonPath 查根;传子路径(如 components.0)查该位置约束。",
|
|
10155
10159
|
schema: t.object({ jsonPath: t.string().optional().describe("要查约束的子路径;不传查根 schema") })
|
|
10156
|
-
}),
|
|
10160
|
+
}), pe = s(async ({ snapshotId: e, against: t }) => {
|
|
10157
10161
|
let n = t != null, r, i;
|
|
10158
10162
|
if (n) {
|
|
10159
10163
|
let e = t;
|
|
@@ -10185,7 +10189,7 @@ function hf(e, n = {}) {
|
|
|
10185
10189
|
snapshotId: t.number().int().optional().describe("对比的快照序号;不传则最近一次"),
|
|
10186
10190
|
against: t.unknown().optional().describe("对比的一段 JSON 值(与 snapshotId 互斥;传则忽略快照)")
|
|
10187
10191
|
})
|
|
10188
|
-
}),
|
|
10192
|
+
}), me = [];
|
|
10189
10193
|
if (n.vfsStore) {
|
|
10190
10194
|
let e = n.vfsStore, r = (e) => `drafts/${e}.json`, i = s(({ draftId: t, chunk: n, mode: i }) => {
|
|
10191
10195
|
let a = r(t), o = e.files[a], s = i === "append" && o, c = s ? o.content + n : n;
|
|
@@ -10226,9 +10230,9 @@ function hf(e, n = {}) {
|
|
|
10226
10230
|
}
|
|
10227
10231
|
});
|
|
10228
10232
|
}
|
|
10229
|
-
let f = await
|
|
10233
|
+
let f = await A();
|
|
10230
10234
|
try {
|
|
10231
|
-
let n = await
|
|
10235
|
+
let n = await P("set", O ? w(i) : void 0, u, f, i);
|
|
10232
10236
|
if (n !== null) return n;
|
|
10233
10237
|
let r = nf({
|
|
10234
10238
|
bindRef: c,
|
|
@@ -10237,9 +10241,9 @@ function hf(e, n = {}) {
|
|
|
10237
10241
|
allowKeys: d,
|
|
10238
10242
|
snapshots: g,
|
|
10239
10243
|
maxSnapshots: _,
|
|
10240
|
-
audit:
|
|
10244
|
+
audit: N,
|
|
10241
10245
|
op: "draft_commit",
|
|
10242
|
-
onWrite:
|
|
10246
|
+
onWrite: M,
|
|
10243
10247
|
internalAfterWrite: a,
|
|
10244
10248
|
protectedCtx: h,
|
|
10245
10249
|
hashFn: k
|
|
@@ -10253,9 +10257,9 @@ function hf(e, n = {}) {
|
|
|
10253
10257
|
description: "把 draft_write 累积的草稿合并 + JSON.parse + 乐观锁 + schema 校验,原子提交主数据(任一步失败不写,草稿保留可修后重试;成功清草稿 + 自动快照可回退)。仅大 JSON 从零生成用;小改用 write。",
|
|
10254
10258
|
schema: t.object({ draftId: t.string().describe("要提交的草稿标识(对应 draft_write 的 draftId)") })
|
|
10255
10259
|
});
|
|
10256
|
-
|
|
10260
|
+
F(l), me.push(i, l);
|
|
10257
10261
|
}
|
|
10258
|
-
let
|
|
10262
|
+
let z = [];
|
|
10259
10263
|
if (e.resources?.length && p) {
|
|
10260
10264
|
let e = s(async ({ path: e, handle: t }) => {
|
|
10261
10265
|
let n = e;
|
|
@@ -10325,9 +10329,9 @@ function hf(e, n = {}) {
|
|
|
10325
10329
|
details: oi(n.error.issues)
|
|
10326
10330
|
});
|
|
10327
10331
|
}
|
|
10328
|
-
let l = await
|
|
10332
|
+
let l = await A();
|
|
10329
10333
|
try {
|
|
10330
|
-
p.update(i, t), Ec(c, i, t), T(k(), r),
|
|
10334
|
+
p.update(i, t), Ec(c, i, t), T(k(), r), M();
|
|
10331
10335
|
} finally {
|
|
10332
10336
|
l.release();
|
|
10333
10337
|
}
|
|
@@ -10341,7 +10345,7 @@ function hf(e, n = {}) {
|
|
|
10341
10345
|
value: t.unknown().describe("新值(需符合字段 schema 类型)")
|
|
10342
10346
|
})
|
|
10343
10347
|
});
|
|
10344
|
-
|
|
10348
|
+
F(n);
|
|
10345
10349
|
let r = s(async () => {
|
|
10346
10350
|
let e = p.list();
|
|
10347
10351
|
if (!e.length) {
|
|
@@ -10372,22 +10376,22 @@ function hf(e, n = {}) {
|
|
|
10372
10376
|
handle: t.string().optional().describe("占位符句柄(与 path 二选一)")
|
|
10373
10377
|
})
|
|
10374
10378
|
});
|
|
10375
|
-
|
|
10379
|
+
F(i), z.push(e, n, r, i);
|
|
10376
10380
|
}
|
|
10377
|
-
let
|
|
10378
|
-
F,
|
|
10379
|
-
le,
|
|
10381
|
+
let B = [
|
|
10380
10382
|
I,
|
|
10383
|
+
ce,
|
|
10381
10384
|
L,
|
|
10385
|
+
R,
|
|
10386
|
+
le,
|
|
10382
10387
|
ue,
|
|
10383
10388
|
de,
|
|
10384
10389
|
fe,
|
|
10385
10390
|
pe,
|
|
10386
|
-
me,
|
|
10387
|
-
...
|
|
10388
|
-
...R
|
|
10391
|
+
...me,
|
|
10392
|
+
...z
|
|
10389
10393
|
];
|
|
10390
|
-
function
|
|
10394
|
+
function V(e) {
|
|
10391
10395
|
let t = e, n = (e) => {
|
|
10392
10396
|
if (e === void 0) return "undefined";
|
|
10393
10397
|
let t = $(e, 200);
|
|
@@ -10481,23 +10485,23 @@ function hf(e, n = {}) {
|
|
|
10481
10485
|
}]
|
|
10482
10486
|
};
|
|
10483
10487
|
}
|
|
10484
|
-
Object.defineProperty(
|
|
10485
|
-
value:
|
|
10488
|
+
Object.defineProperty(B, "controller", {
|
|
10489
|
+
value: oe,
|
|
10486
10490
|
enumerable: !1,
|
|
10487
10491
|
configurable: !1,
|
|
10488
10492
|
writable: !1
|
|
10489
|
-
}), Object.defineProperty(
|
|
10490
|
-
value:
|
|
10493
|
+
}), Object.defineProperty(B, "previewWrite", {
|
|
10494
|
+
value: V,
|
|
10491
10495
|
enumerable: !1,
|
|
10492
10496
|
configurable: !1,
|
|
10493
10497
|
writable: !1
|
|
10494
10498
|
});
|
|
10495
|
-
for (let e of
|
|
10499
|
+
for (let e of B) Object.defineProperty(e, "__dataOpsScoped", {
|
|
10496
10500
|
value: !0,
|
|
10497
10501
|
enumerable: !1,
|
|
10498
10502
|
configurable: !1
|
|
10499
10503
|
});
|
|
10500
|
-
return
|
|
10504
|
+
return B;
|
|
10501
10505
|
}
|
|
10502
10506
|
//#endregion
|
|
10503
10507
|
//#region src/core/tools/htmlValidate.ts
|
|
@@ -12094,7 +12098,7 @@ function Vp(e) {
|
|
|
12094
12098
|
//#endregion
|
|
12095
12099
|
//#region src/core/sdk/conflictManager.ts
|
|
12096
12100
|
function Hp(e, t, n) {
|
|
12097
|
-
let r = /* @__PURE__ */
|
|
12101
|
+
let r = /* @__PURE__ */ Gt(null), i = 0;
|
|
12098
12102
|
function a(a, o) {
|
|
12099
12103
|
let s = t?.() ?? "ask";
|
|
12100
12104
|
if (s !== "ask") {
|
|
@@ -15092,7 +15096,7 @@ function J_(e, t, n, r) {
|
|
|
15092
15096
|
}), i;
|
|
15093
15097
|
},
|
|
15094
15098
|
afterModel: (t) => {
|
|
15095
|
-
let n =
|
|
15099
|
+
let n = re(t.message);
|
|
15096
15100
|
n && (r.prompt_tokens = (r.prompt_tokens ?? 0) + (n.prompt_tokens ?? 0), r.completion_tokens = (r.completion_tokens ?? 0) + (n.completion_tokens ?? 0), r.total_tokens = (r.total_tokens ?? 0) + (n.total_tokens ?? 0), n.reasoning_tokens && (r.reasoning_tokens = (r.reasoning_tokens ?? 0) + n.reasoning_tokens), i++, e({
|
|
15097
15101
|
type: "usage",
|
|
15098
15102
|
round: i,
|
|
@@ -15136,7 +15140,7 @@ function X_(e, n, r) {
|
|
|
15136
15140
|
prompt_tokens: 0,
|
|
15137
15141
|
completion_tokens: 0,
|
|
15138
15142
|
total_tokens: 0
|
|
15139
|
-
}, o = Hp(() =>
|
|
15143
|
+
}, o = Hp(() => Y, () => e.conflictPolicy ?? "ask", () => X.agent?.debugLogs?.value), c = /* @__PURE__ */ Gt(0), l = _m(e.storage);
|
|
15140
15144
|
l && (e.debug && l.onEvent((e) => console.log("[page-agent-sdk][storage]", e)), l.onEvent((e) => {
|
|
15141
15145
|
e.type === "quota" && X.agent?.debugLogs?.value?.push({
|
|
15142
15146
|
timestamp: Date.now(),
|
|
@@ -15156,9 +15160,9 @@ function X_(e, n, r) {
|
|
|
15156
15160
|
}
|
|
15157
15161
|
let y = wm(e, g.contextWindow), b = y.enableLLMSummary !== !1, x = (e.contextOptions && e.contextOptions.preserveLastToolResults) ?? Cm[e.contextPreset ?? "auto"], S = new Set(x), C = e.llm;
|
|
15158
15162
|
e.debug && !d && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
15159
|
-
let w = /* @__PURE__ */
|
|
15163
|
+
let w = /* @__PURE__ */ Pt([]), T = xd(e.vfs?.initialFiles, {
|
|
15160
15164
|
persist: l ? { save: (e) => {
|
|
15161
|
-
|
|
15165
|
+
vn.persistSave({ vfs: e });
|
|
15162
15166
|
} } : void 0,
|
|
15163
15167
|
maxBytes: e.vfs?.maxBytes,
|
|
15164
15168
|
poolBytes: e.vfs?.poolBytes
|
|
@@ -15177,16 +15181,16 @@ function X_(e, n, r) {
|
|
|
15177
15181
|
type: "middleware",
|
|
15178
15182
|
data: { stage: "resume_notice" }
|
|
15179
15183
|
});
|
|
15180
|
-
}), ne = Dm(),
|
|
15181
|
-
|
|
15184
|
+
}), ne = Dm(), A = e.approval?.timeoutMs, re = A !== void 0 && Number.isFinite(A) && A > 0 ? A : A !== void 0 && (!Number.isFinite(A) || A < 0) ? 0 : 3e4, ie = (e) => {
|
|
15185
|
+
Y({
|
|
15182
15186
|
type: "error",
|
|
15183
15187
|
message: `确认请求(${e.toolName})${Math.round(e.waitedMs / 1e3)}s 无响应已自动拒绝 —— 当前路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
15184
15188
|
severity: "observable",
|
|
15185
15189
|
code: "APPROVAL_AUTO_REJECTED",
|
|
15186
15190
|
context: e
|
|
15187
15191
|
});
|
|
15188
|
-
},
|
|
15189
|
-
ne.lastPlanConfirmation = e,
|
|
15192
|
+
}, ae = wu((e) => {
|
|
15193
|
+
ne.lastPlanConfirmation = e, vn.persistSave({ planConfirmation: e }), X.agent?.debugLogs?.value?.push({
|
|
15190
15194
|
timestamp: Date.now(),
|
|
15191
15195
|
type: "middleware",
|
|
15192
15196
|
data: {
|
|
@@ -15196,69 +15200,69 @@ function X_(e, n, r) {
|
|
|
15196
15200
|
}
|
|
15197
15201
|
});
|
|
15198
15202
|
}, {
|
|
15199
|
-
timeoutMs:
|
|
15200
|
-
onAutoReject:
|
|
15201
|
-
}),
|
|
15202
|
-
getSchema: () =>
|
|
15203
|
-
getBind: () =>
|
|
15204
|
-
onChange: (e) =>
|
|
15203
|
+
timeoutMs: re,
|
|
15204
|
+
onAutoReject: ie
|
|
15205
|
+
}), j = Zc({
|
|
15206
|
+
getSchema: () => W()?.schema,
|
|
15207
|
+
getBind: () => W()?.bind,
|
|
15208
|
+
onChange: (e) => Y({
|
|
15205
15209
|
type: "focus_change",
|
|
15206
15210
|
focuses: e
|
|
15207
15211
|
})
|
|
15208
|
-
}),
|
|
15209
|
-
let t = Yc(
|
|
15212
|
+
}), M = (e) => {
|
|
15213
|
+
let t = Yc(W()?.bind, e.path);
|
|
15210
15214
|
return t ? {
|
|
15211
15215
|
...e,
|
|
15212
15216
|
pgId: t
|
|
15213
15217
|
} : e;
|
|
15214
|
-
},
|
|
15215
|
-
typeof e.memory == "function" &&
|
|
15216
|
-
let
|
|
15218
|
+
}, oe = fu(), N = pu(e.memory || "");
|
|
15219
|
+
typeof e.memory == "function" && N.refresh();
|
|
15220
|
+
let se = { current: null }, P = e.data ? {
|
|
15217
15221
|
...e.data,
|
|
15218
15222
|
description: e.data.description ?? "主数据对象"
|
|
15219
|
-
} : void 0,
|
|
15220
|
-
|
|
15221
|
-
let
|
|
15222
|
-
for (let e of
|
|
15223
|
+
} : void 0, F = !(e.subagents ?? []).some((e) => e._codeAsset) && bm(e.capabilities).subagent, I = e.subagents;
|
|
15224
|
+
F && P?.schema && Js(P.schema).length && (I = [...e.subagents ?? [], Cp()], console.info("[page-agent-sdk] 检测到 schema 含代码组件数组(如 components[].code),已自动装配 HTML 代码子 agent(委派编排 + vfs 工作副本 + 格式校验 + 增量 commit)。需定制(codeField/formatCheck/craftNotes 等)请显式传 createHtmlSubagent(...)"));
|
|
15225
|
+
let ce = (I ?? []).filter((e) => !!e._codeAsset), L = /* @__PURE__ */ new Set();
|
|
15226
|
+
for (let e of ce) {
|
|
15223
15227
|
if (e._codeAsset.writablePaths.length) continue;
|
|
15224
|
-
let t = Js(
|
|
15225
|
-
t.length ? (e._codeAsset.writablePaths = t, Array.isArray(e.writablePaths) && (e.writablePaths = t), e._rebuildCodeAssetPaths?.(t[0]), console.info(`[page-agent-sdk][createHtmlSubagent] 未传 writablePaths,已从 schema 推断: [${t.map((e) => `'${e}'`).join(", ")}]`)) : (console.warn("[page-agent-sdk][createHtmlSubagent] 未能从 schema 推断 writablePaths(开放 schema(z.any()/z.record())/嵌套容器(如 sections[].children[])/点路径 codeField(如 props.html_code)不支持自动推断),已跳过该 html 子 agent(整体不受影响);如确需代码资产机制(vfs + 格式校验 + 增量 commit),请显式传 writablePaths(代码组件 data 区,如 ['components'])"),
|
|
15228
|
+
let t = Js(P?.schema, e._codeAsset.codeField);
|
|
15229
|
+
t.length ? (e._codeAsset.writablePaths = t, Array.isArray(e.writablePaths) && (e.writablePaths = t), e._rebuildCodeAssetPaths?.(t[0]), console.info(`[page-agent-sdk][createHtmlSubagent] 未传 writablePaths,已从 schema 推断: [${t.map((e) => `'${e}'`).join(", ")}]`)) : (console.warn("[page-agent-sdk][createHtmlSubagent] 未能从 schema 推断 writablePaths(开放 schema(z.any()/z.record())/嵌套容器(如 sections[].children[])/点路径 codeField(如 props.html_code)不支持自动推断),已跳过该 html 子 agent(整体不受影响);如确需代码资产机制(vfs + 格式校验 + 增量 commit),请显式传 writablePaths(代码组件 data 区,如 ['components'])"), L.add(e));
|
|
15226
15230
|
}
|
|
15227
|
-
let
|
|
15228
|
-
getData: () =>
|
|
15229
|
-
consumeDataDirty: () =>
|
|
15230
|
-
slotPaths:
|
|
15231
|
+
let R = L.size ? ce.filter((e) => !L.has(e)) : ce, le = L.size ? (I ?? []).filter((e) => !L.has(e)) : I, ue = R.length > 0, de = R.flatMap((e) => e._codeAsset.writablePaths), fe = R.flatMap((e) => e._codeAsset.writablePaths.map((t) => `${t}.${e._codeAsset.codeField}`)), pe = e.checkpoint, me = pe !== void 0 && pe !== !1, z = me ? Mu({
|
|
15232
|
+
getData: () => W()?.bind,
|
|
15233
|
+
consumeDataDirty: () => U?.consumeDataDirty?.() ?? !0,
|
|
15234
|
+
slotPaths: P ? [""] : [],
|
|
15231
15235
|
vfsStore: T,
|
|
15232
15236
|
todosMw: D,
|
|
15233
|
-
getTodos: () =>
|
|
15237
|
+
getTodos: () => se.current?.getState?.()?.todos ?? [],
|
|
15234
15238
|
messages: w,
|
|
15235
|
-
maxCheckpoints:
|
|
15236
|
-
}) : null,
|
|
15239
|
+
maxCheckpoints: pe && typeof pe == "object" ? pe.maxCheckpoints : void 0
|
|
15240
|
+
}) : null, B = !pe || typeof pe != "object" || pe.auto !== !1, V = bm(e.capabilities), he = V.dataOps, ge = V.draftWrite, _e = V.automation, ve = V.domInspect && (g.vision === !0 || typeof e.images?.describe == "function"), ye = _d({
|
|
15237
15241
|
...e,
|
|
15238
15242
|
locale: e.i18n?.locale,
|
|
15239
|
-
dataOps:
|
|
15240
|
-
domInspect:
|
|
15241
|
-
screenshot:
|
|
15243
|
+
dataOps: he && !!P,
|
|
15244
|
+
domInspect: V.domInspect === !0,
|
|
15245
|
+
screenshot: ve
|
|
15242
15246
|
});
|
|
15243
|
-
if (
|
|
15244
|
-
let e =
|
|
15245
|
-
e && (
|
|
15246
|
-
} else
|
|
15247
|
-
let
|
|
15247
|
+
if (ue) {
|
|
15248
|
+
let e = R.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
|
|
15249
|
+
e && (ye += "\n\n" + e);
|
|
15250
|
+
} else P?.schema && qs(P.schema) && (ye += "\n\n" + dc.htmlDirectWriteFallback, console.warn("[page-agent-sdk] 检测到 schema 含 code 字段但未注册 html 子 agent:已自动注入「主 agent 自己写 HTML」编排(code 作普通字段直接 write,无 vfs 工作副本 / 无格式校验门禁)。如需代码资产机制(vfs + 格式校验 + 增量 commit + 主上下文 code 摘要),注册 createHtmlSubagent;若确为降级意图可忽略。"));
|
|
15251
|
+
let H = he && P ? hf(P, {
|
|
15248
15252
|
onAudit: e.onAudit ?? (e.debug ? (e) => console.log("[page-agent-sdk][data audit]", e) : void 0),
|
|
15249
15253
|
maxSnapshots: e.maxSnapshots,
|
|
15250
15254
|
onConflict: o.set,
|
|
15251
15255
|
conflictWatchFields: e.conflictWatchFields,
|
|
15252
15256
|
maxParallelTools: e.maxParallelTools,
|
|
15253
|
-
vfsStore:
|
|
15254
|
-
...
|
|
15255
|
-
...
|
|
15256
|
-
}) : [],
|
|
15257
|
-
getBind: () =>
|
|
15258
|
-
recomputeAll: () =>
|
|
15259
|
-
hasBaselines: () =>
|
|
15260
|
-
isManaged: (e) =>
|
|
15261
|
-
hash: (e) =>
|
|
15257
|
+
vfsStore: ge || P?.resources?.length ? T : void 0,
|
|
15258
|
+
...de.length ? { pgIdPaths: de } : {},
|
|
15259
|
+
...fe.length ? { largeTextPaths: fe } : {}
|
|
15260
|
+
}) : [], be = he ? H : [], U = he && P ? H.controller ?? null : null, xe = he && P ? H.previewWrite : void 0, Se = he && P?.resources?.length && U?.getResourcesSnapshot ? P_({ getResourcesSnapshot: () => U?.getResourcesSnapshot?.() ?? [] }) : void 0, W = () => U?.get() ?? P, Ce = new Set(H.map((e) => e.name)), we = e.conflictWatchFields ?? [], Te = !we.includes("*") && we.length ? new Set(we) : void 0, G = U ? Jf({
|
|
15261
|
+
getBind: () => W()?.bind,
|
|
15262
|
+
recomputeAll: () => U.recomputeAllBaselines?.(),
|
|
15263
|
+
hasBaselines: () => U.hasBaselines?.() ?? !1,
|
|
15264
|
+
isManaged: (e) => Ce.has(e),
|
|
15265
|
+
hash: (e) => Te ? Fc(Tu(e), Te) : Pc(Tu(e)),
|
|
15262
15266
|
log: (e, t) => {
|
|
15263
15267
|
let n = X.agent?.debugLogs;
|
|
15264
15268
|
n && (n.value.push({
|
|
@@ -15270,27 +15274,27 @@ function X_(e, n, r) {
|
|
|
15270
15274
|
}
|
|
15271
15275
|
}), Jt(n));
|
|
15272
15276
|
}
|
|
15273
|
-
}) : void 0,
|
|
15274
|
-
|
|
15275
|
-
let
|
|
15277
|
+
}) : void 0, Ee = /* @__PURE__ */ new Map();
|
|
15278
|
+
V.domInspect && !ve && console.warn("[page-agent-sdk][take_screenshot] domInspect 已开启但主模型不支持图片(vision=false)且未配 images.describe,截图工具未装载(视觉验证退回 get_dom/dom_info 结构推断;换多模态模型 / llm.vision:true / 配 images.describe 后重建 SDK 生效)");
|
|
15279
|
+
let De = [], Oe = (e) => {
|
|
15276
15280
|
if (e.type === "tool_result" && e.name === "take_screenshot") {
|
|
15277
|
-
let t =
|
|
15281
|
+
let t = De.find((e) => !e.eventConsumed);
|
|
15278
15282
|
if (t) return t.eventConsumed = !0, Object.assign(e, { image: {
|
|
15279
15283
|
dataUri: t.image.dataUri,
|
|
15280
15284
|
vfsRef: t.meta.vfsRef
|
|
15281
15285
|
} });
|
|
15282
15286
|
}
|
|
15283
15287
|
return e;
|
|
15284
|
-
},
|
|
15288
|
+
}, ke = g.vision === !0 || typeof e.images?.describe == "function" ? sg({
|
|
15285
15289
|
getVision: () => g.vision === !0,
|
|
15286
15290
|
describe: e.images?.describe,
|
|
15287
15291
|
onShot: (e, t) => {
|
|
15288
|
-
|
|
15292
|
+
De.push({
|
|
15289
15293
|
image: e,
|
|
15290
15294
|
meta: t
|
|
15291
15295
|
});
|
|
15292
15296
|
}
|
|
15293
|
-
}) : void 0,
|
|
15297
|
+
}) : void 0, Ae = ve ? ag({
|
|
15294
15298
|
render: e.screenshot?.renderer,
|
|
15295
15299
|
getActiveFocus: () => X.getFocus(),
|
|
15296
15300
|
focusSelector: e.screenshot?.focusSelector,
|
|
@@ -15308,24 +15312,24 @@ function X_(e, n, r) {
|
|
|
15308
15312
|
getVision: () => g.vision === !0,
|
|
15309
15313
|
describe: e.images?.describe,
|
|
15310
15314
|
onShot: (e, t) => {
|
|
15311
|
-
|
|
15315
|
+
De.push({
|
|
15312
15316
|
image: e,
|
|
15313
15317
|
meta: t
|
|
15314
15318
|
});
|
|
15315
15319
|
}
|
|
15316
|
-
}) : void 0,
|
|
15320
|
+
}) : void 0, je = !Ap(e.llm) && (e.llm.provider ?? "openai") === "anthropic" ? "anthropic" : "openai", Me = Ae || ke ? {
|
|
15317
15321
|
name: "screenshotChannel",
|
|
15318
15322
|
wrapModelCall: async (e, t) => {
|
|
15319
|
-
if (
|
|
15320
|
-
let t =
|
|
15323
|
+
if (De.length) {
|
|
15324
|
+
let t = De.splice(0), n = yi(t.map((e, t) => e.meta.mode === "url" ? `[图片 ${t + 1}] 原图直投 ${e.image.url ?? ""}(view_image,全分辨率非渲染态)` : `[截图 ${t + 1}] ${e.meta.mode}${e.meta.selector ? ` selector="${e.meta.selector}"` : ""}${e.meta.vfsRef ? `(原图 vfs:${e.meta.vfsRef})` : ""}`).join("\n") + "\n(视觉内容如上,请结合图片回答/继续)", t.map((e) => ({
|
|
15321
15325
|
dataUri: e.image.dataUri,
|
|
15322
15326
|
url: e.image.url
|
|
15323
|
-
})),
|
|
15327
|
+
})), je);
|
|
15324
15328
|
n && e.messages.push(new i({ content: n }));
|
|
15325
15329
|
}
|
|
15326
15330
|
return t(e);
|
|
15327
15331
|
}
|
|
15328
|
-
} : null,
|
|
15332
|
+
} : null, Ne = !1, Pe = V.domEdit ? bg({
|
|
15329
15333
|
onEdit: (e) => {
|
|
15330
15334
|
X.agent?.debugLogs?.value?.push({
|
|
15331
15335
|
timestamp: Date.now(),
|
|
@@ -15336,22 +15340,22 @@ function X_(e, n, r) {
|
|
|
15336
15340
|
applied: e.applied,
|
|
15337
15341
|
dryRun: e.dryRun
|
|
15338
15342
|
}
|
|
15339
|
-
}), !e.dryRun && e.applied > 0 && (
|
|
15343
|
+
}), !e.dryRun && e.applied > 0 && (Ne = !0);
|
|
15340
15344
|
},
|
|
15341
15345
|
onRestore: (e) => {
|
|
15342
|
-
e.restored > 0 && (
|
|
15346
|
+
e.restored > 0 && (Ne = !0);
|
|
15343
15347
|
}
|
|
15344
|
-
}) : [],
|
|
15348
|
+
}) : [], Fe = [...E_(V, be, Lg, V.domInspect ? [
|
|
15345
15349
|
...Yg,
|
|
15346
|
-
...
|
|
15347
|
-
...
|
|
15348
|
-
...
|
|
15349
|
-
] : [], v_), ...
|
|
15350
|
-
|
|
15351
|
-
let
|
|
15350
|
+
...Pe,
|
|
15351
|
+
...Ae ? [Ae] : [],
|
|
15352
|
+
...V.skills ? [] : [a_, o_]
|
|
15353
|
+
] : [], v_), ...ke ? [ke] : []];
|
|
15354
|
+
ke && Ee.set("view_image", "builtin"), Fe.forEach((e) => Ee.set(e.name, "builtin"));
|
|
15355
|
+
let Ie = e.proposals ? Fg(e.proposals, {
|
|
15352
15356
|
emit: (e) => {
|
|
15353
15357
|
try {
|
|
15354
|
-
|
|
15358
|
+
Y(e);
|
|
15355
15359
|
} catch {}
|
|
15356
15360
|
},
|
|
15357
15361
|
log: (e, t) => {
|
|
@@ -15365,31 +15369,31 @@ function X_(e, n, r) {
|
|
|
15365
15369
|
}
|
|
15366
15370
|
});
|
|
15367
15371
|
}
|
|
15368
|
-
}) : null,
|
|
15369
|
-
|
|
15370
|
-
let
|
|
15371
|
-
|
|
15372
|
-
let
|
|
15373
|
-
|
|
15374
|
-
let
|
|
15375
|
-
let e =
|
|
15376
|
-
return e.length ?
|
|
15372
|
+
}) : null, Le = [...e.tools || [], ...Ie?.tools ?? []];
|
|
15373
|
+
Le.forEach((e) => Ee.set(e.name, "user"));
|
|
15374
|
+
let Re = x_(e.actions ?? {});
|
|
15375
|
+
Re.forEach((e) => Ee.set(e.name, "action"));
|
|
15376
|
+
let ze = Ie ? e.proposals?.readToolName || "read_content" : null, Be = Ie ? e.proposals?.toolName || "propose_content" : null, Ve = /* @__PURE__ */ new Set([...Object.entries(e.actions ?? {}).filter(([, e]) => e?.readsHostState === !0).map(([e]) => e), ...ze ? [ze] : []]), He = /* @__PURE__ */ new Set([...Object.entries(e.actions ?? {}).filter(([, e]) => e?.deferredWrite === !0).map(([e]) => e), ...Be ? [Be] : []]), Ue = [], We = !1, Ge = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1), Ke = Ge ? Cu() : null;
|
|
15377
|
+
Ke && Ee.set(xu, "builtin");
|
|
15378
|
+
let qe = me && z ? [s(async () => {
|
|
15379
|
+
let e = z.list();
|
|
15380
|
+
return e.length ? z.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
|
|
15377
15381
|
}, {
|
|
15378
15382
|
name: "restore_last_checkpoint",
|
|
15379
15383
|
description: "回退到最近一次正常状态(整体还原对话历史 + 主数据 + vfs + todos)。当本轮操作出错、页面被改坏、或走偏时调用,回到本轮起点重新来过。不传参数即回退最近一次。",
|
|
15380
15384
|
schema: t.object({}).optional()
|
|
15381
15385
|
}), s(async () => {
|
|
15382
|
-
let e =
|
|
15386
|
+
let e = z.list();
|
|
15383
15387
|
return e.length ? "可用 checkpoint:\n" + e.map((e) => `#${e.id} [${e.label ?? "auto"}] 消息数=${e.messageCount} 时间=${new Date(e.timestamp).toLocaleTimeString()}`).join("\n") : "无可用 checkpoint。";
|
|
15384
15388
|
}, {
|
|
15385
15389
|
name: "list_checkpoints",
|
|
15386
15390
|
description: "列出可用会话 checkpoint(回退点)。",
|
|
15387
15391
|
schema: t.object({}).optional()
|
|
15388
15392
|
})] : [];
|
|
15389
|
-
|
|
15390
|
-
let
|
|
15391
|
-
let n =
|
|
15392
|
-
return n ? Is(n, e) ? (
|
|
15393
|
+
qe.forEach((e) => Ee.set(e.name, "builtin"));
|
|
15394
|
+
let Je = V.focus, Ye = s(async ({ path: e, label: t }) => {
|
|
15395
|
+
let n = W()?.schema;
|
|
15396
|
+
return n ? Is(n, e) ? (j.setFocus(M({
|
|
15393
15397
|
path: e,
|
|
15394
15398
|
...t ? { label: t } : {}
|
|
15395
15399
|
}), "agent"), `已聚焦到 ${e}${t ? `(${t})` : ""}。后续仅可写该子树(越界被拒),每轮只看到该组件结构。完成精修后调 clear_focus 退出。`) : `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。` : "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
@@ -15400,19 +15404,19 @@ function X_(e, n, r) {
|
|
|
15400
15404
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
15401
15405
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
15402
15406
|
})
|
|
15403
|
-
}),
|
|
15407
|
+
}), Xe = s(async () => (j.clearFocus("agent"), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
15404
15408
|
name: "clear_focus",
|
|
15405
15409
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
15406
15410
|
schema: t.object({}).optional()
|
|
15407
|
-
}),
|
|
15408
|
-
let n =
|
|
15411
|
+
}), Ze = s(async ({ path: e, label: t }) => {
|
|
15412
|
+
let n = W()?.schema;
|
|
15409
15413
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
15410
15414
|
if (!Is(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
15411
|
-
|
|
15415
|
+
j.addFocus(M({
|
|
15412
15416
|
path: e,
|
|
15413
15417
|
...t ? { label: t } : {}
|
|
15414
15418
|
}), "agent");
|
|
15415
|
-
let r =
|
|
15419
|
+
let r = j.getFocuses();
|
|
15416
15420
|
return `已聚焦 ${e}${t ? `(${t})` : ""}(当前共 ${r.length} 个焦点:${r.map((e) => e.path).join(", ")})。后续仅可写这些子树之一(越界被拒)。`;
|
|
15417
15421
|
}, {
|
|
15418
15422
|
name: "add_focus",
|
|
@@ -15421,72 +15425,72 @@ function X_(e, n, r) {
|
|
|
15421
15425
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
15422
15426
|
label: t.string().optional().describe("人类可读标签")
|
|
15423
15427
|
})
|
|
15424
|
-
}),
|
|
15425
|
-
let t =
|
|
15426
|
-
|
|
15427
|
-
let n =
|
|
15428
|
+
}), Qe = s(async ({ path: e }) => {
|
|
15429
|
+
let t = j.getFocuses().length;
|
|
15430
|
+
j.removeFocus(e, "agent");
|
|
15431
|
+
let n = j.getFocuses();
|
|
15428
15432
|
return n.length === t ? `path "${e}" 不在当前焦点列表中(当前:${n.map((e) => e.path).join(", ") || "无"})。` : n.length ? `已移除焦点 ${e}(剩余 ${n.length} 个:${n.map((e) => e.path).join(", ")})。` : `已移除焦点 ${e},聚焦已清空,恢复全量操作范围。`;
|
|
15429
15433
|
}, {
|
|
15430
15434
|
name: "remove_focus",
|
|
15431
15435
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
15432
15436
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
15433
|
-
}),
|
|
15437
|
+
}), $e = Je ? [
|
|
15438
|
+
Ye,
|
|
15434
15439
|
Xe,
|
|
15435
15440
|
Ze,
|
|
15436
|
-
Qe
|
|
15437
|
-
$e
|
|
15441
|
+
Qe
|
|
15438
15442
|
] : [];
|
|
15439
|
-
|
|
15440
|
-
let
|
|
15441
|
-
builtinTools: () =>
|
|
15442
|
-
userTools: () =>
|
|
15443
|
-
actionTools: () =>
|
|
15444
|
-
humanConfirmTool: () =>
|
|
15445
|
-
checkpointTools: () =>
|
|
15446
|
-
focusTools: () =>
|
|
15447
|
-
mcpTools: () =>
|
|
15448
|
-
loadedSkillTools: () =>
|
|
15449
|
-
}),
|
|
15450
|
-
if (
|
|
15451
|
-
if (
|
|
15452
|
-
let
|
|
15453
|
-
e.debug &&
|
|
15454
|
-
let
|
|
15455
|
-
|
|
15456
|
-
let
|
|
15443
|
+
$e.forEach((e) => Ee.set(e.name, "builtin"));
|
|
15444
|
+
let et = [], tt = /* @__PURE__ */ new Map(), nt = jm({
|
|
15445
|
+
builtinTools: () => Fe,
|
|
15446
|
+
userTools: () => Le,
|
|
15447
|
+
actionTools: () => Re,
|
|
15448
|
+
humanConfirmTool: () => Ke,
|
|
15449
|
+
checkpointTools: () => qe,
|
|
15450
|
+
focusTools: () => $e,
|
|
15451
|
+
mcpTools: () => Ue,
|
|
15452
|
+
loadedSkillTools: () => et
|
|
15453
|
+
}), K = nt(), rt = V.planning, it = V.missionAnchor, at = V.workingMemory, ot = V.skills, st = V.vfs || ue;
|
|
15454
|
+
if (st) for (let e of Dd) Ee.set(e, "builtin");
|
|
15455
|
+
if (rt) for (let e of D.tools ?? []) Ee.set(e.name, "builtin");
|
|
15456
|
+
let ct = V.summarization, lt = V.agentCompression && !!m;
|
|
15457
|
+
e.debug && V.agentCompression && !m && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
15458
|
+
let ut = V.memory, dt = V.subagent, ft = dt ? Rl() : void 0, pt = e.verify?.maxAttempts ?? 2, mt = !!(e.verify?.check || e.verify?.maxAttempts || e.verify?.adversarial), ht = e.capabilities?.verify === !1, gt = (V.verify || mt && !ht) && e.verify?.enabled !== !1 && pt > 0, _t = V.contextInspector;
|
|
15459
|
+
mt && !gt && e.verify?.enabled !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
|
|
15460
|
+
let vt = e.subagent, yt = vt?.allowedTools ?? [], bt = e.permissions?.length ? yu(e.permissions) : void 0, xt = e.approval?.preview === !0 && xe ? (e, t) => e === "write" ? xe(t) : null : void 0, St = e.approval?.previewWrite || xt ? (t, n) => e.approval?.previewWrite?.(t, n) ?? xt?.(t, n) ?? null : void 0, Ct = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? bu({
|
|
15457
15461
|
...e.approval,
|
|
15458
|
-
timeoutMs: e.approval.timeoutMs ??
|
|
15459
|
-
onAutoReject:
|
|
15460
|
-
previewWrite:
|
|
15461
|
-
}) : void 0,
|
|
15462
|
-
...
|
|
15463
|
-
...
|
|
15464
|
-
...
|
|
15465
|
-
],
|
|
15466
|
-
llm:
|
|
15467
|
-
allTools: () => X.agent?.allTools ??
|
|
15468
|
-
allowedTools:
|
|
15462
|
+
timeoutMs: e.approval.timeoutMs ?? re,
|
|
15463
|
+
onAutoReject: ie,
|
|
15464
|
+
previewWrite: St
|
|
15465
|
+
}) : void 0, wt = [
|
|
15466
|
+
...bt ? [bt] : [],
|
|
15467
|
+
...Ct ? [Ct] : [],
|
|
15468
|
+
...G ? [G] : []
|
|
15469
|
+
], Tt = !dt || vt?.enabled === !1 ? void 0 : iu({
|
|
15470
|
+
llm: vt?.llm ?? e.llm,
|
|
15471
|
+
allTools: () => X.agent?.allTools ?? K,
|
|
15472
|
+
allowedTools: yt.length ? yt : void 0,
|
|
15469
15473
|
...e.staleReadInvalidation === void 0 ? {} : { staleReadInvalidation: e.staleReadInvalidation },
|
|
15470
|
-
systemPrompt:
|
|
15471
|
-
temperature:
|
|
15472
|
-
maxTokens:
|
|
15473
|
-
skills:
|
|
15474
|
-
maxDepth:
|
|
15475
|
-
maxParallel:
|
|
15476
|
-
thinkingMode:
|
|
15474
|
+
systemPrompt: vt?.systemPrompt,
|
|
15475
|
+
temperature: vt?.temperature,
|
|
15476
|
+
maxTokens: vt?.maxTokens,
|
|
15477
|
+
skills: vt?.skills,
|
|
15478
|
+
maxDepth: vt?.maxDepth,
|
|
15479
|
+
maxParallel: vt?.maxParallel,
|
|
15480
|
+
thinkingMode: vt?.thinkingMode,
|
|
15477
15481
|
debug: e.debug,
|
|
15478
|
-
getFocuses: () =>
|
|
15479
|
-
getSchema: () =>
|
|
15480
|
-
tracker:
|
|
15481
|
-
guardMiddleware:
|
|
15482
|
-
getVfsFiles:
|
|
15483
|
-
enterDataScope:
|
|
15484
|
-
exitDataScope:
|
|
15482
|
+
getFocuses: () => j.getActiveFocuses(),
|
|
15483
|
+
getSchema: () => W()?.schema ?? null,
|
|
15484
|
+
tracker: ft,
|
|
15485
|
+
guardMiddleware: wt.length ? wt : void 0,
|
|
15486
|
+
getVfsFiles: st ? () => T.files : void 0,
|
|
15487
|
+
enterDataScope: U?.enterScope ? (e) => U.enterScope(e) : void 0,
|
|
15488
|
+
exitDataScope: U?.exitScope ? (e) => U.exitScope(e) : void 0,
|
|
15485
15489
|
onUsage: (e) => {
|
|
15486
15490
|
a.prompt_tokens = (a.prompt_tokens ?? 0) + (e.prompt_tokens ?? 0), a.completion_tokens = (a.completion_tokens ?? 0) + (e.completion_tokens ?? 0), a.total_tokens = (a.total_tokens ?? 0) + (e.total_tokens ?? 0), e.reasoning_tokens && (a.reasoning_tokens = (a.reasoning_tokens ?? 0) + e.reasoning_tokens);
|
|
15487
15491
|
},
|
|
15488
|
-
timeoutMs:
|
|
15489
|
-
}),
|
|
15492
|
+
timeoutMs: vt?.timeoutMs
|
|
15493
|
+
}), Et = le?.map((e) => {
|
|
15490
15494
|
if (!e._codeAsset) return e;
|
|
15491
15495
|
let t = e._codeAsset, n = Nf({
|
|
15492
15496
|
writablePaths: t.writablePaths,
|
|
@@ -15495,95 +15499,95 @@ function X_(e, n, r) {
|
|
|
15495
15499
|
codeField: t.codeField,
|
|
15496
15500
|
craftNotes: t.craftNotes,
|
|
15497
15501
|
onWarning: (e) => console.warn(`[page-agent-sdk][code-asset] ${e}`),
|
|
15498
|
-
getController: () =>
|
|
15502
|
+
getController: () => U,
|
|
15499
15503
|
vfsStore: T
|
|
15500
15504
|
}), r = [...e.middleware ?? [], n];
|
|
15501
|
-
for (let e of r) e && os(e) && e._setGetController(() =>
|
|
15505
|
+
for (let e of r) e && os(e) && e._setGetController(() => U);
|
|
15502
15506
|
return {
|
|
15503
15507
|
...e,
|
|
15504
15508
|
middleware: r
|
|
15505
15509
|
};
|
|
15506
|
-
}),
|
|
15507
|
-
getBind: () =>
|
|
15508
|
-
writablePaths:
|
|
15509
|
-
getLocked: () =>
|
|
15510
|
-
tools:
|
|
15511
|
-
getCodeFieldPaths: () => zf(
|
|
15510
|
+
}), Dt = ue && dt ? Pf() : void 0, Ot = Dt ? Vf({
|
|
15511
|
+
getBind: () => W()?.bind,
|
|
15512
|
+
writablePaths: de,
|
|
15513
|
+
getLocked: () => Dt.locked(),
|
|
15514
|
+
tools: K,
|
|
15515
|
+
getCodeFieldPaths: () => zf(W()?.bind, R.map((e) => ({
|
|
15512
15516
|
writablePaths: e._codeAsset.writablePaths,
|
|
15513
15517
|
codeField: e._codeAsset.codeField
|
|
15514
15518
|
})))
|
|
15515
|
-
}) : void 0,
|
|
15516
|
-
getSummarizedPaths: () =>
|
|
15517
|
-
clearSummarizedPaths: () =>
|
|
15518
|
-
}) : void 0,
|
|
15519
|
+
}) : void 0, kt = U?.getSummarizedPaths && U.clearSummarizedPaths ? Wf({
|
|
15520
|
+
getSummarizedPaths: () => U.getSummarizedPaths(),
|
|
15521
|
+
clearSummarizedPaths: () => U.clearSummarizedPaths()
|
|
15522
|
+
}) : void 0, At = dt && Et !== void 0 ? su(Et, {
|
|
15519
15523
|
llm: e.llm,
|
|
15520
15524
|
thinkingModeDefault: e.subagent?.thinkingMode,
|
|
15521
15525
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
15522
|
-
allTools: () => X.agent?.allTools ??
|
|
15526
|
+
allTools: () => X.agent?.allTools ?? K,
|
|
15523
15527
|
debug: e.debug,
|
|
15524
|
-
getFocuses: () =>
|
|
15525
|
-
getSchema: () =>
|
|
15526
|
-
getBind: () =>
|
|
15527
|
-
tracker:
|
|
15528
|
-
guardMiddleware:
|
|
15529
|
-
getVfsFiles:
|
|
15530
|
-
enterDataScope:
|
|
15531
|
-
exitDataScope:
|
|
15528
|
+
getFocuses: () => j.getActiveFocuses(),
|
|
15529
|
+
getSchema: () => W()?.schema ?? null,
|
|
15530
|
+
getBind: () => W()?.bind,
|
|
15531
|
+
tracker: ft,
|
|
15532
|
+
guardMiddleware: wt.length ? wt : void 0,
|
|
15533
|
+
getVfsFiles: st ? () => T.files : void 0,
|
|
15534
|
+
enterDataScope: U?.enterScope ? (e) => U.enterScope(e) : void 0,
|
|
15535
|
+
exitDataScope: U?.exitScope ? (e) => U.exitScope(e) : void 0,
|
|
15532
15536
|
onUsage: (e) => {
|
|
15533
15537
|
a.prompt_tokens = (a.prompt_tokens ?? 0) + (e.prompt_tokens ?? 0), a.completion_tokens = (a.completion_tokens ?? 0) + (e.completion_tokens ?? 0), a.total_tokens = (a.total_tokens ?? 0) + (e.total_tokens ?? 0), e.reasoning_tokens && (a.reasoning_tokens = (a.reasoning_tokens ?? 0) + e.reasoning_tokens);
|
|
15534
15538
|
},
|
|
15535
15539
|
timeoutMs: e.subagent?.timeoutMs,
|
|
15536
|
-
...
|
|
15537
|
-
componentLock:
|
|
15538
|
-
resolveComponents: (e) => Ff(e, kf(
|
|
15540
|
+
...Dt ? {
|
|
15541
|
+
componentLock: Dt,
|
|
15542
|
+
resolveComponents: (e) => Ff(e, kf(W()?.bind, de))
|
|
15539
15543
|
} : {}
|
|
15540
|
-
}) : void 0,
|
|
15544
|
+
}) : void 0, jt = At ? At.controller : null, Mt = (t) => {
|
|
15541
15545
|
let n = t.thinkingMode ?? e.subagent?.thinkingMode, r = n ? Ap(t.llm ?? e.llm) ? "instance-noop" : "applied" : "inherited";
|
|
15542
15546
|
return {
|
|
15543
15547
|
...t,
|
|
15544
15548
|
...n ? { thinkingMode: n } : {},
|
|
15545
15549
|
thinkingApplied: r
|
|
15546
15550
|
};
|
|
15547
|
-
},
|
|
15551
|
+
}, Nt = ["read", "fetch_document"], Ft = K.filter((e) => Nt.includes(e.name)), It = gt ? Fu({
|
|
15548
15552
|
check: e.verify.check ?? Vu({
|
|
15549
|
-
schemas: () =>
|
|
15550
|
-
root: () =>
|
|
15553
|
+
schemas: () => W() ? { "": W().schema } : {},
|
|
15554
|
+
root: () => W()?.bind
|
|
15551
15555
|
}),
|
|
15552
15556
|
adversarial: e.verify?.adversarial ? {
|
|
15553
15557
|
llm: e.llm,
|
|
15554
|
-
tools:
|
|
15558
|
+
tools: Ft
|
|
15555
15559
|
} : void 0
|
|
15556
|
-
}) : void 0,
|
|
15560
|
+
}) : void 0, Lt = _t ? td({
|
|
15557
15561
|
contextWindow: g.contextWindow,
|
|
15558
15562
|
thresholdRatio: wm(e, g.contextWindow).summaryThresholdRatio
|
|
15559
|
-
}) : void 0,
|
|
15560
|
-
...
|
|
15561
|
-
humanConfirm:
|
|
15562
|
-
screenshot: !!
|
|
15563
|
-
domEdit:
|
|
15563
|
+
}) : void 0, Rt = j_({
|
|
15564
|
+
...V,
|
|
15565
|
+
humanConfirm: Ge,
|
|
15566
|
+
screenshot: !!Ae,
|
|
15567
|
+
domEdit: V.domEdit,
|
|
15564
15568
|
hasActions: !!e.actions && Object.keys(e.actions).length > 0,
|
|
15565
15569
|
hasProposals: !!e.proposals,
|
|
15566
|
-
viewImage: !!
|
|
15567
|
-
subagents:
|
|
15568
|
-
},
|
|
15570
|
+
viewImage: !!ke,
|
|
15571
|
+
subagents: le?.map(Mt)
|
|
15572
|
+
}, he && !!P, { promptSoftCap: Nl(g.contextWindow, y.promptSoftCapTokens) }), zt = V.pageContext ? N_({
|
|
15569
15573
|
getPageInfo: () => typeof document < "u" && typeof location < "u" ? {
|
|
15570
15574
|
title: document.title || "",
|
|
15571
15575
|
url: location.href
|
|
15572
15576
|
} : null,
|
|
15573
|
-
canReadPage:
|
|
15574
|
-
}) : void 0,
|
|
15577
|
+
canReadPage: V.domInspect === !0
|
|
15578
|
+
}) : void 0, q = {
|
|
15575
15579
|
epoch: 0,
|
|
15576
15580
|
notices: [],
|
|
15577
15581
|
readsInvalidated: 0
|
|
15578
|
-
},
|
|
15582
|
+
}, Bt = 0, J = {
|
|
15579
15583
|
name: "hostNotice",
|
|
15580
15584
|
beforeAgent: () => {
|
|
15581
|
-
|
|
15585
|
+
Bt = q.epoch;
|
|
15582
15586
|
},
|
|
15583
15587
|
wrapModelCall: async (e, t) => {
|
|
15584
|
-
if (
|
|
15585
|
-
|
|
15586
|
-
let t = eo(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态",
|
|
15588
|
+
if (Ne) {
|
|
15589
|
+
Ne = !1;
|
|
15590
|
+
let t = eo(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态", Ve);
|
|
15587
15591
|
if (t.invalidatedCount > 0) {
|
|
15588
15592
|
for (let n = 0; n < t.messages.length; n++) e.messages[n] = t.messages[n];
|
|
15589
15593
|
X.agent?.debugLogs?.value?.push({
|
|
@@ -15596,18 +15600,18 @@ function X_(e, n, r) {
|
|
|
15596
15600
|
});
|
|
15597
15601
|
}
|
|
15598
15602
|
}
|
|
15599
|
-
if (
|
|
15600
|
-
|
|
15601
|
-
let t =
|
|
15603
|
+
if (q.epoch > Bt) {
|
|
15604
|
+
Bt = q.epoch;
|
|
15605
|
+
let t = q.notices[q.notices.length - 1] ?? "", n = eo(e.messages, t || void 0, Ve);
|
|
15602
15606
|
if (n.invalidatedCount > 0) {
|
|
15603
15607
|
for (let t = 0; t < n.messages.length; t++) e.messages[t] = n.messages[t];
|
|
15604
|
-
|
|
15608
|
+
q.readsInvalidated += n.invalidatedCount, X.agent?.debugLogs?.value?.push({
|
|
15605
15609
|
timestamp: Date.now(),
|
|
15606
15610
|
type: "middleware",
|
|
15607
15611
|
data: {
|
|
15608
15612
|
stage: "host_read_invalidated",
|
|
15609
15613
|
count: n.invalidatedCount,
|
|
15610
|
-
epoch:
|
|
15614
|
+
epoch: q.epoch,
|
|
15611
15615
|
reason: t || void 0
|
|
15612
15616
|
}
|
|
15613
15617
|
});
|
|
@@ -15615,170 +15619,170 @@ function X_(e, n, r) {
|
|
|
15615
15619
|
}
|
|
15616
15620
|
return t(e);
|
|
15617
15621
|
},
|
|
15618
|
-
augmentPrompt: () =>
|
|
15622
|
+
augmentPrompt: () => q.notices.length ? [
|
|
15619
15623
|
"【宿主页面已变更】",
|
|
15620
|
-
...
|
|
15621
|
-
|
|
15624
|
+
...q.notices.filter(Boolean).map((e) => `· ${e}`),
|
|
15625
|
+
V.domInspect === !0 ? "此前的页面读取/截图结果已过期,回答任何关于当前页面的问题前必须重新 read_page / get_dom 读取当前页面;不要凭此前的读取结果或记忆作答。" : "页面内容可能已变化,断言页面前先核实当前状态;不要凭此前的印象作答。"
|
|
15622
15626
|
].join("\n") : void 0,
|
|
15623
15627
|
afterAgent: () => {
|
|
15624
|
-
|
|
15628
|
+
q.notices.length = 0;
|
|
15625
15629
|
}
|
|
15626
|
-
}, Vt =
|
|
15630
|
+
}, Vt = Ie ? {
|
|
15627
15631
|
name: "proposalNotice",
|
|
15628
|
-
augmentPrompt: () =>
|
|
15632
|
+
augmentPrompt: () => Ie.state.notices.length ? ["【内容提案裁决结果】(以此为准,不要凭提案前状态作答)", ...Ie.state.notices].join("\n") : void 0,
|
|
15629
15633
|
afterAgent: () => {
|
|
15630
|
-
|
|
15634
|
+
Ie.state.notices.length = 0;
|
|
15631
15635
|
}
|
|
15632
|
-
} : null,
|
|
15636
|
+
} : null, Ht = P ? {
|
|
15633
15637
|
name: "dataHint",
|
|
15634
|
-
augmentPrompt: () => gd(
|
|
15635
|
-
} : null,
|
|
15638
|
+
augmentPrompt: () => gd(W(), e.schemaHint) || void 0
|
|
15639
|
+
} : null, Ut = e.augmentSystem ? {
|
|
15636
15640
|
name: "augmentSystem",
|
|
15637
15641
|
augmentPrompt: (t) => {
|
|
15638
15642
|
try {
|
|
15639
15643
|
return e.augmentSystem({
|
|
15640
15644
|
state: t,
|
|
15641
|
-
data:
|
|
15645
|
+
data: W()
|
|
15642
15646
|
});
|
|
15643
15647
|
} catch (t) {
|
|
15644
15648
|
e.debug && console.log("[page-agent-sdk][augmentSystem] 回调抛错,降级跳过:", t.message);
|
|
15645
15649
|
return;
|
|
15646
15650
|
}
|
|
15647
15651
|
}
|
|
15648
|
-
} : null,
|
|
15652
|
+
} : null, Wt = xm(e.onEvent), Y = Wt.emit, Kt, qt = [], Yt = (e) => ({
|
|
15649
15653
|
name: e.name,
|
|
15650
15654
|
description: e.description,
|
|
15651
15655
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
15652
|
-
}),
|
|
15656
|
+
}), Xt = (e) => ({
|
|
15653
15657
|
name: e.name,
|
|
15654
15658
|
description: e.description,
|
|
15655
15659
|
getContent: () => e.content
|
|
15656
|
-
}),
|
|
15660
|
+
}), Zt = e.skillStorage === !1 ? null : z_({
|
|
15657
15661
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
15658
15662
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
15659
|
-
}),
|
|
15660
|
-
let t =
|
|
15663
|
+
}), Qt = () => {
|
|
15664
|
+
let t = Kt ? Kt.controller : null;
|
|
15661
15665
|
if (t) {
|
|
15662
|
-
let n = (e.skills || []).filter((e) => !
|
|
15663
|
-
t.set([...n, ...
|
|
15666
|
+
let n = (e.skills || []).filter((e) => !qt.some((t) => t.name === e.name));
|
|
15667
|
+
t.set([...n, ...qt]);
|
|
15664
15668
|
}
|
|
15665
15669
|
X.infoTick.value++;
|
|
15666
|
-
},
|
|
15667
|
-
if (
|
|
15668
|
-
let t = await
|
|
15670
|
+
}, $t = async () => {
|
|
15671
|
+
if (Zt) try {
|
|
15672
|
+
let t = await Zt.list();
|
|
15669
15673
|
if (t.length) {
|
|
15670
|
-
|
|
15671
|
-
let n =
|
|
15674
|
+
qt = t.map(Xt);
|
|
15675
|
+
let n = Kt ? Kt.controller : null;
|
|
15672
15676
|
if (n) {
|
|
15673
|
-
let t = (e.skills || []).filter((e) => !
|
|
15674
|
-
n.set([...t, ...
|
|
15677
|
+
let t = (e.skills || []).filter((e) => !qt.some((t) => t.name === e.name));
|
|
15678
|
+
n.set([...t, ...qt]);
|
|
15675
15679
|
}
|
|
15676
15680
|
X.infoTick.value++;
|
|
15677
15681
|
}
|
|
15678
15682
|
} catch {}
|
|
15679
|
-
},
|
|
15683
|
+
}, en = ct ? Ll({
|
|
15680
15684
|
...y,
|
|
15681
15685
|
llmInvoke: d,
|
|
15682
|
-
getRegisteredData: () =>
|
|
15686
|
+
getRegisteredData: () => W() ? [{ description: W().description ?? "主数据对象" }] : [],
|
|
15683
15687
|
preserveLastToolResults: x,
|
|
15684
|
-
...
|
|
15688
|
+
...lt ? {
|
|
15685
15689
|
decideInvoke: m,
|
|
15686
|
-
getSnapshot: () =>
|
|
15690
|
+
getSnapshot: () => Lt?.getSnapshot()
|
|
15687
15691
|
} : {}
|
|
15688
|
-
}) : void 0,
|
|
15689
|
-
...
|
|
15690
|
-
withScreenshot: !!
|
|
15691
|
-
withDomEdit:
|
|
15692
|
-
withDataOps:
|
|
15692
|
+
}) : void 0, tn = ot ? fl([
|
|
15693
|
+
...V.domInspect && !(e.skills || []).some((e) => e.name === "dom-inspect") ? [c_({
|
|
15694
|
+
withScreenshot: !!Ae,
|
|
15695
|
+
withDomEdit: V.domEdit,
|
|
15696
|
+
withDataOps: he && !!P
|
|
15693
15697
|
})] : [],
|
|
15694
|
-
...
|
|
15695
|
-
withScreenshot: !!
|
|
15696
|
-
withDomEdit:
|
|
15697
|
-
withVfs:
|
|
15698
|
+
...V.domInspect && !(e.skills || []).some((e) => e.name === "page-analysis") ? [u_({
|
|
15699
|
+
withScreenshot: !!Ae,
|
|
15700
|
+
withDomEdit: V.domEdit,
|
|
15701
|
+
withVfs: st
|
|
15698
15702
|
})] : [],
|
|
15699
15703
|
...e.skills || []
|
|
15700
15704
|
], {
|
|
15701
|
-
readVfs:
|
|
15705
|
+
readVfs: st ? (e) => T.files[e]?.content : void 0,
|
|
15702
15706
|
onToolsReady: (e, t) => {
|
|
15703
15707
|
for (let n of t) {
|
|
15704
|
-
let t =
|
|
15705
|
-
t >= 0 &&
|
|
15708
|
+
let t = et.findIndex((e) => e.name === n.name);
|
|
15709
|
+
t >= 0 && et.splice(t, 1), et.push(n), tt.set(n.name, e), Ee.set(n.name, `skill:${e}`);
|
|
15706
15710
|
}
|
|
15707
|
-
|
|
15711
|
+
K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
15708
15712
|
}
|
|
15709
15713
|
}) : void 0;
|
|
15710
|
-
|
|
15711
|
-
let
|
|
15712
|
-
...
|
|
15713
|
-
|
|
15714
|
-
...
|
|
15715
|
-
|
|
15714
|
+
Kt = tn;
|
|
15715
|
+
let nn = Em([
|
|
15716
|
+
...Ht ? [Ht] : [],
|
|
15717
|
+
Rt,
|
|
15718
|
+
...zt ? [zt] : [],
|
|
15719
|
+
J,
|
|
15716
15720
|
...Vt ? [Vt] : [],
|
|
15717
|
-
...
|
|
15721
|
+
...it ? [O] : [],
|
|
15718
15722
|
ee,
|
|
15719
15723
|
te,
|
|
15720
|
-
...
|
|
15721
|
-
|
|
15722
|
-
...
|
|
15723
|
-
...
|
|
15724
|
-
...
|
|
15725
|
-
...
|
|
15726
|
-
...
|
|
15727
|
-
...
|
|
15728
|
-
...
|
|
15729
|
-
...
|
|
15730
|
-
...
|
|
15731
|
-
...
|
|
15732
|
-
...
|
|
15733
|
-
...
|
|
15734
|
-
...
|
|
15735
|
-
...
|
|
15736
|
-
...Dt ? [Dt] : [],
|
|
15724
|
+
...rt ? [D] : [],
|
|
15725
|
+
...tn ? [tn] : [],
|
|
15726
|
+
...st ? [kd(T)] : [],
|
|
15727
|
+
...en ? [en] : [],
|
|
15728
|
+
...at ? [oe] : [],
|
|
15729
|
+
...Je ? [j] : [],
|
|
15730
|
+
...Se ? [Se] : [],
|
|
15731
|
+
...ut ? [N] : [],
|
|
15732
|
+
...bt ? [bt] : [],
|
|
15733
|
+
...me && B && z ? [Nu(z)] : [],
|
|
15734
|
+
...Ge ? [ae] : [],
|
|
15735
|
+
...Ct ? [Ct] : [],
|
|
15736
|
+
...G ? [G] : [],
|
|
15737
|
+
...It ? [It] : [],
|
|
15738
|
+
...Tt ? [Tt] : [],
|
|
15739
|
+
...At ? [At] : [],
|
|
15737
15740
|
...Ot ? [Ot] : [],
|
|
15738
|
-
...
|
|
15739
|
-
|
|
15740
|
-
|
|
15741
|
+
...kt ? [kt] : [],
|
|
15742
|
+
...U && dt ? [qf({
|
|
15743
|
+
getBind: () => W()?.bind,
|
|
15744
|
+
getTools: () => X.agent?.allTools ?? K
|
|
15741
15745
|
})] : [],
|
|
15742
|
-
...
|
|
15743
|
-
...
|
|
15744
|
-
...
|
|
15746
|
+
...Ut ? [Ut] : [],
|
|
15747
|
+
...Lt ? [Lt] : [],
|
|
15748
|
+
...Me ? [Me] : [],
|
|
15745
15749
|
...e.middleware || [],
|
|
15746
|
-
...
|
|
15750
|
+
..._e ? [y_(a, {
|
|
15747
15751
|
tokenBudget: e.tokenBudget,
|
|
15748
15752
|
timeBudgetMs: e.timeBudgetMs
|
|
15749
|
-
},
|
|
15750
|
-
J_(
|
|
15751
|
-
]),
|
|
15752
|
-
function
|
|
15753
|
+
}, Y)] : [],
|
|
15754
|
+
J_(Y, w, W, a)
|
|
15755
|
+
]), rn = e.maxMemoryRounds ?? W_;
|
|
15756
|
+
function an(e) {
|
|
15753
15757
|
return (e) => {
|
|
15754
|
-
e.type !== "approval_request" &&
|
|
15758
|
+
e.type !== "approval_request" && Y(Oe(e));
|
|
15755
15759
|
};
|
|
15756
15760
|
}
|
|
15757
|
-
let
|
|
15758
|
-
function
|
|
15761
|
+
let on = /* @__PURE__ */ Gt([]), sn = U_(), cn = /* @__PURE__ */ new Set();
|
|
15762
|
+
function ln(e) {
|
|
15759
15763
|
let t = new AbortController(), n = () => t.abort();
|
|
15760
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })),
|
|
15764
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })), cn.add(t), {
|
|
15761
15765
|
controller: t,
|
|
15762
15766
|
untrack: () => {
|
|
15763
|
-
|
|
15767
|
+
cn.delete(t), e?.removeEventListener("abort", n);
|
|
15764
15768
|
}
|
|
15765
15769
|
};
|
|
15766
15770
|
}
|
|
15767
|
-
function
|
|
15768
|
-
for (let e of
|
|
15769
|
-
|
|
15771
|
+
function un() {
|
|
15772
|
+
for (let e of cn) e.abort();
|
|
15773
|
+
cn.clear();
|
|
15770
15774
|
}
|
|
15771
|
-
let
|
|
15775
|
+
let dn = /* @__PURE__ */ Gt(null), X = {
|
|
15772
15776
|
agentId: n,
|
|
15773
15777
|
store: l,
|
|
15774
15778
|
messages: w,
|
|
15775
15779
|
vfsStore: T,
|
|
15776
|
-
listeners:
|
|
15780
|
+
listeners: Wt.listeners,
|
|
15777
15781
|
todosMw: D,
|
|
15778
|
-
memoryMw:
|
|
15782
|
+
memoryMw: N,
|
|
15779
15783
|
missionMw: O,
|
|
15780
|
-
workingMemoryMw:
|
|
15781
|
-
focusMw:
|
|
15784
|
+
workingMemoryMw: oe,
|
|
15785
|
+
focusMw: j,
|
|
15782
15786
|
agent: null,
|
|
15783
15787
|
initDone: Promise.resolve(),
|
|
15784
15788
|
sessionId: "",
|
|
@@ -15786,57 +15790,57 @@ function X_(e, n, r) {
|
|
|
15786
15790
|
mcpClosers: [],
|
|
15787
15791
|
mcpServers: [],
|
|
15788
15792
|
mcpFailed: [],
|
|
15789
|
-
checkpoint:
|
|
15790
|
-
dataOpsController:
|
|
15791
|
-
skillsController:
|
|
15793
|
+
checkpoint: z,
|
|
15794
|
+
dataOpsController: U,
|
|
15795
|
+
skillsController: Kt ? Kt.controller : null,
|
|
15792
15796
|
infoTick: c,
|
|
15793
15797
|
pendingConflict: o.pendingConflict,
|
|
15794
|
-
pendingQuote:
|
|
15795
|
-
sessions:
|
|
15796
|
-
refreshSessions: () =>
|
|
15797
|
-
liveData:
|
|
15798
|
+
pendingQuote: dn,
|
|
15799
|
+
sessions: on,
|
|
15800
|
+
refreshSessions: () => vn.refreshSessions(),
|
|
15801
|
+
liveData: W,
|
|
15798
15802
|
usage: a,
|
|
15799
|
-
emit:
|
|
15800
|
-
runSerial:
|
|
15801
|
-
trackActive:
|
|
15802
|
-
abortAllActive:
|
|
15803
|
+
emit: Y,
|
|
15804
|
+
runSerial: sn,
|
|
15805
|
+
trackActive: ln,
|
|
15806
|
+
abortAllActive: un,
|
|
15803
15807
|
unloadSkillTools(e) {
|
|
15804
15808
|
if (e) {
|
|
15805
|
-
let t =
|
|
15806
|
-
if (
|
|
15809
|
+
let t = et.length;
|
|
15810
|
+
if (et = et.filter((t) => tt.get(t.name) === e ? (Ee.delete(t.name), tt.delete(t.name), !1) : !0), et.length === t) return;
|
|
15807
15811
|
} else {
|
|
15808
|
-
if (!
|
|
15809
|
-
for (let e of
|
|
15810
|
-
|
|
15812
|
+
if (!et.length) return;
|
|
15813
|
+
for (let e of et) Ee.delete(e.name), tt.delete(e.name);
|
|
15814
|
+
et = [];
|
|
15811
15815
|
}
|
|
15812
|
-
|
|
15816
|
+
K = nt(), X.agent && X.agent.setTools(K);
|
|
15813
15817
|
},
|
|
15814
15818
|
applySnapshot(t) {
|
|
15815
|
-
if (t.vfs && T.hydrate && T.hydrate(t.vfs), t.messages?.length && (w.push(...Ci(t.messages, (e) => (e ? X.vfsStore?.files?.[e]?.content : void 0) || void 0)), te.markResumed()), t.todos?.length && D.reset(t.todos), t.memory && !e.memory &&
|
|
15819
|
+
if (t.vfs && T.hydrate && T.hydrate(t.vfs), t.messages?.length && (w.push(...Ci(t.messages, (e) => (e ? X.vfsStore?.files?.[e]?.content : void 0) || void 0)), te.markResumed()), t.todos?.length && D.reset(t.todos), t.memory && !e.memory && N.reset(t.memory), t.checkpoints?.length && z && z.importStack(t.checkpoints), t.usage && Object.assign(a, t.usage), t.mission && it && O.setMission(t.mission), t.workingMemory && at && oe.restore(t.workingMemory), t.planConfirmation && (ne.lastPlanConfirmation = t.planConfirmation), Je) {
|
|
15816
15820
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
15817
15821
|
if (r.length) {
|
|
15818
|
-
let t =
|
|
15819
|
-
if (n.length && (
|
|
15822
|
+
let t = W()?.schema, n = t ? r.filter((e) => Is(t, e.path)) : [];
|
|
15823
|
+
if (n.length && (j.setFocus(null), n.forEach((e) => j.addFocus(M(e)))), e.debug && n.length < r.length) {
|
|
15820
15824
|
let e = r.filter((e) => !n.includes(e)).map((e) => e.path);
|
|
15821
15825
|
console.warn("[page-agent-sdk][focus] 恢复的焦点部分 path 已失效(schema 变化/无 schema),剔除:", e);
|
|
15822
15826
|
}
|
|
15823
15827
|
}
|
|
15824
15828
|
}
|
|
15825
|
-
|
|
15829
|
+
hn();
|
|
15826
15830
|
},
|
|
15827
15831
|
addSkill(e) {
|
|
15828
|
-
let t =
|
|
15829
|
-
t >= 0 ?
|
|
15832
|
+
let t = qt.findIndex((t) => t.name === e.name);
|
|
15833
|
+
t >= 0 ? qt[t] = e : qt.push(e), Qt(), Zt && Zt.put(Yt(e));
|
|
15830
15834
|
},
|
|
15831
15835
|
removeSkill(e) {
|
|
15832
|
-
let t =
|
|
15833
|
-
return t < 0 ? !1 : (
|
|
15836
|
+
let t = qt.findIndex((t) => t.name === e);
|
|
15837
|
+
return t < 0 ? !1 : (qt.splice(t, 1), Qt(), Zt && Zt.remove(e), !0);
|
|
15834
15838
|
},
|
|
15835
15839
|
listUserSkills() {
|
|
15836
|
-
return
|
|
15840
|
+
return qt.map((e) => e.name);
|
|
15837
15841
|
},
|
|
15838
15842
|
getUserSkill(e) {
|
|
15839
|
-
let t =
|
|
15843
|
+
let t = qt.find((t) => t.name === e);
|
|
15840
15844
|
if (t) return {
|
|
15841
15845
|
name: t.name,
|
|
15842
15846
|
description: t.description,
|
|
@@ -15844,7 +15848,7 @@ function X_(e, n, r) {
|
|
|
15844
15848
|
};
|
|
15845
15849
|
},
|
|
15846
15850
|
afterRound() {
|
|
15847
|
-
|
|
15851
|
+
gn(), vn.persistRuntime();
|
|
15848
15852
|
},
|
|
15849
15853
|
clearCodeReuse() {
|
|
15850
15854
|
let e = T;
|
|
@@ -15852,12 +15856,12 @@ function X_(e, n, r) {
|
|
|
15852
15856
|
},
|
|
15853
15857
|
async send(e, t) {
|
|
15854
15858
|
if (await X.initDone, X.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 send");
|
|
15855
|
-
t ??= {}, t?.mission &&
|
|
15859
|
+
t ??= {}, t?.mission && it && O.setMission(t.mission);
|
|
15856
15860
|
let n = e, r = (t.images ?? []).filter((e) => e && (e.dataUri || e.vfsRef || e.url));
|
|
15857
15861
|
if (r.length > 4) throw Error(`[page-agent-sdk] 单轮最多 4 张图片(收到 ${r.length})`);
|
|
15858
|
-
if (r.length && (await
|
|
15862
|
+
if (r.length && (await _n.stowImages(r), await _n.describeIfNeeded(r, n)), r.length && !g.vision && !r.every((e) => e.description)) {
|
|
15859
15863
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述(集成方识图子 agent / 自有 vision API)";
|
|
15860
|
-
throw
|
|
15864
|
+
throw Y({
|
|
15861
15865
|
type: "error",
|
|
15862
15866
|
message: e,
|
|
15863
15867
|
severity: "recoverable",
|
|
@@ -15865,7 +15869,7 @@ function X_(e, n, r) {
|
|
|
15865
15869
|
}), Error(`[page-agent-sdk] ${e}`);
|
|
15866
15870
|
}
|
|
15867
15871
|
T?.setProtectedRefs?.(V_(w));
|
|
15868
|
-
let i =
|
|
15872
|
+
let i = _e ? t.maxAutoRetries ?? 1 : 0, a = 0, s = !1, c = an(t.signal);
|
|
15869
15873
|
if (t.signal) {
|
|
15870
15874
|
let e = () => o.resolve("keep_external");
|
|
15871
15875
|
t.signal.aborted ? e() : t.signal.addEventListener("abort", e, { once: !0 });
|
|
@@ -15882,14 +15886,14 @@ function X_(e, n, r) {
|
|
|
15882
15886
|
...n ? { anchor: n } : {}
|
|
15883
15887
|
};
|
|
15884
15888
|
}
|
|
15885
|
-
let i = e ??
|
|
15889
|
+
let i = e ?? dn.value ?? void 0;
|
|
15886
15890
|
w.push({
|
|
15887
15891
|
role: "user",
|
|
15888
15892
|
content: n,
|
|
15889
15893
|
timestamp: Date.now(),
|
|
15890
15894
|
...r.length ? { images: r } : {},
|
|
15891
15895
|
...i ? { quote: i } : {}
|
|
15892
|
-
}), s = !0, !e &&
|
|
15896
|
+
}), s = !0, !e && dn.value && (dn.value = null);
|
|
15893
15897
|
}
|
|
15894
15898
|
try {
|
|
15895
15899
|
let e = await X.agent.invoke(w, t.signal, c);
|
|
@@ -15910,7 +15914,7 @@ function X_(e, n, r) {
|
|
|
15910
15914
|
}), X.afterRound(), l) try {
|
|
15911
15915
|
await l.flush();
|
|
15912
15916
|
} catch (e) {
|
|
15913
|
-
|
|
15917
|
+
Y({
|
|
15914
15918
|
type: "error",
|
|
15915
15919
|
message: `落盘失败(不影响本轮回复):${e instanceof Error ? e.message : String(e)}`,
|
|
15916
15920
|
severity: "observable",
|
|
@@ -15925,8 +15929,8 @@ function X_(e, n, r) {
|
|
|
15925
15929
|
...n,
|
|
15926
15930
|
code: "MODEL_UNAVAILABLE",
|
|
15927
15931
|
message: e instanceof Error ? e.message : n.message
|
|
15928
|
-
}), a < i &&
|
|
15929
|
-
a += 1,
|
|
15932
|
+
}), a < i && z?.canRestore()) {
|
|
15933
|
+
a += 1, z.restore(), s = !0, Y({
|
|
15930
15934
|
type: "error",
|
|
15931
15935
|
message: `致命错误自动恢复(${a}/${i}):${n.message},已回退 checkpoint 重试`,
|
|
15932
15936
|
severity: "observable",
|
|
@@ -15938,7 +15942,7 @@ function X_(e, n, r) {
|
|
|
15938
15942
|
});
|
|
15939
15943
|
continue;
|
|
15940
15944
|
}
|
|
15941
|
-
throw
|
|
15945
|
+
throw Y({
|
|
15942
15946
|
type: "error",
|
|
15943
15947
|
message: n.message,
|
|
15944
15948
|
severity: n.severity,
|
|
@@ -15951,7 +15955,7 @@ function X_(e, n, r) {
|
|
|
15951
15955
|
async batch(e, t, n) {
|
|
15952
15956
|
if (await X.initDone, !e.length) return [];
|
|
15953
15957
|
if (X.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 batch");
|
|
15954
|
-
let r = [], i =
|
|
15958
|
+
let r = [], i = an(n);
|
|
15955
15959
|
if (T?.setProtectedRefs?.(V_(w)), n) {
|
|
15956
15960
|
let e = () => o.resolve("keep_external");
|
|
15957
15961
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
@@ -15967,7 +15971,7 @@ function X_(e, n, r) {
|
|
|
15967
15971
|
break;
|
|
15968
15972
|
}
|
|
15969
15973
|
let o = e[a];
|
|
15970
|
-
|
|
15974
|
+
z && z.save(`batch:${a}`);
|
|
15971
15975
|
let s = w.length;
|
|
15972
15976
|
try {
|
|
15973
15977
|
w.push({
|
|
@@ -15983,7 +15987,7 @@ function X_(e, n, r) {
|
|
|
15983
15987
|
}), X.afterRound(), l) try {
|
|
15984
15988
|
await l.flush();
|
|
15985
15989
|
} catch (e) {
|
|
15986
|
-
|
|
15990
|
+
Y({
|
|
15987
15991
|
type: "error",
|
|
15988
15992
|
message: `落盘失败(不影响本任务结果):${e instanceof Error ? e.message : String(e)}`,
|
|
15989
15993
|
severity: "observable",
|
|
@@ -16019,7 +16023,7 @@ function X_(e, n, r) {
|
|
|
16019
16023
|
}
|
|
16020
16024
|
ya(i);
|
|
16021
16025
|
let c = ui(i, "fatal");
|
|
16022
|
-
|
|
16026
|
+
Y({
|
|
16023
16027
|
type: "error",
|
|
16024
16028
|
message: `批量任务 ${a + 1}/${e.length} 失败:${c.message}`,
|
|
16025
16029
|
severity: "observable",
|
|
@@ -16043,16 +16047,16 @@ function X_(e, n, r) {
|
|
|
16043
16047
|
}
|
|
16044
16048
|
return r;
|
|
16045
16049
|
},
|
|
16046
|
-
switchSession: (e) =>
|
|
16047
|
-
exportSession: (e) =>
|
|
16048
|
-
importSession: (e) =>
|
|
16049
|
-
resetSession: () =>
|
|
16050
|
+
switchSession: (e) => vn.switchSession(e),
|
|
16051
|
+
exportSession: (e) => vn.exportSession(e),
|
|
16052
|
+
importSession: (e) => vn.importSession(e),
|
|
16053
|
+
resetSession: () => vn.resetSession(),
|
|
16050
16054
|
stream: async (e, t, n) => {
|
|
16051
16055
|
if (!X.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
16052
16056
|
let r = [...e].reverse().find((e) => e.role === "user" && e.images?.length);
|
|
16053
|
-
if (r?.images?.length && (await
|
|
16057
|
+
if (r?.images?.length && (await _n.stowImages(r.images), await _n.describeIfNeeded(r.images, r.content), !g.vision && !r.images.every((e) => e.description))) {
|
|
16054
16058
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述";
|
|
16055
|
-
throw
|
|
16059
|
+
throw Y({
|
|
16056
16060
|
type: "error",
|
|
16057
16061
|
message: e,
|
|
16058
16062
|
severity: "recoverable",
|
|
@@ -16061,36 +16065,36 @@ function X_(e, n, r) {
|
|
|
16061
16065
|
}
|
|
16062
16066
|
T?.setProtectedRefs?.(V_(e));
|
|
16063
16067
|
let i = (e) => {
|
|
16064
|
-
t?.(
|
|
16068
|
+
t?.(Oe(e)), Y(Oe(e)), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && X.infoTick.value++;
|
|
16065
16069
|
};
|
|
16066
16070
|
if (n) {
|
|
16067
16071
|
let e = () => o.resolve("keep_external");
|
|
16068
16072
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
16069
16073
|
}
|
|
16070
|
-
let { controller: a, untrack: s } =
|
|
16074
|
+
let { controller: a, untrack: s } = ln(n);
|
|
16071
16075
|
return X.agent.stream(e, i, a.signal).finally(s);
|
|
16072
16076
|
},
|
|
16073
16077
|
release() {
|
|
16074
16078
|
if (X.refCount--, X.refCount <= 0) {
|
|
16075
|
-
|
|
16079
|
+
un(), We = !0, l && (T.flush?.(), l.flush(), l.dispose()), Zt && Zt.dispose();
|
|
16076
16080
|
let e = X.mcpClosers.splice(0);
|
|
16077
16081
|
e.length && Promise.allSettled(e.map((e) => e())), G_.delete(n);
|
|
16078
16082
|
}
|
|
16079
16083
|
},
|
|
16080
16084
|
resolveConflict: o.resolve,
|
|
16081
16085
|
setTools(e) {
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
}),
|
|
16086
|
+
Le.length = 0, e.forEach((e) => {
|
|
16087
|
+
Le.push(e), Ee.set(e.name, "user");
|
|
16088
|
+
}), K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16085
16089
|
},
|
|
16086
16090
|
addTool(e) {
|
|
16087
|
-
|
|
16088
|
-
for (let t =
|
|
16089
|
-
|
|
16091
|
+
K.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
16092
|
+
for (let t = Le.length - 1; t >= 0; t--) Le[t].name === e.name && Le.splice(t, 1);
|
|
16093
|
+
Le.push(e), Ee.set(e.name, "user"), K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16090
16094
|
},
|
|
16091
16095
|
removeTool(e) {
|
|
16092
|
-
let t =
|
|
16093
|
-
return t < 0 ? !1 : (
|
|
16096
|
+
let t = Le.findIndex((t) => t.name === e);
|
|
16097
|
+
return t < 0 ? !1 : (Le.splice(t, 1), Ee.delete(e), K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++, !0);
|
|
16094
16098
|
},
|
|
16095
16099
|
setLlm(t) {
|
|
16096
16100
|
let n;
|
|
@@ -16100,7 +16104,7 @@ function X_(e, n, r) {
|
|
|
16100
16104
|
if ((e.provider ?? "openai") === "anthropic") throw Error("[page-agent-sdk][setLlm] 切换到 Anthropic 需传 BaseChatModel 实例(动态 import 无法同步);请先 const { ChatAnthropic } = await import(\"@langchain/anthropic\") 构造实例后传入");
|
|
16101
16105
|
n = E(e);
|
|
16102
16106
|
}
|
|
16103
|
-
typeof n.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), Mp(n, { emit:
|
|
16107
|
+
typeof n.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), Mp(n, { emit: Y }), C = t;
|
|
16104
16108
|
let r = Ap(t) ? void 0 : t;
|
|
16105
16109
|
if (g = v({
|
|
16106
16110
|
model: r?.model ?? t.model ?? t.modelName,
|
|
@@ -16108,58 +16112,58 @@ function X_(e, n, r) {
|
|
|
16108
16112
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens,
|
|
16109
16113
|
vision: r?.vision ?? t.vision
|
|
16110
16114
|
}), g.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${g.contextWindow} 小于最小支持 ${p}(需 ≥200K 窗口模型)`);
|
|
16111
|
-
X.agent && (X.agent.setLlm(n), X.agent.setModelCaps?.(g)),
|
|
16115
|
+
X.agent && (X.agent.setLlm(n), X.agent.setModelCaps?.(g)), en?.setContextWindow?.(g.contextWindow), Lt?.setContextWindow?.(g.contextWindow), X.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", g);
|
|
16112
16116
|
},
|
|
16113
16117
|
setMemory(e) {
|
|
16114
|
-
|
|
16118
|
+
N.reset(e), typeof e == "function" && N.refresh(), X.infoTick.value++;
|
|
16115
16119
|
},
|
|
16116
16120
|
refreshMemory() {
|
|
16117
|
-
return
|
|
16121
|
+
return N.refresh();
|
|
16118
16122
|
},
|
|
16119
16123
|
setSubagents(t) {
|
|
16120
|
-
if (!
|
|
16124
|
+
if (!jt) {
|
|
16121
16125
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
16122
16126
|
return;
|
|
16123
16127
|
}
|
|
16124
|
-
|
|
16128
|
+
jt.set(t), X.infoTick.value++;
|
|
16125
16129
|
},
|
|
16126
16130
|
addSubagent(t) {
|
|
16127
|
-
if (!
|
|
16131
|
+
if (!jt) {
|
|
16128
16132
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
16129
16133
|
return;
|
|
16130
16134
|
}
|
|
16131
|
-
|
|
16135
|
+
jt.add(t), X.infoTick.value++;
|
|
16132
16136
|
},
|
|
16133
16137
|
removeSubagent(t) {
|
|
16134
|
-
if (!
|
|
16135
|
-
let n =
|
|
16138
|
+
if (!jt) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
16139
|
+
let n = jt.remove(t);
|
|
16136
16140
|
return n && X.infoTick.value++, n;
|
|
16137
16141
|
},
|
|
16138
16142
|
getActiveSubagents() {
|
|
16139
|
-
return
|
|
16143
|
+
return ft?.getActive() ?? [];
|
|
16140
16144
|
},
|
|
16141
16145
|
get subagentHistory() {
|
|
16142
|
-
return
|
|
16146
|
+
return ft?.getHistory() ?? [];
|
|
16143
16147
|
},
|
|
16144
16148
|
getInfo() {
|
|
16145
16149
|
return {
|
|
16146
16150
|
id: n,
|
|
16147
16151
|
sessionId: X.sessionId,
|
|
16148
16152
|
model: Ap(C) ? C.model ?? C.modelName : C.model,
|
|
16149
|
-
systemPrompt: X.agent?.getEffectiveSystemPrompt?.() ??
|
|
16150
|
-
tools: (X.agent?.allTools ??
|
|
16153
|
+
systemPrompt: X.agent?.getEffectiveSystemPrompt?.() ?? ye + gd(W(), e.schemaHint),
|
|
16154
|
+
tools: (X.agent?.allTools ?? K).map((e) => ({
|
|
16151
16155
|
name: e.name,
|
|
16152
16156
|
description: e.description,
|
|
16153
16157
|
schema: e.schema,
|
|
16154
|
-
source:
|
|
16158
|
+
source: Ee.get(e.name) || "user"
|
|
16155
16159
|
})),
|
|
16156
|
-
skills: (
|
|
16160
|
+
skills: (Kt ? Kt.controller.get() : e.skills ?? []).map((e) => ({
|
|
16157
16161
|
name: e.name,
|
|
16158
16162
|
description: e.description
|
|
16159
16163
|
})),
|
|
16160
|
-
data:
|
|
16161
|
-
description:
|
|
16162
|
-
schema:
|
|
16164
|
+
data: W() ? {
|
|
16165
|
+
description: W().description,
|
|
16166
|
+
schema: W().schema
|
|
16163
16167
|
} : void 0,
|
|
16164
16168
|
contextPreset: e.contextPreset ?? "auto",
|
|
16165
16169
|
compression: {
|
|
@@ -16167,16 +16171,16 @@ function X_(e, n, r) {
|
|
|
16167
16171
|
summaryThresholdRatio: y.summaryThresholdRatio ?? .5,
|
|
16168
16172
|
promptSoftCap: Nl(g.contextWindow, y.promptSoftCapTokens)
|
|
16169
16173
|
},
|
|
16170
|
-
memory:
|
|
16174
|
+
memory: N.get(),
|
|
16171
16175
|
staleReadsInvalidated: X.agent?.getStaleReadsInvalidated?.() ?? 0,
|
|
16172
|
-
hostReadsInvalidated:
|
|
16173
|
-
...
|
|
16176
|
+
hostReadsInvalidated: q.readsInvalidated,
|
|
16177
|
+
...Ie ? { proposals: Ie.snapshot() } : {},
|
|
16174
16178
|
...r ? { hostWatch: { ...r } } : {},
|
|
16175
16179
|
llmRetries: X.agent?.getLlmRetries?.() ?? 0,
|
|
16176
16180
|
llmCallFailures: X.agent?.getLlmCallFailures?.() ?? 0,
|
|
16177
16181
|
gates: X.agent?.getGateStats?.(),
|
|
16178
16182
|
systemSegments: X.agent?.getLastSystemSegments?.() ?? [],
|
|
16179
|
-
middleware:
|
|
16183
|
+
middleware: nn.map((e) => e.name),
|
|
16180
16184
|
todos: (X.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
16181
16185
|
id: e.id,
|
|
16182
16186
|
content: e.content,
|
|
@@ -16187,30 +16191,30 @@ function X_(e, n, r) {
|
|
|
16187
16191
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
16188
16192
|
})),
|
|
16189
16193
|
planPhase: D.getPlanPhase(),
|
|
16190
|
-
mission:
|
|
16194
|
+
mission: it ? O.getMission() : void 0,
|
|
16191
16195
|
planConfirmation: ne.lastPlanConfirmation,
|
|
16192
|
-
workingMemory:
|
|
16193
|
-
focus:
|
|
16194
|
-
focuses:
|
|
16196
|
+
workingMemory: at ? oe.getWorkingMemory() : void 0,
|
|
16197
|
+
focus: Je ? j.getFocus() : void 0,
|
|
16198
|
+
focuses: Je ? j.getFocuses() : [],
|
|
16195
16199
|
actions: S_(e.actions ?? {}),
|
|
16196
16200
|
subagent: {
|
|
16197
|
-
enabled: !!
|
|
16201
|
+
enabled: !!Tt,
|
|
16198
16202
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
16199
16203
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
16200
16204
|
timeoutMs: e.subagent?.timeoutMs === void 0 ? 18e5 : e.subagent.timeoutMs > 0 ? e.subagent.timeoutMs : 0,
|
|
16201
16205
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
16202
|
-
subagents: (
|
|
16203
|
-
active:
|
|
16204
|
-
history:
|
|
16205
|
-
lockedComponents:
|
|
16206
|
+
subagents: (jt?.get() ?? []).map(Mt),
|
|
16207
|
+
active: ft?.getActive() ?? [],
|
|
16208
|
+
history: ft?.getHistory() ?? [],
|
|
16209
|
+
lockedComponents: Dt?.locked() ?? {}
|
|
16206
16210
|
},
|
|
16207
16211
|
verify: {
|
|
16208
|
-
enabled: !!
|
|
16209
|
-
maxAttempts:
|
|
16210
|
-
adversarial:
|
|
16212
|
+
enabled: !!It,
|
|
16213
|
+
maxAttempts: gt ? pt : 0,
|
|
16214
|
+
adversarial: gt && !!e.verify?.adversarial
|
|
16211
16215
|
},
|
|
16212
16216
|
context: (() => {
|
|
16213
|
-
let e =
|
|
16217
|
+
let e = Lt?.getSnapshot();
|
|
16214
16218
|
if (e) {
|
|
16215
16219
|
let t = X.agent?.getState?.()?.lastCompression;
|
|
16216
16220
|
t && (e.compression = t);
|
|
@@ -16222,10 +16226,10 @@ function X_(e, n, r) {
|
|
|
16222
16226
|
...X.mcpFailed.length ? { failed: X.mcpFailed } : {}
|
|
16223
16227
|
},
|
|
16224
16228
|
lastCompression: X.agent?.getState?.()?.lastCompression,
|
|
16225
|
-
checkpoints:
|
|
16229
|
+
checkpoints: z ? {
|
|
16226
16230
|
enabled: !0,
|
|
16227
|
-
auto:
|
|
16228
|
-
list:
|
|
16231
|
+
auto: B,
|
|
16232
|
+
list: z.list()
|
|
16229
16233
|
} : void 0
|
|
16230
16234
|
};
|
|
16231
16235
|
},
|
|
@@ -16263,41 +16267,41 @@ function X_(e, n, r) {
|
|
|
16263
16267
|
}));
|
|
16264
16268
|
},
|
|
16265
16269
|
getMission() {
|
|
16266
|
-
return
|
|
16270
|
+
return it ? O.getMission() : void 0;
|
|
16267
16271
|
},
|
|
16268
16272
|
setMission(t) {
|
|
16269
|
-
if (!
|
|
16273
|
+
if (!it) {
|
|
16270
16274
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
16271
16275
|
return;
|
|
16272
16276
|
}
|
|
16273
16277
|
O.setMission(t), X.infoTick.value++;
|
|
16274
16278
|
},
|
|
16275
16279
|
getFocus() {
|
|
16276
|
-
return
|
|
16280
|
+
return Je ? j.getFocus() : void 0;
|
|
16277
16281
|
},
|
|
16278
16282
|
getFocuses() {
|
|
16279
|
-
return
|
|
16283
|
+
return Je ? j.getFocuses() : [];
|
|
16280
16284
|
},
|
|
16281
16285
|
setFocus(t) {
|
|
16282
|
-
let n = Y_(t, "setFocus",
|
|
16283
|
-
return n.ok ? (
|
|
16286
|
+
let n = Y_(t, "setFocus", Je, () => W()?.schema, e.debug);
|
|
16287
|
+
return n.ok ? (j.setFocus(M(t)), e.debug && j.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), X.infoTick.value++, { ok: !0 }) : n;
|
|
16284
16288
|
},
|
|
16285
16289
|
addFocus(t) {
|
|
16286
|
-
let n = Y_(t, "addFocus",
|
|
16287
|
-
return n.ok ?
|
|
16290
|
+
let n = Y_(t, "addFocus", Je, () => W()?.schema, e.debug);
|
|
16291
|
+
return n.ok ? j.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
16288
16292
|
ok: !1,
|
|
16289
16293
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
16290
|
-
}) : (
|
|
16294
|
+
}) : (j.addFocus(M(t)), e.debug && j.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), X.infoTick.value++, { ok: !0 }) : n;
|
|
16291
16295
|
},
|
|
16292
16296
|
removeFocus(e) {
|
|
16293
|
-
|
|
16297
|
+
Je && (j.removeFocus(e), X.infoTick.value++);
|
|
16294
16298
|
},
|
|
16295
16299
|
clearFocus() {
|
|
16296
|
-
|
|
16300
|
+
Je && (j.clearFocus(), X.infoTick.value++);
|
|
16297
16301
|
},
|
|
16298
16302
|
setQuote(e, t, n) {
|
|
16299
16303
|
let r = Ni(e ?? ""), i = Ki(n);
|
|
16300
|
-
|
|
16304
|
+
dn.value = r ? {
|
|
16301
16305
|
text: r,
|
|
16302
16306
|
...t ? { source: t } : {},
|
|
16303
16307
|
...i ? { anchor: i } : {}
|
|
@@ -16305,34 +16309,34 @@ function X_(e, n, r) {
|
|
|
16305
16309
|
},
|
|
16306
16310
|
notifyHostChange(e) {
|
|
16307
16311
|
let t = typeof e?.reason == "string" ? e.reason.trim().slice(0, 200) : "";
|
|
16308
|
-
|
|
16312
|
+
q.epoch += 1, t && !q.notices.includes(t) ? q.notices.push(t) : t || q.notices.push(""), q.notices.length > 5 && q.notices.splice(0, q.notices.length - 5), X.agent?.debugLogs?.value?.push({
|
|
16309
16313
|
timestamp: Date.now(),
|
|
16310
16314
|
type: "middleware",
|
|
16311
16315
|
data: {
|
|
16312
16316
|
stage: "host_change_notified",
|
|
16313
|
-
epoch:
|
|
16317
|
+
epoch: q.epoch,
|
|
16314
16318
|
reason: t || void 0
|
|
16315
16319
|
}
|
|
16316
16320
|
}), X.infoTick.value++;
|
|
16317
16321
|
},
|
|
16318
16322
|
clearQuote() {
|
|
16319
|
-
|
|
16323
|
+
dn.value = null;
|
|
16320
16324
|
},
|
|
16321
16325
|
resolveProposal(e, t, n) {
|
|
16322
|
-
let r =
|
|
16326
|
+
let r = Ie ? Ie.resolve(e, t, n) : !1;
|
|
16323
16327
|
return r && X.infoTick.value++, r;
|
|
16324
16328
|
},
|
|
16325
16329
|
getProposals() {
|
|
16326
|
-
return
|
|
16330
|
+
return Ie ? Ie.snapshot() : null;
|
|
16327
16331
|
}
|
|
16328
16332
|
};
|
|
16329
|
-
async function
|
|
16333
|
+
async function fn() {
|
|
16330
16334
|
if (!l) return;
|
|
16331
16335
|
let t = async (e) => {
|
|
16332
16336
|
try {
|
|
16333
16337
|
return await l.load(n, e);
|
|
16334
16338
|
} catch (t) {
|
|
16335
|
-
|
|
16339
|
+
Y({
|
|
16336
16340
|
type: "error",
|
|
16337
16341
|
message: `会话快照读取失败,已降级空会话:${t instanceof Error ? t.message : String(t)}`,
|
|
16338
16342
|
severity: "observable",
|
|
@@ -16345,7 +16349,7 @@ function X_(e, n, r) {
|
|
|
16345
16349
|
try {
|
|
16346
16350
|
return await l.listSessions(n);
|
|
16347
16351
|
} catch (e) {
|
|
16348
|
-
return
|
|
16352
|
+
return Y({
|
|
16349
16353
|
type: "error",
|
|
16350
16354
|
message: `会话列表读取失败,已降级新建会话:${e instanceof Error ? e.message : String(e)}`,
|
|
16351
16355
|
severity: "observable",
|
|
@@ -16353,7 +16357,7 @@ function X_(e, n, r) {
|
|
|
16353
16357
|
}), [];
|
|
16354
16358
|
}
|
|
16355
16359
|
}, i = Symbol("storage-ready-timeout");
|
|
16356
|
-
await Promise.race([l.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"),
|
|
16360
|
+
await Promise.race([l.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"), Y({
|
|
16357
16361
|
type: "error",
|
|
16358
16362
|
message: "存储初始化 5s 未就绪(IDB blocked?),已放行降级运行",
|
|
16359
16363
|
severity: "observable",
|
|
@@ -16363,7 +16367,7 @@ function X_(e, n, r) {
|
|
|
16363
16367
|
if (a.id) {
|
|
16364
16368
|
X.sessionId = a.id;
|
|
16365
16369
|
let e = await t(X.sessionId);
|
|
16366
|
-
e ? (X.applySnapshot(e),
|
|
16370
|
+
e ? (X.applySnapshot(e), Y({
|
|
16367
16371
|
type: "session_restored",
|
|
16368
16372
|
sessionId: X.sessionId,
|
|
16369
16373
|
rounds: e.messages?.length ?? 0
|
|
@@ -16373,19 +16377,19 @@ function X_(e, n, r) {
|
|
|
16373
16377
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, i.length, i.map((e) => e.sessionId)), i.length) {
|
|
16374
16378
|
X.sessionId = i[0].sessionId;
|
|
16375
16379
|
let n = await t(X.sessionId);
|
|
16376
|
-
n ? (X.applySnapshot(n),
|
|
16380
|
+
n ? (X.applySnapshot(n), Y({
|
|
16377
16381
|
type: "session_restored",
|
|
16378
16382
|
sessionId: X.sessionId,
|
|
16379
16383
|
rounds: n.messages?.length ?? 0
|
|
16380
16384
|
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", X.sessionId, `${n.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", X.sessionId);
|
|
16381
16385
|
} else X.sessionId = await l.createSession(n, a.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", X.sessionId);
|
|
16382
16386
|
} else X.sessionId = await l.createSession(n, a.title);
|
|
16383
|
-
e.memory &&
|
|
16387
|
+
e.memory && vn.persistSave({ memory: N.get() || (typeof e.memory == "string" ? e.memory : "") }), vn.refreshSessions();
|
|
16384
16388
|
}
|
|
16385
|
-
async function
|
|
16386
|
-
await
|
|
16389
|
+
async function pn() {
|
|
16390
|
+
await $t();
|
|
16387
16391
|
}
|
|
16388
|
-
function
|
|
16392
|
+
function mn(e) {
|
|
16389
16393
|
let t = {};
|
|
16390
16394
|
for (let n of V_(e)) {
|
|
16391
16395
|
let e = T.files[n];
|
|
@@ -16393,15 +16397,15 @@ function X_(e, n, r) {
|
|
|
16393
16397
|
}
|
|
16394
16398
|
return t;
|
|
16395
16399
|
}
|
|
16396
|
-
function
|
|
16400
|
+
function hn() {
|
|
16397
16401
|
let e = H_(T.files, V_(w));
|
|
16398
16402
|
for (let t of e) delete T.files[t];
|
|
16399
16403
|
}
|
|
16400
|
-
function
|
|
16401
|
-
let e = xl(w,
|
|
16404
|
+
function gn() {
|
|
16405
|
+
let e = xl(w, rn);
|
|
16402
16406
|
if (!e.trimmed) return;
|
|
16403
16407
|
let { older: t, summary: n } = e;
|
|
16404
|
-
if (
|
|
16408
|
+
if (Y({
|
|
16405
16409
|
type: "context_trimmed",
|
|
16406
16410
|
dropped: t.map((e) => ({
|
|
16407
16411
|
round: e.round,
|
|
@@ -16409,60 +16413,60 @@ function X_(e, n, r) {
|
|
|
16409
16413
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
16410
16414
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
16411
16415
|
})),
|
|
16412
|
-
vfsResults:
|
|
16416
|
+
vfsResults: mn(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
16413
16417
|
summary: n.content,
|
|
16414
16418
|
reason: "max_memory_rounds"
|
|
16415
|
-
}), w.splice(e.deleteFrom, e.deleteCount, n),
|
|
16419
|
+
}), w.splice(e.deleteFrom, e.deleteCount, n), hn(), b && d) {
|
|
16416
16420
|
let n = e.summary, { prevSeg: r } = e;
|
|
16417
16421
|
(async () => {
|
|
16418
16422
|
try {
|
|
16419
16423
|
let e = await d(Ol(t, S)), i = w.indexOf(n);
|
|
16420
16424
|
if (i < 0) return;
|
|
16421
|
-
w[i].content = bl(t, r, e),
|
|
16425
|
+
w[i].content = bl(t, r, e), vn.persistRuntime();
|
|
16422
16426
|
} catch {}
|
|
16423
16427
|
})();
|
|
16424
16428
|
}
|
|
16425
16429
|
}
|
|
16426
|
-
let
|
|
16430
|
+
let _n = ki({
|
|
16427
16431
|
getConfig: () => e.images,
|
|
16428
16432
|
getVision: () => g.vision === !0,
|
|
16429
|
-
emit:
|
|
16433
|
+
emit: Y,
|
|
16430
16434
|
getVfsStore: () => X.vfsStore,
|
|
16431
|
-
noteFailure: (e, t) =>
|
|
16432
|
-
}),
|
|
16435
|
+
noteFailure: (e, t) => vn.notePersistFailure(e, t)
|
|
16436
|
+
}), vn = km({
|
|
16433
16437
|
agentId: n,
|
|
16434
16438
|
options: e,
|
|
16435
|
-
emit:
|
|
16439
|
+
emit: Y,
|
|
16436
16440
|
getStore: () => l,
|
|
16437
16441
|
core: X,
|
|
16438
|
-
sessionsRef:
|
|
16442
|
+
sessionsRef: on,
|
|
16439
16443
|
sessionVars: ne,
|
|
16440
16444
|
messages: w,
|
|
16441
16445
|
getUsage: () => a,
|
|
16442
16446
|
mw: {
|
|
16443
16447
|
todosMw: D,
|
|
16444
|
-
memoryMw:
|
|
16448
|
+
memoryMw: N,
|
|
16445
16449
|
missionMw: O,
|
|
16446
|
-
workingMemoryMw:
|
|
16447
|
-
focusMw:
|
|
16448
|
-
summarizationMw:
|
|
16450
|
+
workingMemoryMw: oe,
|
|
16451
|
+
focusMw: j,
|
|
16452
|
+
summarizationMw: en,
|
|
16449
16453
|
resumeNoticeMw: te,
|
|
16450
|
-
useMission:
|
|
16451
|
-
useWorkingMemory:
|
|
16452
|
-
useFocus:
|
|
16453
|
-
useAutomation:
|
|
16454
|
+
useMission: it,
|
|
16455
|
+
useWorkingMemory: at,
|
|
16456
|
+
useFocus: Je,
|
|
16457
|
+
useAutomation: _e
|
|
16454
16458
|
},
|
|
16455
16459
|
vfsStore: T,
|
|
16456
|
-
checkpointMgr:
|
|
16460
|
+
checkpointMgr: z,
|
|
16457
16461
|
conflictResolve: (e) => o.resolve(e),
|
|
16458
|
-
abortAllActive:
|
|
16462
|
+
abortAllActive: un,
|
|
16459
16463
|
titleLlmInvoke: f
|
|
16460
16464
|
});
|
|
16461
16465
|
return X.initDone = (async () => {
|
|
16462
|
-
await
|
|
16466
|
+
await fn(), await pn(), e.mcp?.length && sd({
|
|
16463
16467
|
servers: e.mcp,
|
|
16464
|
-
emit:
|
|
16465
|
-
isReleased: () =>
|
|
16468
|
+
emit: Y,
|
|
16469
|
+
isReleased: () => We,
|
|
16466
16470
|
core: {
|
|
16467
16471
|
mcpClosers: X.mcpClosers,
|
|
16468
16472
|
mcpServers: X.mcpServers,
|
|
@@ -16471,29 +16475,29 @@ function X_(e, n, r) {
|
|
|
16471
16475
|
},
|
|
16472
16476
|
reservedNames: () => {
|
|
16473
16477
|
let e = /* @__PURE__ */ new Set();
|
|
16474
|
-
for (let t of
|
|
16475
|
-
let n =
|
|
16478
|
+
for (let t of K) {
|
|
16479
|
+
let n = Ee.get(t.name);
|
|
16476
16480
|
n && !n.startsWith("mcp:") && e.add(t.name);
|
|
16477
16481
|
}
|
|
16478
16482
|
return e;
|
|
16479
16483
|
},
|
|
16480
|
-
pushTool: (e, t) => (
|
|
16484
|
+
pushTool: (e, t) => (Ee.set(e.name, `mcp:${t}`), Ue.push(e), !0),
|
|
16481
16485
|
rebind: () => {
|
|
16482
|
-
|
|
16486
|
+
K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16483
16487
|
},
|
|
16484
16488
|
debug: e.debug
|
|
16485
16489
|
});
|
|
16486
16490
|
let t = Ap(e.llm) ? e.llm : await k(e.llm);
|
|
16487
|
-
Mp(t, { emit:
|
|
16491
|
+
Mp(t, { emit: Y }), X.agent = Ms({
|
|
16488
16492
|
llm: t,
|
|
16489
|
-
systemPrompt:
|
|
16490
|
-
tools:
|
|
16491
|
-
middleware:
|
|
16493
|
+
systemPrompt: ye,
|
|
16494
|
+
tools: K,
|
|
16495
|
+
middleware: nn,
|
|
16492
16496
|
maxToolRounds: e.maxToolRounds,
|
|
16493
|
-
hasSubagent:
|
|
16494
|
-
pageAssertionGate:
|
|
16495
|
-
pageReadTools:
|
|
16496
|
-
deferredWriteTools:
|
|
16497
|
+
hasSubagent: dt,
|
|
16498
|
+
pageAssertionGate: V.domInspect === !0,
|
|
16499
|
+
pageReadTools: Ve.size ? Ve : void 0,
|
|
16500
|
+
deferredWriteTools: He.size ? He : void 0,
|
|
16497
16501
|
maxRetries: e.maxRetries,
|
|
16498
16502
|
stallMs: e.streamStallMs ?? 9e4,
|
|
16499
16503
|
streamMaxMs: e.streamMaxDurationMs ?? 18e5,
|
|
@@ -16502,16 +16506,16 @@ function X_(e, n, r) {
|
|
|
16502
16506
|
contextWindow: g.contextWindow,
|
|
16503
16507
|
maxOutputTokens: g.maxOutputTokens,
|
|
16504
16508
|
vision: g.vision,
|
|
16505
|
-
imageContentFormat:
|
|
16506
|
-
maxVerifyAttempts:
|
|
16509
|
+
imageContentFormat: je,
|
|
16510
|
+
maxVerifyAttempts: gt ? pt : 0,
|
|
16507
16511
|
roundTokenBudget: e.roundTokenBudget ?? 0,
|
|
16508
16512
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
16509
16513
|
onLlmChange: (e) => {
|
|
16510
16514
|
C = e;
|
|
16511
16515
|
},
|
|
16512
16516
|
debug: e.debug
|
|
16513
|
-
}),
|
|
16514
|
-
X.agent && X.agent.setTools(
|
|
16517
|
+
}), se.current = X.agent, At && At.setReconfigureHook(() => {
|
|
16518
|
+
X.agent && X.agent.setTools(nt());
|
|
16515
16519
|
});
|
|
16516
16520
|
})(), X;
|
|
16517
16521
|
}
|
|
@@ -16976,11 +16980,11 @@ async function cv(e) {
|
|
|
16976
16980
|
//#region src/core/composables/useChat.ts
|
|
16977
16981
|
var lv = 4e3;
|
|
16978
16982
|
function uv(e = {}) {
|
|
16979
|
-
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a, onBeforeRegenerate: o } = e, s = /* @__PURE__ */
|
|
16983
|
+
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a, onBeforeRegenerate: o } = e, s = /* @__PURE__ */ Pt({
|
|
16980
16984
|
messages: e.messages ?? [],
|
|
16981
16985
|
loading: !1,
|
|
16982
16986
|
error: null
|
|
16983
|
-
}), c = /* @__PURE__ */
|
|
16987
|
+
}), c = /* @__PURE__ */ Gt(null), l = /* @__PURE__ */ Gt(!0), u = null, d = /* @__PURE__ */ Gt([]), f = /* @__PURE__ */ Gt(null);
|
|
16984
16988
|
function p() {}
|
|
16985
16989
|
function m(e) {
|
|
16986
16990
|
let t = c.value;
|
|
@@ -17004,7 +17008,7 @@ function uv(e = {}) {
|
|
|
17004
17008
|
}
|
|
17005
17009
|
async function _(e) {
|
|
17006
17010
|
if (l.value = !0, n) {
|
|
17007
|
-
let t = /* @__PURE__ */
|
|
17011
|
+
let t = /* @__PURE__ */ Pt({
|
|
17008
17012
|
role: "assistant",
|
|
17009
17013
|
content: "",
|
|
17010
17014
|
timestamp: Date.now(),
|
|
@@ -17704,19 +17708,19 @@ function _v(e = {}) {
|
|
|
17704
17708
|
onQueuedCleared: e.onQueuedCleared,
|
|
17705
17709
|
onBeforeRegenerate: e.onBeforeRegenerate,
|
|
17706
17710
|
getFocuses: e.getFocuses
|
|
17707
|
-
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */
|
|
17711
|
+
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */ Gt(""), s = /* @__PURE__ */ Gt(!0), c = () => {
|
|
17708
17712
|
s.value = !s.value;
|
|
17709
|
-
}, l = /* @__PURE__ */
|
|
17713
|
+
}, l = /* @__PURE__ */ Gt(!1), u = () => {
|
|
17710
17714
|
l.value = !0;
|
|
17711
17715
|
}, d = () => {
|
|
17712
17716
|
l.value = !1;
|
|
17713
|
-
}, f = /* @__PURE__ */
|
|
17717
|
+
}, f = /* @__PURE__ */ Gt(!1), p = () => {
|
|
17714
17718
|
f.value = !0;
|
|
17715
17719
|
}, m = () => {
|
|
17716
17720
|
f.value = !1;
|
|
17717
|
-
}, h = /* @__PURE__ */
|
|
17721
|
+
}, h = /* @__PURE__ */ Gt({}), g = (e) => h.value[e] === !0, _ = (e) => {
|
|
17718
17722
|
h.value[e] = !g(e);
|
|
17719
|
-
}, v = /* @__PURE__ */
|
|
17723
|
+
}, v = /* @__PURE__ */ Gt(!1), y = (e) => {
|
|
17720
17724
|
cv(e).then((e) => {
|
|
17721
17725
|
e && (v.value = !0, setTimeout(() => {
|
|
17722
17726
|
v.value = !1;
|
|
@@ -17730,13 +17734,13 @@ function _v(e = {}) {
|
|
|
17730
17734
|
};
|
|
17731
17735
|
}), x = ri(() => (n.messages.length, typeof e.canUndo == "function" && !!e.canUndo())), S = () => {
|
|
17732
17736
|
e.onUndo?.() && (n.error = null);
|
|
17733
|
-
}, C = (e) => new Date(e).toLocaleTimeString(
|
|
17737
|
+
}, C = (e) => new Date(e).toLocaleTimeString(ce, {
|
|
17734
17738
|
hour: "2-digit",
|
|
17735
17739
|
minute: "2-digit"
|
|
17736
17740
|
}), w = () => {
|
|
17737
17741
|
let e = T.value, t = ne.value;
|
|
17738
|
-
!o.value.trim() && !e.length || (r(o.value,
|
|
17739
|
-
}, T = /* @__PURE__ */
|
|
17742
|
+
!o.value.trim() && !e.length || (r(o.value, M.value, e.length ? [...e] : void 0, t ?? void 0), o.value = "", T.value = [], t && re());
|
|
17743
|
+
}, T = /* @__PURE__ */ Gt([]), E = /* @__PURE__ */ Gt(""), D = /* @__PURE__ */ Gt(!1), O, k = (e) => {
|
|
17740
17744
|
E.value = e, clearTimeout(O), O = setTimeout(() => {
|
|
17741
17745
|
E.value = "";
|
|
17742
17746
|
}, 4e3);
|
|
@@ -17745,45 +17749,45 @@ function _v(e = {}) {
|
|
|
17745
17749
|
if (!t.length) return;
|
|
17746
17750
|
let n = 4 - T.value.length;
|
|
17747
17751
|
if (n <= 0) {
|
|
17748
|
-
k(`${
|
|
17752
|
+
k(`${L.imageCountLimitPrefix}4${L.imageCountLimitSuffix}`);
|
|
17749
17753
|
return;
|
|
17750
17754
|
}
|
|
17751
|
-
t.length > n && k(`${
|
|
17755
|
+
t.length > n && k(`${L.imageCountLimitPrefix}4${L.imageCountLimitSuffix}`), D.value = !0;
|
|
17752
17756
|
try {
|
|
17753
17757
|
for (let e of t.slice(0, n)) try {
|
|
17754
17758
|
let t = await Ei(e, { name: e.name });
|
|
17755
17759
|
T.value.push(t);
|
|
17756
17760
|
} catch (e) {
|
|
17757
|
-
k(e instanceof hi ? `${e.message}` :
|
|
17761
|
+
k(e instanceof hi ? `${e.message}` : L.imageInvalid);
|
|
17758
17762
|
}
|
|
17759
17763
|
} finally {
|
|
17760
17764
|
D.value = !1;
|
|
17761
17765
|
}
|
|
17762
17766
|
}, te = (e) => {
|
|
17763
17767
|
T.value = T.value.filter((t) => t.id !== e);
|
|
17764
|
-
}, ne = ri(() => e.pendingQuote?.value ?? null),
|
|
17768
|
+
}, ne = ri(() => e.pendingQuote?.value ?? null), A = (t) => {
|
|
17765
17769
|
e.onSetQuote?.(t);
|
|
17766
|
-
},
|
|
17770
|
+
}, re = () => {
|
|
17767
17771
|
e.onClearQuote?.();
|
|
17768
|
-
},
|
|
17772
|
+
}, ie = (e) => {
|
|
17769
17773
|
e.isComposing || e.keyCode === 229 || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), w());
|
|
17770
|
-
},
|
|
17774
|
+
}, ae = (e) => {
|
|
17771
17775
|
o.value = a.value[e] || "", i(e);
|
|
17772
|
-
},
|
|
17776
|
+
}, j = (e) => {
|
|
17773
17777
|
let t = n.messages, r = t[e];
|
|
17774
17778
|
if (!r || r.role !== "assistant") return !1;
|
|
17775
17779
|
let i = "reasoning" in r ? r.reasoning : void 0, a = "steps" in r ? r.steps : void 0;
|
|
17776
17780
|
return n.loading && e === t.length - 1 && !r.content && !i && !(a && a.length);
|
|
17777
|
-
},
|
|
17781
|
+
}, M = ri(() => (e.infoTick?.value, e.getFocuses?.() ?? [])), oe = ri(() => (e.infoTick?.value, e.getInfo?.()?.planConfirmation)), N = (t) => e.onAddFocus ? e.onAddFocus(t) : {
|
|
17778
17782
|
ok: !1,
|
|
17779
17783
|
error: "focus 未启用"
|
|
17780
|
-
},
|
|
17784
|
+
}, se = (t) => {
|
|
17781
17785
|
e.onRemoveFocus?.(t);
|
|
17782
|
-
},
|
|
17786
|
+
}, P = () => {
|
|
17783
17787
|
e.onClearFocus?.();
|
|
17784
|
-
},
|
|
17788
|
+
}, F = (t) => {
|
|
17785
17789
|
e.onFocusChipClick?.(t);
|
|
17786
|
-
},
|
|
17790
|
+
}, I = fv(e.icons), ce = e.locale ?? "zh-CN", L = hv(ce, e.dialogMessages);
|
|
17787
17791
|
return {
|
|
17788
17792
|
chat: t,
|
|
17789
17793
|
inputText: o,
|
|
@@ -17805,26 +17809,26 @@ function _v(e = {}) {
|
|
|
17805
17809
|
undo: S,
|
|
17806
17810
|
formatTime: C,
|
|
17807
17811
|
send: w,
|
|
17808
|
-
keydown:
|
|
17812
|
+
keydown: ie,
|
|
17809
17813
|
pendingImages: T,
|
|
17810
17814
|
addImageFiles: ee,
|
|
17811
17815
|
removePendingImage: te,
|
|
17812
17816
|
imageInputError: E,
|
|
17813
17817
|
compressingImages: D,
|
|
17814
17818
|
quote: ne,
|
|
17815
|
-
setQuote:
|
|
17816
|
-
clearQuote:
|
|
17817
|
-
editQueued:
|
|
17818
|
-
isPendingAssistant:
|
|
17819
|
-
focuses:
|
|
17820
|
-
planConfirmation:
|
|
17821
|
-
addFocus:
|
|
17822
|
-
removeFocus:
|
|
17823
|
-
clearFocus:
|
|
17824
|
-
focusChipClick:
|
|
17825
|
-
icons:
|
|
17826
|
-
locale:
|
|
17827
|
-
messages:
|
|
17819
|
+
setQuote: A,
|
|
17820
|
+
clearQuote: re,
|
|
17821
|
+
editQueued: ae,
|
|
17822
|
+
isPendingAssistant: j,
|
|
17823
|
+
focuses: M,
|
|
17824
|
+
planConfirmation: oe,
|
|
17825
|
+
addFocus: N,
|
|
17826
|
+
removeFocus: se,
|
|
17827
|
+
clearFocus: P,
|
|
17828
|
+
focusChipClick: F,
|
|
17829
|
+
icons: I,
|
|
17830
|
+
locale: ce,
|
|
17831
|
+
messages: L,
|
|
17828
17832
|
toolStepView: e.toolStepView
|
|
17829
17833
|
};
|
|
17830
17834
|
}
|
|
@@ -17839,4 +17843,4 @@ function yv(e) {
|
|
|
17839
17843
|
return Z_(e);
|
|
17840
17844
|
}
|
|
17841
17845
|
//#endregion
|
|
17842
|
-
export { ym as CAPABILITIES, Sm as CONTEXT_PRESETS, Dp as CompressDecisionSchema, Xg as DEFAULT_COMPUTED_STYLES, jl as DEFAULT_PROMPT_SOFT_CAP, cd as DEFAULT_SYSTEM_PROMPT, ld as DEFAULT_SYSTEM_PROMPT_EN, gf as HTML_VOID_TAGS, xu as HUMAN_CONFIRM_TOOL_NAME, hi as ImageInputError, g as LOW_CAPS_HINT_BASELINE, p as MIN_CONTEXT_WINDOW, va as MODEL_UNAVAILABLE_GUIDANCE, Al as SOFT_CAP_MIN_WINDOW, Sl as STOP_WORDS, Cc as UNSAFE_KEYS, S_ as actionsToInspectInfo, x_ as actionsToTools, di as agentError, ed as analyzeContext, Ic as applyPatchToClone, zc as applyPatchToLive, rf as applyPatchesToBind, Ag as applyProposalOps, Hs as arrayMinLength, ui as asAgentError, sp as buildCollectorJs, t_ as buildCssPath, gd as buildDataPrompt, $f as buildDiagnosticsReport, _p as buildHtmlFragmentSkill, cp as buildSandboxSrcdoc, _d as buildSystemPrompt, Ji as captureSelectionQuote, gv as chatContextKey, nf as commitSetToBind, mp as composeStructureThenRender, Ei as compressImage, od as connectMcp, k as constructLlmFromConfig, E as constructOpenLlmSync, cv as copyText, kg as countOccurrences, Ms as createAgent, bu as createApprovalMiddleware, _v as createChatContext, yv as createChatSdk, Mu as createCheckpointManager, Nu as createCheckpointMiddleware, Hp as createConflictManager, td as createContextInspectorMiddleware, xp as createCraftNoteCheck, hf as createDataOps, sv as createEvalHarness, yp as createHtmlFormatCheck, pp as createHtmlRenderCheck, Cp as createHtmlSubagent, wu as createHumanConfirmMiddleware, Cu as createHumanConfirmTool, iv as createIdleDetector, um as createMemoryBackend, pu as createMemoryMiddleware, u as createProxyLlm, rv as createRagSubagent, wa as createSandboxRunner, xm as createSdkEvents, U_ as createSerialRunner, mm as createSessionStore, hm as createSessionStoreWithBackend, z_ as createSkillStore, iu as createSubagentMiddleware, Rl as createSubagentTracker, su as createSubagentsMiddleware, j_ as createUsageHintsMiddleware, Fu as createVerifyMiddleware, xd as createVfs, fm as createWebStorageBackend, Vu as createWriteBackCheck, ya as decorateModelUnavailable, Oc as deepClone, T_ as defineDataToolset, Qc as defineSkill, wp as defineTool, Dc as deleteByPath, Op as deriveTitle, nc as describeSchemaNode, hs as detectGarbledToolCall, To as detectTransitionalReply, Uc as diffObjects, ov as diffReport, o_ as domInfoTool, d_ as domInspectSkill, a_ as domSearchTool, Vg as domToStructure, Yg as domTools, w_ as domToolsStatic, Us as elementSchemaCandidates, $g as ensureDomListenerRecorder, wl as estimateMessageTokens, Dl as estimateRoundTokens, y as estimateTokens, te as extractReasoningDelta, hc as extractSchemaHint, nd as extractText, ee as extractTextDelta, ne as extractUsage, Lg as fetchDocTools, C_ as fetchTools, Hc as findStrippedKeys, rc as formatConstraints, oi as formatZodIssues, Q as getByPath, Hg as getDomTool, i_ as getElementInfo, m_ as getEnvSummary, e_ as getRecordedListeners, dp as getSandboxLifecycle, Is as getSchemaAtPath, Ns as getSchemaTopKeys, jg as hashContent, Pc as hashValue, vp as htmlFragmentSkill, uc as htmlOrchestratorPrompt, Ol as indexSummarize, __ as inspectEnvTool, v_ as inspectTools, Ap as isChatModel, ga as isContextLengthError, _a as isModelUnavailableError, Ps as isPathAllowed, nm as isQuotaError, wc as isUnsafePath, Pa as jpEval, ci as jsonParseError, Mc as limitDepth, Dg as lineDiff, _ as lowCapsHint, Zf as maskUrlCredentials, Ac as maybeParseValue, Gf as measureWriteScale, Rc as moveByPath, T as normalizeBaseUrl, op as normalizeRenderResult,
|
|
17846
|
+
export { ym as CAPABILITIES, Sm as CONTEXT_PRESETS, Dp as CompressDecisionSchema, Xg as DEFAULT_COMPUTED_STYLES, jl as DEFAULT_PROMPT_SOFT_CAP, cd as DEFAULT_SYSTEM_PROMPT, ld as DEFAULT_SYSTEM_PROMPT_EN, gf as HTML_VOID_TAGS, xu as HUMAN_CONFIRM_TOOL_NAME, hi as ImageInputError, g as LOW_CAPS_HINT_BASELINE, p as MIN_CONTEXT_WINDOW, va as MODEL_UNAVAILABLE_GUIDANCE, Al as SOFT_CAP_MIN_WINDOW, Sl as STOP_WORDS, Cc as UNSAFE_KEYS, S_ as actionsToInspectInfo, x_ as actionsToTools, di as agentError, ed as analyzeContext, Ic as applyPatchToClone, zc as applyPatchToLive, rf as applyPatchesToBind, Ag as applyProposalOps, Hs as arrayMinLength, ui as asAgentError, sp as buildCollectorJs, t_ as buildCssPath, gd as buildDataPrompt, $f as buildDiagnosticsReport, _p as buildHtmlFragmentSkill, cp as buildSandboxSrcdoc, _d as buildSystemPrompt, Ji as captureSelectionQuote, gv as chatContextKey, nf as commitSetToBind, mp as composeStructureThenRender, Ei as compressImage, od as connectMcp, k as constructLlmFromConfig, E as constructOpenLlmSync, cv as copyText, kg as countOccurrences, Ms as createAgent, bu as createApprovalMiddleware, _v as createChatContext, yv as createChatSdk, Mu as createCheckpointManager, Nu as createCheckpointMiddleware, Hp as createConflictManager, td as createContextInspectorMiddleware, xp as createCraftNoteCheck, hf as createDataOps, sv as createEvalHarness, yp as createHtmlFormatCheck, pp as createHtmlRenderCheck, Cp as createHtmlSubagent, wu as createHumanConfirmMiddleware, Cu as createHumanConfirmTool, iv as createIdleDetector, um as createMemoryBackend, pu as createMemoryMiddleware, u as createProxyLlm, rv as createRagSubagent, wa as createSandboxRunner, xm as createSdkEvents, U_ as createSerialRunner, mm as createSessionStore, hm as createSessionStoreWithBackend, z_ as createSkillStore, iu as createSubagentMiddleware, Rl as createSubagentTracker, su as createSubagentsMiddleware, j_ as createUsageHintsMiddleware, Fu as createVerifyMiddleware, xd as createVfs, fm as createWebStorageBackend, Vu as createWriteBackCheck, ya as decorateModelUnavailable, Oc as deepClone, T_ as defineDataToolset, Qc as defineSkill, wp as defineTool, Dc as deleteByPath, Op as deriveTitle, nc as describeSchemaNode, hs as detectGarbledToolCall, To as detectTransitionalReply, Uc as diffObjects, ov as diffReport, o_ as domInfoTool, d_ as domInspectSkill, a_ as domSearchTool, Vg as domToStructure, Yg as domTools, w_ as domToolsStatic, Us as elementSchemaCandidates, $g as ensureDomListenerRecorder, wl as estimateMessageTokens, Dl as estimateRoundTokens, y as estimateTokens, te as extractReasoningDelta, hc as extractSchemaHint, nd as extractText, ee as extractTextDelta, ne as extractUsage, Lg as fetchDocTools, C_ as fetchTools, Hc as findStrippedKeys, rc as formatConstraints, oi as formatZodIssues, Q as getByPath, Hg as getDomTool, i_ as getElementInfo, m_ as getEnvSummary, e_ as getRecordedListeners, dp as getSandboxLifecycle, Is as getSchemaAtPath, Ns as getSchemaTopKeys, jg as hashContent, Pc as hashValue, vp as htmlFragmentSkill, uc as htmlOrchestratorPrompt, Ol as indexSummarize, __ as inspectEnvTool, v_ as inspectTools, Ap as isChatModel, ga as isContextLengthError, _a as isModelUnavailableError, Ps as isPathAllowed, nm as isQuotaError, wc as isUnsafePath, Pa as jpEval, ci as jsonParseError, Mc as limitDepth, Dg as lineDiff, _ as lowCapsHint, Zf as maskUrlCredentials, Ac as maybeParseValue, Gf as measureWriteScale, Rc as moveByPath, T as normalizeBaseUrl, op as normalizeRenderResult, re as normalizeUsage, x as offloadPassThroughChars, b as offloadThresholdChars, lc as presets, Xs as projectBySchema, Ys as projectBySchemaDeep, jc as projectFields, kl as recallRounds, fp as renderInSandbox, ic as renderSchemaHint, ac as renderSchemaOverview, cc as renderSchemaShallow, bm as resolveCapabilities, wm as resolveContextOptions, vm as resolveDialogConfig, Vp as resolveLlm, v as resolveModelCaps, Nl as resolvePromptSoftCap, zs as resolveSchemaPath, _m as resolveStorage, Vc as restoreInPlace, Bc as restoreLive, li as routeError, Ra as runSandboxedScript, Tc as safeMerge, p_ as safeSerialize, $ as safeStringify, gs as sanitizeGarbledContent, Vs as schemaHasRefinement, n_ as searchDom, Ia as searchJson, E_ as selectBuiltinTools, Ec as setByPath, Pl as shouldTriggerCompression, ep as stringifyDiagnosticsReport, w as stripStainlessFetch, dc as systemPromptHelpers, h as tableMaxOutputTokens, Cl as tokenize, Z as toolError, Fs as unwrapSchema, uv as useChat, vv as useChatContext, Bs as validateAtPath, vf as validateHtmlFormat, ef as validateRootValueLocally, tf as validateWriteLocally, Fc as watchFieldsHash, e as z, si as zodError };
|