Documentation
¶
Overview ¶
Package editorui embeds the visual schema editor (Appximo Studio, UI-F0-S1) and serves it from the engine binary under /editor. The compiled SPA lives in web/build and is COMMITTED (ADR-025): the published module carries the prebuilt assets, so any `go build` — including a module consumer's — ships a working Studio. After touching web/src, rebuild with `make editor-ui` and commit the new assets with the src change. A binary that embeds no assets serves an honest 503 from the shell routes instead of a blank page (B1).
The editor is a STATIC single-page Svelte 5 app (plain Vite, no SvelteKit) — there is NO Node process in production: the browser downloads HTML/JS/CSS and runs the editor entirely client-side. The engine only hands out the files.
Real server paths:
- GET /editor and /editor/ → index.html (no-cache; always points at the current hashed assets)
- GET /editor/assets/<hash> → immutable (cached forever by the browser)
- GET /editor/<other> → the matching build file (e.g. favicon.svg)
These are NEW static routes, off the CRUD/JWT hot path (JWT-skipped via the "/editor" prefix in pkg/auth.skipJWT; tenant-agnostic like /admin).
JSON-EDITOR-S1: the validation surface for Studio's assisted JSON editor. Two THIN, STATELESS routes in the /openapi class — no DB access, no deploy, no hot-path involvement, JWT-skipped like the rest of /editor:
POST /editor/validate — body = a raw candidate schema JSON (1 MiB cap, same as the engine's body cap); response = schema.ValidateReport, the AI-F0-S2 unified structural+semantic report (dot-path / rule / expected / got / fix per error). This is the editor's SEMANTIC layer: the frontend never reimplements the validator, it renders this report at the right lines. Debounce-friendly: pure function of the body, callable per keystroke.
GET /editor/meta-schema — the embedded formal JSON Schema meta-schema (Draft 2020-12, pkg/schema/appximo.schema.json), for the editor's client-side STRUCTURAL layer (CodeMirror autocompletion/hover/diagnostics). Same bytes as `appximo meta-schema`; cacheable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasBuiltAssets ¶
func HasBuiltAssets() bool
HasBuiltAssets reports whether real (hashed) assets are embedded — false means only the placeholder index.html is present (the bundle was not built before `go build`). Used by the engine to log a helpful warning.
Types ¶
This section is empty.