@poe-platform/safe-js 0.1.321 → 0.1.323
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-UEFYW6FZ.js → chunk-JLGN75VU.js} +2 -2
- package/dist/safe-js/chunks/{chunk-6SSHJVLI.js → chunk-XWFNWZEL.js} +48 -42
- package/dist/safe-js/chunks/chunk-XWFNWZEL.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/snapshot/array-buffer.d.ts +2 -1
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-6SSHJVLI.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-UEFYW6FZ.js.map → chunk-JLGN75VU.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XWFNWZEL.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-JLGN75VU.js.map
|
|
@@ -11947,42 +11947,43 @@ function defineArrayResult(result, index, value, options) {
|
|
|
11947
11947
|
var arrayLikeSources = /* @__PURE__ */ new WeakMap();
|
|
11948
11948
|
var activeArrayCallbacks = /* @__PURE__ */ new WeakMap();
|
|
11949
11949
|
var localeArrays = /* @__PURE__ */ new WeakSet();
|
|
11950
|
-
var
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11950
|
+
var arrayMethodLengths = {
|
|
11951
|
+
map: 1,
|
|
11952
|
+
filter: 1,
|
|
11953
|
+
find: 1,
|
|
11954
|
+
findIndex: 1,
|
|
11955
|
+
findLast: 1,
|
|
11956
|
+
findLastIndex: 1,
|
|
11957
|
+
some: 1,
|
|
11958
|
+
every: 1,
|
|
11959
|
+
reduce: 1,
|
|
11960
|
+
reduceRight: 1,
|
|
11961
|
+
forEach: 1,
|
|
11962
|
+
flatMap: 1,
|
|
11963
|
+
flat: 0,
|
|
11964
|
+
includes: 1,
|
|
11965
|
+
indexOf: 1,
|
|
11966
|
+
lastIndexOf: 1,
|
|
11967
|
+
join: 1,
|
|
11968
|
+
toLocaleString: 0,
|
|
11969
|
+
slice: 2,
|
|
11970
|
+
concat: 1,
|
|
11971
|
+
splice: 2,
|
|
11972
|
+
fill: 1,
|
|
11973
|
+
copyWithin: 2,
|
|
11974
|
+
at: 1,
|
|
11975
|
+
sort: 1,
|
|
11976
|
+
reverse: 0,
|
|
11977
|
+
toSorted: 1,
|
|
11978
|
+
toReversed: 0,
|
|
11979
|
+
toSpliced: 2,
|
|
11980
|
+
with: 2,
|
|
11981
|
+
push: 1,
|
|
11982
|
+
pop: 0,
|
|
11983
|
+
shift: 0,
|
|
11984
|
+
unshift: 1
|
|
11985
|
+
};
|
|
11986
|
+
var arrayMethodNames = new Set(Object.keys(arrayMethodLengths));
|
|
11986
11987
|
function getArrayMember(value, property, options) {
|
|
11987
11988
|
const index = getArrayIndex(property);
|
|
11988
11989
|
if (index !== void 0) {
|
|
@@ -13503,7 +13504,7 @@ function createArrayGlobal(budget) {
|
|
|
13503
13504
|
guest: true,
|
|
13504
13505
|
sandbox: true,
|
|
13505
13506
|
name,
|
|
13506
|
-
length:
|
|
13507
|
+
length: arrayMethodLengths[name],
|
|
13507
13508
|
call: (args, context) => callArrayMethod(context?.thisValue, name, args, {
|
|
13508
13509
|
budget,
|
|
13509
13510
|
context,
|
|
@@ -21250,9 +21251,10 @@ function validateArrayBufferStorage(value) {
|
|
|
21250
21251
|
if (Object.hasOwn(value, "maxByteLength") && (!Array.isArray(value.bytes) || !Number.isSafeInteger(value.maxByteLength) || Number(value.maxByteLength) < value.bytes.length))
|
|
21251
21252
|
throw new TypeError("Invalid ArrayBuffer maximum length.");
|
|
21252
21253
|
}
|
|
21253
|
-
function decodeArrayBufferStorage(value, resolve) {
|
|
21254
|
+
function decodeArrayBufferStorage(value, resolve, budget) {
|
|
21254
21255
|
validateArrayBufferStorage(value);
|
|
21255
21256
|
if (Array.isArray(value.bytes)) {
|
|
21257
|
+
budget?.allocateArrayLength(Number(value.maxByteLength ?? value.bytes.length));
|
|
21256
21258
|
const buffer = Reflect.construct(ArrayBuffer, [
|
|
21257
21259
|
value.bytes.length,
|
|
21258
21260
|
Object.hasOwn(value, "maxByteLength") ? { maxByteLength: value.maxByteLength } : void 0
|
|
@@ -22162,7 +22164,7 @@ function decodeReplayData(input, options = {}, parent) {
|
|
|
22162
22164
|
}
|
|
22163
22165
|
if (kind === "arraybuffer") {
|
|
22164
22166
|
if (typeof node.extensible !== "boolean") throw new TypeError("Invalid ArrayBuffer extensibility.");
|
|
22165
|
-
const result3 = decodeArrayBufferStorage(node, child);
|
|
22167
|
+
const result3 = decodeArrayBufferStorage(node, child, compilation.owner?.budget);
|
|
22166
22168
|
restored.set(id, result3);
|
|
22167
22169
|
initializeValues.push(() => {
|
|
22168
22170
|
defineProperties(result3, record2(own(node, "properties")), child, node.symbolEntries);
|
|
@@ -23063,7 +23065,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
23063
23065
|
const existing = state.seen.get(value);
|
|
23064
23066
|
if (existing !== void 0) return existing;
|
|
23065
23067
|
const length = arrayBufferLength(value);
|
|
23066
|
-
budget.allocateArrayLength(length);
|
|
23068
|
+
budget.allocateArrayLength(arrayBufferOptions(value)?.maxByteLength ?? length);
|
|
23067
23069
|
budget.provisionDataUsage(length + 1)();
|
|
23068
23070
|
const copy = copyArrayBufferStorage(value, state);
|
|
23069
23071
|
state.seen.set(value, copy);
|
|
@@ -23086,6 +23088,8 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
23086
23088
|
if (isFloat32Array(value)) {
|
|
23087
23089
|
const existing = state.seen.get(value);
|
|
23088
23090
|
if (existing !== void 0) return existing;
|
|
23091
|
+
const capacity = arrayBufferOptions(float32Storage(value).buffer)?.maxByteLength;
|
|
23092
|
+
if (capacity !== void 0) budget.allocateArrayLength(capacity);
|
|
23089
23093
|
checkFloat32Allocation(Math.ceil(float32Storage(value).byteLength / 4), budget);
|
|
23090
23094
|
const copy = copyFloat32Storage(value, state);
|
|
23091
23095
|
state.seen.set(value, copy);
|
|
@@ -28083,7 +28087,7 @@ function allocateSandboxValue2(value, budget, seen) {
|
|
|
28083
28087
|
if (isSandboxArrayBuffer(value)) {
|
|
28084
28088
|
if (seen.has(value)) return;
|
|
28085
28089
|
seen.add(value);
|
|
28086
|
-
budget.allocateArrayLength(arrayBufferLength(value));
|
|
28090
|
+
budget.allocateArrayLength(arrayBufferOptions(value)?.maxByteLength ?? arrayBufferLength(value));
|
|
28087
28091
|
for (const [key, descriptor] of arrayBufferDataProperties(value)) {
|
|
28088
28092
|
if (typeof key === "string") budget.allocateString(key);
|
|
28089
28093
|
allocateSandboxValue2(descriptor.value, budget, seen);
|
|
@@ -28105,6 +28109,8 @@ function allocateSandboxValue2(value, budget, seen) {
|
|
|
28105
28109
|
if (seen.has(value)) return;
|
|
28106
28110
|
seen.add(value);
|
|
28107
28111
|
budget.allocateArrayLength(Math.ceil(float32Storage(value).byteLength / 4));
|
|
28112
|
+
const capacity = arrayBufferOptions(float32Storage(value).buffer)?.maxByteLength;
|
|
28113
|
+
if (capacity !== void 0) budget.allocateArrayLength(capacity);
|
|
28108
28114
|
for (const [key, descriptor] of float32DataProperties(value)) {
|
|
28109
28115
|
budget.allocateString(key);
|
|
28110
28116
|
allocateSandboxValue2(descriptor.value, budget, seen);
|
|
@@ -42340,4 +42346,4 @@ export {
|
|
|
42340
42346
|
FileSnapshotBackend,
|
|
42341
42347
|
run
|
|
42342
42348
|
};
|
|
42343
|
-
//# sourceMappingURL=chunk-
|
|
42349
|
+
//# sourceMappingURL=chunk-XWFNWZEL.js.map
|