Documentation
¶
Index ¶
- type BlockMsg
- type FadeTickMsg
- type GraceExpiredMsg
- type Model
- func (m *Model) AddToolCall(msg *types.Message) tea.Cmd
- func (m *Model) AdvanceFade(toolCallID string) tea.Cmd
- func (m *Model) AgentName() string
- func (m *Model) AppendReasoning(content string)
- func (m *Model) GetSize() (int, int)
- func (m *Model) GetToolFadeLevel(toolCallID string) int
- 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) Reasoning() string
- func (m *Model) SetExpanded(expanded bool)
- func (m *Model) SetReasoning(content string)
- func (m *Model) SetSize(width, height int) tea.Cmd
- 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
- type ToggleMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockMsg ¶ added in v1.19.5
type BlockMsg interface {
GetBlockID() string
}
BlockMsg is implemented by messages that target a specific reasoning block.
type FadeTickMsg ¶ added in v1.19.5
type FadeTickMsg struct {
ToolCallID string
// contains filtered or unexported fields
}
FadeTickMsg is sent to advance a tool's fade animation by one step.
func (FadeTickMsg) GetBlockID ¶ added in v1.19.5
func (m FadeTickMsg) GetBlockID() string
type GraceExpiredMsg ¶ added in v1.19.5
type GraceExpiredMsg struct {
// contains filtered or unexported fields
}
GraceExpiredMsg is sent when a tool's grace period has expired and it should be hidden.
func (GraceExpiredMsg) GetBlockID ¶ added in v1.19.5
func (m GraceExpiredMsg) GetBlockID() string
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.SessionState) *Model
New creates a new reasoning block.
func (*Model) AddToolCall ¶
AddToolCall adds a tool call to the block.
func (*Model) AdvanceFade ¶ added in v1.19.5
AdvanceFade increments a tool's fade level and returns a command for the next step. Returns nil if the tool is not found or already fully faded.
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) GetToolFadeLevel ¶ added in v1.19.5
GetToolFadeLevel returns the fade level for a tool (0 = not fading, 1-8 = 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 0).
func (*Model) IsToggleLine ¶
IsToggleLine returns true if clicking this line should toggle the block. Only the header is toggleable.
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) 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.
type ToggleMsg ¶
type ToggleMsg struct {
// contains filtered or unexported fields
}
ToggleMsg is sent when the block should toggle expanded/collapsed state.
func (ToggleMsg) GetBlockID ¶ added in v1.19.5
func (m ToggleMsg) GetBlockID() string