Documentation
¶
Overview ¶
Package tool provides the tool registry and core tool implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds tool instances and provides lookup.
func NewRegistry ¶
NewRegistry creates a Registry from pre-built tools.
func (*Registry) Tools ¶
Tools returns the registered tools in a deterministic, name-sorted order.
This ordering matters: the slice feeds straight into the LLM request payload (function declarations / tool schemas). Go's map iteration order is randomised per call, which would cause every request to send tools in a different order. That breaks the model's prompt KV cache for tool definitions, hurts output stability, and in practice causes thinking-capable Gemini models to flake hard (long TTFB and Error 500). Keep the order stable across calls.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bash provides tools for executing shell commands.
|
Package bash provides tools for executing shell commands. |
|
Package edit provides tools for reading, writing, and editing files.
|
Package edit provides tools for reading, writing, and editing files. |
|
Package glob provides tools for finding files and searching their content.
|
Package glob provides tools for finding files and searching their content. |
|
Package grep provides tools for finding files and searching their content.
|
Package grep provides tools for finding files and searching their content. |
|
helper
|
|
|
content
Package content provides utilities for analyzing and manipulating file content.
|
Package content provides utilities for analyzing and manipulating file content. |
|
follow
Package follow provides utilities for following real-time updates to a file.
|
Package follow provides utilities for following real-time updates to a file. |
|
pagination
Package pagination provides utilities for paginating slices.
|
Package pagination provides utilities for paginating slices. |
|
Package question provides a tool for asking the user interactive questions.
|
Package question provides a tool for asking the user interactive questions. |
|
Package read provides tools for reading, writing, and editing files.
|
Package read provides tools for reading, writing, and editing files. |
|
Package save provides a tool for the AI agent to save bash commands for later reuse.
|
Package save provides a tool for the AI agent to save bash commands for later reuse. |
|
service
|
|
|
checksum
Package checksum provides utilities for computing and managing file checksums.
|
Package checksum provides utilities for computing and managing file checksums. |
|
executor
Package executor provides functionality for running OS commands with streaming output.
|
Package executor provides functionality for running OS commands with streaming output. |
|
path
Package path provides path resolution and normalization utilities.
|
Package path provides path resolution and normalization utilities. |
|
Package write provides tools for reading, writing, and editing files.
|
Package write provides tools for reading, writing, and editing files. |