tool

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 3 Imported by: 0

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

func NewRegistry(tools []einotool.BaseTool) *Registry

NewRegistry creates a Registry from pre-built tools.

func (*Registry) Get

func (r *Registry) Get(name string) (einotool.BaseTool, bool)

Get returns a tool by name.

func (*Registry) Tools

func (r *Registry) Tools() []einotool.BaseTool

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.

Jump to

Keyboard shortcuts

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