Documentation
¶
Index ¶
- func CheckPathExists(path string) (exists bool, isDir bool, err error)
- func EnsureParentDirs(path string) error
- func FormatFileSize(size int64) string
- func SanitizePath(path string) string
- func ValidateAbsolutePath(path string) error
- func WalkDirectoryTree(rootPath string) (string, error)
- type ConflictWarning
- type CreateFileInput
- type CreateFileResult
- type DiffPair
- type DiffValidationError
- type DirectoryEntry
- type EditFileInput
- type EditFileResult
- type FindFileInput
- type FindFileResult
- type GrepInput
- type GrepMatch
- type GrepResult
- type ListFilesInput
- type ListFilesResult
- type PatchInfo
- type ReadFileInput
- type ReadFileResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPathExists ¶
CheckPathExists checks if a path exists and returns info about it
func EnsureParentDirs ¶
EnsureParentDirs creates parent directories if they don't exist
func FormatFileSize ¶
FormatFileSize formats a file size in bytes to a human-readable string
func SanitizePath ¶
SanitizePath cleans and normalizes a file path
func ValidateAbsolutePath ¶
ValidateAbsolutePath checks if the given path is absolute
func WalkDirectoryTree ¶
WalkDirectoryTree walks a directory tree and returns a string representation
Types ¶
type ConflictWarning ¶
type CreateFileInput ¶
type CreateFileResult ¶
type CreateFileResult struct {
Overwritten bool `json:"overwritten"`
}
func CreateFile ¶
func CreateFile(fsys afero.Fs, input *CreateFileInput) (*CreateFileResult, error)
type DiffValidationError ¶
type DiffValidationError struct {
DiffIndex int `json:"diff_index"`
ErrorType string `json:"error_type"`
ErrorMessage string `json:"error_message"`
SuggestedFix string `json:"suggested_fix,omitempty"`
}
func (*DiffValidationError) Error ¶
func (e *DiffValidationError) Error() string
type DirectoryEntry ¶
type EditFileInput ¶
type EditFileResult ¶
type EditFileResult struct {
Success bool `json:"success"`
Path string `json:"path"`
ReplacementsMade int `json:"replacements_made"`
ExpectedReplacements int `json:"expected_replacements"`
FailureReason string `json:"failure_reason,omitempty"`
ValidationErrors []DiffValidationError `json:"validation_errors,omitempty"`
ConflictWarnings []ConflictWarning `json:"conflict_warnings,omitempty"`
PatchInfo PatchInfo `json:"patch_info,omitempty"`
}
func EditFile ¶
func EditFile(fsys afero.Fs, input *EditFileInput) (*EditFileResult, error)
type FindFileInput ¶
type FindFileResult ¶
type FindFileResult struct {
Files []string `json:"files"`
TotalFiles int `json:"total_files"`
TruncatedCount int `json:"truncated_count"`
}
func FindFile ¶
func FindFile(fsys afero.Fs, input *FindFileInput) (*FindFileResult, error)
type GrepResult ¶
type GrepResult struct {
Matches []GrepMatch `json:"matches"`
TotalMatches int `json:"total_matches"`
TruncatedMatches int `json:"truncated_matches"`
SearchedFiles int `json:"searched_files"`
}
func Grep ¶
func Grep(ctx context.Context, input *GrepInput, cmdRunner shared.CommandRunner) (*GrepResult, error)
type ListFilesInput ¶
type ListFilesResult ¶
type ListFilesResult struct {
Path string `json:"path"`
Entries []DirectoryEntry `json:"entries"`
}
func ListFiles ¶
func ListFiles(fsys afero.Fs, input *ListFilesInput) (*ListFilesResult, error)
type ReadFileInput ¶
type ReadFileInput struct {
Path string `json:"path"`
StartLine *int `json:"start_line,omitempty"` // 1-based, inclusive
EndLine *int `json:"end_line,omitempty"` // 1-based, inclusive
}
func (*ReadFileInput) Validate ¶
func (input *ReadFileInput) Validate() error
type ReadFileResult ¶
func ReadFile ¶
func ReadFile(fsys afero.Fs, input *ReadFileInput) (*ReadFileResult, error)
Click to show internal directories.
Click to hide internal directories.