One codebase β two entrypoints β a pure client (no DB) that points at a server it chooses: public, or a private enterprise deployment.
Client β src/client.ts
Pure API client: console + Share/Review/Benchmark proxies; the Benchmark tab calls benchmarkClient (anon GET) to the chosen server.
The aggregator path is unreachable from this entry, so esbuild ships the desktop bundle with no aggregator, auth, pg, or PGlite β the 500 is gone by construction.
Points at a server via AGENTGEM_AGGREGATOR_URL; never gets a DATABASE_URL.
Server β index.ts + serverAggregator.ts
mountAggregator() mounts the full /api/aggregator surface, auth, OG, orgs on DATABASE_URL Postgres.
Sole importer of the heavy server deps β keeps them out of the client entry.
Same image runs on Fly (public) and on any private enterprise host.
Two deployments, one image
Publicapi.agentgem.ai β Neon, the k-anon network view (fills as producers opt in and ingest).
Private enterprise β their own DATABASE_URL; data stays in their tenant, never mixes with the public network.
Enterprise desktops just set AGENTGEM_AGGREGATOR_URL to their API.
One codebase β two entrypoints Β· client carries no database Β· server owns the DB (public or private-enterprise) Β· spec: docs/superpowers/specs/2026-07-12-desktop-client-mode-no-pglite-design.md