tui

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package tui implements a Grok-Build-CLI (GrokNight) inspired dark interactive, mouse-driven terminal UI with floating overlay modals for MCPlex CRUD diffs and live logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg Config, src EventSource) error

Run starts the full-screen mouse-enabled Bubble Tea console until the user quits or ctx cancels.

Types

type Config

type Config struct {
	Endpoint    string
	Version     string
	ModeLabel   string // "local" | "remote"
	AuthEnabled bool
	StrictRoot  bool
}

Config configures the interactive MCPlex TUI header and connection info.

type EventSource

type EventSource interface {
	Messages() <-chan tea.Msg
	Close()
}

EventSource streams live runtime events into the Bubble Tea loop.

func NewLocalHubSource

func NewLocalHubSource(hub *events.Hub, sessionFilter string) EventSource

NewLocalHubSource attaches directly to an in-process events.Hub (zero network overhead for `--http ... --ui`).

func NewSSESource

func NewSSESource(parentCtx context.Context, baseURL, token, sessionFilter string) EventSource

NewSSESource connects to a running `mcplex serve --http` instance's `GET /events` SSE stream with automatic Last-Event-ID reconnection.

type Model

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

Model is the Bubble Tea state machine for the Grok-Build-CLI dark interactive MCPlex console.

func NewModel

func NewModel(cfg Config, src EventSource) *Model

NewModel creates a new TUI model backed by source (local EventHub or remote SSE).

func (*Model) Init

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

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

Jump to

Keyboard shortcuts

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