Documentation
¶
Overview ¶
Package ui serves the agentgate web interface: a read-only view of the audit database, the loaded policy, and the approvals inbox.
It is plain server-rendered HTML with htmx for the few interactive bits. The templates and both vendored assets are embedded, so the binary serves the whole UI with no network access and no build step.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Approvals ¶
type Approvals interface {
Pending() []proxy.PendingApproval
Resolve(id string, choice proxy.Choice, who string) bool
}
Approvals is the part of the proxy's inbox the UI needs. It is an interface so that "agentgate ui" can serve the audit database on its own, with no proxy running behind it.
type Options ¶
type Options struct {
Store *audit.Store
// Config returns the configuration currently in force. Required.
Config func() *config.Config
// Approvals is the pending "ask" queue, or nil when nothing can be approved.
Approvals Approvals
// Reload re-reads the config file and swaps the policy into the running
// proxy. Nil disables the reload button.
Reload func() (*config.Config, error)
// Freeze and Unfreeze throw and lift the kill switch. Nil hides the
// buttons.
Freeze func(reason, by string) error
Unfreeze func() error
Logger *slog.Logger
Version string
}
Options configure the UI server.