Architecture of supercorp-ai/supergateway
supercorp-ai/supergateway is 450 source files holding 1,896 symbols across 4 modules, written mainly in TypeScript, JavaScript, Python. The largest module is tests, with 289 files, and 2 files are entry points into the dependency graph.
How supergateway fits together
The package has two entry points, src/cli.ts and src/index.ts, and the command-line flags select which mode runs. The src/gateways directory holds one module per conversion, including stdioToStatefulStreamableHttp.ts, stdioToStatelessStreamableHttp.ts and streamableHttpToStdio.ts, so a stdio server is exposed over Streamable HTTP in stateful or stateless form, or a remote Streamable HTTP server is turned into stdio. src/lib/modernHttp.ts is listed among the central hotspot files of the code. The tests directory holds most of the repository's files and covers the clients and the gateway behavior, and the scripts directory holds supporting scripts. Client requests come in over the selected transport, pass through the matching gateway module, and the server's responses go back out to the client.
Largest modules
- tests: 289 files and 44,797 lines of code
- src: 108 files and 9,054 lines of code
- scripts: 23 files and 3,842 lines of code
- root: 2 files and 74 lines of code
Languages
By file count: TypeScript 349 files, JavaScript 67 files, Python 2 files, Go 1 file, Ruby 1 file, Rust 1 file.
Documentation
Repowise documents supergateway in 215 pages generated from the source, 11 of them written explanations of the repository and its modules. Module guides include:
- src: CLI Entry and Process Startup
- src/lib: Child Process and Request Bridging
More on supergateway: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos