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 ActionChangeAPIKeyState
- type ActionClose
- type ActionCmd
- type ActionCompleteOAuth
- type ActionDisableDockerMCP
- type ActionEnableDockerMCP
- type ActionExternalEditor
- type ActionFilePickerSelected
- type ActionInitializeProject
- type ActionInitiateOAuth
- type ActionNewSession
- type ActionOAuthErrored
- type ActionOpenDialog
- type ActionPermissionResponse
- type ActionQuit
- type ActionRunCustomCommand
- type ActionRunMCPPrompt
- type ActionSelectModel
- type ActionSelectReasoningEffort
- type ActionSelectSession
- type ActionSetTheme
- type ActionShare
- type ActionSummarize
- type ActionToggleCompactMode
- type ActionToggleHelp
- type ActionToggleNotifications
- type ActionTogglePills
- type ActionTogglePlanMode
- type ActionToggleThinking
- type ActionToggleTransparentBackground
- type ActionToggleYoloMode
- type ActionUnshare
- 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
- 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 DiffFile
- type DiffHunk
- type DiffReview
- type DiffReviewResult
- 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) 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 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) 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) 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 ThemeItem
- type ThemePicker
- func (tp *ThemePicker) Cursor() *tea.Cursor
- func (tp *ThemePicker) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor
- func (tp *ThemePicker) FullHelp() [][]key.Binding
- func (tp *ThemePicker) HandleMsg(msg tea.Msg) Action
- func (tp *ThemePicker) ID() string
- func (tp *ThemePicker) 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 (
DiffReviewID = "diff_review"
)
const FilePickerID = "filepicker"
FilePickerID is the identifier for the FilePicker dialog.
const ModelsID = "models"
ModelsID is the identifier for the model selection dialog.
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.
const (
// ThemePickerID is the identifier for the theme picker dialog.
ThemePickerID = "theme"
)
Variables ¶
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 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 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 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
}
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 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 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 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 ¶
type CommandItem struct {
// 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) 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.
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 DiffHunk ¶
type DiffHunk struct {
OldStart int
NewStart int
OldLines int
NewLines int
Content string
Accepted bool
Rejected bool
}
DiffHunk represents a single change block in a unified diff.
type DiffReview ¶
type DiffReview struct {
// contains filtered or unexported fields
}
DiffReview represents a dialog for reviewing and selectively accepting diff changes.
func NewDiffReview ¶
func NewDiffReview(com *common.Common, files []DiffFile) *DiffReview
NewDiffReview creates a new diff review dialog.
func (*DiffReview) Cursor ¶
func (dr *DiffReview) Cursor() *tea.Cursor
Cursor returns the cursor position relative to the dialog.
func (*DiffReview) FullHelp ¶
func (dr *DiffReview) FullHelp() [][]key.Binding
FullHelp implements help.KeyMap.
func (*DiffReview) HandleMsg ¶
func (dr *DiffReview) HandleMsg(msg tea.Msg) Action
HandleMsg implements Dialog.
func (*DiffReview) ShortHelp ¶
func (dr *DiffReview) ShortHelp() []key.Binding
ShortHelp implements help.KeyMap.
type DiffReviewResult ¶
type DiffReviewResult struct {
AcceptedHunks map[string]string // filePath -> accepted diff content
Canceled bool
}
DiffReviewResult is returned when the user confirms or cancels the review.
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 {
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.
type ModelItem ¶
type ModelItem struct {
// 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) 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 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) 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.
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 ¶
type ReasoningItem struct {
// 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) 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 defaults its Style.Primary
TitleGradientFromColor color.Color
// TitleGradientToColor is the color the title gradient starts by defaults its Style.Secondary
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 ¶
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) 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 ThemeItem ¶
type ThemeItem struct {
// contains filtered or unexported fields
}
ThemeItem represents a theme list item.
func (*ThemeItem) SetFocused ¶
SetFocused sets the focus state of the theme item.
type ThemePicker ¶
type ThemePicker struct {
// contains filtered or unexported fields
}
ThemePicker represents a dialog for selecting a color theme.
func NewThemePicker ¶
func NewThemePicker(com *common.Common) *ThemePicker
NewThemePicker creates a new theme picker dialog.
func (*ThemePicker) Cursor ¶
func (tp *ThemePicker) Cursor() *tea.Cursor
Cursor returns the cursor position relative to the dialog.
func (*ThemePicker) FullHelp ¶
func (tp *ThemePicker) FullHelp() [][]key.Binding
FullHelp implements help.KeyMap.
func (*ThemePicker) HandleMsg ¶
func (tp *ThemePicker) HandleMsg(msg tea.Msg) Action
HandleMsg implements Dialog.
func (*ThemePicker) ShortHelp ¶
func (tp *ThemePicker) ShortHelp() []key.Binding
ShortHelp implements help.KeyMap.