eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
1 lines • 523 B
JavaScript
import{StringDecoder}from"node:string_decoder";function resultSucceeded(e){return e.termination.kind===`exit`&&e.termination.code===0}function createPackageProcessStdoutCollector(e){let t=e.maxCapturedBytes??65536,n=new StringDecoder(`utf8`),r=``,i=0;function capture(e){for(let n of e){let e=Buffer.byteLength(n);if(i+e>t)return;r+=n,i+=e}}return{write(e){capture(n.write(e))},end(){capture(n.end())},result(t){return{command:e.command,termination:t,stdout:r}}}}export{createPackageProcessStdoutCollector,resultSucceeded};