Lines 1-6javascript
1import{AccessControlBlockError as e,Client as t,ConfigurationError as n,ProxyConnectionError as r,ReadBuffer as i,Server as a,StdioServerTransport as o,compressClientInfo as s,getSessionData as c,initializeTrafficMirror as l,logRequestCounts as u,proxyServer as d,redactCliArgs as f,serializeMessage as p,startHTTPServer as m}from"./stdio-CwWRc8TT.js";import{UnauthorizedError as ee,createParser as h,normalizeUrl as g}from"./normalizeUrl-fkFv5Mfb.js";import{config as _}from"./env-IMxXxvN0.js";import{chownToRealUser as v,extractTraceIdFromHeaders as te,flushLogs as y,logger as b}from"./logger-4h11 ...
2`);this.buffer=r.pop()||``;let i=[];for(let e of r)e.trim().startsWith(`{`)?i.push(e):e.trim().length>0&&this.logDroppedLine(e);if(i.length>0){let e=`${i.join(`
HighChild Process
Package source references child process execution.
dist/main-CpwH4w9e.jsView on unpkg · L1 HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/main-CpwH4w9e.jsView on unpkg · L1 3`)}\n`;n(null,Buffer.from(e))}else n(null,null)}logDroppedLine(e){if(!(this.droppedLinesLogged>50)){if(this.droppedLinesLogged===50){this.droppedLinesLogged+=1,b.info(`Suppressing further non-JSON stdout lines`,{eventType:`mcp_server_stdout_dropped_suppressed`,loggedSoFar:50});return}this.droppedLinesLogged+=1,b.info(`MCP server stdout (non-JSON, dropped)`,{eventType:`mcp_server_stdout_dropped`,line:e.length>1024?`${e.slice(0,1024)}…`:e})}}},ze=class{onclose;onerror;onmessage;get pid(){return this._process?.pid??null}get stderr(){return this._stderrStream?this._stderrStream:this._process?.stde ...
4`);return Ge({exitCode:1,logMessage:`MCP server blocked by access control policy`,meta:{error:t.message,eventType:`mcp_access_control_block`,reason:t.reason},reason:e,respondToClient:a,stderrLine:n})}let l=c(t instanceof n?`Onyx MCP gateway: configuration error — ${t.message}`:t instanceof r?`Onyx MCP gateway: cannot reach the upstream MCP server${o?` at ${o}`:``} — ${t.message}`:`Onyx MCP gateway: failed to start — ${t
5`);c=t.pop()??``;for(let e of t){if(e.length===0)continue;u(e)}c.length>8192&&d()}),n.stderr?.once(`end`,m),n.stderr?.once(`close`,m);try{return await t.connect(n),t}catch(e){throw m(),b.warn(`Failed original server access`,{command:h,error:e instanceof Error?e.message:String(e),eventType:`mcp_server_access_failed`,proxyType:s,stderrTail:l.slice(-20)}),new r(`Failed to connect to stdio process: ${e}`,void 0,`stdio`,{argCount:v?.length,command:h})}}else if(s===`remote`){let e=S,t=()=>{let e={...w};return Object.keys(e).length>0?{headers:e}:void 0},n=e=>{if(e instanceof ee)return!0;if(e&&typeof ...
6//# sourceMappingURL=main-CpwH4w9e.js.map
Long lines were clipped for display.