Skip to content

docs(reference): auto-generated REST API endpoint catalog (260 endpoints, EN+VI+ZH)#60

Merged
thieung merged 2 commits intomasterfrom
docs/sync-goclaw-rest-api-bulk-phase3
Apr 25, 2026
Merged

docs(reference): auto-generated REST API endpoint catalog (260 endpoints, EN+VI+ZH)#60
thieung merged 2 commits intomasterfrom
docs/sync-goclaw-rest-api-bulk-phase3

Conversation

@thieung
Copy link
Copy Markdown
Contributor

@thieung thieung commented Apr 25, 2026

Summary

Phase 3 of v3.11.x sync — auto-generated REST API endpoint catalog covering all 260 live endpoints from goclaw source. Trilingual (EN/VI/ZH).

Audit (plans/reports/api-audit-260425-2237-endpoint-drift.md) flagged 196 endpoints undocumented in hand-written reference/rest-api.md. Hand-writing 200 endpoint stubs × 3 locales is unmaintainable, so this PR introduces an auto-gen catalog kept fresh by a build script.

Approach

  • New page reference/api-endpoints-catalog.md (+ vi/ + zh/) — flat catalog grouped by handler domain (37 groups). One row per endpoint with method + path.
  • Existing rest-api.md untouched — stays as hand-curated narrative ref. Cross-link callout added to top of all 3 locales.
  • Build script scripts/build-api-catalog.js — Node.js, no external deps, scans goclaw/internal/http/*.go + gateway/server.go for mux.Handle/HandleFunc patterns. Run via npm run build:api-catalog or GOCLAW_SOURCE_PATH=... node scripts/build-api-catalog.js.

Files

File Type Notes
scripts/build-api-catalog.js new 296-line generator
reference/api-endpoints-catalog.md new 465 lines, 260 endpoints / 37 groups
vi/reference/api-endpoints-catalog.md new mirror, localized intro
zh/reference/api-endpoints-catalog.md new mirror, localized intro
package.json mod build:api-catalog npm script
js/docs-app.js mod DOC_MAP entry (triple-sync)
index.html mod sidebar link under Reference
README.md mod DOC MAP link + reference page count 16→17
reference/rest-api.md (× 3 locales) mod cross-link callout after Overview

Total: 11 files / +1703/-2.

Generated from

  • GoClaw SHA: 29457bb3
  • Date: 2026-04-25
  • Endpoint count: 260
  • Domain groups: 37 (by handler file basename)

How regeneration works

npm run build:api-catalog
# or with custom source:
GOCLAW_SOURCE_PATH=/path/to/goclaw node scripts/build-api-catalog.js

The script:

  1. Greps mux.Handle("METHOD /path", ...) patterns from internal/http/*.go + internal/gateway/server.go
  2. Groups by handler file basename (e.g., vault.go → "Vault")
  3. Renders markdown table per group, alphabetically sorted
  4. Writes to all 3 locales with localized intro headings

On future goclaw syncs, just run the script — catalog stays fresh without hand-editing.

DOC_MAP triple-sync (per project convention)

All 3 required locations updated together: README.md + js/docs-app.js + index.html.

Reports

  • Implementation: plans/reports/fullstack-260426-0113-GH-1-api-catalog-impl.md
  • Original API drift audit: plans/reports/api-audit-260425-2237-endpoint-drift.md

Test plan

  • Render reference/api-endpoints-catalog.md locally, verify table formatting + group headers
  • Click cross-link from rest-api.md → catalog page (all 3 locales)
  • Verify sidebar entry appears under Reference group
  • Spot-check key endpoints: POST /v1/vault/upload, GET /v1/agents/{agentID}/kg/graph, POST /v1/api-keys, GET /v1/voices
  • npm run build:api-catalog runs cleanly without modifying anything else

Out of scope

  • Per-endpoint request/response schemas — narrative ref rest-api.md covers OpenAI-compat surface; remaining endpoints intentionally catalog-only (path discoverability is the goal here)
  • Fumadocs migration integration — this catalog format will carry over fine; if migration restructures reference/, just re-run script

@thieung thieung merged commit c0c52fb into master Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant