@ls-stack/agent-eval 0.17.0 → 0.19.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/dist/{app-DTotEBoY.mjs → app-hAlVvT-Q.mjs} +23 -4
- package/dist/apps/web/dist/assets/index-C761goIh.css +1 -0
- package/dist/apps/web/dist/assets/index-DS552a3u.js +118 -0
- package/dist/apps/web/dist/index.html +2 -2
- package/dist/bin.mjs +1 -1
- package/dist/{cli-CULTt3Xp.mjs → cli-3zANEAhG.mjs} +3 -3
- package/dist/index.d.mts +63 -350
- package/dist/index.mjs +4 -4
- package/dist/runChild.mjs +1 -1
- package/dist/{runOrchestration-D2okEB3I.mjs → runOrchestration-BBg_VUH5.mjs} +416 -1710
- package/dist/{runner-DyM0Gp8G.mjs → runner-DxlahWDo.mjs} +1 -1
- package/dist/{runner-BSXZiQIi.mjs → runner-RmZPRz-h.mjs} +2 -2
- package/dist/src-BC4OrajN.mjs +3 -0
- package/package.json +1 -1
- package/skills/agent-eval/SKILL.md +8 -4
- package/dist/apps/web/dist/assets/index-C5IRkeUz.js +0 -118
- package/dist/apps/web/dist/assets/index-Cn9WoTj5.css +0 -1
- package/dist/src-CNf3xwVw.mjs +0 -3
|
@@ -6,6 +6,7 @@ import { z, z as z$1 } from "zod/v4";
|
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { formatWithOptions } from "node:util";
|
|
8
8
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
9
|
+
import { gunzipSync, gzipSync } from "node:zlib";
|
|
9
10
|
import { getCompositeKey } from "@ls-stack/utils/getCompositeKey";
|
|
10
11
|
import { existsSync } from "node:fs";
|
|
11
12
|
import { resultify } from "t-result";
|
|
@@ -63,6 +64,8 @@ const consoleCaptureMethods = [
|
|
|
63
64
|
"error"
|
|
64
65
|
];
|
|
65
66
|
const runtimeConsole = globalThis.console;
|
|
67
|
+
const stackFrameLocationPattern = /(?:\((?<parenFile>.+):(?<parenLine>\d+):(?<parenColumn>\d+)\)|at (?<bareFile>.+):(?<bareLine>\d+):(?<bareColumn>\d+))$/;
|
|
68
|
+
const fileUrlPrefixPattern = /^file:\/\//;
|
|
66
69
|
const originalConsoleMethods = {
|
|
67
70
|
log: runtimeConsole.log.bind(runtimeConsole),
|
|
68
71
|
info: runtimeConsole.info.bind(runtimeConsole),
|
|
@@ -203,19 +206,50 @@ function toLogJsonArgs(args) {
|
|
|
203
206
|
truncated: ctx.truncated
|
|
204
207
|
};
|
|
205
208
|
}
|
|
209
|
+
function normalizeStackFile(value) {
|
|
210
|
+
if (!value.startsWith("file://")) return value;
|
|
211
|
+
return decodeURIComponent(value.replace(fileUrlPrefixPattern, ""));
|
|
212
|
+
}
|
|
213
|
+
function isInternalLogFrame(file) {
|
|
214
|
+
return file.includes("/packages/sdk/src/runtime.ts") || file.includes("/node:internal/") || file.startsWith("node:internal/");
|
|
215
|
+
}
|
|
216
|
+
function parseStackFrameLocation(line) {
|
|
217
|
+
const match = stackFrameLocationPattern.exec(line.trim());
|
|
218
|
+
if (!match?.groups) return null;
|
|
219
|
+
const file = match.groups.parenFile ?? match.groups.bareFile;
|
|
220
|
+
const lineNumber = Number(match.groups.parenLine ?? match.groups.bareLine);
|
|
221
|
+
const column = Number(match.groups.parenColumn ?? match.groups.bareColumn);
|
|
222
|
+
if (file === void 0 || !Number.isFinite(lineNumber) || !Number.isFinite(column)) return null;
|
|
223
|
+
return {
|
|
224
|
+
file: normalizeStackFile(file),
|
|
225
|
+
line: lineNumber,
|
|
226
|
+
column
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
function getLogLocation() {
|
|
230
|
+
const stack = (/* @__PURE__ */ new Error()).stack;
|
|
231
|
+
if (stack === void 0) return void 0;
|
|
232
|
+
for (const line of stack.split("\n").slice(1)) {
|
|
233
|
+
const location = parseStackFrameLocation(line);
|
|
234
|
+
if (location === null || isInternalLogFrame(location.file)) continue;
|
|
235
|
+
return location;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
206
238
|
function recordEvalLog(level, args) {
|
|
207
239
|
const scope = getCurrentScope();
|
|
208
240
|
const phase = getCurrentLogPhase();
|
|
209
241
|
if (!scope || !phase) return;
|
|
210
242
|
const preview = formatLogArgs(args);
|
|
211
243
|
const jsonArgs = toLogJsonArgs(args);
|
|
244
|
+
const location = getLogLocation();
|
|
212
245
|
scope.logs.push({
|
|
213
246
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
214
247
|
level: normalizeLogLevel(level),
|
|
215
248
|
phase,
|
|
216
249
|
message: preview.message,
|
|
217
250
|
args: jsonArgs.args,
|
|
218
|
-
truncated: preview.truncated || jsonArgs.truncated
|
|
251
|
+
truncated: preview.truncated || jsonArgs.truncated,
|
|
252
|
+
location
|
|
219
253
|
});
|
|
220
254
|
}
|
|
221
255
|
for (const method of consoleCaptureMethods) runtimeConsole[method] = (...args) => {
|
|
@@ -502,1710 +536,327 @@ function evalAssert(condition, message) {
|
|
|
502
536
|
throw error;
|
|
503
537
|
}
|
|
504
538
|
//#endregion
|
|
505
|
-
//#region
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
[gr]: 6,
|
|
515
|
-
[yr]: 7,
|
|
516
|
-
[Nr]: 8,
|
|
517
|
-
[br]: 9,
|
|
518
|
-
[vr]: 10,
|
|
519
|
-
[P$1]: 11,
|
|
520
|
-
[Cr]: 12
|
|
521
|
-
}, tt = {
|
|
522
|
-
0: v$1,
|
|
523
|
-
1: mr,
|
|
524
|
-
2: R,
|
|
525
|
-
3: C,
|
|
526
|
-
4: pr,
|
|
527
|
-
5: dr,
|
|
528
|
-
6: gr,
|
|
529
|
-
7: yr,
|
|
530
|
-
8: Nr,
|
|
531
|
-
9: br,
|
|
532
|
-
10: vr,
|
|
533
|
-
11: P$1,
|
|
534
|
-
12: Cr
|
|
535
|
-
}, o$1 = void 0, ot = {
|
|
536
|
-
2: !0,
|
|
537
|
-
3: !1,
|
|
538
|
-
1: o$1,
|
|
539
|
-
0: null,
|
|
540
|
-
4: -0,
|
|
541
|
-
5: Number.POSITIVE_INFINITY,
|
|
542
|
-
6: Number.NEGATIVE_INFINITY,
|
|
543
|
-
7: NaN
|
|
544
|
-
};
|
|
545
|
-
var Ce = {
|
|
546
|
-
0: "Error",
|
|
547
|
-
1: "EvalError",
|
|
548
|
-
2: "RangeError",
|
|
549
|
-
3: "ReferenceError",
|
|
550
|
-
4: "SyntaxError",
|
|
551
|
-
5: "TypeError",
|
|
552
|
-
6: "URIError"
|
|
553
|
-
}, at = {
|
|
554
|
-
0: Error,
|
|
555
|
-
1: EvalError,
|
|
556
|
-
2: RangeError,
|
|
557
|
-
3: ReferenceError,
|
|
558
|
-
4: SyntaxError,
|
|
559
|
-
5: TypeError,
|
|
560
|
-
6: URIError
|
|
561
|
-
};
|
|
562
|
-
function c$1(e, r, t, n, a, s, i, u, l, g, S, d) {
|
|
563
|
-
return {
|
|
564
|
-
t: e,
|
|
565
|
-
i: r,
|
|
566
|
-
s: t,
|
|
567
|
-
c: n,
|
|
568
|
-
m: a,
|
|
569
|
-
p: s,
|
|
570
|
-
e: i,
|
|
571
|
-
a: u,
|
|
572
|
-
f: l,
|
|
573
|
-
b: g,
|
|
574
|
-
o: S,
|
|
575
|
-
l: d
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
function B$1(e) {
|
|
579
|
-
return c$1(2, o$1, e, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
580
|
-
}
|
|
581
|
-
var J = B$1(2), Z = B$1(3), Ae = B$1(1), Ee = B$1(0), st = B$1(4), it = B$1(5), ut = B$1(6), lt = B$1(7);
|
|
582
|
-
function fn(e) {
|
|
583
|
-
switch (e) {
|
|
584
|
-
case "\"": return "\\\"";
|
|
585
|
-
case "\\": return "\\\\";
|
|
586
|
-
case `
|
|
587
|
-
`: return "\\n";
|
|
588
|
-
case "\r": return "\\r";
|
|
589
|
-
case "\b": return "\\b";
|
|
590
|
-
case " ": return "\\t";
|
|
591
|
-
case "\f": return "\\f";
|
|
592
|
-
case "<": return "\\x3C";
|
|
593
|
-
case "\u2028": return "\\u2028";
|
|
594
|
-
case "\u2029": return "\\u2029";
|
|
595
|
-
default: return o$1;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
function y$1(e) {
|
|
599
|
-
let r = "", t = 0, n;
|
|
600
|
-
for (let a = 0, s = e.length; a < s; a++) n = fn(e[a]), n && (r += e.slice(t, a) + n, t = a + 1);
|
|
601
|
-
return t === 0 ? r = e : r += e.slice(t), r;
|
|
602
|
-
}
|
|
603
|
-
function Sn(e) {
|
|
604
|
-
switch (e) {
|
|
605
|
-
case "\\\\": return "\\";
|
|
606
|
-
case "\\\"": return "\"";
|
|
607
|
-
case "\\n": return `
|
|
608
|
-
`;
|
|
609
|
-
case "\\r": return "\r";
|
|
610
|
-
case "\\b": return "\b";
|
|
611
|
-
case "\\t": return " ";
|
|
612
|
-
case "\\f": return "\f";
|
|
613
|
-
case "\\x3C": return "<";
|
|
614
|
-
case "\\u2028": return "\u2028";
|
|
615
|
-
case "\\u2029": return "\u2029";
|
|
616
|
-
default: return e;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
function D$1(e) {
|
|
620
|
-
return e.replace(/(\\\\|\\"|\\n|\\r|\\b|\\t|\\f|\\u2028|\\u2029|\\x3C)/g, Sn);
|
|
621
|
-
}
|
|
622
|
-
var U = "__SEROVAL_REFS__";
|
|
623
|
-
var Ar = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map();
|
|
624
|
-
function Er(e) {
|
|
625
|
-
return Ar.has(e);
|
|
626
|
-
}
|
|
627
|
-
function dn(e) {
|
|
628
|
-
return j.has(e);
|
|
629
|
-
}
|
|
630
|
-
function ct(e) {
|
|
631
|
-
if (Er(e)) return Ar.get(e);
|
|
632
|
-
throw new Re(e);
|
|
633
|
-
}
|
|
634
|
-
function ft(e) {
|
|
635
|
-
if (dn(e)) return j.get(e);
|
|
636
|
-
throw new Pe(e);
|
|
637
|
-
}
|
|
638
|
-
typeof globalThis != "undefined" ? Object.defineProperty(globalThis, U, {
|
|
639
|
-
value: j,
|
|
640
|
-
configurable: !0,
|
|
641
|
-
writable: !1,
|
|
642
|
-
enumerable: !1
|
|
643
|
-
}) : typeof window != "undefined" ? Object.defineProperty(window, U, {
|
|
644
|
-
value: j,
|
|
645
|
-
configurable: !0,
|
|
646
|
-
writable: !1,
|
|
647
|
-
enumerable: !1
|
|
648
|
-
}) : typeof self != "undefined" ? Object.defineProperty(self, U, {
|
|
649
|
-
value: j,
|
|
650
|
-
configurable: !0,
|
|
651
|
-
writable: !1,
|
|
652
|
-
enumerable: !1
|
|
653
|
-
}) : typeof global != "undefined" && Object.defineProperty(global, U, {
|
|
654
|
-
value: j,
|
|
655
|
-
configurable: !0,
|
|
656
|
-
writable: !1,
|
|
657
|
-
enumerable: !1
|
|
658
|
-
});
|
|
659
|
-
function xe(e) {
|
|
660
|
-
return e instanceof EvalError ? 1 : e instanceof RangeError ? 2 : e instanceof ReferenceError ? 3 : e instanceof SyntaxError ? 4 : e instanceof TypeError ? 5 : e instanceof URIError ? 6 : 0;
|
|
661
|
-
}
|
|
662
|
-
function gn(e) {
|
|
663
|
-
let r = Ce[xe(e)];
|
|
664
|
-
return e.name !== r ? { name: e.name } : e.constructor.name !== r ? { name: e.constructor.name } : {};
|
|
665
|
-
}
|
|
666
|
-
function $$1(e, r) {
|
|
667
|
-
let t = gn(e), n = Object.getOwnPropertyNames(e);
|
|
668
|
-
for (let a = 0, s = n.length, i; a < s; a++) i = n[a], i !== "name" && i !== "message" && (i === "stack" ? r & 4 && (t = t || {}, t[i] = e[i]) : (t = t || {}, t[i] = e[i]));
|
|
669
|
-
return t;
|
|
670
|
-
}
|
|
671
|
-
function Oe(e) {
|
|
672
|
-
return Object.isFrozen(e) ? 3 : Object.isSealed(e) ? 2 : Object.isExtensible(e) ? 0 : 1;
|
|
673
|
-
}
|
|
674
|
-
function Te(e) {
|
|
675
|
-
switch (e) {
|
|
676
|
-
case Number.POSITIVE_INFINITY: return it;
|
|
677
|
-
case Number.NEGATIVE_INFINITY: return ut;
|
|
678
|
-
}
|
|
679
|
-
return e !== e ? lt : Object.is(e, -0) ? st : c$1(0, o$1, e, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
680
|
-
}
|
|
681
|
-
function X(e) {
|
|
682
|
-
return c$1(1, o$1, y$1(e), o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
683
|
-
}
|
|
684
|
-
function we(e) {
|
|
685
|
-
return c$1(3, o$1, "" + e, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
686
|
-
}
|
|
687
|
-
function mt(e) {
|
|
688
|
-
return c$1(4, e, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
689
|
-
}
|
|
690
|
-
function he(e, r) {
|
|
691
|
-
let t = r.valueOf();
|
|
692
|
-
return c$1(5, e, t !== t ? "" : r.toISOString(), o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
693
|
-
}
|
|
694
|
-
function ze(e, r) {
|
|
695
|
-
return c$1(6, e, o$1, y$1(r.source), r.flags, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
696
|
-
}
|
|
697
|
-
function pt(e, r) {
|
|
698
|
-
return c$1(17, e, ve[r], o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
699
|
-
}
|
|
700
|
-
function dt(e, r) {
|
|
701
|
-
return c$1(18, e, y$1(ct(r)), o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
702
|
-
}
|
|
703
|
-
function fe$1(e, r, t) {
|
|
704
|
-
return c$1(25, e, t, y$1(r), o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
705
|
-
}
|
|
706
|
-
function _e(e, r, t) {
|
|
707
|
-
return c$1(9, e, o$1, o$1, o$1, o$1, o$1, t, o$1, o$1, Oe(r), o$1);
|
|
708
|
-
}
|
|
709
|
-
function ke(e, r) {
|
|
710
|
-
return c$1(21, e, o$1, o$1, o$1, o$1, o$1, o$1, r, o$1, o$1, o$1);
|
|
711
|
-
}
|
|
712
|
-
function De(e, r, t) {
|
|
713
|
-
return c$1(15, e, o$1, r.constructor.name, o$1, o$1, o$1, o$1, t, r.byteOffset, o$1, r.length);
|
|
714
|
-
}
|
|
715
|
-
function Fe(e, r, t) {
|
|
716
|
-
return c$1(16, e, o$1, r.constructor.name, o$1, o$1, o$1, o$1, t, r.byteOffset, o$1, r.byteLength);
|
|
717
|
-
}
|
|
718
|
-
function Be(e, r, t) {
|
|
719
|
-
return c$1(20, e, o$1, o$1, o$1, o$1, o$1, o$1, t, r.byteOffset, o$1, r.byteLength);
|
|
720
|
-
}
|
|
721
|
-
function Ve(e, r, t) {
|
|
722
|
-
return c$1(13, e, xe(r), o$1, y$1(r.message), t, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
723
|
-
}
|
|
724
|
-
function Me(e, r, t) {
|
|
725
|
-
return c$1(14, e, xe(r), o$1, y$1(r.message), t, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
726
|
-
}
|
|
727
|
-
function Le(e, r) {
|
|
728
|
-
return c$1(7, e, o$1, o$1, o$1, o$1, o$1, r, o$1, o$1, o$1, o$1);
|
|
729
|
-
}
|
|
730
|
-
function Ue(e, r) {
|
|
731
|
-
return c$1(28, o$1, o$1, o$1, o$1, o$1, o$1, [e, r], o$1, o$1, o$1, o$1);
|
|
732
|
-
}
|
|
733
|
-
function je(e, r) {
|
|
734
|
-
return c$1(30, o$1, o$1, o$1, o$1, o$1, o$1, [e, r], o$1, o$1, o$1, o$1);
|
|
735
|
-
}
|
|
736
|
-
function Ye(e, r, t) {
|
|
737
|
-
return c$1(31, e, o$1, o$1, o$1, o$1, o$1, t, r, o$1, o$1, o$1);
|
|
539
|
+
//#region ../sdk/src/cacheSerialization.ts
|
|
540
|
+
const serializedCacheValueMarker = "__agentEvalsCacheSerialization";
|
|
541
|
+
const jsonSafeCacheValueVersion = "json-safe-v1";
|
|
542
|
+
const packedNumberArrayMinLength = 128;
|
|
543
|
+
const compressedStringMinBytes = 16 * 1024;
|
|
544
|
+
const compressedJsonMinBytes = 64 * 1024;
|
|
545
|
+
const maxCompressedSizeRatio = .8;
|
|
546
|
+
function isRecordLike$3(value) {
|
|
547
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
738
548
|
}
|
|
739
|
-
function
|
|
740
|
-
return
|
|
549
|
+
function isJsonSafeSerializedCacheValue(value) {
|
|
550
|
+
return isRecordLike$3(value) && value[serializedCacheValueMarker] === jsonSafeCacheValueVersion && typeof value.type === "string";
|
|
741
551
|
}
|
|
742
|
-
function
|
|
743
|
-
return
|
|
552
|
+
function jsonSafeValue(type, value) {
|
|
553
|
+
return value === void 0 ? {
|
|
554
|
+
[serializedCacheValueMarker]: jsonSafeCacheValueVersion,
|
|
555
|
+
type
|
|
556
|
+
} : {
|
|
557
|
+
[serializedCacheValueMarker]: jsonSafeCacheValueVersion,
|
|
558
|
+
type,
|
|
559
|
+
value
|
|
560
|
+
};
|
|
744
561
|
}
|
|
745
|
-
function
|
|
746
|
-
return
|
|
562
|
+
function hasSerializationMarkerKey(value) {
|
|
563
|
+
return Object.hasOwn(value, serializedCacheValueMarker);
|
|
747
564
|
}
|
|
748
|
-
|
|
749
|
-
|
|
565
|
+
/**
|
|
566
|
+
* Serialize one cached value while keeping plain JSON as plain JSON.
|
|
567
|
+
*
|
|
568
|
+
* Rich runtime values use small tagged wrappers.
|
|
569
|
+
*/
|
|
570
|
+
async function serializeCacheValue(value) {
|
|
571
|
+
return serializeJsonSafeValue(value, /* @__PURE__ */ new WeakSet(), 0);
|
|
750
572
|
}
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
serialization: 2,
|
|
755
|
-
deserialization: 3
|
|
756
|
-
};
|
|
757
|
-
function Nn(e) {
|
|
758
|
-
return `Seroval Error (step: ${yn[e]})`;
|
|
573
|
+
/** Revive one cached value, while preserving legacy JSON-round-tripped data. */
|
|
574
|
+
function deserializeCacheValue(value) {
|
|
575
|
+
return deserializeJsonSafeValue(value);
|
|
759
576
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
this.cause = n;
|
|
764
|
-
}
|
|
765
|
-
}, z$2 = class extends Se {
|
|
766
|
-
constructor(r) {
|
|
767
|
-
super("parsing", r);
|
|
768
|
-
}
|
|
769
|
-
}, He = class extends Se {
|
|
770
|
-
constructor(r) {
|
|
771
|
-
super("deserialization", r);
|
|
772
|
-
}
|
|
773
|
-
};
|
|
774
|
-
function _(e) {
|
|
775
|
-
return `Seroval Error (specific: ${e})`;
|
|
577
|
+
/** Clone one value through the same serialization path used for cache data. */
|
|
578
|
+
async function cloneCacheValue(value) {
|
|
579
|
+
return deserializeCacheValue(await serializeCacheValue(value));
|
|
776
580
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
super(_(3));
|
|
789
|
-
}
|
|
790
|
-
}, V = class extends Error {
|
|
791
|
-
constructor(r) {
|
|
792
|
-
super(_(4));
|
|
793
|
-
}
|
|
794
|
-
}, Re = class extends Error {
|
|
795
|
-
constructor(t) {
|
|
796
|
-
super(_(5));
|
|
797
|
-
this.value = t;
|
|
798
|
-
}
|
|
799
|
-
}, Pe = class extends Error {
|
|
800
|
-
constructor(r) {
|
|
801
|
-
super(_(6));
|
|
802
|
-
}
|
|
803
|
-
}, Je = class extends Error {
|
|
804
|
-
constructor(r) {
|
|
805
|
-
super(_(7));
|
|
806
|
-
}
|
|
807
|
-
}, h$1 = class extends Error {
|
|
808
|
-
constructor(r) {
|
|
809
|
-
super(_(8));
|
|
810
|
-
}
|
|
811
|
-
}, ee = class extends Error {
|
|
812
|
-
constructor(r) {
|
|
813
|
-
super(_(9));
|
|
814
|
-
}
|
|
815
|
-
}, Y$1 = class {
|
|
816
|
-
constructor(r, t) {
|
|
817
|
-
this.value = r;
|
|
818
|
-
this.replacement = t;
|
|
819
|
-
}
|
|
820
|
-
}, re = () => {
|
|
821
|
-
let e = {
|
|
822
|
-
p: 0,
|
|
823
|
-
s: 0,
|
|
824
|
-
f: 0
|
|
825
|
-
};
|
|
826
|
-
return e.p = new Promise((r, t) => {
|
|
827
|
-
e.s = r, e.f = t;
|
|
828
|
-
}), e;
|
|
829
|
-
}, vn = (e, r) => {
|
|
830
|
-
e.s(r), e.p.s = 1, e.p.v = r;
|
|
831
|
-
}, Cn = (e, r) => {
|
|
832
|
-
e.f(r), e.p.s = 2, e.p.v = r;
|
|
833
|
-
};
|
|
834
|
-
re.toString();
|
|
835
|
-
vn.toString();
|
|
836
|
-
Cn.toString();
|
|
837
|
-
var Rr = () => {
|
|
838
|
-
let e = [], r = [], t = !0, n = !1, a = 0, s = (l, g, S) => {
|
|
839
|
-
for (S = 0; S < a; S++) r[S] && r[S][g](l);
|
|
840
|
-
}, i = (l, g, S, d) => {
|
|
841
|
-
for (g = 0, S = e.length; g < S; g++) d = e[g], !t && g === S - 1 ? l[n ? "return" : "throw"](d) : l.next(d);
|
|
842
|
-
}, u = (l, g) => (t && (g = a++, r[g] = l), i(l), () => {
|
|
843
|
-
t && (r[g] = r[a], r[a--] = void 0);
|
|
581
|
+
async function serializeJsonSafeValue(value, refs, depth) {
|
|
582
|
+
if (value === void 0) return jsonSafeValue("Undefined");
|
|
583
|
+
if (typeof value === "bigint") return jsonSafeValue("BigInt", value.toString());
|
|
584
|
+
if (typeof value === "number") return serializeNumber(value);
|
|
585
|
+
if (typeof value === "string") return serializeString(value, depth);
|
|
586
|
+
if (value instanceof Date) return jsonSafeValue("Date", value.toISOString());
|
|
587
|
+
if (value instanceof Map) return serializeMap(value, refs, depth);
|
|
588
|
+
if (value instanceof Set) return serializeSet(value, refs, depth);
|
|
589
|
+
if (value instanceof RegExp) return jsonSafeValue("RegExp", {
|
|
590
|
+
flags: value.flags,
|
|
591
|
+
source: value.source
|
|
844
592
|
});
|
|
845
|
-
return
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
},
|
|
854
|
-
return: (l) => {
|
|
855
|
-
t && (e.push(l), s(l, "return"), t = !1, n = !0, r.length = 0);
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
};
|
|
859
|
-
Rr.toString();
|
|
860
|
-
var Pr = (e) => (r) => () => {
|
|
861
|
-
let t = 0, n = {
|
|
862
|
-
[e]: () => n,
|
|
863
|
-
next: () => {
|
|
864
|
-
if (t > r.d) return {
|
|
865
|
-
done: !0,
|
|
866
|
-
value: void 0
|
|
867
|
-
};
|
|
868
|
-
let a = t++, s = r.v[a];
|
|
869
|
-
if (a === r.t) throw s;
|
|
870
|
-
return {
|
|
871
|
-
done: a === r.d,
|
|
872
|
-
value: s
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
};
|
|
876
|
-
return n;
|
|
877
|
-
};
|
|
878
|
-
Pr.toString();
|
|
879
|
-
var xr = (e, r) => (t) => () => {
|
|
880
|
-
let n = 0, a = -1, s = !1, i = [], u = [], l = (S = 0, d = u.length) => {
|
|
881
|
-
for (; S < d; S++) u[S].s({
|
|
882
|
-
done: !0,
|
|
883
|
-
value: void 0
|
|
884
|
-
});
|
|
885
|
-
};
|
|
886
|
-
t.on({
|
|
887
|
-
next: (S) => {
|
|
888
|
-
let d = u.shift();
|
|
889
|
-
d && d.s({
|
|
890
|
-
done: !1,
|
|
891
|
-
value: S
|
|
892
|
-
}), i.push(S);
|
|
893
|
-
},
|
|
894
|
-
throw: (S) => {
|
|
895
|
-
let d = u.shift();
|
|
896
|
-
d && d.f(S), l(), a = i.length, s = !0, i.push(S);
|
|
897
|
-
},
|
|
898
|
-
return: (S) => {
|
|
899
|
-
let d = u.shift();
|
|
900
|
-
d && d.s({
|
|
901
|
-
done: !0,
|
|
902
|
-
value: S
|
|
903
|
-
}), l(), a = i.length, i.push(S);
|
|
904
|
-
}
|
|
593
|
+
if (value instanceof URL) return jsonSafeValue("URL", value.toString());
|
|
594
|
+
if (value instanceof URLSearchParams) return jsonSafeValue("URLSearchParams", value.toString());
|
|
595
|
+
if (value instanceof Headers) return jsonSafeValue("Headers", [...value.entries()]);
|
|
596
|
+
if (value instanceof File) return jsonSafeValue("File", {
|
|
597
|
+
bytes: await blobToBase64(value),
|
|
598
|
+
lastModified: value.lastModified,
|
|
599
|
+
name: value.name,
|
|
600
|
+
type: value.type
|
|
905
601
|
});
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
602
|
+
if (value instanceof Blob) return jsonSafeValue("Blob", {
|
|
603
|
+
bytes: await blobToBase64(value),
|
|
604
|
+
type: value.type
|
|
605
|
+
});
|
|
606
|
+
if (value instanceof ArrayBuffer) return jsonSafeValue("ArrayBuffer", bytesToBase64(new Uint8Array(value)));
|
|
607
|
+
if (value instanceof Error) return serializeError(value, refs, depth);
|
|
608
|
+
if (!value || typeof value !== "object") return value;
|
|
609
|
+
if (refs.has(value)) throw new Error("Circular cache values are not supported");
|
|
610
|
+
refs.add(value);
|
|
611
|
+
if (Array.isArray(value)) {
|
|
612
|
+
if (depth > 0 && value.length >= packedNumberArrayMinLength && isDenseNumberArray(value)) {
|
|
613
|
+
const packed = packNumberArray(value);
|
|
614
|
+
if (packed !== void 0) {
|
|
615
|
+
refs.delete(value);
|
|
616
|
+
return packed;
|
|
919
617
|
}
|
|
920
|
-
if (n > a) return {
|
|
921
|
-
done: !0,
|
|
922
|
-
value: void 0
|
|
923
|
-
};
|
|
924
|
-
let S = n++, d = i[S];
|
|
925
|
-
if (S !== a) return {
|
|
926
|
-
done: !1,
|
|
927
|
-
value: d
|
|
928
|
-
};
|
|
929
|
-
if (s) throw d;
|
|
930
|
-
return {
|
|
931
|
-
done: !0,
|
|
932
|
-
value: d
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
return g;
|
|
937
|
-
};
|
|
938
|
-
xr.toString();
|
|
939
|
-
var Or = (e) => {
|
|
940
|
-
let r = atob(e), t = r.length, n = new Uint8Array(t);
|
|
941
|
-
for (let a = 0; a < t; a++) n[a] = r.charCodeAt(a);
|
|
942
|
-
return n.buffer;
|
|
943
|
-
};
|
|
944
|
-
Or.toString();
|
|
945
|
-
function Ze(e) {
|
|
946
|
-
return "__SEROVAL_SEQUENCE__" in e;
|
|
947
|
-
}
|
|
948
|
-
function Tr(e, r, t) {
|
|
949
|
-
return {
|
|
950
|
-
__SEROVAL_SEQUENCE__: !0,
|
|
951
|
-
v: e,
|
|
952
|
-
t: r,
|
|
953
|
-
d: t
|
|
954
|
-
};
|
|
955
|
-
}
|
|
956
|
-
function $e(e) {
|
|
957
|
-
let r = [], t = -1, n = -1, a = e[C]();
|
|
958
|
-
for (;;) try {
|
|
959
|
-
let s = a.next();
|
|
960
|
-
if (r.push(s.value), s.done) {
|
|
961
|
-
n = r.length - 1;
|
|
962
|
-
break;
|
|
963
|
-
}
|
|
964
|
-
} catch (s) {
|
|
965
|
-
t = r.length, r.push(s);
|
|
966
|
-
}
|
|
967
|
-
return Tr(r, t, n);
|
|
968
|
-
}
|
|
969
|
-
var An = Pr(C);
|
|
970
|
-
function It(e) {
|
|
971
|
-
return An(e);
|
|
972
|
-
}
|
|
973
|
-
var Rt = {}, Pt = {}, xt = {
|
|
974
|
-
0: {},
|
|
975
|
-
1: {},
|
|
976
|
-
2: {},
|
|
977
|
-
3: {},
|
|
978
|
-
4: {},
|
|
979
|
-
5: {}
|
|
980
|
-
};
|
|
981
|
-
function M(e) {
|
|
982
|
-
return "__SEROVAL_STREAM__" in e;
|
|
983
|
-
}
|
|
984
|
-
function te$1() {
|
|
985
|
-
return Rr();
|
|
986
|
-
}
|
|
987
|
-
function Xe(e) {
|
|
988
|
-
let r = te$1(), t = e[v$1]();
|
|
989
|
-
async function n() {
|
|
990
|
-
try {
|
|
991
|
-
let a = await t.next();
|
|
992
|
-
a.done ? r.return(a.value) : (r.next(a.value), await n());
|
|
993
|
-
} catch (a) {
|
|
994
|
-
r.throw(a);
|
|
995
618
|
}
|
|
619
|
+
const items = [];
|
|
620
|
+
for (const item of value) items.push(await serializeJsonSafeValue(item, refs, depth + 1));
|
|
621
|
+
refs.delete(value);
|
|
622
|
+
return compressNestedJsonValue(items, depth) ?? items;
|
|
996
623
|
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
return
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
}
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
624
|
+
const entries = [];
|
|
625
|
+
for (const [key, entryValue] of Object.entries(value)) entries.push([key, await serializeJsonSafeValue(entryValue, refs, depth + 1)]);
|
|
626
|
+
refs.delete(value);
|
|
627
|
+
const serialized = hasSerializationMarkerKey(value) ? jsonSafeValue("Object", entries) : Object.fromEntries(entries);
|
|
628
|
+
return compressNestedJsonValue(serialized, depth) ?? serialized;
|
|
629
|
+
}
|
|
630
|
+
function serializeNumber(value) {
|
|
631
|
+
if (Number.isNaN(value)) return jsonSafeValue("Number", "NaN");
|
|
632
|
+
if (value === Infinity) return jsonSafeValue("Number", "Infinity");
|
|
633
|
+
if (value === -Infinity) return jsonSafeValue("Number", "-Infinity");
|
|
634
|
+
if (Object.is(value, -0)) return jsonSafeValue("Number", "-0");
|
|
635
|
+
return value;
|
|
636
|
+
}
|
|
637
|
+
function serializeString(value, depth) {
|
|
638
|
+
if (depth === 0) return value;
|
|
639
|
+
return compressNestedStringValue(value) ?? value;
|
|
640
|
+
}
|
|
641
|
+
function isDenseNumberArray(value) {
|
|
642
|
+
for (let index = 0; index < value.length; index++) if (typeof value[index] !== "number") return false;
|
|
643
|
+
return true;
|
|
644
|
+
}
|
|
645
|
+
function encodeFloat64Array(value) {
|
|
646
|
+
const bytes = /* @__PURE__ */ new ArrayBuffer(value.length * 8);
|
|
647
|
+
const view = new DataView(bytes);
|
|
648
|
+
for (const [index, item] of value.entries()) view.setFloat64(index * 8, item, true);
|
|
649
|
+
return bytesToBase64(new Uint8Array(bytes));
|
|
650
|
+
}
|
|
651
|
+
function packNumberArray(value) {
|
|
652
|
+
const serialized = {
|
|
653
|
+
[serializedCacheValueMarker]: jsonSafeCacheValueVersion,
|
|
654
|
+
length: value.length,
|
|
655
|
+
type: "Float64Array",
|
|
656
|
+
value: encodeFloat64Array(value)
|
|
1018
657
|
};
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
658
|
+
return compressionIsWorthIt(serialized, Buffer$1.byteLength(JSON.stringify(value))) ? serialized : void 0;
|
|
659
|
+
}
|
|
660
|
+
function decodeFloat64Array(value, length) {
|
|
661
|
+
const bytes = base64ToArrayBuffer(value);
|
|
662
|
+
const view = new DataView(bytes);
|
|
663
|
+
return Array.from({ length }, (_, index) => view.getFloat64(index * 8, true));
|
|
664
|
+
}
|
|
665
|
+
function compressNestedStringValue(value) {
|
|
666
|
+
const rawSize = Buffer$1.byteLength(JSON.stringify(value));
|
|
667
|
+
if (rawSize < compressedStringMinBytes) return void 0;
|
|
668
|
+
const compressed = gzipSync(value);
|
|
669
|
+
const serialized = {
|
|
670
|
+
[serializedCacheValueMarker]: jsonSafeCacheValueVersion,
|
|
671
|
+
codec: "gzip",
|
|
672
|
+
length: Buffer$1.byteLength(value),
|
|
673
|
+
type: "CompressedString",
|
|
674
|
+
value: compressed.toString("base64")
|
|
1035
675
|
};
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
}
|
|
1050
|
-
function k(e, r) {
|
|
1051
|
-
let t = Qe(e, xt[r]);
|
|
1052
|
-
return t.type === 1 ? t.value : c$1(26, t.value, r, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1, o$1);
|
|
1053
|
-
}
|
|
1054
|
-
function er(e) {
|
|
1055
|
-
let r = Qe(e, Rt);
|
|
1056
|
-
return r.type === 1 ? r.value : c$1(27, r.value, o$1, o$1, o$1, o$1, o$1, o$1, I(e, C), o$1, o$1, o$1);
|
|
1057
|
-
}
|
|
1058
|
-
function rr(e) {
|
|
1059
|
-
let r = Qe(e, Pt);
|
|
1060
|
-
return r.type === 1 ? r.value : c$1(29, r.value, o$1, o$1, o$1, o$1, o$1, [k(e, 1), I(e, v$1)], o$1, o$1, o$1, o$1);
|
|
1061
|
-
}
|
|
1062
|
-
function tr(e, r, t, n) {
|
|
1063
|
-
return c$1(t ? 11 : 10, e, o$1, o$1, o$1, n, o$1, o$1, o$1, o$1, Oe(r), o$1);
|
|
1064
|
-
}
|
|
1065
|
-
function nr(e, r, t, n) {
|
|
1066
|
-
return c$1(8, r, o$1, o$1, o$1, o$1, {
|
|
1067
|
-
k: t,
|
|
1068
|
-
v: n
|
|
1069
|
-
}, o$1, k(e, 0), o$1, o$1, o$1);
|
|
1070
|
-
}
|
|
1071
|
-
function or(e, r, t) {
|
|
1072
|
-
let n = new Uint8Array(t), a = "";
|
|
1073
|
-
for (let s = 0, i = n.length; s < i; s++) a += String.fromCharCode(n[s]);
|
|
1074
|
-
return c$1(19, r, y$1(btoa(a)), o$1, o$1, o$1, o$1, o$1, k(e, 5), o$1, o$1, o$1);
|
|
1075
|
-
}
|
|
1076
|
-
function ne$1(e, r) {
|
|
1077
|
-
return {
|
|
1078
|
-
base: pe$1(e, r),
|
|
1079
|
-
child: void 0
|
|
676
|
+
return compressionIsWorthIt(serialized, rawSize) ? serialized : void 0;
|
|
677
|
+
}
|
|
678
|
+
function compressNestedJsonValue(value, depth) {
|
|
679
|
+
if (depth === 0) return void 0;
|
|
680
|
+
const raw = JSON.stringify(value);
|
|
681
|
+
const rawSize = Buffer$1.byteLength(raw);
|
|
682
|
+
if (rawSize < compressedJsonMinBytes) return void 0;
|
|
683
|
+
const serialized = {
|
|
684
|
+
[serializedCacheValueMarker]: jsonSafeCacheValueVersion,
|
|
685
|
+
codec: "gzip",
|
|
686
|
+
length: rawSize,
|
|
687
|
+
type: "CompressedJson",
|
|
688
|
+
value: gzipSync(raw).toString("base64")
|
|
1080
689
|
};
|
|
690
|
+
return compressionIsWorthIt(serialized, rawSize) ? serialized : void 0;
|
|
1081
691
|
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
this._p = r;
|
|
1085
|
-
this.depth = t;
|
|
1086
|
-
}
|
|
1087
|
-
parse(r) {
|
|
1088
|
-
return N$1(this._p, this.depth, r);
|
|
1089
|
-
}
|
|
1090
|
-
};
|
|
1091
|
-
async function Rn(e, r, t) {
|
|
1092
|
-
let n = [];
|
|
1093
|
-
for (let a = 0, s = t.length; a < s; a++) a in t ? n[a] = await N$1(e, r, t[a]) : n[a] = 0;
|
|
1094
|
-
return n;
|
|
1095
|
-
}
|
|
1096
|
-
async function Pn(e, r, t, n) {
|
|
1097
|
-
return _e(t, n, await Rn(e, r, n));
|
|
1098
|
-
}
|
|
1099
|
-
async function kr(e, r, t) {
|
|
1100
|
-
let n = Object.entries(t), a = [], s = [];
|
|
1101
|
-
for (let i = 0, u = n.length; i < u; i++) a.push(y$1(n[i][0])), s.push(await N$1(e, r, n[i][1]));
|
|
1102
|
-
return C in t && (a.push(I(e.base, C)), s.push(Ue(er(e.base), await N$1(e, r, $e(t))))), v$1 in t && (a.push(I(e.base, v$1)), s.push(je(rr(e.base), await N$1(e, r, Xe(t))))), P$1 in t && (a.push(I(e.base, P$1)), s.push(X(t[P$1]))), R in t && (a.push(I(e.base, R)), s.push(t[R] ? J : Z)), {
|
|
1103
|
-
k: a,
|
|
1104
|
-
v: s
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
async function zr(e, r, t, n, a) {
|
|
1108
|
-
return tr(t, n, a, await kr(e, r, n));
|
|
1109
|
-
}
|
|
1110
|
-
async function xn(e, r, t, n) {
|
|
1111
|
-
return ke(t, await N$1(e, r, n.valueOf()));
|
|
1112
|
-
}
|
|
1113
|
-
async function On(e, r, t, n) {
|
|
1114
|
-
return De(t, n, await N$1(e, r, n.buffer));
|
|
692
|
+
function compressionIsWorthIt(value, rawSize) {
|
|
693
|
+
return Buffer$1.byteLength(JSON.stringify(value)) < rawSize * maxCompressedSizeRatio;
|
|
1115
694
|
}
|
|
1116
|
-
async function
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
let a = $$1(n, e.base.features);
|
|
1124
|
-
return Ve(t, n, a ? await kr(e, r, a) : o$1);
|
|
1125
|
-
}
|
|
1126
|
-
async function hn(e, r, t, n) {
|
|
1127
|
-
let a = $$1(n, e.base.features);
|
|
1128
|
-
return Me(t, n, a ? await kr(e, r, a) : o$1);
|
|
1129
|
-
}
|
|
1130
|
-
async function zn(e, r, t, n) {
|
|
1131
|
-
let a = [], s = [];
|
|
1132
|
-
for (let [i, u] of n.entries()) a.push(await N$1(e, r, i)), s.push(await N$1(e, r, u));
|
|
1133
|
-
return nr(e.base, t, a, s);
|
|
695
|
+
async function serializeMap(value, refs, depth) {
|
|
696
|
+
if (refs.has(value)) throw new Error("Circular cache values are not supported");
|
|
697
|
+
refs.add(value);
|
|
698
|
+
const entries = [];
|
|
699
|
+
for (const [key, entryValue] of value.entries()) entries.push([await serializeJsonSafeValue(key, refs, depth + 1), await serializeJsonSafeValue(entryValue, refs, depth + 1)]);
|
|
700
|
+
refs.delete(value);
|
|
701
|
+
return jsonSafeValue("Map", entries);
|
|
1134
702
|
}
|
|
1135
|
-
async function
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
703
|
+
async function serializeSet(value, refs, depth) {
|
|
704
|
+
if (refs.has(value)) throw new Error("Circular cache values are not supported");
|
|
705
|
+
refs.add(value);
|
|
706
|
+
const items = [];
|
|
707
|
+
for (const item of value.values()) items.push(await serializeJsonSafeValue(item, refs, depth + 1));
|
|
708
|
+
refs.delete(value);
|
|
709
|
+
return jsonSafeValue("Set", items);
|
|
1139
710
|
}
|
|
1140
|
-
async function
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
711
|
+
async function serializeError(value, refs, depth) {
|
|
712
|
+
if (refs.has(value)) throw new Error("Circular cache values are not supported");
|
|
713
|
+
refs.add(value);
|
|
714
|
+
const props = [];
|
|
715
|
+
for (const [key, entryValue] of Object.entries(value)) {
|
|
716
|
+
if (key === "cause") continue;
|
|
717
|
+
props.push([key, await serializeJsonSafeValue(entryValue, refs, depth + 1)]);
|
|
1145
718
|
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
function Dn(e, r, t, n, a) {
|
|
1153
|
-
let s = [], i = t.on({
|
|
1154
|
-
next: (u) => {
|
|
1155
|
-
de(this.base, r), N$1(this, e, u).then((l) => {
|
|
1156
|
-
s.push(qe(r, l));
|
|
1157
|
-
}, (l) => {
|
|
1158
|
-
a(l), i();
|
|
1159
|
-
});
|
|
1160
|
-
},
|
|
1161
|
-
throw: (u) => {
|
|
1162
|
-
de(this.base, r), N$1(this, e, u).then((l) => {
|
|
1163
|
-
s.push(We(r, l)), n(s), i();
|
|
1164
|
-
}, (l) => {
|
|
1165
|
-
a(l), i();
|
|
1166
|
-
});
|
|
1167
|
-
},
|
|
1168
|
-
return: (u) => {
|
|
1169
|
-
de(this.base, r), N$1(this, e, u).then((l) => {
|
|
1170
|
-
s.push(Ge(r, l)), n(s), i();
|
|
1171
|
-
}, (l) => {
|
|
1172
|
-
a(l), i();
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
719
|
+
const serialized = jsonSafeValue("Error", {
|
|
720
|
+
cause: "cause" in value ? await serializeJsonSafeValue(value.cause, refs, depth + 1) : void 0,
|
|
721
|
+
message: value.message,
|
|
722
|
+
name: value.name,
|
|
723
|
+
props,
|
|
724
|
+
stack: value.stack
|
|
1175
725
|
});
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
return
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
if (
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
case
|
|
1200
|
-
case
|
|
1201
|
-
case
|
|
1202
|
-
case
|
|
1203
|
-
case
|
|
1204
|
-
case
|
|
1205
|
-
case
|
|
1206
|
-
case
|
|
1207
|
-
case
|
|
1208
|
-
case
|
|
1209
|
-
case
|
|
1210
|
-
case
|
|
1211
|
-
case
|
|
1212
|
-
case
|
|
1213
|
-
case
|
|
1214
|
-
case
|
|
1215
|
-
case
|
|
1216
|
-
case
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
if (
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
if (
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
async function N$1(e, r, t) {
|
|
1244
|
-
switch (typeof t) {
|
|
1245
|
-
case "boolean": return t ? J : Z;
|
|
1246
|
-
case "undefined": return Ae;
|
|
1247
|
-
case "string": return X(t);
|
|
1248
|
-
case "number": return Te(t);
|
|
1249
|
-
case "bigint": return we(t);
|
|
1250
|
-
case "object":
|
|
1251
|
-
if (t) {
|
|
1252
|
-
let n = q$1(e.base, t);
|
|
1253
|
-
return n.type === 0 ? await Vn(e, r + 1, n.value, t) : n.value;
|
|
1254
|
-
}
|
|
1255
|
-
return Ee;
|
|
1256
|
-
case "symbol": return I(e.base, t);
|
|
1257
|
-
case "function": return Mn(e, r, t);
|
|
1258
|
-
default: throw new x$1(t);
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
async function oe(e, r) {
|
|
1262
|
-
try {
|
|
1263
|
-
return await N$1(e, 0, r);
|
|
1264
|
-
} catch (t) {
|
|
1265
|
-
throw t instanceof z$2 ? t : new z$2(t);
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
var ae = ((t) => (t[t.Vanilla = 1] = "Vanilla", t[t.Cross = 2] = "Cross", t))(ae || {});
|
|
1269
|
-
function ni(e) {
|
|
1270
|
-
return e;
|
|
1271
|
-
}
|
|
1272
|
-
function kt(e, r) {
|
|
1273
|
-
for (let t = 0, n = r.length; t < n; t++) {
|
|
1274
|
-
let a = r[t];
|
|
1275
|
-
e.has(a) || (e.add(a), a.extends && kt(e, a.extends));
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
function A(e) {
|
|
1279
|
-
if (e) {
|
|
1280
|
-
let r = /* @__PURE__ */ new Set();
|
|
1281
|
-
return kt(r, e), [...r];
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
function Dt(e) {
|
|
1285
|
-
switch (e) {
|
|
1286
|
-
case "Int8Array": return Int8Array;
|
|
1287
|
-
case "Int16Array": return Int16Array;
|
|
1288
|
-
case "Int32Array": return Int32Array;
|
|
1289
|
-
case "Uint8Array": return Uint8Array;
|
|
1290
|
-
case "Uint16Array": return Uint16Array;
|
|
1291
|
-
case "Uint32Array": return Uint32Array;
|
|
1292
|
-
case "Uint8ClampedArray": return Uint8ClampedArray;
|
|
1293
|
-
case "Float32Array": return Float32Array;
|
|
1294
|
-
case "Float64Array": return Float64Array;
|
|
1295
|
-
case "BigInt64Array": return BigInt64Array;
|
|
1296
|
-
case "BigUint64Array": return BigUint64Array;
|
|
1297
|
-
default: throw new Je(e);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
var Ln = 1e6, Un = 1e4, jn = 2e4;
|
|
1301
|
-
function Bt(e, r) {
|
|
1302
|
-
switch (r) {
|
|
1303
|
-
case 3: return Object.freeze(e);
|
|
1304
|
-
case 1: return Object.preventExtensions(e);
|
|
1305
|
-
case 2: return Object.seal(e);
|
|
1306
|
-
default: return e;
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
var Yn = 1e3;
|
|
1310
|
-
function Vt(e, r) {
|
|
1311
|
-
var t;
|
|
1312
|
-
return {
|
|
1313
|
-
mode: e,
|
|
1314
|
-
plugins: r.plugins,
|
|
1315
|
-
refs: r.refs || /* @__PURE__ */ new Map(),
|
|
1316
|
-
features: (t = r.features) != null ? t : 63 ^ (r.disabledFeatures || 0),
|
|
1317
|
-
depthLimit: r.depthLimit || Yn
|
|
1318
|
-
};
|
|
1319
|
-
}
|
|
1320
|
-
function Mt(e) {
|
|
1321
|
-
return {
|
|
1322
|
-
mode: 1,
|
|
1323
|
-
base: Vt(1, e),
|
|
1324
|
-
child: o$1,
|
|
1325
|
-
state: { marked: new Set(e.markedRefs) }
|
|
1326
|
-
};
|
|
1327
|
-
}
|
|
1328
|
-
var Dr = class {
|
|
1329
|
-
constructor(r, t) {
|
|
1330
|
-
this._p = r;
|
|
1331
|
-
this.depth = t;
|
|
1332
|
-
}
|
|
1333
|
-
deserialize(r) {
|
|
1334
|
-
return p$1(this._p, this.depth, r);
|
|
1335
|
-
}
|
|
1336
|
-
};
|
|
1337
|
-
function Ut(e, r) {
|
|
1338
|
-
if (r < 0 || !Number.isFinite(r) || !Number.isInteger(r)) throw new h$1({
|
|
1339
|
-
t: 4,
|
|
1340
|
-
i: r
|
|
726
|
+
refs.delete(value);
|
|
727
|
+
return serialized;
|
|
728
|
+
}
|
|
729
|
+
async function blobToBase64(value) {
|
|
730
|
+
return bytesToBase64(new Uint8Array(await value.arrayBuffer()));
|
|
731
|
+
}
|
|
732
|
+
function bytesToBase64(value) {
|
|
733
|
+
return Buffer$1.from(value).toString("base64");
|
|
734
|
+
}
|
|
735
|
+
function base64ToArrayBuffer(value) {
|
|
736
|
+
const source = Buffer$1.from(value, "base64");
|
|
737
|
+
const target = new ArrayBuffer(source.byteLength);
|
|
738
|
+
new Uint8Array(target).set(source);
|
|
739
|
+
return target;
|
|
740
|
+
}
|
|
741
|
+
function deserializeJsonSafeValue(value) {
|
|
742
|
+
if (isJsonSafeSerializedCacheValue(value)) return deserializeJsonSafeWrapper(value);
|
|
743
|
+
if (Array.isArray(value)) return value.map(deserializeJsonSafeValue);
|
|
744
|
+
if (!isRecordLike$3(value)) return value;
|
|
745
|
+
return Object.fromEntries(Object.entries(value).map(([key, entryValue]) => [key, deserializeJsonSafeValue(entryValue)]));
|
|
746
|
+
}
|
|
747
|
+
function deserializeJsonSafeWrapper(value) {
|
|
748
|
+
switch (value.type) {
|
|
749
|
+
case "ArrayBuffer": return deserializeArrayBuffer(value.value);
|
|
750
|
+
case "BigInt": return typeof value.value === "string" ? BigInt(value.value) : value.value;
|
|
751
|
+
case "Blob": return deserializeBlob(value.value);
|
|
752
|
+
case "CompressedJson": return deserializeCompressedJson(value.value);
|
|
753
|
+
case "CompressedString": return deserializeCompressedString(value.value);
|
|
754
|
+
case "Date": return typeof value.value === "string" ? new Date(value.value) : value.value;
|
|
755
|
+
case "Error": return deserializeError(value.value);
|
|
756
|
+
case "File": return deserializeFile(value.value);
|
|
757
|
+
case "Float64Array": return deserializeFloat64Array(value.value, value.length);
|
|
758
|
+
case "Headers": return new Headers(deserializeStringPairArray(value.value));
|
|
759
|
+
case "Map": return new Map(deserializePairArray(value.value));
|
|
760
|
+
case "Number": return deserializeNumber(value.value);
|
|
761
|
+
case "Object": return Object.fromEntries(deserializeStringValuePairArray(value.value));
|
|
762
|
+
case "RegExp": return deserializeRegExp(value.value);
|
|
763
|
+
case "Set": return new Set(deserializeArray(value.value));
|
|
764
|
+
case "URL": return typeof value.value === "string" ? new URL(value.value) : value.value;
|
|
765
|
+
case "URLSearchParams": return typeof value.value === "string" ? new URLSearchParams(value.value) : value.value;
|
|
766
|
+
case "Undefined": return;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
function deserializeNumber(value) {
|
|
770
|
+
if (value === "NaN") return NaN;
|
|
771
|
+
if (value === "Infinity") return Infinity;
|
|
772
|
+
if (value === "-Infinity") return -Infinity;
|
|
773
|
+
if (value === "-0") return -0;
|
|
774
|
+
return value;
|
|
775
|
+
}
|
|
776
|
+
function deserializeCompressedString(value) {
|
|
777
|
+
if (typeof value !== "string") return value;
|
|
778
|
+
return gunzipSync(Buffer$1.from(value, "base64")).toString("utf8");
|
|
779
|
+
}
|
|
780
|
+
function deserializeCompressedJson(value) {
|
|
781
|
+
if (typeof value !== "string") return value;
|
|
782
|
+
return deserializeJsonSafeValue(JSON.parse(gunzipSync(Buffer$1.from(value, "base64")).toString("utf8")));
|
|
783
|
+
}
|
|
784
|
+
function deserializeFloat64Array(value, length) {
|
|
785
|
+
if (typeof value !== "string" || typeof length !== "number") return value;
|
|
786
|
+
return decodeFloat64Array(value, length);
|
|
787
|
+
}
|
|
788
|
+
function deserializePairArray(value) {
|
|
789
|
+
if (!Array.isArray(value)) return [];
|
|
790
|
+
return value.flatMap((entry) => {
|
|
791
|
+
if (!Array.isArray(entry) || entry.length !== 2) return [];
|
|
792
|
+
return [[deserializeJsonSafeValue(entry[0]), deserializeJsonSafeValue(entry[1])]];
|
|
1341
793
|
});
|
|
1342
|
-
if (e.refs.has(r)) throw new Error("Conflicted ref id: " + r);
|
|
1343
|
-
}
|
|
1344
|
-
function qn(e, r, t) {
|
|
1345
|
-
return Ut(e.base, r), e.state.marked.has(r) && e.base.refs.set(r, t), t;
|
|
1346
|
-
}
|
|
1347
|
-
function Wn(e, r, t) {
|
|
1348
|
-
return Ut(e.base, r), e.base.refs.set(r, t), t;
|
|
1349
|
-
}
|
|
1350
|
-
function b(e, r, t) {
|
|
1351
|
-
return e.mode === 1 ? qn(e, r, t) : Wn(e, r, t);
|
|
1352
|
-
}
|
|
1353
|
-
function Fr(e, r, t) {
|
|
1354
|
-
if (Object.hasOwn(r, t)) return r[t];
|
|
1355
|
-
throw new h$1(e);
|
|
1356
|
-
}
|
|
1357
|
-
function Gn(e, r) {
|
|
1358
|
-
return b(e, r.i, ft(D$1(r.s)));
|
|
1359
|
-
}
|
|
1360
|
-
function Kn(e, r, t) {
|
|
1361
|
-
let n = t.a, a = n.length, s = b(e, t.i, new Array(a));
|
|
1362
|
-
for (let i = 0, u; i < a; i++) u = n[i], u && (s[i] = p$1(e, r, u));
|
|
1363
|
-
return Bt(s, t.o), s;
|
|
1364
|
-
}
|
|
1365
|
-
function Hn(e) {
|
|
1366
|
-
switch (e) {
|
|
1367
|
-
case "constructor":
|
|
1368
|
-
case "__proto__":
|
|
1369
|
-
case "prototype":
|
|
1370
|
-
case "__defineGetter__":
|
|
1371
|
-
case "__defineSetter__":
|
|
1372
|
-
case "__lookupGetter__":
|
|
1373
|
-
case "__lookupSetter__": return !1;
|
|
1374
|
-
default: return !0;
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
function Jn(e) {
|
|
1378
|
-
switch (e) {
|
|
1379
|
-
case v$1:
|
|
1380
|
-
case R:
|
|
1381
|
-
case P$1:
|
|
1382
|
-
case C: return !0;
|
|
1383
|
-
default: return !1;
|
|
1384
|
-
}
|
|
1385
794
|
}
|
|
1386
|
-
function
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
enumerable: !0,
|
|
1391
|
-
writable: !0
|
|
795
|
+
function deserializeStringPairArray(value) {
|
|
796
|
+
return deserializePairArray(value).flatMap(([key, entryValue]) => {
|
|
797
|
+
if (typeof key !== "string" || typeof entryValue !== "string") return [];
|
|
798
|
+
return [[key, entryValue]];
|
|
1392
799
|
});
|
|
1393
800
|
}
|
|
1394
|
-
function
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
switch (typeof s) {
|
|
1399
|
-
case "string":
|
|
1400
|
-
Ft(t, s, p$1(e, r, a));
|
|
1401
|
-
break;
|
|
1402
|
-
case "symbol":
|
|
1403
|
-
Jn(s) && (t[s] = p$1(e, r, a));
|
|
1404
|
-
break;
|
|
1405
|
-
default: throw new h$1(n);
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
function jt(e, r, t, n) {
|
|
1410
|
-
let a = t.k;
|
|
1411
|
-
if (a.length > 0) for (let i = 0, u = t.v, l = a.length; i < l; i++) Zn(e, r, n, a[i], u[i]);
|
|
1412
|
-
return n;
|
|
1413
|
-
}
|
|
1414
|
-
function $n(e, r, t) {
|
|
1415
|
-
let n = b(e, t.i, t.t === 10 ? {} : Object.create(null));
|
|
1416
|
-
return jt(e, r, t.p, n), Bt(n, t.o), n;
|
|
1417
|
-
}
|
|
1418
|
-
function Xn(e, r) {
|
|
1419
|
-
return b(e, r.i, new Date(r.s));
|
|
1420
|
-
}
|
|
1421
|
-
function Qn(e, r) {
|
|
1422
|
-
if (e.base.features & 32) {
|
|
1423
|
-
let t = D$1(r.c);
|
|
1424
|
-
if (t.length > jn) throw new h$1(r);
|
|
1425
|
-
return b(e, r.i, new RegExp(t, r.m));
|
|
1426
|
-
}
|
|
1427
|
-
throw new w$1(r);
|
|
1428
|
-
}
|
|
1429
|
-
function eo(e, r, t) {
|
|
1430
|
-
let n = b(e, t.i, /* @__PURE__ */ new Set());
|
|
1431
|
-
for (let a = 0, s = t.a, i = s.length; a < i; a++) n.add(p$1(e, r, s[a]));
|
|
1432
|
-
return n;
|
|
1433
|
-
}
|
|
1434
|
-
function ro(e, r, t) {
|
|
1435
|
-
let n = b(e, t.i, /* @__PURE__ */ new Map());
|
|
1436
|
-
for (let a = 0, s = t.e.k, i = t.e.v, u = s.length; a < u; a++) n.set(p$1(e, r, s[a]), p$1(e, r, i[a]));
|
|
1437
|
-
return n;
|
|
1438
|
-
}
|
|
1439
|
-
function to(e, r) {
|
|
1440
|
-
if (r.s.length > Ln) throw new h$1(r);
|
|
1441
|
-
return b(e, r.i, Or(D$1(r.s)));
|
|
1442
|
-
}
|
|
1443
|
-
function no(e, r, t) {
|
|
1444
|
-
var u;
|
|
1445
|
-
let n = Dt(t.c), a = p$1(e, r, t.f), s = (u = t.b) != null ? u : 0;
|
|
1446
|
-
if (s < 0 || s > a.byteLength) throw new h$1(t);
|
|
1447
|
-
return b(e, t.i, new n(a, s, t.l));
|
|
1448
|
-
}
|
|
1449
|
-
function oo(e, r, t) {
|
|
1450
|
-
var i;
|
|
1451
|
-
let n = p$1(e, r, t.f), a = (i = t.b) != null ? i : 0;
|
|
1452
|
-
if (a < 0 || a > n.byteLength) throw new h$1(t);
|
|
1453
|
-
return b(e, t.i, new DataView(n, a, t.l));
|
|
1454
|
-
}
|
|
1455
|
-
function Yt(e, r, t, n) {
|
|
1456
|
-
if (t.p) {
|
|
1457
|
-
let a = jt(e, r, t.p, {});
|
|
1458
|
-
Object.defineProperties(n, Object.getOwnPropertyDescriptors(a));
|
|
1459
|
-
}
|
|
1460
|
-
return n;
|
|
1461
|
-
}
|
|
1462
|
-
function ao(e, r, t) {
|
|
1463
|
-
return Yt(e, r, t, b(e, t.i, new AggregateError([], D$1(t.m))));
|
|
1464
|
-
}
|
|
1465
|
-
function so(e, r, t) {
|
|
1466
|
-
let n = Fr(t, at, t.s);
|
|
1467
|
-
return Yt(e, r, t, b(e, t.i, new n(D$1(t.m))));
|
|
1468
|
-
}
|
|
1469
|
-
function io(e, r, t) {
|
|
1470
|
-
let n = re(), a = b(e, t.i, n.p), s = p$1(e, r, t.f);
|
|
1471
|
-
return t.s ? n.s(s) : n.f(s), a;
|
|
1472
|
-
}
|
|
1473
|
-
function uo(e, r, t) {
|
|
1474
|
-
return b(e, t.i, Object(p$1(e, r, t.f)));
|
|
1475
|
-
}
|
|
1476
|
-
function lo(e, r, t) {
|
|
1477
|
-
let n = e.base.plugins;
|
|
1478
|
-
if (n) {
|
|
1479
|
-
let a = D$1(t.c);
|
|
1480
|
-
for (let s = 0, i = n.length; s < i; s++) {
|
|
1481
|
-
let u = n[s];
|
|
1482
|
-
if (u.tag === a) return b(e, t.i, u.deserialize(t.s, new Dr(e, r), { id: t.i }));
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
throw new Q(t.c);
|
|
1486
|
-
}
|
|
1487
|
-
function co(e, r) {
|
|
1488
|
-
return b(e, r.i, b(e, r.s, re()).p);
|
|
1489
|
-
}
|
|
1490
|
-
function fo(e, r, t) {
|
|
1491
|
-
let n = e.base.refs.get(t.i);
|
|
1492
|
-
if (n) return n.s(p$1(e, r, t.a[1])), o$1;
|
|
1493
|
-
throw new V("Promise");
|
|
1494
|
-
}
|
|
1495
|
-
function So(e, r, t) {
|
|
1496
|
-
let n = e.base.refs.get(t.i);
|
|
1497
|
-
if (n) return n.f(p$1(e, r, t.a[1])), o$1;
|
|
1498
|
-
throw new V("Promise");
|
|
1499
|
-
}
|
|
1500
|
-
function mo(e, r, t) {
|
|
1501
|
-
p$1(e, r, t.a[0]);
|
|
1502
|
-
return It(p$1(e, r, t.a[1]));
|
|
1503
|
-
}
|
|
1504
|
-
function po(e, r, t) {
|
|
1505
|
-
p$1(e, r, t.a[0]);
|
|
1506
|
-
return Tt(p$1(e, r, t.a[1]));
|
|
1507
|
-
}
|
|
1508
|
-
function go(e, r, t) {
|
|
1509
|
-
let n = b(e, t.i, te$1()), a = t.a, s = a.length;
|
|
1510
|
-
if (s) for (let i = 0; i < s; i++) p$1(e, r, a[i]);
|
|
1511
|
-
return n;
|
|
1512
|
-
}
|
|
1513
|
-
function yo(e, r, t) {
|
|
1514
|
-
let n = e.base.refs.get(t.i);
|
|
1515
|
-
if (n && M(n)) return n.next(p$1(e, r, t.f)), o$1;
|
|
1516
|
-
throw new V("Stream");
|
|
1517
|
-
}
|
|
1518
|
-
function No(e, r, t) {
|
|
1519
|
-
let n = e.base.refs.get(t.i);
|
|
1520
|
-
if (n && M(n)) return n.throw(p$1(e, r, t.f)), o$1;
|
|
1521
|
-
throw new V("Stream");
|
|
1522
|
-
}
|
|
1523
|
-
function bo(e, r, t) {
|
|
1524
|
-
let n = e.base.refs.get(t.i);
|
|
1525
|
-
if (n && M(n)) return n.return(p$1(e, r, t.f)), o$1;
|
|
1526
|
-
throw new V("Stream");
|
|
1527
|
-
}
|
|
1528
|
-
function vo(e, r, t) {
|
|
1529
|
-
return p$1(e, r, t.f), o$1;
|
|
1530
|
-
}
|
|
1531
|
-
function Co(e, r, t) {
|
|
1532
|
-
return p$1(e, r, t.a[1]), o$1;
|
|
1533
|
-
}
|
|
1534
|
-
function Ao(e, r, t) {
|
|
1535
|
-
let n = b(e, t.i, Tr([], t.s, t.l));
|
|
1536
|
-
for (let a = 0, s = t.a.length; a < s; a++) n.v[a] = p$1(e, r, t.a[a]);
|
|
1537
|
-
return n;
|
|
1538
|
-
}
|
|
1539
|
-
function p$1(e, r, t) {
|
|
1540
|
-
if (r > e.base.depthLimit) throw new ee(e.base.depthLimit);
|
|
1541
|
-
switch (r += 1, t.t) {
|
|
1542
|
-
case 2: return Fr(t, ot, t.s);
|
|
1543
|
-
case 0: return Number(t.s);
|
|
1544
|
-
case 1: return D$1(String(t.s));
|
|
1545
|
-
case 3:
|
|
1546
|
-
if (String(t.s).length > Un) throw new h$1(t);
|
|
1547
|
-
return BigInt(t.s);
|
|
1548
|
-
case 4: return e.base.refs.get(t.i);
|
|
1549
|
-
case 18: return Gn(e, t);
|
|
1550
|
-
case 9: return Kn(e, r, t);
|
|
1551
|
-
case 10:
|
|
1552
|
-
case 11: return $n(e, r, t);
|
|
1553
|
-
case 5: return Xn(e, t);
|
|
1554
|
-
case 6: return Qn(e, t);
|
|
1555
|
-
case 7: return eo(e, r, t);
|
|
1556
|
-
case 8: return ro(e, r, t);
|
|
1557
|
-
case 19: return to(e, t);
|
|
1558
|
-
case 16:
|
|
1559
|
-
case 15: return no(e, r, t);
|
|
1560
|
-
case 20: return oo(e, r, t);
|
|
1561
|
-
case 14: return ao(e, r, t);
|
|
1562
|
-
case 13: return so(e, r, t);
|
|
1563
|
-
case 12: return io(e, r, t);
|
|
1564
|
-
case 17: return Fr(t, tt, t.s);
|
|
1565
|
-
case 21: return uo(e, r, t);
|
|
1566
|
-
case 25: return lo(e, r, t);
|
|
1567
|
-
case 22: return co(e, t);
|
|
1568
|
-
case 23: return fo(e, r, t);
|
|
1569
|
-
case 24: return So(e, r, t);
|
|
1570
|
-
case 28: return mo(e, r, t);
|
|
1571
|
-
case 30: return po(e, r, t);
|
|
1572
|
-
case 31: return go(e, r, t);
|
|
1573
|
-
case 32: return yo(e, r, t);
|
|
1574
|
-
case 33: return No(e, r, t);
|
|
1575
|
-
case 34: return bo(e, r, t);
|
|
1576
|
-
case 27: return vo(e, r, t);
|
|
1577
|
-
case 29: return Co(e, r, t);
|
|
1578
|
-
case 35: return Ao(e, r, t);
|
|
1579
|
-
default: throw new w$1(t);
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
function ar(e, r) {
|
|
1583
|
-
try {
|
|
1584
|
-
return p$1(e, 0, r);
|
|
1585
|
-
} catch (t) {
|
|
1586
|
-
throw new He(t);
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
var Eo = () => T, Io = Eo.toString();
|
|
1590
|
-
/=>/.test(Io);
|
|
1591
|
-
async function Au(e, r = {}) {
|
|
1592
|
-
let n = ne$1(1, {
|
|
1593
|
-
plugins: A(r.plugins),
|
|
1594
|
-
disabledFeatures: r.disabledFeatures
|
|
801
|
+
function deserializeStringValuePairArray(value) {
|
|
802
|
+
return deserializePairArray(value).flatMap(([key, entryValue]) => {
|
|
803
|
+
if (typeof key !== "string") return [];
|
|
804
|
+
return [[key, entryValue]];
|
|
1595
805
|
});
|
|
1596
|
-
return {
|
|
1597
|
-
t: await oe(n, e),
|
|
1598
|
-
f: n.base.features,
|
|
1599
|
-
m: Array.from(n.base.marked)
|
|
1600
|
-
};
|
|
1601
|
-
}
|
|
1602
|
-
function Iu(e, r = {}) {
|
|
1603
|
-
var i;
|
|
1604
|
-
let t = A(r.plugins), n = r.disabledFeatures || 0, a = (i = e.f) != null ? i : 63;
|
|
1605
|
-
return ar(Mt({
|
|
1606
|
-
plugins: t,
|
|
1607
|
-
markedRefs: e.m,
|
|
1608
|
-
features: a & ~n,
|
|
1609
|
-
disabledFeatures: n
|
|
1610
|
-
}), e.t);
|
|
1611
|
-
}
|
|
1612
|
-
//#endregion
|
|
1613
|
-
//#region ../../node_modules/.pnpm/seroval-plugins@1.5.2_seroval@1.5.2/node_modules/seroval-plugins/dist/esm/production/web.mjs
|
|
1614
|
-
var u = (e) => {
|
|
1615
|
-
let r = new AbortController(), a = r.abort.bind(r);
|
|
1616
|
-
return e.then(a, a), r;
|
|
1617
|
-
};
|
|
1618
|
-
function E(e) {
|
|
1619
|
-
e(this.reason);
|
|
1620
|
-
}
|
|
1621
|
-
function D(e) {
|
|
1622
|
-
this.addEventListener("abort", E.bind(this, e), { once: !0 });
|
|
1623
|
-
}
|
|
1624
|
-
function c(e) {
|
|
1625
|
-
return new Promise(D.bind(e));
|
|
1626
|
-
}
|
|
1627
|
-
var i = {}, O = ni({
|
|
1628
|
-
tag: "seroval-plugins/web/AbortSignal",
|
|
1629
|
-
extends: [ni({
|
|
1630
|
-
tag: "seroval-plugins/web/AbortControllerFactoryPlugin",
|
|
1631
|
-
test(e) {
|
|
1632
|
-
return e === i;
|
|
1633
|
-
},
|
|
1634
|
-
parse: {
|
|
1635
|
-
sync() {
|
|
1636
|
-
return i;
|
|
1637
|
-
},
|
|
1638
|
-
async async() {
|
|
1639
|
-
return await Promise.resolve(i);
|
|
1640
|
-
},
|
|
1641
|
-
stream() {
|
|
1642
|
-
return i;
|
|
1643
|
-
}
|
|
1644
|
-
},
|
|
1645
|
-
serialize() {
|
|
1646
|
-
return u.toString();
|
|
1647
|
-
},
|
|
1648
|
-
deserialize() {
|
|
1649
|
-
return u;
|
|
1650
|
-
}
|
|
1651
|
-
})],
|
|
1652
|
-
test(e) {
|
|
1653
|
-
return typeof AbortSignal == "undefined" ? !1 : e instanceof AbortSignal;
|
|
1654
|
-
},
|
|
1655
|
-
parse: {
|
|
1656
|
-
sync(e, r) {
|
|
1657
|
-
return e.aborted ? { reason: r.parse(e.reason) } : {};
|
|
1658
|
-
},
|
|
1659
|
-
async async(e, r) {
|
|
1660
|
-
if (e.aborted) return { reason: await r.parse(e.reason) };
|
|
1661
|
-
let a = await c(e);
|
|
1662
|
-
return { reason: await r.parse(a) };
|
|
1663
|
-
},
|
|
1664
|
-
stream(e, r) {
|
|
1665
|
-
if (e.aborted) return { reason: r.parse(e.reason) };
|
|
1666
|
-
let a = c(e);
|
|
1667
|
-
return {
|
|
1668
|
-
factory: r.parse(i),
|
|
1669
|
-
controller: r.parse(a)
|
|
1670
|
-
};
|
|
1671
|
-
}
|
|
1672
|
-
},
|
|
1673
|
-
serialize(e, r) {
|
|
1674
|
-
return e.reason ? "AbortSignal.abort(" + r.serialize(e.reason) + ")" : e.controller && e.factory ? "(" + r.serialize(e.factory) + ")(" + r.serialize(e.controller) + ").signal" : "(new AbortController).signal";
|
|
1675
|
-
},
|
|
1676
|
-
deserialize(e, r) {
|
|
1677
|
-
return e.reason ? AbortSignal.abort(r.deserialize(e.reason)) : e.controller ? u(r.deserialize(e.controller)).signal : new AbortController().signal;
|
|
1678
|
-
}
|
|
1679
|
-
});
|
|
1680
|
-
var B = ni({
|
|
1681
|
-
tag: "seroval-plugins/web/Blob",
|
|
1682
|
-
test(e) {
|
|
1683
|
-
return typeof Blob == "undefined" ? !1 : e instanceof Blob;
|
|
1684
|
-
},
|
|
1685
|
-
parse: { async async(e, r) {
|
|
1686
|
-
return {
|
|
1687
|
-
type: await r.parse(e.type),
|
|
1688
|
-
buffer: await r.parse(await e.arrayBuffer())
|
|
1689
|
-
};
|
|
1690
|
-
} },
|
|
1691
|
-
serialize(e, r) {
|
|
1692
|
-
return "new Blob([" + r.serialize(e.buffer) + "],{type:" + r.serialize(e.type) + "})";
|
|
1693
|
-
},
|
|
1694
|
-
deserialize(e, r) {
|
|
1695
|
-
return new Blob([r.deserialize(e.buffer)], { type: r.deserialize(e.type) });
|
|
1696
|
-
}
|
|
1697
|
-
});
|
|
1698
|
-
function d(e) {
|
|
1699
|
-
return {
|
|
1700
|
-
detail: e.detail,
|
|
1701
|
-
bubbles: e.bubbles,
|
|
1702
|
-
cancelable: e.cancelable,
|
|
1703
|
-
composed: e.composed
|
|
1704
|
-
};
|
|
1705
806
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
var q = ni({
|
|
1739
|
-
tag: "seroval-plugins/web/DOMException",
|
|
1740
|
-
test(e) {
|
|
1741
|
-
return typeof DOMException == "undefined" ? !1 : e instanceof DOMException;
|
|
1742
|
-
},
|
|
1743
|
-
parse: {
|
|
1744
|
-
sync(e, r) {
|
|
1745
|
-
return {
|
|
1746
|
-
name: r.parse(e.name),
|
|
1747
|
-
message: r.parse(e.message)
|
|
1748
|
-
};
|
|
1749
|
-
},
|
|
1750
|
-
async async(e, r) {
|
|
1751
|
-
return {
|
|
1752
|
-
name: await r.parse(e.name),
|
|
1753
|
-
message: await r.parse(e.message)
|
|
1754
|
-
};
|
|
1755
|
-
},
|
|
1756
|
-
stream(e, r) {
|
|
1757
|
-
return {
|
|
1758
|
-
name: r.parse(e.name),
|
|
1759
|
-
message: r.parse(e.message)
|
|
1760
|
-
};
|
|
1761
|
-
}
|
|
1762
|
-
},
|
|
1763
|
-
serialize(e, r) {
|
|
1764
|
-
return "new DOMException(" + r.serialize(e.message) + "," + r.serialize(e.name) + ")";
|
|
1765
|
-
},
|
|
1766
|
-
deserialize(e, r) {
|
|
1767
|
-
return new DOMException(r.deserialize(e.message), r.deserialize(e.name));
|
|
1768
|
-
}
|
|
1769
|
-
});
|
|
1770
|
-
function f(e) {
|
|
1771
|
-
return {
|
|
1772
|
-
bubbles: e.bubbles,
|
|
1773
|
-
cancelable: e.cancelable,
|
|
1774
|
-
composed: e.composed
|
|
1775
|
-
};
|
|
1776
|
-
}
|
|
1777
|
-
var Y = ni({
|
|
1778
|
-
tag: "seroval-plugins/web/Event",
|
|
1779
|
-
test(e) {
|
|
1780
|
-
return typeof Event == "undefined" ? !1 : e instanceof Event;
|
|
1781
|
-
},
|
|
1782
|
-
parse: {
|
|
1783
|
-
sync(e, r) {
|
|
1784
|
-
return {
|
|
1785
|
-
type: r.parse(e.type),
|
|
1786
|
-
options: r.parse(f(e))
|
|
1787
|
-
};
|
|
1788
|
-
},
|
|
1789
|
-
async async(e, r) {
|
|
1790
|
-
return {
|
|
1791
|
-
type: await r.parse(e.type),
|
|
1792
|
-
options: await r.parse(f(e))
|
|
1793
|
-
};
|
|
1794
|
-
},
|
|
1795
|
-
stream(e, r) {
|
|
1796
|
-
return {
|
|
1797
|
-
type: r.parse(e.type),
|
|
1798
|
-
options: r.parse(f(e))
|
|
1799
|
-
};
|
|
1800
|
-
}
|
|
1801
|
-
},
|
|
1802
|
-
serialize(e, r) {
|
|
1803
|
-
return "new Event(" + r.serialize(e.type) + "," + r.serialize(e.options) + ")";
|
|
1804
|
-
},
|
|
1805
|
-
deserialize(e, r) {
|
|
1806
|
-
return new Event(r.deserialize(e.type), r.deserialize(e.options));
|
|
1807
|
-
}
|
|
1808
|
-
});
|
|
1809
|
-
var m = ni({
|
|
1810
|
-
tag: "seroval-plugins/web/File",
|
|
1811
|
-
test(e) {
|
|
1812
|
-
return typeof File == "undefined" ? !1 : e instanceof File;
|
|
1813
|
-
},
|
|
1814
|
-
parse: { async async(e, r) {
|
|
1815
|
-
return {
|
|
1816
|
-
name: await r.parse(e.name),
|
|
1817
|
-
options: await r.parse({
|
|
1818
|
-
type: e.type,
|
|
1819
|
-
lastModified: e.lastModified
|
|
1820
|
-
}),
|
|
1821
|
-
buffer: await r.parse(await e.arrayBuffer())
|
|
1822
|
-
};
|
|
1823
|
-
} },
|
|
1824
|
-
serialize(e, r) {
|
|
1825
|
-
return "new File([" + r.serialize(e.buffer) + "]," + r.serialize(e.name) + "," + r.serialize(e.options) + ")";
|
|
1826
|
-
},
|
|
1827
|
-
deserialize(e, r) {
|
|
1828
|
-
return new File([r.deserialize(e.buffer)], r.deserialize(e.name), r.deserialize(e.options));
|
|
1829
|
-
}
|
|
1830
|
-
});
|
|
1831
|
-
function y(e) {
|
|
1832
|
-
let r = [];
|
|
1833
|
-
return e.forEach((a, t) => {
|
|
1834
|
-
r.push([t, a]);
|
|
1835
|
-
}), r;
|
|
1836
|
-
}
|
|
1837
|
-
var o = {}, v = (e, r = new FormData(), a = 0, t = e.length, s) => {
|
|
1838
|
-
for (; a < t; a++) s = e[a], r.append(s[0], s[1]);
|
|
1839
|
-
return r;
|
|
1840
|
-
}, K = ni({
|
|
1841
|
-
tag: "seroval-plugins/web/FormData",
|
|
1842
|
-
extends: [m, ni({
|
|
1843
|
-
tag: "seroval-plugins/web/FormDataFactory",
|
|
1844
|
-
test(e) {
|
|
1845
|
-
return e === o;
|
|
1846
|
-
},
|
|
1847
|
-
parse: {
|
|
1848
|
-
sync() {
|
|
1849
|
-
return o;
|
|
1850
|
-
},
|
|
1851
|
-
async async() {
|
|
1852
|
-
return await Promise.resolve(o);
|
|
1853
|
-
},
|
|
1854
|
-
stream() {
|
|
1855
|
-
return o;
|
|
1856
|
-
}
|
|
1857
|
-
},
|
|
1858
|
-
serialize() {
|
|
1859
|
-
return v.toString();
|
|
1860
|
-
},
|
|
1861
|
-
deserialize() {
|
|
1862
|
-
return o;
|
|
1863
|
-
}
|
|
1864
|
-
})],
|
|
1865
|
-
test(e) {
|
|
1866
|
-
return typeof FormData == "undefined" ? !1 : e instanceof FormData;
|
|
1867
|
-
},
|
|
1868
|
-
parse: {
|
|
1869
|
-
sync(e, r) {
|
|
1870
|
-
return {
|
|
1871
|
-
factory: r.parse(o),
|
|
1872
|
-
entries: r.parse(y(e))
|
|
1873
|
-
};
|
|
1874
|
-
},
|
|
1875
|
-
async async(e, r) {
|
|
1876
|
-
return {
|
|
1877
|
-
factory: await r.parse(o),
|
|
1878
|
-
entries: await r.parse(y(e))
|
|
1879
|
-
};
|
|
1880
|
-
},
|
|
1881
|
-
stream(e, r) {
|
|
1882
|
-
return {
|
|
1883
|
-
factory: r.parse(o),
|
|
1884
|
-
entries: r.parse(y(e))
|
|
1885
|
-
};
|
|
1886
|
-
}
|
|
1887
|
-
},
|
|
1888
|
-
serialize(e, r) {
|
|
1889
|
-
return "(" + r.serialize(e.factory) + ")(" + r.serialize(e.entries) + ")";
|
|
1890
|
-
},
|
|
1891
|
-
deserialize(e, r) {
|
|
1892
|
-
return v(r.deserialize(e.entries));
|
|
1893
|
-
}
|
|
1894
|
-
});
|
|
1895
|
-
function g(e) {
|
|
1896
|
-
let r = [];
|
|
1897
|
-
return e.forEach((a, t) => {
|
|
1898
|
-
r.push([t, a]);
|
|
1899
|
-
}), r;
|
|
1900
|
-
}
|
|
1901
|
-
var l = ni({
|
|
1902
|
-
tag: "seroval-plugins/web/Headers",
|
|
1903
|
-
test(e) {
|
|
1904
|
-
return typeof Headers == "undefined" ? !1 : e instanceof Headers;
|
|
1905
|
-
},
|
|
1906
|
-
parse: {
|
|
1907
|
-
sync(e, r) {
|
|
1908
|
-
return { value: r.parse(g(e)) };
|
|
1909
|
-
},
|
|
1910
|
-
async async(e, r) {
|
|
1911
|
-
return { value: await r.parse(g(e)) };
|
|
1912
|
-
},
|
|
1913
|
-
stream(e, r) {
|
|
1914
|
-
return { value: r.parse(g(e)) };
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
serialize(e, r) {
|
|
1918
|
-
return "new Headers(" + r.serialize(e.value) + ")";
|
|
1919
|
-
},
|
|
1920
|
-
deserialize(e, r) {
|
|
1921
|
-
return new Headers(r.deserialize(e.value));
|
|
1922
|
-
}
|
|
1923
|
-
});
|
|
1924
|
-
var $ = ni({
|
|
1925
|
-
tag: "seroval-plugins/web/ImageData",
|
|
1926
|
-
test(e) {
|
|
1927
|
-
return typeof ImageData == "undefined" ? !1 : e instanceof ImageData;
|
|
1928
|
-
},
|
|
1929
|
-
parse: {
|
|
1930
|
-
sync(e, r) {
|
|
1931
|
-
return {
|
|
1932
|
-
data: r.parse(e.data),
|
|
1933
|
-
width: r.parse(e.width),
|
|
1934
|
-
height: r.parse(e.height),
|
|
1935
|
-
options: r.parse({ colorSpace: e.colorSpace })
|
|
1936
|
-
};
|
|
1937
|
-
},
|
|
1938
|
-
async async(e, r) {
|
|
1939
|
-
return {
|
|
1940
|
-
data: await r.parse(e.data),
|
|
1941
|
-
width: await r.parse(e.width),
|
|
1942
|
-
height: await r.parse(e.height),
|
|
1943
|
-
options: await r.parse({ colorSpace: e.colorSpace })
|
|
1944
|
-
};
|
|
1945
|
-
},
|
|
1946
|
-
stream(e, r) {
|
|
1947
|
-
return {
|
|
1948
|
-
data: r.parse(e.data),
|
|
1949
|
-
width: r.parse(e.width),
|
|
1950
|
-
height: r.parse(e.height),
|
|
1951
|
-
options: r.parse({ colorSpace: e.colorSpace })
|
|
1952
|
-
};
|
|
1953
|
-
}
|
|
1954
|
-
},
|
|
1955
|
-
serialize(e, r) {
|
|
1956
|
-
return "new ImageData(" + r.serialize(e.data) + "," + r.serialize(e.width) + "," + r.serialize(e.height) + "," + r.serialize(e.options) + ")";
|
|
1957
|
-
},
|
|
1958
|
-
deserialize(e, r) {
|
|
1959
|
-
return new ImageData(r.deserialize(e.data), r.deserialize(e.width), r.deserialize(e.height), r.deserialize(e.options));
|
|
1960
|
-
}
|
|
1961
|
-
});
|
|
1962
|
-
var n = {}, P = (e) => new ReadableStream({ start: (r) => {
|
|
1963
|
-
e.on({
|
|
1964
|
-
next: (a) => {
|
|
1965
|
-
try {
|
|
1966
|
-
r.enqueue(a);
|
|
1967
|
-
} catch (t) {}
|
|
1968
|
-
},
|
|
1969
|
-
throw: (a) => {
|
|
1970
|
-
r.error(a);
|
|
1971
|
-
},
|
|
1972
|
-
return: () => {
|
|
1973
|
-
try {
|
|
1974
|
-
r.close();
|
|
1975
|
-
} catch (a) {}
|
|
1976
|
-
}
|
|
807
|
+
function deserializeArray(value) {
|
|
808
|
+
if (!Array.isArray(value)) return [];
|
|
809
|
+
return value.map(deserializeJsonSafeValue);
|
|
810
|
+
}
|
|
811
|
+
function deserializeRegExp(value) {
|
|
812
|
+
if (!isRecordLike$3(value)) return value;
|
|
813
|
+
const source = value.source;
|
|
814
|
+
const flags = value.flags;
|
|
815
|
+
if (typeof source !== "string" || typeof flags !== "string") return value;
|
|
816
|
+
return new RegExp(source, flags);
|
|
817
|
+
}
|
|
818
|
+
function deserializeArrayBuffer(value) {
|
|
819
|
+
if (typeof value !== "string") return value;
|
|
820
|
+
return base64ToArrayBuffer(value);
|
|
821
|
+
}
|
|
822
|
+
function deserializeBlob(value) {
|
|
823
|
+
if (!isRecordLike$3(value)) return value;
|
|
824
|
+
const bytes = value.bytes;
|
|
825
|
+
const type = value.type;
|
|
826
|
+
if (typeof bytes !== "string" || typeof type !== "string") return value;
|
|
827
|
+
return new Blob([base64ToArrayBuffer(bytes)], { type });
|
|
828
|
+
}
|
|
829
|
+
function deserializeFile(value) {
|
|
830
|
+
if (!isRecordLike$3(value)) return value;
|
|
831
|
+
const bytes = value.bytes;
|
|
832
|
+
const lastModified = value.lastModified;
|
|
833
|
+
const name = value.name;
|
|
834
|
+
const type = value.type;
|
|
835
|
+
if (typeof bytes !== "string" || typeof lastModified !== "number" || typeof name !== "string" || typeof type !== "string") return value;
|
|
836
|
+
return new File([new Blob([base64ToArrayBuffer(bytes)], { type })], name, {
|
|
837
|
+
lastModified,
|
|
838
|
+
type
|
|
1977
839
|
});
|
|
1978
|
-
} }), x = ni({
|
|
1979
|
-
tag: "seroval-plugins/web/ReadableStreamFactory",
|
|
1980
|
-
test(e) {
|
|
1981
|
-
return e === n;
|
|
1982
|
-
},
|
|
1983
|
-
parse: {
|
|
1984
|
-
sync() {
|
|
1985
|
-
return n;
|
|
1986
|
-
},
|
|
1987
|
-
async async() {
|
|
1988
|
-
return await Promise.resolve(n);
|
|
1989
|
-
},
|
|
1990
|
-
stream() {
|
|
1991
|
-
return n;
|
|
1992
|
-
}
|
|
1993
|
-
},
|
|
1994
|
-
serialize() {
|
|
1995
|
-
return P.toString();
|
|
1996
|
-
},
|
|
1997
|
-
deserialize() {
|
|
1998
|
-
return n;
|
|
1999
|
-
}
|
|
2000
|
-
});
|
|
2001
|
-
function w(e) {
|
|
2002
|
-
let r = te$1(), a = e.getReader();
|
|
2003
|
-
async function t() {
|
|
2004
|
-
try {
|
|
2005
|
-
let s = await a.read();
|
|
2006
|
-
s.done ? r.return(s.value) : (r.next(s.value), await t());
|
|
2007
|
-
} catch (s) {
|
|
2008
|
-
r.throw(s);
|
|
2009
|
-
}
|
|
2010
|
-
}
|
|
2011
|
-
return t().catch(() => {}), r;
|
|
2012
|
-
}
|
|
2013
|
-
var p = ni({
|
|
2014
|
-
tag: "seroval/plugins/web/ReadableStream",
|
|
2015
|
-
extends: [x],
|
|
2016
|
-
test(e) {
|
|
2017
|
-
return typeof ReadableStream == "undefined" ? !1 : e instanceof ReadableStream;
|
|
2018
|
-
},
|
|
2019
|
-
parse: {
|
|
2020
|
-
sync(e, r) {
|
|
2021
|
-
return {
|
|
2022
|
-
factory: r.parse(n),
|
|
2023
|
-
stream: r.parse(te$1())
|
|
2024
|
-
};
|
|
2025
|
-
},
|
|
2026
|
-
async async(e, r) {
|
|
2027
|
-
return {
|
|
2028
|
-
factory: await r.parse(n),
|
|
2029
|
-
stream: await r.parse(w(e))
|
|
2030
|
-
};
|
|
2031
|
-
},
|
|
2032
|
-
stream(e, r) {
|
|
2033
|
-
return {
|
|
2034
|
-
factory: r.parse(n),
|
|
2035
|
-
stream: r.parse(w(e))
|
|
2036
|
-
};
|
|
2037
|
-
}
|
|
2038
|
-
},
|
|
2039
|
-
serialize(e, r) {
|
|
2040
|
-
return "(" + r.serialize(e.factory) + ")(" + r.serialize(e.stream) + ")";
|
|
2041
|
-
},
|
|
2042
|
-
deserialize(e, r) {
|
|
2043
|
-
return P(r.deserialize(e.stream));
|
|
2044
|
-
}
|
|
2045
|
-
});
|
|
2046
|
-
function N(e, r) {
|
|
2047
|
-
return {
|
|
2048
|
-
body: r,
|
|
2049
|
-
cache: e.cache,
|
|
2050
|
-
credentials: e.credentials,
|
|
2051
|
-
headers: e.headers,
|
|
2052
|
-
integrity: e.integrity,
|
|
2053
|
-
keepalive: e.keepalive,
|
|
2054
|
-
method: e.method,
|
|
2055
|
-
mode: e.mode,
|
|
2056
|
-
redirect: e.redirect,
|
|
2057
|
-
referrer: e.referrer,
|
|
2058
|
-
referrerPolicy: e.referrerPolicy
|
|
2059
|
-
};
|
|
2060
|
-
}
|
|
2061
|
-
var te = ni({
|
|
2062
|
-
tag: "seroval-plugins/web/Request",
|
|
2063
|
-
extends: [p, l],
|
|
2064
|
-
test(e) {
|
|
2065
|
-
return typeof Request == "undefined" ? !1 : e instanceof Request;
|
|
2066
|
-
},
|
|
2067
|
-
parse: {
|
|
2068
|
-
async async(e, r) {
|
|
2069
|
-
return {
|
|
2070
|
-
url: await r.parse(e.url),
|
|
2071
|
-
options: await r.parse(N(e, e.body && !e.bodyUsed ? await e.clone().arrayBuffer() : null))
|
|
2072
|
-
};
|
|
2073
|
-
},
|
|
2074
|
-
stream(e, r) {
|
|
2075
|
-
return {
|
|
2076
|
-
url: r.parse(e.url),
|
|
2077
|
-
options: r.parse(N(e, e.body && !e.bodyUsed ? e.clone().body : null))
|
|
2078
|
-
};
|
|
2079
|
-
}
|
|
2080
|
-
},
|
|
2081
|
-
serialize(e, r) {
|
|
2082
|
-
return "new Request(" + r.serialize(e.url) + "," + r.serialize(e.options) + ")";
|
|
2083
|
-
},
|
|
2084
|
-
deserialize(e, r) {
|
|
2085
|
-
return new Request(r.deserialize(e.url), r.deserialize(e.options));
|
|
2086
|
-
}
|
|
2087
|
-
});
|
|
2088
|
-
function h(e) {
|
|
2089
|
-
return {
|
|
2090
|
-
headers: e.headers,
|
|
2091
|
-
status: e.status,
|
|
2092
|
-
statusText: e.statusText
|
|
2093
|
-
};
|
|
2094
|
-
}
|
|
2095
|
-
var ne = ni({
|
|
2096
|
-
tag: "seroval-plugins/web/Response",
|
|
2097
|
-
extends: [p, l],
|
|
2098
|
-
test(e) {
|
|
2099
|
-
return typeof Response == "undefined" ? !1 : e instanceof Response;
|
|
2100
|
-
},
|
|
2101
|
-
parse: {
|
|
2102
|
-
async async(e, r) {
|
|
2103
|
-
return {
|
|
2104
|
-
body: await r.parse(e.body && !e.bodyUsed ? await e.clone().arrayBuffer() : null),
|
|
2105
|
-
options: await r.parse(h(e))
|
|
2106
|
-
};
|
|
2107
|
-
},
|
|
2108
|
-
stream(e, r) {
|
|
2109
|
-
return {
|
|
2110
|
-
body: r.parse(e.body && !e.bodyUsed ? e.clone().body : null),
|
|
2111
|
-
options: r.parse(h(e))
|
|
2112
|
-
};
|
|
2113
|
-
}
|
|
2114
|
-
},
|
|
2115
|
-
serialize(e, r) {
|
|
2116
|
-
return "new Response(" + r.serialize(e.body) + "," + r.serialize(e.options) + ")";
|
|
2117
|
-
},
|
|
2118
|
-
deserialize(e, r) {
|
|
2119
|
-
return new Response(r.deserialize(e.body), r.deserialize(e.options));
|
|
2120
|
-
}
|
|
2121
|
-
});
|
|
2122
|
-
var pe = ni({
|
|
2123
|
-
tag: "seroval-plugins/web/URL",
|
|
2124
|
-
test(e) {
|
|
2125
|
-
return typeof URL == "undefined" ? !1 : e instanceof URL;
|
|
2126
|
-
},
|
|
2127
|
-
parse: {
|
|
2128
|
-
sync(e, r) {
|
|
2129
|
-
return { value: r.parse(e.href) };
|
|
2130
|
-
},
|
|
2131
|
-
async async(e, r) {
|
|
2132
|
-
return { value: await r.parse(e.href) };
|
|
2133
|
-
},
|
|
2134
|
-
stream(e, r) {
|
|
2135
|
-
return { value: r.parse(e.href) };
|
|
2136
|
-
}
|
|
2137
|
-
},
|
|
2138
|
-
serialize(e, r) {
|
|
2139
|
-
return "new URL(" + r.serialize(e.value) + ")";
|
|
2140
|
-
},
|
|
2141
|
-
deserialize(e, r) {
|
|
2142
|
-
return new URL(r.deserialize(e.value));
|
|
2143
|
-
}
|
|
2144
|
-
});
|
|
2145
|
-
var fe = ni({
|
|
2146
|
-
tag: "seroval-plugins/web/URLSearchParams",
|
|
2147
|
-
test(e) {
|
|
2148
|
-
return typeof URLSearchParams == "undefined" ? !1 : e instanceof URLSearchParams;
|
|
2149
|
-
},
|
|
2150
|
-
parse: {
|
|
2151
|
-
sync(e, r) {
|
|
2152
|
-
return { value: r.parse(e.toString()) };
|
|
2153
|
-
},
|
|
2154
|
-
async async(e, r) {
|
|
2155
|
-
return { value: await r.parse(e.toString()) };
|
|
2156
|
-
},
|
|
2157
|
-
stream(e, r) {
|
|
2158
|
-
return { value: r.parse(e.toString()) };
|
|
2159
|
-
}
|
|
2160
|
-
},
|
|
2161
|
-
serialize(e, r) {
|
|
2162
|
-
return "new URLSearchParams(" + r.serialize(e.value) + ")";
|
|
2163
|
-
},
|
|
2164
|
-
deserialize(e, r) {
|
|
2165
|
-
return new URLSearchParams(r.deserialize(e.value));
|
|
2166
|
-
}
|
|
2167
|
-
});
|
|
2168
|
-
//#endregion
|
|
2169
|
-
//#region ../sdk/src/cacheSerialization.ts
|
|
2170
|
-
const serializedCacheValueMarker = "__agentEvalsCacheSerialization";
|
|
2171
|
-
const serializedCacheValueVersion = "seroval-web-v1";
|
|
2172
|
-
const serovalWebPlugins = [
|
|
2173
|
-
O,
|
|
2174
|
-
B,
|
|
2175
|
-
L,
|
|
2176
|
-
q,
|
|
2177
|
-
Y,
|
|
2178
|
-
m,
|
|
2179
|
-
K,
|
|
2180
|
-
l,
|
|
2181
|
-
$,
|
|
2182
|
-
p,
|
|
2183
|
-
te,
|
|
2184
|
-
ne,
|
|
2185
|
-
pe,
|
|
2186
|
-
fe
|
|
2187
|
-
];
|
|
2188
|
-
function isRecordLike$2(value) {
|
|
2189
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2190
|
-
}
|
|
2191
|
-
function isSerializedCacheValue(value) {
|
|
2192
|
-
return isRecordLike$2(value) && value[serializedCacheValueMarker] === serializedCacheValueVersion;
|
|
2193
840
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
841
|
+
function deserializeError(value) {
|
|
842
|
+
if (!isRecordLike$3(value)) return value;
|
|
843
|
+
const message = value.message;
|
|
844
|
+
const error = new Error(typeof message === "string" ? message : void 0);
|
|
845
|
+
if (typeof value.name === "string") error.name = value.name;
|
|
846
|
+
if (typeof value.stack === "string") error.stack = value.stack;
|
|
847
|
+
if (value.cause !== void 0) Object.defineProperty(error, "cause", {
|
|
848
|
+
configurable: true,
|
|
849
|
+
enumerable: false,
|
|
850
|
+
value: deserializeJsonSafeValue(value.cause),
|
|
851
|
+
writable: true
|
|
852
|
+
});
|
|
853
|
+
for (const [key, entryValue] of deserializeStringValuePairArray(value.props)) Object.defineProperty(error, key, {
|
|
854
|
+
configurable: true,
|
|
855
|
+
enumerable: true,
|
|
856
|
+
value: entryValue,
|
|
857
|
+
writable: true
|
|
858
|
+
});
|
|
859
|
+
return error;
|
|
2209
860
|
}
|
|
2210
861
|
async function serializeRecordValues(record) {
|
|
2211
862
|
const entries = [];
|
|
@@ -2400,7 +1051,7 @@ function mergeSpanAttributes$1(span, attributes) {
|
|
|
2400
1051
|
...attributes
|
|
2401
1052
|
};
|
|
2402
1053
|
}
|
|
2403
|
-
function isRecordLike$
|
|
1054
|
+
function isRecordLike$2(value) {
|
|
2404
1055
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2405
1056
|
}
|
|
2406
1057
|
function valueKind$1(value) {
|
|
@@ -2417,7 +1068,7 @@ function stripCacheAttributes(attributes) {
|
|
|
2417
1068
|
}
|
|
2418
1069
|
async function snapshotNonCacheAttributes(span) {
|
|
2419
1070
|
const snapshot = await cloneCacheValue(stripCacheAttributes(span?.attributes));
|
|
2420
|
-
return isRecordLike$
|
|
1071
|
+
return isRecordLike$2(snapshot) ? snapshot : {};
|
|
2421
1072
|
}
|
|
2422
1073
|
function diffNonCacheAttributes(before, after) {
|
|
2423
1074
|
const result = {};
|
|
@@ -2513,7 +1164,7 @@ function applyRecordingOp(scope, parentSpan, op, options) {
|
|
|
2513
1164
|
if (op.kind === "mergeOutput") {
|
|
2514
1165
|
const existing = scope.outputs[op.key];
|
|
2515
1166
|
if (existing === void 0) scope.outputs[op.key] = { ...op.patch };
|
|
2516
|
-
else if (isRecordLike$
|
|
1167
|
+
else if (isRecordLike$2(existing)) scope.outputs[op.key] = {
|
|
2517
1168
|
...existing,
|
|
2518
1169
|
...op.patch
|
|
2519
1170
|
};
|
|
@@ -2791,7 +1442,7 @@ function mergeSpanAttributes(span, attributes) {
|
|
|
2791
1442
|
...attributes
|
|
2792
1443
|
};
|
|
2793
1444
|
}
|
|
2794
|
-
function isRecordLike(value) {
|
|
1445
|
+
function isRecordLike$1(value) {
|
|
2795
1446
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2796
1447
|
}
|
|
2797
1448
|
function valueKind(value) {
|
|
@@ -2833,7 +1484,7 @@ function mergeSpanAttribute(span, key, patch) {
|
|
|
2833
1484
|
mergeSpanAttributes(span, { [key]: { ...patch } });
|
|
2834
1485
|
return;
|
|
2835
1486
|
}
|
|
2836
|
-
if (!isRecordLike(existing)) {
|
|
1487
|
+
if (!isRecordLike$1(existing)) {
|
|
2837
1488
|
recordSpanAttributeAssertion(`evalSpan.mergeAttribute("${key}"): existing value is ${valueKind(existing)}, expected object`);
|
|
2838
1489
|
return;
|
|
2839
1490
|
}
|
|
@@ -3837,6 +2488,15 @@ const runLogPhaseSchema = z.enum([
|
|
|
3837
2488
|
"scorer"
|
|
3838
2489
|
]);
|
|
3839
2490
|
/** Schema for one persisted log entry captured during a case run. */
|
|
2491
|
+
const runLogLocationSchema = z.object({
|
|
2492
|
+
/** File path reported by the JavaScript stack frame. */
|
|
2493
|
+
file: z.string(),
|
|
2494
|
+
/** 1-based source line reported by the JavaScript stack frame. */
|
|
2495
|
+
line: z.number(),
|
|
2496
|
+
/** 1-based source column reported by the JavaScript stack frame. */
|
|
2497
|
+
column: z.number()
|
|
2498
|
+
});
|
|
2499
|
+
/** Schema for one persisted log entry captured during a case run. */
|
|
3840
2500
|
const runLogEntrySchema = z.object({
|
|
3841
2501
|
/** ISO timestamp for when the log was captured. */
|
|
3842
2502
|
timestamp: z.string(),
|
|
@@ -3850,6 +2510,8 @@ const runLogEntrySchema = z.object({
|
|
|
3850
2510
|
args: z.array(z.unknown()).default([]),
|
|
3851
2511
|
/** Whether `message` was capped before persistence. */
|
|
3852
2512
|
truncated: z.boolean().default(false),
|
|
2513
|
+
/** Best-effort code location for the log call, when Node stack data is available. */
|
|
2514
|
+
location: runLogLocationSchema.optional(),
|
|
3853
2515
|
/**
|
|
3854
2516
|
* Optional source label for logs emitted from a nested case-owned activity,
|
|
3855
2517
|
* such as a score key.
|
|
@@ -4619,68 +3281,98 @@ function readArray(attributes, key) {
|
|
|
4619
3281
|
const value = attributes[key];
|
|
4620
3282
|
return Array.isArray(value) ? value : [];
|
|
4621
3283
|
}
|
|
3284
|
+
function readCacheStatus(attributes) {
|
|
3285
|
+
if (!isRecord$2(attributes)) return void 0;
|
|
3286
|
+
const parsed = cacheStatusSchema.safeParse(attributes["cache.status"]);
|
|
3287
|
+
if (!parsed.success || parsed.data === "bypass") return void 0;
|
|
3288
|
+
return parsed.data;
|
|
3289
|
+
}
|
|
4622
3290
|
/**
|
|
4623
|
-
* Collect every
|
|
3291
|
+
* Collect every cache hit or cache write recorded for a case run.
|
|
4624
3292
|
*
|
|
4625
|
-
* Walks `spans` for span-level cache
|
|
4626
|
-
*
|
|
4627
|
-
*
|
|
4628
|
-
*
|
|
4629
|
-
* inline in the Trace tab.
|
|
3293
|
+
* Walks `spans` for span-level cache activity (`attributes['cache.status']`)
|
|
3294
|
+
* and per-span value-cache refs (`attributes['cache.refs']`), then appends
|
|
3295
|
+
* spanless value-cache refs persisted on the case scope. Bypasses are skipped
|
|
3296
|
+
* because they do not read or write a persisted cache entry.
|
|
4630
3297
|
*/
|
|
4631
|
-
function
|
|
3298
|
+
function extractCacheEntries(spans, caseCacheRefs) {
|
|
4632
3299
|
const entries = [];
|
|
4633
3300
|
for (const span of spans) {
|
|
4634
|
-
|
|
3301
|
+
const status = readCacheStatus(span.attributes);
|
|
3302
|
+
if (status !== void 0) {
|
|
4635
3303
|
const key = readString(span.attributes, "cache.key");
|
|
4636
3304
|
const namespace = readString(span.attributes, "cache.namespace");
|
|
4637
|
-
if (key !== void 0 && namespace !== void 0)
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
3305
|
+
if (key !== void 0 && namespace !== void 0) {
|
|
3306
|
+
const isHit = status === "hit";
|
|
3307
|
+
entries.push({
|
|
3308
|
+
id: span.id,
|
|
3309
|
+
source: "span",
|
|
3310
|
+
origin: "span",
|
|
3311
|
+
action: isHit ? "hit" : "added",
|
|
3312
|
+
status,
|
|
3313
|
+
name: span.name,
|
|
3314
|
+
namespace,
|
|
3315
|
+
key,
|
|
3316
|
+
storedAt: isHit ? readString(span.attributes, "cache.storedAt") : void 0,
|
|
3317
|
+
age: isHit ? readNumber(span.attributes, "cache.age") : void 0,
|
|
3318
|
+
spanId: span.id
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
4648
3321
|
}
|
|
4649
3322
|
const rawRefs = readArray(span.attributes, "cache.refs");
|
|
4650
3323
|
for (const [index, rawRef] of rawRefs.entries()) {
|
|
4651
3324
|
const parsed = traceCacheRefSchema.safeParse(rawRef);
|
|
4652
3325
|
if (!parsed.success) continue;
|
|
4653
3326
|
const ref = parsed.data;
|
|
4654
|
-
if (ref.status
|
|
3327
|
+
if (ref.status === "bypass") continue;
|
|
3328
|
+
const isHit = ref.status === "hit";
|
|
4655
3329
|
entries.push({
|
|
4656
3330
|
id: `${span.id}:value:${String(index)}`,
|
|
4657
3331
|
source: "value",
|
|
4658
3332
|
origin: "span",
|
|
3333
|
+
action: isHit ? "hit" : "added",
|
|
3334
|
+
status: ref.status,
|
|
4659
3335
|
name: ref.name,
|
|
4660
3336
|
namespace: ref.namespace,
|
|
4661
3337
|
key: ref.key,
|
|
4662
|
-
storedAt: ref.storedAt,
|
|
4663
|
-
age: ref.age,
|
|
3338
|
+
storedAt: isHit ? ref.storedAt : void 0,
|
|
3339
|
+
age: isHit ? ref.age : void 0,
|
|
4664
3340
|
spanId: span.id
|
|
4665
3341
|
});
|
|
4666
3342
|
}
|
|
4667
3343
|
}
|
|
4668
3344
|
for (const [index, ref] of caseCacheRefs.entries()) {
|
|
4669
|
-
if (ref.status
|
|
3345
|
+
if (ref.status === "bypass") continue;
|
|
3346
|
+
const isHit = ref.status === "hit";
|
|
4670
3347
|
entries.push({
|
|
4671
3348
|
id: `case:value:${String(index)}`,
|
|
4672
3349
|
source: "value",
|
|
4673
3350
|
origin: "caseRoot",
|
|
3351
|
+
action: isHit ? "hit" : "added",
|
|
3352
|
+
status: ref.status,
|
|
4674
3353
|
name: ref.name,
|
|
4675
3354
|
namespace: ref.namespace,
|
|
4676
3355
|
key: ref.key,
|
|
4677
|
-
storedAt: ref.storedAt,
|
|
4678
|
-
age: ref.age,
|
|
3356
|
+
storedAt: isHit ? ref.storedAt : void 0,
|
|
3357
|
+
age: isHit ? ref.age : void 0,
|
|
4679
3358
|
spanId: void 0
|
|
4680
3359
|
});
|
|
4681
3360
|
}
|
|
4682
3361
|
return entries;
|
|
4683
3362
|
}
|
|
3363
|
+
/**
|
|
3364
|
+
* Collect every `status === 'hit'` cache event recorded for a case run.
|
|
3365
|
+
*
|
|
3366
|
+
* This compatibility helper returns only rows that reused an existing
|
|
3367
|
+
* persisted cache entry. Use `extractCacheEntries(...)` when the UI should
|
|
3368
|
+
* include cache misses and refreshes that wrote entries during the run.
|
|
3369
|
+
*/
|
|
3370
|
+
function extractCacheHits(spans, caseCacheRefs) {
|
|
3371
|
+
return extractCacheEntries(spans, caseCacheRefs).filter(isCacheHitEntry);
|
|
3372
|
+
}
|
|
3373
|
+
function isCacheHitEntry(entry) {
|
|
3374
|
+
return entry.status === "hit";
|
|
3375
|
+
}
|
|
4684
3376
|
z.enum([
|
|
4685
3377
|
"discovery.updated",
|
|
4686
3378
|
"run.started",
|
|
@@ -4725,6 +3417,8 @@ const updateManualScoreRequestSchema = z.object({ value: z.number().min(0).max(1
|
|
|
4725
3417
|
//#endregion
|
|
4726
3418
|
//#region ../runner/src/cacheStore.ts
|
|
4727
3419
|
const defaultMaxEntriesPerNamespace = 100;
|
|
3420
|
+
const cacheSerializationMarker = "__agentEvalsCacheSerialization";
|
|
3421
|
+
const supportedCacheSerializationVersion = "json-safe-v1";
|
|
4728
3422
|
/**
|
|
4729
3423
|
* Create a filesystem-backed cache adapter rooted at `<workspaceRoot>/<dir>`.
|
|
4730
3424
|
*
|
|
@@ -4929,7 +3623,16 @@ async function readCacheFilePath(filePath) {
|
|
|
4929
3623
|
if (json === null) return null;
|
|
4930
3624
|
const parsed = cacheFileSchema.safeParse(json);
|
|
4931
3625
|
if (!parsed.success) return null;
|
|
4932
|
-
return
|
|
3626
|
+
return {
|
|
3627
|
+
...parsed.data,
|
|
3628
|
+
entries: Object.fromEntries(Object.entries(parsed.data.entries).filter(([, entry]) => usesSupportedCacheSerialization(entry.recording)))
|
|
3629
|
+
};
|
|
3630
|
+
}
|
|
3631
|
+
function usesSupportedCacheSerialization(value) {
|
|
3632
|
+
if (Array.isArray(value)) return value.every(usesSupportedCacheSerialization);
|
|
3633
|
+
if (!isRecordLike(value)) return true;
|
|
3634
|
+
if (Object.hasOwn(value, cacheSerializationMarker) && value[cacheSerializationMarker] !== supportedCacheSerializationVersion) return false;
|
|
3635
|
+
return Object.values(value).every(usesSupportedCacheSerialization);
|
|
4933
3636
|
}
|
|
4934
3637
|
async function writeOrRemoveCacheFile(cacheDir, cacheFile) {
|
|
4935
3638
|
if (Object.keys(cacheFile.entries).length === 0) {
|
|
@@ -4942,7 +3645,7 @@ async function writeCacheFile(cacheDir, cacheFile) {
|
|
|
4942
3645
|
await mkdir(cacheDir, { recursive: true });
|
|
4943
3646
|
const filePath = ownerPath(cacheDir, cacheFile.owner);
|
|
4944
3647
|
const tmpPath = `${filePath}.${process.pid.toString()}.tmp`;
|
|
4945
|
-
await writeFile(tmpPath, JSON.stringify(cacheFile
|
|
3648
|
+
await writeFile(tmpPath, JSON.stringify(cacheFile));
|
|
4946
3649
|
await rename(tmpPath, filePath);
|
|
4947
3650
|
}
|
|
4948
3651
|
async function readDebugKeyFile(debugDir, owner) {
|
|
@@ -5030,7 +3733,7 @@ async function writeDebugKeyFile(debugDir, debugFile) {
|
|
|
5030
3733
|
await mkdir(debugDir, { recursive: true });
|
|
5031
3734
|
const filePath = ownerPath(debugDir, debugFile.owner);
|
|
5032
3735
|
const tmpPath = `${filePath}.${process.pid.toString()}.tmp`;
|
|
5033
|
-
await writeFile(tmpPath, JSON.stringify(debugFile
|
|
3736
|
+
await writeFile(tmpPath, JSON.stringify(debugFile));
|
|
5034
3737
|
await rename(tmpPath, filePath);
|
|
5035
3738
|
}
|
|
5036
3739
|
function pruneEntries(entries, namespace, maxEntries, protectedKey) {
|
|
@@ -5085,6 +3788,9 @@ function safeJsonParse(text) {
|
|
|
5085
3788
|
if (parsed.error) return null;
|
|
5086
3789
|
return parsed.value;
|
|
5087
3790
|
}
|
|
3791
|
+
function isRecordLike(value) {
|
|
3792
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3793
|
+
}
|
|
5088
3794
|
//#endregion
|
|
5089
3795
|
//#region ../runner/src/columnBuilder.ts
|
|
5090
3796
|
/**
|
|
@@ -6531,4 +5237,4 @@ function toLastRunStatus(status) {
|
|
|
6531
5237
|
return status === "pending" ? null : status;
|
|
6532
5238
|
}
|
|
6533
5239
|
//#endregion
|
|
6534
|
-
export {
|
|
5240
|
+
export { assertionFailureSchema as $, runArtifactRefSchema as $t, getNestedAttribute as A, getEvalRegistry as An, cacheRecordingSchema as At, agentEvalsConfigSchema as B, traceDisplayInputConfigSchema as Bt, createRunRequestSchema as C, runInEvalScope as Cn, cacheEntrySchema as Ct, extractCacheHits as D, startEvalBackgroundJob as Dn, cacheModeSchema as Dt, extractCacheEntries as E, setScopeCacheContext as En, cacheListItemSchema as Et, deriveStatusFromChildStatuses as F, traceAttributeDisplayFormatSchema as Ft, llmCallMetricFormatSchema as G, cellValueSchema as Gt, apiCallMetricPlacementSchema as H, traceSpanKindSchema as Ht, runManifestSchema as I, traceAttributeDisplayInputSchema as It, llmCallsConfigSchema as J, columnKindSchema as Jt, llmCallMetricPlacementSchema as K, columnDefSchema as Kt, runSummarySchema as L, traceAttributeDisplayPlacementSchema as Lt, getEvalDisplayStatus as M, serializedCacheSpanSchema as Mt, deriveScopedSummaryFromCases as N, spanCacheOptionsSchema as Nt, extractApiCalls as O, repoFile as On, cacheOperationTypeSchema as Ot, deriveStatusFromCaseRows as P, traceCacheRefSchema as Pt, trialSelectionModeSchema as Q, repoFileRefSchema as Qt, DEFAULT_API_CALLS_CONFIG as R, traceAttributeDisplaySchema as Rt, createFsCacheStore as S, runInEvalRuntimeScope as Sn, cacheDebugKeyFileSchema as St, sseEnvelopeSchema as T, setEvalOutput as Tn, cacheFileSchema as Tt, apiCallMetricSchema as U, traceSpanSchema as Ut, apiCallMetricFormatSchema as V, traceSpanErrorSchema as Vt, apiCallsConfigSchema as W, traceSpanWarningSchema as Wt, resolveLlmCallsConfig as X, jsonCellSchema as Xt, resolveApiCallsConfig as Y, fileRefSchema as Yt, runLogsConfigSchema as Z, numberDisplayOptionsSchema as Zt, loadEvalModule as _, getEvalCaseInput as _n, evalChartMetricSchema as _t, loadPersistedRunSnapshot as a, hashCacheKey as an, evalStatsConfigSchema as at, buildDeclaredColumnDefs as b, mergeEvalOutput as bn, evalChartsConfigSchema as bt, persistCaseDetail as c, deserializeCacheValue as cn, runLogLevelSchema as ct, recomputePersistedCaseStatus as d, EvalAssertionError as dn, scoreTraceSchema as dt, z$1 as en, caseDetailSchema as et, runTouchesEval as f, appendToEvalOutput as fn, evalChartAggregateSchema as ft, setLatestRunInfoMap as g, getCurrentScope as gn, evalChartConfigSchema as gt, getTargetEvalIds as h, evalLog as hn, evalChartColorSchema as ht, getLatestRunInfos as i, evalTracer as in, evalStatItemSchema as it, getEvalTitle as j, cacheStatusSchema as jt, extractLlmCalls as k, defineEval as kn, cacheRecordingOpSchema as kt, persistRunState as l, serializeCacheRecording as ln, runLogLocationSchema as lt, buildEvalSummary as m, evalAssert as mn, evalChartBuiltinMetricSchema as mt, generateRunId as n, captureEvalSpanError as nn, evalFreshnessStatusSchema as nt, loadPersistedRunSnapshots as o, hashCacheKeySync as on, evalSummarySchema as ot, resolveArtifactPath as p, configureEvalRunLogs as pn, evalChartAxisSchema as pt, llmCallMetricSchema as q, columnFormatSchema as qt, getLastRunStatuses as r, evalSpan as rn, evalStatAggregateSchema as rt, nextShortIdFromSnapshots as s, deserializeCacheRecording as sn, runLogEntrySchema as st, executeRun as t, buildTraceTree as tn, caseRowSchema as tt, recomputeEvalStatusesInRuns as u, serializeCacheValue as un, runLogPhaseSchema as ut, parseEvalMetas as v, incrementEvalOutput as vn, evalChartTooltipExtraSchema as vt, updateManualScoreRequestSchema as w, runInExistingEvalScope as wn, cacheEntryWithDebugKeySchema as wt, normalizeScoreDef as x, nextEvalId as xn, cacheDebugKeyEntrySchema as xt, loadConfig as y, isInEvalScope as yn, evalChartTypeSchema as yt, DEFAULT_LLM_CALLS_CONFIG as z, traceDisplayConfigSchema as zt };
|