page-agent-sdk 4.24.0 → 4.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/page-agent-sdk.headless.js +1138 -1138
- package/dist/page-agent-sdk.iife.js +8 -8
- package/dist/page-agent-sdk.js +878 -878
- package/dist/page-agent-sdk.legacy.js +579 -576
- package/dist/page-agent-sdk.umd.cjs +6 -6
- 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
|
|
@@ -6534,7 +6534,7 @@ async function ru(e, t, n, r, i, a) {
|
|
|
6534
6534
|
} : { contextWindow: y.contextWindow }), x = t.onUsage ? {
|
|
6535
6535
|
name: "sub-usage",
|
|
6536
6536
|
afterModel: (e) => {
|
|
6537
|
-
let n =
|
|
6537
|
+
let n = re(e.message);
|
|
6538
6538
|
n && t.onUsage(n);
|
|
6539
6539
|
}
|
|
6540
6540
|
} : void 0;
|
|
@@ -6620,16 +6620,16 @@ async function ru(e, t, n, r, i, a) {
|
|
|
6620
6620
|
} finally {
|
|
6621
6621
|
ee();
|
|
6622
6622
|
}
|
|
6623
|
-
let
|
|
6624
|
-
|
|
6623
|
+
let A, ie = new Promise((e, t) => {
|
|
6624
|
+
A = setTimeout(() => {
|
|
6625
6625
|
D.abort(), t(/* @__PURE__ */ Error(`子 agent 执行超时(${ne}ms),已中止。可简化子任务或拆更小的子任务重试,或经 subagent.timeoutMs 调整(0=不限制)`));
|
|
6626
6626
|
}, ne);
|
|
6627
6627
|
});
|
|
6628
6628
|
te.catch(() => {});
|
|
6629
6629
|
try {
|
|
6630
|
-
return nu(await Promise.race([te,
|
|
6630
|
+
return nu(await Promise.race([te, ie]), E.getState());
|
|
6631
6631
|
} finally {
|
|
6632
|
-
clearTimeout(
|
|
6632
|
+
clearTimeout(A), ee();
|
|
6633
6633
|
}
|
|
6634
6634
|
}
|
|
6635
6635
|
function iu(e) {
|
|
@@ -7252,7 +7252,7 @@ function wu(e, t = {}) {
|
|
|
7252
7252
|
//#endregion
|
|
7253
7253
|
//#region src/core/utils/rawRead.ts
|
|
7254
7254
|
function Tu(e) {
|
|
7255
|
-
return /* @__PURE__ */
|
|
7255
|
+
return /* @__PURE__ */ J(e);
|
|
7256
7256
|
}
|
|
7257
7257
|
//#endregion
|
|
7258
7258
|
//#region src/core/harness/checkpoint.ts
|
|
@@ -9369,7 +9369,7 @@ function hf(e, n = {}) {
|
|
|
9369
9369
|
let n = t ?? y;
|
|
9370
9370
|
e === void 0 ? v.delete(n) : v.set(n, e);
|
|
9371
9371
|
}, 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
|
|
9372
|
+
async function A() {
|
|
9373
9373
|
if (!ee) return {
|
|
9374
9374
|
release: () => {},
|
|
9375
9375
|
reacquire: async () => {}
|
|
@@ -9389,35 +9389,35 @@ function hf(e, n = {}) {
|
|
|
9389
9389
|
};
|
|
9390
9390
|
}
|
|
9391
9391
|
(n.maxParallelTools ?? 1) > 1 && !O && console.warn("[page-agent-sdk] maxParallelTools>1 且未声明 conflictWatchFields:并发写不互锁(后写覆盖前写,既有明文语义);声明 conflictWatchFields 后自动启用写互锁与乐观锁校验");
|
|
9392
|
-
let
|
|
9392
|
+
let re = (e) => {
|
|
9393
9393
|
let t = k();
|
|
9394
9394
|
return T(t, e), t;
|
|
9395
|
-
},
|
|
9395
|
+
}, ie = n.largeTextThreshold ?? 200, ae = (n.largeTextPaths ?? []).map((e) => {
|
|
9396
9396
|
let t = e.lastIndexOf(".");
|
|
9397
9397
|
return t > 0 ? {
|
|
9398
9398
|
arrayPath: e.slice(0, t),
|
|
9399
9399
|
field: e.slice(t + 1)
|
|
9400
9400
|
} : null;
|
|
9401
|
-
}).filter((e) => e !== null),
|
|
9402
|
-
function
|
|
9403
|
-
|
|
9401
|
+
}).filter((e) => e !== null), j = !0;
|
|
9402
|
+
function M() {
|
|
9403
|
+
j = !0;
|
|
9404
9404
|
}
|
|
9405
|
-
let
|
|
9405
|
+
let oe = {
|
|
9406
9406
|
get: () => ({
|
|
9407
9407
|
schema: o,
|
|
9408
9408
|
bind: c,
|
|
9409
9409
|
description: u
|
|
9410
9410
|
}),
|
|
9411
9411
|
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(),
|
|
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(), M();
|
|
9413
9413
|
},
|
|
9414
9414
|
update: (e) => {
|
|
9415
|
-
c = e, g.length = 0, v.clear(),
|
|
9415
|
+
c = e, g.length = 0, v.clear(), M();
|
|
9416
9416
|
},
|
|
9417
|
-
markDataDirty:
|
|
9417
|
+
markDataDirty: M,
|
|
9418
9418
|
consumeDataDirty: () => {
|
|
9419
|
-
let e =
|
|
9420
|
-
return
|
|
9419
|
+
let e = j;
|
|
9420
|
+
return j = !1, e;
|
|
9421
9421
|
},
|
|
9422
9422
|
enterScope: (e) => {
|
|
9423
9423
|
let t = y;
|
|
@@ -9471,14 +9471,14 @@ function hf(e, n = {}) {
|
|
|
9471
9471
|
} : void 0,
|
|
9472
9472
|
updateResource: p ? (e, t) => {
|
|
9473
9473
|
let n = Id(e);
|
|
9474
|
-
p.update(n, t), Ec(c, n, t),
|
|
9474
|
+
p.update(n, t), Ec(c, n, t), M(), T(k(), "");
|
|
9475
9475
|
} : void 0,
|
|
9476
9476
|
deleteResource: p ? (e) => p.delete(e) : void 0,
|
|
9477
9477
|
listResources: p ? () => p.list() : void 0
|
|
9478
|
-
},
|
|
9478
|
+
}, N = (e) => {
|
|
9479
9479
|
n.onAudit?.(e);
|
|
9480
9480
|
};
|
|
9481
|
-
function
|
|
9481
|
+
function se(e, t) {
|
|
9482
9482
|
let n = Oc(l()), r = g.length ? g[g.length - 1].id + 1 : 1;
|
|
9483
9483
|
for (g.push({
|
|
9484
9484
|
id: r,
|
|
@@ -9489,7 +9489,7 @@ function hf(e, n = {}) {
|
|
|
9489
9489
|
}); g.length > _;) g.shift();
|
|
9490
9490
|
return r;
|
|
9491
9491
|
}
|
|
9492
|
-
async function
|
|
9492
|
+
async function P(e, t, r, i, a) {
|
|
9493
9493
|
if (!t || t === "") return null;
|
|
9494
9494
|
let o = k();
|
|
9495
9495
|
if (o === t) return null;
|
|
@@ -9511,7 +9511,7 @@ function hf(e, n = {}) {
|
|
|
9511
9511
|
if (u.action === "restore") {
|
|
9512
9512
|
await i?.reacquire();
|
|
9513
9513
|
let e = k();
|
|
9514
|
-
if (e !== o) return
|
|
9514
|
+
if (e !== o) return N({
|
|
9515
9515
|
op: "conflict_recheck",
|
|
9516
9516
|
detail: `restore 裁决基于 ${o} 恢复时 ${e}(ask 窗口新修改落地,回退被拦)`,
|
|
9517
9517
|
timestamp: Date.now()
|
|
@@ -9527,13 +9527,13 @@ function hf(e, n = {}) {
|
|
|
9527
9527
|
message: `restore 裁决所锚定的快照 #${s} 已不在快照栈(可能被 maxSnapshots 淘汰)`,
|
|
9528
9528
|
hint: "重新 read 拿最新值,或用 restore_data 显式指定快照 id 回退"
|
|
9529
9529
|
});
|
|
9530
|
-
Bc(c, Oc(t.value)),
|
|
9530
|
+
Bc(c, Oc(t.value)), M();
|
|
9531
9531
|
let n = k();
|
|
9532
9532
|
return T(n, a), `已回退主数据到历史快照 #${t.id}[${t.op}]。当前值:${$(l(), 400)} (hash=${n})。请基于回退后的值重写或停止。`;
|
|
9533
9533
|
}
|
|
9534
9534
|
await i?.reacquire();
|
|
9535
9535
|
let d = k();
|
|
9536
|
-
return d === o ? (T(d, a), null) : (
|
|
9536
|
+
return d === o ? (T(d, a), null) : (N({
|
|
9537
9537
|
op: "conflict_recheck",
|
|
9538
9538
|
detail: `裁决基于 ${o} 恢复时 ${d}(ask 窗口新修改落地,overwrite 被拦)`,
|
|
9539
9539
|
timestamp: Date.now()
|
|
@@ -9543,10 +9543,10 @@ function hf(e, n = {}) {
|
|
|
9543
9543
|
hint: "重新 read 拿最新值与 hash,基于最新值修改后再写入(单次校验,不再二次挂起)。"
|
|
9544
9544
|
}));
|
|
9545
9545
|
}
|
|
9546
|
-
let
|
|
9546
|
+
let F = (e, t = !0) => {
|
|
9547
9547
|
e.writeCapable = t;
|
|
9548
|
-
},
|
|
9549
|
-
let n = b(t), r = await
|
|
9548
|
+
}, I = s(async ({ id: e }, t) => {
|
|
9549
|
+
let n = b(t), r = await A();
|
|
9550
9550
|
try {
|
|
9551
9551
|
if (!g.length) return Z({
|
|
9552
9552
|
code: "NO_SNAPSHOT",
|
|
@@ -9560,7 +9560,7 @@ function hf(e, n = {}) {
|
|
|
9560
9560
|
hint: "用 history_data({list:true}) 查看可用快照序号"
|
|
9561
9561
|
});
|
|
9562
9562
|
let r = o.safeParse(t.value);
|
|
9563
|
-
r.success ||
|
|
9563
|
+
r.success || N({
|
|
9564
9564
|
op: "restore",
|
|
9565
9565
|
detail: `#${t.id} 快照含当前 schema 违例 ${r.error.issues.length} 处(历史既有数据非本次写入,放行回退)`,
|
|
9566
9566
|
timestamp: Date.now()
|
|
@@ -9573,7 +9573,7 @@ function hf(e, n = {}) {
|
|
|
9573
9573
|
cur: n
|
|
9574
9574
|
});
|
|
9575
9575
|
}
|
|
9576
|
-
if (!i.length) return Bc(c, Oc(t.value)),
|
|
9576
|
+
if (!i.length) return Bc(c, Oc(t.value)), M(), N({
|
|
9577
9577
|
op: "restore",
|
|
9578
9578
|
detail: `#${t.id}`,
|
|
9579
9579
|
timestamp: Date.now()
|
|
@@ -9606,7 +9606,7 @@ function hf(e, n = {}) {
|
|
|
9606
9606
|
}
|
|
9607
9607
|
e.val === void 0 ? l.push(e.p) : Ec(c, n, e.val), s.push(e.p);
|
|
9608
9608
|
}
|
|
9609
|
-
|
|
9609
|
+
M(), N({
|
|
9610
9610
|
op: "restore",
|
|
9611
9611
|
detail: `#${t.id}(保护字段保留 ${s.length}${l.length ? `,未能回填 ${l.length}` : ""})`,
|
|
9612
9612
|
timestamp: Date.now()
|
|
@@ -9621,8 +9621,8 @@ function hf(e, n = {}) {
|
|
|
9621
9621
|
description: "把主数据回退到某个快照(不传 id 回退最近一次)。快照列表用 history_data({list:true})。",
|
|
9622
9622
|
schema: t.object({ id: t.number().int().optional().describe("快照序号;不传回退最近一次") })
|
|
9623
9623
|
});
|
|
9624
|
-
|
|
9625
|
-
let
|
|
9624
|
+
F(I);
|
|
9625
|
+
let ce = s(async ({ id: e, jsonPath: t, list: n }) => {
|
|
9626
9626
|
if (n) {
|
|
9627
9627
|
if (!g.length) return "无快照。set/edit/delete 会自动存快照。";
|
|
9628
9628
|
let e = g.map((e) => {
|
|
@@ -9667,7 +9667,7 @@ function hf(e, n = {}) {
|
|
|
9667
9667
|
jsonPath: t.string().optional().describe("只看快照的某子路径"),
|
|
9668
9668
|
list: t.boolean().optional().describe("true 列出快照时间线(序号/操作/标签/时间/大小)")
|
|
9669
9669
|
})
|
|
9670
|
-
}),
|
|
9670
|
+
}), L = s(async ({ expr: e, queries: t, limit: n }, r) => {
|
|
9671
9671
|
let i = b(r);
|
|
9672
9672
|
if (typeof c != "object" || !c) return Z({
|
|
9673
9673
|
code: "NOT_OBJECT",
|
|
@@ -9686,7 +9686,7 @@ function hf(e, n = {}) {
|
|
|
9686
9686
|
details: { expr: e }
|
|
9687
9687
|
});
|
|
9688
9688
|
}
|
|
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 === "",
|
|
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 === "", ae, ie, {
|
|
9690
9690
|
rootExempt: !1,
|
|
9691
9691
|
rootPath: String(e.path ?? ""),
|
|
9692
9692
|
fullTextPrefixes: s,
|
|
@@ -9710,7 +9710,7 @@ function hf(e, n = {}) {
|
|
|
9710
9710
|
queries: t.array(t.string()).min(2).max(10).optional().describe("批量模式:2-10 条 JSONPath 一次取回(与 expr 同传按 queries);逐条独立返回,单条失败该项标 error 不整批"),
|
|
9711
9711
|
limit: t.number().int().min(1).max(200).optional().describe("返回结果上限(批量时逐条适用),默认 50")
|
|
9712
9712
|
})
|
|
9713
|
-
}),
|
|
9713
|
+
}), R = s(async ({ query: e, mode: t, fuzzyThreshold: n, matchKey: r, limit: i }) => {
|
|
9714
9714
|
if (c == null) return Z({
|
|
9715
9715
|
code: "EMPTY",
|
|
9716
9716
|
message: "主数据为空,无可搜索内容"
|
|
@@ -9748,7 +9748,7 @@ function hf(e, n = {}) {
|
|
|
9748
9748
|
matchKey: t.boolean().optional().describe("是否同时匹配 key 名,默认 true"),
|
|
9749
9749
|
limit: t.number().int().min(1).max(200).optional().describe("返回上限,默认 50")
|
|
9750
9750
|
})
|
|
9751
|
-
}),
|
|
9751
|
+
}), le = s(async ({ script: e, mode: t, jsonPath: n }, r) => {
|
|
9752
9752
|
let s = b(r);
|
|
9753
9753
|
if (e.length > 8e3) return Z({
|
|
9754
9754
|
code: "SCRIPT_TOO_LARGE",
|
|
@@ -9789,9 +9789,9 @@ function hf(e, n = {}) {
|
|
|
9789
9789
|
details: { scriptLen: e.length }
|
|
9790
9790
|
});
|
|
9791
9791
|
if (u) {
|
|
9792
|
-
let e = await
|
|
9792
|
+
let e = await A();
|
|
9793
9793
|
try {
|
|
9794
|
-
let n = await
|
|
9794
|
+
let n = await P("edit", O ? w(s) : void 0, void 0, e, s);
|
|
9795
9795
|
if (n !== null) return n;
|
|
9796
9796
|
let r = rf({
|
|
9797
9797
|
bindRef: c,
|
|
@@ -9804,13 +9804,13 @@ function hf(e, n = {}) {
|
|
|
9804
9804
|
allowKeys: d,
|
|
9805
9805
|
snapshots: g,
|
|
9806
9806
|
maxSnapshots: _,
|
|
9807
|
-
markDataDirty:
|
|
9807
|
+
markDataDirty: M,
|
|
9808
9808
|
schemaErrorMode: "schema_invalid",
|
|
9809
9809
|
snapshotLabel: "eval_transform_subtree",
|
|
9810
9810
|
internalAfterWrite: a,
|
|
9811
9811
|
protectedCtx: h
|
|
9812
9812
|
});
|
|
9813
|
-
return r.ok ? (
|
|
9813
|
+
return r.ok ? (N({
|
|
9814
9814
|
op: "edit",
|
|
9815
9815
|
detail: `eval_transform_subtree @ ${u}`,
|
|
9816
9816
|
timestamp: Date.now()
|
|
@@ -9825,9 +9825,9 @@ function hf(e, n = {}) {
|
|
|
9825
9825
|
message: `主数据 bind 为原始类型(${c === null ? "null" : typeof c}),eval transform(patches) 无法就地替换`,
|
|
9826
9826
|
hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹或集成方通过 sdk.setData 替换 bind"
|
|
9827
9827
|
});
|
|
9828
|
-
let e = await
|
|
9828
|
+
let e = await A();
|
|
9829
9829
|
try {
|
|
9830
|
-
let n = await
|
|
9830
|
+
let n = await P("edit", O ? w(s) : void 0, void 0, e, s);
|
|
9831
9831
|
if (n !== null) return n;
|
|
9832
9832
|
let r = rf({
|
|
9833
9833
|
bindRef: c,
|
|
@@ -9836,13 +9836,13 @@ function hf(e, n = {}) {
|
|
|
9836
9836
|
allowKeys: d,
|
|
9837
9837
|
snapshots: g,
|
|
9838
9838
|
maxSnapshots: _,
|
|
9839
|
-
markDataDirty:
|
|
9839
|
+
markDataDirty: M,
|
|
9840
9840
|
schemaErrorMode: "schema_invalid",
|
|
9841
9841
|
snapshotLabel: "eval_transform",
|
|
9842
9842
|
internalAfterWrite: a,
|
|
9843
9843
|
protectedCtx: h
|
|
9844
9844
|
});
|
|
9845
|
-
return r.ok ? (
|
|
9845
|
+
return r.ok ? (N({
|
|
9846
9846
|
op: "edit",
|
|
9847
9847
|
detail: `eval_transform(${r.applied.length} patches)`,
|
|
9848
9848
|
timestamp: Date.now()
|
|
@@ -9866,9 +9866,9 @@ function hf(e, n = {}) {
|
|
|
9866
9866
|
message: `主数据 bind 为原始类型(${c === null ? "null" : typeof c}),eval transform 无法就地替换外部持有的值引用`,
|
|
9867
9867
|
hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹或集成方通过 sdk.setData 替换 bind"
|
|
9868
9868
|
});
|
|
9869
|
-
let i = await
|
|
9869
|
+
let i = await A();
|
|
9870
9870
|
try {
|
|
9871
|
-
let e = await
|
|
9871
|
+
let e = await P("set", O ? w(s) : void 0, n, i, s);
|
|
9872
9872
|
if (e !== null) return e;
|
|
9873
9873
|
let t = a ? Oc(l()) : null, r = ef({
|
|
9874
9874
|
schema: o,
|
|
@@ -9876,7 +9876,7 @@ function hf(e, n = {}) {
|
|
|
9876
9876
|
value: n,
|
|
9877
9877
|
bindRef: c
|
|
9878
9878
|
});
|
|
9879
|
-
return r.ok ? (
|
|
9879
|
+
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
9880
|
op: "edit",
|
|
9881
9881
|
detail: "eval_transform",
|
|
9882
9882
|
timestamp: Date.now()
|
|
@@ -9904,8 +9904,8 @@ function hf(e, n = {}) {
|
|
|
9904
9904
|
jsonPath: t.string().optional().describe("子树模式:仅对该子树执行;transform 返回值作为子树新值")
|
|
9905
9905
|
})
|
|
9906
9906
|
});
|
|
9907
|
-
|
|
9908
|
-
let
|
|
9907
|
+
F(le, (e) => e?.mode === "transform");
|
|
9908
|
+
let ue = s(async ({ jsonPath: e, jsonPaths: t, fields: n, depth: r, offset: i, limit: a }, s) => {
|
|
9909
9909
|
let c = b(s), f = x(s), p = l(), m, g = () => m ??= k();
|
|
9910
9910
|
if (t && t.length) {
|
|
9911
9911
|
let e = !1, i = t.map((t) => {
|
|
@@ -9924,7 +9924,7 @@ function hf(e, n = {}) {
|
|
|
9924
9924
|
resolved: s,
|
|
9925
9925
|
resourcesByPath: h.resourcesByPath,
|
|
9926
9926
|
resourceStore: h.resourceStore
|
|
9927
|
-
})), n && n.length && (s = jc(s, n)), r != null && (s = Mc(s, r)), s = uf(s, c === "",
|
|
9927
|
+
})), n && n.length && (s = jc(s, n)), r != null && (s = Mc(s, r)), s = uf(s, c === "", ae, ie, {
|
|
9928
9928
|
rootExempt: !0,
|
|
9929
9929
|
rootPath: i,
|
|
9930
9930
|
fullTextPrefixes: f,
|
|
@@ -9972,7 +9972,7 @@ function hf(e, n = {}) {
|
|
|
9972
9972
|
resolved: S,
|
|
9973
9973
|
resourcesByPath: h.resourcesByPath,
|
|
9974
9974
|
resourceStore: h.resourceStore
|
|
9975
|
-
})), T(g(), c), n && n.length && (S = jc(S, n)), r != null && (S = Mc(S, r)), S = uf(S, c === "",
|
|
9975
|
+
})), T(g(), c), n && n.length && (S = jc(S, n)), r != null && (S = Mc(S, r)), S = uf(S, c === "", ae, ie, {
|
|
9976
9976
|
rootExempt: !0,
|
|
9977
9977
|
rootPath: _,
|
|
9978
9978
|
fullTextPrefixes: f,
|
|
@@ -9995,10 +9995,10 @@ function hf(e, n = {}) {
|
|
|
9995
9995
|
offset: t.number().int().min(0).optional().describe("数组分页起始偏移(仅数组目标,默认 0)"),
|
|
9996
9996
|
limit: t.number().int().min(1).max(200).optional().describe("数组分页每页条数(默认 50,上限 200),返回切片+total/hasMore")
|
|
9997
9997
|
})
|
|
9998
|
-
}),
|
|
9998
|
+
}), de = s(async ({ value: e, patch: t, patches: n, del: i, dryRun: s }, u) => {
|
|
9999
9999
|
let f = b(u), p = "set";
|
|
10000
10000
|
i ? p = "delete" : (n && n.length || t) && (p = "edit");
|
|
10001
|
-
let m = t?.value === void 0 ? e : t.value, v = await
|
|
10001
|
+
let m = t?.value === void 0 ? e : t.value, v = await A();
|
|
10002
10002
|
try {
|
|
10003
10003
|
let e = O ? w(f) : void 0;
|
|
10004
10004
|
if (s && e !== void 0) {
|
|
@@ -10033,19 +10033,19 @@ function hf(e, n = {}) {
|
|
|
10033
10033
|
hint: e.spec.mode === "freeze" ? "冻结字段不可删" : "verbatim 字段不可直接删;先 resource_delete 释放"
|
|
10034
10034
|
});
|
|
10035
10035
|
}
|
|
10036
|
-
let n = await
|
|
10036
|
+
let n = await P("delete", e, void 0, v, f);
|
|
10037
10037
|
if (n !== null) return n;
|
|
10038
10038
|
if (s) {
|
|
10039
10039
|
let e = Oc(l());
|
|
10040
10040
|
return Dc(e, t.jsonPath) ? `dryRun(delete): 将删除 @ ${t.jsonPath}。预览剩余:${$(e, 600)}。未实际写入、未入快照。` : `dryRun(delete): @ ${t.jsonPath} 不存在(无需删除)。未实际写入。`;
|
|
10041
10041
|
}
|
|
10042
|
-
|
|
10042
|
+
se("delete");
|
|
10043
10043
|
let r = Dc(c, t.jsonPath);
|
|
10044
|
-
return
|
|
10044
|
+
return M(), N({
|
|
10045
10045
|
op: "delete",
|
|
10046
10046
|
detail: t.jsonPath,
|
|
10047
10047
|
timestamp: Date.now()
|
|
10048
|
-
}), a && (a(c, null),
|
|
10048
|
+
}), a && (a(c, null), M()), T(k(), f), r ? `已删除主数据 @ ${t.jsonPath}` : `主数据 @ ${t.jsonPath} 不存在(无需删除)`;
|
|
10049
10049
|
}
|
|
10050
10050
|
if (p === "edit") {
|
|
10051
10051
|
if (typeof c != "object" || !c) return Z({
|
|
@@ -10053,7 +10053,7 @@ function hf(e, n = {}) {
|
|
|
10053
10053
|
message: `edit 仅适用于对象/数组主数据,当前是 ${c === void 0 ? "undefined" : typeof c}`,
|
|
10054
10054
|
hint: "叶子用 write(value) 整体设置"
|
|
10055
10055
|
});
|
|
10056
|
-
let r = await
|
|
10056
|
+
let r = await P("edit", e, void 0, v, f);
|
|
10057
10057
|
if (r !== null) return r;
|
|
10058
10058
|
let i = n && n.length ? n : [{
|
|
10059
10059
|
op: t.op ?? "set",
|
|
@@ -10066,7 +10066,7 @@ function hf(e, n = {}) {
|
|
|
10066
10066
|
allowKeys: d,
|
|
10067
10067
|
snapshots: g,
|
|
10068
10068
|
maxSnapshots: _,
|
|
10069
|
-
markDataDirty:
|
|
10069
|
+
markDataDirty: M,
|
|
10070
10070
|
schemaErrorMode: "zod",
|
|
10071
10071
|
dryRun: s,
|
|
10072
10072
|
internalAfterWrite: a,
|
|
@@ -10074,18 +10074,18 @@ function hf(e, n = {}) {
|
|
|
10074
10074
|
});
|
|
10075
10075
|
if (!l.ok) return l.error;
|
|
10076
10076
|
if (s) return `dryRun(edit): ${l.applied.length} 个 patch 预检通过(schema 校验 OK)。预览结果:${$(l.clone, 600)}。未实际写入、未入快照。`;
|
|
10077
|
-
|
|
10077
|
+
N({
|
|
10078
10078
|
op: "edit",
|
|
10079
10079
|
detail: `${l.applied.length} 个 patch${l.applied.length > 1 ? "(批量)" : ""}`,
|
|
10080
10080
|
value: l.applied.map((e) => `${e.op}@${e.jp}`),
|
|
10081
10081
|
timestamp: Date.now()
|
|
10082
10082
|
});
|
|
10083
|
-
let u =
|
|
10083
|
+
let u = re(f);
|
|
10084
10084
|
return mf(l.clone), `已 write(edit) 主数据(${l.applied.length} 个 patch)。当前值:${$(l.clone, 600)} (新 hash=${u})`;
|
|
10085
10085
|
}
|
|
10086
10086
|
let i = Ac(m);
|
|
10087
10087
|
if (i.parseError) return ci("", m, i.parseError);
|
|
10088
|
-
let u = await
|
|
10088
|
+
let u = await P("set", e, m, v, f);
|
|
10089
10089
|
if (u !== null) return u;
|
|
10090
10090
|
let y = nf({
|
|
10091
10091
|
bindRef: c,
|
|
@@ -10094,9 +10094,9 @@ function hf(e, n = {}) {
|
|
|
10094
10094
|
allowKeys: d,
|
|
10095
10095
|
snapshots: g,
|
|
10096
10096
|
maxSnapshots: _,
|
|
10097
|
-
audit:
|
|
10097
|
+
audit: N,
|
|
10098
10098
|
dryRun: s,
|
|
10099
|
-
onWrite:
|
|
10099
|
+
onWrite: M,
|
|
10100
10100
|
internalAfterWrite: a,
|
|
10101
10101
|
protectedCtx: h,
|
|
10102
10102
|
hashFn: k
|
|
@@ -10141,8 +10141,8 @@ function hf(e, n = {}) {
|
|
|
10141
10141
|
dryRun: t.boolean().optional().describe("预检:走完整校验链但不落盘不入快照;冲突返回 VERSION_CONFLICT 不挂起")
|
|
10142
10142
|
})
|
|
10143
10143
|
});
|
|
10144
|
-
|
|
10145
|
-
let
|
|
10144
|
+
F(de);
|
|
10145
|
+
let fe = s(async ({ jsonPath: e }) => {
|
|
10146
10146
|
let t = e || "", n = t ? Is(o, t) : o;
|
|
10147
10147
|
return n ? `schema${t ? ` @ ${t}` : ""} = ${$(nc(n))}` : Z({
|
|
10148
10148
|
code: "PATH_DENIED",
|
|
@@ -10153,7 +10153,7 @@ function hf(e, n = {}) {
|
|
|
10153
10153
|
name: "schema_data",
|
|
10154
10154
|
description: "查看主数据(或子路径)的字段约束:类型/min/max/enum/必填/默认值/嵌套 shape。写前查约束,避免写错重试。不传 jsonPath 查根;传子路径(如 components.0)查该位置约束。",
|
|
10155
10155
|
schema: t.object({ jsonPath: t.string().optional().describe("要查约束的子路径;不传查根 schema") })
|
|
10156
|
-
}),
|
|
10156
|
+
}), pe = s(async ({ snapshotId: e, against: t }) => {
|
|
10157
10157
|
let n = t != null, r, i;
|
|
10158
10158
|
if (n) {
|
|
10159
10159
|
let e = t;
|
|
@@ -10185,7 +10185,7 @@ function hf(e, n = {}) {
|
|
|
10185
10185
|
snapshotId: t.number().int().optional().describe("对比的快照序号;不传则最近一次"),
|
|
10186
10186
|
against: t.unknown().optional().describe("对比的一段 JSON 值(与 snapshotId 互斥;传则忽略快照)")
|
|
10187
10187
|
})
|
|
10188
|
-
}),
|
|
10188
|
+
}), me = [];
|
|
10189
10189
|
if (n.vfsStore) {
|
|
10190
10190
|
let e = n.vfsStore, r = (e) => `drafts/${e}.json`, i = s(({ draftId: t, chunk: n, mode: i }) => {
|
|
10191
10191
|
let a = r(t), o = e.files[a], s = i === "append" && o, c = s ? o.content + n : n;
|
|
@@ -10226,9 +10226,9 @@ function hf(e, n = {}) {
|
|
|
10226
10226
|
}
|
|
10227
10227
|
});
|
|
10228
10228
|
}
|
|
10229
|
-
let f = await
|
|
10229
|
+
let f = await A();
|
|
10230
10230
|
try {
|
|
10231
|
-
let n = await
|
|
10231
|
+
let n = await P("set", O ? w(i) : void 0, u, f, i);
|
|
10232
10232
|
if (n !== null) return n;
|
|
10233
10233
|
let r = nf({
|
|
10234
10234
|
bindRef: c,
|
|
@@ -10237,9 +10237,9 @@ function hf(e, n = {}) {
|
|
|
10237
10237
|
allowKeys: d,
|
|
10238
10238
|
snapshots: g,
|
|
10239
10239
|
maxSnapshots: _,
|
|
10240
|
-
audit:
|
|
10240
|
+
audit: N,
|
|
10241
10241
|
op: "draft_commit",
|
|
10242
|
-
onWrite:
|
|
10242
|
+
onWrite: M,
|
|
10243
10243
|
internalAfterWrite: a,
|
|
10244
10244
|
protectedCtx: h,
|
|
10245
10245
|
hashFn: k
|
|
@@ -10253,9 +10253,9 @@ function hf(e, n = {}) {
|
|
|
10253
10253
|
description: "把 draft_write 累积的草稿合并 + JSON.parse + 乐观锁 + schema 校验,原子提交主数据(任一步失败不写,草稿保留可修后重试;成功清草稿 + 自动快照可回退)。仅大 JSON 从零生成用;小改用 write。",
|
|
10254
10254
|
schema: t.object({ draftId: t.string().describe("要提交的草稿标识(对应 draft_write 的 draftId)") })
|
|
10255
10255
|
});
|
|
10256
|
-
|
|
10256
|
+
F(l), me.push(i, l);
|
|
10257
10257
|
}
|
|
10258
|
-
let
|
|
10258
|
+
let z = [];
|
|
10259
10259
|
if (e.resources?.length && p) {
|
|
10260
10260
|
let e = s(async ({ path: e, handle: t }) => {
|
|
10261
10261
|
let n = e;
|
|
@@ -10325,9 +10325,9 @@ function hf(e, n = {}) {
|
|
|
10325
10325
|
details: oi(n.error.issues)
|
|
10326
10326
|
});
|
|
10327
10327
|
}
|
|
10328
|
-
let l = await
|
|
10328
|
+
let l = await A();
|
|
10329
10329
|
try {
|
|
10330
|
-
p.update(i, t), Ec(c, i, t), T(k(), r),
|
|
10330
|
+
p.update(i, t), Ec(c, i, t), T(k(), r), M();
|
|
10331
10331
|
} finally {
|
|
10332
10332
|
l.release();
|
|
10333
10333
|
}
|
|
@@ -10341,7 +10341,7 @@ function hf(e, n = {}) {
|
|
|
10341
10341
|
value: t.unknown().describe("新值(需符合字段 schema 类型)")
|
|
10342
10342
|
})
|
|
10343
10343
|
});
|
|
10344
|
-
|
|
10344
|
+
F(n);
|
|
10345
10345
|
let r = s(async () => {
|
|
10346
10346
|
let e = p.list();
|
|
10347
10347
|
if (!e.length) {
|
|
@@ -10372,22 +10372,22 @@ function hf(e, n = {}) {
|
|
|
10372
10372
|
handle: t.string().optional().describe("占位符句柄(与 path 二选一)")
|
|
10373
10373
|
})
|
|
10374
10374
|
});
|
|
10375
|
-
|
|
10375
|
+
F(i), z.push(e, n, r, i);
|
|
10376
10376
|
}
|
|
10377
|
-
let
|
|
10378
|
-
F,
|
|
10379
|
-
le,
|
|
10377
|
+
let B = [
|
|
10380
10378
|
I,
|
|
10379
|
+
ce,
|
|
10381
10380
|
L,
|
|
10381
|
+
R,
|
|
10382
|
+
le,
|
|
10382
10383
|
ue,
|
|
10383
10384
|
de,
|
|
10384
10385
|
fe,
|
|
10385
10386
|
pe,
|
|
10386
|
-
me,
|
|
10387
|
-
...
|
|
10388
|
-
...R
|
|
10387
|
+
...me,
|
|
10388
|
+
...z
|
|
10389
10389
|
];
|
|
10390
|
-
function
|
|
10390
|
+
function V(e) {
|
|
10391
10391
|
let t = e, n = (e) => {
|
|
10392
10392
|
if (e === void 0) return "undefined";
|
|
10393
10393
|
let t = $(e, 200);
|
|
@@ -10481,23 +10481,23 @@ function hf(e, n = {}) {
|
|
|
10481
10481
|
}]
|
|
10482
10482
|
};
|
|
10483
10483
|
}
|
|
10484
|
-
Object.defineProperty(
|
|
10485
|
-
value:
|
|
10484
|
+
Object.defineProperty(B, "controller", {
|
|
10485
|
+
value: oe,
|
|
10486
10486
|
enumerable: !1,
|
|
10487
10487
|
configurable: !1,
|
|
10488
10488
|
writable: !1
|
|
10489
|
-
}), Object.defineProperty(
|
|
10490
|
-
value:
|
|
10489
|
+
}), Object.defineProperty(B, "previewWrite", {
|
|
10490
|
+
value: V,
|
|
10491
10491
|
enumerable: !1,
|
|
10492
10492
|
configurable: !1,
|
|
10493
10493
|
writable: !1
|
|
10494
10494
|
});
|
|
10495
|
-
for (let e of
|
|
10495
|
+
for (let e of B) Object.defineProperty(e, "__dataOpsScoped", {
|
|
10496
10496
|
value: !0,
|
|
10497
10497
|
enumerable: !1,
|
|
10498
10498
|
configurable: !1
|
|
10499
10499
|
});
|
|
10500
|
-
return
|
|
10500
|
+
return B;
|
|
10501
10501
|
}
|
|
10502
10502
|
//#endregion
|
|
10503
10503
|
//#region src/core/tools/htmlValidate.ts
|
|
@@ -12094,7 +12094,7 @@ function Vp(e) {
|
|
|
12094
12094
|
//#endregion
|
|
12095
12095
|
//#region src/core/sdk/conflictManager.ts
|
|
12096
12096
|
function Hp(e, t, n) {
|
|
12097
|
-
let r = /* @__PURE__ */
|
|
12097
|
+
let r = /* @__PURE__ */ Gt(null), i = 0;
|
|
12098
12098
|
function a(a, o) {
|
|
12099
12099
|
let s = t?.() ?? "ask";
|
|
12100
12100
|
if (s !== "ask") {
|
|
@@ -15092,7 +15092,7 @@ function J_(e, t, n, r) {
|
|
|
15092
15092
|
}), i;
|
|
15093
15093
|
},
|
|
15094
15094
|
afterModel: (t) => {
|
|
15095
|
-
let n =
|
|
15095
|
+
let n = re(t.message);
|
|
15096
15096
|
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
15097
|
type: "usage",
|
|
15098
15098
|
round: i,
|
|
@@ -15136,7 +15136,7 @@ function X_(e, n, r) {
|
|
|
15136
15136
|
prompt_tokens: 0,
|
|
15137
15137
|
completion_tokens: 0,
|
|
15138
15138
|
total_tokens: 0
|
|
15139
|
-
}, o = Hp(() =>
|
|
15139
|
+
}, o = Hp(() => Y, () => e.conflictPolicy ?? "ask", () => X.agent?.debugLogs?.value), c = /* @__PURE__ */ Gt(0), l = _m(e.storage);
|
|
15140
15140
|
l && (e.debug && l.onEvent((e) => console.log("[page-agent-sdk][storage]", e)), l.onEvent((e) => {
|
|
15141
15141
|
e.type === "quota" && X.agent?.debugLogs?.value?.push({
|
|
15142
15142
|
timestamp: Date.now(),
|
|
@@ -15156,9 +15156,9 @@ function X_(e, n, r) {
|
|
|
15156
15156
|
}
|
|
15157
15157
|
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
15158
|
e.debug && !d && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
15159
|
-
let w = /* @__PURE__ */
|
|
15159
|
+
let w = /* @__PURE__ */ Pt([]), T = xd(e.vfs?.initialFiles, {
|
|
15160
15160
|
persist: l ? { save: (e) => {
|
|
15161
|
-
|
|
15161
|
+
vn.persistSave({ vfs: e });
|
|
15162
15162
|
} } : void 0,
|
|
15163
15163
|
maxBytes: e.vfs?.maxBytes,
|
|
15164
15164
|
poolBytes: e.vfs?.poolBytes
|
|
@@ -15177,16 +15177,16 @@ function X_(e, n, r) {
|
|
|
15177
15177
|
type: "middleware",
|
|
15178
15178
|
data: { stage: "resume_notice" }
|
|
15179
15179
|
});
|
|
15180
|
-
}), ne = Dm(),
|
|
15181
|
-
|
|
15180
|
+
}), 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) => {
|
|
15181
|
+
Y({
|
|
15182
15182
|
type: "error",
|
|
15183
15183
|
message: `确认请求(${e.toolName})${Math.round(e.waitedMs / 1e3)}s 无响应已自动拒绝 —— 当前路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
15184
15184
|
severity: "observable",
|
|
15185
15185
|
code: "APPROVAL_AUTO_REJECTED",
|
|
15186
15186
|
context: e
|
|
15187
15187
|
});
|
|
15188
|
-
},
|
|
15189
|
-
ne.lastPlanConfirmation = e,
|
|
15188
|
+
}, ae = wu((e) => {
|
|
15189
|
+
ne.lastPlanConfirmation = e, vn.persistSave({ planConfirmation: e }), X.agent?.debugLogs?.value?.push({
|
|
15190
15190
|
timestamp: Date.now(),
|
|
15191
15191
|
type: "middleware",
|
|
15192
15192
|
data: {
|
|
@@ -15196,69 +15196,69 @@ function X_(e, n, r) {
|
|
|
15196
15196
|
}
|
|
15197
15197
|
});
|
|
15198
15198
|
}, {
|
|
15199
|
-
timeoutMs:
|
|
15200
|
-
onAutoReject:
|
|
15201
|
-
}),
|
|
15202
|
-
getSchema: () =>
|
|
15203
|
-
getBind: () =>
|
|
15204
|
-
onChange: (e) =>
|
|
15199
|
+
timeoutMs: re,
|
|
15200
|
+
onAutoReject: ie
|
|
15201
|
+
}), j = Zc({
|
|
15202
|
+
getSchema: () => W()?.schema,
|
|
15203
|
+
getBind: () => W()?.bind,
|
|
15204
|
+
onChange: (e) => Y({
|
|
15205
15205
|
type: "focus_change",
|
|
15206
15206
|
focuses: e
|
|
15207
15207
|
})
|
|
15208
|
-
}),
|
|
15209
|
-
let t = Yc(
|
|
15208
|
+
}), M = (e) => {
|
|
15209
|
+
let t = Yc(W()?.bind, e.path);
|
|
15210
15210
|
return t ? {
|
|
15211
15211
|
...e,
|
|
15212
15212
|
pgId: t
|
|
15213
15213
|
} : e;
|
|
15214
|
-
},
|
|
15215
|
-
typeof e.memory == "function" &&
|
|
15216
|
-
let
|
|
15214
|
+
}, oe = fu(), N = pu(e.memory || "");
|
|
15215
|
+
typeof e.memory == "function" && N.refresh();
|
|
15216
|
+
let se = { current: null }, P = e.data ? {
|
|
15217
15217
|
...e.data,
|
|
15218
15218
|
description: e.data.description ?? "主数据对象"
|
|
15219
|
-
} : void 0,
|
|
15220
|
-
|
|
15221
|
-
let
|
|
15222
|
-
for (let e of
|
|
15219
|
+
} : void 0, F = !(e.subagents ?? []).some((e) => e._codeAsset) && bm(e.capabilities).subagent, I = e.subagents;
|
|
15220
|
+
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(...)"));
|
|
15221
|
+
let ce = (I ?? []).filter((e) => !!e._codeAsset), L = /* @__PURE__ */ new Set();
|
|
15222
|
+
for (let e of ce) {
|
|
15223
15223
|
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'])"),
|
|
15224
|
+
let t = Js(P?.schema, e._codeAsset.codeField);
|
|
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'])"), L.add(e));
|
|
15226
15226
|
}
|
|
15227
|
-
let
|
|
15228
|
-
getData: () =>
|
|
15229
|
-
consumeDataDirty: () =>
|
|
15230
|
-
slotPaths:
|
|
15227
|
+
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({
|
|
15228
|
+
getData: () => W()?.bind,
|
|
15229
|
+
consumeDataDirty: () => U?.consumeDataDirty?.() ?? !0,
|
|
15230
|
+
slotPaths: P ? [""] : [],
|
|
15231
15231
|
vfsStore: T,
|
|
15232
15232
|
todosMw: D,
|
|
15233
|
-
getTodos: () =>
|
|
15233
|
+
getTodos: () => se.current?.getState?.()?.todos ?? [],
|
|
15234
15234
|
messages: w,
|
|
15235
|
-
maxCheckpoints:
|
|
15236
|
-
}) : null,
|
|
15235
|
+
maxCheckpoints: pe && typeof pe == "object" ? pe.maxCheckpoints : void 0
|
|
15236
|
+
}) : 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
15237
|
...e,
|
|
15238
15238
|
locale: e.i18n?.locale,
|
|
15239
|
-
dataOps:
|
|
15240
|
-
domInspect:
|
|
15241
|
-
screenshot:
|
|
15239
|
+
dataOps: he && !!P,
|
|
15240
|
+
domInspect: V.domInspect === !0,
|
|
15241
|
+
screenshot: ve
|
|
15242
15242
|
});
|
|
15243
|
-
if (
|
|
15244
|
-
let e =
|
|
15245
|
-
e && (
|
|
15246
|
-
} else
|
|
15247
|
-
let
|
|
15243
|
+
if (ue) {
|
|
15244
|
+
let e = R.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
|
|
15245
|
+
e && (ye += "\n\n" + e);
|
|
15246
|
+
} 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;若确为降级意图可忽略。"));
|
|
15247
|
+
let H = he && P ? hf(P, {
|
|
15248
15248
|
onAudit: e.onAudit ?? (e.debug ? (e) => console.log("[page-agent-sdk][data audit]", e) : void 0),
|
|
15249
15249
|
maxSnapshots: e.maxSnapshots,
|
|
15250
15250
|
onConflict: o.set,
|
|
15251
15251
|
conflictWatchFields: e.conflictWatchFields,
|
|
15252
15252
|
maxParallelTools: e.maxParallelTools,
|
|
15253
|
-
vfsStore:
|
|
15254
|
-
...
|
|
15255
|
-
...
|
|
15256
|
-
}) : [],
|
|
15257
|
-
getBind: () =>
|
|
15258
|
-
recomputeAll: () =>
|
|
15259
|
-
hasBaselines: () =>
|
|
15260
|
-
isManaged: (e) =>
|
|
15261
|
-
hash: (e) =>
|
|
15253
|
+
vfsStore: ge || P?.resources?.length ? T : void 0,
|
|
15254
|
+
...de.length ? { pgIdPaths: de } : {},
|
|
15255
|
+
...fe.length ? { largeTextPaths: fe } : {}
|
|
15256
|
+
}) : [], 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({
|
|
15257
|
+
getBind: () => W()?.bind,
|
|
15258
|
+
recomputeAll: () => U.recomputeAllBaselines?.(),
|
|
15259
|
+
hasBaselines: () => U.hasBaselines?.() ?? !1,
|
|
15260
|
+
isManaged: (e) => Ce.has(e),
|
|
15261
|
+
hash: (e) => Te ? Fc(Tu(e), Te) : Pc(Tu(e)),
|
|
15262
15262
|
log: (e, t) => {
|
|
15263
15263
|
let n = X.agent?.debugLogs;
|
|
15264
15264
|
n && (n.value.push({
|
|
@@ -15270,27 +15270,27 @@ function X_(e, n, r) {
|
|
|
15270
15270
|
}
|
|
15271
15271
|
}), Jt(n));
|
|
15272
15272
|
}
|
|
15273
|
-
}) : void 0,
|
|
15274
|
-
|
|
15275
|
-
let
|
|
15273
|
+
}) : void 0, Ee = /* @__PURE__ */ new Map();
|
|
15274
|
+
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 生效)");
|
|
15275
|
+
let De = [], Oe = (e) => {
|
|
15276
15276
|
if (e.type === "tool_result" && e.name === "take_screenshot") {
|
|
15277
|
-
let t =
|
|
15277
|
+
let t = De.find((e) => !e.eventConsumed);
|
|
15278
15278
|
if (t) return t.eventConsumed = !0, Object.assign(e, { image: {
|
|
15279
15279
|
dataUri: t.image.dataUri,
|
|
15280
15280
|
vfsRef: t.meta.vfsRef
|
|
15281
15281
|
} });
|
|
15282
15282
|
}
|
|
15283
15283
|
return e;
|
|
15284
|
-
},
|
|
15284
|
+
}, ke = g.vision === !0 || typeof e.images?.describe == "function" ? sg({
|
|
15285
15285
|
getVision: () => g.vision === !0,
|
|
15286
15286
|
describe: e.images?.describe,
|
|
15287
15287
|
onShot: (e, t) => {
|
|
15288
|
-
|
|
15288
|
+
De.push({
|
|
15289
15289
|
image: e,
|
|
15290
15290
|
meta: t
|
|
15291
15291
|
});
|
|
15292
15292
|
}
|
|
15293
|
-
}) : void 0,
|
|
15293
|
+
}) : void 0, Ae = ve ? ag({
|
|
15294
15294
|
render: e.screenshot?.renderer,
|
|
15295
15295
|
getActiveFocus: () => X.getFocus(),
|
|
15296
15296
|
focusSelector: e.screenshot?.focusSelector,
|
|
@@ -15308,24 +15308,24 @@ function X_(e, n, r) {
|
|
|
15308
15308
|
getVision: () => g.vision === !0,
|
|
15309
15309
|
describe: e.images?.describe,
|
|
15310
15310
|
onShot: (e, t) => {
|
|
15311
|
-
|
|
15311
|
+
De.push({
|
|
15312
15312
|
image: e,
|
|
15313
15313
|
meta: t
|
|
15314
15314
|
});
|
|
15315
15315
|
}
|
|
15316
|
-
}) : void 0,
|
|
15316
|
+
}) : void 0, je = !Ap(e.llm) && (e.llm.provider ?? "openai") === "anthropic" ? "anthropic" : "openai", Me = Ae || ke ? {
|
|
15317
15317
|
name: "screenshotChannel",
|
|
15318
15318
|
wrapModelCall: async (e, t) => {
|
|
15319
|
-
if (
|
|
15320
|
-
let t =
|
|
15319
|
+
if (De.length) {
|
|
15320
|
+
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
15321
|
dataUri: e.image.dataUri,
|
|
15322
15322
|
url: e.image.url
|
|
15323
|
-
})),
|
|
15323
|
+
})), je);
|
|
15324
15324
|
n && e.messages.push(new i({ content: n }));
|
|
15325
15325
|
}
|
|
15326
15326
|
return t(e);
|
|
15327
15327
|
}
|
|
15328
|
-
} : null,
|
|
15328
|
+
} : null, Ne = !1, Pe = V.domEdit ? bg({
|
|
15329
15329
|
onEdit: (e) => {
|
|
15330
15330
|
X.agent?.debugLogs?.value?.push({
|
|
15331
15331
|
timestamp: Date.now(),
|
|
@@ -15336,22 +15336,22 @@ function X_(e, n, r) {
|
|
|
15336
15336
|
applied: e.applied,
|
|
15337
15337
|
dryRun: e.dryRun
|
|
15338
15338
|
}
|
|
15339
|
-
}), !e.dryRun && e.applied > 0 && (
|
|
15339
|
+
}), !e.dryRun && e.applied > 0 && (Ne = !0);
|
|
15340
15340
|
},
|
|
15341
15341
|
onRestore: (e) => {
|
|
15342
|
-
e.restored > 0 && (
|
|
15342
|
+
e.restored > 0 && (Ne = !0);
|
|
15343
15343
|
}
|
|
15344
|
-
}) : [],
|
|
15344
|
+
}) : [], Fe = [...E_(V, be, Lg, V.domInspect ? [
|
|
15345
15345
|
...Yg,
|
|
15346
|
-
...
|
|
15347
|
-
...
|
|
15348
|
-
...
|
|
15349
|
-
] : [], v_), ...
|
|
15350
|
-
|
|
15351
|
-
let
|
|
15346
|
+
...Pe,
|
|
15347
|
+
...Ae ? [Ae] : [],
|
|
15348
|
+
...V.skills ? [] : [a_, o_]
|
|
15349
|
+
] : [], v_), ...ke ? [ke] : []];
|
|
15350
|
+
ke && Ee.set("view_image", "builtin"), Fe.forEach((e) => Ee.set(e.name, "builtin"));
|
|
15351
|
+
let Ie = e.proposals ? Fg(e.proposals, {
|
|
15352
15352
|
emit: (e) => {
|
|
15353
15353
|
try {
|
|
15354
|
-
|
|
15354
|
+
Y(e);
|
|
15355
15355
|
} catch {}
|
|
15356
15356
|
},
|
|
15357
15357
|
log: (e, t) => {
|
|
@@ -15365,31 +15365,31 @@ function X_(e, n, r) {
|
|
|
15365
15365
|
}
|
|
15366
15366
|
});
|
|
15367
15367
|
}
|
|
15368
|
-
}) : null,
|
|
15369
|
-
|
|
15370
|
-
let
|
|
15371
|
-
|
|
15372
|
-
let
|
|
15373
|
-
|
|
15374
|
-
let
|
|
15375
|
-
let e =
|
|
15376
|
-
return e.length ?
|
|
15368
|
+
}) : null, Le = [...e.tools || [], ...Ie?.tools ?? []];
|
|
15369
|
+
Le.forEach((e) => Ee.set(e.name, "user"));
|
|
15370
|
+
let Re = x_(e.actions ?? {});
|
|
15371
|
+
Re.forEach((e) => Ee.set(e.name, "action"));
|
|
15372
|
+
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;
|
|
15373
|
+
Ke && Ee.set(xu, "builtin");
|
|
15374
|
+
let qe = me && z ? [s(async () => {
|
|
15375
|
+
let e = z.list();
|
|
15376
|
+
return e.length ? z.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
|
|
15377
15377
|
}, {
|
|
15378
15378
|
name: "restore_last_checkpoint",
|
|
15379
15379
|
description: "回退到最近一次正常状态(整体还原对话历史 + 主数据 + vfs + todos)。当本轮操作出错、页面被改坏、或走偏时调用,回到本轮起点重新来过。不传参数即回退最近一次。",
|
|
15380
15380
|
schema: t.object({}).optional()
|
|
15381
15381
|
}), s(async () => {
|
|
15382
|
-
let e =
|
|
15382
|
+
let e = z.list();
|
|
15383
15383
|
return e.length ? "可用 checkpoint:\n" + e.map((e) => `#${e.id} [${e.label ?? "auto"}] 消息数=${e.messageCount} 时间=${new Date(e.timestamp).toLocaleTimeString()}`).join("\n") : "无可用 checkpoint。";
|
|
15384
15384
|
}, {
|
|
15385
15385
|
name: "list_checkpoints",
|
|
15386
15386
|
description: "列出可用会话 checkpoint(回退点)。",
|
|
15387
15387
|
schema: t.object({}).optional()
|
|
15388
15388
|
})] : [];
|
|
15389
|
-
|
|
15390
|
-
let
|
|
15391
|
-
let n =
|
|
15392
|
-
return n ? Is(n, e) ? (
|
|
15389
|
+
qe.forEach((e) => Ee.set(e.name, "builtin"));
|
|
15390
|
+
let Je = V.focus, Ye = s(async ({ path: e, label: t }) => {
|
|
15391
|
+
let n = W()?.schema;
|
|
15392
|
+
return n ? Is(n, e) ? (j.setFocus(M({
|
|
15393
15393
|
path: e,
|
|
15394
15394
|
...t ? { label: t } : {}
|
|
15395
15395
|
}), "agent"), `已聚焦到 ${e}${t ? `(${t})` : ""}。后续仅可写该子树(越界被拒),每轮只看到该组件结构。完成精修后调 clear_focus 退出。`) : `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。` : "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
@@ -15400,19 +15400,19 @@ function X_(e, n, r) {
|
|
|
15400
15400
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
15401
15401
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
15402
15402
|
})
|
|
15403
|
-
}),
|
|
15403
|
+
}), Xe = s(async () => (j.clearFocus("agent"), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
15404
15404
|
name: "clear_focus",
|
|
15405
15405
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
15406
15406
|
schema: t.object({}).optional()
|
|
15407
|
-
}),
|
|
15408
|
-
let n =
|
|
15407
|
+
}), Ze = s(async ({ path: e, label: t }) => {
|
|
15408
|
+
let n = W()?.schema;
|
|
15409
15409
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
15410
15410
|
if (!Is(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
15411
|
-
|
|
15411
|
+
j.addFocus(M({
|
|
15412
15412
|
path: e,
|
|
15413
15413
|
...t ? { label: t } : {}
|
|
15414
15414
|
}), "agent");
|
|
15415
|
-
let r =
|
|
15415
|
+
let r = j.getFocuses();
|
|
15416
15416
|
return `已聚焦 ${e}${t ? `(${t})` : ""}(当前共 ${r.length} 个焦点:${r.map((e) => e.path).join(", ")})。后续仅可写这些子树之一(越界被拒)。`;
|
|
15417
15417
|
}, {
|
|
15418
15418
|
name: "add_focus",
|
|
@@ -15421,72 +15421,72 @@ function X_(e, n, r) {
|
|
|
15421
15421
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
15422
15422
|
label: t.string().optional().describe("人类可读标签")
|
|
15423
15423
|
})
|
|
15424
|
-
}),
|
|
15425
|
-
let t =
|
|
15426
|
-
|
|
15427
|
-
let n =
|
|
15424
|
+
}), Qe = s(async ({ path: e }) => {
|
|
15425
|
+
let t = j.getFocuses().length;
|
|
15426
|
+
j.removeFocus(e, "agent");
|
|
15427
|
+
let n = j.getFocuses();
|
|
15428
15428
|
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
15429
|
}, {
|
|
15430
15430
|
name: "remove_focus",
|
|
15431
15431
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
15432
15432
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
15433
|
-
}),
|
|
15433
|
+
}), $e = Je ? [
|
|
15434
|
+
Ye,
|
|
15434
15435
|
Xe,
|
|
15435
15436
|
Ze,
|
|
15436
|
-
Qe
|
|
15437
|
-
$e
|
|
15437
|
+
Qe
|
|
15438
15438
|
] : [];
|
|
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
|
|
15439
|
+
$e.forEach((e) => Ee.set(e.name, "builtin"));
|
|
15440
|
+
let et = [], tt = /* @__PURE__ */ new Map(), nt = jm({
|
|
15441
|
+
builtinTools: () => Fe,
|
|
15442
|
+
userTools: () => Le,
|
|
15443
|
+
actionTools: () => Re,
|
|
15444
|
+
humanConfirmTool: () => Ke,
|
|
15445
|
+
checkpointTools: () => qe,
|
|
15446
|
+
focusTools: () => $e,
|
|
15447
|
+
mcpTools: () => Ue,
|
|
15448
|
+
loadedSkillTools: () => et
|
|
15449
|
+
}), K = nt(), rt = V.planning, it = V.missionAnchor, at = V.workingMemory, ot = V.skills, st = V.vfs || ue;
|
|
15450
|
+
if (st) for (let e of Dd) Ee.set(e, "builtin");
|
|
15451
|
+
if (rt) for (let e of D.tools ?? []) Ee.set(e.name, "builtin");
|
|
15452
|
+
let ct = V.summarization, lt = V.agentCompression && !!m;
|
|
15453
|
+
e.debug && V.agentCompression && !m && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
15454
|
+
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;
|
|
15455
|
+
mt && !gt && e.verify?.enabled !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
|
|
15456
|
+
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
15457
|
...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:
|
|
15458
|
+
timeoutMs: e.approval.timeoutMs ?? re,
|
|
15459
|
+
onAutoReject: ie,
|
|
15460
|
+
previewWrite: St
|
|
15461
|
+
}) : void 0, wt = [
|
|
15462
|
+
...bt ? [bt] : [],
|
|
15463
|
+
...Ct ? [Ct] : [],
|
|
15464
|
+
...G ? [G] : []
|
|
15465
|
+
], Tt = !dt || vt?.enabled === !1 ? void 0 : iu({
|
|
15466
|
+
llm: vt?.llm ?? e.llm,
|
|
15467
|
+
allTools: () => X.agent?.allTools ?? K,
|
|
15468
|
+
allowedTools: yt.length ? yt : void 0,
|
|
15469
15469
|
...e.staleReadInvalidation === void 0 ? {} : { staleReadInvalidation: e.staleReadInvalidation },
|
|
15470
|
-
systemPrompt:
|
|
15471
|
-
temperature:
|
|
15472
|
-
maxTokens:
|
|
15473
|
-
skills:
|
|
15474
|
-
maxDepth:
|
|
15475
|
-
maxParallel:
|
|
15476
|
-
thinkingMode:
|
|
15470
|
+
systemPrompt: vt?.systemPrompt,
|
|
15471
|
+
temperature: vt?.temperature,
|
|
15472
|
+
maxTokens: vt?.maxTokens,
|
|
15473
|
+
skills: vt?.skills,
|
|
15474
|
+
maxDepth: vt?.maxDepth,
|
|
15475
|
+
maxParallel: vt?.maxParallel,
|
|
15476
|
+
thinkingMode: vt?.thinkingMode,
|
|
15477
15477
|
debug: e.debug,
|
|
15478
|
-
getFocuses: () =>
|
|
15479
|
-
getSchema: () =>
|
|
15480
|
-
tracker:
|
|
15481
|
-
guardMiddleware:
|
|
15482
|
-
getVfsFiles:
|
|
15483
|
-
enterDataScope:
|
|
15484
|
-
exitDataScope:
|
|
15478
|
+
getFocuses: () => j.getActiveFocuses(),
|
|
15479
|
+
getSchema: () => W()?.schema ?? null,
|
|
15480
|
+
tracker: ft,
|
|
15481
|
+
guardMiddleware: wt.length ? wt : void 0,
|
|
15482
|
+
getVfsFiles: st ? () => T.files : void 0,
|
|
15483
|
+
enterDataScope: U?.enterScope ? (e) => U.enterScope(e) : void 0,
|
|
15484
|
+
exitDataScope: U?.exitScope ? (e) => U.exitScope(e) : void 0,
|
|
15485
15485
|
onUsage: (e) => {
|
|
15486
15486
|
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
15487
|
},
|
|
15488
|
-
timeoutMs:
|
|
15489
|
-
}),
|
|
15488
|
+
timeoutMs: vt?.timeoutMs
|
|
15489
|
+
}), Et = le?.map((e) => {
|
|
15490
15490
|
if (!e._codeAsset) return e;
|
|
15491
15491
|
let t = e._codeAsset, n = Nf({
|
|
15492
15492
|
writablePaths: t.writablePaths,
|
|
@@ -15495,95 +15495,95 @@ function X_(e, n, r) {
|
|
|
15495
15495
|
codeField: t.codeField,
|
|
15496
15496
|
craftNotes: t.craftNotes,
|
|
15497
15497
|
onWarning: (e) => console.warn(`[page-agent-sdk][code-asset] ${e}`),
|
|
15498
|
-
getController: () =>
|
|
15498
|
+
getController: () => U,
|
|
15499
15499
|
vfsStore: T
|
|
15500
15500
|
}), r = [...e.middleware ?? [], n];
|
|
15501
|
-
for (let e of r) e && os(e) && e._setGetController(() =>
|
|
15501
|
+
for (let e of r) e && os(e) && e._setGetController(() => U);
|
|
15502
15502
|
return {
|
|
15503
15503
|
...e,
|
|
15504
15504
|
middleware: r
|
|
15505
15505
|
};
|
|
15506
|
-
}),
|
|
15507
|
-
getBind: () =>
|
|
15508
|
-
writablePaths:
|
|
15509
|
-
getLocked: () =>
|
|
15510
|
-
tools:
|
|
15511
|
-
getCodeFieldPaths: () => zf(
|
|
15506
|
+
}), Dt = ue && dt ? Pf() : void 0, Ot = Dt ? Vf({
|
|
15507
|
+
getBind: () => W()?.bind,
|
|
15508
|
+
writablePaths: de,
|
|
15509
|
+
getLocked: () => Dt.locked(),
|
|
15510
|
+
tools: K,
|
|
15511
|
+
getCodeFieldPaths: () => zf(W()?.bind, R.map((e) => ({
|
|
15512
15512
|
writablePaths: e._codeAsset.writablePaths,
|
|
15513
15513
|
codeField: e._codeAsset.codeField
|
|
15514
15514
|
})))
|
|
15515
|
-
}) : void 0,
|
|
15516
|
-
getSummarizedPaths: () =>
|
|
15517
|
-
clearSummarizedPaths: () =>
|
|
15518
|
-
}) : void 0,
|
|
15515
|
+
}) : void 0, kt = U?.getSummarizedPaths && U.clearSummarizedPaths ? Wf({
|
|
15516
|
+
getSummarizedPaths: () => U.getSummarizedPaths(),
|
|
15517
|
+
clearSummarizedPaths: () => U.clearSummarizedPaths()
|
|
15518
|
+
}) : void 0, At = dt && Et !== void 0 ? su(Et, {
|
|
15519
15519
|
llm: e.llm,
|
|
15520
15520
|
thinkingModeDefault: e.subagent?.thinkingMode,
|
|
15521
15521
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
15522
|
-
allTools: () => X.agent?.allTools ??
|
|
15522
|
+
allTools: () => X.agent?.allTools ?? K,
|
|
15523
15523
|
debug: e.debug,
|
|
15524
|
-
getFocuses: () =>
|
|
15525
|
-
getSchema: () =>
|
|
15526
|
-
getBind: () =>
|
|
15527
|
-
tracker:
|
|
15528
|
-
guardMiddleware:
|
|
15529
|
-
getVfsFiles:
|
|
15530
|
-
enterDataScope:
|
|
15531
|
-
exitDataScope:
|
|
15524
|
+
getFocuses: () => j.getActiveFocuses(),
|
|
15525
|
+
getSchema: () => W()?.schema ?? null,
|
|
15526
|
+
getBind: () => W()?.bind,
|
|
15527
|
+
tracker: ft,
|
|
15528
|
+
guardMiddleware: wt.length ? wt : void 0,
|
|
15529
|
+
getVfsFiles: st ? () => T.files : void 0,
|
|
15530
|
+
enterDataScope: U?.enterScope ? (e) => U.enterScope(e) : void 0,
|
|
15531
|
+
exitDataScope: U?.exitScope ? (e) => U.exitScope(e) : void 0,
|
|
15532
15532
|
onUsage: (e) => {
|
|
15533
15533
|
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
15534
|
},
|
|
15535
15535
|
timeoutMs: e.subagent?.timeoutMs,
|
|
15536
|
-
...
|
|
15537
|
-
componentLock:
|
|
15538
|
-
resolveComponents: (e) => Ff(e, kf(
|
|
15536
|
+
...Dt ? {
|
|
15537
|
+
componentLock: Dt,
|
|
15538
|
+
resolveComponents: (e) => Ff(e, kf(W()?.bind, de))
|
|
15539
15539
|
} : {}
|
|
15540
|
-
}) : void 0,
|
|
15540
|
+
}) : void 0, jt = At ? At.controller : null, Mt = (t) => {
|
|
15541
15541
|
let n = t.thinkingMode ?? e.subagent?.thinkingMode, r = n ? Ap(t.llm ?? e.llm) ? "instance-noop" : "applied" : "inherited";
|
|
15542
15542
|
return {
|
|
15543
15543
|
...t,
|
|
15544
15544
|
...n ? { thinkingMode: n } : {},
|
|
15545
15545
|
thinkingApplied: r
|
|
15546
15546
|
};
|
|
15547
|
-
},
|
|
15547
|
+
}, Nt = ["read", "fetch_document"], Ft = K.filter((e) => Nt.includes(e.name)), It = gt ? Fu({
|
|
15548
15548
|
check: e.verify.check ?? Vu({
|
|
15549
|
-
schemas: () =>
|
|
15550
|
-
root: () =>
|
|
15549
|
+
schemas: () => W() ? { "": W().schema } : {},
|
|
15550
|
+
root: () => W()?.bind
|
|
15551
15551
|
}),
|
|
15552
15552
|
adversarial: e.verify?.adversarial ? {
|
|
15553
15553
|
llm: e.llm,
|
|
15554
|
-
tools:
|
|
15554
|
+
tools: Ft
|
|
15555
15555
|
} : void 0
|
|
15556
|
-
}) : void 0,
|
|
15556
|
+
}) : void 0, Lt = _t ? td({
|
|
15557
15557
|
contextWindow: g.contextWindow,
|
|
15558
15558
|
thresholdRatio: wm(e, g.contextWindow).summaryThresholdRatio
|
|
15559
|
-
}) : void 0,
|
|
15560
|
-
...
|
|
15561
|
-
humanConfirm:
|
|
15562
|
-
screenshot: !!
|
|
15563
|
-
domEdit:
|
|
15559
|
+
}) : void 0, Rt = j_({
|
|
15560
|
+
...V,
|
|
15561
|
+
humanConfirm: Ge,
|
|
15562
|
+
screenshot: !!Ae,
|
|
15563
|
+
domEdit: V.domEdit,
|
|
15564
15564
|
hasActions: !!e.actions && Object.keys(e.actions).length > 0,
|
|
15565
15565
|
hasProposals: !!e.proposals,
|
|
15566
|
-
viewImage: !!
|
|
15567
|
-
subagents:
|
|
15568
|
-
},
|
|
15566
|
+
viewImage: !!ke,
|
|
15567
|
+
subagents: le?.map(Mt)
|
|
15568
|
+
}, he && !!P, { promptSoftCap: Nl(g.contextWindow, y.promptSoftCapTokens) }), zt = V.pageContext ? N_({
|
|
15569
15569
|
getPageInfo: () => typeof document < "u" && typeof location < "u" ? {
|
|
15570
15570
|
title: document.title || "",
|
|
15571
15571
|
url: location.href
|
|
15572
15572
|
} : null,
|
|
15573
|
-
canReadPage:
|
|
15574
|
-
}) : void 0,
|
|
15573
|
+
canReadPage: V.domInspect === !0
|
|
15574
|
+
}) : void 0, q = {
|
|
15575
15575
|
epoch: 0,
|
|
15576
15576
|
notices: [],
|
|
15577
15577
|
readsInvalidated: 0
|
|
15578
|
-
},
|
|
15578
|
+
}, Bt = 0, J = {
|
|
15579
15579
|
name: "hostNotice",
|
|
15580
15580
|
beforeAgent: () => {
|
|
15581
|
-
|
|
15581
|
+
Bt = q.epoch;
|
|
15582
15582
|
},
|
|
15583
15583
|
wrapModelCall: async (e, t) => {
|
|
15584
|
-
if (
|
|
15585
|
-
|
|
15586
|
-
let t = eo(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态",
|
|
15584
|
+
if (Ne) {
|
|
15585
|
+
Ne = !1;
|
|
15586
|
+
let t = eo(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态", Ve);
|
|
15587
15587
|
if (t.invalidatedCount > 0) {
|
|
15588
15588
|
for (let n = 0; n < t.messages.length; n++) e.messages[n] = t.messages[n];
|
|
15589
15589
|
X.agent?.debugLogs?.value?.push({
|
|
@@ -15596,18 +15596,18 @@ function X_(e, n, r) {
|
|
|
15596
15596
|
});
|
|
15597
15597
|
}
|
|
15598
15598
|
}
|
|
15599
|
-
if (
|
|
15600
|
-
|
|
15601
|
-
let t =
|
|
15599
|
+
if (q.epoch > Bt) {
|
|
15600
|
+
Bt = q.epoch;
|
|
15601
|
+
let t = q.notices[q.notices.length - 1] ?? "", n = eo(e.messages, t || void 0, Ve);
|
|
15602
15602
|
if (n.invalidatedCount > 0) {
|
|
15603
15603
|
for (let t = 0; t < n.messages.length; t++) e.messages[t] = n.messages[t];
|
|
15604
|
-
|
|
15604
|
+
q.readsInvalidated += n.invalidatedCount, X.agent?.debugLogs?.value?.push({
|
|
15605
15605
|
timestamp: Date.now(),
|
|
15606
15606
|
type: "middleware",
|
|
15607
15607
|
data: {
|
|
15608
15608
|
stage: "host_read_invalidated",
|
|
15609
15609
|
count: n.invalidatedCount,
|
|
15610
|
-
epoch:
|
|
15610
|
+
epoch: q.epoch,
|
|
15611
15611
|
reason: t || void 0
|
|
15612
15612
|
}
|
|
15613
15613
|
});
|
|
@@ -15615,170 +15615,170 @@ function X_(e, n, r) {
|
|
|
15615
15615
|
}
|
|
15616
15616
|
return t(e);
|
|
15617
15617
|
},
|
|
15618
|
-
augmentPrompt: () =>
|
|
15618
|
+
augmentPrompt: () => q.notices.length ? [
|
|
15619
15619
|
"【宿主页面已变更】",
|
|
15620
|
-
...
|
|
15621
|
-
|
|
15620
|
+
...q.notices.filter(Boolean).map((e) => `· ${e}`),
|
|
15621
|
+
V.domInspect === !0 ? "此前的页面读取/截图结果已过期,回答任何关于当前页面的问题前必须重新 read_page / get_dom 读取当前页面;不要凭此前的读取结果或记忆作答。" : "页面内容可能已变化,断言页面前先核实当前状态;不要凭此前的印象作答。"
|
|
15622
15622
|
].join("\n") : void 0,
|
|
15623
15623
|
afterAgent: () => {
|
|
15624
|
-
|
|
15624
|
+
q.notices.length = 0;
|
|
15625
15625
|
}
|
|
15626
|
-
}, Vt =
|
|
15626
|
+
}, Vt = Ie ? {
|
|
15627
15627
|
name: "proposalNotice",
|
|
15628
|
-
augmentPrompt: () =>
|
|
15628
|
+
augmentPrompt: () => Ie.state.notices.length ? ["【内容提案裁决结果】(以此为准,不要凭提案前状态作答)", ...Ie.state.notices].join("\n") : void 0,
|
|
15629
15629
|
afterAgent: () => {
|
|
15630
|
-
|
|
15630
|
+
Ie.state.notices.length = 0;
|
|
15631
15631
|
}
|
|
15632
|
-
} : null,
|
|
15632
|
+
} : null, Ht = P ? {
|
|
15633
15633
|
name: "dataHint",
|
|
15634
|
-
augmentPrompt: () => gd(
|
|
15635
|
-
} : null,
|
|
15634
|
+
augmentPrompt: () => gd(W(), e.schemaHint) || void 0
|
|
15635
|
+
} : null, Ut = e.augmentSystem ? {
|
|
15636
15636
|
name: "augmentSystem",
|
|
15637
15637
|
augmentPrompt: (t) => {
|
|
15638
15638
|
try {
|
|
15639
15639
|
return e.augmentSystem({
|
|
15640
15640
|
state: t,
|
|
15641
|
-
data:
|
|
15641
|
+
data: W()
|
|
15642
15642
|
});
|
|
15643
15643
|
} catch (t) {
|
|
15644
15644
|
e.debug && console.log("[page-agent-sdk][augmentSystem] 回调抛错,降级跳过:", t.message);
|
|
15645
15645
|
return;
|
|
15646
15646
|
}
|
|
15647
15647
|
}
|
|
15648
|
-
} : null,
|
|
15648
|
+
} : null, Wt = xm(e.onEvent), Y = Wt.emit, Kt, qt = [], Yt = (e) => ({
|
|
15649
15649
|
name: e.name,
|
|
15650
15650
|
description: e.description,
|
|
15651
15651
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
15652
|
-
}),
|
|
15652
|
+
}), Xt = (e) => ({
|
|
15653
15653
|
name: e.name,
|
|
15654
15654
|
description: e.description,
|
|
15655
15655
|
getContent: () => e.content
|
|
15656
|
-
}),
|
|
15656
|
+
}), Zt = e.skillStorage === !1 ? null : z_({
|
|
15657
15657
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
15658
15658
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
15659
|
-
}),
|
|
15660
|
-
let t =
|
|
15659
|
+
}), Qt = () => {
|
|
15660
|
+
let t = Kt ? Kt.controller : null;
|
|
15661
15661
|
if (t) {
|
|
15662
|
-
let n = (e.skills || []).filter((e) => !
|
|
15663
|
-
t.set([...n, ...
|
|
15662
|
+
let n = (e.skills || []).filter((e) => !qt.some((t) => t.name === e.name));
|
|
15663
|
+
t.set([...n, ...qt]);
|
|
15664
15664
|
}
|
|
15665
15665
|
X.infoTick.value++;
|
|
15666
|
-
},
|
|
15667
|
-
if (
|
|
15668
|
-
let t = await
|
|
15666
|
+
}, $t = async () => {
|
|
15667
|
+
if (Zt) try {
|
|
15668
|
+
let t = await Zt.list();
|
|
15669
15669
|
if (t.length) {
|
|
15670
|
-
|
|
15671
|
-
let n =
|
|
15670
|
+
qt = t.map(Xt);
|
|
15671
|
+
let n = Kt ? Kt.controller : null;
|
|
15672
15672
|
if (n) {
|
|
15673
|
-
let t = (e.skills || []).filter((e) => !
|
|
15674
|
-
n.set([...t, ...
|
|
15673
|
+
let t = (e.skills || []).filter((e) => !qt.some((t) => t.name === e.name));
|
|
15674
|
+
n.set([...t, ...qt]);
|
|
15675
15675
|
}
|
|
15676
15676
|
X.infoTick.value++;
|
|
15677
15677
|
}
|
|
15678
15678
|
} catch {}
|
|
15679
|
-
},
|
|
15679
|
+
}, en = ct ? Ll({
|
|
15680
15680
|
...y,
|
|
15681
15681
|
llmInvoke: d,
|
|
15682
|
-
getRegisteredData: () =>
|
|
15682
|
+
getRegisteredData: () => W() ? [{ description: W().description ?? "主数据对象" }] : [],
|
|
15683
15683
|
preserveLastToolResults: x,
|
|
15684
|
-
...
|
|
15684
|
+
...lt ? {
|
|
15685
15685
|
decideInvoke: m,
|
|
15686
|
-
getSnapshot: () =>
|
|
15686
|
+
getSnapshot: () => Lt?.getSnapshot()
|
|
15687
15687
|
} : {}
|
|
15688
|
-
}) : void 0,
|
|
15689
|
-
...
|
|
15690
|
-
withScreenshot: !!
|
|
15691
|
-
withDomEdit:
|
|
15692
|
-
withDataOps:
|
|
15688
|
+
}) : void 0, tn = ot ? fl([
|
|
15689
|
+
...V.domInspect && !(e.skills || []).some((e) => e.name === "dom-inspect") ? [c_({
|
|
15690
|
+
withScreenshot: !!Ae,
|
|
15691
|
+
withDomEdit: V.domEdit,
|
|
15692
|
+
withDataOps: he && !!P
|
|
15693
15693
|
})] : [],
|
|
15694
|
-
...
|
|
15695
|
-
withScreenshot: !!
|
|
15696
|
-
withDomEdit:
|
|
15697
|
-
withVfs:
|
|
15694
|
+
...V.domInspect && !(e.skills || []).some((e) => e.name === "page-analysis") ? [u_({
|
|
15695
|
+
withScreenshot: !!Ae,
|
|
15696
|
+
withDomEdit: V.domEdit,
|
|
15697
|
+
withVfs: st
|
|
15698
15698
|
})] : [],
|
|
15699
15699
|
...e.skills || []
|
|
15700
15700
|
], {
|
|
15701
|
-
readVfs:
|
|
15701
|
+
readVfs: st ? (e) => T.files[e]?.content : void 0,
|
|
15702
15702
|
onToolsReady: (e, t) => {
|
|
15703
15703
|
for (let n of t) {
|
|
15704
|
-
let t =
|
|
15705
|
-
t >= 0 &&
|
|
15704
|
+
let t = et.findIndex((e) => e.name === n.name);
|
|
15705
|
+
t >= 0 && et.splice(t, 1), et.push(n), tt.set(n.name, e), Ee.set(n.name, `skill:${e}`);
|
|
15706
15706
|
}
|
|
15707
|
-
|
|
15707
|
+
K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
15708
15708
|
}
|
|
15709
15709
|
}) : void 0;
|
|
15710
|
-
|
|
15711
|
-
let
|
|
15712
|
-
...
|
|
15713
|
-
|
|
15714
|
-
...
|
|
15715
|
-
|
|
15710
|
+
Kt = tn;
|
|
15711
|
+
let nn = Em([
|
|
15712
|
+
...Ht ? [Ht] : [],
|
|
15713
|
+
Rt,
|
|
15714
|
+
...zt ? [zt] : [],
|
|
15715
|
+
J,
|
|
15716
15716
|
...Vt ? [Vt] : [],
|
|
15717
|
-
...
|
|
15717
|
+
...it ? [O] : [],
|
|
15718
15718
|
ee,
|
|
15719
15719
|
te,
|
|
15720
|
-
...
|
|
15721
|
-
|
|
15722
|
-
...
|
|
15723
|
-
...
|
|
15724
|
-
...
|
|
15725
|
-
...
|
|
15726
|
-
...
|
|
15727
|
-
...
|
|
15728
|
-
...
|
|
15729
|
-
...
|
|
15730
|
-
...
|
|
15731
|
-
...
|
|
15732
|
-
...
|
|
15733
|
-
...
|
|
15734
|
-
...
|
|
15735
|
-
...
|
|
15736
|
-
...Dt ? [Dt] : [],
|
|
15720
|
+
...rt ? [D] : [],
|
|
15721
|
+
...tn ? [tn] : [],
|
|
15722
|
+
...st ? [kd(T)] : [],
|
|
15723
|
+
...en ? [en] : [],
|
|
15724
|
+
...at ? [oe] : [],
|
|
15725
|
+
...Je ? [j] : [],
|
|
15726
|
+
...Se ? [Se] : [],
|
|
15727
|
+
...ut ? [N] : [],
|
|
15728
|
+
...bt ? [bt] : [],
|
|
15729
|
+
...me && B && z ? [Nu(z)] : [],
|
|
15730
|
+
...Ge ? [ae] : [],
|
|
15731
|
+
...Ct ? [Ct] : [],
|
|
15732
|
+
...G ? [G] : [],
|
|
15733
|
+
...It ? [It] : [],
|
|
15734
|
+
...Tt ? [Tt] : [],
|
|
15735
|
+
...At ? [At] : [],
|
|
15737
15736
|
...Ot ? [Ot] : [],
|
|
15738
|
-
...
|
|
15739
|
-
|
|
15740
|
-
|
|
15737
|
+
...kt ? [kt] : [],
|
|
15738
|
+
...U && dt ? [qf({
|
|
15739
|
+
getBind: () => W()?.bind,
|
|
15740
|
+
getTools: () => X.agent?.allTools ?? K
|
|
15741
15741
|
})] : [],
|
|
15742
|
-
...
|
|
15743
|
-
...
|
|
15744
|
-
...
|
|
15742
|
+
...Ut ? [Ut] : [],
|
|
15743
|
+
...Lt ? [Lt] : [],
|
|
15744
|
+
...Me ? [Me] : [],
|
|
15745
15745
|
...e.middleware || [],
|
|
15746
|
-
...
|
|
15746
|
+
..._e ? [y_(a, {
|
|
15747
15747
|
tokenBudget: e.tokenBudget,
|
|
15748
15748
|
timeBudgetMs: e.timeBudgetMs
|
|
15749
|
-
},
|
|
15750
|
-
J_(
|
|
15751
|
-
]),
|
|
15752
|
-
function
|
|
15749
|
+
}, Y)] : [],
|
|
15750
|
+
J_(Y, w, W, a)
|
|
15751
|
+
]), rn = e.maxMemoryRounds ?? W_;
|
|
15752
|
+
function an(e) {
|
|
15753
15753
|
return (e) => {
|
|
15754
|
-
e.type !== "approval_request" &&
|
|
15754
|
+
e.type !== "approval_request" && Y(Oe(e));
|
|
15755
15755
|
};
|
|
15756
15756
|
}
|
|
15757
|
-
let
|
|
15758
|
-
function
|
|
15757
|
+
let on = /* @__PURE__ */ Gt([]), sn = U_(), cn = /* @__PURE__ */ new Set();
|
|
15758
|
+
function ln(e) {
|
|
15759
15759
|
let t = new AbortController(), n = () => t.abort();
|
|
15760
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })),
|
|
15760
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })), cn.add(t), {
|
|
15761
15761
|
controller: t,
|
|
15762
15762
|
untrack: () => {
|
|
15763
|
-
|
|
15763
|
+
cn.delete(t), e?.removeEventListener("abort", n);
|
|
15764
15764
|
}
|
|
15765
15765
|
};
|
|
15766
15766
|
}
|
|
15767
|
-
function
|
|
15768
|
-
for (let e of
|
|
15769
|
-
|
|
15767
|
+
function un() {
|
|
15768
|
+
for (let e of cn) e.abort();
|
|
15769
|
+
cn.clear();
|
|
15770
15770
|
}
|
|
15771
|
-
let
|
|
15771
|
+
let dn = /* @__PURE__ */ Gt(null), X = {
|
|
15772
15772
|
agentId: n,
|
|
15773
15773
|
store: l,
|
|
15774
15774
|
messages: w,
|
|
15775
15775
|
vfsStore: T,
|
|
15776
|
-
listeners:
|
|
15776
|
+
listeners: Wt.listeners,
|
|
15777
15777
|
todosMw: D,
|
|
15778
|
-
memoryMw:
|
|
15778
|
+
memoryMw: N,
|
|
15779
15779
|
missionMw: O,
|
|
15780
|
-
workingMemoryMw:
|
|
15781
|
-
focusMw:
|
|
15780
|
+
workingMemoryMw: oe,
|
|
15781
|
+
focusMw: j,
|
|
15782
15782
|
agent: null,
|
|
15783
15783
|
initDone: Promise.resolve(),
|
|
15784
15784
|
sessionId: "",
|
|
@@ -15786,57 +15786,57 @@ function X_(e, n, r) {
|
|
|
15786
15786
|
mcpClosers: [],
|
|
15787
15787
|
mcpServers: [],
|
|
15788
15788
|
mcpFailed: [],
|
|
15789
|
-
checkpoint:
|
|
15790
|
-
dataOpsController:
|
|
15791
|
-
skillsController:
|
|
15789
|
+
checkpoint: z,
|
|
15790
|
+
dataOpsController: U,
|
|
15791
|
+
skillsController: Kt ? Kt.controller : null,
|
|
15792
15792
|
infoTick: c,
|
|
15793
15793
|
pendingConflict: o.pendingConflict,
|
|
15794
|
-
pendingQuote:
|
|
15795
|
-
sessions:
|
|
15796
|
-
refreshSessions: () =>
|
|
15797
|
-
liveData:
|
|
15794
|
+
pendingQuote: dn,
|
|
15795
|
+
sessions: on,
|
|
15796
|
+
refreshSessions: () => vn.refreshSessions(),
|
|
15797
|
+
liveData: W,
|
|
15798
15798
|
usage: a,
|
|
15799
|
-
emit:
|
|
15800
|
-
runSerial:
|
|
15801
|
-
trackActive:
|
|
15802
|
-
abortAllActive:
|
|
15799
|
+
emit: Y,
|
|
15800
|
+
runSerial: sn,
|
|
15801
|
+
trackActive: ln,
|
|
15802
|
+
abortAllActive: un,
|
|
15803
15803
|
unloadSkillTools(e) {
|
|
15804
15804
|
if (e) {
|
|
15805
|
-
let t =
|
|
15806
|
-
if (
|
|
15805
|
+
let t = et.length;
|
|
15806
|
+
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
15807
|
} else {
|
|
15808
|
-
if (!
|
|
15809
|
-
for (let e of
|
|
15810
|
-
|
|
15808
|
+
if (!et.length) return;
|
|
15809
|
+
for (let e of et) Ee.delete(e.name), tt.delete(e.name);
|
|
15810
|
+
et = [];
|
|
15811
15811
|
}
|
|
15812
|
-
|
|
15812
|
+
K = nt(), X.agent && X.agent.setTools(K);
|
|
15813
15813
|
},
|
|
15814
15814
|
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 &&
|
|
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 && 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
15816
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
15817
15817
|
if (r.length) {
|
|
15818
|
-
let t =
|
|
15819
|
-
if (n.length && (
|
|
15818
|
+
let t = W()?.schema, n = t ? r.filter((e) => Is(t, e.path)) : [];
|
|
15819
|
+
if (n.length && (j.setFocus(null), n.forEach((e) => j.addFocus(M(e)))), e.debug && n.length < r.length) {
|
|
15820
15820
|
let e = r.filter((e) => !n.includes(e)).map((e) => e.path);
|
|
15821
15821
|
console.warn("[page-agent-sdk][focus] 恢复的焦点部分 path 已失效(schema 变化/无 schema),剔除:", e);
|
|
15822
15822
|
}
|
|
15823
15823
|
}
|
|
15824
15824
|
}
|
|
15825
|
-
|
|
15825
|
+
hn();
|
|
15826
15826
|
},
|
|
15827
15827
|
addSkill(e) {
|
|
15828
|
-
let t =
|
|
15829
|
-
t >= 0 ?
|
|
15828
|
+
let t = qt.findIndex((t) => t.name === e.name);
|
|
15829
|
+
t >= 0 ? qt[t] = e : qt.push(e), Qt(), Zt && Zt.put(Yt(e));
|
|
15830
15830
|
},
|
|
15831
15831
|
removeSkill(e) {
|
|
15832
|
-
let t =
|
|
15833
|
-
return t < 0 ? !1 : (
|
|
15832
|
+
let t = qt.findIndex((t) => t.name === e);
|
|
15833
|
+
return t < 0 ? !1 : (qt.splice(t, 1), Qt(), Zt && Zt.remove(e), !0);
|
|
15834
15834
|
},
|
|
15835
15835
|
listUserSkills() {
|
|
15836
|
-
return
|
|
15836
|
+
return qt.map((e) => e.name);
|
|
15837
15837
|
},
|
|
15838
15838
|
getUserSkill(e) {
|
|
15839
|
-
let t =
|
|
15839
|
+
let t = qt.find((t) => t.name === e);
|
|
15840
15840
|
if (t) return {
|
|
15841
15841
|
name: t.name,
|
|
15842
15842
|
description: t.description,
|
|
@@ -15844,7 +15844,7 @@ function X_(e, n, r) {
|
|
|
15844
15844
|
};
|
|
15845
15845
|
},
|
|
15846
15846
|
afterRound() {
|
|
15847
|
-
|
|
15847
|
+
gn(), vn.persistRuntime();
|
|
15848
15848
|
},
|
|
15849
15849
|
clearCodeReuse() {
|
|
15850
15850
|
let e = T;
|
|
@@ -15852,12 +15852,12 @@ function X_(e, n, r) {
|
|
|
15852
15852
|
},
|
|
15853
15853
|
async send(e, t) {
|
|
15854
15854
|
if (await X.initDone, X.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 send");
|
|
15855
|
-
t ??= {}, t?.mission &&
|
|
15855
|
+
t ??= {}, t?.mission && it && O.setMission(t.mission);
|
|
15856
15856
|
let n = e, r = (t.images ?? []).filter((e) => e && (e.dataUri || e.vfsRef || e.url));
|
|
15857
15857
|
if (r.length > 4) throw Error(`[page-agent-sdk] 单轮最多 4 张图片(收到 ${r.length})`);
|
|
15858
|
-
if (r.length && (await
|
|
15858
|
+
if (r.length && (await _n.stowImages(r), await _n.describeIfNeeded(r, n)), r.length && !g.vision && !r.every((e) => e.description)) {
|
|
15859
15859
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述(集成方识图子 agent / 自有 vision API)";
|
|
15860
|
-
throw
|
|
15860
|
+
throw Y({
|
|
15861
15861
|
type: "error",
|
|
15862
15862
|
message: e,
|
|
15863
15863
|
severity: "recoverable",
|
|
@@ -15865,7 +15865,7 @@ function X_(e, n, r) {
|
|
|
15865
15865
|
}), Error(`[page-agent-sdk] ${e}`);
|
|
15866
15866
|
}
|
|
15867
15867
|
T?.setProtectedRefs?.(V_(w));
|
|
15868
|
-
let i =
|
|
15868
|
+
let i = _e ? t.maxAutoRetries ?? 1 : 0, a = 0, s = !1, c = an(t.signal);
|
|
15869
15869
|
if (t.signal) {
|
|
15870
15870
|
let e = () => o.resolve("keep_external");
|
|
15871
15871
|
t.signal.aborted ? e() : t.signal.addEventListener("abort", e, { once: !0 });
|
|
@@ -15882,14 +15882,14 @@ function X_(e, n, r) {
|
|
|
15882
15882
|
...n ? { anchor: n } : {}
|
|
15883
15883
|
};
|
|
15884
15884
|
}
|
|
15885
|
-
let i = e ??
|
|
15885
|
+
let i = e ?? dn.value ?? void 0;
|
|
15886
15886
|
w.push({
|
|
15887
15887
|
role: "user",
|
|
15888
15888
|
content: n,
|
|
15889
15889
|
timestamp: Date.now(),
|
|
15890
15890
|
...r.length ? { images: r } : {},
|
|
15891
15891
|
...i ? { quote: i } : {}
|
|
15892
|
-
}), s = !0, !e &&
|
|
15892
|
+
}), s = !0, !e && dn.value && (dn.value = null);
|
|
15893
15893
|
}
|
|
15894
15894
|
try {
|
|
15895
15895
|
let e = await X.agent.invoke(w, t.signal, c);
|
|
@@ -15910,7 +15910,7 @@ function X_(e, n, r) {
|
|
|
15910
15910
|
}), X.afterRound(), l) try {
|
|
15911
15911
|
await l.flush();
|
|
15912
15912
|
} catch (e) {
|
|
15913
|
-
|
|
15913
|
+
Y({
|
|
15914
15914
|
type: "error",
|
|
15915
15915
|
message: `落盘失败(不影响本轮回复):${e instanceof Error ? e.message : String(e)}`,
|
|
15916
15916
|
severity: "observable",
|
|
@@ -15925,8 +15925,8 @@ function X_(e, n, r) {
|
|
|
15925
15925
|
...n,
|
|
15926
15926
|
code: "MODEL_UNAVAILABLE",
|
|
15927
15927
|
message: e instanceof Error ? e.message : n.message
|
|
15928
|
-
}), a < i &&
|
|
15929
|
-
a += 1,
|
|
15928
|
+
}), a < i && z?.canRestore()) {
|
|
15929
|
+
a += 1, z.restore(), s = !0, Y({
|
|
15930
15930
|
type: "error",
|
|
15931
15931
|
message: `致命错误自动恢复(${a}/${i}):${n.message},已回退 checkpoint 重试`,
|
|
15932
15932
|
severity: "observable",
|
|
@@ -15938,7 +15938,7 @@ function X_(e, n, r) {
|
|
|
15938
15938
|
});
|
|
15939
15939
|
continue;
|
|
15940
15940
|
}
|
|
15941
|
-
throw
|
|
15941
|
+
throw Y({
|
|
15942
15942
|
type: "error",
|
|
15943
15943
|
message: n.message,
|
|
15944
15944
|
severity: n.severity,
|
|
@@ -15951,7 +15951,7 @@ function X_(e, n, r) {
|
|
|
15951
15951
|
async batch(e, t, n) {
|
|
15952
15952
|
if (await X.initDone, !e.length) return [];
|
|
15953
15953
|
if (X.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 batch");
|
|
15954
|
-
let r = [], i =
|
|
15954
|
+
let r = [], i = an(n);
|
|
15955
15955
|
if (T?.setProtectedRefs?.(V_(w)), n) {
|
|
15956
15956
|
let e = () => o.resolve("keep_external");
|
|
15957
15957
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
@@ -15967,7 +15967,7 @@ function X_(e, n, r) {
|
|
|
15967
15967
|
break;
|
|
15968
15968
|
}
|
|
15969
15969
|
let o = e[a];
|
|
15970
|
-
|
|
15970
|
+
z && z.save(`batch:${a}`);
|
|
15971
15971
|
let s = w.length;
|
|
15972
15972
|
try {
|
|
15973
15973
|
w.push({
|
|
@@ -15983,7 +15983,7 @@ function X_(e, n, r) {
|
|
|
15983
15983
|
}), X.afterRound(), l) try {
|
|
15984
15984
|
await l.flush();
|
|
15985
15985
|
} catch (e) {
|
|
15986
|
-
|
|
15986
|
+
Y({
|
|
15987
15987
|
type: "error",
|
|
15988
15988
|
message: `落盘失败(不影响本任务结果):${e instanceof Error ? e.message : String(e)}`,
|
|
15989
15989
|
severity: "observable",
|
|
@@ -16019,7 +16019,7 @@ function X_(e, n, r) {
|
|
|
16019
16019
|
}
|
|
16020
16020
|
ya(i);
|
|
16021
16021
|
let c = ui(i, "fatal");
|
|
16022
|
-
|
|
16022
|
+
Y({
|
|
16023
16023
|
type: "error",
|
|
16024
16024
|
message: `批量任务 ${a + 1}/${e.length} 失败:${c.message}`,
|
|
16025
16025
|
severity: "observable",
|
|
@@ -16043,16 +16043,16 @@ function X_(e, n, r) {
|
|
|
16043
16043
|
}
|
|
16044
16044
|
return r;
|
|
16045
16045
|
},
|
|
16046
|
-
switchSession: (e) =>
|
|
16047
|
-
exportSession: (e) =>
|
|
16048
|
-
importSession: (e) =>
|
|
16049
|
-
resetSession: () =>
|
|
16046
|
+
switchSession: (e) => vn.switchSession(e),
|
|
16047
|
+
exportSession: (e) => vn.exportSession(e),
|
|
16048
|
+
importSession: (e) => vn.importSession(e),
|
|
16049
|
+
resetSession: () => vn.resetSession(),
|
|
16050
16050
|
stream: async (e, t, n) => {
|
|
16051
16051
|
if (!X.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
16052
16052
|
let r = [...e].reverse().find((e) => e.role === "user" && e.images?.length);
|
|
16053
|
-
if (r?.images?.length && (await
|
|
16053
|
+
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
16054
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述";
|
|
16055
|
-
throw
|
|
16055
|
+
throw Y({
|
|
16056
16056
|
type: "error",
|
|
16057
16057
|
message: e,
|
|
16058
16058
|
severity: "recoverable",
|
|
@@ -16061,36 +16061,36 @@ function X_(e, n, r) {
|
|
|
16061
16061
|
}
|
|
16062
16062
|
T?.setProtectedRefs?.(V_(e));
|
|
16063
16063
|
let i = (e) => {
|
|
16064
|
-
t?.(
|
|
16064
|
+
t?.(Oe(e)), Y(Oe(e)), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && X.infoTick.value++;
|
|
16065
16065
|
};
|
|
16066
16066
|
if (n) {
|
|
16067
16067
|
let e = () => o.resolve("keep_external");
|
|
16068
16068
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
16069
16069
|
}
|
|
16070
|
-
let { controller: a, untrack: s } =
|
|
16070
|
+
let { controller: a, untrack: s } = ln(n);
|
|
16071
16071
|
return X.agent.stream(e, i, a.signal).finally(s);
|
|
16072
16072
|
},
|
|
16073
16073
|
release() {
|
|
16074
16074
|
if (X.refCount--, X.refCount <= 0) {
|
|
16075
|
-
|
|
16075
|
+
un(), We = !0, l && (T.flush?.(), l.flush(), l.dispose()), Zt && Zt.dispose();
|
|
16076
16076
|
let e = X.mcpClosers.splice(0);
|
|
16077
16077
|
e.length && Promise.allSettled(e.map((e) => e())), G_.delete(n);
|
|
16078
16078
|
}
|
|
16079
16079
|
},
|
|
16080
16080
|
resolveConflict: o.resolve,
|
|
16081
16081
|
setTools(e) {
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
}),
|
|
16082
|
+
Le.length = 0, e.forEach((e) => {
|
|
16083
|
+
Le.push(e), Ee.set(e.name, "user");
|
|
16084
|
+
}), K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16085
16085
|
},
|
|
16086
16086
|
addTool(e) {
|
|
16087
|
-
|
|
16088
|
-
for (let t =
|
|
16089
|
-
|
|
16087
|
+
K.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
16088
|
+
for (let t = Le.length - 1; t >= 0; t--) Le[t].name === e.name && Le.splice(t, 1);
|
|
16089
|
+
Le.push(e), Ee.set(e.name, "user"), K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16090
16090
|
},
|
|
16091
16091
|
removeTool(e) {
|
|
16092
|
-
let t =
|
|
16093
|
-
return t < 0 ? !1 : (
|
|
16092
|
+
let t = Le.findIndex((t) => t.name === e);
|
|
16093
|
+
return t < 0 ? !1 : (Le.splice(t, 1), Ee.delete(e), K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++, !0);
|
|
16094
16094
|
},
|
|
16095
16095
|
setLlm(t) {
|
|
16096
16096
|
let n;
|
|
@@ -16100,7 +16100,7 @@ function X_(e, n, r) {
|
|
|
16100
16100
|
if ((e.provider ?? "openai") === "anthropic") throw Error("[page-agent-sdk][setLlm] 切换到 Anthropic 需传 BaseChatModel 实例(动态 import 无法同步);请先 const { ChatAnthropic } = await import(\"@langchain/anthropic\") 构造实例后传入");
|
|
16101
16101
|
n = E(e);
|
|
16102
16102
|
}
|
|
16103
|
-
typeof n.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), Mp(n, { emit:
|
|
16103
|
+
typeof n.bindTools != "function" && e.debug && console.warn("[page-agent-sdk][setLlm] 新模型不支持 bindTools(tool calling 会失效)"), Mp(n, { emit: Y }), C = t;
|
|
16104
16104
|
let r = Ap(t) ? void 0 : t;
|
|
16105
16105
|
if (g = v({
|
|
16106
16106
|
model: r?.model ?? t.model ?? t.modelName,
|
|
@@ -16108,58 +16108,58 @@ function X_(e, n, r) {
|
|
|
16108
16108
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens,
|
|
16109
16109
|
vision: r?.vision ?? t.vision
|
|
16110
16110
|
}), g.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${g.contextWindow} 小于最小支持 ${p}(需 ≥200K 窗口模型)`);
|
|
16111
|
-
X.agent && (X.agent.setLlm(n), X.agent.setModelCaps?.(g)),
|
|
16111
|
+
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
16112
|
},
|
|
16113
16113
|
setMemory(e) {
|
|
16114
|
-
|
|
16114
|
+
N.reset(e), typeof e == "function" && N.refresh(), X.infoTick.value++;
|
|
16115
16115
|
},
|
|
16116
16116
|
refreshMemory() {
|
|
16117
|
-
return
|
|
16117
|
+
return N.refresh();
|
|
16118
16118
|
},
|
|
16119
16119
|
setSubagents(t) {
|
|
16120
|
-
if (!
|
|
16120
|
+
if (!jt) {
|
|
16121
16121
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
16122
16122
|
return;
|
|
16123
16123
|
}
|
|
16124
|
-
|
|
16124
|
+
jt.set(t), X.infoTick.value++;
|
|
16125
16125
|
},
|
|
16126
16126
|
addSubagent(t) {
|
|
16127
|
-
if (!
|
|
16127
|
+
if (!jt) {
|
|
16128
16128
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
16129
16129
|
return;
|
|
16130
16130
|
}
|
|
16131
|
-
|
|
16131
|
+
jt.add(t), X.infoTick.value++;
|
|
16132
16132
|
},
|
|
16133
16133
|
removeSubagent(t) {
|
|
16134
|
-
if (!
|
|
16135
|
-
let n =
|
|
16134
|
+
if (!jt) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
16135
|
+
let n = jt.remove(t);
|
|
16136
16136
|
return n && X.infoTick.value++, n;
|
|
16137
16137
|
},
|
|
16138
16138
|
getActiveSubagents() {
|
|
16139
|
-
return
|
|
16139
|
+
return ft?.getActive() ?? [];
|
|
16140
16140
|
},
|
|
16141
16141
|
get subagentHistory() {
|
|
16142
|
-
return
|
|
16142
|
+
return ft?.getHistory() ?? [];
|
|
16143
16143
|
},
|
|
16144
16144
|
getInfo() {
|
|
16145
16145
|
return {
|
|
16146
16146
|
id: n,
|
|
16147
16147
|
sessionId: X.sessionId,
|
|
16148
16148
|
model: Ap(C) ? C.model ?? C.modelName : C.model,
|
|
16149
|
-
systemPrompt: X.agent?.getEffectiveSystemPrompt?.() ??
|
|
16150
|
-
tools: (X.agent?.allTools ??
|
|
16149
|
+
systemPrompt: X.agent?.getEffectiveSystemPrompt?.() ?? ye + gd(W(), e.schemaHint),
|
|
16150
|
+
tools: (X.agent?.allTools ?? K).map((e) => ({
|
|
16151
16151
|
name: e.name,
|
|
16152
16152
|
description: e.description,
|
|
16153
16153
|
schema: e.schema,
|
|
16154
|
-
source:
|
|
16154
|
+
source: Ee.get(e.name) || "user"
|
|
16155
16155
|
})),
|
|
16156
|
-
skills: (
|
|
16156
|
+
skills: (Kt ? Kt.controller.get() : e.skills ?? []).map((e) => ({
|
|
16157
16157
|
name: e.name,
|
|
16158
16158
|
description: e.description
|
|
16159
16159
|
})),
|
|
16160
|
-
data:
|
|
16161
|
-
description:
|
|
16162
|
-
schema:
|
|
16160
|
+
data: W() ? {
|
|
16161
|
+
description: W().description,
|
|
16162
|
+
schema: W().schema
|
|
16163
16163
|
} : void 0,
|
|
16164
16164
|
contextPreset: e.contextPreset ?? "auto",
|
|
16165
16165
|
compression: {
|
|
@@ -16167,16 +16167,16 @@ function X_(e, n, r) {
|
|
|
16167
16167
|
summaryThresholdRatio: y.summaryThresholdRatio ?? .5,
|
|
16168
16168
|
promptSoftCap: Nl(g.contextWindow, y.promptSoftCapTokens)
|
|
16169
16169
|
},
|
|
16170
|
-
memory:
|
|
16170
|
+
memory: N.get(),
|
|
16171
16171
|
staleReadsInvalidated: X.agent?.getStaleReadsInvalidated?.() ?? 0,
|
|
16172
|
-
hostReadsInvalidated:
|
|
16173
|
-
...
|
|
16172
|
+
hostReadsInvalidated: q.readsInvalidated,
|
|
16173
|
+
...Ie ? { proposals: Ie.snapshot() } : {},
|
|
16174
16174
|
...r ? { hostWatch: { ...r } } : {},
|
|
16175
16175
|
llmRetries: X.agent?.getLlmRetries?.() ?? 0,
|
|
16176
16176
|
llmCallFailures: X.agent?.getLlmCallFailures?.() ?? 0,
|
|
16177
16177
|
gates: X.agent?.getGateStats?.(),
|
|
16178
16178
|
systemSegments: X.agent?.getLastSystemSegments?.() ?? [],
|
|
16179
|
-
middleware:
|
|
16179
|
+
middleware: nn.map((e) => e.name),
|
|
16180
16180
|
todos: (X.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
16181
16181
|
id: e.id,
|
|
16182
16182
|
content: e.content,
|
|
@@ -16187,30 +16187,30 @@ function X_(e, n, r) {
|
|
|
16187
16187
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
16188
16188
|
})),
|
|
16189
16189
|
planPhase: D.getPlanPhase(),
|
|
16190
|
-
mission:
|
|
16190
|
+
mission: it ? O.getMission() : void 0,
|
|
16191
16191
|
planConfirmation: ne.lastPlanConfirmation,
|
|
16192
|
-
workingMemory:
|
|
16193
|
-
focus:
|
|
16194
|
-
focuses:
|
|
16192
|
+
workingMemory: at ? oe.getWorkingMemory() : void 0,
|
|
16193
|
+
focus: Je ? j.getFocus() : void 0,
|
|
16194
|
+
focuses: Je ? j.getFocuses() : [],
|
|
16195
16195
|
actions: S_(e.actions ?? {}),
|
|
16196
16196
|
subagent: {
|
|
16197
|
-
enabled: !!
|
|
16197
|
+
enabled: !!Tt,
|
|
16198
16198
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
16199
16199
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
16200
16200
|
timeoutMs: e.subagent?.timeoutMs === void 0 ? 18e5 : e.subagent.timeoutMs > 0 ? e.subagent.timeoutMs : 0,
|
|
16201
16201
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
16202
|
-
subagents: (
|
|
16203
|
-
active:
|
|
16204
|
-
history:
|
|
16205
|
-
lockedComponents:
|
|
16202
|
+
subagents: (jt?.get() ?? []).map(Mt),
|
|
16203
|
+
active: ft?.getActive() ?? [],
|
|
16204
|
+
history: ft?.getHistory() ?? [],
|
|
16205
|
+
lockedComponents: Dt?.locked() ?? {}
|
|
16206
16206
|
},
|
|
16207
16207
|
verify: {
|
|
16208
|
-
enabled: !!
|
|
16209
|
-
maxAttempts:
|
|
16210
|
-
adversarial:
|
|
16208
|
+
enabled: !!It,
|
|
16209
|
+
maxAttempts: gt ? pt : 0,
|
|
16210
|
+
adversarial: gt && !!e.verify?.adversarial
|
|
16211
16211
|
},
|
|
16212
16212
|
context: (() => {
|
|
16213
|
-
let e =
|
|
16213
|
+
let e = Lt?.getSnapshot();
|
|
16214
16214
|
if (e) {
|
|
16215
16215
|
let t = X.agent?.getState?.()?.lastCompression;
|
|
16216
16216
|
t && (e.compression = t);
|
|
@@ -16222,10 +16222,10 @@ function X_(e, n, r) {
|
|
|
16222
16222
|
...X.mcpFailed.length ? { failed: X.mcpFailed } : {}
|
|
16223
16223
|
},
|
|
16224
16224
|
lastCompression: X.agent?.getState?.()?.lastCompression,
|
|
16225
|
-
checkpoints:
|
|
16225
|
+
checkpoints: z ? {
|
|
16226
16226
|
enabled: !0,
|
|
16227
|
-
auto:
|
|
16228
|
-
list:
|
|
16227
|
+
auto: B,
|
|
16228
|
+
list: z.list()
|
|
16229
16229
|
} : void 0
|
|
16230
16230
|
};
|
|
16231
16231
|
},
|
|
@@ -16263,41 +16263,41 @@ function X_(e, n, r) {
|
|
|
16263
16263
|
}));
|
|
16264
16264
|
},
|
|
16265
16265
|
getMission() {
|
|
16266
|
-
return
|
|
16266
|
+
return it ? O.getMission() : void 0;
|
|
16267
16267
|
},
|
|
16268
16268
|
setMission(t) {
|
|
16269
|
-
if (!
|
|
16269
|
+
if (!it) {
|
|
16270
16270
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
16271
16271
|
return;
|
|
16272
16272
|
}
|
|
16273
16273
|
O.setMission(t), X.infoTick.value++;
|
|
16274
16274
|
},
|
|
16275
16275
|
getFocus() {
|
|
16276
|
-
return
|
|
16276
|
+
return Je ? j.getFocus() : void 0;
|
|
16277
16277
|
},
|
|
16278
16278
|
getFocuses() {
|
|
16279
|
-
return
|
|
16279
|
+
return Je ? j.getFocuses() : [];
|
|
16280
16280
|
},
|
|
16281
16281
|
setFocus(t) {
|
|
16282
|
-
let n = Y_(t, "setFocus",
|
|
16283
|
-
return n.ok ? (
|
|
16282
|
+
let n = Y_(t, "setFocus", Je, () => W()?.schema, e.debug);
|
|
16283
|
+
return n.ok ? (j.setFocus(M(t)), e.debug && j.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), X.infoTick.value++, { ok: !0 }) : n;
|
|
16284
16284
|
},
|
|
16285
16285
|
addFocus(t) {
|
|
16286
|
-
let n = Y_(t, "addFocus",
|
|
16287
|
-
return n.ok ?
|
|
16286
|
+
let n = Y_(t, "addFocus", Je, () => W()?.schema, e.debug);
|
|
16287
|
+
return n.ok ? j.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
16288
16288
|
ok: !1,
|
|
16289
16289
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
16290
|
-
}) : (
|
|
16290
|
+
}) : (j.addFocus(M(t)), e.debug && j.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), X.infoTick.value++, { ok: !0 }) : n;
|
|
16291
16291
|
},
|
|
16292
16292
|
removeFocus(e) {
|
|
16293
|
-
|
|
16293
|
+
Je && (j.removeFocus(e), X.infoTick.value++);
|
|
16294
16294
|
},
|
|
16295
16295
|
clearFocus() {
|
|
16296
|
-
|
|
16296
|
+
Je && (j.clearFocus(), X.infoTick.value++);
|
|
16297
16297
|
},
|
|
16298
16298
|
setQuote(e, t, n) {
|
|
16299
16299
|
let r = Ni(e ?? ""), i = Ki(n);
|
|
16300
|
-
|
|
16300
|
+
dn.value = r ? {
|
|
16301
16301
|
text: r,
|
|
16302
16302
|
...t ? { source: t } : {},
|
|
16303
16303
|
...i ? { anchor: i } : {}
|
|
@@ -16305,34 +16305,34 @@ function X_(e, n, r) {
|
|
|
16305
16305
|
},
|
|
16306
16306
|
notifyHostChange(e) {
|
|
16307
16307
|
let t = typeof e?.reason == "string" ? e.reason.trim().slice(0, 200) : "";
|
|
16308
|
-
|
|
16308
|
+
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
16309
|
timestamp: Date.now(),
|
|
16310
16310
|
type: "middleware",
|
|
16311
16311
|
data: {
|
|
16312
16312
|
stage: "host_change_notified",
|
|
16313
|
-
epoch:
|
|
16313
|
+
epoch: q.epoch,
|
|
16314
16314
|
reason: t || void 0
|
|
16315
16315
|
}
|
|
16316
16316
|
}), X.infoTick.value++;
|
|
16317
16317
|
},
|
|
16318
16318
|
clearQuote() {
|
|
16319
|
-
|
|
16319
|
+
dn.value = null;
|
|
16320
16320
|
},
|
|
16321
16321
|
resolveProposal(e, t, n) {
|
|
16322
|
-
let r =
|
|
16322
|
+
let r = Ie ? Ie.resolve(e, t, n) : !1;
|
|
16323
16323
|
return r && X.infoTick.value++, r;
|
|
16324
16324
|
},
|
|
16325
16325
|
getProposals() {
|
|
16326
|
-
return
|
|
16326
|
+
return Ie ? Ie.snapshot() : null;
|
|
16327
16327
|
}
|
|
16328
16328
|
};
|
|
16329
|
-
async function
|
|
16329
|
+
async function fn() {
|
|
16330
16330
|
if (!l) return;
|
|
16331
16331
|
let t = async (e) => {
|
|
16332
16332
|
try {
|
|
16333
16333
|
return await l.load(n, e);
|
|
16334
16334
|
} catch (t) {
|
|
16335
|
-
|
|
16335
|
+
Y({
|
|
16336
16336
|
type: "error",
|
|
16337
16337
|
message: `会话快照读取失败,已降级空会话:${t instanceof Error ? t.message : String(t)}`,
|
|
16338
16338
|
severity: "observable",
|
|
@@ -16345,7 +16345,7 @@ function X_(e, n, r) {
|
|
|
16345
16345
|
try {
|
|
16346
16346
|
return await l.listSessions(n);
|
|
16347
16347
|
} catch (e) {
|
|
16348
|
-
return
|
|
16348
|
+
return Y({
|
|
16349
16349
|
type: "error",
|
|
16350
16350
|
message: `会话列表读取失败,已降级新建会话:${e instanceof Error ? e.message : String(e)}`,
|
|
16351
16351
|
severity: "observable",
|
|
@@ -16353,7 +16353,7 @@ function X_(e, n, r) {
|
|
|
16353
16353
|
}), [];
|
|
16354
16354
|
}
|
|
16355
16355
|
}, 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 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"),
|
|
16356
|
+
await Promise.race([l.ready.then(() => "ready"), new Promise((e) => setTimeout(() => e(i), 5e3))]) === i && (console.warn("[page-agent-sdk][persist] 存储初始化 5s 未就绪(可能被其他标签页锁住),已放行;持久化暂降级内存,就绪后自动恢复"), Y({
|
|
16357
16357
|
type: "error",
|
|
16358
16358
|
message: "存储初始化 5s 未就绪(IDB blocked?),已放行降级运行",
|
|
16359
16359
|
severity: "observable",
|
|
@@ -16363,7 +16363,7 @@ function X_(e, n, r) {
|
|
|
16363
16363
|
if (a.id) {
|
|
16364
16364
|
X.sessionId = a.id;
|
|
16365
16365
|
let e = await t(X.sessionId);
|
|
16366
|
-
e ? (X.applySnapshot(e),
|
|
16366
|
+
e ? (X.applySnapshot(e), Y({
|
|
16367
16367
|
type: "session_restored",
|
|
16368
16368
|
sessionId: X.sessionId,
|
|
16369
16369
|
rounds: e.messages?.length ?? 0
|
|
@@ -16373,19 +16373,19 @@ function X_(e, n, r) {
|
|
|
16373
16373
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, i.length, i.map((e) => e.sessionId)), i.length) {
|
|
16374
16374
|
X.sessionId = i[0].sessionId;
|
|
16375
16375
|
let n = await t(X.sessionId);
|
|
16376
|
-
n ? (X.applySnapshot(n),
|
|
16376
|
+
n ? (X.applySnapshot(n), Y({
|
|
16377
16377
|
type: "session_restored",
|
|
16378
16378
|
sessionId: X.sessionId,
|
|
16379
16379
|
rounds: n.messages?.length ?? 0
|
|
16380
16380
|
}), 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
16381
|
} else X.sessionId = await l.createSession(n, a.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", X.sessionId);
|
|
16382
16382
|
} else X.sessionId = await l.createSession(n, a.title);
|
|
16383
|
-
e.memory &&
|
|
16383
|
+
e.memory && vn.persistSave({ memory: N.get() || (typeof e.memory == "string" ? e.memory : "") }), vn.refreshSessions();
|
|
16384
16384
|
}
|
|
16385
|
-
async function
|
|
16386
|
-
await
|
|
16385
|
+
async function pn() {
|
|
16386
|
+
await $t();
|
|
16387
16387
|
}
|
|
16388
|
-
function
|
|
16388
|
+
function mn(e) {
|
|
16389
16389
|
let t = {};
|
|
16390
16390
|
for (let n of V_(e)) {
|
|
16391
16391
|
let e = T.files[n];
|
|
@@ -16393,15 +16393,15 @@ function X_(e, n, r) {
|
|
|
16393
16393
|
}
|
|
16394
16394
|
return t;
|
|
16395
16395
|
}
|
|
16396
|
-
function
|
|
16396
|
+
function hn() {
|
|
16397
16397
|
let e = H_(T.files, V_(w));
|
|
16398
16398
|
for (let t of e) delete T.files[t];
|
|
16399
16399
|
}
|
|
16400
|
-
function
|
|
16401
|
-
let e = xl(w,
|
|
16400
|
+
function gn() {
|
|
16401
|
+
let e = xl(w, rn);
|
|
16402
16402
|
if (!e.trimmed) return;
|
|
16403
16403
|
let { older: t, summary: n } = e;
|
|
16404
|
-
if (
|
|
16404
|
+
if (Y({
|
|
16405
16405
|
type: "context_trimmed",
|
|
16406
16406
|
dropped: t.map((e) => ({
|
|
16407
16407
|
round: e.round,
|
|
@@ -16409,60 +16409,60 @@ function X_(e, n, r) {
|
|
|
16409
16409
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
16410
16410
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
16411
16411
|
})),
|
|
16412
|
-
vfsResults:
|
|
16412
|
+
vfsResults: mn(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
16413
16413
|
summary: n.content,
|
|
16414
16414
|
reason: "max_memory_rounds"
|
|
16415
|
-
}), w.splice(e.deleteFrom, e.deleteCount, n),
|
|
16415
|
+
}), w.splice(e.deleteFrom, e.deleteCount, n), hn(), b && d) {
|
|
16416
16416
|
let n = e.summary, { prevSeg: r } = e;
|
|
16417
16417
|
(async () => {
|
|
16418
16418
|
try {
|
|
16419
16419
|
let e = await d(Ol(t, S)), i = w.indexOf(n);
|
|
16420
16420
|
if (i < 0) return;
|
|
16421
|
-
w[i].content = bl(t, r, e),
|
|
16421
|
+
w[i].content = bl(t, r, e), vn.persistRuntime();
|
|
16422
16422
|
} catch {}
|
|
16423
16423
|
})();
|
|
16424
16424
|
}
|
|
16425
16425
|
}
|
|
16426
|
-
let
|
|
16426
|
+
let _n = ki({
|
|
16427
16427
|
getConfig: () => e.images,
|
|
16428
16428
|
getVision: () => g.vision === !0,
|
|
16429
|
-
emit:
|
|
16429
|
+
emit: Y,
|
|
16430
16430
|
getVfsStore: () => X.vfsStore,
|
|
16431
|
-
noteFailure: (e, t) =>
|
|
16432
|
-
}),
|
|
16431
|
+
noteFailure: (e, t) => vn.notePersistFailure(e, t)
|
|
16432
|
+
}), vn = km({
|
|
16433
16433
|
agentId: n,
|
|
16434
16434
|
options: e,
|
|
16435
|
-
emit:
|
|
16435
|
+
emit: Y,
|
|
16436
16436
|
getStore: () => l,
|
|
16437
16437
|
core: X,
|
|
16438
|
-
sessionsRef:
|
|
16438
|
+
sessionsRef: on,
|
|
16439
16439
|
sessionVars: ne,
|
|
16440
16440
|
messages: w,
|
|
16441
16441
|
getUsage: () => a,
|
|
16442
16442
|
mw: {
|
|
16443
16443
|
todosMw: D,
|
|
16444
|
-
memoryMw:
|
|
16444
|
+
memoryMw: N,
|
|
16445
16445
|
missionMw: O,
|
|
16446
|
-
workingMemoryMw:
|
|
16447
|
-
focusMw:
|
|
16448
|
-
summarizationMw:
|
|
16446
|
+
workingMemoryMw: oe,
|
|
16447
|
+
focusMw: j,
|
|
16448
|
+
summarizationMw: en,
|
|
16449
16449
|
resumeNoticeMw: te,
|
|
16450
|
-
useMission:
|
|
16451
|
-
useWorkingMemory:
|
|
16452
|
-
useFocus:
|
|
16453
|
-
useAutomation:
|
|
16450
|
+
useMission: it,
|
|
16451
|
+
useWorkingMemory: at,
|
|
16452
|
+
useFocus: Je,
|
|
16453
|
+
useAutomation: _e
|
|
16454
16454
|
},
|
|
16455
16455
|
vfsStore: T,
|
|
16456
|
-
checkpointMgr:
|
|
16456
|
+
checkpointMgr: z,
|
|
16457
16457
|
conflictResolve: (e) => o.resolve(e),
|
|
16458
|
-
abortAllActive:
|
|
16458
|
+
abortAllActive: un,
|
|
16459
16459
|
titleLlmInvoke: f
|
|
16460
16460
|
});
|
|
16461
16461
|
return X.initDone = (async () => {
|
|
16462
|
-
await
|
|
16462
|
+
await fn(), await pn(), e.mcp?.length && sd({
|
|
16463
16463
|
servers: e.mcp,
|
|
16464
|
-
emit:
|
|
16465
|
-
isReleased: () =>
|
|
16464
|
+
emit: Y,
|
|
16465
|
+
isReleased: () => We,
|
|
16466
16466
|
core: {
|
|
16467
16467
|
mcpClosers: X.mcpClosers,
|
|
16468
16468
|
mcpServers: X.mcpServers,
|
|
@@ -16471,29 +16471,29 @@ function X_(e, n, r) {
|
|
|
16471
16471
|
},
|
|
16472
16472
|
reservedNames: () => {
|
|
16473
16473
|
let e = /* @__PURE__ */ new Set();
|
|
16474
|
-
for (let t of
|
|
16475
|
-
let n =
|
|
16474
|
+
for (let t of K) {
|
|
16475
|
+
let n = Ee.get(t.name);
|
|
16476
16476
|
n && !n.startsWith("mcp:") && e.add(t.name);
|
|
16477
16477
|
}
|
|
16478
16478
|
return e;
|
|
16479
16479
|
},
|
|
16480
|
-
pushTool: (e, t) => (
|
|
16480
|
+
pushTool: (e, t) => (Ee.set(e.name, `mcp:${t}`), Ue.push(e), !0),
|
|
16481
16481
|
rebind: () => {
|
|
16482
|
-
|
|
16482
|
+
K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16483
16483
|
},
|
|
16484
16484
|
debug: e.debug
|
|
16485
16485
|
});
|
|
16486
16486
|
let t = Ap(e.llm) ? e.llm : await k(e.llm);
|
|
16487
|
-
Mp(t, { emit:
|
|
16487
|
+
Mp(t, { emit: Y }), X.agent = Ms({
|
|
16488
16488
|
llm: t,
|
|
16489
|
-
systemPrompt:
|
|
16490
|
-
tools:
|
|
16491
|
-
middleware:
|
|
16489
|
+
systemPrompt: ye,
|
|
16490
|
+
tools: K,
|
|
16491
|
+
middleware: nn,
|
|
16492
16492
|
maxToolRounds: e.maxToolRounds,
|
|
16493
|
-
hasSubagent:
|
|
16494
|
-
pageAssertionGate:
|
|
16495
|
-
pageReadTools:
|
|
16496
|
-
deferredWriteTools:
|
|
16493
|
+
hasSubagent: dt,
|
|
16494
|
+
pageAssertionGate: V.domInspect === !0,
|
|
16495
|
+
pageReadTools: Ve.size ? Ve : void 0,
|
|
16496
|
+
deferredWriteTools: He.size ? He : void 0,
|
|
16497
16497
|
maxRetries: e.maxRetries,
|
|
16498
16498
|
stallMs: e.streamStallMs ?? 9e4,
|
|
16499
16499
|
streamMaxMs: e.streamMaxDurationMs ?? 18e5,
|
|
@@ -16502,16 +16502,16 @@ function X_(e, n, r) {
|
|
|
16502
16502
|
contextWindow: g.contextWindow,
|
|
16503
16503
|
maxOutputTokens: g.maxOutputTokens,
|
|
16504
16504
|
vision: g.vision,
|
|
16505
|
-
imageContentFormat:
|
|
16506
|
-
maxVerifyAttempts:
|
|
16505
|
+
imageContentFormat: je,
|
|
16506
|
+
maxVerifyAttempts: gt ? pt : 0,
|
|
16507
16507
|
roundTokenBudget: e.roundTokenBudget ?? 0,
|
|
16508
16508
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
16509
16509
|
onLlmChange: (e) => {
|
|
16510
16510
|
C = e;
|
|
16511
16511
|
},
|
|
16512
16512
|
debug: e.debug
|
|
16513
|
-
}),
|
|
16514
|
-
X.agent && X.agent.setTools(
|
|
16513
|
+
}), se.current = X.agent, At && At.setReconfigureHook(() => {
|
|
16514
|
+
X.agent && X.agent.setTools(nt());
|
|
16515
16515
|
});
|
|
16516
16516
|
})(), X;
|
|
16517
16517
|
}
|
|
@@ -16976,11 +16976,11 @@ async function cv(e) {
|
|
|
16976
16976
|
//#region src/core/composables/useChat.ts
|
|
16977
16977
|
var lv = 4e3;
|
|
16978
16978
|
function uv(e = {}) {
|
|
16979
|
-
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a, onBeforeRegenerate: o } = e, s = /* @__PURE__ */
|
|
16979
|
+
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a, onBeforeRegenerate: o } = e, s = /* @__PURE__ */ Pt({
|
|
16980
16980
|
messages: e.messages ?? [],
|
|
16981
16981
|
loading: !1,
|
|
16982
16982
|
error: null
|
|
16983
|
-
}), c = /* @__PURE__ */
|
|
16983
|
+
}), c = /* @__PURE__ */ Gt(null), l = /* @__PURE__ */ Gt(!0), u = null, d = /* @__PURE__ */ Gt([]), f = /* @__PURE__ */ Gt(null);
|
|
16984
16984
|
function p() {}
|
|
16985
16985
|
function m(e) {
|
|
16986
16986
|
let t = c.value;
|
|
@@ -17004,7 +17004,7 @@ function uv(e = {}) {
|
|
|
17004
17004
|
}
|
|
17005
17005
|
async function _(e) {
|
|
17006
17006
|
if (l.value = !0, n) {
|
|
17007
|
-
let t = /* @__PURE__ */
|
|
17007
|
+
let t = /* @__PURE__ */ Pt({
|
|
17008
17008
|
role: "assistant",
|
|
17009
17009
|
content: "",
|
|
17010
17010
|
timestamp: Date.now(),
|
|
@@ -17704,19 +17704,19 @@ function _v(e = {}) {
|
|
|
17704
17704
|
onQueuedCleared: e.onQueuedCleared,
|
|
17705
17705
|
onBeforeRegenerate: e.onBeforeRegenerate,
|
|
17706
17706
|
getFocuses: e.getFocuses
|
|
17707
|
-
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */
|
|
17707
|
+
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */ Gt(""), s = /* @__PURE__ */ Gt(!0), c = () => {
|
|
17708
17708
|
s.value = !s.value;
|
|
17709
|
-
}, l = /* @__PURE__ */
|
|
17709
|
+
}, l = /* @__PURE__ */ Gt(!1), u = () => {
|
|
17710
17710
|
l.value = !0;
|
|
17711
17711
|
}, d = () => {
|
|
17712
17712
|
l.value = !1;
|
|
17713
|
-
}, f = /* @__PURE__ */
|
|
17713
|
+
}, f = /* @__PURE__ */ Gt(!1), p = () => {
|
|
17714
17714
|
f.value = !0;
|
|
17715
17715
|
}, m = () => {
|
|
17716
17716
|
f.value = !1;
|
|
17717
|
-
}, h = /* @__PURE__ */
|
|
17717
|
+
}, h = /* @__PURE__ */ Gt({}), g = (e) => h.value[e] === !0, _ = (e) => {
|
|
17718
17718
|
h.value[e] = !g(e);
|
|
17719
|
-
}, v = /* @__PURE__ */
|
|
17719
|
+
}, v = /* @__PURE__ */ Gt(!1), y = (e) => {
|
|
17720
17720
|
cv(e).then((e) => {
|
|
17721
17721
|
e && (v.value = !0, setTimeout(() => {
|
|
17722
17722
|
v.value = !1;
|
|
@@ -17730,13 +17730,13 @@ function _v(e = {}) {
|
|
|
17730
17730
|
};
|
|
17731
17731
|
}), x = ri(() => (n.messages.length, typeof e.canUndo == "function" && !!e.canUndo())), S = () => {
|
|
17732
17732
|
e.onUndo?.() && (n.error = null);
|
|
17733
|
-
}, C = (e) => new Date(e).toLocaleTimeString(
|
|
17733
|
+
}, C = (e) => new Date(e).toLocaleTimeString(ce, {
|
|
17734
17734
|
hour: "2-digit",
|
|
17735
17735
|
minute: "2-digit"
|
|
17736
17736
|
}), w = () => {
|
|
17737
17737
|
let e = T.value, t = ne.value;
|
|
17738
|
-
!o.value.trim() && !e.length || (r(o.value,
|
|
17739
|
-
}, T = /* @__PURE__ */
|
|
17738
|
+
!o.value.trim() && !e.length || (r(o.value, M.value, e.length ? [...e] : void 0, t ?? void 0), o.value = "", T.value = [], t && re());
|
|
17739
|
+
}, T = /* @__PURE__ */ Gt([]), E = /* @__PURE__ */ Gt(""), D = /* @__PURE__ */ Gt(!1), O, k = (e) => {
|
|
17740
17740
|
E.value = e, clearTimeout(O), O = setTimeout(() => {
|
|
17741
17741
|
E.value = "";
|
|
17742
17742
|
}, 4e3);
|
|
@@ -17745,45 +17745,45 @@ function _v(e = {}) {
|
|
|
17745
17745
|
if (!t.length) return;
|
|
17746
17746
|
let n = 4 - T.value.length;
|
|
17747
17747
|
if (n <= 0) {
|
|
17748
|
-
k(`${
|
|
17748
|
+
k(`${L.imageCountLimitPrefix}4${L.imageCountLimitSuffix}`);
|
|
17749
17749
|
return;
|
|
17750
17750
|
}
|
|
17751
|
-
t.length > n && k(`${
|
|
17751
|
+
t.length > n && k(`${L.imageCountLimitPrefix}4${L.imageCountLimitSuffix}`), D.value = !0;
|
|
17752
17752
|
try {
|
|
17753
17753
|
for (let e of t.slice(0, n)) try {
|
|
17754
17754
|
let t = await Ei(e, { name: e.name });
|
|
17755
17755
|
T.value.push(t);
|
|
17756
17756
|
} catch (e) {
|
|
17757
|
-
k(e instanceof hi ? `${e.message}` :
|
|
17757
|
+
k(e instanceof hi ? `${e.message}` : L.imageInvalid);
|
|
17758
17758
|
}
|
|
17759
17759
|
} finally {
|
|
17760
17760
|
D.value = !1;
|
|
17761
17761
|
}
|
|
17762
17762
|
}, te = (e) => {
|
|
17763
17763
|
T.value = T.value.filter((t) => t.id !== e);
|
|
17764
|
-
}, ne = ri(() => e.pendingQuote?.value ?? null),
|
|
17764
|
+
}, ne = ri(() => e.pendingQuote?.value ?? null), A = (t) => {
|
|
17765
17765
|
e.onSetQuote?.(t);
|
|
17766
|
-
},
|
|
17766
|
+
}, re = () => {
|
|
17767
17767
|
e.onClearQuote?.();
|
|
17768
|
-
},
|
|
17768
|
+
}, ie = (e) => {
|
|
17769
17769
|
e.isComposing || e.keyCode === 229 || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), w());
|
|
17770
|
-
},
|
|
17770
|
+
}, ae = (e) => {
|
|
17771
17771
|
o.value = a.value[e] || "", i(e);
|
|
17772
|
-
},
|
|
17772
|
+
}, j = (e) => {
|
|
17773
17773
|
let t = n.messages, r = t[e];
|
|
17774
17774
|
if (!r || r.role !== "assistant") return !1;
|
|
17775
17775
|
let i = "reasoning" in r ? r.reasoning : void 0, a = "steps" in r ? r.steps : void 0;
|
|
17776
17776
|
return n.loading && e === t.length - 1 && !r.content && !i && !(a && a.length);
|
|
17777
|
-
},
|
|
17777
|
+
}, M = ri(() => (e.infoTick?.value, e.getFocuses?.() ?? [])), oe = ri(() => (e.infoTick?.value, e.getInfo?.()?.planConfirmation)), N = (t) => e.onAddFocus ? e.onAddFocus(t) : {
|
|
17778
17778
|
ok: !1,
|
|
17779
17779
|
error: "focus 未启用"
|
|
17780
|
-
},
|
|
17780
|
+
}, se = (t) => {
|
|
17781
17781
|
e.onRemoveFocus?.(t);
|
|
17782
|
-
},
|
|
17782
|
+
}, P = () => {
|
|
17783
17783
|
e.onClearFocus?.();
|
|
17784
|
-
},
|
|
17784
|
+
}, F = (t) => {
|
|
17785
17785
|
e.onFocusChipClick?.(t);
|
|
17786
|
-
},
|
|
17786
|
+
}, I = fv(e.icons), ce = e.locale ?? "zh-CN", L = hv(ce, e.dialogMessages);
|
|
17787
17787
|
return {
|
|
17788
17788
|
chat: t,
|
|
17789
17789
|
inputText: o,
|
|
@@ -17805,26 +17805,26 @@ function _v(e = {}) {
|
|
|
17805
17805
|
undo: S,
|
|
17806
17806
|
formatTime: C,
|
|
17807
17807
|
send: w,
|
|
17808
|
-
keydown:
|
|
17808
|
+
keydown: ie,
|
|
17809
17809
|
pendingImages: T,
|
|
17810
17810
|
addImageFiles: ee,
|
|
17811
17811
|
removePendingImage: te,
|
|
17812
17812
|
imageInputError: E,
|
|
17813
17813
|
compressingImages: D,
|
|
17814
17814
|
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:
|
|
17815
|
+
setQuote: A,
|
|
17816
|
+
clearQuote: re,
|
|
17817
|
+
editQueued: ae,
|
|
17818
|
+
isPendingAssistant: j,
|
|
17819
|
+
focuses: M,
|
|
17820
|
+
planConfirmation: oe,
|
|
17821
|
+
addFocus: N,
|
|
17822
|
+
removeFocus: se,
|
|
17823
|
+
clearFocus: P,
|
|
17824
|
+
focusChipClick: F,
|
|
17825
|
+
icons: I,
|
|
17826
|
+
locale: ce,
|
|
17827
|
+
messages: L,
|
|
17828
17828
|
toolStepView: e.toolStepView
|
|
17829
17829
|
};
|
|
17830
17830
|
}
|
|
@@ -17839,4 +17839,4 @@ function yv(e) {
|
|
|
17839
17839
|
return Z_(e);
|
|
17840
17840
|
}
|
|
17841
17841
|
//#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,
|
|
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, 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 };
|