You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our proto-first stack (Sebuf / protoc-gen-openapiv3, see proto/buf.gen.yaml) auto-generates:
Typed TS client (src/generated/client)
TS server handler stubs (src/generated/server)
OpenAPI v3 docs (docs/api/*Service.openapi.yaml) — published via Mintlify
Today the 30 /api/<domain>/v1/<rpc> domain services are fully proto-driven (173 RPCs, 100% coverage). A sizeable set of endpoints bypasses this path — they're hand-rolled edge functions with no proto, no generated client, and no auto-docs. That means:
Breaking changes are only caught at runtime.
Clients (dashboard, desktop, partners) duplicate type definitions.
Internal — not a user-facing contract: api/bootstrap.js, api/geo.js, api/reverse-geocode.js, api/data/city-coords.ts. These are dashboard-internal helpers we don't want external consumers building against; keeping them hand-rolled avoids implicitly publishing them as API surface.
Thin upstream proxies where we don't own the schema: api/opensky.js, api/polymarket.js, api/gpsjam.js, api/oref-alerts.js, api/rss-proxy.js, api/telegram-feed.js, api/supply-chain/hormuz-tracker.js.
Track A first — low-ceremony RPC additions to existing protos; exercises the toolchain on familiar ground.
scenario/v1 — already follows the URL convention; OpenAPI was hand-written in docs/api/ScenarioService.openapi.yaml and can be diffed against the generated output.
shipping/v2 — partner-facing API, type safety matters most here.
analyst/v1 — note ChatAnalyst is streaming; verify Sebuf supports SSE or handle streaming manually while using proto for the request shape.
enrichment/v1, leads/v1 — simple request/response, good warm-up PRs.
Per-endpoint migration checklist
For each endpoint:
Write / extend .proto in proto/worldmonitor/<domain>/v1/
Run make generate to regen src/generated/{client,server} and docs/api/*.openapi.yaml
Add handler to server/worldmonitor/<domain>/v1/<rpc>.ts
Wire handler into domain handler.ts
Replace the old api/<path>.{ts,js} with a thin gateway (or delete if fully subsumed by the /v1/ route)
Update callers (dashboard, desktop, SDK docs) to the generated client
Add docs/api/<Service>.openapi.yaml entry to docs/docs.json if new service
Smoke test: curl old vs new response shapes match
Remove the hand-written MDX entry (from api-platform.mdx / api-proxies.mdx / etc.) once the auto-generated spec is live
Acceptance
All 10 endpoints migrated.
Hand-written OpenAPI for scenario/v1 (and any others) is replaced by auto-generated output.
No breaking changes to existing callers.
protoc-gen-openapiv3 output in docs/api/ committed and rendered in Mintlify.
Related
Doc audit PR (forthcoming) — adds MDX pages for the non-proto endpoints as an interim.
Context
Our proto-first stack (Sebuf /
protoc-gen-openapiv3, seeproto/buf.gen.yaml) auto-generates:src/generated/client)src/generated/server)docs/api/*Service.openapi.yaml) — published via MintlifyToday the 30
/api/<domain>/v1/<rpc>domain services are fully proto-driven (173 RPCs, 100% coverage). A sizeable set of endpoints bypasses this path — they're hand-rolled edge functions with no proto, no generated client, and no auto-docs. That means:This issue tracks migrating the remaining user-facing endpoints to Sebuf.
Scope
10 endpoints across 6 services. Split into two tracks.
Track A — Add RPCs to existing domain protos (5)
These endpoints already sit inside a domain we own; the work is adding an
rpcto the existing.protoand routing the handler.api/eia/[[...path]].jsproto/worldmonitor/economic/v1/GetEiaSeries— replace catch-all proxy with typed series-id requestapi/satellites.jsproto/worldmonitor/orbital/v1/(or fold intonatural)ListSatellitePositionsapi/military-flights.jsproto/worldmonitor/military/v1/ListMilitaryAircraftLiveapi/ais-snapshot.jsproto/worldmonitor/maritime/v1/GetAisSnapshotapi/sanctions-entity-search.jsproto/worldmonitor/sanctions/v1/SearchSdnEntitiesTrack B — New services (5 new protos, 13 new RPCs)
api/scenario/v1/{run,status,templates}.tsscenario/v1RunScenario,GetScenarioStatus,ListScenarioTemplatesapi/v2/shipping/{route-intelligence,webhooks}.tsshipping/v2GetRouteIntelligence,RegisterWebhook,ListWebhooksapi/contact.js,api/register-interest.jsleads/v1SubmitContact,RegisterInterestapi/chat-analyst.ts,api/widget-agent.ts,api/skills/fetch-agentskills.tsanalyst/v1ChatAnalyst(streaming),WidgetComplete,ListAgentSkillsapi/enrichment/company.js,api/enrichment/signals.jsenrichment/v1GetCompany,GetDomainSignalsOut of scope (intentionally NOT migrating)
api/bootstrap.js,api/geo.js,api/reverse-geocode.js,api/data/city-coords.ts. These are dashboard-internal helpers we don't want external consumers building against; keeping them hand-rolled avoids implicitly publishing them as API surface.api/mcp.ts(MCP JSON-RPC),api/oauth/*(OAuth 2.1),api/discord/oauth/*,api/slack/oauth/*.api/brief/carousel/*(PNG),api/og-story.js(PNG),api/story.js(HTML),api/youtube/embed.js(HTML),api/download.js(binary).api/health.js,api/seed-health.js,api/version.js,api/cache-purge.js,api/seed-contract-probe.ts,api/invalidate-user-api-key-cache.ts,api/mcp-proxy.js,api/fwdstart.js,api/notify.ts.api/opensky.js,api/polymarket.js,api/gpsjam.js,api/oref-alerts.js,api/rss-proxy.js,api/telegram-feed.js,api/supply-chain/hormuz-tracker.js.api/latest-brief.ts,api/brief/share-url.ts,api/brief/public/[hash].ts,api/brief/[userId]/[issueDate].ts,api/notification-channels.ts,api/user-prefs.ts,api/create-checkout.ts,api/customer-portal.ts,api/product-catalog.js,api/referral/me.ts.Suggested order
scenario/v1— already follows the URL convention; OpenAPI was hand-written indocs/api/ScenarioService.openapi.yamland can be diffed against the generated output.shipping/v2— partner-facing API, type safety matters most here.analyst/v1— noteChatAnalystis streaming; verify Sebuf supports SSE or handle streaming manually while using proto for the request shape.enrichment/v1,leads/v1— simple request/response, good warm-up PRs.Per-endpoint migration checklist
For each endpoint:
.protoinproto/worldmonitor/<domain>/v1/make generateto regensrc/generated/{client,server}anddocs/api/*.openapi.yamlserver/worldmonitor/<domain>/v1/<rpc>.tshandler.tsapi/<path>.{ts,js}with a thin gateway (or delete if fully subsumed by the/v1/route)docs/api/<Service>.openapi.yamlentry todocs/docs.jsonif new servicecurlold vs new response shapes matchapi-platform.mdx/api-proxies.mdx/ etc.) once the auto-generated spec is liveAcceptance
scenario/v1(and any others) is replaced by auto-generated output.protoc-gen-openapiv3output indocs/api/committed and rendered in Mintlify.Related
proto/buf.gen.yaml— Sebuf configdocs/adding-endpoints.mdx— proto-first endpoint guide