@synthryn/sypi-netpeek
v0.6.0-beta.20260816.6a00fcae
Published
Optional extension: Capture and inspect Chromium Network traffic or imported HAR files with credential redaction. Use it when browser requests or responses are easier to inspect than copied cURL output. Primary capability: the netpeek tool; live capture n
Maintainers
Readme
sypi-netpeek
Read the browser's Network tab directly. The extension exposes one model
tool, netpeek, with five operations selected by op:
attach: Connect to a Chromium-based browser's Chrome DevTools Protocol endpoint overws://localhost:9222. The browser must run with--remote-debugging-port=9222. The operation subscribes to the Network domain and buffers request and response events in extension memory. It detects installed Chromium browsers, including Chrome, Chromium, Edge, Brave, Vivaldi, Arc, and Opera. If no browser answers, it prints the exact launch command for each detected browser and operating system. No browser is hardcoded.list: Return a compact, filterable table (id method status size host path) with about 10 tokens per row. Filter bymethod,host,path, orstatus, and cap rows withlimit.get <id>: Return the full request and response for one id, including the body. The body is fetched withNetwork.getResponseBody. Base64 payloads are decoded, and binary bodies are flagged instead of dumped.curl <id>: Return a reproducible cURL command for one request, with credential values redacted.har <file>: Import a DevTools "Export HAR" file and read it with the samelist,get, andcurloperations. This supports work browsers that block--remote-debugging-port. Export a HAR from the Network panel and pass its path to netpeek. No live connection is needed.
The CDP client is built over an injectable transport seam (cdp.ts) carried over a WebSocket (each WebSocket message is one complete JSON frame, so there is nothing to re-frame). The whole flow (attach, event capture, body fetch, HAR import) is tested against an in-memory fake with no live browser. Zero runtime dependencies: raw WebSocket + JSON, feature-detected so a host without a global WebSocket (pre-Node-22) degrades to a clear "use op:\"har\"" error instead of crashing. It is on-demand and stateless on disk: the capture buffer lives only in memory, capped so a long session stays within the machine's memory ceiling, and nothing is ever written to the repo or ~/.sypi.
Security
Network traffic carries the highest-value secrets on the machine: session cookies, bearer tokens, API keys. Every captured request and response is scrubbed before it enters model context (redact.ts), in two layers:
- Name-based stripping: Headers and URL query parameters with credential-shaped
names (
Cookie,Set-Cookie,Authorization,X-Api-Key,?access_token=…, and others) have their values replaced with[redacted]. A session cookie can have low entropy, and its header name is not akey=valueassignment. A generic secret scanner could miss it. - Value-based masking: Each remaining body, header value, and URL passes through
the extension API's
maskContent. The deterministic masking preserves shape and catches provider-prefixed tokens and JWTs embedded anywhere.
netpeek imports only @synthryn/sypi-coding-agent/extension-api. It shares
redaction primitives with sypi-redact without importing that package. When
sypi-redact is installed, its tool_result hook re-scans netpeek output for
the session with its entropy and recurrence passes as a third host-level layer.
The curl output remains structurally complete and reproducible, but it never
contains a live cookie or bearer. Add credentials separately when replaying it.
