tui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package tui implements `pano ui`, an interactive terminal interface over the control API: a live flow list, a detail pane with the same body views the CLI and MCP server expose, LLM explain, diff, replay, rules and held requests. Like every other front end it is a thin client of the daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exit

type Exit int

Exit is why the UI returned.

const (
	// ExitInterrupt is ctrl-c or a cancelled context: the daemon applies
	// the ownership rule on its own (off if this UI owned it).
	ExitInterrupt Exit = iota
	// ExitOff means the user chose "turn pano off"; the daemon is stopping.
	ExitOff
	// ExitDetach means the user chose "keep running in the background".
	ExitDetach
	// ExitGone means the daemon went away underneath the UI (`pano off`
	// in another terminal, a crash).
	ExitGone
)

func Run

func Run(ctx context.Context, c *client.Client, version string, opts Options) (Exit, error)

Run starts the interactive UI and blocks until the user quits. The Exit says how: chosen off, chosen background, ctrl-c, or the daemon went away.

type Model

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

Model is the Bubble Tea model for pano ui.

func New

func New(c *client.Client, version string) *Model

New creates the model.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Model) View

func (m *Model) View() tea.View

View implements tea.Model.

type Options

type Options struct {
	// Own marks this UI as the daemon's owner (`pano on`): when it closes
	// for any reason the daemon turns pano off. False for `pano ui` on a
	// daemon that is already running.
	Own bool
	// Update, when set, is polled once a second until it returns the result
	// of the release check (nil while in flight or when nothing is newer).
	Update func() *update.Info
	// Sim, when set, is asked once at startup for booted iOS Simulators
	// that lack pano's certificate; the UI then offers the install.
	Sim *simulator.Manager
}

Options tunes how the UI is attached to the daemon.

type Theme

type Theme struct {
	BgRaised, BgSelected, BgOverlay, LineFaint color.Color
	FgPrimary, FgSecondary, FgMuted, FgFaint   color.Color
	Accent, AccentDim                          color.Color
	OK, Redirect, Warn, Err, LLM, Mock         color.Color
	SynStr, SynNum, SynBool                    color.Color // body syntax: strings / numbers / bool+null
	HeldFg, HeldBg                             color.Color
	BrandA, BrandB                             color.Color // logo gradient (top → bottom); mascot only
	// contains filtered or unexported fields
}

Theme is the single style registry for the UI ("Panoptes" palette). Every component reads colours from here; nothing hardcodes hex values elsewhere.

Jump to

Keyboard shortcuts

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