page-agent-sdk 3.13.0 → 3.14.0
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 +6 -7
- package/README.zh-CN.md +5 -6
- package/dist/page-agent-sdk.headless.js +781 -769
- package/dist/page-agent-sdk.iife.js +109 -109
- package/dist/page-agent-sdk.js +482 -470
- package/dist/page-agent-sdk.umd.cjs +6 -6
- package/package.json +1 -1
package/dist/page-agent-sdk.js
CHANGED
|
@@ -151,7 +151,7 @@ function O(e) {
|
|
|
151
151
|
var k = process.env.NODE_ENV === "production" ? {} : Object.freeze({}), A = process.env.NODE_ENV === "production" ? [] : Object.freeze([]), ee = () => {}, j = () => !1, M = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), N = (e) => e.startsWith("onUpdate:"), P = Object.assign, te = (e, t) => {
|
|
152
152
|
let n = e.indexOf(t);
|
|
153
153
|
n > -1 && e.splice(n, 1);
|
|
154
|
-
}, ne = Object.prototype.hasOwnProperty, F = (e, t) => ne.call(e, t), I = Array.isArray,
|
|
154
|
+
}, ne = Object.prototype.hasOwnProperty, F = (e, t) => ne.call(e, t), I = Array.isArray, re = (e) => ce(e) === "[object Map]", ie = (e) => ce(e) === "[object Set]", L = (e) => ce(e) === "[object Date]", R = (e) => typeof e == "function", z = (e) => typeof e == "string", ae = (e) => typeof e == "symbol", B = (e) => typeof e == "object" && !!e, oe = (e) => (B(e) || R(e)) && R(e.then) && R(e.catch), se = Object.prototype.toString, ce = (e) => se.call(e), le = (e) => ce(e).slice(8, -1), ue = (e) => ce(e) === "[object Object]", de = (e) => z(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, V = /* @__PURE__ */ O(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"), fe = /* @__PURE__ */ O("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"), pe = (e) => {
|
|
155
155
|
let t = /* @__PURE__ */ Object.create(null);
|
|
156
156
|
return ((n) => t[n] || (t[n] = e(n)));
|
|
157
157
|
}, me = /-\w/g, he = pe((e) => e.replace(me, (e) => e.slice(1).toUpperCase())), ge = /\B([A-Z])/g, _e = pe((e) => e.replace(ge, "-$1").toLowerCase()), ve = pe((e) => e.charAt(0).toUpperCase() + e.slice(1)), ye = pe((e) => e ? `on${ve(e)}` : ""), be = (e, t) => !Object.is(e, t), xe = (e, ...t) => {
|
|
@@ -167,18 +167,18 @@ var k = process.env.NODE_ENV === "production" ? {} : Object.freeze({}), A = proc
|
|
|
167
167
|
let t = parseFloat(e);
|
|
168
168
|
return isNaN(t) ? e : t;
|
|
169
169
|
}, we = (e) => {
|
|
170
|
-
let t =
|
|
170
|
+
let t = z(e) ? Number(e) : NaN;
|
|
171
171
|
return isNaN(t) ? e : t;
|
|
172
172
|
}, Te, Ee = () => Te ||= typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
173
173
|
function De(e) {
|
|
174
174
|
if (I(e)) {
|
|
175
175
|
let t = {};
|
|
176
176
|
for (let n = 0; n < e.length; n++) {
|
|
177
|
-
let r = e[n], i =
|
|
177
|
+
let r = e[n], i = z(r) ? je(r) : De(r);
|
|
178
178
|
if (i) for (let e in i) t[e] = i[e];
|
|
179
179
|
}
|
|
180
180
|
return t;
|
|
181
|
-
} else if (
|
|
181
|
+
} else if (z(e) || B(e)) return e;
|
|
182
182
|
}
|
|
183
183
|
var Oe = /;(?![^(]*\))/g, ke = /:([^]+)/, Ae = /\/\*[^]*?\*\//g;
|
|
184
184
|
function je(e) {
|
|
@@ -192,7 +192,7 @@ function je(e) {
|
|
|
192
192
|
}
|
|
193
193
|
function H(e) {
|
|
194
194
|
let t = "";
|
|
195
|
-
if (
|
|
195
|
+
if (z(e)) t = e;
|
|
196
196
|
else if (I(e)) for (let n = 0; n < e.length; n++) {
|
|
197
197
|
let r = H(e[n]);
|
|
198
198
|
r && (t += r + " ");
|
|
@@ -213,7 +213,7 @@ function Ve(e, t) {
|
|
|
213
213
|
}
|
|
214
214
|
function He(e, t) {
|
|
215
215
|
if (e === t) return !0;
|
|
216
|
-
let n =
|
|
216
|
+
let n = L(e), r = L(t);
|
|
217
217
|
if (n || r) return n && r ? e.getTime() === t.getTime() : !1;
|
|
218
218
|
if (n = ae(e), r = ae(t), n || r) return e === t;
|
|
219
219
|
if (n = I(e), r = I(t), n || r) return n && r ? Ve(e, t) : !1;
|
|
@@ -226,7 +226,7 @@ function He(e, t) {
|
|
|
226
226
|
}
|
|
227
227
|
return String(e) === String(t);
|
|
228
228
|
}
|
|
229
|
-
var Ue = (e) => !!(e && e.__v_isRef === !0), U = (e) =>
|
|
229
|
+
var Ue = (e) => !!(e && e.__v_isRef === !0), U = (e) => z(e) ? e : e == null ? "" : I(e) || B(e) && (e.toString === se || !R(e.toString)) ? Ue(e) ? U(e.value) : JSON.stringify(e, We, 2) : String(e), We = (e, t) => Ue(t) ? We(e, t.value) : re(t) ? { [`Map(${t.size})`]: [...t.entries()].reduce((e, [t, n], r) => (e[Ge(t, r) + " =>"] = n, e), {}) } : ie(t) ? { [`Set(${t.size})`]: [...t.values()].map((e) => Ge(e)) } : ae(t) ? Ge(t) : B(t) && !I(t) && !ue(t) ? String(t) : t, Ge = (e, t = "") => ae(e) ? `Symbol(${e.description ?? t})` : e;
|
|
230
230
|
//#endregion
|
|
231
231
|
//#region node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
232
232
|
function Ke(e, ...t) {
|
|
@@ -525,13 +525,13 @@ function Tt(e, t, n, r, i, a) {
|
|
|
525
525
|
});
|
|
526
526
|
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(Ct)), t) {
|
|
527
527
|
case "add":
|
|
528
|
-
i ? a && s(o.get("length")) : (s(o.get(xt)),
|
|
528
|
+
i ? a && s(o.get("length")) : (s(o.get(xt)), re(e) && s(o.get(St)));
|
|
529
529
|
break;
|
|
530
530
|
case "delete":
|
|
531
|
-
i || (s(o.get(xt)),
|
|
531
|
+
i || (s(o.get(xt)), re(e) && s(o.get(St)));
|
|
532
532
|
break;
|
|
533
533
|
case "set":
|
|
534
|
-
|
|
534
|
+
re(e) && s(o.get(xt));
|
|
535
535
|
break;
|
|
536
536
|
}
|
|
537
537
|
}
|
|
@@ -541,37 +541,37 @@ function Et(e) {
|
|
|
541
541
|
let t = /* @__PURE__ */ _n(e);
|
|
542
542
|
return t === e ? t : (wt(t, "iterate", Ct), /* @__PURE__ */ hn(e) ? t : t.map(yn));
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function Dt(e) {
|
|
545
545
|
return wt(e = /* @__PURE__ */ _n(e), "iterate", Ct), e;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function G(e, t) {
|
|
548
548
|
return /* @__PURE__ */ mn(e) ? bn(/* @__PURE__ */ pn(e) ? yn(t) : t) : yn(t);
|
|
549
549
|
}
|
|
550
550
|
var Ot = {
|
|
551
551
|
__proto__: null,
|
|
552
552
|
[Symbol.iterator]() {
|
|
553
|
-
return kt(this, Symbol.iterator, (e) =>
|
|
553
|
+
return kt(this, Symbol.iterator, (e) => G(this, e));
|
|
554
554
|
},
|
|
555
555
|
concat(...e) {
|
|
556
556
|
return Et(this).concat(...e.map((e) => I(e) ? Et(e) : e));
|
|
557
557
|
},
|
|
558
558
|
entries() {
|
|
559
|
-
return kt(this, "entries", (e) => (e[1] =
|
|
559
|
+
return kt(this, "entries", (e) => (e[1] = G(this, e[1]), e));
|
|
560
560
|
},
|
|
561
561
|
every(e, t) {
|
|
562
562
|
return jt(this, "every", e, t, void 0, arguments);
|
|
563
563
|
},
|
|
564
564
|
filter(e, t) {
|
|
565
|
-
return jt(this, "filter", e, t, (e) => e.map((e) =>
|
|
565
|
+
return jt(this, "filter", e, t, (e) => e.map((e) => G(this, e)), arguments);
|
|
566
566
|
},
|
|
567
567
|
find(e, t) {
|
|
568
|
-
return jt(this, "find", e, t, (e) =>
|
|
568
|
+
return jt(this, "find", e, t, (e) => G(this, e), arguments);
|
|
569
569
|
},
|
|
570
570
|
findIndex(e, t) {
|
|
571
571
|
return jt(this, "findIndex", e, t, void 0, arguments);
|
|
572
572
|
},
|
|
573
573
|
findLast(e, t) {
|
|
574
|
-
return jt(this, "findLast", e, t, (e) =>
|
|
574
|
+
return jt(this, "findLast", e, t, (e) => G(this, e), arguments);
|
|
575
575
|
},
|
|
576
576
|
findLastIndex(e, t) {
|
|
577
577
|
return jt(this, "findLastIndex", e, t, void 0, arguments);
|
|
@@ -628,11 +628,11 @@ var Ot = {
|
|
|
628
628
|
return Pt(this, "unshift", e);
|
|
629
629
|
},
|
|
630
630
|
values() {
|
|
631
|
-
return kt(this, "values", (e) =>
|
|
631
|
+
return kt(this, "values", (e) => G(this, e));
|
|
632
632
|
}
|
|
633
633
|
};
|
|
634
634
|
function kt(e, t, n) {
|
|
635
|
-
let r =
|
|
635
|
+
let r = Dt(e), i = r[t]();
|
|
636
636
|
return r !== e && !/* @__PURE__ */ hn(e) && (i._next = i.next, i.next = () => {
|
|
637
637
|
let e = i._next();
|
|
638
638
|
return e.done || (e.value = n(e.value)), e;
|
|
@@ -640,14 +640,14 @@ function kt(e, t, n) {
|
|
|
640
640
|
}
|
|
641
641
|
var At = Array.prototype;
|
|
642
642
|
function jt(e, t, n, r, i, a) {
|
|
643
|
-
let o =
|
|
643
|
+
let o = Dt(e), s = o !== e && !/* @__PURE__ */ hn(e), c = o[t];
|
|
644
644
|
if (c !== At[t]) {
|
|
645
645
|
let t = c.apply(e, a);
|
|
646
646
|
return s ? yn(t) : t;
|
|
647
647
|
}
|
|
648
648
|
let l = n;
|
|
649
649
|
o !== e && (s ? l = function(t, r) {
|
|
650
|
-
return n.call(this,
|
|
650
|
+
return n.call(this, G(e, t), r, e);
|
|
651
651
|
} : n.length > 2 && (l = function(t, r) {
|
|
652
652
|
return n.call(this, t, r, e);
|
|
653
653
|
}));
|
|
@@ -655,14 +655,14 @@ function jt(e, t, n, r, i, a) {
|
|
|
655
655
|
return s && i ? i(u) : u;
|
|
656
656
|
}
|
|
657
657
|
function Mt(e, t, n, r) {
|
|
658
|
-
let i =
|
|
658
|
+
let i = Dt(e), a = i !== e && !/* @__PURE__ */ hn(e), o = n, s = !1;
|
|
659
659
|
i !== e && (a ? (s = r.length === 0, o = function(t, r, i) {
|
|
660
|
-
return s && (s = !1, t =
|
|
660
|
+
return s && (s = !1, t = G(e, t)), n.call(this, t, G(e, r), i, e);
|
|
661
661
|
}) : n.length > 3 && (o = function(t, r, i) {
|
|
662
662
|
return n.call(this, t, r, i, e);
|
|
663
663
|
}));
|
|
664
664
|
let c = i[t](o, ...r);
|
|
665
|
-
return s ?
|
|
665
|
+
return s ? G(e, c) : c;
|
|
666
666
|
}
|
|
667
667
|
function Nt(e, t, n) {
|
|
668
668
|
let r = /* @__PURE__ */ _n(e);
|
|
@@ -743,7 +743,7 @@ var Rt = class {
|
|
|
743
743
|
}, Vt = /* @__PURE__ */ new zt(), Ht = /* @__PURE__ */ new Bt(), Ut = /* @__PURE__ */ new zt(!0), Wt = /* @__PURE__ */ new Bt(!0), Gt = (e) => e, Kt = (e) => Reflect.getPrototypeOf(e);
|
|
744
744
|
function qt(e, t, n) {
|
|
745
745
|
return function(...r) {
|
|
746
|
-
let i = this.__v_raw, a = /* @__PURE__ */ _n(i), o =
|
|
746
|
+
let i = this.__v_raw, a = /* @__PURE__ */ _n(i), o = re(a), s = e === "entries" || e === Symbol.iterator && o, c = e === "keys" && o, l = i[e](...r), u = n ? Gt : t ? bn : yn;
|
|
747
747
|
return !t && wt(a, "iterate", c ? St : xt), P(Object.create(l), { next() {
|
|
748
748
|
let { value: e, done: t } = l.next();
|
|
749
749
|
return t ? {
|
|
@@ -812,7 +812,7 @@ function Yt(e, t) {
|
|
|
812
812
|
return i && Tt(t, "delete", e, void 0, a), o;
|
|
813
813
|
},
|
|
814
814
|
clear() {
|
|
815
|
-
let e = /* @__PURE__ */ _n(this), t = e.size !== 0, n = process.env.NODE_ENV === "production" ? void 0 :
|
|
815
|
+
let e = /* @__PURE__ */ _n(this), t = e.size !== 0, n = process.env.NODE_ENV === "production" ? void 0 : re(e) ? new Map(e) : new Set(e), r = e.clear();
|
|
816
816
|
return t && Tt(e, "clear", void 0, void 0, n), r;
|
|
817
817
|
}
|
|
818
818
|
}), [
|
|
@@ -980,7 +980,7 @@ var kn = class {
|
|
|
980
980
|
// @__NO_SIDE_EFFECTS__
|
|
981
981
|
function An(e, t, n = !1) {
|
|
982
982
|
let r, i;
|
|
983
|
-
|
|
983
|
+
R(e) ? r = e : (r = e.get, i = e.set);
|
|
984
984
|
let a = new kn(r, i, n);
|
|
985
985
|
return process.env.NODE_ENV !== "production" && t && !n && (a.onTrack = t.onTrack, a.onTrigger = t.onTrigger), a;
|
|
986
986
|
}
|
|
@@ -998,9 +998,9 @@ function Fn(e, t, n = k) {
|
|
|
998
998
|
if (/* @__PURE__ */ xn(e) ? (f = () => e.value, h = /* @__PURE__ */ hn(e)) : /* @__PURE__ */ pn(e) ? (f = () => u(e), h = !0) : I(e) ? (g = !0, h = e.some((e) => /* @__PURE__ */ pn(e) || /* @__PURE__ */ hn(e)), f = () => e.map((e) => {
|
|
999
999
|
if (/* @__PURE__ */ xn(e)) return e.value;
|
|
1000
1000
|
if (/* @__PURE__ */ pn(e)) return u(e);
|
|
1001
|
-
if (
|
|
1001
|
+
if (R(e)) return c ? c(e, 2) : e();
|
|
1002
1002
|
process.env.NODE_ENV !== "production" && l(e);
|
|
1003
|
-
})) :
|
|
1003
|
+
})) : R(e) ? f = t ? c ? () => c(e, 2) : e : () => {
|
|
1004
1004
|
if (p) {
|
|
1005
1005
|
pt();
|
|
1006
1006
|
try {
|
|
@@ -1063,7 +1063,7 @@ function In(e, t = Infinity, n) {
|
|
|
1063
1063
|
if (t <= 0 || !B(e) || e.__v_skip || (n ||= /* @__PURE__ */ new Map(), (n.get(e) || 0) >= t)) return e;
|
|
1064
1064
|
if (n.set(e, t), t--, /* @__PURE__ */ xn(e)) In(e.value, t, n);
|
|
1065
1065
|
else if (I(e)) for (let r = 0; r < e.length; r++) In(e[r], t, n);
|
|
1066
|
-
else if (
|
|
1066
|
+
else if (ie(e) || re(e)) e.forEach((e) => {
|
|
1067
1067
|
In(e, t, n);
|
|
1068
1068
|
});
|
|
1069
1069
|
else if (ue(e)) {
|
|
@@ -1134,11 +1134,11 @@ function Wn(e) {
|
|
|
1134
1134
|
}), n.length > 3 && t.push(" ..."), t;
|
|
1135
1135
|
}
|
|
1136
1136
|
function Gn(e, t, n) {
|
|
1137
|
-
return
|
|
1137
|
+
return z(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ xn(t) ? (t = Gn(e, /* @__PURE__ */ _n(t.value), !0), n ? t : [
|
|
1138
1138
|
`${e}=Ref<`,
|
|
1139
1139
|
t,
|
|
1140
1140
|
">"
|
|
1141
|
-
]) :
|
|
1141
|
+
]) : R(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */ _n(t), n ? t : [`${e}=`, t]);
|
|
1142
1142
|
}
|
|
1143
1143
|
function Kn(e, t) {
|
|
1144
1144
|
process.env.NODE_ENV !== "production" && e !== void 0 && (typeof e == "number" ? isNaN(e) && q(`${t} is NaN - the duration expression might be incorrect.`) : q(`${t} is not a valid number - got ${JSON.stringify(e)}.`));
|
|
@@ -1184,7 +1184,7 @@ function Jn(e, t, n, r) {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
}
|
|
1186
1186
|
function Yn(e, t, n, r) {
|
|
1187
|
-
if (
|
|
1187
|
+
if (R(e)) {
|
|
1188
1188
|
let i = Jn(e, t, n, r);
|
|
1189
1189
|
return i && oe(i) && i.catch((e) => {
|
|
1190
1190
|
Xn(e, t, n);
|
|
@@ -1435,7 +1435,7 @@ function Yr(e, t) {
|
|
|
1435
1435
|
let n = Gs(Wr), r = e.dirs ||= [];
|
|
1436
1436
|
for (let e = 0; e < t.length; e++) {
|
|
1437
1437
|
let [i, a, o, s = k] = t[e];
|
|
1438
|
-
i && (
|
|
1438
|
+
i && (R(i) && (i = {
|
|
1439
1439
|
mounted: i,
|
|
1440
1440
|
updated: i
|
|
1441
1441
|
}), i.deep && In(a), r.push({
|
|
@@ -1474,7 +1474,7 @@ function Qr(e, t, n = !1) {
|
|
|
1474
1474
|
if (r || La) {
|
|
1475
1475
|
let i = La ? La._context.provides : r ? r.parent == null || r.ce ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : void 0;
|
|
1476
1476
|
if (i && e in i) return i[e];
|
|
1477
|
-
if (arguments.length > 1) return n &&
|
|
1477
|
+
if (arguments.length > 1) return n && R(t) ? t.call(r && r.proxy) : t;
|
|
1478
1478
|
process.env.NODE_ENV !== "production" && q(`injection "${String(e)}" not found.`);
|
|
1479
1479
|
} else process.env.NODE_ENV !== "production" && q("inject() can only be used inside setup() or functional components.");
|
|
1480
1480
|
}
|
|
@@ -1485,7 +1485,7 @@ var $r = /* @__PURE__ */ Symbol.for("v-scx"), ei = () => {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
};
|
|
1487
1487
|
function ti(e, t, n) {
|
|
1488
|
-
return process.env.NODE_ENV !== "production" && !
|
|
1488
|
+
return process.env.NODE_ENV !== "production" && !R(t) && q("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."), ni(e, t, n);
|
|
1489
1489
|
}
|
|
1490
1490
|
function ni(e, t, n = k) {
|
|
1491
1491
|
let { immediate: r, deep: i, flush: a, once: o } = n;
|
|
@@ -1516,8 +1516,8 @@ function ni(e, t, n = k) {
|
|
|
1516
1516
|
return Ps && (l ? l.push(f) : c && f()), f;
|
|
1517
1517
|
}
|
|
1518
1518
|
function ri(e, t, n) {
|
|
1519
|
-
let r = this.proxy, i =
|
|
1520
|
-
|
|
1519
|
+
let r = this.proxy, i = z(e) ? e.includes(".") ? ii(r, e) : () => r[e] : e.bind(r, r), a;
|
|
1520
|
+
R(t) ? a = t : (a = t.handler, n = t);
|
|
1521
1521
|
let o = ks(this), s = ni(i, a.bind(r), n);
|
|
1522
1522
|
return o(), s;
|
|
1523
1523
|
}
|
|
@@ -1531,7 +1531,7 @@ function ii(e, t) {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
var ai = /* @__PURE__ */ new WeakMap(), oi = /* @__PURE__ */ Symbol("_vte"), si = (e) => e.__isTeleport, ci = (e) => e && (e.disabled || e.disabled === ""), li = (e) => e && (e.defer || e.defer === ""), ui = (e) => typeof SVGElement < "u" && e instanceof SVGElement, di = (e) => typeof MathMLElement == "function" && e instanceof MathMLElement, fi = (e, t) => {
|
|
1533
1533
|
let n = e && e.to;
|
|
1534
|
-
if (
|
|
1534
|
+
if (z(n)) if (t) {
|
|
1535
1535
|
let r = t(n);
|
|
1536
1536
|
return process.env.NODE_ENV !== "production" && !r && !ci(e) && q(`Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`), r;
|
|
1537
1537
|
} else return process.env.NODE_ENV !== "production" && q("Current renderer does not support string target for Teleports. (missing querySelector renderer option)"), null;
|
|
@@ -1777,7 +1777,7 @@ function ji(e) {
|
|
|
1777
1777
|
let { shapeFlag: t, children: n } = e;
|
|
1778
1778
|
if (n) {
|
|
1779
1779
|
if (t & 16) return n[0];
|
|
1780
|
-
if (t & 32 &&
|
|
1780
|
+
if (t & 32 && R(n.default)) return n.default();
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
1783
|
function Mi(e, t) {
|
|
@@ -1794,7 +1794,7 @@ function Ni(e, t = !1, n) {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
// @__NO_SIDE_EFFECTS__
|
|
1796
1796
|
function Pi(e, t) {
|
|
1797
|
-
return
|
|
1797
|
+
return R(e) ? /* @__PURE__ */ P({ name: e.name }, t, { setup: e }) : e;
|
|
1798
1798
|
}
|
|
1799
1799
|
function Fi(e) {
|
|
1800
1800
|
e.ids = [
|
|
@@ -1825,13 +1825,13 @@ function zi(e, t, n, r, i = !1) {
|
|
|
1825
1825
|
}
|
|
1826
1826
|
let l = t && t.r, u = s.refs === k ? s.refs = {} : s.refs, d = s.setupState, f = /* @__PURE__ */ _n(d), p = d === k ? j : (e) => process.env.NODE_ENV !== "production" && (F(f, e) && !/* @__PURE__ */ xn(f[e]) && q(`Template ref "${e}" used on a non-ref value. It will not work in the production build.`), Ii.has(f[e])) || Li(u, e) ? !1 : F(f, e), m = (e, t) => !(process.env.NODE_ENV !== "production" && Ii.has(e) || t && Li(u, t));
|
|
1827
1827
|
if (l != null && l !== c) {
|
|
1828
|
-
if (Bi(t),
|
|
1828
|
+
if (Bi(t), z(l)) u[l] = null, p(l) && (d[l] = null);
|
|
1829
1829
|
else if (/* @__PURE__ */ xn(l)) {
|
|
1830
1830
|
let e = t;
|
|
1831
1831
|
m(l, e.k) && (l.value = null), e.k && (u[e.k] = null);
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
|
-
if (
|
|
1834
|
+
if (R(c)) {
|
|
1835
1835
|
pt();
|
|
1836
1836
|
try {
|
|
1837
1837
|
Jn(c, s, 12, [o, u]);
|
|
@@ -1839,7 +1839,7 @@ function zi(e, t, n, r, i = !1) {
|
|
|
1839
1839
|
mt();
|
|
1840
1840
|
}
|
|
1841
1841
|
} else {
|
|
1842
|
-
let t =
|
|
1842
|
+
let t = z(c), r = /* @__PURE__ */ xn(c);
|
|
1843
1843
|
if (t || r) {
|
|
1844
1844
|
let s = () => {
|
|
1845
1845
|
if (e.f) {
|
|
@@ -1913,9 +1913,9 @@ function ia(e, t = Ts) {
|
|
|
1913
1913
|
var aa = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
1914
1914
|
function oa(e, t, n, r) {
|
|
1915
1915
|
let i, a = n && n[r], o = I(e);
|
|
1916
|
-
if (o ||
|
|
1916
|
+
if (o || z(e)) {
|
|
1917
1917
|
let n = o && /* @__PURE__ */ pn(e), r = !1, s = !1;
|
|
1918
|
-
n && (r = !/* @__PURE__ */ hn(e), s = /* @__PURE__ */ mn(e), e =
|
|
1918
|
+
n && (r = !/* @__PURE__ */ hn(e), s = /* @__PURE__ */ mn(e), e = Dt(e)), i = Array(e.length);
|
|
1919
1919
|
for (let n = 0, o = e.length; n < o; n++) i[n] = t(r ? s ? bn(yn(e[n])) : yn(e[n]) : e[n], n, void 0, a && a[n]);
|
|
1920
1920
|
} else if (typeof e == "number") if (process.env.NODE_ENV !== "production" && (!Number.isInteger(e) || e < 0)) q(`The v-for range expects a positive integer value but got ${e}.`), i = [];
|
|
1921
1921
|
else {
|
|
@@ -1989,7 +1989,7 @@ var la = (e) => e ? Ns(e) ? Gs(e) : la(e.parent) : null, ua = /* @__PURE__ */ P(
|
|
|
1989
1989
|
if ((u = s.__cssModules) && (u = u[t])) return u;
|
|
1990
1990
|
if (n !== k && F(n, t)) return o[t] = 4, n[t];
|
|
1991
1991
|
if (d = c.config.globalProperties, F(d, t)) return d[t];
|
|
1992
|
-
process.env.NODE_ENV !== "production" && Wr && (!
|
|
1992
|
+
process.env.NODE_ENV !== "production" && Wr && (!z(t) || t.indexOf("__v") !== 0) && (i !== k && da(t[0]) && F(i, t) ? q(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`) : e === Wr && q(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`));
|
|
1993
1993
|
},
|
|
1994
1994
|
set({ _: e }, t, n) {
|
|
1995
1995
|
let { data: r, setupState: i, ctx: a } = e;
|
|
@@ -2071,7 +2071,7 @@ function ba(e) {
|
|
|
2071
2071
|
}
|
|
2072
2072
|
if (l && xa(l, r, j), o) for (let e in o) {
|
|
2073
2073
|
let t = o[e];
|
|
2074
|
-
|
|
2074
|
+
R(t) ? (process.env.NODE_ENV === "production" ? r[e] = t.bind(n) : Object.defineProperty(r, e, {
|
|
2075
2075
|
value: t.bind(n),
|
|
2076
2076
|
configurable: !0,
|
|
2077
2077
|
enumerable: !0,
|
|
@@ -2079,7 +2079,7 @@ function ba(e) {
|
|
|
2079
2079
|
}), process.env.NODE_ENV !== "production" && j("Methods", e)) : process.env.NODE_ENV !== "production" && q(`Method "${e}" has type "${typeof t}" in the component definition. Did you reference the function correctly?`);
|
|
2080
2080
|
}
|
|
2081
2081
|
if (i) {
|
|
2082
|
-
process.env.NODE_ENV !== "production" && !
|
|
2082
|
+
process.env.NODE_ENV !== "production" && !R(i) && q("The data option must be a function. Plain object usage is no longer supported.");
|
|
2083
2083
|
let t = i.call(n, n);
|
|
2084
2084
|
if (process.env.NODE_ENV !== "production" && oe(t) && q("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."), !B(t)) process.env.NODE_ENV !== "production" && q("data() should return an object.");
|
|
2085
2085
|
else if (e.data = /* @__PURE__ */ cn(t), process.env.NODE_ENV !== "production") for (let e in t) j("Data", e), da(e[0]) || Object.defineProperty(r, e, {
|
|
@@ -2090,11 +2090,11 @@ function ba(e) {
|
|
|
2090
2090
|
});
|
|
2091
2091
|
}
|
|
2092
2092
|
if (ya = !0, a) for (let e in a) {
|
|
2093
|
-
let t = a[e], i =
|
|
2093
|
+
let t = a[e], i = R(t) ? t.bind(n, n) : R(t.get) ? t.get.bind(n, n) : ee;
|
|
2094
2094
|
process.env.NODE_ENV !== "production" && i === ee && q(`Computed property "${e}" has no getter.`);
|
|
2095
2095
|
let o = Zs({
|
|
2096
2096
|
get: i,
|
|
2097
|
-
set: !
|
|
2097
|
+
set: !R(t) && R(t.set) ? t.set.bind(n) : process.env.NODE_ENV === "production" ? ee : () => {
|
|
2098
2098
|
q(`Write operation failed: computed property "${e}" is readonly.`);
|
|
2099
2099
|
}
|
|
2100
2100
|
});
|
|
@@ -2107,7 +2107,7 @@ function ba(e) {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
if (s) for (let e in s) Ca(s[e], r, n, e);
|
|
2109
2109
|
if (c) {
|
|
2110
|
-
let e =
|
|
2110
|
+
let e = R(c) ? c.call(n) : c;
|
|
2111
2111
|
Reflect.ownKeys(e).forEach((t) => {
|
|
2112
2112
|
Zr(t, e[t]);
|
|
2113
2113
|
});
|
|
@@ -2145,14 +2145,14 @@ function Sa(e, t, n) {
|
|
|
2145
2145
|
}
|
|
2146
2146
|
function Ca(e, t, n, r) {
|
|
2147
2147
|
let i = r.includes(".") ? ii(n, r) : () => n[r];
|
|
2148
|
-
if (
|
|
2148
|
+
if (z(e)) {
|
|
2149
2149
|
let n = t[e];
|
|
2150
|
-
|
|
2151
|
-
} else if (
|
|
2150
|
+
R(n) ? ti(i, n) : process.env.NODE_ENV !== "production" && q(`Invalid watch handler specified by key "${e}"`, n);
|
|
2151
|
+
} else if (R(e)) ti(i, e.bind(n));
|
|
2152
2152
|
else if (B(e)) if (I(e)) e.forEach((e) => Ca(e, t, n, r));
|
|
2153
2153
|
else {
|
|
2154
|
-
let r =
|
|
2155
|
-
|
|
2154
|
+
let r = R(e.handler) ? e.handler.bind(n) : t[e.handler];
|
|
2155
|
+
R(r) ? ti(i, r, e) : process.env.NODE_ENV !== "production" && q(`Invalid watch handler specified by key "${e.handler}"`, r);
|
|
2156
2156
|
}
|
|
2157
2157
|
else process.env.NODE_ENV !== "production" && q(`Invalid watch option: "${r}"`, e);
|
|
2158
2158
|
}
|
|
@@ -2198,7 +2198,7 @@ var Ea = {
|
|
|
2198
2198
|
};
|
|
2199
2199
|
function Da(e, t) {
|
|
2200
2200
|
return t ? e ? function() {
|
|
2201
|
-
return P(
|
|
2201
|
+
return P(R(e) ? e.call(this, this) : e, R(t) ? t.call(this, this) : t);
|
|
2202
2202
|
} : t : e;
|
|
2203
2203
|
}
|
|
2204
2204
|
function Oa(e, t) {
|
|
@@ -2252,7 +2252,7 @@ function Pa() {
|
|
|
2252
2252
|
var Fa = 0;
|
|
2253
2253
|
function Ia(e, t) {
|
|
2254
2254
|
return function(n, r = null) {
|
|
2255
|
-
|
|
2255
|
+
R(n) || (n = P({}, n)), r != null && !B(r) && (process.env.NODE_ENV !== "production" && q("root props passed to app.mount() must be an object."), r = null);
|
|
2256
2256
|
let i = Pa(), a = /* @__PURE__ */ new WeakSet(), o = [], s = !1, c = i.app = {
|
|
2257
2257
|
_uid: Fa++,
|
|
2258
2258
|
_component: n,
|
|
@@ -2268,7 +2268,7 @@ function Ia(e, t) {
|
|
|
2268
2268
|
process.env.NODE_ENV !== "production" && q("app.config cannot be replaced. Modify individual options instead.");
|
|
2269
2269
|
},
|
|
2270
2270
|
use(e, ...t) {
|
|
2271
|
-
return a.has(e) ? process.env.NODE_ENV !== "production" && q("Plugin has already been applied to target app.") : e &&
|
|
2271
|
+
return a.has(e) ? process.env.NODE_ENV !== "production" && q("Plugin has already been applied to target app.") : e && R(e.install) ? (a.add(e), e.install(c, ...t)) : R(e) ? (a.add(e), e(c, ...t)) : process.env.NODE_ENV !== "production" && q("A plugin must either be a function or an object with an \"install\" function."), c;
|
|
2272
2272
|
},
|
|
2273
2273
|
mixin(e) {
|
|
2274
2274
|
return i.mixins.includes(e) ? process.env.NODE_ENV !== "production" && q("Mixin has already been applied to target app" + (e.name ? `: ${e.name}` : "")) : i.mixins.push(e), c;
|
|
@@ -2321,11 +2321,11 @@ function za(e, t, ...n) {
|
|
|
2321
2321
|
if (r) if (!(t in r)) (!i || !(ye(he(t)) in i)) && q(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${ye(he(t))}" prop.`);
|
|
2322
2322
|
else {
|
|
2323
2323
|
let e = r[t];
|
|
2324
|
-
|
|
2324
|
+
R(e) && (e(...n) || q(`Invalid event arguments: event validation failed for event "${t}".`));
|
|
2325
2325
|
}
|
|
2326
2326
|
}
|
|
2327
2327
|
let i = n, a = t.startsWith("update:"), o = a && Ra(r, t.slice(7));
|
|
2328
|
-
if (o && (o.trim && (i = n.map((e) =>
|
|
2328
|
+
if (o && (o.trim && (i = n.map((e) => z(e) ? e.trim() : e)), o.number && (i = n.map(Ce))), process.env.NODE_ENV !== "production" && Ur(e, t, i), process.env.NODE_ENV !== "production") {
|
|
2329
2329
|
let n = t.toLowerCase();
|
|
2330
2330
|
n !== t && r[ye(n)] && q(`Event "${n}" is emitted in component ${Ys(e, e.type)} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${_e(t)}" instead of "${t}".`);
|
|
2331
2331
|
}
|
|
@@ -2343,7 +2343,7 @@ function Va(e, t, n = !1) {
|
|
|
2343
2343
|
let r = n ? Ba : t.emitsCache, i = r.get(e);
|
|
2344
2344
|
if (i !== void 0) return i;
|
|
2345
2345
|
let a = e.emits, o = {}, s = !1;
|
|
2346
|
-
if (!
|
|
2346
|
+
if (!R(e)) {
|
|
2347
2347
|
let r = (e) => {
|
|
2348
2348
|
let n = Va(e, t, !0);
|
|
2349
2349
|
n && (s = !0, P(o, n));
|
|
@@ -2530,7 +2530,7 @@ function co(e, t, n, r, i, a) {
|
|
|
2530
2530
|
let e = F(o, "default");
|
|
2531
2531
|
if (e && r === void 0) {
|
|
2532
2532
|
let e = o.default;
|
|
2533
|
-
if (o.type !== Function && !o.skipFactory &&
|
|
2533
|
+
if (o.type !== Function && !o.skipFactory && R(e)) {
|
|
2534
2534
|
let { propsDefaults: a } = i;
|
|
2535
2535
|
if (n in a) r = a[n];
|
|
2536
2536
|
else {
|
|
@@ -2549,7 +2549,7 @@ function uo(e, t, n = !1) {
|
|
|
2549
2549
|
let r = n ? lo : t.propsCache, i = r.get(e);
|
|
2550
2550
|
if (i) return i;
|
|
2551
2551
|
let a = e.props, o = {}, s = [], c = !1;
|
|
2552
|
-
if (!
|
|
2552
|
+
if (!R(e)) {
|
|
2553
2553
|
let r = (e) => {
|
|
2554
2554
|
c = !0;
|
|
2555
2555
|
let [n, r] = uo(e, t, !0);
|
|
@@ -2559,7 +2559,7 @@ function uo(e, t, n = !1) {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
if (!a && !c) return B(e) && r.set(e, A), A;
|
|
2561
2561
|
if (I(a)) for (let e = 0; e < a.length; e++) {
|
|
2562
|
-
process.env.NODE_ENV !== "production" && !
|
|
2562
|
+
process.env.NODE_ENV !== "production" && !z(a[e]) && q("props must be strings when using array syntax.", a[e]);
|
|
2563
2563
|
let t = he(a[e]);
|
|
2564
2564
|
fo(t) && (o[t] = k);
|
|
2565
2565
|
}
|
|
@@ -2568,15 +2568,15 @@ function uo(e, t, n = !1) {
|
|
|
2568
2568
|
for (let e in a) {
|
|
2569
2569
|
let t = he(e);
|
|
2570
2570
|
if (fo(t)) {
|
|
2571
|
-
let n = a[e], r = o[t] = I(n) ||
|
|
2571
|
+
let n = a[e], r = o[t] = I(n) || R(n) ? { type: n } : P({}, n), i = r.type, c = !1, l = !0;
|
|
2572
2572
|
if (I(i)) for (let e = 0; e < i.length; ++e) {
|
|
2573
|
-
let t = i[e], n =
|
|
2573
|
+
let t = i[e], n = R(t) && t.name;
|
|
2574
2574
|
if (n === "Boolean") {
|
|
2575
2575
|
c = !0;
|
|
2576
2576
|
break;
|
|
2577
2577
|
} else n === "String" && (l = !1);
|
|
2578
2578
|
}
|
|
2579
|
-
else c =
|
|
2579
|
+
else c = R(i) && i.name === "Boolean";
|
|
2580
2580
|
r[0] = c, r[1] = l, (c || F(r, "default")) && s.push(t);
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
@@ -2661,7 +2661,7 @@ var So = (e) => e === "_" || e === "_ctx" || e === "$stable", Co = (e) => I(e) ?
|
|
|
2661
2661
|
for (let n in e) {
|
|
2662
2662
|
if (So(n)) continue;
|
|
2663
2663
|
let i = e[n];
|
|
2664
|
-
if (
|
|
2664
|
+
if (R(i)) t[n] = wo(n, i, r);
|
|
2665
2665
|
else if (i != null) {
|
|
2666
2666
|
process.env.NODE_ENV !== "production" && q(`Non-function value encountered for slot "${n}". Prefer function slots for better performance.`);
|
|
2667
2667
|
let e = Co(i);
|
|
@@ -2720,7 +2720,7 @@ function Ro(e, t) {
|
|
|
2720
2720
|
n.__VUE__ = !0, process.env.NODE_ENV !== "production" && Mr(n.__VUE_DEVTOOLS_GLOBAL_HOOK__, n);
|
|
2721
2721
|
let { insert: r, remove: i, patchProp: a, createElement: o, createText: s, createComment: c, setText: l, setElementText: u, parentNode: d, nextSibling: f, setScopeId: p = ee, insertStaticContent: m } = e, h = (e, t, n, r = null, i = null, a = null, o = void 0, s = null, c = process.env.NODE_ENV !== "production" && gr ? !1 : !!t.dynamicChildren) => {
|
|
2722
2722
|
if (e === t) return;
|
|
2723
|
-
e && !os(e, t) && (r = oe(e),
|
|
2723
|
+
e && !os(e, t) && (r = oe(e), L(e, i, a, !0), e = null), t.patchFlag === -2 && (c = !1, t.dynamicChildren = null);
|
|
2724
2724
|
let { type: l, ref: u, shapeFlag: d } = t;
|
|
2725
2725
|
switch (l) {
|
|
2726
2726
|
case Yo:
|
|
@@ -2914,14 +2914,14 @@ function Ro(e, t) {
|
|
|
2914
2914
|
let l = e && e.children, d = e ? e.shapeFlag : 0, f = t.children, { patchFlag: p, shapeFlag: m } = t;
|
|
2915
2915
|
if (p > 0) {
|
|
2916
2916
|
if (p & 128) {
|
|
2917
|
-
|
|
2917
|
+
re(l, f, n, r, i, a, o, s, c);
|
|
2918
2918
|
return;
|
|
2919
2919
|
} else if (p & 256) {
|
|
2920
2920
|
I(l, f, n, r, i, a, o, s, c);
|
|
2921
2921
|
return;
|
|
2922
2922
|
}
|
|
2923
2923
|
}
|
|
2924
|
-
m & 8 ? (d & 16 && B(l, i, a), f !== l && u(n, f)) : d & 16 ? m & 16 ?
|
|
2924
|
+
m & 8 ? (d & 16 && B(l, i, a), f !== l && u(n, f)) : d & 16 ? m & 16 ? re(l, f, n, r, i, a, o, s, c) : B(l, i, a, !0) : (d & 8 && u(n, ""), m & 16 && T(f, n, r, i, a, o, s, c));
|
|
2925
2925
|
}, I = (e, t, n, r, i, a, o, s, c) => {
|
|
2926
2926
|
e ||= A, t ||= A;
|
|
2927
2927
|
let l = e.length, u = t.length, d = Math.min(l, u), f;
|
|
@@ -2930,7 +2930,7 @@ function Ro(e, t) {
|
|
|
2930
2930
|
h(e[f], r, n, null, i, a, o, s, c);
|
|
2931
2931
|
}
|
|
2932
2932
|
l > u ? B(e, i, a, !0, !1, d) : T(t, n, r, i, a, o, s, c, d);
|
|
2933
|
-
},
|
|
2933
|
+
}, re = (e, t, n, r, i, a, o, s, c) => {
|
|
2934
2934
|
let l = 0, u = t.length, d = e.length - 1, f = u - 1;
|
|
2935
2935
|
for (; l <= d && l <= f;) {
|
|
2936
2936
|
let r = e[l], u = t[l] = c ? vs(t[l]) : _s(t[l]);
|
|
@@ -2949,7 +2949,7 @@ function Ro(e, t) {
|
|
|
2949
2949
|
let e = f + 1, d = e < u ? t[e].el : r;
|
|
2950
2950
|
for (; l <= f;) h(null, t[l] = c ? vs(t[l]) : _s(t[l]), n, d, i, a, o, s, c), l++;
|
|
2951
2951
|
}
|
|
2952
|
-
} else if (l > f) for (; l <= d;)
|
|
2952
|
+
} else if (l > f) for (; l <= d;) L(e[l], i, a, !0), l++;
|
|
2953
2953
|
else {
|
|
2954
2954
|
let p = l, m = l, g = /* @__PURE__ */ new Map();
|
|
2955
2955
|
for (l = m; l <= f; l++) {
|
|
@@ -2961,7 +2961,7 @@ function Ro(e, t) {
|
|
|
2961
2961
|
for (l = p; l <= d; l++) {
|
|
2962
2962
|
let r = e[l];
|
|
2963
2963
|
if (v >= y) {
|
|
2964
|
-
|
|
2964
|
+
L(r, i, a, !0);
|
|
2965
2965
|
continue;
|
|
2966
2966
|
}
|
|
2967
2967
|
let u;
|
|
@@ -2970,18 +2970,18 @@ function Ro(e, t) {
|
|
|
2970
2970
|
u = _;
|
|
2971
2971
|
break;
|
|
2972
2972
|
}
|
|
2973
|
-
u === void 0 ?
|
|
2973
|
+
u === void 0 ? L(r, i, a, !0) : (S[u - m] = l + 1, u >= x ? x = u : b = !0, h(r, t[u], n, null, i, a, o, s, c), v++);
|
|
2974
2974
|
}
|
|
2975
2975
|
let C = b ? Uo(S) : A;
|
|
2976
2976
|
for (_ = C.length - 1, l = y - 1; l >= 0; l--) {
|
|
2977
2977
|
let e = m + l, d = t[e], f = t[e + 1], p = e + 1 < u ? f.el || Ko(f) : r;
|
|
2978
|
-
S[l] === 0 ? h(null, d, n, p, i, a, o, s, c) : b && (_ < 0 || l !== C[_] ?
|
|
2978
|
+
S[l] === 0 ? h(null, d, n, p, i, a, o, s, c) : b && (_ < 0 || l !== C[_] ? ie(d, n, p, 2) : _--);
|
|
2979
2979
|
}
|
|
2980
2980
|
}
|
|
2981
|
-
},
|
|
2981
|
+
}, ie = (e, t, n, a, o = null) => {
|
|
2982
2982
|
let { el: s, type: c, transition: l, children: u, shapeFlag: d } = e;
|
|
2983
2983
|
if (d & 6) {
|
|
2984
|
-
|
|
2984
|
+
ie(e.component.subTree, t, n, a);
|
|
2985
2985
|
return;
|
|
2986
2986
|
}
|
|
2987
2987
|
if (d & 128) {
|
|
@@ -2994,7 +2994,7 @@ function Ro(e, t) {
|
|
|
2994
2994
|
}
|
|
2995
2995
|
if (c === J) {
|
|
2996
2996
|
r(s, t, n);
|
|
2997
|
-
for (let e = 0; e < u.length; e++)
|
|
2997
|
+
for (let e = 0; e < u.length; e++) ie(u[e], t, n, a);
|
|
2998
2998
|
r(e.anchor, t, n);
|
|
2999
2999
|
return;
|
|
3000
3000
|
}
|
|
@@ -3015,7 +3015,7 @@ function Ro(e, t) {
|
|
|
3015
3015
|
o ? o(s, u, d) : d();
|
|
3016
3016
|
}
|
|
3017
3017
|
else r(s, t, n);
|
|
3018
|
-
},
|
|
3018
|
+
}, L = (e, t, n, r = !1, i = !1) => {
|
|
3019
3019
|
let { type: a, props: o, ref: s, children: c, dynamicChildren: l, shapeFlag: u, patchFlag: d, dirs: f, cacheIndex: p, memo: m } = e;
|
|
3020
3020
|
if (d === -2 && (i = !1), s != null && (pt(), zi(s, null, n, e, !0), mt()), p != null && (t.renderCache[p] = void 0), u & 256) {
|
|
3021
3021
|
t.ctx.deactivate(e);
|
|
@@ -3028,18 +3028,18 @@ function Ro(e, t) {
|
|
|
3028
3028
|
e.suspense.unmount(n, r);
|
|
3029
3029
|
return;
|
|
3030
3030
|
}
|
|
3031
|
-
h && Xr(e, null, t, "beforeUnmount"), u & 64 ? e.type.remove(e, t, n, le, r) : l && !l.hasOnce && (a !== J || d > 0 && d & 64) ? B(l, t, n, !1, !0) : (a === J && d & 384 || !i && u & 16) && B(c, t, n), r &&
|
|
3031
|
+
h && Xr(e, null, t, "beforeUnmount"), u & 64 ? e.type.remove(e, t, n, le, r) : l && !l.hasOnce && (a !== J || d > 0 && d & 64) ? B(l, t, n, !1, !0) : (a === J && d & 384 || !i && u & 16) && B(c, t, n), r && R(e);
|
|
3032
3032
|
}
|
|
3033
3033
|
let v = m != null && p == null;
|
|
3034
3034
|
(g && (_ = o && o.onVnodeUnmounted) || h || v) && Io(() => {
|
|
3035
3035
|
_ && xs(_, t, e), h && Xr(e, null, t, "unmounted"), v && (e.el = null);
|
|
3036
3036
|
}, n);
|
|
3037
|
-
},
|
|
3037
|
+
}, R = (e) => {
|
|
3038
3038
|
let { type: t, el: n, anchor: r, transition: a } = e;
|
|
3039
3039
|
if (t === J) {
|
|
3040
3040
|
process.env.NODE_ENV !== "production" && e.patchFlag > 0 && e.patchFlag & 2048 && a && !a.persisted ? e.children.forEach((e) => {
|
|
3041
|
-
e.type === Xo ? i(e.el) :
|
|
3042
|
-
}) :
|
|
3041
|
+
e.type === Xo ? i(e.el) : R(e);
|
|
3042
|
+
}) : z(n, r);
|
|
3043
3043
|
return;
|
|
3044
3044
|
}
|
|
3045
3045
|
if (t === Zo) {
|
|
@@ -3053,18 +3053,18 @@ function Ro(e, t) {
|
|
|
3053
3053
|
let { leave: t, delayLeave: r } = a, i = () => t(n, o);
|
|
3054
3054
|
r ? r(e.el, o, i) : i();
|
|
3055
3055
|
} else o();
|
|
3056
|
-
},
|
|
3056
|
+
}, z = (e, t) => {
|
|
3057
3057
|
let n;
|
|
3058
3058
|
for (; e !== t;) n = f(e), i(e), e = n;
|
|
3059
3059
|
i(t);
|
|
3060
3060
|
}, ae = (e, t, n) => {
|
|
3061
3061
|
process.env.NODE_ENV !== "production" && e.type.__hmrId && xr(e);
|
|
3062
3062
|
let { bum: r, scope: i, job: a, subTree: o, um: s, m: c, a: l } = e;
|
|
3063
|
-
Go(c), Go(l), r && xe(r), i.stop(), a && (a.flags |= 8,
|
|
3063
|
+
Go(c), Go(l), r && xe(r), i.stop(), a && (a.flags |= 8, L(o, e, t, n)), s && Io(s, t), Io(() => {
|
|
3064
3064
|
e.isUnmounted = !0;
|
|
3065
3065
|
}, t), process.env.NODE_ENV !== "production" && Rr(e);
|
|
3066
3066
|
}, B = (e, t, n, r = !1, i = !1, a = 0) => {
|
|
3067
|
-
for (let o = a; o < e.length; o++)
|
|
3067
|
+
for (let o = a; o < e.length; o++) L(e[o], t, n, r, i);
|
|
3068
3068
|
}, oe = (e) => {
|
|
3069
3069
|
if (e.shapeFlag & 6) return oe(e.component.subTree);
|
|
3070
3070
|
if (e.shapeFlag & 128) return e.suspense.next();
|
|
@@ -3072,12 +3072,12 @@ function Ro(e, t) {
|
|
|
3072
3072
|
return n ? f(n) : t;
|
|
3073
3073
|
}, se = !1, ce = (e, t, n) => {
|
|
3074
3074
|
let r;
|
|
3075
|
-
e == null ? t._vnode && (
|
|
3075
|
+
e == null ? t._vnode && (L(t._vnode, null, null, !0), r = t._vnode.component) : h(t._vnode || null, e, t, null, null, null, n), t._vnode = e, se ||= (se = !0, dr(r), fr(), !1);
|
|
3076
3076
|
}, le = {
|
|
3077
3077
|
p: h,
|
|
3078
|
-
um:
|
|
3079
|
-
m:
|
|
3080
|
-
r:
|
|
3078
|
+
um: L,
|
|
3079
|
+
m: ie,
|
|
3080
|
+
r: R,
|
|
3081
3081
|
mt: N,
|
|
3082
3082
|
mc: T,
|
|
3083
3083
|
pc: F,
|
|
@@ -3169,7 +3169,7 @@ function os(e, t) {
|
|
|
3169
3169
|
}
|
|
3170
3170
|
return e.type === t.type && e.key === t.key;
|
|
3171
3171
|
}
|
|
3172
|
-
var ss, cs = (...e) => fs(...ss ? ss(e, Wr) : e), ls = ({ key: e }) => e ?? null, us = ({ ref: e, ref_key: t, ref_for: n }) => (typeof e == "number" && (e = "" + e), e == null ? null :
|
|
3172
|
+
var ss, cs = (...e) => fs(...ss ? ss(e, Wr) : e), ls = ({ key: e }) => e ?? null, us = ({ ref: e, ref_key: t, ref_for: n }) => (typeof e == "number" && (e = "" + e), e == null ? null : z(e) || /* @__PURE__ */ xn(e) || R(e) ? {
|
|
3173
3173
|
i: Wr,
|
|
3174
3174
|
r: e,
|
|
3175
3175
|
k: t,
|
|
@@ -3205,7 +3205,7 @@ function Z(e, t = null, n = null, r = 0, i = null, a = e === J ? 0 : 1, o = !1,
|
|
|
3205
3205
|
appContext: null,
|
|
3206
3206
|
ctx: Wr
|
|
3207
3207
|
};
|
|
3208
|
-
return s ? (ys(c, n), a & 128 && e.normalize(c)) : n && (c.shapeFlag |=
|
|
3208
|
+
return s ? (ys(c, n), a & 128 && e.normalize(c)) : n && (c.shapeFlag |= z(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && q("VNode created with invalid key (NaN). VNode type:", c.type), ts > 0 && !o && $o && (c.patchFlag > 0 || a & 6) && c.patchFlag !== 32 && $o.push(c), c;
|
|
3209
3209
|
}
|
|
3210
3210
|
var ds = process.env.NODE_ENV === "production" ? fs : cs;
|
|
3211
3211
|
function fs(e, t = null, n = null, r = 0, i = null, a = !1) {
|
|
@@ -3216,9 +3216,9 @@ function fs(e, t = null, n = null, r = 0, i = null, a = !1) {
|
|
|
3216
3216
|
if (Xs(e) && (e = e.__vccOpts), t) {
|
|
3217
3217
|
t = ps(t);
|
|
3218
3218
|
let { class: e, style: n } = t;
|
|
3219
|
-
e && !
|
|
3219
|
+
e && !z(e) && (t.class = H(e)), B(n) && (/* @__PURE__ */ gn(n) && !I(n) && (n = P({}, n)), t.style = De(n));
|
|
3220
3220
|
}
|
|
3221
|
-
let o =
|
|
3221
|
+
let o = z(e) ? 1 : qo(e) ? 128 : si(e) ? 64 : B(e) ? 4 : R(e) ? 2 : 0;
|
|
3222
3222
|
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ gn(e) && (e = /* @__PURE__ */ _n(e), q("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)), Z(e, t, n, r, i, o, a, !0);
|
|
3223
3223
|
}
|
|
3224
3224
|
function ps(e) {
|
|
@@ -3287,7 +3287,7 @@ function ys(e, t) {
|
|
|
3287
3287
|
let r = t._;
|
|
3288
3288
|
!r && !ro(t) ? t._ctx = Wr : r === 3 && Wr && (Wr.slots._ === 1 ? t._ = 1 : (t._ = 2, e.patchFlag |= 1024));
|
|
3289
3289
|
}
|
|
3290
|
-
else if (
|
|
3290
|
+
else if (R(t)) {
|
|
3291
3291
|
if (r & 65) {
|
|
3292
3292
|
ys(e, { default: t });
|
|
3293
3293
|
return;
|
|
@@ -3444,7 +3444,7 @@ function Is(e, t) {
|
|
|
3444
3444
|
} else Vs(e, t);
|
|
3445
3445
|
}
|
|
3446
3446
|
function Ls(e, t, n) {
|
|
3447
|
-
|
|
3447
|
+
R(t) ? e.type.__ssrInlineRender ? e.ssrRender = t : e.render = t : B(t) ? (process.env.NODE_ENV !== "production" && as(t) && q("setup() should not return VNodes directly - return a render function instead."), process.env.NODE_ENV !== "production" && (e.devtoolsRawSetupState = t), e.setupState = On(t), process.env.NODE_ENV !== "production" && ga(e)) : process.env.NODE_ENV !== "production" && t !== void 0 && q(`setup() should return an object. Received: ${t === null ? "null" : typeof t}`), Vs(e, n);
|
|
3448
3448
|
}
|
|
3449
3449
|
var Rs, zs, Bs = () => !Rs;
|
|
3450
3450
|
function Vs(e, t, n) {
|
|
@@ -3534,7 +3534,7 @@ function Gs(e) {
|
|
|
3534
3534
|
}
|
|
3535
3535
|
var Ks = /(?:^|[-_])\w/g, qs = (e) => e.replace(Ks, (e) => e.toUpperCase()).replace(/[-_]/g, "");
|
|
3536
3536
|
function Js(e, t = !0) {
|
|
3537
|
-
return
|
|
3537
|
+
return R(e) ? e.displayName || e.name : e.name || t && e.__name;
|
|
3538
3538
|
}
|
|
3539
3539
|
function Ys(e, t, n = !1) {
|
|
3540
3540
|
let r = Js(t);
|
|
@@ -3551,7 +3551,7 @@ function Ys(e, t, n = !1) {
|
|
|
3551
3551
|
return r ? qs(r) : n ? "App" : "Anonymous";
|
|
3552
3552
|
}
|
|
3553
3553
|
function Xs(e) {
|
|
3554
|
-
return
|
|
3554
|
+
return R(e) && "__vccOpts" in e;
|
|
3555
3555
|
}
|
|
3556
3556
|
var Zs = (e, t) => {
|
|
3557
3557
|
let n = /* @__PURE__ */ An(e, t, Ps);
|
|
@@ -3696,7 +3696,7 @@ function $s() {
|
|
|
3696
3696
|
}
|
|
3697
3697
|
function c(e, t) {
|
|
3698
3698
|
let n = e.type;
|
|
3699
|
-
if (
|
|
3699
|
+
if (R(n)) return;
|
|
3700
3700
|
let r = {};
|
|
3701
3701
|
for (let i in e.ctx) l(n, i, t) && (r[i] = e.ctx[i]);
|
|
3702
3702
|
return r;
|
|
@@ -3915,9 +3915,9 @@ function Pc(e, t) {
|
|
|
3915
3915
|
}
|
|
3916
3916
|
var Fc = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "CSS_VAR_TEXT"), Ic = /(?:^|;)\s*display\s*:/;
|
|
3917
3917
|
function Lc(e, t, n) {
|
|
3918
|
-
let r = e.style, i =
|
|
3918
|
+
let r = e.style, i = z(n), a = !1;
|
|
3919
3919
|
if (n && !i) {
|
|
3920
|
-
if (t) if (
|
|
3920
|
+
if (t) if (z(t)) for (let e of t.split(";")) {
|
|
3921
3921
|
let t = e.slice(0, e.indexOf(":")).trim();
|
|
3922
3922
|
n[t] ?? Bc(r, t, "");
|
|
3923
3923
|
}
|
|
@@ -3925,7 +3925,7 @@ function Lc(e, t, n) {
|
|
|
3925
3925
|
for (let i in n) {
|
|
3926
3926
|
i === "display" && (a = !0);
|
|
3927
3927
|
let o = n[i];
|
|
3928
|
-
o == null ? Bc(r, i, "") : Wc(e, i, !
|
|
3928
|
+
o == null ? Bc(r, i, "") : Wc(e, i, !z(t) && t ? t[i] : void 0, o) || Bc(r, i, o);
|
|
3929
3929
|
}
|
|
3930
3930
|
} else if (i) {
|
|
3931
3931
|
if (t !== n) {
|
|
@@ -3962,7 +3962,7 @@ function Uc(e, t) {
|
|
|
3962
3962
|
return t;
|
|
3963
3963
|
}
|
|
3964
3964
|
function Wc(e, t, n, r) {
|
|
3965
|
-
return e.tagName === "TEXTAREA" && (t === "width" || t === "height") &&
|
|
3965
|
+
return e.tagName === "TEXTAREA" && (t === "width" || t === "height") && z(r) && n === r;
|
|
3966
3966
|
}
|
|
3967
3967
|
var Gc = "http://www.w3.org/1999/xlink";
|
|
3968
3968
|
function Kc(e, t, n, r, i, a = ze(t)) {
|
|
@@ -4033,21 +4033,21 @@ function il(e, t) {
|
|
|
4033
4033
|
return n.value = e, n.attached = rl(), n;
|
|
4034
4034
|
}
|
|
4035
4035
|
function al(e, t) {
|
|
4036
|
-
return
|
|
4036
|
+
return R(e) || I(e) ? e : (tc(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
4037
4037
|
Expected function or array of functions, received type ${typeof e}.`), ee);
|
|
4038
4038
|
}
|
|
4039
4039
|
var ol = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && e.charCodeAt(2) > 96 && e.charCodeAt(2) < 123, sl = (e, t, n, r, i, a) => {
|
|
4040
4040
|
let o = i === "svg";
|
|
4041
|
-
t === "class" ? Ac(e, r, o) : t === "style" ? Lc(e, n, r) : M(t) ? N(t) || Zc(e, t, n, r, a) : (t[0] === "." ? (t = t.slice(1), !0) : t[0] === "^" ? (t = t.slice(1), !1) : cl(e, t, r, o)) ? (qc(e, t, r), !e.tagName.includes("-") && (t === "value" || t === "checked" || t === "selected") && Kc(e, t, r, o, a, t !== "value")) : e._isVueCE && (ll(e, t) || e._def.__asyncLoader && (/[A-Z]/.test(t) || !
|
|
4041
|
+
t === "class" ? Ac(e, r, o) : t === "style" ? Lc(e, n, r) : M(t) ? N(t) || Zc(e, t, n, r, a) : (t[0] === "." ? (t = t.slice(1), !0) : t[0] === "^" ? (t = t.slice(1), !1) : cl(e, t, r, o)) ? (qc(e, t, r), !e.tagName.includes("-") && (t === "value" || t === "checked" || t === "selected") && Kc(e, t, r, o, a, t !== "value")) : e._isVueCE && (ll(e, t) || e._def.__asyncLoader && (/[A-Z]/.test(t) || !z(r))) ? qc(e, he(t), r, a, t) : (t === "true-value" ? e._trueValue = r : t === "false-value" && (e._falseValue = r), Kc(e, t, r, o));
|
|
4042
4042
|
};
|
|
4043
4043
|
function cl(e, t, n, r) {
|
|
4044
|
-
if (r) return !!(t === "innerHTML" || t === "textContent" || t in e && ol(t) &&
|
|
4044
|
+
if (r) return !!(t === "innerHTML" || t === "textContent" || t in e && ol(t) && R(n));
|
|
4045
4045
|
if (t === "spellcheck" || t === "draggable" || t === "translate" || t === "autocorrect" || t === "sandbox" && e.tagName === "IFRAME" || t === "form" || t === "list" && e.tagName === "INPUT" || t === "type" && e.tagName === "TEXTAREA") return !1;
|
|
4046
4046
|
if (t === "width" || t === "height") {
|
|
4047
4047
|
let t = e.tagName;
|
|
4048
4048
|
if (t === "IMG" || t === "VIDEO" || t === "CANVAS" || t === "SOURCE") return !1;
|
|
4049
4049
|
}
|
|
4050
|
-
return ol(t) &&
|
|
4050
|
+
return ol(t) && z(n) ? !1 : t in e;
|
|
4051
4051
|
}
|
|
4052
4052
|
function ll(e, t) {
|
|
4053
4053
|
let n = e._def.props;
|
|
@@ -4144,7 +4144,7 @@ var wl = ((...e) => {
|
|
|
4144
4144
|
let r = Ol(e);
|
|
4145
4145
|
if (!r) return;
|
|
4146
4146
|
let i = t._component;
|
|
4147
|
-
!
|
|
4147
|
+
!R(i) && !i.render && !i.template && (i.template = r.innerHTML), r.nodeType === 1 && (r.textContent = "");
|
|
4148
4148
|
let a = n(r, !1, Tl(r));
|
|
4149
4149
|
return r instanceof Element && (r.removeAttribute("v-cloak"), r.setAttribute("data-v-app", "")), a;
|
|
4150
4150
|
}, t;
|
|
@@ -4182,7 +4182,7 @@ function Dl(e) {
|
|
|
4182
4182
|
}
|
|
4183
4183
|
}
|
|
4184
4184
|
function Ol(e) {
|
|
4185
|
-
if (
|
|
4185
|
+
if (z(e)) {
|
|
4186
4186
|
let t = document.querySelector(e);
|
|
4187
4187
|
return process.env.NODE_ENV !== "production" && !t && tc(`Failed to mount app: mount target selector "${e}" returned null.`), t;
|
|
4188
4188
|
}
|
|
@@ -4784,21 +4784,21 @@ function Ou(e) {
|
|
|
4784
4784
|
contextWindow: e.contextWindow,
|
|
4785
4785
|
maxOutputTokens: e.maxOutputTokens
|
|
4786
4786
|
}), ne = u ?? te.maxOutputTokens, F = Gl(te.contextWindow), I = Kl(te.contextWindow);
|
|
4787
|
-
function
|
|
4787
|
+
function re(e) {
|
|
4788
4788
|
te = e, F = Gl(te.contextWindow), I = Kl(te.contextWindow);
|
|
4789
4789
|
}
|
|
4790
|
-
let
|
|
4791
|
-
function
|
|
4790
|
+
let ie = /* @__PURE__ */ Cn([]);
|
|
4791
|
+
function L(e, t) {
|
|
4792
4792
|
let n = {
|
|
4793
4793
|
timestamp: Date.now(),
|
|
4794
4794
|
type: e,
|
|
4795
4795
|
data: t
|
|
4796
4796
|
};
|
|
4797
|
-
|
|
4797
|
+
ie.value.push(n), ie.value.length > Su && ie.value.splice(0, ie.value.length - Su), En(ie), A?.(n), N && console.log(`%c[Agent] ${e}`, "color:#667eea;font-weight:bold", t);
|
|
4798
4798
|
}
|
|
4799
|
-
let
|
|
4800
|
-
|
|
4801
|
-
},
|
|
4799
|
+
let R = (e) => {
|
|
4800
|
+
ie.value.push(e), ie.value.length > Su && ie.value.splice(0, ie.value.length - Su), En(ie);
|
|
4801
|
+
}, z = /* @__PURE__ */ Cn([]), ae = 0, B = !!ee || !!j;
|
|
4802
4802
|
function oe(e, t, n, r = {}) {
|
|
4803
4803
|
if (!B) return null;
|
|
4804
4804
|
let i = {
|
|
@@ -4810,10 +4810,10 @@ function Ou(e) {
|
|
|
4810
4810
|
status: "ok",
|
|
4811
4811
|
attributes: r
|
|
4812
4812
|
};
|
|
4813
|
-
return
|
|
4813
|
+
return z.value.push(i), z.value.length > Su && z.value.splice(0, z.value.length - Su), En(z), i;
|
|
4814
4814
|
}
|
|
4815
4815
|
function se(e, t = "ok", n) {
|
|
4816
|
-
!e || !B || (e.endTs = Date.now(), e.durationMs = e.endTs - e.startTs, e.status = t, n && Object.assign(e.attributes, n), En(
|
|
4816
|
+
!e || !B || (e.endTs = Date.now(), e.durationMs = e.endTs - e.startTs, e.status = t, n && Object.assign(e.attributes, n), En(z), ee?.(e));
|
|
4817
4817
|
}
|
|
4818
4818
|
let ce = [...h.flatMap((e) => e.tools || []), ...m], le = e.llm ?? new n({
|
|
4819
4819
|
apiKey: t,
|
|
@@ -4869,7 +4869,7 @@ function Ou(e) {
|
|
|
4869
4869
|
baseDelayMs: y,
|
|
4870
4870
|
onRetry: ({ attempt: e, error: t, waitMs: n }) => {
|
|
4871
4871
|
let r = t?.message ?? String(t);
|
|
4872
|
-
|
|
4872
|
+
L("error", {
|
|
4873
4873
|
stage: "model_retry",
|
|
4874
4874
|
attempt: e,
|
|
4875
4875
|
waitMs: n,
|
|
@@ -4898,7 +4898,7 @@ function Ou(e) {
|
|
|
4898
4898
|
if (ru(a) && !e._ctxRetry) {
|
|
4899
4899
|
e._ctxRetry = !0;
|
|
4900
4900
|
let i = (e) => Wl(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + i(t), 0), o = be(e.messages, Math.round(te.contextWindow * .3)), s = o.reduce((e, t) => e + i(t), 0);
|
|
4901
|
-
return
|
|
4901
|
+
return L("error", {
|
|
4902
4902
|
stage: "context_overflow_retry",
|
|
4903
4903
|
at: "launch",
|
|
4904
4904
|
beforeTokens: a,
|
|
@@ -4933,7 +4933,7 @@ function Ou(e) {
|
|
|
4933
4933
|
});
|
|
4934
4934
|
}
|
|
4935
4935
|
} catch (a) {
|
|
4936
|
-
if (a instanceof eu) throw s.abort(),
|
|
4936
|
+
if (a instanceof eu) throw s.abort(), L("error", {
|
|
4937
4937
|
stage: "stream_stalled",
|
|
4938
4938
|
waitedMs: a.waitedMs,
|
|
4939
4939
|
stallMs: S
|
|
@@ -4947,7 +4947,7 @@ function Ou(e) {
|
|
|
4947
4947
|
if (ru(a) && l === null && u === "" && !e._ctxRetry) {
|
|
4948
4948
|
e._ctxRetry = !0;
|
|
4949
4949
|
let i = (e) => Wl(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + i(t), 0), o = be(e.messages, Math.round(te.contextWindow * .3)), s = o.reduce((e, t) => e + i(t), 0);
|
|
4950
|
-
return
|
|
4950
|
+
return L("error", {
|
|
4951
4951
|
stage: "context_overflow_retry",
|
|
4952
4952
|
beforeTokens: a,
|
|
4953
4953
|
afterTokens: s,
|
|
@@ -5015,7 +5015,7 @@ function Ou(e) {
|
|
|
5015
5015
|
});
|
|
5016
5016
|
}
|
|
5017
5017
|
async function Se(e, t, n) {
|
|
5018
|
-
|
|
5018
|
+
ie.value = [], z.value = [], ae = 0, V = Jl(), V.messages = e, V = await au(h, V);
|
|
5019
5019
|
let r = e;
|
|
5020
5020
|
for (let e of h) if (e.compressInput) {
|
|
5021
5021
|
let t = oe(void 0, "compression", `compress:${e.name}`, {}), n = await e.compressInput(r);
|
|
@@ -5040,7 +5040,7 @@ function Ou(e) {
|
|
|
5040
5040
|
}
|
|
5041
5041
|
}
|
|
5042
5042
|
let i = he(r);
|
|
5043
|
-
|
|
5043
|
+
L("context", {
|
|
5044
5044
|
model: c,
|
|
5045
5045
|
tools: ce.map((e) => e.name),
|
|
5046
5046
|
middleware: h.map((e) => e.name)
|
|
@@ -5062,7 +5062,7 @@ function Ou(e) {
|
|
|
5062
5062
|
for (; (f < P || b) && m < g && (m++, !n?.aborted);) {
|
|
5063
5063
|
if (k > 0 && d.invokeUsage.total_tokens > k) {
|
|
5064
5064
|
let e = `本轮 token 预算(约 ${k})已用尽:任务在 ${f} 轮工具调用后中断,已完成的部分均保留。可继续对话,指定下一步(如「继续完成」/「只改 X」/「提高预算重试」)。`;
|
|
5065
|
-
return
|
|
5065
|
+
return L("error", {
|
|
5066
5066
|
stage: "round_token_budget_exceeded",
|
|
5067
5067
|
used: d.invokeUsage.total_tokens,
|
|
5068
5068
|
budget: k,
|
|
@@ -5093,7 +5093,7 @@ function Ou(e) {
|
|
|
5093
5093
|
round: f + 1,
|
|
5094
5094
|
tools: ce.map((e) => e.name)
|
|
5095
5095
|
});
|
|
5096
|
-
|
|
5096
|
+
L("llm_request", {
|
|
5097
5097
|
round: f + 1,
|
|
5098
5098
|
model: c,
|
|
5099
5099
|
tools: ce.map((e) => e.name),
|
|
@@ -5103,7 +5103,7 @@ function Ou(e) {
|
|
|
5103
5103
|
messages: i,
|
|
5104
5104
|
state: V
|
|
5105
5105
|
});
|
|
5106
|
-
i.push(o.message),
|
|
5106
|
+
i.push(o.message), L("llm_response", {
|
|
5107
5107
|
round: f + 1,
|
|
5108
5108
|
content: o.content,
|
|
5109
5109
|
toolCalls: o.toolCalls
|
|
@@ -5126,21 +5126,21 @@ function Ou(e) {
|
|
|
5126
5126
|
name: e.name,
|
|
5127
5127
|
args: e.args,
|
|
5128
5128
|
type: "tool_call"
|
|
5129
|
-
}))),
|
|
5129
|
+
}))), L("middleware", {
|
|
5130
5130
|
stage: "dsml_parsed",
|
|
5131
5131
|
count: n.length,
|
|
5132
5132
|
names: n.map((e) => e.name)
|
|
5133
5133
|
});
|
|
5134
5134
|
} else {
|
|
5135
5135
|
if (e && y < 2) {
|
|
5136
|
-
y += 1, b = !0,
|
|
5136
|
+
y += 1, b = !0, L("middleware", {
|
|
5137
5137
|
stage: "format_retry",
|
|
5138
5138
|
attempt: y,
|
|
5139
5139
|
content: o.content.slice(0, 200)
|
|
5140
5140
|
}), i.push(new a("⚠️ 你刚才把工具调用写成了文本(伪 XML/标签/DSML 标记,如 <|tool_calls|>、<||DSML||>、<invoke name=...>),未被系统识别为工具调用,因此未执行,页面无变化。请直接用标准 function calling(工具调用)格式重新发起工具调用,不要在回复正文里输出这些标签或 JSON 文本。"));
|
|
5141
5141
|
continue;
|
|
5142
5142
|
}
|
|
5143
|
-
if (e && (
|
|
5143
|
+
if (e && (L("error", {
|
|
5144
5144
|
stage: "garbled_exhausted",
|
|
5145
5145
|
retries: y,
|
|
5146
5146
|
content: o.content.slice(0, 200)
|
|
@@ -5151,7 +5151,7 @@ function Ou(e) {
|
|
|
5151
5151
|
code: "GARBLED_TOOL_CALL_EXHAUSTED",
|
|
5152
5152
|
context: { content: o.content.slice(0, 200) }
|
|
5153
5153
|
})), !e && f > 0 && x < 2 && gu(o.content)) {
|
|
5154
|
-
x += 1, b = !0,
|
|
5154
|
+
x += 1, b = !0, L("middleware", {
|
|
5155
5155
|
stage: "transitional_retry",
|
|
5156
5156
|
attempt: x,
|
|
5157
5157
|
content: o.content.slice(0, 160)
|
|
@@ -5163,10 +5163,10 @@ function Ou(e) {
|
|
|
5163
5163
|
messages: i,
|
|
5164
5164
|
state: V,
|
|
5165
5165
|
response: o,
|
|
5166
|
-
log: (e, t) =>
|
|
5166
|
+
log: (e, t) => L(e, t)
|
|
5167
5167
|
});
|
|
5168
5168
|
if (e) {
|
|
5169
|
-
v = o.content, V.verifyAttempts += 1, i.push(new a(`⚠️ 验证未通过,请修正:${e}`)),
|
|
5169
|
+
v = o.content, V.verifyAttempts += 1, i.push(new a(`⚠️ 验证未通过,请修正:${e}`)), L("middleware", {
|
|
5170
5170
|
stage: "verify_retry",
|
|
5171
5171
|
attempt: V.verifyAttempts,
|
|
5172
5172
|
feedback: e
|
|
@@ -5199,7 +5199,7 @@ function Ou(e) {
|
|
|
5199
5199
|
state: V,
|
|
5200
5200
|
signal: n,
|
|
5201
5201
|
emit: t,
|
|
5202
|
-
logSink:
|
|
5202
|
+
logSink: R
|
|
5203
5203
|
}
|
|
5204
5204
|
};
|
|
5205
5205
|
}), g = await zl(p, C, async (r) => {
|
|
@@ -5209,7 +5209,7 @@ function Ou(e) {
|
|
|
5209
5209
|
type: "tool_call",
|
|
5210
5210
|
name: r.call.name,
|
|
5211
5211
|
args: r.call.args
|
|
5212
|
-
}),
|
|
5212
|
+
}), L("tool_call", {
|
|
5213
5213
|
round: f + 1,
|
|
5214
5214
|
name: r.call.name,
|
|
5215
5215
|
args: r.call.args,
|
|
@@ -5222,7 +5222,7 @@ function Ou(e) {
|
|
|
5222
5222
|
result: o.content,
|
|
5223
5223
|
status: o.status,
|
|
5224
5224
|
durationMs: s
|
|
5225
|
-
}),
|
|
5225
|
+
}), L("tool_result", {
|
|
5226
5226
|
round: f + 1,
|
|
5227
5227
|
name: r.call.name,
|
|
5228
5228
|
result: o.content,
|
|
@@ -5257,7 +5257,7 @@ function Ou(e) {
|
|
|
5257
5257
|
let e = i[i.length - 1];
|
|
5258
5258
|
if (e && ye(e) === "tool") {
|
|
5259
5259
|
let e = i.filter((e) => ye(e) !== "system"), r = [new o(me() + "\n\n工具调用次数已达上限,请基于已有工具结果直接给出最终回答,不要再调用工具。"), ...e];
|
|
5260
|
-
|
|
5260
|
+
L("llm_request", {
|
|
5261
5261
|
round: "wrap_up",
|
|
5262
5262
|
model: c,
|
|
5263
5263
|
tools: [],
|
|
@@ -5267,7 +5267,7 @@ function Ou(e) {
|
|
|
5267
5267
|
messages: r,
|
|
5268
5268
|
state: V
|
|
5269
5269
|
});
|
|
5270
|
-
if (V = su(h, a, V),
|
|
5270
|
+
if (V = su(h, a, V), L("llm_response", {
|
|
5271
5271
|
round: "wrap_up",
|
|
5272
5272
|
content: a.content
|
|
5273
5273
|
}), a.aborted) return t({
|
|
@@ -5278,7 +5278,7 @@ function Ou(e) {
|
|
|
5278
5278
|
let e = a.content;
|
|
5279
5279
|
if (fu(e)) {
|
|
5280
5280
|
let n = pu(e);
|
|
5281
|
-
|
|
5281
|
+
L("error", {
|
|
5282
5282
|
stage: "garbled_wrapup",
|
|
5283
5283
|
content: e.slice(0, 200)
|
|
5284
5284
|
}), t({
|
|
@@ -5308,7 +5308,7 @@ function Ou(e) {
|
|
|
5308
5308
|
console.warn("[Agent] afterAgent 清理出错(observable,已忽略):", t.message);
|
|
5309
5309
|
}
|
|
5310
5310
|
if (B && j) try {
|
|
5311
|
-
j(
|
|
5311
|
+
j(z.value, ql(z.value));
|
|
5312
5312
|
} catch {}
|
|
5313
5313
|
}
|
|
5314
5314
|
}
|
|
@@ -5333,9 +5333,9 @@ function Ou(e) {
|
|
|
5333
5333
|
},
|
|
5334
5334
|
setTools: we,
|
|
5335
5335
|
setLlm: Te,
|
|
5336
|
-
setModelCaps:
|
|
5337
|
-
debugLogs:
|
|
5338
|
-
spans:
|
|
5336
|
+
setModelCaps: re,
|
|
5337
|
+
debugLogs: ie,
|
|
5338
|
+
spans: z,
|
|
5339
5339
|
getEffectiveSystemPrompt: () => me()
|
|
5340
5340
|
};
|
|
5341
5341
|
}
|
|
@@ -7308,10 +7308,18 @@ async function fp(e, t, n, r, i, a) {
|
|
|
7308
7308
|
let n = D(e.message);
|
|
7309
7309
|
n && t.onUsage(n);
|
|
7310
7310
|
}
|
|
7311
|
-
} : void 0, y
|
|
7311
|
+
} : void 0, y;
|
|
7312
|
+
!Qf(t.llm) && t.llm.provider === "anthropic" && (y = await C({
|
|
7313
|
+
...t.llm,
|
|
7314
|
+
model: e.model ?? t.llm.model
|
|
7315
|
+
}, {
|
|
7316
|
+
temperature: t.temperature ?? t.llm.temperature,
|
|
7317
|
+
maxTokens: t.maxTokens ?? t.llm.maxTokens
|
|
7318
|
+
}));
|
|
7319
|
+
let b = Ou({
|
|
7312
7320
|
contextWindow: g.contextWindow,
|
|
7313
7321
|
maxOutputTokens: g.maxOutputTokens,
|
|
7314
|
-
...Qf(t.llm) ? { llm: t.llm } : {
|
|
7322
|
+
...Qf(t.llm) ? { llm: t.llm } : y ? { llm: y } : {
|
|
7315
7323
|
apiKey: t.llm.apiKey,
|
|
7316
7324
|
baseUrl: t.llm.baseUrl,
|
|
7317
7325
|
model: e.model ?? t.llm.model,
|
|
@@ -7338,11 +7346,11 @@ async function fp(e, t, n, r, i, a) {
|
|
|
7338
7346
|
debug: t.debug
|
|
7339
7347
|
});
|
|
7340
7348
|
t.debug && console.log(`[subagent] 启动子 agent(depth=${o},工具 ${u.length} 个)`);
|
|
7341
|
-
let
|
|
7342
|
-
n?.addEventListener("abort",
|
|
7343
|
-
let
|
|
7344
|
-
n?.removeEventListener("abort",
|
|
7345
|
-
},
|
|
7349
|
+
let x = new AbortController(), S = () => x.abort();
|
|
7350
|
+
n?.addEventListener("abort", S, { once: !0 });
|
|
7351
|
+
let w = () => {
|
|
7352
|
+
n?.removeEventListener("abort", S), t.exitDataScope?.(d);
|
|
7353
|
+
}, T = b.stream([{
|
|
7346
7354
|
role: "user",
|
|
7347
7355
|
content: e.prompt,
|
|
7348
7356
|
timestamp: Date.now()
|
|
@@ -7352,22 +7360,22 @@ async function fp(e, t, n, r, i, a) {
|
|
|
7352
7360
|
return;
|
|
7353
7361
|
}
|
|
7354
7362
|
r && (e.type === "tool_call" || e.type === "tool_result" || e.type === "reasoning") && r(e);
|
|
7355
|
-
},
|
|
7363
|
+
}, x.signal);
|
|
7356
7364
|
if (!t.timeoutMs || t.timeoutMs <= 0) try {
|
|
7357
|
-
return await
|
|
7365
|
+
return await T;
|
|
7358
7366
|
} finally {
|
|
7359
|
-
|
|
7367
|
+
w();
|
|
7360
7368
|
}
|
|
7361
|
-
let
|
|
7362
|
-
|
|
7363
|
-
|
|
7369
|
+
let E, O = new Promise((e, n) => {
|
|
7370
|
+
E = setTimeout(() => {
|
|
7371
|
+
x.abort(), n(/* @__PURE__ */ Error(`子 agent 执行超时(${t.timeoutMs}ms),已中止。可简化子任务或拆更小的子任务重试`));
|
|
7364
7372
|
}, t.timeoutMs);
|
|
7365
7373
|
});
|
|
7366
|
-
|
|
7374
|
+
T.catch(() => {});
|
|
7367
7375
|
try {
|
|
7368
|
-
return await Promise.race([
|
|
7376
|
+
return await Promise.race([T, O]);
|
|
7369
7377
|
} finally {
|
|
7370
|
-
clearTimeout(
|
|
7378
|
+
clearTimeout(E), w();
|
|
7371
7379
|
}
|
|
7372
7380
|
}
|
|
7373
7381
|
function pp(e) {
|
|
@@ -11339,7 +11347,7 @@ function Cg(e, n = {}) {
|
|
|
11339
11347
|
mode: t.enum(["query", "transform"]).optional().describe("query=只读返回结果(默认),transform=校验后落地为新值"),
|
|
11340
11348
|
jsonPath: t.string().optional().describe("子树模式:仅对 jsonPath 指向的子树执行(降低大 JSON 成本);transform 时返回值作为该子树新值")
|
|
11341
11349
|
})
|
|
11342
|
-
}),
|
|
11350
|
+
}), re = r(async ({ jsonPath: e, jsonPaths: t, fields: r, depth: i, offset: a, limit: u }, d) => {
|
|
11343
11351
|
let f = v(d), m = Ed(s);
|
|
11344
11352
|
if (b(m, f), t && t.length) {
|
|
11345
11353
|
let e = t.map((e) => {
|
|
@@ -11415,7 +11423,7 @@ function Cg(e, n = {}) {
|
|
|
11415
11423
|
offset: t.number().int().min(0).optional().describe("数组分页起始偏移(仅当读取目标是数组时生效,默认 0),配合 limit 分页读大数组"),
|
|
11416
11424
|
limit: t.number().int().min(1).max(200).optional().describe("数组分页每页条数(默认 50,上限 200;仅数组时生效),返回切片 + total/hasMore")
|
|
11417
11425
|
})
|
|
11418
|
-
}),
|
|
11426
|
+
}), ie = r(async ({ value: e, patch: t, patches: r, del: i, dryRun: c }, u) => {
|
|
11419
11427
|
let d = v(u), f = "set";
|
|
11420
11428
|
i ? f = "delete" : (r && r.length || t) && (f = "edit");
|
|
11421
11429
|
let g = t?.value === void 0 ? e : t.value, _;
|
|
@@ -11573,7 +11581,7 @@ function Cg(e, n = {}) {
|
|
|
11573
11581
|
del: t.boolean().optional().describe("true 则删除 patch.jsonPath 指定的子路径(等价 delete_data)"),
|
|
11574
11582
|
dryRun: t.boolean().optional().describe("预检模式:走完整校验链(schema + 白名单 + patch 应用到 clone)但不落盘、不入快照,返回预览。四意图(value/patch/patches/del)均支持;乐观锁冲突照常检测(返回 VERSION_CONFLICT 不挂起)")
|
|
11575
11583
|
})
|
|
11576
|
-
}),
|
|
11584
|
+
}), L = r(async ({ jsonPath: e }) => {
|
|
11577
11585
|
let t = e || "", n = t ? Mu(o, t) : o;
|
|
11578
11586
|
return n ? `schema${t ? ` @ ${t}` : ""} = ${wd(Gu(n))}` : $({
|
|
11579
11587
|
code: "PATH_DENIED",
|
|
@@ -11584,7 +11592,7 @@ function Cg(e, n = {}) {
|
|
|
11584
11592
|
name: "schema_data",
|
|
11585
11593
|
description: "查看主数据(或子路径)的字段约束:类型/min/max/enum/必填/默认值/嵌套 shape。写前查约束,避免写错重试。不传 jsonPath 查根;传子路径(如 components.0)查该位置约束。",
|
|
11586
11594
|
schema: t.object({ jsonPath: t.string().optional().describe("要查约束的子路径;不传查根 schema") })
|
|
11587
|
-
}),
|
|
11595
|
+
}), R = r(async ({ snapshotId: e, against: t }) => {
|
|
11588
11596
|
let n = t != null, r, i;
|
|
11589
11597
|
if (n) {
|
|
11590
11598
|
let e = t;
|
|
@@ -11616,7 +11624,7 @@ function Cg(e, n = {}) {
|
|
|
11616
11624
|
snapshotId: t.number().int().optional().describe("对比的快照序号;不传则最近一次"),
|
|
11617
11625
|
against: t.unknown().optional().describe("对比的一段 JSON 值(与 snapshotId 互斥;传则忽略快照)")
|
|
11618
11626
|
})
|
|
11619
|
-
}),
|
|
11627
|
+
}), z = [];
|
|
11620
11628
|
if (n.vfsStore) {
|
|
11621
11629
|
let e = n.vfsStore, i = (e) => `drafts/${e}.json`, a = r(({ draftId: t, chunk: n, mode: r }) => {
|
|
11622
11630
|
let a = i(t), o = e.files[a], s = r === "append" && o, c = s ? o.content + n : n;
|
|
@@ -11680,7 +11688,7 @@ function Cg(e, n = {}) {
|
|
|
11680
11688
|
expectedHash: t.string().optional().describe("乐观锁:改前 read/get 返回的 hash;传入则校验,不一致拒绝写入防覆盖。不传则自动用你最后读到的 hash(autoLock)")
|
|
11681
11689
|
})
|
|
11682
11690
|
});
|
|
11683
|
-
|
|
11691
|
+
z.push(a, c);
|
|
11684
11692
|
}
|
|
11685
11693
|
let ae = [];
|
|
11686
11694
|
if (e.resources?.length && d) {
|
|
@@ -11797,11 +11805,11 @@ function Cg(e, n = {}) {
|
|
|
11797
11805
|
ne,
|
|
11798
11806
|
F,
|
|
11799
11807
|
I,
|
|
11800
|
-
L,
|
|
11801
11808
|
re,
|
|
11809
|
+
ie,
|
|
11810
|
+
L,
|
|
11802
11811
|
R,
|
|
11803
|
-
z,
|
|
11804
|
-
...ie,
|
|
11812
|
+
...z,
|
|
11805
11813
|
...ae
|
|
11806
11814
|
];
|
|
11807
11815
|
Object.defineProperty(B, "controller", {
|
|
@@ -12282,7 +12290,7 @@ function f_(e, n) {
|
|
|
12282
12290
|
prompt_tokens: 0,
|
|
12283
12291
|
completion_tokens: 0,
|
|
12284
12292
|
total_tokens: 0
|
|
12285
|
-
}, a = Qm(() =>
|
|
12293
|
+
}, a = Qm(() => st), o = /* @__PURE__ */ Sn(0), s = wh(e.storage);
|
|
12286
12294
|
e.debug && s && s.onEvent((e) => console.log("[page-agent-sdk][storage]", e));
|
|
12287
12295
|
let { modelCaps: c, summaryLlmInvoke: l, titleLlmInvoke: u, compressDecisionInvoke: d } = Zm(e), f = c;
|
|
12288
12296
|
if (e.debug && console.log("[page-agent-sdk][modelCaps]", f), f.contextWindow < 2e5) throw Error(`[page-agent-sdk] 模型上下文窗口 ${f.contextWindow} 小于最小支持 ${Hl}(需 ≥200K 窗口模型,如 GLM-5.2/Claude/Kimi/Qwen-1M/DeepSeek-v4)`);
|
|
@@ -12298,7 +12306,7 @@ function f_(e, n) {
|
|
|
12298
12306
|
getSchema: () => de()?.schema,
|
|
12299
12307
|
getBind: () => de()?.bind,
|
|
12300
12308
|
unfocusGuidance: e.toolMode === "advanced" ? "tool" : "ask-user",
|
|
12301
|
-
onChange: (e) =>
|
|
12309
|
+
onChange: (e) => st({
|
|
12302
12310
|
type: "focus_change",
|
|
12303
12311
|
focuses: e
|
|
12304
12312
|
})
|
|
@@ -12315,7 +12323,7 @@ function f_(e, n) {
|
|
|
12315
12323
|
let t = Lu(O?.schema, e._codeAsset.codeField);
|
|
12316
12324
|
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'])"), j.add(e));
|
|
12317
12325
|
}
|
|
12318
|
-
let M = j.size ? ee.filter((e) => !j.has(e)) : ee, N = j.size ? (A ?? []).filter((e) => !j.has(e)) : A, P = M.length > 0, te = M.flatMap((e) => e._codeAsset.writablePaths), ne = M.flatMap((e) => e._codeAsset.writablePaths.map((t) => `${t}.${e._codeAsset.codeField}`)), F = e.checkpoint, I = F !== void 0 && F !== !1,
|
|
12326
|
+
let M = j.size ? ee.filter((e) => !j.has(e)) : ee, N = j.size ? (A ?? []).filter((e) => !j.has(e)) : A, P = M.length > 0, te = M.flatMap((e) => e._codeAsset.writablePaths), ne = M.flatMap((e) => e._codeAsset.writablePaths.map((t) => `${t}.${e._codeAsset.codeField}`)), F = e.checkpoint, I = F !== void 0 && F !== !1, re = I ? Df({
|
|
12319
12327
|
getData: () => de()?.bind,
|
|
12320
12328
|
consumeDataDirty: () => le?.consumeDataDirty?.() ?? !0,
|
|
12321
12329
|
slotPaths: O ? [""] : [],
|
|
@@ -12324,48 +12332,48 @@ function f_(e, n) {
|
|
|
12324
12332
|
getTodos: () => D.current?.getState?.()?.todos ?? [],
|
|
12325
12333
|
messages: v,
|
|
12326
12334
|
maxCheckpoints: F && typeof F == "object" ? F.maxCheckpoints : void 0
|
|
12327
|
-
}) : null,
|
|
12335
|
+
}) : null, ie = !F || typeof F != "object" || F.auto !== !1, L = Dh(e.capabilities), R = L.dataOps, z = L.draftWrite, ae = L.tracing, B = L.automation, oe = Gp(e);
|
|
12328
12336
|
if (P) {
|
|
12329
12337
|
let e = M.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
|
|
12330
12338
|
e && (oe += "\n\n" + e);
|
|
12331
12339
|
} else O?.schema && Iu(O.schema) && (oe += "\n\n" + ed.htmlDirectWriteFallback, console.warn("[page-agent-sdk] 检测到 schema 含 code 字段但未注册 html 子 agent:已自动注入「主 agent 自己写 HTML」编排(code 作普通字段直接 write,无 vfs 工作副本 / 无格式校验门禁)。如需代码资产机制(vfs + 格式校验 + 增量 commit + 主上下文 code 摘要),注册 createHtmlSubagent;若确为降级意图可忽略。"));
|
|
12332
|
-
let se =
|
|
12340
|
+
let se = R && O ? Cg(O, {
|
|
12333
12341
|
onAudit: e.onAudit ?? (e.debug ? (e) => console.log("[page-agent-sdk][data audit]", e) : void 0),
|
|
12334
12342
|
maxSnapshots: e.maxSnapshots,
|
|
12335
12343
|
onConflict: a.set,
|
|
12336
12344
|
autoLock: e.autoLock,
|
|
12337
12345
|
interceptors: e.interceptors,
|
|
12338
|
-
vfsStore:
|
|
12346
|
+
vfsStore: z || O?.resources?.length ? y : void 0,
|
|
12339
12347
|
...te.length ? { pgIdPaths: te } : {},
|
|
12340
12348
|
...ne.length ? { largeTextPaths: ne } : {}
|
|
12341
|
-
}) : [], ce =
|
|
12349
|
+
}) : [], ce = R ? mg(se, e.toolMode) : [], le = R && O ? se.controller ?? null : null, ue = R && O?.resources?.length && le?.getResourcesSnapshot ? Xg({
|
|
12342
12350
|
getResourcesSnapshot: () => le?.getResourcesSnapshot?.() ?? [],
|
|
12343
12351
|
toolsExposed: e.toolMode === "advanced"
|
|
12344
|
-
}) : void 0, de = () => le?.get() ?? O, V = /* @__PURE__ */ new Map(), fe = Kg(
|
|
12352
|
+
}) : void 0, de = () => le?.get() ?? O, V = /* @__PURE__ */ new Map(), fe = Kg(L, ce, Tg, jg, Rg);
|
|
12345
12353
|
fe.forEach((e) => V.set(e.name, "builtin"));
|
|
12346
12354
|
let pe = [...e.tools || []];
|
|
12347
12355
|
pe.forEach((e) => V.set(e.name, "user"));
|
|
12348
12356
|
let me = Vg(e.actions ?? {});
|
|
12349
12357
|
me.forEach((e) => V.set(e.name, "action"));
|
|
12350
|
-
let he = [], ge = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1),
|
|
12351
|
-
|
|
12352
|
-
let
|
|
12353
|
-
let e =
|
|
12354
|
-
return e.length ?
|
|
12358
|
+
let he = [], ge = !1, _e = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1), ve = _e ? yf() : null;
|
|
12359
|
+
ve && V.set(_f, "builtin");
|
|
12360
|
+
let ye = I && re ? [r(async () => {
|
|
12361
|
+
let e = re.list();
|
|
12362
|
+
return e.length ? re.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
|
|
12355
12363
|
}, {
|
|
12356
12364
|
name: "restore_last_checkpoint",
|
|
12357
12365
|
description: "回退到最近一次正常状态(整体还原对话历史 + 主数据 + vfs + todos)。当本轮操作出错、页面被改坏、或走偏时调用,回到本轮起点重新来过。不传参数即回退最近一次。",
|
|
12358
12366
|
schema: t.object({}).optional()
|
|
12359
12367
|
}), r(async () => {
|
|
12360
|
-
let e =
|
|
12368
|
+
let e = re.list();
|
|
12361
12369
|
return e.length ? "可用 checkpoint:\n" + e.map((e) => `#${e.id} [${e.label ?? "auto"}] 消息数=${e.messageCount} 时间=${new Date(e.timestamp).toLocaleTimeString()}`).join("\n") : "无可用 checkpoint。";
|
|
12362
12370
|
}, {
|
|
12363
12371
|
name: "list_checkpoints",
|
|
12364
12372
|
description: "列出可用会话 checkpoint(回退点)。",
|
|
12365
12373
|
schema: t.object({}).optional()
|
|
12366
12374
|
})] : [];
|
|
12367
|
-
|
|
12368
|
-
let
|
|
12375
|
+
ye.forEach((e) => V.set(e.name, "builtin"));
|
|
12376
|
+
let be = L.focus, xe = r(async ({ path: e, label: t }) => {
|
|
12369
12377
|
let n = de()?.schema;
|
|
12370
12378
|
return n ? Mu(n, e) ? (w.setFocus({
|
|
12371
12379
|
path: e,
|
|
@@ -12378,11 +12386,11 @@ function f_(e, n) {
|
|
|
12378
12386
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
12379
12387
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
12380
12388
|
})
|
|
12381
|
-
}),
|
|
12389
|
+
}), Se = r(async () => (w.clearFocus(), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
12382
12390
|
name: "clear_focus",
|
|
12383
12391
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
12384
12392
|
schema: t.object({}).optional()
|
|
12385
|
-
}),
|
|
12393
|
+
}), Ce = r(async ({ path: e, label: t }) => {
|
|
12386
12394
|
let n = de()?.schema;
|
|
12387
12395
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
12388
12396
|
if (!Mu(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
@@ -12399,7 +12407,7 @@ function f_(e, n) {
|
|
|
12399
12407
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
12400
12408
|
label: t.string().optional().describe("人类可读标签")
|
|
12401
12409
|
})
|
|
12402
|
-
}),
|
|
12410
|
+
}), we = r(async ({ path: e }) => {
|
|
12403
12411
|
let t = w.getFocuses().length;
|
|
12404
12412
|
w.removeFocus(e);
|
|
12405
12413
|
let n = w.getFocuses();
|
|
@@ -12408,15 +12416,15 @@ function f_(e, n) {
|
|
|
12408
12416
|
name: "remove_focus",
|
|
12409
12417
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
12410
12418
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
12411
|
-
}),
|
|
12412
|
-
be,
|
|
12419
|
+
}), Te = be && e.toolMode === "advanced" ? [
|
|
12413
12420
|
xe,
|
|
12414
12421
|
Se,
|
|
12415
|
-
Ce
|
|
12422
|
+
Ce,
|
|
12423
|
+
we
|
|
12416
12424
|
] : [];
|
|
12417
|
-
|
|
12418
|
-
let
|
|
12419
|
-
function
|
|
12425
|
+
Te.forEach((e) => V.set(e.name, "builtin"));
|
|
12426
|
+
let Ee = [], De = /* @__PURE__ */ new Map(), Oe = ke();
|
|
12427
|
+
function ke() {
|
|
12420
12428
|
let { tools: e, collisions: t } = qg([
|
|
12421
12429
|
{
|
|
12422
12430
|
label: "builtin",
|
|
@@ -12432,15 +12440,15 @@ function f_(e, n) {
|
|
|
12432
12440
|
},
|
|
12433
12441
|
{
|
|
12434
12442
|
label: "humanConfirm",
|
|
12435
|
-
tools:
|
|
12443
|
+
tools: ve ? [ve] : []
|
|
12436
12444
|
},
|
|
12437
12445
|
{
|
|
12438
12446
|
label: "checkpoint",
|
|
12439
|
-
tools:
|
|
12447
|
+
tools: ye
|
|
12440
12448
|
},
|
|
12441
12449
|
{
|
|
12442
12450
|
label: "focus",
|
|
12443
|
-
tools:
|
|
12451
|
+
tools: Te
|
|
12444
12452
|
},
|
|
12445
12453
|
{
|
|
12446
12454
|
label: "mcp",
|
|
@@ -12448,41 +12456,41 @@ function f_(e, n) {
|
|
|
12448
12456
|
},
|
|
12449
12457
|
{
|
|
12450
12458
|
label: "skill",
|
|
12451
|
-
tools:
|
|
12459
|
+
tools: Ee
|
|
12452
12460
|
}
|
|
12453
12461
|
]);
|
|
12454
12462
|
return t.length && console.warn("[page-agent-sdk] 工具重名,后注册覆盖先注册:", t.map((e) => `${e.name}(${e.loser}→${e.winner})`).join(", ")), e;
|
|
12455
12463
|
}
|
|
12456
|
-
let
|
|
12457
|
-
if (
|
|
12458
|
-
if (
|
|
12459
|
-
let
|
|
12460
|
-
e.debug &&
|
|
12461
|
-
let
|
|
12462
|
-
|
|
12463
|
-
let
|
|
12464
|
-
llm:
|
|
12465
|
-
allTools: () => G.agent?.allTools ??
|
|
12466
|
-
allowedTools:
|
|
12467
|
-
systemPrompt:
|
|
12468
|
-
temperature:
|
|
12469
|
-
maxTokens:
|
|
12470
|
-
skills:
|
|
12471
|
-
maxDepth:
|
|
12472
|
-
maxParallel:
|
|
12464
|
+
let Ae = L.planning, je = L.missionAnchor, H = L.workingMemory, Me = L.skills, Ne = L.vfs || P;
|
|
12465
|
+
if (Ne) for (let e of nm) V.set(e, "builtin");
|
|
12466
|
+
if (Ae) for (let e of b.tools ?? []) V.set(e.name, "builtin");
|
|
12467
|
+
let Pe = L.summarization, Fe = L.agentCompression && !!d;
|
|
12468
|
+
e.debug && L.agentCompression && !d && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
12469
|
+
let Ie = L.memory, Le = L.subagent, Re = Le ? Zf() : void 0, ze = e.verify?.maxAttempts ?? 2, Be = !!(e.verify?.check || e.verify?.maxAttempts || e.verify?.adversarial), Ve = e.capabilities?.verify === !1, He = (L.verify || Be && !Ve) && e.verify?.enabled !== !1 && ze > 0, Ue = L.contextInspector;
|
|
12470
|
+
Be && !He && e.verify?.enabled !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
|
|
12471
|
+
let U = e.subagent, We = U?.allowedTools ?? [], Ge = e.permissions?.length ? hf(e.permissions) : void 0, Ke = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? gf(e.approval) : void 0, qe = [...Ge ? [Ge] : [], ...Ke ? [Ke] : []], Je = !Le || U?.enabled === !1 ? void 0 : pp({
|
|
12472
|
+
llm: U?.llm ?? e.llm,
|
|
12473
|
+
allTools: () => G.agent?.allTools ?? Oe,
|
|
12474
|
+
allowedTools: We.length ? We : void 0,
|
|
12475
|
+
systemPrompt: U?.systemPrompt,
|
|
12476
|
+
temperature: U?.temperature,
|
|
12477
|
+
maxTokens: U?.maxTokens,
|
|
12478
|
+
skills: U?.skills,
|
|
12479
|
+
maxDepth: U?.maxDepth,
|
|
12480
|
+
maxParallel: U?.maxParallel,
|
|
12473
12481
|
debug: e.debug,
|
|
12474
12482
|
getFocuses: () => w.getFocuses(),
|
|
12475
12483
|
getSchema: () => de()?.schema ?? null,
|
|
12476
|
-
tracker:
|
|
12477
|
-
guardMiddleware:
|
|
12478
|
-
getVfsFiles:
|
|
12484
|
+
tracker: Re,
|
|
12485
|
+
guardMiddleware: qe.length ? qe : void 0,
|
|
12486
|
+
getVfsFiles: Ne ? () => y.files : void 0,
|
|
12479
12487
|
enterDataScope: le?.enterScope ? (e) => le.enterScope(e) : void 0,
|
|
12480
12488
|
exitDataScope: le?.exitScope ? (e) => le.exitScope(e) : void 0,
|
|
12481
12489
|
onUsage: (e) => {
|
|
12482
12490
|
i.prompt_tokens = (i.prompt_tokens ?? 0) + (e.prompt_tokens ?? 0), i.completion_tokens = (i.completion_tokens ?? 0) + (e.completion_tokens ?? 0), i.total_tokens = (i.total_tokens ?? 0) + (e.total_tokens ?? 0);
|
|
12483
12491
|
},
|
|
12484
|
-
timeoutMs:
|
|
12485
|
-
}),
|
|
12492
|
+
timeoutMs: U?.timeoutMs
|
|
12493
|
+
}), Ye = N?.map((e) => {
|
|
12486
12494
|
if (!e._codeAsset) return e;
|
|
12487
12495
|
let t = e._codeAsset, n = bm({
|
|
12488
12496
|
writablePaths: t.writablePaths,
|
|
@@ -12499,59 +12507,59 @@ function f_(e, n) {
|
|
|
12499
12507
|
...e,
|
|
12500
12508
|
middleware: r
|
|
12501
12509
|
};
|
|
12502
|
-
}),
|
|
12510
|
+
}), Xe = P && Le ? xm() : void 0, W = Xe ? Om({
|
|
12503
12511
|
getBind: () => de()?.bind,
|
|
12504
12512
|
writablePaths: te,
|
|
12505
|
-
getLocked: () =>
|
|
12506
|
-
}) : void 0,
|
|
12513
|
+
getLocked: () => Xe.locked()
|
|
12514
|
+
}) : void 0, Ze = Le && Ye !== void 0 ? gp(Ye, {
|
|
12507
12515
|
llm: e.llm,
|
|
12508
|
-
allTools: () => G.agent?.allTools ??
|
|
12516
|
+
allTools: () => G.agent?.allTools ?? Oe,
|
|
12509
12517
|
debug: e.debug,
|
|
12510
12518
|
getFocuses: () => w.getFocuses(),
|
|
12511
12519
|
getSchema: () => de()?.schema ?? null,
|
|
12512
12520
|
getBind: () => de()?.bind,
|
|
12513
|
-
tracker:
|
|
12514
|
-
guardMiddleware:
|
|
12515
|
-
getVfsFiles:
|
|
12521
|
+
tracker: Re,
|
|
12522
|
+
guardMiddleware: qe.length ? qe : void 0,
|
|
12523
|
+
getVfsFiles: Ne ? () => y.files : void 0,
|
|
12516
12524
|
enterDataScope: le?.enterScope ? (e) => le.enterScope(e) : void 0,
|
|
12517
12525
|
exitDataScope: le?.exitScope ? (e) => le.exitScope(e) : void 0,
|
|
12518
12526
|
onUsage: (e) => {
|
|
12519
12527
|
i.prompt_tokens = (i.prompt_tokens ?? 0) + (e.prompt_tokens ?? 0), i.completion_tokens = (i.completion_tokens ?? 0) + (e.completion_tokens ?? 0), i.total_tokens = (i.total_tokens ?? 0) + (e.total_tokens ?? 0);
|
|
12520
12528
|
},
|
|
12521
12529
|
timeoutMs: e.subagent?.timeoutMs,
|
|
12522
|
-
...
|
|
12523
|
-
componentLock:
|
|
12530
|
+
...Xe ? {
|
|
12531
|
+
componentLock: Xe,
|
|
12524
12532
|
resolveComponents: (e) => Sm(e, gm(de()?.bind, te))
|
|
12525
12533
|
} : {}
|
|
12526
|
-
}) : void 0,
|
|
12534
|
+
}) : void 0, Qe = Ze ? Ze.controller : null, $e = [
|
|
12527
12535
|
"get_data",
|
|
12528
12536
|
"describe_data",
|
|
12529
12537
|
"read",
|
|
12530
12538
|
"fetch_document"
|
|
12531
|
-
],
|
|
12539
|
+
], et = Oe.filter((e) => $e.includes(e.name)), tt = He ? _p({
|
|
12532
12540
|
check: e.verify.check ?? Cp({
|
|
12533
12541
|
schemas: () => de() ? { "": de().schema } : {},
|
|
12534
12542
|
root: () => de()?.bind
|
|
12535
12543
|
}),
|
|
12536
12544
|
adversarial: e.verify?.adversarial ? {
|
|
12537
12545
|
llm: e.llm,
|
|
12538
|
-
tools:
|
|
12546
|
+
tools: et
|
|
12539
12547
|
} : void 0
|
|
12540
|
-
}) : void 0,
|
|
12548
|
+
}) : void 0, nt = Ue ? Lp({
|
|
12541
12549
|
contextWindow: f.contextWindow,
|
|
12542
12550
|
thresholdRatio: jh(e, f.contextWindow).summaryThresholdRatio
|
|
12543
|
-
}) : void 0,
|
|
12544
|
-
...
|
|
12545
|
-
humanConfirm:
|
|
12551
|
+
}) : void 0, rt = Yg({
|
|
12552
|
+
...L,
|
|
12553
|
+
humanConfirm: _e,
|
|
12546
12554
|
subagents: N?.map((e) => ({
|
|
12547
12555
|
id: e.id,
|
|
12548
12556
|
description: e.description,
|
|
12549
12557
|
temperature: e.temperature
|
|
12550
12558
|
}))
|
|
12551
|
-
},
|
|
12559
|
+
}, R && !!O, e.toolMode, !!O?.resources?.length, { promptSoftCap: Kf(f.contextWindow, p.promptSoftCapTokens) }), it = O ? {
|
|
12552
12560
|
name: "dataHint",
|
|
12553
12561
|
augmentPrompt: () => Wp(de(), e.schemaHint) || void 0
|
|
12554
|
-
} : null,
|
|
12562
|
+
} : null, at = e.augmentSystem ? {
|
|
12555
12563
|
name: "augmentSystem",
|
|
12556
12564
|
augmentPrompt: (t) => {
|
|
12557
12565
|
try {
|
|
@@ -12564,91 +12572,91 @@ function f_(e, n) {
|
|
|
12564
12572
|
return;
|
|
12565
12573
|
}
|
|
12566
12574
|
}
|
|
12567
|
-
} : null,
|
|
12575
|
+
} : null, ot = Oh(e.onEvent), st = ot.emit, ct, lt = [], ut = (e) => ({
|
|
12568
12576
|
name: e.name,
|
|
12569
12577
|
description: e.description,
|
|
12570
12578
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
12571
|
-
}),
|
|
12579
|
+
}), dt = (e) => ({
|
|
12572
12580
|
name: e.name,
|
|
12573
12581
|
description: e.description,
|
|
12574
12582
|
getContent: () => e.content
|
|
12575
|
-
}),
|
|
12583
|
+
}), ft = e.skillStorage === !1 ? null : t_({
|
|
12576
12584
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
12577
12585
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
12578
|
-
}),
|
|
12579
|
-
let t =
|
|
12586
|
+
}), pt = () => {
|
|
12587
|
+
let t = ct ? ct.controller : null;
|
|
12580
12588
|
if (t) {
|
|
12581
|
-
let n = (e.skills || []).filter((e) => !
|
|
12582
|
-
t.set([...n, ...
|
|
12589
|
+
let n = (e.skills || []).filter((e) => !lt.some((t) => t.name === e.name));
|
|
12590
|
+
t.set([...n, ...lt]);
|
|
12583
12591
|
}
|
|
12584
12592
|
G.infoTick.value++;
|
|
12585
|
-
},
|
|
12586
|
-
if (
|
|
12587
|
-
let t = await
|
|
12593
|
+
}, mt = async () => {
|
|
12594
|
+
if (ft) try {
|
|
12595
|
+
let t = await ft.list();
|
|
12588
12596
|
if (t.length) {
|
|
12589
|
-
|
|
12590
|
-
let n =
|
|
12597
|
+
lt = t.map(dt);
|
|
12598
|
+
let n = ct ? ct.controller : null;
|
|
12591
12599
|
if (n) {
|
|
12592
|
-
let t = (e.skills || []).filter((e) => !
|
|
12593
|
-
n.set([...t, ...
|
|
12600
|
+
let t = (e.skills || []).filter((e) => !lt.some((t) => t.name === e.name));
|
|
12601
|
+
n.set([...t, ...lt]);
|
|
12594
12602
|
}
|
|
12595
12603
|
G.infoTick.value++;
|
|
12596
12604
|
}
|
|
12597
12605
|
} catch {}
|
|
12598
|
-
},
|
|
12606
|
+
}, ht = Pe ? Xf({
|
|
12599
12607
|
...p,
|
|
12600
12608
|
llmInvoke: l,
|
|
12601
12609
|
getRegisteredData: () => de() ? [{ description: de().description ?? "主数据对象" }] : [],
|
|
12602
12610
|
preserveLastToolResults: h,
|
|
12603
|
-
...
|
|
12611
|
+
...Fe ? {
|
|
12604
12612
|
decideInvoke: d,
|
|
12605
|
-
getSnapshot: () =>
|
|
12613
|
+
getSnapshot: () => nt?.getSnapshot()
|
|
12606
12614
|
} : {}
|
|
12607
|
-
}) : void 0,
|
|
12608
|
-
...
|
|
12609
|
-
|
|
12610
|
-
...
|
|
12611
|
-
...
|
|
12612
|
-
...
|
|
12613
|
-
readVfs:
|
|
12614
|
-
hostScriptEnabled:
|
|
12615
|
+
}) : void 0, gt = Nh([
|
|
12616
|
+
...it ? [it] : [],
|
|
12617
|
+
rt,
|
|
12618
|
+
...je ? [x] : [],
|
|
12619
|
+
...Ae ? [b] : [],
|
|
12620
|
+
...Me ? [ct = cf(e.skills || [], {
|
|
12621
|
+
readVfs: Ne ? (e) => y.files[e]?.content : void 0,
|
|
12622
|
+
hostScriptEnabled: L.skillHostScript,
|
|
12615
12623
|
onToolsReady: (e, t) => {
|
|
12616
12624
|
for (let n of t) {
|
|
12617
|
-
let t =
|
|
12618
|
-
t >= 0 &&
|
|
12625
|
+
let t = Ee.findIndex((e) => e.name === n.name);
|
|
12626
|
+
t >= 0 && Ee.splice(t, 1), Ee.push(n), De.set(n.name, e), V.set(n.name, `skill:${e}`);
|
|
12619
12627
|
}
|
|
12620
|
-
|
|
12628
|
+
Oe = ke(), G.agent && G.agent.setTools(Oe), G.infoTick.value++;
|
|
12621
12629
|
}
|
|
12622
12630
|
})] : [],
|
|
12623
|
-
...
|
|
12624
|
-
...
|
|
12625
|
-
...
|
|
12626
|
-
...
|
|
12631
|
+
...Ne ? [im(y)] : [],
|
|
12632
|
+
...ht ? [ht] : [],
|
|
12633
|
+
...H ? [T] : [],
|
|
12634
|
+
...be ? [w] : [],
|
|
12627
12635
|
...ue ? [ue] : [],
|
|
12628
|
-
...
|
|
12629
|
-
...We ? [We] : [],
|
|
12630
|
-
...I && re && L ? [Of(L)] : [],
|
|
12631
|
-
...ge ? [bf()] : [],
|
|
12636
|
+
...Ie ? [E] : [],
|
|
12632
12637
|
...Ge ? [Ge] : [],
|
|
12633
|
-
...
|
|
12634
|
-
...
|
|
12635
|
-
...
|
|
12636
|
-
...Xe ? [Xe] : [],
|
|
12637
|
-
...it ? [it] : [],
|
|
12638
|
+
...I && ie && re ? [Of(re)] : [],
|
|
12639
|
+
..._e ? [bf()] : [],
|
|
12640
|
+
...Ke ? [Ke] : [],
|
|
12638
12641
|
...tt ? [tt] : [],
|
|
12642
|
+
...Je ? [Je] : [],
|
|
12643
|
+
...Ze ? [Ze] : [],
|
|
12644
|
+
...W ? [W] : [],
|
|
12645
|
+
...at ? [at] : [],
|
|
12646
|
+
...nt ? [nt] : [],
|
|
12639
12647
|
...e.middleware || [],
|
|
12640
12648
|
...B ? [zg(i, {
|
|
12641
12649
|
tokenBudget: e.tokenBudget,
|
|
12642
12650
|
timeBudgetMs: e.timeBudgetMs
|
|
12643
|
-
},
|
|
12644
|
-
u_(
|
|
12645
|
-
]),
|
|
12646
|
-
function
|
|
12647
|
-
if (
|
|
12651
|
+
}, st)] : [],
|
|
12652
|
+
u_(st, v, de, i)
|
|
12653
|
+
]), _t = e.maxMemoryRounds ?? o_, vt = e.approval?.timeoutMs, yt = vt === void 0 || vt === 0 ? 3e4 : !Number.isFinite(vt) || vt < 0 ? 0 : vt;
|
|
12654
|
+
function bt(e) {
|
|
12655
|
+
if (yt) return (t) => {
|
|
12648
12656
|
if (t.type !== "approval_request") return;
|
|
12649
12657
|
let n = Date.now(), r = t.toolName;
|
|
12650
12658
|
setTimeout(() => {
|
|
12651
|
-
e?.aborted || (t.resolve(!1),
|
|
12659
|
+
e?.aborted || (t.resolve(!1), st({
|
|
12652
12660
|
type: "error",
|
|
12653
12661
|
message: `确认请求(${r})${Math.round((Date.now() - n) / 1e3)}s 无响应已自动拒绝 —— send/batch 路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
12654
12662
|
severity: "observable",
|
|
@@ -12658,37 +12666,37 @@ function f_(e, n) {
|
|
|
12658
12666
|
waitedMs: Date.now() - n
|
|
12659
12667
|
}
|
|
12660
12668
|
}));
|
|
12661
|
-
},
|
|
12669
|
+
}, yt);
|
|
12662
12670
|
};
|
|
12663
12671
|
}
|
|
12664
|
-
function
|
|
12665
|
-
let t =
|
|
12672
|
+
function xt(e) {
|
|
12673
|
+
let t = bt(e);
|
|
12666
12674
|
return (e) => {
|
|
12667
|
-
t?.(e), e.type === "error" &&
|
|
12675
|
+
t?.(e), e.type === "error" && st(e);
|
|
12668
12676
|
};
|
|
12669
12677
|
}
|
|
12670
|
-
let
|
|
12671
|
-
async function
|
|
12672
|
-
s && (
|
|
12678
|
+
let St = /* @__PURE__ */ Sn([]);
|
|
12679
|
+
async function Ct() {
|
|
12680
|
+
s && (St.value = (await s.listSessions(n)).sort((e, t) => t.lastAccessed - e.lastAccessed));
|
|
12673
12681
|
}
|
|
12674
|
-
let
|
|
12675
|
-
function
|
|
12682
|
+
let wt = a_(), Tt = /* @__PURE__ */ new Set();
|
|
12683
|
+
function Et(e) {
|
|
12676
12684
|
let t = new AbortController();
|
|
12677
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", () => t.abort(), { once: !0 })),
|
|
12685
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", () => t.abort(), { once: !0 })), Tt.add(t), {
|
|
12678
12686
|
controller: t,
|
|
12679
|
-
untrack: () =>
|
|
12687
|
+
untrack: () => Tt.delete(t)
|
|
12680
12688
|
};
|
|
12681
12689
|
}
|
|
12682
|
-
function
|
|
12683
|
-
for (let e of
|
|
12684
|
-
|
|
12690
|
+
function Dt() {
|
|
12691
|
+
for (let e of Tt) e.abort();
|
|
12692
|
+
Tt.clear();
|
|
12685
12693
|
}
|
|
12686
12694
|
let G = {
|
|
12687
12695
|
agentId: n,
|
|
12688
12696
|
store: s,
|
|
12689
12697
|
messages: v,
|
|
12690
12698
|
vfsStore: y,
|
|
12691
|
-
listeners:
|
|
12699
|
+
listeners: ot.listeners,
|
|
12692
12700
|
todosMw: b,
|
|
12693
12701
|
memoryMw: E,
|
|
12694
12702
|
missionMw: x,
|
|
@@ -12700,32 +12708,32 @@ function f_(e, n) {
|
|
|
12700
12708
|
refCount: 0,
|
|
12701
12709
|
mcpClosers: [],
|
|
12702
12710
|
mcpServers: [],
|
|
12703
|
-
checkpoint:
|
|
12711
|
+
checkpoint: re,
|
|
12704
12712
|
dataOpsController: le,
|
|
12705
|
-
skillsController:
|
|
12713
|
+
skillsController: ct ? ct.controller : null,
|
|
12706
12714
|
infoTick: o,
|
|
12707
12715
|
pendingConflict: a.pendingConflict,
|
|
12708
|
-
sessions:
|
|
12709
|
-
refreshSessions:
|
|
12716
|
+
sessions: St,
|
|
12717
|
+
refreshSessions: Ct,
|
|
12710
12718
|
liveData: de,
|
|
12711
12719
|
usage: i,
|
|
12712
|
-
emit:
|
|
12713
|
-
runSerial:
|
|
12714
|
-
trackActive:
|
|
12715
|
-
abortAllActive:
|
|
12720
|
+
emit: st,
|
|
12721
|
+
runSerial: wt,
|
|
12722
|
+
trackActive: Et,
|
|
12723
|
+
abortAllActive: Dt,
|
|
12716
12724
|
unloadSkillTools(e) {
|
|
12717
12725
|
if (e) {
|
|
12718
|
-
let t =
|
|
12719
|
-
if (
|
|
12726
|
+
let t = Ee.length;
|
|
12727
|
+
if (Ee = Ee.filter((t) => De.get(t.name) === e ? (V.delete(t.name), De.delete(t.name), !1) : !0), Ee.length === t) return;
|
|
12720
12728
|
} else {
|
|
12721
|
-
if (!
|
|
12722
|
-
for (let e of
|
|
12723
|
-
|
|
12729
|
+
if (!Ee.length) return;
|
|
12730
|
+
for (let e of Ee) V.delete(e.name), De.delete(e.name);
|
|
12731
|
+
Ee = [];
|
|
12724
12732
|
}
|
|
12725
|
-
|
|
12733
|
+
Oe = ke(), G.agent && G.agent.setTools(Oe);
|
|
12726
12734
|
},
|
|
12727
12735
|
applySnapshot(t) {
|
|
12728
|
-
if (t.messages?.length && v.push(...t.messages), t.vfs && y.hydrate && y.hydrate(t.vfs), t.todos?.length && b.reset(t.todos), t.memory && !e.memory && E.reset(t.memory), t.checkpoints?.length &&
|
|
12736
|
+
if (t.messages?.length && v.push(...t.messages), t.vfs && y.hydrate && y.hydrate(t.vfs), t.todos?.length && b.reset(t.todos), t.memory && !e.memory && E.reset(t.memory), t.checkpoints?.length && re && re.importStack(t.checkpoints), t.usage && Object.assign(i, t.usage), t.mission && je && x.setMission(t.mission), t.workingMemory && H && T.restore(t.workingMemory), be) {
|
|
12729
12737
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
12730
12738
|
if (r.length) {
|
|
12731
12739
|
let t = de()?.schema, n = t ? r.filter((e) => Mu(t, e.path)) : [];
|
|
@@ -12735,21 +12743,21 @@ function f_(e, n) {
|
|
|
12735
12743
|
}
|
|
12736
12744
|
}
|
|
12737
12745
|
}
|
|
12738
|
-
|
|
12746
|
+
jt();
|
|
12739
12747
|
},
|
|
12740
12748
|
addSkill(e) {
|
|
12741
|
-
let t =
|
|
12742
|
-
t >= 0 ?
|
|
12749
|
+
let t = lt.findIndex((t) => t.name === e.name);
|
|
12750
|
+
t >= 0 ? lt[t] = e : lt.push(e), pt(), ft && ft.put(ut(e));
|
|
12743
12751
|
},
|
|
12744
12752
|
removeSkill(e) {
|
|
12745
|
-
let t =
|
|
12746
|
-
return t < 0 ? !1 : (
|
|
12753
|
+
let t = lt.findIndex((t) => t.name === e);
|
|
12754
|
+
return t < 0 ? !1 : (lt.splice(t, 1), pt(), ft && ft.remove(e), !0);
|
|
12747
12755
|
},
|
|
12748
12756
|
listUserSkills() {
|
|
12749
|
-
return
|
|
12757
|
+
return lt.map((e) => e.name);
|
|
12750
12758
|
},
|
|
12751
12759
|
getUserSkill(e) {
|
|
12752
|
-
let t =
|
|
12760
|
+
let t = lt.find((t) => t.name === e);
|
|
12753
12761
|
if (t) return {
|
|
12754
12762
|
name: t.name,
|
|
12755
12763
|
description: t.description,
|
|
@@ -12757,16 +12765,16 @@ function f_(e, n) {
|
|
|
12757
12765
|
};
|
|
12758
12766
|
},
|
|
12759
12767
|
afterRound() {
|
|
12760
|
-
|
|
12768
|
+
Mt(), Ft();
|
|
12761
12769
|
},
|
|
12762
12770
|
async send(e, t) {
|
|
12763
|
-
await G.initDone, t ??= {}, t?.mission &&
|
|
12771
|
+
await G.initDone, t ??= {}, t?.mission && je && x.setMission(t.mission);
|
|
12764
12772
|
let n = e;
|
|
12765
12773
|
if (t.interceptors?.input) try {
|
|
12766
12774
|
let r = t.interceptors.input(e);
|
|
12767
12775
|
typeof r == "string" && (n = r);
|
|
12768
12776
|
} catch {}
|
|
12769
|
-
let r = B ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o =
|
|
12777
|
+
let r = B ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o = xt(t.signal);
|
|
12770
12778
|
for (;;) {
|
|
12771
12779
|
a ||= (v.push({
|
|
12772
12780
|
role: "user",
|
|
@@ -12787,8 +12795,8 @@ function f_(e, n) {
|
|
|
12787
12795
|
} catch (e) {
|
|
12788
12796
|
if (Yl(e, t.signal)) throw e;
|
|
12789
12797
|
let n = Pl(e, "fatal");
|
|
12790
|
-
if (i < r &&
|
|
12791
|
-
i += 1,
|
|
12798
|
+
if (i < r && re?.canRestore()) {
|
|
12799
|
+
i += 1, re.restore(), a = !0, st({
|
|
12792
12800
|
type: "error",
|
|
12793
12801
|
message: `致命错误自动恢复(${i}/${r}):${n.message},已回退 checkpoint 重试`,
|
|
12794
12802
|
severity: "observable",
|
|
@@ -12800,7 +12808,7 @@ function f_(e, n) {
|
|
|
12800
12808
|
});
|
|
12801
12809
|
continue;
|
|
12802
12810
|
}
|
|
12803
|
-
throw
|
|
12811
|
+
throw st({
|
|
12804
12812
|
type: "error",
|
|
12805
12813
|
message: n.message,
|
|
12806
12814
|
severity: n.severity,
|
|
@@ -12812,7 +12820,7 @@ function f_(e, n) {
|
|
|
12812
12820
|
},
|
|
12813
12821
|
async batch(e, t, n) {
|
|
12814
12822
|
if (await G.initDone, !e.length) return [];
|
|
12815
|
-
let r = [], i =
|
|
12823
|
+
let r = [], i = xt(n);
|
|
12816
12824
|
for (let a = 0; a < e.length; a++) {
|
|
12817
12825
|
if (n?.aborted) {
|
|
12818
12826
|
for (let t = a; t < e.length; t++) r.push({
|
|
@@ -12824,7 +12832,7 @@ function f_(e, n) {
|
|
|
12824
12832
|
break;
|
|
12825
12833
|
}
|
|
12826
12834
|
let o = e[a];
|
|
12827
|
-
|
|
12835
|
+
re && re.save(`batch:${a}`);
|
|
12828
12836
|
let c = v.length;
|
|
12829
12837
|
try {
|
|
12830
12838
|
v.push({
|
|
@@ -12865,7 +12873,7 @@ function f_(e, n) {
|
|
|
12865
12873
|
break;
|
|
12866
12874
|
}
|
|
12867
12875
|
let s = Pl(i, "fatal");
|
|
12868
|
-
|
|
12876
|
+
st({
|
|
12869
12877
|
type: "error",
|
|
12870
12878
|
message: `批量任务 ${a + 1}/${e.length} 失败:${s.message}`,
|
|
12871
12879
|
severity: "observable",
|
|
@@ -12892,50 +12900,50 @@ function f_(e, n) {
|
|
|
12892
12900
|
async switchSession(t) {
|
|
12893
12901
|
if (await G.initDone, !s) throw Error("page-agent-sdk: storage 未开启,无法切换会话(请传 storage 选项)");
|
|
12894
12902
|
if (a.resolve("keep_external"), G.sessionId && s) {
|
|
12895
|
-
if (
|
|
12903
|
+
if (je) {
|
|
12896
12904
|
let e = x.getMission();
|
|
12897
12905
|
e && s.save(n, G.sessionId, { mission: e });
|
|
12898
12906
|
}
|
|
12899
|
-
if (
|
|
12907
|
+
if (H) {
|
|
12900
12908
|
let e = T.getWorkingMemory();
|
|
12901
12909
|
e && s.save(n, G.sessionId, { workingMemory: e });
|
|
12902
12910
|
}
|
|
12903
|
-
if (
|
|
12911
|
+
if (be) {
|
|
12904
12912
|
let e = w.getFocuses();
|
|
12905
12913
|
s.save(n, G.sessionId, { focus: e.length ? e : null });
|
|
12906
12914
|
}
|
|
12907
12915
|
}
|
|
12908
12916
|
y.flush?.(), await s.flush();
|
|
12909
12917
|
let r = t ?? "", i;
|
|
12910
|
-
return r ? (i = await s.load(n, r), i || await s.createSession(n, e.session?.title, r)) : r = await s.createSession(n, e.session?.title), G.sessionId = r, v.splice(0, v.length), y.clear?.(), b.reset([]), e.memory || E.reset(""), x.reset(), T.reset(), w.reset(),
|
|
12918
|
+
return r ? (i = await s.load(n, r), i || await s.createSession(n, e.session?.title, r)) : r = await s.createSession(n, e.session?.title), G.sessionId = r, v.splice(0, v.length), y.clear?.(), b.reset([]), e.memory || E.reset(""), x.reset(), T.reset(), w.reset(), re && re.importStack([]), G.agent.debugLogs.value = [], i ||= await s.load(n, r), i && (G.applySnapshot(i), st({
|
|
12911
12919
|
type: "session_restored",
|
|
12912
12920
|
sessionId: r,
|
|
12913
12921
|
rounds: i.messages?.length ?? 0
|
|
12914
|
-
})), e.memory && s.save(n, G.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }),
|
|
12922
|
+
})), e.memory && s.save(n, G.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), Ct(), Nt = void 0, Pt = !1, G.infoTick.value++, r;
|
|
12915
12923
|
},
|
|
12916
12924
|
resetSession: () => {
|
|
12917
|
-
|
|
12925
|
+
Dt(), a.resolve("keep_external"), G.sessionId = $m(), v.splice(0, v.length), y.clear?.(), b.reset([]), e.memory || E.reset(""), x.reset(), T.reset(), w.reset(), re && re.importStack([]), G.agent && (G.agent.debugLogs.value = []), s && s.createSession(G.agentId, e.session?.title, G.sessionId), st({
|
|
12918
12926
|
type: "session_restored",
|
|
12919
12927
|
sessionId: G.sessionId,
|
|
12920
12928
|
rounds: 0
|
|
12921
|
-
}), G.infoTick.value++,
|
|
12929
|
+
}), G.infoTick.value++, Ct(), Nt = void 0, Pt = !1;
|
|
12922
12930
|
},
|
|
12923
12931
|
stream: (e, t, n) => {
|
|
12924
12932
|
if (!G.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
12925
12933
|
y?.setProtectedRefs?.(r_(e));
|
|
12926
12934
|
let r = (e) => {
|
|
12927
|
-
t?.(e),
|
|
12935
|
+
t?.(e), st(e), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && G.infoTick.value++;
|
|
12928
12936
|
};
|
|
12929
12937
|
if (n) {
|
|
12930
12938
|
let e = () => a.resolve("keep_external");
|
|
12931
12939
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
12932
12940
|
}
|
|
12933
|
-
let { controller: i, untrack: o } =
|
|
12941
|
+
let { controller: i, untrack: o } = Et(n);
|
|
12934
12942
|
return G.agent.stream(e, r, i.signal).finally(o);
|
|
12935
12943
|
},
|
|
12936
12944
|
release() {
|
|
12937
12945
|
if (G.refCount--, G.refCount <= 0) {
|
|
12938
|
-
|
|
12946
|
+
Dt(), ge = !0, s && (y.flush?.(), s.flush(), s.dispose()), ft && ft.dispose();
|
|
12939
12947
|
let e = G.mcpClosers.splice(0);
|
|
12940
12948
|
e.length && Promise.allSettled(e.map((e) => e())), s_.delete(n);
|
|
12941
12949
|
}
|
|
@@ -12944,16 +12952,16 @@ function f_(e, n) {
|
|
|
12944
12952
|
setTools(e) {
|
|
12945
12953
|
pe.length = 0, e.forEach((e) => {
|
|
12946
12954
|
pe.push(e), V.set(e.name, "user");
|
|
12947
|
-
}),
|
|
12955
|
+
}), Oe = ke(), G.agent && G.agent.setTools(Oe), G.infoTick.value++;
|
|
12948
12956
|
},
|
|
12949
12957
|
addTool(e) {
|
|
12950
|
-
|
|
12958
|
+
Oe.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
12951
12959
|
for (let t = pe.length - 1; t >= 0; t--) pe[t].name === e.name && pe.splice(t, 1);
|
|
12952
|
-
pe.push(e), V.set(e.name, "user"),
|
|
12960
|
+
pe.push(e), V.set(e.name, "user"), Oe = ke(), G.agent && G.agent.setTools(Oe), G.infoTick.value++;
|
|
12953
12961
|
},
|
|
12954
12962
|
removeTool(e) {
|
|
12955
12963
|
let t = pe.findIndex((t) => t.name === e);
|
|
12956
|
-
return t < 0 ? !1 : (pe.splice(t, 1), V.delete(e),
|
|
12964
|
+
return t < 0 ? !1 : (pe.splice(t, 1), V.delete(e), Oe = ke(), G.agent && G.agent.setTools(Oe), G.infoTick.value++, !0);
|
|
12957
12965
|
},
|
|
12958
12966
|
setLlm(t) {
|
|
12959
12967
|
let n;
|
|
@@ -12970,7 +12978,7 @@ function f_(e, n) {
|
|
|
12970
12978
|
contextWindow: e.contextWindow ?? r?.contextWindow,
|
|
12971
12979
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens
|
|
12972
12980
|
}), f.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${f.contextWindow} 小于最小支持 ${Hl}(需 ≥200K 窗口模型)`);
|
|
12973
|
-
G.agent && (G.agent.setLlm(n), G.agent.setModelCaps?.(f)),
|
|
12981
|
+
G.agent && (G.agent.setLlm(n), G.agent.setModelCaps?.(f)), ht?.setContextWindow?.(f.contextWindow), nt?.setContextWindow?.(f.contextWindow), G.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", f);
|
|
12974
12982
|
},
|
|
12975
12983
|
setMemory(e) {
|
|
12976
12984
|
E.reset(e), typeof e == "function" && E.refresh(), G.infoTick.value++;
|
|
@@ -12979,29 +12987,29 @@ function f_(e, n) {
|
|
|
12979
12987
|
return E.refresh();
|
|
12980
12988
|
},
|
|
12981
12989
|
setSubagents(t) {
|
|
12982
|
-
if (!
|
|
12990
|
+
if (!Qe) {
|
|
12983
12991
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
12984
12992
|
return;
|
|
12985
12993
|
}
|
|
12986
|
-
|
|
12994
|
+
Qe.set(t), G.infoTick.value++;
|
|
12987
12995
|
},
|
|
12988
12996
|
addSubagent(t) {
|
|
12989
|
-
if (!
|
|
12997
|
+
if (!Qe) {
|
|
12990
12998
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
12991
12999
|
return;
|
|
12992
13000
|
}
|
|
12993
|
-
|
|
13001
|
+
Qe.add(t), G.infoTick.value++;
|
|
12994
13002
|
},
|
|
12995
13003
|
removeSubagent(t) {
|
|
12996
|
-
if (!
|
|
12997
|
-
let n =
|
|
13004
|
+
if (!Qe) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
13005
|
+
let n = Qe.remove(t);
|
|
12998
13006
|
return n && G.infoTick.value++, n;
|
|
12999
13007
|
},
|
|
13000
13008
|
getActiveSubagents() {
|
|
13001
|
-
return
|
|
13009
|
+
return Re?.getActive() ?? [];
|
|
13002
13010
|
},
|
|
13003
13011
|
get subagentHistory() {
|
|
13004
|
-
return
|
|
13012
|
+
return Re?.getHistory() ?? [];
|
|
13005
13013
|
},
|
|
13006
13014
|
getInfo() {
|
|
13007
13015
|
return {
|
|
@@ -13009,13 +13017,13 @@ function f_(e, n) {
|
|
|
13009
13017
|
sessionId: G.sessionId,
|
|
13010
13018
|
model: Hm(_) ? _.model ?? _.modelName : _.model,
|
|
13011
13019
|
systemPrompt: G.agent?.getEffectiveSystemPrompt?.() ?? oe + Wp(de(), e.schemaHint),
|
|
13012
|
-
tools: (G.agent?.allTools ??
|
|
13020
|
+
tools: (G.agent?.allTools ?? Oe).map((e) => ({
|
|
13013
13021
|
name: e.name,
|
|
13014
13022
|
description: e.description,
|
|
13015
13023
|
schema: e.schema,
|
|
13016
13024
|
source: V.get(e.name) || "user"
|
|
13017
13025
|
})),
|
|
13018
|
-
skills: (
|
|
13026
|
+
skills: (ct ? ct.controller.get() : e.skills ?? []).map((e) => ({
|
|
13019
13027
|
name: e.name,
|
|
13020
13028
|
description: e.description
|
|
13021
13029
|
})),
|
|
@@ -13030,7 +13038,7 @@ function f_(e, n) {
|
|
|
13030
13038
|
promptSoftCap: Kf(f.contextWindow, p.promptSoftCapTokens)
|
|
13031
13039
|
},
|
|
13032
13040
|
memory: E.get(),
|
|
13033
|
-
middleware:
|
|
13041
|
+
middleware: gt.map((e) => e.name),
|
|
13034
13042
|
todos: (G.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
13035
13043
|
id: e.id,
|
|
13036
13044
|
content: e.content,
|
|
@@ -13041,32 +13049,32 @@ function f_(e, n) {
|
|
|
13041
13049
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
13042
13050
|
})),
|
|
13043
13051
|
planPhase: b.getPlanPhase(),
|
|
13044
|
-
mission:
|
|
13045
|
-
workingMemory:
|
|
13046
|
-
focus:
|
|
13047
|
-
focuses:
|
|
13052
|
+
mission: je ? x.getMission() : void 0,
|
|
13053
|
+
workingMemory: H ? T.getWorkingMemory() : void 0,
|
|
13054
|
+
focus: be ? w.getFocus() : void 0,
|
|
13055
|
+
focuses: be ? w.getFocuses() : [],
|
|
13048
13056
|
trace: ae && G.agent?.spans ? {
|
|
13049
13057
|
spans: G.agent.spans.value,
|
|
13050
13058
|
metrics: ql(G.agent.spans.value)
|
|
13051
13059
|
} : void 0,
|
|
13052
13060
|
actions: Hg(e.actions ?? {}),
|
|
13053
13061
|
subagent: {
|
|
13054
|
-
enabled: !!
|
|
13062
|
+
enabled: !!Je,
|
|
13055
13063
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
13056
13064
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
13057
13065
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
13058
|
-
subagents:
|
|
13059
|
-
active:
|
|
13060
|
-
history:
|
|
13061
|
-
lockedComponents:
|
|
13066
|
+
subagents: Qe?.get() ?? [],
|
|
13067
|
+
active: Re?.getActive() ?? [],
|
|
13068
|
+
history: Re?.getHistory() ?? [],
|
|
13069
|
+
lockedComponents: Xe?.locked() ?? {}
|
|
13062
13070
|
},
|
|
13063
13071
|
verify: {
|
|
13064
|
-
enabled: !!
|
|
13065
|
-
maxAttempts:
|
|
13066
|
-
adversarial:
|
|
13072
|
+
enabled: !!tt,
|
|
13073
|
+
maxAttempts: He ? ze : 0,
|
|
13074
|
+
adversarial: He && !!e.verify?.adversarial
|
|
13067
13075
|
},
|
|
13068
13076
|
context: (() => {
|
|
13069
|
-
let e =
|
|
13077
|
+
let e = nt?.getSnapshot();
|
|
13070
13078
|
if (e) {
|
|
13071
13079
|
let t = G.agent?.getState?.()?.lastCompression;
|
|
13072
13080
|
t && (e.compression = t);
|
|
@@ -13075,55 +13083,55 @@ function f_(e, n) {
|
|
|
13075
13083
|
})(),
|
|
13076
13084
|
mcp: { servers: G.mcpServers },
|
|
13077
13085
|
lastCompression: G.agent?.getState?.()?.lastCompression,
|
|
13078
|
-
checkpoints:
|
|
13086
|
+
checkpoints: re ? {
|
|
13079
13087
|
enabled: !0,
|
|
13080
|
-
auto:
|
|
13081
|
-
list:
|
|
13088
|
+
auto: ie,
|
|
13089
|
+
list: re.list()
|
|
13082
13090
|
} : void 0
|
|
13083
13091
|
};
|
|
13084
13092
|
},
|
|
13085
13093
|
getMission() {
|
|
13086
|
-
return
|
|
13094
|
+
return je ? x.getMission() : void 0;
|
|
13087
13095
|
},
|
|
13088
13096
|
setMission(t) {
|
|
13089
|
-
if (!
|
|
13097
|
+
if (!je) {
|
|
13090
13098
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
13091
13099
|
return;
|
|
13092
13100
|
}
|
|
13093
13101
|
x.setMission(t), G.infoTick.value++;
|
|
13094
13102
|
},
|
|
13095
13103
|
getFocus() {
|
|
13096
|
-
return
|
|
13104
|
+
return be ? w.getFocus() : void 0;
|
|
13097
13105
|
},
|
|
13098
13106
|
getFocuses() {
|
|
13099
|
-
return
|
|
13107
|
+
return be ? w.getFocuses() : [];
|
|
13100
13108
|
},
|
|
13101
13109
|
setFocus(t) {
|
|
13102
|
-
let n = d_(t, "setFocus",
|
|
13110
|
+
let n = d_(t, "setFocus", be, () => de()?.schema, e.debug);
|
|
13103
13111
|
return n.ok ? (w.setFocus(t), G.infoTick.value++, { ok: !0 }) : n;
|
|
13104
13112
|
},
|
|
13105
13113
|
addFocus(t) {
|
|
13106
|
-
let n = d_(t, "addFocus",
|
|
13114
|
+
let n = d_(t, "addFocus", be, () => de()?.schema, e.debug);
|
|
13107
13115
|
return n.ok ? w.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
13108
13116
|
ok: !1,
|
|
13109
13117
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
13110
13118
|
}) : (w.addFocus(t), G.infoTick.value++, { ok: !0 }) : n;
|
|
13111
13119
|
},
|
|
13112
13120
|
removeFocus(e) {
|
|
13113
|
-
|
|
13121
|
+
be && (w.removeFocus(e), G.infoTick.value++);
|
|
13114
13122
|
},
|
|
13115
13123
|
clearFocus() {
|
|
13116
|
-
|
|
13124
|
+
be && (w.clearFocus(), G.infoTick.value++);
|
|
13117
13125
|
}
|
|
13118
13126
|
};
|
|
13119
|
-
async function
|
|
13127
|
+
async function Ot() {
|
|
13120
13128
|
if (!s) return;
|
|
13121
13129
|
await s.ready;
|
|
13122
13130
|
let t = e.session || {};
|
|
13123
13131
|
if (t.id) {
|
|
13124
13132
|
G.sessionId = t.id;
|
|
13125
13133
|
let e = await s.load(n, G.sessionId);
|
|
13126
|
-
e ? (G.applySnapshot(e),
|
|
13134
|
+
e ? (G.applySnapshot(e), st({
|
|
13127
13135
|
type: "session_restored",
|
|
13128
13136
|
sessionId: G.sessionId,
|
|
13129
13137
|
rounds: e.messages?.length ?? 0
|
|
@@ -13133,19 +13141,19 @@ function f_(e, n) {
|
|
|
13133
13141
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, r.length, r.map((e) => e.sessionId)), r.length) {
|
|
13134
13142
|
G.sessionId = r[0].sessionId;
|
|
13135
13143
|
let t = await s.load(n, G.sessionId);
|
|
13136
|
-
t ? (G.applySnapshot(t),
|
|
13144
|
+
t ? (G.applySnapshot(t), st({
|
|
13137
13145
|
type: "session_restored",
|
|
13138
13146
|
sessionId: G.sessionId,
|
|
13139
13147
|
rounds: t.messages?.length ?? 0
|
|
13140
13148
|
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", G.sessionId, `${t.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", G.sessionId);
|
|
13141
13149
|
} else G.sessionId = await s.createSession(n, t.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", G.sessionId);
|
|
13142
13150
|
} else G.sessionId = await s.createSession(n, t.title);
|
|
13143
|
-
e.memory && s.save(n, G.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }),
|
|
13151
|
+
e.memory && s.save(n, G.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), Ct();
|
|
13144
13152
|
}
|
|
13145
|
-
async function
|
|
13146
|
-
await
|
|
13153
|
+
async function kt() {
|
|
13154
|
+
await mt();
|
|
13147
13155
|
}
|
|
13148
|
-
function
|
|
13156
|
+
function At(e) {
|
|
13149
13157
|
let t = {};
|
|
13150
13158
|
for (let n of r_(e)) {
|
|
13151
13159
|
let e = y.files[n];
|
|
@@ -13153,15 +13161,15 @@ function f_(e, n) {
|
|
|
13153
13161
|
}
|
|
13154
13162
|
return t;
|
|
13155
13163
|
}
|
|
13156
|
-
function
|
|
13164
|
+
function jt() {
|
|
13157
13165
|
let e = i_(y.files, r_(v));
|
|
13158
13166
|
for (let t of e) delete y.files[t];
|
|
13159
13167
|
}
|
|
13160
|
-
function
|
|
13161
|
-
let e = Lf(v,
|
|
13168
|
+
function Mt() {
|
|
13169
|
+
let e = Lf(v, _t);
|
|
13162
13170
|
if (!e.trimmed) return;
|
|
13163
13171
|
let { older: t, summary: n } = e;
|
|
13164
|
-
if (
|
|
13172
|
+
if (st({
|
|
13165
13173
|
type: "context_trimmed",
|
|
13166
13174
|
dropped: t.map((e) => ({
|
|
13167
13175
|
round: e.round,
|
|
@@ -13169,77 +13177,81 @@ function f_(e, n) {
|
|
|
13169
13177
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
13170
13178
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
13171
13179
|
})),
|
|
13172
|
-
vfsResults:
|
|
13180
|
+
vfsResults: At(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
13173
13181
|
summary: n.content,
|
|
13174
13182
|
reason: "max_memory_rounds"
|
|
13175
|
-
}), v.splice(e.deleteFrom, e.deleteCount, n),
|
|
13183
|
+
}), v.splice(e.deleteFrom, e.deleteCount, n), jt(), m && l) {
|
|
13176
13184
|
let n = e.summary, { prevSeg: r } = e;
|
|
13177
13185
|
(async () => {
|
|
13178
13186
|
try {
|
|
13179
13187
|
let e = await l(Hf(t, g)), i = v.indexOf(n);
|
|
13180
13188
|
if (i < 0) return;
|
|
13181
|
-
v[i].content = If(t, r, e),
|
|
13189
|
+
v[i].content = If(t, r, e), Ft();
|
|
13182
13190
|
} catch {}
|
|
13183
13191
|
})();
|
|
13184
13192
|
}
|
|
13185
13193
|
}
|
|
13186
|
-
let
|
|
13187
|
-
function
|
|
13194
|
+
let Nt, Pt = !1;
|
|
13195
|
+
function Ft() {
|
|
13188
13196
|
if (!G.sessionId || !s) return;
|
|
13189
13197
|
let t = JSON.parse(JSON.stringify(v));
|
|
13190
13198
|
s.save(n, G.sessionId, { messages: t });
|
|
13191
13199
|
let r = G.agent?.getState?.()?.todos ?? [];
|
|
13192
|
-
if (s.save(n, G.sessionId, { todos: r }),
|
|
13200
|
+
if (s.save(n, G.sessionId, { todos: r }), je) {
|
|
13193
13201
|
let e = x.getMission();
|
|
13194
13202
|
e && s.save(n, G.sessionId, { mission: e });
|
|
13195
13203
|
}
|
|
13196
|
-
if (
|
|
13204
|
+
if (H) {
|
|
13197
13205
|
let e = T.getWorkingMemory();
|
|
13198
13206
|
e && s.save(n, G.sessionId, { workingMemory: e });
|
|
13199
13207
|
}
|
|
13200
|
-
if (
|
|
13208
|
+
if (be) {
|
|
13201
13209
|
let e = w.getFocuses();
|
|
13202
13210
|
s.save(n, G.sessionId, { focus: e.length ? e : null });
|
|
13203
13211
|
}
|
|
13204
|
-
B &&
|
|
13212
|
+
B && re && (s.save(n, G.sessionId, { checkpoints: re.exportStack() }), s.save(n, G.sessionId, { usage: i }));
|
|
13205
13213
|
let a = Vm(v);
|
|
13206
|
-
a && a !==
|
|
13214
|
+
a && a !== Nt && (Nt = a, s.updateTitle(n, G.sessionId, a)), e.autoTitle !== !1 && u && !Pt && v.some((e) => e.role === "user") && v.some((e) => e.role === "assistant") && (Pt = !0, (async () => {
|
|
13207
13215
|
let e = await u(v);
|
|
13208
|
-
e && (await s.updateTitle(n, G.sessionId, e), await
|
|
13216
|
+
e && (await s.updateTitle(n, G.sessionId, e), await Ct());
|
|
13209
13217
|
})()), e.debug && console.log("[page-agent-sdk][persist] save", G.sessionId, `${v.length} msgs`);
|
|
13210
13218
|
}
|
|
13211
13219
|
return G.initDone = (async () => {
|
|
13212
|
-
|
|
13213
|
-
let t = await Promise.allSettled(e.mcp.map((e) => Hp(e)));
|
|
13214
|
-
|
|
13220
|
+
await Ot(), await kt(), e.mcp?.length && (async () => {
|
|
13221
|
+
let t = await Promise.allSettled(e.mcp.map((e) => Hp(e))), n = t.flatMap((e) => e.status === "fulfilled" ? [e.value.close] : []);
|
|
13222
|
+
if (ge) {
|
|
13223
|
+
Promise.allSettled(n.map((e) => e()));
|
|
13224
|
+
return;
|
|
13225
|
+
}
|
|
13226
|
+
G.mcpClosers = n, G.mcpServers = [], t.forEach((t, n) => {
|
|
13215
13227
|
let r = e.mcp[n], i = r.name ?? r.url;
|
|
13216
13228
|
t.status === "fulfilled" ? (G.mcpServers.push({
|
|
13217
13229
|
name: i,
|
|
13218
13230
|
url: r.url,
|
|
13219
13231
|
toolCount: t.value.tools.length
|
|
13220
13232
|
}), t.value.tools.forEach((e) => V.set(e.name, `mcp:${i}`)), he.push(...t.value.tools)) : console.warn(`[page-agent-sdk][mcp] server ${i} 连接失败:`, t.reason);
|
|
13221
|
-
}),
|
|
13222
|
-
}
|
|
13233
|
+
}), he.length && (Oe = ke(), G.agent && G.agent.setTools(Oe), G.infoTick.value++), e.debug && console.log(`[page-agent-sdk][mcp] 注入 ${he.length} 个工具,${G.mcpServers.length} 个 server`);
|
|
13234
|
+
})();
|
|
13223
13235
|
let t = Hm(e.llm) ? e.llm : await C(e.llm);
|
|
13224
13236
|
G.agent = Ou({
|
|
13225
13237
|
llm: t,
|
|
13226
13238
|
systemPrompt: oe,
|
|
13227
|
-
tools:
|
|
13228
|
-
middleware:
|
|
13239
|
+
tools: Oe,
|
|
13240
|
+
middleware: gt,
|
|
13229
13241
|
maxToolRounds: e.maxToolRounds,
|
|
13230
13242
|
maxRetries: e.maxRetries,
|
|
13231
13243
|
stallMs: e.streamStallMs ?? 9e4,
|
|
13232
13244
|
maxParallelTools: e.maxParallelTools,
|
|
13233
13245
|
contextWindow: f.contextWindow,
|
|
13234
13246
|
maxOutputTokens: f.maxOutputTokens,
|
|
13235
|
-
maxVerifyAttempts:
|
|
13247
|
+
maxVerifyAttempts: He ? ze : 0,
|
|
13236
13248
|
roundTokenBudget: e.roundTokenBudget ?? 0,
|
|
13237
13249
|
onLlmChange: (e) => {
|
|
13238
13250
|
_ = e;
|
|
13239
13251
|
},
|
|
13240
13252
|
onTrace: ae ? (e, t) => {
|
|
13241
13253
|
try {
|
|
13242
|
-
|
|
13254
|
+
st({
|
|
13243
13255
|
type: "trace",
|
|
13244
13256
|
spans: e,
|
|
13245
13257
|
metrics: t
|
|
@@ -13247,8 +13259,8 @@ function f_(e, n) {
|
|
|
13247
13259
|
} catch {}
|
|
13248
13260
|
} : void 0,
|
|
13249
13261
|
debug: e.debug
|
|
13250
|
-
}), D.current = G.agent,
|
|
13251
|
-
G.agent && G.agent.setTools(
|
|
13262
|
+
}), D.current = G.agent, Ze && Ze.setReconfigureHook && Ze.setReconfigureHook(() => {
|
|
13263
|
+
G.agent && G.agent.setTools(ke());
|
|
13252
13264
|
});
|
|
13253
13265
|
})(), G;
|
|
13254
13266
|
}
|
|
@@ -15894,7 +15906,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
15894
15906
|
});
|
|
15895
15907
|
let i = y("I", "a", "is", "so", "us", "to", "at", "if", "in", "it", "on", /[A-Za-z]+['](d|ve|re|ll|t|s|n)/, /[A-Za-z]+[-][a-z]+/, /[A-Za-z][a-z]{2,}/);
|
|
15896
15908
|
return r.contains.push({ begin: _(/[ ]+/, "(", i, /[.]?[:]?([.][ ]|[ ])/, "){3}") }), r;
|
|
15897
|
-
}, ne = te("//", "$"), F = te("/\\*", "\\*/"), I = te("#", "$"),
|
|
15909
|
+
}, ne = te("//", "$"), F = te("/\\*", "\\*/"), I = te("#", "$"), re = /*#__PURE__*/ Object.freeze({
|
|
15898
15910
|
__proto__: null,
|
|
15899
15911
|
APOS_STRING_MODE: M,
|
|
15900
15912
|
BACKSLASH_ESCAPE: j,
|
|
@@ -15963,16 +15975,16 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
15963
15975
|
relevance: 0
|
|
15964
15976
|
}
|
|
15965
15977
|
});
|
|
15966
|
-
function
|
|
15978
|
+
function ie(e, t) {
|
|
15967
15979
|
e.input[e.index - 1] === "." && t.ignoreMatch();
|
|
15968
15980
|
}
|
|
15969
|
-
function
|
|
15981
|
+
function L(e, t) {
|
|
15970
15982
|
e.className !== void 0 && (e.scope = e.className, delete e.className);
|
|
15971
15983
|
}
|
|
15972
|
-
function
|
|
15973
|
-
t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin =
|
|
15984
|
+
function R(e, t) {
|
|
15985
|
+
t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = ie, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
15974
15986
|
}
|
|
15975
|
-
function
|
|
15987
|
+
function z(e, t) {
|
|
15976
15988
|
Array.isArray(e.illegal) && (e.illegal = y(...e.illegal));
|
|
15977
15989
|
}
|
|
15978
15990
|
function ae(e, t) {
|
|
@@ -16121,13 +16133,13 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
16121
16133
|
let a = n;
|
|
16122
16134
|
if (n.isCompiled) return a;
|
|
16123
16135
|
[
|
|
16124
|
-
|
|
16136
|
+
L,
|
|
16125
16137
|
ae,
|
|
16126
16138
|
be,
|
|
16127
16139
|
oe
|
|
16128
16140
|
].forEach((e) => e(n, r)), e.compilerExtensions.forEach((e) => e(n, r)), n.__beforeBegin = null, [
|
|
16141
|
+
R,
|
|
16129
16142
|
z,
|
|
16130
|
-
ie,
|
|
16131
16143
|
B
|
|
16132
16144
|
].forEach((e) => e(n, r)), n.isCompiled = !0;
|
|
16133
16145
|
let s = null;
|
|
@@ -16490,7 +16502,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
16490
16502
|
e[n] && e[n](t);
|
|
16491
16503
|
});
|
|
16492
16504
|
}
|
|
16493
|
-
function
|
|
16505
|
+
function ie(e) {
|
|
16494
16506
|
return me("10.7.0", "highlightBlock will be removed entirely in v12.0"), me("10.7.0", "Please use highlightElement now."), w(e);
|
|
16495
16507
|
}
|
|
16496
16508
|
Object.assign(e, {
|
|
@@ -16498,7 +16510,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
16498
16510
|
highlightAuto: S,
|
|
16499
16511
|
highlightAll: k,
|
|
16500
16512
|
highlightElement: w,
|
|
16501
|
-
highlightBlock:
|
|
16513
|
+
highlightBlock: ie,
|
|
16502
16514
|
configure: T,
|
|
16503
16515
|
initHighlighting: E,
|
|
16504
16516
|
initHighlightingOnLoad: D,
|
|
@@ -16522,8 +16534,8 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
16522
16534
|
optional: g,
|
|
16523
16535
|
anyNumberOfTimes: h
|
|
16524
16536
|
};
|
|
16525
|
-
for (let e in
|
|
16526
|
-
return Object.assign(e,
|
|
16537
|
+
for (let e in re) typeof re[e] == "object" && n(re[e]);
|
|
16538
|
+
return Object.assign(e, re), e;
|
|
16527
16539
|
}, je = Ae({});
|
|
16528
16540
|
je.newInstance = () => Ae({}), t.exports = je, je.HighlightJS = je, je.default = je;
|
|
16529
16541
|
})), By = /* @__PURE__ */ h(((e, t) => {
|
|
@@ -18876,7 +18888,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
18876
18888
|
3: "title.function"
|
|
18877
18889
|
},
|
|
18878
18890
|
contains: [{ begin: /\(\)/ }, k]
|
|
18879
|
-
}, I = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>",
|
|
18891
|
+
}, I = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", re = {
|
|
18880
18892
|
match: [
|
|
18881
18893
|
/const|var|let/,
|
|
18882
18894
|
/\s+/,
|
|
@@ -18929,7 +18941,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
18929
18941
|
match: d + t.lookahead(":"),
|
|
18930
18942
|
relevance: 0
|
|
18931
18943
|
},
|
|
18932
|
-
|
|
18944
|
+
re,
|
|
18933
18945
|
{
|
|
18934
18946
|
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
18935
18947
|
keywords: "return throw case",
|
|
@@ -21310,7 +21322,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21310
21322
|
begin: i(e, /"/),
|
|
21311
21323
|
end: i(/"/, e),
|
|
21312
21324
|
contains: [P(e), ne(e)]
|
|
21313
|
-
}),
|
|
21325
|
+
}), re = {
|
|
21314
21326
|
className: "string",
|
|
21315
21327
|
variants: [
|
|
21316
21328
|
F(),
|
|
@@ -21322,33 +21334,33 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21322
21334
|
I("##"),
|
|
21323
21335
|
I("###")
|
|
21324
21336
|
]
|
|
21325
|
-
},
|
|
21337
|
+
}, ie = [e.BACKSLASH_ESCAPE, {
|
|
21326
21338
|
begin: /\[/,
|
|
21327
21339
|
end: /\]/,
|
|
21328
21340
|
relevance: 0,
|
|
21329
21341
|
contains: [e.BACKSLASH_ESCAPE]
|
|
21330
|
-
}],
|
|
21342
|
+
}], L = {
|
|
21331
21343
|
begin: /\/[^\s](?=[^/\n]*\/)/,
|
|
21332
21344
|
end: /\//,
|
|
21333
|
-
contains:
|
|
21334
|
-
},
|
|
21345
|
+
contains: ie
|
|
21346
|
+
}, R = (e) => {
|
|
21335
21347
|
let t = i(e, /\//), n = i(/\//, e);
|
|
21336
21348
|
return {
|
|
21337
21349
|
begin: t,
|
|
21338
21350
|
end: n,
|
|
21339
|
-
contains: [...
|
|
21351
|
+
contains: [...ie, {
|
|
21340
21352
|
scope: "comment",
|
|
21341
21353
|
begin: `#(?!.*${n})`,
|
|
21342
21354
|
end: /$/
|
|
21343
21355
|
}]
|
|
21344
21356
|
};
|
|
21345
|
-
},
|
|
21357
|
+
}, z = {
|
|
21346
21358
|
scope: "regexp",
|
|
21347
21359
|
variants: [
|
|
21348
|
-
|
|
21349
|
-
|
|
21350
|
-
|
|
21351
|
-
|
|
21360
|
+
R("###"),
|
|
21361
|
+
R("##"),
|
|
21362
|
+
R("#"),
|
|
21363
|
+
L
|
|
21352
21364
|
]
|
|
21353
21365
|
}, ae = { match: i(/`/, x, /`/) }, B = [
|
|
21354
21366
|
ae,
|
|
@@ -21371,7 +21383,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21371
21383
|
contains: [
|
|
21372
21384
|
...ee,
|
|
21373
21385
|
N,
|
|
21374
|
-
|
|
21386
|
+
re
|
|
21375
21387
|
]
|
|
21376
21388
|
}] }
|
|
21377
21389
|
},
|
|
@@ -21435,12 +21447,12 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21435
21447
|
relevance: 0
|
|
21436
21448
|
},
|
|
21437
21449
|
...a,
|
|
21438
|
-
|
|
21450
|
+
z,
|
|
21439
21451
|
...O,
|
|
21440
21452
|
...k,
|
|
21441
21453
|
...ee,
|
|
21442
21454
|
N,
|
|
21443
|
-
|
|
21455
|
+
re,
|
|
21444
21456
|
...B,
|
|
21445
21457
|
...oe,
|
|
21446
21458
|
se
|
|
@@ -21471,7 +21483,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21471
21483
|
...O,
|
|
21472
21484
|
...ee,
|
|
21473
21485
|
N,
|
|
21474
|
-
|
|
21486
|
+
re,
|
|
21475
21487
|
...oe,
|
|
21476
21488
|
se,
|
|
21477
21489
|
le
|
|
@@ -21576,7 +21588,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21576
21588
|
}
|
|
21577
21589
|
]
|
|
21578
21590
|
};
|
|
21579
|
-
for (let e of
|
|
21591
|
+
for (let e of re.variants) {
|
|
21580
21592
|
let t = e.contains.find((e) => e.label === "interpol");
|
|
21581
21593
|
t.keywords = D;
|
|
21582
21594
|
let n = [
|
|
@@ -21584,7 +21596,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21584
21596
|
...k,
|
|
21585
21597
|
...ee,
|
|
21586
21598
|
N,
|
|
21587
|
-
|
|
21599
|
+
re,
|
|
21588
21600
|
...B
|
|
21589
21601
|
];
|
|
21590
21602
|
t.contains = [...n, {
|
|
@@ -21611,12 +21623,12 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
21611
21623
|
contains: [...a],
|
|
21612
21624
|
relevance: 0
|
|
21613
21625
|
},
|
|
21614
|
-
|
|
21626
|
+
z,
|
|
21615
21627
|
...O,
|
|
21616
21628
|
...k,
|
|
21617
21629
|
...ee,
|
|
21618
21630
|
N,
|
|
21619
|
-
|
|
21631
|
+
re,
|
|
21620
21632
|
...B,
|
|
21621
21633
|
...oe,
|
|
21622
21634
|
se,
|
|
@@ -22049,7 +22061,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
22049
22061
|
3: "title.function"
|
|
22050
22062
|
},
|
|
22051
22063
|
contains: [{ begin: /\(\)/ }, k]
|
|
22052
|
-
}, I = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>",
|
|
22064
|
+
}, I = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", re = {
|
|
22053
22065
|
match: [
|
|
22054
22066
|
/const|var|let/,
|
|
22055
22067
|
/\s+/,
|
|
@@ -22102,7 +22114,7 @@ var zy = /* @__PURE__ */ h(((e, t) => {
|
|
|
22102
22114
|
match: d + t.lookahead(":"),
|
|
22103
22115
|
relevance: 0
|
|
22104
22116
|
},
|
|
22105
|
-
|
|
22117
|
+
re,
|
|
22106
22118
|
{
|
|
22107
22119
|
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
22108
22120
|
keywords: "return throw case",
|
|
@@ -22706,7 +22718,7 @@ function Wx() {
|
|
|
22706
22718
|
return T ||= (w = Vx(u, i), !0), w;
|
|
22707
22719
|
}, ee = n, j = ee.implementation, M = ee.createNodeIterator, N = ee.createDocumentFragment, P = ee.getElementsByTagName, te = r.importNode, ne = Hx();
|
|
22708
22720
|
t.isSupported = typeof kb == "function" && typeof g == "function" && j && j.createHTMLDocument !== void 0;
|
|
22709
|
-
let F = Tx, I = Ex,
|
|
22721
|
+
let F = Tx, I = Ex, re = Dx, ie = Ox, L = kx, R = jx, z = Mx, ae = Px, B = Ax, oe = null, se = cx({}, [
|
|
22710
22722
|
...mx,
|
|
22711
22723
|
...hx,
|
|
22712
22724
|
...gx,
|
|
@@ -22939,7 +22951,7 @@ function Wx() {
|
|
|
22939
22951
|
let t = x ? x(e) : e.ownerDocument;
|
|
22940
22952
|
return M.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
22941
22953
|
}, ht = function(e) {
|
|
22942
|
-
return e = Yb(e, F, " "), e = Yb(e, I, " "), e = Yb(e,
|
|
22954
|
+
return e = Yb(e, F, " "), e = Yb(e, I, " "), e = Yb(e, re, " "), e;
|
|
22943
22955
|
}, gt = function(e) {
|
|
22944
22956
|
e.normalize();
|
|
22945
22957
|
let t = x ? x(e) : e.ownerDocument, n = M.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
@@ -22974,7 +22986,7 @@ function Wx() {
|
|
|
22974
22986
|
let xt = function(e, t) {
|
|
22975
22987
|
return !!(ve && e.hasChildNodes() && !yt(e.firstElementChild) && ix(Fx, e.textContent) && ix(Fx, e.innerHTML) || ve && e.namespaceURI === Be && t === "style" && yt(e.firstElementChild) || e.nodeType === zx.processingInstruction || ve && e.nodeType === zx.comment && ix(Ix, e.data));
|
|
22976
22988
|
}, St = function(e, t, n) {
|
|
22977
|
-
if (!de[t] &&
|
|
22989
|
+
if (!de[t] && Dt(t) && (ue.tagNameCheck instanceof RegExp && ix(ue.tagNameCheck, t) || ue.tagNameCheck instanceof Function && ue.tagNameCheck(t))) return !1;
|
|
22978
22990
|
if (Ae && !Me[t]) {
|
|
22979
22991
|
let t = g(e), r = h(e);
|
|
22980
22992
|
if (r && t) {
|
|
@@ -23010,10 +23022,10 @@ function Wx() {
|
|
|
23010
23022
|
}, Tt = function(e, t, r) {
|
|
23011
23023
|
if (V[t] || ve && t === "patchsrc" || ve && t === "for" && e !== "label" && e !== "output" || De && (t === "id" || t === "name") && (r in n || r in Qe)) return !1;
|
|
23012
23024
|
let i = ce[t] || fe.attributeCheck instanceof Function && fe.attributeCheck(t, e);
|
|
23013
|
-
if (!(me && ix(
|
|
23025
|
+
if (!(me && ix(ie, t)) && !(pe && ix(L, t))) {
|
|
23014
23026
|
if (!i) {
|
|
23015
|
-
if (!(
|
|
23016
|
-
} else if (!Ie[t] && !ix(B, Yb(r,
|
|
23027
|
+
if (!(Dt(e) && (ue.tagNameCheck instanceof RegExp && ix(ue.tagNameCheck, e) || ue.tagNameCheck instanceof Function && ue.tagNameCheck(e)) && (ue.attributeNameCheck instanceof RegExp && ix(ue.attributeNameCheck, t) || ue.attributeNameCheck instanceof Function && ue.attributeNameCheck(t, e)) || t === "is" && ue.allowCustomizedBuiltInElements && (ue.tagNameCheck instanceof RegExp && ix(ue.tagNameCheck, r) || ue.tagNameCheck instanceof Function && ue.tagNameCheck(r)))) return !1;
|
|
23028
|
+
} else if (!Ie[t] && !ix(B, Yb(r, z, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Xb(r, "data:") === 0 && Pe[e]) && !(he && !ix(R, Yb(r, z, ""))) && r) return !1;
|
|
23017
23029
|
}
|
|
23018
23030
|
return !0;
|
|
23019
23031
|
}, Et = cx({}, [
|
|
@@ -23025,9 +23037,9 @@ function Wx() {
|
|
|
23025
23037
|
"font-face-src",
|
|
23026
23038
|
"font-face-uri",
|
|
23027
23039
|
"missing-glyph"
|
|
23028
|
-
]),
|
|
23040
|
+
]), Dt = function(e) {
|
|
23029
23041
|
return !Et[Kb(e)] && ix(ae, e);
|
|
23030
|
-
},
|
|
23042
|
+
}, G = function(e, t, n, r) {
|
|
23031
23043
|
if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
23032
23044
|
case "TrustedHTML": return O(r);
|
|
23033
23045
|
case "TrustedScriptURL": return k(r);
|
|
@@ -23074,7 +23086,7 @@ function Wx() {
|
|
|
23074
23086
|
lt(o, e);
|
|
23075
23087
|
continue;
|
|
23076
23088
|
}
|
|
23077
|
-
d =
|
|
23089
|
+
d = G(i, l, s, d), d !== u && Ot(e, o, s, d);
|
|
23078
23090
|
}
|
|
23079
23091
|
}
|
|
23080
23092
|
bt(ne.afterSanitizeAttributes, e, null);
|
|
@@ -24403,17 +24415,17 @@ app.mount('#app');
|
|
|
24403
24415
|
color: "#dc2626"
|
|
24404
24416
|
}
|
|
24405
24417
|
}, I = /* @__PURE__ */ Sn(/* @__PURE__ */ new Set());
|
|
24406
|
-
function
|
|
24418
|
+
function re(e) {
|
|
24407
24419
|
let t = new Set(I.value);
|
|
24408
24420
|
t.has(e) ? t.delete(e) : t.add(e), I.value = t;
|
|
24409
24421
|
}
|
|
24410
|
-
function
|
|
24422
|
+
function ie(e) {
|
|
24411
24423
|
return e === "round" ? "🔄" : e === "model" ? "🧠" : e === "tool" ? "🔧" : e === "compression" ? "📦" : "•";
|
|
24412
24424
|
}
|
|
24413
|
-
function
|
|
24425
|
+
function L(e) {
|
|
24414
24426
|
return `${e.windowRatio == null ? `keepRounds=${e.keepRounds ?? "?"}` : `windowRatio=${e.windowRatio}`} · ${e.summarize.mode}摘要 · 召回${e.recallTopK ?? "?"}${e.reason ? " · " + e.reason : ""}`;
|
|
24415
24427
|
}
|
|
24416
|
-
function
|
|
24428
|
+
function R(e) {
|
|
24417
24429
|
let t = e.data || {};
|
|
24418
24430
|
switch (e.type) {
|
|
24419
24431
|
case "context": return `${t.tools?.length ?? 0} 工具 · ${t.totalMessages ?? 0} 消息`;
|
|
@@ -24488,7 +24500,7 @@ app.mount('#app');
|
|
|
24488
24500
|
key: e.id,
|
|
24489
24501
|
class: H(["trace-span", [e.type, e.status]])
|
|
24490
24502
|
}, [
|
|
24491
|
-
Z("span", $C, U(
|
|
24503
|
+
Z("span", $C, U(ie(e.type)), 1),
|
|
24492
24504
|
Z("span", ew, U(e.name), 1),
|
|
24493
24505
|
e.durationMs ? (Y(), X("span", tw, U(A(e.durationMs)), 1)) : Q("", !0),
|
|
24494
24506
|
e.status === "error" ? (Y(), X("span", nw, "❌")) : Q("", !0)
|
|
@@ -24533,7 +24545,7 @@ app.mount('#app');
|
|
|
24533
24545
|
Z("span", vw, "摘要 " + U(M.value.compression.roundsSummarized) + "/" + U(M.value.compression.roundsTotal) + " 轮", 1),
|
|
24534
24546
|
Z("span", yw, "召回 " + U(M.value.compression.roundsRecalled), 1),
|
|
24535
24547
|
Z("span", bw, U(M.value.compression.strategy), 1),
|
|
24536
|
-
M.value.compression.decision ? (Y(), X("span", xw, "🤖 agent 决策:" + U(
|
|
24548
|
+
M.value.compression.decision ? (Y(), X("span", xw, "🤖 agent 决策:" + U(L(M.value.compression.decision)), 1)) : Q("", !0)
|
|
24537
24549
|
])])) : Q("", !0)
|
|
24538
24550
|
], 64)) : (Y(), X("div", iw, "未开启 contextInspector(默认开)或暂无快照。跑一轮 agent 后切回刷新。"))])) : Q("", !0),
|
|
24539
24551
|
y.value === "subagent" ? (Y(), X("div", Sw, [ne.value.length ? (Y(), X("div", Cw, [Z("div", ww, "🔒 组件锁 (" + U(ne.value.length) + ")", 1), (Y(!0), X(J, null, oa(ne.value, ([e, t]) => (Y(), X("div", {
|
|
@@ -24569,7 +24581,7 @@ app.mount('#app');
|
|
|
24569
24581
|
e.steps.length ? (Y(), X("button", {
|
|
24570
24582
|
key: 1,
|
|
24571
24583
|
class: "sub-toggle",
|
|
24572
|
-
onClick: (e) =>
|
|
24584
|
+
onClick: (e) => re(t)
|
|
24573
24585
|
}, U(I.value.has(t) ? "收起" : "步骤"), 9, Lw)) : Q("", !0)
|
|
24574
24586
|
]),
|
|
24575
24587
|
Z("div", Rw, U(k(e.task, 80)), 1),
|
|
@@ -24666,7 +24678,7 @@ app.mount('#app');
|
|
|
24666
24678
|
}, [
|
|
24667
24679
|
Z("span", GT, U(s[e.type]?.icon), 1),
|
|
24668
24680
|
Z("span", KT, U(s[e.type]?.label), 1),
|
|
24669
|
-
Z("span", qT, U(
|
|
24681
|
+
Z("span", qT, U(R(e)), 1),
|
|
24670
24682
|
Z("span", JT, U(d(e.timestamp)), 1)
|
|
24671
24683
|
], 2))), 128))])) : Q("", !0),
|
|
24672
24684
|
(Y(!0), X(J, null, oa(O.value.rounds, (e) => (Y(), X("div", {
|
|
@@ -24678,7 +24690,7 @@ app.mount('#app');
|
|
|
24678
24690
|
}, [
|
|
24679
24691
|
Z("span", ZT, U(s[e.type]?.icon), 1),
|
|
24680
24692
|
Z("span", QT, U(s[e.type]?.label), 1),
|
|
24681
|
-
Z("span", $T, U(
|
|
24693
|
+
Z("span", $T, U(R(e)), 1),
|
|
24682
24694
|
Z("span", eE, U(d(e.timestamp)), 1)
|
|
24683
24695
|
], 2))), 128))])]))), 128))
|
|
24684
24696
|
], 64)) : (Y(), X("div", tE, [b.value ? (Y(), X(J, { key: 1 }, [
|
|
@@ -24741,7 +24753,7 @@ app.mount('#app');
|
|
|
24741
24753
|
Z("div", fD, [n[45] ||= Z("span", { class: "k" }, "召回", -1), Z("span", pD, U(b.value.lastCompression.roundsRecalled) + " 条", 1)]),
|
|
24742
24754
|
Z("div", mD, [n[46] ||= Z("span", { class: "k" }, "消息数", -1), Z("span", hD, U(b.value.lastCompression.originalMessages) + " → " + U(b.value.lastCompression.compressedMessages), 1)]),
|
|
24743
24755
|
Z("div", gD, [n[47] ||= Z("span", { class: "k" }, "策略", -1), Z("span", _D, U(b.value.lastCompression.strategy), 1)]),
|
|
24744
|
-
b.value.lastCompression.decision ? (Y(), X("div", vD, [n[48] ||= Z("span", { class: "k" }, "压缩决策", -1), Z("span", yD, "🤖 " + U(
|
|
24756
|
+
b.value.lastCompression.decision ? (Y(), X("div", vD, [n[48] ||= Z("span", { class: "k" }, "压缩决策", -1), Z("span", yD, "🤖 " + U(L(b.value.lastCompression.decision)), 1)])) : Q("", !0)
|
|
24745
24757
|
])])) : Q("", !0)
|
|
24746
24758
|
], 64)) : (Y(), X("div", nE, "暂无信息"))]))
|
|
24747
24759
|
])
|