Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NimbusCloudSpinner = spinner.Spinner{ Frames: []string{"☁ ✦", "☁ ✧", "☁ ˖", "☁ ⁺", "☁ ⋆", "☁ ⁺", "☁ ˖", "☁ ✧", "☁ ✦", "☁ ✧"}, FPS: time.Second / 10, }
NimbusCloudSpinner provides an animated cloud icon with shimmering particles.
var WordBank = []string{
"Pondering", "Noodling", "Percolating", "Marinating", "Ruminating", "Brewing",
"Cogitating", "Simmering", "Brainstorming", "Contemplating", "Meditating", "Mulling",
"Deliberating", "Daydreaming", "Envisioning", "Incubating", "Conjuring", "Weaving",
"Cooking", "Fermenting", "Stewing", "Musing", "Formulating", "Scheming", "Ideating",
"Compiling", "Refactoring", "Untangling", "Scaffolding", "Synthesizing", "Architecting",
"Parsing", "Optimizing", "Indexing", "Wiring", "Inspecting", "Analyzing", "Structuring",
"Composing", "Crafting", "Benchmarking", "Validating", "Assembling", "Decoupling",
"Vectorizing", "Generating", "Calibrating", "Tracing", "Transforming", "Polishing",
"Resolving", "Orchestrating", "Refining", "Linting", "Provisioning", "Connecting", "Formatting",
}
WordBank contains ~50 present-participle verbs mixing coding-flavored actions with whimsical generic thinking states.
Functions ¶
func EstimateDeltaTokens ¶
EstimateDeltaTokens approximates token count for a stream delta string.
func NextRandomVerb ¶
NextRandomVerb returns a random verb from WordBank that does not match lastVerb.
func RenderColorizedDiff ¶
RenderColorizedDiff formats unified diff strings with addition/deletion styling. Long diffs are capped so a big generated file doesn't swamp the transcript.
func RenderMarkdown ¶
RenderMarkdown parses basic markdown constructs and converts them into Lipgloss styled strings.
func RenderThinkingStatus ¶
RenderThinkingStatus formats the animated activity line shown above the input while the agent works, e.g. "☁ ✦ Exploring the codebase… (12s · 340 tokens · esc to interrupt)". The agent's current phase is used when known; otherwise a random verb.
Types ¶
type ChatItem ¶
type ChatItem struct {
Role string // "user" | "assistant" | "tool" | "phase" | "error" | "system"
Content string
Timestamp time.Time
Plan *ai.PlanSummary
Diffs []string
ToolName string
ToolArgs map[string]any
IsError bool
Detail string // short tool-result summary, e.g. "120 lines"
Diff string // inline diff shown under create/edit tool lines
Elapsed time.Duration // for phase lines
}
ChatItem represents a structured entry in the transcript.
type Model ¶
type Model struct {
Agent *ai.Agent
Mode Mode
Viewport viewport.Model
TextInput textinput.Model
StepInput textinput.Model
CustomInput textinput.Model
Spinner spinner.Model
SelectedStep int
IsEditingStep bool
StreamBuffer *strings.Builder
Messages []ChatItem
CurrentDiffs []string
History []string
HistoryIndex int
Width int
Height int
StatusText string
ErrorMessage string
OneShot bool
Ready bool
OriginalPrompt string
ClarificationPlan *ai.PlanSummary
CurrentQuestionIdx int
SelectedOptionIdx int
ClarificationAnswers map[string]string
IsCustomInput bool
ExecChan chan tea.Msg
// Phase is the agent's current activity ("Exploring the codebase…").
Phase string
PhaseStart time.Time
ToolCalls int
// FinalSummary is the last completed run's summary (printed after a
// one-shot run exits the alt screen).
FinalSummary string
// Claude-Code-style thinking indicator state
IsThinking bool
ThinkingStartTime time.Time
ThinkingVerb string
LastThinkingVerb string
ThinkingTokens int
LastVerbChange time.Time
// contains filtered or unexported fields
}