Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TruncateHead ¶
func TruncateHead(output string) truncationResult
TruncateHead keeps the first N lines / bytes (whichever limit is hit first). Suitable for file reads and search results where the beginning matters most.
func TruncateTail ¶
func TruncateTail(output string) truncationResult
TruncateTail keeps the last N lines / bytes (whichever limit is hit first). Suitable for command output and logs where the end matters most.
Types ¶
type BashTool ¶
type BashTool struct {
// contains filtered or unexported fields
}
BashTool executes bash commands.
func (*BashTool) Definition ¶
func (t *BashTool) Definition() toolspec.Definition
type EditTool ¶
type EditTool struct{}
EditTool makes surgical edits to files by exact string replacement.
func (*EditTool) Definition ¶
func (t *EditTool) Definition() toolspec.Definition
type ReadTool ¶
type ReadTool struct{}
ReadTool reads file contents.
func (*ReadTool) Definition ¶
func (t *ReadTool) Definition() toolspec.Definition
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds named tools and provides lookup + definitions.
func NewRegistry ¶
NewRegistry creates a registry with the default built-in tools.
func (*Registry) Definitions ¶
func (r *Registry) Definitions() []toolspec.Definition
Definitions returns all tool definitions for passing to the LLM.
type Tool ¶
type Tool interface {
Definition() toolspec.Definition
Execute(ctx context.Context, args map[string]any) (string, error)
}
Tool is a built-in tool that can be executed by the Go runner.
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool fetches a URL, extracts readable content, and returns it in the requested format.
func NewWebFetchTool ¶
func NewWebFetchTool() *WebFetchTool
func (*WebFetchTool) Definition ¶
func (t *WebFetchTool) Definition() toolspec.Definition
type WriteTool ¶
type WriteTool struct{}
WriteTool creates new files or completely overwrites existing ones.
func (*WriteTool) Definition ¶
func (t *WriteTool) Definition() toolspec.Definition