@poe-platform/safe-js 0.1.382 → 0.1.384
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-FUPQ2J76.js → chunk-4OTKJDYX.js} +2 -2
- package/dist/safe-js/chunks/{chunk-DRWLAPG6.js → chunk-N3C4UP54.js} +34 -7
- package/dist/safe-js/chunks/chunk-N3C4UP54.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/package.json +2 -2
- package/dist/safe-js/chunks/chunk-DRWLAPG6.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-FUPQ2J76.js.map → chunk-4OTKJDYX.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-N3C4UP54.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-4OTKJDYX.js.map
|
|
@@ -9787,7 +9787,7 @@ async function acquireSandboxIterator(value, budget, context, asyncProtocol = fa
|
|
|
9787
9787
|
if (!hasExplicitSandboxPrototype(value) && value.async === true === asyncProtocol && getSandboxPropertyDescriptor(value, "next", budget) !== void 0)
|
|
9788
9788
|
return guestIterator(value, await context.getProperty(value, "next"), asyncProtocol, budget, context, signal);
|
|
9789
9789
|
}
|
|
9790
|
-
if (!asyncProtocol && Array.isArray(value) && getSandboxPrototype(value, budget) !== null) return void 0;
|
|
9790
|
+
if (!asyncProtocol && (typeof value === "string" ? lookupTarget !== void 0 : (Array.isArray(value) || isSandboxBox(value) || isSandboxMap(value) || isSandboxSet(value)) && (hasExplicitSandboxPrototype(value) || getSandboxPrototype(value, budget) !== null))) return void 0;
|
|
9791
9791
|
if (!asyncProtocol) return getSandboxIterator(value, budget, context);
|
|
9792
9792
|
if (isSandboxGenerator(value) && value.async && !hasExplicitSandboxPrototype(value))
|
|
9793
9793
|
return getSandboxAsyncIterator(value, budget, context, signal);
|
|
@@ -15041,6 +15041,18 @@ function createArrayGlobal(budget) {
|
|
|
15041
15041
|
const statics = {
|
|
15042
15042
|
isArray: createSandboxClosure({ sandbox: true, name: "isArray", call: ([value]) => Array.isArray(value) }),
|
|
15043
15043
|
from: createSandboxClosure({ sandbox: true, name: "from", call: (args, context) => arrayFromSandboxValues(args, budget, context) }),
|
|
15044
|
+
fromAsync: createSandboxClosure({
|
|
15045
|
+
guest: true,
|
|
15046
|
+
sandbox: true,
|
|
15047
|
+
name: "fromAsync",
|
|
15048
|
+
length: 1,
|
|
15049
|
+
call: (args, context) => executeAsyncFunction(
|
|
15050
|
+
(onSuspend) => arrayFromSandboxValues(args, budget, context, onSuspend),
|
|
15051
|
+
budget,
|
|
15052
|
+
void 0,
|
|
15053
|
+
context
|
|
15054
|
+
)
|
|
15055
|
+
}),
|
|
15044
15056
|
of: createSandboxClosure({
|
|
15045
15057
|
guest: true,
|
|
15046
15058
|
sandbox: true,
|
|
@@ -15327,7 +15339,17 @@ function defineDataProperty(target, key, descriptor, budget, context, throwOnFai
|
|
|
15327
15339
|
function isAssignableSandboxTarget(value) {
|
|
15328
15340
|
return typeof value === "object" && value !== null && !isSandboxClosure(value) && !isSandboxGenerator(value) && !isSandboxMap(value) && !isSandboxSet(value) && !isSandboxPromise(value) && !isSandboxRegex(value);
|
|
15329
15341
|
}
|
|
15330
|
-
async function arrayFromSandboxValues(args, budget, context) {
|
|
15342
|
+
async function arrayFromSandboxValues(args, budget, context, onSuspend) {
|
|
15343
|
+
const asyncProtocol = onSuspend !== void 0;
|
|
15344
|
+
const awaitAsync = async (pending) => {
|
|
15345
|
+
onSuspend();
|
|
15346
|
+
const leaveAwait = budget.enterAwait();
|
|
15347
|
+
try {
|
|
15348
|
+
return await suspendJob(pending);
|
|
15349
|
+
} finally {
|
|
15350
|
+
leaveAwait();
|
|
15351
|
+
}
|
|
15352
|
+
};
|
|
15331
15353
|
const [items, mapFn, thisValue] = args;
|
|
15332
15354
|
if (mapFn !== void 0 && !isSandboxClosure(mapFn)) {
|
|
15333
15355
|
throw new TypeError("Array.from mapping callback must be a function.");
|
|
@@ -15336,11 +15358,11 @@ async function arrayFromSandboxValues(args, budget, context) {
|
|
|
15336
15358
|
throw new TypeError("Array.from requires a non-null input.");
|
|
15337
15359
|
}
|
|
15338
15360
|
const read = (property) => context?.getProperty !== void 0 ? context.getProperty(items, property) : getSandboxDataProperty(items, property, budget);
|
|
15339
|
-
const observableMethod = context?.getProperty !== void 0 && !isGuestHostObject(items) && getSandboxPropertyDescriptor(typeof items === "object" ? items : getBoxedPrototype(items, budget), Symbol.iterator, budget) !== void 0;
|
|
15361
|
+
const observableMethod = !asyncProtocol && context?.getProperty !== void 0 && !isGuestHostObject(items) && getSandboxPropertyDescriptor(typeof items === "object" ? items : getBoxedPrototype(items, budget), Symbol.iterator, budget) !== void 0;
|
|
15340
15362
|
const iteratorMethod = observableMethod ? await context.getProperty(items, Symbol.iterator) : void 0;
|
|
15341
15363
|
if (iteratorMethod !== null && iteratorMethod !== void 0 && !isSandboxClosure(iteratorMethod) && typeof iteratorMethod !== "function")
|
|
15342
15364
|
throw new TypeError("Iterator method must be callable.");
|
|
15343
|
-
let iterator = observableMethod ? void 0 : context === void 0 ? getSandboxIterator(items, budget) : await acquireSandboxIterator(items, budget, context);
|
|
15365
|
+
let iterator = observableMethod ? void 0 : context === void 0 ? asyncProtocol ? getSandboxAsyncIterator(items, budget) : getSandboxIterator(items, budget) : await acquireSandboxIterator(items, budget, context, asyncProtocol);
|
|
15344
15366
|
const iterable = observableMethod ? iteratorMethod !== null && iteratorMethod !== void 0 : iterator !== void 0;
|
|
15345
15367
|
const constructor = context?.thisValue;
|
|
15346
15368
|
let result;
|
|
@@ -15354,6 +15376,7 @@ async function arrayFromSandboxValues(args, budget, context) {
|
|
|
15354
15376
|
iteratorMethod,
|
|
15355
15377
|
iterator?.retainedValue,
|
|
15356
15378
|
mapFn,
|
|
15379
|
+
thisValue,
|
|
15357
15380
|
constructor,
|
|
15358
15381
|
result,
|
|
15359
15382
|
currentValue,
|
|
@@ -15396,17 +15419,19 @@ async function arrayFromSandboxValues(args, budget, context) {
|
|
|
15396
15419
|
await closeOnThrow(error);
|
|
15397
15420
|
}
|
|
15398
15421
|
if (iterator !== void 0) {
|
|
15399
|
-
const
|
|
15422
|
+
const pending = Promise.resolve(iterator.next());
|
|
15423
|
+
const next = await (asyncProtocol ? awaitAsync(pending) : pending);
|
|
15400
15424
|
if (typeof next !== "object" || next === null)
|
|
15401
15425
|
throw new TypeError("Iterator result must be an object.");
|
|
15402
15426
|
if ((await readIteratorResult(iterator, next, "done")).value) break;
|
|
15403
15427
|
currentValue = (await readIteratorResult(iterator, next, "value")).value;
|
|
15404
15428
|
} else {
|
|
15405
15429
|
currentValue = await read(index);
|
|
15430
|
+
if (asyncProtocol) currentValue = await awaitAsync(awaitSandboxValue(currentValue, void 0, budget, context));
|
|
15406
15431
|
}
|
|
15407
15432
|
try {
|
|
15408
15433
|
if (Array.isArray(result)) budget.allocateArrayLength(index + 1);
|
|
15409
|
-
if (mapFn !== void 0)
|
|
15434
|
+
if (mapFn !== void 0) {
|
|
15410
15435
|
currentValue = await invokeBuiltinClosure(
|
|
15411
15436
|
mapFn,
|
|
15412
15437
|
[currentValue, index],
|
|
@@ -15414,6 +15439,8 @@ async function arrayFromSandboxValues(args, budget, context) {
|
|
|
15414
15439
|
context,
|
|
15415
15440
|
thisValue
|
|
15416
15441
|
);
|
|
15442
|
+
if (asyncProtocol) currentValue = await awaitAsync(awaitSandboxValue(currentValue, void 0, budget, context));
|
|
15443
|
+
}
|
|
15417
15444
|
const key = String(index);
|
|
15418
15445
|
const growth = key.length + 1 + (Array.isArray(result) ? Math.max(0, index + 1 - result.length) : 0) + (budget.limits.dataSize === void 0 ? 0 : measureSandboxData([currentValue]));
|
|
15419
15446
|
budget.visitNode();
|
|
@@ -44064,4 +44091,4 @@ export {
|
|
|
44064
44091
|
FileSnapshotBackend,
|
|
44065
44092
|
run
|
|
44066
44093
|
};
|
|
44067
|
-
//# sourceMappingURL=chunk-
|
|
44094
|
+
//# sourceMappingURL=chunk-N3C4UP54.js.map
|