Documentation
¶
Overview ¶
Package ui embeds the built Hanzo Tasks SPA (@hanzo/tasks, the admin-tasks app in hanzoai/admin, Vite + hanzogui) directly into the cloud binary and serves it at /tasks/* (console.hanzo.ai/tasks + tasks.hanzo.ai/tasks).
WHY cloud owns this embed (not github.com/hanzoai/tasks/ui): the tasks module ships an EMPTY ui/dist placeholder ("No UI build present") because its bundle is produced in a separate frontend workspace and synced in at release time — a step the tasks module's own releases do not run, so cloud's tasks UI was a placeholder. cloud is the ONE process that serves tasks.hanzo.ai (durable.go's EmbeddedTasks engine + clients/tasks's /v1/tasks surface), so cloud owns the UI embed too: one binary, one origin, the real UI. This retires the standalone tasks-ui pod (a Temporal-Web-UI fork).
dist/ is the committed, content-addressed Vite build. The SPA is built with base '/tasks/' and API prefix '/v1/tasks' (see the admin-tasks vite.config), so every asset + XHR is same-origin under the paths cloud already serves. To refresh it, rebuild the admin-tasks app and sync its dist/ here — see clients/tasks/ui/README.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler returns an http.Handler that serves the embedded SPA. Mount it under StripPrefix("/tasks", …) so it sees root-relative paths.
- Content-addressed assets under assets/ ship immutable cache hints (Vite hashes filenames).
- Any path that is not a real file rewrites to index.html so the client-side router handles the route — the standard SPA fallback that lets a deep-link reload survive.
- If the build is absent (index.html missing) every request returns 503, so a missing bundle is loud in staging, never a blank page in production.
Types ¶
This section is empty.