Documentation
¶
Index ¶
- Variables
- func Run(ctx context.Context, store storage.Backend, know *knowledge.Engine, ...) error
- func StatColor(index int) lipgloss.Color
- type CollectionWithStats
- type Config
- type ConversationModel
- type DashboardModel
- type DashboardStats
- type EntityModel
- type KeyMap
- type KnowledgeModel
- type Model
- type View
Constants ¶
This section is empty.
Variables ¶
var ( ColorBgPrimary = lipgloss.Color("#0d1117") ColorBgSecondary = lipgloss.Color("#161b22") ColorBgTertiary = lipgloss.Color("#21262d") ColorBorder = lipgloss.Color("#30363d") ColorTextPrimary = lipgloss.Color("#c9d1d9") ColorTextMuted = lipgloss.Color("#6e7681") ColorBlue = lipgloss.Color("#58a6ff") ColorGreen = lipgloss.Color("#3fb950") ColorPurple = lipgloss.Color("#a371f7") ColorOrange = lipgloss.Color("#d29922") ColorRed = lipgloss.Color("#f85149") )
Colors matching the web dashboard dark theme
var ( // Base styles BaseStyle = lipgloss.NewStyle(). Background(ColorBgPrimary). Foreground(ColorTextPrimary) // Title bar TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorTextPrimary). Background(ColorBgSecondary). Padding(0, 1) // Sidebar navigation SidebarStyle = lipgloss.NewStyle(). Width(24). Background(ColorBgSecondary). BorderStyle(lipgloss.NormalBorder()). BorderRight(true). BorderForeground(ColorBorder) Padding(0, 2). Foreground(ColorTextMuted) Padding(0, 2). Foreground(ColorTextPrimary). Background(ColorBgTertiary). Bold(true) // Main content area ContentStyle = lipgloss.NewStyle(). Padding(1, 2) // Cards/boxes CardStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(1, 2). MarginBottom(1) CardTitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorTextPrimary). MarginBottom(1) // Stats StatValueStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorBlue) StatLabelStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted) // Tables TableHeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(ColorTextMuted). BorderStyle(lipgloss.NormalBorder()). BorderBottom(true). BorderForeground(ColorBorder) TableRowStyle = lipgloss.NewStyle(). Foreground(ColorTextPrimary) TableRowSelectedStyle = lipgloss.NewStyle(). Foreground(ColorTextPrimary). Background(ColorBgTertiary) // Badges BadgeStyle = lipgloss.NewStyle(). Padding(0, 1). Background(ColorBgTertiary). Foreground(ColorTextMuted) BadgeBlueStyle = lipgloss.NewStyle(). Padding(0, 1). Background(lipgloss.Color("#1a3a5c")). Foreground(ColorBlue) BadgeGreenStyle = lipgloss.NewStyle(). Padding(0, 1). Background(lipgloss.Color("#1a3d2a")). Foreground(ColorGreen) BadgePurpleStyle = lipgloss.NewStyle(). Padding(0, 1). Background(lipgloss.Color("#2d1f4a")). Foreground(ColorPurple) BadgeOrangeStyle = lipgloss.NewStyle(). Padding(0, 1). Background(lipgloss.Color("#3d2e1a")). Foreground(ColorOrange) // Help text HelpStyle = lipgloss.NewStyle(). Foreground(ColorTextMuted). MarginTop(1) // Status bar StatusBarStyle = lipgloss.NewStyle(). Background(ColorBgSecondary). Foreground(ColorTextMuted). Padding(0, 1) // Error/warning messages ErrorStyle = lipgloss.NewStyle(). Foreground(ColorRed) SuccessStyle = lipgloss.NewStyle(). Foreground(ColorGreen) // Input fields InputStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.RoundedBorder()). BorderForeground(ColorBorder). Padding(0, 1) InputFocusedStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.RoundedBorder()). BorderForeground(ColorBlue). Padding(0, 1) // List items ListItemStyle = lipgloss.NewStyle(). Foreground(ColorTextPrimary) ListItemSelectedStyle = lipgloss.NewStyle(). Foreground(ColorBlue). Bold(true) // Spinner SpinnerStyle = lipgloss.NewStyle(). Foreground(ColorBlue) )
Styles for the TUI components
Functions ¶
Types ¶
type CollectionWithStats ¶
type CollectionWithStats struct {
Collection *types.Collection
Stats *types.CollectionStats
}
CollectionWithStats holds collection with its stats
type ConversationModel ¶
type ConversationModel struct {
// contains filtered or unexported fields
}
ConversationModel handles the conversations view
func NewConversationModel ¶
func NewConversationModel(parent *Model) *ConversationModel
NewConversationModel creates a new conversation model
func (*ConversationModel) LoadThreadDetail ¶
func (m *ConversationModel) LoadThreadDetail(threadID string) tea.Cmd
LoadThreadDetail loads a single thread with messages
func (*ConversationModel) LoadThreads ¶
func (m *ConversationModel) LoadThreads() tea.Cmd
LoadThreads loads all conversation threads
func (*ConversationModel) Update ¶
func (m *ConversationModel) Update(msg tea.Msg) tea.Cmd
Update handles messages for the conversation view
func (*ConversationModel) View ¶
func (m *ConversationModel) View() string
View renders the conversation view
type DashboardModel ¶
type DashboardModel struct {
// contains filtered or unexported fields
}
DashboardModel handles the dashboard view
func NewDashboardModel ¶
func NewDashboardModel(parent *Model) *DashboardModel
NewDashboardModel creates a new dashboard model
func (*DashboardModel) LoadStats ¶
func (m *DashboardModel) LoadStats() tea.Cmd
LoadStats loads the dashboard statistics
func (*DashboardModel) Update ¶
func (m *DashboardModel) Update(msg tea.Msg) tea.Cmd
Update handles messages for the dashboard view
func (*DashboardModel) View ¶
func (m *DashboardModel) View() string
View renders the dashboard view
type DashboardStats ¶
DashboardStats holds the dashboard overview statistics
type EntityModel ¶
type EntityModel struct {
// contains filtered or unexported fields
}
EntityModel handles the entities view
func NewEntityModel ¶
func NewEntityModel(parent *Model) *EntityModel
NewEntityModel creates a new entity model
func (*EntityModel) LoadEntities ¶
func (m *EntityModel) LoadEntities() tea.Cmd
LoadEntities loads all entities
func (*EntityModel) LoadEntityDetail ¶
func (m *EntityModel) LoadEntityDetail(entityID string) tea.Cmd
LoadEntityDetail loads a single entity with relationships and mentions
type KeyMap ¶
type KeyMap struct {
Up key.Binding
Down key.Binding
Left key.Binding
Right key.Binding
Enter key.Binding
Back key.Binding
Tab key.Binding
Search key.Binding
Refresh key.Binding
Help key.Binding
Quit key.Binding
}
KeyMap defines the key bindings for the TUI
type KnowledgeModel ¶
type KnowledgeModel struct {
// contains filtered or unexported fields
}
KnowledgeModel handles the knowledge browser view
func NewKnowledgeModel ¶
func NewKnowledgeModel(parent *Model) *KnowledgeModel
NewKnowledgeModel creates a new knowledge model
func (*KnowledgeModel) LoadCollectionDetail ¶
func (m *KnowledgeModel) LoadCollectionDetail(id string) tea.Cmd
LoadCollectionDetail loads a single collection's details
func (*KnowledgeModel) LoadCollections ¶
func (m *KnowledgeModel) LoadCollections() tea.Cmd
LoadCollections loads all collections
func (*KnowledgeModel) Update ¶
func (m *KnowledgeModel) Update(msg tea.Msg) tea.Cmd
Update handles messages for the knowledge view
func (*KnowledgeModel) View ¶
func (m *KnowledgeModel) View() string
View renders the knowledge view
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main TUI application model
func New ¶
func New( ctx context.Context, store storage.Backend, know *knowledge.Engine, conv *conversation.Engine, ctxEng *ctxengine.Engine, ent *entity.Engine, cfg *Config, ) *Model
New creates a new TUI model