infrastructure

package
v0.178.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseFormatter

type BaseFormatter struct {
	// contains filtered or unexported fields
}

BaseFormatter provides common formatting functionality that tools can embed

func NewBaseFormatter

func NewBaseFormatter(toolName string) BaseFormatter

NewBaseFormatter creates a new base formatter for a tool

func (BaseFormatter) FormatAsJSON

func (f BaseFormatter) FormatAsJSON(data any) string

FormatAsJSON formats data as JSON if possible, falls back to string representation

func (BaseFormatter) FormatDuration

func (f BaseFormatter) FormatDuration(result *agentdomain.ToolExecutionResult) string

FormatDuration formats a duration for display in a human-friendly way

func (BaseFormatter) FormatExpanded

func (f BaseFormatter) FormatExpanded(result *agentdomain.ToolExecutionResult, dataContent string) string

FormatExpanded renders the full expanded result as a single native lipgloss/tree, replacing the hand-drawn ├─/└─ connectors that used to live across three methods. dataContent is the tool-specific result body (may be ""). Output is plain: the UI wraps and themes it (services.themeTreeLines); LLM / headless consume it as-is.

func (BaseFormatter) FormatStatusIcon

func (f BaseFormatter) FormatStatusIcon(success bool) string

FormatStatusIcon returns just the status icon

func (BaseFormatter) FormatToolCall

func (f BaseFormatter) FormatToolCall(args map[string]any, expanded bool) string

FormatToolCall formats a tool call for consistent display

func (BaseFormatter) GetDomainFromURL

func (f BaseFormatter) GetDomainFromURL(url string) string

GetDomainFromURL extracts domain from URL

func (BaseFormatter) GetFileName

func (f BaseFormatter) GetFileName(path string) string

GetFileName extracts filename from a path

func (BaseFormatter) ShouldCollapseArg

func (f BaseFormatter) ShouldCollapseArg(key string) bool

ShouldCollapseArg provides default collapse behavior (can be overridden by tools)

func (BaseFormatter) TruncateText

func (f BaseFormatter) TruncateText(text string, maxLength int) string

TruncateText truncates text to specified length with ellipsis

type CustomFormatter

type CustomFormatter struct {
	BaseFormatter
	// contains filtered or unexported fields
}

CustomFormatter extends BaseFormatter with customizable collapse behavior

func NewCustomFormatter

func NewCustomFormatter(toolName string, collapseFunc func(string) bool) CustomFormatter

NewCustomFormatter creates a formatter with custom collapse logic

func (CustomFormatter) FormatExpanded

func (f CustomFormatter) FormatExpanded(result *agentdomain.ToolExecutionResult, dataContent string) string

FormatExpanded renders the expanded tree using the custom collapse behavior.

func (CustomFormatter) FormatToolCall

func (f CustomFormatter) FormatToolCall(args map[string]any, expanded bool) string

FormatToolCall overrides BaseFormatter to use custom collapse logic

func (CustomFormatter) ShouldCollapseArg

func (f CustomFormatter) ShouldCollapseArg(key string) bool

ShouldCollapseArg uses the custom collapse function if provided

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL