glob

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxResults is the maximum number of files to return
	MaxResults = 100

	// MaxResultSizeBytes is the maximum total size in bytes for all results
	MaxResultSizeBytes = 1024 * 1024 // 1MB
)
View Source
const (
	// ToolName is the name of the glob tool
	ToolName = "glob"

	// SearchHint is a hint for tool search functionality.
	SearchHint = "find files using glob patterns"

	// ToolDescription is the human-readable description of what the glob tool does
	ToolDescription = `` /* 1472-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

Tool implements the glob tool for finding files by pattern

func NewGlobTool

func NewGlobTool(workingDir string) *Tool

NewGlobTool creates a new glob tool

func (*Tool) BackfillInput

func (g *Tool) BackfillInput(ctx context.Context, input map[string]any) map[string]any

BackfillInput enriches a shallow clone of the parsed input with derived fields.

func (*Tool) Call

func (g *Tool) Call(
	ctx context.Context,
	input tool.CallInput,
	permissionCheck types.CanUseToolFn,
) (tool.CallResult, error)

Call executes the tool

func (*Tool) CheckPermissions

func (g *Tool) CheckPermissions(ctx context.Context, input map[string]any, toolCtx tool.ToolUseContext) types.PermissionResult

CheckPermissions performs glob-specific permission checks before the global pipeline.

func (*Tool) Definition

func (g *Tool) Definition() tool.Definition

Definition returns the tool definition

func (*Tool) Description

func (g *Tool) Description(ctx context.Context) (string, error)

Description returns the tool description

func (*Tool) FormatResult

func (g *Tool) FormatResult(data any) string

FormatResult serialises the tool output into the tool_result content string.

func (*Tool) GetWorkingDir

func (g *Tool) GetWorkingDir() string

GetWorkingDir returns the current working directory

func (*Tool) IsConcurrencySafe

func (g *Tool) IsConcurrencySafe(input map[string]any) bool

IsConcurrencySafe reports that glob searches can run concurrently.

func (*Tool) IsEnabled

func (g *Tool) IsEnabled() bool

IsEnabled returns whether this tool is currently active.

func (*Tool) IsReadOnly

func (g *Tool) IsReadOnly(input map[string]any) bool

IsReadOnly reports that glob does not modify state.

func (*Tool) SetWorkingDir

func (g *Tool) SetWorkingDir(dir string)

SetWorkingDir sets the working directory for the tool

func (*Tool) ValidateInput

func (g *Tool) ValidateInput(ctx context.Context, input map[string]any) (map[string]any, error)

ValidateInput validates and normalizes glob input.

Jump to

Keyboard shortcuts

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