tools

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BashFormatter

type BashFormatter interface {
	ToolFormatter
	FormatInputWithCWD(data map[string]interface{}, cwd string) (template.HTML, error)
}

BashFormatter extends ToolFormatter with CWD context.

type FormatterRegistry

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

FormatterRegistry manages tool-specific formatters.

func NewFormatterRegistry

func NewFormatterRegistry() *FormatterRegistry

NewFormatterRegistry creates a new formatter registry

func (*FormatterRegistry) Format

func (r *FormatterRegistry) Format(toolName string, data map[string]interface{}) (template.HTML, error)

Format formats tool input using the appropriate formatter

func (*FormatterRegistry) FormatWithCWD

func (r *FormatterRegistry) FormatWithCWD(toolName string, data map[string]interface{}, cwd string) (template.HTML, error)

FormatWithCWD formats tool input with current working directory (for Bash tool)

func (*FormatterRegistry) GetCompactView

func (r *FormatterRegistry) GetCompactView(toolName string, data map[string]interface{}) template.HTML

GetCompactView gets the compact view for a tool

func (*FormatterRegistry) GetDescription

func (r *FormatterRegistry) GetDescription(toolName string, data map[string]interface{}) string

GetDescription gets the tool description using the appropriate formatter

func (*FormatterRegistry) Register

func (r *FormatterRegistry) Register(formatter ToolFormatter)

Register adds a formatter to the registry

type ToolFormatter

type ToolFormatter interface {
	Name() string
	FormatInput(data map[string]interface{}) (template.HTML, error)
	FormatOutput(output interface{}) (template.HTML, error)
	ValidateInput(data map[string]interface{}) error
	GetDescription(data map[string]interface{}) string
	GetCompactView(data map[string]interface{}) template.HTML
}

ToolFormatter formats tool inputs and outputs for display.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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