poe-code 11.0.29 → 11.0.31
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/index.js +28 -7
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-DB2DNWCX.js → chunk-5IU6NPGM.js} +2 -2
- package/packages/safejs/dist/chunks/{chunk-HC3QSP5N.js → chunk-NPXVDTLX.js} +28 -7
- package/packages/safejs/dist/chunks/{chunk-HC3QSP5N.js.map → chunk-NPXVDTLX.js.map} +3 -3
- package/packages/safejs/dist/cli.js +2 -2
- package/packages/safejs/dist/core.js +1 -1
- package/packages/safejs/dist/index.js +2 -2
- package/packages/safejs/dist/interp/host-call.js +32 -8
- /package/packages/safejs/dist/chunks/{chunk-DB2DNWCX.js.map → chunk-5IU6NPGM.js.map} +0 -0
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
parseMcpConfig,
|
|
21
21
|
splitFrontmatter,
|
|
22
22
|
withBrokenPipeGuard
|
|
23
|
-
} from "./chunks/chunk-
|
|
23
|
+
} from "./chunks/chunk-5IU6NPGM.js";
|
|
24
24
|
import {
|
|
25
25
|
Budget,
|
|
26
26
|
SandboxError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
replaceErrorStack,
|
|
33
33
|
restore,
|
|
34
34
|
run
|
|
35
|
-
} from "./chunks/chunk-
|
|
35
|
+
} from "./chunks/chunk-NPXVDTLX.js";
|
|
36
36
|
import "./chunks/chunk-4YIDX44G.js";
|
|
37
37
|
|
|
38
38
|
// packages/safejs/src/cli.ts
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
runWithSpawnUsageAccumulator,
|
|
28
28
|
splitFrontmatter,
|
|
29
29
|
supportsSpawnMode
|
|
30
|
-
} from "./chunks/chunk-
|
|
30
|
+
} from "./chunks/chunk-5IU6NPGM.js";
|
|
31
31
|
import {
|
|
32
32
|
Budget,
|
|
33
33
|
FileSnapshotBackend,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
registerPendingHostCallPolicy,
|
|
50
50
|
restore,
|
|
51
51
|
run
|
|
52
|
-
} from "./chunks/chunk-
|
|
52
|
+
} from "./chunks/chunk-NPXVDTLX.js";
|
|
53
53
|
import "./chunks/chunk-4YIDX44G.js";
|
|
54
54
|
|
|
55
55
|
// packages/safejs/src/runner/run-harness.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { cloneSandboxValue, createSandboxClosure, measureSandboxData } from "./values.js";
|
|
2
|
+
import { cloneSandboxValue, createSandboxClosure, defineOwnDataProperty, isArrayIndexKey, measureSandboxData } from "./values.js";
|
|
3
3
|
import { decodeReplayData, encodeReplayData } from "../snapshot/replay-data.js";
|
|
4
4
|
import { validateSnapshotData } from "../snapshot/validation.js";
|
|
5
5
|
import { pendingHostCallResumeIdentityMatches } from "../snapshot/policy.js";
|
|
@@ -520,21 +520,45 @@ function stableStringify(value) {
|
|
|
520
520
|
return JSON.stringify(normalize(value, seen));
|
|
521
521
|
}
|
|
522
522
|
function normalize(value, seen) {
|
|
523
|
+
if (typeof value === "function")
|
|
524
|
+
return undefined;
|
|
525
|
+
if (typeof value === "bigint")
|
|
526
|
+
throw new TypeError("Do not know how to serialize a BigInt");
|
|
523
527
|
if (value === undefined)
|
|
524
|
-
return { $type: "undefined" };
|
|
528
|
+
return Object.assign(Object.create(null), { $type: "undefined" });
|
|
525
529
|
if (typeof value === "number" && !Number.isFinite(value))
|
|
526
|
-
return { $type: "number", value: String(value) };
|
|
530
|
+
return Object.assign(Object.create(null), { $type: "number", value: String(value) });
|
|
527
531
|
if (value === null || typeof value !== "object")
|
|
528
532
|
return value;
|
|
529
533
|
if (seen.has(value))
|
|
530
534
|
throw new TypeError("Host call arguments cannot contain cycles.");
|
|
531
535
|
seen.add(value);
|
|
532
536
|
try {
|
|
533
|
-
if (Array.isArray(value))
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
.
|
|
537
|
-
|
|
537
|
+
if (Array.isArray(value)) {
|
|
538
|
+
const normalized = new Array(value.length);
|
|
539
|
+
Object.setPrototypeOf(normalized, null);
|
|
540
|
+
for (const [key, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
|
|
541
|
+
if (!isArrayIndexKey(key))
|
|
542
|
+
continue;
|
|
543
|
+
if (!("value" in descriptor)) {
|
|
544
|
+
throw new TypeError("Host call arguments cannot contain accessor properties.");
|
|
545
|
+
}
|
|
546
|
+
defineOwnDataProperty(normalized, key, normalize(descriptor.value, seen));
|
|
547
|
+
}
|
|
548
|
+
return normalized;
|
|
549
|
+
}
|
|
550
|
+
const normalized = Object.create(null);
|
|
551
|
+
const descriptors = Object.getOwnPropertyDescriptors(value);
|
|
552
|
+
for (const key of Object.keys(descriptors).sort()) {
|
|
553
|
+
const descriptor = descriptors[key];
|
|
554
|
+
if (!descriptor.enumerable)
|
|
555
|
+
continue;
|
|
556
|
+
if (!("value" in descriptor)) {
|
|
557
|
+
throw new TypeError("Host call arguments cannot contain accessor properties.");
|
|
558
|
+
}
|
|
559
|
+
defineOwnDataProperty(normalized, key, normalize(descriptor.value, seen));
|
|
560
|
+
}
|
|
561
|
+
return normalized;
|
|
538
562
|
}
|
|
539
563
|
finally {
|
|
540
564
|
seen.delete(value);
|
|
File without changes
|