UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

1 lines 332 B
const workspaceTails=new Map;async function withSelfModificationWorkspaceLock(e,t){let n=workspaceTails.get(e)??Promise.resolve(),r,i=new Promise(e=>{r=e}),a=n.then(()=>i);workspaceTails.set(e,a),await n;try{return await t()}finally{r(),workspaceTails.get(e)===a&&workspaceTails.delete(e)}}export{withSelfModificationWorkspaceLock};