Documentation
¶
Overview ¶
Package types defines the shared wire contracts for the filesystem tools.
Index ¶
Constants ¶
View Source
const ( ToolNameReadFile = "read_file" ToolNameReadMultipleFiles = "read_multiple_files" ToolNameEditFile = "edit_file" ToolNameWriteFile = "write_file" ToolNameDirectoryTree = "directory_tree" ToolNameListDirectory = "list_directory" ToolNameSearchFilesContent = "search_files_content" ToolNameMkdir = "create_directory" ToolNameRmdir = "remove_directory" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectoryTreeArgs ¶
type DirectoryTreeArgs struct {
Path string `json:"path" jsonschema:"Directory to traverse"`
}
type DirectoryTreeMeta ¶
type EditFileArgs ¶
type EditFileArgs struct {
Path string `json:"path" jsonschema:"File to edit"`
Edits []Edit `json:"edits" jsonschema:"Edits to apply"`
}
func ParseEditFileArgs ¶
func ParseEditFileArgs(data []byte) (EditFileArgs, error)
ParseEditFileArgs parses LLM-generated edit_file arguments, handling two common failure modes:
- The outer JSON itself is malformed — typically extra closing braces/brackets or stray escape sequences caused by the model losing track of nesting depth when the text payload contains structural characters (e.g. YAML, Dockerfiles).
- The "edits" field is double-serialized (a JSON string instead of an array).
type ListDirectoryArgs ¶
type ListDirectoryArgs struct {
Path string `json:"path" jsonschema:"Directory to list"`
}
type ListDirectoryMeta ¶
type ReadFileArgs ¶
type ReadFileArgs struct {
Path string `json:"path" jsonschema:"File to read"`
// Line and Limit are pointers so an omitted value is distinguishable
// from an explicit (invalid) zero.
Line *int `json:"line,omitempty" jsonschema:"1-based line number to start reading from (text files only; defaults to the first line)"`
Limit *int `` /* 134-byte string literal not displayed */
}
type ReadFileMeta ¶
type ReadMultipleFilesArgs ¶
type ReadMultipleFilesMeta ¶
type ReadMultipleFilesMeta struct {
Files []ReadFileMeta `json:"files"`
}
type SearchFilesContentArgs ¶
type SearchFilesContentArgs struct {
Path string `json:"path" jsonschema:"Starting directory"`
Query string `json:"query" jsonschema:"Text or regex to search"`
IsRegex bool `json:"is_regex,omitempty" jsonschema:"Treat query as regex"`
ExcludePatterns []string `json:"excludePatterns,omitempty" jsonschema:"Patterns to exclude"`
}
type SearchFilesContentMeta ¶
type WriteFileArgs ¶
Click to show internal directories.
Click to hide internal directories.