Documentation
¶
Index ¶
- type Entry
- type FileChangeResult
- type GlobFilesResult
- type GrepFilesResult
- type GrepMatch
- type ListDirectoryResult
- type ReadFileResult
- type Service
- func (s *Service) EditFile(path string, oldString string, newString string, replaceAll bool) (*FileChangeResult, error)
- func (s *Service) GlobFiles(pattern string, basePath string) (*GlobFilesResult, error)
- func (s *Service) GrepFiles(pattern string, basePath string, include string) (*GrepFilesResult, error)
- func (s *Service) ListDirectory(path string) (*ListDirectoryResult, error)
- func (s *Service) ReadFile(path string, offset int, limit int) (*ReadFileResult, error)
- func (s *Service) Root() string
- func (s *Service) WriteFile(path string, content string) (*FileChangeResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileChangeResult ¶
type FileChangeResult struct {
Path string `json:"path"`
Operation string `json:"operation"`
Diff string `json:"diff"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Changed bool `json:"changed"`
}
FileChangeResult is the structured output of EditFile and WriteFile.
type GlobFilesResult ¶
type GlobFilesResult struct {
BasePath string `json:"base_path"`
Pattern string `json:"pattern"`
Matches []string `json:"matches"`
Count int `json:"count"`
Truncated bool `json:"truncated"`
}
GlobFilesResult is the structured output of GlobFiles.
type GrepFilesResult ¶
type GrepFilesResult struct {
BasePath string `json:"base_path"`
Pattern string `json:"pattern"`
Include string `json:"include,omitempty"`
Matches []GrepMatch `json:"matches"`
Count int `json:"count"`
Truncated bool `json:"truncated"`
}
GrepFilesResult is the structured output of GrepFiles.
type GrepMatch ¶
type GrepMatch struct {
Path string `json:"path"`
Line int `json:"line"`
Text string `json:"text"`
}
GrepMatch describes one grep match.
type ListDirectoryResult ¶
type ListDirectoryResult struct {
Path string `json:"path"`
Entries []Entry `json:"entries"`
Count int `json:"count"`
Truncated bool `json:"truncated"`
}
ListDirectoryResult is the structured output of ListDirectory.
type ReadFileResult ¶
type ReadFileResult struct {
Path string `json:"path"`
Content string `json:"content"`
StartLine int `json:"start_line"`
EndLine int `json:"end_line"`
TotalLines int `json:"total_lines"`
Truncated bool `json:"truncated"`
}
ReadFileResult is the structured output of ReadFile.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service exposes workspace-scoped file exploration and editing helpers.
func (*Service) EditFile ¶
func (s *Service) EditFile(path string, oldString string, newString string, replaceAll bool) (*FileChangeResult, error)
EditFile replaces oldString with newString in a workspace file and returns a unified diff.
func (*Service) GlobFiles ¶
func (s *Service) GlobFiles(pattern string, basePath string) (*GlobFilesResult, error)
GlobFiles finds files that match the supplied pattern under the workspace root.
func (*Service) GrepFiles ¶
func (s *Service) GrepFiles(pattern string, basePath string, include string) (*GrepFilesResult, error)
GrepFiles searches text files for matches under the workspace root.
func (*Service) ListDirectory ¶
func (s *Service) ListDirectory(path string) (*ListDirectoryResult, error)
ListDirectory returns directory entries under the workspace root.
func (*Service) ReadFile ¶
ReadFile reads a text file from the workspace root using 1-indexed line windows.