envtrap/
├── package/ # Core envtrap security agent npm package
│ ├── src/ # TypeScript source code
│ │ ├── index.ts # CLI entry point: commander commands, secret loader, child spawner
│ │ ├── hooks.mjs # ESM customization hooks & CommonJS Module.prototype.require patch
│ │ ├── config.ts # envtrap.json schema validator, loader, and deepMerge logic
│ │ ├── types.ts # Shared TypeScript interfaces (Secret, LeakEvent, ScanResult, etc.)
│ │ ├── ca.ts # In-memory 2048-bit RSA Root CA (node-forge), OS trust store inject/remove
│ │ ├── proxy.ts # MITM TLS HTTP/HTTPS proxy server (127.0.0.1, random port)
│ │ ├── scanner.ts # Stateful scan engine: 1MB clamp, 1.5s TTL dedup cache, block routing
│ │ ├── fingerprint.ts# looksLikeSecret gate, shannonEntropy, scanContent, formatNetworkContext
│ │ └── reporter.ts # Terminal output: chalk alerts, run summary, JSONL log writer
│ └── dist/ # Compiled JS and copied ESM hooks
├── test-server/ # Integration test suite (Express web app + mock TLS server)
│ └── test/
│ └── integration.test.js # Comprehensive test runner
├── landing-page/ # Next.js product landing page
└── docs/ # Mintlify documentation (you are here)