edit

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: 12 Imported by: 0

Documentation

Overview

Package edit provides tools for reading, writing, and editing files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	FilePath    string `json:"file_path"`
	Description string `json:"description"`
	OldString   string `json:"old_string"`
	NewString   string `json:"new_string"`
	ReplaceAll  bool   `json:"replace_all"`
}

Request is the input for Tool.

type Tool

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

Tool handles file editing operations.

func NewTool

func NewTool(
	fileOps fileEditor,
	checksumManager checksumManager,
	pathResolver pathResolver,
	maxFileSize int64,
) *Tool

NewTool creates a new Tool with injected dependencies.

func (*Tool) Info

func (t *Tool) Info(_ context.Context) (*schema.ToolInfo, error)

func (*Tool) InvokableRun

func (t *Tool) InvokableRun(ctx context.Context, argumentsInJSON string, _ ...einotool.Option) (string, error)

func (*Tool) IsConcurrentSafe

func (t *Tool) IsConcurrentSafe() bool

IsConcurrentSafe indicates if the edit file tool can be run concurrently.

func (*Tool) PreflightValidate

func (t *Tool) PreflightValidate(input *compose.ToolInput) error

func (*Tool) Preview

func (t *Tool) Preview(input *compose.ToolInput) domain.ToolDisplay

Jump to

Keyboard shortcuts

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