Documentation
¶
Overview ¶
Package tui implements the terminal user interface for Ghost's interactive chat mode using the BubbleTea framework. It handles user input, message display, viewport management, and LLM streaming integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLLMClientInit indicates the LLM client was not properly initialized before use. ErrLLMClientInit = errors.New("failed to initialize LLM client") // ErrLLMRequest indicates an LLM request processing failure in the TUI context. ErrLLMRequest = errors.New("failed to process LLM request") )
Functions ¶
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents the TUI application state for the chat interface. It implements the BubbleTea Model interface (Init, Update, View).
func NewModel ¶
func NewModel(ctx context.Context, llmClient llm.LLMClient, timeout time.Duration, logger *log.Logger) Model
NewModel creates a new TUI model initialized with the provided dependencies. The model is pre-configured with a system prompt and greeting instruction that will be sent to the LLM on initialization.
func (Model) Init ¶
Init initializes the TUI and returns a command to send the initial greeting. This is called once when the BubbleTea program starts.