Documentation
¶
Index ¶
- func DelegateDefinition() toolspec.Definition
- func IsBinary(data string) bool
- func TruncateHead(output string) truncationResult
- func TruncateTail(output string) truncationResult
- type BashTool
- type DelegateConfig
- type DelegateTool
- type EditTool
- type ReadTool
- type Registry
- type Tool
- type WebFetchTool
- type WriteTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DelegateDefinition ¶ added in v0.8.0
func DelegateDefinition() toolspec.Definition
DelegateDefinition returns the tool definition without requiring a live config.
func IsBinary ¶ added in v0.7.0
IsBinary reports whether data appears to be binary (non-text) content. It samples up to the first 8KB and checks for a high ratio of non-UTF-8 bytes or null bytes, which are reliable indicators of binary data.
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 DelegateConfig ¶ added in v0.6.2
type DelegateConfig struct {
Engine *engine.Engine
Registry *Registry
Model ai.Model
APIKey string
System string
PluginHooks engine.PluginHookRunner // optional plugin lifecycle hooks
}
DelegateConfig holds the dependencies needed to spawn subagent loops.
type DelegateTool ¶ added in v0.6.2
type DelegateTool struct {
// contains filtered or unexported fields
}
DelegateTool spawns child agent loops for bounded subtasks.
func NewDelegateTool ¶ added in v0.6.2
func NewDelegateTool(cfg DelegateConfig) *DelegateTool
NewDelegateTool creates a delegate tool with the given configuration.
func (*DelegateTool) Definition ¶ added in v0.6.2
func (t *DelegateTool) 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) BuiltinNames ¶ added in v0.7.0
BuiltinNames returns the names of all currently registered 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