Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BuiltinSlashCommands = []AutocompleteItem{
{Value: "/help", Label: "/help", Desc: "Help commands & keyboard shortcuts"},
{Value: "/memory", Label: "/memory", Desc: "View learned project knowledge & gotchas"},
{Value: "/undo", Label: "/undo", Desc: "Roll back current turn changes (Git Shadow)"},
{Value: "/sessions", Label: "/sessions", Desc: "Switch / manage session history"},
{Value: "/models", Label: "/models", Desc: "Select active AI model"},
{Value: "/connect", Label: "/connect", Desc: "Configure providers & API keys"},
{Value: "/cost", Label: "/cost", Desc: "Token statistics & estimated spend"},
{Value: "/lsp", Label: "/lsp", Desc: "Language Server Protocol status"},
{Value: "/diagnose", Label: "/diagnose", Desc: "Run autonomous codebase diagnostics"},
{Value: "/lsp-install", Label: "/lsp-install", Desc: "LSP binary installation guide"},
{Value: "/miner", Label: "/miner", Desc: "MINER mode: deep codebase exploration"},
{Value: "/workspace", Label: "/workspace", Desc: "Manage multi-repo workspace & repos"},
{Value: "/clear", Label: "/clear", Desc: "Clear chat history screen"},
{Value: "/new", Label: "/new", Desc: "Start a new conversation session"},
{Value: "/mcp", Label: "/mcp", Desc: "List Model Context Protocol tools"},
{Value: "/mcp-reload", Label: "/mcp-reload", Desc: "Reload MCP configuration"},
{Value: "/debug-context", Label: "/debug-context", Desc: "Dump active context tokens"},
}
BuiltinSlashCommands lists all known BroCode slash commands with descriptions.
Functions ¶
func ApplyAutocomplete ¶
func ApplyAutocomplete(input string, state AutocompleteState) string
ApplyAutocomplete updates input text by replacing the active query with the selected item.
func FormatMessageForTerminal ¶
FormatMessageForTerminal renders a formatted message string for stdout stream printing.
func RenderAutocomplete ¶
func RenderAutocomplete(state AutocompleteState, width int) string
RenderAutocomplete renders a compact floating suggestion box with sliding window scrolling.
Types ¶
type AutocompleteItem ¶
type AutocompleteItem struct {
Value string // text to insert (e.g. "/memory" or "internal/ui/app.go")
Label string // display name
Desc string // short explanation
}
AutocompleteItem represents a single selectable completion candidate.
type AutocompleteKind ¶
type AutocompleteKind int
AutocompleteKind distinguishes between slash commands and file mentions.
const ( AutoKindNone AutocompleteKind = iota AutoKindSlash AutoKindFile )
type AutocompleteState ¶
type AutocompleteState struct {
Active bool
Kind AutocompleteKind
Items []AutocompleteItem
Selected int
Query string
}
AutocompleteState manages the active suggestion popup.
func DetectAutocomplete ¶
func DetectAutocomplete(input string, allFiles []string, prev AutocompleteState) AutocompleteState
DetectAutocomplete inspects the current prompt input text and cursor position to determine if slash command or file mention completion should activate. It preserves previous selection index if the query has not changed.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model defines the Bubble Tea v2 TUI state.
func NewApp ¶
func NewApp( cfg provider.AppConfig, p provider.DetectedProvider, modelName string, adapter provider.ProviderAdapter, tools *tool.Registry, ctxMgr *bcontext.Manager, mcpMgr *mcp.Manager, lspMgr *lsp.Manager, scoutMgr *subagent.ScoutManager, budgetUSD float64, previousPrompts []string, activityLog io.Writer, initialMsgs ...string, ) Model
NewApp initializes the Bubble Tea v2 TUI model.