poe-code 11.0.25 → 11.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-code",
3
- "version": "11.0.25",
3
+ "version": "11.0.27",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-DXJLYASS.js";
30
+ } from "./chunk-LSVSAZHI.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-BGO2B5YI.js.map
8058
+ //# sourceMappingURL=chunk-EW4KQ32H.js.map
@@ -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);
@@ -22060,6 +22063,7 @@ function wrapCallerInjectedFunction(name, value, options, state) {
22060
22063
  entries: /* @__PURE__ */ new Map(),
22061
22064
  hostFunctions: /* @__PURE__ */ new Map(),
22062
22065
  sourceFunctions: /* @__PURE__ */ new Map(),
22066
+ proofFunctions: /* @__PURE__ */ new WeakMap(),
22063
22067
  active: /* @__PURE__ */ new Set(),
22064
22068
  seen: /* @__PURE__ */ new WeakMap(),
22065
22069
  restored: []
@@ -22238,6 +22242,7 @@ function executeHostCall(record2, restored, invoke, stackFrames, options, span,
22238
22242
  );
22239
22243
  }
22240
22244
  if (restored && record2.policy === "read-side-effect" && record2.lifecycle !== "created") {
22245
+ let active = true;
22241
22246
  const context = callbacks === void 0 ? void 0 : {
22242
22247
  callbacks: new Map(callbacks.hostFunctions),
22243
22248
  replayed: callbacks.restored.map((invocation) => ({
@@ -22246,9 +22251,23 @@ function executeHostCall(record2, restored, invoke, stackFrames, options, span,
22246
22251
  })),
22247
22252
  async waitForCallbacks() {
22248
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
+ );
22249
22265
  }
22250
22266
  };
22251
- return createHostCallPromise(record2, hostCalls.reconcile(record2, context), hostCalls);
22267
+ const outcome2 = hostCalls.reconcile(record2, context).finally(() => {
22268
+ active = false;
22269
+ });
22270
+ return createHostCallPromise(record2, outcome2, hostCalls);
22252
22271
  }
22253
22272
  if (restored && callbacks !== void 0) callbacks.nextReissuedInvocation = 0;
22254
22273
  hostCalls.start(record2);
@@ -22488,6 +22507,7 @@ function wrapSandboxClosureForHost(closure, stackFrames, budget, callbacks) {
22488
22507
  callbacks?.entries.set(id, invoke);
22489
22508
  callbacks?.hostFunctions.set(id, wrapped);
22490
22509
  callbacks?.sourceFunctions.set(id, closure);
22510
+ callbacks?.proofFunctions.set(wrapped, closure);
22491
22511
  if (callbacks?.record !== void 0)
22492
22512
  callbacks.journal?.registerCallbackFunction(callbacks.record, id, closure, wrapped);
22493
22513
  return wrapped;
@@ -22566,9 +22586,17 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22566
22586
  throw new TypeError("Host error data must not contain functions or promises.");
22567
22587
  }
22568
22588
  if (isSandboxClosure(value) || isSandboxPromise(value)) {
22589
+ if (options.proofFunctions !== void 0)
22590
+ throw new TypeError(`Unsupported proof value at ${path}: sandbox capability`);
22569
22591
  return deepCopyToSandbox(value);
22570
22592
  }
22571
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
+ }
22572
22600
  const sourceClosure = options.hostCalls?.nativeClosures.get(value);
22573
22601
  if (sourceClosure !== void 0) return sourceClosure;
22574
22602
  const callable = value;
@@ -22587,6 +22615,10 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22587
22615
  );
22588
22616
  }
22589
22617
  if (!options.errorData && isPromiseLike3(value)) {
22618
+ if (options.proofFunctions !== void 0)
22619
+ throw new TypeError(`Unsupported proof value at ${path}: promise`);
22620
+ const existing = state.seen.get(value);
22621
+ if (existing !== void 0) return existing;
22590
22622
  const promise = wrapHostPromiseWithSignal(Promise.resolve(value), options.signal).then(
22591
22623
  (resolved) => {
22592
22624
  try {
@@ -22614,6 +22646,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22614
22646
  }
22615
22647
  );
22616
22648
  const sandboxPromise = createSandboxPromise(promise);
22649
+ state.seen.set(value, sandboxPromise);
22617
22650
  const span = getBoundOtelSpan(value);
22618
22651
  if (span !== void 0) {
22619
22652
  bindOtelSpan(promise, span);
@@ -29193,4 +29226,4 @@ export {
29193
29226
  FileSnapshotBackend,
29194
29227
  run
29195
29228
  };
29196
- //# sourceMappingURL=chunk-DXJLYASS.js.map
29229
+ //# sourceMappingURL=chunk-LSVSAZHI.js.map