Lines 1-8javascript
3import{AsyncLocalStorage as ZJ}from"async_hooks";var f=["log","info","warn","error","debug"];function v(J){let{wire:G}=J,$=new ZJ,z={log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console)};for(let N of f)console[N]=(...H)=>{let X=$.getStore()??null;G.emit("capsule:console",{level:N,commandId:X,args:H})};return{run(N,H){return $.run(N,H)},write(N,H){let X=$.getStore()??null,Y=typeof H==="string"?H:new TextDecoder().decode(H);return G.emit("capsule:console",{level:N,commandId:X,args:[Y]}),! ...
4`),matches:[],totalLines:H,matchedLines:X.length};function _(Z){if(Q&&Q.test(Z))return!1;if(Y&&!Y.test(Z))return!1;if(F&&!F.test(Z))return!1;return!0}let K=z.context??0,T=[],B=new Set;for(let Z=0;Z<X.length;Z++){let P=X[Z];if(P===void 0||!_(P))continue;B.add(Z),T.push({line:Z,text:P,before:K>0?X.slice(Math.max(0,Z-K),Z):[],after:K>0?X.slice(Z+1,Math.min(X.length,Z+1+K)):[]})}let D=X.filter((Z,P)=>B.has(P));return{procId:J,stream:$,lines:D,raw:D.join(`
MediumDynamic Require
Package source references dynamic require/import behavior.
capsule-process.jsView on unpkg · L2 5`),matches:T,totalLines:H,matchedLines:D.length}}function i(J){if(J instanceof RegExp)return($)=>J.test($);let G=J.toLowerCase();return($)=>$.toLowerCase().includes(G)}function PJ(J,G){if(!J)return"";let $=[],z=0;for(let N=0;N<J.length;N++)if(J[N]===`
6`)$.push(J.slice(z,N+1)),z=N+1;if(z<J.length)$.push(J.slice(z));return $.slice(-G).join("")}function s(J,G){let $=new Promise((H)=>{if(J.status==="exited"){H({exitCode:J.exitCode??-1,ok:J.exitCode===0,stdout:J.stdout.join("")});return}let X=G.subscribe(J.procId+":exit",()=>{X(),H({exitCode:J.exitCode??-1,ok:J.exitCode===0,stdout:J.stdout.join("")})})});function z(H=["stdout"]){let X=[];if(H.includes("stdout"))X.push(J.stdout.join(""));if(H.includes("stderr"))X.push(J.stderr.join(""));return X.join("")}let N={get procId(){return J.procId},get kind(){return J.kind},get command(){return J.command ...
7`)},onCommand(z){return J.add(z),()=>J.delete(z)}}}var r=process.exit.bind(process);function t(J){let G=process;if(
Long lines were clipped for display.