BuilderHub
CleverCase proxy to Rakontevr BuilderHub — studios, experiences, and unified-agent
BuilderHub Integration
CleverCase integrates with Rakontevr BuilderHub through a server-side proxy. The browser calls /api/rakontevr/*; Next.js forwards to ${RAKONTEVR_API_BASE_URL}/api/builderhub/* with the service key injected as a Bearer token.
Proxy route
src/app/api/rakontevr/[...path]/route.ts implements Mode B integration:
Forwarded headers
| Header | Value |
|---|---|
Authorization | Bearer <RAKONTEVR_SERVICE_KEY> |
X-User-Id | Resolved tenant user |
X-Tenant-Id | 00000000-0000-4000-a000-000000000003 |
X-Trace-Id | Fresh UUID per request |
X-Task-Type | clevercase-assistant |
X-CleverCase-Proxy | 1 |
Stripped headers
Hop-by-hop headers and caller-supplied auth are removed so only the service key authenticates upstream: authorization, x-api-key, cookie, host, etc.
Methods
GET, POST, PUT, PATCH, DELETE — query strings preserved.
Configuration
| Env | Purpose |
|---|---|
RAKONTEVR_SERVICE_KEY | M2M credential (server-only) |
RAKONTEVR_API_BASE_URL | BuilderHub host |
BUILDERHUB_API_SEGMENT | Default /api/builderhub |
Returns 503 when service key is unset.
Studios
BuilderHub Studios are authoring surfaces for agents, experiences, and workflow templates. CleverCase accesses studios through the proxy path:
GET /api/rakontevr/studios
GET /api/rakontevr/studios/{studioId}Studios publish agent blueprints to the agent marketplace (@rakontevr/sdk/agent-marketplace).
Experiences
Experiences are deployable UI shells that embed BuilderHub chat and tool surfaces. CleverCase registers as experience clevercase-experience:
- Gladys chat mounts against
/api/gladys/stream(dedicated BFF) - Other BuilderHub APIs use the generic
/api/rakontevr/*proxy surfaceContext.surface: "clevercase-experience"on unified-agent calls
unified-agent
Gladys uses a dedicated server client (gladys-iorek-server.ts) rather than the generic proxy, because streaming SSE requires event parsing and document-action post-processing. Non-streaming BuilderHub calls can use either:
fetchViaRakGateway("/api/builderhub/...", { identity })fromrak-gateway.ts- Browser →
/api/rakontevr/unified-agent(proxy)
Marketing RSP (MRSP)
Marketing content generation uses BuilderHub indirectly via streamGladysAsk in mrsp-host.ts, persisting runs to mrspRun Prisma table. See Marketing RSP.
Registration
scripts/register-clevercase-builderhub.ts registers CleverCase as a BuilderHub application with callback URL /api/auth/entra/callback.
Related
- Gladys / Iorek
- Rakontevr SDK
src/lib/clevercase/rakontevr-config.ts