@poe-platform/safe-js 0.1.68 → 0.1.70
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-ORSTBFGI.js → chunk-BL5U2VOU.js} +2 -2
- package/dist/safe-js/chunks/{chunk-NQN7UBAH.js → chunk-CSC4EXIV.js} +12 -7
- package/dist/safe-js/chunks/chunk-CSC4EXIV.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/budget.d.ts +1 -1
- package/package.json +2 -2
- package/dist/safe-js/chunks/chunk-NQN7UBAH.js.map +0 -7
- /package/dist/safe-js/chunks/{chunk-ORSTBFGI.js.map → chunk-BL5U2VOU.js.map} +0 -0
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CSC4EXIV.js";
|
|
31
31
|
|
|
32
32
|
// packages/safe-js/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8245,4 +8245,4 @@ export {
|
|
|
8245
8245
|
parseMcpConfig,
|
|
8246
8246
|
makeMcpModule
|
|
8247
8247
|
};
|
|
8248
|
-
//# sourceMappingURL=chunk-
|
|
8248
|
+
//# sourceMappingURL=chunk-BL5U2VOU.js.map
|
|
@@ -202,9 +202,13 @@ var Budget = class {
|
|
|
202
202
|
dataSize: normalizeLimit("dataSize", options.dataSize)
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
visitNode() {
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
visitNode(units = 1) {
|
|
206
|
+
if (!Number.isSafeInteger(units) || units < 0) {
|
|
207
|
+
throw new Error("units must be a non-negative safe integer.");
|
|
208
|
+
}
|
|
209
|
+
if (units === 0) return;
|
|
210
|
+
this.stepsUsed += units;
|
|
211
|
+
this.checkSampledDeadline(units);
|
|
208
212
|
if (this.allChecksSuspended === 0 && this.limits.maxSteps !== void 0 && this.stepsUsed > this.limits.maxSteps) {
|
|
209
213
|
throw new SandboxError({
|
|
210
214
|
budget: "steps",
|
|
@@ -444,15 +448,15 @@ var Budget = class {
|
|
|
444
448
|
});
|
|
445
449
|
}
|
|
446
450
|
}
|
|
447
|
-
checkSampledDeadline() {
|
|
451
|
+
checkSampledDeadline(units) {
|
|
448
452
|
if (this.allChecksSuspended > 0 || this.deadlineChecksSuspended > 0 || this.deadline === void 0) {
|
|
449
453
|
return;
|
|
450
454
|
}
|
|
451
|
-
this.visitsUntilDeadlineCheck -=
|
|
455
|
+
this.visitsUntilDeadlineCheck -= units;
|
|
452
456
|
if (this.visitsUntilDeadlineCheck > 0) {
|
|
453
457
|
return;
|
|
454
458
|
}
|
|
455
|
-
this.visitsUntilDeadlineCheck = DEADLINE_CHECK_INTERVAL;
|
|
459
|
+
this.visitsUntilDeadlineCheck = DEADLINE_CHECK_INTERVAL - -this.visitsUntilDeadlineCheck % DEADLINE_CHECK_INTERVAL;
|
|
456
460
|
this.checkDeadline();
|
|
457
461
|
}
|
|
458
462
|
enterDepth() {
|
|
@@ -24676,6 +24680,7 @@ function callStringMethod(value, methodName, args, budget, callClosure = async (
|
|
|
24676
24680
|
];
|
|
24677
24681
|
})
|
|
24678
24682
|
);
|
|
24683
|
+
budget.visitNode(value.length + comparison.length);
|
|
24679
24684
|
return Reflect.apply(String.prototype.localeCompare, value, [
|
|
24680
24685
|
comparison,
|
|
24681
24686
|
locales,
|
|
@@ -32767,4 +32772,4 @@ export {
|
|
|
32767
32772
|
FileSnapshotBackend,
|
|
32768
32773
|
run
|
|
32769
32774
|
};
|
|
32770
|
-
//# sourceMappingURL=chunk-
|
|
32775
|
+
//# sourceMappingURL=chunk-CSC4EXIV.js.map
|