tui

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tui provides an offline contribution workbench over local corpus data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the TUI state.

func New

func New(ctx context.Context, reader tuicontract.Reader, opts ...Option) Model

New creates a Model for the given reader and lifecycle context.

func Run

func Run(ctx context.Context, reader tuicontract.Reader, input io.Reader, output io.Writer) (Model, error)

Run starts the TUI program with the provided local reader and I/O.

It is suitable for later CLI wiring: the caller supplies a context, a Reader, and input/output streams. The TUI loads local data on start and never performs network I/O on its own.

func (Model) Init

func (m Model) Init() tea.Cmd

Init triggers an asynchronous local load. No network I/O is performed here.

func (Model) String

func (m Model) String() string

String returns a short human-readable identifier for the current selection.

func (Model) Update

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

Update processes messages and returns the updated model and any commands.

func (Model) View

func (m Model) View() tea.View

View renders the current model state.

type Option

type Option func(*Model)

Option customizes a Model.

func WithActionProvider added in v0.14.0

func WithActionProvider(provider tuicontract.ActionProvider) Option

WithActionProvider registers typed contextual application operations. Loading, navigation, filtering, and detail inspection remain local.

func WithBriefProvider added in v0.14.0

func WithBriefProvider(provider tuicontract.BriefProvider) Option

WithBriefProvider registers the offline research-brief capability.

func WithSize

func WithSize(w, h int) Option

WithSize sets the initial terminal size.

type Runner

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

Runner implements the product-owned TUI runner contract.

func NewRunner

func NewRunner(
	reader tuicontract.Reader,
	actions tuicontract.ActionProvider,
	briefs tuicontract.BriefProvider,
	input io.Reader,
	output io.Writer,
) *Runner

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, opts contracts.TUIOptions) error

Jump to

Keyboard shortcuts

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