Documentation
¶
Index ¶
- Variables
- func ApplyAutocomplete(input string, state AutocompleteState) string
- func FormatMessageForTerminal(msg string, width int) string
- func RenderAutocomplete(state AutocompleteState, width int) string
- func RenderRecommendationsBar(recs []QuickRecommendation, width int) string
- func WelcomeBanner() string
- type AutocompleteItem
- type AutocompleteKind
- type AutocompleteState
- type Model
- type QueuedPrompt
- type QuickRecommendation
Constants ¶
This section is empty.
Variables ¶
var BuiltinSlashCommands = []AutocompleteItem{
{Value: "/ask", Label: "/ask", Desc: "Isolated QA: Ask codebase questions without context pollution"},
{Value: "/spec", Label: "/spec", Desc: "Spec-First Gate: Draft an architectural blueprint contract"},
{Value: "/tournament", Label: "/tournament", Desc: "Multi-Candidate: Run 2 parallel candidate agents to solve tasks"},
{Value: "/help", Label: "/help", Desc: "Help commands & keyboard shortcuts"},
{Value: "/plan", Label: "/plan", Desc: "View or archive active plan (/plan, /plan archive)"},
{Value: "/undo", Label: "/undo", Desc: "Time-Travel Rollback: Revert file changes from last turn"},
{Value: "/report", Label: "/report", Desc: "View or export privacy-safe benchmark/activity report"},
{Value: "/memory", Label: "/memory", Desc: "View learned project knowledge & gotchas"},
{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 (USD & IDR)"},
{Value: "/lsp", Label: "/lsp", Desc: "Language Server Protocol status"},
{Value: "/diagnose", Label: "/diagnose", Desc: "Run autonomous codebase diagnostics (/diagnose, /diagnose fix)"},
{Value: "/lsp-install", Label: "/lsp-install", Desc: "LSP binary installation guide"},
{Value: "/builder", Label: "/builder", Desc: "BUILDER mode: autonomous coding & file editing"},
{Value: "/planner", Label: "/planner", Desc: "PLANNER mode: read-only architecture analysis"},
{Value: "/miner", Label: "/miner", Desc: "MINER mode: deep codebase exploration & memory persistence"},
{Value: "/mode", Label: "/mode", Desc: "Switch engine mode (/mode builder|planner|miner)"},
{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.
func RenderRecommendationsBar ¶ added in v0.1.32
func RenderRecommendationsBar(recs []QuickRecommendation, width int) string
RenderRecommendationsBar formats the quick recommendations into an interactive TUI card.
func WelcomeBanner ¶ added in v0.1.2
func WelcomeBanner() string
WelcomeBanner renders the fresh-session hero banner with blue-gradient logo.
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.
func (*Model) SetProgram ¶
type QueuedPrompt ¶ added in v0.1.24
QueuedPrompt holds a user prompt waiting to run, along with the engine mode (BUILDER/PLANNER/MINER) under which it should be executed when drained.
type QuickRecommendation ¶ added in v0.1.32
type QuickRecommendation struct {
Index int `json:"index"` // 1, 2, 3...
Title string `json:"title"` // e.g. "Lanjutkan test auth"
Prompt string `json:"prompt"` // e.g. "Lanjutkan test auth dengan beberapa validator"
Clicked bool `json:"clicked"`
}
QuickRecommendation represents an actionable follow-up suggestion proposed by the AI.
func ExtractRecommendations ¶ added in v0.1.32
func ExtractRecommendations(content string) []QuickRecommendation
ExtractRecommendations parses senior recommendations from the end of an assistant's response.