page-agent-sdk 3.22.1 → 3.23.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 +7 -6
- package/README.zh-CN.md +7 -6
- package/dist/page-agent-sdk.headless.js +999 -738
- package/dist/page-agent-sdk.iife.js +148 -146
- package/dist/page-agent-sdk.js +1461 -1180
- package/dist/page-agent-sdk.umd.cjs +46 -44
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +76 -1
|
@@ -172,39 +172,39 @@ var S = () => {}, C = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110
|
|
|
172
172
|
}, D = Object.prototype.hasOwnProperty, O = (e, t) => D.call(e, t), k = Array.isArray, A = (e) => re(e) === "[object Map]", ee = (e) => re(e) === "[object Set]", j = (e) => typeof e == "function", M = (e) => typeof e == "string", te = (e) => typeof e == "symbol", N = (e) => typeof e == "object" && !!e, P = (e) => (N(e) || j(e)) && j(e.then) && j(e.catch), ne = Object.prototype.toString, re = (e) => ne.call(e), ie = (e) => re(e).slice(8, -1), F = (e) => re(e) === "[object Object]", I = (e) => M(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, L = ((e) => {
|
|
173
173
|
let t = /* @__PURE__ */ Object.create(null);
|
|
174
174
|
return ((n) => t[n] || (t[n] = e(n)));
|
|
175
|
-
})((e) => e.charAt(0).toUpperCase() + e.slice(1)),
|
|
175
|
+
})((e) => e.charAt(0).toUpperCase() + e.slice(1)), ae = (e, t) => !Object.is(e, t), oe = (e, t, n, r = !1) => {
|
|
176
176
|
Object.defineProperty(e, t, {
|
|
177
177
|
configurable: !0,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: r,
|
|
180
180
|
value: n
|
|
181
181
|
});
|
|
182
|
-
},
|
|
183
|
-
function
|
|
182
|
+
}, se, ce = () => se ||= typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
183
|
+
function le(e) {
|
|
184
184
|
if (k(e)) {
|
|
185
185
|
let t = {};
|
|
186
186
|
for (let n = 0; n < e.length; n++) {
|
|
187
|
-
let r = e[n], i = M(r) ?
|
|
187
|
+
let r = e[n], i = M(r) ? fe(r) : le(r);
|
|
188
188
|
if (i) for (let e in i) t[e] = i[e];
|
|
189
189
|
}
|
|
190
190
|
return t;
|
|
191
191
|
} else if (M(e) || N(e)) return e;
|
|
192
192
|
}
|
|
193
|
-
var
|
|
194
|
-
function
|
|
193
|
+
var ue = /;(?![^(]*\))/g, de = /:([^]+)/, R = /\/\*[^]*?\*\//g;
|
|
194
|
+
function fe(e) {
|
|
195
195
|
let t = {};
|
|
196
|
-
return e.replace(
|
|
196
|
+
return e.replace(R, "").split(ue).forEach((e) => {
|
|
197
197
|
if (e) {
|
|
198
|
-
let n = e.split(
|
|
198
|
+
let n = e.split(de);
|
|
199
199
|
n.length > 1 && (t[n[0].trim()] = n[1].trim());
|
|
200
200
|
}
|
|
201
201
|
}), t;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function z(e) {
|
|
204
204
|
let t = "";
|
|
205
205
|
if (M(e)) t = e;
|
|
206
206
|
else if (k(e)) for (let n = 0; n < e.length; n++) {
|
|
207
|
-
let r =
|
|
207
|
+
let r = z(e[n]);
|
|
208
208
|
r && (t += r + " ");
|
|
209
209
|
}
|
|
210
210
|
else if (N(e)) for (let n in e) e[n] && (t += n + " ");
|
|
@@ -212,76 +212,76 @@ function B(e) {
|
|
|
212
212
|
}
|
|
213
213
|
//#endregion
|
|
214
214
|
//#region node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js
|
|
215
|
-
function
|
|
215
|
+
function B(e, ...t) {
|
|
216
216
|
console.warn(`[Vue warn] ${e}`, ...t);
|
|
217
217
|
}
|
|
218
|
-
var
|
|
219
|
-
function
|
|
220
|
-
return
|
|
218
|
+
var pe;
|
|
219
|
+
function me() {
|
|
220
|
+
return pe;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
222
|
+
var V, he = /* @__PURE__ */ new WeakSet(), ge = class {
|
|
223
223
|
constructor(e) {
|
|
224
|
-
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,
|
|
224
|
+
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, pe && (pe.active ? pe.effects.push(this) : this.flags &= -2);
|
|
225
225
|
}
|
|
226
226
|
pause() {
|
|
227
227
|
this.flags |= 64;
|
|
228
228
|
}
|
|
229
229
|
resume() {
|
|
230
|
-
this.flags & 64 && (this.flags &= -65,
|
|
230
|
+
this.flags & 64 && (this.flags &= -65, he.has(this) && (he.delete(this), this.trigger()));
|
|
231
231
|
}
|
|
232
232
|
notify() {
|
|
233
|
-
this.flags & 2 && !(this.flags & 32) || this.flags & 8 ||
|
|
233
|
+
this.flags & 2 && !(this.flags & 32) || this.flags & 8 || H(this);
|
|
234
234
|
}
|
|
235
235
|
run() {
|
|
236
236
|
if (!(this.flags & 1)) return this.fn();
|
|
237
|
-
this.flags |= 2,
|
|
238
|
-
let e =
|
|
239
|
-
|
|
237
|
+
this.flags |= 2, Ae(this), Se(this);
|
|
238
|
+
let e = V, t = W;
|
|
239
|
+
V = this, W = !0;
|
|
240
240
|
try {
|
|
241
241
|
return this.fn();
|
|
242
242
|
} finally {
|
|
243
|
-
process.env.NODE_ENV !== "production" &&
|
|
243
|
+
process.env.NODE_ENV !== "production" && V !== this && B("Active effect was not restored correctly - this is likely a Vue internal bug."), Ce(this), V = e, W = t, this.flags &= -3;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
stop() {
|
|
247
247
|
if (this.flags & 1) {
|
|
248
|
-
for (let e = this.deps; e; e = e.nextDep)
|
|
249
|
-
this.deps = this.depsTail = void 0,
|
|
248
|
+
for (let e = this.deps; e; e = e.nextDep) Ee(e);
|
|
249
|
+
this.deps = this.depsTail = void 0, Ae(this), this.onStop && this.onStop(), this.flags &= -2;
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
trigger() {
|
|
253
|
-
this.flags & 64 ?
|
|
253
|
+
this.flags & 64 ? he.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
|
|
254
254
|
}
|
|
255
255
|
runIfDirty() {
|
|
256
|
-
|
|
256
|
+
we(this) && this.run();
|
|
257
257
|
}
|
|
258
258
|
get dirty() {
|
|
259
|
-
return
|
|
259
|
+
return we(this);
|
|
260
260
|
}
|
|
261
|
-
},
|
|
262
|
-
function
|
|
261
|
+
}, _e = 0, ve, ye;
|
|
262
|
+
function H(e, t = !1) {
|
|
263
263
|
if (e.flags |= 8, t) {
|
|
264
|
-
e.next =
|
|
264
|
+
e.next = ye, ye = e;
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
|
-
e.next =
|
|
268
|
-
}
|
|
269
|
-
function ye() {
|
|
270
|
-
ge++;
|
|
267
|
+
e.next = ve, ve = e;
|
|
271
268
|
}
|
|
272
269
|
function be() {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
270
|
+
_e++;
|
|
271
|
+
}
|
|
272
|
+
function xe() {
|
|
273
|
+
if (--_e > 0) return;
|
|
274
|
+
if (ye) {
|
|
275
|
+
let e = ye;
|
|
276
|
+
for (ye = void 0; e;) {
|
|
277
277
|
let t = e.next;
|
|
278
278
|
e.next = void 0, e.flags &= -9, e = t;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
let e;
|
|
282
|
-
for (;
|
|
283
|
-
let t =
|
|
284
|
-
for (
|
|
282
|
+
for (; ve;) {
|
|
283
|
+
let t = ve;
|
|
284
|
+
for (ve = void 0; t;) {
|
|
285
285
|
let n = t.next;
|
|
286
286
|
if (t.next = void 0, t.flags &= -9, t.flags & 1) try {
|
|
287
287
|
t.trigger();
|
|
@@ -293,127 +293,127 @@ function be() {
|
|
|
293
293
|
}
|
|
294
294
|
if (e) throw e;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Se(e) {
|
|
297
297
|
for (let t = e.deps; t; t = t.nextDep) t.version = -1, t.prevActiveLink = t.dep.activeLink, t.dep.activeLink = t;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Ce(e) {
|
|
300
300
|
let t, n = e.depsTail, r = n;
|
|
301
301
|
for (; r;) {
|
|
302
302
|
let e = r.prevDep;
|
|
303
|
-
r.version === -1 ? (r === n && (n = e),
|
|
303
|
+
r.version === -1 ? (r === n && (n = e), Ee(r), U(r)) : t = r, r.dep.activeLink = r.prevActiveLink, r.prevActiveLink = void 0, r = e;
|
|
304
304
|
}
|
|
305
305
|
e.deps = t, e.depsTail = n;
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (
|
|
307
|
+
function we(e) {
|
|
308
|
+
for (let t = e.deps; t; t = t.nextDep) if (t.dep.version !== t.version || t.dep.computed && (Te(t.dep.computed) || t.dep.version !== t.version)) return !0;
|
|
309
309
|
return !!e._dirty;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion ===
|
|
311
|
+
function Te(e) {
|
|
312
|
+
if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion === je) || (e.globalVersion = je, !e.isSSR && e.flags & 128 && (!e.deps && !e._dirty || !we(e)))) return;
|
|
313
313
|
e.flags |= 2;
|
|
314
|
-
let t = e.dep, n =
|
|
315
|
-
|
|
314
|
+
let t = e.dep, n = V, r = W;
|
|
315
|
+
V = e, W = !0;
|
|
316
316
|
try {
|
|
317
|
-
|
|
317
|
+
Se(e);
|
|
318
318
|
let n = e.fn(e._value);
|
|
319
|
-
(t.version === 0 ||
|
|
319
|
+
(t.version === 0 || ae(n, e._value)) && (e.flags |= 128, e._value = n, t.version++);
|
|
320
320
|
} catch (e) {
|
|
321
321
|
throw t.version++, e;
|
|
322
322
|
} finally {
|
|
323
|
-
|
|
323
|
+
V = n, W = r, Ce(e), e.flags &= -3;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Ee(e, t = !1) {
|
|
327
327
|
let { dep: n, prevSub: r, nextSub: i } = e;
|
|
328
328
|
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)) {
|
|
329
329
|
n.computed.flags &= -5;
|
|
330
|
-
for (let e = n.computed.deps; e; e = e.nextDep)
|
|
330
|
+
for (let e = n.computed.deps; e; e = e.nextDep) Ee(e, !0);
|
|
331
331
|
}
|
|
332
332
|
!t && !--n.sc && n.map && n.map.delete(n.key);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function U(e) {
|
|
335
335
|
let { prevDep: t, nextDep: n } = e;
|
|
336
336
|
t && (t.nextDep = n, e.prevDep = void 0), n && (n.prevDep = t, e.nextDep = void 0);
|
|
337
337
|
}
|
|
338
|
-
var
|
|
339
|
-
function De() {
|
|
340
|
-
Ee.push(G), G = !1;
|
|
341
|
-
}
|
|
338
|
+
var W = !0, De = [];
|
|
342
339
|
function Oe() {
|
|
343
|
-
|
|
344
|
-
|
|
340
|
+
De.push(W), W = !1;
|
|
341
|
+
}
|
|
342
|
+
function ke() {
|
|
343
|
+
let e = De.pop();
|
|
344
|
+
W = e === void 0 || e;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ae(e) {
|
|
347
347
|
let { cleanup: t } = e;
|
|
348
348
|
if (e.cleanup = void 0, t) {
|
|
349
|
-
let e =
|
|
350
|
-
|
|
349
|
+
let e = V;
|
|
350
|
+
V = void 0;
|
|
351
351
|
try {
|
|
352
352
|
t();
|
|
353
353
|
} finally {
|
|
354
|
-
|
|
354
|
+
V = e;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
var
|
|
358
|
+
var je = 0, Me = class {
|
|
359
359
|
constructor(e, t) {
|
|
360
360
|
this.sub = e, this.dep = t, this.version = t.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
|
|
361
361
|
}
|
|
362
|
-
},
|
|
362
|
+
}, Ne = class {
|
|
363
363
|
constructor(e) {
|
|
364
364
|
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);
|
|
365
365
|
}
|
|
366
366
|
track(e) {
|
|
367
|
-
if (!
|
|
367
|
+
if (!V || !W || V === this.computed) return;
|
|
368
368
|
let t = this.activeLink;
|
|
369
|
-
if (t === void 0 || t.sub !==
|
|
369
|
+
if (t === void 0 || t.sub !== V) t = this.activeLink = new Me(V, this), V.deps ? (t.prevDep = V.depsTail, V.depsTail.nextDep = t, V.depsTail = t) : V.deps = V.depsTail = t, Pe(t);
|
|
370
370
|
else if (t.version === -1 && (t.version = this.version, t.nextDep)) {
|
|
371
371
|
let e = t.nextDep;
|
|
372
|
-
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep =
|
|
372
|
+
e.prevDep = t.prevDep, t.prevDep && (t.prevDep.nextDep = e), t.prevDep = V.depsTail, t.nextDep = void 0, V.depsTail.nextDep = t, V.depsTail = t, V.deps === t && (V.deps = e);
|
|
373
373
|
}
|
|
374
|
-
return process.env.NODE_ENV !== "production" &&
|
|
374
|
+
return process.env.NODE_ENV !== "production" && V.onTrack && V.onTrack(T({ effect: V }, e)), t;
|
|
375
375
|
}
|
|
376
376
|
trigger(e) {
|
|
377
|
-
this.version++,
|
|
377
|
+
this.version++, je++, this.notify(e);
|
|
378
378
|
}
|
|
379
379
|
notify(e) {
|
|
380
|
-
|
|
380
|
+
be();
|
|
381
381
|
try {
|
|
382
382
|
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(T({ effect: t.sub }, e));
|
|
383
383
|
for (let e = this.subs; e; e = e.prevSub) e.sub.notify() && e.sub.dep.notify();
|
|
384
384
|
} finally {
|
|
385
|
-
|
|
385
|
+
xe();
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
};
|
|
389
|
-
function
|
|
389
|
+
function Pe(e) {
|
|
390
390
|
if (e.dep.sc++, e.sub.flags & 4) {
|
|
391
391
|
let t = e.dep.computed;
|
|
392
392
|
if (t && !e.dep.subs) {
|
|
393
393
|
t.flags |= 20;
|
|
394
|
-
for (let e = t.deps; e; e = e.nextDep)
|
|
394
|
+
for (let e = t.deps; e; e = e.nextDep) Pe(e);
|
|
395
395
|
}
|
|
396
396
|
let n = e.dep.subs;
|
|
397
397
|
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;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
var
|
|
401
|
-
function
|
|
402
|
-
if (
|
|
403
|
-
let r =
|
|
404
|
-
r ||
|
|
400
|
+
var Fe = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Object iterate"), Le = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Map keys iterate"), Re = /* @__PURE__ */ Symbol(process.env.NODE_ENV === "production" ? "" : "Array iterate");
|
|
401
|
+
function ze(e, t, n) {
|
|
402
|
+
if (W && V) {
|
|
403
|
+
let r = Fe.get(e);
|
|
404
|
+
r || Fe.set(e, r = /* @__PURE__ */ new Map());
|
|
405
405
|
let i = r.get(n);
|
|
406
|
-
i || (r.set(n, i = new
|
|
406
|
+
i || (r.set(n, i = new Ne()), i.map = r, i.key = n), process.env.NODE_ENV === "production" ? i.track() : i.track({
|
|
407
407
|
target: e,
|
|
408
408
|
type: t,
|
|
409
409
|
key: n
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
414
|
-
let o =
|
|
413
|
+
function Be(e, t, n, r, i, a) {
|
|
414
|
+
let o = Fe.get(e);
|
|
415
415
|
if (!o) {
|
|
416
|
-
|
|
416
|
+
je++;
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
419
|
let s = (o) => {
|
|
@@ -426,173 +426,173 @@ function Re(e, t, n, r, i, a) {
|
|
|
426
426
|
oldTarget: a
|
|
427
427
|
}));
|
|
428
428
|
};
|
|
429
|
-
if (
|
|
429
|
+
if (be(), t === "clear") o.forEach(s);
|
|
430
430
|
else {
|
|
431
431
|
let i = k(e), a = i && I(n);
|
|
432
432
|
if (i && n === "length") {
|
|
433
433
|
let e = Number(r);
|
|
434
434
|
o.forEach((t, n) => {
|
|
435
|
-
(n === "length" || n ===
|
|
435
|
+
(n === "length" || n === Re || !te(n) && n >= e) && s(t);
|
|
436
436
|
});
|
|
437
|
-
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(
|
|
437
|
+
} else switch ((n !== void 0 || o.has(void 0)) && s(o.get(n)), a && s(o.get(Re)), t) {
|
|
438
438
|
case "add":
|
|
439
|
-
i ? a && s(o.get("length")) : (s(o.get(
|
|
439
|
+
i ? a && s(o.get("length")) : (s(o.get(Ie)), A(e) && s(o.get(Le)));
|
|
440
440
|
break;
|
|
441
441
|
case "delete":
|
|
442
|
-
i || (s(o.get(
|
|
442
|
+
i || (s(o.get(Ie)), A(e) && s(o.get(Le)));
|
|
443
443
|
break;
|
|
444
444
|
case "set":
|
|
445
|
-
A(e) && s(o.get(
|
|
445
|
+
A(e) && s(o.get(Ie));
|
|
446
446
|
break;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
|
|
449
|
+
xe();
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
let t = /* @__PURE__ */
|
|
453
|
-
return t === e ? t : (
|
|
451
|
+
function Ve(e) {
|
|
452
|
+
let t = /* @__PURE__ */ q(e);
|
|
453
|
+
return t === e ? t : (ze(t, "iterate", Re), /* @__PURE__ */ K(e) ? t : t.map(Ot));
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return
|
|
455
|
+
function He(e) {
|
|
456
|
+
return ze(e = /* @__PURE__ */ q(e), "iterate", Re), e;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
return /* @__PURE__ */
|
|
458
|
+
function Ue(e, t) {
|
|
459
|
+
return /* @__PURE__ */ Tt(e) ? J(/* @__PURE__ */ wt(e) ? Ot(t) : t) : Ot(t);
|
|
460
460
|
}
|
|
461
|
-
var
|
|
461
|
+
var We = {
|
|
462
462
|
__proto__: null,
|
|
463
463
|
[Symbol.iterator]() {
|
|
464
|
-
return
|
|
464
|
+
return Ge(this, Symbol.iterator, (e) => Ue(this, e));
|
|
465
465
|
},
|
|
466
466
|
concat(...e) {
|
|
467
|
-
return
|
|
467
|
+
return Ve(this).concat(...e.map((e) => k(e) ? Ve(e) : e));
|
|
468
468
|
},
|
|
469
469
|
entries() {
|
|
470
|
-
return
|
|
470
|
+
return Ge(this, "entries", (e) => (e[1] = Ue(this, e[1]), e));
|
|
471
471
|
},
|
|
472
472
|
every(e, t) {
|
|
473
|
-
return
|
|
473
|
+
return qe(this, "every", e, t, void 0, arguments);
|
|
474
474
|
},
|
|
475
475
|
filter(e, t) {
|
|
476
|
-
return
|
|
476
|
+
return qe(this, "filter", e, t, (e) => e.map((e) => Ue(this, e)), arguments);
|
|
477
477
|
},
|
|
478
478
|
find(e, t) {
|
|
479
|
-
return
|
|
479
|
+
return qe(this, "find", e, t, (e) => Ue(this, e), arguments);
|
|
480
480
|
},
|
|
481
481
|
findIndex(e, t) {
|
|
482
|
-
return
|
|
482
|
+
return qe(this, "findIndex", e, t, void 0, arguments);
|
|
483
483
|
},
|
|
484
484
|
findLast(e, t) {
|
|
485
|
-
return
|
|
485
|
+
return qe(this, "findLast", e, t, (e) => Ue(this, e), arguments);
|
|
486
486
|
},
|
|
487
487
|
findLastIndex(e, t) {
|
|
488
|
-
return
|
|
488
|
+
return qe(this, "findLastIndex", e, t, void 0, arguments);
|
|
489
489
|
},
|
|
490
490
|
forEach(e, t) {
|
|
491
|
-
return
|
|
491
|
+
return qe(this, "forEach", e, t, void 0, arguments);
|
|
492
492
|
},
|
|
493
493
|
includes(...e) {
|
|
494
|
-
return
|
|
494
|
+
return Ye(this, "includes", e);
|
|
495
495
|
},
|
|
496
496
|
indexOf(...e) {
|
|
497
|
-
return
|
|
497
|
+
return Ye(this, "indexOf", e);
|
|
498
498
|
},
|
|
499
499
|
join(e) {
|
|
500
|
-
return
|
|
500
|
+
return Ve(this).join(e);
|
|
501
501
|
},
|
|
502
502
|
lastIndexOf(...e) {
|
|
503
|
-
return
|
|
503
|
+
return Ye(this, "lastIndexOf", e);
|
|
504
504
|
},
|
|
505
505
|
map(e, t) {
|
|
506
|
-
return
|
|
506
|
+
return qe(this, "map", e, t, void 0, arguments);
|
|
507
507
|
},
|
|
508
508
|
pop() {
|
|
509
|
-
return
|
|
509
|
+
return Xe(this, "pop");
|
|
510
510
|
},
|
|
511
511
|
push(...e) {
|
|
512
|
-
return
|
|
512
|
+
return Xe(this, "push", e);
|
|
513
513
|
},
|
|
514
514
|
reduce(e, ...t) {
|
|
515
|
-
return
|
|
515
|
+
return Je(this, "reduce", e, t);
|
|
516
516
|
},
|
|
517
517
|
reduceRight(e, ...t) {
|
|
518
|
-
return
|
|
518
|
+
return Je(this, "reduceRight", e, t);
|
|
519
519
|
},
|
|
520
520
|
shift() {
|
|
521
|
-
return
|
|
521
|
+
return Xe(this, "shift");
|
|
522
522
|
},
|
|
523
523
|
some(e, t) {
|
|
524
|
-
return
|
|
524
|
+
return qe(this, "some", e, t, void 0, arguments);
|
|
525
525
|
},
|
|
526
526
|
splice(...e) {
|
|
527
|
-
return
|
|
527
|
+
return Xe(this, "splice", e);
|
|
528
528
|
},
|
|
529
529
|
toReversed() {
|
|
530
|
-
return
|
|
530
|
+
return Ve(this).toReversed();
|
|
531
531
|
},
|
|
532
532
|
toSorted(e) {
|
|
533
|
-
return
|
|
533
|
+
return Ve(this).toSorted(e);
|
|
534
534
|
},
|
|
535
535
|
toSpliced(...e) {
|
|
536
|
-
return
|
|
536
|
+
return Ve(this).toSpliced(...e);
|
|
537
537
|
},
|
|
538
538
|
unshift(...e) {
|
|
539
|
-
return
|
|
539
|
+
return Xe(this, "unshift", e);
|
|
540
540
|
},
|
|
541
541
|
values() {
|
|
542
|
-
return
|
|
542
|
+
return Ge(this, "values", (e) => Ue(this, e));
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
function
|
|
546
|
-
let r =
|
|
547
|
-
return r !== e && !/* @__PURE__ */
|
|
545
|
+
function Ge(e, t, n) {
|
|
546
|
+
let r = He(e), i = r[t]();
|
|
547
|
+
return r !== e && !/* @__PURE__ */ K(e) && (i._next = i.next, i.next = () => {
|
|
548
548
|
let e = i._next();
|
|
549
549
|
return e.done || (e.value = n(e.value)), e;
|
|
550
550
|
}), i;
|
|
551
551
|
}
|
|
552
|
-
var
|
|
553
|
-
function
|
|
554
|
-
let o =
|
|
555
|
-
if (c !==
|
|
552
|
+
var Ke = Array.prototype;
|
|
553
|
+
function qe(e, t, n, r, i, a) {
|
|
554
|
+
let o = He(e), s = o !== e && !/* @__PURE__ */ K(e), c = o[t];
|
|
555
|
+
if (c !== Ke[t]) {
|
|
556
556
|
let t = c.apply(e, a);
|
|
557
|
-
return s ?
|
|
557
|
+
return s ? Ot(t) : t;
|
|
558
558
|
}
|
|
559
559
|
let l = n;
|
|
560
560
|
o !== e && (s ? l = function(t, r) {
|
|
561
|
-
return n.call(this,
|
|
561
|
+
return n.call(this, Ue(e, t), r, e);
|
|
562
562
|
} : n.length > 2 && (l = function(t, r) {
|
|
563
563
|
return n.call(this, t, r, e);
|
|
564
564
|
}));
|
|
565
565
|
let u = c.call(o, l, r);
|
|
566
566
|
return s && i ? i(u) : u;
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
let i =
|
|
568
|
+
function Je(e, t, n, r) {
|
|
569
|
+
let i = He(e), a = i !== e && !/* @__PURE__ */ K(e), o = n, s = !1;
|
|
570
570
|
i !== e && (a ? (s = r.length === 0, o = function(t, r, i) {
|
|
571
|
-
return s && (s = !1, t =
|
|
571
|
+
return s && (s = !1, t = Ue(e, t)), n.call(this, t, Ue(e, r), i, e);
|
|
572
572
|
}) : n.length > 3 && (o = function(t, r, i) {
|
|
573
573
|
return n.call(this, t, r, i, e);
|
|
574
574
|
}));
|
|
575
575
|
let c = i[t](o, ...r);
|
|
576
|
-
return s ?
|
|
576
|
+
return s ? Ue(e, c) : c;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
579
|
-
let r = /* @__PURE__ */
|
|
580
|
-
|
|
578
|
+
function Ye(e, t, n) {
|
|
579
|
+
let r = /* @__PURE__ */ q(e);
|
|
580
|
+
ze(r, "iterate", Re);
|
|
581
581
|
let i = r[t](...n);
|
|
582
|
-
return (i === -1 || i === !1) && /* @__PURE__ */
|
|
582
|
+
return (i === -1 || i === !1) && /* @__PURE__ */ Et(n[0]) ? (n[0] = /* @__PURE__ */ q(n[0]), r[t](...n)) : i;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
|
|
586
|
-
let r = (/* @__PURE__ */
|
|
587
|
-
return
|
|
584
|
+
function Xe(e, t, n = []) {
|
|
585
|
+
Oe(), be();
|
|
586
|
+
let r = (/* @__PURE__ */ q(e))[t].apply(e, n);
|
|
587
|
+
return xe(), ke(), r;
|
|
588
588
|
}
|
|
589
|
-
var
|
|
590
|
-
function
|
|
589
|
+
var Ze = /* @__PURE__ */ b("__proto__,__v_isRef,__isVue"), Qe = new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(te));
|
|
590
|
+
function $e(e) {
|
|
591
591
|
te(e) || (e = String(e));
|
|
592
|
-
let t = /* @__PURE__ */
|
|
593
|
-
return
|
|
592
|
+
let t = /* @__PURE__ */ q(this);
|
|
593
|
+
return ze(t, "has", e), t.hasOwnProperty(e);
|
|
594
594
|
}
|
|
595
|
-
var
|
|
595
|
+
var et = class {
|
|
596
596
|
constructor(e = !1, t = !1) {
|
|
597
597
|
this._isReadonly = e, this._isShallow = t;
|
|
598
598
|
}
|
|
@@ -602,60 +602,60 @@ var Qe = class {
|
|
|
602
602
|
if (t === "__v_isReactive") return !r;
|
|
603
603
|
if (t === "__v_isReadonly") return r;
|
|
604
604
|
if (t === "__v_isShallow") return i;
|
|
605
|
-
if (t === "__v_raw") return n === (r ? i ?
|
|
605
|
+
if (t === "__v_raw") return n === (r ? i ? vt : _t : i ? gt : ht).get(e) || Object.getPrototypeOf(e) === Object.getPrototypeOf(n) ? e : void 0;
|
|
606
606
|
let a = k(e);
|
|
607
607
|
if (!r) {
|
|
608
608
|
let e;
|
|
609
|
-
if (a && (e =
|
|
610
|
-
if (t === "hasOwnProperty") return
|
|
609
|
+
if (a && (e = We[t])) return e;
|
|
610
|
+
if (t === "hasOwnProperty") return $e;
|
|
611
611
|
}
|
|
612
612
|
let o = Reflect.get(e, t, /* @__PURE__ */ kt(e) ? e : n);
|
|
613
|
-
if ((te(t) ?
|
|
613
|
+
if ((te(t) ? Qe.has(t) : Ze(t)) || (r || ze(e, "get", t), i)) return o;
|
|
614
614
|
if (/* @__PURE__ */ kt(o)) {
|
|
615
615
|
let e = a && I(t) ? o : o.value;
|
|
616
|
-
return r && N(e) ? /* @__PURE__ */
|
|
616
|
+
return r && N(e) ? /* @__PURE__ */ xt(e) : e;
|
|
617
617
|
}
|
|
618
|
-
return N(o) ? r ? /* @__PURE__ */
|
|
618
|
+
return N(o) ? r ? /* @__PURE__ */ xt(o) : /* @__PURE__ */ bt(o) : o;
|
|
619
619
|
}
|
|
620
|
-
},
|
|
620
|
+
}, tt = class extends et {
|
|
621
621
|
constructor(e = !1) {
|
|
622
622
|
super(!1, e);
|
|
623
623
|
}
|
|
624
624
|
set(e, t, n, r) {
|
|
625
625
|
let i = e[t], a = k(e) && I(t);
|
|
626
626
|
if (!this._isShallow) {
|
|
627
|
-
let r = /* @__PURE__ */
|
|
628
|
-
if (!/* @__PURE__ */
|
|
627
|
+
let r = /* @__PURE__ */ Tt(i);
|
|
628
|
+
if (!/* @__PURE__ */ K(n) && !/* @__PURE__ */ Tt(n) && (i = /* @__PURE__ */ q(i), n = /* @__PURE__ */ q(n)), !a && /* @__PURE__ */ kt(i) && !/* @__PURE__ */ kt(n)) return r ? (process.env.NODE_ENV !== "production" && B(`Set operation on key "${String(t)}" failed: target is readonly.`, e[t]), !0) : (i.value = n, !0);
|
|
629
629
|
}
|
|
630
630
|
let o = a ? Number(t) < e.length : O(e, t), s = Reflect.set(e, t, n, /* @__PURE__ */ kt(e) ? e : r);
|
|
631
|
-
return e === /* @__PURE__ */
|
|
631
|
+
return e === /* @__PURE__ */ q(r) && s && (o ? ae(n, i) && Be(e, "set", t, n, i) : Be(e, "add", t, n)), s;
|
|
632
632
|
}
|
|
633
633
|
deleteProperty(e, t) {
|
|
634
634
|
let n = O(e, t), r = e[t], i = Reflect.deleteProperty(e, t);
|
|
635
|
-
return i && n &&
|
|
635
|
+
return i && n && Be(e, "delete", t, void 0, r), i;
|
|
636
636
|
}
|
|
637
637
|
has(e, t) {
|
|
638
638
|
let n = Reflect.has(e, t);
|
|
639
|
-
return (!te(t) || !
|
|
639
|
+
return (!te(t) || !Qe.has(t)) && ze(e, "has", t), n;
|
|
640
640
|
}
|
|
641
641
|
ownKeys(e) {
|
|
642
|
-
return
|
|
642
|
+
return ze(e, "iterate", k(e) ? "length" : Ie), Reflect.ownKeys(e);
|
|
643
643
|
}
|
|
644
|
-
},
|
|
644
|
+
}, nt = class extends et {
|
|
645
645
|
constructor(e = !1) {
|
|
646
646
|
super(!0, e);
|
|
647
647
|
}
|
|
648
648
|
set(e, t) {
|
|
649
|
-
return process.env.NODE_ENV !== "production" &&
|
|
649
|
+
return process.env.NODE_ENV !== "production" && B(`Set operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
650
650
|
}
|
|
651
651
|
deleteProperty(e, t) {
|
|
652
|
-
return process.env.NODE_ENV !== "production" &&
|
|
652
|
+
return process.env.NODE_ENV !== "production" && B(`Delete operation on key "${String(t)}" failed: target is readonly.`, e), !0;
|
|
653
653
|
}
|
|
654
|
-
},
|
|
655
|
-
function
|
|
654
|
+
}, rt = /* @__PURE__ */ new tt(), it = /* @__PURE__ */ new nt(), at = /* @__PURE__ */ new nt(!0), ot = (e) => e, G = (e) => Reflect.getPrototypeOf(e);
|
|
655
|
+
function st(e, t, n) {
|
|
656
656
|
return function(...r) {
|
|
657
|
-
let i = this.__v_raw, a = /* @__PURE__ */
|
|
658
|
-
return !t &&
|
|
657
|
+
let i = this.__v_raw, a = /* @__PURE__ */ q(i), o = A(a), s = e === "entries" || e === Symbol.iterator && o, c = e === "keys" && o, l = i[e](...r), u = n ? ot : t ? J : Ot;
|
|
658
|
+
return !t && ze(a, "iterate", c ? Le : Ie), T(Object.create(l), { next() {
|
|
659
659
|
let { value: e, done: t } = l.next();
|
|
660
660
|
return t ? {
|
|
661
661
|
value: e,
|
|
@@ -667,64 +667,64 @@ function at(e, t, n) {
|
|
|
667
667
|
} });
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function ct(e) {
|
|
671
671
|
return function(...t) {
|
|
672
672
|
if (process.env.NODE_ENV !== "production") {
|
|
673
673
|
let n = t[0] ? `on key "${t[0]}" ` : "";
|
|
674
|
-
|
|
674
|
+
B(`${L(e)} operation ${n}failed: target is readonly.`, /* @__PURE__ */ q(this));
|
|
675
675
|
}
|
|
676
676
|
return e === "delete" ? !1 : e === "clear" ? void 0 : this;
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function lt(e, t) {
|
|
680
680
|
let n = {
|
|
681
681
|
get(n) {
|
|
682
|
-
let r = this.__v_raw, i = /* @__PURE__ */
|
|
683
|
-
e || (
|
|
684
|
-
let { has: o } =
|
|
682
|
+
let r = this.__v_raw, i = /* @__PURE__ */ q(r), a = /* @__PURE__ */ q(n);
|
|
683
|
+
e || (ae(n, a) && ze(i, "get", n), ze(i, "get", a));
|
|
684
|
+
let { has: o } = G(i), s = t ? ot : e ? J : Ot;
|
|
685
685
|
if (o.call(i, n)) return s(r.get(n));
|
|
686
686
|
if (o.call(i, a)) return s(r.get(a));
|
|
687
687
|
r !== i && r.get(n);
|
|
688
688
|
},
|
|
689
689
|
get size() {
|
|
690
690
|
let t = this.__v_raw;
|
|
691
|
-
return !e &&
|
|
691
|
+
return !e && ze(/* @__PURE__ */ q(t), "iterate", Ie), t.size;
|
|
692
692
|
},
|
|
693
693
|
has(t) {
|
|
694
|
-
let n = this.__v_raw, r = /* @__PURE__ */
|
|
695
|
-
return e || (
|
|
694
|
+
let n = this.__v_raw, r = /* @__PURE__ */ q(n), i = /* @__PURE__ */ q(t);
|
|
695
|
+
return e || (ae(t, i) && ze(r, "has", t), ze(r, "has", i)), t === i ? n.has(t) : n.has(t) || n.has(i);
|
|
696
696
|
},
|
|
697
697
|
forEach(n, r) {
|
|
698
|
-
let i = this, a = i.__v_raw, o = /* @__PURE__ */
|
|
699
|
-
return !e &&
|
|
698
|
+
let i = this, a = i.__v_raw, o = /* @__PURE__ */ q(a), s = t ? ot : e ? J : Ot;
|
|
699
|
+
return !e && ze(o, "iterate", Ie), a.forEach((e, t) => n.call(r, s(e), s(t), i));
|
|
700
700
|
}
|
|
701
701
|
};
|
|
702
702
|
return T(n, e ? {
|
|
703
|
-
add:
|
|
704
|
-
set:
|
|
705
|
-
delete:
|
|
706
|
-
clear:
|
|
703
|
+
add: ct("add"),
|
|
704
|
+
set: ct("set"),
|
|
705
|
+
delete: ct("delete"),
|
|
706
|
+
clear: ct("clear")
|
|
707
707
|
} : {
|
|
708
708
|
add(e) {
|
|
709
|
-
let n = /* @__PURE__ */
|
|
710
|
-
return r.has.call(n, a) ||
|
|
709
|
+
let n = /* @__PURE__ */ q(this), r = G(n), i = /* @__PURE__ */ q(e), a = !t && !/* @__PURE__ */ K(e) && !/* @__PURE__ */ Tt(e) ? i : e;
|
|
710
|
+
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), Be(n, "add", a, a)), this;
|
|
711
711
|
},
|
|
712
712
|
set(e, n) {
|
|
713
|
-
!t && !/* @__PURE__ */
|
|
714
|
-
let r = /* @__PURE__ */
|
|
715
|
-
o ? process.env.NODE_ENV !== "production" &&
|
|
713
|
+
!t && !/* @__PURE__ */ K(n) && !/* @__PURE__ */ Tt(n) && (n = /* @__PURE__ */ q(n));
|
|
714
|
+
let r = /* @__PURE__ */ q(this), { has: i, get: a } = G(r), o = i.call(r, e);
|
|
715
|
+
o ? process.env.NODE_ENV !== "production" && mt(r, i, e) : (e = /* @__PURE__ */ q(e), o = i.call(r, e));
|
|
716
716
|
let s = a.call(r, e);
|
|
717
|
-
return r.set(e, n), o ?
|
|
717
|
+
return r.set(e, n), o ? ae(n, s) && Be(r, "set", e, n, s) : Be(r, "add", e, n), this;
|
|
718
718
|
},
|
|
719
719
|
delete(e) {
|
|
720
|
-
let t = /* @__PURE__ */
|
|
721
|
-
i ? process.env.NODE_ENV !== "production" &&
|
|
720
|
+
let t = /* @__PURE__ */ q(this), { has: n, get: r } = G(t), i = n.call(t, e);
|
|
721
|
+
i ? process.env.NODE_ENV !== "production" && mt(t, n, e) : (e = /* @__PURE__ */ q(e), i = n.call(t, e));
|
|
722
722
|
let a = r ? r.call(t, e) : void 0, o = t.delete(e);
|
|
723
|
-
return i &&
|
|
723
|
+
return i && Be(t, "delete", e, void 0, a), o;
|
|
724
724
|
},
|
|
725
725
|
clear() {
|
|
726
|
-
let e = /* @__PURE__ */
|
|
727
|
-
return t &&
|
|
726
|
+
let e = /* @__PURE__ */ q(this), t = e.size !== 0, n = process.env.NODE_ENV === "production" ? void 0 : A(e) ? new Map(e) : new Set(e), r = e.clear();
|
|
727
|
+
return t && Be(e, "clear", void 0, void 0, n), r;
|
|
728
728
|
}
|
|
729
729
|
}), [
|
|
730
730
|
"keys",
|
|
@@ -732,23 +732,23 @@ function st(e, t) {
|
|
|
732
732
|
"entries",
|
|
733
733
|
Symbol.iterator
|
|
734
734
|
].forEach((r) => {
|
|
735
|
-
n[r] =
|
|
735
|
+
n[r] = st(r, e, t);
|
|
736
736
|
}), n;
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
let n =
|
|
738
|
+
function ut(e, t) {
|
|
739
|
+
let n = lt(e, t);
|
|
740
740
|
return (t, r, i) => r === "__v_isReactive" ? !e : r === "__v_isReadonly" ? e : r === "__v_raw" ? t : Reflect.get(O(n, r) && r in t ? n : t, r, i);
|
|
741
741
|
}
|
|
742
|
-
var
|
|
743
|
-
function
|
|
744
|
-
let r = /* @__PURE__ */
|
|
742
|
+
var dt = { get: /* @__PURE__ */ ut(!1, !1) }, ft = { get: /* @__PURE__ */ ut(!0, !1) }, pt = { get: /* @__PURE__ */ ut(!0, !0) };
|
|
743
|
+
function mt(e, t, n) {
|
|
744
|
+
let r = /* @__PURE__ */ q(n);
|
|
745
745
|
if (r !== n && t.call(e, r)) {
|
|
746
746
|
let t = ie(e);
|
|
747
|
-
|
|
747
|
+
B(`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.`);
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
var
|
|
751
|
-
function
|
|
750
|
+
var ht = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap();
|
|
751
|
+
function yt(e) {
|
|
752
752
|
switch (e) {
|
|
753
753
|
case "Object":
|
|
754
754
|
case "Array": return 1;
|
|
@@ -760,52 +760,52 @@ function _t(e) {
|
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
762
|
// @__NO_SIDE_EFFECTS__
|
|
763
|
-
function
|
|
764
|
-
return /* @__PURE__ */
|
|
763
|
+
function bt(e) {
|
|
764
|
+
return /* @__PURE__ */ Tt(e) ? e : Ct(e, !1, rt, dt, ht);
|
|
765
765
|
}
|
|
766
766
|
// @__NO_SIDE_EFFECTS__
|
|
767
|
-
function
|
|
768
|
-
return
|
|
767
|
+
function xt(e) {
|
|
768
|
+
return Ct(e, !0, it, ft, _t);
|
|
769
769
|
}
|
|
770
770
|
// @__NO_SIDE_EFFECTS__
|
|
771
|
-
function
|
|
772
|
-
return
|
|
771
|
+
function St(e) {
|
|
772
|
+
return Ct(e, !0, at, pt, vt);
|
|
773
773
|
}
|
|
774
|
-
function
|
|
775
|
-
if (!N(e)) return process.env.NODE_ENV !== "production" &&
|
|
774
|
+
function Ct(e, t, n, r, i) {
|
|
775
|
+
if (!N(e)) return process.env.NODE_ENV !== "production" && B(`value cannot be made ${t ? "readonly" : "reactive"}: ${String(e)}`), e;
|
|
776
776
|
if (e.__v_raw && !(t && e.__v_isReactive) || e.__v_skip || !Object.isExtensible(e)) return e;
|
|
777
777
|
let a = i.get(e);
|
|
778
778
|
if (a) return a;
|
|
779
|
-
let o =
|
|
779
|
+
let o = yt(ie(e));
|
|
780
780
|
if (o === 0) return e;
|
|
781
781
|
let s = new Proxy(e, o === 2 ? r : n);
|
|
782
782
|
return i.set(e, s), s;
|
|
783
783
|
}
|
|
784
784
|
// @__NO_SIDE_EFFECTS__
|
|
785
|
-
function
|
|
786
|
-
return /* @__PURE__ */
|
|
785
|
+
function wt(e) {
|
|
786
|
+
return /* @__PURE__ */ Tt(e) ? /* @__PURE__ */ wt(e.__v_raw) : !!(e && e.__v_isReactive);
|
|
787
787
|
}
|
|
788
788
|
// @__NO_SIDE_EFFECTS__
|
|
789
|
-
function
|
|
789
|
+
function Tt(e) {
|
|
790
790
|
return !!(e && e.__v_isReadonly);
|
|
791
791
|
}
|
|
792
792
|
// @__NO_SIDE_EFFECTS__
|
|
793
|
-
function
|
|
793
|
+
function K(e) {
|
|
794
794
|
return !!(e && e.__v_isShallow);
|
|
795
795
|
}
|
|
796
796
|
// @__NO_SIDE_EFFECTS__
|
|
797
|
-
function
|
|
797
|
+
function Et(e) {
|
|
798
798
|
return e ? !!e.__v_raw : !1;
|
|
799
799
|
}
|
|
800
800
|
// @__NO_SIDE_EFFECTS__
|
|
801
|
-
function
|
|
801
|
+
function q(e) {
|
|
802
802
|
let t = e && e.__v_raw;
|
|
803
|
-
return t ? /* @__PURE__ */
|
|
803
|
+
return t ? /* @__PURE__ */ q(t) : e;
|
|
804
804
|
}
|
|
805
|
-
function
|
|
806
|
-
return !O(e, "__v_skip") && Object.isExtensible(e) &&
|
|
805
|
+
function Dt(e) {
|
|
806
|
+
return !O(e, "__v_skip") && Object.isExtensible(e) && oe(e, "__v_skip", !0), e;
|
|
807
807
|
}
|
|
808
|
-
var
|
|
808
|
+
var Ot = (e) => N(e) ? /* @__PURE__ */ bt(e) : e, J = (e) => N(e) ? /* @__PURE__ */ xt(e) : e;
|
|
809
809
|
// @__NO_SIDE_EFFECTS__
|
|
810
810
|
function kt(e) {
|
|
811
811
|
return e ? e.__v_isRef === !0 : !1;
|
|
@@ -823,7 +823,7 @@ function Mt(e, t) {
|
|
|
823
823
|
}
|
|
824
824
|
var Nt = class {
|
|
825
825
|
constructor(e, t) {
|
|
826
|
-
this.dep = new
|
|
826
|
+
this.dep = new Ne(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = t ? e : /* @__PURE__ */ q(e), this._value = t ? e : Ot(e), this.__v_isShallow = t;
|
|
827
827
|
}
|
|
828
828
|
get value() {
|
|
829
829
|
return process.env.NODE_ENV === "production" ? this.dep.track() : this.dep.track({
|
|
@@ -833,8 +833,8 @@ var Nt = class {
|
|
|
833
833
|
}), this._value;
|
|
834
834
|
}
|
|
835
835
|
set value(e) {
|
|
836
|
-
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */
|
|
837
|
-
e = n ? e : /* @__PURE__ */
|
|
836
|
+
let t = this._rawValue, n = this.__v_isShallow || /* @__PURE__ */ K(e) || /* @__PURE__ */ Tt(e);
|
|
837
|
+
e = n ? e : /* @__PURE__ */ q(e), ae(e, t) && (this._rawValue = e, this._value = n ? e : Ot(e), process.env.NODE_ENV === "production" ? this.dep.trigger() : this.dep.trigger({
|
|
838
838
|
target: this,
|
|
839
839
|
type: "set",
|
|
840
840
|
key: "value",
|
|
@@ -862,14 +862,14 @@ var It = {
|
|
|
862
862
|
}
|
|
863
863
|
};
|
|
864
864
|
function Lt(e) {
|
|
865
|
-
return /* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ wt(e) ? e : new Proxy(e, It);
|
|
866
866
|
}
|
|
867
867
|
var Rt = class {
|
|
868
868
|
constructor(e, t, n) {
|
|
869
|
-
this.fn = e, this.setter = t, this._value = void 0, this.dep = new
|
|
869
|
+
this.fn = e, this.setter = t, this._value = void 0, this.dep = new Ne(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = je - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !t, this.isSSR = n;
|
|
870
870
|
}
|
|
871
871
|
notify() {
|
|
872
|
-
if (this.flags |= 16, !(this.flags & 8) &&
|
|
872
|
+
if (this.flags |= 16, !(this.flags & 8) && V !== this) return H(this, !0), !0;
|
|
873
873
|
process.env.NODE_ENV;
|
|
874
874
|
}
|
|
875
875
|
get value() {
|
|
@@ -878,10 +878,10 @@ var Rt = class {
|
|
|
878
878
|
type: "get",
|
|
879
879
|
key: "value"
|
|
880
880
|
});
|
|
881
|
-
return
|
|
881
|
+
return Te(this), e && (e.version = this.dep.version), this._value;
|
|
882
882
|
}
|
|
883
883
|
set value(e) {
|
|
884
|
-
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" &&
|
|
884
|
+
this.setter ? this.setter(e) : process.env.NODE_ENV !== "production" && B("Write operation failed: computed value is readonly");
|
|
885
885
|
}
|
|
886
886
|
};
|
|
887
887
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -896,24 +896,24 @@ function Ut(e, t = !1, n = Ht) {
|
|
|
896
896
|
if (n) {
|
|
897
897
|
let t = Vt.get(n);
|
|
898
898
|
t || Vt.set(n, t = []), t.push(e);
|
|
899
|
-
} else process.env.NODE_ENV !== "production" && !t &&
|
|
899
|
+
} else process.env.NODE_ENV !== "production" && !t && B("onWatcherCleanup() was called when there was no active watcher to associate with.");
|
|
900
900
|
}
|
|
901
901
|
function Wt(e, t, n = x) {
|
|
902
902
|
let { immediate: r, deep: i, once: a, scheduler: o, augmentJob: s, call: c } = n, l = (e) => {
|
|
903
|
-
(n.onWarn ||
|
|
904
|
-
}, u = (e) => i ? e : /* @__PURE__ */
|
|
905
|
-
if (/* @__PURE__ */ kt(e) ? (f = () => e.value, h = /* @__PURE__ */
|
|
903
|
+
(n.onWarn || B)("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.");
|
|
904
|
+
}, u = (e) => i ? e : /* @__PURE__ */ K(e) || i === !1 || i === 0 ? Gt(e, 1) : Gt(e), d, f, p, m, h = !1, g = !1;
|
|
905
|
+
if (/* @__PURE__ */ kt(e) ? (f = () => e.value, h = /* @__PURE__ */ K(e)) : /* @__PURE__ */ wt(e) ? (f = () => u(e), h = !0) : k(e) ? (g = !0, h = e.some((e) => /* @__PURE__ */ wt(e) || /* @__PURE__ */ K(e)), f = () => e.map((e) => {
|
|
906
906
|
if (/* @__PURE__ */ kt(e)) return e.value;
|
|
907
|
-
if (/* @__PURE__ */
|
|
907
|
+
if (/* @__PURE__ */ wt(e)) return u(e);
|
|
908
908
|
if (j(e)) return c ? c(e, 2) : e();
|
|
909
909
|
process.env.NODE_ENV !== "production" && l(e);
|
|
910
910
|
})) : j(e) ? f = t ? c ? () => c(e, 2) : e : () => {
|
|
911
911
|
if (p) {
|
|
912
|
-
|
|
912
|
+
Oe();
|
|
913
913
|
try {
|
|
914
914
|
p();
|
|
915
915
|
} finally {
|
|
916
|
-
|
|
916
|
+
ke();
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
919
|
let t = Ht;
|
|
@@ -927,7 +927,7 @@ function Wt(e, t, n = x) {
|
|
|
927
927
|
let e = f, t = i === !0 ? Infinity : i;
|
|
928
928
|
f = () => Gt(e(), t);
|
|
929
929
|
}
|
|
930
|
-
let _ =
|
|
930
|
+
let _ = me(), v = () => {
|
|
931
931
|
d.stop(), _ && _.active && E(_.effects, d);
|
|
932
932
|
};
|
|
933
933
|
if (a && t) {
|
|
@@ -940,7 +940,7 @@ function Wt(e, t, n = x) {
|
|
|
940
940
|
let y = g ? Array(e.length).fill(Bt) : Bt, b = (e) => {
|
|
941
941
|
if (!(!(d.flags & 1) || !d.dirty && !e)) if (t) {
|
|
942
942
|
let n = d.run();
|
|
943
|
-
if (e || i || h || (g ? n.some((e, t) =>
|
|
943
|
+
if (e || i || h || (g ? n.some((e, t) => ae(e, y[t])) : ae(n, y))) {
|
|
944
944
|
p && p();
|
|
945
945
|
let e = Ht;
|
|
946
946
|
Ht = d;
|
|
@@ -957,7 +957,7 @@ function Wt(e, t, n = x) {
|
|
|
957
957
|
}
|
|
958
958
|
} else d.run();
|
|
959
959
|
};
|
|
960
|
-
return s && s(b), d = new
|
|
960
|
+
return s && s(b), d = new ge(f), d.scheduler = o ? () => o(b, !1) : b, m = (e) => Ut(e, !1, d), p = d.onStop = () => {
|
|
961
961
|
let e = Vt.get(d);
|
|
962
962
|
if (e) {
|
|
963
963
|
if (c) c(e, 4);
|
|
@@ -991,7 +991,7 @@ function Jt() {
|
|
|
991
991
|
var Yt = !1;
|
|
992
992
|
function Xt(e, ...t) {
|
|
993
993
|
if (Yt) return;
|
|
994
|
-
Yt = !0,
|
|
994
|
+
Yt = !0, Oe();
|
|
995
995
|
let n = Kt.length ? Kt[Kt.length - 1].component : null, r = n && n.appContext.config.warnHandler, i = Zt();
|
|
996
996
|
if (r) rn(r, n, 11, [
|
|
997
997
|
e + t.map((e) => e.toString?.call(e) ?? JSON.stringify(e)).join(""),
|
|
@@ -1003,7 +1003,7 @@ function Xt(e, ...t) {
|
|
|
1003
1003
|
let n = [`[Vue warn]: ${e}`, ...t];
|
|
1004
1004
|
i.length && n.push("\n", ...Qt(i)), console.warn(...n);
|
|
1005
1005
|
}
|
|
1006
|
-
|
|
1006
|
+
ke(), Yt = !1;
|
|
1007
1007
|
}
|
|
1008
1008
|
function Zt() {
|
|
1009
1009
|
let e = Kt[Kt.length - 1];
|
|
@@ -1041,11 +1041,11 @@ function en(e) {
|
|
|
1041
1041
|
}), n.length > 3 && t.push(" ..."), t;
|
|
1042
1042
|
}
|
|
1043
1043
|
function tn(e, t, n) {
|
|
1044
|
-
return M(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ kt(t) ? (t = tn(e, /* @__PURE__ */
|
|
1044
|
+
return M(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : /* @__PURE__ */ kt(t) ? (t = tn(e, /* @__PURE__ */ q(t.value), !0), n ? t : [
|
|
1045
1045
|
`${e}=Ref<`,
|
|
1046
1046
|
t,
|
|
1047
1047
|
">"
|
|
1048
|
-
]) : j(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */
|
|
1048
|
+
]) : j(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = /* @__PURE__ */ q(t), n ? t : [`${e}=`, t]);
|
|
1049
1049
|
}
|
|
1050
1050
|
var nn = {
|
|
1051
1051
|
sp: "serverPrefetch hook",
|
|
@@ -1112,11 +1112,11 @@ function on(e, t, n, r = !0) {
|
|
|
1112
1112
|
r = r.parent;
|
|
1113
1113
|
}
|
|
1114
1114
|
if (a) {
|
|
1115
|
-
|
|
1115
|
+
Oe(), rn(a, null, 10, [
|
|
1116
1116
|
e,
|
|
1117
1117
|
i,
|
|
1118
1118
|
o
|
|
1119
|
-
]),
|
|
1119
|
+
]), ke();
|
|
1120
1120
|
return;
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
@@ -1198,7 +1198,7 @@ function wn(e, t) {
|
|
|
1198
1198
|
return e.set(t, n + 1), !1;
|
|
1199
1199
|
}
|
|
1200
1200
|
var Tn = /* @__PURE__ */ new Map();
|
|
1201
|
-
process.env.NODE_ENV !== "production" && (
|
|
1201
|
+
process.env.NODE_ENV !== "production" && (ce().__VUE_HMR_RUNTIME__ = {
|
|
1202
1202
|
createRecord: Mn(Dn),
|
|
1203
1203
|
rerender: Mn(kn),
|
|
1204
1204
|
reload: Mn(An)
|
|
@@ -1317,15 +1317,15 @@ var Wn = (e) => e.__isTeleport;
|
|
|
1317
1317
|
function Gn(e, t) {
|
|
1318
1318
|
e.shapeFlag & 6 && e.component ? (e.transition = t, Gn(e.component.subTree, t)) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
|
|
1319
1319
|
}
|
|
1320
|
-
|
|
1320
|
+
ce().requestIdleCallback, ce().cancelIdleCallback;
|
|
1321
1321
|
var Kn = /* @__PURE__ */ Symbol.for("v-ndc"), qn = (e) => e ? Ir(e) ? Rr(e) : qn(e.parent) : null, Jn = /* @__PURE__ */ T(/* @__PURE__ */ Object.create(null), {
|
|
1322
1322
|
$: (e) => e,
|
|
1323
1323
|
$el: (e) => e.vnode.el,
|
|
1324
1324
|
$data: (e) => e.data,
|
|
1325
|
-
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */
|
|
1326
|
-
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */
|
|
1327
|
-
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */
|
|
1328
|
-
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */
|
|
1325
|
+
$props: (e) => process.env.NODE_ENV === "production" ? e.props : /* @__PURE__ */ St(e.props),
|
|
1326
|
+
$attrs: (e) => process.env.NODE_ENV === "production" ? e.attrs : /* @__PURE__ */ St(e.attrs),
|
|
1327
|
+
$slots: (e) => process.env.NODE_ENV === "production" ? e.slots : /* @__PURE__ */ St(e.slots),
|
|
1328
|
+
$refs: (e) => process.env.NODE_ENV === "production" ? e.refs : /* @__PURE__ */ St(e.refs),
|
|
1329
1329
|
$parent: (e) => qn(e.parent),
|
|
1330
1330
|
$root: (e) => qn(e.root),
|
|
1331
1331
|
$host: (e) => e.ce,
|
|
@@ -1356,7 +1356,7 @@ var Kn = /* @__PURE__ */ Symbol.for("v-ndc"), qn = (e) => e ? Ir(e) ? Rr(e) : qn
|
|
|
1356
1356
|
else Qn && (o[t] = 0);
|
|
1357
1357
|
}
|
|
1358
1358
|
let l = Jn[t], u, d;
|
|
1359
|
-
if (l) return t === "$attrs" ? (
|
|
1359
|
+
if (l) return t === "$attrs" ? (ze(e.attrs, "get", ""), process.env.NODE_ENV) : process.env.NODE_ENV !== "production" && t === "$slots" && ze(e, "get", t), l(e);
|
|
1360
1360
|
if ((u = s.__cssModules) && (u = u[t])) return u;
|
|
1361
1361
|
if (n !== x && O(n, t)) return o[t] = 4, n[t];
|
|
1362
1362
|
if (d = c.config.globalProperties, O(d, t)) return d[t];
|
|
@@ -1510,13 +1510,13 @@ function Tr(e, t = null, n = null, r = 0, i = null, a = !1) {
|
|
|
1510
1510
|
if (Ur(e) && (e = e.__vccOpts), t) {
|
|
1511
1511
|
t = Er(t);
|
|
1512
1512
|
let { class: e, style: n } = t;
|
|
1513
|
-
e && !M(e) && (t.class =
|
|
1513
|
+
e && !M(e) && (t.class = z(e)), N(n) && (/* @__PURE__ */ Et(n) && !k(n) && (n = T({}, n)), t.style = le(n));
|
|
1514
1514
|
}
|
|
1515
1515
|
let o = M(e) ? 1 : pr(e) ? 128 : Wn(e) ? 64 : N(e) ? 4 : j(e) ? 2 : 0;
|
|
1516
|
-
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */
|
|
1516
|
+
return process.env.NODE_ENV !== "production" && o & 4 && /* @__PURE__ */ Et(e) && (e = /* @__PURE__ */ q(e), Xt("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)), Cr(e, t, n, r, i, o, a, !0);
|
|
1517
1517
|
}
|
|
1518
1518
|
function Er(e) {
|
|
1519
|
-
return e ? /* @__PURE__ */
|
|
1519
|
+
return e ? /* @__PURE__ */ Et(e) || dr(e) ? T({}, e) : e : null;
|
|
1520
1520
|
}
|
|
1521
1521
|
function Dr(e, t, n = !1, r = !1) {
|
|
1522
1522
|
let { props: i, ref: a, patchFlag: o, children: s, transition: c } = e, l = t ? jr(i || {}, t) : i, u = {
|
|
@@ -1584,8 +1584,8 @@ function jr(...e) {
|
|
|
1584
1584
|
let t = {};
|
|
1585
1585
|
for (let n = 0; n < e.length; n++) {
|
|
1586
1586
|
let r = e[n];
|
|
1587
|
-
for (let e in r) if (e === "class") t.class !== r.class && (t.class =
|
|
1588
|
-
else if (e === "style") t.style =
|
|
1587
|
+
for (let e in r) if (e === "class") t.class !== r.class && (t.class = z([t.class, r.class]));
|
|
1588
|
+
else if (e === "style") t.style = le([t.style, r.style]);
|
|
1589
1589
|
else if (C(e)) {
|
|
1590
1590
|
let n = t[e], i = r[e];
|
|
1591
1591
|
i && n !== i && !(k(n) && n.includes(i)) ? t[e] = n ? [].concat(n, i) : i : i == null && n == null && !w(e) && (t[e] = i);
|
|
@@ -1595,7 +1595,7 @@ function jr(...e) {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
var Mr = null, Nr = () => Mr || In, Pr;
|
|
1597
1597
|
{
|
|
1598
|
-
let e =
|
|
1598
|
+
let e = ce(), t = (t, n) => {
|
|
1599
1599
|
let r;
|
|
1600
1600
|
return (r = e[t]) || (r = e[t] = []), r.push(n), (e) => {
|
|
1601
1601
|
r.length > 1 ? r.forEach((t) => t(e)) : r[0](e);
|
|
@@ -1615,7 +1615,7 @@ function Ir(e) {
|
|
|
1615
1615
|
var Lr = !1;
|
|
1616
1616
|
process.env.NODE_ENV;
|
|
1617
1617
|
function Rr(e) {
|
|
1618
|
-
return e.exposed ? e.exposeProxy ||= new Proxy(Lt(
|
|
1618
|
+
return e.exposed ? e.exposeProxy ||= new Proxy(Lt(Dt(e.exposed)), {
|
|
1619
1619
|
get(t, n) {
|
|
1620
1620
|
if (n in t) return t[n];
|
|
1621
1621
|
if (n in Jn) return Jn[n](e);
|
|
@@ -1666,9 +1666,9 @@ function Gr() {
|
|
|
1666
1666
|
"VueInstance"
|
|
1667
1667
|
];
|
|
1668
1668
|
if (/* @__PURE__ */ kt(t)) {
|
|
1669
|
-
|
|
1669
|
+
Oe();
|
|
1670
1670
|
let n = t.value;
|
|
1671
|
-
return
|
|
1671
|
+
return ke(), [
|
|
1672
1672
|
"div",
|
|
1673
1673
|
{},
|
|
1674
1674
|
[
|
|
@@ -1680,25 +1680,25 @@ function Gr() {
|
|
|
1680
1680
|
s(n),
|
|
1681
1681
|
">"
|
|
1682
1682
|
];
|
|
1683
|
-
} else if (/* @__PURE__ */
|
|
1683
|
+
} else if (/* @__PURE__ */ wt(t)) return [
|
|
1684
1684
|
"div",
|
|
1685
1685
|
{},
|
|
1686
1686
|
[
|
|
1687
1687
|
"span",
|
|
1688
1688
|
e,
|
|
1689
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ K(t) ? "ShallowReactive" : "Reactive"
|
|
1690
1690
|
],
|
|
1691
1691
|
"<",
|
|
1692
1692
|
s(t),
|
|
1693
|
-
`>${/* @__PURE__ */
|
|
1693
|
+
`>${/* @__PURE__ */ Tt(t) ? " (readonly)" : ""}`
|
|
1694
1694
|
];
|
|
1695
|
-
else if (/* @__PURE__ */
|
|
1695
|
+
else if (/* @__PURE__ */ Tt(t)) return [
|
|
1696
1696
|
"div",
|
|
1697
1697
|
{},
|
|
1698
1698
|
[
|
|
1699
1699
|
"span",
|
|
1700
1700
|
e,
|
|
1701
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ K(t) ? "ShallowReadonly" : "Readonly"
|
|
1702
1702
|
],
|
|
1703
1703
|
"<",
|
|
1704
1704
|
s(t),
|
|
@@ -1719,7 +1719,7 @@ function Gr() {
|
|
|
1719
1719
|
};
|
|
1720
1720
|
function a(e) {
|
|
1721
1721
|
let t = [];
|
|
1722
|
-
e.type.props && e.props && t.push(o("props", /* @__PURE__ */
|
|
1722
|
+
e.type.props && e.props && t.push(o("props", /* @__PURE__ */ q(e.props))), e.setupState !== x && t.push(o("setup", e.setupState)), e.data !== x && t.push(o("data", /* @__PURE__ */ q(e.data)));
|
|
1723
1723
|
let n = c(e, "computed");
|
|
1724
1724
|
n && t.push(o("computed", n));
|
|
1725
1725
|
let i = c(e, "inject");
|
|
@@ -1772,7 +1772,7 @@ function Gr() {
|
|
|
1772
1772
|
"span",
|
|
1773
1773
|
r,
|
|
1774
1774
|
e
|
|
1775
|
-
] : N(e) ? ["object", { object: i ? /* @__PURE__ */
|
|
1775
|
+
] : N(e) ? ["object", { object: i ? /* @__PURE__ */ q(e) : e }] : [
|
|
1776
1776
|
"span",
|
|
1777
1777
|
n,
|
|
1778
1778
|
String(e)
|
|
@@ -1790,7 +1790,7 @@ function Gr() {
|
|
|
1790
1790
|
if (k(r) && r.includes(t) || N(r) && t in r || e.extends && l(e.extends, t, n) || e.mixins && e.mixins.some((e) => l(e, t, n))) return !0;
|
|
1791
1791
|
}
|
|
1792
1792
|
function u(e) {
|
|
1793
|
-
return /* @__PURE__ */
|
|
1793
|
+
return /* @__PURE__ */ K(e) ? "ShallowRef" : e.effect ? "ComputedRef" : "Ref";
|
|
1794
1794
|
}
|
|
1795
1795
|
window.devtoolsFormatters ? window.devtoolsFormatters.push(i) : window.devtoolsFormatters = [i];
|
|
1796
1796
|
}
|
|
@@ -2403,13 +2403,13 @@ function Wi(e) {
|
|
|
2403
2403
|
};
|
|
2404
2404
|
I.value.push(n), I.value.length > Ri && I.value.splice(0, I.value.length - Ri), Pt(I), A?.(n), te && console.log(`%c[Agent] ${e}`, "color:#667eea;font-weight:bold", t);
|
|
2405
2405
|
}
|
|
2406
|
-
let
|
|
2406
|
+
let ae = (e) => {
|
|
2407
2407
|
I.value.push(e), I.value.length > Ri && I.value.splice(0, I.value.length - Ri), Pt(I);
|
|
2408
|
-
},
|
|
2409
|
-
function
|
|
2410
|
-
if (!
|
|
2408
|
+
}, oe = /* @__PURE__ */ jt([]), se = 0, ce = !!ee || !!j;
|
|
2409
|
+
function le(e, t, n, r = {}) {
|
|
2410
|
+
if (!ce) return null;
|
|
2411
2411
|
let i = {
|
|
2412
|
-
id: `span-${++
|
|
2412
|
+
id: `span-${++se}`,
|
|
2413
2413
|
parentId: e,
|
|
2414
2414
|
name: n,
|
|
2415
2415
|
type: t,
|
|
@@ -2417,12 +2417,12 @@ function Wi(e) {
|
|
|
2417
2417
|
status: "ok",
|
|
2418
2418
|
attributes: r
|
|
2419
2419
|
};
|
|
2420
|
-
return
|
|
2420
|
+
return oe.value.push(i), oe.value.length > Ri && oe.value.splice(0, oe.value.length - Ri), Pt(oe), i;
|
|
2421
2421
|
}
|
|
2422
|
-
function
|
|
2423
|
-
!e || !
|
|
2422
|
+
function ue(e, t = "ok", n) {
|
|
2423
|
+
!e || !ce || (e.endTs = Date.now(), e.durationMs = e.endTs - e.startTs, e.status = t, n && Object.assign(e.attributes, n), Pt(oe), ee?.(e));
|
|
2424
2424
|
}
|
|
2425
|
-
let
|
|
2425
|
+
let de = [...x.flatMap((e) => e.tools || []), ...b], R = e.llm ?? new n({
|
|
2426
2426
|
apiKey: t,
|
|
2427
2427
|
model: c,
|
|
2428
2428
|
temperature: l,
|
|
@@ -2433,44 +2433,44 @@ function Wi(e) {
|
|
|
2433
2433
|
...m
|
|
2434
2434
|
},
|
|
2435
2435
|
...p ? { modelKwargs: p } : {}
|
|
2436
|
-
}),
|
|
2437
|
-
function
|
|
2438
|
-
|
|
2436
|
+
}), fe = de.length > 0 ? R.bindTools?.(de) ?? R : R;
|
|
2437
|
+
function z() {
|
|
2438
|
+
fe = de.length > 0 ? R.bindTools?.(de) ?? R : R;
|
|
2439
2439
|
}
|
|
2440
|
-
let
|
|
2441
|
-
function
|
|
2440
|
+
let B = ui(), pe = .25, me = /* @__PURE__ */ new Set(["mission", "workingMemory"]);
|
|
2441
|
+
function V() {
|
|
2442
2442
|
let e = v || "你是一个智能助手。", t = [];
|
|
2443
2443
|
for (let e of x) if (e.augmentPrompt) {
|
|
2444
|
-
let n = e.augmentPrompt(
|
|
2444
|
+
let n = e.augmentPrompt(B);
|
|
2445
2445
|
n && t.push({
|
|
2446
2446
|
name: e.name,
|
|
2447
2447
|
text: n,
|
|
2448
2448
|
tokens: X(n),
|
|
2449
|
-
pin:
|
|
2449
|
+
pin: me.has(e.name)
|
|
2450
2450
|
});
|
|
2451
2451
|
}
|
|
2452
|
-
let n = Math.max(2e3, Math.round(P.contextWindow *
|
|
2452
|
+
let n = Math.max(2e3, Math.round(P.contextWindow * pe)), r = X(e) + t.reduce((e, t) => e + t.tokens, 0);
|
|
2453
2453
|
if (r > n) {
|
|
2454
2454
|
let e = r, i = [];
|
|
2455
2455
|
for (let e of t.filter((e) => !e.pin).sort((e, t) => t.tokens - e.tokens)) {
|
|
2456
2456
|
if (r <= n) break;
|
|
2457
2457
|
i.push(`${e.name}(${e.tokens})`), r -= e.tokens, e.text = "";
|
|
2458
2458
|
}
|
|
2459
|
-
i.length && console.warn(`[page-agent-sdk] 系统段超预算(${e} > ${n} tokens,窗口 ${P.contextWindow} 的 ${
|
|
2459
|
+
i.length && console.warn(`[page-agent-sdk] 系统段超预算(${e} > ${n} tokens,窗口 ${P.contextWindow} 的 ${pe * 100}%),drop 非核心段:${i.join(", ")}(保 base/mission/workingMemory)`);
|
|
2460
2460
|
}
|
|
2461
2461
|
return [e, ...t.filter((e) => e.text).map((e) => e.text)].join("\n\n");
|
|
2462
2462
|
}
|
|
2463
|
-
function
|
|
2464
|
-
let t = [new o(
|
|
2463
|
+
function he(e) {
|
|
2464
|
+
let t = [new o(V())];
|
|
2465
2465
|
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));
|
|
2466
2466
|
return t;
|
|
2467
2467
|
}
|
|
2468
|
-
function
|
|
2469
|
-
let t = e[0] &&
|
|
2470
|
-
return [new o(
|
|
2468
|
+
function ge(e) {
|
|
2469
|
+
let t = e[0] && ye(e[0]) === "system" ? e.slice(1) : e.slice();
|
|
2470
|
+
return [new o(V()), ...t];
|
|
2471
2471
|
}
|
|
2472
|
-
async function
|
|
2473
|
-
let a = r ??
|
|
2472
|
+
async function _e(e, t, n, r) {
|
|
2473
|
+
let a = r ?? fe, o = {
|
|
2474
2474
|
signal: n,
|
|
2475
2475
|
maxRetries: w,
|
|
2476
2476
|
baseDelayMs: T,
|
|
@@ -2508,14 +2508,14 @@ function Wi(e) {
|
|
|
2508
2508
|
};
|
|
2509
2509
|
if (yi(a) && !e._ctxRetry) {
|
|
2510
2510
|
e._ctxRetry = !0;
|
|
2511
|
-
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 =
|
|
2511
|
+
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 = H(e.messages, Math.round(P.contextWindow * .3)), s = o.reduce((e, t) => e + i(t), 0);
|
|
2512
2512
|
return L("error", {
|
|
2513
2513
|
stage: "context_overflow_retry",
|
|
2514
2514
|
at: "launch",
|
|
2515
2515
|
beforeTokens: a,
|
|
2516
2516
|
afterTokens: s,
|
|
2517
2517
|
window: P.contextWindow
|
|
2518
|
-
}), console.warn(`[page-agent-sdk] 上下文超限(启动)→ 激进 trim 重试:${a} → ${s} tokens`),
|
|
2518
|
+
}), console.warn(`[page-agent-sdk] 上下文超限(启动)→ 激进 trim 重试:${a} → ${s} tokens`), _e({
|
|
2519
2519
|
...e,
|
|
2520
2520
|
messages: o
|
|
2521
2521
|
}, t, n, r);
|
|
@@ -2557,13 +2557,13 @@ function Wi(e) {
|
|
|
2557
2557
|
};
|
|
2558
2558
|
if (yi(a) && l === null && u === "" && !e._ctxRetry) {
|
|
2559
2559
|
e._ctxRetry = !0;
|
|
2560
|
-
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 =
|
|
2560
|
+
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 = H(e.messages, Math.round(P.contextWindow * .3)), s = o.reduce((e, t) => e + i(t), 0);
|
|
2561
2561
|
return L("error", {
|
|
2562
2562
|
stage: "context_overflow_retry",
|
|
2563
2563
|
beforeTokens: a,
|
|
2564
2564
|
afterTokens: s,
|
|
2565
2565
|
window: P.contextWindow
|
|
2566
|
-
}), console.warn(`[page-agent-sdk] 上下文超限 → 激进 trim 重试:${a} → ${s} tokens(窗口 ${P.contextWindow})`),
|
|
2566
|
+
}), console.warn(`[page-agent-sdk] 上下文超限 → 激进 trim 重试:${a} → ${s} tokens(窗口 ${P.contextWindow})`), _e({
|
|
2567
2567
|
...e,
|
|
2568
2568
|
messages: o
|
|
2569
2569
|
}, t, n, r);
|
|
@@ -2577,8 +2577,8 @@ function Wi(e) {
|
|
|
2577
2577
|
content: u
|
|
2578
2578
|
};
|
|
2579
2579
|
}
|
|
2580
|
-
async function
|
|
2581
|
-
let t =
|
|
2580
|
+
async function ve(e) {
|
|
2581
|
+
let t = de.find((t) => t.name === e.name);
|
|
2582
2582
|
if (!t) return {
|
|
2583
2583
|
content: `工具 "${e.name}" 不存在`,
|
|
2584
2584
|
status: "error"
|
|
@@ -2590,7 +2590,7 @@ function Wi(e) {
|
|
|
2590
2590
|
}, r = await t.invoke(e.args, { configurable: n }), i = typeof r == "string" ? r : JSON.stringify(r);
|
|
2591
2591
|
return i = ti(i, {
|
|
2592
2592
|
files: e.state.files,
|
|
2593
|
-
vfsAvailable:
|
|
2593
|
+
vfsAvailable: de.some((e) => e.name === "vfs_read"),
|
|
2594
2594
|
toolName: e.name,
|
|
2595
2595
|
threshold: re,
|
|
2596
2596
|
passThroughChars: ie
|
|
@@ -2605,15 +2605,15 @@ function Wi(e) {
|
|
|
2605
2605
|
};
|
|
2606
2606
|
}
|
|
2607
2607
|
}
|
|
2608
|
-
function
|
|
2608
|
+
function ye(e) {
|
|
2609
2609
|
return e instanceof a ? "human" : e instanceof i ? "ai" : e instanceof o ? "system" : e instanceof s ? "tool" : "unknown";
|
|
2610
2610
|
}
|
|
2611
|
-
function
|
|
2611
|
+
function H(e, t) {
|
|
2612
2612
|
return Bi(e, t);
|
|
2613
2613
|
}
|
|
2614
|
-
function
|
|
2614
|
+
function be(e) {
|
|
2615
2615
|
return !te && !A ? [] : e.map((e) => {
|
|
2616
|
-
let t =
|
|
2616
|
+
let t = ye(e), n = { role: t === "human" ? "user" : t === "ai" ? "assistant" : t }, r = typeof e.content == "string" ? e.content : JSON.stringify(e.content);
|
|
2617
2617
|
r && (n.content = r.length > zi ? r.slice(0, zi) + `…(截断 ${r.length - zi} 字符)` : r);
|
|
2618
2618
|
let i = e.tool_calls;
|
|
2619
2619
|
Array.isArray(i) && i.length && (n.tool_calls = i.map((e) => ({
|
|
@@ -2628,20 +2628,20 @@ function Wi(e) {
|
|
|
2628
2628
|
return a && (n.tool_call_id = a), n;
|
|
2629
2629
|
});
|
|
2630
2630
|
}
|
|
2631
|
-
async function
|
|
2632
|
-
I.value = [],
|
|
2631
|
+
async function xe(e, t, n) {
|
|
2632
|
+
I.value = [], oe.value = [], se = 0, B = ui(), B.messages = e, B = await xi(x, B);
|
|
2633
2633
|
let r = e;
|
|
2634
2634
|
for (let e of x) if (e.compressInput) {
|
|
2635
|
-
let t =
|
|
2636
|
-
r = Array.isArray(n) ? n : n.messages, n && !Array.isArray(n) && n.stats ? (
|
|
2637
|
-
...
|
|
2635
|
+
let t = le(void 0, "compression", `compress:${e.name}`, {}), n = await e.compressInput(r);
|
|
2636
|
+
r = Array.isArray(n) ? n : n.messages, n && !Array.isArray(n) && n.stats ? (B = {
|
|
2637
|
+
...B,
|
|
2638
2638
|
lastCompression: n.stats
|
|
2639
|
-
},
|
|
2639
|
+
}, ue(t, "ok", { stats: n.stats })) : ue(t);
|
|
2640
2640
|
}
|
|
2641
2641
|
{
|
|
2642
|
-
let e = X(v || "你是一个智能助手。"), n = Math.max(2e3, Math.round(P.contextWindow *
|
|
2642
|
+
let e = X(v || "你是一个智能助手。"), n = Math.max(2e3, Math.round(P.contextWindow * pe));
|
|
2643
2643
|
if (e > n) {
|
|
2644
|
-
let r = `[page-agent-sdk] systemPrompt 本身(${e} tokens)超过系统段预算(${n} tokens,窗口 ${P.contextWindow} 的 ${
|
|
2644
|
+
let r = `[page-agent-sdk] systemPrompt 本身(${e} tokens)超过系统段预算(${n} tokens,窗口 ${P.contextWindow} 的 ${pe * 100}%);请缩减 systemPrompt 或换更大窗口模型`;
|
|
2645
2645
|
return console.error(r), t({
|
|
2646
2646
|
type: "error",
|
|
2647
2647
|
message: r,
|
|
@@ -2653,13 +2653,13 @@ function Wi(e) {
|
|
|
2653
2653
|
}), "";
|
|
2654
2654
|
}
|
|
2655
2655
|
}
|
|
2656
|
-
let i =
|
|
2656
|
+
let i = he(r);
|
|
2657
2657
|
L("context", {
|
|
2658
2658
|
model: c,
|
|
2659
|
-
tools:
|
|
2659
|
+
tools: de.map((e) => e.name),
|
|
2660
2660
|
middleware: x.map((e) => e.name)
|
|
2661
2661
|
});
|
|
2662
|
-
let l = Ei(x, (e) =>
|
|
2662
|
+
let l = Ei(x, (e) => _e(e, t, n)), u = Di(x, ve), d = {
|
|
2663
2663
|
rounds: 0,
|
|
2664
2664
|
maxToolRounds: N,
|
|
2665
2665
|
invokeUsage: {
|
|
@@ -2670,7 +2670,7 @@ function Wi(e) {
|
|
|
2670
2670
|
writeFailures: {},
|
|
2671
2671
|
budgetHinted: !1
|
|
2672
2672
|
};
|
|
2673
|
-
|
|
2673
|
+
B.loopProgress = d;
|
|
2674
2674
|
let f = 0, p = 0, m = Vi(N, C), h = null, g = 0, b = !1, S = 0;
|
|
2675
2675
|
try {
|
|
2676
2676
|
for (; (f < N || b) && p < m && (p++, !n?.aborted);) {
|
|
@@ -2695,38 +2695,38 @@ function Wi(e) {
|
|
|
2695
2695
|
content: e
|
|
2696
2696
|
}), e;
|
|
2697
2697
|
}
|
|
2698
|
-
let e =
|
|
2698
|
+
let e = le(void 0, "round", `round ${p}`, { round: p })?.id;
|
|
2699
2699
|
t({
|
|
2700
2700
|
type: "round_start",
|
|
2701
2701
|
round: p
|
|
2702
|
-
}),
|
|
2702
|
+
}), B = Si(x, {
|
|
2703
2703
|
messages: i,
|
|
2704
|
-
state:
|
|
2705
|
-
}), i =
|
|
2706
|
-
let r =
|
|
2704
|
+
state: B
|
|
2705
|
+
}), i = ge(i), i = H(i, Math.round(P.contextWindow * .6));
|
|
2706
|
+
let r = le(e, "model", c, {
|
|
2707
2707
|
round: f + 1,
|
|
2708
|
-
tools:
|
|
2708
|
+
tools: de.map((e) => e.name)
|
|
2709
2709
|
});
|
|
2710
2710
|
L("llm_request", {
|
|
2711
2711
|
round: f + 1,
|
|
2712
2712
|
model: c,
|
|
2713
|
-
tools:
|
|
2714
|
-
messages:
|
|
2713
|
+
tools: de.map((e) => e.name),
|
|
2714
|
+
messages: be(i)
|
|
2715
2715
|
});
|
|
2716
2716
|
let o = await l({
|
|
2717
2717
|
messages: i,
|
|
2718
|
-
state:
|
|
2718
|
+
state: B
|
|
2719
2719
|
});
|
|
2720
2720
|
i.push(o.message), L("llm_response", {
|
|
2721
2721
|
round: f + 1,
|
|
2722
2722
|
content: o.content,
|
|
2723
2723
|
toolCalls: o.toolCalls
|
|
2724
|
-
}),
|
|
2724
|
+
}), ue(r, o.aborted ? "timeout" : "ok", { usage: _(o.message) });
|
|
2725
2725
|
{
|
|
2726
2726
|
let e = y(o.message);
|
|
2727
2727
|
e && (d.invokeUsage.prompt_tokens += e.prompt_tokens ?? 0, d.invokeUsage.completion_tokens += e.completion_tokens ?? 0, d.invokeUsage.total_tokens += e.total_tokens ?? 0);
|
|
2728
2728
|
}
|
|
2729
|
-
if (
|
|
2729
|
+
if (B = Ci(x, o, B), o.aborted) return t({
|
|
2730
2730
|
type: "done",
|
|
2731
2731
|
content: o.content
|
|
2732
2732
|
}), o.content;
|
|
@@ -2772,17 +2772,17 @@ function Wi(e) {
|
|
|
2772
2772
|
}), i.push(new a("⚠️ 你刚才输出的是计划/过渡性表述(如「我先看看」「稍后委派」),任务尚未完成。请立即继续执行 —— 调用所需工具把任务做完,全部完成后再给出总结回复。"));
|
|
2773
2773
|
continue;
|
|
2774
2774
|
}
|
|
2775
|
-
if (!e && O > 0 &&
|
|
2775
|
+
if (!e && O > 0 && B.verifyAttempts < O) {
|
|
2776
2776
|
let e = await Ti(x, {
|
|
2777
2777
|
messages: i,
|
|
2778
|
-
state:
|
|
2778
|
+
state: B,
|
|
2779
2779
|
response: o,
|
|
2780
2780
|
log: (e, t) => L(e, t)
|
|
2781
2781
|
});
|
|
2782
2782
|
if (e) {
|
|
2783
|
-
h = o.content,
|
|
2783
|
+
h = o.content, B.verifyAttempts += 1, i.push(new a(`⚠️ 验证未通过,请修正:${e}`)), L("middleware", {
|
|
2784
2784
|
stage: "verify_retry",
|
|
2785
|
-
attempt:
|
|
2785
|
+
attempt: B.verifyAttempts,
|
|
2786
2786
|
feedback: e
|
|
2787
2787
|
});
|
|
2788
2788
|
continue;
|
|
@@ -2810,15 +2810,15 @@ function Wi(e) {
|
|
|
2810
2810
|
id: r,
|
|
2811
2811
|
name: e.name,
|
|
2812
2812
|
args: e.args,
|
|
2813
|
-
state:
|
|
2813
|
+
state: B,
|
|
2814
2814
|
signal: n,
|
|
2815
2815
|
emit: t,
|
|
2816
|
-
logSink:
|
|
2816
|
+
logSink: ae
|
|
2817
2817
|
}
|
|
2818
2818
|
};
|
|
2819
2819
|
}), v = await ni(m, D, async (r) => {
|
|
2820
2820
|
if (n?.aborted) return;
|
|
2821
|
-
let i =
|
|
2821
|
+
let i = le(e, "tool", r.call.name, { name: r.call.name }), a = Date.now();
|
|
2822
2822
|
t({
|
|
2823
2823
|
type: "tool_call",
|
|
2824
2824
|
name: r.call.name,
|
|
@@ -2852,7 +2852,7 @@ function Wi(e) {
|
|
|
2852
2852
|
result: o.content,
|
|
2853
2853
|
status: o.status,
|
|
2854
2854
|
durationMs: s
|
|
2855
|
-
}),
|
|
2855
|
+
}), ue(i, o.status === "error" ? "error" : "ok", { resultSnippet: String(o.content).slice(0, 100) }), o;
|
|
2856
2856
|
}, n);
|
|
2857
2857
|
for (let e = 0; e < m.length; e++) {
|
|
2858
2858
|
let t = v[e];
|
|
@@ -2879,19 +2879,19 @@ function Wi(e) {
|
|
|
2879
2879
|
content: h
|
|
2880
2880
|
}), h;
|
|
2881
2881
|
let e = i[i.length - 1];
|
|
2882
|
-
if (e &&
|
|
2883
|
-
let e = i[0] &&
|
|
2882
|
+
if (e && ye(e) === "tool") {
|
|
2883
|
+
let e = i[0] && ye(i[0]) === "system" ? i.slice(1) : i.slice(), r = [new o(V() + "\n\n工具调用次数已达上限,请基于已有工具结果直接给出最终回答,不要再调用工具。"), ...e];
|
|
2884
2884
|
L("llm_request", {
|
|
2885
2885
|
round: "wrap_up",
|
|
2886
2886
|
model: c,
|
|
2887
2887
|
tools: [],
|
|
2888
|
-
messages:
|
|
2888
|
+
messages: be(r)
|
|
2889
2889
|
});
|
|
2890
|
-
let a = await Ei(x, (e) =>
|
|
2890
|
+
let a = await Ei(x, (e) => _e(e, t, n, R))({
|
|
2891
2891
|
messages: r,
|
|
2892
|
-
state:
|
|
2892
|
+
state: B
|
|
2893
2893
|
});
|
|
2894
|
-
if (
|
|
2894
|
+
if (B = Ci(x, a, B), L("llm_response", {
|
|
2895
2895
|
round: "wrap_up",
|
|
2896
2896
|
content: a.content
|
|
2897
2897
|
}), a.aborted) return t({
|
|
@@ -2926,41 +2926,41 @@ function Wi(e) {
|
|
|
2926
2926
|
}), r;
|
|
2927
2927
|
} finally {
|
|
2928
2928
|
try {
|
|
2929
|
-
await wi(x,
|
|
2929
|
+
await wi(x, B);
|
|
2930
2930
|
} catch (e) {
|
|
2931
2931
|
let t = Zr(e, "observable");
|
|
2932
2932
|
console.warn("[Agent] afterAgent 清理出错(observable,已忽略):", t.message);
|
|
2933
2933
|
}
|
|
2934
|
-
if (
|
|
2935
|
-
j(
|
|
2934
|
+
if (ce && j) try {
|
|
2935
|
+
j(oe.value, li(oe.value));
|
|
2936
2936
|
} catch {}
|
|
2937
2937
|
}
|
|
2938
2938
|
}
|
|
2939
|
-
async function
|
|
2939
|
+
async function Se(e, t, n) {
|
|
2940
2940
|
let r = "";
|
|
2941
|
-
return await
|
|
2941
|
+
return await xe(e, (e) => {
|
|
2942
2942
|
e.type === "done" && (r = e.content), n?.(e);
|
|
2943
2943
|
}, t), r;
|
|
2944
2944
|
}
|
|
2945
|
-
function Se(e) {
|
|
2946
|
-
ue = [...x.flatMap((e) => e.tools || []), ...e], B();
|
|
2947
|
-
}
|
|
2948
2945
|
function Ce(e) {
|
|
2949
|
-
|
|
2946
|
+
de = [...x.flatMap((e) => e.tools || []), ...e], z();
|
|
2947
|
+
}
|
|
2948
|
+
function we(e) {
|
|
2949
|
+
R = e, z(), M?.(e);
|
|
2950
2950
|
}
|
|
2951
2951
|
return {
|
|
2952
|
-
invoke:
|
|
2953
|
-
stream:
|
|
2954
|
-
getState: () =>
|
|
2952
|
+
invoke: Se,
|
|
2953
|
+
stream: xe,
|
|
2954
|
+
getState: () => B,
|
|
2955
2955
|
get allTools() {
|
|
2956
|
-
return
|
|
2956
|
+
return de;
|
|
2957
2957
|
},
|
|
2958
|
-
setTools:
|
|
2959
|
-
setLlm:
|
|
2958
|
+
setTools: Ce,
|
|
2959
|
+
setLlm: we,
|
|
2960
2960
|
setModelCaps: F,
|
|
2961
2961
|
debugLogs: I,
|
|
2962
|
-
spans:
|
|
2963
|
-
getEffectiveSystemPrompt: () =>
|
|
2962
|
+
spans: oe,
|
|
2963
|
+
getEffectiveSystemPrompt: () => V()
|
|
2964
2964
|
};
|
|
2965
2965
|
}
|
|
2966
2966
|
//#endregion
|
|
@@ -7536,6 +7536,10 @@ var Rl = [
|
|
|
7536
7536
|
name: "agentCompression",
|
|
7537
7537
|
defaultOn: !1,
|
|
7538
7538
|
requires: ["summarization"]
|
|
7539
|
+
},
|
|
7540
|
+
{
|
|
7541
|
+
name: "preferences",
|
|
7542
|
+
defaultOn: !1
|
|
7539
7543
|
}
|
|
7540
7544
|
];
|
|
7541
7545
|
function zl(e) {
|
|
@@ -9325,7 +9329,7 @@ function Fu(e, n = {}) {
|
|
|
9325
9329
|
})
|
|
9326
9330
|
});
|
|
9327
9331
|
A(L);
|
|
9328
|
-
let
|
|
9332
|
+
let ae = r(async ({ jsonPath: e }) => {
|
|
9329
9333
|
let t = e || "", n = t ? Ji(o, t) : o;
|
|
9330
9334
|
return n ? `schema${t ? ` @ ${t}` : ""} = ${Q(sa(n))}` : Y({
|
|
9331
9335
|
code: "PATH_DENIED",
|
|
@@ -9336,7 +9340,7 @@ function Fu(e, n = {}) {
|
|
|
9336
9340
|
name: "schema_data",
|
|
9337
9341
|
description: "查看主数据(或子路径)的字段约束:类型/min/max/enum/必填/默认值/嵌套 shape。写前查约束,避免写错重试。不传 jsonPath 查根;传子路径(如 components.0)查该位置约束。",
|
|
9338
9342
|
schema: t.object({ jsonPath: t.string().optional().describe("要查约束的子路径;不传查根 schema") })
|
|
9339
|
-
}),
|
|
9343
|
+
}), oe = r(async ({ snapshotId: e, against: t }) => {
|
|
9340
9344
|
let n = t != null, r, i;
|
|
9341
9345
|
if (n) {
|
|
9342
9346
|
let e = t;
|
|
@@ -9368,7 +9372,7 @@ function Fu(e, n = {}) {
|
|
|
9368
9372
|
snapshotId: t.number().int().optional().describe("对比的快照序号;不传则最近一次"),
|
|
9369
9373
|
against: t.unknown().optional().describe("对比的一段 JSON 值(与 snapshotId 互斥;传则忽略快照)")
|
|
9370
9374
|
})
|
|
9371
|
-
}),
|
|
9375
|
+
}), se = [];
|
|
9372
9376
|
if (n.vfsStore) {
|
|
9373
9377
|
let e = n.vfsStore, i = (e) => `drafts/${e}.json`, c = r(({ draftId: t, chunk: n, mode: r }) => {
|
|
9374
9378
|
let a = i(t), o = e.files[a], s = r === "append" && o, c = s ? o.content + n : n;
|
|
@@ -9433,9 +9437,9 @@ function Fu(e, n = {}) {
|
|
|
9433
9437
|
expectedHash: t.string().optional().describe("乐观锁:改前 read/get 返回的 hash;传入则校验,不一致拒绝写入防覆盖。不传则自动用你最后读到的 hash(autoLock)")
|
|
9434
9438
|
})
|
|
9435
9439
|
});
|
|
9436
|
-
A(u),
|
|
9440
|
+
A(u), se.push(c, u);
|
|
9437
9441
|
}
|
|
9438
|
-
let
|
|
9442
|
+
let ce = [];
|
|
9439
9443
|
if (e.resources?.length && d) {
|
|
9440
9444
|
let e = r(async ({ path: e, handle: t }) => {
|
|
9441
9445
|
let n = e;
|
|
@@ -9539,9 +9543,9 @@ function Fu(e, n = {}) {
|
|
|
9539
9543
|
handle: t.string().optional().describe("占位符句柄(与 path 二选一)")
|
|
9540
9544
|
})
|
|
9541
9545
|
});
|
|
9542
|
-
A(a),
|
|
9546
|
+
A(a), ce.push(e, n, i, a);
|
|
9543
9547
|
}
|
|
9544
|
-
let
|
|
9548
|
+
let le = [
|
|
9545
9549
|
ee,
|
|
9546
9550
|
j,
|
|
9547
9551
|
M,
|
|
@@ -9554,23 +9558,23 @@ function Fu(e, n = {}) {
|
|
|
9554
9558
|
F,
|
|
9555
9559
|
I,
|
|
9556
9560
|
L,
|
|
9557
|
-
R,
|
|
9558
9561
|
ae,
|
|
9559
|
-
|
|
9560
|
-
...se
|
|
9562
|
+
oe,
|
|
9563
|
+
...se,
|
|
9564
|
+
...ce
|
|
9561
9565
|
];
|
|
9562
|
-
Object.defineProperty(
|
|
9566
|
+
Object.defineProperty(le, "controller", {
|
|
9563
9567
|
value: E,
|
|
9564
9568
|
enumerable: !1,
|
|
9565
9569
|
configurable: !1,
|
|
9566
9570
|
writable: !1
|
|
9567
9571
|
});
|
|
9568
|
-
for (let e of
|
|
9572
|
+
for (let e of le) Object.defineProperty(e, "__dataOpsScoped", {
|
|
9569
9573
|
value: !0,
|
|
9570
9574
|
enumerable: !1,
|
|
9571
9575
|
configurable: !1
|
|
9572
9576
|
});
|
|
9573
|
-
return
|
|
9577
|
+
return le;
|
|
9574
9578
|
}
|
|
9575
9579
|
//#endregion
|
|
9576
9580
|
//#region src/core/tools/fetchDoc.ts
|
|
@@ -9945,24 +9949,236 @@ function pd(e = {}) {
|
|
|
9945
9949
|
dispose() {}
|
|
9946
9950
|
};
|
|
9947
9951
|
}
|
|
9948
|
-
|
|
9949
|
-
|
|
9952
|
+
//#endregion
|
|
9953
|
+
//#region src/core/backends/preferenceStore.ts
|
|
9954
|
+
var md = [
|
|
9955
|
+
"color",
|
|
9956
|
+
"copy",
|
|
9957
|
+
"layout",
|
|
9958
|
+
"interaction",
|
|
9959
|
+
"tech",
|
|
9960
|
+
"other"
|
|
9961
|
+
], hd = "v:1::pref-store", gd = "chat-sdk";
|
|
9962
|
+
function _d(e, t, n) {
|
|
9963
|
+
return `${hd}::${e}::${t}::${n}`;
|
|
9964
|
+
}
|
|
9965
|
+
function vd(e, t) {
|
|
9966
|
+
return `${hd}::${e}::${t}::`;
|
|
9967
|
+
}
|
|
9968
|
+
function yd() {
|
|
9969
|
+
return `pref-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
9970
|
+
}
|
|
9971
|
+
function bd(e = {}) {
|
|
9972
|
+
let t = e.dbName ?? gd, n = e.backend ?? "indexed", r = e.id ?? "", i = e.maxEntries ?? 20, a, o, s = new Promise((e) => {
|
|
9973
|
+
o = e;
|
|
9974
|
+
});
|
|
9975
|
+
(async () => {
|
|
9976
|
+
try {
|
|
9977
|
+
if (n === "indexed") {
|
|
9978
|
+
if (typeof indexedDB > "u") throw Error("indexedDB 不可用");
|
|
9979
|
+
a = await Ml(t), o(!0);
|
|
9980
|
+
} else if (n === "session") {
|
|
9981
|
+
if (typeof sessionStorage > "u") throw Error("sessionStorage 不可用");
|
|
9982
|
+
a = Nl(sessionStorage), o(!0);
|
|
9983
|
+
} else if (n === "local") {
|
|
9984
|
+
if (typeof localStorage > "u") throw Error("localStorage 不可用");
|
|
9985
|
+
a = Nl(localStorage), o(!0);
|
|
9986
|
+
} else a = jl(), o(!1);
|
|
9987
|
+
} catch {
|
|
9988
|
+
a = jl(), o(!1);
|
|
9989
|
+
}
|
|
9990
|
+
})();
|
|
9991
|
+
async function c() {
|
|
9992
|
+
let e = [];
|
|
9993
|
+
return await a.scan(vd(t, r), (t, n) => {
|
|
9994
|
+
e.push(n);
|
|
9995
|
+
}), e;
|
|
9996
|
+
}
|
|
9997
|
+
return {
|
|
9998
|
+
ready: s,
|
|
9999
|
+
async list() {
|
|
10000
|
+
return (await c()).sort((e, t) => t.updatedAt - e.updatedAt);
|
|
10001
|
+
},
|
|
10002
|
+
async put(e) {
|
|
10003
|
+
let n = await c(), o = Date.now(), s = n.reduce((e, t) => Math.max(e, t.updatedAt), 0), l = n.find((t) => t.topic === e.topic), u = {
|
|
10004
|
+
id: e.id ?? l?.id ?? yd(),
|
|
10005
|
+
content: e.content,
|
|
10006
|
+
topic: e.topic,
|
|
10007
|
+
sourceSessionId: l?.sourceSessionId ?? e.sourceSessionId,
|
|
10008
|
+
sourceRound: l?.sourceRound ?? e.sourceRound,
|
|
10009
|
+
createdAt: l?.createdAt ?? o,
|
|
10010
|
+
updatedAt: Math.max(o, s + 1)
|
|
10011
|
+
};
|
|
10012
|
+
l && l.id !== u.id && await a.del(_d(t, r, l.id));
|
|
10013
|
+
try {
|
|
10014
|
+
await a.set(_d(t, r, u.id), u);
|
|
10015
|
+
} catch (e) {
|
|
10016
|
+
Cl(e) && (a = jl(), await a.set(_d(t, r, u.id), u));
|
|
10017
|
+
}
|
|
10018
|
+
let d = await c();
|
|
10019
|
+
if (d.length > i) {
|
|
10020
|
+
let e = d.sort((e, t) => e.updatedAt - t.updatedAt).slice(0, d.length - i);
|
|
10021
|
+
for (let n of e) await a.del(_d(t, r, n.id));
|
|
10022
|
+
}
|
|
10023
|
+
return u;
|
|
10024
|
+
},
|
|
10025
|
+
async remove(e) {
|
|
10026
|
+
let n = _d(t, r, e);
|
|
10027
|
+
return await a.get(n) == null ? !1 : (await a.del(n), !0);
|
|
10028
|
+
},
|
|
10029
|
+
async clear() {
|
|
10030
|
+
await a.clearPrefix(vd(t, r));
|
|
10031
|
+
},
|
|
10032
|
+
dispose() {}
|
|
10033
|
+
};
|
|
10034
|
+
}
|
|
10035
|
+
//#endregion
|
|
10036
|
+
//#region src/core/harness/preferences.ts
|
|
10037
|
+
var xd = {
|
|
10038
|
+
color: "颜色",
|
|
10039
|
+
copy: "文案",
|
|
10040
|
+
layout: "排版",
|
|
10041
|
+
interaction: "交互",
|
|
10042
|
+
tech: "技术",
|
|
10043
|
+
other: "其他"
|
|
10044
|
+
}, Sd = [
|
|
10045
|
+
/^(?:请|帮我|麻烦)?你?记住[::,,、]?\s*(.{4,200})/,
|
|
10046
|
+
/^(?:从)?今后(?:开始|起)?[::,,]?\s*(.{4,200})/,
|
|
10047
|
+
/^以后(?:都|全都|总是|尽量)?[::,,]?\s*(.{4,200})/
|
|
10048
|
+
], Cd = /(?:不要|别再|别用|别加|太(?:艳|花|亮|暗|大|小|密|挤|乱|复杂|素|少)|不喜欢|讨厌|希望|更喜欢|偏好|永远|一律|统一保持|保持统一)/, wd = [
|
|
10049
|
+
["layout", /布局|排版|间距|留白|密度|居中|对齐|栅格|边距|紧凑|圆角|分栏|层级|大小|尺寸/],
|
|
10050
|
+
["copy", /文案|文字|标题|副标题|字体|字号|措辞|语气|口语|书面|简洁|简短|详尽|emoji|表情/],
|
|
10051
|
+
["interaction", /动画|动效|过渡|交互|悬停|hover|点击反馈|弹窗|提示|加载|滚动/],
|
|
10052
|
+
["tech", /代码|框架|组件|技术|写法|命名|注释|依赖|版本|接口/],
|
|
10053
|
+
["color", /颜色|配色|色调|色彩|深色|浅色|饱和|渐变|紫|红|橙|黄|绿|青|蓝|粉|棕|灰|黑|白|金|银/]
|
|
10054
|
+
];
|
|
10055
|
+
function Td(e) {
|
|
10056
|
+
for (let [t, n] of wd) if (n.test(e)) return t;
|
|
10057
|
+
return "other";
|
|
10058
|
+
}
|
|
10059
|
+
function Ed(e) {
|
|
10060
|
+
let t = e.trim();
|
|
10061
|
+
if (!(!t || t.length > 500)) for (let e of Sd) {
|
|
10062
|
+
let n = t.match(e);
|
|
10063
|
+
if (n?.[1]) {
|
|
10064
|
+
let e = n[1].trim().replace(/[。.!!]+$/, "");
|
|
10065
|
+
return e.length < 3 ? void 0 : {
|
|
10066
|
+
content: e,
|
|
10067
|
+
topic: Td(e)
|
|
10068
|
+
};
|
|
10069
|
+
}
|
|
10070
|
+
}
|
|
10071
|
+
}
|
|
10072
|
+
function Dd(e) {
|
|
10073
|
+
let t = e.trim();
|
|
10074
|
+
return t.length < 4 || t.length > 500 || /^(你好|hi|hello|ok|好的|继续|嗯|谢谢|hey|哈喽|收到|明白)/i.test(t) ? !1 : Cd.test(t);
|
|
10075
|
+
}
|
|
10076
|
+
function Od(e) {
|
|
10077
|
+
return [
|
|
10078
|
+
"你是用户偏好提取器。判断下面的用户消息是否包含「持久偏好」—— 对未来同类工作都适用的口味/规则(如配色口味、文案风格、排版密度),而非仅针对本轮的任务指令。",
|
|
10079
|
+
"只输出 JSON(无任何其他文本):{\"captured\": true, \"content\": \"一句话中性陈述(用户视角,如:不用紫色,偏好低饱和)\", \"topic\": \"color|copy|layout|interaction|tech|other\"} 或 {\"captured\": false, \"content\": \"\", \"topic\": \"other\"}",
|
|
10080
|
+
"判定:用户明确表达喜欢/不喜欢/以后要/不要某类风格 → captured:true;仅本轮的任务要求(如「把这个改成红色」「删掉这个组件」)→ captured:false。宁漏勿误:拿不准一律 false。",
|
|
10081
|
+
"content 用用户原语言表述。",
|
|
10082
|
+
`用户消息:"""${e.slice(0, 800)}"""`
|
|
10083
|
+
].join("\n");
|
|
10084
|
+
}
|
|
10085
|
+
function kd(e) {
|
|
10086
|
+
if (!e) return;
|
|
10087
|
+
let t = (e.match(/```(?:json)?\s*([\s\S]*?)```/)?.[1] ?? e).match(/\{[\s\S]*\}/)?.[0];
|
|
10088
|
+
if (t) try {
|
|
10089
|
+
let e = JSON.parse(t);
|
|
10090
|
+
if (e.captured !== !0) return;
|
|
10091
|
+
let n = typeof e.content == "string" ? e.content.trim().replace(/[。.!!]+$/, "") : "";
|
|
10092
|
+
return n.length < 3 || n.length > 200 ? void 0 : {
|
|
10093
|
+
content: n,
|
|
10094
|
+
topic: md.includes(e.topic) ? e.topic : "other"
|
|
10095
|
+
};
|
|
10096
|
+
} catch {
|
|
10097
|
+
return;
|
|
10098
|
+
}
|
|
10099
|
+
}
|
|
10100
|
+
function Ad(e) {
|
|
10101
|
+
if (!e.length) return;
|
|
10102
|
+
let t = ["## 用户偏好(跨会话沉淀;除非用户本轮另有指示,遵守以下偏好)"];
|
|
10103
|
+
for (let n of e) t.push(`- ${xd[n.topic]}:${n.content}`);
|
|
10104
|
+
return t.join("\n");
|
|
10105
|
+
}
|
|
10106
|
+
function jd(e) {
|
|
10107
|
+
let t = [], n = -1, r = Promise.resolve(), i = (t) => e.onDebug?.({
|
|
10108
|
+
stage: "preferences",
|
|
10109
|
+
...t
|
|
10110
|
+
});
|
|
10111
|
+
function a(n, a, o, s) {
|
|
10112
|
+
r = r.then(() => e.store.put({
|
|
10113
|
+
content: n,
|
|
10114
|
+
topic: a,
|
|
10115
|
+
sourceSessionId: e.getSessionId(),
|
|
10116
|
+
sourceRound: o
|
|
10117
|
+
})).then((e) => {
|
|
10118
|
+
t = [e, ...t.filter((t) => t.id !== e.id && t.topic !== e.topic)], i({
|
|
10119
|
+
captured: s,
|
|
10120
|
+
topic: a,
|
|
10121
|
+
content: n
|
|
10122
|
+
});
|
|
10123
|
+
}).catch((e) => i({ error: String(e) }));
|
|
10124
|
+
}
|
|
10125
|
+
return {
|
|
10126
|
+
name: "preferences",
|
|
10127
|
+
augmentPrompt: () => Ad(t),
|
|
10128
|
+
afterAgent: (t) => {
|
|
10129
|
+
let r = t.messages ?? [];
|
|
10130
|
+
for (let t = n + 1; t < r.length; t++) {
|
|
10131
|
+
let n = r[t];
|
|
10132
|
+
if (n.role !== "user" || typeof n.content != "string" || !n.content) continue;
|
|
10133
|
+
let o = n.content, s = Ed(o);
|
|
10134
|
+
if (s) {
|
|
10135
|
+
a(s.content, s.topic, t, "explicit");
|
|
10136
|
+
continue;
|
|
10137
|
+
}
|
|
10138
|
+
if (e.llmInvoke && Dd(o)) {
|
|
10139
|
+
let n = t;
|
|
10140
|
+
e.llmInvoke(Od(o)).then((e) => {
|
|
10141
|
+
let t = kd(e);
|
|
10142
|
+
t && a(t.content, t.topic, n, "llm");
|
|
10143
|
+
}).catch((e) => i({ extractError: String(e) }));
|
|
10144
|
+
}
|
|
10145
|
+
}
|
|
10146
|
+
n = r.length - 1;
|
|
10147
|
+
},
|
|
10148
|
+
preload: async () => {
|
|
10149
|
+
await e.store.ready, t = await e.store.list();
|
|
10150
|
+
},
|
|
10151
|
+
getPreferences: () => [...t],
|
|
10152
|
+
removePreference: async (n) => {
|
|
10153
|
+
let r = await e.store.remove(n);
|
|
10154
|
+
return r && (t = t.filter((e) => e.id !== n)), r;
|
|
10155
|
+
},
|
|
10156
|
+
clearPreferences: async () => {
|
|
10157
|
+
await e.store.clear(), t = [];
|
|
10158
|
+
},
|
|
10159
|
+
resetScanCursor: () => {
|
|
10160
|
+
n = -1;
|
|
10161
|
+
}
|
|
10162
|
+
};
|
|
10163
|
+
}
|
|
10164
|
+
var Md = /large_results\/[^\s"'`),]+\.txt/g;
|
|
10165
|
+
function Nd(e) {
|
|
9950
10166
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
9951
10167
|
if (typeof e != "string" || !e) return;
|
|
9952
10168
|
let n;
|
|
9953
|
-
for (
|
|
10169
|
+
for (Md.lastIndex = 0; (n = Md.exec(e)) !== null;) t.add(n[0]);
|
|
9954
10170
|
};
|
|
9955
10171
|
for (let t of e) if (n(t.content), t.steps) for (let e of t.steps) n(e.result);
|
|
9956
10172
|
return t;
|
|
9957
10173
|
}
|
|
9958
|
-
function
|
|
10174
|
+
function Pd(e, t) {
|
|
9959
10175
|
let n = [];
|
|
9960
10176
|
for (let r of Object.keys(e)) r.startsWith("large_results/") && !t.has(r) && n.push(r);
|
|
9961
10177
|
return n;
|
|
9962
10178
|
}
|
|
9963
10179
|
//#endregion
|
|
9964
10180
|
//#region src/core/utils/serialRunner.ts
|
|
9965
|
-
function
|
|
10181
|
+
function Fd() {
|
|
9966
10182
|
let e = Promise.resolve();
|
|
9967
10183
|
return function(t) {
|
|
9968
10184
|
let n = e.then(t, t);
|
|
@@ -9971,24 +10187,24 @@ function _d() {
|
|
|
9971
10187
|
}
|
|
9972
10188
|
//#endregion
|
|
9973
10189
|
//#region src/core/sdk/createChatSdk.ts
|
|
9974
|
-
var
|
|
9975
|
-
function
|
|
10190
|
+
var Id = 30, Ld = /* @__PURE__ */ new Map();
|
|
10191
|
+
function Rd(e, t) {
|
|
9976
10192
|
return e === "set_data" ? "set" : e === "edit_data" ? "edit" : e === "delete_data" ? "delete" : e === "restore_data" ? "restore" : e === "write" ? t?.del ? "delete" : t?.patch ? "edit" : "set" : null;
|
|
9977
10193
|
}
|
|
9978
|
-
function
|
|
10194
|
+
function zd(e) {
|
|
9979
10195
|
return e === "spawn_agent" || e === "spawn_agents" || e.startsWith("use_");
|
|
9980
10196
|
}
|
|
9981
|
-
function
|
|
10197
|
+
function Bd(e, t, n, r) {
|
|
9982
10198
|
let i = 0;
|
|
9983
10199
|
return {
|
|
9984
10200
|
name: "sdk-events",
|
|
9985
10201
|
wrapToolCall: async (t, r) => {
|
|
9986
|
-
let i = await r(t), a =
|
|
10202
|
+
let i = await r(t), a = Rd(t.name, t.args);
|
|
9987
10203
|
return a ? e({
|
|
9988
10204
|
type: "data_change",
|
|
9989
10205
|
operation: a,
|
|
9990
10206
|
value: n()?.bind
|
|
9991
|
-
}) : i.status === "done" &&
|
|
10207
|
+
}) : i.status === "done" && zd(t.name) && e({
|
|
9992
10208
|
type: "data_change",
|
|
9993
10209
|
operation: "edit",
|
|
9994
10210
|
value: n()?.bind
|
|
@@ -10015,7 +10231,7 @@ function Sd(e, t, n, r) {
|
|
|
10015
10231
|
}
|
|
10016
10232
|
};
|
|
10017
10233
|
}
|
|
10018
|
-
function
|
|
10234
|
+
function Vd(e, t, n, r, i) {
|
|
10019
10235
|
if (!n) return i && console.warn(`[page-agent-sdk][focus] capabilities.focus 关闭,${t} 忽略`), {
|
|
10020
10236
|
ok: !1,
|
|
10021
10237
|
error: "capabilities.focus 关闭"
|
|
@@ -10033,28 +10249,28 @@ function Cd(e, t, n, r, i) {
|
|
|
10033
10249
|
error: "当前无主数据 schema,无法聚焦"
|
|
10034
10250
|
});
|
|
10035
10251
|
}
|
|
10036
|
-
function
|
|
10252
|
+
function Hd(e, n) {
|
|
10037
10253
|
let i = {
|
|
10038
10254
|
prompt_tokens: 0,
|
|
10039
10255
|
completion_tokens: 0,
|
|
10040
10256
|
total_tokens: 0
|
|
10041
|
-
}, a = ul(() =>
|
|
10257
|
+
}, a = ul(() => G), o = /* @__PURE__ */ At(0), s = Il(e.storage);
|
|
10042
10258
|
e.debug && s && s.onEvent((e) => console.log("[page-agent-sdk][storage]", e));
|
|
10043
10259
|
let { modelCaps: c, summaryLlmInvoke: l, titleLlmInvoke: u, compressDecisionInvoke: d } = ll(e), f = c;
|
|
10044
10260
|
if (e.debug && console.log("[page-agent-sdk][modelCaps]", f), f.contextWindow < 2e5) throw Error(`[page-agent-sdk] 模型上下文窗口 ${f.contextWindow} 小于最小支持 ${ai}(需 ≥200K 窗口模型,如 GLM-5.2/Claude/Kimi/Qwen-1M/DeepSeek-v4)`);
|
|
10045
10261
|
let h = Ul(e, f.contextWindow), g = h.enableLLMSummary !== !1, _ = (e.contextOptions && e.contextOptions.preserveLastToolResults) ?? Hl[e.contextPreset ?? "auto"], v = new Set(_), y = e.llm;
|
|
10046
10262
|
e.debug && !l && console.warn("[page-agent-sdk][summarization] 未构造 llmInvoke(apiKey 缺失?),摘要回退零成本索引摘要");
|
|
10047
|
-
let b = /* @__PURE__ */
|
|
10263
|
+
let b = /* @__PURE__ */ bt([]), x = lc(e.vfs?.initialFiles, {
|
|
10048
10264
|
persist: s ? { save: (e) => {
|
|
10049
|
-
|
|
10265
|
+
zt({ vfs: e });
|
|
10050
10266
|
} } : void 0,
|
|
10051
10267
|
maxBytes: e.vfs?.maxBytes,
|
|
10052
10268
|
poolBytes: e.vfs?.poolBytes
|
|
10053
10269
|
}), S = Ta([], { maxPlanRevisions: e.maxPlanRevisions }), C = ka(), w = Qa({
|
|
10054
|
-
getSchema: () =>
|
|
10055
|
-
getBind: () =>
|
|
10270
|
+
getSchema: () => z()?.schema,
|
|
10271
|
+
getBind: () => z()?.bind,
|
|
10056
10272
|
unfocusGuidance: e.toolMode === "advanced" ? "tool" : "ask-user",
|
|
10057
|
-
onChange: (e) =>
|
|
10273
|
+
onChange: (e) => G({
|
|
10058
10274
|
type: "focus_change",
|
|
10059
10275
|
focuses: e
|
|
10060
10276
|
})
|
|
@@ -10072,43 +10288,43 @@ function wd(e, n) {
|
|
|
10072
10288
|
t.length ? (e._codeAsset.writablePaths = t, Array.isArray(e.writablePaths) && (e.writablePaths = t), e._rebuildCodeAssetPaths?.(t[0]), console.info(`[page-agent-sdk][createHtmlSubagent] 未传 writablePaths,已从 schema 推断: [${t.map((e) => `'${e}'`).join(", ")}]`)) : (console.warn("[page-agent-sdk][createHtmlSubagent] 未能从 schema 推断 writablePaths(开放 schema(z.any()/z.record())/嵌套容器(如 sections[].children[])/点路径 codeField(如 props.html_code)不支持自动推断),已跳过该 html 子 agent(整体不受影响);如确需代码资产机制(vfs + 格式校验 + 增量 commit),请显式传 writablePaths(代码组件 data 区,如 ['components'])"), j.add(e));
|
|
10073
10289
|
}
|
|
10074
10290
|
let M = j.size ? ee.filter((e) => !j.has(e)) : ee, te = j.size ? (A ?? []).filter((e) => !j.has(e)) : A, N = M.length > 0, P = M.flatMap((e) => e._codeAsset.writablePaths), ne = M.flatMap((e) => e._codeAsset.writablePaths.map((t) => `${t}.${e._codeAsset.codeField}`)), re = e.checkpoint, ie = re !== void 0 && re !== !1, F = ie ? Bo({
|
|
10075
|
-
getData: () =>
|
|
10076
|
-
consumeDataDirty: () =>
|
|
10291
|
+
getData: () => z()?.bind,
|
|
10292
|
+
consumeDataDirty: () => R?.consumeDataDirty?.() ?? !0,
|
|
10077
10293
|
slotPaths: O ? [""] : [],
|
|
10078
10294
|
vfsStore: x,
|
|
10079
10295
|
todosMw: S,
|
|
10080
10296
|
getTodos: () => D.current?.getState?.()?.todos ?? [],
|
|
10081
10297
|
messages: b,
|
|
10082
10298
|
maxCheckpoints: re && typeof re == "object" ? re.maxCheckpoints : void 0
|
|
10083
|
-
}) : null, I = !re || typeof re != "object" || re.auto !== !1, L = zl(e.capabilities),
|
|
10299
|
+
}) : null, I = !re || typeof re != "object" || re.auto !== !1, L = zl(e.capabilities), ae = L.dataOps, oe = L.draftWrite, se = L.tracing, ce = L.automation, le = ac({
|
|
10084
10300
|
...e,
|
|
10085
10301
|
locale: e.i18n?.locale
|
|
10086
10302
|
});
|
|
10087
10303
|
if (N) {
|
|
10088
10304
|
let e = M.map((e) => e._codeAsset.orchestratorPrompt).filter(Boolean).join("\n\n");
|
|
10089
|
-
e && (
|
|
10090
|
-
} else O?.schema && Qi(O.schema) && (
|
|
10091
|
-
let
|
|
10305
|
+
e && (le += "\n\n" + e);
|
|
10306
|
+
} else O?.schema && Qi(O.schema) && (le += "\n\n" + ga.htmlDirectWriteFallback, console.warn("[page-agent-sdk] 检测到 schema 含 code 字段但未注册 html 子 agent:已自动注入「主 agent 自己写 HTML」编排(code 作普通字段直接 write,无 vfs 工作副本 / 无格式校验门禁)。如需代码资产机制(vfs + 格式校验 + 增量 commit + 主上下文 code 摘要),注册 createHtmlSubagent;若确为降级意图可忽略。"));
|
|
10307
|
+
let ue = ae && O ? Fu(O, {
|
|
10092
10308
|
onAudit: e.onAudit ?? (e.debug ? (e) => console.log("[page-agent-sdk][data audit]", e) : void 0),
|
|
10093
10309
|
maxSnapshots: e.maxSnapshots,
|
|
10094
10310
|
onConflict: a.set,
|
|
10095
10311
|
autoLock: e.autoLock,
|
|
10096
10312
|
interceptors: e.interceptors,
|
|
10097
|
-
vfsStore:
|
|
10313
|
+
vfsStore: oe || O?.resources?.length ? x : void 0,
|
|
10098
10314
|
...P.length ? { pgIdPaths: P } : {},
|
|
10099
10315
|
...ne.length ? { largeTextPaths: ne } : {}
|
|
10100
|
-
}) : [],
|
|
10101
|
-
getResourcesSnapshot: () =>
|
|
10316
|
+
}) : [], de = ae ? Eu(ue, e.toolMode) : [], R = ae && O ? ue.controller ?? null : null, fe = ae && O?.resources?.length && R?.getResourcesSnapshot ? cd({
|
|
10317
|
+
getResourcesSnapshot: () => R?.getResourcesSnapshot?.() ?? [],
|
|
10102
10318
|
toolsExposed: e.toolMode === "advanced"
|
|
10103
|
-
}) : void 0,
|
|
10104
|
-
|
|
10105
|
-
let
|
|
10106
|
-
|
|
10107
|
-
let
|
|
10108
|
-
|
|
10109
|
-
let
|
|
10110
|
-
|
|
10111
|
-
let
|
|
10319
|
+
}) : void 0, z = () => R?.get() ?? O, B = /* @__PURE__ */ new Map(), pe = id(L, de, Lu, Uu, Xu);
|
|
10320
|
+
pe.forEach((e) => B.set(e.name, "builtin"));
|
|
10321
|
+
let me = [...e.tools || []];
|
|
10322
|
+
me.forEach((e) => B.set(e.name, "user"));
|
|
10323
|
+
let V = $u(e.actions ?? {});
|
|
10324
|
+
V.forEach((e) => B.set(e.name, "action"));
|
|
10325
|
+
let he = [], ge = !1, _e = e.humanConfirm !== !1 && (!e.approval || e.approval.humanConfirmTool !== !1), ve = _e ? Mo() : null;
|
|
10326
|
+
ve && B.set(Ao, "builtin");
|
|
10327
|
+
let ye = ie && F ? [r(async () => {
|
|
10112
10328
|
let e = F.list();
|
|
10113
10329
|
return e.length ? F.restore() ? `已回退到最近一次正常状态(checkpoint #${e[e.length - 1].id})。对话历史、主数据、vfs、todos 已整体还原。请基于回退后的状态重新判断并继续。` : "回退失败:无可用 checkpoint。" : "无可用 checkpoint,无法回退。";
|
|
10114
10330
|
}, {
|
|
@@ -10123,9 +10339,9 @@ function wd(e, n) {
|
|
|
10123
10339
|
description: "列出可用会话 checkpoint(回退点)。",
|
|
10124
10340
|
schema: t.object({}).optional()
|
|
10125
10341
|
})] : [];
|
|
10126
|
-
|
|
10127
|
-
let
|
|
10128
|
-
let n =
|
|
10342
|
+
ye.forEach((e) => B.set(e.name, "builtin"));
|
|
10343
|
+
let H = L.focus, be = r(async ({ path: e, label: t }) => {
|
|
10344
|
+
let n = z()?.schema;
|
|
10129
10345
|
return n ? Ji(n, e) ? (w.setFocus({
|
|
10130
10346
|
path: e,
|
|
10131
10347
|
...t ? { label: t } : {}
|
|
@@ -10137,12 +10353,12 @@ function wd(e, n) {
|
|
|
10137
10353
|
path: t.string().describe("要聚焦的组件 jsonPath,如 components.3"),
|
|
10138
10354
|
label: t.string().optional().describe("人类可读标签,如「导航栏」")
|
|
10139
10355
|
})
|
|
10140
|
-
}),
|
|
10356
|
+
}), xe = r(async () => (w.clearFocus(), "已清除聚焦,恢复全量可操作范围(可读写所有组件)。"), {
|
|
10141
10357
|
name: "clear_focus",
|
|
10142
10358
|
description: "清除当前聚焦,退出精修模式,恢复对全部组件的读写权限。",
|
|
10143
10359
|
schema: t.object({}).optional()
|
|
10144
|
-
}),
|
|
10145
|
-
let n =
|
|
10360
|
+
}), Se = r(async ({ path: e, label: t }) => {
|
|
10361
|
+
let n = z()?.schema;
|
|
10146
10362
|
if (!n) return "聚焦失败:当前无主数据 schema,无法聚焦。";
|
|
10147
10363
|
if (!Ji(n, e)) return `PATH_DENIED · 聚焦失败:path "${e}" 不在 schema 内。请先用 read 查看可操作路径再聚焦。`;
|
|
10148
10364
|
w.addFocus({
|
|
@@ -10158,7 +10374,7 @@ function wd(e, n) {
|
|
|
10158
10374
|
path: t.string().describe("要追加聚焦的组件 jsonPath,如 components.3"),
|
|
10159
10375
|
label: t.string().optional().describe("人类可读标签")
|
|
10160
10376
|
})
|
|
10161
|
-
}),
|
|
10377
|
+
}), Ce = r(async ({ path: e }) => {
|
|
10162
10378
|
let t = w.getFocuses().length;
|
|
10163
10379
|
w.removeFocus(e);
|
|
10164
10380
|
let n = w.getFocuses();
|
|
@@ -10167,81 +10383,81 @@ function wd(e, n) {
|
|
|
10167
10383
|
name: "remove_focus",
|
|
10168
10384
|
description: "移除单个聚焦焦点(by path),保留其他焦点。移除最后一个等价退出精修。全部退出用 clear_focus。",
|
|
10169
10385
|
schema: t.object({ path: t.string().describe("要移除的焦点 jsonPath") })
|
|
10170
|
-
}),
|
|
10171
|
-
ye,
|
|
10386
|
+
}), we = H && e.toolMode === "advanced" ? [
|
|
10172
10387
|
be,
|
|
10173
10388
|
xe,
|
|
10174
|
-
Se
|
|
10389
|
+
Se,
|
|
10390
|
+
Ce
|
|
10175
10391
|
] : [];
|
|
10176
|
-
|
|
10177
|
-
let
|
|
10178
|
-
function
|
|
10392
|
+
we.forEach((e) => B.set(e.name, "builtin"));
|
|
10393
|
+
let Te = [], Ee = /* @__PURE__ */ new Map(), U = W();
|
|
10394
|
+
function W() {
|
|
10179
10395
|
let { tools: e, collisions: t } = ad([
|
|
10180
10396
|
{
|
|
10181
10397
|
label: "builtin",
|
|
10182
|
-
tools:
|
|
10398
|
+
tools: pe
|
|
10183
10399
|
},
|
|
10184
10400
|
{
|
|
10185
10401
|
label: "user",
|
|
10186
|
-
tools:
|
|
10402
|
+
tools: me
|
|
10187
10403
|
},
|
|
10188
10404
|
{
|
|
10189
10405
|
label: "action",
|
|
10190
|
-
tools:
|
|
10406
|
+
tools: V
|
|
10191
10407
|
},
|
|
10192
10408
|
{
|
|
10193
10409
|
label: "humanConfirm",
|
|
10194
|
-
tools:
|
|
10410
|
+
tools: ve ? [ve] : []
|
|
10195
10411
|
},
|
|
10196
10412
|
{
|
|
10197
10413
|
label: "checkpoint",
|
|
10198
|
-
tools:
|
|
10414
|
+
tools: ye
|
|
10199
10415
|
},
|
|
10200
10416
|
{
|
|
10201
10417
|
label: "focus",
|
|
10202
|
-
tools:
|
|
10418
|
+
tools: we
|
|
10203
10419
|
},
|
|
10204
10420
|
{
|
|
10205
10421
|
label: "mcp",
|
|
10206
|
-
tools:
|
|
10422
|
+
tools: he
|
|
10207
10423
|
},
|
|
10208
10424
|
{
|
|
10209
10425
|
label: "skill",
|
|
10210
|
-
tools:
|
|
10426
|
+
tools: Te
|
|
10211
10427
|
}
|
|
10212
10428
|
]);
|
|
10213
10429
|
return t.length && console.warn("[page-agent-sdk] 工具重名,后注册覆盖先注册:", t.map((e) => `${e.name}(${e.loser}→${e.winner})`).join(", ")), e;
|
|
10214
10430
|
}
|
|
10215
|
-
let
|
|
10216
|
-
if (
|
|
10217
|
-
if (
|
|
10218
|
-
let
|
|
10431
|
+
let De = L.planning, Oe = L.missionAnchor, ke = L.workingMemory, Ae = L.skills, je = L.vfs || N;
|
|
10432
|
+
if (je) for (let e of gc) B.set(e, "builtin");
|
|
10433
|
+
if (De) for (let e of S.tools ?? []) B.set(e.name, "builtin");
|
|
10434
|
+
let Me = L.summarization, Ne = L.agentCompression && !!d;
|
|
10219
10435
|
e.debug && L.agentCompression && !d && console.warn("[page-agent-sdk][agentCompression] agentCompression 开启但 summaryLlm 不可用(或缺 apiKey / 模型不支持工具),压缩决策不启用,回退静态压缩");
|
|
10220
|
-
let
|
|
10221
|
-
|
|
10222
|
-
let
|
|
10223
|
-
llm:
|
|
10224
|
-
allTools: () => J.agent?.allTools ??
|
|
10225
|
-
allowedTools:
|
|
10226
|
-
systemPrompt:
|
|
10227
|
-
temperature:
|
|
10228
|
-
maxTokens:
|
|
10229
|
-
skills:
|
|
10230
|
-
maxDepth:
|
|
10231
|
-
maxParallel:
|
|
10436
|
+
let Pe = L.memory, Fe = L.subagent, Ie = Fe ? us() : void 0, Le = e.verify?.maxAttempts ?? 2, Re = !!(e.verify?.check || e.verify?.maxAttempts || e.verify?.adversarial), ze = e.capabilities?.verify === !1, Be = (L.verify || Re && !ze) && e.verify?.enabled !== !1 && Le > 0, Ve = L.contextInspector;
|
|
10437
|
+
Re && !Be && e.verify?.enabled !== !1 && console.warn("[page-agent-sdk][verify] 检测到 verify 配置(check/maxAttempts/adversarial)但未装载(capabilities.verify:false 显式关闭 或 maxAttempts≤0)");
|
|
10438
|
+
let He = e.subagent, Ue = He?.allowedTools ?? [], We = e.permissions?.length ? Oo(e.permissions) : void 0, Ge = e.approval && (e.approval.tools !== void 0 || e.approval.confirm) ? ko(e.approval) : void 0, Ke = [...We ? [We] : [], ...Ge ? [Ge] : []], qe = !Fe || He?.enabled === !1 ? void 0 : Es({
|
|
10439
|
+
llm: He?.llm ?? e.llm,
|
|
10440
|
+
allTools: () => J.agent?.allTools ?? U,
|
|
10441
|
+
allowedTools: Ue.length ? Ue : void 0,
|
|
10442
|
+
systemPrompt: He?.systemPrompt,
|
|
10443
|
+
temperature: He?.temperature,
|
|
10444
|
+
maxTokens: He?.maxTokens,
|
|
10445
|
+
skills: He?.skills,
|
|
10446
|
+
maxDepth: He?.maxDepth,
|
|
10447
|
+
maxParallel: He?.maxParallel,
|
|
10232
10448
|
debug: e.debug,
|
|
10233
10449
|
getFocuses: () => w.getFocuses(),
|
|
10234
|
-
getSchema: () =>
|
|
10235
|
-
tracker:
|
|
10236
|
-
guardMiddleware:
|
|
10237
|
-
getVfsFiles:
|
|
10238
|
-
enterDataScope:
|
|
10239
|
-
exitDataScope:
|
|
10450
|
+
getSchema: () => z()?.schema ?? null,
|
|
10451
|
+
tracker: Ie,
|
|
10452
|
+
guardMiddleware: Ke.length ? Ke : void 0,
|
|
10453
|
+
getVfsFiles: je ? () => x.files : void 0,
|
|
10454
|
+
enterDataScope: R?.enterScope ? (e) => R.enterScope(e) : void 0,
|
|
10455
|
+
exitDataScope: R?.exitScope ? (e) => R.exitScope(e) : void 0,
|
|
10240
10456
|
onUsage: (e) => {
|
|
10241
10457
|
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);
|
|
10242
10458
|
},
|
|
10243
|
-
timeoutMs:
|
|
10244
|
-
}),
|
|
10459
|
+
timeoutMs: He?.timeoutMs
|
|
10460
|
+
}), Je = te?.map((e) => {
|
|
10245
10461
|
if (!e._codeAsset) return e;
|
|
10246
10462
|
let t = e._codeAsset, n = Pc({
|
|
10247
10463
|
writablePaths: t.writablePaths,
|
|
@@ -10250,165 +10466,181 @@ function wd(e, n) {
|
|
|
10250
10466
|
codeField: t.codeField,
|
|
10251
10467
|
craftNotes: t.craftNotes,
|
|
10252
10468
|
onWarning: (e) => console.warn(`[page-agent-sdk][code-asset] ${e}`),
|
|
10253
|
-
getController: () =>
|
|
10469
|
+
getController: () => R,
|
|
10254
10470
|
vfsStore: x
|
|
10255
10471
|
}), r = [...e.middleware ?? [], n];
|
|
10256
|
-
for (let e of r) e && typeof e == "object" && typeof e._setGetController == "function" && e._setGetController(() =>
|
|
10472
|
+
for (let e of r) e && typeof e == "object" && typeof e._setGetController == "function" && e._setGetController(() => R);
|
|
10257
10473
|
return {
|
|
10258
10474
|
...e,
|
|
10259
10475
|
middleware: r
|
|
10260
10476
|
};
|
|
10261
|
-
}),
|
|
10262
|
-
getBind: () =>
|
|
10477
|
+
}), Ye = N && Fe ? Fc() : void 0, Xe = Ye ? Vc({
|
|
10478
|
+
getBind: () => z()?.bind,
|
|
10263
10479
|
writablePaths: P,
|
|
10264
|
-
getLocked: () =>
|
|
10265
|
-
tools:
|
|
10266
|
-
}) : void 0,
|
|
10480
|
+
getLocked: () => Ye.locked(),
|
|
10481
|
+
tools: U
|
|
10482
|
+
}) : void 0, Ze = Fe && Je !== void 0 ? ks(Je, {
|
|
10267
10483
|
llm: e.llm,
|
|
10268
|
-
allTools: () => J.agent?.allTools ??
|
|
10484
|
+
allTools: () => J.agent?.allTools ?? U,
|
|
10269
10485
|
debug: e.debug,
|
|
10270
10486
|
getFocuses: () => w.getFocuses(),
|
|
10271
|
-
getSchema: () =>
|
|
10272
|
-
getBind: () =>
|
|
10273
|
-
tracker:
|
|
10274
|
-
guardMiddleware:
|
|
10275
|
-
getVfsFiles:
|
|
10276
|
-
enterDataScope:
|
|
10277
|
-
exitDataScope:
|
|
10487
|
+
getSchema: () => z()?.schema ?? null,
|
|
10488
|
+
getBind: () => z()?.bind,
|
|
10489
|
+
tracker: Ie,
|
|
10490
|
+
guardMiddleware: Ke.length ? Ke : void 0,
|
|
10491
|
+
getVfsFiles: je ? () => x.files : void 0,
|
|
10492
|
+
enterDataScope: R?.enterScope ? (e) => R.enterScope(e) : void 0,
|
|
10493
|
+
exitDataScope: R?.exitScope ? (e) => R.exitScope(e) : void 0,
|
|
10278
10494
|
onUsage: (e) => {
|
|
10279
10495
|
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);
|
|
10280
10496
|
},
|
|
10281
10497
|
timeoutMs: e.subagent?.timeoutMs,
|
|
10282
|
-
...
|
|
10283
|
-
componentLock:
|
|
10284
|
-
resolveComponents: (e) => Ic(e, Ac(
|
|
10498
|
+
...Ye ? {
|
|
10499
|
+
componentLock: Ye,
|
|
10500
|
+
resolveComponents: (e) => Ic(e, Ac(z()?.bind, P))
|
|
10285
10501
|
} : {}
|
|
10286
|
-
}) : void 0,
|
|
10502
|
+
}) : void 0, Qe = Ze ? Ze.controller : null, $e = [
|
|
10287
10503
|
"get_data",
|
|
10288
10504
|
"describe_data",
|
|
10289
10505
|
"read",
|
|
10290
10506
|
"fetch_document"
|
|
10291
|
-
],
|
|
10507
|
+
], et = U.filter((e) => $e.includes(e.name)), tt = Be ? As({
|
|
10292
10508
|
check: e.verify.check ?? Is({
|
|
10293
|
-
schemas: () =>
|
|
10294
|
-
root: () =>
|
|
10509
|
+
schemas: () => z() ? { "": z().schema } : {},
|
|
10510
|
+
root: () => z()?.bind
|
|
10295
10511
|
}),
|
|
10296
10512
|
adversarial: e.verify?.adversarial ? {
|
|
10297
10513
|
llm: e.llm,
|
|
10298
|
-
tools:
|
|
10514
|
+
tools: et
|
|
10299
10515
|
} : void 0
|
|
10300
|
-
}) : void 0,
|
|
10516
|
+
}) : void 0, nt = Ve ? Xs({
|
|
10301
10517
|
contextWindow: f.contextWindow,
|
|
10302
10518
|
thresholdRatio: Ul(e, f.contextWindow).summaryThresholdRatio
|
|
10303
|
-
}) : void 0,
|
|
10519
|
+
}) : void 0, rt = sd({
|
|
10304
10520
|
...L,
|
|
10305
|
-
humanConfirm:
|
|
10521
|
+
humanConfirm: _e,
|
|
10306
10522
|
subagents: te?.map((e) => ({
|
|
10307
10523
|
id: e.id,
|
|
10308
10524
|
description: e.description,
|
|
10309
10525
|
temperature: e.temperature
|
|
10310
10526
|
}))
|
|
10311
|
-
},
|
|
10527
|
+
}, ae && !!O, e.toolMode, !!O?.resources?.length, { promptSoftCap: as(f.contextWindow, h.promptSoftCapTokens) }), it = O ? {
|
|
10312
10528
|
name: "dataHint",
|
|
10313
|
-
augmentPrompt: () => ic(
|
|
10314
|
-
} : null,
|
|
10529
|
+
augmentPrompt: () => ic(z(), e.schemaHint) || void 0
|
|
10530
|
+
} : null, at = e.augmentSystem ? {
|
|
10315
10531
|
name: "augmentSystem",
|
|
10316
10532
|
augmentPrompt: (t) => {
|
|
10317
10533
|
try {
|
|
10318
10534
|
return e.augmentSystem({
|
|
10319
10535
|
state: t,
|
|
10320
|
-
data:
|
|
10536
|
+
data: z()
|
|
10321
10537
|
});
|
|
10322
10538
|
} catch (t) {
|
|
10323
10539
|
e.debug && console.log("[page-agent-sdk][augmentSystem] 回调抛错,降级跳过:", t.message);
|
|
10324
10540
|
return;
|
|
10325
10541
|
}
|
|
10326
10542
|
}
|
|
10327
|
-
} : null,
|
|
10543
|
+
} : null, ot = Bl(e.onEvent), G = ot.emit, st, ct = [], lt = (e) => ({
|
|
10328
10544
|
name: e.name,
|
|
10329
10545
|
description: e.description,
|
|
10330
10546
|
content: typeof e.getContent == "function" ? e.getContent() : ""
|
|
10331
|
-
}),
|
|
10547
|
+
}), ut = (e) => ({
|
|
10332
10548
|
name: e.name,
|
|
10333
10549
|
description: e.description,
|
|
10334
10550
|
getContent: () => e.content
|
|
10335
|
-
}),
|
|
10551
|
+
}), dt = e.skillStorage === !1 ? null : pd({
|
|
10336
10552
|
...typeof e.skillStorage == "object" ? e.skillStorage : {},
|
|
10337
10553
|
id: e.skillStorage && typeof e.skillStorage == "object" && e.skillStorage.id ? e.skillStorage.id : `agent::${n}`
|
|
10338
|
-
}),
|
|
10339
|
-
|
|
10554
|
+
}), ft = L.preferences, pt = ft && e.preferenceStorage !== !1 ? bd({
|
|
10555
|
+
...typeof e.preferenceStorage == "object" ? e.preferenceStorage : {},
|
|
10556
|
+
id: e.preferenceStorage && typeof e.preferenceStorage == "object" && e.preferenceStorage.id ? e.preferenceStorage.id : `agent::${n}`
|
|
10557
|
+
}) : null, mt = pt ? jd({
|
|
10558
|
+
store: pt,
|
|
10559
|
+
llmInvoke: l,
|
|
10560
|
+
getSessionId: () => J.sessionId,
|
|
10561
|
+
onDebug: (e) => {
|
|
10562
|
+
let t = J.agent?.debugLogs;
|
|
10563
|
+
t && (t.value.push({
|
|
10564
|
+
timestamp: Date.now(),
|
|
10565
|
+
type: "middleware",
|
|
10566
|
+
data: e
|
|
10567
|
+
}), Pt(t));
|
|
10568
|
+
}
|
|
10569
|
+
}) : null, ht = () => {
|
|
10570
|
+
let t = st ? st.controller : null;
|
|
10340
10571
|
if (t) {
|
|
10341
|
-
let n = (e.skills || []).filter((e) => !
|
|
10342
|
-
t.set([...n, ...
|
|
10572
|
+
let n = (e.skills || []).filter((e) => !ct.some((t) => t.name === e.name));
|
|
10573
|
+
t.set([...n, ...ct]);
|
|
10343
10574
|
}
|
|
10344
10575
|
J.infoTick.value++;
|
|
10345
|
-
},
|
|
10346
|
-
if (
|
|
10347
|
-
let t = await
|
|
10576
|
+
}, gt = async () => {
|
|
10577
|
+
if (dt) try {
|
|
10578
|
+
let t = await dt.list();
|
|
10348
10579
|
if (t.length) {
|
|
10349
|
-
|
|
10350
|
-
let n =
|
|
10580
|
+
ct = t.map(ut);
|
|
10581
|
+
let n = st ? st.controller : null;
|
|
10351
10582
|
if (n) {
|
|
10352
|
-
let t = (e.skills || []).filter((e) => !
|
|
10353
|
-
n.set([...t, ...
|
|
10583
|
+
let t = (e.skills || []).filter((e) => !ct.some((t) => t.name === e.name));
|
|
10584
|
+
n.set([...t, ...ct]);
|
|
10354
10585
|
}
|
|
10355
10586
|
J.infoTick.value++;
|
|
10356
10587
|
}
|
|
10357
10588
|
} catch {}
|
|
10358
|
-
},
|
|
10589
|
+
}, _t = Me ? ls({
|
|
10359
10590
|
...h,
|
|
10360
10591
|
llmInvoke: l,
|
|
10361
|
-
getRegisteredData: () =>
|
|
10592
|
+
getRegisteredData: () => z() ? [{ description: z().description ?? "主数据对象" }] : [],
|
|
10362
10593
|
preserveLastToolResults: _,
|
|
10363
|
-
...
|
|
10594
|
+
...Ne ? {
|
|
10364
10595
|
decideInvoke: d,
|
|
10365
|
-
getSnapshot: () =>
|
|
10596
|
+
getSnapshot: () => nt?.getSnapshot()
|
|
10366
10597
|
} : {}
|
|
10367
|
-
}) : void 0,
|
|
10368
|
-
...
|
|
10369
|
-
|
|
10370
|
-
...
|
|
10371
|
-
...
|
|
10372
|
-
...
|
|
10373
|
-
|
|
10598
|
+
}) : void 0, vt = Gl([
|
|
10599
|
+
...it ? [it] : [],
|
|
10600
|
+
rt,
|
|
10601
|
+
...Oe ? [C] : [],
|
|
10602
|
+
...mt ? [mt] : [],
|
|
10603
|
+
...De ? [S] : [],
|
|
10604
|
+
...Ae ? [st = xo(e.skills || [], {
|
|
10605
|
+
readVfs: je ? (e) => x.files[e]?.content : void 0,
|
|
10374
10606
|
hostScriptEnabled: L.skillHostScript,
|
|
10375
10607
|
onToolsReady: (e, t) => {
|
|
10376
10608
|
for (let n of t) {
|
|
10377
|
-
let t =
|
|
10378
|
-
t >= 0 &&
|
|
10609
|
+
let t = Te.findIndex((e) => e.name === n.name);
|
|
10610
|
+
t >= 0 && Te.splice(t, 1), Te.push(n), Ee.set(n.name, e), B.set(n.name, `skill:${e}`);
|
|
10379
10611
|
}
|
|
10380
|
-
|
|
10612
|
+
U = W(), J.agent && J.agent.setTools(U), J.infoTick.value++;
|
|
10381
10613
|
}
|
|
10382
10614
|
})] : [],
|
|
10383
|
-
...
|
|
10384
|
-
...
|
|
10385
|
-
...
|
|
10386
|
-
...
|
|
10387
|
-
...
|
|
10388
|
-
...
|
|
10389
|
-
...
|
|
10615
|
+
...je ? [vc(x)] : [],
|
|
10616
|
+
..._t ? [_t] : [],
|
|
10617
|
+
...ke ? [T] : [],
|
|
10618
|
+
...H ? [w] : [],
|
|
10619
|
+
...fe ? [fe] : [],
|
|
10620
|
+
...Pe ? [E] : [],
|
|
10621
|
+
...We ? [We] : [],
|
|
10390
10622
|
...ie && I && F ? [Vo(F)] : [],
|
|
10391
|
-
...
|
|
10392
|
-
...Ue ? [Ue] : [],
|
|
10393
|
-
...$e ? [$e] : [],
|
|
10623
|
+
..._e ? [No()] : [],
|
|
10394
10624
|
...Ge ? [Ge] : [],
|
|
10395
|
-
...
|
|
10396
|
-
...
|
|
10397
|
-
...
|
|
10398
|
-
...
|
|
10625
|
+
...tt ? [tt] : [],
|
|
10626
|
+
...qe ? [qe] : [],
|
|
10627
|
+
...Ze ? [Ze] : [],
|
|
10628
|
+
...Xe ? [Xe] : [],
|
|
10629
|
+
...at ? [at] : [],
|
|
10630
|
+
...nt ? [nt] : [],
|
|
10399
10631
|
...e.middleware || [],
|
|
10400
|
-
...
|
|
10632
|
+
...ce ? [Zu(i, {
|
|
10401
10633
|
tokenBudget: e.tokenBudget,
|
|
10402
10634
|
timeBudgetMs: e.timeBudgetMs
|
|
10403
|
-
},
|
|
10404
|
-
|
|
10405
|
-
]),
|
|
10406
|
-
function
|
|
10407
|
-
if (
|
|
10635
|
+
}, G)] : [],
|
|
10636
|
+
Bd(G, b, z, i)
|
|
10637
|
+
]), yt = e.maxMemoryRounds ?? Id, xt = e.approval?.timeoutMs, St = xt === void 0 || xt === 0 ? 3e4 : !Number.isFinite(xt) || xt < 0 ? 0 : xt;
|
|
10638
|
+
function Ct(e) {
|
|
10639
|
+
if (St) return (t) => {
|
|
10408
10640
|
if (t.type !== "approval_request") return;
|
|
10409
10641
|
let n = Date.now(), r = t.toolName;
|
|
10410
10642
|
setTimeout(() => {
|
|
10411
|
-
e?.aborted || (t.resolve(!1),
|
|
10643
|
+
e?.aborted || (t.resolve(!1), G({
|
|
10412
10644
|
type: "error",
|
|
10413
10645
|
message: `确认请求(${r})${Math.round((Date.now() - n) / 1e3)}s 无响应已自动拒绝 —— send/batch 路径无 UI 响应方;可传 approval.timeoutMs 调整(Infinity = 无限等)`,
|
|
10414
10646
|
severity: "observable",
|
|
@@ -10418,43 +10650,43 @@ function wd(e, n) {
|
|
|
10418
10650
|
waitedMs: Date.now() - n
|
|
10419
10651
|
}
|
|
10420
10652
|
}));
|
|
10421
|
-
},
|
|
10653
|
+
}, St);
|
|
10422
10654
|
};
|
|
10423
10655
|
}
|
|
10424
|
-
function
|
|
10425
|
-
let t =
|
|
10656
|
+
function wt(e) {
|
|
10657
|
+
let t = Ct(e);
|
|
10426
10658
|
return (e) => {
|
|
10427
|
-
t?.(e), e.type === "error" &&
|
|
10659
|
+
t?.(e), e.type === "error" && G(e);
|
|
10428
10660
|
};
|
|
10429
10661
|
}
|
|
10430
|
-
let
|
|
10431
|
-
async function
|
|
10662
|
+
let Tt = /* @__PURE__ */ At([]);
|
|
10663
|
+
async function K() {
|
|
10432
10664
|
if (s) try {
|
|
10433
|
-
|
|
10665
|
+
Tt.value = (await s.listSessions(n)).sort((e, t) => t.lastAccessed - e.lastAccessed);
|
|
10434
10666
|
} catch (t) {
|
|
10435
10667
|
e.debug && console.warn("[page-agent-sdk][persist] refreshSessions 失败(已吞):", t);
|
|
10436
10668
|
}
|
|
10437
10669
|
}
|
|
10438
|
-
let
|
|
10439
|
-
function
|
|
10670
|
+
let Et = Fd(), q = /* @__PURE__ */ new Set();
|
|
10671
|
+
function Dt(e) {
|
|
10440
10672
|
let t = new AbortController(), n = () => t.abort();
|
|
10441
|
-
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })),
|
|
10673
|
+
return e && (e.aborted ? t.abort() : e.addEventListener("abort", n, { once: !0 })), q.add(t), {
|
|
10442
10674
|
controller: t,
|
|
10443
10675
|
untrack: () => {
|
|
10444
|
-
|
|
10676
|
+
q.delete(t), e?.removeEventListener("abort", n);
|
|
10445
10677
|
}
|
|
10446
10678
|
};
|
|
10447
10679
|
}
|
|
10448
|
-
function
|
|
10449
|
-
for (let e of
|
|
10450
|
-
|
|
10680
|
+
function Ot() {
|
|
10681
|
+
for (let e of q) e.abort();
|
|
10682
|
+
q.clear();
|
|
10451
10683
|
}
|
|
10452
10684
|
let J = {
|
|
10453
10685
|
agentId: n,
|
|
10454
10686
|
store: s,
|
|
10455
10687
|
messages: b,
|
|
10456
10688
|
vfsStore: x,
|
|
10457
|
-
listeners:
|
|
10689
|
+
listeners: ot.listeners,
|
|
10458
10690
|
todosMw: S,
|
|
10459
10691
|
memoryMw: E,
|
|
10460
10692
|
missionMw: C,
|
|
@@ -10467,55 +10699,55 @@ function wd(e, n) {
|
|
|
10467
10699
|
mcpClosers: [],
|
|
10468
10700
|
mcpServers: [],
|
|
10469
10701
|
checkpoint: F,
|
|
10470
|
-
dataOpsController:
|
|
10471
|
-
skillsController:
|
|
10702
|
+
dataOpsController: R,
|
|
10703
|
+
skillsController: st ? st.controller : null,
|
|
10472
10704
|
infoTick: o,
|
|
10473
10705
|
pendingConflict: a.pendingConflict,
|
|
10474
|
-
sessions:
|
|
10475
|
-
refreshSessions:
|
|
10476
|
-
liveData:
|
|
10706
|
+
sessions: Tt,
|
|
10707
|
+
refreshSessions: K,
|
|
10708
|
+
liveData: z,
|
|
10477
10709
|
usage: i,
|
|
10478
|
-
emit:
|
|
10479
|
-
runSerial:
|
|
10480
|
-
trackActive:
|
|
10481
|
-
abortAllActive:
|
|
10710
|
+
emit: G,
|
|
10711
|
+
runSerial: Et,
|
|
10712
|
+
trackActive: Dt,
|
|
10713
|
+
abortAllActive: Ot,
|
|
10482
10714
|
unloadSkillTools(e) {
|
|
10483
10715
|
if (e) {
|
|
10484
|
-
let t =
|
|
10485
|
-
if (
|
|
10716
|
+
let t = Te.length;
|
|
10717
|
+
if (Te = Te.filter((t) => Ee.get(t.name) === e ? (B.delete(t.name), Ee.delete(t.name), !1) : !0), Te.length === t) return;
|
|
10486
10718
|
} else {
|
|
10487
|
-
if (!
|
|
10488
|
-
for (let e of
|
|
10489
|
-
|
|
10719
|
+
if (!Te.length) return;
|
|
10720
|
+
for (let e of Te) B.delete(e.name), Ee.delete(e.name);
|
|
10721
|
+
Te = [];
|
|
10490
10722
|
}
|
|
10491
|
-
|
|
10723
|
+
U = W(), J.agent && J.agent.setTools(U);
|
|
10492
10724
|
},
|
|
10493
10725
|
applySnapshot(t) {
|
|
10494
|
-
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 && F && F.importStack(t.checkpoints), t.usage && Object.assign(i, t.usage), t.mission &&
|
|
10726
|
+
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 && F && F.importStack(t.checkpoints), t.usage && Object.assign(i, t.usage), t.mission && Oe && C.setMission(t.mission), t.workingMemory && ke && T.restore(t.workingMemory), H) {
|
|
10495
10727
|
let n = t.focus, r = n ? Array.isArray(n) ? n : [n] : [];
|
|
10496
10728
|
if (r.length) {
|
|
10497
|
-
let t =
|
|
10729
|
+
let t = z()?.schema, n = t ? r.filter((e) => Ji(t, e.path)) : [];
|
|
10498
10730
|
if (n.length && (w.setFocus(null), n.forEach((e) => w.addFocus(e))), e.debug && n.length < r.length) {
|
|
10499
10731
|
let e = r.filter((e) => !n.includes(e)).map((e) => e.path);
|
|
10500
10732
|
console.warn("[page-agent-sdk][focus] 恢复的焦点部分 path 已失效(schema 变化/无 schema),剔除:", e);
|
|
10501
10733
|
}
|
|
10502
10734
|
}
|
|
10503
10735
|
}
|
|
10504
|
-
|
|
10736
|
+
Nt();
|
|
10505
10737
|
},
|
|
10506
10738
|
addSkill(e) {
|
|
10507
|
-
let t =
|
|
10508
|
-
t >= 0 ?
|
|
10739
|
+
let t = ct.findIndex((t) => t.name === e.name);
|
|
10740
|
+
t >= 0 ? ct[t] = e : ct.push(e), ht(), dt && dt.put(lt(e));
|
|
10509
10741
|
},
|
|
10510
10742
|
removeSkill(e) {
|
|
10511
|
-
let t =
|
|
10512
|
-
return t < 0 ? !1 : (
|
|
10743
|
+
let t = ct.findIndex((t) => t.name === e);
|
|
10744
|
+
return t < 0 ? !1 : (ct.splice(t, 1), ht(), dt && dt.remove(e), !0);
|
|
10513
10745
|
},
|
|
10514
10746
|
listUserSkills() {
|
|
10515
|
-
return
|
|
10747
|
+
return ct.map((e) => e.name);
|
|
10516
10748
|
},
|
|
10517
10749
|
getUserSkill(e) {
|
|
10518
|
-
let t =
|
|
10750
|
+
let t = ct.find((t) => t.name === e);
|
|
10519
10751
|
if (t) return {
|
|
10520
10752
|
name: t.name,
|
|
10521
10753
|
description: t.description,
|
|
@@ -10523,17 +10755,17 @@ function wd(e, n) {
|
|
|
10523
10755
|
};
|
|
10524
10756
|
},
|
|
10525
10757
|
afterRound() {
|
|
10526
|
-
|
|
10758
|
+
Ft(), Vt();
|
|
10527
10759
|
},
|
|
10528
10760
|
async send(e, t) {
|
|
10529
10761
|
if (await J.initDone, J.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 send");
|
|
10530
|
-
t ??= {}, t?.mission &&
|
|
10762
|
+
t ??= {}, t?.mission && Oe && C.setMission(t.mission);
|
|
10531
10763
|
let n = e;
|
|
10532
10764
|
if (t.interceptors?.input) try {
|
|
10533
10765
|
let r = t.interceptors.input(e);
|
|
10534
10766
|
typeof r == "string" && (n = r);
|
|
10535
10767
|
} catch {}
|
|
10536
|
-
let r =
|
|
10768
|
+
let r = ce ? t.maxAutoRetries ?? 1 : 0, i = 0, a = !1, o = wt(t.signal), c = J.sessionId;
|
|
10537
10769
|
for (;;) {
|
|
10538
10770
|
a ||= (b.push({
|
|
10539
10771
|
role: "user",
|
|
@@ -10565,7 +10797,7 @@ function wd(e, n) {
|
|
|
10565
10797
|
if (di(e, t.signal)) throw e;
|
|
10566
10798
|
let n = Zr(e, "fatal");
|
|
10567
10799
|
if (i < r && F?.canRestore()) {
|
|
10568
|
-
i += 1, F.restore(), a = !0,
|
|
10800
|
+
i += 1, F.restore(), a = !0, G({
|
|
10569
10801
|
type: "error",
|
|
10570
10802
|
message: `致命错误自动恢复(${i}/${r}):${n.message},已回退 checkpoint 重试`,
|
|
10571
10803
|
severity: "observable",
|
|
@@ -10577,7 +10809,7 @@ function wd(e, n) {
|
|
|
10577
10809
|
});
|
|
10578
10810
|
continue;
|
|
10579
10811
|
}
|
|
10580
|
-
throw
|
|
10812
|
+
throw G({
|
|
10581
10813
|
type: "error",
|
|
10582
10814
|
message: n.message,
|
|
10583
10815
|
severity: n.severity,
|
|
@@ -10590,7 +10822,7 @@ function wd(e, n) {
|
|
|
10590
10822
|
async batch(e, t, n) {
|
|
10591
10823
|
if (await J.initDone, !e.length) return [];
|
|
10592
10824
|
if (J.refCount <= 0) throw Error("page-agent-sdk: agent 已释放(unmount),拒绝排队中的 batch");
|
|
10593
|
-
let r = [], i =
|
|
10825
|
+
let r = [], i = wt(n);
|
|
10594
10826
|
for (let a = 0; a < e.length; a++) {
|
|
10595
10827
|
if (n?.aborted) {
|
|
10596
10828
|
for (let t = a; t < e.length; t++) r.push({
|
|
@@ -10643,7 +10875,7 @@ function wd(e, n) {
|
|
|
10643
10875
|
break;
|
|
10644
10876
|
}
|
|
10645
10877
|
let s = Zr(i, "fatal");
|
|
10646
|
-
|
|
10878
|
+
G({
|
|
10647
10879
|
type: "error",
|
|
10648
10880
|
message: `批量任务 ${a + 1}/${e.length} 失败:${s.message}`,
|
|
10649
10881
|
severity: "observable",
|
|
@@ -10670,70 +10902,70 @@ function wd(e, n) {
|
|
|
10670
10902
|
async switchSession(t) {
|
|
10671
10903
|
if (await J.initDone, !s) throw Error("page-agent-sdk: storage 未开启,无法切换会话(请传 storage 选项)");
|
|
10672
10904
|
if (a.resolve("keep_external"), J.sessionId && s) {
|
|
10673
|
-
if (
|
|
10905
|
+
if (Oe) {
|
|
10674
10906
|
let e = C.getMission();
|
|
10675
|
-
e &&
|
|
10907
|
+
e && zt({ mission: e });
|
|
10676
10908
|
}
|
|
10677
|
-
if (
|
|
10909
|
+
if (ke) {
|
|
10678
10910
|
let e = T.getWorkingMemory();
|
|
10679
|
-
e &&
|
|
10911
|
+
e && zt({ workingMemory: e });
|
|
10680
10912
|
}
|
|
10681
|
-
if (
|
|
10913
|
+
if (H) {
|
|
10682
10914
|
let e = w.getFocuses();
|
|
10683
|
-
|
|
10915
|
+
zt({ focus: e.length ? e : null });
|
|
10684
10916
|
}
|
|
10685
10917
|
}
|
|
10686
10918
|
x.flush?.(), await s.flush();
|
|
10687
10919
|
let r = t ?? "", i;
|
|
10688
|
-
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), J.sessionId = r, b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), F && F.importStack([]), J.agent.debugLogs.value = [], i ||= await s.load(n, r), i && (J.applySnapshot(i),
|
|
10920
|
+
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), J.sessionId = r, b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), mt?.resetScanCursor(), F && F.importStack([]), J.agent.debugLogs.value = [], i ||= await s.load(n, r), i && (J.applySnapshot(i), G({
|
|
10689
10921
|
type: "session_restored",
|
|
10690
10922
|
sessionId: r,
|
|
10691
10923
|
rounds: i.messages?.length ?? 0
|
|
10692
|
-
})), e.memory &&
|
|
10924
|
+
})), e.memory && zt({ memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), K(), It = void 0, Lt = !1, J.infoTick.value++, r;
|
|
10693
10925
|
},
|
|
10694
10926
|
resetSession: () => {
|
|
10695
|
-
|
|
10927
|
+
Ot(), a.resolve("keep_external"), J.sessionId = dl(), b.splice(0, b.length), x.clear?.(), S.reset([]), e.memory || E.reset(""), C.reset(), T.reset(), w.reset(), mt?.resetScanCursor(), F && F.importStack([]), J.agent && (J.agent.debugLogs.value = []), s && s.createSession(J.agentId, e.session?.title, J.sessionId).catch((t) => {
|
|
10696
10928
|
e.debug && console.warn("[page-agent-sdk][persist] createSession 失败(已吞):", t);
|
|
10697
|
-
}),
|
|
10929
|
+
}), G({
|
|
10698
10930
|
type: "session_restored",
|
|
10699
10931
|
sessionId: J.sessionId,
|
|
10700
10932
|
rounds: 0
|
|
10701
|
-
}), J.infoTick.value++,
|
|
10933
|
+
}), J.infoTick.value++, K(), It = void 0, Lt = !1;
|
|
10702
10934
|
},
|
|
10703
10935
|
stream: (e, t, n) => {
|
|
10704
10936
|
if (!J.agent) throw Error("page-agent-sdk: agent 尚未初始化完成,请先 await mount()");
|
|
10705
|
-
x?.setProtectedRefs?.(
|
|
10937
|
+
x?.setProtectedRefs?.(Nd(e));
|
|
10706
10938
|
let r = (e) => {
|
|
10707
|
-
t?.(e),
|
|
10939
|
+
t?.(e), G(e), e.type === "subagent" && (e.kind === "tool_call" || e.kind === "tool_result") && J.infoTick.value++;
|
|
10708
10940
|
};
|
|
10709
10941
|
if (n) {
|
|
10710
10942
|
let e = () => a.resolve("keep_external");
|
|
10711
10943
|
n.aborted ? e() : n.addEventListener("abort", e, { once: !0 });
|
|
10712
10944
|
}
|
|
10713
|
-
let { controller: i, untrack: o } =
|
|
10945
|
+
let { controller: i, untrack: o } = Dt(n);
|
|
10714
10946
|
return J.agent.stream(e, r, i.signal).finally(o);
|
|
10715
10947
|
},
|
|
10716
10948
|
release() {
|
|
10717
10949
|
if (J.refCount--, J.refCount <= 0) {
|
|
10718
|
-
|
|
10950
|
+
Ot(), ge = !0, s && (x.flush?.(), s.flush(), s.dispose()), dt && dt.dispose();
|
|
10719
10951
|
let e = J.mcpClosers.splice(0);
|
|
10720
|
-
e.length && Promise.allSettled(e.map((e) => e())),
|
|
10952
|
+
e.length && Promise.allSettled(e.map((e) => e())), Ld.delete(n);
|
|
10721
10953
|
}
|
|
10722
10954
|
},
|
|
10723
10955
|
resolveConflict: a.resolve,
|
|
10724
10956
|
setTools(e) {
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
}),
|
|
10957
|
+
me.length = 0, e.forEach((e) => {
|
|
10958
|
+
me.push(e), B.set(e.name, "user");
|
|
10959
|
+
}), U = W(), J.agent && J.agent.setTools(U), J.infoTick.value++;
|
|
10728
10960
|
},
|
|
10729
10961
|
addTool(e) {
|
|
10730
|
-
|
|
10731
|
-
for (let t =
|
|
10732
|
-
|
|
10962
|
+
U.some((t) => t.name === e.name) && console.warn(`[page-agent-sdk] 工具 "${e.name}" 已存在,新工具覆盖(后注册覆盖先注册)`);
|
|
10963
|
+
for (let t = me.length - 1; t >= 0; t--) me[t].name === e.name && me.splice(t, 1);
|
|
10964
|
+
me.push(e), B.set(e.name, "user"), U = W(), J.agent && J.agent.setTools(U), J.infoTick.value++;
|
|
10733
10965
|
},
|
|
10734
10966
|
removeTool(e) {
|
|
10735
|
-
let t =
|
|
10736
|
-
return t < 0 ? !1 : (
|
|
10967
|
+
let t = me.findIndex((t) => t.name === e);
|
|
10968
|
+
return t < 0 ? !1 : (me.splice(t, 1), B.delete(e), U = W(), J.agent && J.agent.setTools(U), J.infoTick.value++, !0);
|
|
10737
10969
|
},
|
|
10738
10970
|
setLlm(t) {
|
|
10739
10971
|
let n;
|
|
@@ -10750,7 +10982,7 @@ function wd(e, n) {
|
|
|
10750
10982
|
contextWindow: e.contextWindow ?? r?.contextWindow,
|
|
10751
10983
|
maxOutputTokens: e.maxOutputTokens ?? r?.maxOutputTokens
|
|
10752
10984
|
}), f.contextWindow < 2e5) throw Error(`[page-agent-sdk][setLlm] 新模型上下文窗口 ${f.contextWindow} 小于最小支持 ${ai}(需 ≥200K 窗口模型)`);
|
|
10753
|
-
J.agent && (J.agent.setLlm(n), J.agent.setModelCaps?.(f)),
|
|
10985
|
+
J.agent && (J.agent.setLlm(n), J.agent.setModelCaps?.(f)), _t?.setContextWindow?.(f.contextWindow), nt?.setContextWindow?.(f.contextWindow), J.infoTick.value++, e.debug && console.log("[page-agent-sdk][setLlm] 重解析 modelCaps + 回灌:", f);
|
|
10754
10986
|
},
|
|
10755
10987
|
setMemory(e) {
|
|
10756
10988
|
E.reset(e), typeof e == "function" && E.refresh(), J.infoTick.value++;
|
|
@@ -10759,49 +10991,49 @@ function wd(e, n) {
|
|
|
10759
10991
|
return E.refresh();
|
|
10760
10992
|
},
|
|
10761
10993
|
setSubagents(t) {
|
|
10762
|
-
if (!
|
|
10994
|
+
if (!Qe) {
|
|
10763
10995
|
e.debug && console.warn("[page-agent-sdk][setSubagents] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
10764
10996
|
return;
|
|
10765
10997
|
}
|
|
10766
|
-
|
|
10998
|
+
Qe.set(t), J.infoTick.value++;
|
|
10767
10999
|
},
|
|
10768
11000
|
addSubagent(t) {
|
|
10769
|
-
if (!
|
|
11001
|
+
if (!Qe) {
|
|
10770
11002
|
e.debug && console.warn("[page-agent-sdk][addSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略");
|
|
10771
11003
|
return;
|
|
10772
11004
|
}
|
|
10773
|
-
|
|
11005
|
+
Qe.add(t), J.infoTick.value++;
|
|
10774
11006
|
},
|
|
10775
11007
|
removeSubagent(t) {
|
|
10776
|
-
if (!
|
|
10777
|
-
let n =
|
|
11008
|
+
if (!Qe) return e.debug && console.warn("[page-agent-sdk][removeSubagent] 未配 subagents:[] 或 capabilities.subagent 关闭,忽略"), !1;
|
|
11009
|
+
let n = Qe.remove(t);
|
|
10778
11010
|
return n && J.infoTick.value++, n;
|
|
10779
11011
|
},
|
|
10780
11012
|
getActiveSubagents() {
|
|
10781
|
-
return
|
|
11013
|
+
return Ie?.getActive() ?? [];
|
|
10782
11014
|
},
|
|
10783
11015
|
get subagentHistory() {
|
|
10784
|
-
return
|
|
11016
|
+
return Ie?.getHistory() ?? [];
|
|
10785
11017
|
},
|
|
10786
11018
|
getInfo() {
|
|
10787
11019
|
return {
|
|
10788
11020
|
id: n,
|
|
10789
11021
|
sessionId: J.sessionId,
|
|
10790
11022
|
model: el(y) ? y.model ?? y.modelName : y.model,
|
|
10791
|
-
systemPrompt: J.agent?.getEffectiveSystemPrompt?.() ??
|
|
10792
|
-
tools: (J.agent?.allTools ??
|
|
11023
|
+
systemPrompt: J.agent?.getEffectiveSystemPrompt?.() ?? le + ic(z(), e.schemaHint),
|
|
11024
|
+
tools: (J.agent?.allTools ?? U).map((e) => ({
|
|
10793
11025
|
name: e.name,
|
|
10794
11026
|
description: e.description,
|
|
10795
11027
|
schema: e.schema,
|
|
10796
|
-
source:
|
|
11028
|
+
source: B.get(e.name) || "user"
|
|
10797
11029
|
})),
|
|
10798
|
-
skills: (
|
|
11030
|
+
skills: (st ? st.controller.get() : e.skills ?? []).map((e) => ({
|
|
10799
11031
|
name: e.name,
|
|
10800
11032
|
description: e.description
|
|
10801
11033
|
})),
|
|
10802
|
-
data:
|
|
10803
|
-
description:
|
|
10804
|
-
schema:
|
|
11034
|
+
data: z() ? {
|
|
11035
|
+
description: z().description,
|
|
11036
|
+
schema: z().schema
|
|
10805
11037
|
} : void 0,
|
|
10806
11038
|
contextPreset: e.contextPreset ?? "auto",
|
|
10807
11039
|
compression: {
|
|
@@ -10810,7 +11042,7 @@ function wd(e, n) {
|
|
|
10810
11042
|
promptSoftCap: as(f.contextWindow, h.promptSoftCapTokens)
|
|
10811
11043
|
},
|
|
10812
11044
|
memory: E.get(),
|
|
10813
|
-
middleware:
|
|
11045
|
+
middleware: vt.map((e) => e.name),
|
|
10814
11046
|
todos: (J.agent?.getState?.()?.todos ?? []).map((e) => ({
|
|
10815
11047
|
id: e.id,
|
|
10816
11048
|
content: e.content,
|
|
@@ -10821,32 +11053,33 @@ function wd(e, n) {
|
|
|
10821
11053
|
...e.evidence === void 0 ? {} : { evidence: e.evidence }
|
|
10822
11054
|
})),
|
|
10823
11055
|
planPhase: S.getPlanPhase(),
|
|
10824
|
-
mission:
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
11056
|
+
mission: Oe ? C.getMission() : void 0,
|
|
11057
|
+
preferences: ft && mt ? mt.getPreferences() : void 0,
|
|
11058
|
+
workingMemory: ke ? T.getWorkingMemory() : void 0,
|
|
11059
|
+
focus: H ? w.getFocus() : void 0,
|
|
11060
|
+
focuses: H ? w.getFocuses() : [],
|
|
11061
|
+
trace: se && J.agent?.spans ? {
|
|
10829
11062
|
spans: J.agent.spans.value,
|
|
10830
11063
|
metrics: li(J.agent.spans.value)
|
|
10831
11064
|
} : void 0,
|
|
10832
11065
|
actions: ed(e.actions ?? {}),
|
|
10833
11066
|
subagent: {
|
|
10834
|
-
enabled: !!
|
|
11067
|
+
enabled: !!qe,
|
|
10835
11068
|
maxDepth: e.subagent?.maxDepth ?? 1,
|
|
10836
11069
|
maxParallel: e.subagent?.maxParallel ?? 4,
|
|
10837
11070
|
allowedTools: e.subagent?.allowedTools ?? [],
|
|
10838
|
-
subagents:
|
|
10839
|
-
active:
|
|
10840
|
-
history:
|
|
10841
|
-
lockedComponents:
|
|
11071
|
+
subagents: Qe?.get() ?? [],
|
|
11072
|
+
active: Ie?.getActive() ?? [],
|
|
11073
|
+
history: Ie?.getHistory() ?? [],
|
|
11074
|
+
lockedComponents: Ye?.locked() ?? {}
|
|
10842
11075
|
},
|
|
10843
11076
|
verify: {
|
|
10844
|
-
enabled:
|
|
10845
|
-
maxAttempts:
|
|
10846
|
-
adversarial:
|
|
11077
|
+
enabled: !!tt,
|
|
11078
|
+
maxAttempts: Be ? Le : 0,
|
|
11079
|
+
adversarial: Be && !!e.verify?.adversarial
|
|
10847
11080
|
},
|
|
10848
11081
|
context: (() => {
|
|
10849
|
-
let e =
|
|
11082
|
+
let e = nt?.getSnapshot();
|
|
10850
11083
|
if (e) {
|
|
10851
11084
|
let t = J.agent?.getState?.()?.lastCompression;
|
|
10852
11085
|
t && (e.compression = t);
|
|
@@ -10863,47 +11096,58 @@ function wd(e, n) {
|
|
|
10863
11096
|
};
|
|
10864
11097
|
},
|
|
10865
11098
|
getMission() {
|
|
10866
|
-
return
|
|
11099
|
+
return Oe ? C.getMission() : void 0;
|
|
10867
11100
|
},
|
|
10868
11101
|
setMission(t) {
|
|
10869
|
-
if (!
|
|
11102
|
+
if (!Oe) {
|
|
10870
11103
|
e.debug && console.warn("[page-agent-sdk][mission] capabilities.missionAnchor 关闭,setMission 忽略");
|
|
10871
11104
|
return;
|
|
10872
11105
|
}
|
|
10873
11106
|
C.setMission(t), J.infoTick.value++;
|
|
10874
11107
|
},
|
|
11108
|
+
getPreferences() {
|
|
11109
|
+
return mt ? mt.getPreferences() : [];
|
|
11110
|
+
},
|
|
11111
|
+
async removePreference(e) {
|
|
11112
|
+
if (!mt) return !1;
|
|
11113
|
+
let t = await mt.removePreference(e);
|
|
11114
|
+
return t && J.infoTick.value++, t;
|
|
11115
|
+
},
|
|
11116
|
+
async clearPreferences() {
|
|
11117
|
+
mt && (await mt.clearPreferences(), J.infoTick.value++);
|
|
11118
|
+
},
|
|
10875
11119
|
getFocus() {
|
|
10876
|
-
return
|
|
11120
|
+
return H ? w.getFocus() : void 0;
|
|
10877
11121
|
},
|
|
10878
11122
|
getFocuses() {
|
|
10879
|
-
return
|
|
11123
|
+
return H ? w.getFocuses() : [];
|
|
10880
11124
|
},
|
|
10881
11125
|
setFocus(t) {
|
|
10882
|
-
let n =
|
|
11126
|
+
let n = Vd(t, "setFocus", H, () => z()?.schema, e.debug);
|
|
10883
11127
|
return n.ok ? (w.setFocus(t), J.infoTick.value++, { ok: !0 }) : n;
|
|
10884
11128
|
},
|
|
10885
11129
|
addFocus(t) {
|
|
10886
|
-
let n =
|
|
11130
|
+
let n = Vd(t, "addFocus", H, () => z()?.schema, e.debug);
|
|
10887
11131
|
return n.ok ? w.getFocuses().length >= 8 ? (e.debug && console.warn("[page-agent-sdk][focus] addFocus 拒绝:焦点数已达上限 8(augmentPrompt 注入每焦点子树 schema,过多致 system prompt 超预算)"), {
|
|
10888
11132
|
ok: !1,
|
|
10889
11133
|
error: "焦点数上限 8(避免 system prompt 撑爆)"
|
|
10890
11134
|
}) : (w.addFocus(t), J.infoTick.value++, { ok: !0 }) : n;
|
|
10891
11135
|
},
|
|
10892
11136
|
removeFocus(e) {
|
|
10893
|
-
|
|
11137
|
+
H && (w.removeFocus(e), J.infoTick.value++);
|
|
10894
11138
|
},
|
|
10895
11139
|
clearFocus() {
|
|
10896
|
-
|
|
11140
|
+
H && (w.clearFocus(), J.infoTick.value++);
|
|
10897
11141
|
}
|
|
10898
11142
|
};
|
|
10899
|
-
async function
|
|
11143
|
+
async function kt() {
|
|
10900
11144
|
if (!s) return;
|
|
10901
11145
|
await s.ready;
|
|
10902
11146
|
let t = e.session || {};
|
|
10903
11147
|
if (t.id) {
|
|
10904
11148
|
J.sessionId = t.id;
|
|
10905
11149
|
let e = await s.load(n, J.sessionId);
|
|
10906
|
-
e ? (J.applySnapshot(e),
|
|
11150
|
+
e ? (J.applySnapshot(e), G({
|
|
10907
11151
|
type: "session_restored",
|
|
10908
11152
|
sessionId: J.sessionId,
|
|
10909
11153
|
rounds: e.messages?.length ?? 0
|
|
@@ -10913,35 +11157,35 @@ function wd(e, n) {
|
|
|
10913
11157
|
if (e.debug && console.log("[page-agent-sdk][restore] listSessions", n, r.length, r.map((e) => e.sessionId)), r.length) {
|
|
10914
11158
|
J.sessionId = r[0].sessionId;
|
|
10915
11159
|
let t = await s.load(n, J.sessionId);
|
|
10916
|
-
t ? (J.applySnapshot(t),
|
|
11160
|
+
t ? (J.applySnapshot(t), G({
|
|
10917
11161
|
type: "session_restored",
|
|
10918
11162
|
sessionId: J.sessionId,
|
|
10919
11163
|
rounds: t.messages?.length ?? 0
|
|
10920
11164
|
}), e.debug && console.log("[page-agent-sdk][restore] 恢复会话", J.sessionId, `${t.messages?.length ?? 0} msgs`)) : e.debug && console.log("[page-agent-sdk][restore] 会话 meta 存在但快照为空", J.sessionId);
|
|
10921
11165
|
} else J.sessionId = await s.createSession(n, t.title), e.debug && console.log("[page-agent-sdk][restore] 新建会话(无历史)", J.sessionId);
|
|
10922
11166
|
} else J.sessionId = await s.createSession(n, t.title);
|
|
10923
|
-
e.memory &&
|
|
11167
|
+
e.memory && zt({ memory: E.get() || (typeof e.memory == "string" ? e.memory : "") }), K();
|
|
10924
11168
|
}
|
|
10925
|
-
async function
|
|
10926
|
-
await
|
|
11169
|
+
async function jt() {
|
|
11170
|
+
await gt();
|
|
10927
11171
|
}
|
|
10928
|
-
function
|
|
11172
|
+
function Mt(e) {
|
|
10929
11173
|
let t = {};
|
|
10930
|
-
for (let n of
|
|
11174
|
+
for (let n of Nd(e)) {
|
|
10931
11175
|
let e = x.files[n];
|
|
10932
11176
|
e && (t[n] = e.content);
|
|
10933
11177
|
}
|
|
10934
11178
|
return t;
|
|
10935
11179
|
}
|
|
10936
|
-
function
|
|
10937
|
-
let e =
|
|
11180
|
+
function Nt() {
|
|
11181
|
+
let e = Pd(x.files, Nd(b));
|
|
10938
11182
|
for (let t of e) delete x.files[t];
|
|
10939
11183
|
}
|
|
10940
|
-
function
|
|
10941
|
-
let e = Xo(b,
|
|
11184
|
+
function Ft() {
|
|
11185
|
+
let e = Xo(b, yt);
|
|
10942
11186
|
if (!e.trimmed) return;
|
|
10943
11187
|
let { older: t, summary: n } = e;
|
|
10944
|
-
if (
|
|
11188
|
+
if (G({
|
|
10945
11189
|
type: "context_trimmed",
|
|
10946
11190
|
dropped: t.map((e) => ({
|
|
10947
11191
|
round: e.round,
|
|
@@ -10949,22 +11193,22 @@ function wd(e, n) {
|
|
|
10949
11193
|
assistant: e.assistantMsgs.map((e) => e.content),
|
|
10950
11194
|
steps: e.assistantMsgs.flatMap((e) => e.steps ?? [])
|
|
10951
11195
|
})),
|
|
10952
|
-
vfsResults:
|
|
11196
|
+
vfsResults: Mt(t.flatMap((e) => [e.userMsg, ...e.assistantMsgs])),
|
|
10953
11197
|
summary: n.content,
|
|
10954
11198
|
reason: "max_memory_rounds"
|
|
10955
|
-
}), b.splice(e.deleteFrom, e.deleteCount, n),
|
|
11199
|
+
}), b.splice(e.deleteFrom, e.deleteCount, n), Nt(), g && l) {
|
|
10956
11200
|
let n = e.summary, { prevSeg: r } = e;
|
|
10957
11201
|
(async () => {
|
|
10958
11202
|
try {
|
|
10959
11203
|
let e = await l(ts(t, v)), i = b.indexOf(n);
|
|
10960
11204
|
if (i < 0) return;
|
|
10961
|
-
b[i].content = Yo(t, r, e),
|
|
11205
|
+
b[i].content = Yo(t, r, e), Vt();
|
|
10962
11206
|
} catch {}
|
|
10963
11207
|
})();
|
|
10964
11208
|
}
|
|
10965
11209
|
}
|
|
10966
|
-
let
|
|
10967
|
-
function
|
|
11210
|
+
let It, Lt = !1;
|
|
11211
|
+
function Rt(t, n) {
|
|
10968
11212
|
e.debug && console.warn(`[page-agent-sdk][persist] ${t} 失败(已吞):`, n);
|
|
10969
11213
|
let r = J.agent?.debugLogs;
|
|
10970
11214
|
r && r.value.push({
|
|
@@ -10977,30 +11221,30 @@ function wd(e, n) {
|
|
|
10977
11221
|
}
|
|
10978
11222
|
});
|
|
10979
11223
|
}
|
|
10980
|
-
function
|
|
10981
|
-
!J.sessionId || !s || s.save(n, J.sessionId, e).catch((e) =>
|
|
11224
|
+
function zt(e) {
|
|
11225
|
+
!J.sessionId || !s || s.save(n, J.sessionId, e).catch((e) => Rt("save", e));
|
|
10982
11226
|
}
|
|
10983
|
-
function
|
|
10984
|
-
s && s.updateTitle(n, e, t).catch((e) =>
|
|
11227
|
+
function Bt(e, t) {
|
|
11228
|
+
s && s.updateTitle(n, e, t).catch((e) => Rt("updateTitle", e));
|
|
10985
11229
|
}
|
|
10986
|
-
function
|
|
11230
|
+
function Vt() {
|
|
10987
11231
|
if (!J.sessionId || !s) return;
|
|
10988
|
-
if (
|
|
11232
|
+
if (zt({ messages: JSON.parse(JSON.stringify(b)) }), zt({ todos: J.agent?.getState?.()?.todos ?? [] }), Oe) {
|
|
10989
11233
|
let e = C.getMission();
|
|
10990
|
-
e &&
|
|
11234
|
+
e && zt({ mission: e });
|
|
10991
11235
|
}
|
|
10992
|
-
if (
|
|
11236
|
+
if (ke) {
|
|
10993
11237
|
let e = T.getWorkingMemory();
|
|
10994
|
-
e &&
|
|
11238
|
+
e && zt({ workingMemory: e });
|
|
10995
11239
|
}
|
|
10996
|
-
if (
|
|
11240
|
+
if (H) {
|
|
10997
11241
|
let e = w.getFocuses();
|
|
10998
|
-
|
|
11242
|
+
zt({ focus: e.length ? e : null });
|
|
10999
11243
|
}
|
|
11000
|
-
|
|
11244
|
+
ce && F && (zt({ checkpoints: F.exportStack() }), zt({ usage: i }));
|
|
11001
11245
|
let t = $c(b);
|
|
11002
|
-
if (t && t !==
|
|
11003
|
-
|
|
11246
|
+
if (t && t !== It && (It = t, Bt(J.sessionId, t)), e.autoTitle !== !1 && u && !Lt && b.some((e) => e.role === "user") && b.some((e) => e.role === "assistant")) {
|
|
11247
|
+
Lt = !0;
|
|
11004
11248
|
let e = J.sessionId;
|
|
11005
11249
|
(async () => {
|
|
11006
11250
|
try {
|
|
@@ -11009,9 +11253,9 @@ function wd(e, n) {
|
|
|
11009
11253
|
try {
|
|
11010
11254
|
await s.updateTitle(n, e, t);
|
|
11011
11255
|
} catch (e) {
|
|
11012
|
-
|
|
11256
|
+
Rt("updateTitle", e);
|
|
11013
11257
|
}
|
|
11014
|
-
await
|
|
11258
|
+
await K();
|
|
11015
11259
|
}
|
|
11016
11260
|
} catch {}
|
|
11017
11261
|
})();
|
|
@@ -11019,16 +11263,16 @@ function wd(e, n) {
|
|
|
11019
11263
|
e.debug && console.log("[page-agent-sdk][persist] save", J.sessionId, `${b.length} msgs`);
|
|
11020
11264
|
}
|
|
11021
11265
|
return J.initDone = (async () => {
|
|
11022
|
-
await
|
|
11266
|
+
await kt(), await jt(), mt && await mt.preload(), e.mcp?.length && (async () => {
|
|
11023
11267
|
let t = await Promise.allSettled(e.mcp.map((e) => tc(e))), n = t.flatMap((e) => e.status === "fulfilled" ? [e.value.close] : []);
|
|
11024
|
-
if (
|
|
11268
|
+
if (ge) {
|
|
11025
11269
|
Promise.allSettled(n.map((e) => e()));
|
|
11026
11270
|
return;
|
|
11027
11271
|
}
|
|
11028
11272
|
J.mcpClosers = n, J.mcpServers = [];
|
|
11029
11273
|
let r = /* @__PURE__ */ new Set();
|
|
11030
|
-
for (let e of
|
|
11031
|
-
let t =
|
|
11274
|
+
for (let e of U) {
|
|
11275
|
+
let t = B.get(e.name);
|
|
11032
11276
|
t && !t.startsWith("mcp:") && r.add(e.name);
|
|
11033
11277
|
}
|
|
11034
11278
|
t.forEach((t, n) => {
|
|
@@ -11042,30 +11286,30 @@ function wd(e, n) {
|
|
|
11042
11286
|
console.warn(`[page-agent-sdk][mcp] 工具 "${e.name}" 与内置工具重名,已拒绝注入(安全保留字保护)`);
|
|
11043
11287
|
return;
|
|
11044
11288
|
}
|
|
11045
|
-
|
|
11289
|
+
B.set(e.name, `mcp:${a}`), he.push(e);
|
|
11046
11290
|
})) : console.warn(`[page-agent-sdk][mcp] server ${a} 连接失败:`, t.reason);
|
|
11047
|
-
}),
|
|
11291
|
+
}), he.length && (U = W(), J.agent && J.agent.setTools(U), J.infoTick.value++), e.debug && console.log(`[page-agent-sdk][mcp] 注入 ${he.length} 个工具,${J.mcpServers.length} 个 server`);
|
|
11048
11292
|
})();
|
|
11049
11293
|
let t = el(e.llm) ? e.llm : await m(e.llm);
|
|
11050
11294
|
J.agent = Wi({
|
|
11051
11295
|
llm: t,
|
|
11052
|
-
systemPrompt:
|
|
11053
|
-
tools:
|
|
11054
|
-
middleware:
|
|
11296
|
+
systemPrompt: le,
|
|
11297
|
+
tools: U,
|
|
11298
|
+
middleware: vt,
|
|
11055
11299
|
maxToolRounds: e.maxToolRounds,
|
|
11056
11300
|
maxRetries: e.maxRetries,
|
|
11057
11301
|
stallMs: e.streamStallMs ?? 9e4,
|
|
11058
11302
|
maxParallelTools: e.maxParallelTools,
|
|
11059
11303
|
contextWindow: f.contextWindow,
|
|
11060
11304
|
maxOutputTokens: f.maxOutputTokens,
|
|
11061
|
-
maxVerifyAttempts:
|
|
11305
|
+
maxVerifyAttempts: Be ? Le : 0,
|
|
11062
11306
|
roundTokenBudget: e.roundTokenBudget ?? 0,
|
|
11063
11307
|
onLlmChange: (e) => {
|
|
11064
11308
|
y = e;
|
|
11065
11309
|
},
|
|
11066
|
-
onTrace:
|
|
11310
|
+
onTrace: se ? (e, t) => {
|
|
11067
11311
|
try {
|
|
11068
|
-
|
|
11312
|
+
G({
|
|
11069
11313
|
type: "trace",
|
|
11070
11314
|
spans: e,
|
|
11071
11315
|
metrics: t
|
|
@@ -11073,16 +11317,16 @@ function wd(e, n) {
|
|
|
11073
11317
|
} catch {}
|
|
11074
11318
|
} : void 0,
|
|
11075
11319
|
debug: e.debug
|
|
11076
|
-
}), D.current = J.agent,
|
|
11077
|
-
J.agent && J.agent.setTools(
|
|
11320
|
+
}), D.current = J.agent, Ze && Ze.setReconfigureHook && Ze.setReconfigureHook(() => {
|
|
11321
|
+
J.agent && J.agent.setTools(W());
|
|
11078
11322
|
});
|
|
11079
11323
|
})(), J;
|
|
11080
11324
|
}
|
|
11081
|
-
function
|
|
11325
|
+
function Ud(e, t) {
|
|
11082
11326
|
let n = e.id ?? dl();
|
|
11083
11327
|
e.id || console.warn(`[page-agent-sdk] 未传 options.id,已生成随机 id "${n}"。刷新后持久化数据无法恢复,请传稳定 id。`);
|
|
11084
|
-
let r = e.streaming ?? !0, i = e.ui ?? "default", a, o = e.shareContext ?
|
|
11085
|
-
o ? a = o : (a =
|
|
11328
|
+
let r = e.streaming ?? !0, i = e.ui ?? "default", a, o = e.shareContext ? Ld.get(n) : void 0;
|
|
11329
|
+
o ? a = o : (a = Hd(e, n), e.shareContext && Ld.set(n, a)), a.refCount++;
|
|
11086
11330
|
let s = null, c = Ll(e), l = null, u = null;
|
|
11087
11331
|
async function d(n) {
|
|
11088
11332
|
if (await a.initDone, s) {
|
|
@@ -11177,6 +11421,9 @@ function Td(e, t) {
|
|
|
11177
11421
|
inspectContext: () => a.getInfo().context,
|
|
11178
11422
|
getMission: a.getMission,
|
|
11179
11423
|
setMission: a.setMission,
|
|
11424
|
+
getPreferences: a.getPreferences,
|
|
11425
|
+
removePreference: a.removePreference,
|
|
11426
|
+
clearPreferences: a.clearPreferences,
|
|
11180
11427
|
getFocus: a.getFocus,
|
|
11181
11428
|
getFocuses: a.getFocuses,
|
|
11182
11429
|
setFocus: a.setFocus,
|
|
@@ -11299,7 +11546,7 @@ function Td(e, t) {
|
|
|
11299
11546
|
}
|
|
11300
11547
|
//#endregion
|
|
11301
11548
|
//#region src/core/sdk/ragSubagent.ts
|
|
11302
|
-
function
|
|
11549
|
+
function Wd(e, t, n, r, i) {
|
|
11303
11550
|
let a = [];
|
|
11304
11551
|
e && a.push("vfs_grep + vfs_read(搜预注入文档)"), t && a.push(`${r}(语义检索)`), n && a.push(`${i}(按 source 加载)`), a.push("fetch_document(公网 URL)");
|
|
11305
11552
|
let o = [];
|
|
@@ -11314,7 +11561,7 @@ function Ed(e, t, n, r, i) {
|
|
|
11314
11561
|
|
|
11315
11562
|
你是只读检索角色,不要尝试修改任何数据。不要尝试上面未列出的工具。`;
|
|
11316
11563
|
}
|
|
11317
|
-
function
|
|
11564
|
+
function Gd(e, t, n, r, i) {
|
|
11318
11565
|
let a = [], o = [];
|
|
11319
11566
|
return e && (a.push("- vfs_grep / vfs_read:搜集成方预注入 vfs 的文档(组件文档 / UI 规范)—— 快、静态,先查"), o.push("- 静态文档(组件库文档 / UI 规范):vfs_grep")), t && (a.push(`- ${r}:语义检索(retriever 向量库)—— 模糊匹配,关键词不确定 / 语义相似时用`), o.push(`- 语义相似(「瀑布流组件」「倒计时」「拼团」):${r}`)), n && (a.push(`- ${i}:按 source 精确加载(已知文档 id / URL / key)—— 精确取特定文档`), o.push(`- 已知文档 id / URL:${i}`)), a.push("- fetch_document:公网 URL —— 查公开资料"), o.push("- 公开 URL(设计规范网站 / 第三方文档):fetch_document"), `# 知识检索策略(RAG)
|
|
11320
11567
|
|
|
@@ -11331,12 +11578,12 @@ ${a.join("\n")}
|
|
|
11331
11578
|
## 何时用何源
|
|
11332
11579
|
${o.join("\n")}`;
|
|
11333
11580
|
}
|
|
11334
|
-
var
|
|
11581
|
+
var Kd = {
|
|
11335
11582
|
name: "rag-search",
|
|
11336
11583
|
description: "多源知识检索策略:vfs 预注入文档 → 语义检索 → 指定文档加载 → 公网;综合结构化结论 + 溯源",
|
|
11337
|
-
getContent: () =>
|
|
11584
|
+
getContent: () => Gd(!0, !0, !0, "search_docs", "load_doc")
|
|
11338
11585
|
};
|
|
11339
|
-
function
|
|
11586
|
+
function qd(e, n, i) {
|
|
11340
11587
|
return r(async ({ query: e, topK: t }) => {
|
|
11341
11588
|
try {
|
|
11342
11589
|
let r = await n(e, { topK: t ?? i });
|
|
@@ -11353,7 +11600,7 @@ function kd(e, n, i) {
|
|
|
11353
11600
|
})
|
|
11354
11601
|
});
|
|
11355
11602
|
}
|
|
11356
|
-
function
|
|
11603
|
+
function Jd(e, n) {
|
|
11357
11604
|
return r(async ({ source: e }) => {
|
|
11358
11605
|
try {
|
|
11359
11606
|
let t = await n(e), r = Array.isArray(t) ? t : [t];
|
|
@@ -11367,19 +11614,19 @@ function Ad(e, n) {
|
|
|
11367
11614
|
schema: t.object({ source: t.string().describe("文档标识(id/URL/key)") })
|
|
11368
11615
|
});
|
|
11369
11616
|
}
|
|
11370
|
-
function
|
|
11617
|
+
function Yd(e) {
|
|
11371
11618
|
let { retriever: t, loader: n, useVfs: r = !0, id: i = "rag", description: a, topK: o = 5, searchToolName: s = "search_docs", loadToolName: c = "load_doc", maxToolRounds: l = 8, summarization: u, skills: d, extraTools: f } = e;
|
|
11372
11619
|
if (!t && !n && r === !1) throw Error("[page-agent-sdk][createRagSubagent] 至少配一种知识源:retriever / loader / useVfs(true)");
|
|
11373
11620
|
let p = [];
|
|
11374
|
-
t && p.push(
|
|
11621
|
+
t && p.push(qd(s, t, o)), n && p.push(Jd(c, n)), f && p.push(...f);
|
|
11375
11622
|
let m = r ? [
|
|
11376
11623
|
"vfs_grep",
|
|
11377
11624
|
"vfs_read",
|
|
11378
11625
|
"vfs_json_read"
|
|
11379
|
-
] : void 0, h =
|
|
11626
|
+
] : void 0, h = Wd(r, !!t, !!n, s, c), g = {
|
|
11380
11627
|
name: "rag-search",
|
|
11381
|
-
description:
|
|
11382
|
-
getContent: () =>
|
|
11628
|
+
description: Kd.description,
|
|
11629
|
+
getContent: () => Gd(r, !!t, !!n, s, c)
|
|
11383
11630
|
};
|
|
11384
11631
|
return {
|
|
11385
11632
|
id: i,
|
|
@@ -11394,7 +11641,7 @@ function jd(e) {
|
|
|
11394
11641
|
}
|
|
11395
11642
|
//#endregion
|
|
11396
11643
|
//#region src/core/utils/clipboard.ts
|
|
11397
|
-
async function
|
|
11644
|
+
async function Xd(e) {
|
|
11398
11645
|
try {
|
|
11399
11646
|
let t = globalThis.navigator?.clipboard;
|
|
11400
11647
|
if (t && typeof t.writeText == "function") return await t.writeText(e), !0;
|
|
@@ -11412,9 +11659,9 @@ async function Md(e) {
|
|
|
11412
11659
|
}
|
|
11413
11660
|
//#endregion
|
|
11414
11661
|
//#region src/core/composables/useChat.ts
|
|
11415
|
-
var
|
|
11416
|
-
function
|
|
11417
|
-
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a } = e, o = /* @__PURE__ */
|
|
11662
|
+
var Zd = 4e3;
|
|
11663
|
+
function Qd(e = {}) {
|
|
11664
|
+
let { fetchResponse: t, fetchStream: n, onPersist: r, onClear: i, onQueuedCleared: a } = e, o = /* @__PURE__ */ bt({
|
|
11418
11665
|
messages: e.messages ?? [],
|
|
11419
11666
|
loading: !1,
|
|
11420
11667
|
error: null
|
|
@@ -11440,7 +11687,7 @@ function Pd(e = {}) {
|
|
|
11440
11687
|
}
|
|
11441
11688
|
async function g(e) {
|
|
11442
11689
|
if (c.value = !0, n) {
|
|
11443
|
-
let t = /* @__PURE__ */
|
|
11690
|
+
let t = /* @__PURE__ */ bt({
|
|
11444
11691
|
role: "assistant",
|
|
11445
11692
|
content: "",
|
|
11446
11693
|
timestamp: Date.now(),
|
|
@@ -11482,7 +11729,7 @@ function Pd(e = {}) {
|
|
|
11482
11729
|
let t = e.delta || "";
|
|
11483
11730
|
n.subReasonFull = (n.subReasonFull || "") + t;
|
|
11484
11731
|
let r = (n.subReason || "") + t;
|
|
11485
|
-
n.subReason = r.length >
|
|
11732
|
+
n.subReason = r.length > Zd ? r.slice(-4e3) : r;
|
|
11486
11733
|
break;
|
|
11487
11734
|
}
|
|
11488
11735
|
n.children ||= [];
|
|
@@ -11611,7 +11858,7 @@ function Pd(e = {}) {
|
|
|
11611
11858
|
}
|
|
11612
11859
|
//#endregion
|
|
11613
11860
|
//#region src/core/components/icons.ts
|
|
11614
|
-
var
|
|
11861
|
+
var $d = {
|
|
11615
11862
|
header: "🤖",
|
|
11616
11863
|
subagent: "🤖",
|
|
11617
11864
|
subagentProgress: "🧬",
|
|
@@ -11622,10 +11869,10 @@ var Fd = {
|
|
|
11622
11869
|
recommend: "💡",
|
|
11623
11870
|
conflict: "⚠️"
|
|
11624
11871
|
};
|
|
11625
|
-
function
|
|
11626
|
-
let t = {
|
|
11872
|
+
function ef(e) {
|
|
11873
|
+
let t = { ...$d };
|
|
11627
11874
|
if (!e) return t;
|
|
11628
|
-
let n = Object.keys(
|
|
11875
|
+
let n = Object.keys($d);
|
|
11629
11876
|
for (let r of n) {
|
|
11630
11877
|
let n = e[r];
|
|
11631
11878
|
typeof n == "string" && (t[r] = n);
|
|
@@ -11634,7 +11881,7 @@ function Id(e) {
|
|
|
11634
11881
|
}
|
|
11635
11882
|
//#endregion
|
|
11636
11883
|
//#region src/core/components/messages.ts
|
|
11637
|
-
var
|
|
11884
|
+
var tf = {
|
|
11638
11885
|
defaultTitle: "AI 助手",
|
|
11639
11886
|
inputPlaceholder: "输入消息,Enter 发送...",
|
|
11640
11887
|
newSession: "新建会话",
|
|
@@ -11809,6 +12056,13 @@ var Ld = {
|
|
|
11809
12056
|
debugSameAsMain: "(同主)",
|
|
11810
12057
|
debugTodosTitle: "任务清单",
|
|
11811
12058
|
debugMemoryTitle: "持久指令 (memory)",
|
|
12059
|
+
debugPrefsTitle: "用户偏好(跨会话)",
|
|
12060
|
+
debugPrefTopicColor: "颜色",
|
|
12061
|
+
debugPrefTopicCopy: "文案",
|
|
12062
|
+
debugPrefTopicLayout: "排版",
|
|
12063
|
+
debugPrefTopicInteraction: "交互",
|
|
12064
|
+
debugPrefTopicTech: "技术",
|
|
12065
|
+
debugPrefTopicOther: "其他",
|
|
11812
12066
|
debugLastCompTitle: "上轮压缩",
|
|
11813
12067
|
debugTriggered: "触发",
|
|
11814
12068
|
debugNotTriggered: "✗(未达阈值)",
|
|
@@ -11854,8 +12108,8 @@ var Ld = {
|
|
|
11854
12108
|
codeDemoText: "这是一段示例文字,用于展示 CSS 效果。",
|
|
11855
12109
|
codeDemoButton: "按钮",
|
|
11856
12110
|
codeDemoInput: "输入框"
|
|
11857
|
-
},
|
|
11858
|
-
"zh-CN":
|
|
12111
|
+
}, nf = {
|
|
12112
|
+
"zh-CN": tf,
|
|
11859
12113
|
"en-US": {
|
|
11860
12114
|
defaultTitle: "AI Assistant",
|
|
11861
12115
|
inputPlaceholder: "Type a message, Enter to send...",
|
|
@@ -12031,6 +12285,13 @@ var Ld = {
|
|
|
12031
12285
|
debugSameAsMain: " (same as main)",
|
|
12032
12286
|
debugTodosTitle: "Todos",
|
|
12033
12287
|
debugMemoryTitle: "Persistent instructions (memory)",
|
|
12288
|
+
debugPrefsTitle: "User preferences (cross-session)",
|
|
12289
|
+
debugPrefTopicColor: "color",
|
|
12290
|
+
debugPrefTopicCopy: "copy",
|
|
12291
|
+
debugPrefTopicLayout: "layout",
|
|
12292
|
+
debugPrefTopicInteraction: "interaction",
|
|
12293
|
+
debugPrefTopicTech: "tech",
|
|
12294
|
+
debugPrefTopicOther: "other",
|
|
12034
12295
|
debugLastCompTitle: "Last compression",
|
|
12035
12296
|
debugTriggered: "Triggered",
|
|
12036
12297
|
debugNotTriggered: "✗ (below threshold)",
|
|
@@ -12078,10 +12339,10 @@ var Ld = {
|
|
|
12078
12339
|
codeDemoInput: "Input"
|
|
12079
12340
|
}
|
|
12080
12341
|
};
|
|
12081
|
-
function
|
|
12342
|
+
function rf(e = "zh-CN", t) {
|
|
12082
12343
|
let n = {
|
|
12083
|
-
...
|
|
12084
|
-
...
|
|
12344
|
+
...tf,
|
|
12345
|
+
...nf[e]
|
|
12085
12346
|
};
|
|
12086
12347
|
if (!t) return n;
|
|
12087
12348
|
let r = { ...n };
|
|
@@ -12093,9 +12354,9 @@ function zd(e = "zh-CN", t) {
|
|
|
12093
12354
|
}
|
|
12094
12355
|
//#endregion
|
|
12095
12356
|
//#region src/core/composables/chatContext.ts
|
|
12096
|
-
var
|
|
12097
|
-
function
|
|
12098
|
-
let t =
|
|
12357
|
+
var af = Symbol("chatContext");
|
|
12358
|
+
function of(e = {}) {
|
|
12359
|
+
let t = Qd({
|
|
12099
12360
|
fetchResponse: e.fetchResponse,
|
|
12100
12361
|
fetchStream: e.fetchStream,
|
|
12101
12362
|
messages: e.messages,
|
|
@@ -12115,7 +12376,7 @@ function Vd(e = {}) {
|
|
|
12115
12376
|
}, h = /* @__PURE__ */ At({}), g = (e) => h.value[e] === !0, _ = (e) => {
|
|
12116
12377
|
h.value[e] = !g(e);
|
|
12117
12378
|
}, v = /* @__PURE__ */ At(!1), y = (e) => {
|
|
12118
|
-
|
|
12379
|
+
Xd(e).then((e) => {
|
|
12119
12380
|
e && (v.value = !0, setTimeout(() => {
|
|
12120
12381
|
v.value = !1;
|
|
12121
12382
|
}, 1500));
|
|
@@ -12151,7 +12412,7 @@ function Vd(e = {}) {
|
|
|
12151
12412
|
e.onClearFocus?.();
|
|
12152
12413
|
}, j = (t) => {
|
|
12153
12414
|
e.onFocusChipClick?.(t);
|
|
12154
|
-
}, M =
|
|
12415
|
+
}, M = ef(e.icons), te = e.locale ?? "zh-CN";
|
|
12155
12416
|
return {
|
|
12156
12417
|
chat: t,
|
|
12157
12418
|
inputText: o,
|
|
@@ -12183,18 +12444,18 @@ function Vd(e = {}) {
|
|
|
12183
12444
|
focusChipClick: j,
|
|
12184
12445
|
icons: M,
|
|
12185
12446
|
locale: te,
|
|
12186
|
-
messages:
|
|
12447
|
+
messages: rf(te, e.dialogMessages)
|
|
12187
12448
|
};
|
|
12188
12449
|
}
|
|
12189
|
-
function
|
|
12190
|
-
let e = Rn(
|
|
12450
|
+
function sf() {
|
|
12451
|
+
let e = Rn(af);
|
|
12191
12452
|
if (!e) throw Error("useChatContext 必须在 provide(chatContextKey) 的组件子树内调用");
|
|
12192
12453
|
return e;
|
|
12193
12454
|
}
|
|
12194
12455
|
//#endregion
|
|
12195
12456
|
//#region src/core/index.headless.ts
|
|
12196
|
-
function
|
|
12197
|
-
return
|
|
12457
|
+
function cf(e) {
|
|
12458
|
+
return Ud(e);
|
|
12198
12459
|
}
|
|
12199
12460
|
//#endregion
|
|
12200
|
-
export { Rl as CAPABILITIES, Vl as CONTEXT_PRESETS, Qc as CompressDecisionSchema, is as DEFAULT_PROMPT_SOFT_CAP, nc as DEFAULT_SYSTEM_PROMPT, yc as HTML_VOID_TAGS, Ao as HUMAN_CONFIRM_TOOL_NAME, ai as MIN_CONTEXT_WINDOW, rs as SOFT_CAP_MIN_WINDOW, Zo as STOP_WORDS, Aa as UNSAFE_KEYS, ed as actionsToInspectInfo, $u as actionsToTools, Qr as agentError, Ys as analyzeContext, Ba as applyPatchToClone, Ua as applyPatchToLive, Zr as asAgentError, ic as buildDataPrompt, ac as buildSystemPrompt,
|
|
12461
|
+
export { Rl as CAPABILITIES, Vl as CONTEXT_PRESETS, Qc as CompressDecisionSchema, is as DEFAULT_PROMPT_SOFT_CAP, nc as DEFAULT_SYSTEM_PROMPT, yc as HTML_VOID_TAGS, Ao as HUMAN_CONFIRM_TOOL_NAME, ai as MIN_CONTEXT_WINDOW, rs as SOFT_CAP_MIN_WINDOW, Zo as STOP_WORDS, Aa as UNSAFE_KEYS, ed as actionsToInspectInfo, $u as actionsToTools, Qr as agentError, Ys as analyzeContext, Ba as applyPatchToClone, Ua as applyPatchToLive, Zr as asAgentError, ic as buildDataPrompt, ac as buildSystemPrompt, af as chatContextKey, Du as commitSetToBind, tc as connectMcp, m as constructLlmFromConfig, p as constructOpenLlmSync, Xd as copyText, Wi as createAgent, ko as createApprovalMiddleware, of as createChatContext, cf as createChatSdk, Bo as createCheckpointManager, Vo as createCheckpointMiddleware, ul as createConflictManager, Xs as createContextInspectorMiddleware, Fu as createDataOps, Gc as createHtmlFormatCheck, Jc as createHtmlSubagent, No as createHumanConfirmMiddleware, Mo as createHumanConfirmTool, jl as createMemoryBackend, So as createMemoryMiddleware, u as createProxyLlm, Yd as createRagSubagent, ao as createSandboxRunner, Bl as createSdkEvents, Fd as createSerialRunner, Fl as createSessionStore, pd as createSkillStore, Es as createSubagentMiddleware, us as createSubagentTracker, ks as createSubagentsMiddleware, sd as createUsageHintsMiddleware, As as createVerifyMiddleware, lc as createVfs, Nl as createWebStorageBackend, Is as createWriteBackCheck, Fa as deepClone, rd as defineDataToolset, so as defineSkill, Yc as defineTool, Pa as deleteByPath, $c as deriveTitle, sa as describeSchemaNode, Oi as detectGarbledToolCall, qa as diffObjects, Vu as domToStructure, Uu as domTools, nd as domToolsStatic, $o as estimateMessageTokens, es as estimateRoundTokens, X as estimateTokens, g as extractReasoningDelta, ba as extractSchemaHint, Zs as extractText, h as extractTextDelta, _ as extractUsage, Lu as fetchDocTools, td as fetchTools, Eu as filterByToolMode, Ka as findStrippedKeys, ca as formatConstraints, qr as formatZodIssues, Z as getByPath, Hu as getDomTool, Ku as getEnvSummary, Ji as getSchemaAtPath, Gi as getSchemaTopKeys, li as getTraceMetrics, $ as hashValue, ha as htmlOrchestratorPrompt, ts as indexSummarize, Yu as inspectEnvTool, Xu as inspectTools, el as isChatModel, yi as isContextLengthError, Ki as isPathAllowed, Cl as isQuotaError, ja as isUnsafePath, tu as jpEval, Yr as jsonParseError, Ra as limitDepth, Ia as maybeParseValue, y as normalizeUsage, ci as offloadPassThroughChars, si as offloadThresholdChars, ma as presets, ta as projectBySchema, ea as projectBySchemaDeep, La as projectFields, ns as recallRounds, la as renderSchemaHint, ua as renderSchemaOverview, pa as renderSchemaShallow, zl as resolveCapabilities, Ul as resolveContextOptions, Ll as resolveDialogConfig, ll as resolveLlm, oi as resolveModelCaps, as as resolvePromptSoftCap, Il as resolveStorage, Ga as restoreInPlace, Wa as restoreLive, Xr as routeError, oo as runHostScript, au as runSandboxedScript, Ma as safeMerge, Gu as safeSerialize, Q as safeStringify, ru as searchJson, id as selectBuiltinTools, Na as setByPath, os as shouldTriggerCompression, ga as systemPromptHelpers, Qo as tokenize, Y as toolError, qi as unwrapSchema, Qd as useChat, sf as useChatContext, xc as validateHtmlFormat, e as z, Jr as zodError };
|