dialog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

View Source
const APIKeyInputID = "api_key_input"

APIKeyInputID is the identifier for the model selection dialog.

View Source
const ArgumentsID = "arguments"

ArgumentsID is the identifier for the arguments dialog.

View Source
const CommandsID = "commands"

CommandsID is the identifier for the commands dialog.

View Source
const FilePickerID = "filepicker"

FilePickerID is the identifier for the FilePicker dialog.

View Source
const ModelsID = "models"

ModelsID is the identifier for the model selection dialog.

View Source
const (
	// NotificationsID is the identifier for the notification style picker dialog.
	NotificationsID = "notifications"
)
View Source
const OAuthID = "oauth"

OAuthID is the identifier for the model selection dialog.

View Source
const PermissionsID = "permissions"

PermissionsID is the identifier for the permissions dialog.

View Source
const (
	// PlanReviewID is the identifier for the plan review dialog.
	PlanReviewID = "plan_review"
)
View Source
const QuitID = "quit"

QuitID is the identifier for the quit dialog.

View Source
const (
	// ReasoningID is the identifier for the reasoning effort dialog.
	ReasoningID = "reasoning"
)
View Source
const SessionsID = "session"

SessionsID is the identifier for the session selector dialog.

View Source
const SettingsID = "settings"

SettingsID is the identifier for the settings dialog.

View Source
const WebSearchConfigID = "web_search_config"

Variables

View Source
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.

View Source
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

func DrawCenter(scr uv.Screen, area uv.Rectangle, view string)

DrawCenter draws the given string view centered in the screen area.

func DrawCenterCursor

func DrawCenterCursor(scr uv.Screen, area uv.Rectangle, view string, cur *tea.Cursor)

DrawCenterCursor draws the given string view centered in the screen area and adjusts the cursor position accordingly.

func DrawOnboarding

func DrawOnboarding(scr uv.Screen, area uv.Rectangle, view string)

DrawOnboarding draws the given string view centered in the screen area.

func DrawOnboardingCursor

func DrawOnboardingCursor(scr uv.Screen, area uv.Rectangle, view string, cur *tea.Cursor)

DrawOnboardingCursor draws the given string view positioned at the bottom left area of the screen.

func InputCursor

func InputCursor(t *styles.Styles, cur *tea.Cursor) *tea.Cursor

InputCursor adjusts the cursor position for an input field within a dialog.

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) Draw

func (m *APIKeyInput) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements 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) ID

func (m *APIKeyInput) ID() string

ID 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

type ActionAttachSkill struct {
	ID   string
	Name string
}

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 ActionClose

type ActionClose struct{}

ActionClose is a message to close the current dialog.

type ActionCmd

type ActionCmd struct {
	Cmd tea.Cmd
}

ActionCmd represents an action that carries a tea.Cmd to be passed to the Bubble Tea program loop.

type ActionCompleteOAuth

type ActionCompleteOAuth struct {
	Token *oauth.Token
}

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 ActionExternalEditor

type ActionExternalEditor struct{}

Messages for commands

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

Cmd returns a command that reads the file at path and sends a message.Attachement to the program.

type ActionInitializeProject

type ActionInitializeProject struct{}

Messages for commands

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 ActionNewSession

type ActionNewSession struct{}

Messages for commands

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

type ActionOpenProviderConfig struct {
	Provider catwalk.Provider
}

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 ActionQuit

type ActionQuit = tea.QuitMsg

ActionQuit is a message to quit the application.

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

type ActionSelectCapabilityProvider struct {
	Capability string
	ProviderID string
}

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

type ActionSelectSession struct {
	Session session.Session
}

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 ActionSummarize

type ActionSummarize struct {
	SessionID string
}

Messages for commands

type ActionToggleCompactMode

type ActionToggleCompactMode struct{}

Messages for commands

type ActionToggleHelp

type ActionToggleHelp struct{}

Messages for commands

type ActionToggleNotifications

type ActionToggleNotifications struct{}

Messages for commands

type ActionTogglePills

type ActionTogglePills struct{}

Messages for commands

type ActionToggleThinking

type ActionToggleThinking struct{}

Messages for commands

type ActionToggleTransparentBackground

type ActionToggleTransparentBackground struct{}

Messages for commands

type ActionToggleVerboseSteps

