Documentation
¶
Overview ¶
Package webui provides embedded frontend assets for production deployment.
Index ¶
Constants ¶
const ContentSecurityPolicy = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; " +
"img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; " +
"form-action 'self'; frame-ancestors 'none'"
ContentSecurityPolicy is sent with every web UI response (docs/design/mcp.md §9). The editor shows text from agents and flows; even if a rendering bug let markup through, no inline, eval'd or foreign script runs, no plugin loads, <base> cannot redirect relative URLs and no other site can frame the editor. The built UI loads only its own files and talks only to its own server; inline styles stay allowed (component libraries set them).
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler returns an http.Handler that serves the embedded frontend files. It implements SPA routing by serving index.html for any path that doesn't match a static file. Every response carries ContentSecurityPolicy.
func IsAvailable ¶
func IsAvailable() bool
IsAvailable returns true if the embedded frontend is available. This will be false during development when the dist folder doesn't exist.
Types ¶
This section is empty.