page-agent-sdk 2.41.1 → 2.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/page-agent-sdk.headless.js +1028 -809
- package/dist/page-agent-sdk.iife.js +185 -137
- package/dist/page-agent-sdk.js +567 -349
- package/dist/page-agent-sdk.umd.cjs +83 -35
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/headless.d.ts +29 -0
- package/types/index.d.ts +29 -0
|
@@ -173,10 +173,10 @@ function de(e, ...t) {
|
|
|
173
173
|
console.warn(`[Vue warn] ${e}`, ...t);
|
|
174
174
|
}
|
|
175
175
|
var fe;
|
|
176
|
-
function
|
|
176
|
+
function z() {
|
|
177
177
|
return fe;
|
|
178
178
|
}
|
|
179
|
-
var
|
|
179
|
+
var B, pe = /* @__PURE__ */ new WeakSet(), me = class {
|
|
180
180
|
constructor(e) {
|
|
181
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
|
}
|
|
@@ -184,61 +184,61 @@ var z, me = /* @__PURE__ */ new WeakSet(), he = class {
|
|
|
184
184
|
this.flags |= 64;
|
|
185
185
|
}
|
|
186
186
|
resume() {
|
|
187
|
-
this.flags & 64 && (this.flags &= -65,
|
|
187
|
+
this.flags & 64 && (this.flags &= -65, pe.has(this) && (pe.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 || _e(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, ke(this), ye(this);
|
|
195
|
+
let e = B, t = Te;
|
|
196
|
+
B = this, Te = !0;
|
|
197
197
|
try {
|
|
198
198
|
return this.fn();
|
|
199
199
|
} finally {
|
|
200
|
-
process.env.NODE_ENV !== "production" &&
|
|
200
|
+
process.env.NODE_ENV !== "production" && B !== this && de("Active effect was not restored correctly - this is likely a Vue internal bug."), be(this), B = e, Te = 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) Ce(e);
|
|
206
|
+
this.deps = this.depsTail = void 0, ke(this), this.onStop && this.onStop(), this.flags &= -2;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
trigger() {
|
|
210
|
-
this.flags & 64 ?
|
|
210
|
+
this.flags & 64 ? pe.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
|
|
211
211
|
}
|
|
212
212
|
runIfDirty() {
|
|
213
|
-
|
|
213
|
+
xe(this) && this.run();
|
|
214
214
|
}
|
|
215
215
|
get dirty() {
|
|
216
|
-
return
|
|
216
|
+
return xe(this);
|
|
217
217
|
}
|
|
218
|
-
},
|
|
219
|
-
function
|
|
218
|
+
}, he = 0, ge, V;
|
|
219
|
+
function _e(e, t = !1) {
|
|
220
220
|
if (e.flags |= 8, t) {
|
|
221
|
-
e.next =
|
|
221
|
+
e.next = V, V = e;
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
-
e.next =
|
|
224
|
+
e.next = ge, ge = e;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
|
|
226
|
+
function H() {
|
|
227
|
+
he++;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
if (--
|
|
231
|
-
if (
|
|
232
|
-
let e =
|
|
233
|
-
for (
|
|
229
|
+
function ve() {
|
|
230
|
+
if (--he > 0) return;
|
|
231
|
+
if (V) {
|
|
232
|
+
let e = V;
|
|
233
|
+
for (V = 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 (; ge;) {
|
|
240
|
+
let t = ge;
|
|
241
|
+
for (ge = 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 ye() {
|
|
|
250
250
|
}
|
|
251
251
|
if (e) throw e;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function ye(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 be(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), Ce(r), we(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 xe(e) {
|
|
265
|
+
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (Se(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 Se(e) {
|
|
269
|
+
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion === Ae) || (e.globalVersion = Ae, !e.isSSR && e.flags & 128 && (!e.deps && !e._dirty || !xe(e)))) return;
|
|
270
270
|
e.flags |= 2;
|
|
271
|
-
let t = e.dep, n =
|
|
272
|
-
|
|
271
|
+
let t = e.dep, n = B, r = Te;
|
|
272
|
+
B = e, Te = !0;
|
|
273
273
|
try {
|
|
274
|
-
|
|
274
|
+
ye(e);
|
|
275
275
|
let n = e.fn(e._value);
|
|
276
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
|
+
B = n, Te = r, be(e), e.flags &= -3;
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Ce(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) Ce(e, !0);
|
|
288
288
|
}
|
|
289
289
|
!t && !--n.sc && n.map && n.map.delete(n.key);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function we(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
|
|
297
|
-
|
|
295
|
+
var Te = !0, Ee = [];
|
|
296
|
+
function De() {
|
|
297
|
+
Ee.push(Te), Te = !1;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
let e =
|
|
301
|
-
|
|
299
|
+
function Oe() {
|
|
300
|
+
let e = Ee.pop();
|
|
301
|
+
Te = e === void 0 || e;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function ke(e) {
|
|
304
304
|
let { cleanup: t } = e;
|
|
305
305
|
if (e.cleanup = void 0, t) {
|
|
306
|
-
let e =
|
|
307
|
-
|
|
306
|
+
let e = B;
|
|
307
|
+
B = void 0;
|
|
308
308
|
try {
|
|
309
309
|
t();
|
|
310
310
|
} finally {
|
|
311
|
-
|
|
311
|
+
B = e;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
|
-
var
|
|
315
|
+
var Ae = 0, je = 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
|
+
}, Me = 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 (!B || !Te || B === this.computed) return;
|
|
325
325
|
let t = this.activeLink;
|
|
326
|
-
if (t === void 0 || t.sub !==
|
|
326
|
+
if (t === void 0 || t.sub !== B) t = this.activeLink = new je(B, this), B.deps ? (t.prevDep = B.depsTail, B.depsTail.nextDep = t, B.depsTail = t) : B.deps = B.depsTail = t, Ne(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 = B.depsTail, t.nextDep = void 0, B.depsTail.nextDep = t, B.depsTail = t, B.deps === t && (B.deps = e);
|
|
330
330
|
}
|
|
331
|
-
return process.env.NODE_ENV !== "production" &&
|
|
331
|
+
return process.env.NODE_ENV !== "production" && B.onTrack && B.onTrack(S({ effect: B }, e)), t;
|
|
332
332
|
}
|
|
333
333
|
trigger(e) {
|
|
334
|
-
this.version++,
|
|
334
|
+
this.version++, Ae++, this.notify(e);
|
|
335
335
|
}
|
|
336
336
|
notify(e) {
|
|
337
|
-
|
|
337
|
+
H();
|
|
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
|
+
ve();
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
|
-
function
|
|
346
|
+
function Ne(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) Ne(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 Pe = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Object iterate"), Ie = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Map keys iterate"), Le = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Array iterate");
|
|
358
|
+
function U(e, t, n) {
|
|
359
|
+
if (Te && B) {
|
|
360
|
+
let r = Pe.get(e);
|
|
361
|
+
r || Pe.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 Me()), 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 W(e, t, n, r, i, a) {
|
|
371
|
+
let o = Pe.get(e);
|
|
372
372
|
if (!o) {
|
|
373
|
-
|
|
373
|
+
Ae++;
|
|
374
374
|
return;
|
|
375
375
|
}
|
|
376
376
|
let s = (o) => {
|
|
@@ -383,173 +383,173 @@ function ze(e, t, n, r, i, a) {
|
|
|
383
383
|
oldTarget: a
|
|
384
384
|
}));
|
|
385
385
|
};
|
|
386
|
-
if (
|
|
386
|
+
if (H(), 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 === Le || !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(Le)), 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(Fe)), ee(e) && s(o.get(Ie)));
|
|
397
397
|
break;
|
|
398
398
|
case "delete":
|
|
399
|
-
i || (s(o.get(
|
|
399
|
+
i || (s(o.get(Fe)), ee(e) && s(o.get(Ie)));
|
|
400
400
|
break;
|
|
401
401
|
case "set":
|
|
402
|
-
ee(e) && s(o.get(
|
|
402
|
+
ee(e) && s(o.get(Fe));
|
|
403
403
|
break;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
|
|
406
|
+
ve();
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
let t = /* @__PURE__ */
|
|
410
|
-
return t === e ? t : (
|
|
408
|
+
function Re(e) {
|
|
409
|
+
let t = /* @__PURE__ */ q(e);
|
|
410
|
+
return t === e ? t : (U(t, "iterate", Le), /* @__PURE__ */ St(e) ? t : t.map(Tt));
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
return
|
|
412
|
+
function ze(e) {
|
|
413
|
+
return U(e = /* @__PURE__ */ q(e), "iterate", Le), e;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
return /* @__PURE__ */
|
|
415
|
+
function Be(e, t) {
|
|
416
|
+
return /* @__PURE__ */ xt(e) ? Et(/* @__PURE__ */ bt(e) ? Tt(t) : t) : Tt(t);
|
|
417
417
|
}
|
|
418
|
-
var
|
|
418
|
+
var Ve = {
|
|
419
419
|
__proto__: null,
|
|
420
420
|
[Symbol.iterator]() {
|
|
421
|
-
return
|
|
421
|
+
return He(this, Symbol.iterator, (e) => Be(this, e));
|
|
422
422
|
},
|
|
423
423
|
concat(...e) {
|
|
424
|
-
return
|
|
424
|
+
return Re(this).concat(...e.map((e) => E(e) ? Re(e) : e));
|
|
425
425
|
},
|
|
426
426
|
entries() {
|
|
427
|
-
return
|
|
427
|
+
return He(this, "entries", (e) => (e[1] = Be(this, e[1]), e));
|
|
428
428
|
},
|
|
429
429
|
every(e, t) {
|
|
430
|
-
return
|
|
430
|
+
return We(this, "every", e, t, void 0, arguments);
|
|
431
431
|
},
|
|
432
432
|
filter(e, t) {
|
|
433
|
-
return
|
|
433
|
+
return We(this, "filter", e, t, (e) => e.map((e) => Be(this, e)), arguments);
|
|
434
434
|
},
|
|
435
435
|
find(e, t) {
|
|
436
|
-
return
|
|
436
|
+
return We(this, "find", e, t, (e) => Be(this, e), arguments);
|
|
437
437
|
},
|
|
438
438
|
findIndex(e, t) {
|
|
439
|
-
return
|
|
439
|
+
return We(this, "findIndex", e, t, void 0, arguments);
|
|
440
440
|
},
|
|
441
441
|
findLast(e, t) {
|
|
442
|
-
return
|
|
442
|
+
return We(this, "findLast", e, t, (e) => Be(this, e), arguments);
|
|
443
443
|
},
|
|
444
444
|
findLastIndex(e, t) {
|
|
445
|
-
return
|
|
445
|
+
return We(this, "findLastIndex", e, t, void 0, arguments);
|
|
446
446
|
},
|
|
447
447
|
forEach(e, t) {
|
|
448
|
-
return
|
|
448
|
+
return We(this, "forEach", e, t, void 0, arguments);
|
|
449
449
|
},
|
|
450
450
|
includes(...e) {
|
|
451
|
-
return
|
|
451
|
+
return G(this, "includes", e);
|
|
452
452
|
},
|
|
453
453
|
indexOf(...e) {
|
|
454
|
-
return
|
|
454
|
+
return G(this, "indexOf", e);
|
|
455
455
|
},
|
|
456
456
|
join(e) {
|
|
457
|
-
return
|
|
457
|
+
return Re(this).join(e);
|
|
458
458
|
},
|
|
459
459
|
lastIndexOf(...e) {
|
|
460
|
-
return
|
|
460
|
+
return G(this, "lastIndexOf", e);
|
|
461
461
|
},
|
|
462
462
|
map(e, t) {
|
|
463
|
-
return
|
|
463
|
+
return We(this, "map", e, t, void 0, arguments);
|
|
464
464
|
},
|
|
465
465
|
pop() {
|
|
466
|
-
return
|
|
466
|
+
return Ke(this, "pop");
|
|
467
467
|
},
|
|
468
468
|
push(...e) {
|
|
469
|
-
return
|
|
469
|
+
return Ke(this, "push", e);
|
|
470
470
|
},
|
|
471
471
|
reduce(e, ...t) {
|
|
472
|
-
return
|
|
472
|
+
return Ge(this, "reduce", e, t);
|
|
473
473
|
},
|
|
474
474
|
reduceRight(e, ...t) {
|
|
475
|
-
return
|
|
475
|
+
return Ge(this, "reduceRight", e, t);
|
|
476
476
|
},
|
|
477
477
|
shift() {
|
|
478
|
-
return
|
|
478
|
+
return Ke(this, "shift");
|
|
479
479
|
},
|
|
480
480
|
some(e, t) {
|
|
481
|
-
return
|
|
481
|
+
return We(this, "some", e, t, void 0, arguments);
|
|
482
482
|
},
|
|
483
483
|
splice(...e) {
|
|
484
|
-
return
|
|
484
|
+
return Ke(this, "splice", e);
|
|
485
485
|
},
|
|
486
486
|
toReversed() {
|
|
487
|
-
return
|
|
487
|
+
return Re(this).toReversed();
|
|
488
488
|
},
|
|
489
489
|
toSorted(e) {
|
|
490
|
-
return
|
|
490
|
+
return Re(this).toSorted(e);
|
|
491
491
|
},
|
|
492
492
|
toSpliced(...e) {
|
|
493
|
-
return
|
|
493
|
+
return Re(this).toSpliced(...e);
|
|
494
494
|
},
|
|
495
495
|
unshift(...e) {
|
|
496
|
-
return
|
|
496
|
+
return Ke(this, "unshift", e);
|
|
497
497
|
},
|
|
498
498
|
values() {
|
|
499
|
-
return
|
|
499
|
+
return He(this, "values", (e) => Be(this, e));
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
|
-
function
|
|
503
|
-
let r =
|
|
504
|
-
return r !== e && !/* @__PURE__ */
|
|
502
|
+
function He(e, t, n) {
|
|
503
|
+
let r = ze(e), i = r[t]();
|
|
504
|
+
return r !== e && !/* @__PURE__ */ St(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 Ue = Array.prototype;
|
|
510
|
+
function We(e, t, n, r, i, a) {
|
|
511
|
+
let o = ze(e), s = o !== e && !/* @__PURE__ */ St(e), c = o[t];
|
|
512
|
+
if (c !== Ue[t]) {
|
|
513
513
|
let t = c.apply(e, a);
|
|
514
|
-
return s ?
|
|
514
|
+
return s ? Tt(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, Be(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 Ge(e, t, n, r) {
|
|
526
|
+
let i = ze(e), a = i !== e && !/* @__PURE__ */ St(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 = Be(e, t)), n.call(this, t, Be(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 ? Be(e, c) : c;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
let r = /* @__PURE__ */
|
|
537
|
-
|
|
535
|
+
function G(e, t, n) {
|
|
536
|
+
let r = /* @__PURE__ */ q(e);
|
|
537
|
+
U(r, "iterate", Le);
|
|
538
538
|
let i = r[t](...n);
|
|
539
|
-
return (i === -1 || i === !1) && /* @__PURE__ */
|
|
539
|
+
return (i === -1 || i === !1) && /* @__PURE__ */ Ct(n[0]) ? (n[0] = /* @__PURE__ */ q(n[0]), r[t](...n)) : i;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
|
|
543
|
-
let r = (/* @__PURE__ */
|
|
544
|
-
return
|
|
541
|
+
function Ke(e, t, n = []) {
|
|
542
|
+
De(), H();
|
|
543
|
+
let r = (/* @__PURE__ */ q(e))[t].apply(e, n);
|
|
544
|
+
return ve(), Oe(), r;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
547
|
-
function
|
|
546
|
+
var qe = /* @__PURE__ */ _("__proto__,__v_isRef,__isVue"), Je = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(A));
|
|
547
|
+
function Ye(e) {
|
|
548
548
|
A(e) || (e = String(e));
|
|
549
|
-
let t = /* @__PURE__ */
|
|
550
|
-
return
|
|
549
|
+
let t = /* @__PURE__ */ q(this);
|
|
550
|
+
return U(t, "has", e), t.hasOwnProperty(e);
|
|
551
551
|
}
|
|
552
|
-
var
|
|
552
|
+
var Xe = class {
|
|
553
553
|
constructor(e = !1, t = !1) {
|
|
554
554
|
this._isReadonly = e, this._isShallow = t;
|
|
555
555
|
}
|
|
@@ -559,46 +559,46 @@ var Qe = 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 ? mt : pt : i ? ft : dt).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 = Ve[t])) return e;
|
|
567
|
+
if (t === "hasOwnProperty") return Ye;
|
|
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__ */ Dt(e) ? e : n);
|
|
570
|
+
if ((A(t) ? Je.has(t) : qe(t)) || (r || U(e, "get", t), i)) return o;
|
|
571
|
+
if (/* @__PURE__ */ Dt(o)) {
|
|
572
572
|
let e = a && re(t) ? o : o.value;
|
|
573
|
-
return r && j(e) ? /* @__PURE__ */
|
|
573
|
+
return r && j(e) ? /* @__PURE__ */ _t(e) : e;
|
|
574
574
|
}
|
|
575
|
-
return j(o) ? r ? /* @__PURE__ */
|
|
575
|
+
return j(o) ? r ? /* @__PURE__ */ _t(o) : /* @__PURE__ */ gt(o) : o;
|
|
576
576
|
}
|
|
577
|
-
},
|
|
577
|
+
}, Ze = class extends Xe {
|
|
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__ */ xt(i);
|
|
585
|
+
if (!/* @__PURE__ */ St(n) && !/* @__PURE__ */ xt(n) && (i = /* @__PURE__ */ q(i), n = /* @__PURE__ */ q(n)), !a && /* @__PURE__ */ Dt(i) && !/* @__PURE__ */ Dt(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__ */ Dt(e) ? e : r);
|
|
588
|
+
return e === /* @__PURE__ */ q(r) && s && (o ? ae(n, i) && W(e, "set", t, n, i) : W(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 && W(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) || !Je.has(t)) && U(e, "has", t), n;
|
|
597
597
|
}
|
|
598
598
|
ownKeys(e) {
|
|
599
|
-
return
|
|
599
|
+
return U(e, "iterate", E(e) ? "length" : Fe), Reflect.ownKeys(e);
|
|
600
600
|
}
|
|
601
|
-
},
|
|
601
|
+
}, Qe = class extends Xe {
|
|
602
602
|
constructor(e = !1) {
|
|
603
603
|
super(!0, e);
|
|
604
604
|
}
|
|
@@ -608,11 +608,11 @@ var Qe = class {
|
|
|
608
608
|
deleteProperty(e, t) {
|
|
609
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
|
+
}, $e = /* @__PURE__ */ new Ze(), et = /* @__PURE__ */ new Qe(), tt = /* @__PURE__ */ new Qe(!0), nt = (e) => e, rt = (e) => Reflect.getPrototypeOf(e);
|
|
612
|
+
function it(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__ */ q(i), o = ee(a), s = e === "entries" || e === Symbol.iterator && o, c = e === "keys" && o, l = i[e](...r), u = n ? nt : t ? Et : Tt;
|
|
615
|
+
return !t && U(a, "iterate", c ? Ie : Fe), 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 ot(e, t, n) {
|
|
|
624
624
|
} });
|
|
625
625
|
};
|
|
626
626
|
}
|
|
627
|
-
function
|
|
627
|
+
function at(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
|
-
de(`${ie(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */
|
|
631
|
+
de(`${ie(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */ q(this));
|
|
632
632
|
}
|
|
633
633
|
return e === "delete" ? !1 : e === "clear" ? void 0 : this;
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
636
|
+
function ot(e, t) {
|
|
637
637
|
let n = {
|
|
638
638
|
get(n) {
|
|
639
|
-
let r = this.__v_raw, i = /* @__PURE__ */
|
|
640
|
-
e || (ae(n, a) &&
|
|
641
|
-
let { has: o } =
|
|
639
|
+
let r = this.__v_raw, i = /* @__PURE__ */ q(r), a = /* @__PURE__ */ q(n);
|
|
640
|
+
e || (ae(n, a) && U(i, "get", n), U(i, "get", a));
|
|
641
|
+
let { has: o } = rt(i), s = t ? nt : e ? Et : Tt;
|
|
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 && U(/* @__PURE__ */ q(t), "iterate", Fe), t.size;
|
|
649
649
|
},
|
|
650
650
|
has(t) {
|
|
651
|
-
let n = this.__v_raw, r = /* @__PURE__ */
|
|
652
|
-
return e || (ae(t, i) &&
|
|
651
|
+
let n = this.__v_raw, r = /* @__PURE__ */ q(n), i = /* @__PURE__ */ q(t);
|
|
652
|
+
return e || (ae(t, i) && U(r, "has", t), U(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__ */ q(a), s = t ? nt : e ? Et : Tt;
|
|
656
|
+
return !e && U(o, "iterate", Fe), 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: at("add"),
|
|
661
|
+
set: at("set"),
|
|
662
|
+
delete: at("delete"),
|
|
663
|
+
clear: at("clear")
|
|
664
664
|
} : {
|
|
665
665
|
add(e) {
|
|
666
|
-
let n = /* @__PURE__ */
|
|
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),
|
|
666
|
+
let n = /* @__PURE__ */ q(this), r = rt(n), i = /* @__PURE__ */ q(e), a = !t && !/* @__PURE__ */ St(e) && !/* @__PURE__ */ xt(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), W(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__ */ St(n) && !/* @__PURE__ */ xt(n) && (n = /* @__PURE__ */ q(n));
|
|
671
|
+
let r = /* @__PURE__ */ q(this), { has: i, get: a } = rt(r), o = i.call(r, e);
|
|
672
|
+
o ? process.env.NODE_ENV !== "production" && K(r, i, e) : (e = /* @__PURE__ */ q(e), o = i.call(r, e));
|
|
673
673
|
let s = a.call(r, e);
|
|
674
|
-
return r.set(e, n), o ? ae(n, s) &&
|
|
674
|
+
return r.set(e, n), o ? ae(n, s) && W(r, "set", e, n, s) : W(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__ */ q(this), { has: n, get: r } = rt(t), i = n.call(t, e);
|
|
678
|
+
i ? process.env.NODE_ENV !== "production" && K(t, n, e) : (e = /* @__PURE__ */ q(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 && W(t, "delete", e, void 0, a), o;
|
|
681
681
|
},
|
|
682
682
|
clear() {
|
|
683
|
-
let e = /* @__PURE__ */
|
|
684
|
-
return t &&
|
|
683
|
+
let e = /* @__PURE__ */ q(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 && W(e, "clear", void 0, void 0, n), r;
|
|
685
685
|
}
|
|
686
686
|
}), [
|
|
687
687
|
"keys",
|
|
@@ -689,23 +689,23 @@ function ct(e, t) {
|
|
|
689
689
|
"entries",
|
|
690
690
|
Symbol.iterator
|
|
691
691
|
].forEach((r) => {
|
|
692
|
-
n[r] =
|
|
692
|
+
n[r] = it(r, e, t);
|
|
693
693
|
}), n;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
let n =
|
|
695
|
+
function st(e, t) {
|
|
696
|
+
let n = ot(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 ct = { get: /* @__PURE__ */ st(!1, !1) }, lt = { get: /* @__PURE__ */ st(!0, !1) }, ut = { get: /* @__PURE__ */ st(!0, !0) };
|
|
700
|
+
function K(e, t, n) {
|
|
701
|
+
let r = /* @__PURE__ */ q(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 dt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap();
|
|
708
|
+
function ht(e) {
|
|
709
709
|
switch (e) {
|
|
710
710
|
case "Object":
|
|
711
711
|
case "Array": return 1;
|
|
@@ -717,70 +717,70 @@ function _t(e) {
|
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
// @__NO_SIDE_EFFECTS__
|
|
720
|
-
function
|
|
721
|
-
return /* @__PURE__ */
|
|
720
|
+
function gt(e) {
|
|
721
|
+
return /* @__PURE__ */ xt(e) ? e : yt(e, !1, $e, ct, dt);
|
|
722
722
|
}
|
|
723
723
|
// @__NO_SIDE_EFFECTS__
|
|
724
|
-
function
|
|
725
|
-
return
|
|
724
|
+
function _t(e) {
|
|
725
|
+
return yt(e, !0, et, lt, pt);
|
|
726
726
|
}
|
|
727
727
|
// @__NO_SIDE_EFFECTS__
|
|
728
|
-
function
|
|
729
|
-
return
|
|
728
|
+
function vt(e) {
|
|
729
|
+
return yt(e, !0, tt, ut, mt);
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function yt(e, t, n, r, i) {
|
|
732
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 = ht(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 bt(e) {
|
|
743
|
+
return /* @__PURE__ */ xt(e) ? /* @__PURE__ */ bt(e.__v_raw) : !!(e && e.__v_isReactive);
|
|
744
744
|
}
|
|
745
745
|
// @__NO_SIDE_EFFECTS__
|
|
746
|
-
function
|
|
746
|
+
function xt(e) {
|
|
747
747
|
return !!(e && e.__v_isReadonly);
|
|
748
748
|
}
|
|
749
749
|
// @__NO_SIDE_EFFECTS__
|
|
750
|
-
function
|
|
750
|
+
function St(e) {
|
|
751
751
|
return !!(e && e.__v_isShallow);
|
|
752
752
|
}
|
|
753
753
|
// @__NO_SIDE_EFFECTS__
|
|
754
|
-
function
|
|
754
|
+
function Ct(e) {
|
|
755
755
|
return e ? !!e.__v_raw : !1;
|
|
756
756
|
}
|
|
757
757
|
// @__NO_SIDE_EFFECTS__
|
|
758
|
-
function
|
|
758
|
+
function q(e) {
|
|
759
759
|
let t = e && e.__v_raw;
|
|
760
|
-
return t ? /* @__PURE__ */
|
|
760
|
+
return t ? /* @__PURE__ */ q(t) : e;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function wt(e) {
|
|
763
763
|
return !T(e, "__v_skip") && Object.isExtensible(e) && F(e, "__v_skip", !0), e;
|
|
764
764
|
}
|
|
765
|
-
var
|
|
765
|
+
var Tt = (e) => j(e) ? /* @__PURE__ */ gt(e) : e, Et = (e) => j(e) ? /* @__PURE__ */ _t(e) : e;
|
|
766
766
|
// @__NO_SIDE_EFFECTS__
|
|
767
|
-
function
|
|
767
|
+
function Dt(e) {
|
|
768
768
|
return e ? e.__v_isRef === !0 : !1;
|
|
769
769
|
}
|
|
770
770
|
// @__NO_SIDE_EFFECTS__
|
|
771
|
-
function
|
|
772
|
-
return
|
|
771
|
+
function Ot(e) {
|
|
772
|
+
return At(e, !1);
|
|
773
773
|
}
|
|
774
774
|
// @__NO_SIDE_EFFECTS__
|
|
775
|
-
function
|
|
776
|
-
return
|
|
775
|
+
function kt(e) {
|
|
776
|
+
return At(e, !0);
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
return /* @__PURE__ */
|
|
778
|
+
function At(e, t) {
|
|
779
|
+
return /* @__PURE__ */ Dt(e) ? e : new jt(e, t);
|
|
780
780
|
}
|
|
781
|
-
var
|
|
781
|
+
var jt = class {
|
|
782
782
|
constructor(e, t) {
|
|
783
|
-
this.dep = new
|
|
783
|
+
this.dep = new Me(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = t ? e : /* @__PURE__ */ q(e), this._value = t ? e : Tt(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 Mt = 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__ */ St(e) || /* @__PURE__ */ xt(e);
|
|
794
|
+
e = n ? e : /* @__PURE__ */ q(e), ae(e, t) && (this._rawValue = e, this._value = n ? e : Tt(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 Mt = class {
|
|
|
800
800
|
}));
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
|
-
function
|
|
803
|
+
function Mt(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 Nt(e) {
|
|
|
808
808
|
newValue: e._value
|
|
809
809
|
}));
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
return /* @__PURE__ */
|
|
811
|
+
function Nt(e) {
|
|
812
|
+
return /* @__PURE__ */ Dt(e) ? e.value : e;
|
|
813
813
|
}
|
|
814
|
-
var
|
|
815
|
-
get: (e, t, n) => t === "__v_raw" ? e :
|
|
814
|
+
var Pt = {
|
|
815
|
+
get: (e, t, n) => t === "__v_raw" ? e : Nt(Reflect.get(e, t, n)),
|
|
816
816
|
set: (e, t, n, r) => {
|
|
817
817
|
let i = e[t];
|
|
818
|
-
return /* @__PURE__ */
|
|
818
|
+
return /* @__PURE__ */ Dt(i) && !/* @__PURE__ */ Dt(n) ? (i.value = n, !0) : Reflect.set(e, t, n, r);
|
|
819
819
|
}
|
|
820
820
|
};
|
|
821
|
-
function
|
|
822
|
-
return /* @__PURE__ */
|
|
821
|
+
function Ft(e) {
|
|
822
|
+
return /* @__PURE__ */ bt(e) ? e : new Proxy(e, Pt);
|
|
823
823
|
}
|
|
824
|
-
var
|
|
824
|
+
var It = 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 Me(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = Ae - 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) && B !== this) return _e(this, !0), !0;
|
|
830
830
|
process.env.NODE_ENV;
|
|
831
831
|
}
|
|
832
832
|
get value() {
|
|
@@ -835,56 +835,56 @@ var Lt = class {
|
|
|
835
835
|
type: "get",
|
|
836
836
|
key: "value"
|
|
837
837
|
});
|
|
838
|
-
return
|
|
838
|
+
return Se(this), e && (e.version = this.dep.version), this._value;
|
|
839
839
|
}
|
|
840
840
|
set value(e) {
|
|
841
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 Lt(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 It(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 Rt = {}, zt = /* @__PURE__ */ new WeakMap(), Bt = void 0;
|
|
852
|
+
function Vt(e, t = !1, n = Bt) {
|
|
853
853
|
if (n) {
|
|
854
|
-
let t =
|
|
855
|
-
t ||
|
|
854
|
+
let t = zt.get(n);
|
|
855
|
+
t || zt.set(n, t = []), t.push(e);
|
|
856
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 Ht(e, t, n = v) {
|
|
859
859
|
let { immediate: r, deep: i, once: a, scheduler: o, augmentJob: s, call: c } = n, l = (e) => {
|
|
860
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__ */
|
|
862
|
-
if (/* @__PURE__ */
|
|
863
|
-
if (/* @__PURE__ */
|
|
864
|
-
if (/* @__PURE__ */
|
|
861
|
+
}, u = (e) => i ? e : /* @__PURE__ */ St(e) || i === !1 || i === 0 ? Ut(e, 1) : Ut(e), d, f, p, m, h = !1, g = !1;
|
|
862
|
+
if (/* @__PURE__ */ Dt(e) ? (f = () => e.value, h = /* @__PURE__ */ St(e)) : /* @__PURE__ */ bt(e) ? (f = () => u(e), h = !0) : E(e) ? (g = !0, h = e.some((e) => /* @__PURE__ */ bt(e) || /* @__PURE__ */ St(e)), f = () => e.map((e) => {
|
|
863
|
+
if (/* @__PURE__ */ Dt(e)) return e.value;
|
|
864
|
+
if (/* @__PURE__ */ bt(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
|
+
De();
|
|
870
870
|
try {
|
|
871
871
|
p();
|
|
872
872
|
} finally {
|
|
873
|
-
|
|
873
|
+
Oe();
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
let t =
|
|
877
|
-
|
|
876
|
+
let t = Bt;
|
|
877
|
+
Bt = d;
|
|
878
878
|
try {
|
|
879
879
|
return c ? c(e, 3, [m]) : e(m);
|
|
880
880
|
} finally {
|
|
881
|
-
|
|
881
|
+
Bt = 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 = () => Ut(e(), t);
|
|
886
886
|
}
|
|
887
|
-
let _ =
|
|
887
|
+
let _ = z(), b = () => {
|
|
888
888
|
d.stop(), _ && _.active && C(_.effects, d);
|
|
889
889
|
};
|
|
890
890
|
if (a && t) {
|
|
@@ -894,63 +894,63 @@ function Ut(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(Rt) : Rt, S = (e) => {
|
|
898
898
|
if (!(!(d.flags & 1) || !d.dirty && !e)) if (t) {
|
|
899
899
|
let n = d.run();
|
|
900
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 = Bt;
|
|
903
|
+
Bt = d;
|
|
904
904
|
try {
|
|
905
905
|
let e = [
|
|
906
906
|
n,
|
|
907
|
-
x ===
|
|
907
|
+
x === Rt ? void 0 : g && x[0] === Rt ? [] : x,
|
|
908
908
|
m
|
|
909
909
|
];
|
|
910
910
|
x = n, c ? c(t, 3, e) : t(...e);
|
|
911
911
|
} finally {
|
|
912
|
-
|
|
912
|
+
Bt = 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 me(f), d.scheduler = o ? () => o(S, !1) : S, m = (e) => Vt(e, !1, d), p = d.onStop = () => {
|
|
918
|
+
let e = zt.get(d);
|
|
919
919
|
if (e) {
|
|
920
920
|
if (c) c(e, 4);
|
|
921
921
|
else for (let t of e) t();
|
|
922
|
-
|
|
922
|
+
zt.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 Ut(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__ */ Dt(e)) Ut(e.value, t, n);
|
|
929
|
+
else if (E(e)) for (let r = 0; r < e.length; r++) Ut(e[r], t, n);
|
|
930
930
|
else if (D(e) || ee(e)) e.forEach((e) => {
|
|
931
|
-
|
|
931
|
+
Ut(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) Ut(e[r], t, n);
|
|
935
|
+
for (let r of Object.getOwnPropertySymbols(e)) Object.prototype.propertyIsEnumerable.call(e, r) && Ut(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 Wt = [];
|
|
942
|
+
function Gt(e) {
|
|
943
|
+
Wt.push(e);
|
|
944
|
+
}
|
|
945
|
+
function Kt() {
|
|
946
|
+
Wt.pop();
|
|
947
|
+
}
|
|
948
|
+
var qt = !1;
|
|
949
|
+
function J(e, ...t) {
|
|
950
|
+
if (qt) return;
|
|
951
|
+
qt = !0, De();
|
|
952
|
+
let n = Wt.length ? Wt[Wt.length - 1].component : null, r = n && n.appContext.config.warnHandler, i = Jt();
|
|
953
|
+
if (r) en(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 q(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", ...Yt(i)), console.warn(...n);
|
|
962
962
|
}
|
|
963
|
-
|
|
963
|
+
Oe(), qt = !1;
|
|
964
964
|
}
|
|
965
|
-
function
|
|
966
|
-
let e =
|
|
965
|
+
function Jt() {
|
|
966
|
+
let e = Wt[Wt.length - 1];
|
|
967
967
|
if (!e) return [];
|
|
968
968
|
let t = [];
|
|
969
969
|
for (; e;) {
|
|
@@ -977,34 +977,34 @@ function Yt() {
|
|
|
977
977
|
}
|
|
978
978
|
return t;
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Yt(e) {
|
|
981
981
|
let t = [];
|
|
982
982
|
return e.forEach((e, n) => {
|
|
983
|
-
t.push(...n === 0 ? [] : ["\n"], ...
|
|
983
|
+
t.push(...n === 0 ? [] : ["\n"], ...Xt(e));
|
|
984
984
|
}), t;
|
|
985
985
|
}
|
|
986
|
-
function
|
|
986
|
+
function Xt({ 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
|
+
...Zt(e.props),
|
|
991
991
|
a
|
|
992
992
|
] : [i + a];
|
|
993
993
|
}
|
|
994
|
-
function
|
|
994
|
+
function Zt(e) {
|
|
995
995
|
let t = [], n = Object.keys(e);
|
|
996
996
|
return n.slice(0, 3).forEach((n) => {
|
|
997
|
-
t.push(
|
|
997
|
+
t.push(...Qt(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 Qt(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__ */ Dt(t) ? (t = Qt(e, /* @__PURE__ */ q(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__ */ q(t), n ? t : [`${e}=`, t]);
|
|
1006
1006
|
}
|
|
1007
|
-
var
|
|
1007
|
+
var $t = {
|
|
1008
1008
|
sp: "serverPrefetch hook",
|
|
1009
1009
|
bc: "beforeCreate hook",
|
|
1010
1010
|
c: "created hook",
|
|
@@ -1037,30 +1037,30 @@ var en = {
|
|
|
1037
1037
|
15: "component update",
|
|
1038
1038
|
16: "app unmount cleanup function"
|
|
1039
1039
|
};
|
|
1040
|
-
function
|
|
1040
|
+
function en(e, t, n, r) {
|
|
1041
1041
|
try {
|
|
1042
1042
|
return r ? e(...r) : e();
|
|
1043
1043
|
} catch (e) {
|
|
1044
|
-
|
|
1044
|
+
nn(e, t, n);
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function tn(e, t, n, r) {
|
|
1048
1048
|
if (O(e)) {
|
|
1049
|
-
let i =
|
|
1049
|
+
let i = en(e, t, n, r);
|
|
1050
1050
|
return i && M(i) && i.catch((e) => {
|
|
1051
|
-
|
|
1051
|
+
nn(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(tn(e[a], t, n, r));
|
|
1057
1057
|
return i;
|
|
1058
|
-
} else process.env.NODE_ENV !== "production" &&
|
|
1058
|
+
} else process.env.NODE_ENV !== "production" && J(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`);
|
|
1059
1059
|
}
|
|
1060
|
-
function
|
|
1060
|
+
function nn(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}` : $t[n];
|
|
1064
1064
|
for (; r;) {
|
|
1065
1065
|
let t = r.ec;
|
|
1066
1066
|
if (t) {
|
|
@@ -1069,133 +1069,133 @@ function rn(e, t, n, r = !0) {
|
|
|
1069
1069
|
r = r.parent;
|
|
1070
1070
|
}
|
|
1071
1071
|
if (a) {
|
|
1072
|
-
|
|
1072
|
+
De(), en(a, null, 10, [
|
|
1073
1073
|
e,
|
|
1074
1074
|
i,
|
|
1075
1075
|
o
|
|
1076
|
-
]),
|
|
1076
|
+
]), Oe();
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
|
|
1080
|
+
rn(e, n, i, r, o);
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function rn(e, t, n, r = !0, i = !1) {
|
|
1083
1083
|
if (process.env.NODE_ENV !== "production") {
|
|
1084
|
-
let i =
|
|
1085
|
-
if (n &&
|
|
1084
|
+
let i = $t[t];
|
|
1085
|
+
if (n && Gt(n), J(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && Kt(), 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 an = [], on = -1, sn = [], cn = null, ln = 0, un = /* @__PURE__ */ Promise.resolve(), dn = null, fn = 100;
|
|
1091
|
+
function pn(e) {
|
|
1092
|
+
let t = dn || un;
|
|
1093
1093
|
return e ? t.then(this ? e.bind(this) : e) : t;
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1096
|
-
let t =
|
|
1095
|
+
function mn(e) {
|
|
1096
|
+
let t = on + 1, n = an.length;
|
|
1097
1097
|
for (; t < n;) {
|
|
1098
|
-
let r = t + n >>> 1, i =
|
|
1098
|
+
let r = t + n >>> 1, i = an[r], a = yn(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 hn(e) {
|
|
1104
1104
|
if (!(e.flags & 1)) {
|
|
1105
|
-
let t =
|
|
1106
|
-
!n || !(e.flags & 2) && t >=
|
|
1105
|
+
let t = yn(e), n = an[an.length - 1];
|
|
1106
|
+
!n || !(e.flags & 2) && t >= yn(n) ? an.push(e) : an.splice(mn(t), 0, e), e.flags |= 1, gn();
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
|
|
1109
|
+
function gn() {
|
|
1110
|
+
dn ||= un.then(bn);
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1113
|
-
E(e) ?
|
|
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();
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1116
|
-
if (
|
|
1117
|
-
let t = [...new Set(
|
|
1118
|
-
if (
|
|
1119
|
-
|
|
1115
|
+
function vn(e) {
|
|
1116
|
+
if (sn.length) {
|
|
1117
|
+
let t = [...new Set(sn)].sort((e, t) => yn(e) - yn(t));
|
|
1118
|
+
if (sn.length = 0, cn) {
|
|
1119
|
+
cn.push(...t);
|
|
1120
1120
|
return;
|
|
1121
1121
|
}
|
|
1122
|
-
for (
|
|
1123
|
-
let t = ln
|
|
1124
|
-
process.env.NODE_ENV !== "production" &&
|
|
1122
|
+
for (cn = t, process.env.NODE_ENV !== "production" && (e ||= /* @__PURE__ */ new Map()), ln = 0; ln < cn.length; ln++) {
|
|
1123
|
+
let t = cn[ln];
|
|
1124
|
+
process.env.NODE_ENV !== "production" && xn(e, t) || (t.flags & 4 && (t.flags &= -2), t.flags & 8 || t(), t.flags &= -2);
|
|
1125
1125
|
}
|
|
1126
|
-
|
|
1126
|
+
cn = null, ln = 0;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
|
-
var
|
|
1130
|
-
function
|
|
1129
|
+
var yn = (e) => e.id == null ? e.flags & 2 ? -1 : Infinity : e.id;
|
|
1130
|
+
function bn(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) => xn(e, t);
|
|
1133
1133
|
try {
|
|
1134
|
-
for (
|
|
1135
|
-
let e = on
|
|
1134
|
+
for (on = 0; on < an.length; on++) {
|
|
1135
|
+
let e = an[on];
|
|
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), en(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 = on
|
|
1142
|
+
for (; on < an.length; on++) {
|
|
1143
|
+
let e = an[on];
|
|
1144
1144
|
e && (e.flags &= -2);
|
|
1145
1145
|
}
|
|
1146
|
-
|
|
1146
|
+
on = -1, an.length = 0, vn(e), dn = null, (an.length || sn.length) && bn(e);
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function xn(e, t) {
|
|
1150
1150
|
let n = e.get(t) || 0;
|
|
1151
|
-
if (n >
|
|
1151
|
+
if (n > fn) {
|
|
1152
1152
|
let e = t.i, n = e && Rr(e.type);
|
|
1153
|
-
return
|
|
1153
|
+
return nn(`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
|
|
1157
|
+
var Sn = /* @__PURE__ */ new Map();
|
|
1158
1158
|
process.env.NODE_ENV !== "production" && (I().__VUE_HMR_RUNTIME__ = {
|
|
1159
|
-
createRecord:
|
|
1160
|
-
rerender:
|
|
1161
|
-
reload:
|
|
1159
|
+
createRecord: kn(wn),
|
|
1160
|
+
rerender: kn(En),
|
|
1161
|
+
reload: kn(Dn)
|
|
1162
1162
|
});
|
|
1163
|
-
var
|
|
1164
|
-
function
|
|
1165
|
-
return
|
|
1166
|
-
initialDef:
|
|
1163
|
+
var Cn = /* @__PURE__ */ new Map();
|
|
1164
|
+
function wn(e, t) {
|
|
1165
|
+
return Cn.has(e) ? !1 : (Cn.set(e, {
|
|
1166
|
+
initialDef: Tn(t),
|
|
1167
1167
|
instances: /* @__PURE__ */ new Set()
|
|
1168
1168
|
}), !0);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function Tn(e) {
|
|
1171
1171
|
return Br(e) ? e.__vccOpts : e;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
let n =
|
|
1173
|
+
function En(e, t) {
|
|
1174
|
+
let n = Cn.get(e);
|
|
1175
1175
|
n && (n.initialDef.render = t, [...n.instances].forEach((e) => {
|
|
1176
|
-
t && (e.render = t,
|
|
1176
|
+
t && (e.render = t, Tn(e.type).render = t), e.renderCache = [], e.job.flags & 8 || e.update();
|
|
1177
1177
|
}));
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1180
|
-
let n =
|
|
1179
|
+
function Dn(e, t) {
|
|
1180
|
+
let n = Cn.get(e);
|
|
1181
1181
|
if (!n) return;
|
|
1182
|
-
t =
|
|
1182
|
+
t = Tn(t), On(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 = Tn(i.type), o = Sn.get(a);
|
|
1186
|
+
o || (a !== n.initialDef && On(a, t), Sn.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 ? hn(() => {
|
|
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
|
+
_n(() => {
|
|
1191
|
+
Sn.clear();
|
|
1192
1192
|
});
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function On(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 kn(e) {
|
|
1199
1199
|
return (t, n) => {
|
|
1200
1200
|
try {
|
|
1201
1201
|
return e(t, n);
|
|
@@ -1204,39 +1204,39 @@ function An(e) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
};
|
|
1206
1206
|
}
|
|
1207
|
-
var
|
|
1208
|
-
function
|
|
1209
|
-
|
|
1210
|
-
|
|
1207
|
+
var An, jn = [];
|
|
1208
|
+
function Mn(e, t) {
|
|
1209
|
+
An = e, An ? (An.enabled = !0, jn.forEach(({ event: e, args: t }) => An.emit(e, ...t)), jn = []) : typeof window < "u" && window.HTMLElement && !(window.navigator?.userAgent)?.includes("jsdom") ? ((t.__VUE_DEVTOOLS_HOOK_REPLAY__ = t.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((e) => {
|
|
1210
|
+
Mn(e, t);
|
|
1211
1211
|
}), setTimeout(() => {
|
|
1212
|
-
|
|
1213
|
-
}, 3e3)) :
|
|
1212
|
+
An || (t.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, jn = []);
|
|
1213
|
+
}, 3e3)) : jn = [];
|
|
1214
1214
|
}
|
|
1215
|
-
var
|
|
1216
|
-
function
|
|
1215
|
+
var Nn = null, Pn = null;
|
|
1216
|
+
function Fn(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" && J(`injection "${String(e)}" not found.`);
|
|
1223
|
+
} else process.env.NODE_ENV !== "production" && J("inject() can only be used inside setup() or functional components.");
|
|
1224
1224
|
}
|
|
1225
|
-
var
|
|
1225
|
+
var In = /* @__PURE__ */ Symbol.for("v-scx"), Ln = () => {
|
|
1226
1226
|
{
|
|
1227
|
-
let e = In
|
|
1228
|
-
return e || process.env.NODE_ENV !== "production" &&
|
|
1227
|
+
let e = Fn(In);
|
|
1228
|
+
return e || process.env.NODE_ENV !== "production" && J("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 Rn(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 && J("watch() \"immediate\" option is only respected when using the watch(source, callback, options?) signature."), i !== void 0 && J("watch() \"deep\" option is only respected when using the watch(source, callback, options?) signature."), o !== void 0 && J("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 = J);
|
|
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 = Ln();
|
|
1240
1240
|
l = e.__watcherHandles ||= [];
|
|
1241
1241
|
} else if (!c) {
|
|
1242
1242
|
let e = () => {};
|
|
@@ -1244,25 +1244,25 @@ function zn(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) => tn(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() : hn(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 = Ht(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 zn(e, t, n) {
|
|
1260
|
+
let r = this.proxy, i = k(e) ? e.includes(".") ? Bn(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 = Rn(i, a.bind(r), n);
|
|
1263
1263
|
return o(), s;
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function Bn(e, t) {
|
|
1266
1266
|
let n = t.split(".");
|
|
1267
1267
|
return () => {
|
|
1268
1268
|
let t = e;
|
|
@@ -1270,30 +1270,30 @@ function Vn(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 Vn = (e) => e.__isTeleport;
|
|
1274
|
+
function Hn(e, t) {
|
|
1275
|
+
e.shapeFlag & 6 && e.component ? (e.transition = t, Hn(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
1277
|
I().requestIdleCallback, I().cancelIdleCallback;
|
|
1278
|
-
var
|
|
1278
|
+
var Un = /* @__PURE__ */ Symbol.for("v-ndc"), Wn = (e) => e ? Nr(e) ? Fr(e) : Wn(e.parent) : null, Gn = /* @__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__ */ vt(e.props),
|
|
1283
|
+
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */ vt(e.attrs),
|
|
1284
|
+
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */ vt(e.slots),
|
|
1285
|
+
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */ vt(e.refs),
|
|
1286
|
+
$parent: (e) => Wn(e.parent),
|
|
1287
|
+
$root: (e) => Wn(e.root),
|
|
1288
1288
|
$host: (e) => e.ce,
|
|
1289
1289
|
$emit: (e) => e.emit,
|
|
1290
|
-
$options: (e) =>
|
|
1290
|
+
$options: (e) => Xn(e),
|
|
1291
1291
|
$forceUpdate: (e) => e.f ||= () => {
|
|
1292
|
-
|
|
1292
|
+
hn(e.update);
|
|
1293
1293
|
},
|
|
1294
|
-
$nextTick: (e) => e.n ||=
|
|
1295
|
-
$watch: (e) =>
|
|
1296
|
-
}),
|
|
1294
|
+
$nextTick: (e) => e.n ||= pn.bind(e.proxy),
|
|
1295
|
+
$watch: (e) => zn.bind(e)
|
|
1296
|
+
}), Kn = (e, t) => e !== v && !e.__isScriptSetup && T(e, t), qn = {
|
|
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 Wn = /* @__PURE__ */ Symbol.for("v-ndc"), Gn = (e) => e ? Nr(e) ? Fr(e) : Gn
|
|
|
1306
1306
|
case 4: return n[t];
|
|
1307
1307
|
case 3: return a[t];
|
|
1308
1308
|
}
|
|
1309
|
-
else if (
|
|
1309
|
+
else if (Kn(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 Yn && (o[t] = 0);
|
|
1314
1314
|
}
|
|
1315
|
-
let l =
|
|
1316
|
-
if (l) return t === "$attrs" ? (
|
|
1315
|
+
let l = Gn[t], u, d;
|
|
1316
|
+
if (l) return t === "$attrs" ? (U(e.attrs, "get", ""), process.env.NODE_ENV) : process.env.NODE_ENV !== "production" && t === "$slots" && U(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 Wn = /* @__PURE__ */ Symbol.for("v-ndc"), Gn = (e) => e ? Nr(e) ? Fr(e) : Gn
|
|
|
1321
1321
|
},
|
|
1322
1322
|
set({ _: e }, t, n) {
|
|
1323
1323
|
let { data: r, setupState: i, ctx: a } = e;
|
|
1324
|
-
return
|
|
1324
|
+
return Kn(i, t) ? (i[t] = n, !0) : process.env.NODE_ENV !== "production" && i.__isScriptSetup && T(i, t) ? (J(`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" && J(`Attempting to mutate prop "${t}". Props are readonly.`), !1) : t[0] === "$" && t.slice(1) in e ? (process.env.NODE_ENV !== "production" && J(`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 Wn = /* @__PURE__ */ Symbol.for("v-ndc"), Gn = (e) => e ? Nr(e) ? Fr(e) : Gn
|
|
|
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) || Kn(t, s) || T(a, s) || T(r, s) || T(Gn, 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" && (qn.ownKeys = (e) => (J("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 Jn(e) {
|
|
1340
1340
|
return E(e) ? e.reduce((e, t) => (e[t] = null, e), {}) : e;
|
|
1341
1341
|
}
|
|
1342
|
-
var
|
|
1343
|
-
function
|
|
1342
|
+
var Yn = !0;
|
|
1343
|
+
function Xn(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) => Zn(c, e, o, !0)), Zn(c, t, o)), j(t) && a.set(t, c), c;
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function Zn(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 && Zn(e, a, n, !0), i && i.forEach((t) => Zn(e, t, n, !0));
|
|
1350
|
+
for (let i in t) if (r && i === "expose") process.env.NODE_ENV !== "production" && J("\"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 = Qn[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 Qn = {
|
|
1358
|
+
data: $n,
|
|
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: nr,
|
|
1364
|
+
created: nr,
|
|
1365
|
+
beforeMount: nr,
|
|
1366
|
+
mounted: nr,
|
|
1367
|
+
beforeUpdate: nr,
|
|
1368
|
+
updated: nr,
|
|
1369
|
+
beforeDestroy: nr,
|
|
1370
|
+
beforeUnmount: nr,
|
|
1371
|
+
destroyed: nr,
|
|
1372
|
+
unmounted: nr,
|
|
1373
|
+
activated: nr,
|
|
1374
|
+
deactivated: nr,
|
|
1375
|
+
errorCaptured: nr,
|
|
1376
|
+
serverPrefetch: nr,
|
|
1377
1377
|
components: rr,
|
|
1378
1378
|
directives: rr,
|
|
1379
1379
|
watch: ar,
|
|
1380
|
-
provide:
|
|
1381
|
-
inject:
|
|
1380
|
+
provide: $n,
|
|
1381
|
+
inject: er
|
|
1382
1382
|
};
|
|
1383
|
-
function
|
|
1383
|
+
function $n(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 er(e, t) {
|
|
1389
|
+
return rr(tr(e), tr(t));
|
|
1390
1390
|
}
|
|
1391
|
-
function
|
|
1391
|
+
function tr(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 nr(e) {
|
|
|
1396
1396
|
}
|
|
1397
1397
|
return e;
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function nr(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), Jn(e), Jn(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] = nr(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) : _n(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, Nn) : 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__ */ Dt(e) || O(e) ? {
|
|
1424
|
+
i: Nn,
|
|
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: Pn,
|
|
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: Nn
|
|
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 && J("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 === Un) && (process.env.NODE_ENV !== "production" && !e && J(`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 = ue(e)), j(n) && (/* @__PURE__ */
|
|
1470
|
+
e && !k(e) && (t.class = ue(e)), j(n) && (/* @__PURE__ */ Ct(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 : Vn(e) ? 64 : j(e) ? 4 : O(e) ? 2 : 0;
|
|
1473
|
+
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ Ct(e) && (e = /* @__PURE__ */ q(e), J("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__ */ Ct(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 && Hn(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 = Nn);
|
|
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: Nn
|
|
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;
|
|
@@ -1550,7 +1550,7 @@ function Or(...e) {
|
|
|
1550
1550
|
}
|
|
1551
1551
|
return t;
|
|
1552
1552
|
}
|
|
1553
|
-
var kr = null, Ar = () => kr ||
|
|
1553
|
+
var kr = null, Ar = () => kr || Nn, jr;
|
|
1554
1554
|
{
|
|
1555
1555
|
let e = I(), t = (t, n) => {
|
|
1556
1556
|
let r;
|
|
@@ -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(Ft(wt(e.exposed)), {
|
|
1576
1576
|
get(t, n) {
|
|
1577
1577
|
if (n in t) return t[n];
|
|
1578
|
-
if (n in
|
|
1578
|
+
if (n in Gn) return Gn[n](e);
|
|
1579
1579
|
},
|
|
1580
1580
|
has(e, t) {
|
|
1581
|
-
return t in e || t in
|
|
1581
|
+
return t in e || t in Gn;
|
|
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__ */ Lt(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__ */ Dt(t)) {
|
|
1626
|
+
De();
|
|
1627
1627
|
let n = t.value;
|
|
1628
|
-
return
|
|
1628
|
+
return Oe(), [
|
|
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__ */ bt(t)) return [
|
|
1641
1641
|
"div",
|
|
1642
1642
|
{},
|
|
1643
1643
|
[
|
|
1644
1644
|
"span",
|
|
1645
1645
|
e,
|
|
1646
|
-
/* @__PURE__ */
|
|
1646
|
+
/* @__PURE__ */ St(t) ? "ShallowReactive" : "Reactive"
|
|
1647
1647
|
],
|
|
1648
1648
|
"<",
|
|
1649
1649
|
s(t),
|
|
1650
|
-
`>${/* @__PURE__ */
|
|
1650
|
+
`>${/* @__PURE__ */ xt(t) ? " (readonly)" : ""}`
|
|
1651
1651
|
];
|
|
1652
|
-
else if (/* @__PURE__ */
|
|
1652
|
+
else if (/* @__PURE__ */ xt(t)) return [
|
|
1653
1653
|
"div",
|
|
1654
1654
|
{},
|
|
1655
1655
|
[
|
|
1656
1656
|
"span",
|
|
1657
1657
|
e,
|
|
1658
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ St(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__ */ q(e.props))), e.setupState !== v && t.push(o("setup", e.setupState)), e.data !== v && t.push(o("data", /* @__PURE__ */ q(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__ */ q(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__ */ St(e) ? "ShallowRef" : e.effect ? "ComputedRef" : "Ref";
|
|
1751
1751
|
}
|
|
1752
1752
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i];
|
|
1753
1753
|
}
|
|
@@ -2321,18 +2321,18 @@ 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__ */ kt([]);
|
|
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), Mt(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__ */
|
|
2334
|
+
N.value.push(e), N.value.length > ji && N.value.splice(0, N.value.length - ji), Mt(N);
|
|
2335
|
+
}, ie = /* @__PURE__ */ kt([]), ae = 0, F = !!ee || !!D;
|
|
2336
2336
|
function oe(e, t, n, r = {}) {
|
|
2337
2337
|
if (!F) return null;
|
|
2338
2338
|
let i = {
|
|
@@ -2344,10 +2344,10 @@ 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), Mt(ie), i;
|
|
2348
2348
|
}
|
|
2349
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),
|
|
2350
|
+
!e || !F || (e.endTs = Date.now(), e.durationMs = e.endTs - e.startTs, e.status = t, n && Object.assign(e.attributes, n), Mt(ie), ee?.(e));
|
|
2351
2351
|
}
|
|
2352
2352
|
let L = [...v.flatMap((e) => e.tools || []), ..._], se = e.llm ?? new n({
|
|
2353
2353
|
apiKey: t,
|
|
@@ -2386,16 +2386,16 @@ function Fi(e) {
|
|
|
2386
2386
|
}
|
|
2387
2387
|
return [e, ...t.filter((e) => e.text).map((e) => e.text)].join("\n\n");
|
|
2388
2388
|
}
|
|
2389
|
-
function
|
|
2389
|
+
function z(e) {
|
|
2390
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] &&
|
|
2394
|
+
function B(e) {
|
|
2395
|
+
let t = e[0] && he(e[0]) === "system" ? e.slice(1) : e.slice();
|
|
2396
2396
|
return [new o(fe()), ...t];
|
|
2397
2397
|
}
|
|
2398
|
-
async function
|
|
2398
|
+
async function pe(e, t, n, r) {
|
|
2399
2399
|
let a = r ?? ce, o = {
|
|
2400
2400
|
signal: n,
|
|
2401
2401
|
maxRetries: x,
|
|
@@ -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 = ge(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`), pe({
|
|
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 = ge(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})`), pe({
|
|
2482
2482
|
...e,
|
|
2483
2483
|
messages: o
|
|
2484
2484
|
}, t, n, r);
|
|
@@ -2492,7 +2492,7 @@ function Fi(e) {
|
|
|
2492
2492
|
content: u
|
|
2493
2493
|
};
|
|
2494
2494
|
}
|
|
2495
|
-
async function
|
|
2495
|
+
async function me(e) {
|
|
2496
2496
|
let t = L.find((t) => t.name === e.name);
|
|
2497
2497
|
if (!t) return {
|
|
2498
2498
|
content: `工具 "${e.name}" 不存在`,
|
|
@@ -2517,15 +2517,15 @@ function Fi(e) {
|
|
|
2517
2517
|
};
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
|
-
function
|
|
2520
|
+
function he(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 ge(e, t) {
|
|
2524
2524
|
return Ni(e, t);
|
|
2525
2525
|
}
|
|
2526
|
-
function
|
|
2526
|
+
function V(e) {
|
|
2527
2527
|
return !k && !E ? [] : e.map((e) => {
|
|
2528
|
-
let t =
|
|
2528
|
+
let t = he(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,7 +2540,7 @@ function Fi(e) {
|
|
|
2540
2540
|
return a && (n.tool_call_id = a), n;
|
|
2541
2541
|
});
|
|
2542
2542
|
}
|
|
2543
|
-
async function
|
|
2543
|
+
async function _e(e, t, n) {
|
|
2544
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) {
|
|
@@ -2565,13 +2565,13 @@ function Fi(e) {
|
|
|
2565
2565
|
}), "";
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
|
-
let i =
|
|
2568
|
+
let i = z(r);
|
|
2569
2569
|
P("context", {
|
|
2570
2570
|
model: c,
|
|
2571
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) => pe(e, t, n)), u = wi(v, me), 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
2577
|
let e = oe(void 0, "round", `round ${f}`, { round: f })?.id;
|
|
@@ -2581,7 +2581,7 @@ function Fi(e) {
|
|
|
2581
2581
|
}), R = yi(v, {
|
|
2582
2582
|
messages: i,
|
|
2583
2583
|
state: R
|
|
2584
|
-
}), i =
|
|
2584
|
+
}), i = B(i), i = ge(i, Math.round(A.contextWindow * .6));
|
|
2585
2585
|
let r = oe(e, "model", c, {
|
|
2586
2586
|
round: d + 1,
|
|
2587
2587
|
tools: L.map((e) => e.name)
|
|
@@ -2590,7 +2590,7 @@ function Fi(e) {
|
|
|
2590
2590
|
round: d + 1,
|
|
2591
2591
|
model: c,
|
|
2592
2592
|
tools: L.map((e) => e.name),
|
|
2593
|
-
messages:
|
|
2593
|
+
messages: V(i)
|
|
2594
2594
|
});
|
|
2595
2595
|
let o = await l({
|
|
2596
2596
|
messages: i,
|
|
@@ -2723,15 +2723,15 @@ 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 && he(e) === "tool") {
|
|
2727
|
+
let e = i.filter((e) => he(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: V(r)
|
|
2733
2733
|
});
|
|
2734
|
-
let a = await Ci(v, (e) =>
|
|
2734
|
+
let a = await Ci(v, (e) => pe(e, t, n, se))({
|
|
2735
2735
|
messages: r,
|
|
2736
2736
|
state: R
|
|
2737
2737
|
});
|
|
@@ -2760,27 +2760,27 @@ function Fi(e) {
|
|
|
2760
2760
|
} catch {}
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
|
-
async function
|
|
2763
|
+
async function H(e, t, n) {
|
|
2764
2764
|
let r = "";
|
|
2765
|
-
return await
|
|
2765
|
+
return await _e(e, (e) => {
|
|
2766
2766
|
e.type === "done" && (r = e.content), n?.(e);
|
|
2767
2767
|
}, t), r;
|
|
2768
2768
|
}
|
|
2769
|
-
function
|
|
2769
|
+
function ve(e) {
|
|
2770
2770
|
L = [...v.flatMap((e) => e.tools || []), ...e], le();
|
|
2771
2771
|
}
|
|
2772
|
-
function
|
|
2772
|
+
function ye(e) {
|
|
2773
2773
|
se = e, le(), O?.(e);
|
|
2774
2774
|
}
|
|
2775
2775
|
return {
|
|
2776
|
-
invoke:
|
|
2777
|
-
stream:
|
|
2776
|
+
invoke: H,
|
|
2777
|
+
stream: _e,
|
|
2778
2778
|
getState: () => R,
|
|
2779
2779
|
get allTools() {
|
|
2780
2780
|
return L;
|
|
2781
2781
|
},
|
|
2782
|
-
setTools:
|
|
2783
|
-
setLlm:
|
|
2782
|
+
setTools: ve,
|
|
2783
|
+
setLlm: ye,
|
|
2784
2784
|
setModelCaps: ne,
|
|
2785
2785
|
debugLogs: N,
|
|
2786
2786
|
spans: ie,
|
|
@@ -4417,6 +4417,7 @@ async function Vo(e, t, n, r, i, a) {
|
|
|
4417
4417
|
...t.middleware ?? []
|
|
4418
4418
|
],
|
|
4419
4419
|
maxToolRounds: t.maxToolRounds ?? jo,
|
|
4420
|
+
maxVerifyAttempts: t.maxVerifyAttempts ?? 0,
|
|
4420
4421
|
onLog: i,
|
|
4421
4422
|
debug: t.debug
|
|
4422
4423
|
});
|
|
@@ -4549,6 +4550,7 @@ function Wo(e, t) {
|
|
|
4549
4550
|
...e.allowedTools?.length ? { allowedTools: e.allowedTools } : {},
|
|
4550
4551
|
...e.middleware?.length ? { middleware: e.middleware } : {},
|
|
4551
4552
|
...e.summarization === void 0 ? {} : { summarization: e.summarization },
|
|
4553
|
+
...e.maxVerifyAttempts === void 0 ? {} : { maxVerifyAttempts: e.maxVerifyAttempts },
|
|
4552
4554
|
...t.getFocuses ? { getFocuses: t.getFocuses } : {},
|
|
4553
4555
|
...t.getSchema ? { getSchema: t.getSchema } : {},
|
|
4554
4556
|
...t.tracker ? { tracker: t.tracker } : {},
|
|
@@ -5284,7 +5286,7 @@ function Ps(e) {
|
|
|
5284
5286
|
//#endregion
|
|
5285
5287
|
//#region src/core/sdk/conflictManager.ts
|
|
5286
5288
|
function Fs(e) {
|
|
5287
|
-
let t = /* @__PURE__ */
|
|
5289
|
+
let t = /* @__PURE__ */ Ot(null), n = 0;
|
|
5288
5290
|
function r(r) {
|
|
5289
5291
|
return new Promise((i) => {
|
|
5290
5292
|
let a = t.value;
|
|
@@ -8701,15 +8703,15 @@ function gu(e, n) {
|
|
|
8701
8703
|
prompt_tokens: 0,
|
|
8702
8704
|
completion_tokens: 0,
|
|
8703
8705
|
total_tokens: 0
|
|
8704
|
-
}, a = Fs(() =>
|
|
8706
|
+
}, a = Fs(() => G), o = /* @__PURE__ */ Ot(0), s = sc(e.storage);
|
|
8705
8707
|
e.debug && s && s.onEvent((e) => console.log("[page-agent-sdk][storage]", e));
|
|
8706
8708
|
let { modelCaps: c, summaryLlmInvoke: l, titleLlmInvoke: u, compressDecisionInvoke: p } = Ps(e), m = c;
|
|
8707
8709
|
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)`);
|
|
8708
8710
|
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;
|
|
8709
8711
|
e.debug && !l && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
8710
|
-
let b = /* @__PURE__ */
|
|
8712
|
+
let b = /* @__PURE__ */ gt([]), x = Fc(e.vfs?.initialFiles, {
|
|
8711
8713
|
persist: s ? { save: (e) => {
|
|
8712
|
-
|
|
8714
|
+
K.sessionId && s && s.save(n, K.sessionId, { vfs: e });
|
|
8713
8715
|
} } : void 0,
|
|
8714
8716
|
maxBytes: e.vfs?.maxBytes,
|
|
8715
8717
|
poolBytes: e.vfs?.poolBytes
|
|
@@ -8758,7 +8760,7 @@ function gu(e, n) {
|
|
|
8758
8760
|
schema: t.object({}).optional()
|
|
8759
8761
|
})] : [];
|
|
8760
8762
|
fe.forEach((e) => L.set(e.name, "builtin"));
|
|
8761
|
-
let
|
|
8763
|
+
let z = M.focus, B = r(async ({ path: e, label: t }) => {
|
|
8762
8764
|
let n = I()?.schema;
|
|
8763
8765
|
return n ? zi(n, e) ? (w.setFocus({
|
|
8764
8766
|
path: e,
|
|
@@ -8771,11 +8773,11 @@ function gu(e, n) {
|
|
|
8771
8773
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
8772
8774
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
8773
8775
|
})
|
|
8774
|
-
}),
|
|
8776
|
+
}), pe = r(async () => (w.clearFocus(), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
8775
8777
|
name: "clear_focus",
|
|
8776
8778
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
8777
8779
|
schema: t.object({}).optional()
|
|
8778
|
-
}),
|
|
8780
|
+
}), me = r(async ({ path: e, label: t }) => {
|
|
8779
8781
|
let n = I()?.schema;
|
|
8780
8782
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
8781
8783
|
if (!zi(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
@@ -8792,7 +8794,7 @@ function gu(e, n) {
|
|
|
8792
8794
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
8793
8795
|
label: t.string().optional().describe("人类可读标签")
|
|
8794
8796
|
})
|
|
8795
|
-
}),
|
|
8797
|
+
}), he = r(async ({ path: e }) => {
|
|
8796
8798
|
let t = w.getFocuses().length;
|
|
8797
8799
|
w.removeFocus(e);
|
|
8798
8800
|
let n = w.getFocuses();
|
|
@@ -8801,15 +8803,15 @@ function gu(e, n) {
|
|
|
8801
8803
|
name: "remove_focus",
|
|
8802
8804
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
8803
8805
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
8804
|
-
}),
|
|
8805
|
-
|
|
8806
|
+
}), ge = z && e.toolMode === "advanced" ? [
|
|
8807
|
+
B,
|
|
8808
|
+
pe,
|
|
8806
8809
|
me,
|
|
8807
|
-
he
|
|
8808
|
-
ge
|
|
8810
|
+
he
|
|
8809
8811
|
] : [];
|
|
8810
|
-
|
|
8811
|
-
let
|
|
8812
|
-
function
|
|
8812
|
+
ge.forEach((e) => L.set(e.name, "builtin"));
|
|
8813
|
+
let V = [], _e = /* @__PURE__ */ new Map(), H = ve();
|
|
8814
|
+
function ve() {
|
|
8813
8815
|
let { tools: e, collisions: t } = Ql([
|
|
8814
8816
|
{
|
|
8815
8817
|
label: "builtin",
|
|
@@ -8833,7 +8835,7 @@ function gu(e, n) {
|
|
|
8833
8835
|
},
|
|
8834
8836
|
{
|
|
8835
8837
|
label: "focus",
|
|
8836
|
-
tools:
|
|
8838
|
+
tools: ge
|
|
8837
8839
|
},
|
|
8838
8840
|
{
|
|
8839
8841
|
label: "mcp",
|
|
@@ -8841,73 +8843,73 @@ function gu(e, n) {
|
|
|
8841
8843
|
},
|
|
8842
8844
|
{
|
|
8843
8845
|
label: "skill",
|
|
8844
|
-
tools:
|
|
8846
|
+
tools: V
|
|
8845
8847
|
}
|
|
8846
8848
|
]);
|
|
8847
8849
|
return t.length && console.warn("[page-agent-sdk] 工具重名,后注册覆盖先注册:", t.map((e) => `${e.name}(${e.loser}→${e.winner})`).join(", ")), e;
|
|
8848
8850
|
}
|
|
8849
|
-
let
|
|
8850
|
-
if (
|
|
8851
|
-
if (
|
|
8852
|
-
let
|
|
8851
|
+
let ye = M.planning, be = M.missionAnchor, xe = M.workingMemory, Se = M.skills, Ce = M.vfs;
|
|
8852
|
+
if (Ce) for (let e of Hc) L.set(e, "builtin");
|
|
8853
|
+
if (ye) for (let e of S.tools ?? []) L.set(e.name, "builtin");
|
|
8854
|
+
let we = M.summarization, Te = M.agentCompression && !!p;
|
|
8853
8855
|
e.debug && M.agentCompression && !p && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
8854
|
-
let
|
|
8856
|
+
let Ee = M.memory, De = M.subagent, Oe = De ? Eo() : void 0, ke = e.verify?.maxAttempts ?? 2, Ae = M.verify && e.verify?.enabled !== !1 && ke > 0, je = M.contextInspector;
|
|
8855
8857
|
e.verify?.check && !M.verify && console.warn("[page-agent-sdk][verify] 检测到 verify.check 但 capabilities.verify 未开启,verify 未装载");
|
|
8856
|
-
let
|
|
8857
|
-
llm:
|
|
8858
|
-
allTools: () =>
|
|
8859
|
-
allowedTools:
|
|
8860
|
-
systemPrompt:
|
|
8861
|
-
temperature:
|
|
8862
|
-
maxTokens:
|
|
8863
|
-
skills:
|
|
8864
|
-
maxDepth:
|
|
8865
|
-
maxParallel:
|
|
8858
|
+
let Me = e.subagent, Ne = Me?.allowedTools ?? [], Pe = e.permissions?.length ? Ka(e.permissions) : void 0, Fe = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? qa(e.approval) : void 0, Ie = [...Pe ? [Pe] : [], ...Fe ? [Fe] : []], Le = !De || Me?.enabled === !1 ? void 0 : Ho({
|
|
8859
|
+
llm: Me?.llm ?? e.llm,
|
|
8860
|
+
allTools: () => K.agent?.allTools ?? H,
|
|
8861
|
+
allowedTools: Ne.length ? Ne : void 0,
|
|
8862
|
+
systemPrompt: Me?.systemPrompt,
|
|
8863
|
+
temperature: Me?.temperature,
|
|
8864
|
+
maxTokens: Me?.maxTokens,
|
|
8865
|
+
skills: Me?.skills,
|
|
8866
|
+
maxDepth: Me?.maxDepth,
|
|
8867
|
+
maxParallel: Me?.maxParallel,
|
|
8866
8868
|
debug: e.debug,
|
|
8867
8869
|
getFocuses: () => w.getFocuses(),
|
|
8868
8870
|
getSchema: () => I()?.schema ?? null,
|
|
8869
|
-
tracker:
|
|
8870
|
-
guardMiddleware:
|
|
8871
|
-
getVfsFiles:
|
|
8871
|
+
tracker: Oe,
|
|
8872
|
+
guardMiddleware: Ie.length ? Ie : void 0,
|
|
8873
|
+
getVfsFiles: Ce ? () => x.files : void 0,
|
|
8872
8874
|
enterDataScope: F?.enterScope ? (e) => F.enterScope(e) : void 0,
|
|
8873
8875
|
exitDataScope: F?.exitScope ? (e) => F.exitScope(e) : void 0,
|
|
8874
8876
|
onUsage: (e) => {
|
|
8875
8877
|
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);
|
|
8876
8878
|
},
|
|
8877
|
-
timeoutMs:
|
|
8878
|
-
}),
|
|
8879
|
+
timeoutMs: Me?.timeoutMs
|
|
8880
|
+
}), U = De && e.subagents !== void 0 ? Go(e.subagents, {
|
|
8879
8881
|
llm: e.llm,
|
|
8880
|
-
allTools: () =>
|
|
8882
|
+
allTools: () => K.agent?.allTools ?? H,
|
|
8881
8883
|
debug: e.debug,
|
|
8882
8884
|
getFocuses: () => w.getFocuses(),
|
|
8883
8885
|
getSchema: () => I()?.schema ?? null,
|
|
8884
|
-
tracker:
|
|
8885
|
-
guardMiddleware:
|
|
8886
|
-
getVfsFiles:
|
|
8886
|
+
tracker: Oe,
|
|
8887
|
+
guardMiddleware: Ie.length ? Ie : void 0,
|
|
8888
|
+
getVfsFiles: Ce ? () => x.files : void 0,
|
|
8887
8889
|
enterDataScope: F?.enterScope ? (e) => F.enterScope(e) : void 0,
|
|
8888
8890
|
exitDataScope: F?.exitScope ? (e) => F.exitScope(e) : void 0,
|
|
8889
8891
|
onUsage: (e) => {
|
|
8890
8892
|
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);
|
|
8891
8893
|
},
|
|
8892
8894
|
timeoutMs: e.subagent?.timeoutMs
|
|
8893
|
-
}) : void 0,
|
|
8895
|
+
}) : void 0, W = U ? U.controller : null, Re = [
|
|
8894
8896
|
"get_data",
|
|
8895
8897
|
"describe_data",
|
|
8896
8898
|
"read",
|
|
8897
8899
|
"fetch_document"
|
|
8898
|
-
],
|
|
8900
|
+
], ze = H.filter((e) => Re.includes(e.name)), Be = Ae ? Ko({
|
|
8899
8901
|
check: e.verify.check ?? Qo({
|
|
8900
8902
|
schemas: () => I() ? { "": I().schema } : {},
|
|
8901
8903
|
root: () => I()?.bind
|
|
8902
8904
|
}),
|
|
8903
8905
|
adversarial: e.verify?.adversarial ? {
|
|
8904
8906
|
llm: e.llm,
|
|
8905
|
-
tools:
|
|
8907
|
+
tools: ze
|
|
8906
8908
|
} : void 0
|
|
8907
|
-
}) : void 0,
|
|
8909
|
+
}) : void 0, Ve = je ? fs({
|
|
8908
8910
|
contextWindow: m.contextWindow,
|
|
8909
8911
|
thresholdRatio: mc(e, m.contextWindow).summaryThresholdRatio
|
|
8910
|
-
}) : void 0,
|
|
8912
|
+
}) : void 0, He = eu({
|
|
8911
8913
|
...M,
|
|
8912
8914
|
humanConfirm: ue,
|
|
8913
8915
|
subagents: e.subagents?.map((e) => ({
|
|
@@ -8915,10 +8917,10 @@ function gu(e, n) {
|
|
|
8915
8917
|
description: e.description,
|
|
8916
8918
|
temperature: e.temperature
|
|
8917
8919
|
}))
|
|
8918
|
-
}, te && !!D, e.toolMode, !!D?.resources?.length),
|
|
8920
|
+
}, te && !!D, e.toolMode, !!D?.resources?.length), Ue = D ? {
|
|
8919
8921
|
name: "dataHint",
|
|
8920
8922
|
augmentPrompt: () => vs(I(), e.schemaHint) || void 0
|
|
8921
|
-
} : null,
|
|
8923
|
+
} : null, We = e.augmentSystem ? {
|
|
8922
8924
|
name: "augmentSystem",
|
|
8923
8925
|
augmentPrompt: (t) => {
|
|
8924
8926
|
try {
|
|
@@ -8931,90 +8933,90 @@ function gu(e, n) {
|
|
|
8931
8933
|
return;
|
|
8932
8934
|
}
|
|
8933
8935
|
}
|
|
8934
|
-
} : null,
|
|
8936
|
+
} : null, Ge = dc(e.onEvent), G = Ge.emit, Ke, qe = [], Je = (e) => ({
|
|
8935
8937
|
name: e.name,
|
|
8936
8938
|
description: e.description,
|
|
8937
8939
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
8938
|
-
}),
|
|
8940
|
+
}), Ye = (e) => ({
|
|
8939
8941
|
name: e.name,
|
|
8940
8942
|
description: e.description,
|
|
8941
8943
|
getContent: () => e.content
|
|
8942
|
-
}),
|
|
8944
|
+
}), Xe = e.skillStorage === !1 ? null : ou({
|
|
8943
8945
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
8944
8946
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
8945
|
-
}),
|
|
8946
|
-
let t =
|
|
8947
|
+
}), Ze = () => {
|
|
8948
|
+
let t = Ke ? Ke.controller : null;
|
|
8947
8949
|
if (t) {
|
|
8948
|
-
let n = (e.skills || []).filter((e) => !
|
|
8949
|
-
t.set([...n, ...
|
|
8950
|
+
let n = (e.skills || []).filter((e) => !qe.some((t) => t.name === e.name));
|
|
8951
|
+
t.set([...n, ...qe]);
|
|
8950
8952
|
}
|
|
8951
|
-
|
|
8952
|
-
},
|
|
8953
|
-
if (
|
|
8954
|
-
let t = await
|
|
8953
|
+
K.infoTick.value++;
|
|
8954
|
+
}, Qe = async () => {
|
|
8955
|
+
if (Xe) try {
|
|
8956
|
+
let t = await Xe.list();
|
|
8955
8957
|
if (t.length) {
|
|
8956
|
-
|
|
8957
|
-
let n =
|
|
8958
|
+
qe = t.map(Ye);
|
|
8959
|
+
let n = Ke ? Ke.controller : null;
|
|
8958
8960
|
if (n) {
|
|
8959
|
-
let t = (e.skills || []).filter((e) => !
|
|
8960
|
-
n.set([...t, ...
|
|
8961
|
+
let t = (e.skills || []).filter((e) => !qe.some((t) => t.name === e.name));
|
|
8962
|
+
n.set([...t, ...qe]);
|
|
8961
8963
|
}
|
|
8962
|
-
|
|
8964
|
+
K.infoTick.value++;
|
|
8963
8965
|
}
|
|
8964
8966
|
} catch {}
|
|
8965
|
-
},
|
|
8967
|
+
}, $e = we ? To({
|
|
8966
8968
|
...h,
|
|
8967
8969
|
llmInvoke: l,
|
|
8968
8970
|
getRegisteredData: () => I() ? [{ description: I().description ?? "主数据对象" }] : [],
|
|
8969
8971
|
preserveLastToolResults: _,
|
|
8970
|
-
...
|
|
8972
|
+
...Te ? {
|
|
8971
8973
|
decideInvoke: p,
|
|
8972
|
-
getSnapshot: () =>
|
|
8974
|
+
getSnapshot: () => Ve?.getSnapshot()
|
|
8973
8975
|
} : {}
|
|
8974
|
-
}) : void 0,
|
|
8975
|
-
...
|
|
8976
|
-
|
|
8977
|
-
...
|
|
8978
|
-
...
|
|
8979
|
-
...
|
|
8980
|
-
readVfs:
|
|
8976
|
+
}) : void 0, et = gc([
|
|
8977
|
+
...Ue ? [Ue] : [],
|
|
8978
|
+
He,
|
|
8979
|
+
...be ? [C] : [],
|
|
8980
|
+
...ye ? [S] : [],
|
|
8981
|
+
...Se ? [Ke = za(e.skills || [], {
|
|
8982
|
+
readVfs: Ce ? (e) => x.files[e]?.content : void 0,
|
|
8981
8983
|
hostScriptEnabled: M.skillHostScript,
|
|
8982
8984
|
onToolsReady: (e, t) => {
|
|
8983
8985
|
for (let n of t) {
|
|
8984
|
-
let t =
|
|
8985
|
-
t >= 0 &&
|
|
8986
|
+
let t = V.findIndex((e) => e.name === n.name);
|
|
8987
|
+
t >= 0 && V.splice(t, 1), V.push(n), _e.set(n.name, e), L.set(n.name, `skill:${e}`);
|
|
8986
8988
|
}
|
|
8987
|
-
|
|
8989
|
+
H = ve(), K.agent && K.agent.setTools(H), K.infoTick.value++;
|
|
8988
8990
|
}
|
|
8989
8991
|
})] : [],
|
|
8990
|
-
...
|
|
8991
|
-
|
|
8992
|
-
...
|
|
8993
|
-
...
|
|
8992
|
+
...Ce ? [Wc(x)] : [],
|
|
8993
|
+
...$e ? [$e] : [],
|
|
8994
|
+
...xe ? [T] : [],
|
|
8995
|
+
...z ? [w] : [],
|
|
8994
8996
|
...oe ? [oe] : [],
|
|
8995
|
-
...
|
|
8996
|
-
...
|
|
8997
|
+
...Ee ? [E] : [],
|
|
8998
|
+
...Pe ? [Pe] : [],
|
|
8997
8999
|
...k && j && A ? [ao(A)] : [],
|
|
8998
9000
|
...ue ? [Za()] : [],
|
|
8999
|
-
...
|
|
9000
|
-
...
|
|
9001
|
-
...
|
|
9002
|
-
...
|
|
9003
|
-
...
|
|
9004
|
-
...
|
|
9001
|
+
...Fe ? [Fe] : [],
|
|
9002
|
+
...Be ? [Be] : [],
|
|
9003
|
+
...Le ? [Le] : [],
|
|
9004
|
+
...U ? [U] : [],
|
|
9005
|
+
...We ? [We] : [],
|
|
9006
|
+
...Ve ? [Ve] : [],
|
|
9005
9007
|
...e.middleware || [],
|
|
9006
9008
|
...P ? [Wl(i, {
|
|
9007
9009
|
tokenBudget: e.tokenBudget,
|
|
9008
9010
|
timeBudgetMs: e.timeBudgetMs
|
|
9009
|
-
},
|
|
9010
|
-
mu(
|
|
9011
|
-
]),
|
|
9012
|
-
function
|
|
9013
|
-
if (
|
|
9011
|
+
}, G)] : [],
|
|
9012
|
+
mu(G, b, I, i)
|
|
9013
|
+
]), tt = e.maxMemoryRounds ?? du, nt = e.approval?.timeoutMs, rt = nt === void 0 || nt === 0 ? 3e4 : !Number.isFinite(nt) || nt < 0 ? 0 : nt;
|
|
9014
|
+
function it(e) {
|
|
9015
|
+
if (rt) return (t) => {
|
|
9014
9016
|
if (t.type !== "approval_request") return;
|
|
9015
9017
|
let n = Date.now(), r = t.toolName;
|
|
9016
9018
|
setTimeout(() => {
|
|
9017
|
-
e?.aborted || (t.resolve(!1),
|
|
9019
|
+
e?.aborted || (t.resolve(!1), G({
|
|
9018
9020
|
type: "error",
|
|
9019
9021
|
message: `确认请求(${r})${Math.round((Date.now() - n) / 1e3)}s 无响应已自动拒绝 —— send/batch 路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
9020
9022
|
severity: "observable",
|
|
@@ -9024,31 +9026,31 @@ function gu(e, n) {
|
|
|
9024
9026
|
waitedMs: Date.now() - n
|
|
9025
9027
|
}
|
|
9026
9028
|
}));
|
|
9027
|
-
},
|
|
9029
|
+
}, rt);
|
|
9028
9030
|
};
|
|
9029
9031
|
}
|
|
9030
|
-
let
|
|
9031
|
-
async function
|
|
9032
|
-
s && (
|
|
9032
|
+
let at = /* @__PURE__ */ Ot([]);
|
|
9033
|
+
async function ot() {
|
|
9034
|
+
s && (at.value = (await s.listSessions(n)).sort((e, t) => t.lastAccessed - e.lastAccessed));
|
|
9033
9035
|
}
|
|
9034
|
-
let
|
|
9035
|
-
function
|
|
9036
|
+
let st = uu(), ct = /* @__PURE__ */ new Set();
|
|
9037
|
+
function lt(e) {
|
|
9036
9038
|
let t = new AbortController();
|
|
9037
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", () => t.abort(), { once: !0 })),
|
|
9039
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", () => t.abort(), { once: !0 })), ct.add(t), {
|
|
9038
9040
|
controller: t,
|
|
9039
|
-
untrack: () =>
|
|
9041
|
+
untrack: () => ct.delete(t)
|
|
9040
9042
|
};
|
|
9041
9043
|
}
|
|
9042
|
-
function
|
|
9043
|
-
for (let e of
|
|
9044
|
-
|
|
9044
|
+
function ut() {
|
|
9045
|
+
for (let e of ct) e.abort();
|
|
9046
|
+
ct.clear();
|
|
9045
9047
|
}
|
|
9046
|
-
let
|
|
9048
|
+
let K = {
|
|
9047
9049
|
agentId: n,
|
|
9048
9050
|
store: s,
|
|
9049
9051
|
messages: b,
|
|
9050
9052
|
vfsStore: x,
|
|
9051
|
-
listeners:
|
|
9053
|
+
listeners: Ge.listeners,
|
|
9052
9054
|
todosMw: S,
|
|
9053
9055
|
memoryMw: E,
|
|
9054
9056
|
missionMw: C,
|
|
@@ -9062,30 +9064,30 @@ function gu(e, n) {
|
|
|
9062
9064
|
mcpServers: [],
|
|
9063
9065
|
checkpoint: A,
|
|
9064
9066
|
dataOpsController: F,
|
|
9065
|
-
skillsController:
|
|
9067
|
+
skillsController: Ke ? Ke.controller : null,
|
|
9066
9068
|
infoTick: o,
|
|
9067
9069
|
pendingConflict: a.pendingConflict,
|
|
9068
|
-
sessions:
|
|
9069
|
-
refreshSessions:
|
|
9070
|
+
sessions: at,
|
|
9071
|
+
refreshSessions: ot,
|
|
9070
9072
|
liveData: I,
|
|
9071
9073
|
usage: i,
|
|
9072
|
-
emit:
|
|
9073
|
-
runSerial:
|
|
9074
|
-
trackActive:
|
|
9075
|
-
abortAllActive:
|
|
9074
|
+
emit: G,
|
|
9075
|
+
runSerial: st,
|
|
9076
|
+
trackActive: lt,
|
|
9077
|
+
abortAllActive: ut,
|
|
9076
9078
|
unloadSkillTools(e) {
|
|
9077
9079
|
if (e) {
|
|
9078
|
-
let t =
|
|
9079
|
-
if (
|
|
9080
|
+
let t = V.length;
|
|
9081
|
+
if (V = V.filter((t) => _e.get(t.name) === e ? (L.delete(t.name), _e.delete(t.name), !1) : !0), V.length === t) return;
|
|
9080
9082
|
} else {
|
|
9081
|
-
if (!
|
|
9082
|
-
for (let e of
|
|
9083
|
-
|
|
9083
|
+
if (!V.length) return;
|
|
9084
|
+
for (let e of V) L.delete(e.name), _e.delete(e.name);
|
|
9085
|
+
V = [];
|
|
9084
9086
|
}
|
|
9085
|
-
|
|
9087
|
+
H = ve(), K.agent && K.agent.setTools(H);
|
|
9086
9088
|
},
|
|
9087
9089
|
applySnapshot(t) {
|
|
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 &&
|
|
9090
|
+
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 && be && C.setMission(t.mission), t.workingMemory && xe && T.restore(t.workingMemory), z) {
|
|
9089
9091
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
9090
9092
|
if (r.length) {
|
|
9091
9093
|
let t = I()?.schema, n = t ? r.filter((e) => zi(t, e.path)) : [];
|
|
@@ -9095,21 +9097,21 @@ function gu(e, n) {
|
|
|
9095
9097
|
}
|
|
9096
9098
|
}
|
|
9097
9099
|
}
|
|
9098
|
-
|
|
9100
|
+
mt();
|
|
9099
9101
|
},
|
|
9100
9102
|
addSkill(e) {
|
|
9101
|
-
let t =
|
|
9102
|
-
t >= 0 ?
|
|
9103
|
+
let t = qe.findIndex((t) => t.name === e.name);
|
|
9104
|
+
t >= 0 ? qe[t] = e : qe.push(e), Ze(), Xe && Xe.put(Je(e));
|
|
9103
9105
|
},
|
|
9104
9106
|
removeSkill(e) {
|
|
9105
|
-
let t =
|
|
9106
|
-
return t < 0 ? !1 : (
|
|
9107
|
+
let t = qe.findIndex((t) => t.name === e);
|
|
9108
|
+
return t < 0 ? !1 : (qe.splice(t, 1), Ze(), Xe && Xe.remove(e), !0);
|
|
9107
9109
|
},
|
|
9108
9110
|
listUserSkills() {
|
|
9109
|
-
return
|
|
9111
|
+
return qe.map((e) => e.name);
|
|
9110
9112
|
},
|
|
9111
9113
|
getUserSkill(e) {
|
|
9112
|
-
let t =
|
|
9114
|
+
let t = qe.find((t) => t.name === e);
|
|
9113
9115
|
if (t) return {
|
|
9114
9116
|
name: t.name,
|
|
9115
9117
|
description: t.description,
|
|
@@ -9117,16 +9119,16 @@ function gu(e, n) {
|
|
|
9117
9119
|
};
|
|
9118
9120
|
},
|
|
9119
9121
|
afterRound() {
|
|
9120
|
-
|
|
9122
|
+
ht(), yt();
|
|
9121
9123
|
},
|
|
9122
9124
|
async send(e, t) {
|
|
9123
|
-
await
|
|
9125
|
+
await K.initDone, t ??= {}, t?.mission && be && C.setMission(t.mission);
|
|
9124
9126
|
let n = e;
|
|
9125
9127
|
if (t.interceptors?.input) try {
|
|
9126
9128
|
let r = t.interceptors.input(e);
|
|
9127
9129
|
typeof r == "string" && (n = r);
|
|
9128
9130
|
} catch {}
|
|
9129
|
-
let r = P ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o =
|
|
9131
|
+
let r = P ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o = it(t.signal);
|
|
9130
9132
|
for (;;) {
|
|
9131
9133
|
a ||= (b.push({
|
|
9132
9134
|
role: "user",
|
|
@@ -9134,7 +9136,7 @@ function gu(e, n) {
|
|
|
9134
9136
|
timestamp: Date.now()
|
|
9135
9137
|
}), !0);
|
|
9136
9138
|
try {
|
|
9137
|
-
let e = await
|
|
9139
|
+
let e = await K.agent.invoke(b, t.signal, o);
|
|
9138
9140
|
if (t.interceptors?.output) try {
|
|
9139
9141
|
let n = t.interceptors.output(e);
|
|
9140
9142
|
typeof n == "string" && (e = n);
|
|
@@ -9143,12 +9145,12 @@ function gu(e, n) {
|
|
|
9143
9145
|
role: "assistant",
|
|
9144
9146
|
content: e,
|
|
9145
9147
|
timestamp: Date.now()
|
|
9146
|
-
}),
|
|
9148
|
+
}), K.afterRound(), s && await s.flush(), e;
|
|
9147
9149
|
} catch (e) {
|
|
9148
9150
|
if (ci(e, t.signal)) throw e;
|
|
9149
9151
|
let n = Jr(e, "fatal");
|
|
9150
9152
|
if (i < r && A?.canRestore()) {
|
|
9151
|
-
i += 1, A.restore(), a = !0,
|
|
9153
|
+
i += 1, A.restore(), a = !0, G({
|
|
9152
9154
|
type: "error",
|
|
9153
9155
|
message: `致命错误自动恢复(${i}/${r}):${n.message},已回退 checkpoint 重试`,
|
|
9154
9156
|
severity: "observable",
|
|
@@ -9160,7 +9162,7 @@ function gu(e, n) {
|
|
|
9160
9162
|
});
|
|
9161
9163
|
continue;
|
|
9162
9164
|
}
|
|
9163
|
-
throw
|
|
9165
|
+
throw G({
|
|
9164
9166
|
type: "error",
|
|
9165
9167
|
message: n.message,
|
|
9166
9168
|
severity: n.severity,
|
|
@@ -9171,8 +9173,8 @@ function gu(e, n) {
|
|
|
9171
9173
|
}
|
|
9172
9174
|
},
|
|
9173
9175
|
async batch(e, t, n) {
|
|
9174
|
-
if (await
|
|
9175
|
-
let r = [], i =
|
|
9176
|
+
if (await K.initDone, !e.length) return [];
|
|
9177
|
+
let r = [], i = it(n);
|
|
9176
9178
|
for (let a = 0; a < e.length; a++) {
|
|
9177
9179
|
if (n?.aborted) {
|
|
9178
9180
|
for (let t = a; t < e.length; t++) r.push({
|
|
@@ -9192,12 +9194,12 @@ function gu(e, n) {
|
|
|
9192
9194
|
content: o,
|
|
9193
9195
|
timestamp: Date.now()
|
|
9194
9196
|
});
|
|
9195
|
-
let c = await
|
|
9197
|
+
let c = await K.agent.invoke(b, n, i);
|
|
9196
9198
|
b.push({
|
|
9197
9199
|
role: "assistant",
|
|
9198
9200
|
content: c,
|
|
9199
9201
|
timestamp: Date.now()
|
|
9200
|
-
}),
|
|
9202
|
+
}), K.afterRound(), s && await s.flush(), r.push({
|
|
9201
9203
|
index: a,
|
|
9202
9204
|
task: o,
|
|
9203
9205
|
reply: c,
|
|
@@ -9225,7 +9227,7 @@ function gu(e, n) {
|
|
|
9225
9227
|
break;
|
|
9226
9228
|
}
|
|
9227
9229
|
let s = Jr(i, "fatal");
|
|
9228
|
-
|
|
9230
|
+
G({
|
|
9229
9231
|
type: "error",
|
|
9230
9232
|
message: `批量任务 ${a + 1}/${e.length} 失败:${s.message}`,
|
|
9231
9233
|
severity: "observable",
|
|
@@ -9250,53 +9252,53 @@ function gu(e, n) {
|
|
|
9250
9252
|
return r;
|
|
9251
9253
|
},
|
|
9252
9254
|
async switchSession(t) {
|
|
9253
|
-
if (await
|
|
9254
|
-
if (a.resolve("keep_external"),
|
|
9255
|
-
if (
|
|
9255
|
+
if (await K.initDone, !s) throw Error("page-agent-sdk: storage 未开启,无法切换会话(请传 storage 选项)");
|
|
9256
|
+
if (a.resolve("keep_external"), K.sessionId && s) {
|
|
9257
|
+
if (be) {
|
|
9256
9258
|
let e = C.getMission();
|
|
9257
|
-
e && s.save(n,
|
|
9259
|
+
e && s.save(n, K.sessionId, { mission: e });
|
|
9258
9260
|
}
|
|
9259
|
-
if (
|
|
9261
|
+
if (xe) {
|
|
9260
9262
|
let e = T.getWorkingMemory();
|
|
9261
|
-
e && s.save(n,
|
|
9263
|
+
e && s.save(n, K.sessionId, { workingMemory: e });
|
|
9262
9264
|
}
|
|
9263
|
-
if (
|
|
9265
|
+
if (z) {
|
|
9264
9266
|
let e = w.getFocuses();
|
|
9265
|
-
s.save(n,
|
|
9267
|
+
s.save(n, K.sessionId, { focus: e.length ? e : null });
|
|
9266
9268
|
}
|
|
9267
9269
|
}
|
|
9268
9270
|
x.flush?.(), await s.flush();
|
|
9269
9271
|
let r = t ?? "", i;
|
|
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),
|
|
9272
|
+
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), K.sessionId = r, b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), A && A.importStack([]), K.agent.debugLogs.value = [], i ||= await s.load(n, r), i && (K.applySnapshot(i), G({
|
|
9271
9273
|
type: "session_restored",
|
|
9272
9274
|
sessionId: r,
|
|
9273
9275
|
rounds: i.messages?.length ?? 0
|
|
9274
|
-
})), e.memory && s.save(n,
|
|
9276
|
+
})), e.memory && s.save(n, K.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), ot(), _t = void 0, vt = !1, r;
|
|
9275
9277
|
},
|
|
9276
9278
|
resetSession: () => {
|
|
9277
|
-
|
|
9279
|
+
ut(), a.resolve("keep_external"), K.sessionId = Is(), b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), A && A.importStack([]), K.agent && (K.agent.debugLogs.value = []), s && s.createSession(K.agentId, e.session?.title, K.sessionId), G({
|
|
9278
9280
|
type: "session_restored",
|
|
9279
|
-
sessionId:
|
|
9281
|
+
sessionId: K.sessionId,
|
|
9280
9282
|
rounds: 0
|
|
9281
|
-
}),
|
|
9283
|
+
}), ot(), _t = void 0, vt = !1;
|
|
9282
9284
|
},
|
|
9283
9285
|
stream: (e, t, n) => {
|
|
9284
|
-
if (!
|
|
9286
|
+
if (!K.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
9285
9287
|
x?.setProtectedRefs?.(cu(e));
|
|
9286
9288
|
let r = (e) => {
|
|
9287
|
-
t?.(e),
|
|
9289
|
+
t?.(e), G(e);
|
|
9288
9290
|
};
|
|
9289
9291
|
if (n) {
|
|
9290
9292
|
let e = () => a.resolve("keep_external");
|
|
9291
9293
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
9292
9294
|
}
|
|
9293
|
-
let { controller: i, untrack: o } =
|
|
9294
|
-
return
|
|
9295
|
+
let { controller: i, untrack: o } = lt(n);
|
|
9296
|
+
return K.agent.stream(e, r, i.signal).finally(o);
|
|
9295
9297
|
},
|
|
9296
9298
|
release() {
|
|
9297
|
-
if (
|
|
9298
|
-
|
|
9299
|
-
let e =
|
|
9299
|
+
if (K.refCount--, K.refCount <= 0) {
|
|
9300
|
+
ut(), s && (x.flush?.(), s.flush(), s.dispose()), Xe && Xe.dispose();
|
|
9301
|
+
let e = K.mcpClosers.splice(0);
|
|
9300
9302
|
e.length && Promise.allSettled(e.map((e) => e())), fu.delete(n);
|
|
9301
9303
|
}
|
|
9302
9304
|
},
|
|
@@ -9304,16 +9306,16 @@ function gu(e, n) {
|
|
|
9304
9306
|
setTools(e) {
|
|
9305
9307
|
ce.length = 0, e.forEach((e) => {
|
|
9306
9308
|
ce.push(e), L.set(e.name, "user");
|
|
9307
|
-
}),
|
|
9309
|
+
}), H = ve(), K.agent && K.agent.setTools(H), K.infoTick.value++;
|
|
9308
9310
|
},
|
|
9309
9311
|
addTool(e) {
|
|
9310
|
-
|
|
9312
|
+
H.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
9311
9313
|
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"),
|
|
9314
|
+
ce.push(e), L.set(e.name, "user"), H = ve(), K.agent && K.agent.setTools(H), K.infoTick.value++;
|
|
9313
9315
|
},
|
|
9314
9316
|
removeTool(e) {
|
|
9315
9317
|
let t = ce.findIndex((t) => t.name === e);
|
|
9316
|
-
return t < 0 ? !1 : (ce.splice(t, 1), L.delete(e),
|
|
9318
|
+
return t < 0 ? !1 : (ce.splice(t, 1), L.delete(e), H = ve(), K.agent && K.agent.setTools(H), K.infoTick.value++, !0);
|
|
9317
9319
|
},
|
|
9318
9320
|
setLlm(t) {
|
|
9319
9321
|
let n;
|
|
@@ -9330,52 +9332,52 @@ function gu(e, n) {
|
|
|
9330
9332
|
contextWindow: e.contextWindow ?? r?.contextWindow,
|
|
9331
9333
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens
|
|
9332
9334
|
}), m.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${m.contextWindow} 小于最小支持 ${ni}(需 ≥200K 窗口模型)`);
|
|
9333
|
-
|
|
9335
|
+
K.agent && (K.agent.setLlm(n), K.agent.setModelCaps?.(m)), $e?.setContextWindow?.(m.contextWindow), Ve?.setContextWindow?.(m.contextWindow), K.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", m);
|
|
9334
9336
|
},
|
|
9335
9337
|
setMemory(e) {
|
|
9336
|
-
E.reset(e), typeof e == "function" && E.refresh(),
|
|
9338
|
+
E.reset(e), typeof e == "function" && E.refresh(), K.infoTick.value++;
|
|
9337
9339
|
},
|
|
9338
9340
|
refreshMemory() {
|
|
9339
9341
|
return E.refresh();
|
|
9340
9342
|
},
|
|
9341
9343
|
setSubagents(t) {
|
|
9342
|
-
if (!
|
|
9344
|
+
if (!W) {
|
|
9343
9345
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
9344
9346
|
return;
|
|
9345
9347
|
}
|
|
9346
|
-
|
|
9348
|
+
W.set(t), K.infoTick.value++;
|
|
9347
9349
|
},
|
|
9348
9350
|
addSubagent(t) {
|
|
9349
|
-
if (!
|
|
9351
|
+
if (!W) {
|
|
9350
9352
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
9351
9353
|
return;
|
|
9352
9354
|
}
|
|
9353
|
-
|
|
9355
|
+
W.add(t), K.infoTick.value++;
|
|
9354
9356
|
},
|
|
9355
9357
|
removeSubagent(t) {
|
|
9356
|
-
if (!
|
|
9357
|
-
let n =
|
|
9358
|
-
return n &&
|
|
9358
|
+
if (!W) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
9359
|
+
let n = W.remove(t);
|
|
9360
|
+
return n && K.infoTick.value++, n;
|
|
9359
9361
|
},
|
|
9360
9362
|
getActiveSubagents() {
|
|
9361
|
-
return
|
|
9363
|
+
return Oe?.getActive() ?? [];
|
|
9362
9364
|
},
|
|
9363
9365
|
get subagentHistory() {
|
|
9364
|
-
return
|
|
9366
|
+
return Oe?.getHistory() ?? [];
|
|
9365
9367
|
},
|
|
9366
9368
|
getInfo() {
|
|
9367
9369
|
return {
|
|
9368
9370
|
id: n,
|
|
9369
|
-
sessionId:
|
|
9371
|
+
sessionId: K.sessionId,
|
|
9370
9372
|
model: Ts(y) ? y.model ?? y.modelName : y.model,
|
|
9371
|
-
systemPrompt:
|
|
9372
|
-
tools: (
|
|
9373
|
+
systemPrompt: K.agent?.getEffectiveSystemPrompt?.() ?? re + vs(I(), e.schemaHint),
|
|
9374
|
+
tools: (K.agent?.allTools ?? H).map((e) => ({
|
|
9373
9375
|
name: e.name,
|
|
9374
9376
|
description: e.description,
|
|
9375
9377
|
schema: e.schema,
|
|
9376
9378
|
source: L.get(e.name) || "user"
|
|
9377
9379
|
})),
|
|
9378
|
-
skills: (
|
|
9380
|
+
skills: (Ke ? Ke.controller.get() : e.skills ?? []).map((e) => ({
|
|
9379
9381
|
name: e.name,
|
|
9380
9382
|
description: e.description
|
|
9381
9383
|
})),
|
|
@@ -9385,8 +9387,8 @@ function gu(e, n) {
|
|
|
9385
9387
|
} : void 0,
|
|
9386
9388
|
contextPreset: e.contextPreset ?? "auto",
|
|
9387
9389
|
memory: E.get(),
|
|
9388
|
-
middleware:
|
|
9389
|
-
todos: (
|
|
9390
|
+
middleware: et.map((e) => e.name),
|
|
9391
|
+
todos: (K.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
9390
9392
|
id: e.id,
|
|
9391
9393
|
content: e.content,
|
|
9392
9394
|
status: e.status,
|
|
@@ -9396,39 +9398,39 @@ function gu(e, n) {
|
|
|
9396
9398
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
9397
9399
|
})),
|
|
9398
9400
|
planPhase: S.getPlanPhase(),
|
|
9399
|
-
mission:
|
|
9400
|
-
workingMemory:
|
|
9401
|
-
focus:
|
|
9402
|
-
focuses:
|
|
9403
|
-
trace: N &&
|
|
9404
|
-
spans:
|
|
9405
|
-
metrics: oi(
|
|
9401
|
+
mission: be ? C.getMission() : void 0,
|
|
9402
|
+
workingMemory: xe ? T.getWorkingMemory() : void 0,
|
|
9403
|
+
focus: z ? w.getFocus() : void 0,
|
|
9404
|
+
focuses: z ? w.getFocuses() : [],
|
|
9405
|
+
trace: N && K.agent?.spans ? {
|
|
9406
|
+
spans: K.agent.spans.value,
|
|
9407
|
+
metrics: oi(K.agent.spans.value)
|
|
9406
9408
|
} : void 0,
|
|
9407
9409
|
actions: ql(e.actions ?? {}),
|
|
9408
9410
|
subagent: {
|
|
9409
|
-
enabled: !!
|
|
9411
|
+
enabled: !!Le,
|
|
9410
9412
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
9411
9413
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
9412
9414
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
9413
|
-
subagents:
|
|
9414
|
-
active:
|
|
9415
|
-
history:
|
|
9415
|
+
subagents: W?.get() ?? [],
|
|
9416
|
+
active: Oe?.getActive() ?? [],
|
|
9417
|
+
history: Oe?.getHistory() ?? []
|
|
9416
9418
|
},
|
|
9417
9419
|
verify: {
|
|
9418
|
-
enabled: !!
|
|
9419
|
-
maxAttempts:
|
|
9420
|
-
adversarial:
|
|
9420
|
+
enabled: !!Be,
|
|
9421
|
+
maxAttempts: Ae ? ke : 0,
|
|
9422
|
+
adversarial: Ae && !!e.verify?.adversarial
|
|
9421
9423
|
},
|
|
9422
9424
|
context: (() => {
|
|
9423
|
-
let e =
|
|
9425
|
+
let e = Ve?.getSnapshot();
|
|
9424
9426
|
if (e) {
|
|
9425
|
-
let t =
|
|
9427
|
+
let t = K.agent?.getState?.()?.lastCompression;
|
|
9426
9428
|
t && (e.compression = t);
|
|
9427
9429
|
}
|
|
9428
9430
|
return e;
|
|
9429
9431
|
})(),
|
|
9430
|
-
mcp: { servers:
|
|
9431
|
-
lastCompression:
|
|
9432
|
+
mcp: { servers: K.mcpServers },
|
|
9433
|
+
lastCompression: K.agent?.getState?.()?.lastCompression,
|
|
9432
9434
|
checkpoints: A ? {
|
|
9433
9435
|
enabled: !0,
|
|
9434
9436
|
auto: j,
|
|
@@ -9437,69 +9439,69 @@ function gu(e, n) {
|
|
|
9437
9439
|
};
|
|
9438
9440
|
},
|
|
9439
9441
|
getMission() {
|
|
9440
|
-
return
|
|
9442
|
+
return be ? C.getMission() : void 0;
|
|
9441
9443
|
},
|
|
9442
9444
|
setMission(t) {
|
|
9443
|
-
if (!
|
|
9445
|
+
if (!be) {
|
|
9444
9446
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
9445
9447
|
return;
|
|
9446
9448
|
}
|
|
9447
|
-
C.setMission(t),
|
|
9449
|
+
C.setMission(t), K.infoTick.value++;
|
|
9448
9450
|
},
|
|
9449
9451
|
getFocus() {
|
|
9450
|
-
return
|
|
9452
|
+
return z ? w.getFocus() : void 0;
|
|
9451
9453
|
},
|
|
9452
9454
|
getFocuses() {
|
|
9453
|
-
return
|
|
9455
|
+
return z ? w.getFocuses() : [];
|
|
9454
9456
|
},
|
|
9455
9457
|
setFocus(t) {
|
|
9456
|
-
let n = hu(t, "setFocus",
|
|
9457
|
-
return n.ok ? (w.setFocus(t),
|
|
9458
|
+
let n = hu(t, "setFocus", z, () => I()?.schema, e.debug);
|
|
9459
|
+
return n.ok ? (w.setFocus(t), K.infoTick.value++, { ok: !0 }) : n;
|
|
9458
9460
|
},
|
|
9459
9461
|
addFocus(t) {
|
|
9460
|
-
let n = hu(t, "addFocus",
|
|
9462
|
+
let n = hu(t, "addFocus", z, () => I()?.schema, e.debug);
|
|
9461
9463
|
return n.ok ? w.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
9462
9464
|
ok: !1,
|
|
9463
9465
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
9464
|
-
}) : (w.addFocus(t),
|
|
9466
|
+
}) : (w.addFocus(t), K.infoTick.value++, { ok: !0 }) : n;
|
|
9465
9467
|
},
|
|
9466
9468
|
removeFocus(e) {
|
|
9467
|
-
|
|
9469
|
+
z && (w.removeFocus(e), K.infoTick.value++);
|
|
9468
9470
|
},
|
|
9469
9471
|
clearFocus() {
|
|
9470
|
-
|
|
9472
|
+
z && (w.clearFocus(), K.infoTick.value++);
|
|
9471
9473
|
}
|
|
9472
9474
|
};
|
|
9473
|
-
async function
|
|
9475
|
+
async function dt() {
|
|
9474
9476
|
if (!s) return;
|
|
9475
9477
|
await s.ready;
|
|
9476
9478
|
let t = e.session || {};
|
|
9477
9479
|
if (t.id) {
|
|
9478
|
-
|
|
9479
|
-
let e = await s.load(n,
|
|
9480
|
-
e ? (
|
|
9480
|
+
K.sessionId = t.id;
|
|
9481
|
+
let e = await s.load(n, K.sessionId);
|
|
9482
|
+
e ? (K.applySnapshot(e), G({
|
|
9481
9483
|
type: "session_restored",
|
|
9482
|
-
sessionId:
|
|
9484
|
+
sessionId: K.sessionId,
|
|
9483
9485
|
rounds: e.messages?.length ?? 0
|
|
9484
|
-
})) : await s.createSession(n, t.title,
|
|
9486
|
+
})) : await s.createSession(n, t.title, K.sessionId);
|
|
9485
9487
|
} else if (t.autoResume !== !1) {
|
|
9486
9488
|
let r = await s.listSessions(n);
|
|
9487
9489
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, r.length, r.map((e) => e.sessionId)), r.length) {
|
|
9488
|
-
|
|
9489
|
-
let t = await s.load(n,
|
|
9490
|
-
t ? (
|
|
9490
|
+
K.sessionId = r[0].sessionId;
|
|
9491
|
+
let t = await s.load(n, K.sessionId);
|
|
9492
|
+
t ? (K.applySnapshot(t), G({
|
|
9491
9493
|
type: "session_restored",
|
|
9492
|
-
sessionId:
|
|
9494
|
+
sessionId: K.sessionId,
|
|
9493
9495
|
rounds: t.messages?.length ?? 0
|
|
9494
|
-
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话",
|
|
9495
|
-
} else
|
|
9496
|
-
} else
|
|
9497
|
-
e.memory && s.save(n,
|
|
9496
|
+
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", K.sessionId, `${t.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", K.sessionId);
|
|
9497
|
+
} else K.sessionId = await s.createSession(n, t.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", K.sessionId);
|
|
9498
|
+
} else K.sessionId = await s.createSession(n, t.title);
|
|
9499
|
+
e.memory && s.save(n, K.sessionId, { memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), ot();
|
|
9498
9500
|
}
|
|
9499
|
-
async function
|
|
9500
|
-
await
|
|
9501
|
+
async function ft() {
|
|
9502
|
+
await Qe();
|
|
9501
9503
|
}
|
|
9502
|
-
function
|
|
9504
|
+
function pt(e) {
|
|
9503
9505
|
let t = {};
|
|
9504
9506
|
for (let n of cu(e)) {
|
|
9505
9507
|
let e = x.files[n];
|
|
@@ -9507,15 +9509,15 @@ function gu(e, n) {
|
|
|
9507
9509
|
}
|
|
9508
9510
|
return t;
|
|
9509
9511
|
}
|
|
9510
|
-
function
|
|
9512
|
+
function mt() {
|
|
9511
9513
|
let e = lu(x.files, cu(b));
|
|
9512
9514
|
for (let t of e) delete x.files[t];
|
|
9513
9515
|
}
|
|
9514
|
-
function
|
|
9515
|
-
let e = ho(b,
|
|
9516
|
+
function ht() {
|
|
9517
|
+
let e = ho(b, tt);
|
|
9516
9518
|
if (!e.trimmed) return;
|
|
9517
9519
|
let { older: t, summary: n } = e;
|
|
9518
|
-
if (
|
|
9520
|
+
if (G({
|
|
9519
9521
|
type: "context_trimmed",
|
|
9520
9522
|
dropped: t.map((e) => ({
|
|
9521
9523
|
round: e.round,
|
|
@@ -9523,76 +9525,76 @@ function gu(e, n) {
|
|
|
9523
9525
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
9524
9526
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
9525
9527
|
})),
|
|
9526
|
-
vfsResults:
|
|
9528
|
+
vfsResults: pt(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
9527
9529
|
summary: n.content,
|
|
9528
9530
|
reason: "max_memory_rounds"
|
|
9529
|
-
}), b.splice(e.deleteFrom, e.deleteCount, n),
|
|
9531
|
+
}), b.splice(e.deleteFrom, e.deleteCount, n), mt(), g && l) {
|
|
9530
9532
|
let n = e.summary, { prevSeg: r } = e;
|
|
9531
9533
|
(async () => {
|
|
9532
9534
|
try {
|
|
9533
9535
|
let e = await l(bo(t, v)), i = b.indexOf(n);
|
|
9534
9536
|
if (i < 0) return;
|
|
9535
|
-
b[i].content = mo(t, r, e),
|
|
9537
|
+
b[i].content = mo(t, r, e), yt();
|
|
9536
9538
|
} catch {}
|
|
9537
9539
|
})();
|
|
9538
9540
|
}
|
|
9539
9541
|
}
|
|
9540
|
-
let
|
|
9541
|
-
function
|
|
9542
|
-
if (!
|
|
9542
|
+
let _t, vt = !1;
|
|
9543
|
+
function yt() {
|
|
9544
|
+
if (!K.sessionId || !s) return;
|
|
9543
9545
|
let t = JSON.parse(JSON.stringify(b));
|
|
9544
|
-
s.save(n,
|
|
9545
|
-
let r =
|
|
9546
|
-
if (s.save(n,
|
|
9546
|
+
s.save(n, K.sessionId, { messages: t });
|
|
9547
|
+
let r = K.agent?.getState?.()?.todos ?? [];
|
|
9548
|
+
if (s.save(n, K.sessionId, { todos: r }), be) {
|
|
9547
9549
|
let e = C.getMission();
|
|
9548
|
-
e && s.save(n,
|
|
9550
|
+
e && s.save(n, K.sessionId, { mission: e });
|
|
9549
9551
|
}
|
|
9550
|
-
if (
|
|
9552
|
+
if (xe) {
|
|
9551
9553
|
let e = T.getWorkingMemory();
|
|
9552
|
-
e && s.save(n,
|
|
9554
|
+
e && s.save(n, K.sessionId, { workingMemory: e });
|
|
9553
9555
|
}
|
|
9554
|
-
if (
|
|
9556
|
+
if (z) {
|
|
9555
9557
|
let e = w.getFocuses();
|
|
9556
|
-
s.save(n,
|
|
9558
|
+
s.save(n, K.sessionId, { focus: e.length ? e : null });
|
|
9557
9559
|
}
|
|
9558
|
-
P && A && (s.save(n,
|
|
9560
|
+
P && A && (s.save(n, K.sessionId, { checkpoints: A.exportStack() }), s.save(n, K.sessionId, { usage: i }));
|
|
9559
9561
|
let a = ws(b);
|
|
9560
|
-
a && a !==
|
|
9562
|
+
a && a !== _t && (_t = a, s.updateTitle(n, K.sessionId, a)), e.autoTitle !== !1 && u && !vt && b.some((e) => e.role === "user") && b.some((e) => e.role === "assistant") && (vt = !0, (async () => {
|
|
9561
9563
|
let e = await u(b);
|
|
9562
|
-
e && (await s.updateTitle(n,
|
|
9563
|
-
})()), e.debug && console.log("[page-agent-sdk][persist] save",
|
|
9564
|
+
e && (await s.updateTitle(n, K.sessionId, e), await ot());
|
|
9565
|
+
})()), e.debug && console.log("[page-agent-sdk][persist] save", K.sessionId, `${b.length} msgs`);
|
|
9564
9566
|
}
|
|
9565
|
-
return
|
|
9566
|
-
if (await
|
|
9567
|
+
return K.initDone = (async () => {
|
|
9568
|
+
if (await dt(), await ft(), e.mcp?.length) {
|
|
9567
9569
|
let t = await Promise.allSettled(e.mcp.map((e) => gs(e)));
|
|
9568
|
-
|
|
9570
|
+
K.mcpClosers = t.flatMap((e) => e.status === "fulfilled" ? [e.value.close] : []), K.mcpServers = [], t.forEach((t, n) => {
|
|
9569
9571
|
let r = e.mcp[n], i = r.name ?? r.url;
|
|
9570
|
-
t.status === "fulfilled" ? (
|
|
9572
|
+
t.status === "fulfilled" ? (K.mcpServers.push({
|
|
9571
9573
|
name: i,
|
|
9572
9574
|
url: r.url,
|
|
9573
9575
|
toolCount: t.value.tools.length
|
|
9574
9576
|
}), 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
|
-
}),
|
|
9577
|
+
}), H = ve(), e.debug && console.log(`[page-agent-sdk][mcp] 注入 ${R.length} 个工具,${K.mcpServers.length} 个 server`);
|
|
9576
9578
|
}
|
|
9577
9579
|
let t = Ts(e.llm) ? e.llm : await f(e.llm);
|
|
9578
|
-
|
|
9580
|
+
K.agent = Fi({
|
|
9579
9581
|
llm: t,
|
|
9580
9582
|
systemPrompt: re,
|
|
9581
|
-
tools:
|
|
9582
|
-
middleware:
|
|
9583
|
+
tools: H,
|
|
9584
|
+
middleware: et,
|
|
9583
9585
|
maxToolRounds: e.maxToolRounds,
|
|
9584
9586
|
maxRetries: e.maxRetries,
|
|
9585
9587
|
stallMs: e.streamStallMs ?? 9e4,
|
|
9586
9588
|
maxParallelTools: e.maxParallelTools,
|
|
9587
9589
|
contextWindow: m.contextWindow,
|
|
9588
9590
|
maxOutputTokens: m.maxOutputTokens,
|
|
9589
|
-
maxVerifyAttempts:
|
|
9591
|
+
maxVerifyAttempts: Ae ? ke : 0,
|
|
9590
9592
|
onLlmChange: (e) => {
|
|
9591
9593
|
y = e;
|
|
9592
9594
|
},
|
|
9593
9595
|
onTrace: N ? (e, t) => {
|
|
9594
9596
|
try {
|
|
9595
|
-
|
|
9597
|
+
G({
|
|
9596
9598
|
type: "trace",
|
|
9597
9599
|
spans: e,
|
|
9598
9600
|
metrics: t
|
|
@@ -9600,10 +9602,10 @@ function gu(e, n) {
|
|
|
9600
9602
|
} catch {}
|
|
9601
9603
|
} : void 0,
|
|
9602
9604
|
debug: e.debug
|
|
9603
|
-
}), ee.current =
|
|
9604
|
-
|
|
9605
|
+
}), ee.current = K.agent, U && U.setReconfigureHook && U.setReconfigureHook(() => {
|
|
9606
|
+
K.agent && K.agent.setTools(ve());
|
|
9605
9607
|
});
|
|
9606
|
-
})(),
|
|
9608
|
+
})(), K;
|
|
9607
9609
|
}
|
|
9608
9610
|
function _u(e, t) {
|
|
9609
9611
|
let n = e.id ?? Is();
|
|
@@ -9883,36 +9885,252 @@ function Cu(e) {
|
|
|
9883
9885
|
};
|
|
9884
9886
|
}
|
|
9885
9887
|
//#endregion
|
|
9888
|
+
//#region src/core/tools/htmlValidate.ts
|
|
9889
|
+
var wu = /* @__PURE__ */ new Set([
|
|
9890
|
+
"area",
|
|
9891
|
+
"base",
|
|
9892
|
+
"br",
|
|
9893
|
+
"col",
|
|
9894
|
+
"embed",
|
|
9895
|
+
"hr",
|
|
9896
|
+
"img",
|
|
9897
|
+
"input",
|
|
9898
|
+
"link",
|
|
9899
|
+
"meta",
|
|
9900
|
+
"param",
|
|
9901
|
+
"source",
|
|
9902
|
+
"track",
|
|
9903
|
+
"wbr"
|
|
9904
|
+
]), Tu = /* @__PURE__ */ new Set(["script", "style"]), Eu = /* @__PURE__ */ new Set([
|
|
9905
|
+
"html",
|
|
9906
|
+
"head",
|
|
9907
|
+
"body"
|
|
9908
|
+
]);
|
|
9909
|
+
function Du(e, t = {}) {
|
|
9910
|
+
let n = t.sfc === !0, r = [], i = e.length;
|
|
9911
|
+
if (!e.trim()) return r;
|
|
9912
|
+
let a = [0];
|
|
9913
|
+
for (let t = 0; t < i; t++) e[t] === "\n" && a.push(t + 1);
|
|
9914
|
+
let o = (e) => {
|
|
9915
|
+
let t = 0, n = a.length - 1;
|
|
9916
|
+
for (; t < n;) {
|
|
9917
|
+
let r = t + n + 1 >> 1;
|
|
9918
|
+
a[r] <= e ? t = r : n = r - 1;
|
|
9919
|
+
}
|
|
9920
|
+
return t + 1;
|
|
9921
|
+
}, s = [], c = 0;
|
|
9922
|
+
for (; c < i;) {
|
|
9923
|
+
let t = e.indexOf("<", c);
|
|
9924
|
+
if (t < 0) break;
|
|
9925
|
+
if (e.startsWith("<!--", t)) {
|
|
9926
|
+
let n = e.indexOf("-->", t + 4);
|
|
9927
|
+
if (n < 0) {
|
|
9928
|
+
r.push({
|
|
9929
|
+
line: o(t),
|
|
9930
|
+
code: "UNCLOSED_COMMENT",
|
|
9931
|
+
message: "注释 <!-- 未闭合(缺 -->)"
|
|
9932
|
+
});
|
|
9933
|
+
break;
|
|
9934
|
+
}
|
|
9935
|
+
c = n + 3;
|
|
9936
|
+
continue;
|
|
9937
|
+
}
|
|
9938
|
+
if (e[t + 1] === "!") {
|
|
9939
|
+
let n = e.indexOf(">", t), a = e.slice(t, n < 0 ? i : n + 1);
|
|
9940
|
+
/^<!doctype/i.test(a) && r.push({
|
|
9941
|
+
line: o(t),
|
|
9942
|
+
code: "DOCTYPE_IN_FRAGMENT",
|
|
9943
|
+
message: "<!DOCTYPE> 不应出现(渲染产物经 v-html 注入,只输出内容片段)"
|
|
9944
|
+
}), c = n < 0 ? i : n + 1;
|
|
9945
|
+
continue;
|
|
9946
|
+
}
|
|
9947
|
+
let a = e[t + 1] === "/", l = a ? t + 2 : t + 1, u = e[l] ?? "";
|
|
9948
|
+
if (!/[a-zA-Z]/.test(u)) {
|
|
9949
|
+
c = t + 1;
|
|
9950
|
+
continue;
|
|
9951
|
+
}
|
|
9952
|
+
let d = l, f = "";
|
|
9953
|
+
for (; d < i;) {
|
|
9954
|
+
let t = e[d];
|
|
9955
|
+
if (f) t === f && (f = "");
|
|
9956
|
+
else if (t === "\"" || t === "'") f = t;
|
|
9957
|
+
else if (t === ">") break;
|
|
9958
|
+
d++;
|
|
9959
|
+
}
|
|
9960
|
+
if (d >= i) {
|
|
9961
|
+
r.push({
|
|
9962
|
+
line: o(t),
|
|
9963
|
+
code: "UNCLOSED_TAG",
|
|
9964
|
+
message: `标签 ${e.slice(t, Math.min(t + 20, i))} 未写完(缺 >)`
|
|
9965
|
+
});
|
|
9966
|
+
break;
|
|
9967
|
+
}
|
|
9968
|
+
let p = e.slice(l, d), m = (p.match(/^[a-zA-Z][a-zA-Z0-9-]*/) ?? [""])[0].toLowerCase(), h = !a && /\/\s*$/.test(p);
|
|
9969
|
+
if (c = d + 1, m) {
|
|
9970
|
+
if (a) {
|
|
9971
|
+
let e = s.length - 1;
|
|
9972
|
+
if (e >= 0 && s[e].name === m) s.pop();
|
|
9973
|
+
else {
|
|
9974
|
+
let e = s.findIndex((e) => e.name === m);
|
|
9975
|
+
if (e >= 0) {
|
|
9976
|
+
let t = s.splice(e);
|
|
9977
|
+
for (let e of t.slice(1)) r.push({
|
|
9978
|
+
line: o(e.idx),
|
|
9979
|
+
code: "UNCLOSED_TAG",
|
|
9980
|
+
message: `<${e.name}> 未闭合(先遇到 </${m}>)`
|
|
9981
|
+
});
|
|
9982
|
+
} else r.push({
|
|
9983
|
+
line: o(t),
|
|
9984
|
+
code: "STRAY_CLOSE_TAG",
|
|
9985
|
+
message: `</${m}> 无匹配的开标签`
|
|
9986
|
+
});
|
|
9987
|
+
}
|
|
9988
|
+
continue;
|
|
9989
|
+
}
|
|
9990
|
+
if (Eu.has(m) && r.push({
|
|
9991
|
+
line: o(t),
|
|
9992
|
+
code: "DOC_TAG_IN_FRAGMENT",
|
|
9993
|
+
message: `<${m}> 不应出现(v-html 注入场景只输出内容片段,不要 html/head/body 外围)`
|
|
9994
|
+
}), !(wu.has(m) || h)) {
|
|
9995
|
+
if (Tu.has(m)) {
|
|
9996
|
+
m === "script" && !n && r.push({
|
|
9997
|
+
line: o(t),
|
|
9998
|
+
code: "SCRIPT_IN_FRAGMENT",
|
|
9999
|
+
message: "<script> 禁用(v-html 注入不执行脚本,且有安全风险)"
|
|
10000
|
+
});
|
|
10001
|
+
let i = RegExp(`</${m}\\s*>`, "i").exec(e.slice(c));
|
|
10002
|
+
if (!i) {
|
|
10003
|
+
r.push({
|
|
10004
|
+
line: o(t),
|
|
10005
|
+
code: "UNCLOSED_TAG",
|
|
10006
|
+
message: `<${m}> 未闭合(缺 </${m}>)`
|
|
10007
|
+
});
|
|
10008
|
+
break;
|
|
10009
|
+
}
|
|
10010
|
+
c += i.index + i[0].length;
|
|
10011
|
+
continue;
|
|
10012
|
+
}
|
|
10013
|
+
s.push({
|
|
10014
|
+
name: m,
|
|
10015
|
+
idx: t
|
|
10016
|
+
});
|
|
10017
|
+
}
|
|
10018
|
+
}
|
|
10019
|
+
}
|
|
10020
|
+
for (let e of s) r.push({
|
|
10021
|
+
line: o(e.idx),
|
|
10022
|
+
code: "UNCLOSED_TAG",
|
|
10023
|
+
message: `<${e.name}> 未闭合`
|
|
10024
|
+
});
|
|
10025
|
+
return r;
|
|
10026
|
+
}
|
|
10027
|
+
//#endregion
|
|
9886
10028
|
//#region src/core/sdk/htmlSubagent.ts
|
|
9887
|
-
function
|
|
9888
|
-
|
|
10029
|
+
function Ou(e, t) {
|
|
10030
|
+
let n = t === "html" ? "html" : "vue";
|
|
10031
|
+
return `你是纯代码组件生成专家。可用工具:vfs_write / vfs_edit / vfs_rm(写/改/删代码到 vfs ${e}) / vfs_grep + vfs_read(读 vfs) / validate_code(代码格式自检) / write + set(写 data 引用,writablePaths 限定) / read / write_todos + update_todo(规划)。
|
|
9889
10032
|
|
|
9890
10033
|
代码存储约定(重要):
|
|
9891
|
-
- 代码正文写 vfs:${e}<name
|
|
9892
|
-
- data 存引用:write({ patch:{ op:'set', jsonPath:'components.N', value:{ type:'custom', codeRef:'vfs://${e}<name
|
|
9893
|
-
- 改代码:先 vfs_edit
|
|
10034
|
+
- 代码正文写 vfs:${e}<name>.${n}(如 ${e}hero.${n})
|
|
10035
|
+
- data 存引用:write({ patch:{ op:'set', jsonPath:'components.N', value:{ type:'custom', codeRef:'vfs://${e}<name>.${n}', name, props } } })
|
|
10036
|
+
- 改代码:先 vfs_edit 局部改 vfs 文件(工具返回替换结果;data 的 codeRef 引用不变,无需改 data)
|
|
10037
|
+
|
|
10038
|
+
代码形态规则:
|
|
10039
|
+
${t === "html" ? `- 输出纯 HTML 片段(.${n}):结构 + 内联 <style>(class 加统一前缀防样式冲突);交互交给宿主(不写 JS)
|
|
10040
|
+
- 单根元素包裹(如 <section class="...">…</section>),语义化标签` : `- 输出 Vue SFC(.${n}):<template> + <script setup>(组合式),defineProps 接外部数据
|
|
10041
|
+
- 只渲染 UI,不做副作用(不发请求 / 不读写 storage)`}
|
|
10042
|
+
|
|
10043
|
+
输出契约(必须):
|
|
10044
|
+
- 渲染产物经 v-html 等方式注入宿主页面:不要 <!DOCTYPE>,不要 <html>/<head>/<body> 外围标签,只输出内容片段本身
|
|
10045
|
+
- 非 SFC 块不要 <script>(注入场景不执行脚本,且有安全风险);不引入外部脚本 / CDN
|
|
9894
10046
|
|
|
9895
10047
|
工作方式:
|
|
9896
10048
|
1. 中等任务(多组件 / 大段代码)先 write_todos 拆解:读现有结构 → 规划各组件 → 逐个生成 → read 确认;
|
|
9897
|
-
2.
|
|
10049
|
+
2. 遵循已加载 skill 的规范(安全底线 / 可访问性 / 组件库引用);
|
|
9898
10050
|
3. 小段代码 vfs_write 整体写;大段用 vfs_edit 增量拼(避免单次输出超限);
|
|
9899
|
-
4.
|
|
10051
|
+
4. 生成/修改完成后必须调 validate_code 自检(标签闭合 + 片段契约),报错用 vfs_edit 修正后复查,直到通过;
|
|
10052
|
+
5. 最后 read(vfs 文件 + data 引用)确认结构正确;只写 writablePaths 内 data + ${e} 下 vfs。`;
|
|
9900
10053
|
}
|
|
9901
|
-
var
|
|
10054
|
+
var ku = "# 纯代码组件生成规范\n\n## 代码存储约定(重要)\n- 代码正文写 vfs:html/<name>.vue(如 html/hero.vue)\n- data 存引用:{ type:'custom', codeRef:'vfs://html/<name>.vue', name, props }\n- 改代码:vfs_edit 局部改 vfs 文件(data 的 codeRef 引用不变)\n\n## 何时写代码组件\n- 组件库无对应类型(高度定制交互 / 一次性特效 / 特殊布局)→ 写 custom 代码组件\n- 组件库已有(按钮 / 卡片 / 列表)→ 用现有组件配置,不重造\n\n## Vue SFC 规范\n- Vue 3 <template> + <script setup>(组合式)\n- props 用 defineProps;事件用 defineEmits\n- 只渲染 UI,不做副作用(不发请求 / 不读写 storage)\n\n## 输出契约(必须)\n- 渲染产物经 v-html 等方式注入宿主:<template> 内不要 <!DOCTYPE> / <html> / <head> / <body> 外围标签,只输出内容片段\n- <template> 内不写 <script>;不引入外部脚本 / CDN\n- 每次生成/修改后调 validate_code 自检,报错修正直到通过\n\n## props 定义\n- 代码组件 defineProps 接受外部 data 传入(集成方渲染时按 data 的 props 字段传)\n\n## 组件库引用\n- 代码内可 import 组件库组件(如 <Button>);所用依赖以集成方渲染层已注入为准,不重复造\n\n## 安全底线(必须)\n- 禁 eval / new Function / Function 构造器\n- 禁访问 window 敏感属性(document.cookie / apiKey / token)\n- 不引入外部脚本 / CDN\n\n## 可访问性 + 语义化\n- 语义化标签(button / nav / section);图片 alt;交互可键盘聚焦\n- 颜色对比达标;不只用颜色传达信息", Au = "# HTML 片段生成规范\n\n## 代码存储约定(重要)\n- 代码正文写 vfs:html/<name>.html(如 html/landing.html)\n- data 存引用:{ type:'custom', codeRef:'vfs://html/<name>.html', name, props }\n- 改代码:vfs_edit 局部改 vfs 文件(data 的 codeRef 引用不变)\n\n## 输出契约(必须)\n- 输出经 v-html 注入宿主的 HTML 片段:不要 <!DOCTYPE>,不要 <html> / <head> / <body> 外围标签\n- 单根元素包裹(如 <section class=\"hero\">…</section>)\n- 不写 <script>(v-html 注入不执行脚本);交互交宿主页面已有机制\n- 样式用片段内 <style>,class 统一加前缀防冲突(如 .pg-hero-…)\n- 不引入外部脚本 / CDN / 外链样式\n\n## 标签闭合(必须)\n- 非自闭合标签必须成对闭合(<img> / <br> / <input> 等 void 元素除外)\n- 每次生成/修改后调 validate_code 自检,报错用 vfs_edit 修正直到通过\n\n## 何时写代码组件\n- 组件库无对应类型(高度定制布局 / 一次性专题页 / 特殊视觉效果)→ 写 HTML 片段\n- 组件库已有(按钮 / 卡片 / 列表)→ 用现有组件配置,不重造\n\n## 安全底线(必须)\n- 禁 eval / new Function / Function 构造器\n- 禁访问 window 敏感属性(document.cookie / apiKey / token)\n- 不引入外部脚本 / CDN\n\n## 可访问性 + 语义化\n- 语义化标签(button / nav / section);图片 alt;交互可键盘聚焦\n- 颜色对比达标;不只用颜色传达信息", ju = {
|
|
9902
10055
|
name: "html-builder",
|
|
9903
|
-
description: "纯代码组件(custom Vue SFC)生成规范:代码存 vfs+data 引用 / SFC 规范 /
|
|
9904
|
-
getContent: () =>
|
|
10056
|
+
description: "纯代码组件(custom Vue SFC)生成规范:代码存 vfs+data 引用 / SFC 规范 / 输出契约 / props / 组件库引用 / 可访问性",
|
|
10057
|
+
getContent: () => ku
|
|
10058
|
+
}, Mu = {
|
|
10059
|
+
name: "html-fragment",
|
|
10060
|
+
description: "纯 HTML 片段(v-html 注入)生成规范:无外围标签 / 单根元素 / 标签闭合 / validate_code 自检 / 安全底线 / 可访问性",
|
|
10061
|
+
getContent: () => Au
|
|
9905
10062
|
};
|
|
9906
|
-
function
|
|
9907
|
-
let
|
|
10063
|
+
function Nu(e = {}) {
|
|
10064
|
+
let t = e.vfsPrefix ?? "html/";
|
|
10065
|
+
return ({ state: e }) => {
|
|
10066
|
+
let n = e.files;
|
|
10067
|
+
if (!n) return { ok: !0 };
|
|
10068
|
+
let r = [];
|
|
10069
|
+
for (let [e, i] of Object.entries(n)) {
|
|
10070
|
+
if (!e.startsWith(t)) continue;
|
|
10071
|
+
let n = Du(i.content, { sfc: e.endsWith(".vue") });
|
|
10072
|
+
for (let t of n) r.push(`${e} 第 ${t.line} 行:${t.message}(${t.code})`);
|
|
10073
|
+
}
|
|
10074
|
+
return r.length ? {
|
|
10075
|
+
ok: !1,
|
|
10076
|
+
feedback: `HTML 格式校验未通过(共 ${r.length} 处):\n- ${r.join("\n- ")}\n请用 vfs_edit 逐项修正,改完调 validate_code 复查,全部通过后再返回。`
|
|
10077
|
+
} : { ok: !0 };
|
|
10078
|
+
};
|
|
10079
|
+
}
|
|
10080
|
+
function Pu(e) {
|
|
10081
|
+
let n;
|
|
10082
|
+
return {
|
|
10083
|
+
name: "html-validate-tools",
|
|
10084
|
+
beforeAgent: (e) => {
|
|
10085
|
+
n = e.files;
|
|
10086
|
+
},
|
|
10087
|
+
tools: [r(async ({ path: t, content: r }) => {
|
|
10088
|
+
let i = [];
|
|
10089
|
+
if (r !== void 0) i.push({
|
|
10090
|
+
path: t ?? "(传入内容)",
|
|
10091
|
+
content: r
|
|
10092
|
+
});
|
|
10093
|
+
else if (t) {
|
|
10094
|
+
let r = t.replace(/^\/+/, ""), a = n?.[r];
|
|
10095
|
+
if (!a) return `未找到 vfs 文件 "${t}"。先 vfs_ls 查看;代码须写在 ${e} 下。`;
|
|
10096
|
+
i.push({
|
|
10097
|
+
path: r,
|
|
10098
|
+
content: a.content
|
|
10099
|
+
});
|
|
10100
|
+
} else {
|
|
10101
|
+
if (n) for (let [t, r] of Object.entries(n)) t.startsWith(e) && i.push({
|
|
10102
|
+
path: t,
|
|
10103
|
+
content: r.content
|
|
10104
|
+
});
|
|
10105
|
+
if (!i.length) return `${e} 下暂无代码文件,无需校验。`;
|
|
10106
|
+
}
|
|
10107
|
+
let a = [];
|
|
10108
|
+
for (let e of i) {
|
|
10109
|
+
let t = Du(e.content, { sfc: e.path.endsWith(".vue") });
|
|
10110
|
+
t.length && a.push(`${e.path}:\n${t.map((e) => ` 第 ${e.line} 行 ${e.message}(${e.code})`).join("\n")}`);
|
|
10111
|
+
}
|
|
10112
|
+
return a.length ? `❌ 格式校验未通过:\n${a.join("\n")}\n请用 vfs_edit 修正后重新调用 validate_code 复查。` : `✅ 格式校验通过(${i.map((e) => e.path).join(", ")}:标签闭合、片段契约)。`;
|
|
10113
|
+
}, {
|
|
10114
|
+
name: "validate_code",
|
|
10115
|
+
description: "校验 HTML/Vue SFC 代码格式(标签闭合 + v-html 片段契约:无 html/head/body/DOCTYPE 外围、片段无 script)。生成/修改代码后必调;报错修正后复查直到通过。",
|
|
10116
|
+
schema: t.object({
|
|
10117
|
+
path: t.string().optional().describe("vfs 代码文件路径(如 html/hero.vue);省略则校验代码前缀下全部文件"),
|
|
10118
|
+
content: t.string().optional().describe("直接校验的代码内容(优先于 path)")
|
|
10119
|
+
})
|
|
10120
|
+
})]
|
|
10121
|
+
};
|
|
10122
|
+
}
|
|
10123
|
+
var Fu = 2;
|
|
10124
|
+
function Iu(e) {
|
|
10125
|
+
let { writablePaths: t, codeVfsPrefix: n = "html/", id: r = "html", description: i, planning: a = !0, summarization: o = !0, maxToolRounds: s = 12, temperature: c = .4, skills: l, extraTools: u, codeKind: d = "sfc", formatCheck: f = !0 } = e;
|
|
9908
10126
|
if (!t?.length) throw Error("[page-agent-sdk][createHtmlSubagent] writablePaths 必填(代码组件 data 区,如 [\"components\"])");
|
|
9909
|
-
let
|
|
9910
|
-
a &&
|
|
9911
|
-
let
|
|
10127
|
+
let p = [];
|
|
10128
|
+
a && p.push(na()), f && (p.push(Pu(n)), p.push(Ko({ check: Nu({ vfsPrefix: n }) })));
|
|
10129
|
+
let m = u ?? [];
|
|
9912
10130
|
return {
|
|
9913
10131
|
id: r,
|
|
9914
|
-
description: i ?? "生成/修改纯代码组件(custom
|
|
9915
|
-
systemPrompt:
|
|
10132
|
+
description: i ?? "生成/修改纯代码组件(custom 代码)。代码写 vfs,data 存引用;能规划(write_todos)+ 执行。需写代码组件或灵活定制时委派",
|
|
10133
|
+
systemPrompt: Ou(n, d),
|
|
9916
10134
|
writablePaths: t,
|
|
9917
10135
|
allowedTools: [
|
|
9918
10136
|
"vfs_write",
|
|
@@ -9921,17 +10139,18 @@ function Du(e) {
|
|
|
9921
10139
|
"vfs_grep",
|
|
9922
10140
|
"vfs_read"
|
|
9923
10141
|
],
|
|
9924
|
-
middleware:
|
|
10142
|
+
middleware: p.length ? p : void 0,
|
|
9925
10143
|
summarization: o === !1 ? void 0 : o,
|
|
10144
|
+
maxVerifyAttempts: f ? Fu : void 0,
|
|
9926
10145
|
temperature: c,
|
|
9927
|
-
skills: l ?? [
|
|
10146
|
+
skills: l ?? (d === "html" ? [Mu] : [ju]),
|
|
9928
10147
|
maxToolRounds: s,
|
|
9929
|
-
tools:
|
|
10148
|
+
tools: m.length ? m : void 0
|
|
9930
10149
|
};
|
|
9931
10150
|
}
|
|
9932
10151
|
//#endregion
|
|
9933
10152
|
//#region src/core/utils/clipboard.ts
|
|
9934
|
-
async function
|
|
10153
|
+
async function Lu(e) {
|
|
9935
10154
|
try {
|
|
9936
10155
|
let t = globalThis.navigator?.clipboard;
|
|
9937
10156
|
if (t && typeof t.writeText == "function") return await t.writeText(e), !0;
|
|
@@ -9949,12 +10168,12 @@ async function Ou(e) {
|
|
|
9949
10168
|
}
|
|
9950
10169
|
//#endregion
|
|
9951
10170
|
//#region src/core/composables/useChat.ts
|
|
9952
|
-
function
|
|
9953
|
-
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a } = e, o = /* @__PURE__ */
|
|
10171
|
+
function Ru(e = {}) {
|
|
10172
|
+
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a } = e, o = /* @__PURE__ */ gt({
|
|
9954
10173
|
messages: e.messages ?? [],
|
|
9955
10174
|
loading: !1,
|
|
9956
10175
|
error: null
|
|
9957
|
-
}), s = /* @__PURE__ */
|
|
10176
|
+
}), s = /* @__PURE__ */ Ot(null), c = /* @__PURE__ */ Ot(!0), l = null, u = /* @__PURE__ */ Ot([]), d = /* @__PURE__ */ Ot(null);
|
|
9958
10177
|
function f() {}
|
|
9959
10178
|
function p(e) {
|
|
9960
10179
|
let t = s.value;
|
|
@@ -9976,7 +10195,7 @@ function ku(e = {}) {
|
|
|
9976
10195
|
}
|
|
9977
10196
|
async function g(e) {
|
|
9978
10197
|
if (c.value = !0, n) {
|
|
9979
|
-
let t = /* @__PURE__ */
|
|
10198
|
+
let t = /* @__PURE__ */ gt({
|
|
9980
10199
|
role: "assistant",
|
|
9981
10200
|
content: "",
|
|
9982
10201
|
timestamp: Date.now(),
|
|
@@ -10128,29 +10347,29 @@ function ku(e = {}) {
|
|
|
10128
10347
|
}
|
|
10129
10348
|
//#endregion
|
|
10130
10349
|
//#region src/core/composables/chatContext.ts
|
|
10131
|
-
var
|
|
10132
|
-
function
|
|
10133
|
-
let t =
|
|
10350
|
+
var zu = Symbol("chatContext");
|
|
10351
|
+
function Bu(e = {}) {
|
|
10352
|
+
let t = Ru({
|
|
10134
10353
|
fetchResponse: e.fetchResponse,
|
|
10135
10354
|
fetchStream: e.fetchStream,
|
|
10136
10355
|
messages: e.messages,
|
|
10137
10356
|
onPersist: e.onPersist,
|
|
10138
10357
|
onClear: e.onClear,
|
|
10139
10358
|
onQueuedCleared: e.onQueuedCleared
|
|
10140
|
-
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */
|
|
10359
|
+
}), { state: n, sendMessage: r, removeQueuedTask: i, queuedTasks: a } = t, o = /* @__PURE__ */ Ot(""), s = /* @__PURE__ */ Ot(!0), c = () => {
|
|
10141
10360
|
s.value = !s.value;
|
|
10142
|
-
}, l = /* @__PURE__ */
|
|
10361
|
+
}, l = /* @__PURE__ */ Ot(!1), u = () => {
|
|
10143
10362
|
l.value = !0;
|
|
10144
10363
|
}, d = () => {
|
|
10145
10364
|
l.value = !1;
|
|
10146
|
-
}, f = /* @__PURE__ */
|
|
10365
|
+
}, f = /* @__PURE__ */ Ot(!1), p = () => {
|
|
10147
10366
|
f.value = !0;
|
|
10148
10367
|
}, m = () => {
|
|
10149
10368
|
f.value = !1;
|
|
10150
|
-
}, h = /* @__PURE__ */
|
|
10369
|
+
}, h = /* @__PURE__ */ Ot({}), g = (e) => h.value[e] !== !1, _ = (e) => {
|
|
10151
10370
|
h.value[e] = !g(e);
|
|
10152
|
-
}, v = /* @__PURE__ */
|
|
10153
|
-
|
|
10371
|
+
}, v = /* @__PURE__ */ Ot(!1), y = (e) => {
|
|
10372
|
+
Lu(e).then((e) => {
|
|
10154
10373
|
e && (v.value = !0, setTimeout(() => {
|
|
10155
10374
|
v.value = !1;
|
|
10156
10375
|
}, 1500));
|
|
@@ -10218,15 +10437,15 @@ function ju(e = {}) {
|
|
|
10218
10437
|
}
|
|
10219
10438
|
};
|
|
10220
10439
|
}
|
|
10221
|
-
function
|
|
10222
|
-
let e =
|
|
10440
|
+
function Vu() {
|
|
10441
|
+
let e = Fn(zu);
|
|
10223
10442
|
if (!e) throw Error("useChatContext 必须在 provide(chatContextKey) 的组件子树内调用");
|
|
10224
10443
|
return e;
|
|
10225
10444
|
}
|
|
10226
10445
|
//#endregion
|
|
10227
10446
|
//#region src/core/index.headless.ts
|
|
10228
|
-
function
|
|
10447
|
+
function Hu(e) {
|
|
10229
10448
|
return _u(e);
|
|
10230
10449
|
}
|
|
10231
10450
|
//#endregion
|
|
10232
|
-
export { lc as CAPABILITIES, fc as CONTEXT_PRESETS, Cs as CompressDecisionSchema, _s as DEFAULT_SYSTEM_PROMPT, Ja as HUMAN_CONFIRM_TOOL_NAME, ni as MIN_CONTEXT_WINDOW, go as STOP_WORDS, _c as UNSAFE_KEYS, ql as actionsToInspectInfo, Kl as actionsToTools, Yr as agentError, ds as analyzeContext, Dc as applyPatchToClone, Oc as applyPatchToLive, Jr as asAgentError, vs as buildDataPrompt, ys as buildSystemPrompt,
|
|
10451
|
+
export { lc as CAPABILITIES, fc as CONTEXT_PRESETS, Cs as CompressDecisionSchema, _s as DEFAULT_SYSTEM_PROMPT, wu as HTML_VOID_TAGS, Ja as HUMAN_CONFIRM_TOOL_NAME, ni as MIN_CONTEXT_WINDOW, go as STOP_WORDS, _c as UNSAFE_KEYS, ql as actionsToInspectInfo, Kl as actionsToTools, Yr as agentError, ds as analyzeContext, Dc as applyPatchToClone, Oc as applyPatchToLive, Jr as asAgentError, vs as buildDataPrompt, ys as buildSystemPrompt, zu as chatContextKey, El as commitSetToBind, gs as connectMcp, f as constructLlmFromConfig, d as constructOpenLlmSync, Lu as copyText, Fi as createAgent, qa as createApprovalMiddleware, Bu as createChatContext, Hu as createChatSdk, io as createCheckpointManager, ao as createCheckpointMiddleware, Fs as createConflictManager, fs as createContextInspectorMiddleware, Ol as createDataOps, Nu as createHtmlFormatCheck, Iu as createHtmlSubagent, Za as createHumanConfirmMiddleware, Xa as createHumanConfirmTool, nc as createMemoryBackend, Ba as createMemoryMiddleware, u as createProxyLlm, Cu as createRagSubagent, wa as createSandboxRunner, dc as createSdkEvents, uu as createSerialRunner, oc as createSessionStore, ou as createSkillStore, Ho as createSubagentMiddleware, Eo as createSubagentTracker, Go as createSubagentsMiddleware, eu as createUsageHintsMiddleware, Ko as createVerifyMiddleware, Fc as createVfs, ic as createWebStorageBackend, Qo as createWriteBackCheck, Sc as deepClone, Xl as defineDataToolset, Ea as defineSkill, bs as defineTool, xc as deleteByPath, ws as deriveTitle, qi as describeSchemaNode, Ti as detectGarbledToolCall, jc as diffObjects, Pl as domToStructure, Il as domTools, Yl as domToolsStatic, vo as estimateMessageTokens, yo as estimateRoundTokens, X as estimateTokens, m as extractReasoningDelta, fa as extractSchemaHint, ps as extractText, p as extractTextDelta, h as extractUsage, Al as fetchDocTools, Jl as fetchTools, Tl as filterByToolMode, Ji as formatConstraints, Wr as formatZodIssues, Z as getByPath, Fl as getDomTool, zl as getEnvSummary, zi as getSchemaAtPath, Ii as getSchemaTopKeys, oi as getTraceMetrics, $ as hashValue, bo as indexSummarize, Hl as inspectEnvTool, Ul as inspectTools, Ts as isChatModel, gi as isContextLengthError, Li as isPathAllowed, Js as isQuotaError, vc as isUnsafePath, el as jpEval, Kr as jsonParseError, Tc as limitDepth, Cc as maybeParseValue, g as normalizeUsage, ai as offloadPassThroughChars, ii as offloadThresholdChars, sa as presets, Vi as projectBySchema, Bi as projectBySchemaDeep, wc as projectFields, xo as recallRounds, Yi as renderSchemaHint, Xi as renderSchemaOverview, Qi as renderSchemaShallow, uc as resolveCapabilities, mc as resolveContextOptions, cc as resolveDialogConfig, Ps as resolveLlm, ri as resolveModelCaps, sc as resolveStorage, Ac as restoreInPlace, kc as restoreLive, qr as routeError, Ta as runHostScript, il as runSandboxedScript, yc as safeMerge, Rl as safeSerialize, Q as safeStringify, nl as searchJson, Zl as selectBuiltinTools, bc as setByPath, So as shouldTriggerCompression, ca as systemPromptHelpers, _o as tokenize, Y as toolError, Ri as unwrapSchema, Ru as useChat, Vu as useChatContext, Du as validateHtmlFormat, e as z, Gr as zodError };
|