Documentation
¶
Index ¶
- Constants
- type MsgAgentSet
- type MsgConversationDeleted
- type MsgConversationListLoaded
- type MsgConversationLoaded
- type MsgConversationPersisted
- type MsgConversationSearchResults
- type MsgMessageAdded
- type MsgMessageUpdated
- type MsgModelSet
- type MsgResponseStopped
- type MsgTitleGenerated
- type SelectionBehavior
- type Service
- func (s *Service) BranchMessage(index int, content string) tea.Cmd
- 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) PersistConversation(next tea.Cmd) 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
- func (s *Service) StopResponse() tea.Cmd
- func (s *Service) UpdateMessage(index int, content string) 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 MsgConversationPersisted ¶
MsgConversationPersisted is sent when conversation is persisted
type MsgConversationSearchResults ¶
type MsgConversationSearchResults struct {
Conversations conversation.ConversationList
Query string
}
MsgConversationSearchResults is sent when conversation search completes
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 MsgResponseStopped ¶
type MsgResponseStopped struct{}
MsgResponseStopped is sent when response is stopped by the user
type MsgTitleGenerated ¶
type MsgTitleGenerated struct {
Title string
}
MsgTitleGenerated is sent when title is generated
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) BranchMessage ¶
BranchMessage creates a new message with the given content branching off from the same parent as the message at index, without copying descendants. The new message is set as the selected path. Used when editing a message that already has replies.
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.
func (*Service) StopResponse ¶
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