page-agent-sdk 2.40.0 → 2.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/dist/page-agent-sdk.headless.js +1005 -995
- package/dist/page-agent-sdk.iife.js +142 -141
- package/dist/page-agent-sdk.js +3187 -3152
- package/dist/page-agent-sdk.umd.cjs +93 -92
- package/package.json +1 -1
- package/types/headless.d.ts +6 -0
- package/types/index.d.ts +12 -0
|
@@ -129,39 +129,39 @@ var y = () => {}, b = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110
|
|
|
129
129
|
}, w = Object.prototype.hasOwnProperty, T = (e, t) => w.call(e, t), E = Array.isArray, ee = (e) => ne(e) === "[object Map]", D = (e) => ne(e) === "[object Set]", O = (e) => typeof e == "function", k = (e) => typeof e == "string", A = (e) => typeof e == "symbol", j = (e) => typeof e == "object" && !!e, M = (e) => (j(e) || O(e)) && O(e.then) && O(e.catch), te = Object.prototype.toString, ne = (e) => te.call(e), N = (e) => ne(e).slice(8, -1), P = (e) => ne(e) === "[object Object]", re = (e) => k(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, ie = ((e) => {
|
|
130
130
|
let t = /* @__PURE__ */ Object.create(null);
|
|
131
131
|
return ((n) => t[n] || (t[n] = e(n)));
|
|
132
|
-
})((e) => e.charAt(0).toUpperCase() + e.slice(1)),
|
|
132
|
+
})((e) => e.charAt(0).toUpperCase() + e.slice(1)), ae = (e, t) => !Object.is(e, t), F = (e, t, n, r = !1) => {
|
|
133
133
|
Object.defineProperty(e, t, {
|
|
134
134
|
configurable: !0,
|
|
135
135
|
enumerable: !1,
|
|
136
136
|
writable: r,
|
|
137
137
|
value: n
|
|
138
138
|
});
|
|
139
|
-
},
|
|
140
|
-
function
|
|
139
|
+
}, oe, I = () => oe ||= typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
140
|
+
function L(e) {
|
|
141
141
|
if (E(e)) {
|
|
142
142
|
let t = {};
|
|
143
143
|
for (let n = 0; n < e.length; n++) {
|
|
144
|
-
let r = e[n], i = k(r) ?
|
|
144
|
+
let r = e[n], i = k(r) ? R(r) : L(r);
|
|
145
145
|
if (i) for (let e in i) t[e] = i[e];
|
|
146
146
|
}
|
|
147
147
|
return t;
|
|
148
148
|
} else if (k(e) || j(e)) return e;
|
|
149
149
|
}
|
|
150
|
-
var
|
|
151
|
-
function
|
|
150
|
+
var se = /;(?![^(]*\))/g, ce = /:([^]+)/, le = /\/\*[^]*?\*\//g;
|
|
151
|
+
function R(e) {
|
|
152
152
|
let t = {};
|
|
153
|
-
return e.replace(
|
|
153
|
+
return e.replace(le, "").split(se).forEach((e) => {
|
|
154
154
|
if (e) {
|
|
155
|
-
let n = e.split(
|
|
155
|
+
let n = e.split(ce);
|
|
156
156
|
n.length > 1 && (t[n[0].trim()] = n[1].trim());
|
|
157
157
|
}
|
|
158
158
|
}), t;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function ue(e) {
|
|
161
161
|
let t = "";
|
|
162
162
|
if (k(e)) t = e;
|
|
163
163
|
else if (E(e)) for (let n = 0; n < e.length; n++) {
|
|
164
|
-
let r =
|
|
164
|
+
let r = ue(e[n]);
|
|
165
165
|
r && (t += r + " ");
|
|
166
166
|
}
|
|
167
167
|
else if (j(e)) for (let n in e) e[n] && (t += n + " ");
|
|
@@ -169,76 +169,76 @@ function le(e) {
|
|
|
169
169
|
}
|
|
170
170
|
//#endregion
|
|
171
171
|
//#region node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
172
|
-
function
|
|
172
|
+
function de(e, ...t) {
|
|
173
173
|
console.warn(`[Vue warn] ${e}`, ...t);
|
|
174
174
|
}
|
|
175
|
-
var
|
|
176
|
-
function
|
|
177
|
-
return
|
|
175
|
+
var fe;
|
|
176
|
+
function pe() {
|
|
177
|
+
return fe;
|
|
178
178
|
}
|
|
179
|
-
var
|
|
179
|
+
var z, me = /* @__PURE__ */ new WeakSet(), he = class {
|
|
180
180
|
constructor(e) {
|
|
181
|
-
this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0,
|
|
181
|
+
this.fn = e, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0, fe && (fe.active ? fe.effects.push(this) : this.flags &= -2);
|
|
182
182
|
}
|
|
183
183
|
pause() {
|
|
184
184
|
this.flags |= 64;
|
|
185
185
|
}
|
|
186
186
|
resume() {
|
|
187
|
-
this.flags & 64 && (this.flags &= -65,
|
|
187
|
+
this.flags & 64 && (this.flags &= -65, me.has(this) && (me.delete(this), this.trigger()));
|
|
188
188
|
}
|
|
189
189
|
notify() {
|
|
190
|
-
this.flags & 2 && !(this.flags & 32) || this.flags & 8 ||
|
|
190
|
+
this.flags & 2 && !(this.flags & 32) || this.flags & 8 || ve(this);
|
|
191
191
|
}
|
|
192
192
|
run() {
|
|
193
193
|
if (!(this.flags & 1)) return this.fn();
|
|
194
|
-
this.flags |= 2,
|
|
195
|
-
let e =
|
|
196
|
-
|
|
194
|
+
this.flags |= 2, Ae(this), be(this);
|
|
195
|
+
let e = z, t = Ee;
|
|
196
|
+
z = this, Ee = !0;
|
|
197
197
|
try {
|
|
198
198
|
return this.fn();
|
|
199
199
|
} finally {
|
|
200
|
-
process.env.NODE_ENV !== "production" &&
|
|
200
|
+
process.env.NODE_ENV !== "production" && z !== this && de("Active effect was not restored correctly - this is likely a Vue internal bug."), xe(this), z = e, Ee = t, this.flags &= -3;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
stop() {
|
|
204
204
|
if (this.flags & 1) {
|
|
205
|
-
for (let e = this.deps; e; e = e.nextDep)
|
|
206
|
-
this.deps = this.depsTail = void 0,
|
|
205
|
+
for (let e = this.deps; e; e = e.nextDep) we(e);
|
|
206
|
+
this.deps = this.depsTail = void 0, Ae(this), this.onStop && this.onStop(), this.flags &= -2;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
trigger() {
|
|
210
|
-
this.flags & 64 ?
|
|
210
|
+
this.flags & 64 ? me.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
|
|
211
211
|
}
|
|
212
212
|
runIfDirty() {
|
|
213
|
-
|
|
213
|
+
Se(this) && this.run();
|
|
214
214
|
}
|
|
215
215
|
get dirty() {
|
|
216
|
-
return
|
|
216
|
+
return Se(this);
|
|
217
217
|
}
|
|
218
|
-
},
|
|
219
|
-
function
|
|
218
|
+
}, ge = 0, _e, B;
|
|
219
|
+
function ve(e, t = !1) {
|
|
220
220
|
if (e.flags |= 8, t) {
|
|
221
|
-
e.next =
|
|
221
|
+
e.next = B, B = e;
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
e.next =
|
|
224
|
+
e.next = _e, _e = e;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
|
|
226
|
+
function V() {
|
|
227
|
+
ge++;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
if (--
|
|
231
|
-
if (
|
|
232
|
-
let e =
|
|
233
|
-
for (
|
|
229
|
+
function ye() {
|
|
230
|
+
if (--ge > 0) return;
|
|
231
|
+
if (B) {
|
|
232
|
+
let e = B;
|
|
233
|
+
for (B = void 0; e;) {
|
|
234
234
|
let t = e.next;
|
|
235
235
|
e.next = void 0, e.flags &= -9, e = t;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
let e;
|
|
239
|
-
for (;
|
|
240
|
-
let t =
|
|
241
|
-
for (
|
|
239
|
+
for (; _e;) {
|
|
240
|
+
let t = _e;
|
|
241
|
+
for (_e = void 0; t;) {
|
|
242
242
|
let n = t.next;
|
|
243
243
|
if (t.next = void 0, t.flags &= -9, t.flags & 1) try {
|
|
244
244
|
t.trigger();
|
|
@@ -250,127 +250,127 @@ function ve() {
|
|
|
250
250
|
}
|
|
251
251
|
if (e) throw e;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function be(e) {
|
|
254
254
|
for (let t = e.deps; t; t = t.nextDep) t.version = -1, t.prevActiveLink = t.dep.activeLink, t.dep.activeLink = t;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function xe(e) {
|
|
257
257
|
let t, n = e.depsTail, r = n;
|
|
258
258
|
for (; r;) {
|
|
259
259
|
let e = r.prevDep;
|
|
260
|
-
r.version === -1 ? (r === n && (n = e),
|
|
260
|
+
r.version === -1 ? (r === n && (n = e), we(r), Te(r)) : t = r, r.dep.activeLink = r.prevActiveLink, r.prevActiveLink = void 0, r = e;
|
|
261
261
|
}
|
|
262
262
|
e.deps = t, e.depsTail = n;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (
|
|
264
|
+
function Se(e) {
|
|
265
|
+
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (Ce(t.dep.computed) || t.dep.version !== t.version)) return !0;
|
|
266
266
|
return !!e._dirty;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion ===
|
|
268
|
+
function Ce(e) {
|
|
269
|
+
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion === je) || (e.globalVersion = je, !e.isSSR && e.flags & 128 && (!e.deps && !e._dirty || !Se(e)))) return;
|
|
270
270
|
e.flags |= 2;
|
|
271
|
-
let t = e.dep, n =
|
|
272
|
-
|
|
271
|
+
let t = e.dep, n = z, r = Ee;
|
|
272
|
+
z = e, Ee = !0;
|
|
273
273
|
try {
|
|
274
|
-
|
|
274
|
+
be(e);
|
|
275
275
|
let n = e.fn(e._value);
|
|
276
|
-
(t.version === 0 ||
|
|
276
|
+
(t.version === 0 || ae(n, e._value)) && (e.flags |= 128, e._value = n, t.version++);
|
|
277
277
|
} catch (e) {
|
|
278
278
|
throw t.version++, e;
|
|
279
279
|
} finally {
|
|
280
|
-
|
|
280
|
+
z = n, Ee = r, xe(e), e.flags &= -3;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function we(e, t = !1) {
|
|
284
284
|
let { dep: n, prevSub: r, nextSub: i } = e;
|
|
285
285
|
if (r && (r.nextSub = i, e.prevSub = void 0), i && (i.prevSub = r, e.nextSub = void 0), process.env.NODE_ENV !== "production" && n.subsHead === e && (n.subsHead = i), n.subs === e && (n.subs = r, !r && n.computed)) {
|
|
286
286
|
n.computed.flags &= -5;
|
|
287
|
-
for (let e = n.computed.deps; e; e = e.nextDep)
|
|
287
|
+
for (let e = n.computed.deps; e; e = e.nextDep) we(e, !0);
|
|
288
288
|
}
|
|
289
289
|
!t && !--n.sc && n.map && n.map.delete(n.key);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Te(e) {
|
|
292
292
|
let { prevDep: t, nextDep: n } = e;
|
|
293
293
|
t && (t.nextDep = n, e.prevDep = void 0), n && (n.prevDep = t, e.nextDep = void 0);
|
|
294
294
|
}
|
|
295
|
-
var
|
|
296
|
-
function De() {
|
|
297
|
-
Ee.push(Te), Te = !1;
|
|
298
|
-
}
|
|
295
|
+
var Ee = !0, De = [];
|
|
299
296
|
function Oe() {
|
|
300
|
-
|
|
301
|
-
|
|
297
|
+
De.push(Ee), Ee = !1;
|
|
298
|
+
}
|
|
299
|
+
function ke() {
|
|
300
|
+
let e = De.pop();
|
|
301
|
+
Ee = e === void 0 || e;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Ae(e) {
|
|
304
304
|
let { cleanup: t } = e;
|
|
305
305
|
if (e.cleanup = void 0, t) {
|
|
306
|
-
let e =
|
|
307
|
-
|
|
306
|
+
let e = z;
|
|
307
|
+
z = void 0;
|
|
308
308
|
try {
|
|
309
309
|
t();
|
|
310
310
|
} finally {
|
|
311
|
-
|
|
311
|
+
z = e;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
var
|
|
315
|
+
var je = 0, Me = class {
|
|
316
316
|
constructor(e, t) {
|
|
317
317
|
this.sub = e, this.dep = t, this.version = t.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
318
318
|
}
|
|
319
|
-
},
|
|
319
|
+
}, Ne = class {
|
|
320
320
|
constructor(e) {
|
|
321
321
|
this.computed = e, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, this.__v_skip = !0, process.env.NODE_ENV !== "production" && (this.subsHead = void 0);
|
|
322
322
|
}
|
|
323
323
|
track(e) {
|
|
324
|
-
if (!
|
|
324
|
+
if (!z || !Ee || z === this.computed) return;
|
|
325
325
|
let t = this.activeLink;
|
|
326
|
-
if (t === void 0 || t.sub !==
|
|
326
|
+
if (t === void 0 || t.sub !== z) t = this.activeLink = new Me(z, this), z.deps ? (t.prevDep = z.depsTail, z.depsTail.nextDep = t, z.depsTail = t) : z.deps = z.depsTail = t, Pe(t);
|
|
327
327
|
else if (t.version === -1 && (t.version = this.version, t.nextDep)) {
|
|
328
328
|
let e = t.nextDep;
|
|
329
|
-
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep =
|
|
329
|
+
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep = z.depsTail, t.nextDep = void 0, z.depsTail.nextDep = t, z.depsTail = t, z.deps === t && (z.deps = e);
|
|
330
330
|
}
|
|
331
|
-
return process.env.NODE_ENV !== "production" &&
|
|
331
|
+
return process.env.NODE_ENV !== "production" && z.onTrack && z.onTrack(S({ effect: z }, e)), t;
|
|
332
332
|
}
|
|
333
333
|
trigger(e) {
|
|
334
|
-
this.version++,
|
|
334
|
+
this.version++, je++, this.notify(e);
|
|
335
335
|
}
|
|
336
336
|
notify(e) {
|
|
337
|
-
|
|
337
|
+
V();
|
|
338
338
|
try {
|
|
339
339
|
if (process.env.NODE_ENV !== "production") for (let t = this.subsHead; t; t = t.nextSub) t.sub.onTrigger && !(t.sub.flags & 8) && t.sub.onTrigger(S({ effect: t.sub }, e));
|
|
340
340
|
for (let e = this.subs; e; e = e.prevSub) e.sub.notify() && e.sub.dep.notify();
|
|
341
341
|
} finally {
|
|
342
|
-
|
|
342
|
+
ye();
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
|
-
function
|
|
346
|
+
function Pe(e) {
|
|
347
347
|
if (e.dep.sc++, e.sub.flags & 4) {
|
|
348
348
|
let t = e.dep.computed;
|
|
349
349
|
if (t && !e.dep.subs) {
|
|
350
350
|
t.flags |= 20;
|
|
351
|
-
for (let e = t.deps; e; e = e.nextDep)
|
|
351
|
+
for (let e = t.deps; e; e = e.nextDep) Pe(e);
|
|
352
352
|
}
|
|
353
353
|
let n = e.dep.subs;
|
|
354
354
|
n !== e && (e.prevSub = n, n && (n.nextSub = e)), process.env.NODE_ENV !== "production" && e.dep.subsHead === void 0 && (e.dep.subsHead = e), e.dep.subs = e;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
var
|
|
358
|
-
function
|
|
359
|
-
if (
|
|
360
|
-
let r =
|
|
361
|
-
r ||
|
|
357
|
+
var Fe = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Object iterate"), Le = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Map keys iterate"), Re = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Array iterate");
|
|
358
|
+
function H(e, t, n) {
|
|
359
|
+
if (Ee && z) {
|
|
360
|
+
let r = Fe.get(e);
|
|
361
|
+
r || Fe.set(e, r = /* @__PURE__ */ new Map());
|
|
362
362
|
let i = r.get(n);
|
|
363
|
-
i || (r.set(n, i = new
|
|
363
|
+
i || (r.set(n, i = new Ne()), i.map = r, i.key = n), process.env.NODE_ENV === "production" ? i.track() : i.track({
|
|
364
364
|
target: e,
|
|
365
365
|
type: t,
|
|
366
366
|
key: n
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
let o =
|
|
370
|
+
function ze(e, t, n, r, i, a) {
|
|
371
|
+
let o = Fe.get(e);
|
|
372
372
|
if (!o) {
|
|
373
|
-
|
|
373
|
+
je++;
|
|
374
374
|
return;
|
|
375
375
|
}
|
|
376
376
|
let s = (o) => {
|
|
@@ -383,173 +383,173 @@ function Re(e, t, n, r, i, a) {
|
|
|
383
383
|
oldTarget: a
|
|
384
384
|
}));
|
|
385
385
|
};
|
|
386
|
-
if (
|
|
386
|
+
if (V(), t === "clear") o.forEach(s);
|
|
387
387
|
else {
|
|
388
388
|
let i = E(e), a = i && re(n);
|
|
389
389
|
if (i && n === "length") {
|
|
390
390
|
let e = Number(r);
|
|
391
391
|
o.forEach((t, n) => {
|
|
392
|
-
(n === "length" || n ===
|
|
392
|
+
(n === "length" || n === Re || !A(n) && n >= e) && s(t);
|
|
393
393
|
});
|
|
394
|
-
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(
|
|
394
|
+
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(Re)), t) {
|
|
395
395
|
case "add":
|
|
396
|
-
i ? a && s(o.get("length")) : (s(o.get(
|
|
396
|
+
i ? a && s(o.get("length")) : (s(o.get(Ie)), ee(e) && s(o.get(Le)));
|
|
397
397
|
break;
|
|
398
398
|
case "delete":
|
|
399
|
-
i || (s(o.get(
|
|
399
|
+
i || (s(o.get(Ie)), ee(e) && s(o.get(Le)));
|
|
400
400
|
break;
|
|
401
401
|
case "set":
|
|
402
|
-
ee(e) && s(o.get(
|
|
402
|
+
ee(e) && s(o.get(Ie));
|
|
403
403
|
break;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
|
|
407
|
-
}
|
|
408
|
-
function ze(e) {
|
|
409
|
-
let t = /* @__PURE__ */ K(e);
|
|
410
|
-
return t === e ? t : (U(t, "iterate", Le), /* @__PURE__ */ Ct(e) ? t : t.map(Et));
|
|
406
|
+
ye();
|
|
411
407
|
}
|
|
412
408
|
function Be(e) {
|
|
413
|
-
|
|
409
|
+
let t = /* @__PURE__ */ G(e);
|
|
410
|
+
return t === e ? t : (H(t, "iterate", Re), /* @__PURE__ */ wt(e) ? t : t.map(Dt));
|
|
411
|
+
}
|
|
412
|
+
function Ve(e) {
|
|
413
|
+
return H(e = /* @__PURE__ */ G(e), "iterate", Re), e;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
return /* @__PURE__ */
|
|
415
|
+
function He(e, t) {
|
|
416
|
+
return /* @__PURE__ */ Ct(e) ? Ot(/* @__PURE__ */ St(e) ? Dt(t) : t) : Dt(t);
|
|
417
417
|
}
|
|
418
|
-
var
|
|
418
|
+
var Ue = {
|
|
419
419
|
__proto__: null,
|
|
420
420
|
[Symbol.iterator]() {
|
|
421
|
-
return
|
|
421
|
+
return We(this, Symbol.iterator, (e) => He(this, e));
|
|
422
422
|
},
|
|
423
423
|
concat(...e) {
|
|
424
|
-
return
|
|
424
|
+
return Be(this).concat(...e.map((e) => E(e) ? Be(e) : e));
|
|
425
425
|
},
|
|
426
426
|
entries() {
|
|
427
|
-
return
|
|
427
|
+
return We(this, "entries", (e) => (e[1] = He(this, e[1]), e));
|
|
428
428
|
},
|
|
429
429
|
every(e, t) {
|
|
430
|
-
return
|
|
430
|
+
return Ke(this, "every", e, t, void 0, arguments);
|
|
431
431
|
},
|
|
432
432
|
filter(e, t) {
|
|
433
|
-
return
|
|
433
|
+
return Ke(this, "filter", e, t, (e) => e.map((e) => He(this, e)), arguments);
|
|
434
434
|
},
|
|
435
435
|
find(e, t) {
|
|
436
|
-
return
|
|
436
|
+
return Ke(this, "find", e, t, (e) => He(this, e), arguments);
|
|
437
437
|
},
|
|
438
438
|
findIndex(e, t) {
|
|
439
|
-
return
|
|
439
|
+
return Ke(this, "findIndex", e, t, void 0, arguments);
|
|
440
440
|
},
|
|
441
441
|
findLast(e, t) {
|
|
442
|
-
return
|
|
442
|
+
return Ke(this, "findLast", e, t, (e) => He(this, e), arguments);
|
|
443
443
|
},
|
|
444
444
|
findLastIndex(e, t) {
|
|
445
|
-
return
|
|
445
|
+
return Ke(this, "findLastIndex", e, t, void 0, arguments);
|
|
446
446
|
},
|
|
447
447
|
forEach(e, t) {
|
|
448
|
-
return
|
|
448
|
+
return Ke(this, "forEach", e, t, void 0, arguments);
|
|
449
449
|
},
|
|
450
450
|
includes(...e) {
|
|
451
|
-
return
|
|
451
|
+
return U(this, "includes", e);
|
|
452
452
|
},
|
|
453
453
|
indexOf(...e) {
|
|
454
|
-
return
|
|
454
|
+
return U(this, "indexOf", e);
|
|
455
455
|
},
|
|
456
456
|
join(e) {
|
|
457
|
-
return
|
|
457
|
+
return Be(this).join(e);
|
|
458
458
|
},
|
|
459
459
|
lastIndexOf(...e) {
|
|
460
|
-
return
|
|
460
|
+
return U(this, "lastIndexOf", e);
|
|
461
461
|
},
|
|
462
462
|
map(e, t) {
|
|
463
|
-
return
|
|
463
|
+
return Ke(this, "map", e, t, void 0, arguments);
|
|
464
464
|
},
|
|
465
465
|
pop() {
|
|
466
|
-
return
|
|
466
|
+
return Je(this, "pop");
|
|
467
467
|
},
|
|
468
468
|
push(...e) {
|
|
469
|
-
return
|
|
469
|
+
return Je(this, "push", e);
|
|
470
470
|
},
|
|
471
471
|
reduce(e, ...t) {
|
|
472
|
-
return
|
|
472
|
+
return qe(this, "reduce", e, t);
|
|
473
473
|
},
|
|
474
474
|
reduceRight(e, ...t) {
|
|
475
|
-
return
|
|
475
|
+
return qe(this, "reduceRight", e, t);
|
|
476
476
|
},
|
|
477
477
|
shift() {
|
|
478
|
-
return
|
|
478
|
+
return Je(this, "shift");
|
|
479
479
|
},
|
|
480
480
|
some(e, t) {
|
|
481
|
-
return
|
|
481
|
+
return Ke(this, "some", e, t, void 0, arguments);
|
|
482
482
|
},
|
|
483
483
|
splice(...e) {
|
|
484
|
-
return
|
|
484
|
+
return Je(this, "splice", e);
|
|
485
485
|
},
|
|
486
486
|
toReversed() {
|
|
487
|
-
return
|
|
487
|
+
return Be(this).toReversed();
|
|
488
488
|
},
|
|
489
489
|
toSorted(e) {
|
|
490
|
-
return
|
|
490
|
+
return Be(this).toSorted(e);
|
|
491
491
|
},
|
|
492
492
|
toSpliced(...e) {
|
|
493
|
-
return
|
|
493
|
+
return Be(this).toSpliced(...e);
|
|
494
494
|
},
|
|
495
495
|
unshift(...e) {
|
|
496
|
-
return
|
|
496
|
+
return Je(this, "unshift", e);
|
|
497
497
|
},
|
|
498
498
|
values() {
|
|
499
|
-
return
|
|
499
|
+
return We(this, "values", (e) => He(this, e));
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
|
-
function
|
|
503
|
-
let r =
|
|
504
|
-
return r !== e && !/* @__PURE__ */
|
|
502
|
+
function We(e, t, n) {
|
|
503
|
+
let r = Ve(e), i = r[t]();
|
|
504
|
+
return r !== e && !/* @__PURE__ */ wt(e) && (i._next = i.next, i.next = () => {
|
|
505
505
|
let e = i._next();
|
|
506
506
|
return e.done || (e.value = n(e.value)), e;
|
|
507
507
|
}), i;
|
|
508
508
|
}
|
|
509
|
-
var
|
|
510
|
-
function
|
|
511
|
-
let o =
|
|
512
|
-
if (c !==
|
|
509
|
+
var Ge = Array.prototype;
|
|
510
|
+
function Ke(e, t, n, r, i, a) {
|
|
511
|
+
let o = Ve(e), s = o !== e && !/* @__PURE__ */ wt(e), c = o[t];
|
|
512
|
+
if (c !== Ge[t]) {
|
|
513
513
|
let t = c.apply(e, a);
|
|
514
|
-
return s ?
|
|
514
|
+
return s ? Dt(t) : t;
|
|
515
515
|
}
|
|
516
516
|
let l = n;
|
|
517
517
|
o !== e && (s ? l = function(t, r) {
|
|
518
|
-
return n.call(this,
|
|
518
|
+
return n.call(this, He(e, t), r, e);
|
|
519
519
|
} : n.length > 2 && (l = function(t, r) {
|
|
520
520
|
return n.call(this, t, r, e);
|
|
521
521
|
}));
|
|
522
522
|
let u = c.call(o, l, r);
|
|
523
523
|
return s && i ? i(u) : u;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
let i =
|
|
525
|
+
function qe(e, t, n, r) {
|
|
526
|
+
let i = Ve(e), a = i !== e && !/* @__PURE__ */ wt(e), o = n, s = !1;
|
|
527
527
|
i !== e && (a ? (s = r.length === 0, o = function(t, r, i) {
|
|
528
|
-
return s && (s = !1, t =
|
|
528
|
+
return s && (s = !1, t = He(e, t)), n.call(this, t, He(e, r), i, e);
|
|
529
529
|
}) : n.length > 3 && (o = function(t, r, i) {
|
|
530
530
|
return n.call(this, t, r, i, e);
|
|
531
531
|
}));
|
|
532
532
|
let c = i[t](o, ...r);
|
|
533
|
-
return s ?
|
|
533
|
+
return s ? He(e, c) : c;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
let r = /* @__PURE__ */
|
|
537
|
-
|
|
535
|
+
function U(e, t, n) {
|
|
536
|
+
let r = /* @__PURE__ */ G(e);
|
|
537
|
+
H(r, "iterate", Re);
|
|
538
538
|
let i = r[t](...n);
|
|
539
|
-
return (i === -1 || i === !1) && /* @__PURE__ */
|
|
539
|
+
return (i === -1 || i === !1) && /* @__PURE__ */ Tt(n[0]) ? (n[0] = /* @__PURE__ */ G(n[0]), r[t](...n)) : i;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
543
|
-
let r = (/* @__PURE__ */
|
|
544
|
-
return
|
|
541
|
+
function Je(e, t, n = []) {
|
|
542
|
+
Oe(), V();
|
|
543
|
+
let r = (/* @__PURE__ */ G(e))[t].apply(e, n);
|
|
544
|
+
return ye(), ke(), r;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
547
|
-
function
|
|
546
|
+
var Ye = /* @__PURE__ */ _("__proto__,__v_isRef,__isVue"), Xe = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(A));
|
|
547
|
+
function Ze(e) {
|
|
548
548
|
A(e) || (e = String(e));
|
|
549
|
-
let t = /* @__PURE__ */
|
|
550
|
-
return
|
|
549
|
+
let t = /* @__PURE__ */ G(this);
|
|
550
|
+
return H(t, "has", e), t.hasOwnProperty(e);
|
|
551
551
|
}
|
|
552
|
-
var
|
|
552
|
+
var Qe = class {
|
|
553
553
|
constructor(e = !1, t = !1) {
|
|
554
554
|
this._isReadonly = e, this._isShallow = t;
|
|
555
555
|
}
|
|
@@ -559,60 +559,60 @@ var Ze = class {
|
|
|
559
559
|
if (t === "__v_isReactive") return !r;
|
|
560
560
|
if (t === "__v_isReadonly") return r;
|
|
561
561
|
if (t === "__v_isShallow") return i;
|
|
562
|
-
if (t === "__v_raw") return n === (r ? i ?
|
|
562
|
+
if (t === "__v_raw") return n === (r ? i ? gt : ht : i ? mt : pt).get(e) || Object.getPrototypeOf(e) === Object.getPrototypeOf(n) ? e : void 0;
|
|
563
563
|
let a = E(e);
|
|
564
564
|
if (!r) {
|
|
565
565
|
let e;
|
|
566
|
-
if (a && (e =
|
|
567
|
-
if (t === "hasOwnProperty") return
|
|
566
|
+
if (a && (e = Ue[t])) return e;
|
|
567
|
+
if (t === "hasOwnProperty") return Ze;
|
|
568
568
|
}
|
|
569
|
-
let o = Reflect.get(e, t, /* @__PURE__ */
|
|
570
|
-
if ((A(t) ?
|
|
571
|
-
if (/* @__PURE__ */
|
|
569
|
+
let o = Reflect.get(e, t, /* @__PURE__ */ K(e) ? e : n);
|
|
570
|
+
if ((A(t) ? Xe.has(t) : Ye(t)) || (r || H(e, "get", t), i)) return o;
|
|
571
|
+
if (/* @__PURE__ */ K(o)) {
|
|
572
572
|
let e = a && re(t) ? o : o.value;
|
|
573
|
-
return r && j(e) ? /* @__PURE__ */
|
|
573
|
+
return r && j(e) ? /* @__PURE__ */ yt(e) : e;
|
|
574
574
|
}
|
|
575
|
-
return j(o) ? r ? /* @__PURE__ */
|
|
575
|
+
return j(o) ? r ? /* @__PURE__ */ yt(o) : /* @__PURE__ */ vt(o) : o;
|
|
576
576
|
}
|
|
577
|
-
},
|
|
577
|
+
}, $e = class extends Qe {
|
|
578
578
|
constructor(e = !1) {
|
|
579
579
|
super(!1, e);
|
|
580
580
|
}
|
|
581
581
|
set(e, t, n, r) {
|
|
582
582
|
let i = e[t], a = E(e) && re(t);
|
|
583
583
|
if (!this._isShallow) {
|
|
584
|
-
let r = /* @__PURE__ */
|
|
585
|
-
if (!/* @__PURE__ */
|
|
584
|
+
let r = /* @__PURE__ */ Ct(i);
|
|
585
|
+
if (!/* @__PURE__ */ wt(n) && !/* @__PURE__ */ Ct(n) && (i = /* @__PURE__ */ G(i), n = /* @__PURE__ */ G(n)), !a && /* @__PURE__ */ K(i) && !/* @__PURE__ */ K(n)) return r ? (process.env.NODE_ENV !== "production" && de(`Set operation on key "${String(t)}" failed: target is readonly.`, e[t]), !0) : (i.value = n, !0);
|
|
586
586
|
}
|
|
587
|
-
let o = a ? Number(t) < e.length : T(e, t), s = Reflect.set(e, t, n, /* @__PURE__ */
|
|
588
|
-
return e === /* @__PURE__ */
|
|
587
|
+
let o = a ? Number(t) < e.length : T(e, t), s = Reflect.set(e, t, n, /* @__PURE__ */ K(e) ? e : r);
|
|
588
|
+
return e === /* @__PURE__ */ G(r) && s && (o ? ae(n, i) && ze(e, "set", t, n, i) : ze(e, "add", t, n)), s;
|
|
589
589
|
}
|
|
590
590
|
deleteProperty(e, t) {
|
|
591
591
|
let n = T(e, t), r = e[t], i = Reflect.deleteProperty(e, t);
|
|
592
|
-
return i && n &&
|
|
592
|
+
return i && n && ze(e, "delete", t, void 0, r), i;
|
|
593
593
|
}
|
|
594
594
|
has(e, t) {
|
|
595
595
|
let n = Reflect.has(e, t);
|
|
596
|
-
return (!A(t) || !
|
|
596
|
+
return (!A(t) || !Xe.has(t)) && H(e, "has", t), n;
|
|
597
597
|
}
|
|
598
598
|
ownKeys(e) {
|
|
599
|
-
return
|
|
599
|
+
return H(e, "iterate", E(e) ? "length" : Ie), Reflect.ownKeys(e);
|
|
600
600
|
}
|
|
601
|
-
},
|
|
601
|
+
}, et = class extends Qe {
|
|
602
602
|
constructor(e = !1) {
|
|
603
603
|
super(!0, e);
|
|
604
604
|
}
|
|
605
605
|
set(e, t) {
|
|
606
|
-
return process.env.NODE_ENV !== "production" &&
|
|
606
|
+
return process.env.NODE_ENV !== "production" && de(`Set operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
607
607
|
}
|
|
608
608
|
deleteProperty(e, t) {
|
|
609
|
-
return process.env.NODE_ENV !== "production" &&
|
|
609
|
+
return process.env.NODE_ENV !== "production" && de(`Delete operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
610
610
|
}
|
|
611
|
-
},
|
|
612
|
-
function
|
|
611
|
+
}, tt = /* @__PURE__ */ new $e(), nt = /* @__PURE__ */ new et(), rt = /* @__PURE__ */ new et(!0), it = (e) => e, at = (e) => Reflect.getPrototypeOf(e);
|
|
612
|
+
function ot(e, t, n) {
|
|
613
613
|
return function(...r) {
|
|
614
|
-
let i = this.__v_raw, a = /* @__PURE__ */
|
|
615
|
-
return !t &&
|
|
614
|
+
let i = this.__v_raw, a = /* @__PURE__ */ G(i), o = ee(a), s = e === "entries" || e === Symbol.iterator && o, c = e === "keys" && o, l = i[e](...r), u = n ? it : t ? Ot : Dt;
|
|
615
|
+
return !t && H(a, "iterate", c ? Le : Ie), S(Object.create(l), { next() {
|
|
616
616
|
let { value: e, done: t } = l.next();
|
|
617
617
|
return t ? {
|
|
618
618
|
value: e,
|
|
@@ -624,64 +624,64 @@ function at(e, t, n) {
|
|
|
624
624
|
} });
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function st(e) {
|
|
628
628
|
return function(...t) {
|
|
629
629
|
if (process.env.NODE_ENV !== "production") {
|
|
630
630
|
let n = t[0] ? `on key "${t[0]}" ` : "";
|
|
631
|
-
|
|
631
|
+
de(`${ie(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */ G(this));
|
|
632
632
|
}
|
|
633
633
|
return e === "delete" ? !1 : e === "clear" ? void 0 : this;
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function ct(e, t) {
|
|
637
637
|
let n = {
|
|
638
638
|
get(n) {
|
|
639
|
-
let r = this.__v_raw, i = /* @__PURE__ */
|
|
640
|
-
e || (
|
|
641
|
-
let { has: o } =
|
|
639
|
+
let r = this.__v_raw, i = /* @__PURE__ */ G(r), a = /* @__PURE__ */ G(n);
|
|
640
|
+
e || (ae(n, a) && H(i, "get", n), H(i, "get", a));
|
|
641
|
+
let { has: o } = at(i), s = t ? it : e ? Ot : Dt;
|
|
642
642
|
if (o.call(i, n)) return s(r.get(n));
|
|
643
643
|
if (o.call(i, a)) return s(r.get(a));
|
|
644
644
|
r !== i && r.get(n);
|
|
645
645
|
},
|
|
646
646
|
get size() {
|
|
647
647
|
let t = this.__v_raw;
|
|
648
|
-
return !e &&
|
|
648
|
+
return !e && H(/* @__PURE__ */ G(t), "iterate", Ie), t.size;
|
|
649
649
|
},
|
|
650
650
|
has(t) {
|
|
651
|
-
let n = this.__v_raw, r = /* @__PURE__ */
|
|
652
|
-
return e || (
|
|
651
|
+
let n = this.__v_raw, r = /* @__PURE__ */ G(n), i = /* @__PURE__ */ G(t);
|
|
652
|
+
return e || (ae(t, i) && H(r, "has", t), H(r, "has", i)), t === i ? n.has(t) : n.has(t) || n.has(i);
|
|
653
653
|
},
|
|
654
654
|
forEach(n, r) {
|
|
655
|
-
let i = this, a = i.__v_raw, o = /* @__PURE__ */
|
|
656
|
-
return !e &&
|
|
655
|
+
let i = this, a = i.__v_raw, o = /* @__PURE__ */ G(a), s = t ? it : e ? Ot : Dt;
|
|
656
|
+
return !e && H(o, "iterate", Ie), a.forEach((e, t) => n.call(r, s(e), s(t), i));
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
659
|
return S(n, e ? {
|
|
660
|
-
add:
|
|
661
|
-
set:
|
|
662
|
-
delete:
|
|
663
|
-
clear:
|
|
660
|
+
add: st("add"),
|
|
661
|
+
set: st("set"),
|
|
662
|
+
delete: st("delete"),
|
|
663
|
+
clear: st("clear")
|
|
664
664
|
} : {
|
|
665
665
|
add(e) {
|
|
666
|
-
let n = /* @__PURE__ */
|
|
667
|
-
return r.has.call(n, a) ||
|
|
666
|
+
let n = /* @__PURE__ */ G(this), r = at(n), i = /* @__PURE__ */ G(e), a = !t && !/* @__PURE__ */ wt(e) && !/* @__PURE__ */ Ct(e) ? i : e;
|
|
667
|
+
return r.has.call(n, a) || ae(e, a) && r.has.call(n, e) || ae(i, a) && r.has.call(n, i) || (n.add(a), ze(n, "add", a, a)), this;
|
|
668
668
|
},
|
|
669
669
|
set(e, n) {
|
|
670
|
-
!t && !/* @__PURE__ */
|
|
671
|
-
let r = /* @__PURE__ */
|
|
672
|
-
o ? process.env.NODE_ENV !== "production" &&
|
|
670
|
+
!t && !/* @__PURE__ */ wt(n) && !/* @__PURE__ */ Ct(n) && (n = /* @__PURE__ */ G(n));
|
|
671
|
+
let r = /* @__PURE__ */ G(this), { has: i, get: a } = at(r), o = i.call(r, e);
|
|
672
|
+
o ? process.env.NODE_ENV !== "production" && W(r, i, e) : (e = /* @__PURE__ */ G(e), o = i.call(r, e));
|
|
673
673
|
let s = a.call(r, e);
|
|
674
|
-
return r.set(e, n), o ?
|
|
674
|
+
return r.set(e, n), o ? ae(n, s) && ze(r, "set", e, n, s) : ze(r, "add", e, n), this;
|
|
675
675
|
},
|
|
676
676
|
delete(e) {
|
|
677
|
-
let t = /* @__PURE__ */
|
|
678
|
-
i ? process.env.NODE_ENV !== "production" &&
|
|
677
|
+
let t = /* @__PURE__ */ G(this), { has: n, get: r } = at(t), i = n.call(t, e);
|
|
678
|
+
i ? process.env.NODE_ENV !== "production" && W(t, n, e) : (e = /* @__PURE__ */ G(e), i = n.call(t, e));
|
|
679
679
|
let a = r ? r.call(t, e) : void 0, o = t.delete(e);
|
|
680
|
-
return i &&
|
|
680
|
+
return i && ze(t, "delete", e, void 0, a), o;
|
|
681
681
|
},
|
|
682
682
|
clear() {
|
|
683
|
-
let e = /* @__PURE__ */
|
|
684
|
-
return t &&
|
|
683
|
+
let e = /* @__PURE__ */ G(this), t = e.size !== 0, n = process.env.NODE_ENV === "production" ? void 0 : ee(e) ? new Map(e) : new Set(e), r = e.clear();
|
|
684
|
+
return t && ze(e, "clear", void 0, void 0, n), r;
|
|
685
685
|
}
|
|
686
686
|
}), [
|
|
687
687
|
"keys",
|
|
@@ -689,23 +689,23 @@ function st(e, t) {
|
|
|
689
689
|
"entries",
|
|
690
690
|
Symbol.iterator
|
|
691
691
|
].forEach((r) => {
|
|
692
|
-
n[r] =
|
|
692
|
+
n[r] = ot(r, e, t);
|
|
693
693
|
}), n;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
let n =
|
|
695
|
+
function lt(e, t) {
|
|
696
|
+
let n = ct(e, t);
|
|
697
697
|
return (t, r, i) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? t : Reflect.get(T(n, r) && r in t ? n : t, r, i);
|
|
698
698
|
}
|
|
699
|
-
var
|
|
700
|
-
function
|
|
701
|
-
let r = /* @__PURE__ */
|
|
699
|
+
var ut = { get: /* @__PURE__ */ lt(!1, !1) }, dt = { get: /* @__PURE__ */ lt(!0, !1) }, ft = { get: /* @__PURE__ */ lt(!0, !0) };
|
|
700
|
+
function W(e, t, n) {
|
|
701
|
+
let r = /* @__PURE__ */ G(n);
|
|
702
702
|
if (r !== n && t.call(e, r)) {
|
|
703
703
|
let t = N(e);
|
|
704
|
-
|
|
704
|
+
de(`Reactive ${t} contains both the raw and reactive versions of the same object${t === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
var
|
|
708
|
-
function
|
|
707
|
+
var pt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap();
|
|
708
|
+
function _t(e) {
|
|
709
709
|
switch (e) {
|
|
710
710
|
case "Object":
|
|
711
711
|
case "Array": return 1;
|
|
@@ -717,70 +717,70 @@ function gt(e) {
|
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
// @__NO_SIDE_EFFECTS__
|
|
720
|
-
function _t(e) {
|
|
721
|
-
return /* @__PURE__ */ St(e) ? e : bt(e, !1, et, ct, ft);
|
|
722
|
-
}
|
|
723
|
-
// @__NO_SIDE_EFFECTS__
|
|
724
720
|
function vt(e) {
|
|
725
|
-
return
|
|
721
|
+
return /* @__PURE__ */ Ct(e) ? e : xt(e, !1, tt, ut, pt);
|
|
726
722
|
}
|
|
727
723
|
// @__NO_SIDE_EFFECTS__
|
|
728
724
|
function yt(e) {
|
|
729
|
-
return
|
|
725
|
+
return xt(e, !0, nt, dt, ht);
|
|
726
|
+
}
|
|
727
|
+
// @__NO_SIDE_EFFECTS__
|
|
728
|
+
function bt(e) {
|
|
729
|
+
return xt(e, !0, rt, ft, gt);
|
|
730
730
|
}
|
|
731
|
-
function
|
|
732
|
-
if (!j(e)) return process.env.NODE_ENV !== "production" &&
|
|
731
|
+
function xt(e, t, n, r, i) {
|
|
732
|
+
if (!j(e)) return process.env.NODE_ENV !== "production" && de(`value cannot be made ${t ? "readonly" : "reactive"}: ${String(e)}`), e;
|
|
733
733
|
if (e.__v_raw && !(t && e.__v_isReactive) || e.__v_skip || !Object.isExtensible(e)) return e;
|
|
734
734
|
let a = i.get(e);
|
|
735
735
|
if (a) return a;
|
|
736
|
-
let o =
|
|
736
|
+
let o = _t(N(e));
|
|
737
737
|
if (o === 0) return e;
|
|
738
738
|
let s = new Proxy(e, o === 2 ? r : n);
|
|
739
739
|
return i.set(e, s), s;
|
|
740
740
|
}
|
|
741
741
|
// @__NO_SIDE_EFFECTS__
|
|
742
|
-
function
|
|
743
|
-
return /* @__PURE__ */
|
|
742
|
+
function St(e) {
|
|
743
|
+
return /* @__PURE__ */ Ct(e) ? /* @__PURE__ */ St(e.__v_raw) : !!(e && e.__v_isReactive);
|
|
744
744
|
}
|
|
745
745
|
// @__NO_SIDE_EFFECTS__
|
|
746
|
-
function
|
|
746
|
+
function Ct(e) {
|
|
747
747
|
return !!(e && e.__v_isReadonly);
|
|
748
748
|
}
|
|
749
749
|
// @__NO_SIDE_EFFECTS__
|
|
750
|
-
function
|
|
750
|
+
function wt(e) {
|
|
751
751
|
return !!(e && e.__v_isShallow);
|
|
752
752
|
}
|
|
753
753
|
// @__NO_SIDE_EFFECTS__
|
|
754
|
-
function
|
|
754
|
+
function Tt(e) {
|
|
755
755
|
return e ? !!e.__v_raw : !1;
|
|
756
756
|
}
|
|
757
757
|
// @__NO_SIDE_EFFECTS__
|
|
758
|
-
function
|
|
758
|
+
function G(e) {
|
|
759
759
|
let t = e && e.__v_raw;
|
|
760
|
-
return t ? /* @__PURE__ */
|
|
760
|
+
return t ? /* @__PURE__ */ G(t) : e;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
return !T(e, "__v_skip") && Object.isExtensible(e) &&
|
|
762
|
+
function Et(e) {
|
|
763
|
+
return !T(e, "__v_skip") && Object.isExtensible(e) && F(e, "__v_skip", !0), e;
|
|
764
764
|
}
|
|
765
|
-
var
|
|
765
|
+
var Dt = (e) => j(e) ? /* @__PURE__ */ vt(e) : e, Ot = (e) => j(e) ? /* @__PURE__ */ yt(e) : e;
|
|
766
766
|
// @__NO_SIDE_EFFECTS__
|
|
767
|
-
function
|
|
767
|
+
function K(e) {
|
|
768
768
|
return e ? e.__v_isRef === !0 : !1;
|
|
769
769
|
}
|
|
770
770
|
// @__NO_SIDE_EFFECTS__
|
|
771
|
-
function
|
|
772
|
-
return
|
|
771
|
+
function kt(e) {
|
|
772
|
+
return jt(e, !1);
|
|
773
773
|
}
|
|
774
774
|
// @__NO_SIDE_EFFECTS__
|
|
775
|
-
function
|
|
776
|
-
return
|
|
775
|
+
function At(e) {
|
|
776
|
+
return jt(e, !0);
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
return /* @__PURE__ */
|
|
778
|
+
function jt(e, t) {
|
|
779
|
+
return /* @__PURE__ */ K(e) ? e : new Mt(e, t);
|
|
780
780
|
}
|
|
781
|
-
var
|
|
781
|
+
var Mt = class {
|
|
782
782
|
constructor(e, t) {
|
|
783
|
-
this.dep = new
|
|
783
|
+
this.dep = new Ne(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = t ? e : /* @__PURE__ */ G(e), this._value = t ? e : Dt(e), this.__v_isShallow = t;
|
|
784
784
|
}
|
|
785
785
|
get value() {
|
|
786
786
|
return process.env.NODE_ENV === "production" ? this.dep.track() : this.dep.track({
|
|
@@ -790,8 +790,8 @@ var jt = class {
|
|
|
790
790
|
}), this._value;
|
|
791
791
|
}
|
|
792
792
|
set value(e) {
|
|
793
|
-
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */
|
|
794
|
-
e = n ? e : /* @__PURE__ */
|
|
793
|
+
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */ wt(e) || /* @__PURE__ */ Ct(e);
|
|
794
|
+
e = n ? e : /* @__PURE__ */ G(e), ae(e, t) && (this._rawValue = e, this._value = n ? e : Dt(e), process.env.NODE_ENV === "production" ? this.dep.trigger() : this.dep.trigger({
|
|
795
795
|
target: this,
|
|
796
796
|
type: "set",
|
|
797
797
|
key: "value",
|
|
@@ -800,7 +800,7 @@ var jt = class {
|
|
|
800
800
|
}));
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
|
-
function
|
|
803
|
+
function Nt(e) {
|
|
804
804
|
e.dep && (process.env.NODE_ENV === "production" ? e.dep.trigger() : e.dep.trigger({
|
|
805
805
|
target: e,
|
|
806
806
|
type: "set",
|
|
@@ -808,25 +808,25 @@ function Mt(e) {
|
|
|
808
808
|
newValue: e._value
|
|
809
809
|
}));
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
return /* @__PURE__ */
|
|
811
|
+
function Pt(e) {
|
|
812
|
+
return /* @__PURE__ */ K(e) ? e.value : e;
|
|
813
813
|
}
|
|
814
|
-
var
|
|
815
|
-
get: (e, t, n) => t === "__v_raw" ? e :
|
|
814
|
+
var Ft = {
|
|
815
|
+
get: (e, t, n) => t === "__v_raw" ? e : Pt(Reflect.get(e, t, n)),
|
|
816
816
|
set: (e, t, n, r) => {
|
|
817
817
|
let i = e[t];
|
|
818
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ K(i) && !/* @__PURE__ */ K(n) ? (i.value = n, !0) : Reflect.set(e, t, n, r);
|
|
819
819
|
}
|
|
820
820
|
};
|
|
821
|
-
function
|
|
822
|
-
return /* @__PURE__ */
|
|
821
|
+
function It(e) {
|
|
822
|
+
return /* @__PURE__ */ St(e) ? e : new Proxy(e, Ft);
|
|
823
823
|
}
|
|
824
|
-
var
|
|
824
|
+
var Lt = class {
|
|
825
825
|
constructor(e, t, n) {
|
|
826
|
-
this.fn = e, this.setter = t, this._value = void 0, this.dep = new
|
|
826
|
+
this.fn = e, this.setter = t, this._value = void 0, this.dep = new Ne(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = je - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !t, this.isSSR = n;
|
|
827
827
|
}
|
|
828
828
|
notify() {
|
|
829
|
-
if (this.flags |= 16, !(this.flags & 8) &&
|
|
829
|
+
if (this.flags |= 16, !(this.flags & 8) && z !== this) return ve(this, !0), !0;
|
|
830
830
|
process.env.NODE_ENV;
|
|
831
831
|
}
|
|
832
832
|
get value() {
|
|
@@ -835,56 +835,56 @@ var It = class {
|
|
|
835
835
|
type: "get",
|
|
836
836
|
key: "value"
|
|
837
837
|
});
|
|
838
|
-
return
|
|
838
|
+
return Ce(this), e && (e.version = this.dep.version), this._value;
|
|
839
839
|
}
|
|
840
840
|
set value(e) {
|
|
841
|
-
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" &&
|
|
841
|
+
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" && de("Write operation failed: computed value is readonly");
|
|
842
842
|
}
|
|
843
843
|
};
|
|
844
844
|
// @__NO_SIDE_EFFECTS__
|
|
845
|
-
function
|
|
845
|
+
function Rt(e, t, n = !1) {
|
|
846
846
|
let r, i;
|
|
847
847
|
O(e) ? r = e : (r = e.get, i = e.set);
|
|
848
|
-
let a = new
|
|
848
|
+
let a = new Lt(r, i, n);
|
|
849
849
|
return process.env.NODE_ENV !== "production" && t && !n && (a.onTrack = t.onTrack, a.onTrigger = t.onTrigger), a;
|
|
850
850
|
}
|
|
851
|
-
var
|
|
852
|
-
function
|
|
851
|
+
var zt = {}, Bt = /* @__PURE__ */ new WeakMap(), Vt = void 0;
|
|
852
|
+
function Ht(e, t = !1, n = Vt) {
|
|
853
853
|
if (n) {
|
|
854
|
-
let t =
|
|
855
|
-
t ||
|
|
856
|
-
} else process.env.NODE_ENV !== "production" && !t &&
|
|
854
|
+
let t = Bt.get(n);
|
|
855
|
+
t || Bt.set(n, t = []), t.push(e);
|
|
856
|
+
} else process.env.NODE_ENV !== "production" && !t && de("onWatcherCleanup() was called when there was no active watcher to associate with.");
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function Ut(e, t, n = v) {
|
|
859
859
|
let { immediate: r, deep: i, once: a, scheduler: o, augmentJob: s, call: c } = n, l = (e) => {
|
|
860
|
-
(n.onWarn ||
|
|
861
|
-
}, u = (e) => i ? e : /* @__PURE__ */
|
|
862
|
-
if (/* @__PURE__ */
|
|
863
|
-
if (/* @__PURE__ */
|
|
864
|
-
if (/* @__PURE__ */
|
|
860
|
+
(n.onWarn || de)("Invalid watch source: ", e, "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.");
|
|
861
|
+
}, u = (e) => i ? e : /* @__PURE__ */ wt(e) || i === !1 || i === 0 ? Wt(e, 1) : Wt(e), d, f, p, m, h = !1, g = !1;
|
|
862
|
+
if (/* @__PURE__ */ K(e) ? (f = () => e.value, h = /* @__PURE__ */ wt(e)) : /* @__PURE__ */ St(e) ? (f = () => u(e), h = !0) : E(e) ? (g = !0, h = e.some((e) => /* @__PURE__ */ St(e) || /* @__PURE__ */ wt(e)), f = () => e.map((e) => {
|
|
863
|
+
if (/* @__PURE__ */ K(e)) return e.value;
|
|
864
|
+
if (/* @__PURE__ */ St(e)) return u(e);
|
|
865
865
|
if (O(e)) return c ? c(e, 2) : e();
|
|
866
866
|
process.env.NODE_ENV !== "production" && l(e);
|
|
867
867
|
})) : O(e) ? f = t ? c ? () => c(e, 2) : e : () => {
|
|
868
868
|
if (p) {
|
|
869
|
-
|
|
869
|
+
Oe();
|
|
870
870
|
try {
|
|
871
871
|
p();
|
|
872
872
|
} finally {
|
|
873
|
-
|
|
873
|
+
ke();
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
let t =
|
|
877
|
-
|
|
876
|
+
let t = Vt;
|
|
877
|
+
Vt = d;
|
|
878
878
|
try {
|
|
879
879
|
return c ? c(e, 3, [m]) : e(m);
|
|
880
880
|
} finally {
|
|
881
|
-
|
|
881
|
+
Vt = t;
|
|
882
882
|
}
|
|
883
883
|
} : (f = y, process.env.NODE_ENV !== "production" && l(e)), t && i) {
|
|
884
884
|
let e = f, t = i === !0 ? Infinity : i;
|
|
885
|
-
f = () =>
|
|
885
|
+
f = () => Wt(e(), t);
|
|
886
886
|
}
|
|
887
|
-
let _ =
|
|
887
|
+
let _ = pe(), b = () => {
|
|
888
888
|
d.stop(), _ && _.active && C(_.effects, d);
|
|
889
889
|
};
|
|
890
890
|
if (a && t) {
|
|
@@ -894,63 +894,63 @@ function Ht(e, t, n = v) {
|
|
|
894
894
|
return b(), n;
|
|
895
895
|
};
|
|
896
896
|
}
|
|
897
|
-
let x = g ? Array(e.length).fill(
|
|
897
|
+
let x = g ? Array(e.length).fill(zt) : zt, S = (e) => {
|
|
898
898
|
if (!(!(d.flags & 1) || !d.dirty && !e)) if (t) {
|
|
899
899
|
let n = d.run();
|
|
900
|
-
if (e || i || h || (g ? n.some((e, t) =>
|
|
900
|
+
if (e || i || h || (g ? n.some((e, t) => ae(e, x[t])) : ae(n, x))) {
|
|
901
901
|
p && p();
|
|
902
|
-
let e =
|
|
903
|
-
|
|
902
|
+
let e = Vt;
|
|
903
|
+
Vt = d;
|
|
904
904
|
try {
|
|
905
905
|
let e = [
|
|
906
906
|
n,
|
|
907
|
-
x ===
|
|
907
|
+
x === zt ? void 0 : g && x[0] === zt ? [] : x,
|
|
908
908
|
m
|
|
909
909
|
];
|
|
910
910
|
x = n, c ? c(t, 3, e) : t(...e);
|
|
911
911
|
} finally {
|
|
912
|
-
|
|
912
|
+
Vt = e;
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
} else d.run();
|
|
916
916
|
};
|
|
917
|
-
return s && s(S), d = new
|
|
918
|
-
let e =
|
|
917
|
+
return s && s(S), d = new he(f), d.scheduler = o ? () => o(S, !1) : S, m = (e) => Ht(e, !1, d), p = d.onStop = () => {
|
|
918
|
+
let e = Bt.get(d);
|
|
919
919
|
if (e) {
|
|
920
920
|
if (c) c(e, 4);
|
|
921
921
|
else for (let t of e) t();
|
|
922
|
-
|
|
922
|
+
Bt.delete(d);
|
|
923
923
|
}
|
|
924
924
|
}, process.env.NODE_ENV !== "production" && (d.onTrack = n.onTrack, d.onTrigger = n.onTrigger), t ? r ? S(!0) : x = d.run() : o ? o(S.bind(null, !0), !0) : d.run(), b.pause = d.pause.bind(d), b.resume = d.resume.bind(d), b.stop = b, b;
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function Wt(e, t = Infinity, n) {
|
|
927
927
|
if (t <= 0 || !j(e) || e.__v_skip || (n ||= /* @__PURE__ */ new Map(), (n.get(e) || 0) >= t)) return e;
|
|
928
|
-
if (n.set(e, t), t--, /* @__PURE__ */
|
|
929
|
-
else if (E(e)) for (let r = 0; r < e.length; r++)
|
|
928
|
+
if (n.set(e, t), t--, /* @__PURE__ */ K(e)) Wt(e.value, t, n);
|
|
929
|
+
else if (E(e)) for (let r = 0; r < e.length; r++) Wt(e[r], t, n);
|
|
930
930
|
else if (D(e) || ee(e)) e.forEach((e) => {
|
|
931
|
-
|
|
931
|
+
Wt(e, t, n);
|
|
932
932
|
});
|
|
933
933
|
else if (P(e)) {
|
|
934
|
-
for (let r in e)
|
|
935
|
-
for (let r of Object.getOwnPropertySymbols(e)) Object.prototype.propertyIsEnumerable.call(e, r) &&
|
|
934
|
+
for (let r in e) Wt(e[r], t, n);
|
|
935
|
+
for (let r of Object.getOwnPropertySymbols(e)) Object.prototype.propertyIsEnumerable.call(e, r) && Wt(e[r], t, n);
|
|
936
936
|
}
|
|
937
937
|
return e;
|
|
938
938
|
}
|
|
939
939
|
//#endregion
|
|
940
940
|
//#region node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
|
|
941
|
-
var
|
|
942
|
-
function
|
|
943
|
-
|
|
944
|
-
}
|
|
945
|
-
function
|
|
946
|
-
|
|
947
|
-
}
|
|
948
|
-
var
|
|
949
|
-
function
|
|
950
|
-
if (
|
|
951
|
-
|
|
952
|
-
let n =
|
|
953
|
-
if (r)
|
|
941
|
+
var Gt = [];
|
|
942
|
+
function Kt(e) {
|
|
943
|
+
Gt.push(e);
|
|
944
|
+
}
|
|
945
|
+
function qt() {
|
|
946
|
+
Gt.pop();
|
|
947
|
+
}
|
|
948
|
+
var Jt = !1;
|
|
949
|
+
function q(e, ...t) {
|
|
950
|
+
if (Jt) return;
|
|
951
|
+
Jt = !0, Oe();
|
|
952
|
+
let n = Gt.length ? Gt[Gt.length - 1].component : null, r = n && n.appContext.config.warnHandler, i = Yt();
|
|
953
|
+
if (r) tn(r, n, 11, [
|
|
954
954
|
e + t.map((e) => e.toString?.call(e) ?? JSON.stringify(e)).join(""),
|
|
955
955
|
n && n.proxy,
|
|
956
956
|
i.map(({ vnode: e }) => `at <${zr(n, e.type)}>`).join("\n"),
|
|
@@ -958,12 +958,12 @@ function J(e, ...t) {
|
|
|
958
958
|
]);
|
|
959
959
|
else {
|
|
960
960
|
let n = [`[Vue warn]: ${e}`, ...t];
|
|
961
|
-
i.length && n.push("\n", ...
|
|
961
|
+
i.length && n.push("\n", ...Xt(i)), console.warn(...n);
|
|
962
962
|
}
|
|
963
|
-
|
|
963
|
+
ke(), Jt = !1;
|
|
964
964
|
}
|
|
965
|
-
function
|
|
966
|
-
let e =
|
|
965
|
+
function Yt() {
|
|
966
|
+
let e = Gt[Gt.length - 1];
|
|
967
967
|
if (!e) return [];
|
|
968
968
|
let t = [];
|
|
969
969
|
for (; e;) {
|
|
@@ -977,34 +977,34 @@ function Jt() {
|
|
|
977
977
|
}
|
|
978
978
|
return t;
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Xt(e) {
|
|
981
981
|
let t = [];
|
|
982
982
|
return e.forEach((e, n) => {
|
|
983
|
-
t.push(...n === 0 ? [] : ["\n"], ...
|
|
983
|
+
t.push(...n === 0 ? [] : ["\n"], ...Zt(e));
|
|
984
984
|
}), t;
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function Zt({ vnode: e, recurseCount: t }) {
|
|
987
987
|
let n = t > 0 ? `... (${t} recursive calls)` : "", r = e.component ? e.component.parent == null : !1, i = ` at <${zr(e.component, e.type, r)}`, a = ">" + n;
|
|
988
988
|
return e.props ? [
|
|
989
989
|
i,
|
|
990
|
-
...
|
|
990
|
+
...Qt(e.props),
|
|
991
991
|
a
|
|
992
992
|
] : [i + a];
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Qt(e) {
|
|
995
995
|
let t = [], n = Object.keys(e);
|
|
996
996
|
return n.slice(0, 3).forEach((n) => {
|
|
997
|
-
t.push(
|
|
997
|
+
t.push(...$t(n, e[n]));
|
|
998
998
|
}), n.length > 3 && t.push(" ..."), t;
|
|
999
999
|
}
|
|
1000
|
-
function
|
|
1001
|
-
return k(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */
|
|
1000
|
+
function $t(e, t, n) {
|
|
1001
|
+
return k(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ K(t) ? (t = $t(e, /* @__PURE__ */ G(t.value), !0), n ? t : [
|
|
1002
1002
|
`${e}=Ref<`,
|
|
1003
1003
|
t,
|
|
1004
1004
|
">"
|
|
1005
|
-
]) : O(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */
|
|
1005
|
+
]) : O(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */ G(t), n ? t : [`${e}=`, t]);
|
|
1006
1006
|
}
|
|
1007
|
-
var
|
|
1007
|
+
var en = {
|
|
1008
1008
|
sp: "serverPrefetch hook",
|
|
1009
1009
|
bc: "beforeCreate hook",
|
|
1010
1010
|
c: "created hook",
|
|
@@ -1037,30 +1037,30 @@ var $t = {
|
|
|
1037
1037
|
15: "component update",
|
|
1038
1038
|
16: "app unmount cleanup function"
|
|
1039
1039
|
};
|
|
1040
|
-
function
|
|
1040
|
+
function tn(e, t, n, r) {
|
|
1041
1041
|
try {
|
|
1042
1042
|
return r ? e(...r) : e();
|
|
1043
1043
|
} catch (e) {
|
|
1044
|
-
|
|
1044
|
+
rn(e, t, n);
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function nn(e, t, n, r) {
|
|
1048
1048
|
if (O(e)) {
|
|
1049
|
-
let i =
|
|
1049
|
+
let i = tn(e, t, n, r);
|
|
1050
1050
|
return i && M(i) && i.catch((e) => {
|
|
1051
|
-
|
|
1051
|
+
rn(e, t, n);
|
|
1052
1052
|
}), i;
|
|
1053
1053
|
}
|
|
1054
1054
|
if (E(e)) {
|
|
1055
1055
|
let i = [];
|
|
1056
|
-
for (let a = 0; a < e.length; a++) i.push(
|
|
1056
|
+
for (let a = 0; a < e.length; a++) i.push(nn(e[a], t, n, r));
|
|
1057
1057
|
return i;
|
|
1058
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
1058
|
+
} else process.env.NODE_ENV !== "production" && q(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function rn(e, t, n, r = !0) {
|
|
1061
1061
|
let i = t ? t.vnode : null, { errorHandler: a, throwUnhandledErrorInProduction: o } = t && t.appContext.config || v;
|
|
1062
1062
|
if (t) {
|
|
1063
|
-
let r = t.parent, i = t.proxy, o = process.env.NODE_ENV === "production" ? `https://vuejs.org/error-reference/#runtime-${n}` :
|
|
1063
|
+
let r = t.parent, i = t.proxy, o = process.env.NODE_ENV === "production" ? `https://vuejs.org/error-reference/#runtime-${n}` : en[n];
|
|
1064
1064
|
for (; r;) {
|
|
1065
1065
|
let t = r.ec;
|
|
1066
1066
|
if (t) {
|
|
@@ -1069,133 +1069,133 @@ function nn(e, t, n, r = !0) {
|
|
|
1069
1069
|
r = r.parent;
|
|
1070
1070
|
}
|
|
1071
1071
|
if (a) {
|
|
1072
|
-
|
|
1072
|
+
Oe(), tn(a, null, 10, [
|
|
1073
1073
|
e,
|
|
1074
1074
|
i,
|
|
1075
1075
|
o
|
|
1076
|
-
]),
|
|
1076
|
+
]), ke();
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1080
|
+
an(e, n, i, r, o);
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function an(e, t, n, r = !0, i = !1) {
|
|
1083
1083
|
if (process.env.NODE_ENV !== "production") {
|
|
1084
|
-
let i =
|
|
1085
|
-
if (n &&
|
|
1084
|
+
let i = en[t];
|
|
1085
|
+
if (n && Kt(n), q(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && qt(), r) throw e;
|
|
1086
1086
|
console.error(e);
|
|
1087
1087
|
} else if (i) throw e;
|
|
1088
1088
|
else console.error(e);
|
|
1089
1089
|
}
|
|
1090
|
-
var
|
|
1091
|
-
function
|
|
1092
|
-
let t =
|
|
1090
|
+
var on = [], sn = -1, cn = [], ln = null, un = 0, dn = /* @__PURE__ */ Promise.resolve(), fn = null, pn = 100;
|
|
1091
|
+
function mn(e) {
|
|
1092
|
+
let t = fn || dn;
|
|
1093
1093
|
return e ? t.then(this ? e.bind(this) : e) : t;
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1096
|
-
let t =
|
|
1095
|
+
function hn(e) {
|
|
1096
|
+
let t = sn + 1, n = on.length;
|
|
1097
1097
|
for (; t < n;) {
|
|
1098
|
-
let r = t + n >>> 1, i =
|
|
1098
|
+
let r = t + n >>> 1, i = on[r], a = bn(i);
|
|
1099
1099
|
a < e || a === e && i.flags & 2 ? t = r + 1 : n = r;
|
|
1100
1100
|
}
|
|
1101
1101
|
return t;
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function gn(e) {
|
|
1104
1104
|
if (!(e.flags & 1)) {
|
|
1105
|
-
let t =
|
|
1106
|
-
!n || !(e.flags & 2) && t >=
|
|
1105
|
+
let t = bn(e), n = on[on.length - 1];
|
|
1106
|
+
!n || !(e.flags & 2) && t >= bn(n) ? on.push(e) : on.splice(hn(t), 0, e), e.flags |= 1, _n();
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
|
|
1111
|
-
}
|
|
1112
|
-
function _n(e) {
|
|
1113
|
-
E(e) ? sn.push(...e) : cn && e.id === -1 ? cn.splice(ln + 1, 0, e) : e.flags & 1 || (sn.push(e), e.flags |= 1), gn();
|
|
1109
|
+
function _n() {
|
|
1110
|
+
fn ||= dn.then(xn);
|
|
1114
1111
|
}
|
|
1115
1112
|
function vn(e) {
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1113
|
+
E(e) ? cn.push(...e) : ln && e.id === -1 ? ln.splice(un + 1, 0, e) : e.flags & 1 || (cn.push(e), e.flags |= 1), _n();
|
|
1114
|
+
}
|
|
1115
|
+
function yn(e) {
|
|
1116
|
+
if (cn.length) {
|
|
1117
|
+
let t = [...new Set(cn)].sort((e, t) => bn(e) - bn(t));
|
|
1118
|
+
if (cn.length = 0, ln) {
|
|
1119
|
+
ln.push(...t);
|
|
1120
1120
|
return;
|
|
1121
1121
|
}
|
|
1122
|
-
for (
|
|
1123
|
-
let t =
|
|
1124
|
-
process.env.NODE_ENV !== "production" &&
|
|
1122
|
+
for (ln = t, process.env.NODE_ENV !== "production" && (e ||= /* @__PURE__ */ new Map()), un = 0; un < ln.length; un++) {
|
|
1123
|
+
let t = ln[un];
|
|
1124
|
+
process.env.NODE_ENV !== "production" && Sn(e, t) || (t.flags & 4 && (t.flags &= -2), t.flags & 8 || t(), t.flags &= -2);
|
|
1125
1125
|
}
|
|
1126
|
-
|
|
1126
|
+
ln = null, un = 0;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var
|
|
1130
|
-
function
|
|
1129
|
+
var bn = (e) => e.id == null ? e.flags & 2 ? -1 : Infinity : e.id;
|
|
1130
|
+
function xn(e) {
|
|
1131
1131
|
process.env.NODE_ENV !== "production" && (e ||= /* @__PURE__ */ new Map());
|
|
1132
|
-
let t = process.env.NODE_ENV === "production" ? y : (t) =>
|
|
1132
|
+
let t = process.env.NODE_ENV === "production" ? y : (t) => Sn(e, t);
|
|
1133
1133
|
try {
|
|
1134
|
-
for (
|
|
1135
|
-
let e =
|
|
1134
|
+
for (sn = 0; sn < on.length; sn++) {
|
|
1135
|
+
let e = on[sn];
|
|
1136
1136
|
if (e && !(e.flags & 8)) {
|
|
1137
1137
|
if (process.env.NODE_ENV !== "production" && t(e)) continue;
|
|
1138
|
-
e.flags & 4 && (e.flags &= -2),
|
|
1138
|
+
e.flags & 4 && (e.flags &= -2), tn(e, e.i, e.i ? 15 : 14), e.flags & 4 || (e.flags &= -2);
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
1141
|
} finally {
|
|
1142
|
-
for (;
|
|
1143
|
-
let e =
|
|
1142
|
+
for (; sn < on.length; sn++) {
|
|
1143
|
+
let e = on[sn];
|
|
1144
1144
|
e && (e.flags &= -2);
|
|
1145
1145
|
}
|
|
1146
|
-
|
|
1146
|
+
sn = -1, on.length = 0, yn(e), fn = null, (on.length || cn.length) && xn(e);
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function Sn(e, t) {
|
|
1150
1150
|
let n = e.get(t) || 0;
|
|
1151
|
-
if (n >
|
|
1151
|
+
if (n > pn) {
|
|
1152
1152
|
let e = t.i, n = e && Rr(e.type);
|
|
1153
|
-
return
|
|
1153
|
+
return rn(`Maximum recursive updates exceeded${n ? ` in component <${n}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, null, 10), !0;
|
|
1154
1154
|
}
|
|
1155
1155
|
return e.set(t, n + 1), !1;
|
|
1156
1156
|
}
|
|
1157
|
-
var Sn = /* @__PURE__ */ new Map();
|
|
1158
|
-
process.env.NODE_ENV !== "production" && (L().__VUE_HMR_RUNTIME__ = {
|
|
1159
|
-
createRecord: kn(wn),
|
|
1160
|
-
rerender: kn(En),
|
|
1161
|
-
reload: kn(Dn)
|
|
1162
|
-
});
|
|
1163
1157
|
var Cn = /* @__PURE__ */ new Map();
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1158
|
+
process.env.NODE_ENV !== "production" && (I().__VUE_HMR_RUNTIME__ = {
|
|
1159
|
+
createRecord: An(Tn),
|
|
1160
|
+
rerender: An(Dn),
|
|
1161
|
+
reload: An(On)
|
|
1162
|
+
});
|
|
1163
|
+
var wn = /* @__PURE__ */ new Map();
|
|
1164
|
+
function Tn(e, t) {
|
|
1165
|
+
return wn.has(e) ? !1 : (wn.set(e, {
|
|
1166
|
+
initialDef: En(t),
|
|
1167
1167
|
instances: /* @__PURE__ */ new Set()
|
|
1168
1168
|
}), !0);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function En(e) {
|
|
1171
1171
|
return Br(e) ? e.__vccOpts : e;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
let n =
|
|
1173
|
+
function Dn(e, t) {
|
|
1174
|
+
let n = wn.get(e);
|
|
1175
1175
|
n && (n.initialDef.render = t, [...n.instances].forEach((e) => {
|
|
1176
|
-
t && (e.render = t,
|
|
1176
|
+
t && (e.render = t, En(e.type).render = t), e.renderCache = [], e.job.flags & 8 || e.update();
|
|
1177
1177
|
}));
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1180
|
-
let n =
|
|
1179
|
+
function On(e, t) {
|
|
1180
|
+
let n = wn.get(e);
|
|
1181
1181
|
if (!n) return;
|
|
1182
|
-
t =
|
|
1182
|
+
t = En(t), kn(n.initialDef, t);
|
|
1183
1183
|
let r = [...n.instances];
|
|
1184
1184
|
for (let e = 0; e < r.length; e++) {
|
|
1185
|
-
let i = r[e], a =
|
|
1186
|
-
o || (a !== n.initialDef &&
|
|
1185
|
+
let i = r[e], a = En(i.type), o = Cn.get(a);
|
|
1186
|
+
o || (a !== n.initialDef && kn(a, t), Cn.set(a, o = /* @__PURE__ */ new Set())), o.add(i), i.appContext.propsCache.delete(i.type), i.appContext.emitsCache.delete(i.type), i.appContext.optionsCache.delete(i.type), i.ceReload ? (o.add(i), i.ceReload(t.styles), o.delete(i)) : i.parent ? gn(() => {
|
|
1187
1187
|
i.job.flags & 8 || (i.parent.update(), o.delete(i));
|
|
1188
1188
|
}) : i.appContext.reload ? i.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn("[HMR] Root or manually mounted instance modified. Full reload required."), i.root.ce && i !== i.root && i.root.ce._removeChildStyle(a);
|
|
1189
1189
|
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1190
|
+
vn(() => {
|
|
1191
|
+
Cn.clear();
|
|
1192
1192
|
});
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function kn(e, t) {
|
|
1195
1195
|
S(e, t);
|
|
1196
1196
|
for (let n in e) n !== "__file" && !(n in t) && delete e[n];
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function An(e) {
|
|
1199
1199
|
return (t, n) => {
|
|
1200
1200
|
try {
|
|
1201
1201
|
return e(t, n);
|
|
@@ -1204,39 +1204,39 @@ function kn(e) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
};
|
|
1206
1206
|
}
|
|
1207
|
-
var
|
|
1208
|
-
function
|
|
1209
|
-
|
|
1210
|
-
|
|
1207
|
+
var jn, Mn = [];
|
|
1208
|
+
function Nn(e, t) {
|
|
1209
|
+
jn = e, jn ? (jn.enabled = !0, Mn.forEach(({ event: e, args: t }) => jn.emit(e, ...t)), Mn = []) : typeof window < "u" && window.HTMLElement && !(window.navigator?.userAgent)?.includes("jsdom") ? ((t.__VUE_DEVTOOLS_HOOK_REPLAY__ = t.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((e) => {
|
|
1210
|
+
Nn(e, t);
|
|
1211
1211
|
}), setTimeout(() => {
|
|
1212
|
-
|
|
1213
|
-
}, 3e3)) :
|
|
1212
|
+
jn || (t.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, Mn = []);
|
|
1213
|
+
}, 3e3)) : Mn = [];
|
|
1214
1214
|
}
|
|
1215
|
-
var
|
|
1216
|
-
function
|
|
1215
|
+
var Pn = null, Fn = null;
|
|
1216
|
+
function In(e, t, n = !1) {
|
|
1217
1217
|
let r = Ar();
|
|
1218
1218
|
if (r || or) {
|
|
1219
1219
|
let i = or ? or._context.provides : r ? r.parent == null || r.ce ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : void 0;
|
|
1220
1220
|
if (i && e in i) return i[e];
|
|
1221
1221
|
if (arguments.length > 1) return n && O(t) ? t.call(r && r.proxy) : t;
|
|
1222
|
-
process.env.NODE_ENV !== "production" &&
|
|
1223
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
1222
|
+
process.env.NODE_ENV !== "production" && q(`injection "${String(e)}" not found.`);
|
|
1223
|
+
} else process.env.NODE_ENV !== "production" && q("inject() can only be used inside setup() or functional components.");
|
|
1224
1224
|
}
|
|
1225
|
-
var
|
|
1225
|
+
var Ln = /* @__PURE__ */ Symbol.for("v-scx"), Rn = () => {
|
|
1226
1226
|
{
|
|
1227
|
-
let e =
|
|
1228
|
-
return e || process.env.NODE_ENV !== "production" &&
|
|
1227
|
+
let e = In(Ln);
|
|
1228
|
+
return e || process.env.NODE_ENV !== "production" && q("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."), e;
|
|
1229
1229
|
}
|
|
1230
1230
|
};
|
|
1231
|
-
function
|
|
1231
|
+
function zn(e, t, n = v) {
|
|
1232
1232
|
let { immediate: r, deep: i, flush: a, once: o } = n;
|
|
1233
|
-
process.env.NODE_ENV !== "production" && !t && (r !== void 0 &&
|
|
1233
|
+
process.env.NODE_ENV !== "production" && !t && (r !== void 0 && q("watch() \"immediate\" option is only respected when using the watch(source, callback, options?) signature."), i !== void 0 && q("watch() \"deep\" option is only respected when using the watch(source, callback, options?) signature."), o !== void 0 && q("watch() \"once\" option is only respected when using the watch(source, callback, options?) signature."));
|
|
1234
1234
|
let s = S({}, n);
|
|
1235
|
-
process.env.NODE_ENV !== "production" && (s.onWarn =
|
|
1235
|
+
process.env.NODE_ENV !== "production" && (s.onWarn = q);
|
|
1236
1236
|
let c = t && r || !t && a !== "post", l;
|
|
1237
1237
|
if (Pr) {
|
|
1238
1238
|
if (a === "sync") {
|
|
1239
|
-
let e =
|
|
1239
|
+
let e = Rn();
|
|
1240
1240
|
l = e.__watcherHandles ||= [];
|
|
1241
1241
|
} else if (!c) {
|
|
1242
1242
|
let e = () => {};
|
|
@@ -1244,25 +1244,25 @@ function Rn(e, t, n = v) {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
1246
|
let u = kr;
|
|
1247
|
-
s.call = (e, t, n) =>
|
|
1247
|
+
s.call = (e, t, n) => nn(e, u, t, n);
|
|
1248
1248
|
let d = !1;
|
|
1249
1249
|
a === "post" ? s.scheduler = (e) => {
|
|
1250
1250
|
lr(e, u && u.suspense);
|
|
1251
1251
|
} : a !== "sync" && (d = !0, s.scheduler = (e, t) => {
|
|
1252
|
-
t ? e() :
|
|
1252
|
+
t ? e() : gn(e);
|
|
1253
1253
|
}), s.augmentJob = (e) => {
|
|
1254
1254
|
t && (e.flags |= 4), d && (e.flags |= 2, u && (e.id = u.uid, e.i = u));
|
|
1255
1255
|
};
|
|
1256
|
-
let f =
|
|
1256
|
+
let f = Ut(e, t, s);
|
|
1257
1257
|
return Pr && (l ? l.push(f) : c && f()), f;
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1260
|
-
let r = this.proxy, i = k(e) ? e.includes(".") ?
|
|
1259
|
+
function Bn(e, t, n) {
|
|
1260
|
+
let r = this.proxy, i = k(e) ? e.includes(".") ? Vn(r, e) : () => r[e] : e.bind(r, r), a;
|
|
1261
1261
|
O(t) ? a = t : (a = t.handler, n = t);
|
|
1262
|
-
let o = Mr(this), s =
|
|
1262
|
+
let o = Mr(this), s = zn(i, a.bind(r), n);
|
|
1263
1263
|
return o(), s;
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function Vn(e, t) {
|
|
1266
1266
|
let n = t.split(".");
|
|
1267
1267
|
return () => {
|
|
1268
1268
|
let t = e;
|
|
@@ -1270,30 +1270,30 @@ function Bn(e, t) {
|
|
|
1270
1270
|
return t;
|
|
1271
1271
|
};
|
|
1272
1272
|
}
|
|
1273
|
-
var
|
|
1274
|
-
function
|
|
1275
|
-
e.shapeFlag & 6 && e.component ? (e.transition = t,
|
|
1273
|
+
var Hn = (e) => e.__isTeleport;
|
|
1274
|
+
function Un(e, t) {
|
|
1275
|
+
e.shapeFlag & 6 && e.component ? (e.transition = t, Un(e.component.subTree, t)) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
|
|
1276
1276
|
}
|
|
1277
|
-
|
|
1278
|
-
var
|
|
1277
|
+
I().requestIdleCallback, I().cancelIdleCallback;
|
|
1278
|
+
var Wn = /* @__PURE__ */ Symbol.for("v-ndc"), Gn = (e) => e ? Nr(e) ? Fr(e) : Gn(e.parent) : null, Kn = /* @__PURE__ */ S(/* @__PURE__ */ Object.create(null), {
|
|
1279
1279
|
$: (e) => e,
|
|
1280
1280
|
$el: (e) => e.vnode.el,
|
|
1281
1281
|
$data: (e) => e.data,
|
|
1282
|
-
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */
|
|
1283
|
-
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */
|
|
1284
|
-
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */
|
|
1285
|
-
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */
|
|
1286
|
-
$parent: (e) =>
|
|
1287
|
-
$root: (e) =>
|
|
1282
|
+
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */ bt(e.props),
|
|
1283
|
+
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */ bt(e.attrs),
|
|
1284
|
+
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */ bt(e.slots),
|
|
1285
|
+
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */ bt(e.refs),
|
|
1286
|
+
$parent: (e) => Gn(e.parent),
|
|
1287
|
+
$root: (e) => Gn(e.root),
|
|
1288
1288
|
$host: (e) => e.ce,
|
|
1289
1289
|
$emit: (e) => e.emit,
|
|
1290
|
-
$options: (e) =>
|
|
1290
|
+
$options: (e) => Zn(e),
|
|
1291
1291
|
$forceUpdate: (e) => e.f ||= () => {
|
|
1292
|
-
|
|
1292
|
+
gn(e.update);
|
|
1293
1293
|
},
|
|
1294
|
-
$nextTick: (e) => e.n ||=
|
|
1295
|
-
$watch: (e) =>
|
|
1296
|
-
}),
|
|
1294
|
+
$nextTick: (e) => e.n ||= mn.bind(e.proxy),
|
|
1295
|
+
$watch: (e) => Bn.bind(e)
|
|
1296
|
+
}), qn = (e, t) => e !== v && !e.__isScriptSetup && T(e, t), Jn = {
|
|
1297
1297
|
get({ _: e }, t) {
|
|
1298
1298
|
if (t === "__v_skip") return !0;
|
|
1299
1299
|
let { ctx: n, setupState: r, data: i, props: a, accessCache: o, type: s, appContext: c } = e;
|
|
@@ -1306,14 +1306,14 @@ var Un = /* @__PURE__ */ Symbol.for("v-ndc"), Wn = (e) => e ? Nr(e) ? Fr(e) : Wn
|
|
|
1306
1306
|
case 4: return n[t];
|
|
1307
1307
|
case 3: return a[t];
|
|
1308
1308
|
}
|
|
1309
|
-
else if (
|
|
1309
|
+
else if (qn(r, t)) return o[t] = 1, r[t];
|
|
1310
1310
|
else if (i !== v && T(i, t)) return o[t] = 2, i[t];
|
|
1311
1311
|
else if (T(a, t)) return o[t] = 3, a[t];
|
|
1312
1312
|
else if (n !== v && T(n, t)) return o[t] = 4, n[t];
|
|
1313
|
-
else
|
|
1313
|
+
else Xn && (o[t] = 0);
|
|
1314
1314
|
}
|
|
1315
|
-
let l =
|
|
1316
|
-
if (l) return t === "$attrs" ? (
|
|
1315
|
+
let l = Kn[t], u, d;
|
|
1316
|
+
if (l) return t === "$attrs" ? (H(e.attrs, "get", ""), process.env.NODE_ENV) : process.env.NODE_ENV !== "production" && t === "$slots" && H(e, "get", t), l(e);
|
|
1317
1317
|
if ((u = s.__cssModules) && (u = u[t])) return u;
|
|
1318
1318
|
if (n !== v && T(n, t)) return o[t] = 4, n[t];
|
|
1319
1319
|
if (d = c.config.globalProperties, T(d, t)) return d[t];
|
|
@@ -1321,7 +1321,7 @@ var Un = /* @__PURE__ */ Symbol.for("v-ndc"), Wn = (e) => e ? Nr(e) ? Fr(e) : Wn
|
|
|
1321
1321
|
},
|
|
1322
1322
|
set({ _: e }, t, n) {
|
|
1323
1323
|
let { data: r, setupState: i, ctx: a } = e;
|
|
1324
|
-
return
|
|
1324
|
+
return qn(i, t) ? (i[t] = n, !0) : process.env.NODE_ENV !== "production" && i.__isScriptSetup && T(i, t) ? (q(`Cannot mutate <script setup> binding "${t}" from Options API.`), !1) : r !== v && T(r, t) ? (r[t] = n, !0) : T(e.props, t) ? (process.env.NODE_ENV !== "production" && q(`Attempting to mutate prop "${t}". Props are readonly.`), !1) : t[0] === "$" && t.slice(1) in e ? (process.env.NODE_ENV !== "production" && q(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`), !1) : (process.env.NODE_ENV !== "production" && t in e.appContext.config.globalProperties ? Object.defineProperty(a, t, {
|
|
1325
1325
|
enumerable: !0,
|
|
1326
1326
|
configurable: !0,
|
|
1327
1327
|
value: n
|
|
@@ -1329,66 +1329,66 @@ var Un = /* @__PURE__ */ Symbol.for("v-ndc"), Wn = (e) => e ? Nr(e) ? Fr(e) : Wn
|
|
|
1329
1329
|
},
|
|
1330
1330
|
has({ _: { data: e, setupState: t, accessCache: n, ctx: r, appContext: i, props: a, type: o } }, s) {
|
|
1331
1331
|
let c;
|
|
1332
|
-
return !!(n[s] || e !== v && s[0] !== "$" && T(e, s) ||
|
|
1332
|
+
return !!(n[s] || e !== v && s[0] !== "$" && T(e, s) || qn(t, s) || T(a, s) || T(r, s) || T(Kn, s) || T(i.config.globalProperties, s) || (c = o.__cssModules) && c[s]);
|
|
1333
1333
|
},
|
|
1334
1334
|
defineProperty(e, t, n) {
|
|
1335
1335
|
return n.get == null ? T(n, "value") && this.set(e, t, n.value, null) : e._.accessCache[t] = 0, Reflect.defineProperty(e, t, n);
|
|
1336
1336
|
}
|
|
1337
1337
|
};
|
|
1338
|
-
process.env.NODE_ENV !== "production" && (
|
|
1339
|
-
function
|
|
1338
|
+
process.env.NODE_ENV !== "production" && (Jn.ownKeys = (e) => (q("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."), Reflect.ownKeys(e)));
|
|
1339
|
+
function Yn(e) {
|
|
1340
1340
|
return E(e) ? e.reduce((e, t) => (e[t] = null, e), {}) : e;
|
|
1341
1341
|
}
|
|
1342
|
-
var
|
|
1343
|
-
function
|
|
1342
|
+
var Xn = !0;
|
|
1343
|
+
function Zn(e) {
|
|
1344
1344
|
let t = e.type, { mixins: n, extends: r } = t, { mixins: i, optionsCache: a, config: { optionMergeStrategies: o } } = e.appContext, s = a.get(t), c;
|
|
1345
|
-
return s ? c = s : !i.length && !n && !r ? c = t : (c = {}, i.length && i.forEach((e) =>
|
|
1345
|
+
return s ? c = s : !i.length && !n && !r ? c = t : (c = {}, i.length && i.forEach((e) => Qn(c, e, o, !0)), Qn(c, t, o)), j(t) && a.set(t, c), c;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Qn(e, t, n, r = !1) {
|
|
1348
1348
|
let { mixins: i, extends: a } = t;
|
|
1349
|
-
a &&
|
|
1350
|
-
for (let i in t) if (r && i === "expose") process.env.NODE_ENV !== "production" &&
|
|
1349
|
+
a && Qn(e, a, n, !0), i && i.forEach((t) => Qn(e, t, n, !0));
|
|
1350
|
+
for (let i in t) if (r && i === "expose") process.env.NODE_ENV !== "production" && q("\"expose\" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.");
|
|
1351
1351
|
else {
|
|
1352
|
-
let r =
|
|
1352
|
+
let r = $n[i] || n && n[i];
|
|
1353
1353
|
e[i] = r ? r(e[i], t[i]) : t[i];
|
|
1354
1354
|
}
|
|
1355
1355
|
return e;
|
|
1356
1356
|
}
|
|
1357
|
-
var
|
|
1358
|
-
data:
|
|
1357
|
+
var $n = {
|
|
1358
|
+
data: er,
|
|
1359
1359
|
props: ir,
|
|
1360
1360
|
emits: ir,
|
|
1361
1361
|
methods: rr,
|
|
1362
1362
|
computed: rr,
|
|
1363
|
-
beforeCreate:
|
|
1364
|
-
created:
|
|
1365
|
-
beforeMount:
|
|
1366
|
-
mounted:
|
|
1367
|
-
beforeUpdate:
|
|
1368
|
-
updated:
|
|
1369
|
-
beforeDestroy:
|
|
1370
|
-
beforeUnmount:
|
|
1371
|
-
destroyed:
|
|
1372
|
-
unmounted:
|
|
1373
|
-
activated:
|
|
1374
|
-
deactivated:
|
|
1375
|
-
errorCaptured:
|
|
1376
|
-
serverPrefetch:
|
|
1363
|
+
beforeCreate: J,
|
|
1364
|
+
created: J,
|
|
1365
|
+
beforeMount: J,
|
|
1366
|
+
mounted: J,
|
|
1367
|
+
beforeUpdate: J,
|
|
1368
|
+
updated: J,
|
|
1369
|
+
beforeDestroy: J,
|
|
1370
|
+
beforeUnmount: J,
|
|
1371
|
+
destroyed: J,
|
|
1372
|
+
unmounted: J,
|
|
1373
|
+
activated: J,
|
|
1374
|
+
deactivated: J,
|
|
1375
|
+
errorCaptured: J,
|
|
1376
|
+
serverPrefetch: J,
|
|
1377
1377
|
components: rr,
|
|
1378
1378
|
directives: rr,
|
|
1379
1379
|
watch: ar,
|
|
1380
|
-
provide:
|
|
1381
|
-
inject:
|
|
1380
|
+
provide: er,
|
|
1381
|
+
inject: tr
|
|
1382
1382
|
};
|
|
1383
|
-
function
|
|
1383
|
+
function er(e, t) {
|
|
1384
1384
|
return t ? e ? function() {
|
|
1385
1385
|
return S(O(e) ? e.call(this, this) : e, O(t) ? t.call(this, this) : t);
|
|
1386
1386
|
} : t : e;
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1389
|
-
return rr(
|
|
1388
|
+
function tr(e, t) {
|
|
1389
|
+
return rr(nr(e), nr(t));
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function nr(e) {
|
|
1392
1392
|
if (E(e)) {
|
|
1393
1393
|
let t = {};
|
|
1394
1394
|
for (let n = 0; n < e.length; n++) t[e[n]] = e[n];
|
|
@@ -1396,32 +1396,32 @@ function tr(e) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
return e;
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function J(e, t) {
|
|
1400
1400
|
return e ? [...new Set([].concat(e, t))] : t;
|
|
1401
1401
|
}
|
|
1402
1402
|
function rr(e, t) {
|
|
1403
1403
|
return e ? S(/* @__PURE__ */ Object.create(null), e, t) : t;
|
|
1404
1404
|
}
|
|
1405
1405
|
function ir(e, t) {
|
|
1406
|
-
return e ? E(e) && E(t) ? [.../* @__PURE__ */ new Set([...e, ...t])] : S(/* @__PURE__ */ Object.create(null),
|
|
1406
|
+
return e ? E(e) && E(t) ? [.../* @__PURE__ */ new Set([...e, ...t])] : S(/* @__PURE__ */ Object.create(null), Yn(e), Yn(t ?? {})) : t;
|
|
1407
1407
|
}
|
|
1408
1408
|
function ar(e, t) {
|
|
1409
1409
|
if (!e) return t;
|
|
1410
1410
|
if (!t) return e;
|
|
1411
1411
|
let n = S(/* @__PURE__ */ Object.create(null), e);
|
|
1412
|
-
for (let r in t) n[r] =
|
|
1412
|
+
for (let r in t) n[r] = J(e[r], t[r]);
|
|
1413
1413
|
return n;
|
|
1414
1414
|
}
|
|
1415
1415
|
var or = null, sr = {}, cr = (e) => Object.getPrototypeOf(e) === sr, lr = dr, ur = (e) => e.__isSuspense;
|
|
1416
1416
|
function dr(e, t) {
|
|
1417
|
-
t && t.pendingBranch ? E(e) ? t.effects.push(...e) : t.effects.push(e) :
|
|
1417
|
+
t && t.pendingBranch ? E(e) ? t.effects.push(...e) : t.effects.push(e) : vn(e);
|
|
1418
1418
|
}
|
|
1419
1419
|
var fr = /* @__PURE__ */ Symbol.for("v-fgt"), pr = /* @__PURE__ */ Symbol.for("v-txt"), mr = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
1420
1420
|
function hr(e) {
|
|
1421
1421
|
return e ? e.__v_isVNode === !0 : !1;
|
|
1422
1422
|
}
|
|
1423
|
-
var gr, _r = (...e) => Sr(...gr ? gr(e,
|
|
1424
|
-
i:
|
|
1423
|
+
var gr, _r = (...e) => Sr(...gr ? gr(e, Pn) : e), vr = ({ key: e }) => e ?? null, yr = ({ ref: e, ref_key: t, ref_for: n }) => (typeof e == "number" && (e = "" + e), e == null ? null : k(e) || /* @__PURE__ */ K(e) || O(e) ? {
|
|
1424
|
+
i: Pn,
|
|
1425
1425
|
r: e,
|
|
1426
1426
|
k: t,
|
|
1427
1427
|
f: !!n
|
|
@@ -1434,7 +1434,7 @@ function br(e, t = null, n = null, r = 0, i = null, a = e === fr ? 0 : 1, o = !1
|
|
|
1434
1434
|
props: t,
|
|
1435
1435
|
key: t && vr(t),
|
|
1436
1436
|
ref: t && yr(t),
|
|
1437
|
-
scopeId:
|
|
1437
|
+
scopeId: Fn,
|
|
1438
1438
|
slotScopeIds: null,
|
|
1439
1439
|
children: n,
|
|
1440
1440
|
component: null,
|
|
@@ -1454,26 +1454,26 @@ function br(e, t = null, n = null, r = 0, i = null, a = e === fr ? 0 : 1, o = !1
|
|
|
1454
1454
|
dynamicProps: i,
|
|
1455
1455
|
dynamicChildren: null,
|
|
1456
1456
|
appContext: null,
|
|
1457
|
-
ctx:
|
|
1457
|
+
ctx: Pn
|
|
1458
1458
|
};
|
|
1459
|
-
return s ? (Dr(c, n), a & 128 && e.normalize(c)) : n && (c.shapeFlag |= k(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key &&
|
|
1459
|
+
return s ? (Dr(c, n), a & 128 && e.normalize(c)) : n && (c.shapeFlag |= k(n) ? 8 : 16), process.env.NODE_ENV !== "production" && c.key !== c.key && q("VNode created with invalid key (NaN). VNode type:", c.type), c;
|
|
1460
1460
|
}
|
|
1461
1461
|
var xr = process.env.NODE_ENV === "production" ? Sr : _r;
|
|
1462
1462
|
function Sr(e, t = null, n = null, r = 0, i = null, a = !1) {
|
|
1463
|
-
if ((!e || e ===
|
|
1463
|
+
if ((!e || e === Wn) && (process.env.NODE_ENV !== "production" && !e && q(`Invalid vnode type when creating vnode: ${e}.`), e = mr), hr(e)) {
|
|
1464
1464
|
let r = wr(e, t, !0);
|
|
1465
1465
|
return n && Dr(r, n), r.patchFlag = -2, r;
|
|
1466
1466
|
}
|
|
1467
1467
|
if (Br(e) && (e = e.__vccOpts), t) {
|
|
1468
1468
|
t = Cr(t);
|
|
1469
1469
|
let { class: e, style: n } = t;
|
|
1470
|
-
e && !k(e) && (t.class =
|
|
1470
|
+
e && !k(e) && (t.class = ue(e)), j(n) && (/* @__PURE__ */ Tt(n) && !E(n) && (n = S({}, n)), t.style = L(n));
|
|
1471
1471
|
}
|
|
1472
|
-
let o = k(e) ? 1 : ur(e) ? 128 :
|
|
1473
|
-
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */
|
|
1472
|
+
let o = k(e) ? 1 : ur(e) ? 128 : Hn(e) ? 64 : j(e) ? 4 : O(e) ? 2 : 0;
|
|
1473
|
+
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ Tt(e) && (e = /* @__PURE__ */ G(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)), br(e, t, n, r, i, o, a, !0);
|
|
1474
1474
|
}
|
|
1475
1475
|
function Cr(e) {
|
|
1476
|
-
return e ? /* @__PURE__ */
|
|
1476
|
+
return e ? /* @__PURE__ */ Tt(e) || cr(e) ? S({}, e) : e : null;
|
|
1477
1477
|
}
|
|
1478
1478
|
function wr(e, t, n = !1, r = !1) {
|
|
1479
1479
|
let { props: i, ref: a, patchFlag: o, children: s, transition: c } = e, l = t ? Or(i || {}, t) : i, u = {
|
|
@@ -1507,7 +1507,7 @@ function wr(e, t, n = !1, r = !1) {
|
|
|
1507
1507
|
ctx: e.ctx,
|
|
1508
1508
|
ce: e.ce
|
|
1509
1509
|
};
|
|
1510
|
-
return c && r &&
|
|
1510
|
+
return c && r && Un(u, c.clone(u)), u;
|
|
1511
1511
|
}
|
|
1512
1512
|
function Tr(e) {
|
|
1513
1513
|
let t = wr(e);
|
|
@@ -1524,7 +1524,7 @@ function Dr(e, t) {
|
|
|
1524
1524
|
let n = t.default;
|
|
1525
1525
|
n && (n._c && (n._d = !1), Dr(e, n()), n._c && (n._d = !0));
|
|
1526
1526
|
return;
|
|
1527
|
-
} else n = 32, !t._ && !cr(t) && (t._ctx =
|
|
1527
|
+
} else n = 32, !t._ && !cr(t) && (t._ctx = Pn);
|
|
1528
1528
|
else if (O(t)) {
|
|
1529
1529
|
if (r & 65) {
|
|
1530
1530
|
Dr(e, { default: t });
|
|
@@ -1532,7 +1532,7 @@ function Dr(e, t) {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
t = {
|
|
1534
1534
|
default: t,
|
|
1535
|
-
_ctx:
|
|
1535
|
+
_ctx: Pn
|
|
1536
1536
|
}, n = 32;
|
|
1537
1537
|
} else t = String(t), r & 64 ? (n = 16, t = [Er(t)]) : n = 8;
|
|
1538
1538
|
e.children = t, e.shapeFlag |= n;
|
|
@@ -1541,8 +1541,8 @@ function Or(...e) {
|
|
|
1541
1541
|
let t = {};
|
|
1542
1542
|
for (let n = 0; n < e.length; n++) {
|
|
1543
1543
|
let r = e[n];
|
|
1544
|
-
for (let e in r) if (e === "class") t.class !== r.class && (t.class =
|
|
1545
|
-
else if (e === "style") t.style =
|
|
1544
|
+
for (let e in r) if (e === "class") t.class !== r.class && (t.class = ue([t.class, r.class]));
|
|
1545
|
+
else if (e === "style") t.style = L([t.style, r.style]);
|
|
1546
1546
|
else if (b(e)) {
|
|
1547
1547
|
let n = t[e], i = r[e];
|
|
1548
1548
|
i && n !== i && !(E(n) && n.includes(i)) ? t[e] = n ? [].concat(n, i) : i : i == null && n == null && !x(e) && (t[e] = i);
|
|
@@ -1550,9 +1550,9 @@ function Or(...e) {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
return t;
|
|
1552
1552
|
}
|
|
1553
|
-
var kr = null, Ar = () => kr ||
|
|
1553
|
+
var kr = null, Ar = () => kr || Pn, jr;
|
|
1554
1554
|
{
|
|
1555
|
-
let e =
|
|
1555
|
+
let e = I(), t = (t, n) => {
|
|
1556
1556
|
let r;
|
|
1557
1557
|
return (r = e[t]) || (r = e[t] = []), r.push(n), (e) => {
|
|
1558
1558
|
r.length > 1 ? r.forEach((t) => t(e)) : r[0](e);
|
|
@@ -1572,13 +1572,13 @@ function Nr(e) {
|
|
|
1572
1572
|
var Pr = !1;
|
|
1573
1573
|
process.env.NODE_ENV;
|
|
1574
1574
|
function Fr(e) {
|
|
1575
|
-
return e.exposed ? e.exposeProxy ||= new Proxy(
|
|
1575
|
+
return e.exposed ? e.exposeProxy ||= new Proxy(It(Et(e.exposed)), {
|
|
1576
1576
|
get(t, n) {
|
|
1577
1577
|
if (n in t) return t[n];
|
|
1578
|
-
if (n in
|
|
1578
|
+
if (n in Kn) return Kn[n](e);
|
|
1579
1579
|
},
|
|
1580
1580
|
has(e, t) {
|
|
1581
|
-
return t in e || t in
|
|
1581
|
+
return t in e || t in Kn;
|
|
1582
1582
|
}
|
|
1583
1583
|
}) : e.proxy;
|
|
1584
1584
|
}
|
|
@@ -1604,7 +1604,7 @@ function Br(e) {
|
|
|
1604
1604
|
return O(e) && "__vccOpts" in e;
|
|
1605
1605
|
}
|
|
1606
1606
|
var Vr = (e, t) => {
|
|
1607
|
-
let n = /* @__PURE__ */
|
|
1607
|
+
let n = /* @__PURE__ */ Rt(e, t, Pr);
|
|
1608
1608
|
if (process.env.NODE_ENV !== "production") {
|
|
1609
1609
|
let e = Ar();
|
|
1610
1610
|
e && e.appContext.config.warnRecursiveComputed && (n._warnRecursive = !0);
|
|
@@ -1622,10 +1622,10 @@ function Hr() {
|
|
|
1622
1622
|
e,
|
|
1623
1623
|
"VueInstance"
|
|
1624
1624
|
];
|
|
1625
|
-
if (/* @__PURE__ */
|
|
1626
|
-
|
|
1625
|
+
if (/* @__PURE__ */ K(t)) {
|
|
1626
|
+
Oe();
|
|
1627
1627
|
let n = t.value;
|
|
1628
|
-
return
|
|
1628
|
+
return ke(), [
|
|
1629
1629
|
"div",
|
|
1630
1630
|
{},
|
|
1631
1631
|
[
|
|
@@ -1637,25 +1637,25 @@ function Hr() {
|
|
|
1637
1637
|
s(n),
|
|
1638
1638
|
">"
|
|
1639
1639
|
];
|
|
1640
|
-
} else if (/* @__PURE__ */
|
|
1640
|
+
} else if (/* @__PURE__ */ St(t)) return [
|
|
1641
1641
|
"div",
|
|
1642
1642
|
{},
|
|
1643
1643
|
[
|
|
1644
1644
|
"span",
|
|
1645
1645
|
e,
|
|
1646
|
-
/* @__PURE__ */
|
|
1646
|
+
/* @__PURE__ */ wt(t) ? "ShallowReactive" : "Reactive"
|
|
1647
1647
|
],
|
|
1648
1648
|
"<",
|
|
1649
1649
|
s(t),
|
|
1650
|
-
`>${/* @__PURE__ */
|
|
1650
|
+
`>${/* @__PURE__ */ Ct(t) ? " (readonly)" : ""}`
|
|
1651
1651
|
];
|
|
1652
|
-
else if (/* @__PURE__ */
|
|
1652
|
+
else if (/* @__PURE__ */ Ct(t)) return [
|
|
1653
1653
|
"div",
|
|
1654
1654
|
{},
|
|
1655
1655
|
[
|
|
1656
1656
|
"span",
|
|
1657
1657
|
e,
|
|
1658
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ wt(t) ? "ShallowReadonly" : "Readonly"
|
|
1659
1659
|
],
|
|
1660
1660
|
"<",
|
|
1661
1661
|
s(t),
|
|
@@ -1676,7 +1676,7 @@ function Hr() {
|
|
|
1676
1676
|
};
|
|
1677
1677
|
function a(e) {
|
|
1678
1678
|
let t = [];
|
|
1679
|
-
e.type.props && e.props && t.push(o("props", /* @__PURE__ */
|
|
1679
|
+
e.type.props && e.props && t.push(o("props", /* @__PURE__ */ G(e.props))), e.setupState !== v && t.push(o("setup", e.setupState)), e.data !== v && t.push(o("data", /* @__PURE__ */ G(e.data)));
|
|
1680
1680
|
let n = c(e, "computed");
|
|
1681
1681
|
n && t.push(o("computed", n));
|
|
1682
1682
|
let i = c(e, "inject");
|
|
@@ -1729,7 +1729,7 @@ function Hr() {
|
|
|
1729
1729
|
"span",
|
|
1730
1730
|
r,
|
|
1731
1731
|
e
|
|
1732
|
-
] : j(e) ? ["object", { object: i ? /* @__PURE__ */
|
|
1732
|
+
] : j(e) ? ["object", { object: i ? /* @__PURE__ */ G(e) : e }] : [
|
|
1733
1733
|
"span",
|
|
1734
1734
|
n,
|
|
1735
1735
|
String(e)
|
|
@@ -1747,7 +1747,7 @@ function Hr() {
|
|
|
1747
1747
|
if (E(r) && r.includes(t) || j(r) && t in r || e.extends && l(e.extends, t, n) || e.mixins && e.mixins.some((e) => l(e, t, n))) return !0;
|
|
1748
1748
|
}
|
|
1749
1749
|
function u(e) {
|
|
1750
|
-
return /* @__PURE__ */
|
|
1750
|
+
return /* @__PURE__ */ wt(e) ? "ShallowRef" : e.effect ? "ComputedRef" : "Ref";
|
|
1751
1751
|
}
|
|
1752
1752
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i];
|
|
1753
1753
|
}
|
|
@@ -2321,22 +2321,22 @@ function Fi(e) {
|
|
|
2321
2321
|
function ne(e) {
|
|
2322
2322
|
A = e, M = ii(A.contextWindow), te = ai(A.contextWindow);
|
|
2323
2323
|
}
|
|
2324
|
-
let N = /* @__PURE__ */
|
|
2324
|
+
let N = /* @__PURE__ */ At([]);
|
|
2325
2325
|
function P(e, t) {
|
|
2326
2326
|
let n = {
|
|
2327
2327
|
timestamp: Date.now(),
|
|
2328
2328
|
type: e,
|
|
2329
2329
|
data: t
|
|
2330
2330
|
};
|
|
2331
|
-
N.value.push(n), N.value.length > ji && N.value.splice(0, N.value.length - ji),
|
|
2331
|
+
N.value.push(n), N.value.length > ji && N.value.splice(0, N.value.length - ji), Nt(N), E?.(n), k && console.log(`%c[Agent] ${e}`, "color:#667eea;font-weight:bold", t);
|
|
2332
2332
|
}
|
|
2333
2333
|
let re = (e) => {
|
|
2334
|
-
N.value.push(e), N.value.length > ji && N.value.splice(0, N.value.length - ji),
|
|
2335
|
-
}, ie = /* @__PURE__ */
|
|
2336
|
-
function
|
|
2337
|
-
if (!
|
|
2334
|
+
N.value.push(e), N.value.length > ji && N.value.splice(0, N.value.length - ji), Nt(N);
|
|
2335
|
+
}, ie = /* @__PURE__ */ At([]), ae = 0, F = !!ee || !!D;
|
|
2336
|
+
function oe(e, t, n, r = {}) {
|
|
2337
|
+
if (!F) return null;
|
|
2338
2338
|
let i = {
|
|
2339
|
-
id: `span-${++
|
|
2339
|
+
id: `span-${++ae}`,
|
|
2340
2340
|
parentId: e,
|
|
2341
2341
|
name: n,
|
|
2342
2342
|
type: t,
|
|
@@ -2344,12 +2344,12 @@ function Fi(e) {
|
|
|
2344
2344
|
status: "ok",
|
|
2345
2345
|
attributes: r
|
|
2346
2346
|
};
|
|
2347
|
-
return ie.value.push(i), ie.value.length > ji && ie.value.splice(0, ie.value.length - ji),
|
|
2347
|
+
return ie.value.push(i), ie.value.length > ji && ie.value.splice(0, ie.value.length - ji), Nt(ie), i;
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2350
|
-
!e || !
|
|
2349
|
+
function I(e, t = "ok", n) {
|
|
2350
|
+
!e || !F || (e.endTs = Date.now(), e.durationMs = e.endTs - e.startTs, e.status = t, n && Object.assign(e.attributes, n), Nt(ie), ee?.(e));
|
|
2351
2351
|
}
|
|
2352
|
-
let
|
|
2352
|
+
let L = [...v.flatMap((e) => e.tools || []), ..._], se = e.llm ?? new n({
|
|
2353
2353
|
apiKey: t,
|
|
2354
2354
|
model: c,
|
|
2355
2355
|
temperature: l,
|
|
@@ -2359,44 +2359,44 @@ function Fi(e) {
|
|
|
2359
2359
|
...f
|
|
2360
2360
|
},
|
|
2361
2361
|
...d ? { modelKwargs: d } : {}
|
|
2362
|
-
}),
|
|
2363
|
-
function
|
|
2364
|
-
|
|
2362
|
+
}), ce = L.length > 0 ? se.bindTools?.(L) ?? se : se;
|
|
2363
|
+
function le() {
|
|
2364
|
+
ce = L.length > 0 ? se.bindTools?.(L) ?? se : se;
|
|
2365
2365
|
}
|
|
2366
|
-
let
|
|
2367
|
-
function
|
|
2366
|
+
let R = si(), ue = .25, de = /* @__PURE__ */ new Set(["mission", "workingMemory"]);
|
|
2367
|
+
function fe() {
|
|
2368
2368
|
let e = g || "你是一个智能助手。", t = [];
|
|
2369
2369
|
for (let e of v) if (e.augmentPrompt) {
|
|
2370
|
-
let n = e.augmentPrompt(
|
|
2370
|
+
let n = e.augmentPrompt(R);
|
|
2371
2371
|
n && t.push({
|
|
2372
2372
|
name: e.name,
|
|
2373
2373
|
text: n,
|
|
2374
2374
|
tokens: X(n),
|
|
2375
|
-
pin:
|
|
2375
|
+
pin: de.has(e.name)
|
|
2376
2376
|
});
|
|
2377
2377
|
}
|
|
2378
|
-
let n = Math.max(2e3, Math.round(A.contextWindow *
|
|
2378
|
+
let n = Math.max(2e3, Math.round(A.contextWindow * ue)), r = X(e) + t.reduce((e, t) => e + t.tokens, 0);
|
|
2379
2379
|
if (r > n) {
|
|
2380
2380
|
let e = r, i = [];
|
|
2381
2381
|
for (let e of t.filter((e) => !e.pin).sort((e, t) => t.tokens - e.tokens)) {
|
|
2382
2382
|
if (r <= n) break;
|
|
2383
2383
|
i.push(`${e.name}(${e.tokens})`), r -= e.tokens, e.text = "";
|
|
2384
2384
|
}
|
|
2385
|
-
i.length && console.warn(`[page-agent-sdk] 系统段超预算(${e} > ${n} tokens,窗口 ${A.contextWindow} 的 ${
|
|
2385
|
+
i.length && console.warn(`[page-agent-sdk] 系统段超预算(${e} > ${n} tokens,窗口 ${A.contextWindow} 的 ${ue * 100}%),drop 非核心段:${i.join(", ")}(保 base/mission/workingMemory)`);
|
|
2386
2386
|
}
|
|
2387
2387
|
return [e, ...t.filter((e) => e.text).map((e) => e.text)].join("\n\n");
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2390
|
-
let t = [new o(
|
|
2389
|
+
function pe(e) {
|
|
2390
|
+
let t = [new o(fe())];
|
|
2391
2391
|
for (let n of e) n.role === "user" ? t.push(new a(n.content)) : n.role === "assistant" ? t.push(new i(n.content)) : n.role === "system" && t.push(new o(n.content));
|
|
2392
2392
|
return t;
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2395
|
-
let t = e[0] &&
|
|
2396
|
-
return [new o(
|
|
2394
|
+
function z(e) {
|
|
2395
|
+
let t = e[0] && ge(e[0]) === "system" ? e.slice(1) : e.slice();
|
|
2396
|
+
return [new o(fe()), ...t];
|
|
2397
2397
|
}
|
|
2398
|
-
async function
|
|
2399
|
-
let a = r ??
|
|
2398
|
+
async function me(e, t, n, r) {
|
|
2399
|
+
let a = r ?? ce, o = {
|
|
2400
2400
|
signal: n,
|
|
2401
2401
|
maxRetries: x,
|
|
2402
2402
|
baseDelayMs: S,
|
|
@@ -2423,14 +2423,14 @@ function Fi(e) {
|
|
|
2423
2423
|
};
|
|
2424
2424
|
if (gi(a) && !e._ctxRetry) {
|
|
2425
2425
|
e._ctxRetry = !0;
|
|
2426
|
-
let i = (e) => X(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + i(t), 0), o =
|
|
2426
|
+
let i = (e) => X(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + i(t), 0), o = _e(e.messages, Math.round(A.contextWindow * .3)), s = o.reduce((e, t) => e + i(t), 0);
|
|
2427
2427
|
return P("error", {
|
|
2428
2428
|
stage: "context_overflow_retry",
|
|
2429
2429
|
at: "launch",
|
|
2430
2430
|
beforeTokens: a,
|
|
2431
2431
|
afterTokens: s,
|
|
2432
2432
|
window: A.contextWindow
|
|
2433
|
-
}), console.warn(`[page-agent-sdk] 上下文超限(启动)→ 激进 trim 重试:${a} → ${s} tokens`),
|
|
2433
|
+
}), console.warn(`[page-agent-sdk] 上下文超限(启动)→ 激进 trim 重试:${a} → ${s} tokens`), me({
|
|
2434
2434
|
...e,
|
|
2435
2435
|
messages: o
|
|
2436
2436
|
}, t, n, r);
|
|
@@ -2472,13 +2472,13 @@ function Fi(e) {
|
|
|
2472
2472
|
};
|
|
2473
2473
|
if (gi(a) && l === null && u === "" && !e._ctxRetry) {
|
|
2474
2474
|
e._ctxRetry = !0;
|
|
2475
|
-
let i = (e) => X(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + i(t), 0), o =
|
|
2475
|
+
let i = (e) => X(typeof e.content == "string" ? e.content : JSON.stringify(e.content)), a = e.messages.reduce((e, t) => e + i(t), 0), o = _e(e.messages, Math.round(A.contextWindow * .3)), s = o.reduce((e, t) => e + i(t), 0);
|
|
2476
2476
|
return P("error", {
|
|
2477
2477
|
stage: "context_overflow_retry",
|
|
2478
2478
|
beforeTokens: a,
|
|
2479
2479
|
afterTokens: s,
|
|
2480
2480
|
window: A.contextWindow
|
|
2481
|
-
}), console.warn(`[page-agent-sdk] 上下文超限 → 激进 trim 重试:${a} → ${s} tokens(窗口 ${A.contextWindow})`),
|
|
2481
|
+
}), console.warn(`[page-agent-sdk] 上下文超限 → 激进 trim 重试:${a} → ${s} tokens(窗口 ${A.contextWindow})`), me({
|
|
2482
2482
|
...e,
|
|
2483
2483
|
messages: o
|
|
2484
2484
|
}, t, n, r);
|
|
@@ -2492,8 +2492,8 @@ function Fi(e) {
|
|
|
2492
2492
|
content: u
|
|
2493
2493
|
};
|
|
2494
2494
|
}
|
|
2495
|
-
async function
|
|
2496
|
-
let t =
|
|
2495
|
+
async function he(e) {
|
|
2496
|
+
let t = L.find((t) => t.name === e.name);
|
|
2497
2497
|
if (!t) return {
|
|
2498
2498
|
content: `工具 "${e.name}" 不存在`,
|
|
2499
2499
|
status: "error"
|
|
@@ -2502,7 +2502,7 @@ function Fi(e) {
|
|
|
2502
2502
|
let n = await t.invoke(e.args), r = typeof n == "string" ? n : JSON.stringify(n);
|
|
2503
2503
|
return r = Qr(r, {
|
|
2504
2504
|
files: e.state.files,
|
|
2505
|
-
vfsAvailable:
|
|
2505
|
+
vfsAvailable: L.some((e) => e.name === "vfs_read"),
|
|
2506
2506
|
toolName: e.name,
|
|
2507
2507
|
threshold: M,
|
|
2508
2508
|
passThroughChars: te
|
|
@@ -2517,15 +2517,15 @@ function Fi(e) {
|
|
|
2517
2517
|
};
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2520
|
+
function ge(e) {
|
|
2521
2521
|
return e instanceof a ? "human" : e instanceof i ? "ai" : e instanceof o ? "system" : e instanceof s ? "tool" : "unknown";
|
|
2522
2522
|
}
|
|
2523
|
-
function
|
|
2523
|
+
function _e(e, t) {
|
|
2524
2524
|
return Ni(e, t);
|
|
2525
2525
|
}
|
|
2526
|
-
function
|
|
2526
|
+
function B(e) {
|
|
2527
2527
|
return !k && !E ? [] : e.map((e) => {
|
|
2528
|
-
let t =
|
|
2528
|
+
let t = ge(e), n = { role: t === "human" ? "user" : t === "ai" ? "assistant" : t }, r = typeof e.content == "string" ? e.content : JSON.stringify(e.content);
|
|
2529
2529
|
r && (n.content = r.length > Mi ? r.slice(0, Mi) + `…(截断 ${r.length - Mi} 字符)` : r);
|
|
2530
2530
|
let i = e.tool_calls;
|
|
2531
2531
|
Array.isArray(i) && i.length && (n.tool_calls = i.map((e) => ({
|
|
@@ -2540,20 +2540,20 @@ function Fi(e) {
|
|
|
2540
2540
|
return a && (n.tool_call_id = a), n;
|
|
2541
2541
|
});
|
|
2542
2542
|
}
|
|
2543
|
-
async function
|
|
2544
|
-
N.value = [], ie.value = [],
|
|
2543
|
+
async function ve(e, t, n) {
|
|
2544
|
+
N.value = [], ie.value = [], ae = 0, R = si(), R.messages = e, R = await vi(v, R);
|
|
2545
2545
|
let r = e;
|
|
2546
2546
|
for (let e of v) if (e.compressInput) {
|
|
2547
|
-
let t =
|
|
2548
|
-
r = Array.isArray(n) ? n : n.messages, n && !Array.isArray(n) && n.stats ? (
|
|
2549
|
-
...
|
|
2547
|
+
let t = oe(void 0, "compression", `compress:${e.name}`, {}), n = await e.compressInput(r);
|
|
2548
|
+
r = Array.isArray(n) ? n : n.messages, n && !Array.isArray(n) && n.stats ? (R = {
|
|
2549
|
+
...R,
|
|
2550
2550
|
lastCompression: n.stats
|
|
2551
|
-
},
|
|
2551
|
+
}, I(t, "ok", { stats: n.stats })) : I(t);
|
|
2552
2552
|
}
|
|
2553
2553
|
{
|
|
2554
|
-
let e = X(g || "你是一个智能助手。"), n = Math.max(2e3, Math.round(A.contextWindow *
|
|
2554
|
+
let e = X(g || "你是一个智能助手。"), n = Math.max(2e3, Math.round(A.contextWindow * ue));
|
|
2555
2555
|
if (e > n) {
|
|
2556
|
-
let r = `[page-agent-sdk] systemPrompt 本身(${e} tokens)超过系统段预算(${n} tokens,窗口 ${A.contextWindow} 的 ${
|
|
2556
|
+
let r = `[page-agent-sdk] systemPrompt 本身(${e} tokens)超过系统段预算(${n} tokens,窗口 ${A.contextWindow} 的 ${ue * 100}%);请缩减 systemPrompt 或换更大窗口模型`;
|
|
2557
2557
|
return console.error(r), t({
|
|
2558
2558
|
type: "error",
|
|
2559
2559
|
message: r,
|
|
@@ -2565,42 +2565,42 @@ function Fi(e) {
|
|
|
2565
2565
|
}), "";
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
|
-
let i =
|
|
2568
|
+
let i = pe(r);
|
|
2569
2569
|
P("context", {
|
|
2570
2570
|
model: c,
|
|
2571
|
-
tools:
|
|
2571
|
+
tools: L.map((e) => e.name),
|
|
2572
2572
|
middleware: v.map((e) => e.name)
|
|
2573
2573
|
});
|
|
2574
|
-
let l = Ci(v, (e) =>
|
|
2574
|
+
let l = Ci(v, (e) => me(e, t, n)), u = wi(v, he), d = 0, f = 0, p = Pi(y, b), m = null, _ = 0, x = !1;
|
|
2575
2575
|
try {
|
|
2576
2576
|
for (; (d < y || x) && f < p && (f++, !n?.aborted);) {
|
|
2577
|
-
let e =
|
|
2577
|
+
let e = oe(void 0, "round", `round ${f}`, { round: f })?.id;
|
|
2578
2578
|
t({
|
|
2579
2579
|
type: "round_start",
|
|
2580
2580
|
round: f
|
|
2581
|
-
}),
|
|
2581
|
+
}), R = yi(v, {
|
|
2582
2582
|
messages: i,
|
|
2583
|
-
state:
|
|
2584
|
-
}), i =
|
|
2585
|
-
let r =
|
|
2583
|
+
state: R
|
|
2584
|
+
}), i = z(i), i = _e(i, Math.round(A.contextWindow * .6));
|
|
2585
|
+
let r = oe(e, "model", c, {
|
|
2586
2586
|
round: d + 1,
|
|
2587
|
-
tools:
|
|
2587
|
+
tools: L.map((e) => e.name)
|
|
2588
2588
|
});
|
|
2589
2589
|
P("llm_request", {
|
|
2590
2590
|
round: d + 1,
|
|
2591
2591
|
model: c,
|
|
2592
|
-
tools:
|
|
2593
|
-
messages:
|
|
2592
|
+
tools: L.map((e) => e.name),
|
|
2593
|
+
messages: B(i)
|
|
2594
2594
|
});
|
|
2595
2595
|
let o = await l({
|
|
2596
2596
|
messages: i,
|
|
2597
|
-
state:
|
|
2597
|
+
state: R
|
|
2598
2598
|
});
|
|
2599
2599
|
if (i.push(o.message), P("llm_response", {
|
|
2600
2600
|
round: d + 1,
|
|
2601
2601
|
content: o.content,
|
|
2602
2602
|
toolCalls: o.toolCalls
|
|
2603
|
-
}),
|
|
2603
|
+
}), I(r, o.aborted ? "timeout" : "ok", { usage: h(o.message) }), R = bi(v, o, R), o.aborted) return t({
|
|
2604
2604
|
type: "done",
|
|
2605
2605
|
content: o.content
|
|
2606
2606
|
}), o.content;
|
|
@@ -2638,17 +2638,17 @@ function Fi(e) {
|
|
|
2638
2638
|
severity: "observable",
|
|
2639
2639
|
code: "GARBLED_TOOL_CALL_EXHAUSTED",
|
|
2640
2640
|
context: { content: o.content.slice(0, 200) }
|
|
2641
|
-
})), !e && T > 0 &&
|
|
2641
|
+
})), !e && T > 0 && R.verifyAttempts < T) {
|
|
2642
2642
|
let e = await Si(v, {
|
|
2643
2643
|
messages: i,
|
|
2644
|
-
state:
|
|
2644
|
+
state: R,
|
|
2645
2645
|
response: o,
|
|
2646
2646
|
log: (e, t) => P(e, t)
|
|
2647
2647
|
});
|
|
2648
2648
|
if (e) {
|
|
2649
|
-
m = o.content,
|
|
2649
|
+
m = o.content, R.verifyAttempts += 1, i.push(new a(`⚠️ 验证未通过,请修正:${e}`)), P("middleware", {
|
|
2650
2650
|
stage: "verify_retry",
|
|
2651
|
-
attempt:
|
|
2651
|
+
attempt: R.verifyAttempts,
|
|
2652
2652
|
feedback: e
|
|
2653
2653
|
});
|
|
2654
2654
|
continue;
|
|
@@ -2670,7 +2670,7 @@ function Fi(e) {
|
|
|
2670
2670
|
id: r,
|
|
2671
2671
|
name: e.name,
|
|
2672
2672
|
args: e.args,
|
|
2673
|
-
state:
|
|
2673
|
+
state: R,
|
|
2674
2674
|
signal: n,
|
|
2675
2675
|
emit: t,
|
|
2676
2676
|
logSink: re
|
|
@@ -2678,7 +2678,7 @@ function Fi(e) {
|
|
|
2678
2678
|
};
|
|
2679
2679
|
}), g = await $r(p, w, async (r) => {
|
|
2680
2680
|
if (n?.aborted) return;
|
|
2681
|
-
let i =
|
|
2681
|
+
let i = oe(e, "tool", r.call.name, { name: r.call.name }), a = Date.now();
|
|
2682
2682
|
t({
|
|
2683
2683
|
type: "tool_call",
|
|
2684
2684
|
name: r.call.name,
|
|
@@ -2702,7 +2702,7 @@ function Fi(e) {
|
|
|
2702
2702
|
result: o.content,
|
|
2703
2703
|
status: o.status,
|
|
2704
2704
|
durationMs: s
|
|
2705
|
-
}),
|
|
2705
|
+
}), I(i, o.status === "error" ? "error" : "ok", { resultSnippet: String(o.content).slice(0, 100) }), o;
|
|
2706
2706
|
}, n);
|
|
2707
2707
|
for (let e = 0; e < p.length; e++) {
|
|
2708
2708
|
let t = g[e];
|
|
@@ -2723,19 +2723,19 @@ function Fi(e) {
|
|
|
2723
2723
|
content: m
|
|
2724
2724
|
}), m;
|
|
2725
2725
|
let e = i[i.length - 1];
|
|
2726
|
-
if (e &&
|
|
2727
|
-
let e = i.filter((e) =>
|
|
2726
|
+
if (e && ge(e) === "tool") {
|
|
2727
|
+
let e = i.filter((e) => ge(e) !== "system"), r = [new o(fe() + "\n\n工具调用次数已达上限,请基于已有工具结果直接给出最终回答,不要再调用工具。"), ...e];
|
|
2728
2728
|
P("llm_request", {
|
|
2729
2729
|
round: "wrap_up",
|
|
2730
2730
|
model: c,
|
|
2731
2731
|
tools: [],
|
|
2732
|
-
messages:
|
|
2732
|
+
messages: B(r)
|
|
2733
2733
|
});
|
|
2734
|
-
let a = await Ci(v, (e) =>
|
|
2734
|
+
let a = await Ci(v, (e) => me(e, t, n, se))({
|
|
2735
2735
|
messages: r,
|
|
2736
|
-
state:
|
|
2736
|
+
state: R
|
|
2737
2737
|
});
|
|
2738
|
-
if (
|
|
2738
|
+
if (R = bi(v, a, R), P("llm_response", {
|
|
2739
2739
|
round: "wrap_up",
|
|
2740
2740
|
content: a.content
|
|
2741
2741
|
}), a.aborted || a.content) return t({
|
|
@@ -2750,41 +2750,41 @@ function Fi(e) {
|
|
|
2750
2750
|
}), r;
|
|
2751
2751
|
} finally {
|
|
2752
2752
|
try {
|
|
2753
|
-
await xi(v,
|
|
2753
|
+
await xi(v, R);
|
|
2754
2754
|
} catch (e) {
|
|
2755
2755
|
let t = Jr(e, "observable");
|
|
2756
2756
|
console.warn("[Agent] afterAgent 清理出错(observable,已忽略):", t.message);
|
|
2757
2757
|
}
|
|
2758
|
-
if (
|
|
2758
|
+
if (F && D) try {
|
|
2759
2759
|
D(ie.value, oi(ie.value));
|
|
2760
2760
|
} catch {}
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
|
-
async function
|
|
2763
|
+
async function V(e, t, n) {
|
|
2764
2764
|
let r = "";
|
|
2765
|
-
return await
|
|
2765
|
+
return await ve(e, (e) => {
|
|
2766
2766
|
e.type === "done" && (r = e.content), n?.(e);
|
|
2767
2767
|
}, t), r;
|
|
2768
2768
|
}
|
|
2769
|
-
function ve(e) {
|
|
2770
|
-
R = [...v.flatMap((e) => e.tools || []), ...e], ce();
|
|
2771
|
-
}
|
|
2772
2769
|
function ye(e) {
|
|
2773
|
-
|
|
2770
|
+
L = [...v.flatMap((e) => e.tools || []), ...e], le();
|
|
2771
|
+
}
|
|
2772
|
+
function be(e) {
|
|
2773
|
+
se = e, le(), O?.(e);
|
|
2774
2774
|
}
|
|
2775
2775
|
return {
|
|
2776
|
-
invoke:
|
|
2777
|
-
stream:
|
|
2778
|
-
getState: () =>
|
|
2776
|
+
invoke: V,
|
|
2777
|
+
stream: ve,
|
|
2778
|
+
getState: () => R,
|
|
2779
2779
|
get allTools() {
|
|
2780
|
-
return
|
|
2780
|
+
return L;
|
|
2781
2781
|
},
|
|
2782
|
-
setTools:
|
|
2783
|
-
setLlm:
|
|
2782
|
+
setTools: ye,
|
|
2783
|
+
setLlm: be,
|
|
2784
2784
|
setModelCaps: ne,
|
|
2785
2785
|
debugLogs: N,
|
|
2786
2786
|
spans: ie,
|
|
2787
|
-
getEffectiveSystemPrompt: () =>
|
|
2787
|
+
getEffectiveSystemPrompt: () => fe()
|
|
2788
2788
|
};
|
|
2789
2789
|
}
|
|
2790
2790
|
//#endregion
|
|
@@ -4130,93 +4130,101 @@ function wo(e = {}) {
|
|
|
4130
4130
|
let t = {
|
|
4131
4131
|
...Co,
|
|
4132
4132
|
...e
|
|
4133
|
-
};
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4133
|
+
}, n = null, r = !1;
|
|
4134
|
+
function i(e, i) {
|
|
4135
|
+
r || !t.llmInvoke || (r = !0, t.llmInvoke(i).then((t) => {
|
|
4136
|
+
typeof t == "string" && t && (!n || n.coveredCount <= e) && (n = {
|
|
4137
|
+
coveredCount: e,
|
|
4138
|
+
text: t
|
|
4139
|
+
});
|
|
4140
|
+
}).catch(() => {}).finally(() => {
|
|
4141
|
+
r = !1;
|
|
4142
|
+
}));
|
|
4143
|
+
}
|
|
4144
|
+
async function a(e, r) {
|
|
4145
|
+
let a = oo(e), o = e.length, s = "";
|
|
4146
|
+
if (a.length) {
|
|
4147
|
+
let t = a[0].startIdx;
|
|
4138
4148
|
for (let n = 0; n < t; n++) {
|
|
4139
4149
|
let t = e[n];
|
|
4140
4150
|
if (t.role === "system") {
|
|
4141
4151
|
let e = fo(t.content);
|
|
4142
4152
|
if (e) {
|
|
4143
|
-
|
|
4153
|
+
s = e.body;
|
|
4144
4154
|
break;
|
|
4145
4155
|
}
|
|
4146
4156
|
}
|
|
4147
4157
|
}
|
|
4148
4158
|
}
|
|
4149
|
-
let
|
|
4159
|
+
let c = (t) => ({
|
|
4150
4160
|
messages: e,
|
|
4151
4161
|
stats: {
|
|
4152
4162
|
triggered: !1,
|
|
4153
|
-
roundsTotal:
|
|
4163
|
+
roundsTotal: a.length,
|
|
4154
4164
|
roundsSummarized: 0,
|
|
4155
4165
|
roundsRecalled: 0,
|
|
4156
|
-
originalMessages:
|
|
4157
|
-
compressedMessages:
|
|
4166
|
+
originalMessages: o,
|
|
4167
|
+
compressedMessages: o,
|
|
4158
4168
|
strategy: t
|
|
4159
4169
|
}
|
|
4160
4170
|
});
|
|
4161
|
-
if (!So(
|
|
4162
|
-
let
|
|
4171
|
+
if (!So(a, t)) return c("none");
|
|
4172
|
+
let l, u, d;
|
|
4163
4173
|
if (t.contextWindow && t.contextWindow > 0) {
|
|
4164
|
-
let e = t.contextWindow * (
|
|
4165
|
-
for (let t =
|
|
4166
|
-
|
|
4174
|
+
let e = t.contextWindow * (r?.windowRatio ?? t.windowRatio ?? .4), n = 0, i = 0;
|
|
4175
|
+
for (let t = a.length - 1; t >= 0; t--) if (n += yo(a[t]), n >= e) {
|
|
4176
|
+
i = t + 1;
|
|
4167
4177
|
break;
|
|
4168
4178
|
}
|
|
4169
|
-
if (
|
|
4170
|
-
|
|
4179
|
+
if (i > a.length - 1 && (i = a.length - 1), i < 0 && (i = 0), l = a.slice(i), u = a.slice(0, i), !u.length) return c("none");
|
|
4180
|
+
d = "token-window+";
|
|
4171
4181
|
} else {
|
|
4172
|
-
let e =
|
|
4173
|
-
if (
|
|
4174
|
-
|
|
4175
|
-
}
|
|
4176
|
-
let
|
|
4177
|
-
if (
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
}
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
let e = t.contextWindow && t.contextWindow > 0 ? `windowRatio=${n.windowRatio ?? t.windowRatio}` : `keepRounds=${n.keepRounds ?? t.windowRounds}`;
|
|
4186
|
-
b.push(`\n(压缩决策:${e} · 摘要=${n.summarize.mode} · 召回=${g}${n.reason ? " · " + n.reason : ""})`);
|
|
4182
|
+
let e = r?.keepRounds ?? t.windowRounds, n = Math.min(Math.max(1, e), a.length);
|
|
4183
|
+
if (l = a.slice(a.length - n), u = a.slice(0, a.length - n), !u.length) return c("none");
|
|
4184
|
+
d = "window+";
|
|
4185
|
+
}
|
|
4186
|
+
let f = [...e].reverse().find((e) => e.role === "user")?.content || "", p = r?.summarize?.mode ?? (t.enableLLMSummary ? "llm" : "index"), m = /* @__PURE__ */ new Set([...t.preserveLastToolResults ?? [], ...r?.preserveTools ?? []]), h = m.size ? m : void 0, g, _;
|
|
4187
|
+
if (p === "llm" && t.llmInvoke) {
|
|
4188
|
+
let e = bo(u, h), t = u.length;
|
|
4189
|
+
n && n.coveredCount >= t ? (g = n.text, _ = d + "llm_summary(cached)") : n && n.coveredCount > 0 ? (g = n.text + "\n" + bo(u.slice(n.coveredCount), h), _ = d + "llm_summary(prefix)+index_tail", i(t, e)) : (g = e, _ = d + "index_summary(llm_background)", i(t, e));
|
|
4190
|
+
} else g = bo(u, h), _ = d + "index_summary";
|
|
4191
|
+
let v = r?.recallTopK == null ? t.enableRecall ? t.recallTopK : 0 : r.recallTopK, y = v > 0 ? xo(u, f, v) : [], b = y.length ? y.map((e) => `- 第${e.round}轮:${so(e.userMsg.content, 60)} → ${e.assistantMsgs[0] ? so(e.assistantMsgs[0].content, 80) : ""}`).join("\n") : "", x = s ? `${g}\n【更早累积摘要】\n${s}` : g, S = [`【对话历史摘要】以下是之前 ${u.length} 轮对话的要点(最新 ${l.length} 轮已完整保留):`, x];
|
|
4192
|
+
if (r) {
|
|
4193
|
+
let e = t.contextWindow && t.contextWindow > 0 ? `windowRatio=${r.windowRatio ?? t.windowRatio}` : `keepRounds=${r.keepRounds ?? t.windowRounds}`;
|
|
4194
|
+
S.push(`\n(压缩决策:${e} · 摘要=${r.summarize.mode} · 召回=${v}${r.reason ? " · " + r.reason : ""})`);
|
|
4187
4195
|
}
|
|
4188
|
-
|
|
4189
|
-
let
|
|
4190
|
-
if (
|
|
4191
|
-
let e =
|
|
4196
|
+
b && S.push("\n【与当前问题可能相关的早期对话】", b);
|
|
4197
|
+
let C = t.getRegisteredData ?? t.getRegisteredSlots;
|
|
4198
|
+
if (C) try {
|
|
4199
|
+
let e = C();
|
|
4192
4200
|
if (e.length) {
|
|
4193
4201
|
let t = e.map((e) => `- ${e.path ? e.path + ": " : ""}${e.description}`).join("\n");
|
|
4194
|
-
|
|
4202
|
+
S.push("\n【当前可操作数据(动态增删后的最新状态,操作前以 describe_data / read 为准)】", t);
|
|
4195
4203
|
}
|
|
4196
4204
|
} catch {}
|
|
4197
|
-
let
|
|
4205
|
+
let w = {
|
|
4198
4206
|
role: "system",
|
|
4199
|
-
content:
|
|
4207
|
+
content: S.join("\n"),
|
|
4200
4208
|
timestamp: Date.now()
|
|
4201
|
-
},
|
|
4202
|
-
for (let e of
|
|
4203
|
-
let
|
|
4204
|
-
return t.contextWindow &&
|
|
4205
|
-
messages:
|
|
4209
|
+
}, T = [];
|
|
4210
|
+
for (let e of l) T.push(e.userMsg), T.push(...e.assistantMsgs);
|
|
4211
|
+
let E = [w, ...T], ee = E.reduce((e, t) => e + X(typeof t.content == "string" ? t.content : JSON.stringify(t.content)), 0);
|
|
4212
|
+
return t.contextWindow && ee > t.contextWindow && console.warn(`[page-agent-sdk] compress 后仍超窗口:${ee} > ${t.contextWindow} tokens(单条消息超窗口,compress 无法压)`), {
|
|
4213
|
+
messages: E,
|
|
4206
4214
|
stats: {
|
|
4207
4215
|
triggered: !0,
|
|
4208
|
-
roundsTotal:
|
|
4209
|
-
roundsSummarized:
|
|
4210
|
-
roundsRecalled:
|
|
4211
|
-
originalMessages:
|
|
4212
|
-
compressedMessages:
|
|
4213
|
-
strategy:
|
|
4214
|
-
decision:
|
|
4216
|
+
roundsTotal: a.length,
|
|
4217
|
+
roundsSummarized: u.length,
|
|
4218
|
+
roundsRecalled: y.length,
|
|
4219
|
+
originalMessages: o,
|
|
4220
|
+
compressedMessages: E.length,
|
|
4221
|
+
strategy: _,
|
|
4222
|
+
decision: r
|
|
4215
4223
|
}
|
|
4216
4224
|
};
|
|
4217
4225
|
}
|
|
4218
4226
|
return {
|
|
4219
|
-
compress:
|
|
4227
|
+
compress: a,
|
|
4220
4228
|
config: t
|
|
4221
4229
|
};
|
|
4222
4230
|
}
|
|
@@ -5276,7 +5284,7 @@ function Ps(e) {
|
|
|
5276
5284
|
//#endregion
|
|
5277
5285
|
//#region src/core/sdk/conflictManager.ts
|
|
5278
5286
|
function Fs(e) {
|
|
5279
|
-
let t = /* @__PURE__ */
|
|
5287
|
+
let t = /* @__PURE__ */ kt(null), n = 0;
|
|
5280
5288
|
function r(r) {
|
|
5281
5289
|
return new Promise((i) => {
|
|
5282
5290
|
let a = t.value;
|
|
@@ -7374,7 +7382,7 @@ function Ol(e, n = {}) {
|
|
|
7374
7382
|
hint: "主数据仅暴露 schema 声明的字段;若需操作该字段,集成方需在 schema 中声明它"
|
|
7375
7383
|
});
|
|
7376
7384
|
let n = t ? Z(a, t) : a;
|
|
7377
|
-
t
|
|
7385
|
+
!t && s && (n = Bi(n, i)), d && (n = gl({
|
|
7378
7386
|
jp: t,
|
|
7379
7387
|
resolved: n,
|
|
7380
7388
|
resourcesByPath: d.resourcesByPath,
|
|
@@ -7600,7 +7608,7 @@ function Ol(e, n = {}) {
|
|
|
7600
7608
|
message: `主数据不是对象/数组,无法查询(当前为 ${a === void 0 ? "undefined" : typeof a})`,
|
|
7601
7609
|
hint: "query 仅适用于对象/数组;叶子用 get_data 读"
|
|
7602
7610
|
});
|
|
7603
|
-
let n = s ?
|
|
7611
|
+
let n = s ? Bi(a, i) : a, r;
|
|
7604
7612
|
try {
|
|
7605
7613
|
r = el(n, e);
|
|
7606
7614
|
} catch (t) {
|
|
@@ -7611,8 +7619,8 @@ function Ol(e, n = {}) {
|
|
|
7611
7619
|
details: { expr: e }
|
|
7612
7620
|
});
|
|
7613
7621
|
}
|
|
7614
|
-
let
|
|
7615
|
-
return `{"matched":${r.length},"returned":${
|
|
7622
|
+
let o = t ?? 50, c = r.slice(0, o), l = c.map((e) => `{"path":${JSON.stringify(e.path)},"index":${e.index === void 0 ? "null" : e.index},"value":${Q(e.value)}}`);
|
|
7623
|
+
return `{"matched":${r.length},"returned":${c.length},"truncated":${r.length > o},"results":[${l.join(",")}]}`;
|
|
7616
7624
|
}, {
|
|
7617
7625
|
name: "query_data",
|
|
7618
7626
|
description: "用 JSONPath 表达式对主数据做结构化查询(只读,无副作用)。语法子集:$ 根、.key、[n]、[\"key\"]、[*] 通配、[?(filter)] 过滤、..key 递归找后代、..* 全后代。过滤表达式:@.field op literal(op:==/!=/</<=/>/>=),&&/||/() 连接;@ 指当前元素。注意过滤作用于\"当前节点的子元素数组\",若主数据是对象需先点出数组字段再过滤,如 $.components[?(@.type==\"card\" && @.price<100)]。返回匹配元素的 path(相对主数据根,数组索引可作后续 edit_data 的 jsonPath)+ index(若父为数组)+ value。适合在大数组里按条件筛选元素,定位后再用 edit_data 增量改。",
|
|
@@ -7620,21 +7628,21 @@ function Ol(e, n = {}) {
|
|
|
7620
7628
|
expr: t.string().describe("JSONPath 表达式,如 $.components[?(@.type==\"card\" && @.price<100)] 或 $..title(递归找所有 title)"),
|
|
7621
7629
|
limit: t.number().int().min(1).max(200).optional().describe("返回结果上限,默认 50")
|
|
7622
7630
|
})
|
|
7623
|
-
}), M = r(async ({ query: e, mode: t, fuzzyThreshold: n, matchKey: r, limit:
|
|
7631
|
+
}), M = r(async ({ query: e, mode: t, fuzzyThreshold: n, matchKey: r, limit: o }) => {
|
|
7624
7632
|
if (a == null) return Y({
|
|
7625
7633
|
code: "EMPTY",
|
|
7626
7634
|
message: "主数据为空,无可搜索内容"
|
|
7627
7635
|
});
|
|
7628
7636
|
try {
|
|
7629
|
-
let
|
|
7637
|
+
let c = nl(s ? Bi(a, i) : a, e, {
|
|
7630
7638
|
mode: t,
|
|
7631
7639
|
fuzzyThreshold: n,
|
|
7632
7640
|
matchKey: r,
|
|
7633
|
-
limit:
|
|
7641
|
+
limit: o ?? 50
|
|
7634
7642
|
});
|
|
7635
7643
|
return Q({
|
|
7636
|
-
matched:
|
|
7637
|
-
results:
|
|
7644
|
+
matched: c.length,
|
|
7645
|
+
results: c
|
|
7638
7646
|
});
|
|
7639
7647
|
} catch (t) {
|
|
7640
7648
|
return Y({
|
|
@@ -7675,7 +7683,7 @@ function Ol(e, n = {}) {
|
|
|
7675
7683
|
let e = zi(i, r);
|
|
7676
7684
|
e && (o = Bi(o, e));
|
|
7677
7685
|
}
|
|
7678
|
-
} else o = s ?
|
|
7686
|
+
} else o = s ? Bi(a, i) : a;
|
|
7679
7687
|
let c = Sc(o), l = await il(c, e, r && JSON.stringify(c).length > 1e5 ? 8e3 : 3e3);
|
|
7680
7688
|
if (!l.ok) {
|
|
7681
7689
|
let t = /超时/.test(l.error || "");
|
|
@@ -7783,7 +7791,7 @@ function Ol(e, n = {}) {
|
|
|
7783
7791
|
let t = e || "";
|
|
7784
7792
|
if (!Li(t, i, s)) return `- ${t || "(根)"}: [PATH_DENIED: 不在 schema 声明字段内]`;
|
|
7785
7793
|
let o = t ? Z(a, t) : a;
|
|
7786
|
-
if (!t) o =
|
|
7794
|
+
if (!t && s) o = Bi(o, i);
|
|
7787
7795
|
else if (s) {
|
|
7788
7796
|
let e = zi(i, t);
|
|
7789
7797
|
e && (o = Bi(o, e));
|
|
@@ -7815,7 +7823,7 @@ function Ol(e, n = {}) {
|
|
|
7815
7823
|
hint: "主数据仅暴露 schema 声明的字段;若需操作该字段,集成方需在 schema 中声明它"
|
|
7816
7824
|
});
|
|
7817
7825
|
let m = p ? Z(a, p) : a;
|
|
7818
|
-
if (!p) m =
|
|
7826
|
+
if (!p && s) m = Bi(m, i);
|
|
7819
7827
|
else if (s) {
|
|
7820
7828
|
let e = zi(i, p);
|
|
7821
7829
|
e && (m = Bi(m, e));
|
|
@@ -8016,14 +8024,14 @@ function Ol(e, n = {}) {
|
|
|
8016
8024
|
description: "查看主数据(或子路径)的字段约束:类型/min/max/enum/必填/默认值/嵌套 shape。写前查约束,避免写错重试。不传 jsonPath 查根;传子路径(如 components.0)查该位置约束。",
|
|
8017
8025
|
schema: t.object({ jsonPath: t.string().optional().describe("要查约束的子路径;不传查根 schema") })
|
|
8018
8026
|
}), re = r(async ({ snapshotId: e, against: t }) => {
|
|
8019
|
-
let n = t != null, r,
|
|
8027
|
+
let n = t != null, r, o;
|
|
8020
8028
|
if (n) {
|
|
8021
8029
|
let e = t;
|
|
8022
8030
|
if (typeof e == "string") {
|
|
8023
8031
|
let t = Cc(e);
|
|
8024
8032
|
t.parseError || (e = t.parsed);
|
|
8025
8033
|
}
|
|
8026
|
-
r = e,
|
|
8034
|
+
r = e, o = "against";
|
|
8027
8035
|
} else {
|
|
8028
8036
|
if (!f.length) return Y({
|
|
8029
8037
|
code: "NO_SNAPSHOT",
|
|
@@ -8036,10 +8044,10 @@ function Ol(e, n = {}) {
|
|
|
8036
8044
|
message: `未找到快照 #${e}`,
|
|
8037
8045
|
hint: "不传 snapshotId 用最近一次;或传 against"
|
|
8038
8046
|
});
|
|
8039
|
-
r = t.value,
|
|
8047
|
+
r = t.value, o = `快照 #${t.id}`;
|
|
8040
8048
|
}
|
|
8041
|
-
let
|
|
8042
|
-
return
|
|
8049
|
+
let c = s ? Bi(a, i) : a, l = jc(r, Sc(c));
|
|
8050
|
+
return l.length ? `差异(当前 vs ${o},共 ${l.length} 处):\n${l.map((e) => ` ${e.path}: ${Q(e.from)} → ${Q(e.to)}`).join("\n")}` : `无差异:当前主数据与 ${o} 完全相同。`;
|
|
8043
8051
|
}, {
|
|
8044
8052
|
name: "diff_data",
|
|
8045
8053
|
description: "对比当前主数据与某快照(默认最近)或一段 JSON(against)的差异,返回结构化 {path, from→to} 列表。供 verify 自纠/冲突诊断/操作审计(\"刚才改了啥\")。snapshotId 指定快照;against 传一段 JSON 值(与 snapshotId 互斥,传则忽略快照)。",
|
|
@@ -8113,7 +8121,7 @@ function Ol(e, n = {}) {
|
|
|
8113
8121
|
});
|
|
8114
8122
|
ie.push(c, l);
|
|
8115
8123
|
}
|
|
8116
|
-
let
|
|
8124
|
+
let ae = [];
|
|
8117
8125
|
if (e.resources?.length && l) {
|
|
8118
8126
|
let e = r(async ({ path: e, handle: t }) => {
|
|
8119
8127
|
let n = e;
|
|
@@ -8214,9 +8222,9 @@ function Ol(e, n = {}) {
|
|
|
8214
8222
|
handle: t.string().optional().describe("占位符句柄(与 path 二选一)")
|
|
8215
8223
|
})
|
|
8216
8224
|
});
|
|
8217
|
-
|
|
8225
|
+
ae.push(e, n, o, s);
|
|
8218
8226
|
}
|
|
8219
|
-
let
|
|
8227
|
+
let F = [
|
|
8220
8228
|
T,
|
|
8221
8229
|
E,
|
|
8222
8230
|
ee,
|
|
@@ -8232,20 +8240,20 @@ function Ol(e, n = {}) {
|
|
|
8232
8240
|
P,
|
|
8233
8241
|
re,
|
|
8234
8242
|
...ie,
|
|
8235
|
-
...
|
|
8243
|
+
...ae
|
|
8236
8244
|
];
|
|
8237
|
-
Object.defineProperty(
|
|
8245
|
+
Object.defineProperty(F, "controller", {
|
|
8238
8246
|
value: x,
|
|
8239
8247
|
enumerable: !1,
|
|
8240
8248
|
configurable: !1,
|
|
8241
8249
|
writable: !1
|
|
8242
8250
|
});
|
|
8243
|
-
for (let e of
|
|
8251
|
+
for (let e of F) Object.defineProperty(e, "__dataOpsScoped", {
|
|
8244
8252
|
value: !0,
|
|
8245
8253
|
enumerable: !1,
|
|
8246
8254
|
configurable: !1
|
|
8247
8255
|
});
|
|
8248
|
-
return
|
|
8256
|
+
return F;
|
|
8249
8257
|
}
|
|
8250
8258
|
//#endregion
|
|
8251
8259
|
//#region src/core/tools/fetchDoc.ts
|
|
@@ -8693,26 +8701,26 @@ function gu(e, n) {
|
|
|
8693
8701
|
prompt_tokens: 0,
|
|
8694
8702
|
completion_tokens: 0,
|
|
8695
8703
|
total_tokens: 0
|
|
8696
|
-
}, a = Fs(() =>
|
|
8704
|
+
}, a = Fs(() => U), o = /* @__PURE__ */ kt(0), s = sc(e.storage);
|
|
8697
8705
|
e.debug && s && s.onEvent((e) => console.log("[page-agent-sdk][storage]", e));
|
|
8698
8706
|
let { modelCaps: c, summaryLlmInvoke: l, titleLlmInvoke: u, compressDecisionInvoke: p } = Ps(e), m = c;
|
|
8699
8707
|
if (e.debug && console.log("[page-agent-sdk][modelCaps]", m), m.contextWindow < 2e5) throw Error(`[page-agent-sdk] 模型上下文窗口 ${m.contextWindow} 小于最小支持 ${ni}(需 ≥200K 窗口模型,如 GLM-5.2/Claude/Kimi/Qwen-1M/DeepSeek-v4)`);
|
|
8700
8708
|
let h = mc(e, m.contextWindow), g = h.enableLLMSummary !== !1, _ = (e.contextOptions && e.contextOptions.preserveLastToolResults) ?? pc[e.contextPreset ?? "auto"], v = new Set(_), y = e.llm;
|
|
8701
8709
|
e.debug && !l && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
8702
|
-
let b = /* @__PURE__ */
|
|
8710
|
+
let b = /* @__PURE__ */ vt([]), x = Fc(e.vfs?.initialFiles, {
|
|
8703
8711
|
persist: s ? { save: (e) => {
|
|
8704
|
-
|
|
8712
|
+
W.sessionId && s && s.save(n, W.sessionId, { vfs: e });
|
|
8705
8713
|
} } : void 0,
|
|
8706
8714
|
maxBytes: e.vfs?.maxBytes,
|
|
8707
8715
|
poolBytes: e.vfs?.poolBytes
|
|
8708
|
-
}), S = na([], { maxPlanRevisions: e.maxPlanRevisions }), C = oa(), w = _a({ getSchema: () =>
|
|
8716
|
+
}), S = na([], { maxPlanRevisions: e.maxPlanRevisions }), C = oa(), w = _a({ getSchema: () => I()?.schema }), T = ba(), E = Ba(e.memory || "");
|
|
8709
8717
|
typeof e.memory == "function" && E.refresh();
|
|
8710
8718
|
let ee = { current: null }, D = e.data ? {
|
|
8711
8719
|
...e.data,
|
|
8712
8720
|
description: e.data.description ?? "主数据对象"
|
|
8713
8721
|
} : void 0, O = e.checkpoint, k = O !== void 0 && O !== !1, A = k ? io({
|
|
8714
|
-
getData: () =>
|
|
8715
|
-
consumeDataDirty: () =>
|
|
8722
|
+
getData: () => I()?.bind,
|
|
8723
|
+
consumeDataDirty: () => F?.consumeDataDirty?.() ?? !0,
|
|
8716
8724
|
slotPaths: D ? [""] : [],
|
|
8717
8725
|
vfsStore: x,
|
|
8718
8726
|
todosMw: S,
|
|
@@ -8726,15 +8734,15 @@ function gu(e, n) {
|
|
|
8726
8734
|
autoLock: e.autoLock,
|
|
8727
8735
|
interceptors: e.interceptors,
|
|
8728
8736
|
vfsStore: ne || D?.resources?.length ? x : void 0
|
|
8729
|
-
}) : [],
|
|
8730
|
-
|
|
8731
|
-
let
|
|
8732
|
-
|
|
8733
|
-
let
|
|
8734
|
-
|
|
8735
|
-
let
|
|
8736
|
-
|
|
8737
|
-
let
|
|
8737
|
+
}) : [], ae = te ? Tl(ie, e.toolMode) : [], F = te && D ? ie.controller ?? null : null, oe = te && D?.resources?.length && F?.getResourcesSnapshot ? tu({ getResourcesSnapshot: () => F?.getResourcesSnapshot?.() ?? [] }) : void 0, I = () => F?.get() ?? D, L = /* @__PURE__ */ new Map(), se = Zl(M, ae, Al, Il, Ul);
|
|
8738
|
+
se.forEach((e) => L.set(e.name, "builtin"));
|
|
8739
|
+
let ce = [...e.tools || []];
|
|
8740
|
+
ce.forEach((e) => L.set(e.name, "user"));
|
|
8741
|
+
let le = Kl(e.actions ?? {});
|
|
8742
|
+
le.forEach((e) => L.set(e.name, "action"));
|
|
8743
|
+
let R = [], ue = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1), de = ue ? Xa() : null;
|
|
8744
|
+
de && L.set(Ja, "builtin");
|
|
8745
|
+
let fe = k && A ? [r(async () => {
|
|
8738
8746
|
let e = A.list();
|
|
8739
8747
|
return e.length ? A.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
|
|
8740
8748
|
}, {
|
|
@@ -8749,9 +8757,9 @@ function gu(e, n) {
|
|
|
8749
8757
|
description: "列出可用会话 checkpoint(回退点)。",
|
|
8750
8758
|
schema: t.object({}).optional()
|
|
8751
8759
|
})] : [];
|
|
8752
|
-
|
|
8753
|
-
let
|
|
8754
|
-
let n =
|
|
8760
|
+
fe.forEach((e) => L.set(e.name, "builtin"));
|
|
8761
|
+
let pe = M.focus, z = r(async ({ path: e, label: t }) => {
|
|
8762
|
+
let n = I()?.schema;
|
|
8755
8763
|
return n ? zi(n, e) ? (w.setFocus({
|
|
8756
8764
|
path: e,
|
|
8757
8765
|
...t ? { label: t } : {}
|
|
@@ -8763,12 +8771,12 @@ function gu(e, n) {
|
|
|
8763
8771
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
8764
8772
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
8765
8773
|
})
|
|
8766
|
-
}),
|
|
8774
|
+
}), me = r(async () => (w.clearFocus(), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
8767
8775
|
name: "clear_focus",
|
|
8768
8776
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
8769
8777
|
schema: t.object({}).optional()
|
|
8770
|
-
}),
|
|
8771
|
-
let n =
|
|
8778
|
+
}), he = r(async ({ path: e, label: t }) => {
|
|
8779
|
+
let n = I()?.schema;
|
|
8772
8780
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
8773
8781
|
if (!zi(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
8774
8782
|
w.addFocus({
|
|
@@ -8784,7 +8792,7 @@ function gu(e, n) {
|
|
|
8784
8792
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
8785
8793
|
label: t.string().optional().describe("人类可读标签")
|
|
8786
8794
|
})
|
|
8787
|
-
}),
|
|
8795
|
+
}), ge = r(async ({ path: e }) => {
|
|
8788
8796
|
let t = w.getFocuses().length;
|
|
8789
8797
|
w.removeFocus(e);
|
|
8790
8798
|
let n = w.getFocuses();
|
|
@@ -8793,220 +8801,220 @@ function gu(e, n) {
|
|
|
8793
8801
|
name: "remove_focus",
|
|
8794
8802
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
8795
8803
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
8796
|
-
}),
|
|
8797
|
-
|
|
8798
|
-
pe,
|
|
8804
|
+
}), _e = pe && e.toolMode === "advanced" ? [
|
|
8805
|
+
z,
|
|
8799
8806
|
me,
|
|
8800
|
-
he
|
|
8807
|
+
he,
|
|
8808
|
+
ge
|
|
8801
8809
|
] : [];
|
|
8802
|
-
|
|
8803
|
-
let
|
|
8804
|
-
function
|
|
8810
|
+
_e.forEach((e) => L.set(e.name, "builtin"));
|
|
8811
|
+
let B = [], ve = /* @__PURE__ */ new Map(), V = ye();
|
|
8812
|
+
function ye() {
|
|
8805
8813
|
let { tools: e, collisions: t } = Ql([
|
|
8806
8814
|
{
|
|
8807
8815
|
label: "builtin",
|
|
8808
|
-
tools:
|
|
8816
|
+
tools: se
|
|
8809
8817
|
},
|
|
8810
8818
|
{
|
|
8811
8819
|
label: "user",
|
|
8812
|
-
tools:
|
|
8820
|
+
tools: ce
|
|
8813
8821
|
},
|
|
8814
8822
|
{
|
|
8815
8823
|
label: "action",
|
|
8816
|
-
tools:
|
|
8824
|
+
tools: le
|
|
8817
8825
|
},
|
|
8818
8826
|
{
|
|
8819
8827
|
label: "humanConfirm",
|
|
8820
|
-
tools:
|
|
8828
|
+
tools: de ? [de] : []
|
|
8821
8829
|
},
|
|
8822
8830
|
{
|
|
8823
8831
|
label: "checkpoint",
|
|
8824
|
-
tools:
|
|
8832
|
+
tools: fe
|
|
8825
8833
|
},
|
|
8826
8834
|
{
|
|
8827
8835
|
label: "focus",
|
|
8828
|
-
tools:
|
|
8836
|
+
tools: _e
|
|
8829
8837
|
},
|
|
8830
8838
|
{
|
|
8831
8839
|
label: "mcp",
|
|
8832
|
-
tools:
|
|
8840
|
+
tools: R
|
|
8833
8841
|
},
|
|
8834
8842
|
{
|
|
8835
8843
|
label: "skill",
|
|
8836
|
-
tools:
|
|
8844
|
+
tools: B
|
|
8837
8845
|
}
|
|
8838
8846
|
]);
|
|
8839
8847
|
return t.length && console.warn("[page-agent-sdk] 工具重名,后注册覆盖先注册:", t.map((e) => `${e.name}(${e.loser}→${e.winner})`).join(", ")), e;
|
|
8840
8848
|
}
|
|
8841
|
-
let
|
|
8842
|
-
if (
|
|
8843
|
-
if (
|
|
8844
|
-
let
|
|
8849
|
+
let be = M.planning, xe = M.missionAnchor, Se = M.workingMemory, Ce = M.skills, we = M.vfs;
|
|
8850
|
+
if (we) for (let e of Hc) L.set(e, "builtin");
|
|
8851
|
+
if (be) for (let e of S.tools ?? []) L.set(e.name, "builtin");
|
|
8852
|
+
let Te = M.summarization, Ee = M.agentCompression && !!p;
|
|
8845
8853
|
e.debug && M.agentCompression && !p && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
8846
|
-
let
|
|
8854
|
+
let De = M.memory, Oe = M.subagent, ke = Oe ? Eo() : void 0, Ae = e.verify?.maxAttempts ?? 2, je = M.verify && e.verify?.enabled !== !1 && Ae > 0, Me = M.contextInspector;
|
|
8847
8855
|
e.verify?.check && !M.verify && console.warn("[page-agent-sdk][verify] 检测到 verify.check 但 capabilities.verify 未开启,verify 未装载");
|
|
8848
|
-
let
|
|
8849
|
-
llm:
|
|
8850
|
-
allTools: () =>
|
|
8851
|
-
allowedTools:
|
|
8852
|
-
systemPrompt:
|
|
8853
|
-
temperature:
|
|
8854
|
-
maxTokens:
|
|
8855
|
-
skills:
|
|
8856
|
-
maxDepth:
|
|
8857
|
-
maxParallel:
|
|
8856
|
+
let Ne = e.subagent, Pe = Ne?.allowedTools ?? [], Fe = e.permissions?.length ? Ka(e.permissions) : void 0, Ie = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? qa(e.approval) : void 0, Le = [...Fe ? [Fe] : [], ...Ie ? [Ie] : []], Re = !Oe || Ne?.enabled === !1 ? void 0 : Ho({
|
|
8857
|
+
llm: Ne?.llm ?? e.llm,
|
|
8858
|
+
allTools: () => W.agent?.allTools ?? V,
|
|
8859
|
+
allowedTools: Pe.length ? Pe : void 0,
|
|
8860
|
+
systemPrompt: Ne?.systemPrompt,
|
|
8861
|
+
temperature: Ne?.temperature,
|
|
8862
|
+
maxTokens: Ne?.maxTokens,
|
|
8863
|
+
skills: Ne?.skills,
|
|
8864
|
+
maxDepth: Ne?.maxDepth,
|
|
8865
|
+
maxParallel: Ne?.maxParallel,
|
|
8858
8866
|
debug: e.debug,
|
|
8859
8867
|
getFocuses: () => w.getFocuses(),
|
|
8860
|
-
getSchema: () =>
|
|
8861
|
-
tracker:
|
|
8862
|
-
guardMiddleware:
|
|
8863
|
-
getVfsFiles:
|
|
8864
|
-
enterDataScope:
|
|
8865
|
-
exitDataScope:
|
|
8868
|
+
getSchema: () => I()?.schema ?? null,
|
|
8869
|
+
tracker: ke,
|
|
8870
|
+
guardMiddleware: Le.length ? Le : void 0,
|
|
8871
|
+
getVfsFiles: we ? () => x.files : void 0,
|
|
8872
|
+
enterDataScope: F?.enterScope ? (e) => F.enterScope(e) : void 0,
|
|
8873
|
+
exitDataScope: F?.exitScope ? (e) => F.exitScope(e) : void 0,
|
|
8866
8874
|
onUsage: (e) => {
|
|
8867
8875
|
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);
|
|
8868
8876
|
},
|
|
8869
|
-
timeoutMs:
|
|
8870
|
-
}),
|
|
8877
|
+
timeoutMs: Ne?.timeoutMs
|
|
8878
|
+
}), H = Oe && e.subagents !== void 0 ? Go(e.subagents, {
|
|
8871
8879
|
llm: e.llm,
|
|
8872
|
-
allTools: () =>
|
|
8880
|
+
allTools: () => W.agent?.allTools ?? V,
|
|
8873
8881
|
debug: e.debug,
|
|
8874
8882
|
getFocuses: () => w.getFocuses(),
|
|
8875
|
-
getSchema: () =>
|
|
8876
|
-
tracker:
|
|
8877
|
-
guardMiddleware:
|
|
8878
|
-
getVfsFiles:
|
|
8879
|
-
enterDataScope:
|
|
8880
|
-
exitDataScope:
|
|
8883
|
+
getSchema: () => I()?.schema ?? null,
|
|
8884
|
+
tracker: ke,
|
|
8885
|
+
guardMiddleware: Le.length ? Le : void 0,
|
|
8886
|
+
getVfsFiles: we ? () => x.files : void 0,
|
|
8887
|
+
enterDataScope: F?.enterScope ? (e) => F.enterScope(e) : void 0,
|
|
8888
|
+
exitDataScope: F?.exitScope ? (e) => F.exitScope(e) : void 0,
|
|
8881
8889
|
onUsage: (e) => {
|
|
8882
8890
|
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);
|
|
8883
8891
|
},
|
|
8884
8892
|
timeoutMs: e.subagent?.timeoutMs
|
|
8885
|
-
}) : void 0,
|
|
8893
|
+
}) : void 0, ze = H ? H.controller : null, Be = [
|
|
8886
8894
|
"get_data",
|
|
8887
8895
|
"describe_data",
|
|
8888
8896
|
"read",
|
|
8889
8897
|
"fetch_document"
|
|
8890
|
-
],
|
|
8898
|
+
], Ve = V.filter((e) => Be.includes(e.name)), He = je ? Ko({
|
|
8891
8899
|
check: e.verify.check ?? Qo({
|
|
8892
|
-
schemas: () =>
|
|
8893
|
-
root: () =>
|
|
8900
|
+
schemas: () => I() ? { "": I().schema } : {},
|
|
8901
|
+
root: () => I()?.bind
|
|
8894
8902
|
}),
|
|
8895
8903
|
adversarial: e.verify?.adversarial ? {
|
|
8896
8904
|
llm: e.llm,
|
|
8897
|
-
tools:
|
|
8905
|
+
tools: Ve
|
|
8898
8906
|
} : void 0
|
|
8899
|
-
}) : void 0,
|
|
8907
|
+
}) : void 0, Ue = Me ? fs({
|
|
8900
8908
|
contextWindow: m.contextWindow,
|
|
8901
8909
|
thresholdRatio: mc(e, m.contextWindow).summaryThresholdRatio
|
|
8902
|
-
}) : void 0,
|
|
8910
|
+
}) : void 0, We = eu({
|
|
8903
8911
|
...M,
|
|
8904
|
-
humanConfirm:
|
|
8912
|
+
humanConfirm: ue,
|
|
8905
8913
|
subagents: e.subagents?.map((e) => ({
|
|
8906
8914
|
id: e.id,
|
|
8907
8915
|
description: e.description,
|
|
8908
8916
|
temperature: e.temperature
|
|
8909
8917
|
}))
|
|
8910
|
-
}, te && !!D, e.toolMode, !!D?.resources?.length),
|
|
8918
|
+
}, te && !!D, e.toolMode, !!D?.resources?.length), Ge = D ? {
|
|
8911
8919
|
name: "dataHint",
|
|
8912
|
-
augmentPrompt: () => vs(
|
|
8913
|
-
} : null,
|
|
8920
|
+
augmentPrompt: () => vs(I(), e.schemaHint) || void 0
|
|
8921
|
+
} : null, Ke = e.augmentSystem ? {
|
|
8914
8922
|
name: "augmentSystem",
|
|
8915
8923
|
augmentPrompt: (t) => {
|
|
8916
8924
|
try {
|
|
8917
8925
|
return e.augmentSystem({
|
|
8918
8926
|
state: t,
|
|
8919
|
-
data:
|
|
8927
|
+
data: I()
|
|
8920
8928
|
});
|
|
8921
8929
|
} catch (t) {
|
|
8922
8930
|
e.debug && console.log("[page-agent-sdk][augmentSystem] 回调抛错,降级跳过:", t.message);
|
|
8923
8931
|
return;
|
|
8924
8932
|
}
|
|
8925
8933
|
}
|
|
8926
|
-
} : null,
|
|
8934
|
+
} : null, qe = dc(e.onEvent), U = qe.emit, Je, Ye = [], Xe = (e) => ({
|
|
8927
8935
|
name: e.name,
|
|
8928
8936
|
description: e.description,
|
|
8929
8937
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
8930
|
-
}),
|
|
8938
|
+
}), Ze = (e) => ({
|
|
8931
8939
|
name: e.name,
|
|
8932
8940
|
description: e.description,
|
|
8933
8941
|
getContent: () => e.content
|
|
8934
|
-
}),
|
|
8942
|
+
}), Qe = e.skillStorage === !1 ? null : ou({
|
|
8935
8943
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
8936
8944
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
8937
|
-
}),
|
|
8938
|
-
let t =
|
|
8945
|
+
}), $e = () => {
|
|
8946
|
+
let t = Je ? Je.controller : null;
|
|
8939
8947
|
if (t) {
|
|
8940
|
-
let n = (e.skills || []).filter((e) => !
|
|
8941
|
-
t.set([...n, ...
|
|
8948
|
+
let n = (e.skills || []).filter((e) => !Ye.some((t) => t.name === e.name));
|
|
8949
|
+
t.set([...n, ...Ye]);
|
|
8942
8950
|
}
|
|
8943
|
-
|
|
8944
|
-
},
|
|
8945
|
-
if (
|
|
8946
|
-
let t = await
|
|
8951
|
+
W.infoTick.value++;
|
|
8952
|
+
}, et = async () => {
|
|
8953
|
+
if (Qe) try {
|
|
8954
|
+
let t = await Qe.list();
|
|
8947
8955
|
if (t.length) {
|
|
8948
|
-
|
|
8949
|
-
let n =
|
|
8956
|
+
Ye = t.map(Ze);
|
|
8957
|
+
let n = Je ? Je.controller : null;
|
|
8950
8958
|
if (n) {
|
|
8951
|
-
let t = (e.skills || []).filter((e) => !
|
|
8952
|
-
n.set([...t, ...
|
|
8959
|
+
let t = (e.skills || []).filter((e) => !Ye.some((t) => t.name === e.name));
|
|
8960
|
+
n.set([...t, ...Ye]);
|
|
8953
8961
|
}
|
|
8954
|
-
|
|
8962
|
+
W.infoTick.value++;
|
|
8955
8963
|
}
|
|
8956
8964
|
} catch {}
|
|
8957
|
-
},
|
|
8965
|
+
}, tt = Te ? To({
|
|
8958
8966
|
...h,
|
|
8959
8967
|
llmInvoke: l,
|
|
8960
|
-
getRegisteredData: () =>
|
|
8968
|
+
getRegisteredData: () => I() ? [{ description: I().description ?? "主数据对象" }] : [],
|
|
8961
8969
|
preserveLastToolResults: _,
|
|
8962
|
-
...
|
|
8970
|
+
...Ee ? {
|
|
8963
8971
|
decideInvoke: p,
|
|
8964
|
-
getSnapshot: () =>
|
|
8972
|
+
getSnapshot: () => Ue?.getSnapshot()
|
|
8965
8973
|
} : {}
|
|
8966
|
-
}) : void 0,
|
|
8967
|
-
...
|
|
8968
|
-
|
|
8969
|
-
...
|
|
8970
|
-
...
|
|
8971
|
-
...
|
|
8972
|
-
readVfs:
|
|
8974
|
+
}) : void 0, nt = gc([
|
|
8975
|
+
...Ge ? [Ge] : [],
|
|
8976
|
+
We,
|
|
8977
|
+
...xe ? [C] : [],
|
|
8978
|
+
...be ? [S] : [],
|
|
8979
|
+
...Ce ? [Je = za(e.skills || [], {
|
|
8980
|
+
readVfs: we ? (e) => x.files[e]?.content : void 0,
|
|
8973
8981
|
hostScriptEnabled: M.skillHostScript,
|
|
8974
8982
|
onToolsReady: (e, t) => {
|
|
8975
8983
|
for (let n of t) {
|
|
8976
|
-
let t =
|
|
8977
|
-
t >= 0 &&
|
|
8984
|
+
let t = B.findIndex((e) => e.name === n.name);
|
|
8985
|
+
t >= 0 && B.splice(t, 1), B.push(n), ve.set(n.name, e), L.set(n.name, `skill:${e}`);
|
|
8978
8986
|
}
|
|
8979
|
-
|
|
8987
|
+
V = ye(), W.agent && W.agent.setTools(V), W.infoTick.value++;
|
|
8980
8988
|
}
|
|
8981
8989
|
})] : [],
|
|
8982
|
-
...
|
|
8983
|
-
...
|
|
8984
|
-
...
|
|
8985
|
-
...
|
|
8986
|
-
...
|
|
8987
|
-
...
|
|
8988
|
-
...Pe ? [Pe] : [],
|
|
8989
|
-
...k && j && A ? [ao(A)] : [],
|
|
8990
|
-
...le ? [Za()] : [],
|
|
8990
|
+
...we ? [Wc(x)] : [],
|
|
8991
|
+
...tt ? [tt] : [],
|
|
8992
|
+
...Se ? [T] : [],
|
|
8993
|
+
...pe ? [w] : [],
|
|
8994
|
+
...oe ? [oe] : [],
|
|
8995
|
+
...De ? [E] : [],
|
|
8991
8996
|
...Fe ? [Fe] : [],
|
|
8992
|
-
...
|
|
8993
|
-
...
|
|
8994
|
-
...
|
|
8995
|
-
...Ge ? [Ge] : [],
|
|
8997
|
+
...k && j && A ? [ao(A)] : [],
|
|
8998
|
+
...ue ? [Za()] : [],
|
|
8999
|
+
...Ie ? [Ie] : [],
|
|
8996
9000
|
...He ? [He] : [],
|
|
9001
|
+
...Re ? [Re] : [],
|
|
9002
|
+
...H ? [H] : [],
|
|
9003
|
+
...Ke ? [Ke] : [],
|
|
9004
|
+
...Ue ? [Ue] : [],
|
|
8997
9005
|
...e.middleware || [],
|
|
8998
9006
|
...P ? [Wl(i, {
|
|
8999
9007
|
tokenBudget: e.tokenBudget,
|
|
9000
9008
|
timeBudgetMs: e.timeBudgetMs
|
|
9001
|
-
},
|
|
9002
|
-
mu(
|
|
9003
|
-
]),
|
|
9004
|
-
function
|
|
9005
|
-
if (
|
|
9009
|
+
}, U)] : [],
|
|
9010
|
+
mu(U, b, I, i)
|
|
9011
|
+
]), rt = e.maxMemoryRounds ?? du, it = e.approval?.timeoutMs, at = it === void 0 || it === 0 ? 3e4 : !Number.isFinite(it) || it < 0 ? 0 : it;
|
|
9012
|
+
function ot(e) {
|
|
9013
|
+
if (at) return (t) => {
|
|
9006
9014
|
if (t.type !== "approval_request") return;
|
|
9007
9015
|
let n = Date.now(), r = t.toolName;
|
|
9008
9016
|
setTimeout(() => {
|
|
9009
|
-
e?.aborted || (t.resolve(!1),
|
|
9017
|
+
e?.aborted || (t.resolve(!1), U({
|
|
9010
9018
|
type: "error",
|
|
9011
9019
|
message: `确认请求(${r})${Math.round((Date.now() - n) / 1e3)}s 无响应已自动拒绝 —— send/batch 路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
9012
9020
|
severity: "observable",
|
|
@@ -9016,19 +9024,31 @@ function gu(e, n) {
|
|
|
9016
9024
|
waitedMs: Date.now() - n
|
|
9017
9025
|
}
|
|
9018
9026
|
}));
|
|
9019
|
-
},
|
|
9027
|
+
}, at);
|
|
9028
|
+
};
|
|
9029
|
+
}
|
|
9030
|
+
let st = /* @__PURE__ */ kt([]);
|
|
9031
|
+
async function ct() {
|
|
9032
|
+
s && (st.value = (await s.listSessions(n)).sort((e, t) => t.lastAccessed - e.lastAccessed));
|
|
9033
|
+
}
|
|
9034
|
+
let lt = uu(), ut = /* @__PURE__ */ new Set();
|
|
9035
|
+
function dt(e) {
|
|
9036
|
+
let t = new AbortController();
|
|
9037
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", () => t.abort(), { once: !0 })), ut.add(t), {
|
|
9038
|
+
controller: t,
|
|
9039
|
+
untrack: () => ut.delete(t)
|
|
9020
9040
|
};
|
|
9021
9041
|
}
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
9042
|
+
function ft() {
|
|
9043
|
+
for (let e of ut) e.abort();
|
|
9044
|
+
ut.clear();
|
|
9025
9045
|
}
|
|
9026
|
-
let
|
|
9046
|
+
let W = {
|
|
9027
9047
|
agentId: n,
|
|
9028
9048
|
store: s,
|
|
9029
9049
|
messages: b,
|
|
9030
9050
|
vfsStore: x,
|
|
9031
|
-
listeners:
|
|
9051
|
+
listeners: qe.listeners,
|
|
9032
9052
|
todosMw: S,
|
|
9033
9053
|
memoryMw: E,
|
|
9034
9054
|
missionMw: C,
|
|
@@ -9041,52 +9061,55 @@ function gu(e, n) {
|
|
|
9041
9061
|
mcpClosers: [],
|
|
9042
9062
|
mcpServers: [],
|
|
9043
9063
|
checkpoint: A,
|
|
9044
|
-
dataOpsController:
|
|
9045
|
-
skillsController:
|
|
9064
|
+
dataOpsController: F,
|
|
9065
|
+
skillsController: Je ? Je.controller : null,
|
|
9046
9066
|
infoTick: o,
|
|
9047
9067
|
pendingConflict: a.pendingConflict,
|
|
9048
|
-
sessions:
|
|
9049
|
-
refreshSessions:
|
|
9050
|
-
liveData:
|
|
9068
|
+
sessions: st,
|
|
9069
|
+
refreshSessions: ct,
|
|
9070
|
+
liveData: I,
|
|
9051
9071
|
usage: i,
|
|
9052
|
-
emit:
|
|
9072
|
+
emit: U,
|
|
9073
|
+
runSerial: lt,
|
|
9074
|
+
trackActive: dt,
|
|
9075
|
+
abortAllActive: ft,
|
|
9053
9076
|
unloadSkillTools(e) {
|
|
9054
9077
|
if (e) {
|
|
9055
|
-
let t =
|
|
9056
|
-
if (
|
|
9078
|
+
let t = B.length;
|
|
9079
|
+
if (B = B.filter((t) => ve.get(t.name) === e ? (L.delete(t.name), ve.delete(t.name), !1) : !0), B.length === t) return;
|
|
9057
9080
|
} else {
|
|
9058
|
-
if (!
|
|
9059
|
-
for (let e of
|
|
9060
|
-
|
|
9081
|
+
if (!B.length) return;
|
|
9082
|
+
for (let e of B) L.delete(e.name), ve.delete(e.name);
|
|
9083
|
+
B = [];
|
|
9061
9084
|
}
|
|
9062
|
-
|
|
9085
|
+
V = ye(), W.agent && W.agent.setTools(V);
|
|
9063
9086
|
},
|
|
9064
9087
|
applySnapshot(t) {
|
|
9065
|
-
if (t.messages?.length && b.push(...t.messages), t.vfs && x.hydrate && x.hydrate(t.vfs), t.todos?.length && S.reset(t.todos), t.memory && !e.memory && E.reset(t.memory), t.checkpoints?.length && A && A.importStack(t.checkpoints), t.usage && Object.assign(i, t.usage), t.mission &&
|
|
9088
|
+
if (t.messages?.length && b.push(...t.messages), t.vfs && x.hydrate && x.hydrate(t.vfs), t.todos?.length && S.reset(t.todos), t.memory && !e.memory && E.reset(t.memory), t.checkpoints?.length && A && A.importStack(t.checkpoints), t.usage && Object.assign(i, t.usage), t.mission && xe && C.setMission(t.mission), t.workingMemory && Se && T.restore(t.workingMemory), pe) {
|
|
9066
9089
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
9067
9090
|
if (r.length) {
|
|
9068
|
-
let t =
|
|
9091
|
+
let t = I()?.schema, n = t ? r.filter((e) => zi(t, e.path)) : [];
|
|
9069
9092
|
if (n.length && (w.setFocus(null), n.forEach((e) => w.addFocus(e))), e.debug && n.length < r.length) {
|
|
9070
9093
|
let e = r.filter((e) => !n.includes(e)).map((e) => e.path);
|
|
9071
9094
|
console.warn("[page-agent-sdk][focus] 恢复的焦点部分 path 已失效(schema 变化/无 schema),剔除:", e);
|
|
9072
9095
|
}
|
|
9073
9096
|
}
|
|
9074
9097
|
}
|
|
9075
|
-
|
|
9098
|
+
gt();
|
|
9076
9099
|
},
|
|
9077
9100
|
addSkill(e) {
|
|
9078
|
-
let t =
|
|
9079
|
-
t >= 0 ?
|
|
9101
|
+
let t = Ye.findIndex((t) => t.name === e.name);
|
|
9102
|
+
t >= 0 ? Ye[t] = e : Ye.push(e), $e(), Qe && Qe.put(Xe(e));
|
|
9080
9103
|
},
|
|
9081
9104
|
removeSkill(e) {
|
|
9082
|
-
let t =
|
|
9083
|
-
return t < 0 ? !1 : (
|
|
9105
|
+
let t = Ye.findIndex((t) => t.name === e);
|
|
9106
|
+
return t < 0 ? !1 : (Ye.splice(t, 1), $e(), Qe && Qe.remove(e), !0);
|
|
9084
9107
|
},
|
|
9085
9108
|
listUserSkills() {
|
|
9086
|
-
return
|
|
9109
|
+
return Ye.map((e) => e.name);
|
|
9087
9110
|
},
|
|
9088
9111
|
getUserSkill(e) {
|
|
9089
|
-
let t =
|
|
9112
|
+
let t = Ye.find((t) => t.name === e);
|
|
9090
9113
|
if (t) return {
|
|
9091
9114
|
name: t.name,
|
|
9092
9115
|
description: t.description,
|
|
@@ -9094,16 +9117,16 @@ function gu(e, n) {
|
|
|
9094
9117
|
};
|
|
9095
9118
|
},
|
|
9096
9119
|
afterRound() {
|
|
9097
|
-
|
|
9120
|
+
_t(), xt();
|
|
9098
9121
|
},
|
|
9099
9122
|
async send(e, t) {
|
|
9100
|
-
await
|
|
9123
|
+
await W.initDone, t ??= {}, t?.mission && xe && C.setMission(t.mission);
|
|
9101
9124
|
let n = e;
|
|
9102
9125
|
if (t.interceptors?.input) try {
|
|
9103
9126
|
let r = t.interceptors.input(e);
|
|
9104
9127
|
typeof r == "string" && (n = r);
|
|
9105
9128
|
} catch {}
|
|
9106
|
-
let r = P ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o =
|
|
9129
|
+
let r = P ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o = ot(t.signal);
|
|
9107
9130
|
for (;;) {
|
|
9108
9131
|
a ||= (b.push({
|
|
9109
9132
|
role: "user",
|
|
@@ -9111,7 +9134,7 @@ function gu(e, n) {
|
|
|
9111
9134
|
timestamp: Date.now()
|
|
9112
9135
|
}), !0);
|
|
9113
9136
|
try {
|
|
9114
|
-
let e = await
|
|
9137
|
+
let e = await W.agent.invoke(b, t.signal, o);
|
|
9115
9138
|
if (t.interceptors?.output) try {
|
|
9116
9139
|
let n = t.interceptors.output(e);
|
|
9117
9140
|
typeof n == "string" && (e = n);
|
|
@@ -9120,12 +9143,12 @@ function gu(e, n) {
|
|
|
9120
9143
|
role: "assistant",
|
|
9121
9144
|
content: e,
|
|
9122
9145
|
timestamp: Date.now()
|
|
9123
|
-
}),
|
|
9146
|
+
}), W.afterRound(), s && await s.flush(), e;
|
|
9124
9147
|
} catch (e) {
|
|
9125
9148
|
if (ci(e, t.signal)) throw e;
|
|
9126
9149
|
let n = Jr(e, "fatal");
|
|
9127
9150
|
if (i < r && A?.canRestore()) {
|
|
9128
|
-
i += 1, A.restore(), a = !0,
|
|
9151
|
+
i += 1, A.restore(), a = !0, U({
|
|
9129
9152
|
type: "error",
|
|
9130
9153
|
message: `致命错误自动恢复(${i}/${r}):${n.message},已回退 checkpoint 重试`,
|
|
9131
9154
|
severity: "observable",
|
|
@@ -9137,7 +9160,7 @@ function gu(e, n) {
|
|
|
9137
9160
|
});
|
|
9138
9161
|
continue;
|
|
9139
9162
|
}
|
|
9140
|
-
throw
|
|
9163
|
+
throw U({
|
|
9141
9164
|
type: "error",
|
|
9142
9165
|
message: n.message,
|
|
9143
9166
|
severity: n.severity,
|
|
@@ -9148,8 +9171,8 @@ function gu(e, n) {
|
|
|
9148
9171
|
}
|
|
9149
9172
|
},
|
|
9150
9173
|
async batch(e, t, n) {
|
|
9151
|
-
if (await
|
|
9152
|
-
let r = [], i =
|
|
9174
|
+
if (await W.initDone, !e.length) return [];
|
|
9175
|
+
let r = [], i = ot(n);
|
|
9153
9176
|
for (let a = 0; a < e.length; a++) {
|
|
9154
9177
|
if (n?.aborted) {
|
|
9155
9178
|
for (let t = a; t < e.length; t++) r.push({
|
|
@@ -9169,12 +9192,12 @@ function gu(e, n) {
|
|
|
9169
9192
|
content: o,
|
|
9170
9193
|
timestamp: Date.now()
|
|
9171
9194
|
});
|
|
9172
|
-
let c = await
|
|
9195
|
+
let c = await W.agent.invoke(b, n, i);
|
|
9173
9196
|
b.push({
|
|
9174
9197
|
role: "assistant",
|
|
9175
9198
|
content: c,
|
|
9176
9199
|
timestamp: Date.now()
|
|
9177
|
-
}),
|
|
9200
|
+
}), W.afterRound(), s && await s.flush(), r.push({
|
|
9178
9201
|
index: a,
|
|
9179
9202
|
task: o,
|
|
9180
9203
|
reply: c,
|
|
@@ -9202,7 +9225,7 @@ function gu(e, n) {
|
|
|
9202
9225
|
break;
|
|
9203
9226
|
}
|
|
9204
9227
|
let s = Jr(i, "fatal");
|
|
9205
|
-
|
|
9228
|
+
U({
|
|
9206
9229
|
type: "error",
|
|
9207
9230
|
message: `批量任务 ${a + 1}/${e.length} 失败:${s.message}`,
|
|
9208
9231
|
severity: "observable",
|
|
@@ -9227,69 +9250,70 @@ function gu(e, n) {
|
|
|
9227
9250
|
return r;
|
|
9228
9251
|
},
|
|
9229
9252
|
async switchSession(t) {
|
|
9230
|
-
if (await
|
|
9231
|
-
if (a.resolve("keep_external"),
|
|
9232
|
-
if (
|
|
9253
|
+
if (await W.initDone, !s) throw Error("page-agent-sdk: storage 未开启,无法切换会话(请传 storage 选项)");
|
|
9254
|
+
if (a.resolve("keep_external"), W.sessionId && s) {
|
|
9255
|
+
if (xe) {
|
|
9233
9256
|
let e = C.getMission();
|
|
9234
|
-
e && s.save(n,
|
|
9257
|
+
e && s.save(n, W.sessionId, { mission: e });
|
|
9235
9258
|
}
|
|
9236
|
-
if (
|
|
9259
|
+
if (Se) {
|
|
9237
9260
|
let e = T.getWorkingMemory();
|
|
9238
|
-
e && s.save(n,
|
|
9261
|
+
e && s.save(n, W.sessionId, { workingMemory: e });
|
|
9239
9262
|
}
|
|
9240
|
-
if (
|
|
9263
|
+
if (pe) {
|
|
9241
9264
|
let e = w.getFocuses();
|
|
9242
|
-
s.save(n,
|
|
9265
|
+
s.save(n, W.sessionId, { focus: e.length ? e : null });
|
|
9243
9266
|
}
|
|
9244
9267
|
}
|
|
9245
9268
|
x.flush?.(), await s.flush();
|
|
9246
9269
|
let r = t ?? "", i;
|
|
9247
|
-
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),
|
|
9270
|
+
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), W.sessionId = r, b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), A && A.importStack([]), W.agent.debugLogs.value = [], i ||= await s.load(n, r), i && (W.applySnapshot(i), U({
|
|
9248
9271
|
type: "session_restored",
|
|
9249
9272
|
sessionId: r,
|
|
9250
9273
|
rounds: i.messages?.length ?? 0
|
|
9251
|
-
})), e.memory && s.save(n,
|
|
9274
|
+
})), e.memory && s.save(n, W.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), ct(), yt = void 0, bt = !1, r;
|
|
9252
9275
|
},
|
|
9253
9276
|
resetSession: () => {
|
|
9254
|
-
|
|
9277
|
+
ft(), a.resolve("keep_external"), W.sessionId = Is(), b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), A && A.importStack([]), W.agent && (W.agent.debugLogs.value = []), s && s.createSession(W.agentId, e.session?.title, W.sessionId), U({
|
|
9255
9278
|
type: "session_restored",
|
|
9256
|
-
sessionId:
|
|
9279
|
+
sessionId: W.sessionId,
|
|
9257
9280
|
rounds: 0
|
|
9258
|
-
}),
|
|
9281
|
+
}), ct(), yt = void 0, bt = !1;
|
|
9259
9282
|
},
|
|
9260
9283
|
stream: (e, t, n) => {
|
|
9261
|
-
if (!
|
|
9284
|
+
if (!W.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
9262
9285
|
x?.setProtectedRefs?.(cu(e));
|
|
9263
9286
|
let r = (e) => {
|
|
9264
|
-
t?.(e),
|
|
9287
|
+
t?.(e), U(e);
|
|
9265
9288
|
};
|
|
9266
9289
|
if (n) {
|
|
9267
9290
|
let e = () => a.resolve("keep_external");
|
|
9268
9291
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
9269
9292
|
}
|
|
9270
|
-
|
|
9293
|
+
let { controller: i, untrack: o } = dt(n);
|
|
9294
|
+
return W.agent.stream(e, r, i.signal).finally(o);
|
|
9271
9295
|
},
|
|
9272
9296
|
release() {
|
|
9273
|
-
if (
|
|
9274
|
-
s && (x.flush?.(), s.flush(), s.dispose()),
|
|
9275
|
-
let e =
|
|
9297
|
+
if (W.refCount--, W.refCount <= 0) {
|
|
9298
|
+
ft(), s && (x.flush?.(), s.flush(), s.dispose()), Qe && Qe.dispose();
|
|
9299
|
+
let e = W.mcpClosers.splice(0);
|
|
9276
9300
|
e.length && Promise.allSettled(e.map((e) => e())), fu.delete(n);
|
|
9277
9301
|
}
|
|
9278
9302
|
},
|
|
9279
9303
|
resolveConflict: a.resolve,
|
|
9280
9304
|
setTools(e) {
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
}),
|
|
9305
|
+
ce.length = 0, e.forEach((e) => {
|
|
9306
|
+
ce.push(e), L.set(e.name, "user");
|
|
9307
|
+
}), V = ye(), W.agent && W.agent.setTools(V), W.infoTick.value++;
|
|
9284
9308
|
},
|
|
9285
9309
|
addTool(e) {
|
|
9286
|
-
|
|
9287
|
-
for (let t =
|
|
9288
|
-
|
|
9310
|
+
V.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
9311
|
+
for (let t = ce.length - 1; t >= 0; t--) ce[t].name === e.name && ce.splice(t, 1);
|
|
9312
|
+
ce.push(e), L.set(e.name, "user"), V = ye(), W.agent && W.agent.setTools(V), W.infoTick.value++;
|
|
9289
9313
|
},
|
|
9290
9314
|
removeTool(e) {
|
|
9291
|
-
let t =
|
|
9292
|
-
return t < 0 ? !1 : (
|
|
9315
|
+
let t = ce.findIndex((t) => t.name === e);
|
|
9316
|
+
return t < 0 ? !1 : (ce.splice(t, 1), L.delete(e), V = ye(), W.agent && W.agent.setTools(V), W.infoTick.value++, !0);
|
|
9293
9317
|
},
|
|
9294
9318
|
setLlm(t) {
|
|
9295
9319
|
let n;
|
|
@@ -9306,63 +9330,63 @@ function gu(e, n) {
|
|
|
9306
9330
|
contextWindow: e.contextWindow ?? r?.contextWindow,
|
|
9307
9331
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens
|
|
9308
9332
|
}), m.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${m.contextWindow} 小于最小支持 ${ni}(需 ≥200K 窗口模型)`);
|
|
9309
|
-
|
|
9333
|
+
W.agent && (W.agent.setLlm(n), W.agent.setModelCaps?.(m)), tt?.setContextWindow?.(m.contextWindow), Ue?.setContextWindow?.(m.contextWindow), W.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", m);
|
|
9310
9334
|
},
|
|
9311
9335
|
setMemory(e) {
|
|
9312
|
-
E.reset(e), typeof e == "function" && E.refresh(),
|
|
9336
|
+
E.reset(e), typeof e == "function" && E.refresh(), W.infoTick.value++;
|
|
9313
9337
|
},
|
|
9314
9338
|
refreshMemory() {
|
|
9315
9339
|
return E.refresh();
|
|
9316
9340
|
},
|
|
9317
9341
|
setSubagents(t) {
|
|
9318
|
-
if (!
|
|
9342
|
+
if (!ze) {
|
|
9319
9343
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
9320
9344
|
return;
|
|
9321
9345
|
}
|
|
9322
|
-
|
|
9346
|
+
ze.set(t), W.infoTick.value++;
|
|
9323
9347
|
},
|
|
9324
9348
|
addSubagent(t) {
|
|
9325
|
-
if (!
|
|
9349
|
+
if (!ze) {
|
|
9326
9350
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
9327
9351
|
return;
|
|
9328
9352
|
}
|
|
9329
|
-
|
|
9353
|
+
ze.add(t), W.infoTick.value++;
|
|
9330
9354
|
},
|
|
9331
9355
|
removeSubagent(t) {
|
|
9332
|
-
if (!
|
|
9333
|
-
let n =
|
|
9334
|
-
return n &&
|
|
9356
|
+
if (!ze) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
9357
|
+
let n = ze.remove(t);
|
|
9358
|
+
return n && W.infoTick.value++, n;
|
|
9335
9359
|
},
|
|
9336
9360
|
getActiveSubagents() {
|
|
9337
|
-
return
|
|
9361
|
+
return ke?.getActive() ?? [];
|
|
9338
9362
|
},
|
|
9339
9363
|
get subagentHistory() {
|
|
9340
|
-
return
|
|
9364
|
+
return ke?.getHistory() ?? [];
|
|
9341
9365
|
},
|
|
9342
9366
|
getInfo() {
|
|
9343
9367
|
return {
|
|
9344
9368
|
id: n,
|
|
9345
|
-
sessionId:
|
|
9369
|
+
sessionId: W.sessionId,
|
|
9346
9370
|
model: Ts(y) ? y.model ?? y.modelName : y.model,
|
|
9347
|
-
systemPrompt:
|
|
9348
|
-
tools: (
|
|
9371
|
+
systemPrompt: W.agent?.getEffectiveSystemPrompt?.() ?? re + vs(I(), e.schemaHint),
|
|
9372
|
+
tools: (W.agent?.allTools ?? V).map((e) => ({
|
|
9349
9373
|
name: e.name,
|
|
9350
9374
|
description: e.description,
|
|
9351
9375
|
schema: e.schema,
|
|
9352
|
-
source:
|
|
9376
|
+
source: L.get(e.name) || "user"
|
|
9353
9377
|
})),
|
|
9354
|
-
skills: (
|
|
9378
|
+
skills: (Je ? Je.controller.get() : e.skills ?? []).map((e) => ({
|
|
9355
9379
|
name: e.name,
|
|
9356
9380
|
description: e.description
|
|
9357
9381
|
})),
|
|
9358
|
-
data:
|
|
9359
|
-
description:
|
|
9360
|
-
schema:
|
|
9382
|
+
data: I() ? {
|
|
9383
|
+
description: I().description,
|
|
9384
|
+
schema: I().schema
|
|
9361
9385
|
} : void 0,
|
|
9362
9386
|
contextPreset: e.contextPreset ?? "auto",
|
|
9363
9387
|
memory: E.get(),
|
|
9364
|
-
middleware:
|
|
9365
|
-
todos: (
|
|
9388
|
+
middleware: nt.map((e) => e.name),
|
|
9389
|
+
todos: (W.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
9366
9390
|
id: e.id,
|
|
9367
9391
|
content: e.content,
|
|
9368
9392
|
status: e.status,
|
|
@@ -9372,39 +9396,39 @@ function gu(e, n) {
|
|
|
9372
9396
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
9373
9397
|
})),
|
|
9374
9398
|
planPhase: S.getPlanPhase(),
|
|
9375
|
-
mission:
|
|
9376
|
-
workingMemory:
|
|
9377
|
-
focus:
|
|
9378
|
-
focuses:
|
|
9379
|
-
trace: N &&
|
|
9380
|
-
spans:
|
|
9381
|
-
metrics: oi(
|
|
9399
|
+
mission: xe ? C.getMission() : void 0,
|
|
9400
|
+
workingMemory: Se ? T.getWorkingMemory() : void 0,
|
|
9401
|
+
focus: pe ? w.getFocus() : void 0,
|
|
9402
|
+
focuses: pe ? w.getFocuses() : [],
|
|
9403
|
+
trace: N && W.agent?.spans ? {
|
|
9404
|
+
spans: W.agent.spans.value,
|
|
9405
|
+
metrics: oi(W.agent.spans.value)
|
|
9382
9406
|
} : void 0,
|
|
9383
9407
|
actions: ql(e.actions ?? {}),
|
|
9384
9408
|
subagent: {
|
|
9385
|
-
enabled: !!
|
|
9409
|
+
enabled: !!Re,
|
|
9386
9410
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
9387
9411
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
9388
9412
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
9389
|
-
subagents:
|
|
9390
|
-
active:
|
|
9391
|
-
history:
|
|
9413
|
+
subagents: ze?.get() ?? [],
|
|
9414
|
+
active: ke?.getActive() ?? [],
|
|
9415
|
+
history: ke?.getHistory() ?? []
|
|
9392
9416
|
},
|
|
9393
9417
|
verify: {
|
|
9394
|
-
enabled: !!
|
|
9395
|
-
maxAttempts:
|
|
9396
|
-
adversarial:
|
|
9418
|
+
enabled: !!He,
|
|
9419
|
+
maxAttempts: je ? Ae : 0,
|
|
9420
|
+
adversarial: je && !!e.verify?.adversarial
|
|
9397
9421
|
},
|
|
9398
9422
|
context: (() => {
|
|
9399
|
-
let e =
|
|
9423
|
+
let e = Ue?.getSnapshot();
|
|
9400
9424
|
if (e) {
|
|
9401
|
-
let t =
|
|
9425
|
+
let t = W.agent?.getState?.()?.lastCompression;
|
|
9402
9426
|
t && (e.compression = t);
|
|
9403
9427
|
}
|
|
9404
9428
|
return e;
|
|
9405
9429
|
})(),
|
|
9406
|
-
mcp: { servers:
|
|
9407
|
-
lastCompression:
|
|
9430
|
+
mcp: { servers: W.mcpServers },
|
|
9431
|
+
lastCompression: W.agent?.getState?.()?.lastCompression,
|
|
9408
9432
|
checkpoints: A ? {
|
|
9409
9433
|
enabled: !0,
|
|
9410
9434
|
auto: j,
|
|
@@ -9413,69 +9437,69 @@ function gu(e, n) {
|
|
|
9413
9437
|
};
|
|
9414
9438
|
},
|
|
9415
9439
|
getMission() {
|
|
9416
|
-
return
|
|
9440
|
+
return xe ? C.getMission() : void 0;
|
|
9417
9441
|
},
|
|
9418
9442
|
setMission(t) {
|
|
9419
|
-
if (!
|
|
9443
|
+
if (!xe) {
|
|
9420
9444
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
9421
9445
|
return;
|
|
9422
9446
|
}
|
|
9423
|
-
C.setMission(t),
|
|
9447
|
+
C.setMission(t), W.infoTick.value++;
|
|
9424
9448
|
},
|
|
9425
9449
|
getFocus() {
|
|
9426
|
-
return
|
|
9450
|
+
return pe ? w.getFocus() : void 0;
|
|
9427
9451
|
},
|
|
9428
9452
|
getFocuses() {
|
|
9429
|
-
return
|
|
9453
|
+
return pe ? w.getFocuses() : [];
|
|
9430
9454
|
},
|
|
9431
9455
|
setFocus(t) {
|
|
9432
|
-
let n = hu(t, "setFocus",
|
|
9433
|
-
return n.ok ? (w.setFocus(t),
|
|
9456
|
+
let n = hu(t, "setFocus", pe, () => I()?.schema, e.debug);
|
|
9457
|
+
return n.ok ? (w.setFocus(t), W.infoTick.value++, { ok: !0 }) : n;
|
|
9434
9458
|
},
|
|
9435
9459
|
addFocus(t) {
|
|
9436
|
-
let n = hu(t, "addFocus",
|
|
9460
|
+
let n = hu(t, "addFocus", pe, () => I()?.schema, e.debug);
|
|
9437
9461
|
return n.ok ? w.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
9438
9462
|
ok: !1,
|
|
9439
9463
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
9440
|
-
}) : (w.addFocus(t),
|
|
9464
|
+
}) : (w.addFocus(t), W.infoTick.value++, { ok: !0 }) : n;
|
|
9441
9465
|
},
|
|
9442
9466
|
removeFocus(e) {
|
|
9443
|
-
|
|
9467
|
+
pe && (w.removeFocus(e), W.infoTick.value++);
|
|
9444
9468
|
},
|
|
9445
9469
|
clearFocus() {
|
|
9446
|
-
|
|
9470
|
+
pe && (w.clearFocus(), W.infoTick.value++);
|
|
9447
9471
|
}
|
|
9448
9472
|
};
|
|
9449
|
-
async function
|
|
9473
|
+
async function pt() {
|
|
9450
9474
|
if (!s) return;
|
|
9451
9475
|
await s.ready;
|
|
9452
9476
|
let t = e.session || {};
|
|
9453
9477
|
if (t.id) {
|
|
9454
|
-
|
|
9455
|
-
let e = await s.load(n,
|
|
9456
|
-
e ? (
|
|
9478
|
+
W.sessionId = t.id;
|
|
9479
|
+
let e = await s.load(n, W.sessionId);
|
|
9480
|
+
e ? (W.applySnapshot(e), U({
|
|
9457
9481
|
type: "session_restored",
|
|
9458
|
-
sessionId:
|
|
9482
|
+
sessionId: W.sessionId,
|
|
9459
9483
|
rounds: e.messages?.length ?? 0
|
|
9460
|
-
})) : await s.createSession(n, t.title,
|
|
9484
|
+
})) : await s.createSession(n, t.title, W.sessionId);
|
|
9461
9485
|
} else if (t.autoResume !== !1) {
|
|
9462
9486
|
let r = await s.listSessions(n);
|
|
9463
9487
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, r.length, r.map((e) => e.sessionId)), r.length) {
|
|
9464
|
-
|
|
9465
|
-
let t = await s.load(n,
|
|
9466
|
-
t ? (
|
|
9488
|
+
W.sessionId = r[0].sessionId;
|
|
9489
|
+
let t = await s.load(n, W.sessionId);
|
|
9490
|
+
t ? (W.applySnapshot(t), U({
|
|
9467
9491
|
type: "session_restored",
|
|
9468
|
-
sessionId:
|
|
9492
|
+
sessionId: W.sessionId,
|
|
9469
9493
|
rounds: t.messages?.length ?? 0
|
|
9470
|
-
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话",
|
|
9471
|
-
} else
|
|
9472
|
-
} else
|
|
9473
|
-
e.memory && s.save(n,
|
|
9494
|
+
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", W.sessionId, `${t.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", W.sessionId);
|
|
9495
|
+
} else W.sessionId = await s.createSession(n, t.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", W.sessionId);
|
|
9496
|
+
} else W.sessionId = await s.createSession(n, t.title);
|
|
9497
|
+
e.memory && s.save(n, W.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), ct();
|
|
9474
9498
|
}
|
|
9475
|
-
async function
|
|
9476
|
-
await
|
|
9499
|
+
async function mt() {
|
|
9500
|
+
await et();
|
|
9477
9501
|
}
|
|
9478
|
-
function
|
|
9502
|
+
function ht(e) {
|
|
9479
9503
|
let t = {};
|
|
9480
9504
|
for (let n of cu(e)) {
|
|
9481
9505
|
let e = x.files[n];
|
|
@@ -9483,15 +9507,15 @@ function gu(e, n) {
|
|
|
9483
9507
|
}
|
|
9484
9508
|
return t;
|
|
9485
9509
|
}
|
|
9486
|
-
function
|
|
9510
|
+
function gt() {
|
|
9487
9511
|
let e = lu(x.files, cu(b));
|
|
9488
9512
|
for (let t of e) delete x.files[t];
|
|
9489
9513
|
}
|
|
9490
|
-
function
|
|
9491
|
-
let e = ho(b,
|
|
9514
|
+
function _t() {
|
|
9515
|
+
let e = ho(b, rt);
|
|
9492
9516
|
if (!e.trimmed) return;
|
|
9493
9517
|
let { older: t, summary: n } = e;
|
|
9494
|
-
if (
|
|
9518
|
+
if (U({
|
|
9495
9519
|
type: "context_trimmed",
|
|
9496
9520
|
dropped: t.map((e) => ({
|
|
9497
9521
|
round: e.round,
|
|
@@ -9499,76 +9523,76 @@ function gu(e, n) {
|
|
|
9499
9523
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
9500
9524
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
9501
9525
|
})),
|
|
9502
|
-
vfsResults:
|
|
9526
|
+
vfsResults: ht(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
9503
9527
|
summary: n.content,
|
|
9504
9528
|
reason: "max_memory_rounds"
|
|
9505
|
-
}), b.splice(e.deleteFrom, e.deleteCount, n),
|
|
9529
|
+
}), b.splice(e.deleteFrom, e.deleteCount, n), gt(), g && l) {
|
|
9506
9530
|
let n = e.summary, { prevSeg: r } = e;
|
|
9507
9531
|
(async () => {
|
|
9508
9532
|
try {
|
|
9509
9533
|
let e = await l(bo(t, v)), i = b.indexOf(n);
|
|
9510
9534
|
if (i < 0) return;
|
|
9511
|
-
b[i].content = mo(t, r, e),
|
|
9535
|
+
b[i].content = mo(t, r, e), xt();
|
|
9512
9536
|
} catch {}
|
|
9513
9537
|
})();
|
|
9514
9538
|
}
|
|
9515
9539
|
}
|
|
9516
|
-
let
|
|
9517
|
-
function
|
|
9518
|
-
if (!
|
|
9540
|
+
let yt, bt = !1;
|
|
9541
|
+
function xt() {
|
|
9542
|
+
if (!W.sessionId || !s) return;
|
|
9519
9543
|
let t = JSON.parse(JSON.stringify(b));
|
|
9520
|
-
s.save(n,
|
|
9521
|
-
let r =
|
|
9522
|
-
if (s.save(n,
|
|
9544
|
+
s.save(n, W.sessionId, { messages: t });
|
|
9545
|
+
let r = W.agent?.getState?.()?.todos ?? [];
|
|
9546
|
+
if (s.save(n, W.sessionId, { todos: r }), xe) {
|
|
9523
9547
|
let e = C.getMission();
|
|
9524
|
-
e && s.save(n,
|
|
9548
|
+
e && s.save(n, W.sessionId, { mission: e });
|
|
9525
9549
|
}
|
|
9526
|
-
if (
|
|
9550
|
+
if (Se) {
|
|
9527
9551
|
let e = T.getWorkingMemory();
|
|
9528
|
-
e && s.save(n,
|
|
9552
|
+
e && s.save(n, W.sessionId, { workingMemory: e });
|
|
9529
9553
|
}
|
|
9530
|
-
if (
|
|
9554
|
+
if (pe) {
|
|
9531
9555
|
let e = w.getFocuses();
|
|
9532
|
-
s.save(n,
|
|
9556
|
+
s.save(n, W.sessionId, { focus: e.length ? e : null });
|
|
9533
9557
|
}
|
|
9534
|
-
P && A && (s.save(n,
|
|
9558
|
+
P && A && (s.save(n, W.sessionId, { checkpoints: A.exportStack() }), s.save(n, W.sessionId, { usage: i }));
|
|
9535
9559
|
let a = ws(b);
|
|
9536
|
-
a && a !==
|
|
9560
|
+
a && a !== yt && (yt = a, s.updateTitle(n, W.sessionId, a)), e.autoTitle !== !1 && u && !bt && b.some((e) => e.role === "user") && b.some((e) => e.role === "assistant") && (bt = !0, (async () => {
|
|
9537
9561
|
let e = await u(b);
|
|
9538
|
-
e && (await s.updateTitle(n,
|
|
9539
|
-
})()), e.debug && console.log("[page-agent-sdk][persist] save",
|
|
9562
|
+
e && (await s.updateTitle(n, W.sessionId, e), await ct());
|
|
9563
|
+
})()), e.debug && console.log("[page-agent-sdk][persist] save", W.sessionId, `${b.length} msgs`);
|
|
9540
9564
|
}
|
|
9541
|
-
return
|
|
9542
|
-
if (await
|
|
9565
|
+
return W.initDone = (async () => {
|
|
9566
|
+
if (await pt(), await mt(), e.mcp?.length) {
|
|
9543
9567
|
let t = await Promise.allSettled(e.mcp.map((e) => gs(e)));
|
|
9544
|
-
|
|
9568
|
+
W.mcpClosers = t.flatMap((e) => e.status === "fulfilled" ? [e.value.close] : []), W.mcpServers = [], t.forEach((t, n) => {
|
|
9545
9569
|
let r = e.mcp[n], i = r.name ?? r.url;
|
|
9546
|
-
t.status === "fulfilled" ? (
|
|
9570
|
+
t.status === "fulfilled" ? (W.mcpServers.push({
|
|
9547
9571
|
name: i,
|
|
9548
9572
|
url: r.url,
|
|
9549
9573
|
toolCount: t.value.tools.length
|
|
9550
|
-
}), t.value.tools.forEach((e) =>
|
|
9551
|
-
}),
|
|
9574
|
+
}), t.value.tools.forEach((e) => L.set(e.name, `mcp:${i}`)), R.push(...t.value.tools)) : console.warn(`[page-agent-sdk][mcp] server ${i} 连接失败:`, t.reason);
|
|
9575
|
+
}), V = ye(), e.debug && console.log(`[page-agent-sdk][mcp] 注入 ${R.length} 个工具,${W.mcpServers.length} 个 server`);
|
|
9552
9576
|
}
|
|
9553
9577
|
let t = Ts(e.llm) ? e.llm : await f(e.llm);
|
|
9554
|
-
|
|
9578
|
+
W.agent = Fi({
|
|
9555
9579
|
llm: t,
|
|
9556
9580
|
systemPrompt: re,
|
|
9557
|
-
tools:
|
|
9558
|
-
middleware:
|
|
9581
|
+
tools: V,
|
|
9582
|
+
middleware: nt,
|
|
9559
9583
|
maxToolRounds: e.maxToolRounds,
|
|
9560
9584
|
maxRetries: e.maxRetries,
|
|
9561
9585
|
stallMs: e.streamStallMs ?? 9e4,
|
|
9562
9586
|
maxParallelTools: e.maxParallelTools,
|
|
9563
9587
|
contextWindow: m.contextWindow,
|
|
9564
9588
|
maxOutputTokens: m.maxOutputTokens,
|
|
9565
|
-
maxVerifyAttempts:
|
|
9589
|
+
maxVerifyAttempts: je ? Ae : 0,
|
|
9566
9590
|
onLlmChange: (e) => {
|
|
9567
9591
|
y = e;
|
|
9568
9592
|
},
|
|
9569
9593
|
onTrace: N ? (e, t) => {
|
|
9570
9594
|
try {
|
|
9571
|
-
|
|
9595
|
+
U({
|
|
9572
9596
|
type: "trace",
|
|
9573
9597
|
spans: e,
|
|
9574
9598
|
metrics: t
|
|
@@ -9576,10 +9600,10 @@ function gu(e, n) {
|
|
|
9576
9600
|
} catch {}
|
|
9577
9601
|
} : void 0,
|
|
9578
9602
|
debug: e.debug
|
|
9579
|
-
}), ee.current =
|
|
9580
|
-
|
|
9603
|
+
}), ee.current = W.agent, H && H.setReconfigureHook && H.setReconfigureHook(() => {
|
|
9604
|
+
W.agent && W.agent.setTools(ye());
|
|
9581
9605
|
});
|
|
9582
|
-
})(),
|
|
9606
|
+
})(), W;
|
|
9583
9607
|
}
|
|
9584
9608
|
function _u(e, t) {
|
|
9585
9609
|
let n = e.id ?? Is();
|
|
@@ -9611,7 +9635,7 @@ function _u(e, t) {
|
|
|
9611
9635
|
core: a,
|
|
9612
9636
|
dialogCfg: c,
|
|
9613
9637
|
streaming: r,
|
|
9614
|
-
runSerial:
|
|
9638
|
+
runSerial: a.runSerial,
|
|
9615
9639
|
hide: p,
|
|
9616
9640
|
unmount: f,
|
|
9617
9641
|
onDialogUnmounted: () => {
|
|
@@ -9620,7 +9644,7 @@ function _u(e, t) {
|
|
|
9620
9644
|
}), c.drawer === !0 && c.drawerHidden === !0 && s.hide(), o();
|
|
9621
9645
|
}
|
|
9622
9646
|
function f() {
|
|
9623
|
-
|
|
9647
|
+
a.abortAllActive(), a.resolveConflict("keep_external"), l && typeof window < "u" && window.removeEventListener("pagehide", l), u && typeof document < "u" && document.removeEventListener("visibilitychange", u), l = null, u = null, s ? s.unmount() : a.release();
|
|
9624
9648
|
}
|
|
9625
9649
|
function p() {
|
|
9626
9650
|
s?.hide();
|
|
@@ -9628,25 +9652,13 @@ function _u(e, t) {
|
|
|
9628
9652
|
function m() {
|
|
9629
9653
|
s?.show();
|
|
9630
9654
|
}
|
|
9631
|
-
|
|
9632
|
-
function _(e) {
|
|
9633
|
-
let t = new AbortController();
|
|
9634
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", () => t.abort(), { once: !0 })), g.add(t), {
|
|
9635
|
-
controller: t,
|
|
9636
|
-
untrack: () => g.delete(t)
|
|
9637
|
-
};
|
|
9638
|
-
}
|
|
9639
|
-
function v() {
|
|
9640
|
-
for (let e of g) e.abort();
|
|
9641
|
-
g.clear();
|
|
9642
|
-
}
|
|
9643
|
-
return a.abortAllActive = v, {
|
|
9655
|
+
return {
|
|
9644
9656
|
mount: d,
|
|
9645
9657
|
unmount: f,
|
|
9646
9658
|
hide: p,
|
|
9647
9659
|
show: m,
|
|
9648
|
-
send: (e, t) =>
|
|
9649
|
-
let { controller: n, untrack: r } =
|
|
9660
|
+
send: (e, t) => a.runSerial(async () => {
|
|
9661
|
+
let { controller: n, untrack: r } = a.trackActive(t?.signal);
|
|
9650
9662
|
try {
|
|
9651
9663
|
return await a.send(e, {
|
|
9652
9664
|
...t,
|
|
@@ -9656,15 +9668,16 @@ function _u(e, t) {
|
|
|
9656
9668
|
r();
|
|
9657
9669
|
}
|
|
9658
9670
|
}),
|
|
9659
|
-
batch: (e, t, n) =>
|
|
9660
|
-
let { controller: r, untrack: i } =
|
|
9671
|
+
batch: (e, t, n) => a.runSerial(async () => {
|
|
9672
|
+
let { controller: r, untrack: i } = a.trackActive(n);
|
|
9661
9673
|
try {
|
|
9662
9674
|
return await a.batch(e, t, r.signal);
|
|
9663
9675
|
} finally {
|
|
9664
9676
|
i();
|
|
9665
9677
|
}
|
|
9666
9678
|
}),
|
|
9667
|
-
switchSession: (...e) =>
|
|
9679
|
+
switchSession: (...e) => a.runSerial(async () => (a.abortAllActive(), a.switchSession(...e))),
|
|
9680
|
+
resetSession: () => a.resetSession(),
|
|
9668
9681
|
sessions: a.sessions,
|
|
9669
9682
|
async listSessions() {
|
|
9670
9683
|
return a.store ? a.store.listSessions(n) : [];
|
|
@@ -9681,10 +9694,7 @@ function _u(e, t) {
|
|
|
9681
9694
|
get sessionId() {
|
|
9682
9695
|
return a.sessionId;
|
|
9683
9696
|
},
|
|
9684
|
-
stream: (e, t, n) =>
|
|
9685
|
-
let { controller: r, untrack: i } = _(n);
|
|
9686
|
-
return a.stream(e, t, r.signal).finally(i);
|
|
9687
|
-
},
|
|
9697
|
+
stream: (e, t, n) => a.stream(e, t, n),
|
|
9688
9698
|
afterRound: a.afterRound,
|
|
9689
9699
|
get debugLogs() {
|
|
9690
9700
|
return a.agent.debugLogs;
|
|
@@ -9940,11 +9950,11 @@ async function Ou(e) {
|
|
|
9940
9950
|
//#endregion
|
|
9941
9951
|
//#region src/core/composables/useChat.ts
|
|
9942
9952
|
function ku(e = {}) {
|
|
9943
|
-
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a } = e, o = /* @__PURE__ */
|
|
9953
|
+
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a } = e, o = /* @__PURE__ */ vt({
|
|
9944
9954
|
messages: e.messages ?? [],
|
|
9945
9955
|
loading: !1,
|
|
9946
9956
|
error: null
|
|
9947
|
-
}), s = /* @__PURE__ */
|
|
9957
|
+
}), s = /* @__PURE__ */ kt(null), c = /* @__PURE__ */ kt(!0), l = null, u = /* @__PURE__ */ kt([]), d = /* @__PURE__ */ kt(null);
|
|
9948
9958
|
function f() {}
|
|
9949
9959
|
function p(e) {
|
|
9950
9960
|
let t = s.value;
|
|
@@ -9966,7 +9976,7 @@ function ku(e = {}) {
|
|
|
9966
9976
|
}
|
|
9967
9977
|
async function g(e) {
|
|
9968
9978
|
if (c.value = !0, n) {
|
|
9969
|
-
let t = /* @__PURE__ */
|
|
9979
|
+
let t = /* @__PURE__ */ vt({
|
|
9970
9980
|
role: "assistant",
|
|
9971
9981
|
content: "",
|
|
9972
9982
|
timestamp: Date.now(),
|
|
@@ -10127,19 +10137,19 @@ function ju(e = {}) {
|
|
|
10127
10137
|
onPersist: e.onPersist,
|
|
10128
10138
|
onClear: e.onClear,
|
|
10129
10139
|
onQueuedCleared: e.onQueuedCleared
|
|
10130
|
-
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */
|
|
10140
|
+
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */ kt(""), s = /* @__PURE__ */ kt(!0), c = () => {
|
|
10131
10141
|
s.value = !s.value;
|
|
10132
|
-
}, l = /* @__PURE__ */
|
|
10142
|
+
}, l = /* @__PURE__ */ kt(!1), u = () => {
|
|
10133
10143
|
l.value = !0;
|
|
10134
10144
|
}, d = () => {
|
|
10135
10145
|
l.value = !1;
|
|
10136
|
-
}, f = /* @__PURE__ */
|
|
10146
|
+
}, f = /* @__PURE__ */ kt(!1), p = () => {
|
|
10137
10147
|
f.value = !0;
|
|
10138
10148
|
}, m = () => {
|
|
10139
10149
|
f.value = !1;
|
|
10140
|
-
}, h = /* @__PURE__ */
|
|
10150
|
+
}, h = /* @__PURE__ */ kt({}), g = (e) => h.value[e] !== !1, _ = (e) => {
|
|
10141
10151
|
h.value[e] = !g(e);
|
|
10142
|
-
}, v = /* @__PURE__ */
|
|
10152
|
+
}, v = /* @__PURE__ */ kt(!1), y = (e) => {
|
|
10143
10153
|
Ou(e).then((e) => {
|
|
10144
10154
|
e && (v.value = !0, setTimeout(() => {
|
|
10145
10155
|
v.value = !1;
|
|
@@ -10209,7 +10219,7 @@ function ju(e = {}) {
|
|
|
10209
10219
|
};
|
|
10210
10220
|
}
|
|
10211
10221
|
function Mu() {
|
|
10212
|
-
let e =
|
|
10222
|
+
let e = In(Au);
|
|
10213
10223
|
if (!e) throw Error("useChatContext 必须在 provide(chatContextKey) 的组件子树内调用");
|
|
10214
10224
|
return e;
|
|
10215
10225
|
}
|