type ActionToggleVerboseSteps struct{}

ActionToggleVerboseSteps toggles verbose agent step narration.

type ActionToggleYoloMode

type ActionToggleYoloMode struct{}

Messages for commands

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

func (a *Arguments) Cursor(descriptionHeight int) *tea.Cursor

Cursor returns the cursor position relative to the dialog. we pass the description height to offset the cursor correctly.

func (*Arguments) Draw

func (a *Arguments) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements Dialog.

func (*Arguments) FullHelp

func (a *Arguments) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Arguments) HandleMsg

func (a *Arguments) HandleMsg(msg tea.Msg) Action

HandleMsg implements Dialog.

func (*Arguments) ID

func (a *Arguments) ID() string

ID implements Dialog.

func (*Arguments) ShortHelp

func (a *Arguments) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Arguments) StartLoading

func (a *Arguments) StartLoading() tea.Cmd

StartLoading implements LoadingDialog.

func (*Arguments) StopLoading

func (a *Arguments) StopLoading()

StopLoading implements LoadingDialog.

type CommandItem

type CommandItem struct {
	*list.Versioned
	// contains filtered or unexported fields
}

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) Filter

func (c *CommandItem) Filter() string

Filter implements ListItem.

func (*CommandItem) Finished

func (c *CommandItem) Finished() bool

Finished implements list.Item. Command items are render-stable outside of explicit SetFocused / SetMatch.

func (*CommandItem) ID

func (c *CommandItem) ID() string

ID implements ListItem.

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) Cursor

func (c *Commands) Cursor() *tea.Cursor

Cursor returns the cursor position relative to the dialog.

func (*Commands) Draw

func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements Dialog.

func (*Commands) FullHelp

func (c *Commands) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Commands) HandleMsg

func (c *Commands) HandleMsg(msg tea.Msg) Action

HandleMsg implements Dialog.

func (*Commands) ID

func (c *Commands) ID() string

ID implements Dialog.

func (*Commands) InitialCmd

func (c *Commands) InitialCmd() tea.Cmd

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

func (c *Commands) SetMCPPrompts(mcpPrompts []commands.MCPPrompt)

SetMCPPrompts sets the MCP prompts and refreshes the view if MCP prompts are currently displayed.

func (*Commands) ShortHelp

func (c *Commands) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

func (*Commands) StartLoading

func (a *Commands) StartLoading() tea.Cmd

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

func (f *FilePicker) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

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 ListItemStyles struct {
	ItemBlurred     lipgloss.Style
	ItemFocused     lipgloss.Style
	InfoTextBlurred lipgloss.Style
	InfoTextFocused lipgloss.Style
}

type LoadingDialog

type LoadingDialog interface {
	StartLoading() tea.Cmd
	StopLoading()
}

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

func NewModelGroup(t *styles.Styles, title string, configured bool, items ...*ModelItem) ModelGroup

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.

func (*ModelGroup) Render

func (m *ModelGroup) Render(width int) string

Render implements list.Item.

type ModelItem

type ModelItem struct {
	*list.Versioned
	// contains filtered or unexported fields
}

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) Filter

func (m *ModelItem) Filter() string

Filter implements ListItem.

func (*ModelItem) Finished

func (m *ModelItem) Finished() bool

Finished implements list.Item. Model items are render-stable outside of explicit SetFocused / SetMatch.

func (*ModelItem) ID

func (m *ModelItem) ID() string

ID implements ListItem.

func (*ModelItem) Render

func (m *ModelItem) Render(width int) string

Render implements ListItem.

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

func (m *ModelItem) SetFocused(focused bool)

SetFocused implements ListItem.

func (*ModelItem) SetMatch

func (m *ModelItem) SetMatch(fm fuzzy.Match)

SetMatch implements ListItem.

type ModelType

type ModelType int

ModelType represents the type of model to select.

const (
	ModelTypeLarge ModelType = iota
	ModelTypeSmall
)

func (ModelType) Config

func (mt ModelType) Config() config.SelectedModelType

Config returns the corresponding config model type.

func (ModelType) Placeholder

func (mt ModelType) Placeholder() string

Placeholder returns the input placeholder for the model type.

func (ModelType) String

func (mt ModelType) String() string

String returns the string representation of the ModelType.

