@polka-codes/cli 0.9.69 → 0.9.70

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -37660,7 +37660,7 @@ var {
37660
37660
  Help
37661
37661
  } = import__.default;
37662
37662
  // package.json
37663
- var version = "0.9.69";
37663
+ var version = "0.9.70";
37664
37664
 
37665
37665
  // src/commands/code.ts
37666
37666
  import { readFile as readFile4 } from "node:fs/promises";
@@ -64201,16 +64201,25 @@ var fromJsonModelMessage = (msg) => {
64201
64201
  var makeStepFn = () => {
64202
64202
  const results = new Map;
64203
64203
  const callStack = [];
64204
- return async (name17, fn) => {
64204
+ return async (name17, fn, options) => {
64205
64205
  callStack.push(name17);
64206
64206
  const key = callStack.join(">");
64207
64207
  try {
64208
64208
  if (results.has(key)) {
64209
64209
  return results.get(key);
64210
64210
  }
64211
- const result = await fn();
64212
- results.set(key, result);
64213
- return result;
64211
+ const maxRetryCount = options?.retry ?? 1;
64212
+ let lastError;
64213
+ for (let retryCount = 0;retryCount <= maxRetryCount; retryCount++) {
64214
+ try {
64215
+ const result = await fn();
64216
+ results.set(key, result);
64217
+ return result;
64218
+ } catch (error46) {
64219
+ lastError = error46;
64220
+ }
64221
+ }
64222
+ throw lastError;
64214
64223
  } finally {
64215
64224
  callStack.pop();
64216
64225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/cli",
3
- "version": "0.9.69",
3
+ "version": "0.9.70",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",