Documentation
¶
Overview ¶
Package renderers provides CLI output rendering functionality for tool results. It includes a registry system for managing tool renderers and supports pattern-based matching for custom and MCP tools.
Index ¶
- type ApplyPatchRenderer
- type BashRenderer
- type CLIRenderer
- type CodeExecutionRenderer
- type CustomToolRenderer
- type FileEditRenderer
- type FileReadRenderer
- type FileWriteRenderer
- type GlobRenderer
- type GrepRenderer
- type ImageRecognitionRenderer
- type MCPToolRenderer
- type RendererRegistry
- type SkillRenderer
- type SubAgentRenderer
- type TodoRenderer
- type WebFetchRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyPatchRenderer ¶
type ApplyPatchRenderer struct{}
ApplyPatchRenderer renders apply_patch results.
func (*ApplyPatchRenderer) RenderCLI ¶
func (r *ApplyPatchRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders apply_patch results with a summary and unified diffs.
type BashRenderer ¶
type BashRenderer struct{}
BashRenderer renders bash command results
func (*BashRenderer) RenderCLI ¶
func (r *BashRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders bash command execution results in CLI format, including command details, exit code, execution time, and output.
type CLIRenderer ¶
type CLIRenderer interface {
RenderCLI(result tools.StructuredToolResult) string
}
CLIRenderer interface for rendering structured tool results to CLI output
type CodeExecutionRenderer ¶
type CodeExecutionRenderer struct{}
CodeExecutionRenderer renders code execution results
func (*CodeExecutionRenderer) RenderCLI ¶
func (r *CodeExecutionRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders code execution results in CLI format, showing the runtime, code executed, and the output produced.
type CustomToolRenderer ¶
type CustomToolRenderer struct{}
CustomToolRenderer renders custom tool results
func (*CustomToolRenderer) RenderCLI ¶
func (r *CustomToolRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders custom tool execution results in CLI format, including the tool name, execution time, and output.
type FileEditRenderer ¶
type FileEditRenderer struct{}
FileEditRenderer renders file edit results
func (*FileEditRenderer) RenderCLI ¶
func (r *FileEditRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders file edit results in CLI format with unified diff output, showing the file path, number of replacements, and the changes made to the file.
type FileReadRenderer ¶
type FileReadRenderer struct{}
FileReadRenderer renders file read results
func (*FileReadRenderer) RenderCLI ¶
func (r *FileReadRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders file read results in CLI format with line numbers, showing the file path, offset, content, and truncation status if applicable.
type FileWriteRenderer ¶
type FileWriteRenderer struct{}
FileWriteRenderer renders file write results
func (*FileWriteRenderer) RenderCLI ¶
func (r *FileWriteRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders file write results in CLI format, showing the file path and size.
type GlobRenderer ¶
type GlobRenderer struct{}
GlobRenderer renders glob file pattern results
func (*GlobRenderer) RenderCLI ¶
func (r *GlobRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders glob pattern search results in CLI format, showing the pattern, path, matched files with sizes, type indicators, and truncation status.
type GrepRenderer ¶
type GrepRenderer struct{}
GrepRenderer renders grep search results
func (*GrepRenderer) RenderCLI ¶
func (r *GrepRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders grep search results in CLI format, showing the search pattern, path, include filter, matched files with line numbers, and truncation status.
type ImageRecognitionRenderer ¶
type ImageRecognitionRenderer struct{}
ImageRecognitionRenderer renders image recognition results
func (*ImageRecognitionRenderer) RenderCLI ¶
func (r *ImageRecognitionRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders image recognition results in CLI format, showing the image path, type, prompt, and analysis results.
type MCPToolRenderer ¶
type MCPToolRenderer struct{}
MCPToolRenderer renders MCP tool results
func (*MCPToolRenderer) RenderCLI ¶
func (r *MCPToolRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders MCP tool execution results in CLI format, including the tool name, server name, parameters, structured content, and execution time.
type RendererRegistry ¶
type RendererRegistry struct {
// contains filtered or unexported fields
}
RendererRegistry manages tool renderers with pattern matching support
func NewRendererRegistry ¶
func NewRendererRegistry() *RendererRegistry
NewRendererRegistry creates and initializes a new renderer registry
func (*RendererRegistry) Register ¶
func (r *RendererRegistry) Register(toolName string, renderer CLIRenderer)
Register adds a renderer for a specific tool name
func (*RendererRegistry) RegisterPattern ¶
func (r *RendererRegistry) RegisterPattern(pattern string, renderer CLIRenderer)
RegisterPattern adds a renderer for a pattern (e.g., "mcp_*")
func (*RendererRegistry) Render ¶
func (r *RendererRegistry) Render(result tools.StructuredToolResult) string
Render finds the appropriate renderer and renders the result
type SkillRenderer ¶
type SkillRenderer struct{}
SkillRenderer renders skill tool results
func (*SkillRenderer) RenderCLI ¶
func (r *SkillRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders skill results in CLI format
type SubAgentRenderer ¶
type SubAgentRenderer struct{}
SubAgentRenderer renders subagent results
func (*SubAgentRenderer) RenderCLI ¶
func (r *SubAgentRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders subagent execution results in CLI format, showing the question (if available) and the response.
type TodoRenderer ¶
type TodoRenderer struct{}
TodoRenderer renders todo list results
func (*TodoRenderer) RenderCLI ¶
func (r *TodoRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders todo list results in CLI format, showing statistics and todo items with status icons, priorities, IDs, and content.
type WebFetchRenderer ¶
type WebFetchRenderer struct{}
WebFetchRenderer renders web fetch results
func (*WebFetchRenderer) RenderCLI ¶
func (r *WebFetchRenderer) RenderCLI(result tools.StructuredToolResult) string
RenderCLI renders web fetch results in CLI format, showing the URL, saved path (if applicable), prompt (if used), and the fetched content.