tui

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NullWriter

func NullWriter() io.Writer

NullWriter returns an io.Writer that discards everything.

func SuppressOutputs

func SuppressOutputs(fn func())

SuppressOutputs redirects both stdout and stderr to /dev/null for the duration of fn, then restores them. Used to silence ChromaDB/hnswlib integrity-check and stats noise.

func SuppressStderr

func SuppressStderr(fn func())

SuppressStderr redirects stderr to /dev/null for the duration of fn, then restores it. Used to silence ChromaDB/hnswlib integrity-check noise that would otherwise bleed into the TUI.

Types

type LiveSearchModel

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

LiveSearchModel is a Bubble Tea model for interactive live semantic search. The user types a query; results update automatically after a short debounce.

inflight is a *int64 pointer (heap-allocated) so that value-copies of the model (as Bubble Tea requires) do not violate sync/atomic noCopy rules.

func NewLiveSearch

func NewLiveSearch(searchFn SearchFunc, vaultName string, limit int, initialQuery string, useEditor bool) LiveSearchModel

NewLiveSearch creates a LiveSearchModel. searchFn wraps embed+query so the TUI has no direct dependency on the store/embedder packages.

func (LiveSearchModel) Init

func (m LiveSearchModel) Init() tea.Cmd

func (LiveSearchModel) Update

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

func (LiveSearchModel) View

func (m LiveSearchModel) View() tea.View

type Model

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

Model is the Bubble Tea model for the interactive result browser.

func NewResultBrowser

func NewResultBrowser(header, vaultName string, results []store.Result, useEditor bool) Model

NewResultBrowser creates a new interactive search results browser.

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() tea.View

type SearchFunc

type SearchFunc func(ctx context.Context, query string) ([]store.Result, error)

SearchFunc is the function signature used to perform a vector search. It is decoupled from concrete types so tests can inject a stub.

Jump to

Keyboard shortcuts

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