Documentation
¶
Index ¶
- type CommonServer
- type ConfigType
- type ConfirmModel
- type ConfirmMsg
- type FormKeyMap
- type FormModel
- type Model
- type ProfileFormKeyMap
- type ProfileFormModel
- func (m *ProfileFormModel) GetProfileData() (string, string, error)
- func (m *ProfileFormModel) GetToolsAndPrompts() ([]string, []string, []string, []string)
- func (m *ProfileFormModel) ParsePathList(input string) []string
- func (m *ProfileFormModel) SetProfileData(name, description string)
- func (m ProfileFormModel) Update(msg tea.Msg) (ProfileFormModel, tea.Cmd)
- func (m ProfileFormModel) View() string
- type ServerConfigEditor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonServer ¶
type CommonServer struct {
Name string // Name identifier for the server
Command string // Command to execute for the server (Claude)
Args []string // Arguments for the command (Claude)
Env map[string]string // Environment variables (Claude)
URL string // URL for SSE connection (Cursor)
IsSSE bool // Type identifier (true for Cursor SSE, false for Claude Command)
}
CommonServer is a unified structure to represent server configurations from different sources (Cursor, Claude Desktop, etc.) within the UI.
type ConfigType ¶
type ConfigType string
Define configuration types
const ( ConfigTypeCursor ConfigType = "cursor" ConfigTypeClaude ConfigType = "claude" ConfigTypeAmpCode ConfigType = "ampcode" // Configuration for Amp (Cursor) ConfigTypeAmp ConfigType = "amp" // Configuration for standalone Amp ConfigTypeProfile ConfigType = "profile" // New config type for profiles ConfigTypeNone ConfigType = "" // Represents no config loaded )
type ConfirmModel ¶
type ConfirmModel struct {
// contains filtered or unexported fields
}
ConfirmModel represents a confirmation dialog
func NewConfirmModel ¶
func NewConfirmModel(title, message string) ConfirmModel
NewConfirmModel creates a new confirmation dialog
func (ConfirmModel) Cancelled ¶
func (m ConfirmModel) Cancelled() bool
Cancelled returns whether the dialog was cancelled
func (ConfirmModel) Confirmed ¶
func (m ConfirmModel) Confirmed() bool
Confirmed returns whether the dialog was confirmed
func (ConfirmModel) Update ¶
func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)
Update handles confirmation dialog input
type ConfirmMsg ¶
type ConfirmMsg struct {
Confirmed bool
}
ConfirmMsg is returned when a selection is confirmed
type FormKeyMap ¶
type FormKeyMap struct {
Submit key.Binding
Cancel key.Binding
Next key.Binding // Tab
Prev key.Binding // Shift+Tab
}
FormKeyMap defines keybindings specific to the form view
type FormModel ¶
type FormModel struct {
// contains filtered or unexported fields
}
FormModel represents the form for adding/editing servers
func NewFormModel ¶
func NewFormModel() FormModel
NewFormModel creates a new form model with initialized inputs
func (*FormModel) ToServer ¶
func (m *FormModel) ToServer() (types.CommonServer, error)
ToServer converts the current form state into a CommonServer object. It performs basic validation (e.g., name is required).
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Main application model
type ProfileFormKeyMap ¶
type ProfileFormKeyMap struct {
Submit key.Binding
Cancel key.Binding
Next key.Binding // Tab
Prev key.Binding // Shift+Tab
}
ProfileFormKeyMap defines keybindings specific to the profile form view
type ProfileFormModel ¶
type ProfileFormModel struct {
// contains filtered or unexported fields
}
ProfileFormModel represents the form for adding/editing profiles
func NewProfileFormModel ¶
func NewProfileFormModel() ProfileFormModel
NewProfileFormModel creates a new profile form model with initialized inputs
func (*ProfileFormModel) GetProfileData ¶
func (m *ProfileFormModel) GetProfileData() (string, string, error)
GetProfileData retrieves the profile data from the form
func (*ProfileFormModel) GetToolsAndPrompts ¶
func (m *ProfileFormModel) GetToolsAndPrompts() ([]string, []string, []string, []string)
GetToolsAndPrompts retrieves tool and prompt configuration from the form
func (*ProfileFormModel) ParsePathList ¶
func (m *ProfileFormModel) ParsePathList(input string) []string
ParsePathList parses a comma-separated list of paths into a slice of strings
func (*ProfileFormModel) SetProfileData ¶
func (m *ProfileFormModel) SetProfileData(name, description string)
SetProfileData populates the form with existing profile data for editing
func (ProfileFormModel) Update ¶
func (m ProfileFormModel) Update(msg tea.Msg) (ProfileFormModel, tea.Cmd)
Update handles profile form input messages
func (ProfileFormModel) View ¶
func (m ProfileFormModel) View() string
View renders the profile form
type ServerConfigEditor ¶
type ServerConfigEditor interface {
// ListServers retrieves all configured servers (both enabled and disabled).
// It returns a map where the key is the server name.
ListServers() (map[string]CommonServer, error)
// ListDisabledServers returns the names of disabled servers.
// This might be redundant if ListServers includes enabled status, but kept for now
// based on the original proposal.
ListDisabledServers() ([]string, error)
// EnableMCPServer enables a specific server by name.
EnableMCPServer(name string) error
// DisableMCPServer disables a specific server by name.
DisableMCPServer(name string) error
// AddMCPServer adds or updates a server configuration.
AddMCPServer(server CommonServer, overwrite bool) error
// RemoveMCPServer removes a specific server by name.
RemoveMCPServer(name string) error
// Save persists the configuration changes to the underlying storage.
Save() error
// GetConfigPath returns the path of the configuration file being managed.
GetConfigPath() string
// IsServerDisabled checks if a server with the given name is currently disabled.
IsServerDisabled(name string) (bool, error)
// GetServer retrieves a specific server configuration by name.
GetServer(name string) (CommonServer, bool, error)
}
ServerConfigEditor defines the interface for managing server configurations in a backend-agnostic way for the TUI.