poe-code 11.0.26 → 11.0.28
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 +30 -3
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/package.json +1 -1
- package/packages/safejs/dist/chunks/{chunk-YVBVZ7MR.js → chunk-3OFXSTL2.js} +2 -2
- package/packages/safejs/dist/chunks/{chunk-4TA6S7L6.js → chunk-FAAW5HF7.js} +30 -3
- package/packages/safejs/dist/chunks/{chunk-4TA6S7L6.js.map → chunk-FAAW5HF7.js.map} +3 -3
- 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.d.ts +2 -1
- package/packages/safejs/dist/interp/host-bridge.js +24 -1
- package/packages/safejs/dist/interp/host-call.d.ts +1 -0
- package/packages/safejs/dist/interp/host-call.js +3 -3
- /package/packages/safejs/dist/chunks/{chunk-YVBVZ7MR.js.map → chunk-3OFXSTL2.js.map} +0 -0
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
validateMigrationSemantics,
|
|
28
28
|
validateSnapshotData,
|
|
29
29
|
validateSnapshotMigration
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-FAAW5HF7.js";
|
|
31
31
|
|
|
32
32
|
// packages/safejs/src/migrate.ts
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
@@ -8055,4 +8055,4 @@ export {
|
|
|
8055
8055
|
parseMcpConfig,
|
|
8056
8056
|
makeMcpModule
|
|
8057
8057
|
};
|
|
8058
|
-
//# sourceMappingURL=chunk-
|
|
8058
|
+
//# sourceMappingURL=chunk-3OFXSTL2.js.map
|
|
@@ -20946,7 +20946,7 @@ var HostCallJournal = class {
|
|
|
20946
20946
|
}
|
|
20947
20947
|
};
|
|
20948
20948
|
function copyOutcome(outcome) {
|
|
20949
|
-
return outcome.status === "fulfilled" ? { status: "fulfilled", value:
|
|
20949
|
+
return outcome.status === "fulfilled" ? { status: "fulfilled", value: cloneSandboxValue(outcome.value) } : { status: "rejected", reason: cloneSandboxValue(outcome.reason) };
|
|
20950
20950
|
}
|
|
20951
20951
|
function restoreReplayCalls(input, encodedOutcomes, callbackSizes, requiredHostCapabilities = /* @__PURE__ */ new Set()) {
|
|
20952
20952
|
validateSnapshotData(input);
|
|
@@ -22063,6 +22063,7 @@ function wrapCallerInjectedFunction(name, value, options, state) {
|
|
|
22063
22063
|
entries: /* @__PURE__ */ new Map(),
|
|
22064
22064
|
hostFunctions: /* @__PURE__ */ new Map(),
|
|
22065
22065
|
sourceFunctions: /* @__PURE__ */ new Map(),
|
|
22066
|
+
proofFunctions: /* @__PURE__ */ new WeakMap(),
|
|
22066
22067
|
active: /* @__PURE__ */ new Set(),
|
|
22067
22068
|
seen: /* @__PURE__ */ new WeakMap(),
|
|
22068
22069
|
restored: []
|
|
@@ -22241,6 +22242,7 @@ function executeHostCall(record2, restored, invoke, stackFrames, options, span,
|
|
|
22241
22242
|
);
|
|
22242
22243
|
}
|
|
22243
22244
|
if (restored && record2.policy === "read-side-effect" && record2.lifecycle !== "created") {
|
|
22245
|
+
let active = true;
|
|
22244
22246
|
const context = callbacks === void 0 ? void 0 : {
|
|
22245
22247
|
callbacks: new Map(callbacks.hostFunctions),
|
|
22246
22248
|
replayed: callbacks.restored.map((invocation) => ({
|
|
@@ -22249,9 +22251,23 @@ function executeHostCall(record2, restored, invoke, stackFrames, options, span,
|
|
|
22249
22251
|
})),
|
|
22250
22252
|
async waitForCallbacks() {
|
|
22251
22253
|
while (callbacks.active.size > 0) await Promise.allSettled([...callbacks.active]);
|
|
22254
|
+
},
|
|
22255
|
+
toSandboxValue(value) {
|
|
22256
|
+
if (!active) throw new TypeError("Host call resume context is no longer active.");
|
|
22257
|
+
if (options.signal?.aborted) throw readAbortReason2(options.signal);
|
|
22258
|
+
return copyHostValueToSandbox(
|
|
22259
|
+
value,
|
|
22260
|
+
stackFrames,
|
|
22261
|
+
{ ...options, proofFunctions: callbacks.proofFunctions },
|
|
22262
|
+
{ seen: /* @__PURE__ */ new WeakMap() },
|
|
22263
|
+
"<root>"
|
|
22264
|
+
);
|
|
22252
22265
|
}
|
|
22253
22266
|
};
|
|
22254
|
-
|
|
22267
|
+
const outcome2 = hostCalls.reconcile(record2, context).finally(() => {
|
|
22268
|
+
active = false;
|
|
22269
|
+
});
|
|
22270
|
+
return createHostCallPromise(record2, outcome2, hostCalls);
|
|
22255
22271
|
}
|
|
22256
22272
|
if (restored && callbacks !== void 0) callbacks.nextReissuedInvocation = 0;
|
|
22257
22273
|
hostCalls.start(record2);
|
|
@@ -22491,6 +22507,7 @@ function wrapSandboxClosureForHost(closure, stackFrames, budget, callbacks) {
|
|
|
22491
22507
|
callbacks?.entries.set(id, invoke);
|
|
22492
22508
|
callbacks?.hostFunctions.set(id, wrapped);
|
|
22493
22509
|
callbacks?.sourceFunctions.set(id, closure);
|
|
22510
|
+
callbacks?.proofFunctions.set(wrapped, closure);
|
|
22494
22511
|
if (callbacks?.record !== void 0)
|
|
22495
22512
|
callbacks.journal?.registerCallbackFunction(callbacks.record, id, closure, wrapped);
|
|
22496
22513
|
return wrapped;
|
|
@@ -22569,9 +22586,17 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
22569
22586
|
throw new TypeError("Host error data must not contain functions or promises.");
|
|
22570
22587
|
}
|
|
22571
22588
|
if (isSandboxClosure(value) || isSandboxPromise(value)) {
|
|
22589
|
+
if (options.proofFunctions !== void 0)
|
|
22590
|
+
throw new TypeError(`Unsupported proof value at ${path}: sandbox capability`);
|
|
22572
22591
|
return deepCopyToSandbox(value);
|
|
22573
22592
|
}
|
|
22574
22593
|
if (typeof value === "function") {
|
|
22594
|
+
if (options.proofFunctions !== void 0) {
|
|
22595
|
+
const sourceClosure2 = options.proofFunctions.get(value);
|
|
22596
|
+
if (sourceClosure2 === void 0)
|
|
22597
|
+
throw new TypeError(`Unsupported proof value at ${path}: function`);
|
|
22598
|
+
return sourceClosure2;
|
|
22599
|
+
}
|
|
22575
22600
|
const sourceClosure = options.hostCalls?.nativeClosures.get(value);
|
|
22576
22601
|
if (sourceClosure !== void 0) return sourceClosure;
|
|
22577
22602
|
const callable = value;
|
|
@@ -22590,6 +22615,8 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
|
|
|
22590
22615
|
);
|
|
22591
22616
|
}
|
|
22592
22617
|
if (!options.errorData && isPromiseLike3(value)) {
|
|
22618
|
+
if (options.proofFunctions !== void 0)
|
|
22619
|
+
throw new TypeError(`Unsupported proof value at ${path}: promise`);
|
|
22593
22620
|
const existing = state.seen.get(value);
|
|
22594
22621
|
if (existing !== void 0) return existing;
|
|
22595
22622
|
const promise = wrapHostPromiseWithSignal(Promise.resolve(value), options.signal).then(
|
|
@@ -29199,4 +29226,4 @@ export {
|
|
|
29199
29226
|
FileSnapshotBackend,
|
|
29200
29227
|
run
|
|
29201
29228
|
};
|
|
29202
|
-
//# sourceMappingURL=chunk-
|
|
29229
|
+
//# sourceMappingURL=chunk-FAAW5HF7.js.map
|