tui

package
v0.0.0-...-675af36 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package tui provides remote client functionality for connecting to a running daemon.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRemoteDashboard

func NewRemoteDashboard(addr string) (*Dashboard, *RemoteClient, error)

NewRemoteDashboard creates a dashboard that connects to a remote daemon via WebSocket. The addr can be a port number, host:port, or full URL.

func RenderLiveFeedEvents

func RenderLiveFeedEvents(events []daemon.LiveFeedEvent, width int) string

RenderLiveFeedEvents renders a slice of live feed events with styling

func RunRemote

func RunRemote(addr string) error

RunRemote starts a dashboard that connects to a remote daemon

Types

type AgentOutputMsg

type AgentOutputMsg struct {
	AgentID string
	Output  string
	IsError bool
}

AgentOutputMsg is sent when agent output is updated

type AgentSelectedMsg

type AgentSelectedMsg struct {
	Agent *daemon.AgentState
}

AgentSelectedMsg is sent when an agent is selected

type Dashboard

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

Dashboard is the main TUI model that displays agent status, output, and progress

func NewDashboard

func NewDashboard(state *daemon.RuntimeState, eventBus *events.EventBus) *Dashboard

NewDashboard creates a new dashboard TUI with in-process state and event bus

func (*Dashboard) Init

func (d *Dashboard) Init() tea.Cmd

Init initializes the dashboard

func (*Dashboard) Run

func (d *Dashboard) Run() error

Run starts the dashboard TUI

func (*Dashboard) Update

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

Update handles messages and updates the dashboard state

func (*Dashboard) View

func (d *Dashboard) View() string

View renders the dashboard

type RemoteClient

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

RemoteClient connects to a running daemon via HTTP/WebSocket

func NewRemoteClient

func NewRemoteClient(addr string) *RemoteClient

NewRemoteClient creates a new remote client for the given daemon address

func (*RemoteClient) BaseURL

func (c *RemoteClient) BaseURL() string

BaseURL returns the base HTTP URL

func (*RemoteClient) Close

func (c *RemoteClient) Close() error

Close closes the WebSocket connection

func (*RemoteClient) Connect

func (c *RemoteClient) Connect() error

Connect establishes connection to the daemon First fetches initial state via HTTP, then connects WebSocket for updates

func (*RemoteClient) GetEventBus

func (c *RemoteClient) GetEventBus() *events.EventBus

GetEventBus returns the event bus for use by the TUI

func (*RemoteClient) GetState

func (c *RemoteClient) GetState() *daemon.RuntimeState

GetState returns the runtime state for use by the TUI

func (*RemoteClient) IsConnected

func (c *RemoteClient) IsConnected() bool

IsConnected returns whether the client is connected

type TerminalModel

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

TerminalModel represents the terminal pane that displays agent output

func NewTerminalModel

func NewTerminalModel() TerminalModel

NewTerminalModel creates a new terminal model

func (TerminalModel) Init

func (m TerminalModel) Init() tea.Cmd

Init initializes the terminal model

func (*TerminalModel) SetAgent

func (m *TerminalModel) SetAgent(agent *daemon.AgentState)

SetAgent updates the selected agent

func (TerminalModel) Update

func (m TerminalModel) Update(msg tea.Msg) (TerminalModel, tea.Cmd)

Update handles messages and updates the terminal model

func (TerminalModel) View

func (m TerminalModel) View() string

View renders the terminal pane

Jump to

Keyboard shortcuts

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