Documentation
¶
Index ¶
- func ListDirectoryTool() spec.Tool
- func ReadFile(ctx context.Context, args ReadFileArgs) ([]spec.ToolStoreOutputUnion, error)
- func ReadFileTool() spec.Tool
- func SearchFilesTool() spec.Tool
- func StatPathTool() spec.Tool
- type ListDirectoryArgs
- type ListDirectoryOut
- type ReadFileArgs
- type SearchFilesArgs
- type SearchFilesOut
- type StatPathArgs
- type StatPathOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListDirectoryTool ¶
func ReadFile ¶
func ReadFile(ctx context.Context, args ReadFileArgs) ([]spec.ToolStoreOutputUnion, error)
ReadFile reads a file from disk and returns its contents. If Encoding == "binary" the output is base64-encoded.
func ReadFileTool ¶
func SearchFilesTool ¶
func StatPathTool ¶
Types ¶
type ListDirectoryArgs ¶
type ListDirectoryOut ¶
type ListDirectoryOut struct {
Entries []string `json:"entries"`
}
func ListDirectory ¶
func ListDirectory(ctx context.Context, args ListDirectoryArgs) (*ListDirectoryOut, error)
ListDirectory lists files / dirs in Path. If Pattern is supplied, the results are filtered via filepath.Match.
type ReadFileArgs ¶
type SearchFilesArgs ¶
type SearchFilesOut ¶
type SearchFilesOut struct {
Matches []string `json:"matches"`
}
func SearchFiles ¶
func SearchFiles(ctx context.Context, args SearchFilesArgs) (*SearchFilesOut, error)
SearchFiles walks Root (recursively) and returns up to MaxResults files whose *path* or *UTF-8 text content* match the supplied regexp.
type StatPathArgs ¶
type StatPathArgs struct {
Path string `json:"path"`
}
type StatPathOut ¶
type StatPathOut struct {
Path string `json:"path"`
Name string `json:"name"`
Exists bool `json:"exists"`
IsDir bool `json:"isDir"`
SizeBytes int64 `json:"sizeBytes,omitempty"`
ModTime *time.Time `json:"modTime,omitempty"`
}
func StatPath ¶
func StatPath(ctx context.Context, args StatPathArgs) (*StatPathOut, error)
StatPath returns basic metadata for the supplied path without mutating the file system.
Click to show internal directories.
Click to hide internal directories.