Documentation
¶
Index ¶
- Constants
- Variables
- func Diff(content1, content2, file1, file2 string, contextLines int) string
- func FormatEnabledIndicator(enabled bool) string
- func GetDynamicHuhNote(title string, ms *huh.MultiSelect[string], descFunc func(string) string) *huh.Note
- func GetDynamicHuhNoteForSelect(title string, sel *huh.Select[string], descFunc func(string) string) *huh.Note
- func GetHuhKeyMap() *huh.KeyMap
- func GetLogo(textColor string, gradientColor string, scale float64) string
- func GetNewLineKeyBinding() key.Binding
- func GetRandomProcessingWord() string
- func GetStaticHuhNote(title string, description string) *huh.Note
- func GetStaticHuhNoteFull(title string, description string) *huh.Note
- func NeedUserConfirmToolUse(info string, prompt string, description string, toolsUse *data.ToolsUse)
- func PrintLogo(textColor string, gradientColor string, scale float64)
- func RegisterIndicatorHook()
- func RunFormClearable(form *huh.Form, ctx context.Context) error
- func SendEvent(msg tea.Msg)
- func SendSyncEvent(msg tea.Msg)
- func SortMultiOptions(options []huh.Option[string], selected []string)
- func SortOptions(options []huh.Option[string], selected string)
- func StartUIEventListener()
- type AskUserRequest
- type AskUserResponse
- type BannerMsg
- type ChatInputHooks
- type ChatInputModel
- type ChatInputResult
- type Indicator
- type PasteResultMsg
- type QuestionType
- type SessionMode
- type SessionModeMsg
- type StatusMsg
- type Suggestion
- type ViewportModel
Constants ¶
const ( SessionModeNormal = iota SessionModePlan SessionModeYolo )
const ( IndicatorLoadingMCP = "Loading MCP servers..." IndicatorCompressingContext = "Compressing context..." IndicatorRenamingSession = "Renaming session..." IndicatorConvertingSession = "Converting session..." IndicatorCheckingUpdate = "Checking for updates..." IndicatorInstallingUpdate = "Downloading and installing..." IndicatorGenInstruction = "Generating GLLM.md ..." )
const ( LogoFont = "8bitfortress" LogoText = "GLLM" )
Variables ¶
var WhimsicalProcessingWords = []string{
"Channelling...",
"Pondering...",
"Cogitating...",
"Contemplating...",
"Ruminating...",
"Philosophising...",
"Musing...",
"Deliberating...",
"Conjuring...",
"Wizarding...",
"Enchanting...",
"Spellcrafting...",
"Transmuting...",
"Alchemizing...",
"Computing...",
"Calculating...",
"Synthesizing...",
"Compiling...",
"Architecting...",
"Optimizing...",
"Booping...",
"Smooshing...",
"Discombobulating...",
"Flibbertigibbeting...",
"Bamboozling...",
"Zigzagging...",
"Percolating...",
"Noodling...",
"Crafting...",
"Assembling...",
"Constructing...",
"Fabricating...",
"Orchestrating...",
"Choreographing...",
"Imagining...",
"Dreaming...",
"Inventing...",
"Innovating...",
"Improvising...",
"Tinkering...",
"Fiddling...",
"Futzing...",
"Wrangling...",
"Massaging...",
"Finessing...",
}
WhimsicalProcessingWords is a collection of fun, playful processing indicators inspired by Claude Code's delightful personality
Functions ¶
func FormatEnabledIndicator ¶
FormatEnabledIndicator returns a consistent enabled/disabled bracket indicator When enabled: [✔] with green color When disabled: [ ] with no color
func GetDynamicHuhNote ¶
func GetDynamicHuhNote(title string, ms *huh.MultiSelect[string], descFunc func(string) string) *huh.Note
*
func GetDynamicHuhNoteForSelect ¶ added in v1.15.15
func GetDynamicHuhNoteForSelect(title string, sel *huh.Select[string], descFunc func(string) string) *huh.Note
GetDynamicHuhNoteForSelect creates a note that updates based on the hovered item in a single select
func GetHuhKeyMap ¶
GetHuhKeyMap returns a custom keymap for huh forms Specifically disables the Editor key binding for Text fields as it interferes with input
func GetNewLineKeyBinding ¶ added in v1.14.9
GetNewLineKeyBinding returns a key binding for inserting a newline
func GetRandomProcessingWord ¶ added in v1.14.4
func GetRandomProcessingWord() string
GetRandomProcessingWord returns a random whimsical processing word
func GetStaticHuhNoteFull ¶ added in v1.14.21
func NeedUserConfirmToolUse ¶ added in v1.14.12
func NeedUserConfirmToolUse(info string, prompt string, description string, toolsUse *data.ToolsUse)
NeedUserConfirmToolUse prompts the user for tool execution confirmation. If toolsUse.AutoApprove is true, it returns ToolConfirmYes immediately. Otherwise, it displays a selection menu for the user to choose "once", "session", or "cancel".
func RegisterIndicatorHook ¶ added in v1.15.9
func RegisterIndicatorHook()
RegisterIndicatorHook registers the global indicator as a logger hook
func RunFormClearable ¶ added in v1.15.31
RunFormClearable runs a huh.Form with context and clears it from the terminal on exit. It uses a goroutine to listen for context cancellation and sends a forceQuitMsg to ensure the TUI clears the screen before the process continues.
func SendEvent ¶ added in v1.14.26
SendEvent dispatches a message to the active chat input program. Goroutine-safe; saves status globally even if no program is running.
func SendSyncEvent ¶ added in v1.16.14
SendSyncEvent dispatches a message to the active chat input program synchronously. This is used for messages that need to be processed immediately.
func SortMultiOptions ¶
SortMultiOptions sorts options for huh.MultiSelect, pinning selected values to the top and sorting the rest alphabetically (case-sensitive).
func SortOptions ¶
SortOptions sorts options for huh.Select, pinning the selected value to the top and sorting the rest alphabetically (case-sensitive).
func StartUIEventListener ¶ added in v1.15.8
func StartUIEventListener()
StartUIEventListener runs event bus listeners. Call once at app startup. It bridges the decoupled service events to the concrete UI implementations.
Types ¶
type AskUserRequest ¶ added in v1.14.25
type AskUserRequest struct {
Question string
QuestionType QuestionType
Options []string
Placeholder string
}
AskUserRequest is the structured input from the LLM tool call.
type AskUserResponse ¶ added in v1.14.25
type AskUserResponse struct {
Answer string `json:"answer,omitempty"` // text / confirm / single-select
Answers []string `json:"answers,omitempty"` // multi-select
Cancelled bool `json:"cancelled,omitempty"` // user pressed Ctrl-C / Esc
}
AskUserResponse carries the user's answer back to the model.
func RunAskUser ¶ added in v1.14.25
func RunAskUser(req AskUserRequest) (AskUserResponse, error)
RunAskUser stops the spinner, renders the appropriate huh form, and returns the answer.
type BannerMsg ¶ added in v1.14.26
type BannerMsg struct{ Text string }
BannerMsg carries a notification banner text to display above the input.
type ChatInputHooks ¶ added in v1.14.28
type ChatInputHooks struct {
// EventChatInputReady is called when the chat input is ready
EventChatInputReady func()
// IsPlanModeActive returns true if in plan mode
IsPlanModeActive func() bool
// IsYoloModeActive returns true if in yolo mode
IsYoloModeActive func() bool
// ToggleSessionMode toggles the session mode
ToggleSessionMode func()
// OnPasteRequested is called when the user presses Ctrl+V.
// The orchestrator is responsible for reading the clipboard and calling
// ui.SendEvent(PasteResultMsg{...}) with the outcome.
OnPasteRequested func()
}
ChatInputHooks allows an external orchestrator to provide state and handle events
type ChatInputModel ¶ added in v1.14.9
type ChatInputModel struct {
// contains filtered or unexported fields
}
ChatInputModel is the Bubble Tea model for the chat input with autocomplete
func NewChatInputModel ¶ added in v1.14.9
func NewChatInputModel(commands []Suggestion, initialValue string, history []string, hooks ChatInputHooks) ChatInputModel
NewChatInputModel creates a new chat input model
func (ChatInputModel) Init ¶ added in v1.14.9
func (m ChatInputModel) Init() tea.Cmd
func (ChatInputModel) Update ¶ added in v1.14.9
User input, move cursor, type text, all trigger Update
func (ChatInputModel) UpdateSuggestions ¶ added in v1.14.10
UpdateSuggestions updates the suggestions based on the current input
func (ChatInputModel) View ¶ added in v1.14.9
func (m ChatInputModel) View() string
View renders the chat input Whether to show suggestions or not is determined by the model View renders the program's UI, which is just a string. The view is rendered after every Update.
type ChatInputResult ¶ added in v1.14.9
ChatInputResult holds the result of the chat input
func RunChatInput ¶ added in v1.14.9
func RunChatInput(commands []Suggestion, initialValue string, history []string, hooks ChatInputHooks) (ChatInputResult, error)
RunChatInput runs the chat input program
type Indicator ¶ added in v1.14.4
type Indicator struct {
// contains filtered or unexported fields
}
func GetIndicator ¶ added in v1.14.7
func GetIndicator() *Indicator
GetIndicator returns the singleton indicator instance
type PasteResultMsg ¶ added in v1.16.6
type PasteResultMsg struct {
PastedAttachments string // non-empty: show as attachment badge in pendingBanner
PastedText string // non-empty: insert into the textarea (text fallback)
}
PasteResultMsg is sent back by the orchestrator (e.g. repl.go) after processing a paste request initiated by the user pressing Ctrl+V. The UI uses this to update banners or insert text — it performs no I/O itself.
type QuestionType ¶ added in v1.14.25
type QuestionType string
QuestionType enumerates the supported interaction modes.
const ( QuestionTypeSelect QuestionType = "select" QuestionTypeMultiSelect QuestionType = "multiselect" QuestionTypeText QuestionType = "text" QuestionTypeConfirm QuestionType = "confirm" )
type SessionMode ¶ added in v1.14.28
type SessionMode int
type SessionModeMsg ¶ added in v1.14.28
type SessionModeMsg struct{ Mode SessionMode }
SessionModeMsg signals a session mode toggle to the UI.
type StatusMsg ¶ added in v1.15.4
type StatusMsg struct{ Text string }
StatusMsg carries a background status update for the right-side banner.
type Suggestion ¶ added in v1.14.9
Suggestion represents a suggestion item
type ViewportModel ¶
type ViewportModel struct {
// contains filtered or unexported fields
}
func NewViewportModel ¶
func NewViewportModel(provider string, content string, headerFunc func() string) ViewportModel
func (ViewportModel) Init ¶
func (m ViewportModel) Init() tea.Cmd
func (ViewportModel) View ¶
func (m ViewportModel) View() string