poe-code 11.0.24 → 11.0.26
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 +43 -21
- package/dist/index.js.map +2 -2
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-CGS4H4L3.js → chunk-4TA6S7L6.js} +43 -21
- package/packages/safejs/dist/chunks/{chunk-CGS4H4L3.js.map → chunk-4TA6S7L6.js.map} +2 -2
- package/packages/safejs/dist/chunks/{chunk-I5FH3SKL.js → chunk-YVBVZ7MR.js} +2 -2
- 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-bridge.js +4 -0
- package/packages/safejs/dist/interp/values.js +4 -0
- package/packages/safejs/dist/restore.js +1 -0
- package/packages/safejs/dist/run.js +14 -8
- package/packages/safejs/dist/snapshot/dump-format.d.ts +1 -1
- package/packages/safejs/dist/snapshot/dump-format.js +1 -1
- package/packages/safejs/dist/snapshot/migration.js +2 -2
- /package/packages/safejs/dist/chunks/{chunk-I5FH3SKL.js.map → chunk-YVBVZ7MR.js.map} +0 -0
package/package.json
CHANGED
|
@@ -16961,7 +16961,7 @@ function serializeArray(value, serializeValue) {
|
|
|
16961
16961
|
|
|
16962
16962
|
// packages/safejs/src/snapshot/dump-format.ts
|
|
16963
16963
|
var DUMP_FORMAT_VERSION = 1;
|
|
16964
|
-
var EXECUTION_SEMANTICS = "jobs-
|
|
16964
|
+
var EXECUTION_SEMANTICS = "jobs-v7";
|
|
16965
16965
|
var SKIP_VALUE = /* @__PURE__ */ Symbol("SafeJS.skip-dump-value");
|
|
16966
16966
|
function serializeSafeJSSnapshot(snapshot) {
|
|
16967
16967
|
const replayError = Object.getOwnPropertyDescriptor(snapshot, "replayError");
|
|
@@ -19953,11 +19953,14 @@ function copyToSandbox(value, state, path = "<root>", cloneSandboxCollections =
|
|
|
19953
19953
|
return copy;
|
|
19954
19954
|
}
|
|
19955
19955
|
if (isHostPromise(value)) {
|
|
19956
|
+
const existing = state.seen.get(value);
|
|
19957
|
+
if (existing !== void 0) return existing;
|
|
19956
19958
|
const promise = Promise.resolve(value).then(
|
|
19957
19959
|
(resolved) => copyToSandbox(resolved, { seen: /* @__PURE__ */ new WeakMap() }),
|
|
19958
19960
|
(reason) => Promise.reject(copyToSandbox(reason, { seen: /* @__PURE__ */ new WeakMap() }))
|
|
19959
19961
|
);
|
|
19960
19962
|
const sandboxPromise = createSandboxPromise(promise);
|
|
19963
|
+
state.seen.set(value, sandboxPromise);
|
|
19961
19964
|
const span = getBoundOtelSpan(value);
|
|
19962
19965
|
if (span !== void 0) {
|
|
19963
19966
|
bindOtelSpan(promise, span);
|
|
@@ -21309,9 +21312,11 @@ function shouldIncludeTemplateRaw(record2, key, includeTemplateRaw) {
|
|
|
21309
21312
|
|
|
21310
21313
|
// packages/safejs/src/snapshot/migration.ts
|
|
21311
21314
|
function validateMigrationSemantics(value) {
|
|
21312
|
-
if (!["jobs-v1", "jobs-v2", "jobs-v3", "jobs-v4", "jobs-v5", "jobs-v6"].includes(
|
|
21315
|
+
if (!["jobs-v1", "jobs-v2", "jobs-v3", "jobs-v4", "jobs-v5", "jobs-v6", "jobs-v7"].includes(
|
|
21316
|
+
value
|
|
21317
|
+
))
|
|
21313
21318
|
throw new TypeError(
|
|
21314
|
-
"Migration requires a supported execution-semantics marker (jobs-v1 through jobs-
|
|
21319
|
+
"Migration requires a supported execution-semantics marker (jobs-v1 through jobs-v7)."
|
|
21315
21320
|
);
|
|
21316
21321
|
}
|
|
21317
21322
|
function validateMigrationJournal(sourceHash, replay, hostCalls = []) {
|
|
@@ -21408,7 +21413,7 @@ function restore(snapshot, options) {
|
|
|
21408
21413
|
assertSnapshotInactive(snapshot);
|
|
21409
21414
|
validateDumpEnvelope(snapshot);
|
|
21410
21415
|
validateSnapshotMigration(snapshot.migration, snapshot.sourceHash);
|
|
21411
|
-
if (snapshot.executionSemantics !== EXECUTION_SEMANTICS && (snapshot.executionSemantics !== void 0 || snapshot.promiseReplay !== void 0 || snapshot.replay !== void 0 || snapshot.initialInputs !== void 0)) {
|
|
21416
|
+
if (snapshot.executionSemantics !== EXECUTION_SEMANTICS && snapshot.executionSemantics !== "jobs-v6" && (snapshot.executionSemantics !== void 0 || snapshot.promiseReplay !== void 0 || snapshot.replay !== void 0 || snapshot.initialInputs !== void 0)) {
|
|
21412
21417
|
throw new SnapshotValidationError(
|
|
21413
21418
|
"unsupportedVersion",
|
|
21414
21419
|
"$.executionSemantics",
|
|
@@ -22585,6 +22590,8 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
22585
22590
|
);
|
|
22586
22591
|
}
|
|
22587
22592
|
if (!options.errorData && isPromiseLike3(value)) {
|
|
22593
|
+
const existing = state.seen.get(value);
|
|
22594
|
+
if (existing !== void 0) return existing;
|
|
22588
22595
|
const promise = wrapHostPromiseWithSignal(Promise.resolve(value), options.signal).then(
|
|
22589
22596
|
(resolved) => {
|
|
22590
22597
|
try {
|
|
@@ -22612,6 +22619,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
22612
22619
|
}
|
|
22613
22620
|
);
|
|
22614
22621
|
const sandboxPromise = createSandboxPromise(promise);
|
|
22622
|
+
state.seen.set(value, sandboxPromise);
|
|
22615
22623
|
const span = getBoundOtelSpan(value);
|
|
22616
22624
|
if (span !== void 0) {
|
|
22617
22625
|
bindOtelSpan(promise, span);
|
|
@@ -28651,6 +28659,8 @@ function run(source, options = {}) {
|
|
|
28651
28659
|
options.signal?.addEventListener("abort", captureCancellationSnapshot, { once: true });
|
|
28652
28660
|
try {
|
|
28653
28661
|
const restoredSnapshot = options.snapshot === void 0 ? void 0 : restore(options.snapshot, { source });
|
|
28662
|
+
const executionSemantics = restoredSnapshot?.executionSemantics === "jobs-v6" ? "jobs-v6" : EXECUTION_SEMANTICS;
|
|
28663
|
+
const convertInitialInput = (convert) => executionSemantics === "jobs-v6" ? convert() : promiseReplayContext.exit(convert);
|
|
28654
28664
|
if (restoredSnapshot !== void 0) {
|
|
28655
28665
|
leaveSnapshotRun = enterSnapshotRun(restoredSnapshot);
|
|
28656
28666
|
}
|
|
@@ -28676,13 +28686,15 @@ function run(source, options = {}) {
|
|
|
28676
28686
|
...restoredSnapshot,
|
|
28677
28687
|
resumeNodeId: restoredSnapshot.pendingAwaits?.[0]?.nodeId
|
|
28678
28688
|
} : void 0;
|
|
28679
|
-
const callerBindings =
|
|
28680
|
-
|
|
28681
|
-
|
|
28682
|
-
|
|
28683
|
-
|
|
28684
|
-
|
|
28685
|
-
|
|
28689
|
+
const callerBindings = convertInitialInput(
|
|
28690
|
+
() => options.bindings === void 0 ? {} : wrapCallerInjectedBindings(options.bindings, {
|
|
28691
|
+
budget,
|
|
28692
|
+
hostCalls,
|
|
28693
|
+
moduleId: "<bindings>",
|
|
28694
|
+
signal: options.signal,
|
|
28695
|
+
lifecycle
|
|
28696
|
+
})
|
|
28697
|
+
);
|
|
28686
28698
|
const builtinBindings = {
|
|
28687
28699
|
...createConsoleJsonGlobals({
|
|
28688
28700
|
budget,
|
|
@@ -28707,7 +28719,9 @@ function run(source, options = {}) {
|
|
|
28707
28719
|
}),
|
|
28708
28720
|
...createRegexGlobals()
|
|
28709
28721
|
};
|
|
28710
|
-
const importMeta =
|
|
28722
|
+
const importMeta = convertInitialInput(
|
|
28723
|
+
() => deepCopyToSandbox(options.importMeta ?? {})
|
|
28724
|
+
);
|
|
28711
28725
|
if (restoredSnapshot?.migration !== void 0) {
|
|
28712
28726
|
if (Object.hasOwn(importMeta, "migration"))
|
|
28713
28727
|
throw new TypeError("import.meta.migration is reserved for migrated checkpoint state.");
|
|
@@ -28721,13 +28735,17 @@ function run(source, options = {}) {
|
|
|
28721
28735
|
const initialInputs = prepareReplayInputs(
|
|
28722
28736
|
{
|
|
28723
28737
|
bindings: callerBindings,
|
|
28724
|
-
imports:
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
|
|
28730
|
-
|
|
28738
|
+
imports: convertInitialInput(
|
|
28739
|
+
() => resolveModuleImports(module, options.modules, {
|
|
28740
|
+
budget,
|
|
28741
|
+
hostCalls,
|
|
28742
|
+
signal: options.signal,
|
|
28743
|
+
allowMissing: restoredSnapshot?.initialInputs !== void 0
|
|
28744
|
+
})
|
|
28745
|
+
),
|
|
28746
|
+
entryPointArgs: convertInitialInput(
|
|
28747
|
+
() => options.entryPointArgs === void 0 ? void 0 : deepCopyToSandbox([...options.entryPointArgs])
|
|
28748
|
+
),
|
|
28731
28749
|
importMeta
|
|
28732
28750
|
},
|
|
28733
28751
|
restoredSnapshot?.initialInputs,
|
|
@@ -28793,6 +28811,7 @@ function run(source, options = {}) {
|
|
|
28793
28811
|
});
|
|
28794
28812
|
snapshotScheduler = activeSnapshotScheduler;
|
|
28795
28813
|
createFailureSnapshot = () => createRunSnapshot({
|
|
28814
|
+
executionSemantics,
|
|
28796
28815
|
migration: restoredSnapshot?.migration,
|
|
28797
28816
|
bindings: executionScope.snapshot().bindings,
|
|
28798
28817
|
clock: options.clock,
|
|
@@ -28819,6 +28838,7 @@ function run(source, options = {}) {
|
|
|
28819
28838
|
}
|
|
28820
28839
|
const interpreterSnapshot2 = yieldPoint.snapshot();
|
|
28821
28840
|
snapshot2 = createRunSnapshot({
|
|
28841
|
+
executionSemantics,
|
|
28822
28842
|
migration: restoredSnapshot?.migration,
|
|
28823
28843
|
bindings: interpreterSnapshot2.bindings,
|
|
28824
28844
|
clock: options.clock,
|
|
@@ -28861,6 +28881,7 @@ function run(source, options = {}) {
|
|
|
28861
28881
|
}
|
|
28862
28882
|
const interpreterSnapshot2 = yieldPoint.snapshot();
|
|
28863
28883
|
snapshot2 = createRunSnapshot({
|
|
28884
|
+
executionSemantics,
|
|
28864
28885
|
migration: restoredSnapshot?.migration,
|
|
28865
28886
|
bindings: interpreterSnapshot2.bindings,
|
|
28866
28887
|
clock: options.clock,
|
|
@@ -28895,6 +28916,7 @@ function run(source, options = {}) {
|
|
|
28895
28916
|
replayError = error.message;
|
|
28896
28917
|
}
|
|
28897
28918
|
const snapshot = createRunSnapshot({
|
|
28919
|
+
executionSemantics,
|
|
28898
28920
|
migration: restoredSnapshot?.migration,
|
|
28899
28921
|
bindings: executionScope.snapshot().bindings,
|
|
28900
28922
|
clock: options.clock,
|
|
@@ -29064,7 +29086,7 @@ function createExecutableNode(module) {
|
|
|
29064
29086
|
function createRunSnapshot(input) {
|
|
29065
29087
|
return {
|
|
29066
29088
|
version: DUMP_FORMAT_VERSION,
|
|
29067
|
-
executionSemantics:
|
|
29089
|
+
executionSemantics: input.executionSemantics,
|
|
29068
29090
|
sourceHash: input.sourceHash,
|
|
29069
29091
|
...input.migration === void 0 ? {} : { migration: structuredClone(input.migration) },
|
|
29070
29092
|
bindings: input.bindings,
|
|
@@ -29177,4 +29199,4 @@ export {
|
|
|
29177
29199
|
FileSnapshotBackend,
|
|
29178
29200
|
run
|
|
29179
29201
|
};
|
|
29180
|
-
//# sourceMappingURL=chunk-
|
|
29202
|
+
//# sourceMappingURL=chunk-4TA6S7L6.js.map
|