Documentation
¶
Overview ¶
Package read provides file reading operations with line enumeration and range support.
Index ¶
- type Inputs
- type Tool
- func (t *Tool) Execute(ctx context.Context, args map[string]any) (string, error)
- func (t *Tool) Name() string
- func (t *Tool) Paths(ctx context.Context, args map[string]any) (read, write []string, err error)
- func (t *Tool) Post(ctx context.Context, args map[string]any)
- func (t *Tool) Schema() tool.Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inputs ¶
type Inputs struct {
// Path is the file path to read.
Path string `json:"path" jsonschema:"required,description=Path to the file to read" validate:"required"`
// LineStart is the starting line number (1-based index).
LineStart int `json:"line_start,omitempty" jsonschema:"description=Starting line number (1-based index)" validate:"omitempty,min=1"`
// LineEnd is the ending line number (inclusive).
LineEnd int `` /* 127-byte string literal not displayed */
// Count indicates whether to return only the total line count.
Count bool `json:"count,omitempty" jsonschema:"description=If true, returns the total number of lines in the file" validate:"omitempty"`
}
Inputs defines the parameters for the Read tool.
type Tool ¶
type Tool struct {
tool.Base
// SmallFileTokens is the token threshold below which line ranges are ignored and the full file is returned.
// Zero uses the default (2000).
SmallFileTokens int
// contains filtered or unexported fields
}
Tool implements file reading with enumerated lines.
func New ¶
New creates a new Read tool with the specified small file token threshold. lspManager is optional (nil disables LSP didOpen notifications). estimate is the token estimation function.
Click to show internal directories.
Click to hide internal directories.