poe-code 12.0.8 → 12.0.9

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-JGTN4U7F.js";
30
+ } from "./chunk-4D75HUZZ.js";
31
31
  import {
32
32
  createFileSystem,
33
33
  createNodeFileSystemAdapterRegistry,
@@ -8183,4 +8183,4 @@ export {
8183
8183
  parseMcpConfig,
8184
8184
  makeMcpModule
8185
8185
  };
8186
- //# sourceMappingURL=chunk-PY5NKSTP.js.map
8186
+ //# sourceMappingURL=chunk-ETVJF5BE.js.map
@@ -22,7 +22,7 @@ import {
22
22
  resolveFsConfig,
23
23
  splitFrontmatter,
24
24
  withBrokenPipeGuard
25
- } from "./chunks/chunk-PY5NKSTP.js";
25
+ } from "./chunks/chunk-ETVJF5BE.js";
26
26
  import {
27
27
  Budget,
28
28
  SandboxError,
@@ -34,7 +34,7 @@ import {
34
34
  replaceErrorStack,
35
35
  restore,
36
36
  run
37
- } from "./chunks/chunk-JGTN4U7F.js";
37
+ } from "./chunks/chunk-4D75HUZZ.js";
38
38
  import "./chunks/chunk-F7NY24BF.js";
39
39
  import "./chunks/chunk-YBQUQPZV.js";
40
40
  import "./chunks/chunk-4YIDX44G.js";
@@ -3,7 +3,7 @@ import {
3
3
  createReplayableRandom,
4
4
  lint,
5
5
  run
6
- } from "./chunks/chunk-JGTN4U7F.js";
6
+ } from "./chunks/chunk-4D75HUZZ.js";
7
7
  import "./chunks/chunk-4YIDX44G.js";
8
8
  export {
9
9
  Budget,
@@ -29,7 +29,7 @@ import {
29
29
  runWithSpawnUsageAccumulator,
30
30
  splitFrontmatter,
31
31
  supportsSpawnMode
32
- } from "./chunks/chunk-PY5NKSTP.js";
32
+ } from "./chunks/chunk-ETVJF5BE.js";
33
33
  import {
34
34
  Budget,
35
35
  FileSnapshotBackend,
@@ -51,7 +51,7 @@ import {
51
51
  registerPendingHostCallPolicy,
52
52
  restore,
53
53
  run
54
- } from "./chunks/chunk-JGTN4U7F.js";
54
+ } from "./chunks/chunk-4D75HUZZ.js";
55
55
  import "./chunks/chunk-F7NY24BF.js";
56
56
  import "./chunks/chunk-YBQUQPZV.js";
57
57
  import "./chunks/chunk-4YIDX44G.js";
@@ -1,5 +1,5 @@
1
1
  import { type Budget } from "./budget.js";
2
- import type { PendingHostCallPolicyMode } from "../snapshot/policy.js";
2
+ import { type PendingHostCallPolicyMode } from "../snapshot/policy.js";
3
3
  import { type HostCallJournal, type HostCallOutcome } from "./host-call.js";
4
4
  import { type SandboxClosure, type SandboxValue } from "./values.js";
5
5
  import type { RunLifecycle } from "../snapshot/dump.js";
@@ -4,6 +4,7 @@ import { SandboxError } from "./budget.js";
4
4
  import { checkFloat32Allocation, copyFloat32Storage, float32DataProperties, float32Storage, isFloat32Array } from "./float32.js";
5
5
  import { createSubsetErrorValue } from "./exceptions.js";
6
6
  import { bindOtelSpan, getBoundOtelSpan } from "../observability/otel.js";
7
+ import { readRegisteredPendingHostCallPolicy } from "../snapshot/policy.js";
7
8
  import { digestHostCallArguments, HostCallResumabilityError, UnresolvedReplayCapabilityError } from "./host-call.js";
8
9
  import { createSandboxClosure, createSandboxMap, createSandboxPromise, createSandboxSet, deepCopyFromSandbox, deepCopyToSandbox, defineOwnDataProperty, isArrayIndexKey, isSandboxClosure, isSandboxPromise, measureSandboxData } from "./values.js";
9
10
  import { enterRunningState } from "./running-state.js";
@@ -68,10 +69,12 @@ function wrapCallerInjectedFunction(name, value, options, state) {
68
69
  const hostArgs = deepCopyFromSandbox([...args], {
69
70
  wrapClosure: (closure) => wrapSandboxClosureForHost(closure, stackFrames, options.budget, callbacks)
70
71
  });
71
- const policy = readHostOperationPolicy(value) ?? "re-issue";
72
72
  const hostCalls = options.hostCalls;
73
73
  const operation = options.operation ?? bindingName;
74
74
  const moduleId = options.moduleId ?? "<bindings>";
75
+ const policy = readHostOperationPolicy(value) ??
76
+ readRegisteredPendingHostCallPolicy(moduleId, operation) ??
77
+ "re-issue";
75
78
  if (hostCalls === undefined) {
76
79
  return copyHostResultToSandbox(invokeHostCallback(() => Reflect.apply(callable, undefined, hostArgs), options), stackFrames, options);
77
80
  }
@@ -36,6 +36,7 @@ export declare class HostOperationResumePolicyError extends Error {
36
36
  constructor(moduleId: string, operation: string);
37
37
  }
38
38
  export declare function registerPendingHostCallPolicy(registration: PendingHostCallPolicyRegistration): void;
39
+ export declare function readRegisteredPendingHostCallPolicy(moduleId: string, operation: string): PendingHostCallPolicyMode | undefined;
39
40
  export declare function resolvePendingHostCallIssuePolicy(call: PendingHostCallDescriptor): PendingHostCallIssuePolicy;
40
41
  export declare function tagPendingHostCallAtIssue<TCall extends PendingHostCallDescriptor>(call: TCall): TCall & {
41
42
  sideEffectTag?: PendingHostCallSideEffectTag;
@@ -31,6 +31,9 @@ export function registerPendingHostCallPolicy(registration) {
31
31
  MODULE_PENDING_HOST_CALL_POLICIES[moduleId] ??= Object.create(null);
32
32
  MODULE_PENDING_HOST_CALL_POLICIES[moduleId][operation] = policy;
33
33
  }
34
+ export function readRegisteredPendingHostCallPolicy(moduleId, operation) {
35
+ return MODULE_PENDING_HOST_CALL_POLICIES[moduleId]?.[operation];
36
+ }
34
37
  export function resolvePendingHostCallIssuePolicy(call) {
35
38
  const mode = readPendingHostCallPolicyMode(call);
36
39
  if (mode === "re-issue") {
@@ -96,7 +99,7 @@ function readPendingHostCallPolicyMode(call) {
96
99
  operation.length === 0) {
97
100
  return DEFAULT_PENDING_HOST_CALL_POLICY;
98
101
  }
99
- const policy = MODULE_PENDING_HOST_CALL_POLICIES[moduleId]?.[operation];
102
+ const policy = readRegisteredPendingHostCallPolicy(moduleId, operation);
100
103
  if (policy === undefined) {
101
104
  throw new HostOperationResumePolicyError(moduleId, operation);
102
105
  }