poe-code 12.0.8 → 12.0.10

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": "12.0.8",
3
+ "version": "12.0.10",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17746,6 +17746,9 @@ function registerPendingHostCallPolicy(registration) {
17746
17746
  MODULE_PENDING_HOST_CALL_POLICIES[moduleId] ??= /* @__PURE__ */ Object.create(null);
17747
17747
  MODULE_PENDING_HOST_CALL_POLICIES[moduleId][operation] = policy;
17748
17748
  }
17749
+ function readRegisteredPendingHostCallPolicy(moduleId, operation) {
17750
+ return MODULE_PENDING_HOST_CALL_POLICIES[moduleId]?.[operation];
17751
+ }
17749
17752
  function pendingHostCallResumeIdentityMatches(expected, actual) {
17750
17753
  return actual.callId === expected.callId && actual.sourceHash === expected.sourceHash && actual.moduleId === expected.moduleId && actual.operation === expected.operation && actual.argumentDigest === expected.argumentDigest;
17751
17754
  }
@@ -18288,6 +18291,9 @@ function isCapturedException(value) {
18288
18291
  return typeof value === "object" && value !== null && capturedExceptionBrand in value;
18289
18292
  }
18290
18293
  function coerceThrownValue(reason, budget, stackFrames, span, sandbox = false) {
18294
+ if (reason instanceof HostCallResumabilityError) {
18295
+ throw reason;
18296
+ }
18291
18297
  if (isSubsetErrorValue(reason)) {
18292
18298
  attachErrorSpan(reason, readErrorSpan(reason) ?? span);
18293
18299
  return reason;
@@ -20776,9 +20782,13 @@ function own(value, key) {
20776
20782
 
20777
20783
  // packages/safe-js/src/interp/host-call.ts
20778
20784
  var HostCallResumabilityError = class extends Error {
20785
+ #nativeInstance = true;
20779
20786
  action;
20780
20787
  callId;
20781
20788
  lifecycle;
20789
+ static [Symbol.hasInstance](value) {
20790
+ return typeof value === "object" && value !== null && #nativeInstance in value && Function.prototype[Symbol.hasInstance].call(this, value);
20791
+ }
20782
20792
  constructor(record2, action, message) {
20783
20793
  super(message);
20784
20794
  this.name = "HostCallResumabilityError";
@@ -22309,10 +22319,10 @@ function wrapCallerInjectedFunction(name, value, options, state) {
22309
22319
  const hostArgs = deepCopyFromSandbox([...args], {
22310
22320
  wrapClosure: (closure) => wrapSandboxClosureForHost(closure, stackFrames, options.budget, callbacks)
22311
22321
  });
22312
- const policy = readHostOperationPolicy(value) ?? "re-issue";
22313
22322
  const hostCalls = options.hostCalls;
22314
22323
  const operation = options.operation ?? bindingName;
22315
22324
  const moduleId = options.moduleId ?? "<bindings>";
22325
+ const policy = readHostOperationPolicy(value) ?? readRegisteredPendingHostCallPolicy(moduleId, operation) ?? "re-issue";
22316
22326
  if (hostCalls === void 0) {
22317
22327
  return copyHostResultToSandbox(
22318
22328
  invokeHostCallback(() => Reflect.apply(callable, void 0, hostArgs), options),
@@ -22513,6 +22523,9 @@ function executeHostCall(record2, restored, invoke, stackFrames, options, span,
22513
22523
  try {
22514
22524
  result = invoke();
22515
22525
  } catch (error) {
22526
+ if (error instanceof HostCallResumabilityError) {
22527
+ throw error;
22528
+ }
22516
22529
  const reason = createHostErrorValue(error, stackFrames, options.budget, span);
22517
22530
  hostCalls.settle(record2, { status: "rejected", reason });
22518
22531
  throw error;
@@ -29748,4 +29761,4 @@ export {
29748
29761
  FileSnapshotBackend,
29749
29762
  run
29750
29763
  };
29751
- //# sourceMappingURL=chunk-JGTN4U7F.js.map
29764
+ //# sourceMappingURL=chunk-5TMXWUAL.js.map