page-agent-sdk 4.23.3 → 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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/page-agent-sdk.headless.js +1048 -1018
- package/dist/page-agent-sdk.iife.js +13 -11
- package/dist/page-agent-sdk.js +911 -881
- package/dist/page-agent-sdk.legacy.js +612 -579
- package/dist/page-agent-sdk.umd.cjs +11 -9
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/headless.d.ts +6 -2
- package/types/index.d.ts +9 -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,52 +496,52 @@ 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
|
-
}, 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),
|
|
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
|
|
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
521
|
if (I(e)) {
|
|
522
522
|
let t = {};
|
|
523
523
|
for (let n = 0; n < e.length; n++) {
|
|
524
|
-
let r = e[n], i = le(r) ?
|
|
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
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
542
|
if (le(e)) t = e;
|
|
543
543
|
else if (I(e)) for (let n = 0; n < e.length; n++) {
|
|
544
|
-
let r =
|
|
544
|
+
let r = W(e[n]);
|
|
545
545
|
r && (t += r + " ");
|
|
546
546
|
}
|
|
547
547
|
else if (de(e)) for (let n in e) e[n] && (t += n + " ");
|
|
@@ -549,76 +549,76 @@ function U(e) {
|
|
|
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 = I(e), a = 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
|
-
ce(e) && s(o.get(
|
|
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
|
|
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
928
|
ue(e) || (e = String(e));
|
|
929
|
-
let t = /* @__PURE__ */
|
|
930
|
-
return
|
|
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 ?
|
|
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
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 ((ue(t) ?
|
|
951
|
-
if (/* @__PURE__ */
|
|
952
|
-
let e = a &&
|
|
953
|
-
return r && de(e) ? /* @__PURE__ */
|
|
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 de(o) ? r ? /* @__PURE__ */
|
|
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 = I(e) &&
|
|
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 : F(e, t), s = Reflect.set(e, t, n, /* @__PURE__ */
|
|
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
971
|
let n = F(e, t), r = e[t], i = Reflect.deleteProperty(e, t);
|
|
972
|
-
return i && n &&
|
|
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 (!ue(t) || !
|
|
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 =
|
|
1075
|
+
function wt(e, t) {
|
|
1076
|
+
let n = Ct(e, t);
|
|
1077
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 (!de(e)) return process.env.NODE_ENV !== "production" &&
|
|
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 !F(e, "__v_skip") && Object.isExtensible(e) &&
|
|
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,10 +1215,10 @@ 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__
|
|
@@ -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__ */
|
|
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
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);
|
|
@@ -1305,12 +1305,12 @@ function an(e, t, n = oe) {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
function on(e, t = Infinity, n) {
|
|
1307
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__ */
|
|
1308
|
+
if (n.set(e, t), t--, /* @__PURE__ */ Wt(e)) on(e.value, t, n);
|
|
1309
1309
|
else if (I(e)) for (let r = 0; r < e.length; r++) on(e[r], t, n);
|
|
1310
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 le(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */
|
|
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
|
-
]) : R(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */
|
|
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",
|
|
@@ -1435,10 +1435,10 @@ function vn(e, t, n, r) {
|
|
|
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);
|
|
@@ -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) {
|
|
@@ -1599,20 +1599,20 @@ function Zn(e, t, n = !1) {
|
|
|
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
1601
|
if (arguments.length > 1) return n && R(t) ? t.call(r && r.proxy) : t;
|
|
1602
|
-
process.env.NODE_ENV !== "production" &&
|
|
1603
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
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;
|
|
@@ -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 !==
|
|
1690
|
+
else if (i !== ae && F(i, t)) return o[t] = 2, i[t];
|
|
1691
1691
|
else if (F(a, t)) return o[t] = 3, a[t];
|
|
1692
|
-
else if (n !==
|
|
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 !==
|
|
1698
|
+
if (n !== ae && F(n, t)) return o[t] = 4, n[t];
|
|
1699
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 && F(i, t) ? (
|
|
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,13 +1709,13 @@ 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
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
1720
|
return I(e) ? e.reduce((e, t) => (e[t] = null, e), {}) : e;
|
|
1721
1721
|
}
|
|
@@ -1727,7 +1727,7 @@ function fr(e) {
|
|
|
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,7 +1762,7 @@ 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) {
|
|
@@ -1780,15 +1780,15 @@ 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 ? I(e) && I(t) ? [.../* @__PURE__ */ new Set([...e, ...t])] :
|
|
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
|
}
|
|
@@ -1800,7 +1800,7 @@ var Or = /* @__PURE__ */ Symbol.for("v-fgt"), kr = /* @__PURE__ */ Symbol.for("v
|
|
|
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 : le(e) || /* @__PURE__ */
|
|
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 |= le(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key &&
|
|
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 && !le(e) && (t.class =
|
|
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
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__ */
|
|
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 = {
|
|
@@ -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 && !(I(n) && n.includes(i)) ? t[e] = n ? [].concat(n, i) : i : i == null && n == null && !
|
|
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);
|
|
@@ -2002,10 +2002,10 @@ function ii() {
|
|
|
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
|
-
] : de(e) ? ["object", { object: i ? /* @__PURE__ */
|
|
2112
|
+
] : de(e) ? ["object", { object: i ? /* @__PURE__ */ J(e) : e }] : [
|
|
2113
2113
|
"span",
|
|
2114
2114
|
n,
|
|
2115
2115
|
String(e)
|
|
@@ -2127,7 +2127,7 @@ function ii() {
|
|
|
2127
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,18 +3996,18 @@ 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
|
-
}), P = u ??
|
|
4006
|
+
}), P = u ?? se.maxOutputTokens, F = b(se.contextWindow), I = x(se.contextWindow);
|
|
4007
4007
|
function ce(e) {
|
|
4008
|
-
|
|
4008
|
+
se = e, F = b(se.contextWindow), I = x(se.contextWindow);
|
|
4009
4009
|
}
|
|
4010
|
-
let L = /* @__PURE__ */
|
|
4010
|
+
let L = /* @__PURE__ */ Y([]), R = 0, le = () => ({
|
|
4011
4011
|
retries: 0,
|
|
4012
4012
|
exhausted: 0
|
|
4013
4013
|
}), ue = {
|
|
@@ -4022,22 +4022,22 @@ function Ms(e) {
|
|
|
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
|
-
}, fe = [], pe = 0, me = 0,
|
|
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
|
-
L.value.push(n), L.value.length > Ss && L.value.splice(0, L.value.length - Ss), Jt(L),
|
|
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
|
|
4034
|
+
let V = (e) => {
|
|
4035
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
4039
|
}), L.value.length > Ss && L.value.splice(0, L.value.length - Ss), Jt(L);
|
|
4040
|
-
},
|
|
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,
|
|
@@ -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,25 +4067,25 @@ 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
4090
|
return fe = t.map((e) => ({
|
|
4091
4091
|
name: e.name,
|
|
@@ -4093,26 +4093,26 @@ function Ms(e) {
|
|
|
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
|
-
pe += 1,
|
|
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) ? (me += 1,
|
|
4160
|
+
throw ya(a) ? (me += 1, B("error", {
|
|
4161
4161
|
stage: "model_unavailable",
|
|
4162
4162
|
at: "launch",
|
|
4163
4163
|
status: a?.status
|
|
4164
|
-
})) : (me += 1,
|
|
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(), me += 1,
|
|
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,13 +4204,13 @@ 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);
|
|
@@ -4219,7 +4219,7 @@ function Ms(e) {
|
|
|
4219
4219
|
if (l === null && u === "" && o <= S && oa(a, n)) {
|
|
4220
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) ? (me += 1,
|
|
4252
|
+
throw ya(a) ? (me += 1, B("error", {
|
|
4253
4253
|
stage: "model_unavailable",
|
|
4254
4254
|
at: "iterate",
|
|
4255
4255
|
status: a?.status
|
|
4256
|
-
})) : (me += 1,
|
|
4256
|
+
})) : (me += 1, B("error", {
|
|
4257
4257
|
stage: "model_call_failed",
|
|
4258
4258
|
at: "iterate",
|
|
4259
4259
|
emitted: l !== null || u !== "",
|
|
@@ -4261,11 +4261,11 @@ 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 显式报错"
|
|
@@ -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,7 +4307,7 @@ 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,
|
|
@@ -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,
|
|
@@ -4518,7 +4518,7 @@ function Ms(e) {
|
|
|
4518
4518
|
if (a?.kind === "feedback") {
|
|
4519
4519
|
O = !0;
|
|
4520
4520
|
let e = ue[a.gate.stage];
|
|
4521
|
-
e && (e.retries += 1),
|
|
4521
|
+
e && (e.retries += 1), B("middleware", {
|
|
4522
4522
|
stage: a.gate.stage,
|
|
4523
4523
|
attempt: a.gate.attempt,
|
|
4524
4524
|
...a.gate.logData ?? {},
|
|
@@ -4528,7 +4528,7 @@ function Ms(e) {
|
|
|
4528
4528
|
}
|
|
4529
4529
|
if (a?.kind === "observable") {
|
|
4530
4530
|
let e = de[a.obs.code];
|
|
4531
|
-
e && ue[e] && (ue[e].exhausted += 1),
|
|
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, R += e.invalidatedCount,
|
|
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,38 +4782,38 @@ 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
4818
|
getStaleReadsInvalidated: () => R,
|
|
4819
4819
|
getLlmRetries: () => pe,
|
|
@@ -4824,11 +4824,11 @@ function Ms(e) {
|
|
|
4824
4824
|
R = 0, pe = 0, me = 0;
|
|
4825
4825
|
for (let e of Object.keys(ue)) ue[e] = le();
|
|
4826
4826
|
},
|
|
4827
|
-
setTools:
|
|
4828
|
-
setLlm:
|
|
4827
|
+
setTools: ke,
|
|
4828
|
+
setLlm: Ae,
|
|
4829
4829
|
setModelCaps: ce,
|
|
4830
4830
|
debugLogs: L,
|
|
4831
|
-
getEffectiveSystemPrompt: () =>
|
|
4831
|
+
getEffectiveSystemPrompt: () => xe()
|
|
4832
4832
|
};
|
|
4833
4833
|
}
|
|
4834
4834
|
//#endregion
|
|
@@ -5309,6 +5309,36 @@ var dc = {
|
|
|
5309
5309
|
"5. Prefer incremental write patches (send only the change, e.g. write({ value, patch:{ op, jsonPath } })) over resending the whole large JSON, which risks truncation;",
|
|
5310
5310
|
"6. If a write hits an optimistic-lock conflict (VERSION_CONFLICT returned, or the tool suspends awaiting the user decision): after the tool returns, follow its instruction (keep external → re-read then edit; overwritten/restored → continue from the result); do not abandon the task."
|
|
5311
5311
|
].join("\n"),
|
|
5312
|
+
answerLanes: [
|
|
5313
|
+
"【作答车道:先判问题形态,再选纪律】",
|
|
5314
|
+
"用户的问题分三类,判错车道是最大的答非所问:",
|
|
5315
|
+
"A. 问页面内容(「这页写了什么 / 哪里提到 / 原文是什么 / 这段在说什么」)",
|
|
5316
|
+
" → 以页面实料为准并点明出处;页面内容与你的先验知识冲突时以页面为准;页面没写就说没写,一句话即可,不列举查过哪些节。",
|
|
5317
|
+
"B. 问概念术语(「X 是什么 / 啥意思 / X 和 Y 什么区别」)",
|
|
5318
|
+
" → 页面有语境就先按页面语境讲;页面没有也必须直接用自己的知识解释,",
|
|
5319
|
+
" 开头一句「本页未提及,以下是通用解释:」即可 —— 不许把「页面上没有」当答案。",
|
|
5320
|
+
"C. 求观点经验(「你觉得呢 / 按你的经验 / 是不是很难 / 该怎么选」)",
|
|
5321
|
+
" → 直接给判断和理由;笔记口径与个人观点分开说(「本页的立场是…;我的看法是…」)。",
|
|
5322
|
+
" 页面没写不构成不答的理由。",
|
|
5323
|
+
"",
|
|
5324
|
+
"出处密度:只有「对页面内容的断言」才标出处(句末括注即可);概念解释、个人观点、",
|
|
5325
|
+
"过渡句一律不标。「没找到」的说明压成一句,不报检索过程。"
|
|
5326
|
+
].join("\n"),
|
|
5327
|
+
answerLanesEn: [
|
|
5328
|
+
"[Answer lanes: classify the question first, then pick the discipline]",
|
|
5329
|
+
"User questions fall into three categories; picking the wrong lane is the biggest way to miss the point:",
|
|
5330
|
+
"A. Asking about page content (\"what does this page say / where is it mentioned / what is the original text / what does this passage mean\")",
|
|
5331
|
+
" → Ground answers in what the page actually says and cite where it came from; when the page conflicts with your prior knowledge, the page wins; if the page does not say it, say so in one sentence — do not enumerate which sections you searched.",
|
|
5332
|
+
"B. Asking about a concept or term (\"what is X / what does it mean / how do X and Y differ\")",
|
|
5333
|
+
" → If the page has context for it, explain in that context first; if the page does not, you MUST still explain it directly from your own knowledge,",
|
|
5334
|
+
" opening with one line like \"Not covered on this page — general explanation:\" — never treat \"it is not on the page\" as the answer.",
|
|
5335
|
+
"C. Asking for your opinion or experience (\"what do you think / in your experience / is it hard to match / which should I choose\")",
|
|
5336
|
+
" → Give your judgment and reasoning directly; keep the notes' stance and your own view separate (\"this page's position is ...; my take is ...\").",
|
|
5337
|
+
" The page not covering it is never a reason to refuse.",
|
|
5338
|
+
"",
|
|
5339
|
+
"Citation density: only claims about page content get a citation (a short parenthetical); concept explanations,",
|
|
5340
|
+
"personal opinions, and transitions get none. Compress \"not found\" statements to one sentence; never narrate the search process."
|
|
5341
|
+
].join("\n"),
|
|
5312
5342
|
htmlPageOrchestrator: uc("html"),
|
|
5313
5343
|
htmlPageProposeFirst: ["【新建/创意类请求】先用简短文字给出 2~3 套方案(每套一两句风格/配色/结构要点),询问用户选哪套;选定前不要委派生成代码、不要写 components。", "【方案切换】已生成某套方案后改选另一套:不重新罗列,直接依据之前描述重新委派生成并覆盖相应组件(委派工具见编排段 use_<id>)。"].join("\n"),
|
|
5314
5344
|
htmlDirectWriteFallback: [
|
|
@@ -6504,7 +6534,7 @@ async function ru(e, t, n, r, i, a) {
|
|
|
6504
6534
|
} : { contextWindow: y.contextWindow }), x = t.onUsage ? {
|
|
6505
6535
|
name: "sub-usage",
|
|
6506
6536
|
afterModel: (e) => {
|
|
6507
|
-
let n =
|
|
6537
|
+
let n = re(e.message);
|
|
6508
6538
|
n && t.onUsage(n);
|
|
6509
6539
|
}
|
|
6510
6540
|
} : void 0;
|
|
@@ -6590,16 +6620,16 @@ async function ru(e, t, n, r, i, a) {
|
|
|
6590
6620
|
} finally {
|
|
6591
6621
|
ee();
|
|
6592
6622
|
}
|
|
6593
|
-
let
|
|
6594
|
-
|
|
6623
|
+
let A, ie = new Promise((e, t) => {
|
|
6624
|
+
A = setTimeout(() => {
|
|
6595
6625
|
D.abort(), t(/* @__PURE__ */ Error(`子 agent 执行超时(${ne}ms),已中止。可简化子任务或拆更小的子任务重试,或经 subagent.timeoutMs 调整(0=不限制)`));
|
|
6596
6626
|
}, ne);
|
|
6597
6627
|
});
|
|
6598
6628
|
te.catch(() => {});
|
|
6599
6629
|
try {
|
|
6600
|
-
return nu(await Promise.race([te,
|
|
6630
|
+
return nu(await Promise.race([te, ie]), E.getState());
|
|
6601
6631
|
} finally {
|
|
6602
|
-
clearTimeout(
|
|
6632
|
+
clearTimeout(A), ee();
|
|
6603
6633
|
}
|
|
6604
6634
|
}
|
|
6605
6635
|
function iu(e) {
|
|
@@ -7222,7 +7252,7 @@ function wu(e, t = {}) {
|
|
|
7222
7252
|
//#endregion
|
|
7223
7253
|
//#region src/core/utils/rawRead.ts
|
|
7224
7254
|
function Tu(e) {
|
|
7225
|
-
return /* @__PURE__ */
|
|
7255
|
+
return /* @__PURE__ */ J(e);
|
|
7226
7256
|
}
|
|
7227
7257
|
//#endregion
|
|
7228
7258
|
//#region src/core/harness/checkpoint.ts
|
|
@@ -7827,14 +7857,14 @@ var cd = [
|
|
|
7827
7857
|
"你是一个页面内容助手,帮助用户理解、查找与排查其当前所在的网页。",
|
|
7828
7858
|
"你可以经专用工具探查页面:read_page 读页面正文(长文按 hasMore 分页续读)、get_dom 读渲染后结构、dom_search / dom_info 定位元素与查属性" + (e ? "、take_screenshot 截图查看实际渲染效果(视觉问题优先截图,结构推断不能代替)" : "") + ";一切以工具读到的页面实料为准。",
|
|
7829
7859
|
"用户消息可能带 [引用原文] 块(其在页面上选中的文字):优先围绕引用内容作答,需要更多上下文再向外探索(所在小节 → 整页)。",
|
|
7830
|
-
|
|
7860
|
+
dc.answerLanes,
|
|
7831
7861
|
"输出从简:直接说内容,不写过程 —— 不要「我先读一下页面」这类旁白、不要「先给结论/依据是」这类包装、不要解释结论是怎么推出来的、不要「下面分三点/综上」这类套话;出处用句末括注(如「(§小节名)」)带过即可。",
|
|
7832
7862
|
ud
|
|
7833
7863
|
].join("\n"), pd = (e) => [
|
|
7834
7864
|
"You are a page content assistant that helps users understand, locate, and troubleshoot the web page they are on.",
|
|
7835
7865
|
"You can inspect the page through dedicated tools: read_page for page text (paginate via hasMore on long documents), get_dom for the rendered structure, dom_search / dom_info to locate elements and read attributes" + (e ? ", and take_screenshot to see the actual rendered appearance (prefer a screenshot for visual questions; structural inference is no substitute)" : "") + "; the page as read by tools is the source of truth.",
|
|
7836
7866
|
"User messages may carry a [quoted text] block (text they selected on the page): answer around the quote first, then explore outward (its section → the whole page) if more context is needed.",
|
|
7837
|
-
|
|
7867
|
+
dc.answerLanesEn,
|
|
7838
7868
|
"Be terse: state the content directly, never narrate process — no \"let me first read the page\" asides, no \"in summary / the evidence is\" packaging, no explaining how you derived the conclusion, no \"here are three points\" preambles; cite sources inline as a short parenthetical such as \"(§ section name)\".",
|
|
7839
7869
|
dd,
|
|
7840
7870
|
"Respond in English."
|
|
@@ -9339,7 +9369,7 @@ function hf(e, n = {}) {
|
|
|
9339
9369
|
let n = t ?? y;
|
|
9340
9370
|
e === void 0 ? v.delete(n) : v.set(n, e);
|
|
9341
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 = [];
|
|
9342
|
-
async function
|
|
9372
|
+
async function A() {
|
|
9343
9373
|
if (!ee) return {
|
|
9344
9374
|
release: () => {},
|
|
9345
9375
|
reacquire: async () => {}
|
|
@@ -9359,35 +9389,35 @@ function hf(e, n = {}) {
|
|
|
9359
9389
|
};
|
|
9360
9390
|
}
|
|
9361
9391
|
(n.maxParallelTools ?? 1) > 1 && !O && console.warn("[page-agent-sdk] maxParallelTools>1 且未声明 conflictWatchFields:并发写不互锁(后写覆盖前写,既有明文语义);声明 conflictWatchFields 后自动启用写互锁与乐观锁校验");
|
|
9362
|
-
let
|
|
9392
|
+
let re = (e) => {
|
|
9363
9393
|
let t = k();
|
|
9364
9394
|
return T(t, e), t;
|
|
9365
|
-
},
|
|
9395
|
+
}, ie = n.largeTextThreshold ?? 200, ae = (n.largeTextPaths ?? []).map((e) => {
|
|
9366
9396
|
let t = e.lastIndexOf(".");
|
|
9367
9397
|
return t > 0 ? {
|
|
9368
9398
|
arrayPath: e.slice(0, t),
|
|
9369
9399
|
field: e.slice(t + 1)
|
|
9370
9400
|
} : null;
|
|
9371
|
-
}).filter((e) => e !== null),
|
|
9372
|
-
function
|
|
9373
|
-
|
|
9401
|
+
}).filter((e) => e !== null), j = !0;
|
|
9402
|
+
function M() {
|
|
9403
|
+
j = !0;
|
|
9374
9404
|
}
|
|
9375
|
-
let
|
|
9405
|
+
let oe = {
|
|
9376
9406
|
get: () => ({
|
|
9377
9407
|
schema: o,
|
|
9378
9408
|
bind: c,
|
|
9379
9409
|
description: u
|
|
9380
9410
|
}),
|
|
9381
9411
|
set: (e) => {
|
|
9382
|
-
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();
|
|
9383
9413
|
},
|
|
9384
9414
|
update: (e) => {
|
|
9385
|
-
c = e, g.length = 0, v.clear(),
|
|
9415
|
+
c = e, g.length = 0, v.clear(), M();
|
|
9386
9416
|
},
|
|
9387
|
-
markDataDirty:
|
|
9417
|
+
markDataDirty: M,
|
|
9388
9418
|
consumeDataDirty: () => {
|
|
9389
|
-
let e =
|
|
9390
|
-
return
|
|
9419
|
+
let e = j;
|
|
9420
|
+
return j = !1, e;
|
|
9391
9421
|
},
|
|
9392
9422
|
enterScope: (e) => {
|
|
9393
9423
|
let t = y;
|
|
@@ -9441,14 +9471,14 @@ function hf(e, n = {}) {
|
|
|
9441
9471
|
} : void 0,
|
|
9442
9472
|
updateResource: p ? (e, t) => {
|
|
9443
9473
|
let n = Id(e);
|
|
9444
|
-
p.update(n, t), Ec(c, n, t),
|
|
9474
|
+
p.update(n, t), Ec(c, n, t), M(), T(k(), "");
|
|
9445
9475
|
} : void 0,
|
|
9446
9476
|
deleteResource: p ? (e) => p.delete(e) : void 0,
|
|
9447
9477
|
listResources: p ? () => p.list() : void 0
|
|
9448
|
-
},
|
|
9478
|
+
}, N = (e) => {
|
|
9449
9479
|
n.onAudit?.(e);
|
|
9450
9480
|
};
|
|
9451
|
-
function
|
|
9481
|
+
function se(e, t) {
|
|
9452
9482
|
let n = Oc(l()), r = g.length ? g[g.length - 1].id + 1 : 1;
|
|
9453
9483
|
for (g.push({
|
|
9454
9484
|
id: r,
|
|
@@ -9481,7 +9511,7 @@ function hf(e, n = {}) {
|
|
|
9481
9511
|
if (u.action === "restore") {
|
|
9482
9512
|
await i?.reacquire();
|
|
9483
9513
|
let e = k();
|
|
9484
|
-
if (e !== o) return
|
|
9514
|
+
if (e !== o) return N({
|
|
9485
9515
|
op: "conflict_recheck",
|
|
9486
9516
|
detail: `restore 裁决基于 ${o} 恢复时 ${e}(ask 窗口新修改落地,回退被拦)`,
|
|
9487
9517
|
timestamp: Date.now()
|
|
@@ -9497,13 +9527,13 @@ function hf(e, n = {}) {
|
|
|
9497
9527
|
message: `restore 裁决所锚定的快照 #${s} 已不在快照栈(可能被 maxSnapshots 淘汰)`,
|
|
9498
9528
|
hint: "重新 read 拿最新值,或用 restore_data 显式指定快照 id 回退"
|
|
9499
9529
|
});
|
|
9500
|
-
Bc(c, Oc(t.value)),
|
|
9530
|
+
Bc(c, Oc(t.value)), M();
|
|
9501
9531
|
let n = k();
|
|
9502
9532
|
return T(n, a), `已回退主数据到历史快照 #${t.id}[${t.op}]。当前值:${$(l(), 400)} (hash=${n})。请基于回退后的值重写或停止。`;
|
|
9503
9533
|
}
|
|
9504
9534
|
await i?.reacquire();
|
|
9505
9535
|
let d = k();
|
|
9506
|
-
return d === o ? (T(d, a), null) : (
|
|
9536
|
+
return d === o ? (T(d, a), null) : (N({
|
|
9507
9537
|
op: "conflict_recheck",
|
|
9508
9538
|
detail: `裁决基于 ${o} 恢复时 ${d}(ask 窗口新修改落地,overwrite 被拦)`,
|
|
9509
9539
|
timestamp: Date.now()
|
|
@@ -9516,7 +9546,7 @@ function hf(e, n = {}) {
|
|
|
9516
9546
|
let F = (e, t = !0) => {
|
|
9517
9547
|
e.writeCapable = t;
|
|
9518
9548
|
}, I = s(async ({ id: e }, t) => {
|
|
9519
|
-
let n = b(t), r = await
|
|
9549
|
+
let n = b(t), r = await A();
|
|
9520
9550
|
try {
|
|
9521
9551
|
if (!g.length) return Z({
|
|
9522
9552
|
code: "NO_SNAPSHOT",
|
|
@@ -9530,7 +9560,7 @@ function hf(e, n = {}) {
|
|
|
9530
9560
|
hint: "用 history_data({list:true}) 查看可用快照序号"
|
|
9531
9561
|
});
|
|
9532
9562
|
let r = o.safeParse(t.value);
|
|
9533
|
-
r.success ||
|
|
9563
|
+
r.success || N({
|
|
9534
9564
|
op: "restore",
|
|
9535
9565
|
detail: `#${t.id} 快照含当前 schema 违例 ${r.error.issues.length} 处(历史既有数据非本次写入,放行回退)`,
|
|
9536
9566
|
timestamp: Date.now()
|
|
@@ -9543,7 +9573,7 @@ function hf(e, n = {}) {
|
|
|
9543
9573
|
cur: n
|
|
9544
9574
|
});
|
|
9545
9575
|
}
|
|
9546
|
-
if (!i.length) return Bc(c, Oc(t.value)),
|
|
9576
|
+
if (!i.length) return Bc(c, Oc(t.value)), M(), N({
|
|
9547
9577
|
op: "restore",
|
|
9548
9578
|
detail: `#${t.id}`,
|
|
9549
9579
|
timestamp: Date.now()
|
|
@@ -9576,7 +9606,7 @@ function hf(e, n = {}) {
|
|
|
9576
9606
|
}
|
|
9577
9607
|
e.val === void 0 ? l.push(e.p) : Ec(c, n, e.val), s.push(e.p);
|
|
9578
9608
|
}
|
|
9579
|
-
|
|
9609
|
+
M(), N({
|
|
9580
9610
|
op: "restore",
|
|
9581
9611
|
detail: `#${t.id}(保护字段保留 ${s.length}${l.length ? `,未能回填 ${l.length}` : ""})`,
|
|
9582
9612
|
timestamp: Date.now()
|
|
@@ -9656,7 +9686,7 @@ function hf(e, n = {}) {
|
|
|
9656
9686
|
details: { expr: e }
|
|
9657
9687
|
});
|
|
9658
9688
|
}
|
|
9659
|
-
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, {
|
|
9660
9690
|
rootExempt: !1,
|
|
9661
9691
|
rootPath: String(e.path ?? ""),
|
|
9662
9692
|
fullTextPrefixes: s,
|
|
@@ -9759,7 +9789,7 @@ function hf(e, n = {}) {
|
|
|
9759
9789
|
details: { scriptLen: e.length }
|
|
9760
9790
|
});
|
|
9761
9791
|
if (u) {
|
|
9762
|
-
let e = await
|
|
9792
|
+
let e = await A();
|
|
9763
9793
|
try {
|
|
9764
9794
|
let n = await P("edit", O ? w(s) : void 0, void 0, e, s);
|
|
9765
9795
|
if (n !== null) return n;
|
|
@@ -9774,13 +9804,13 @@ function hf(e, n = {}) {
|
|
|
9774
9804
|
allowKeys: d,
|
|
9775
9805
|
snapshots: g,
|
|
9776
9806
|
maxSnapshots: _,
|
|
9777
|
-
markDataDirty:
|
|
9807
|
+
markDataDirty: M,
|
|
9778
9808
|
schemaErrorMode: "schema_invalid",
|
|
9779
9809
|
snapshotLabel: "eval_transform_subtree",
|
|
9780
9810
|
internalAfterWrite: a,
|
|
9781
9811
|
protectedCtx: h
|
|
9782
9812
|
});
|
|
9783
|
-
return r.ok ? (
|
|
9813
|
+
return r.ok ? (N({
|
|
9784
9814
|
op: "edit",
|
|
9785
9815
|
detail: `eval_transform_subtree @ ${u}`,
|
|
9786
9816
|
timestamp: Date.now()
|
|
@@ -9795,7 +9825,7 @@ function hf(e, n = {}) {
|
|
|
9795
9825
|
message: `主数据 bind 为原始类型(${c === null ? "null" : typeof c}),eval transform(patches) 无法就地替换`,
|
|
9796
9826
|
hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹或集成方通过 sdk.setData 替换 bind"
|
|
9797
9827
|
});
|
|
9798
|
-
let e = await
|
|
9828
|
+
let e = await A();
|
|
9799
9829
|
try {
|
|
9800
9830
|
let n = await P("edit", O ? w(s) : void 0, void 0, e, s);
|
|
9801
9831
|
if (n !== null) return n;
|
|
@@ -9806,13 +9836,13 @@ function hf(e, n = {}) {
|
|
|
9806
9836
|
allowKeys: d,
|
|
9807
9837
|
snapshots: g,
|
|
9808
9838
|
maxSnapshots: _,
|
|
9809
|
-
markDataDirty:
|
|
9839
|
+
markDataDirty: M,
|
|
9810
9840
|
schemaErrorMode: "schema_invalid",
|
|
9811
9841
|
snapshotLabel: "eval_transform",
|
|
9812
9842
|
internalAfterWrite: a,
|
|
9813
9843
|
protectedCtx: h
|
|
9814
9844
|
});
|
|
9815
|
-
return r.ok ? (
|
|
9845
|
+
return r.ok ? (N({
|
|
9816
9846
|
op: "edit",
|
|
9817
9847
|
detail: `eval_transform(${r.applied.length} patches)`,
|
|
9818
9848
|
timestamp: Date.now()
|
|
@@ -9836,7 +9866,7 @@ function hf(e, n = {}) {
|
|
|
9836
9866
|
message: `主数据 bind 为原始类型(${c === null ? "null" : typeof c}),eval transform 无法就地替换外部持有的值引用`,
|
|
9837
9867
|
hint: "主数据 bind 必须为对象/数组;叶子值请用对象包裹或集成方通过 sdk.setData 替换 bind"
|
|
9838
9868
|
});
|
|
9839
|
-
let i = await
|
|
9869
|
+
let i = await A();
|
|
9840
9870
|
try {
|
|
9841
9871
|
let e = await P("set", O ? w(s) : void 0, n, i, s);
|
|
9842
9872
|
if (e !== null) return e;
|
|
@@ -9846,7 +9876,7 @@ function hf(e, n = {}) {
|
|
|
9846
9876
|
value: n,
|
|
9847
9877
|
bindRef: c
|
|
9848
9878
|
});
|
|
9849
|
-
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({
|
|
9850
9880
|
op: "edit",
|
|
9851
9881
|
detail: "eval_transform",
|
|
9852
9882
|
timestamp: Date.now()
|
|
@@ -9894,7 +9924,7 @@ function hf(e, n = {}) {
|
|
|
9894
9924
|
resolved: s,
|
|
9895
9925
|
resourcesByPath: h.resourcesByPath,
|
|
9896
9926
|
resourceStore: h.resourceStore
|
|
9897
|
-
})), 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, {
|
|
9898
9928
|
rootExempt: !0,
|
|
9899
9929
|
rootPath: i,
|
|
9900
9930
|
fullTextPrefixes: f,
|
|
@@ -9942,7 +9972,7 @@ function hf(e, n = {}) {
|
|
|
9942
9972
|
resolved: S,
|
|
9943
9973
|
resourcesByPath: h.resourcesByPath,
|
|
9944
9974
|
resourceStore: h.resourceStore
|
|
9945
|
-
})), 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, {
|
|
9946
9976
|
rootExempt: !0,
|
|
9947
9977
|
rootPath: _,
|
|
9948
9978
|
fullTextPrefixes: f,
|
|
@@ -9968,7 +9998,7 @@ function hf(e, n = {}) {
|
|
|
9968
9998
|
}), de = s(async ({ value: e, patch: t, patches: n, del: i, dryRun: s }, u) => {
|
|
9969
9999
|
let f = b(u), p = "set";
|
|
9970
10000
|
i ? p = "delete" : (n && n.length || t) && (p = "edit");
|
|
9971
|
-
let m = t?.value === void 0 ? e : t.value, v = await
|
|
10001
|
+
let m = t?.value === void 0 ? e : t.value, v = await A();
|
|
9972
10002
|
try {
|
|
9973
10003
|
let e = O ? w(f) : void 0;
|
|
9974
10004
|
if (s && e !== void 0) {
|
|
@@ -10009,13 +10039,13 @@ function hf(e, n = {}) {
|
|
|
10009
10039
|
let e = Oc(l());
|
|
10010
10040
|
return Dc(e, t.jsonPath) ? `dryRun(delete): 将删除 @ ${t.jsonPath}。预览剩余:${$(e, 600)}。未实际写入、未入快照。` : `dryRun(delete): @ ${t.jsonPath} 不存在(无需删除)。未实际写入。`;
|
|
10011
10041
|
}
|
|
10012
|
-
|
|
10042
|
+
se("delete");
|
|
10013
10043
|
let r = Dc(c, t.jsonPath);
|
|
10014
|
-
return
|
|
10044
|
+
return M(), N({
|
|
10015
10045
|
op: "delete",
|
|
10016
10046
|
detail: t.jsonPath,
|
|
10017
10047
|
timestamp: Date.now()
|
|
10018
|
-
}), a && (a(c, null),
|
|
10048
|
+
}), a && (a(c, null), M()), T(k(), f), r ? `已删除主数据 @ ${t.jsonPath}` : `主数据 @ ${t.jsonPath} 不存在(无需删除)`;
|
|
10019
10049
|
}
|
|
10020
10050
|
if (p === "edit") {
|
|
10021
10051
|
if (typeof c != "object" || !c) return Z({
|
|
@@ -10036,7 +10066,7 @@ function hf(e, n = {}) {
|
|
|
10036
10066
|
allowKeys: d,
|
|
10037
10067
|
snapshots: g,
|
|
10038
10068
|
maxSnapshots: _,
|
|
10039
|
-
markDataDirty:
|
|
10069
|
+
markDataDirty: M,
|
|
10040
10070
|
schemaErrorMode: "zod",
|
|
10041
10071
|
dryRun: s,
|
|
10042
10072
|
internalAfterWrite: a,
|
|
@@ -10044,13 +10074,13 @@ function hf(e, n = {}) {
|
|
|
10044
10074
|
});
|
|
10045
10075
|
if (!l.ok) return l.error;
|
|
10046
10076
|
if (s) return `dryRun(edit): ${l.applied.length} 个 patch 预检通过(schema 校验 OK)。预览结果:${$(l.clone, 600)}。未实际写入、未入快照。`;
|
|
10047
|
-
|
|
10077
|
+
N({
|
|
10048
10078
|
op: "edit",
|
|
10049
10079
|
detail: `${l.applied.length} 个 patch${l.applied.length > 1 ? "(批量)" : ""}`,
|
|
10050
10080
|
value: l.applied.map((e) => `${e.op}@${e.jp}`),
|
|
10051
10081
|
timestamp: Date.now()
|
|
10052
10082
|
});
|
|
10053
|
-
let u =
|
|
10083
|
+
let u = re(f);
|
|
10054
10084
|
return mf(l.clone), `已 write(edit) 主数据(${l.applied.length} 个 patch)。当前值:${$(l.clone, 600)} (新 hash=${u})`;
|
|
10055
10085
|
}
|
|
10056
10086
|
let i = Ac(m);
|
|
@@ -10064,9 +10094,9 @@ function hf(e, n = {}) {
|
|
|
10064
10094
|
allowKeys: d,
|
|
10065
10095
|
snapshots: g,
|
|
10066
10096
|
maxSnapshots: _,
|
|
10067
|
-
audit:
|
|
10097
|
+
audit: N,
|
|
10068
10098
|
dryRun: s,
|
|
10069
|
-
onWrite:
|
|
10099
|
+
onWrite: M,
|
|
10070
10100
|
internalAfterWrite: a,
|
|
10071
10101
|
protectedCtx: h,
|
|
10072
10102
|
hashFn: k
|
|
@@ -10196,7 +10226,7 @@ function hf(e, n = {}) {
|
|
|
10196
10226
|
}
|
|
10197
10227
|
});
|
|
10198
10228
|
}
|
|
10199
|
-
let f = await
|
|
10229
|
+
let f = await A();
|
|
10200
10230
|
try {
|
|
10201
10231
|
let n = await P("set", O ? w(i) : void 0, u, f, i);
|
|
10202
10232
|
if (n !== null) return n;
|
|
@@ -10207,9 +10237,9 @@ function hf(e, n = {}) {
|
|
|
10207
10237
|
allowKeys: d,
|
|
10208
10238
|
snapshots: g,
|
|
10209
10239
|
maxSnapshots: _,
|
|
10210
|
-
audit:
|
|
10240
|
+
audit: N,
|
|
10211
10241
|
op: "draft_commit",
|
|
10212
|
-
onWrite:
|
|
10242
|
+
onWrite: M,
|
|
10213
10243
|
internalAfterWrite: a,
|
|
10214
10244
|
protectedCtx: h,
|
|
10215
10245
|
hashFn: k
|
|
@@ -10225,7 +10255,7 @@ function hf(e, n = {}) {
|
|
|
10225
10255
|
});
|
|
10226
10256
|
F(l), me.push(i, l);
|
|
10227
10257
|
}
|
|
10228
|
-
let
|
|
10258
|
+
let z = [];
|
|
10229
10259
|
if (e.resources?.length && p) {
|
|
10230
10260
|
let e = s(async ({ path: e, handle: t }) => {
|
|
10231
10261
|
let n = e;
|
|
@@ -10295,9 +10325,9 @@ function hf(e, n = {}) {
|
|
|
10295
10325
|
details: oi(n.error.issues)
|
|
10296
10326
|
});
|
|
10297
10327
|
}
|
|
10298
|
-
let l = await
|
|
10328
|
+
let l = await A();
|
|
10299
10329
|
try {
|
|
10300
|
-
p.update(i, t), Ec(c, i, t), T(k(), r),
|
|
10330
|
+
p.update(i, t), Ec(c, i, t), T(k(), r), M();
|
|
10301
10331
|
} finally {
|
|
10302
10332
|
l.release();
|
|
10303
10333
|
}
|
|
@@ -10342,9 +10372,9 @@ function hf(e, n = {}) {
|
|
|
10342
10372
|
handle: t.string().optional().describe("占位符句柄(与 path 二选一)")
|
|
10343
10373
|
})
|
|
10344
10374
|
});
|
|
10345
|
-
F(i),
|
|
10375
|
+
F(i), z.push(e, n, r, i);
|
|
10346
10376
|
}
|
|
10347
|
-
let
|
|
10377
|
+
let B = [
|
|
10348
10378
|
I,
|
|
10349
10379
|
ce,
|
|
10350
10380
|
L,
|
|
@@ -10355,9 +10385,9 @@ function hf(e, n = {}) {
|
|
|
10355
10385
|
fe,
|
|
10356
10386
|
pe,
|
|
10357
10387
|
...me,
|
|
10358
|
-
...
|
|
10388
|
+
...z
|
|
10359
10389
|
];
|
|
10360
|
-
function
|
|
10390
|
+
function V(e) {
|
|
10361
10391
|
let t = e, n = (e) => {
|
|
10362
10392
|
if (e === void 0) return "undefined";
|
|
10363
10393
|
let t = $(e, 200);
|
|
@@ -10451,23 +10481,23 @@ function hf(e, n = {}) {
|
|
|
10451
10481
|
}]
|
|
10452
10482
|
};
|
|
10453
10483
|
}
|
|
10454
|
-
Object.defineProperty(
|
|
10455
|
-
value:
|
|
10484
|
+
Object.defineProperty(B, "controller", {
|
|
10485
|
+
value: oe,
|
|
10456
10486
|
enumerable: !1,
|
|
10457
10487
|
configurable: !1,
|
|
10458
10488
|
writable: !1
|
|
10459
|
-
}), Object.defineProperty(
|
|
10460
|
-
value:
|
|
10489
|
+
}), Object.defineProperty(B, "previewWrite", {
|
|
10490
|
+
value: V,
|
|
10461
10491
|
enumerable: !1,
|
|
10462
10492
|
configurable: !1,
|
|
10463
10493
|
writable: !1
|
|
10464
10494
|
});
|
|
10465
|
-
for (let e of
|
|
10495
|
+
for (let e of B) Object.defineProperty(e, "__dataOpsScoped", {
|
|
10466
10496
|
value: !0,
|
|
10467
10497
|
enumerable: !1,
|
|
10468
10498
|
configurable: !1
|
|
10469
10499
|
});
|
|
10470
|
-
return
|
|
10500
|
+
return B;
|
|
10471
10501
|
}
|
|
10472
10502
|
//#endregion
|
|
10473
10503
|
//#region src/core/tools/htmlValidate.ts
|
|
@@ -12064,7 +12094,7 @@ function Vp(e) {
|
|
|
12064
12094
|
//#endregion
|
|
12065
12095
|
//#region src/core/sdk/conflictManager.ts
|
|
12066
12096
|
function Hp(e, t, n) {
|
|
12067
|
-
let r = /* @__PURE__ */
|
|
12097
|
+
let r = /* @__PURE__ */ Gt(null), i = 0;
|
|
12068
12098
|
function a(a, o) {
|
|
12069
12099
|
let s = t?.() ?? "ask";
|
|
12070
12100
|
if (s !== "ask") {
|
|
@@ -15062,7 +15092,7 @@ function J_(e, t, n, r) {
|
|
|
15062
15092
|
}), i;
|
|
15063
15093
|
},
|
|
15064
15094
|
afterModel: (t) => {
|
|
15065
|
-
let n =
|
|
15095
|
+
let n = re(t.message);
|
|
15066
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({
|
|
15067
15097
|
type: "usage",
|
|
15068
15098
|
round: i,
|
|
@@ -15106,7 +15136,7 @@ function X_(e, n, r) {
|
|
|
15106
15136
|
prompt_tokens: 0,
|
|
15107
15137
|
completion_tokens: 0,
|
|
15108
15138
|
total_tokens: 0
|
|
15109
|
-
}, o = Hp(() =>
|
|
15139
|
+
}, o = Hp(() => Y, () => e.conflictPolicy ?? "ask", () => X.agent?.debugLogs?.value), c = /* @__PURE__ */ Gt(0), l = _m(e.storage);
|
|
15110
15140
|
l && (e.debug && l.onEvent((e) => console.log("[page-agent-sdk][storage]", e)), l.onEvent((e) => {
|
|
15111
15141
|
e.type === "quota" && X.agent?.debugLogs?.value?.push({
|
|
15112
15142
|
timestamp: Date.now(),
|
|
@@ -15126,9 +15156,9 @@ function X_(e, n, r) {
|
|
|
15126
15156
|
}
|
|
15127
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;
|
|
15128
15158
|
e.debug && !d && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
15129
|
-
let w = /* @__PURE__ */
|
|
15159
|
+
let w = /* @__PURE__ */ Pt([]), T = xd(e.vfs?.initialFiles, {
|
|
15130
15160
|
persist: l ? { save: (e) => {
|
|
15131
|
-
|
|
15161
|
+
vn.persistSave({ vfs: e });
|
|
15132
15162
|
} } : void 0,
|
|
15133
15163
|
maxBytes: e.vfs?.maxBytes,
|
|
15134
15164
|
poolBytes: e.vfs?.poolBytes
|
|
@@ -15147,16 +15177,16 @@ function X_(e, n, r) {
|
|
|
15147
15177
|
type: "middleware",
|
|
15148
15178
|
data: { stage: "resume_notice" }
|
|
15149
15179
|
});
|
|
15150
|
-
}), ne = Dm(),
|
|
15151
|
-
|
|
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({
|
|
15152
15182
|
type: "error",
|
|
15153
15183
|
message: `确认请求(${e.toolName})${Math.round(e.waitedMs / 1e3)}s 无响应已自动拒绝 —— 当前路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
15154
15184
|
severity: "observable",
|
|
15155
15185
|
code: "APPROVAL_AUTO_REJECTED",
|
|
15156
15186
|
context: e
|
|
15157
15187
|
});
|
|
15158
|
-
},
|
|
15159
|
-
ne.lastPlanConfirmation = e,
|
|
15188
|
+
}, ae = wu((e) => {
|
|
15189
|
+
ne.lastPlanConfirmation = e, vn.persistSave({ planConfirmation: e }), X.agent?.debugLogs?.value?.push({
|
|
15160
15190
|
timestamp: Date.now(),
|
|
15161
15191
|
type: "middleware",
|
|
15162
15192
|
data: {
|
|
@@ -15166,24 +15196,24 @@ function X_(e, n, r) {
|
|
|
15166
15196
|
}
|
|
15167
15197
|
});
|
|
15168
15198
|
}, {
|
|
15169
|
-
timeoutMs:
|
|
15170
|
-
onAutoReject:
|
|
15171
|
-
}),
|
|
15172
|
-
getSchema: () =>
|
|
15173
|
-
getBind: () =>
|
|
15174
|
-
onChange: (e) =>
|
|
15199
|
+
timeoutMs: re,
|
|
15200
|
+
onAutoReject: ie
|
|
15201
|
+
}), j = Zc({
|
|
15202
|
+
getSchema: () => W()?.schema,
|
|
15203
|
+
getBind: () => W()?.bind,
|
|
15204
|
+
onChange: (e) => Y({
|
|
15175
15205
|
type: "focus_change",
|
|
15176
15206
|
focuses: e
|
|
15177
15207
|
})
|
|
15178
|
-
}),
|
|
15179
|
-
let t = Yc(
|
|
15208
|
+
}), M = (e) => {
|
|
15209
|
+
let t = Yc(W()?.bind, e.path);
|
|
15180
15210
|
return t ? {
|
|
15181
15211
|
...e,
|
|
15182
15212
|
pgId: t
|
|
15183
15213
|
} : e;
|
|
15184
|
-
},
|
|
15185
|
-
typeof e.memory == "function" &&
|
|
15186
|
-
let
|
|
15214
|
+
}, oe = fu(), N = pu(e.memory || "");
|
|
15215
|
+
typeof e.memory == "function" && N.refresh();
|
|
15216
|
+
let se = { current: null }, P = e.data ? {
|
|
15187
15217
|
...e.data,
|
|
15188
15218
|
description: e.data.description ?? "主数据对象"
|
|
15189
15219
|
} : void 0, F = !(e.subagents ?? []).some((e) => e._codeAsset) && bm(e.capabilities).subagent, I = e.subagents;
|
|
@@ -15194,41 +15224,41 @@ function X_(e, n, r) {
|
|
|
15194
15224
|
let t = Js(P?.schema, e._codeAsset.codeField);
|
|
15195
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));
|
|
15196
15226
|
}
|
|
15197
|
-
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,
|
|
15198
|
-
getData: () =>
|
|
15199
|
-
consumeDataDirty: () =>
|
|
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,
|
|
15200
15230
|
slotPaths: P ? [""] : [],
|
|
15201
15231
|
vfsStore: T,
|
|
15202
15232
|
todosMw: D,
|
|
15203
|
-
getTodos: () =>
|
|
15233
|
+
getTodos: () => se.current?.getState?.()?.todos ?? [],
|
|
15204
15234
|
messages: w,
|
|
15205
15235
|
maxCheckpoints: pe && typeof pe == "object" ? pe.maxCheckpoints : void 0
|
|
15206
|
-
}) : null,
|
|
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({
|
|
15207
15237
|
...e,
|
|
15208
15238
|
locale: e.i18n?.locale,
|
|
15209
|
-
dataOps:
|
|
15210
|
-
domInspect:
|
|
15211
|
-
screenshot:
|
|
15239
|
+
dataOps: he && !!P,
|
|
15240
|
+
domInspect: V.domInspect === !0,
|
|
15241
|
+
screenshot: ve
|
|
15212
15242
|
});
|
|
15213
15243
|
if (ue) {
|
|
15214
15244
|
let e = R.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
|
|
15215
|
-
e && (
|
|
15216
|
-
} else P?.schema && qs(P.schema) && (
|
|
15217
|
-
let
|
|
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, {
|
|
15218
15248
|
onAudit: e.onAudit ?? (e.debug ? (e) => console.log("[page-agent-sdk][data audit]", e) : void 0),
|
|
15219
15249
|
maxSnapshots: e.maxSnapshots,
|
|
15220
15250
|
onConflict: o.set,
|
|
15221
15251
|
conflictWatchFields: e.conflictWatchFields,
|
|
15222
15252
|
maxParallelTools: e.maxParallelTools,
|
|
15223
|
-
vfsStore:
|
|
15253
|
+
vfsStore: ge || P?.resources?.length ? T : void 0,
|
|
15224
15254
|
...de.length ? { pgIdPaths: de } : {},
|
|
15225
15255
|
...fe.length ? { largeTextPaths: fe } : {}
|
|
15226
|
-
}) : [],
|
|
15227
|
-
getBind: () =>
|
|
15228
|
-
recomputeAll: () =>
|
|
15229
|
-
hasBaselines: () =>
|
|
15230
|
-
isManaged: (e) =>
|
|
15231
|
-
hash: (e) =>
|
|
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)),
|
|
15232
15262
|
log: (e, t) => {
|
|
15233
15263
|
let n = X.agent?.debugLogs;
|
|
15234
15264
|
n && (n.value.push({
|
|
@@ -15240,27 +15270,27 @@ function X_(e, n, r) {
|
|
|
15240
15270
|
}
|
|
15241
15271
|
}), Jt(n));
|
|
15242
15272
|
}
|
|
15243
|
-
}) : void 0,
|
|
15244
|
-
|
|
15245
|
-
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) => {
|
|
15246
15276
|
if (e.type === "tool_result" && e.name === "take_screenshot") {
|
|
15247
|
-
let t =
|
|
15277
|
+
let t = De.find((e) => !e.eventConsumed);
|
|
15248
15278
|
if (t) return t.eventConsumed = !0, Object.assign(e, { image: {
|
|
15249
15279
|
dataUri: t.image.dataUri,
|
|
15250
15280
|
vfsRef: t.meta.vfsRef
|
|
15251
15281
|
} });
|
|
15252
15282
|
}
|
|
15253
15283
|
return e;
|
|
15254
|
-
},
|
|
15284
|
+
}, ke = g.vision === !0 || typeof e.images?.describe == "function" ? sg({
|
|
15255
15285
|
getVision: () => g.vision === !0,
|
|
15256
15286
|
describe: e.images?.describe,
|
|
15257
15287
|
onShot: (e, t) => {
|
|
15258
|
-
|
|
15288
|
+
De.push({
|
|
15259
15289
|
image: e,
|
|
15260
15290
|
meta: t
|
|
15261
15291
|
});
|
|
15262
15292
|
}
|
|
15263
|
-
}) : void 0,
|
|
15293
|
+
}) : void 0, Ae = ve ? ag({
|
|
15264
15294
|
render: e.screenshot?.renderer,
|
|
15265
15295
|
getActiveFocus: () => X.getFocus(),
|
|
15266
15296
|
focusSelector: e.screenshot?.focusSelector,
|
|
@@ -15278,24 +15308,24 @@ function X_(e, n, r) {
|
|
|
15278
15308
|
getVision: () => g.vision === !0,
|
|
15279
15309
|
describe: e.images?.describe,
|
|
15280
15310
|
onShot: (e, t) => {
|
|
15281
|
-
|
|
15311
|
+
De.push({
|
|
15282
15312
|
image: e,
|
|
15283
15313
|
meta: t
|
|
15284
15314
|
});
|
|
15285
15315
|
}
|
|
15286
|
-
}) : void 0,
|
|
15316
|
+
}) : void 0, je = !Ap(e.llm) && (e.llm.provider ?? "openai") === "anthropic" ? "anthropic" : "openai", Me = Ae || ke ? {
|
|
15287
15317
|
name: "screenshotChannel",
|
|
15288
15318
|
wrapModelCall: async (e, t) => {
|
|
15289
|
-
if (
|
|
15290
|
-
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) => ({
|
|
15291
15321
|
dataUri: e.image.dataUri,
|
|
15292
15322
|
url: e.image.url
|
|
15293
|
-
})),
|
|
15323
|
+
})), je);
|
|
15294
15324
|
n && e.messages.push(new i({ content: n }));
|
|
15295
15325
|
}
|
|
15296
15326
|
return t(e);
|
|
15297
15327
|
}
|
|
15298
|
-
} : null,
|
|
15328
|
+
} : null, Ne = !1, Pe = V.domEdit ? bg({
|
|
15299
15329
|
onEdit: (e) => {
|
|
15300
15330
|
X.agent?.debugLogs?.value?.push({
|
|
15301
15331
|
timestamp: Date.now(),
|
|
@@ -15306,22 +15336,22 @@ function X_(e, n, r) {
|
|
|
15306
15336
|
applied: e.applied,
|
|
15307
15337
|
dryRun: e.dryRun
|
|
15308
15338
|
}
|
|
15309
|
-
}), !e.dryRun && e.applied > 0 && (
|
|
15339
|
+
}), !e.dryRun && e.applied > 0 && (Ne = !0);
|
|
15310
15340
|
},
|
|
15311
15341
|
onRestore: (e) => {
|
|
15312
|
-
e.restored > 0 && (
|
|
15342
|
+
e.restored > 0 && (Ne = !0);
|
|
15313
15343
|
}
|
|
15314
|
-
}) : [],
|
|
15344
|
+
}) : [], Fe = [...E_(V, be, Lg, V.domInspect ? [
|
|
15315
15345
|
...Yg,
|
|
15316
|
-
...
|
|
15317
|
-
...
|
|
15318
|
-
...
|
|
15319
|
-
] : [], v_), ...
|
|
15320
|
-
|
|
15321
|
-
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, {
|
|
15322
15352
|
emit: (e) => {
|
|
15323
15353
|
try {
|
|
15324
|
-
|
|
15354
|
+
Y(e);
|
|
15325
15355
|
} catch {}
|
|
15326
15356
|
},
|
|
15327
15357
|
log: (e, t) => {
|
|
@@ -15335,31 +15365,31 @@ function X_(e, n, r) {
|
|
|
15335
15365
|
}
|
|
15336
15366
|
});
|
|
15337
15367
|
}
|
|
15338
|
-
}) : null,
|
|
15339
|
-
|
|
15340
|
-
let
|
|
15341
|
-
|
|
15342
|
-
let
|
|
15343
|
-
|
|
15344
|
-
let
|
|
15345
|
-
let e =
|
|
15346
|
-
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,无法回退。";
|
|
15347
15377
|
}, {
|
|
15348
15378
|
name: "restore_last_checkpoint",
|
|
15349
15379
|
description: "回退到最近一次正常状态(整体还原对话历史 + 主数据 + vfs + todos)。当本轮操作出错、页面被改坏、或走偏时调用,回到本轮起点重新来过。不传参数即回退最近一次。",
|
|
15350
15380
|
schema: t.object({}).optional()
|
|
15351
15381
|
}), s(async () => {
|
|
15352
|
-
let e =
|
|
15382
|
+
let e = z.list();
|
|
15353
15383
|
return e.length ? "可用 checkpoint:\n" + e.map((e) => `#${e.id} [${e.label ?? "auto"}] 消息数=${e.messageCount} 时间=${new Date(e.timestamp).toLocaleTimeString()}`).join("\n") : "无可用 checkpoint。";
|
|
15354
15384
|
}, {
|
|
15355
15385
|
name: "list_checkpoints",
|
|
15356
15386
|
description: "列出可用会话 checkpoint(回退点)。",
|
|
15357
15387
|
schema: t.object({}).optional()
|
|
15358
15388
|
})] : [];
|
|
15359
|
-
|
|
15360
|
-
let
|
|
15361
|
-
let n =
|
|
15362
|
-
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({
|
|
15363
15393
|
path: e,
|
|
15364
15394
|
...t ? { label: t } : {}
|
|
15365
15395
|
}), "agent"), `已聚焦到 ${e}${t ? `(${t})` : ""}。后续仅可写该子树(越界被拒),每轮只看到该组件结构。完成精修后调 clear_focus 退出。`) : `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。` : "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
@@ -15370,19 +15400,19 @@ function X_(e, n, r) {
|
|
|
15370
15400
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
15371
15401
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
15372
15402
|
})
|
|
15373
|
-
}),
|
|
15403
|
+
}), Xe = s(async () => (j.clearFocus("agent"), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
15374
15404
|
name: "clear_focus",
|
|
15375
15405
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
15376
15406
|
schema: t.object({}).optional()
|
|
15377
|
-
}),
|
|
15378
|
-
let n =
|
|
15407
|
+
}), Ze = s(async ({ path: e, label: t }) => {
|
|
15408
|
+
let n = W()?.schema;
|
|
15379
15409
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
15380
15410
|
if (!Is(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
15381
|
-
|
|
15411
|
+
j.addFocus(M({
|
|
15382
15412
|
path: e,
|
|
15383
15413
|
...t ? { label: t } : {}
|
|
15384
15414
|
}), "agent");
|
|
15385
|
-
let r =
|
|
15415
|
+
let r = j.getFocuses();
|
|
15386
15416
|
return `已聚焦 ${e}${t ? `(${t})` : ""}(当前共 ${r.length} 个焦点:${r.map((e) => e.path).join(", ")})。后续仅可写这些子树之一(越界被拒)。`;
|
|
15387
15417
|
}, {
|
|
15388
15418
|
name: "add_focus",
|
|
@@ -15391,72 +15421,72 @@ function X_(e, n, r) {
|
|
|
15391
15421
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
15392
15422
|
label: t.string().optional().describe("人类可读标签")
|
|
15393
15423
|
})
|
|
15394
|
-
}),
|
|
15395
|
-
let t =
|
|
15396
|
-
|
|
15397
|
-
let n =
|
|
15424
|
+
}), Qe = s(async ({ path: e }) => {
|
|
15425
|
+
let t = j.getFocuses().length;
|
|
15426
|
+
j.removeFocus(e, "agent");
|
|
15427
|
+
let n = j.getFocuses();
|
|
15398
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},聚焦已清空,恢复全量操作范围。`;
|
|
15399
15429
|
}, {
|
|
15400
15430
|
name: "remove_focus",
|
|
15401
15431
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
15402
15432
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
15403
|
-
}),
|
|
15433
|
+
}), $e = Je ? [
|
|
15434
|
+
Ye,
|
|
15404
15435
|
Xe,
|
|
15405
15436
|
Ze,
|
|
15406
|
-
Qe
|
|
15407
|
-
$e
|
|
15437
|
+
Qe
|
|
15408
15438
|
] : [];
|
|
15409
|
-
|
|
15410
|
-
let
|
|
15411
|
-
builtinTools: () =>
|
|
15412
|
-
userTools: () =>
|
|
15413
|
-
actionTools: () =>
|
|
15414
|
-
humanConfirmTool: () =>
|
|
15415
|
-
checkpointTools: () =>
|
|
15416
|
-
focusTools: () =>
|
|
15417
|
-
mcpTools: () =>
|
|
15418
|
-
loadedSkillTools: () =>
|
|
15419
|
-
}),
|
|
15420
|
-
if (
|
|
15421
|
-
if (
|
|
15422
|
-
let
|
|
15423
|
-
e.debug &&
|
|
15424
|
-
let
|
|
15425
|
-
|
|
15426
|
-
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({
|
|
15427
15457
|
...e.approval,
|
|
15428
|
-
timeoutMs: e.approval.timeoutMs ??
|
|
15429
|
-
onAutoReject:
|
|
15430
|
-
previewWrite:
|
|
15431
|
-
}) : void 0,
|
|
15432
|
-
...
|
|
15433
|
-
...
|
|
15434
|
-
...
|
|
15435
|
-
],
|
|
15436
|
-
llm:
|
|
15437
|
-
allTools: () => X.agent?.allTools ??
|
|
15438
|
-
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,
|
|
15439
15469
|
...e.staleReadInvalidation === void 0 ? {} : { staleReadInvalidation: e.staleReadInvalidation },
|
|
15440
|
-
systemPrompt:
|
|
15441
|
-
temperature:
|
|
15442
|
-
maxTokens:
|
|
15443
|
-
skills:
|
|
15444
|
-
maxDepth:
|
|
15445
|
-
maxParallel:
|
|
15446
|
-
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,
|
|
15447
15477
|
debug: e.debug,
|
|
15448
|
-
getFocuses: () =>
|
|
15449
|
-
getSchema: () =>
|
|
15450
|
-
tracker:
|
|
15451
|
-
guardMiddleware:
|
|
15452
|
-
getVfsFiles:
|
|
15453
|
-
enterDataScope:
|
|
15454
|
-
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,
|
|
15455
15485
|
onUsage: (e) => {
|
|
15456
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);
|
|
15457
15487
|
},
|
|
15458
|
-
timeoutMs:
|
|
15459
|
-
}),
|
|
15488
|
+
timeoutMs: vt?.timeoutMs
|
|
15489
|
+
}), Et = le?.map((e) => {
|
|
15460
15490
|
if (!e._codeAsset) return e;
|
|
15461
15491
|
let t = e._codeAsset, n = Nf({
|
|
15462
15492
|
writablePaths: t.writablePaths,
|
|
@@ -15465,95 +15495,95 @@ function X_(e, n, r) {
|
|
|
15465
15495
|
codeField: t.codeField,
|
|
15466
15496
|
craftNotes: t.craftNotes,
|
|
15467
15497
|
onWarning: (e) => console.warn(`[page-agent-sdk][code-asset] ${e}`),
|
|
15468
|
-
getController: () =>
|
|
15498
|
+
getController: () => U,
|
|
15469
15499
|
vfsStore: T
|
|
15470
15500
|
}), r = [...e.middleware ?? [], n];
|
|
15471
|
-
for (let e of r) e && os(e) && e._setGetController(() =>
|
|
15501
|
+
for (let e of r) e && os(e) && e._setGetController(() => U);
|
|
15472
15502
|
return {
|
|
15473
15503
|
...e,
|
|
15474
15504
|
middleware: r
|
|
15475
15505
|
};
|
|
15476
|
-
}),
|
|
15477
|
-
getBind: () =>
|
|
15506
|
+
}), Dt = ue && dt ? Pf() : void 0, Ot = Dt ? Vf({
|
|
15507
|
+
getBind: () => W()?.bind,
|
|
15478
15508
|
writablePaths: de,
|
|
15479
|
-
getLocked: () =>
|
|
15480
|
-
tools:
|
|
15481
|
-
getCodeFieldPaths: () => zf(
|
|
15509
|
+
getLocked: () => Dt.locked(),
|
|
15510
|
+
tools: K,
|
|
15511
|
+
getCodeFieldPaths: () => zf(W()?.bind, R.map((e) => ({
|
|
15482
15512
|
writablePaths: e._codeAsset.writablePaths,
|
|
15483
15513
|
codeField: e._codeAsset.codeField
|
|
15484
15514
|
})))
|
|
15485
|
-
}) : void 0,
|
|
15486
|
-
getSummarizedPaths: () =>
|
|
15487
|
-
clearSummarizedPaths: () =>
|
|
15488
|
-
}) : 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, {
|
|
15489
15519
|
llm: e.llm,
|
|
15490
15520
|
thinkingModeDefault: e.subagent?.thinkingMode,
|
|
15491
15521
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
15492
|
-
allTools: () => X.agent?.allTools ??
|
|
15522
|
+
allTools: () => X.agent?.allTools ?? K,
|
|
15493
15523
|
debug: e.debug,
|
|
15494
|
-
getFocuses: () =>
|
|
15495
|
-
getSchema: () =>
|
|
15496
|
-
getBind: () =>
|
|
15497
|
-
tracker:
|
|
15498
|
-
guardMiddleware:
|
|
15499
|
-
getVfsFiles:
|
|
15500
|
-
enterDataScope:
|
|
15501
|
-
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,
|
|
15502
15532
|
onUsage: (e) => {
|
|
15503
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);
|
|
15504
15534
|
},
|
|
15505
15535
|
timeoutMs: e.subagent?.timeoutMs,
|
|
15506
|
-
...
|
|
15507
|
-
componentLock:
|
|
15508
|
-
resolveComponents: (e) => Ff(e, kf(
|
|
15536
|
+
...Dt ? {
|
|
15537
|
+
componentLock: Dt,
|
|
15538
|
+
resolveComponents: (e) => Ff(e, kf(W()?.bind, de))
|
|
15509
15539
|
} : {}
|
|
15510
|
-
}) : void 0,
|
|
15540
|
+
}) : void 0, jt = At ? At.controller : null, Mt = (t) => {
|
|
15511
15541
|
let n = t.thinkingMode ?? e.subagent?.thinkingMode, r = n ? Ap(t.llm ?? e.llm) ? "instance-noop" : "applied" : "inherited";
|
|
15512
15542
|
return {
|
|
15513
15543
|
...t,
|
|
15514
15544
|
...n ? { thinkingMode: n } : {},
|
|
15515
15545
|
thinkingApplied: r
|
|
15516
15546
|
};
|
|
15517
|
-
},
|
|
15547
|
+
}, Nt = ["read", "fetch_document"], Ft = K.filter((e) => Nt.includes(e.name)), It = gt ? Fu({
|
|
15518
15548
|
check: e.verify.check ?? Vu({
|
|
15519
|
-
schemas: () =>
|
|
15520
|
-
root: () =>
|
|
15549
|
+
schemas: () => W() ? { "": W().schema } : {},
|
|
15550
|
+
root: () => W()?.bind
|
|
15521
15551
|
}),
|
|
15522
15552
|
adversarial: e.verify?.adversarial ? {
|
|
15523
15553
|
llm: e.llm,
|
|
15524
|
-
tools:
|
|
15554
|
+
tools: Ft
|
|
15525
15555
|
} : void 0
|
|
15526
|
-
}) : void 0,
|
|
15556
|
+
}) : void 0, Lt = _t ? td({
|
|
15527
15557
|
contextWindow: g.contextWindow,
|
|
15528
15558
|
thresholdRatio: wm(e, g.contextWindow).summaryThresholdRatio
|
|
15529
|
-
}) : void 0,
|
|
15530
|
-
...
|
|
15531
|
-
humanConfirm:
|
|
15532
|
-
screenshot: !!
|
|
15533
|
-
domEdit:
|
|
15559
|
+
}) : void 0, Rt = j_({
|
|
15560
|
+
...V,
|
|
15561
|
+
humanConfirm: Ge,
|
|
15562
|
+
screenshot: !!Ae,
|
|
15563
|
+
domEdit: V.domEdit,
|
|
15534
15564
|
hasActions: !!e.actions && Object.keys(e.actions).length > 0,
|
|
15535
15565
|
hasProposals: !!e.proposals,
|
|
15536
|
-
viewImage: !!
|
|
15537
|
-
subagents: le?.map(
|
|
15538
|
-
},
|
|
15566
|
+
viewImage: !!ke,
|
|
15567
|
+
subagents: le?.map(Mt)
|
|
15568
|
+
}, he && !!P, { promptSoftCap: Nl(g.contextWindow, y.promptSoftCapTokens) }), zt = V.pageContext ? N_({
|
|
15539
15569
|
getPageInfo: () => typeof document < "u" && typeof location < "u" ? {
|
|
15540
15570
|
title: document.title || "",
|
|
15541
15571
|
url: location.href
|
|
15542
15572
|
} : null,
|
|
15543
|
-
canReadPage:
|
|
15544
|
-
}) : void 0,
|
|
15573
|
+
canReadPage: V.domInspect === !0
|
|
15574
|
+
}) : void 0, q = {
|
|
15545
15575
|
epoch: 0,
|
|
15546
15576
|
notices: [],
|
|
15547
15577
|
readsInvalidated: 0
|
|
15548
|
-
},
|
|
15578
|
+
}, Bt = 0, J = {
|
|
15549
15579
|
name: "hostNotice",
|
|
15550
15580
|
beforeAgent: () => {
|
|
15551
|
-
|
|
15581
|
+
Bt = q.epoch;
|
|
15552
15582
|
},
|
|
15553
15583
|
wrapModelCall: async (e, t) => {
|
|
15554
|
-
if (
|
|
15555
|
-
|
|
15556
|
-
let t = eo(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态",
|
|
15584
|
+
if (Ne) {
|
|
15585
|
+
Ne = !1;
|
|
15586
|
+
let t = eo(e.messages, "agent 已通过 dom_edit 修改页面,此前读取为改前状态", Ve);
|
|
15557
15587
|
if (t.invalidatedCount > 0) {
|
|
15558
15588
|
for (let n = 0; n < t.messages.length; n++) e.messages[n] = t.messages[n];
|
|
15559
15589
|
X.agent?.debugLogs?.value?.push({
|
|
@@ -15566,18 +15596,18 @@ function X_(e, n, r) {
|
|
|
15566
15596
|
});
|
|
15567
15597
|
}
|
|
15568
15598
|
}
|
|
15569
|
-
if (
|
|
15570
|
-
|
|
15571
|
-
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);
|
|
15572
15602
|
if (n.invalidatedCount > 0) {
|
|
15573
15603
|
for (let t = 0; t < n.messages.length; t++) e.messages[t] = n.messages[t];
|
|
15574
|
-
|
|
15604
|
+
q.readsInvalidated += n.invalidatedCount, X.agent?.debugLogs?.value?.push({
|
|
15575
15605
|
timestamp: Date.now(),
|
|
15576
15606
|
type: "middleware",
|
|
15577
15607
|
data: {
|
|
15578
15608
|
stage: "host_read_invalidated",
|
|
15579
15609
|
count: n.invalidatedCount,
|
|
15580
|
-
epoch:
|
|
15610
|
+
epoch: q.epoch,
|
|
15581
15611
|
reason: t || void 0
|
|
15582
15612
|
}
|
|
15583
15613
|
});
|
|
@@ -15585,170 +15615,170 @@ function X_(e, n, r) {
|
|
|
15585
15615
|
}
|
|
15586
15616
|
return t(e);
|
|
15587
15617
|
},
|
|
15588
|
-
augmentPrompt: () =>
|
|
15618
|
+
augmentPrompt: () => q.notices.length ? [
|
|
15589
15619
|
"【宿主页面已变更】",
|
|
15590
|
-
...
|
|
15591
|
-
|
|
15620
|
+
...q.notices.filter(Boolean).map((e) => `· ${e}`),
|
|
15621
|
+
V.domInspect === !0 ? "此前的页面读取/截图结果已过期,回答任何关于当前页面的问题前必须重新 read_page / get_dom 读取当前页面;不要凭此前的读取结果或记忆作答。" : "页面内容可能已变化,断言页面前先核实当前状态;不要凭此前的印象作答。"
|
|
15592
15622
|
].join("\n") : void 0,
|
|
15593
15623
|
afterAgent: () => {
|
|
15594
|
-
|
|
15624
|
+
q.notices.length = 0;
|
|
15595
15625
|
}
|
|
15596
|
-
}, Vt =
|
|
15626
|
+
}, Vt = Ie ? {
|
|
15597
15627
|
name: "proposalNotice",
|
|
15598
|
-
augmentPrompt: () =>
|
|
15628
|
+
augmentPrompt: () => Ie.state.notices.length ? ["【内容提案裁决结果】(以此为准,不要凭提案前状态作答)", ...Ie.state.notices].join("\n") : void 0,
|
|
15599
15629
|
afterAgent: () => {
|
|
15600
|
-
|
|
15630
|
+
Ie.state.notices.length = 0;
|
|
15601
15631
|
}
|
|
15602
|
-
} : null,
|
|
15632
|
+
} : null, Ht = P ? {
|
|
15603
15633
|
name: "dataHint",
|
|
15604
|
-
augmentPrompt: () => gd(
|
|
15605
|
-
} : null,
|
|
15634
|
+
augmentPrompt: () => gd(W(), e.schemaHint) || void 0
|
|
15635
|
+
} : null, Ut = e.augmentSystem ? {
|
|
15606
15636
|
name: "augmentSystem",
|
|
15607
15637
|
augmentPrompt: (t) => {
|
|
15608
15638
|
try {
|
|
15609
15639
|
return e.augmentSystem({
|
|
15610
15640
|
state: t,
|
|
15611
|
-
data:
|
|
15641
|
+
data: W()
|
|
15612
15642
|
});
|
|
15613
15643
|
} catch (t) {
|
|
15614
15644
|
e.debug && console.log("[page-agent-sdk][augmentSystem] 回调抛错,降级跳过:", t.message);
|
|
15615
15645
|
return;
|
|
15616
15646
|
}
|
|
15617
15647
|
}
|
|
15618
|
-
} : null,
|
|
15648
|
+
} : null, Wt = xm(e.onEvent), Y = Wt.emit, Kt, qt = [], Yt = (e) => ({
|
|
15619
15649
|
name: e.name,
|
|
15620
15650
|
description: e.description,
|
|
15621
15651
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
15622
|
-
}),
|
|
15652
|
+
}), Xt = (e) => ({
|
|
15623
15653
|
name: e.name,
|
|
15624
15654
|
description: e.description,
|
|
15625
15655
|
getContent: () => e.content
|
|
15626
|
-
}),
|
|
15656
|
+
}), Zt = e.skillStorage === !1 ? null : z_({
|
|
15627
15657
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
15628
15658
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
15629
|
-
}),
|
|
15630
|
-
let t =
|
|
15659
|
+
}), Qt = () => {
|
|
15660
|
+
let t = Kt ? Kt.controller : null;
|
|
15631
15661
|
if (t) {
|
|
15632
|
-
let n = (e.skills || []).filter((e) => !
|
|
15633
|
-
t.set([...n, ...
|
|
15662
|
+
let n = (e.skills || []).filter((e) => !qt.some((t) => t.name === e.name));
|
|
15663
|
+
t.set([...n, ...qt]);
|
|
15634
15664
|
}
|
|
15635
15665
|
X.infoTick.value++;
|
|
15636
|
-
},
|
|
15637
|
-
if (
|
|
15638
|
-
let t = await
|
|
15666
|
+
}, $t = async () => {
|
|
15667
|
+
if (Zt) try {
|
|
15668
|
+
let t = await Zt.list();
|
|
15639
15669
|
if (t.length) {
|
|
15640
|
-
|
|
15641
|
-
let n =
|
|
15670
|
+
qt = t.map(Xt);
|
|
15671
|
+
let n = Kt ? Kt.controller : null;
|
|
15642
15672
|
if (n) {
|
|
15643
|
-
let t = (e.skills || []).filter((e) => !
|
|
15644
|
-
n.set([...t, ...
|
|
15673
|
+
let t = (e.skills || []).filter((e) => !qt.some((t) => t.name === e.name));
|
|
15674
|
+
n.set([...t, ...qt]);
|
|
15645
15675
|
}
|
|
15646
15676
|
X.infoTick.value++;
|
|
15647
15677
|
}
|
|
15648
15678
|
} catch {}
|
|
15649
|
-
},
|
|
15679
|
+
}, en = ct ? Ll({
|
|
15650
15680
|
...y,
|
|
15651
15681
|
llmInvoke: d,
|
|
15652
|
-
getRegisteredData: () =>
|
|
15682
|
+
getRegisteredData: () => W() ? [{ description: W().description ?? "主数据对象" }] : [],
|
|
15653
15683
|
preserveLastToolResults: x,
|
|
15654
|
-
...
|
|
15684
|
+
...lt ? {
|
|
15655
15685
|
decideInvoke: m,
|
|
15656
|
-
getSnapshot: () =>
|
|
15686
|
+
getSnapshot: () => Lt?.getSnapshot()
|
|
15657
15687
|
} : {}
|
|
15658
|
-
}) : void 0,
|
|
15659
|
-
...
|
|
15660
|
-
withScreenshot: !!
|
|
15661
|
-
withDomEdit:
|
|
15662
|
-
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
|
|
15663
15693
|
})] : [],
|
|
15664
|
-
...
|
|
15665
|
-
withScreenshot: !!
|
|
15666
|
-
withDomEdit:
|
|
15667
|
-
withVfs:
|
|
15694
|
+
...V.domInspect && !(e.skills || []).some((e) => e.name === "page-analysis") ? [u_({
|
|
15695
|
+
withScreenshot: !!Ae,
|
|
15696
|
+
withDomEdit: V.domEdit,
|
|
15697
|
+
withVfs: st
|
|
15668
15698
|
})] : [],
|
|
15669
15699
|
...e.skills || []
|
|
15670
15700
|
], {
|
|
15671
|
-
readVfs:
|
|
15701
|
+
readVfs: st ? (e) => T.files[e]?.content : void 0,
|
|
15672
15702
|
onToolsReady: (e, t) => {
|
|
15673
15703
|
for (let n of t) {
|
|
15674
|
-
let t =
|
|
15675
|
-
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}`);
|
|
15676
15706
|
}
|
|
15677
|
-
|
|
15707
|
+
K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
15678
15708
|
}
|
|
15679
15709
|
}) : void 0;
|
|
15680
|
-
|
|
15681
|
-
let
|
|
15682
|
-
...
|
|
15683
|
-
|
|
15684
|
-
...
|
|
15685
|
-
|
|
15710
|
+
Kt = tn;
|
|
15711
|
+
let nn = Em([
|
|
15712
|
+
...Ht ? [Ht] : [],
|
|
15713
|
+
Rt,
|
|
15714
|
+
...zt ? [zt] : [],
|
|
15715
|
+
J,
|
|
15686
15716
|
...Vt ? [Vt] : [],
|
|
15687
|
-
...
|
|
15717
|
+
...it ? [O] : [],
|
|
15688
15718
|
ee,
|
|
15689
15719
|
te,
|
|
15690
|
-
...
|
|
15691
|
-
|
|
15692
|
-
...
|
|
15693
|
-
...
|
|
15694
|
-
...
|
|
15695
|
-
...
|
|
15696
|
-
...
|
|
15697
|
-
...
|
|
15698
|
-
...
|
|
15699
|
-
...me &&
|
|
15700
|
-
...
|
|
15701
|
-
...
|
|
15702
|
-
...
|
|
15703
|
-
...
|
|
15704
|
-
...
|
|
15705
|
-
...
|
|
15706
|
-
...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] : [],
|
|
15707
15736
|
...Ot ? [Ot] : [],
|
|
15708
|
-
...
|
|
15709
|
-
|
|
15710
|
-
|
|
15737
|
+
...kt ? [kt] : [],
|
|
15738
|
+
...U && dt ? [qf({
|
|
15739
|
+
getBind: () => W()?.bind,
|
|
15740
|
+
getTools: () => X.agent?.allTools ?? K
|
|
15711
15741
|
})] : [],
|
|
15712
|
-
...
|
|
15713
|
-
...
|
|
15714
|
-
...
|
|
15742
|
+
...Ut ? [Ut] : [],
|
|
15743
|
+
...Lt ? [Lt] : [],
|
|
15744
|
+
...Me ? [Me] : [],
|
|
15715
15745
|
...e.middleware || [],
|
|
15716
|
-
...
|
|
15746
|
+
..._e ? [y_(a, {
|
|
15717
15747
|
tokenBudget: e.tokenBudget,
|
|
15718
15748
|
timeBudgetMs: e.timeBudgetMs
|
|
15719
|
-
},
|
|
15720
|
-
J_(
|
|
15721
|
-
]),
|
|
15722
|
-
function
|
|
15749
|
+
}, Y)] : [],
|
|
15750
|
+
J_(Y, w, W, a)
|
|
15751
|
+
]), rn = e.maxMemoryRounds ?? W_;
|
|
15752
|
+
function an(e) {
|
|
15723
15753
|
return (e) => {
|
|
15724
|
-
e.type !== "approval_request" &&
|
|
15754
|
+
e.type !== "approval_request" && Y(Oe(e));
|
|
15725
15755
|
};
|
|
15726
15756
|
}
|
|
15727
|
-
let
|
|
15728
|
-
function
|
|
15757
|
+
let on = /* @__PURE__ */ Gt([]), sn = U_(), cn = /* @__PURE__ */ new Set();
|
|
15758
|
+
function ln(e) {
|
|
15729
15759
|
let t = new AbortController(), n = () => t.abort();
|
|
15730
|
-
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), {
|
|
15731
15761
|
controller: t,
|
|
15732
15762
|
untrack: () => {
|
|
15733
|
-
|
|
15763
|
+
cn.delete(t), e?.removeEventListener("abort", n);
|
|
15734
15764
|
}
|
|
15735
15765
|
};
|
|
15736
15766
|
}
|
|
15737
|
-
function
|
|
15738
|
-
for (let e of
|
|
15739
|
-
|
|
15767
|
+
function un() {
|
|
15768
|
+
for (let e of cn) e.abort();
|
|
15769
|
+
cn.clear();
|
|
15740
15770
|
}
|
|
15741
|
-
let
|
|
15771
|
+
let dn = /* @__PURE__ */ Gt(null), X = {
|
|
15742
15772
|
agentId: n,
|
|
15743
15773
|
store: l,
|
|
15744
15774
|
messages: w,
|
|
15745
15775
|
vfsStore: T,
|
|
15746
|
-
listeners:
|
|
15776
|
+
listeners: Wt.listeners,
|
|
15747
15777
|
todosMw: D,
|
|
15748
|
-
memoryMw:
|
|
15778
|
+
memoryMw: N,
|
|
15749
15779
|
missionMw: O,
|
|
15750
|
-
workingMemoryMw:
|
|
15751
|
-
focusMw:
|
|
15780
|
+
workingMemoryMw: oe,
|
|
15781
|
+
focusMw: j,
|
|
15752
15782
|
agent: null,
|
|
15753
15783
|
initDone: Promise.resolve(),
|
|
15754
15784
|
sessionId: "",
|
|
@@ -15756,57 +15786,57 @@ function X_(e, n, r) {
|
|
|
15756
15786
|
mcpClosers: [],
|
|
15757
15787
|
mcpServers: [],
|
|
15758
15788
|
mcpFailed: [],
|
|
15759
|
-
checkpoint:
|
|
15760
|
-
dataOpsController:
|
|
15761
|
-
skillsController:
|
|
15789
|
+
checkpoint: z,
|
|
15790
|
+
dataOpsController: U,
|
|
15791
|
+
skillsController: Kt ? Kt.controller : null,
|
|
15762
15792
|
infoTick: c,
|
|
15763
15793
|
pendingConflict: o.pendingConflict,
|
|
15764
|
-
pendingQuote:
|
|
15765
|
-
sessions:
|
|
15766
|
-
refreshSessions: () =>
|
|
15767
|
-
liveData:
|
|
15794
|
+
pendingQuote: dn,
|
|
15795
|
+
sessions: on,
|
|
15796
|
+
refreshSessions: () => vn.refreshSessions(),
|
|
15797
|
+
liveData: W,
|
|
15768
15798
|
usage: a,
|
|
15769
|
-
emit:
|
|
15770
|
-
runSerial:
|
|
15771
|
-
trackActive:
|
|
15772
|
-
abortAllActive:
|
|
15799
|
+
emit: Y,
|
|
15800
|
+
runSerial: sn,
|
|
15801
|
+
trackActive: ln,
|
|
15802
|
+
abortAllActive: un,
|
|
15773
15803
|
unloadSkillTools(e) {
|
|
15774
15804
|
if (e) {
|
|
15775
|
-
let t =
|
|
15776
|
-
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;
|
|
15777
15807
|
} else {
|
|
15778
|
-
if (!
|
|
15779
|
-
for (let e of
|
|
15780
|
-
|
|
15808
|
+
if (!et.length) return;
|
|
15809
|
+
for (let e of et) Ee.delete(e.name), tt.delete(e.name);
|
|
15810
|
+
et = [];
|
|
15781
15811
|
}
|
|
15782
|
-
|
|
15812
|
+
K = nt(), X.agent && X.agent.setTools(K);
|
|
15783
15813
|
},
|
|
15784
15814
|
applySnapshot(t) {
|
|
15785
|
-
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) {
|
|
15786
15816
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
15787
15817
|
if (r.length) {
|
|
15788
|
-
let t =
|
|
15789
|
-
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) {
|
|
15790
15820
|
let e = r.filter((e) => !n.includes(e)).map((e) => e.path);
|
|
15791
15821
|
console.warn("[page-agent-sdk][focus] 恢复的焦点部分 path 已失效(schema 变化/无 schema),剔除:", e);
|
|
15792
15822
|
}
|
|
15793
15823
|
}
|
|
15794
15824
|
}
|
|
15795
|
-
|
|
15825
|
+
hn();
|
|
15796
15826
|
},
|
|
15797
15827
|
addSkill(e) {
|
|
15798
|
-
let t =
|
|
15799
|
-
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));
|
|
15800
15830
|
},
|
|
15801
15831
|
removeSkill(e) {
|
|
15802
|
-
let t =
|
|
15803
|
-
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);
|
|
15804
15834
|
},
|
|
15805
15835
|
listUserSkills() {
|
|
15806
|
-
return
|
|
15836
|
+
return qt.map((e) => e.name);
|
|
15807
15837
|
},
|
|
15808
15838
|
getUserSkill(e) {
|
|
15809
|
-
let t =
|
|
15839
|
+
let t = qt.find((t) => t.name === e);
|
|
15810
15840
|
if (t) return {
|
|
15811
15841
|
name: t.name,
|
|
15812
15842
|
description: t.description,
|
|
@@ -15814,7 +15844,7 @@ function X_(e, n, r) {
|
|
|
15814
15844
|
};
|
|
15815
15845
|
},
|
|
15816
15846
|
afterRound() {
|
|
15817
|
-
|
|
15847
|
+
gn(), vn.persistRuntime();
|
|
15818
15848
|
},
|
|
15819
15849
|
clearCodeReuse() {
|
|
15820
15850
|
let e = T;
|
|
@@ -15822,12 +15852,12 @@ function X_(e, n, r) {
|
|
|
15822
15852
|
},
|
|
15823
15853
|
async send(e, t) {
|
|
15824
15854
|
if (await X.initDone, X.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 send");
|
|
15825
|
-
t ??= {}, t?.mission &&
|
|
15855
|
+
t ??= {}, t?.mission && it && O.setMission(t.mission);
|
|
15826
15856
|
let n = e, r = (t.images ?? []).filter((e) => e && (e.dataUri || e.vfsRef || e.url));
|
|
15827
15857
|
if (r.length > 4) throw Error(`[page-agent-sdk] 单轮最多 4 张图片(收到 ${r.length})`);
|
|
15828
|
-
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)) {
|
|
15829
15859
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述(集成方识图子 agent / 自有 vision API)";
|
|
15830
|
-
throw
|
|
15860
|
+
throw Y({
|
|
15831
15861
|
type: "error",
|
|
15832
15862
|
message: e,
|
|
15833
15863
|
severity: "recoverable",
|
|
@@ -15835,7 +15865,7 @@ function X_(e, n, r) {
|
|
|
15835
15865
|
}), Error(`[page-agent-sdk] ${e}`);
|
|
15836
15866
|
}
|
|
15837
15867
|
T?.setProtectedRefs?.(V_(w));
|
|
15838
|
-
let i =
|
|
15868
|
+
let i = _e ? t.maxAutoRetries ?? 1 : 0, a = 0, s = !1, c = an(t.signal);
|
|
15839
15869
|
if (t.signal) {
|
|
15840
15870
|
let e = () => o.resolve("keep_external");
|
|
15841
15871
|
t.signal.aborted ? e() : t.signal.addEventListener("abort", e, { once: !0 });
|
|
@@ -15852,14 +15882,14 @@ function X_(e, n, r) {
|
|
|
15852
15882
|
...n ? { anchor: n } : {}
|
|
15853
15883
|
};
|
|
15854
15884
|
}
|
|
15855
|
-
let i = e ??
|
|
15885
|
+
let i = e ?? dn.value ?? void 0;
|
|
15856
15886
|
w.push({
|
|
15857
15887
|
role: "user",
|
|
15858
15888
|
content: n,
|
|
15859
15889
|
timestamp: Date.now(),
|
|
15860
15890
|
...r.length ? { images: r } : {},
|
|
15861
15891
|
...i ? { quote: i } : {}
|
|
15862
|
-
}), s = !0, !e &&
|
|
15892
|
+
}), s = !0, !e && dn.value && (dn.value = null);
|
|
15863
15893
|
}
|
|
15864
15894
|
try {
|
|
15865
15895
|
let e = await X.agent.invoke(w, t.signal, c);
|
|
@@ -15880,7 +15910,7 @@ function X_(e, n, r) {
|
|
|
15880
15910
|
}), X.afterRound(), l) try {
|
|
15881
15911
|
await l.flush();
|
|
15882
15912
|
} catch (e) {
|
|
15883
|
-
|
|
15913
|
+
Y({
|
|
15884
15914
|
type: "error",
|
|
15885
15915
|
message: `落盘失败(不影响本轮回复):${e instanceof Error ? e.message : String(e)}`,
|
|
15886
15916
|
severity: "observable",
|
|
@@ -15895,8 +15925,8 @@ function X_(e, n, r) {
|
|
|
15895
15925
|
...n,
|
|
15896
15926
|
code: "MODEL_UNAVAILABLE",
|
|
15897
15927
|
message: e instanceof Error ? e.message : n.message
|
|
15898
|
-
}), a < i &&
|
|
15899
|
-
a += 1,
|
|
15928
|
+
}), a < i && z?.canRestore()) {
|
|
15929
|
+
a += 1, z.restore(), s = !0, Y({
|
|
15900
15930
|
type: "error",
|
|
15901
15931
|
message: `致命错误自动恢复(${a}/${i}):${n.message},已回退 checkpoint 重试`,
|
|
15902
15932
|
severity: "observable",
|
|
@@ -15908,7 +15938,7 @@ function X_(e, n, r) {
|
|
|
15908
15938
|
});
|
|
15909
15939
|
continue;
|
|
15910
15940
|
}
|
|
15911
|
-
throw
|
|
15941
|
+
throw Y({
|
|
15912
15942
|
type: "error",
|
|
15913
15943
|
message: n.message,
|
|
15914
15944
|
severity: n.severity,
|
|
@@ -15921,7 +15951,7 @@ function X_(e, n, r) {
|
|
|
15921
15951
|
async batch(e, t, n) {
|
|
15922
15952
|
if (await X.initDone, !e.length) return [];
|
|
15923
15953
|
if (X.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 batch");
|
|
15924
|
-
let r = [], i =
|
|
15954
|
+
let r = [], i = an(n);
|
|
15925
15955
|
if (T?.setProtectedRefs?.(V_(w)), n) {
|
|
15926
15956
|
let e = () => o.resolve("keep_external");
|
|
15927
15957
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
@@ -15937,7 +15967,7 @@ function X_(e, n, r) {
|
|
|
15937
15967
|
break;
|
|
15938
15968
|
}
|
|
15939
15969
|
let o = e[a];
|
|
15940
|
-
|
|
15970
|
+
z && z.save(`batch:${a}`);
|
|
15941
15971
|
let s = w.length;
|
|
15942
15972
|
try {
|
|
15943
15973
|
w.push({
|
|
@@ -15953,7 +15983,7 @@ function X_(e, n, r) {
|
|
|
15953
15983
|
}), X.afterRound(), l) try {
|
|
15954
15984
|
await l.flush();
|
|
15955
15985
|
} catch (e) {
|
|
15956
|
-
|
|
15986
|
+
Y({
|
|
15957
15987
|
type: "error",
|
|
15958
15988
|
message: `落盘失败(不影响本任务结果):${e instanceof Error ? e.message : String(e)}`,
|
|
15959
15989
|
severity: "observable",
|
|
@@ -15989,7 +16019,7 @@ function X_(e, n, r) {
|
|
|
15989
16019
|
}
|
|
15990
16020
|
ya(i);
|
|
15991
16021
|
let c = ui(i, "fatal");
|
|
15992
|
-
|
|
16022
|
+
Y({
|
|
15993
16023
|
type: "error",
|
|
15994
16024
|
message: `批量任务 ${a + 1}/${e.length} 失败:${c.message}`,
|
|
15995
16025
|
severity: "observable",
|
|
@@ -16013,16 +16043,16 @@ function X_(e, n, r) {
|
|
|
16013
16043
|
}
|
|
16014
16044
|
return r;
|
|
16015
16045
|
},
|
|
16016
|
-
switchSession: (e) =>
|
|
16017
|
-
exportSession: (e) =>
|
|
16018
|
-
importSession: (e) =>
|
|
16019
|
-
resetSession: () =>
|
|
16046
|
+
switchSession: (e) => vn.switchSession(e),
|
|
16047
|
+
exportSession: (e) => vn.exportSession(e),
|
|
16048
|
+
importSession: (e) => vn.importSession(e),
|
|
16049
|
+
resetSession: () => vn.resetSession(),
|
|
16020
16050
|
stream: async (e, t, n) => {
|
|
16021
16051
|
if (!X.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
16022
16052
|
let r = [...e].reverse().find((e) => e.role === "user" && e.images?.length);
|
|
16023
|
-
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))) {
|
|
16024
16054
|
let e = "当前主模型不支持图片输入(modelCaps.vision=false)。请换多模态模型(gpt-4o/claude/qwen-vl)或 LLMConfig 声明 vision:true;或配置 images.describe 绑定识图转述";
|
|
16025
|
-
throw
|
|
16055
|
+
throw Y({
|
|
16026
16056
|
type: "error",
|
|
16027
16057
|
message: e,
|
|
16028
16058
|
severity: "recoverable",
|
|
@@ -16031,36 +16061,36 @@ function X_(e, n, r) {
|
|
|
16031
16061
|
}
|
|
16032
16062
|
T?.setProtectedRefs?.(V_(e));
|
|
16033
16063
|
let i = (e) => {
|
|
16034
|
-
t?.(
|
|
16064
|
+
t?.(Oe(e)), Y(Oe(e)), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && X.infoTick.value++;
|
|
16035
16065
|
};
|
|
16036
16066
|
if (n) {
|
|
16037
16067
|
let e = () => o.resolve("keep_external");
|
|
16038
16068
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
16039
16069
|
}
|
|
16040
|
-
let { controller: a, untrack: s } =
|
|
16070
|
+
let { controller: a, untrack: s } = ln(n);
|
|
16041
16071
|
return X.agent.stream(e, i, a.signal).finally(s);
|
|
16042
16072
|
},
|
|
16043
16073
|
release() {
|
|
16044
16074
|
if (X.refCount--, X.refCount <= 0) {
|
|
16045
|
-
|
|
16075
|
+
un(), We = !0, l && (T.flush?.(), l.flush(), l.dispose()), Zt && Zt.dispose();
|
|
16046
16076
|
let e = X.mcpClosers.splice(0);
|
|
16047
16077
|
e.length && Promise.allSettled(e.map((e) => e())), G_.delete(n);
|
|
16048
16078
|
}
|
|
16049
16079
|
},
|
|
16050
16080
|
resolveConflict: o.resolve,
|
|
16051
16081
|
setTools(e) {
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
}),
|
|
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++;
|
|
16055
16085
|
},
|
|
16056
16086
|
addTool(e) {
|
|
16057
|
-
|
|
16058
|
-
for (let t =
|
|
16059
|
-
|
|
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++;
|
|
16060
16090
|
},
|
|
16061
16091
|
removeTool(e) {
|
|
16062
|
-
let t =
|
|
16063
|
-
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);
|
|
16064
16094
|
},
|
|
16065
16095
|
setLlm(t) {
|
|
16066
16096
|
let n;
|
|
@@ -16070,7 +16100,7 @@ function X_(e, n, r) {
|
|
|
16070
16100
|
if ((e.provider ?? "openai") === "anthropic") throw Error("[page-agent-sdk][setLlm] 切换到 Anthropic 需传 BaseChatModel 实例(动态 import 无法同步);请先 const { ChatAnthropic } = await import(\"@langchain/anthropic\") 构造实例后传入");
|
|
16071
16101
|
n = E(e);
|
|
16072
16102
|
}
|
|
16073
|
-
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;
|
|
16074
16104
|
let r = Ap(t) ? void 0 : t;
|
|
16075
16105
|
if (g = v({
|
|
16076
16106
|
model: r?.model ?? t.model ?? t.modelName,
|
|
@@ -16078,58 +16108,58 @@ function X_(e, n, r) {
|
|
|
16078
16108
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens,
|
|
16079
16109
|
vision: r?.vision ?? t.vision
|
|
16080
16110
|
}), g.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${g.contextWindow} 小于最小支持 ${p}(需 ≥200K 窗口模型)`);
|
|
16081
|
-
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);
|
|
16082
16112
|
},
|
|
16083
16113
|
setMemory(e) {
|
|
16084
|
-
|
|
16114
|
+
N.reset(e), typeof e == "function" && N.refresh(), X.infoTick.value++;
|
|
16085
16115
|
},
|
|
16086
16116
|
refreshMemory() {
|
|
16087
|
-
return
|
|
16117
|
+
return N.refresh();
|
|
16088
16118
|
},
|
|
16089
16119
|
setSubagents(t) {
|
|
16090
|
-
if (!
|
|
16120
|
+
if (!jt) {
|
|
16091
16121
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
16092
16122
|
return;
|
|
16093
16123
|
}
|
|
16094
|
-
|
|
16124
|
+
jt.set(t), X.infoTick.value++;
|
|
16095
16125
|
},
|
|
16096
16126
|
addSubagent(t) {
|
|
16097
|
-
if (!
|
|
16127
|
+
if (!jt) {
|
|
16098
16128
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
16099
16129
|
return;
|
|
16100
16130
|
}
|
|
16101
|
-
|
|
16131
|
+
jt.add(t), X.infoTick.value++;
|
|
16102
16132
|
},
|
|
16103
16133
|
removeSubagent(t) {
|
|
16104
|
-
if (!
|
|
16105
|
-
let n =
|
|
16134
|
+
if (!jt) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
16135
|
+
let n = jt.remove(t);
|
|
16106
16136
|
return n && X.infoTick.value++, n;
|
|
16107
16137
|
},
|
|
16108
16138
|
getActiveSubagents() {
|
|
16109
|
-
return
|
|
16139
|
+
return ft?.getActive() ?? [];
|
|
16110
16140
|
},
|
|
16111
16141
|
get subagentHistory() {
|
|
16112
|
-
return
|
|
16142
|
+
return ft?.getHistory() ?? [];
|
|
16113
16143
|
},
|
|
16114
16144
|
getInfo() {
|
|
16115
16145
|
return {
|
|
16116
16146
|
id: n,
|
|
16117
16147
|
sessionId: X.sessionId,
|
|
16118
16148
|
model: Ap(C) ? C.model ?? C.modelName : C.model,
|
|
16119
|
-
systemPrompt: X.agent?.getEffectiveSystemPrompt?.() ??
|
|
16120
|
-
tools: (X.agent?.allTools ??
|
|
16149
|
+
systemPrompt: X.agent?.getEffectiveSystemPrompt?.() ?? ye + gd(W(), e.schemaHint),
|
|
16150
|
+
tools: (X.agent?.allTools ?? K).map((e) => ({
|
|
16121
16151
|
name: e.name,
|
|
16122
16152
|
description: e.description,
|
|
16123
16153
|
schema: e.schema,
|
|
16124
|
-
source:
|
|
16154
|
+
source: Ee.get(e.name) || "user"
|
|
16125
16155
|
})),
|
|
16126
|
-
skills: (
|
|
16156
|
+
skills: (Kt ? Kt.controller.get() : e.skills ?? []).map((e) => ({
|
|
16127
16157
|
name: e.name,
|
|
16128
16158
|
description: e.description
|
|
16129
16159
|
})),
|
|
16130
|
-
data:
|
|
16131
|
-
description:
|
|
16132
|
-
schema:
|
|
16160
|
+
data: W() ? {
|
|
16161
|
+
description: W().description,
|
|
16162
|
+
schema: W().schema
|
|
16133
16163
|
} : void 0,
|
|
16134
16164
|
contextPreset: e.contextPreset ?? "auto",
|
|
16135
16165
|
compression: {
|
|
@@ -16137,16 +16167,16 @@ function X_(e, n, r) {
|
|
|
16137
16167
|
summaryThresholdRatio: y.summaryThresholdRatio ?? .5,
|
|
16138
16168
|
promptSoftCap: Nl(g.contextWindow, y.promptSoftCapTokens)
|
|
16139
16169
|
},
|
|
16140
|
-
memory:
|
|
16170
|
+
memory: N.get(),
|
|
16141
16171
|
staleReadsInvalidated: X.agent?.getStaleReadsInvalidated?.() ?? 0,
|
|
16142
|
-
hostReadsInvalidated:
|
|
16143
|
-
...
|
|
16172
|
+
hostReadsInvalidated: q.readsInvalidated,
|
|
16173
|
+
...Ie ? { proposals: Ie.snapshot() } : {},
|
|
16144
16174
|
...r ? { hostWatch: { ...r } } : {},
|
|
16145
16175
|
llmRetries: X.agent?.getLlmRetries?.() ?? 0,
|
|
16146
16176
|
llmCallFailures: X.agent?.getLlmCallFailures?.() ?? 0,
|
|
16147
16177
|
gates: X.agent?.getGateStats?.(),
|
|
16148
16178
|
systemSegments: X.agent?.getLastSystemSegments?.() ?? [],
|
|
16149
|
-
middleware:
|
|
16179
|
+
middleware: nn.map((e) => e.name),
|
|
16150
16180
|
todos: (X.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
16151
16181
|
id: e.id,
|
|
16152
16182
|
content: e.content,
|
|
@@ -16157,30 +16187,30 @@ function X_(e, n, r) {
|
|
|
16157
16187
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
16158
16188
|
})),
|
|
16159
16189
|
planPhase: D.getPlanPhase(),
|
|
16160
|
-
mission:
|
|
16190
|
+
mission: it ? O.getMission() : void 0,
|
|
16161
16191
|
planConfirmation: ne.lastPlanConfirmation,
|
|
16162
|
-
workingMemory:
|
|
16163
|
-
focus:
|
|
16164
|
-
focuses:
|
|
16192
|
+
workingMemory: at ? oe.getWorkingMemory() : void 0,
|
|
16193
|
+
focus: Je ? j.getFocus() : void 0,
|
|
16194
|
+
focuses: Je ? j.getFocuses() : [],
|
|
16165
16195
|
actions: S_(e.actions ?? {}),
|
|
16166
16196
|
subagent: {
|
|
16167
|
-
enabled: !!
|
|
16197
|
+
enabled: !!Tt,
|
|
16168
16198
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
16169
16199
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
16170
16200
|
timeoutMs: e.subagent?.timeoutMs === void 0 ? 18e5 : e.subagent.timeoutMs > 0 ? e.subagent.timeoutMs : 0,
|
|
16171
16201
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
16172
|
-
subagents: (
|
|
16173
|
-
active:
|
|
16174
|
-
history:
|
|
16175
|
-
lockedComponents:
|
|
16202
|
+
subagents: (jt?.get() ?? []).map(Mt),
|
|
16203
|
+
active: ft?.getActive() ?? [],
|
|
16204
|
+
history: ft?.getHistory() ?? [],
|
|
16205
|
+
lockedComponents: Dt?.locked() ?? {}
|
|
16176
16206
|
},
|
|
16177
16207
|
verify: {
|
|
16178
|
-
enabled: !!
|
|
16179
|
-
maxAttempts:
|
|
16180
|
-
adversarial:
|
|
16208
|
+
enabled: !!It,
|
|
16209
|
+
maxAttempts: gt ? pt : 0,
|
|
16210
|
+
adversarial: gt && !!e.verify?.adversarial
|
|
16181
16211
|
},
|
|
16182
16212
|
context: (() => {
|
|
16183
|
-
let e =
|
|
16213
|
+
let e = Lt?.getSnapshot();
|
|
16184
16214
|
if (e) {
|
|
16185
16215
|
let t = X.agent?.getState?.()?.lastCompression;
|
|
16186
16216
|
t && (e.compression = t);
|
|
@@ -16192,10 +16222,10 @@ function X_(e, n, r) {
|
|
|
16192
16222
|
...X.mcpFailed.length ? { failed: X.mcpFailed } : {}
|
|
16193
16223
|
},
|
|
16194
16224
|
lastCompression: X.agent?.getState?.()?.lastCompression,
|
|
16195
|
-
checkpoints:
|
|
16225
|
+
checkpoints: z ? {
|
|
16196
16226
|
enabled: !0,
|
|
16197
|
-
auto:
|
|
16198
|
-
list:
|
|
16227
|
+
auto: B,
|
|
16228
|
+
list: z.list()
|
|
16199
16229
|
} : void 0
|
|
16200
16230
|
};
|
|
16201
16231
|
},
|
|
@@ -16233,41 +16263,41 @@ function X_(e, n, r) {
|
|
|
16233
16263
|
}));
|
|
16234
16264
|
},
|
|
16235
16265
|
getMission() {
|
|
16236
|
-
return
|
|
16266
|
+
return it ? O.getMission() : void 0;
|
|
16237
16267
|
},
|
|
16238
16268
|
setMission(t) {
|
|
16239
|
-
if (!
|
|
16269
|
+
if (!it) {
|
|
16240
16270
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
16241
16271
|
return;
|
|
16242
16272
|
}
|
|
16243
16273
|
O.setMission(t), X.infoTick.value++;
|
|
16244
16274
|
},
|
|
16245
16275
|
getFocus() {
|
|
16246
|
-
return
|
|
16276
|
+
return Je ? j.getFocus() : void 0;
|
|
16247
16277
|
},
|
|
16248
16278
|
getFocuses() {
|
|
16249
|
-
return
|
|
16279
|
+
return Je ? j.getFocuses() : [];
|
|
16250
16280
|
},
|
|
16251
16281
|
setFocus(t) {
|
|
16252
|
-
let n = Y_(t, "setFocus",
|
|
16253
|
-
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;
|
|
16254
16284
|
},
|
|
16255
16285
|
addFocus(t) {
|
|
16256
|
-
let n = Y_(t, "addFocus",
|
|
16257
|
-
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 超预算)"), {
|
|
16258
16288
|
ok: !1,
|
|
16259
16289
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
16260
|
-
}) : (
|
|
16290
|
+
}) : (j.addFocus(M(t)), e.debug && j.isInvokeActive() && console.info("[page-agent-sdk][focus] 在途流程进行中,聚焦将在下一次输入生效(当前流程不受影响)"), X.infoTick.value++, { ok: !0 }) : n;
|
|
16261
16291
|
},
|
|
16262
16292
|
removeFocus(e) {
|
|
16263
|
-
|
|
16293
|
+
Je && (j.removeFocus(e), X.infoTick.value++);
|
|
16264
16294
|
},
|
|
16265
16295
|
clearFocus() {
|
|
16266
|
-
|
|
16296
|
+
Je && (j.clearFocus(), X.infoTick.value++);
|
|
16267
16297
|
},
|
|
16268
16298
|
setQuote(e, t, n) {
|
|
16269
16299
|
let r = Ni(e ?? ""), i = Ki(n);
|
|
16270
|
-
|
|
16300
|
+
dn.value = r ? {
|
|
16271
16301
|
text: r,
|
|
16272
16302
|
...t ? { source: t } : {},
|
|
16273
16303
|
...i ? { anchor: i } : {}
|
|
@@ -16275,34 +16305,34 @@ function X_(e, n, r) {
|
|
|
16275
16305
|
},
|
|
16276
16306
|
notifyHostChange(e) {
|
|
16277
16307
|
let t = typeof e?.reason == "string" ? e.reason.trim().slice(0, 200) : "";
|
|
16278
|
-
|
|
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({
|
|
16279
16309
|
timestamp: Date.now(),
|
|
16280
16310
|
type: "middleware",
|
|
16281
16311
|
data: {
|
|
16282
16312
|
stage: "host_change_notified",
|
|
16283
|
-
epoch:
|
|
16313
|
+
epoch: q.epoch,
|
|
16284
16314
|
reason: t || void 0
|
|
16285
16315
|
}
|
|
16286
16316
|
}), X.infoTick.value++;
|
|
16287
16317
|
},
|
|
16288
16318
|
clearQuote() {
|
|
16289
|
-
|
|
16319
|
+
dn.value = null;
|
|
16290
16320
|
},
|
|
16291
16321
|
resolveProposal(e, t, n) {
|
|
16292
|
-
let r =
|
|
16322
|
+
let r = Ie ? Ie.resolve(e, t, n) : !1;
|
|
16293
16323
|
return r && X.infoTick.value++, r;
|
|
16294
16324
|
},
|
|
16295
16325
|
getProposals() {
|
|
16296
|
-
return
|
|
16326
|
+
return Ie ? Ie.snapshot() : null;
|
|
16297
16327
|
}
|
|
16298
16328
|
};
|
|
16299
|
-
async function
|
|
16329
|
+
async function fn() {
|
|
16300
16330
|
if (!l) return;
|
|
16301
16331
|
let t = async (e) => {
|
|
16302
16332
|
try {
|
|
16303
16333
|
return await l.load(n, e);
|
|
16304
16334
|
} catch (t) {
|
|
16305
|
-
|
|
16335
|
+
Y({
|
|
16306
16336
|
type: "error",
|
|
16307
16337
|
message: `会话快照读取失败,已降级空会话:${t instanceof Error ? t.message : String(t)}`,
|
|
16308
16338
|
severity: "observable",
|
|
@@ -16315,7 +16345,7 @@ function X_(e, n, r) {
|
|
|
16315
16345
|
try {
|
|
16316
16346
|
return await l.listSessions(n);
|
|
16317
16347
|
} catch (e) {
|
|
16318
|
-
return
|
|
16348
|
+
return Y({
|
|
16319
16349
|
type: "error",
|
|
16320
16350
|
message: `会话列表读取失败,已降级新建会话:${e instanceof Error ? e.message : String(e)}`,
|
|
16321
16351
|
severity: "observable",
|
|
@@ -16323,7 +16353,7 @@ function X_(e, n, r) {
|
|
|
16323
16353
|
}), [];
|
|
16324
16354
|
}
|
|
16325
16355
|
}, i = Symbol("storage-ready-timeout");
|
|
16326
|
-
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({
|
|
16327
16357
|
type: "error",
|
|
16328
16358
|
message: "存储初始化 5s 未就绪(IDB blocked?),已放行降级运行",
|
|
16329
16359
|
severity: "observable",
|
|
@@ -16333,7 +16363,7 @@ function X_(e, n, r) {
|
|
|
16333
16363
|
if (a.id) {
|
|
16334
16364
|
X.sessionId = a.id;
|
|
16335
16365
|
let e = await t(X.sessionId);
|
|
16336
|
-
e ? (X.applySnapshot(e),
|
|
16366
|
+
e ? (X.applySnapshot(e), Y({
|
|
16337
16367
|
type: "session_restored",
|
|
16338
16368
|
sessionId: X.sessionId,
|
|
16339
16369
|
rounds: e.messages?.length ?? 0
|
|
@@ -16343,19 +16373,19 @@ function X_(e, n, r) {
|
|
|
16343
16373
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, i.length, i.map((e) => e.sessionId)), i.length) {
|
|
16344
16374
|
X.sessionId = i[0].sessionId;
|
|
16345
16375
|
let n = await t(X.sessionId);
|
|
16346
|
-
n ? (X.applySnapshot(n),
|
|
16376
|
+
n ? (X.applySnapshot(n), Y({
|
|
16347
16377
|
type: "session_restored",
|
|
16348
16378
|
sessionId: X.sessionId,
|
|
16349
16379
|
rounds: n.messages?.length ?? 0
|
|
16350
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);
|
|
16351
16381
|
} else X.sessionId = await l.createSession(n, a.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", X.sessionId);
|
|
16352
16382
|
} else X.sessionId = await l.createSession(n, a.title);
|
|
16353
|
-
e.memory &&
|
|
16383
|
+
e.memory && vn.persistSave({ memory: N.get() || (typeof e.memory == "string" ? e.memory : "") }), vn.refreshSessions();
|
|
16354
16384
|
}
|
|
16355
|
-
async function
|
|
16356
|
-
await
|
|
16385
|
+
async function pn() {
|
|
16386
|
+
await $t();
|
|
16357
16387
|
}
|
|
16358
|
-
function
|
|
16388
|
+
function mn(e) {
|
|
16359
16389
|
let t = {};
|
|
16360
16390
|
for (let n of V_(e)) {
|
|
16361
16391
|
let e = T.files[n];
|
|
@@ -16363,15 +16393,15 @@ function X_(e, n, r) {
|
|
|
16363
16393
|
}
|
|
16364
16394
|
return t;
|
|
16365
16395
|
}
|
|
16366
|
-
function
|
|
16396
|
+
function hn() {
|
|
16367
16397
|
let e = H_(T.files, V_(w));
|
|
16368
16398
|
for (let t of e) delete T.files[t];
|
|
16369
16399
|
}
|
|
16370
|
-
function
|
|
16371
|
-
let e = xl(w,
|
|
16400
|
+
function gn() {
|
|
16401
|
+
let e = xl(w, rn);
|
|
16372
16402
|
if (!e.trimmed) return;
|
|
16373
16403
|
let { older: t, summary: n } = e;
|
|
16374
|
-
if (
|
|
16404
|
+
if (Y({
|
|
16375
16405
|
type: "context_trimmed",
|
|
16376
16406
|
dropped: t.map((e) => ({
|
|
16377
16407
|
round: e.round,
|
|
@@ -16379,60 +16409,60 @@ function X_(e, n, r) {
|
|
|
16379
16409
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
16380
16410
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
16381
16411
|
})),
|
|
16382
|
-
vfsResults:
|
|
16412
|
+
vfsResults: mn(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
16383
16413
|
summary: n.content,
|
|
16384
16414
|
reason: "max_memory_rounds"
|
|
16385
|
-
}), w.splice(e.deleteFrom, e.deleteCount, n),
|
|
16415
|
+
}), w.splice(e.deleteFrom, e.deleteCount, n), hn(), b && d) {
|
|
16386
16416
|
let n = e.summary, { prevSeg: r } = e;
|
|
16387
16417
|
(async () => {
|
|
16388
16418
|
try {
|
|
16389
16419
|
let e = await d(Ol(t, S)), i = w.indexOf(n);
|
|
16390
16420
|
if (i < 0) return;
|
|
16391
|
-
w[i].content = bl(t, r, e),
|
|
16421
|
+
w[i].content = bl(t, r, e), vn.persistRuntime();
|
|
16392
16422
|
} catch {}
|
|
16393
16423
|
})();
|
|
16394
16424
|
}
|
|
16395
16425
|
}
|
|
16396
|
-
let
|
|
16426
|
+
let _n = ki({
|
|
16397
16427
|
getConfig: () => e.images,
|
|
16398
16428
|
getVision: () => g.vision === !0,
|
|
16399
|
-
emit:
|
|
16429
|
+
emit: Y,
|
|
16400
16430
|
getVfsStore: () => X.vfsStore,
|
|
16401
|
-
noteFailure: (e, t) =>
|
|
16402
|
-
}),
|
|
16431
|
+
noteFailure: (e, t) => vn.notePersistFailure(e, t)
|
|
16432
|
+
}), vn = km({
|
|
16403
16433
|
agentId: n,
|
|
16404
16434
|
options: e,
|
|
16405
|
-
emit:
|
|
16435
|
+
emit: Y,
|
|
16406
16436
|
getStore: () => l,
|
|
16407
16437
|
core: X,
|
|
16408
|
-
sessionsRef:
|
|
16438
|
+
sessionsRef: on,
|
|
16409
16439
|
sessionVars: ne,
|
|
16410
16440
|
messages: w,
|
|
16411
16441
|
getUsage: () => a,
|
|
16412
16442
|
mw: {
|
|
16413
16443
|
todosMw: D,
|
|
16414
|
-
memoryMw:
|
|
16444
|
+
memoryMw: N,
|
|
16415
16445
|
missionMw: O,
|
|
16416
|
-
workingMemoryMw:
|
|
16417
|
-
focusMw:
|
|
16418
|
-
summarizationMw:
|
|
16446
|
+
workingMemoryMw: oe,
|
|
16447
|
+
focusMw: j,
|
|
16448
|
+
summarizationMw: en,
|
|
16419
16449
|
resumeNoticeMw: te,
|
|
16420
|
-
useMission:
|
|
16421
|
-
useWorkingMemory:
|
|
16422
|
-
useFocus:
|
|
16423
|
-
useAutomation:
|
|
16450
|
+
useMission: it,
|
|
16451
|
+
useWorkingMemory: at,
|
|
16452
|
+
useFocus: Je,
|
|
16453
|
+
useAutomation: _e
|
|
16424
16454
|
},
|
|
16425
16455
|
vfsStore: T,
|
|
16426
|
-
checkpointMgr:
|
|
16456
|
+
checkpointMgr: z,
|
|
16427
16457
|
conflictResolve: (e) => o.resolve(e),
|
|
16428
|
-
abortAllActive:
|
|
16458
|
+
abortAllActive: un,
|
|
16429
16459
|
titleLlmInvoke: f
|
|
16430
16460
|
});
|
|
16431
16461
|
return X.initDone = (async () => {
|
|
16432
|
-
await
|
|
16462
|
+
await fn(), await pn(), e.mcp?.length && sd({
|
|
16433
16463
|
servers: e.mcp,
|
|
16434
|
-
emit:
|
|
16435
|
-
isReleased: () =>
|
|
16464
|
+
emit: Y,
|
|
16465
|
+
isReleased: () => We,
|
|
16436
16466
|
core: {
|
|
16437
16467
|
mcpClosers: X.mcpClosers,
|
|
16438
16468
|
mcpServers: X.mcpServers,
|
|
@@ -16441,29 +16471,29 @@ function X_(e, n, r) {
|
|
|
16441
16471
|
},
|
|
16442
16472
|
reservedNames: () => {
|
|
16443
16473
|
let e = /* @__PURE__ */ new Set();
|
|
16444
|
-
for (let t of
|
|
16445
|
-
let n =
|
|
16474
|
+
for (let t of K) {
|
|
16475
|
+
let n = Ee.get(t.name);
|
|
16446
16476
|
n && !n.startsWith("mcp:") && e.add(t.name);
|
|
16447
16477
|
}
|
|
16448
16478
|
return e;
|
|
16449
16479
|
},
|
|
16450
|
-
pushTool: (e, t) => (
|
|
16480
|
+
pushTool: (e, t) => (Ee.set(e.name, `mcp:${t}`), Ue.push(e), !0),
|
|
16451
16481
|
rebind: () => {
|
|
16452
|
-
|
|
16482
|
+
K = nt(), X.agent && X.agent.setTools(K), X.infoTick.value++;
|
|
16453
16483
|
},
|
|
16454
16484
|
debug: e.debug
|
|
16455
16485
|
});
|
|
16456
16486
|
let t = Ap(e.llm) ? e.llm : await k(e.llm);
|
|
16457
|
-
Mp(t, { emit:
|
|
16487
|
+
Mp(t, { emit: Y }), X.agent = Ms({
|
|
16458
16488
|
llm: t,
|
|
16459
|
-
systemPrompt:
|
|
16460
|
-
tools:
|
|
16461
|
-
middleware:
|
|
16489
|
+
systemPrompt: ye,
|
|
16490
|
+
tools: K,
|
|
16491
|
+
middleware: nn,
|
|
16462
16492
|
maxToolRounds: e.maxToolRounds,
|
|
16463
|
-
hasSubagent:
|
|
16464
|
-
pageAssertionGate:
|
|
16465
|
-
pageReadTools:
|
|
16466
|
-
deferredWriteTools:
|
|
16493
|
+
hasSubagent: dt,
|
|
16494
|
+
pageAssertionGate: V.domInspect === !0,
|
|
16495
|
+
pageReadTools: Ve.size ? Ve : void 0,
|
|
16496
|
+
deferredWriteTools: He.size ? He : void 0,
|
|
16467
16497
|
maxRetries: e.maxRetries,
|
|
16468
16498
|
stallMs: e.streamStallMs ?? 9e4,
|
|
16469
16499
|
streamMaxMs: e.streamMaxDurationMs ?? 18e5,
|
|
@@ -16472,16 +16502,16 @@ function X_(e, n, r) {
|
|
|
16472
16502
|
contextWindow: g.contextWindow,
|
|
16473
16503
|
maxOutputTokens: g.maxOutputTokens,
|
|
16474
16504
|
vision: g.vision,
|
|
16475
|
-
imageContentFormat:
|
|
16476
|
-
maxVerifyAttempts:
|
|
16505
|
+
imageContentFormat: je,
|
|
16506
|
+
maxVerifyAttempts: gt ? pt : 0,
|
|
16477
16507
|
roundTokenBudget: e.roundTokenBudget ?? 0,
|
|
16478
16508
|
staleReadInvalidation: e.staleReadInvalidation,
|
|
16479
16509
|
onLlmChange: (e) => {
|
|
16480
16510
|
C = e;
|
|
16481
16511
|
},
|
|
16482
16512
|
debug: e.debug
|
|
16483
|
-
}),
|
|
16484
|
-
X.agent && X.agent.setTools(
|
|
16513
|
+
}), se.current = X.agent, At && At.setReconfigureHook(() => {
|
|
16514
|
+
X.agent && X.agent.setTools(nt());
|
|
16485
16515
|
});
|
|
16486
16516
|
})(), X;
|
|
16487
16517
|
}
|
|
@@ -16946,11 +16976,11 @@ async function cv(e) {
|
|
|
16946
16976
|
//#region src/core/composables/useChat.ts
|
|
16947
16977
|
var lv = 4e3;
|
|
16948
16978
|
function uv(e = {}) {
|
|
16949
|
-
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({
|
|
16950
16980
|
messages: e.messages ?? [],
|
|
16951
16981
|
loading: !1,
|
|
16952
16982
|
error: null
|
|
16953
|
-
}), c = /* @__PURE__ */
|
|
16983
|
+
}), c = /* @__PURE__ */ Gt(null), l = /* @__PURE__ */ Gt(!0), u = null, d = /* @__PURE__ */ Gt([]), f = /* @__PURE__ */ Gt(null);
|
|
16954
16984
|
function p() {}
|
|
16955
16985
|
function m(e) {
|
|
16956
16986
|
let t = c.value;
|
|
@@ -16974,7 +17004,7 @@ function uv(e = {}) {
|
|
|
16974
17004
|
}
|
|
16975
17005
|
async function _(e) {
|
|
16976
17006
|
if (l.value = !0, n) {
|
|
16977
|
-
let t = /* @__PURE__ */
|
|
17007
|
+
let t = /* @__PURE__ */ Pt({
|
|
16978
17008
|
role: "assistant",
|
|
16979
17009
|
content: "",
|
|
16980
17010
|
timestamp: Date.now(),
|
|
@@ -17674,19 +17704,19 @@ function _v(e = {}) {
|
|
|
17674
17704
|
onQueuedCleared: e.onQueuedCleared,
|
|
17675
17705
|
onBeforeRegenerate: e.onBeforeRegenerate,
|
|
17676
17706
|
getFocuses: e.getFocuses
|
|
17677
|
-
}), { 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 = () => {
|
|
17678
17708
|
s.value = !s.value;
|
|
17679
|
-
}, l = /* @__PURE__ */
|
|
17709
|
+
}, l = /* @__PURE__ */ Gt(!1), u = () => {
|
|
17680
17710
|
l.value = !0;
|
|
17681
17711
|
}, d = () => {
|
|
17682
17712
|
l.value = !1;
|
|
17683
|
-
}, f = /* @__PURE__ */
|
|
17713
|
+
}, f = /* @__PURE__ */ Gt(!1), p = () => {
|
|
17684
17714
|
f.value = !0;
|
|
17685
17715
|
}, m = () => {
|
|
17686
17716
|
f.value = !1;
|
|
17687
|
-
}, h = /* @__PURE__ */
|
|
17717
|
+
}, h = /* @__PURE__ */ Gt({}), g = (e) => h.value[e] === !0, _ = (e) => {
|
|
17688
17718
|
h.value[e] = !g(e);
|
|
17689
|
-
}, v = /* @__PURE__ */
|
|
17719
|
+
}, v = /* @__PURE__ */ Gt(!1), y = (e) => {
|
|
17690
17720
|
cv(e).then((e) => {
|
|
17691
17721
|
e && (v.value = !0, setTimeout(() => {
|
|
17692
17722
|
v.value = !1;
|
|
@@ -17705,8 +17735,8 @@ function _v(e = {}) {
|
|
|
17705
17735
|
minute: "2-digit"
|
|
17706
17736
|
}), w = () => {
|
|
17707
17737
|
let e = T.value, t = ne.value;
|
|
17708
|
-
!o.value.trim() && !e.length || (r(o.value,
|
|
17709
|
-
}, 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) => {
|
|
17710
17740
|
E.value = e, clearTimeout(O), O = setTimeout(() => {
|
|
17711
17741
|
E.value = "";
|
|
17712
17742
|
}, 4e3);
|
|
@@ -17731,23 +17761,23 @@ function _v(e = {}) {
|
|
|
17731
17761
|
}
|
|
17732
17762
|
}, te = (e) => {
|
|
17733
17763
|
T.value = T.value.filter((t) => t.id !== e);
|
|
17734
|
-
}, ne = ri(() => e.pendingQuote?.value ?? null),
|
|
17764
|
+
}, ne = ri(() => e.pendingQuote?.value ?? null), A = (t) => {
|
|
17735
17765
|
e.onSetQuote?.(t);
|
|
17736
|
-
},
|
|
17766
|
+
}, re = () => {
|
|
17737
17767
|
e.onClearQuote?.();
|
|
17738
|
-
},
|
|
17768
|
+
}, ie = (e) => {
|
|
17739
17769
|
e.isComposing || e.keyCode === 229 || e.key === "Enter" && !e.shiftKey && (e.preventDefault(), w());
|
|
17740
|
-
},
|
|
17770
|
+
}, ae = (e) => {
|
|
17741
17771
|
o.value = a.value[e] || "", i(e);
|
|
17742
|
-
},
|
|
17772
|
+
}, j = (e) => {
|
|
17743
17773
|
let t = n.messages, r = t[e];
|
|
17744
17774
|
if (!r || r.role !== "assistant") return !1;
|
|
17745
17775
|
let i = "reasoning" in r ? r.reasoning : void 0, a = "steps" in r ? r.steps : void 0;
|
|
17746
17776
|
return n.loading && e === t.length - 1 && !r.content && !i && !(a && a.length);
|
|
17747
|
-
},
|
|
17777
|
+
}, M = ri(() => (e.infoTick?.value, e.getFocuses?.() ?? [])), oe = ri(() => (e.infoTick?.value, e.getInfo?.()?.planConfirmation)), N = (t) => e.onAddFocus ? e.onAddFocus(t) : {
|
|
17748
17778
|
ok: !1,
|
|
17749
17779
|
error: "focus 未启用"
|
|
17750
|
-
},
|
|
17780
|
+
}, se = (t) => {
|
|
17751
17781
|
e.onRemoveFocus?.(t);
|
|
17752
17782
|
}, P = () => {
|
|
17753
17783
|
e.onClearFocus?.();
|
|
@@ -17775,21 +17805,21 @@ function _v(e = {}) {
|
|
|
17775
17805
|
undo: S,
|
|
17776
17806
|
formatTime: C,
|
|
17777
17807
|
send: w,
|
|
17778
|
-
keydown:
|
|
17808
|
+
keydown: ie,
|
|
17779
17809
|
pendingImages: T,
|
|
17780
17810
|
addImageFiles: ee,
|
|
17781
17811
|
removePendingImage: te,
|
|
17782
17812
|
imageInputError: E,
|
|
17783
17813
|
compressingImages: D,
|
|
17784
17814
|
quote: ne,
|
|
17785
|
-
setQuote:
|
|
17786
|
-
clearQuote:
|
|
17787
|
-
editQueued:
|
|
17788
|
-
isPendingAssistant:
|
|
17789
|
-
focuses:
|
|
17790
|
-
planConfirmation:
|
|
17791
|
-
addFocus:
|
|
17792
|
-
removeFocus:
|
|
17815
|
+
setQuote: A,
|
|
17816
|
+
clearQuote: re,
|
|
17817
|
+
editQueued: ae,
|
|
17818
|
+
isPendingAssistant: j,
|
|
17819
|
+
focuses: M,
|
|
17820
|
+
planConfirmation: oe,
|
|
17821
|
+
addFocus: N,
|
|
17822
|
+
removeFocus: se,
|
|
17793
17823
|
clearFocus: P,
|
|
17794
17824
|
focusChipClick: F,
|
|
17795
17825
|
icons: I,
|
|
@@ -17809,4 +17839,4 @@ function yv(e) {
|
|
|
17809
17839
|
return Z_(e);
|
|
17810
17840
|
}
|
|
17811
17841
|
//#endregion
|
|
17812
|
-
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 };
|