webui

package
v1.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: GPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package webui provides embedded frontend assets for production deployment.

Index

Constants

View Source
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

func Handler() http.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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL