app

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CONVERSATION_LIST_COUNT = 250

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgAgentSet

type MsgAgentSet struct {
	Agent *api.Agent
}

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

type MsgConversationPersisted struct {
	Next tea.Cmd
}

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

type MsgModelSet struct {
	Model *api.Model
}

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 NewService(state *TUI) *Service

func (*Service) BranchMessage

func (s *Service) BranchMessage(index int, content string) tea.Cmd

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 (s *Service) CycleSelection(message *conversation.Message, forward bool, isRoot bool) tea.Cmd

func (*Service) DeleteConversation

func (s *Service) DeleteConversation(id uint) tea.Cmd

func (*Service) DeleteMessage

func (s *Service) DeleteMessage(index int, withDescendants bool) tea.Cmd

func (*Service) GenerateTitle

func (s *Service) GenerateTitle() tea.Cmd

func (*Service) LoadConversation

func (s *Service) LoadConversation(id uint, selectBehavior SelectionBehavior) tea.Cmd

func (*Service) LoadConversationList

func (s *Service) LoadConversationList() tea.Cmd

func (*Service) LoadSession added in v0.7.0

func (s *Service) LoadSession(id uint) (*session.Session, error)

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 (s *Service) NewConversation() tea.Cmd

func (*Service) PersistConversation

func (s *Service) PersistConversation(next tea.Cmd) tea.Cmd

func (*Service) PersistTitle

func (s *Service) PersistTitle() tea.Cmd

PersistTitle saves only the conversation metadata (e.g. title) to the repo without re-persisting messages. Used after title generation.

func (*Service) SearchConversations

func (s *Service) SearchConversations(query string) tea.Cmd

func (*Service) SetAgent

func (s *Service) SetAgent(agent *api.Agent) tea.Cmd

func (*Service) SetModel

func (s *Service) SetModel(model *api.Model) tea.Cmd

func (*Service) StopResponse

func (s *Service) StopResponse() tea.Cmd

func (*Service) UpdateMessage

func (s *Service) UpdateMessage(index int, content string) tea.Cmd

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

func (*TUI) ActiveModel

func (s *TUI) ActiveModel(style lipgloss.Style) string

func (*TUI) HandleMessageDelete

func (s *TUI) HandleMessageDelete(msgId uint)

Jump to

Keyboard shortcuts

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