Documentation
¶
Index ¶
- Constants
- Variables
- func DrawCenter(scr uv.Screen, area uv.Rectangle, view string)
- func DrawCenterCursor(scr uv.Screen, area uv.Rectangle, view string, cur *tea.Cursor)
- func DrawOnboarding(scr uv.Screen, area uv.Rectangle, view string)
- func DrawOnboardingCursor(scr uv.Screen, area uv.Rectangle, view string, cur *tea.Cursor)
- func InputCursor(t *styles.Styles, cur *tea.Cursor) *tea.Cursor
- type APIKeyInput
- type APIKeyInputState
- type Action
- type ActionAttachSkill
- type ActionChangeAPIKeyState
- type ActionClose
- type ActionCmd
- type ActionCompleteOAuth
- type ActionCopyLastMessage
- type ActionDisableDockerMCP
- type ActionDisableMCPServer
- type ActionEnableDockerMCP
- type ActionEnableMCPServer
- type ActionExternalEditor
- type ActionFilePickerSelected
- type ActionInitializeProject
- type ActionInitiateOAuth
- type ActionNewSession
- type ActionOAuthErrored
- type ActionOpenDialog
- type ActionOpenModels
- type ActionOpenProviderConfig
- type ActionOpenWebSearchConfig
- type ActionPermissionResponse
- type ActionPlanReviewRequestChanges
- type ActionPlanReviewSubmit
- type ActionQuit
- type ActionRunCustomCommand
- type ActionRunMCPPrompt
- type ActionSelectCapabilityProvider
- type ActionSelectModel
- type ActionSelectNotificationStyle
- type ActionSelectReasoningEffort
- type ActionSelectSession
- type ActionSelectWebSearchProvider
- type ActionSummarize
- type ActionToggleCompactMode
- type ActionToggleHelp
- type ActionToggleNotifications
- type ActionTogglePills
- type ActionToggleThinking
- type ActionToggleTransparentBackground
- type ActionToggleVerboseSteps
- type ActionToggleYoloMode
- type Arguments
- func (a *Arguments) Cursor(descriptionHeight int) *tea.Cursor
- func (a *Arguments) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (a *Arguments) FullHelp() [][]key.Binding
- func (a *Arguments) HandleMsg(msg tea.Msg) Action
- func (a *Arguments) ID() string
- func (a *Arguments) ShortHelp() []key.Binding
- func (a *Arguments) StartLoading() tea.Cmd
- func (a *Arguments) StopLoading()
- type CommandItem
- func (c *CommandItem) Action() Action
- func (c *CommandItem) Filter() string
- func (c *CommandItem) Finished() bool
- func (c *CommandItem) ID() string
- func (c *CommandItem) Render(width int) string
- func (c *CommandItem) SetFocused(focused bool)
- func (c *CommandItem) SetMatch(m fuzzy.Match)
- func (c *CommandItem) Shortcut() string
- func (c *CommandItem) WithAliases(aliases ...string) *CommandItem
- func (c *CommandItem) WithDescription(desc string) *CommandItem
- type CommandType
- type Commands
- func (c *Commands) Cursor() *tea.Cursor
- func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (c *Commands) FullHelp() [][]key.Binding
- func (c *Commands) HandleMsg(msg tea.Msg) Action
- func (c *Commands) ID() string
- func (c *Commands) InitialCmd() tea.Cmd
- func (c *Commands) SetCustomCommands(customCommands []commands.CustomCommand)
- func (c *Commands) SetMCPPrompts(mcpPrompts []commands.MCPPrompt)
- func (c *Commands) ShortHelp() []key.Binding
- func (a *Commands) StartLoading() tea.Cmd
- func (a *Commands) StopLoading()
- type Dialog
- type FilePicker
- func (f *FilePicker) CellSize() fimage.CellSize
- func (f *FilePicker) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (f *FilePicker) FullHelp() [][]key.Binding
- func (f *FilePicker) HandleMsg(msg tea.Msg) Action
- func (f *FilePicker) ID() string
- func (f *FilePicker) SetImageCapabilities(caps *common.Capabilities)
- func (f *FilePicker) ShortHelp() []key.Binding
- func (f *FilePicker) WorkingDir() string
- type ListItem
- type ListItemStyles
- type LoadingDialog
- type ModelGroup
- type ModelItem
- func (m *ModelItem) Filter() string
- func (m *ModelItem) Finished() bool
- func (m *ModelItem) ID() string
- func (m *ModelItem) Render(width int) string
- func (m *ModelItem) SelectedModel() config.SelectedModel
- func (m *ModelItem) SelectedModelType() config.SelectedModelType
- func (m *ModelItem) SetFocused(focused bool)
- func (m *ModelItem) SetMatch(fm fuzzy.Match)
- type ModelType
- type Models
- type ModelsList
- func (f *ModelsList) IsSelectedFirst() bool
- func (f *ModelsList) IsSelectedLast() bool
- func (f *ModelsList) Len() int
- func (f *ModelsList) Render() string
- func (f *ModelsList) SelectFirst() (v bool)
- func (f *ModelsList) SelectLast() (v bool)
- func (f *ModelsList) SelectNext() (v bool)
- func (f *ModelsList) SelectNextCyclic()
- func (f *ModelsList) SelectPrev() (v bool)
- func (f *ModelsList) SelectPrevCyclic()
- func (f *ModelsList) SetFilter(q string)
- func (f *ModelsList) SetGroups(groups ...ModelGroup)
- func (f *ModelsList) SetSelected(index int)
- func (f *ModelsList) SetSelectedItem(itemID string)
- func (f *ModelsList) VisibleItems() []list.Item
- type NotificationItem
- type NotificationStyle
- type Notifications
- func (n *Notifications) Cursor() *tea.Cursor
- func (n *Notifications) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (n *Notifications) FullHelp() [][]key.Binding
- func (n *Notifications) HandleMsg(msg tea.Msg) Action
- func (n *Notifications) ID() string
- func (n *Notifications) ShortHelp() []key.Binding
- type OAuth
- type OAuthCopilot
- type OAuthHyper
- type OAuthProvider
- type OAuthState
- type Overlay
- func (d *Overlay) BringToFront(dialogID string)
- func (d *Overlay) CloseDialog(dialogID string)
- func (d *Overlay) CloseFrontDialog()
- func (d *Overlay) CloseSettingsFamilyDialogs()
- func (d *Overlay) ContainsDialog(dialogID string) bool
- func (d *Overlay) Dialog(dialogID string) Dialog
- func (d *Overlay) DialogLast() Dialog
- func (d *Overlay) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (d *Overlay) HasDialogs() bool
- func (d *Overlay) OpenDialog(dialog Dialog)
- func (d *Overlay) StartLoading() tea.Cmd
- func (d *Overlay) StopLoading()
- func (d *Overlay) Update(msg tea.Msg) tea.Msg
- type PermissionAction
- type Permissions
- type PermissionsOption
- type PlanReview
- type Quit
- type Reasoning
- type ReasoningItem
- type RenderContext
- type Session
- type SessionItem
- func (s *SessionItem) Cursor() *tea.Cursor
- func (s *SessionItem) Filter() string
- func (s *SessionItem) Finished() bool
- func (s *SessionItem) HandleInput(msg tea.Msg) tea.Cmd
- func (s *SessionItem) ID() string
- func (s *SessionItem) InputValue() string
- func (s *SessionItem) Render(width int) string
- func (s *SessionItem) SetFocused(focused bool)
- func (s *SessionItem) SetMatch(m fuzzy.Match)
- type Settings
- type ToolsList
- func (l *ToolsList) IsSelectedFirst() bool
- func (l *ToolsList) IsSelectedLast() bool
- func (l *ToolsList) SelectFirst() bool
- func (l *ToolsList) SelectLast() bool
- func (l *ToolsList) SelectNext() bool
- func (l *ToolsList) SelectNextCyclic()
- func (l *ToolsList) SelectPrev() bool
- func (l *ToolsList) SelectPrevCyclic()
- func (l *ToolsList) SetFilter(query string)
- func (l *ToolsList) SetGroups(groups ...toolGroup)
- type WebSearchConfig
- func (m *WebSearchConfig) Cursor() *tea.Cursor
- func (m *WebSearchConfig) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (m *WebSearchConfig) FullHelp() [][]key.Binding
- func (m *WebSearchConfig) HandleMsg(msg tea.Msg) Action
- func (m *WebSearchConfig) ID() string
- func (m *WebSearchConfig) ShortHelp() []key.Binding
Constants ¶
const APIKeyInputID = "api_key_input"
APIKeyInputID is the identifier for the model selection dialog.
const ArgumentsID = "arguments"
ArgumentsID is the identifier for the arguments dialog.
const CommandsID = "commands"
CommandsID is the identifier for the commands dialog.
const FilePickerID = "filepicker"
FilePickerID is the identifier for the FilePicker dialog.
const ModelsID = "models"
ModelsID is the identifier for the model selection dialog.
const (
// NotificationsID is the identifier for the notification style picker dialog.
NotificationsID = "notifications"
)
const OAuthID = "oauth"
OAuthID is the identifier for the model selection dialog.
const PermissionsID = "permissions"
PermissionsID is the identifier for the permissions dialog.
const (
// PlanReviewID is the identifier for the plan review dialog.
PlanReviewID = "plan_review"
)
const QuitID = "quit"
QuitID is the identifier for the quit dialog.
const (
// ReasoningID is the identifier for the reasoning effort dialog.
ReasoningID = "reasoning"
)
const SessionsID = "session"
SessionsID is the identifier for the session selector dialog.
const SettingsID = "settings"
SettingsID is the identifier for the settings dialog.
const WebSearchConfigID = "web_search_config"
Variables ¶
var AllNotificationStyles = []NotificationStyle{
{ID: "auto", Title: "Auto", Description: "Automatically detect the best backend"},
{ID: "native", Title: "Native", Description: "Use system notifications (macOS/Linux/Windows)"},
{ID: "osc", Title: "OSC", Description: "Use terminal OSC escape sequences"},
{ID: "bell", Title: "Bell", Description: "Use terminal bell character"},
{ID: "disabled", Title: "Disabled", Description: "Turn off notifications"},
}
AllNotificationStyles lists all available notification styles in order.
var CloseKey = key.NewBinding( key.WithKeys("esc", "alt+esc"), key.WithHelp("esc", "exit"), )
CloseKey is the default key binding to close dialogs.
Functions ¶
func DrawCenter ¶
DrawCenter draws the given string view centered in the screen area.
func DrawCenterCursor ¶
DrawCenterCursor draws the given string view centered in the screen area and adjusts the cursor position accordingly.
func DrawOnboarding ¶
DrawOnboarding draws the given string view centered in the screen area.
func DrawOnboardingCursor ¶
DrawOnboardingCursor draws the given string view positioned at the bottom left area of the screen.
Types ¶
type APIKeyInput ¶
type APIKeyInput struct {
// contains filtered or unexported fields
}
APIKeyInput represents a provider configuration dialog.
func NewAPIKeyInput ¶
func NewAPIKeyInput( com *common.Common, isOnboarding bool, provider catwalk.Provider, model config.SelectedModel, modelType config.SelectedModelType, ) (*APIKeyInput, tea.Cmd)
NewAPIKeyInput creates a new provider configuration dialog.
func (*APIKeyInput) Cursor ¶
func (m *APIKeyInput) Cursor() *tea.Cursor
Cursor returns the cursor position relative to the dialog.
func (*APIKeyInput) FullHelp ¶
func (m *APIKeyInput) FullHelp() [][]key.Binding
FullHelp returns the full help view.
func (*APIKeyInput) HandleMsg ¶
func (m *APIKeyInput) HandleMsg(msg tea.Msg) Action
HandleMsg implements Dialog.
func (*APIKeyInput) ShortHelp ¶
func (m *APIKeyInput) ShortHelp() []key.Binding
ShortHelp returns the short help view.
type APIKeyInputState ¶
type APIKeyInputState int
const ( APIKeyInputStateInitial APIKeyInputState = iota APIKeyInputStateVerifying APIKeyInputStateVerified APIKeyInputStateError )
type Action ¶
type Action any
Action represents an action taken in a dialog after handling a message.
type ActionAttachSkill ¶
ActionAttachSkill is sent when a skill is selected from the commands dialog to be attached to the conversation as a markdown attachment.
type ActionChangeAPIKeyState ¶
type ActionChangeAPIKeyState struct {
State APIKeyInputState
Error error
}
Messages for API key input dialog.
type ActionCmd ¶
ActionCmd represents an action that carries a tea.Cmd to be passed to the Bubble Tea program loop.
type ActionCompleteOAuth ¶
ActionCompleteOAuth is sent when the device flow completes successfully.
type ActionCopyLastMessage ¶
type ActionCopyLastMessage struct{}
ActionCopyLastMessage copies the user's last sent message to the clipboard.
type ActionDisableDockerMCP ¶
type ActionDisableDockerMCP struct{}
ActionDisableDockerMCP is a message to disable Docker MCP.
type ActionDisableMCPServer ¶
type ActionDisableMCPServer struct{ Name string }
ActionDisableMCPServer disconnects/disables a named MCP server from Settings.
type ActionEnableDockerMCP ¶
type ActionEnableDockerMCP struct{}
ActionEnableDockerMCP is a message to enable Docker MCP.
type ActionEnableMCPServer ¶
type ActionEnableMCPServer struct{ Name string }
ActionEnableMCPServer reconnects/enables a named MCP server from Settings.
type ActionFilePickerSelected ¶
type ActionFilePickerSelected struct {
Path string
}
ActionFilePickerSelected is a message indicating a file has been selected in the file picker dialog.
func (ActionFilePickerSelected) Cmd ¶
func (a ActionFilePickerSelected) Cmd() tea.Cmd
Cmd returns a command that reads the file at path and sends a message.Attachement to the program.
type ActionInitiateOAuth ¶
type ActionInitiateOAuth struct {
DeviceCode string
UserCode string
ExpiresIn int
VerificationURL string
Interval int
}
ActionInitiateOAuth is sent when the device auth is initiated successfully.
type ActionOAuthErrored ¶
type ActionOAuthErrored struct {
Error error
}
ActionOAuthErrored is sent when the device flow encounters an error.
type ActionOpenDialog ¶
type ActionOpenDialog struct {
DialogID string
}
ActionOpenDialog is a message to open a dialog.
type ActionOpenModels ¶
type ActionOpenModels struct {
PreferredProviderID string
}
ActionOpenModels opens the models dialog, optionally focused on a provider.
type ActionOpenProviderConfig ¶
ActionOpenProviderConfig triggers the API key / auth flow for a provider.
type ActionOpenWebSearchConfig ¶
type ActionOpenWebSearchConfig struct {
ProviderID string
}
ActionOpenWebSearchConfig opens the web-search configuration dialog.
type ActionPermissionResponse ¶
type ActionPermissionResponse struct {
Permission permission.PermissionRequest
Action PermissionAction
}
Messages for commands
type ActionPlanReviewRequestChanges ¶
type ActionPlanReviewRequestChanges struct {
Review planreview.Review
}
ActionPlanReviewRequestChanges is sent when the user sends feedback to the agent without approving the plan. The dialog stays open; the agent is expected to revise the plan and call submit_plan again.
type ActionPlanReviewSubmit ¶
type ActionPlanReviewSubmit struct {
Review planreview.Review
}
Messages for commands
type ActionRunCustomCommand ¶
type ActionRunCustomCommand struct {
Content string
Arguments []commands.Argument
Args map[string]string // Actual argument values
Skill *skills.Skill // Set when this is a skill command
}
ActionRunCustomCommand is a message to run a custom command.
type ActionRunMCPPrompt ¶
type ActionRunMCPPrompt struct {
Title string
Description string
PromptID string
ClientID string
Arguments []commands.Argument
Args map[string]string // Actual argument values
}
ActionRunMCPPrompt is a message to run a custom command.
type ActionSelectCapabilityProvider ¶
ActionSelectCapabilityProvider selects the provider used by a capability-specific tool.
type ActionSelectModel ¶
type ActionSelectModel struct {
Provider catwalk.Provider
Model config.SelectedModel
ModelType config.SelectedModelType
ReAuthenticate bool
}
ActionSelectModel is a message indicating a model has been selected.
type ActionSelectNotificationStyle ¶
type ActionSelectNotificationStyle struct {
Style string
}
Messages for commands
type ActionSelectReasoningEffort ¶
type ActionSelectReasoningEffort struct {
Effort string
}
ActionSelectReasoningEffort is a message indicating a reasoning effort has been selected.
type ActionSelectSession ¶
ActionSelectSession is a message indicating a session has been selected.
type ActionSelectWebSearchProvider ¶
type ActionSelectWebSearchProvider struct {
ProviderID string
}
ActionSelectWebSearchProvider selects the active web-search provider mode.
type ActionToggleTransparentBackground ¶
type ActionToggleTransparentBackground struct{}
Messages for commands
type ActionToggleVerboseSteps ¶
type ActionToggleVerboseSteps struct{}
ActionToggleVerboseSteps toggles verbose agent step narration.
type Arguments ¶
type Arguments struct {
// contains filtered or unexported fields
}
Arguments represents a dialog for collecting command arguments.
func NewArguments ¶
func NewArguments(com *common.Common, title, description string, arguments []commands.Argument, resultAction Action) *Arguments
NewArguments creates a new arguments dialog.
func (*Arguments) Cursor ¶
Cursor returns the cursor position relative to the dialog. we pass the description height to offset the cursor correctly.
func (*Arguments) StartLoading ¶
StartLoading implements LoadingDialog.
func (*Arguments) StopLoading ¶
func (a *Arguments) StopLoading()
StopLoading implements LoadingDialog.
type CommandItem ¶
CommandItem wraps a uicmd.Command to implement the ListItem interface.
func NewCommandItem ¶
func NewCommandItem(t *styles.Styles, id, title, shortcut string, action Action) *CommandItem
NewCommandItem creates a new CommandItem.
func (*CommandItem) Action ¶
func (c *CommandItem) Action() Action
Action returns the action associated with the command item.
func (*CommandItem) Finished ¶
func (c *CommandItem) Finished() bool
Finished implements list.Item. Command items are render-stable outside of explicit SetFocused / SetMatch.
func (*CommandItem) Render ¶
func (c *CommandItem) Render(width int) string
Render implements ListItem.
func (*CommandItem) SetFocused ¶
func (c *CommandItem) SetFocused(focused bool)
SetFocused implements ListItem.
func (*CommandItem) SetMatch ¶
func (c *CommandItem) SetMatch(m fuzzy.Match)
SetMatch implements ListItem.
func (*CommandItem) Shortcut ¶
func (c *CommandItem) Shortcut() string
Shortcut returns the shortcut associated with the command item.
func (*CommandItem) WithAliases ¶
func (c *CommandItem) WithAliases(aliases ...string) *CommandItem
WithAliases returns the CommandItem with the given aliases for filtering.
func (*CommandItem) WithDescription ¶
func (c *CommandItem) WithDescription(desc string) *CommandItem
WithDescription returns the CommandItem with a description displayed below the title.
type CommandType ¶
type CommandType uint
CommandType represents the type of commands being displayed.
const ( SystemCommands CommandType = iota UserCommands MCPPrompts )
func (CommandType) String ¶
func (c CommandType) String() string
String returns the string representation of the CommandType.
type Commands ¶
type Commands struct {
// contains filtered or unexported fields
}
func NewCommands ¶
func NewCommands(com *common.Common, sessionID string, hasSession, hasTodos, hasQueue bool, customCommands []commands.CustomCommand, mcpPrompts []commands.MCPPrompt) (*Commands, error)
NewCommands creates a new commands dialog.
func (*Commands) FullHelp ¶
FullHelp implements help.KeyMap.
func (*Commands) InitialCmd ¶
func (*Commands) SetCustomCommands ¶
func (c *Commands) SetCustomCommands(customCommands []commands.CustomCommand)
SetCustomCommands sets the custom commands and refreshes the view if user commands are currently displayed.
func (*Commands) SetMCPPrompts ¶
SetMCPPrompts sets the MCP prompts and refreshes the view if MCP prompts are currently displayed.
func (*Commands) ShortHelp ¶
ShortHelp implements help.KeyMap.
func (*Commands) StartLoading ¶
StartLoading implements LoadingDialog.
func (*Commands) StopLoading ¶
func (a *Commands) StopLoading()
StopLoading implements LoadingDialog.
type Dialog ¶
type Dialog interface {
// ID returns the unique identifier of the dialog.
ID() string
// HandleMsg processes a message and returns an action. An [Action] can be
// anything and the caller is responsible for handling it appropriately.
HandleMsg(msg tea.Msg) Action
// Draw draws the dialog onto the provided screen within the specified area
// and returns the desired cursor position on the screen.
Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
}
Dialog is a component that can be displayed on top of the UI.
type FilePicker ¶
type FilePicker struct {
// contains filtered or unexported fields
}
FilePicker is a dialog that allows users to select files or directories.
func NewFilePicker ¶
func NewFilePicker(com *common.Common) (*FilePicker, tea.Cmd)
NewFilePicker creates a new FilePicker dialog.
func (*FilePicker) CellSize ¶
func (f *FilePicker) CellSize() fimage.CellSize
CellSize returns the cell size used for image rendering.
func (*FilePicker) Draw ¶
Draw renders the FilePicker dialog as a string.
func (*FilePicker) FullHelp ¶
func (f *FilePicker) FullHelp() [][]key.Binding
FullHelp returns the full help key bindings for the FilePicker dialog.
func (*FilePicker) HandleMsg ¶
func (f *FilePicker) HandleMsg(msg tea.Msg) Action
HandleMsg updates the FilePicker dialog based on the given message.
func (*FilePicker) ID ¶
func (f *FilePicker) ID() string
ID returns the identifier of the FilePicker dialog.
func (*FilePicker) SetImageCapabilities ¶
func (f *FilePicker) SetImageCapabilities(caps *common.Capabilities)
SetImageCapabilities sets the image capabilities for the FilePicker.
func (*FilePicker) ShortHelp ¶
func (f *FilePicker) ShortHelp() []key.Binding
ShortHelp returns the short help key bindings for the FilePicker dialog.
func (*FilePicker) WorkingDir ¶
func (f *FilePicker) WorkingDir() string
WorkingDir returns the current working directory of the FilePicker.
type ListItem ¶
type ListItem interface {
list.FilterableItem
list.Focusable
list.MatchSettable
// ID returns the unique identifier of the item.
ID() string
}
ListItem represents a selectable and searchable item in a dialog list.
type ListItemStyles ¶
type LoadingDialog ¶
LoadingDialog is a dialog that can show a loading state.
type ModelGroup ¶
type ModelGroup struct {
*list.Versioned
Title string
Items []*ModelItem
// contains filtered or unexported fields
}
ModelGroup represents a group of model items.
func NewModelGroup ¶
NewModelGroup creates a new ModelGroup.
func (*ModelGroup) AppendItems ¶
func (m *ModelGroup) AppendItems(items ...*ModelItem)
AppendItems appends [ModelItem]s to the group.
func (*ModelGroup) Finished ¶
func (m *ModelGroup) Finished() bool
Finished implements list.Item. Model groups are immutable headers.
type ModelItem ¶
ModelItem represents a list item for a model type.
func NewModelItem ¶
func NewModelItem(t *styles.Styles, prov catwalk.Provider, model catwalk.Model, typ ModelType, showProvider bool) *ModelItem
NewModelItem creates a new ModelItem.
func (*ModelItem) Finished ¶
Finished implements list.Item. Model items are render-stable outside of explicit SetFocused / SetMatch.
func (*ModelItem) SelectedModel ¶
func (m *ModelItem) SelectedModel() config.SelectedModel
SelectedModel returns this model item as a config.SelectedModel instance.
func (*ModelItem) SelectedModelType ¶
func (m *ModelItem) SelectedModelType() config.SelectedModelType
SelectedModelType returns the type of model represented by this item.
func (*ModelItem) SetFocused ¶
SetFocused implements ListItem.
type ModelType ¶
type ModelType int
ModelType represents the type of model to select.
func (ModelType) Config ¶
func (mt ModelType) Config() config.SelectedModelType
Config returns the corresponding config model type.
func (ModelType) Placeholder ¶
Placeholder returns the input placeholder for the model type.
type Models ¶
type Models struct {
// contains filtered or unexported fields
}
Models represents a model selection dialog.
type ModelsList ¶
ModelsList is a list specifically for model items and groups.
func NewModelsList ¶
func NewModelsList(sty *styles.Styles, groups ...ModelGroup) *ModelsList
NewModelsList creates a new list suitable for model items and groups.
func (*ModelsList) IsSelectedFirst ¶
func (f *ModelsList) IsSelectedFirst() bool
IsSelectedFirst checks if the selected item is the first model item.
func (*ModelsList) IsSelectedLast ¶
func (f *ModelsList) IsSelectedLast() bool
IsSelectedLast checks if the selected item is the last model item.
func (*ModelsList) Len ¶
func (f *ModelsList) Len() int
Len returns the number of model items across all groups.
func (*ModelsList) Render ¶
func (f *ModelsList) Render() string
Render renders the filterable list.
func (*ModelsList) SelectFirst ¶
func (f *ModelsList) SelectFirst() (v bool)
SelectFirst selects the first model item in the list.
func (*ModelsList) SelectLast ¶
func (f *ModelsList) SelectLast() (v bool)
SelectLast selects the last model item in the list.
func (*ModelsList) SelectNext ¶
func (f *ModelsList) SelectNext() (v bool)
SelectNext selects the next model item, skipping any non-focusable items like group headers and spacers.
func (*ModelsList) SelectNextCyclic ¶
func (f *ModelsList) SelectNextCyclic()
SelectNextCyclic selects the next model item, wrapping to the first one if the last is currently selected, and scrolls it into view.
func (*ModelsList) SelectPrev ¶
func (f *ModelsList) SelectPrev() (v bool)
SelectPrev selects the previous model item, skipping any non-focusable items like group headers and spacers.
func (*ModelsList) SelectPrevCyclic ¶
func (f *ModelsList) SelectPrevCyclic()
SelectPrevCyclic selects the previous model item, wrapping to the last one if the first is currently selected, and scrolls it into view.
func (*ModelsList) SetFilter ¶
func (f *ModelsList) SetFilter(q string)
SetFilter sets the filter query and updates the list items.
func (*ModelsList) SetGroups ¶
func (f *ModelsList) SetGroups(groups ...ModelGroup)
SetGroups sets the model groups and updates the list items.
func (*ModelsList) SetSelected ¶
func (f *ModelsList) SetSelected(index int)
SetSelected sets the selected item index. It overrides the base method to skip non-model items.
func (*ModelsList) SetSelectedItem ¶
func (f *ModelsList) SetSelectedItem(itemID string)
SetSelectedItem sets the selected item in the list by item ID.
func (*ModelsList) VisibleItems ¶
func (f *ModelsList) VisibleItems() []list.Item
VisibleItems returns the visible items after filtering.
type NotificationItem ¶
NotificationItem represents a notification style list item.
func (*NotificationItem) Filter ¶
func (n *NotificationItem) Filter() string
Filter returns the filter value for the notification item.
func (*NotificationItem) Finished ¶
func (n *NotificationItem) Finished() bool
Finished implements list.Item. Notification items are render-stable outside of explicit SetFocused / SetMatch.
func (*NotificationItem) ID ¶
func (n *NotificationItem) ID() string
ID returns the unique identifier for the notification style.
func (*NotificationItem) Render ¶
func (n *NotificationItem) Render(width int) string
Render returns the string representation of the notification item.
func (*NotificationItem) SetFocused ¶
func (n *NotificationItem) SetFocused(focused bool)
SetFocused sets the focus state of the notification item.
func (*NotificationItem) SetMatch ¶
func (n *NotificationItem) SetMatch(m fuzzy.Match)
SetMatch sets the fuzzy match for the notification item.
type NotificationStyle ¶
NotificationStyle represents a notification backend option.
type Notifications ¶
type Notifications struct {
// contains filtered or unexported fields
}
Notifications represents a dialog for selecting notification style.
func NewNotifications ¶
func NewNotifications(com *common.Common) *Notifications
NewNotifications creates a new notification style picker dialog.
func (*Notifications) Cursor ¶
func (n *Notifications) Cursor() *tea.Cursor
Cursor returns the cursor position relative to the dialog.
func (*Notifications) FullHelp ¶
func (n *Notifications) FullHelp() [][]key.Binding
FullHelp implements help.KeyMap.
func (*Notifications) HandleMsg ¶
func (n *Notifications) HandleMsg(msg tea.Msg) Action
HandleMsg implements Dialog.
func (*Notifications) ShortHelp ¶
func (n *Notifications) ShortHelp() []key.Binding
ShortHelp implements help.KeyMap.
type OAuth ¶
type OAuth struct {
State OAuthState
// contains filtered or unexported fields
}
OAuth handles the OAuth flow authentication.
func NewOAuthCopilot ¶
func NewOAuthHyper ¶
type OAuthCopilot ¶
type OAuthCopilot struct {
// contains filtered or unexported fields
}
type OAuthHyper ¶
type OAuthHyper struct {
// contains filtered or unexported fields
}
type OAuthProvider ¶
type OAuthProvider interface {
// contains filtered or unexported methods
}
type OAuthState ¶
type OAuthState int
OAuthState represents the current state of the device flow.
const ( OAuthStateInitializing OAuthState = iota OAuthStateDisplay OAuthStateSuccess OAuthStateError )
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay manages multiple dialogs as an overlay.
func NewOverlay ¶
NewOverlay creates a new Overlay instance.
func (*Overlay) BringToFront ¶
BringToFront brings the dialog with the specified ID to the front.
func (*Overlay) CloseDialog ¶
CloseDialog closes the dialog with the specified ID from the stack.
func (*Overlay) CloseFrontDialog ¶
func (d *Overlay) CloseFrontDialog()
CloseFrontDialog closes the front dialog in the stack.
func (*Overlay) CloseSettingsFamilyDialogs ¶
func (d *Overlay) CloseSettingsFamilyDialogs()
CloseSettingsFamilyDialogs closes every settings-family dialog that is mutually exclusive with the others. Call this before opening any dialog in the Settings/Commands/Models/Notifications/Reasoning group so that no stale dialog remains visible in the background.
func (*Overlay) ContainsDialog ¶
ContainsDialog checks if a dialog with the specified ID exists.
func (*Overlay) DialogLast ¶
DialogLast returns the front dialog, or nil if there are no dialogs.
func (*Overlay) HasDialogs ¶
HasDialogs checks if there are any active dialogs.
func (*Overlay) OpenDialog ¶
OpenDialog opens a new dialog to the stack.
func (*Overlay) StartLoading ¶
StartLoading starts the loading state for the front dialog if it implements LoadingDialog.
func (*Overlay) StopLoading ¶
func (d *Overlay) StopLoading()
StopLoading stops the loading state for the front dialog if it implements LoadingDialog.
type PermissionAction ¶
type PermissionAction string
PermissionAction represents the user's response to a permission request.
const ( PermissionAllow PermissionAction = "allow" PermissionAllowForSession PermissionAction = "allow_session" PermissionDeny PermissionAction = "deny" )
type Permissions ¶
type Permissions struct {
// contains filtered or unexported fields
}
Permissions represents a dialog for permission requests.
func NewPermissions ¶
func NewPermissions(com *common.Common, perm permission.PermissionRequest, opts ...PermissionsOption) *Permissions
NewPermissions creates a new permissions dialog.
func (*Permissions) FullHelp ¶
func (p *Permissions) FullHelp() [][]key.Binding
FullHelp implements help.KeyMap.
func (*Permissions) HandleMsg ¶
func (p *Permissions) HandleMsg(msg tea.Msg) Action
HandleMsg implements Dialog.
func (*Permissions) ShortHelp ¶
func (p *Permissions) ShortHelp() []key.Binding
ShortHelp implements help.KeyMap.
func (*Permissions) ToolCallID ¶
func (p *Permissions) ToolCallID() string
ToolCallID returns the tool call ID associated with this dialog's permission request.
type PermissionsOption ¶
type PermissionsOption func(*Permissions)
PermissionsOption configures the permissions dialog.
func WithDiffMode ¶
func WithDiffMode(split bool) PermissionsOption
WithDiffMode sets the initial diff mode (split or unified).
type PlanReview ¶
type PlanReview struct {
// contains filtered or unexported fields
}
PlanReview is the submit_plan review surface shown outside the transcript.
func NewPlanReview ¶
func NewPlanReview(com *common.Common, submission planreview.Submission) *PlanReview
NewPlanReview creates a new plan review dialog for a submitted plan.
func (*PlanReview) AddSubmission ¶
func (p *PlanReview) AddSubmission(submission planreview.Submission)
AddSubmission appends or replaces the active submission and switches focus to the latest version.
func (*PlanReview) ID ¶
func (p *PlanReview) ID() string
type Quit ¶
type Quit struct {
// contains filtered or unexported fields
}
Quit represents a confirmation dialog for quitting the application.
type Reasoning ¶
type Reasoning struct {
// contains filtered or unexported fields
}
Reasoning represents a dialog for selecting reasoning effort.
func NewReasoning ¶
NewReasoning creates a new reasoning effort dialog.
func (*Reasoning) FullHelp ¶
FullHelp implements help.KeyMap.
type ReasoningItem ¶
ReasoningItem represents a reasoning effort list item.
func (*ReasoningItem) Filter ¶
func (r *ReasoningItem) Filter() string
Filter returns the filter value for the reasoning item.
func (*ReasoningItem) Finished ¶
func (r *ReasoningItem) Finished() bool
Finished implements list.Item. Reasoning items are render-stable outside of explicit SetFocused / SetMatch.
func (*ReasoningItem) ID ¶
func (r *ReasoningItem) ID() string
ID returns the unique identifier for the reasoning effort.
func (*ReasoningItem) Render ¶
func (r *ReasoningItem) Render(width int) string
Render returns the string representation of the reasoning item.
func (*ReasoningItem) SetFocused ¶
func (r *ReasoningItem) SetFocused(focused bool)
SetFocused sets the focus state of the reasoning item.
func (*ReasoningItem) SetMatch ¶
func (r *ReasoningItem) SetMatch(m fuzzy.Match)
SetMatch sets the fuzzy match for the reasoning item.
type RenderContext ¶
type RenderContext struct {
// Styles is the styles to use for rendering.
Styles *styles.Styles
// TitleStyle is the style of the dialog title by default it uses Styles.Dialog.Title
TitleStyle lipgloss.Style
// ViewStyle is the style of the dialog title by default it uses Styles.Dialog.View
ViewStyle lipgloss.Style
// TitleGradientFromColor is the color the title gradient starts by default
// its Styles.Dialog.TitleGradFromColor
TitleGradientFromColor color.Color
// TitleGradientToColor is the color the title gradient ends by default its
// Styles.Dialog.TitleGradToColor
TitleGradientToColor color.Color
// Width is the total width of the dialog including any margins, borders,
// and paddings.
Width int
// Gap is the gap between content parts. Zero means no gap.
Gap int
// Title is the title of the dialog. This will be styled using the default
// dialog title style and prepended to the content parts slice.
Title string
// TitleInfo is additional information to display next to the title. This
// part is displayed as is, any styling must be applied before setting this
// field.
TitleInfo string
// Parts are the rendered parts of the dialog.
Parts []string
// Help is the help view content. This will be appended to the content parts
// slice using the default dialog help style.
Help string
// IsOnboarding indicates whether to render the dialog as part of the
// onboarding flow. This means that the content will be rendered at the
// bottom left of the screen.
IsOnboarding bool
}
RenderContext is a dialog rendering context that can be used to render common dialog layouts.
func NewRenderContext ¶
func NewRenderContext(t *styles.Styles, width int) *RenderContext
NewRenderContext creates a new RenderContext with the provided styles and width.
func (*RenderContext) AddPart ¶
func (rc *RenderContext) AddPart(part string)
AddPart adds a rendered part to the dialog.
func (*RenderContext) Render ¶
func (rc *RenderContext) Render() string
Render renders the dialog using the provided context.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a session selector dialog.
func NewSessions ¶
NewSessions creates a new Session dialog.
func (*Session) FullHelp ¶
FullHelp implements help.KeyMap.
type SessionItem ¶
type SessionItem struct {
*list.Versioned
session.Session
// contains filtered or unexported fields
}
SessionItem wraps a session.Session to implement the ListItem interface.
func (*SessionItem) Cursor ¶
func (s *SessionItem) Cursor() *tea.Cursor
Cursor returns the cursor of the update title input
func (*SessionItem) Filter ¶
func (s *SessionItem) Filter() string
Filter returns the filterable value of the session.
func (*SessionItem) Finished ¶
func (s *SessionItem) Finished() bool
Finished implements list.Item. Session items are render-stable outside of explicit SetFocused / SetMatch calls, both of which bump Version() and therefore invalidate the F6 frozen entry.
func (*SessionItem) HandleInput ¶
func (s *SessionItem) HandleInput(msg tea.Msg) tea.Cmd
HandleInput forwards input message to the update title input
func (*SessionItem) ID ¶
func (s *SessionItem) ID() string
ID returns the unique identifier of the session.
func (*SessionItem) InputValue ¶
func (s *SessionItem) InputValue() string
InputValue returns the updated title value
func (*SessionItem) Render ¶
func (s *SessionItem) Render(width int) string
Render returns the string representation of the session item.
func (*SessionItem) SetFocused ¶
func (s *SessionItem) SetFocused(focused bool)
SetFocused sets the focus state of the session item.
func (*SessionItem) SetMatch ¶
func (s *SessionItem) SetMatch(m fuzzy.Match)
SetMatch sets the fuzzy match for the session item.
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings is the Settings hub dialog opened by ctrl+p. It shows navigable sections that route to sub-views or existing dialogs.
func NewSettings ¶
NewSettings creates a new Settings hub dialog.
type ToolsList ¶
ToolsList wraps list.List with grouped category/tool display and fuzzy filtering.
func (*ToolsList) IsSelectedFirst ¶
IsSelectedFirst reports whether the selection is on the first toolItem.
func (*ToolsList) IsSelectedLast ¶
IsSelectedLast reports whether the selection is on the last toolItem.
func (*ToolsList) SelectFirst ¶
SelectFirst selects the first toolItem.
func (*ToolsList) SelectLast ¶
SelectLast selects the last toolItem.
func (*ToolsList) SelectNext ¶
SelectNext skips non-toolItem entries (group headers, spacers).
func (*ToolsList) SelectNextCyclic ¶
func (l *ToolsList) SelectNextCyclic()
SelectNextCyclic selects the next toolItem, wrapping to the first one if the last is currently selected, and scrolls it into view.
func (*ToolsList) SelectPrev ¶
SelectPrev skips non-toolItem entries.
func (*ToolsList) SelectPrevCyclic ¶
func (l *ToolsList) SelectPrevCyclic()
SelectPrevCyclic selects the previous toolItem, wrapping to the last one if the first is currently selected, and scrolls it into view.
type WebSearchConfig ¶
type WebSearchConfig struct {
// contains filtered or unexported fields
}
func NewWebSearchConfig ¶
func NewWebSearchConfig(com *common.Common, providerID string) (*WebSearchConfig, error)
func (*WebSearchConfig) Cursor ¶
func (m *WebSearchConfig) Cursor() *tea.Cursor
func (*WebSearchConfig) FullHelp ¶
func (m *WebSearchConfig) FullHelp() [][]key.Binding
func (*WebSearchConfig) ID ¶
func (m *WebSearchConfig) ID() string
func (*WebSearchConfig) ShortHelp ¶
func (m *WebSearchConfig) ShortHelp() []key.Binding
Source Files
¶
- actions.go
- api_key_input.go
- arguments.go
- commands.go
- commands_item.go
- common.go
- dialog.go
- filepicker.go
- models.go
- models_item.go
- models_list.go
- notifications.go
- oauth.go
- oauth_copilot.go
- oauth_hyper.go
- permissions.go
- plan_review.go
- quit.go
- reasoning.go
- sessions.go
- sessions_item.go
- settings.go
- settings_card.go
- tools_list.go
- web_search_config.go