chore(docs-rag): client paths /api/* -> /v1/*

Move the docs and bot-docs RAG clients (search/chat/index) off the
residual /api/ prefix to top-level /v1/, matching the cloud-api route
rename and the openapi v1.0.0 lock-in (no /api/ prefix):

  /api/search-docs -> /v1/search-docs
  /api/chat-docs   -> /v1/chat-docs
  /api/index-docs  -> /v1/index-docs

Touched: apps/{docs,bot-docs}/lib/hanzo/client.ts,
apps/docs/scripts/update-hanzo-index.ts, the .env.example (also
corrects the stale cloud-api.hanzo.ai host -> api.hanzo.ai front door),
and the two generate-search-index.py docstrings.

Server-side these are served at /v1/ by hanzoai/ai (bare search/chat/
index-docs); deeper product GETs by hanzoai/cloud productsvc. Hard
cutover, coordinated with cloud, universe cloud-api-v1 AUTH_PUBLIC_PATHS,
python-sdk, and the openapi cloud spec.
This commit is contained in:
2026-06-30 17:00:02 -07:00
parent db7ee41151
commit abd252a178
6 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -1,14 +1,14 @@
export const searchEndpoint =
process.env.NEXT_PUBLIC_HANZO_SEARCH_ENDPOINT ??
'https://api.hanzo.ai/api/search-docs?store=bot-docs';
'https://api.hanzo.ai/v1/search-docs?store=bot-docs';
export const indexEndpoint =
process.env.HANZO_SEARCH_INDEX_ENDPOINT ??
'https://api.hanzo.ai/api/index-docs?store=bot-docs';
'https://api.hanzo.ai/v1/index-docs?store=bot-docs';
export const chatEndpoint =
process.env.NEXT_PUBLIC_HANZO_CHAT_ENDPOINT ??
'https://api.hanzo.ai/api/chat-docs?store=bot-docs';
'https://api.hanzo.ai/v1/chat-docs?store=bot-docs';
export const publishableKey =
process.env.NEXT_PUBLIC_HANZO_SEARCH_KEY ?? 'pk-hanzo-docs-search-2026';
@@ -4,7 +4,7 @@ Generate Meilisearch index documents from bot-docs MDX source files.
Reads all .mdx files under content/docs/, parses YAML frontmatter and
markdown body, splits by heading sections, and outputs a JSON array
matching the HanzoIndex schema used by the cloud-api /api/index-docs
matching the HanzoIndex schema used by the cloud-api /v1/index-docs
endpoint and the Meilisearch admin-bot-docs-docs index.
Usage:
+2 -2
View File
@@ -7,11 +7,11 @@
# NEXT_PUBLIC_HANZO_SEARCH_INDEX="app-docs-hanzo-ai-docs"
# For cloud backend:
# NEXT_PUBLIC_HANZO_SEARCH_ENDPOINT="https://cloud-api.hanzo.ai/api/search-docs"
# NEXT_PUBLIC_HANZO_SEARCH_ENDPOINT="https://api.hanzo.ai/v1/search-docs"
# NEXT_PUBLIC_HANZO_SEARCH_KEY="pk-hanzo-docs-search-2026"
# Chat endpoint (requires cloud-api)
# NEXT_PUBLIC_HANZO_CHAT_ENDPOINT="https://cloud-api.hanzo.ai/api/chat-docs"
# NEXT_PUBLIC_HANZO_CHAT_ENDPOINT="https://api.hanzo.ai/v1/chat-docs"
# Post-build index sync (admin key for write access)
# HANZO_SEARCH_ADMIN_KEY=<master-key-or-hk-key>
+3 -3
View File
@@ -6,18 +6,18 @@ export const searchEndpoint =
process.env.NEXT_PUBLIC_HANZO_SEARCH_ENDPOINT ??
(searchBackend === 'meilisearch'
? 'https://search.hanzo.ai'
: 'https://api.hanzo.ai/api/search-docs');
: 'https://api.hanzo.ai/v1/search-docs');
export const searchIndex =
process.env.NEXT_PUBLIC_HANZO_SEARCH_INDEX ?? 'app-docs-hanzo-ai-docs';
export const indexEndpoint =
process.env.HANZO_SEARCH_INDEX_ENDPOINT ??
'https://api.hanzo.ai/api/index-docs';
'https://api.hanzo.ai/v1/index-docs';
export const chatEndpoint =
process.env.NEXT_PUBLIC_HANZO_CHAT_ENDPOINT ??
'https://api.hanzo.ai/api/chat-docs';
'https://api.hanzo.ai/v1/chat-docs';
export const publishableKey =
process.env.NEXT_PUBLIC_HANZO_SEARCH_KEY ??
+1 -1
View File
@@ -4,7 +4,7 @@ Generate Meilisearch index documents from docs MDX source files.
Reads all .mdx files under content/docs/, parses YAML frontmatter and
markdown body, splits by heading sections, and outputs a JSON array
matching the HanzoIndex schema used by the cloud-api /api/index-docs
matching the HanzoIndex schema used by the cloud-api /v1/index-docs
endpoint and the Meilisearch app-docs-hanzo-ai-docs index.
Usage:
+1 -1
View File
@@ -18,7 +18,7 @@ export async function updateSearchIndexes(): Promise<void> {
const defaultEndpoint =
backend === 'meilisearch'
? 'https://search.hanzo.ai'
: 'https://api.hanzo.ai/api/index-docs';
: 'https://api.hanzo.ai/v1/index-docs';
await sync({
endpoint: process.env.HANZO_SEARCH_INDEX_ENDPOINT ?? defaultEndpoint,