diff --git a/apps/console/src/pages/developer/hooks/useApiDiscovery.ts b/apps/console/src/pages/developer/hooks/useApiDiscovery.ts index 1b24635590..7a9bc5e3b0 100644 --- a/apps/console/src/pages/developer/hooks/useApiDiscovery.ts +++ b/apps/console/src/pages/developer/hooks/useApiDiscovery.ts @@ -45,16 +45,33 @@ function buildAuthEndpoints(authBase: string): EndpointDef[] { } export const SERVICE_ENDPOINT_CATALOG: Record = { - // The twelve routes `buildAIRoutes()` mounts, in table order (framework#3718). + // The `/api/v1/ai/**` family, in ledger order (framework#3718). + // // `/nlq`, `/suggest` and `/insights` used to sit here with "try it" bodies and // always 404'd — they were declared in the framework's `DEFAULT_AI_ROUTES` and // never implemented anywhere, so this page offered three endpoints that had no // server. The audited table is cloud's `packages/service-ai/src/ // ai-route-ledger.ts`; when a route is added or renamed there, mirror it here. // - // `/status` and `/effective-model` are deliberately NOT SDK surface (operator - // diagnostics) — which is exactly why they belong on this page: it explores raw - // HTTP, not `client.*`. + // That first fix listed one server-side builder, `buildAIRoutes()`. The family + // is SEVEN builders plus one route mounted by `objectos-runtime`, so this page + // still showed under half of it. All 26 are here now, grouped as the ledger + // groups them. + // + // TWO KINDS OF ENTRY LIVE HERE, and both belong: + // - routes the SDK also expresses (`/chat`, `/conversations/*`) — this page is + // where you check the wire shape behind `client.ai.*`; + // - routes it deliberately does not (`/status`, `/effective-model`, `/tools/*`, + // `/evals/runs`, `/usage`) — operator and console surfaces, which is exactly + // why they belong on a page that explores raw HTTP rather than `client.*`. + // + // MOUNTING IS CONDITIONAL for four of the builders (see AI_ROUTE_MOUNT_GATES in + // the ledger): `/agents/*` and `/assistant/*` need a metadata service, + // `/evals/runs` also needs a data engine, `/conversations/:id/debug` needs one. + // A full Cloud deployment wires all of them; a stripped host may not, and there + // these 404 because they are not mounted — NOT because they do not exist. That + // is a different failure from the one above, and the only honest place to say so + // is here. ai: { group: 'AI', defaultRoute: '/api/v1/ai', @@ -74,6 +91,39 @@ export const SERVICE_ENDPOINT_CATALOG: Record