tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package tui is `mesh tui`: a keyboard-driven terminal view of the vault over the same index + graph + retriever the agent uses. Three panes: a notes list, ranked search results, and a markdown preview with the note's neighbors. Built on bubbletea/lipgloss; the Backend interface keeps the UI testable and leaves room for a future remote backend (deferred, like the web viewer's).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(vaultRoot string) error

Run opens the vault and runs the TUI in the alternate screen.

Types

type App

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

App is the parent bubbletea model: three panes (notes list, search results, preview) with focus arbitration and a single keymap.

func NewApp

func NewApp(be Backend) *App

NewApp builds the model over a Backend.

func (*App) Init

func (a *App) Init() tea.Cmd

func (*App) Update

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

func (*App) View

func (a *App) View() string

---- view ----

type Backend

type Backend interface {
	Notes() []NoteRef
	Search(query string) ([]retrieve.Card, error)
	Note(id string) (NoteDetail, error)
}

Backend is the data surface the TUI renders. LocalBackend reads the on-disk index + graph; a RemoteBackend (over the hub) is deferred.

type LocalBackend

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

LocalBackend serves the TUI from the local SQLite index + in-memory graph.

func NewLocalBackend

func NewLocalBackend(vaultRoot string) (*LocalBackend, func() error, error)

NewLocalBackend opens the vault index, builds the graph once, and returns the backend plus a close func the caller defers.

func (*LocalBackend) Note

func (b *LocalBackend) Note(id string) (NoteDetail, error)

Note reads a note's markdown and its typed neighbors (in + out, headings and the note itself excluded).

func (*LocalBackend) Notes

func (b *LocalBackend) Notes() []NoteRef

Notes lists every note, hubs first (highest degree), ties by title.

func (*LocalBackend) Search

func (b *LocalBackend) Search(query string) ([]retrieve.Card, error)

Search runs the same fused retrieval the agent's mesh_search uses.

type NeighborRef

type NeighborRef struct {
	ID, Title, Rel, Dir string // Dir: out (this -> it) | in (it -> this)
}

NeighborRef is one linked note shown under the preview.

type NoteDetail

type NoteDetail struct {
	ID, Title, Path, Type string
	Body                  string
	Neighbors             []NeighborRef
}

NoteDetail is the preview payload: the note body plus its neighbors.

type NoteRef

type NoteRef struct {
	ID, Title, Path, Type string
	Degree, Community     int
}

NoteRef is one row in the notes list.

Jump to

Keyboard shortcuts

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