(()=>{functionl(r){lete=[],a=newUint8Array(1024);for(;;){letn=0;try{n=Javy.IO.readSync(0,a)}catch(o){if(o.message.includes("os error 29"))break;thrownewError("Error reading from stdin")}if(n<0)thrownewError("Error reading from stdin");if(n===0)break;if(e=[...e,...a.subarray(0,n)],!e.includes(10))continue;lett=0;for(leto=0;t<e.length;t++)if(e[t]===10){letw=e.splice(o,t+1),f=newUint8Array(w),c;try{c=JSON.parse(newTextDecoder().decode(f))}catch(d){thrownewError(`Error parsing JSON '${newTextDecoder().decode(f)}' from stdin: ${d.message}`)}try{r(c)}catch(d){letu=c.header;u.err=d.message,i({header:u})}o=t+1}e=e.slice(t)}}functioni(r){lets=newTextEncoder().encode(JSON.stringify(r)+`