Documentation
¶
Overview ¶
Package tui provides the full-screen chat TUI for the default glean invocation.
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 Bubbletea model for the glean chat TUI.
func New ¶
func New(cfg *config.Config, session *Session, identity, version string, ctx context.Context) (*Model, error)
New creates a fully-initialized TUI model.
func (*Model) Session ¶
Session returns the current session (used by cmd/root.go for post-exit stats).
func (*Model) StatsLine ¶
StatsLine builds a brief session summary printed to stdout after the TUI exits. Format: "N turns · 5m 30s · Thanks for using Glean"
type Session ¶
type Session struct {
Turns []Turn `json:"turns"`
}
Session holds conversation history and can be persisted to disk.
func LoadLatest ¶
func LoadLatest() *Session
LoadLatest loads the last saved session, or returns an empty session if none exists.
func (*Session) AppendTurn ¶
AppendTurn appends a complete Turn (including Elapsed and any other fields) to the session and saves immediately.
type Source ¶
type Source struct {
Title string `json:"title"`
URL string `json:"url"`
Datasource string `json:"datasource"`
}
Source is a cited document reference shown below an AI response.
type Turn ¶
type Turn struct {
Role string `json:"role"` // "user" or "assistant"
Content string `json:"content"` // full text of the message
Sources []Source `json:"sources,omitempty"` // cited documents
Elapsed string `json:"elapsed,omitempty"` // response time, e.g. "4.2s"
}
Turn holds one exchange in the conversation history.