UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 829 B
import"./fs-safe-copy.worker-redact-BQxLxSX2.mjs";import{n as e,o as t}from"./fs-safe-copy.worker-src-DSFoKngP.mjs";import{Q as n}from"./fs-safe-copy.worker-sqlite-database-admission-CoQADBJP.mjs";import{randomBytes as r}from"node:crypto";const i=/* @__PURE__ */ new WeakMap;function recordRetryAttemptErrors(e,t){i.set(e,[...t])}function getRetryAttemptErrors(e){return e!==null&&(typeof e==`object`||typeof e==`function`)?i.get(e):void 0}function generateSecureFraction(){return r(4).readUInt32BE(0)/4294967296}function createRetryFailure(e){let n=e.flatMap(e=>getRetryAttemptErrors(e)??[e]),r=t(n.at(-1)??/* @__PURE__ */ Error(`Retry failed`),`Non-Error thrown`);return n.length>1&&recordRetryAttemptErrors(r,n),r}const a=e({shouldRetry:e=>!n(e),random:generateSecureFraction,createFailure:createRetryFailure});export{a as t};