ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 16 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 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, allow bool, 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.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server renders the UI.

func New

func New(opts Options) (*Server, error)

New builds the UI server and parses the templates.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the router.

Jump to

Keyboard shortcuts

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