poe-code 11.0.20 → 11.0.22

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, {
@@ -144515,7 +144514,8 @@ function callSplit(value, args, budget) {
144515
144514
  let endedWithZeroWidthMatch = false;
144516
144515
  for (const match of collectRegexMatches(splitter, value, true)) {
144517
144516
  endedWithZeroWidthMatch = match.text.length === 0 && match.index === value.length;
144518
- if (match.text.length === 0 && match.index === 0) continue;
144517
+ if (match.text.length === 0 && (match.index === copiedThrough || match.index === value.length))
144518
+ continue;
144519
144519
  if (result2.length >= limit2) break;
144520
144520
  result2.push(budget.allocateString(value.slice(copiedThrough, match.index)));
144521
144521
  for (const capture of match.captures) {
@@ -144524,7 +144524,7 @@ function callSplit(value, args, budget) {
144524
144524
  }
144525
144525
  copiedThrough = match.index + match.text.length;
144526
144526
  }
144527
- if (result2.length < limit2 && !endedWithZeroWidthMatch)
144527
+ if (result2.length < limit2 && (value.length > 0 || !endedWithZeroWidthMatch))
144528
144528
  result2.push(budget.allocateString(value.slice(copiedThrough)));
144529
144529
  budget.allocateArrayLength(result2.length);
144530
144530
  return result2;
@@ -155709,7 +155709,7 @@ var init_package2 = __esm({
155709
155709
  "package.json"() {
155710
155710
  package_default2 = {
155711
155711
  name: "poe-code",
155712
- version: "11.0.20",
155712
+ version: "11.0.22",
155713
155713
  description: "CLI tool to configure Poe API for developer workflows.",
155714
155714
  license: "MIT",
155715
155715
  type: "module",