type Models

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

Models represents a model selection dialog.

func NewModels

func NewModels(com *common.Common, isOnboarding bool, preferredProviderID string) (*Models, error)

NewModels creates a new Models dialog.

func (*Models) Cursor

func (m *Models) Cursor() *tea.Cursor

Cursor returns the cursor for the dialog.

func (*Models) Draw

func (m *Models) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements Dialog.

func (*Models) FullHelp

func (m *Models) FullHelp() [][]key.Binding

FullHelp returns the full help view.

func (*Models) HandleMsg

func (m *Models) HandleMsg(msg tea.Msg) Action

HandleMsg implements Dialog.

func (*Models) ID

func (m *Models) ID() string

ID implements Dialog.

func (*Models) ShortHelp

func (m *Models) ShortHelp() []key.Binding

ShortHelp returns the short help view.

type ModelsList

type ModelsList struct {
	*list.List
	// contains filtered or unexported fields
}

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

type NotificationItem struct {
	*list.Versioned
	// contains filtered or unexported fields
}

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

type NotificationStyle struct {
	ID          string
	Title       string
	Description string
}

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) Draw

func (n *Notifications) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements 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) ID

func (n *Notifications) ID() string

ID 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 NewOAuthCopilot(
	com *common.Common,
	isOnboarding bool,
	provider catwalk.Provider,
	model config.SelectedModel,
	modelType config.SelectedModelType,
) (*OAuth, tea.Cmd)

func NewOAuthHyper

func NewOAuthHyper(
	com *common.Common,
	isOnboarding bool,
	provider catwalk.Provider,
	model config.SelectedModel,
	modelType config.SelectedModelType,
) (*OAuth, tea.Cmd)

func (*OAuth) Draw

func (m *OAuth) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

View renders the device flow dialog.

func (*OAuth) FullHelp

func (m *OAuth) FullHelp() [][]key.Binding

FullHelp returns the full help view.

func (*OAuth) HandleMsg

func (m *OAuth) HandleMsg(msg tea.Msg) Action

HandleMsg handles messages and state transitions.

func (*OAuth) ID

func (m *OAuth) ID() string

ID implements Dialog.

func (*OAuth) ShortHelp

func (m *OAuth) ShortHelp() []key.Binding

ShortHelp returns the full help view.

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

func NewOverlay(dialogs ...Dialog) *Overlay

NewOverlay creates a new Overlay instance.

func (*Overlay) BringToFront

func (d *Overlay) BringToFront(dialogID string)

BringToFront brings the dialog with the specified ID to the front.

func (*Overlay) CloseDialog

func (d *Overlay) CloseDialog(dialogID string)

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

func (d *Overlay) ContainsDialog(dialogID string) bool

ContainsDialog checks if a dialog with the specified ID exists.

func (*Overlay) Dialog

func (d *Overlay) Dialog(dialogID string) Dialog

Dialog returns the dialog with the specified ID, or nil if not found.

func (*Overlay) DialogLast

func (d *Overlay) DialogLast() Dialog

DialogLast returns the front dialog, or nil if there are no dialogs.

func (*Overlay) Draw

func (d *Overlay) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw renders the overlay and its dialogs.

func (*Overlay) HasDialogs

func (d *Overlay) HasDialogs() bool

HasDialogs checks if there are any active dialogs.

func (*Overlay) OpenDialog

func (d *Overlay) OpenDialog(dialog Dialog)

OpenDialog opens a new dialog to the stack.

func (*Overlay) StartLoading

func (d *Overlay) StartLoading() tea.Cmd

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.

func (*Overlay) Update

func (d *Overlay) Update(msg tea.Msg) tea.Msg

Update handles dialog updates.

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) Draw

func (p *Permissions) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements 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) ID

func (*Permissions) ID() string

ID 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) Draw

func (p *PlanReview) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

func (*PlanReview) HandleMsg

func (p *PlanReview) HandleMsg(msg tea.Msg) Action

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.

func NewQuit

func NewQuit(com *common.Common) *Quit

NewQuit creates a new quit confirmation dialog.

func (*Quit) Draw

func (q *Quit) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements Dialog.

func (*Quit) FullHelp

func (q *Quit) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Quit) HandleMsg

func (q *Quit) HandleMsg(msg tea.Msg) Action

