Documentation
¶
Index ¶
- Constants
- type MsgAgentSet
- type MsgConversationDeleted
- type MsgConversationListLoaded
- type MsgConversationLoaded
- type MsgConversationSearchResults
- type MsgConversationTitleGenerated
- type MsgMessageAdded
- type MsgMessageUpdated
- type MsgModelSet
- type SelectionBehavior
- type Service
- func (s *Service) CycleSelection(message *conversation.Message, forward bool, isRoot bool) tea.Cmd
- func (s *Service) DeleteConversation(id uint) tea.Cmd
- func (s *Service) DeleteMessage(index int, withDescendants bool) tea.Cmd
- func (s *Service) GenerateTitle() tea.Cmd
- func (s *Service) LoadConversation(id uint, selectBehavior SelectionBehavior) tea.Cmd
- func (s *Service) LoadConversationList() tea.Cmd
- func (s *Service) LoadSession(id uint) (*session.Session, error)
- func (s *Service) NewConversation() tea.Cmd
- func (s *Service) PersistTitle() tea.Cmd
- func (s *Service) SearchConversations(query string) tea.Cmd
- func (s *Service) SetAgent(agent *api.Agent) tea.Cmd
- func (s *Service) SetModel(model *api.Model) tea.Cmd
- type TUI
Constants ¶
const CONVERSATION_LIST_COUNT = 250
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MsgAgentSet ¶
MsgAgentSet is sent when the agent is set
type MsgConversationDeleted ¶
type MsgConversationDeleted struct {
ConversationID uint
}
MsgConversationDeleted is sent when a conversation is deleted
type MsgConversationListLoaded ¶
type MsgConversationListLoaded struct {
Conversations conversation.ConversationList
}
MsgConversationListLoaded is sent when the conversation list is loaded
type MsgConversationLoaded ¶
type MsgConversationLoaded struct {
Session *session.Session
SelectionBehavior SelectionBehavior
}
MsgConversationLoaded is sent when a conversation is loaded
type MsgConversationSearchResults ¶
type MsgConversationSearchResults struct {
Conversations conversation.ConversationList
Query string
}
MsgConversationSearchResults is sent when conversation search completes
type MsgConversationTitleGenerated ¶ added in v0.8.0
type MsgConversationTitleGenerated struct {
Title string
}
MsgConversationTitleGenerated is sent when title is generated
type MsgMessageAdded ¶
type MsgMessageAdded struct {
Message conversation.Message
Index int
}
MsgMessageAdded is sent when a message is added
type MsgMessageUpdated ¶
type MsgMessageUpdated struct {
Message conversation.Message
Index int
}
MsgMessageUpdated is sent when a message is updated
type MsgModelSet ¶
MsgModelSet is sent when the model is set
type SelectionBehavior ¶
type SelectionBehavior int
SelectionBehavior controls where the selected message lands after a conversation load
const ( SelectionEnd SelectionBehavior = iota // jump to the last message SelectionStart // jump to the first message SelectionKeep // keep the current selected index )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CycleSelection ¶
func (*Service) DeleteMessage ¶
func (*Service) GenerateTitle ¶
func (*Service) LoadConversation ¶
func (s *Service) LoadConversation(id uint, selectBehavior SelectionBehavior) tea.Cmd
func (*Service) LoadConversationList ¶
func (*Service) LoadSession ¶ added in v0.7.0
LoadSession fetches a conversation by ID, loads its message thread, and restores the saved agent and workspace. Shared by the sync initial-load path and the async Service.LoadConversation.
func (*Service) NewConversation ¶
func (*Service) PersistTitle ¶
PersistTitle saves only the conversation metadata (e.g. title) to the repo without re-persisting messages. Used after title generation.
type TUI ¶
type TUI struct {
Ctx *lmcli.Context
Service Service
Conversations conversation.ConversationList
Session *session.Session
// InitialMessage is an optional message to send immediately when the
// chat view opens. Cleared after being consumed.
InitialMessage string
}
TUI holds the top-level state shared across TUI views.
func New ¶
func New(ctx *lmcli.Context, initialConversation *conversation.Conversation, temperatureOverride *float32, maxTokensOverride *int, permission api.PermissionMode) *TUI