globtool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package globtool implements the Glob tool — finds files matching a glob pattern. Mirrors src/tools/GlobTool/GlobTool.ts.

M2 scope: standard doublestar glob via github.com/bmatcuk/doublestar/v4, 100-result cap, relative-path output, optional base directory. Permissions integration and plugin-cache exclusions land in M5.

Index

Constants

View Source
const MaxResults = 100

MaxResults caps the number of returned paths to keep tool_result blocks under context budgets. Matches the real tool's limit of 100.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Pattern string `json:"pattern"`
	Path    string `json:"path,omitempty"`
}

Input is the typed view of the JSON input.

type Tool

type Tool struct{}

Tool implements the Glob tool.

func New

func New() *Tool

New returns a fresh Glob tool.

func (*Tool) Description

func (*Tool) Description() string

Description is the prompt text the model sees.

func (*Tool) Execute

func (t *Tool) Execute(ctx context.Context, raw json.RawMessage) (tool.Result, error)

Execute finds files matching the pattern and returns their paths.

func (*Tool) InputSchema

func (*Tool) InputSchema() json.RawMessage

InputSchema is the JSON Schema sent to the model.

func (*Tool) IsConcurrencySafe

func (*Tool) IsConcurrencySafe(json.RawMessage) bool

IsConcurrencySafe: glob is safe to run concurrently.

func (*Tool) IsReadOnly

func (*Tool) IsReadOnly(json.RawMessage) bool

IsReadOnly: glob only reads the filesystem.

func (*Tool) Name

func (*Tool) Name() string

Name implements tool.Tool.

Jump to

Keyboard shortcuts

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