Documentation
¶
Overview ¶
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Package tui provides a full-featured terminal user interface for gmn. Copyright 2025 Tomohiro Owada SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func Run(config Config, client *api.Client, sessionMgr *session.Manager, ...) error
- type ActivityItem
- type ActivityStatus
- type ActivityType
- type App
- type ChatMessage
- type ChatViewModel
- func (c *ChatViewModel) AddMessage(msg ChatMessage)
- func (c *ChatViewModel) Clear()
- func (c *ChatViewModel) SetFocused(focused bool)
- func (c *ChatViewModel) SetLoading(loading bool, text string)
- func (c *ChatViewModel) SetSize(width, height int)
- func (c *ChatViewModel) Update(msg tea.Msg) tea.Cmd
- func (c *ChatViewModel) UpdateLastMessage(content string)
- func (c *ChatViewModel) View() string
- type Config
- type ConfirmChoice
- type ConfirmDialogModel
- type ConfirmDialogOptions
- type ConfirmationType
- type ContextItem
- type ContextPanelModel
- func (c *ContextPanelModel) AddActivity(activity ActivityItem)
- func (c *ContextPanelModel) AddContextItem(item ContextItem)
- func (c *ContextPanelModel) ClearContext()
- func (c *ContextPanelModel) RemoveContextItem(path string)
- func (c *ContextPanelModel) SetFocused(focused bool)
- func (c *ContextPanelModel) SetSize(width, height int)
- func (c *ContextPanelModel) ToggleActivities()
- func (c *ContextPanelModel) ToggleContext()
- func (c *ContextPanelModel) UpdateLastActivity(status ActivityStatus, duration time.Duration)
- func (c ContextPanelModel) View() string
- type ContextType
- type DiffLine
- type DiffLineType
- type FilePreviewModel
- func (f *FilePreviewModel) Hide()
- func (f *FilePreviewModel) IsVisible() bool
- func (f *FilePreviewModel) ScrollDown(lines int)
- func (f *FilePreviewModel) ScrollUp(lines int)
- func (f *FilePreviewModel) SetCommandPreview(command, explanation string)
- func (f *FilePreviewModel) SetDiffPreview(title, path, oldContent, newContent string)
- func (f *FilePreviewModel) SetFilePreview(title, path, content string)
- func (f *FilePreviewModel) SetOutputPreview(title, output string)
- func (f *FilePreviewModel) SetSize(width, height int)
- func (f *FilePreviewModel) Show()
- func (f *FilePreviewModel) Toggle()
- func (f FilePreviewModel) View() string
- type FocusArea
- type HeaderModel
- type InputModel
- func (i *InputModel) DeleteChar()
- func (i *InputModel) DeleteCharForward()
- func (i *InputModel) DeleteLine()
- func (i *InputModel) DeleteWord()
- func (i *InputModel) HistoryDown()
- func (i *InputModel) HistoryUp()
- func (i *InputModel) InsertChar(c rune)
- func (i *InputModel) InsertString(s string)
- func (i *InputModel) MoveLeft()
- func (i *InputModel) MoveRight()
- func (i *InputModel) MoveToEnd()
- func (i *InputModel) MoveToStart()
- func (i *InputModel) Reset()
- func (i *InputModel) SetFocused(focused bool)
- func (i *InputModel) SetValue(value string)
- func (i *InputModel) SetWidth(width int)
- func (i *InputModel) Value() string
- func (i *InputModel) View() string
- type KeyMap
- type MarkdownRenderer
- type MessageType
- type PreviewType
- type SessionInfo
- type SidebarModel
- func (s *SidebarModel) MoveDown()
- func (s *SidebarModel) MoveUp()
- func (s *SidebarModel) SelectedSession() *SessionInfo
- func (s *SidebarModel) SetFocused(focused bool)
- func (s *SidebarModel) SetSessions(sessions []SessionInfo)
- func (s *SidebarModel) SetSize(width, height int)
- func (s SidebarModel) View() string
- type SpinnerModel
- type StatusBarModel
- type StepStatus
- type ThinkingModel
- func (t *ThinkingModel) AddStep(label string)
- func (t *ThinkingModel) CompleteStep()
- func (t *ThinkingModel) FailStep()
- func (t ThinkingModel) IsActive() bool
- func (t *ThinkingModel) SetMessage(message string)
- func (t *ThinkingModel) SetWidth(width int)
- func (t *ThinkingModel) Start(message string) tea.Cmd
- func (t *ThinkingModel) Stop()
- func (t *ThinkingModel) Update(msg tea.Msg) tea.Cmd
- func (t ThinkingModel) View() string
- type ThinkingStep
Constants ¶
This section is empty.
Variables ¶
var ( ConfirmDialogStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(AccentColor). Padding(1, 2). Background(BackgroundColor) ButtonStyle = lipgloss.NewStyle(). Foreground(TextColor). Background(SurfaceColor). Padding(0, 2). MarginRight(1) ConfirmButtonSelectedStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFFFFF")). Background(SuccessColor). Padding(0, 2). MarginRight(1). Bold(true) CancelButtonSelectedStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFFFFF")). Background(DangerColor). Padding(0, 2). MarginRight(1). Bold(true) AlwaysButtonSelectedStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFFFFF")). Background(AccentColor). Padding(0, 2). MarginRight(1). Bold(true) )
var ( // Primary colors - Gemini-inspired gradient palette AccentColor = lipgloss.Color("#8B5CF6") // Vibrant purple AccentColor2 = lipgloss.Color("#06B6D4") // Cyan for gradients SuccessColor = lipgloss.Color("#22C55E") // Bright green DangerColor = lipgloss.Color("#EF4444") // Red WarningColor = lipgloss.Color("#FBBF24") // Amber InfoColor = lipgloss.Color("#3B82F6") // Blue MagentaColor = lipgloss.Color("#EC4899") // Magenta for emphasis TealColor = lipgloss.Color("#14B8A6") // Teal // Neutral colors - Codex-inspired dark theme TextColor = lipgloss.Color("#F8FAFC") // Bright white text DimTextColor = lipgloss.Color("#94A3B8") // Slate dim text MutedColor = lipgloss.Color("#64748B") // Slate muted SurfaceColor = lipgloss.Color("#1E293B") // Slate dark surface BackgroundColor = lipgloss.Color("#0F172A") // Slate darker background BorderColor = lipgloss.Color("#334155") // Slate border HighlightColor = lipgloss.Color("#475569") // Slate highlight // Special - Conversation colors UserColor = lipgloss.Color("#22D3EE") // Cyan for user ModelColor = lipgloss.Color("#A78BFA") // Light purple for model SystemColor = lipgloss.Color("#64748B") // Slate for system ThinkColor = lipgloss.Color("#818CF8") // Indigo for thinking )
var ( // Container styles BaseContainerStyle = lipgloss.NewStyle(). Padding(0, 1) BorderedContainerStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(BorderColor) // Gradient border style (simulated with colors) GradientBorderStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(AccentColor) // Text styles BoldStyle = lipgloss.NewStyle().Bold(true) DimStyle = lipgloss.NewStyle(). Foreground(DimTextColor) MutedStyle = lipgloss.NewStyle(). Foreground(MutedColor) ErrorStyle = lipgloss.NewStyle(). Foreground(DangerColor). Bold(true) SuccessStyle = lipgloss.NewStyle(). Foreground(SuccessColor). Bold(true) WarningStyle = lipgloss.NewStyle(). Foreground(WarningColor) AccentStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) // Gradient text effect (using alternating colors) GradientTextStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) )
var ( HeaderStyle = lipgloss.NewStyle(). Border(lipgloss.NormalBorder(), false, false, true, false). BorderForeground(AccentColor). Padding(0, 1). Background(BackgroundColor) LogoStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) ModelBadgeStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFFFFF")). Background(AccentColor). Padding(0, 1). Bold(true) YoloBadgeStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#000000")). Background(WarningColor). Padding(0, 1). Bold(true) InfoBadgeStyle = lipgloss.NewStyle(). Foreground(DimTextColor). Background(SurfaceColor). Padding(0, 1) // New: Status indicator badges OnlineBadgeStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#000000")). Background(SuccessColor). Padding(0, 1). Bold(true) ProcessingBadgeStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFFFFF")). Background(ThinkColor). Padding(0, 1). Bold(true) )
var ( SidebarStyle = lipgloss.NewStyle(). Border(lipgloss.NormalBorder(), false, true, false, false). BorderForeground(BorderColor). Padding(0, 1). Background(BackgroundColor) SidebarTitleStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true). Padding(0, 0, 1, 0) SessionItemStyle = lipgloss.NewStyle(). Foreground(TextColor). Padding(0, 1) SessionItemSelectedStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFFFFF")). Background(AccentColor). Padding(0, 1). Bold(true) SessionItemCurrentStyle = lipgloss.NewStyle(). Foreground(SuccessColor). Padding(0, 1) SessionInfoStyle = lipgloss.NewStyle(). Foreground(DimTextColor). Padding(0, 1) )
var ( ChatContainerStyle = lipgloss.NewStyle(). Padding(0, 1) UserMessageStyle = lipgloss.NewStyle(). Foreground(UserColor). Bold(true) UserPromptStyle = lipgloss.NewStyle(). Foreground(UserColor). Bold(true) ModelMessageStyle = lipgloss.NewStyle(). Foreground(TextColor) ThinkingStyle = lipgloss.NewStyle(). Foreground(DimTextColor). Italic(true) TimestampStyle = lipgloss.NewStyle(). Foreground(MutedColor) CodeBlockStyle = lipgloss.NewStyle(). Background(SurfaceColor). Padding(0, 1) )
var ( ToolCallStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) ToolNameStyle = lipgloss.NewStyle(). Foreground(WarningColor). Bold(true) ToolResultStyle = lipgloss.NewStyle(). Foreground(SuccessColor) ToolBoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(BorderColor). Padding(0, 1) ToolArgStyle = lipgloss.NewStyle(). Foreground(DimTextColor) )
var ( InputContainerStyle = lipgloss.NewStyle(). Border(lipgloss.NormalBorder(), true, false, false, false). BorderForeground(BorderColor). Padding(0, 1) InputPromptStyle = lipgloss.NewStyle(). Foreground(SuccessColor). Bold(true) InputPlaceholderStyle = lipgloss.NewStyle(). Foreground(MutedColor) InputCursorStyle = lipgloss.NewStyle(). Foreground(AccentColor) )
var ( StatusBarStyle = lipgloss.NewStyle(). Background(SurfaceColor). Foreground(DimTextColor). Padding(0, 1) StatusKeyStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) StatusValueStyle = lipgloss.NewStyle(). Foreground(DimTextColor) StatusDividerStyle = lipgloss.NewStyle(). Foreground(BorderColor) )
var ( HelpStyle = lipgloss.NewStyle(). Foreground(DimTextColor) HelpKeyStyle = lipgloss.NewStyle(). Foreground(AccentColor). Bold(true) HelpDescStyle = lipgloss.NewStyle(). Foreground(MutedColor) )
var ( SpinnerStyle = lipgloss.NewStyle(). Foreground(AccentColor) SpinnerTextStyle = lipgloss.NewStyle(). Foreground(DimTextColor) )
var ( ScrollbarThumbStyle = lipgloss.NewStyle(). Foreground(MutedColor) ScrollbarTrackStyle = lipgloss.NewStyle(). Foreground(BorderColor) )
var ContextPanelStyle = lipgloss.NewStyle(). Border(lipgloss.NormalBorder(), false, false, false, true). BorderForeground(BorderColor). Padding(0, 1)
var FilePreviewStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(AccentColor). Padding(0, 1)
var ThinkingBoxStyle = lipgloss.NewStyle(). Border(lipgloss.RoundedBorder()). BorderForeground(AccentColor). Padding(0, 1). MarginTop(1). MarginBottom(1)
Functions ¶
Types ¶
type ActivityItem ¶
type ActivityItem struct {
Type ActivityType
Title string
Detail string
Status ActivityStatus
Timestamp time.Time
Duration time.Duration
}
ActivityItem represents an activity in the feed
type ActivityStatus ¶
type ActivityStatus int
ActivityStatus represents the status of an activity
const ( ActivityStatusPending ActivityStatus = iota ActivityStatusRunning ActivityStatusSuccess ActivityStatusError )
type ActivityType ¶
type ActivityType int
ActivityType represents the type of activity
const ( ActivityTypeAPI ActivityType = iota ActivityTypeTool ActivityTypeFile ActivityTypeSearch ActivityTypeShell ActivityTypeThinking )
type App ¶
type App struct {
// contains filtered or unexported fields
}
App represents the main TUI application
type ChatMessage ¶
type ChatMessage struct {
Type MessageType
Content string
ToolName string
ToolArgs string
Timestamp string
Rendered string // Pre-rendered content for Markdown
}
ChatMessage represents a single message
type ChatViewModel ¶
type ChatViewModel struct {
// contains filtered or unexported fields
}
ChatViewModel represents the chat display area
func NewChatViewModel ¶
func NewChatViewModel() ChatViewModel
NewChatViewModel creates a new chat view model
func (*ChatViewModel) AddMessage ¶
func (c *ChatViewModel) AddMessage(msg ChatMessage)
AddMessage adds a message to the chat
func (*ChatViewModel) SetFocused ¶
func (c *ChatViewModel) SetFocused(focused bool)
SetFocused sets focus state
func (*ChatViewModel) SetLoading ¶
func (c *ChatViewModel) SetLoading(loading bool, text string)
SetLoading sets loading state
func (*ChatViewModel) SetSize ¶
func (c *ChatViewModel) SetSize(width, height int)
SetSize sets the chat view dimensions
func (*ChatViewModel) Update ¶
func (c *ChatViewModel) Update(msg tea.Msg) tea.Cmd
Update handles viewport updates
func (*ChatViewModel) UpdateLastMessage ¶
func (c *ChatViewModel) UpdateLastMessage(content string)
UpdateLastMessage updates the last message (for streaming)
type Config ¶
type Config struct {
Model string
YoloMode bool
Cwd string
ProjectID string
Timeout time.Duration
AvailableModels []string
InitialPrompt string
ResumeSession string
}
Config holds TUI configuration
type ConfirmChoice ¶
type ConfirmChoice int
ConfirmChoice represents the user's choice
const ( ConfirmChoiceNone ConfirmChoice = iota ConfirmChoiceYes ConfirmChoiceNo ConfirmChoiceAlways )
type ConfirmDialogModel ¶
type ConfirmDialogModel struct {
// contains filtered or unexported fields
}
ConfirmDialogModel represents a confirmation dialog
func NewConfirmDialogModel ¶
func NewConfirmDialogModel() ConfirmDialogModel
NewConfirmDialogModel creates a new confirmation dialog
func (ConfirmDialogModel) IsVisible ¶
func (c ConfirmDialogModel) IsVisible() bool
IsVisible returns visibility
func (*ConfirmDialogModel) SetSize ¶
func (c *ConfirmDialogModel) SetSize(width, height int)
SetSize sets the dialog dimensions
func (*ConfirmDialogModel) Show ¶
func (c *ConfirmDialogModel) Show(opts ConfirmDialogOptions)
Show shows the confirmation dialog
type ConfirmDialogOptions ¶
type ConfirmDialogOptions struct {
Type ConfirmationType
Title string
Message string
Detail string
ToolName string
FilePath string
Command string
URL string
OldContent string
NewContent string
OnResult func(ConfirmChoice)
}
ConfirmDialogOptions holds dialog options
type ConfirmationType ¶
type ConfirmationType int
ConfirmationType represents the type of confirmation
const ( ConfirmTypeFile ConfirmationType = iota ConfirmTypeCommand ConfirmTypeNetwork ConfirmTypeDangerous )
type ContextItem ¶
type ContextItem struct {
Type ContextType
Path string
Name string
Size int64
LineCount int
AddedAt time.Time
}
ContextItem represents an item in the context
type ContextPanelModel ¶
type ContextPanelModel struct {
// contains filtered or unexported fields
}
ContextPanelModel represents the context/activity panel
func NewContextPanelModel ¶
func NewContextPanelModel() ContextPanelModel
NewContextPanelModel creates a new context panel model
func (*ContextPanelModel) AddActivity ¶
func (c *ContextPanelModel) AddActivity(activity ActivityItem)
AddActivity adds an activity item
func (*ContextPanelModel) AddContextItem ¶
func (c *ContextPanelModel) AddContextItem(item ContextItem)
AddContextItem adds a context item
func (*ContextPanelModel) ClearContext ¶
func (c *ContextPanelModel) ClearContext()
ClearContext clears all context items
func (*ContextPanelModel) RemoveContextItem ¶
func (c *ContextPanelModel) RemoveContextItem(path string)
RemoveContextItem removes a context item by path
func (*ContextPanelModel) SetFocused ¶
func (c *ContextPanelModel) SetFocused(focused bool)
SetFocused sets the focus state
func (*ContextPanelModel) SetSize ¶
func (c *ContextPanelModel) SetSize(width, height int)
SetSize sets the panel dimensions
func (*ContextPanelModel) ToggleActivities ¶
func (c *ContextPanelModel) ToggleActivities()
ToggleActivities toggles activities display
func (*ContextPanelModel) ToggleContext ¶
func (c *ContextPanelModel) ToggleContext()
ToggleContext toggles context display
func (*ContextPanelModel) UpdateLastActivity ¶
func (c *ContextPanelModel) UpdateLastActivity(status ActivityStatus, duration time.Duration)
UpdateLastActivity updates the most recent activity
func (ContextPanelModel) View ¶
func (c ContextPanelModel) View() string
View renders the context panel
type ContextType ¶
type ContextType int
ContextType represents the type of context item
const ( ContextTypeFile ContextType = iota ContextTypeDirectory ContextTypeURL ContextTypeClipboard )
type DiffLine ¶
type DiffLine struct {
Type DiffLineType
Content string
OldNum int
NewNum int
}
DiffLine represents a line in the diff
type DiffLineType ¶
type DiffLineType int
DiffLineType represents the type of diff line
const ( DiffLineContext DiffLineType = iota DiffLineAdded DiffLineRemoved DiffLineHeader )
type FilePreviewModel ¶
type FilePreviewModel struct {
// contains filtered or unexported fields
}
FilePreviewModel represents the file preview/diff component
func NewFilePreviewModel ¶
func NewFilePreviewModel() FilePreviewModel
NewFilePreviewModel creates a new file preview model
func (*FilePreviewModel) IsVisible ¶
func (f *FilePreviewModel) IsVisible() bool
IsVisible returns visibility state
func (*FilePreviewModel) ScrollDown ¶
func (f *FilePreviewModel) ScrollDown(lines int)
ScrollDown scrolls down
func (*FilePreviewModel) ScrollUp ¶
func (f *FilePreviewModel) ScrollUp(lines int)
ScrollUp scrolls up
func (*FilePreviewModel) SetCommandPreview ¶
func (f *FilePreviewModel) SetCommandPreview(command, explanation string)
SetCommandPreview sets a command preview
func (*FilePreviewModel) SetDiffPreview ¶
func (f *FilePreviewModel) SetDiffPreview(title, path, oldContent, newContent string)
SetDiffPreview sets a diff preview
func (*FilePreviewModel) SetFilePreview ¶
func (f *FilePreviewModel) SetFilePreview(title, path, content string)
SetFilePreview sets a file preview
func (*FilePreviewModel) SetOutputPreview ¶
func (f *FilePreviewModel) SetOutputPreview(title, output string)
SetOutputPreview sets an output preview
func (*FilePreviewModel) SetSize ¶
func (f *FilePreviewModel) SetSize(width, height int)
SetSize sets the preview dimensions
func (FilePreviewModel) View ¶
func (f FilePreviewModel) View() string
View renders the file preview
type HeaderModel ¶
type HeaderModel struct {
// contains filtered or unexported fields
}
HeaderModel represents the header component
func NewHeaderModel ¶
func NewHeaderModel(modelName string, yoloMode bool, cwd string) HeaderModel
NewHeaderModel creates a new header model
func (*HeaderModel) SetModel ¶
func (h *HeaderModel) SetModel(modelName string)
SetModel sets the model name
func (*HeaderModel) SetWidth ¶
func (h *HeaderModel) SetWidth(width int)
SetWidth sets the width of the header
type InputModel ¶
type InputModel struct {
// contains filtered or unexported fields
}
InputModel represents the text input component
func (*InputModel) DeleteChar ¶
func (i *InputModel) DeleteChar()
DeleteChar deletes character before cursor (backspace)
func (*InputModel) DeleteCharForward ¶
func (i *InputModel) DeleteCharForward()
DeleteCharForward deletes character at cursor (delete)
func (*InputModel) DeleteWord ¶
func (i *InputModel) DeleteWord()
DeleteWord deletes word before cursor
func (*InputModel) HistoryDown ¶
func (i *InputModel) HistoryDown()
HistoryDown navigates to next history item
func (*InputModel) HistoryUp ¶
func (i *InputModel) HistoryUp()
HistoryUp navigates to previous history item
func (*InputModel) InsertChar ¶
func (i *InputModel) InsertChar(c rune)
InsertChar inserts a character at cursor
func (*InputModel) InsertString ¶
func (i *InputModel) InsertString(s string)
InsertString inserts a string at cursor
func (*InputModel) MoveToStart ¶
func (i *InputModel) MoveToStart()
MoveToStart moves cursor to start
func (*InputModel) SetFocused ¶
func (i *InputModel) SetFocused(focused bool)
SetFocused sets focus state
func (*InputModel) SetWidth ¶
func (i *InputModel) SetWidth(width int)
SetWidth sets the input width
type KeyMap ¶
type KeyMap struct {
// Navigation
Up key.Binding
Down key.Binding
PageUp key.Binding
PageDown key.Binding
Home key.Binding
End key.Binding
// Actions
Submit key.Binding
Cancel key.Binding
Help key.Binding
Quit key.Binding
// Panels
FocusChat key.Binding
FocusSidebar key.Binding
FocusInput key.Binding
ToggleSidebar key.Binding
ToggleContext key.Binding
TogglePreview key.Binding
// Commands
NewSession key.Binding
SaveSession key.Binding
LoadSession key.Binding
ClearChat key.Binding
SwitchModel key.Binding
ShowStats key.Binding
// Editor
NewLine key.Binding
DeleteWord key.Binding
DeleteLine key.Binding
}
KeyMap defines key bindings for the TUI
type MarkdownRenderer ¶
type MarkdownRenderer struct {
// contains filtered or unexported fields
}
MarkdownRenderer renders markdown content with syntax highlighting
func NewMarkdownRenderer ¶
func NewMarkdownRenderer(width int) *MarkdownRenderer
NewMarkdownRenderer creates a new markdown renderer
func (*MarkdownRenderer) Render ¶
func (r *MarkdownRenderer) Render(content string) string
Render renders markdown content
func (*MarkdownRenderer) SetWidth ¶
func (r *MarkdownRenderer) SetWidth(width int)
SetWidth sets the render width
type MessageType ¶
type MessageType int
MessageType represents the type of message
const ( MessageTypeUser MessageType = iota MessageTypeModel MessageTypeTool MessageTypeError MessageTypeSystem )
type PreviewType ¶
type PreviewType int
PreviewType represents the type of preview
const ( PreviewTypeFile PreviewType = iota PreviewTypeDiff PreviewTypeCommand PreviewTypeOutput )
type SessionInfo ¶
SessionInfo represents a session in the sidebar
type SidebarModel ¶
type SidebarModel struct {
// contains filtered or unexported fields
}
SidebarModel represents the sidebar component
func NewSidebarModel ¶
func NewSidebarModel() SidebarModel
NewSidebarModel creates a new sidebar model
func (*SidebarModel) SelectedSession ¶
func (s *SidebarModel) SelectedSession() *SessionInfo
SelectedSession returns the currently selected session
func (*SidebarModel) SetFocused ¶
func (s *SidebarModel) SetFocused(focused bool)
SetFocused sets focus state
func (*SidebarModel) SetSessions ¶
func (s *SidebarModel) SetSessions(sessions []SessionInfo)
SetSessions sets the session list
func (*SidebarModel) SetSize ¶
func (s *SidebarModel) SetSize(width, height int)
SetSize sets the sidebar dimensions
type SpinnerModel ¶
type SpinnerModel struct {
// contains filtered or unexported fields
}
SpinnerModel represents a loading spinner
func NewSpinnerModel ¶
func NewSpinnerModel() SpinnerModel
NewSpinnerModel creates a new spinner model
func (SpinnerModel) IsActive ¶
func (s SpinnerModel) IsActive() bool
IsActive returns whether the spinner is active
func (*SpinnerModel) Start ¶
func (s *SpinnerModel) Start(text string) tea.Cmd
Start starts the spinner
type StatusBarModel ¶
type StatusBarModel struct {
// contains filtered or unexported fields
}
StatusBarModel represents the status bar
func NewStatusBarModel ¶
func NewStatusBarModel() StatusBarModel
NewStatusBarModel creates a new status bar model
func (*StatusBarModel) SetModel ¶
func (s *StatusBarModel) SetModel(model string)
SetModel sets the model name
func (*StatusBarModel) SetSessionID ¶
func (s *StatusBarModel) SetSessionID(sessionID string)
SetSessionID sets the session ID
func (*StatusBarModel) SetTokens ¶
func (s *StatusBarModel) SetTokens(input, output int)
SetTokens sets token counts
func (*StatusBarModel) SetWidth ¶
func (s *StatusBarModel) SetWidth(width int)
SetWidth sets the status bar width
type StepStatus ¶
type StepStatus int
StepStatus represents the status of a thinking step
const ( StepPending StepStatus = iota StepActive StepCompleted StepFailed )
type ThinkingModel ¶
type ThinkingModel struct {
// contains filtered or unexported fields
}
ThinkingModel represents the thinking/processing indicator
func NewThinkingModel ¶
func NewThinkingModel() ThinkingModel
NewThinkingModel creates a new thinking model
func (*ThinkingModel) AddStep ¶
func (t *ThinkingModel) AddStep(label string)
AddStep adds a thinking step
func (*ThinkingModel) CompleteStep ¶
func (t *ThinkingModel) CompleteStep()
CompleteStep completes the current step
func (*ThinkingModel) FailStep ¶
func (t *ThinkingModel) FailStep()
FailStep marks the current step as failed
func (ThinkingModel) IsActive ¶
func (t ThinkingModel) IsActive() bool
IsActive returns whether the thinking indicator is active
func (*ThinkingModel) SetMessage ¶
func (t *ThinkingModel) SetMessage(message string)
SetMessage sets the thinking message
func (*ThinkingModel) SetWidth ¶
func (t *ThinkingModel) SetWidth(width int)
SetWidth sets the width
func (*ThinkingModel) Start ¶
func (t *ThinkingModel) Start(message string) tea.Cmd
Start starts the thinking indicator
func (*ThinkingModel) Update ¶
func (t *ThinkingModel) Update(msg tea.Msg) tea.Cmd
Update updates the thinking model
func (ThinkingModel) View ¶
func (t ThinkingModel) View() string
View renders the thinking indicator
type ThinkingStep ¶
type ThinkingStep struct {
Label string
Status StepStatus
StartTime time.Time
Duration time.Duration
}
ThinkingStep represents a step in the thinking process