Documentation
¶
Index ¶
- type Model
- func (m *Model) AddToolCall(msg *types.Message) tea.Cmd
- func (m *Model) AgentName() string
- func (m *Model) AppendReasoning(content string)
- func (m *Model) AppendToolOutput(toolCallID, output string) bool
- func (m *Model) GetSize() (int, int)
- func (m *Model) GetToolFadeProgress(toolCallID string) float64
- func (m *Model) HasToolCall(toolCallID string) bool
- func (m *Model) Height() int
- func (m *Model) ID() string
- func (m *Model) Init() tea.Cmd
- func (m *Model) IsExpanded() bool
- func (m *Model) IsHeaderLine(lineIdx int) bool
- func (m *Model) IsToggleLine(lineIdx int) bool
- func (m *Model) NeedsTick() bool
- func (m *Model) Reasoning() string
- func (m *Model) SetExpanded(expanded bool)
- func (m *Model) SetReasoning(content string)
- func (m *Model) SetSelected(selected bool)
- func (m *Model) SetShowAgentBadge(show bool)
- func (m *Model) SetSize(width, height int) tea.Cmd
- func (m *Model) StopAnimation()
- func (m *Model) Toggle()
- func (m *Model) ToolCount() int
- func (m *Model) Update(msg tea.Msg) (layout.Model, tea.Cmd)
- func (m *Model) UpdateToolCall(toolCallID string, status types.ToolStatus, args string)
- func (m *Model) UpdateToolResult(toolCallID, content string, status types.ToolStatus, ...) tea.Cmd
- func (m *Model) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model represents a collapsible reasoning + tool calls block.
func New ¶
func New(id, agentName string, sessionState service.SessionStateReader) *Model
New creates a new reasoning block.
func (*Model) AddToolCall ¶
AddToolCall adds a tool call to the block.
func (*Model) AppendReasoning ¶
AppendReasoning appends to the reasoning content. Creates a new reasoning item if the last item was a tool, otherwise appends to the last reasoning item.
func (*Model) AppendToolOutput ¶ added in v1.70.2
AppendToolOutput appends incremental output to a running tool call.
func (*Model) GetToolFadeProgress ¶
GetToolFadeProgress returns the fade progress for a tool (0.0 = not fading, 0.0-1.0 = fading).
func (*Model) HasToolCall ¶
HasToolCall returns true if the block contains the given tool call ID.
func (*Model) IsExpanded ¶
IsExpanded returns the current expanded state.
func (*Model) IsHeaderLine ¶
IsHeaderLine returns true if the given line index is the header line.
func (*Model) IsToggleLine ¶
IsToggleLine returns true if clicking this line should toggle the block. Only the header is toggleable.
func (*Model) NeedsTick ¶
NeedsTick returns true if this reasoning block requires animation tick updates. This is true when:
- Any tool is pending/running (needs spinner animation)
- Any tool is still fading (fadeProgress < 1.0)
The messages list uses this to decide whether to invalidate its render cache on ticks. Use fadeProgress (updated on ticks) to stay consistent with renderCollapsed/hasFadingTools.
func (*Model) Reasoning ¶
Reasoning returns the full reasoning content (concatenated from all reasoning items).
func (*Model) SetExpanded ¶
SetExpanded sets the expanded state directly.
func (*Model) SetReasoning ¶
SetReasoning sets reasoning content (replaces all content items with a single reasoning item).
func (*Model) SetSelected ¶
SetSelected sets the selected state for visual highlighting.
func (*Model) SetShowAgentBadge ¶ added in v1.104.0
SetShowAgentBadge controls whether the block renders the agent badge above the Thinking header. The messages list enables it when the block does not visually continue content from the same agent (e.g. reasoning that starts a sub-agent's turn right after a transfer_task), mirroring the sender prefix on standard assistant messages.
func (*Model) StopAnimation ¶
func (m *Model) StopAnimation()
StopAnimation stops all animation subscriptions for this reasoning block. This must be called when the block is removed from the UI to avoid leaked animation subscriptions.
func (*Model) Toggle ¶
func (m *Model) Toggle()
Toggle switches between expanded and collapsed state.
func (*Model) UpdateToolCall ¶
func (m *Model) UpdateToolCall(toolCallID string, status types.ToolStatus, args string)
UpdateToolCall updates an existing tool call in the block.
func (*Model) UpdateToolResult ¶
func (m *Model) UpdateToolResult(toolCallID, content string, status types.ToolStatus, result *tools.ToolCallResult) tea.Cmd
UpdateToolResult updates tool result for a tool call.