@poe-platform/safe-js 0.1.370 → 0.1.371
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/safe-js/chunks/{chunk-CEICOOQA.js → chunk-J5WI6EGF.js} +2 -2
- package/dist/safe-js/chunks/{chunk-JJH7D3EH.js → chunk-SDKXAZOP.js} +35 -9
- package/dist/safe-js/chunks/chunk-SDKXAZOP.js.map +7 -0
- package/dist/safe-js/cli.js +2 -2
- package/dist/safe-js/core.js +1 -1
- package/dist/safe-js/index.js +2 -2
- package/dist/safe-js/interp/values.d.ts +6 -3
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-JJH7D3EH.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-CEICOOQA.js.map → chunk-J5WI6EGF.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-SDKXAZOP.js";
|
|
31
31
|
|
|
32
32
|
// packages/safe-js/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8249,4 +8249,4 @@ export {
|
|
|
8249
8249
|
parseMcpConfig,
|
|
8250
8250
|
makeMcpModule
|
|
8251
8251
|
};
|
|
8252
|
-
//# sourceMappingURL=chunk-
|
|
8252
|
+
//# sourceMappingURL=chunk-J5WI6EGF.js.map
|
|
@@ -7409,6 +7409,9 @@ async function withRunResources(signal, execute) {
|
|
|
7409
7409
|
return result;
|
|
7410
7410
|
}
|
|
7411
7411
|
|
|
7412
|
+
// packages/safe-js/src/interp/error-prototypes.ts
|
|
7413
|
+
var errorPrototypes = /* @__PURE__ */ new WeakMap();
|
|
7414
|
+
|
|
7412
7415
|
// packages/safe-js/src/interp/collection-brands.ts
|
|
7413
7416
|
var sandboxMapBrand = /* @__PURE__ */ Symbol("SandboxMap");
|
|
7414
7417
|
var sandboxSetBrand = /* @__PURE__ */ Symbol("SandboxSet");
|
|
@@ -8047,9 +8050,6 @@ function namedKeys(state) {
|
|
|
8047
8050
|
});
|
|
8048
8051
|
}
|
|
8049
8052
|
|
|
8050
|
-
// packages/safe-js/src/interp/error-prototypes.ts
|
|
8051
|
-
var errorPrototypes = /* @__PURE__ */ new WeakMap();
|
|
8052
|
-
|
|
8053
8053
|
// packages/safe-js/src/interp/typed-array-prototypes.ts
|
|
8054
8054
|
var typedArrayPrototypes = /* @__PURE__ */ new WeakMap();
|
|
8055
8055
|
|
|
@@ -25680,9 +25680,14 @@ function cloneStructuredValue(value, transfers, budget, context) {
|
|
|
25680
25680
|
let step = first;
|
|
25681
25681
|
try {
|
|
25682
25682
|
while (!step.done) {
|
|
25683
|
-
const
|
|
25684
|
-
|
|
25685
|
-
|
|
25683
|
+
const request = step.value;
|
|
25684
|
+
if ("stringValue" in request) {
|
|
25685
|
+
createDataCheckpoint(budget, context)(request.stringValue, 0, true);
|
|
25686
|
+
step = iterator.next(await sandboxString(request.stringValue, budget, context));
|
|
25687
|
+
} else {
|
|
25688
|
+
createDataCheckpoint(budget, context)(request.receiver, 0, true);
|
|
25689
|
+
step = iterator.next(await readPropertyDescriptor(request.descriptor, request.receiver, context));
|
|
25690
|
+
}
|
|
25686
25691
|
}
|
|
25687
25692
|
return step.value;
|
|
25688
25693
|
} finally {
|
|
@@ -28365,6 +28370,7 @@ function allocateProducedSandboxValue(value, budget) {
|
|
|
28365
28370
|
allocateSandboxValue2(value, budget, /* @__PURE__ */ new WeakSet());
|
|
28366
28371
|
return value;
|
|
28367
28372
|
}
|
|
28373
|
+
var structuredCloneErrorNames = ["Error", "EvalError", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError"];
|
|
28368
28374
|
function* cloneStructuredGraph(value, state, budget, depth = 0) {
|
|
28369
28375
|
assertSandboxDataDepth(depth);
|
|
28370
28376
|
budget.visitNode();
|
|
@@ -28388,12 +28394,32 @@ function* cloneStructuredGraph(value, state, budget, depth = 0) {
|
|
|
28388
28394
|
const copy = map ? createSandboxMap() : set ? createSandboxSet() : array2 ? new Array(value.length) : createPlainObject(Object.getPrototypeOf(value) === null);
|
|
28389
28395
|
state.seen.set(value, copy);
|
|
28390
28396
|
const errorType = sandboxErrorTypes.get(value);
|
|
28391
|
-
if (errorType !== void 0) sandboxErrorTypes.set(copy, errorType);
|
|
28392
28397
|
let pending;
|
|
28393
28398
|
let current;
|
|
28394
28399
|
const release = retainValues(budget, () => [value, copy, pending, current]);
|
|
28395
28400
|
try {
|
|
28396
|
-
if (
|
|
28401
|
+
if (errorType !== void 0) {
|
|
28402
|
+
const nameDescriptor = getSandboxPropertyDescriptor(value, "name", budget);
|
|
28403
|
+
current = nameDescriptor === void 0 ? void 0 : "value" in nameDescriptor ? nameDescriptor.value : yield { descriptor: nameDescriptor, receiver: value };
|
|
28404
|
+
const name = structuredCloneErrorNames.find((name2) => name2 === current) ?? "Error";
|
|
28405
|
+
const prototype = errorPrototypes.get(budget)?.get(name);
|
|
28406
|
+
if (prototype !== void 0) setSandboxPrototype(copy, prototype, budget);
|
|
28407
|
+
sandboxErrorTypes.set(copy, name);
|
|
28408
|
+
const message = Object.getOwnPropertyDescriptor(value, "message");
|
|
28409
|
+
if (message !== void 0 && "value" in message) {
|
|
28410
|
+
current = message.value;
|
|
28411
|
+
current = yield { stringValue: current };
|
|
28412
|
+
Object.defineProperty(copy, "message", { value: current, writable: true, configurable: true });
|
|
28413
|
+
}
|
|
28414
|
+
const stack = Object.getOwnPropertyDescriptor(value, "stack");
|
|
28415
|
+
if (stack !== void 0 && "value" in stack && typeof stack.value === "string")
|
|
28416
|
+
Object.defineProperty(copy, "stack", { value: budget.allocateString(stack.value), writable: true, configurable: true });
|
|
28417
|
+
const cause = Object.getOwnPropertyDescriptor(value, "cause");
|
|
28418
|
+
if (cause !== void 0 && "value" in cause) {
|
|
28419
|
+
current = cause.value;
|
|
28420
|
+
Object.defineProperty(copy, "cause", { value: yield* cloneStructuredGraph(current, state, budget, depth + 1), writable: true, configurable: true });
|
|
28421
|
+
}
|
|
28422
|
+
} else if (map && isSandboxMap(copy)) {
|
|
28397
28423
|
budget.allocateArrayLength(value.entries.size);
|
|
28398
28424
|
budget.provisionDataUsage(value.entries.size * 3 + 1)();
|
|
28399
28425
|
const entries = [...value.entries];
|
|
@@ -43596,4 +43622,4 @@ export {
|
|
|
43596
43622
|
FileSnapshotBackend,
|
|
43597
43623
|
run
|
|
43598
43624
|
};
|
|
43599
|
-
//# sourceMappingURL=chunk-
|
|
43625
|
+
//# sourceMappingURL=chunk-SDKXAZOP.js.map
|