poe-code 11.0.19 → 11.0.21

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 CHANGED
@@ -141496,7 +141496,6 @@ function wrapCallerInjectedFunction(name, value, options, state) {
141496
141496
  sourceFunctions: /* @__PURE__ */ new Map(),
141497
141497
  active: /* @__PURE__ */ new Set(),
141498
141498
  seen: /* @__PURE__ */ new WeakMap(),
141499
- nextInvocation: 0,
141500
141499
  restored: []
141501
141500
  };
141502
141501
  const hostArgs = deepCopyFromSandbox([...args], {
@@ -141673,7 +141672,6 @@ function executeHostCall(record2, restored, invoke2, stackFrames, options, span,
141673
141672
  );
141674
141673
  }
141675
141674
  if (restored && record2.policy === "read-side-effect" && record2.lifecycle !== "created") {
141676
- if (callbacks !== void 0) callbacks.nextInvocation = callbacks.restored.length;
141677
141675
  const context = callbacks === void 0 ? void 0 : {
141678
141676
  callbacks: new Map(callbacks.hostFunctions),
141679
141677
  replayed: callbacks.restored.map((invocation) => ({
@@ -141686,6 +141684,7 @@ function executeHostCall(record2, restored, invoke2, stackFrames, options, span,
141686
141684
  };
141687
141685
  return createHostCallPromise(record2, hostCalls.reconcile(record2, context), hostCalls);
141688
141686
  }
141687
+ if (restored && callbacks !== void 0) callbacks.nextReissuedInvocation = 0;
141689
141688
  hostCalls.start(record2);
141690
141689
  let result;
141691
141690
  try {
@@ -141880,7 +141879,7 @@ function wrapSandboxClosureForHost(closure, stackFrames, budget, callbacks) {
141880
141879
  { seen: /* @__PURE__ */ new WeakMap() },
141881
141880
  "<callback>"
141882
141881
  );
141883
- const restored = callbacks === void 0 ? void 0 : callbacks.restored[callbacks.nextInvocation++];
141882
+ const restored = callbacks?.nextReissuedInvocation === void 0 ? void 0 : callbacks.restored[callbacks.nextReissuedInvocation++];
141884
141883
  if (restored !== void 0) {
141885
141884
  if (restored.id !== id || JSON.stringify(
141886
141885
  encodeReplayData(sandboxArgs, {
@@ -144554,6 +144553,7 @@ function callMatchLikeMethod(value, methodName, args) {
144554
144553
  if (methodName === "match") regex.lastIndex = 0;
144555
144554
  const matcher = methodName === "matchAll" ? createSandboxRegex(regex.source, regex.flags, regex.lastIndex) : regex;
144556
144555
  const matches = collectRegexMatches(matcher, value, true);
144556
+ if (methodName === "match" && matches.length === 0) return null;
144557
144557
  return methodName === "match" ? matches.map((match) => match.text) : matches.map((match) => toMatchArray(match, value));
144558
144558
  }
144559
144559
  function collectRegexMatches(regex, value, all) {
@@ -155708,7 +155708,7 @@ var init_package2 = __esm({
155708
155708
  "package.json"() {
155709
155709
  package_default2 = {
155710
155710
  name: "poe-code",
155711
- version: "11.0.19",
155711
+ version: "11.0.21",
155712
155712
  description: "CLI tool to configure Poe API for developer workflows.",
155713
155713
  license: "MIT",
155714
155714
  type: "module",