poe-code 10.0.2 → 10.0.3

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": "10.0.2",
3
+ "version": "10.0.3",
4
4
  "description": "CLI tool to configure Poe API for developer workflows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28308,6 +28308,7 @@ function run(source, options = {}) {
28308
28308
  const lifecycle = { hostCallbackDepth: 0 };
28309
28309
  const dumpController = createDumpController(lifecycle);
28310
28310
  const promiseTracker = createSandboxPromiseRejectionTracker();
28311
+ let completedSnapshot;
28311
28312
  const execute = async () => {
28312
28313
  const promiseReplay = new PromiseReplay(options.snapshot?.promiseReplay);
28313
28314
  return promiseReplayContext.run(promiseReplay, async () => {
@@ -28570,6 +28571,7 @@ function run(source, options = {}) {
28570
28571
  });
28571
28572
  if (replayError !== void 0) snapshot.replayError = replayError;
28572
28573
  dumpController.finalize(snapshot);
28574
+ completedSnapshot = snapshot;
28573
28575
  return {
28574
28576
  ...result2,
28575
28577
  snapshot
@@ -28606,7 +28608,17 @@ function run(source, options = {}) {
28606
28608
  const result = withRunResources(
28607
28609
  options.signal,
28608
28610
  () => withSandboxPromiseRejectionTracker(promiseTracker, execute)
28609
- );
28611
+ ).catch(async (error) => {
28612
+ if (completedSnapshot !== void 0) {
28613
+ try {
28614
+ await createSnapshotScheduler(options).write(completedSnapshot);
28615
+ } catch (snapshotError) {
28616
+ console.warn("Failed to write failure snapshot.", snapshotError);
28617
+ }
28618
+ }
28619
+ dumpController.fail(error);
28620
+ throw error;
28621
+ });
28610
28622
  return attachDumpController(result, dumpController);
28611
28623
  }
28612
28624
  async function throwIfReturnedPromiseRejected(result) {
@@ -28815,4 +28827,4 @@ export {
28815
28827
  FileSnapshotBackend,
28816
28828
  run
28817
28829
  };
28818
- //# sourceMappingURL=chunk-RSK47E4C.js.map
28830
+ //# sourceMappingURL=chunk-A2XBEN3H.js.map