components

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeCmd

func EscapeCmd() tea.Msg

func ListDeleteCmd

func ListDeleteCmd(selectedIndex int) func() tea.Msg

func ListEnterCmd

func ListEnterCmd(selectedIndex int) func() tea.Msg

func ListSelectCmd

func ListSelectCmd(selectedIndex int) func() tea.Msg

func NewThreadListItemDelegate

func NewThreadListItemDelegate() list.ItemDelegate

func NewThreadListItems

func NewThreadListItems(threads []*db.Thread) []list.Item

func SettingsSubmitCmd

func SettingsSubmitCmd(msg SettingsSubmitMsg) tea.Cmd

Types

type ChatInputModel

type ChatInputModel struct {
	// contains filtered or unexported fields
}

func NewChatInputModel

func NewChatInputModel(width, height int) ChatInputModel

func (*ChatInputModel) Blur

func (c *ChatInputModel) Blur()

func (*ChatInputModel) EnterCmd

func (c *ChatInputModel) EnterCmd(value string) tea.Cmd

func (*ChatInputModel) Focus

func (c *ChatInputModel) Focus() tea.Cmd

func (*ChatInputModel) Update

func (c *ChatInputModel) Update(msg tea.Msg) (ChatInputModel, tea.Cmd)

func (*ChatInputModel) Value

func (c *ChatInputModel) Value() string

func (*ChatInputModel) View

func (c *ChatInputModel) View() string

type ChatInputReturnMsg

type ChatInputReturnMsg struct {
	Value string
}

type ChatModel

type ChatModel struct {
	// contains filtered or unexported fields
}

func NewChatModel

func NewChatModel(width, height int) ChatModel

func (*ChatModel) AddMessage

func (m *ChatModel) AddMessage(msg Message)

func (*ChatModel) ResetMessages

func (m *ChatModel) ResetMessages()

func (*ChatModel) ScrollToBottom

func (m *ChatModel) ScrollToBottom()

func (*ChatModel) SetMessage

func (m *ChatModel) SetMessage(index int, msg Message)

func (*ChatModel) SetSize

func (m *ChatModel) SetSize(width, height int)

func (*ChatModel) Update

func (m *ChatModel) Update(msg tea.Msg) (ChatModel, tea.Cmd)

func (*ChatModel) View

func (m *ChatModel) View() string

type Component

type Component string
const (
	ComponentHistory       Component = "history"
	ComponentMessages      Component = "messages"
	ComponentInnerMessages Component = "innerMessages"
	ComponentChatInput     Component = "chatInput"
	ComponentSettings      Component = "settings"
	ComponentNone          Component = "none" // utility component
)

type EscapeMsg

type EscapeMsg struct{}

type ListDeleteMsg

type ListDeleteMsg struct {
	Index int
}

type ListEnterMsg

type ListEnterMsg struct {
	Index int
}

type ListModel

type ListModel struct {
	// contains filtered or unexported fields
}

func NewListModel

func NewListModel(i *NewListModelInput) ListModel

func (*ListModel) Blur

func (m *ListModel) Blur()

func (*ListModel) Focus

func (m *ListModel) Focus()

func (*ListModel) GoToLastPage

func (m *ListModel) GoToLastPage()

func (*ListModel) Select

func (m *ListModel) Select(i int)

func (*ListModel) SetItem

func (m *ListModel) SetItem(index int, item list.Item) tea.Cmd

func (*ListModel) SetItems

func (m *ListModel) SetItems(items []list.Item) tea.Cmd

func (*ListModel) Update

func (m *ListModel) Update(msg tea.Msg) (ListModel, tea.Cmd)

func (*ListModel) View

func (m *ListModel) View() string

type ListSelectMsg

type ListSelectMsg struct {
	Index int
}

type Message

type Message struct {
	Content   string
	CreatedAt string
	IsUser    bool
}

TODO: use same Message model throughout the app

type NewListModelInput

type NewListModelInput struct {
	Title                  string
	Items                  []list.Item
	Width                  int
	Height                 int
	AllowInfiniteScrolling bool
	Delegate               list.ItemDelegate
}

type SettingsMode

type SettingsMode int
const (
	SettingsModeAPIKey SettingsMode = iota
	SettingsModeLLMModel
)

type SettingsModel

type SettingsModel struct {
	// contains filtered or unexported fields
}

func NewSettingsModel

func NewSettingsModel() SettingsModel

func (*SettingsModel) Blur

func (m *SettingsModel) Blur()

func (*SettingsModel) Focus

func (m *SettingsModel) Focus() tea.Cmd

func (*SettingsModel) Update

func (m *SettingsModel) Update(msg interface{}) (SettingsModel, tea.Cmd)

func (*SettingsModel) View

func (m *SettingsModel) View() string

type SettingsSubmitMsg

type SettingsSubmitMsg struct {
	APIKey   string
	LLMModel string
}

type ThreadListItem

type ThreadListItem struct {
	// contains filtered or unexported fields
}

ThreadListItem implements the list.Item, list.DefaultItem and list.ItemDelegate interface

func (*ThreadListItem) Description

func (t *ThreadListItem) Description() string

func (*ThreadListItem) FilterValue

func (t *ThreadListItem) FilterValue() string

func (*ThreadListItem) Title

func (t *ThreadListItem) Title() string

type ThreadListItemDelegate

type ThreadListItemDelegate struct {
	// contains filtered or unexported fields
}

func (*ThreadListItemDelegate) Height

func (d *ThreadListItemDelegate) Height() int

func (*ThreadListItemDelegate) Render

func (d *ThreadListItemDelegate) Render(w io.Writer, m list.Model, index int, item list.Item)

func (*ThreadListItemDelegate) Spacing

func (d *ThreadListItemDelegate) Spacing() int

func (*ThreadListItemDelegate) Update

func (t *ThreadListItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

Jump to

Keyboard shortcuts

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