Documentation
¶
Index ¶
- Constants
- Variables
- func AgentDescription(a AgentName) string
- 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 ActionDisableDockerMCP
- type ActionEnableDockerMCP
- type ActionExternalEditor
- type ActionFilePickerSelected
- type ActionInitializeProject
- type ActionInitiateOAuth
- type ActionInlineCommand
- type ActionNewSession
- type ActionOAuthErrored
- type ActionOpenDialog
- type ActionPermissionResponse
- type ActionQuit
- type ActionRunCustomCommand
- type ActionRunMCPPrompt
- type ActionSelectAgent
- type ActionSelectModel
- type ActionSelectNotificationStyle
- type ActionSelectReasoningEffort
- type ActionSelectSession
- type ActionSummarize
- type ActionToggleCompactMode
- type ActionToggleHelp
- type ActionToggleNotifications
- type ActionTogglePills
- type ActionToggleThinking
- type ActionToggleTransparentBackground
- type ActionToggleYoloMode
- type AgentName
- type AgentSwitch
- func (a *AgentSwitch) Current() AgentName
- func (a *AgentSwitch) Cursor() *tea.Cursor
- func (a *AgentSwitch) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (a *AgentSwitch) FullHelp() [][]key.Binding
- func (a *AgentSwitch) HandleMsg(msg tea.Msg) Action
- func (a *AgentSwitch) ID() string
- func (a *AgentSwitch) Selected() AgentName
- func (a *AgentSwitch) ShortHelp() []key.Binding
- 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) SelectPrev() (v bool)
- 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) 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) OpenDialogWithGrace(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 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)
Constants ¶
const APIKeyInputID = "api_key_input"
APIKeyInputID is the identifier for the model selection dialog.
const AgentSwitchID = "agent-switch"
AgentSwitchID is the identifier for the agent switch 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 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.
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 AgentDescription ¶
AgentDescription returns a short blurb for an agent.
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 model selection 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 Models 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 full 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
}
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 ActionDisableDockerMCP ¶
type ActionDisableDockerMCP struct{}
ActionDisableDockerMCP is a message to disable Docker MCP.
type ActionEnableDockerMCP ¶
type ActionEnableDockerMCP struct{}
ActionEnableDockerMCP is a message to enable Docker MCP.
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 ActionInlineCommand ¶
type ActionInlineCommand struct {
// Invocation is the command token placed into the editor,
// without a trailing space (e.g. "/ralph-loop").
Invocation string
// Content is the command body, with optional $ARG placeholders.
Content string
// Arguments are the named $ARG placeholders, if any.
Arguments []commands.Argument
// Name is the bare command name (e.g. "caveman") so handlers
// can run side-effects (like setting intensity) before the
// command body is sent as a prompt.
Name string
}
ActionInlineCommand is sent when a slash command that expects user input is selected from the picker. Instead of running immediately, the command's invocation (e.g. "/ralph-loop") is placed into the editor so the user can type the argument inline right after it. On send, the typed text is injected into Content and dispatched as the prompt.
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 ActionPermissionResponse ¶
type ActionPermissionResponse struct {
Permission permission.PermissionRequest
Action PermissionAction
}
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
Name string // Bare command name (e.g. "caveman"); empty if not a builtin
}
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 ActionSelectAgent ¶
type ActionSelectAgent struct {
Agent AgentName
}
ActionSelectAgent is returned when the user picks an agent.
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 ActionToggleTransparentBackground ¶
type ActionToggleTransparentBackground struct{}
Messages for commands
type AgentName ¶
type AgentName string
AgentName is the registry name of a built-in agent.
const ( AgentOdin AgentName = "odin" AgentVolund AgentName = "volund" AgentHeimdall AgentName = "heimdall" AgentBragi AgentName = "bragi" // AgentBaldr is the default-on-launch primary agent. It is NOT // in MainAgents() — the Ctrl+A switcher exposes only the 4 work // agents. Users land on Baldr on launch and pick a work agent // via Ctrl+A. AgentBaldr AgentName = "baldr" )
The 4 main agents exposed in the switcher. Subagent-only agents (oracle, librarian, explore, multimodal-looker, metis, momus, vidar) are intentionally not switchable from the UI; they are reached via the task tool from a main agent.
func MainAgents ¶
func MainAgents() []AgentName
MainAgents returns the 4 main agents in display order.
type AgentSwitch ¶
type AgentSwitch struct {
// contains filtered or unexported fields
}
AgentSwitch is a dialog that lets the user pick one of the 4 main agents. It uses 4 buttons in a 2x2 grid (Tab / Shift+Tab to move, Enter to confirm, Esc to cancel).
func NewAgentSwitch ¶
func NewAgentSwitch(com *common.Common, current AgentName) *AgentSwitch
NewAgentSwitch creates a new agent switch dialog with the given currently-active agent.
func (*AgentSwitch) Current ¶
func (a *AgentSwitch) Current() AgentName
Current returns the agent that was active when the dialog opened.
func (*AgentSwitch) Draw ¶
Draw implements Dialog.
Layout: the 4 main agents are laid out in a single horizontal row. Buttons are padded to a fixed width so the row stays the same width regardless of which agent is selected. Below the row: the agent's description, wrapped to a fixed width so it doesn't reflow.
The dialog's width is fixed at 60 columns; the body is centered horizontally within that. Navigation is Left/Right (and 1-4 number keys for quick pick). Up/Down wrap.
func (*AgentSwitch) FullHelp ¶
func (a *AgentSwitch) FullHelp() [][]key.Binding
FullHelp implements help.KeyMap.
func (*AgentSwitch) HandleMsg ¶
func (a *AgentSwitch) HandleMsg(msg tea.Msg) Action
HandleMsg implements Dialog.
func (*AgentSwitch) Selected ¶
func (a *AgentSwitch) Selected() AgentName
Selected returns the currently-selected agent (for preview).
func (*AgentSwitch) ShortHelp ¶
func (a *AgentSwitch) ShortHelp() []key.Binding
ShortHelp implements help.KeyMap.
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) 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) 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) 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) OpenDialogWithGrace ¶
OpenDialogWithGrace opens a dialog with an input grace period. All keystrokes are absorbed until either the input has been quiet for graceQuietPeriod or graceMaxDelay has elapsed since opening, whichever comes first. Use this for dialogs that open asynchronously (e.g. permission prompts) where in-flight keystrokes from a previously focused component could act on the dialog before the user sees it.
If the same dialog ID was just closed (within reopenGraceWindow), the grace period is skipped — the user is already focused on this dialog type and rapid successive prompts should not eat keystrokes.
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 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.