MCPcopy Create free account
hub / github.com/deepclause/agentvm / wrapFdOp

Function wrapFdOp

src/worker.js:580–588  ·  view source on GitHub ↗
(name, orig, fdArgIdx = 0)

Source from the content-addressed store, hash-verified

578
579 // Intercept fd operations to redirect fake directory fds
580 const wrapFdOp = (name, orig, fdArgIdx = 0) => {
581 return (...args) => {
582 const fd = args[fdArgIdx];
583 if (fakeFdMap.has(fd)) {
584 args[fdArgIdx] = fakeFdMap.get(fd);
585 }
586 return orig(...args);
587 };
588 };
589
590 // Custom fd_readdir for our directory handles
591 const origFdReaddir = wasiImport.fd_readdir;

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected