ui

package
v0.0.0-...-8065d5d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintUnansweredDebug

func PrintUnansweredDebug(ctx context.Context, client *api.Client, w io.Writer) error

PrintUnansweredDebug prints one line per active chat with every signal the unanswered filter reads, so filter bugs can be diagnosed from flags alone. IDs are reduced to their shape and no titles, names, or text are printed.

func RunChatQuery

func RunChatQuery(ctx context.Context, lc *llm.Client, client *api.Client, people *person.Store, question string) (answer string, trace []string, err error)

RunChatQuery answers one question through the full tool loop without the TUI. It exists for eval harnesses: the answer and tool trace come back as plain strings for a human to judge.

Types

type ConnState

type ConnState int

ConnState is the live-events connection state shown in the status bar. The zero value connIdle means no WebSocket client is attached and keeps the status bar quiet.

type Mode

type Mode int

Mode is the top-level UI state. INSERT (M2) and overlays (M1.5) slot in later.

const (
	ModeList Mode = iota
	ModeConversation
	ModeInsert
	ModeSearch
	ModeReact
	ModeChat
	ModeChatInsert
)

type Model

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

Model holds all TUI state. bubbletea passes it by value through Update, so navigation methods use value receivers and return a new Model.

func New

func New(client *api.Client, events *ws.Client) Model

New builds the initial model. The chat fetch happens in Init, not here. events may be nil, which disables live updates.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Snapshot

func (m Model) Snapshot() state.Cache

Snapshot captures what the next launch needs to warm-start.

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

func (Model) WithCache

func (m Model) WithCache(c state.Cache, path string) Model

WithCache warm-starts the model from a cached snapshot, so the first frame shows chats instead of "Loading…". Init's REST fetch still runs and replaces the snapshot when fresh data lands.

func (Model) WithLLM

func (m Model) WithLLM(c *llm.Client) Model

WithLLM attaches the local-model client backing the chat tab. A nil client leaves the tab in its setup-help state.

func (Model) WithMerges

func (m Model) WithMerges(p *identity.MergePolicy) Model

WithMerges attaches the cross-network identity merge policy.

func (Model) WithPeople

func (m Model) WithPeople(s *person.Store) Model

WithPeople attaches the person-card store used by the chat tools.

func (Model) WithVault

func (m Model) WithVault(v *redact.Vault) Model

WithVault attaches the session redaction vault so contact refreshes can register identities discovered after startup.

type Tab

type Tab int

Tab is a client-side filter over the fetched chat list. Each tab partitions chats by flags already present on every Chat, so switching tabs needs no network round-trip.

const (
	TabInbox Tab = iota
	TabUnread
	TabMentions
	TabPinned
	TabLowPriority
	TabArchive
	// TabChat is not a chat-list filter: it hosts the local-LLM assistant
	// via ModeChat.
	TabChat
)

Jump to

Keyboard shortcuts

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