HandleMsg implements [Model].

func (*Quit) ID

func (*Quit) ID() string

ID implements [Model].

func (*Quit) ShortHelp

func (q *Quit) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

type Reasoning

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

Reasoning represents a dialog for selecting reasoning effort.

func NewReasoning

func NewReasoning(com *common.Common) (*Reasoning, error)

NewReasoning creates a new reasoning effort dialog.

func (*Reasoning) Cursor

func (r *Reasoning) Cursor() *tea.Cursor

Cursor returns the cursor position relative to the dialog.

func (*Reasoning) Draw

func (r *Reasoning) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements Dialog.

func (*Reasoning) FullHelp

func (r *Reasoning) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Reasoning) HandleMsg

func (r *Reasoning) HandleMsg(msg tea.Msg) Action

HandleMsg implements Dialog.

func (*Reasoning) ID

func (r *Reasoning) ID() string

ID implements Dialog.

func (*Reasoning) ShortHelp

func (r *Reasoning) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

type ReasoningItem

type ReasoningItem struct {
	*list.Versioned
	// contains filtered or unexported fields
}

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

func NewSessions(com *common.Common, selectedSessionID string) (*Session, error)

NewSessions creates a new Session dialog.

func (*Session) Cursor

func (s *Session) Cursor() *tea.Cursor

Cursor returns the cursor position relative to the dialog.

func (*Session) Draw

func (s *Session) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

Draw implements Dialog.

func (*Session) FullHelp

func (s *Session) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (*Session) HandleMsg

func (s *Session) HandleMsg(msg tea.Msg) Action

HandleMsg implements Dialog.

func (*Session) ID

func (s *Session) ID() string

ID implements Dialog.

func (*Session) ShortHelp

func (s *Session) ShortHelp() []key.Binding

ShortHelp 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

func NewSettings(com *common.Common) (*Settings, error)

NewSettings creates a new Settings hub dialog.

func (*Settings) Cursor

func (s *Settings) Cursor() *tea.Cursor

Cursor implements Dialog.

func (*Settings) Draw

func (s *Settings) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

func (*Settings) FullHelp

func (s *Settings) FullHelp() [][]key.Binding

func (*Settings) HandleMsg

func (s *Settings) HandleMsg(msg tea.Msg) Action

HandleMsg implements Dialog.

func (*Settings) ID

func (s *Settings) ID() string

ID implements Dialog.

func (*Settings) ShortHelp

func (s *Settings) ShortHelp() []key.Binding

type ToolsList

type ToolsList struct {
	*list.List
	// contains filtered or unexported fields
}

ToolsList wraps list.List with grouped category/tool display and fuzzy filtering.

func (*ToolsList) IsSelectedFirst

func (l *ToolsList) IsSelectedFirst() bool

IsSelectedFirst reports whether the selection is on the first toolItem.

func (*ToolsList) IsSelectedLast

func (l *ToolsList) IsSelectedLast() bool

IsSelectedLast reports whether the selection is on the last toolItem.

func (*ToolsList) SelectFirst

func (l *ToolsList) SelectFirst() bool

SelectFirst selects the first toolItem.

func (*ToolsList) SelectLast

func (l *ToolsList) SelectLast() bool

SelectLast selects the last toolItem.

func (*ToolsList) SelectNext

func (l *ToolsList) SelectNext() bool

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

func (l *ToolsList) SelectPrev() bool

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.

func (*ToolsList) SetFilter

func (l *ToolsList) SetFilter(query string)

SetFilter applies fuzzy filtering across all tool names/descs.

func (*ToolsList) SetGroups

func (l *ToolsList) SetGroups(groups ...toolGroup)

SetGroups replaces the tool groups and syncs the underlying list items.

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) Draw

func (m *WebSearchConfig) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor

func (*WebSearchConfig) FullHelp

func (m *WebSearchConfig) FullHelp() [][]key.Binding

func (*WebSearchConfig) HandleMsg

func (m *WebSearchConfig) HandleMsg(msg tea.Msg) Action

func (*WebSearchConfig) ID

func (m *WebSearchConfig) ID() string

func (*WebSearchConfig) ShortHelp

func (m *WebSearchConfig) ShortHelp() []key.Binding

Jump to

Keyboard shortcuts

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