Documentation
¶
Index ¶
- Constants
- Variables
- func AddLineNumbers(content string) string
- func ClearLine() error
- func Colorize(c Color, s string) string
- func ColorizeDiff(diff string) string
- func ConfirmAction(action, connectionName string) (bool, error)
- func CreateReadlineCompletions(commands []ic.Command) []readline.PrefixCompleterInterface
- func DisplayBanner()
- func FormatConnectionList(result *client.ConnectionsResponse) error
- func FormatConnectionOperationResult(result *client.ConnectionOperationResponse) error
- func Height() int
- func Print(a ...interface{}) (n int, err error)
- func PrintBox(b *Box)
- func Printf(format string, a ...interface{}) (n int, err error)
- func Println(a ...interface{}) (n int, err error)
- func PromptForAuthToken(prompt string) (string, error)
- func SelectConnectionWithArrowKeys(connections []client.MCPServerInfo, prompt string) (*client.MCPServerInfo, error)
- func SetColorOutput(force bool)
- func ShowSessionsMenu(timClient *client.TimClient) (*client.SessionInfoResponse, error)
- func Size() (int, int)
- func TodoIcon(status session.TodoStatus, priority session.TodoPriority) string
- func TodoStatusFromText(status string) session.TodoStatus
- func TodoStatusText(status session.TodoStatus) string
- func VisualLen(s string) int
- func Width() int
- type Box
- type ChoiceResult
- type Color
- type CommandSelector
- type ConnectionAddPromptResult
- type ConnectionSelectionDisplay
- func (d *ConnectionSelectionDisplay) Clear()
- func (d *ConnectionSelectionDisplay) Display()
- func (d *ConnectionSelectionDisplay) GetSelected() *client.MCPServerInfo
- func (d *ConnectionSelectionDisplay) MoveDown() bool
- func (d *ConnectionSelectionDisplay) MoveUp() bool
- func (d *ConnectionSelectionDisplay) Update()
- type ConnectionSelector
- type Spinner
- type TerminalWriter
- type TodoMenu
- type TodoMenuCallbacks
- type TodoMenuItem
Constants ¶
const ( TodoMenuAdd = "add" TodoMenuEdit = "edit" TodoMenuBack = "back" )
const (
HeaderPrefixSuffix = "──"
)
Variables ¶
var ErrInputCancelled = errors.New("input cancelled")
ErrInputCancelled is returned when user cancels input with Escape or Ctrl+C
Functions ¶
func AddLineNumbers ¶
func ColorizeDiff ¶
func ConfirmAction ¶
ConfirmAction prompts the user to confirm an action
func CreateReadlineCompletions ¶
func CreateReadlineCompletions(commands []ic.Command) []readline.PrefixCompleterInterface
func DisplayBanner ¶
func DisplayBanner()
DisplayBanner shows the TIM banner at the top of the terminal
func FormatConnectionList ¶
func FormatConnectionList(result *client.ConnectionsResponse) error
func FormatConnectionOperationResult ¶
func FormatConnectionOperationResult(result *client.ConnectionOperationResponse) error
func PromptForAuthToken ¶
PromptForAuthToken prompts for an authentication token with cancellation support
func SelectConnectionWithArrowKeys ¶
func SelectConnectionWithArrowKeys(connections []client.MCPServerInfo, prompt string) (*client.MCPServerInfo, error)
SelectConnectionWithArrowKeys allows user to select a connection using arrow keys
func SetColorOutput ¶
func SetColorOutput(force bool)
SetColorOutput allows configuring whether color output is forced.
func ShowSessionsMenu ¶
func ShowSessionsMenu(timClient *client.TimClient) (*client.SessionInfoResponse, error)
func TodoIcon ¶
func TodoIcon(status session.TodoStatus, priority session.TodoPriority) string
TodoIcon returns a colored icon for the given status and priority
func TodoStatusFromText ¶
func TodoStatusFromText(status string) session.TodoStatus
TodoStatusFromText returns todo status from the given text
func TodoStatusText ¶
func TodoStatusText(status session.TodoStatus) string
TodoStatusText returns text for the given todo status
Types ¶
type ChoiceResult ¶
ChoiceResult holds the result of a choice selection
type CommandSelector ¶
type CommandSelector struct {
// contains filtered or unexported fields
}
func NewCommandSelector ¶
func NewCommandSelector(allCommands []ic.Command, logger *logger.Logger) *CommandSelector
func (*CommandSelector) HandleInput ¶
func (cs *CommandSelector) HandleInput(char byte) (bool, string)
func (*CommandSelector) IsActive ¶
func (cs *CommandSelector) IsActive() bool
func (*CommandSelector) Show ¶
func (cs *CommandSelector) Show()
type ConnectionAddPromptResult ¶
type ConnectionAddPromptResult struct {
Name string
Description string
Remote bool
Command string
URL string
Args []string
IsPreset bool
PresetChoice string
PresetIndex int // Index in the original preset list for mapping
}
ConnectionAddPromptResult contains the result of the interactive connection add prompt
func ConnectionAddPromptWithPresets ¶
func ConnectionAddPromptWithPresets(presetOptions []string) (*ConnectionAddPromptResult, error)
ConnectionAddPromptWithPresets prompts the user for information to add a new connection with preset options
type ConnectionSelectionDisplay ¶
type ConnectionSelectionDisplay struct {
// contains filtered or unexported fields
}
ConnectionSelectionDisplay encapsulates the display state and logic for connection selection
func NewConnectionSelectionDisplay ¶
func NewConnectionSelectionDisplay(connections []client.MCPServerInfo, prompt string) *ConnectionSelectionDisplay
NewConnectionSelectionDisplay creates a new connection selection display manager
func (*ConnectionSelectionDisplay) Clear ¶
func (d *ConnectionSelectionDisplay) Clear()
Clear clears the selection display with state validation
func (*ConnectionSelectionDisplay) Display ¶
func (d *ConnectionSelectionDisplay) Display()
Display shows the initial connection selection with header and content
func (*ConnectionSelectionDisplay) GetSelected ¶
func (d *ConnectionSelectionDisplay) GetSelected() *client.MCPServerInfo
GetSelected returns the currently selected connection
func (*ConnectionSelectionDisplay) MoveDown ¶
func (d *ConnectionSelectionDisplay) MoveDown() bool
MoveDown moves the selection down if possible and returns true if moved
func (*ConnectionSelectionDisplay) MoveUp ¶
func (d *ConnectionSelectionDisplay) MoveUp() bool
MoveUp moves the selection up if possible and returns true if moved
func (*ConnectionSelectionDisplay) Update ¶
func (d *ConnectionSelectionDisplay) Update()
Update redraws only the connection list portion with bounds checking
type ConnectionSelector ¶
type ConnectionSelector struct {
// contains filtered or unexported fields
}
ConnectionSelector provides interactive connection selection functionality
func NewConnectionSelector ¶
func NewConnectionSelector(connections []client.MCPServerInfo, prompt string) *ConnectionSelector
NewConnectionSelector creates a new connection selector
func (*ConnectionSelector) Select ¶
func (s *ConnectionSelector) Select() (*client.MCPServerInfo, error)
Select allows the user to select a connection using arrow keys
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
func NewSpinner ¶
func (*Spinner) Pause ¶
func (s *Spinner) Pause()
Pause pauses the spinner animation if it's currently active. Does nothing if the spinner is not active.
func (*Spinner) Resume ¶
func (s *Spinner) Resume()
Resume unpauses the spinner animation if it's currently active and paused. Does nothing if the spinner is not active and paused.
func (*Spinner) SetMessage ¶
type TerminalWriter ¶
type TerminalWriter struct {
// contains filtered or unexported fields
}
func NewTerminalWriter ¶
func NewTerminalWriter(w io.Writer) *TerminalWriter
type TodoMenu ¶
type TodoMenu struct {
// contains filtered or unexported fields
}
func NewTodoMenu ¶
func NewTodoMenu(items []TodoMenuItem, callbacks TodoMenuCallbacks) *TodoMenu
type TodoMenuCallbacks ¶
type TodoMenuCallbacks struct {
AddTodo func(title, description, priority string) error
RemoveTodo func(id string) error
UpdateStatus func(id, status string) error
UpdatePriority func(id, priority string) error
UpdateTitle func(id, title string) error
UpdateDescription func(id, description string) error
RefreshTodos func() []TodoMenuItem // returns the latest todo items
}