Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BuiltinSlashCommands = []AutocompleteItem{
{Value: "/help", Label: "/help", Desc: "Bantuan perintah & shortcuts"},
{Value: "/memory", Label: "/memory", Desc: "Lihat pengetahuan & gotchas repo"},
{Value: "/undo", Label: "/undo", Desc: "Rollback perubahan turn ini (Git Shadow)"},
{Value: "/sessions", Label: "/sessions", Desc: "Beralih / kelola riwayat sesi"},
{Value: "/models", Label: "/models", Desc: "Pilih model AI aktif"},
{Value: "/connect", Label: "/connect", Desc: "Konfigurasi provider & API keys"},
{Value: "/cost", Label: "/cost", Desc: "Statistik token & perkiraan biaya"},
{Value: "/lsp", Label: "/lsp", Desc: "Status Language Server Protocol"},
{Value: "/diagnose", Label: "/diagnose", Desc: "Jalankan diagnostik kode mandiri"},
{Value: "/lsp-install", Label: "/lsp-install", Desc: "Panduan instalasi LSP binary"},
{Value: "/miner", Label: "/miner", Desc: "Mode MINER: eksplorasi mendalam"},
{Value: "/clear", Label: "/clear", Desc: "Bersihkan layar riwayat"},
{Value: "/new", Label: "/new", Desc: "Mulai sesi percakapan baru"},
{Value: "/mcp", Label: "/mcp", Desc: "Daftar Model Context Protocol tools"},
{Value: "/mcp-reload", Label: "/mcp-reload", Desc: "Muat ulang konfigurasi MCP"},
{Value: "/debug-context", Label: "/debug-context", Desc: "Dump konteks aktif"},
}
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.