filesystemtools

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirEntryResult

type DirEntryResult struct {
	Name  string `json:"name"`
	Size  int64  `json:"size"`
	IsDir bool   `json:"is_dir"`
	Mode  string `json:"mode"`
}

type FileError

type FileError struct {
	Path  string `json:"path"`
	Error string `json:"error"`
}

type FileInfoResult

type FileInfoResult struct {
	Path    string `json:"path"`
	Name    string `json:"name"`
	Size    int64  `json:"size"`
	IsDir   bool   `json:"is_dir"`
	Mode    string `json:"mode"`
	ModTime string `json:"mod_time"`
}

type FilesystemClient

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

func NewFilesystemClient

func NewFilesystemClient(logger *slog.Logger, allowedRoots []string) (*FilesystemClient, error)

func (*FilesystemClient) AllowedRoots

func (c *FilesystemClient) AllowedRoots() []string

func (*FilesystemClient) CallTool

func (c *FilesystemClient) CallTool(ctx context.Context, name string, args json.RawMessage) (interface{}, error)

func (*FilesystemClient) Close

func (c *FilesystemClient) Close() error

func (*FilesystemClient) GetTools

func (c *FilesystemClient) GetTools() []ToolDefinition

type ListDirResult

type ListDirResult struct {
	Path    string           `json:"path"`
	Entries []DirEntryResult `json:"entries"`
}

type ReadFileResult

type ReadFileResult struct {
	Path      string `json:"path"`
	Content   string `json:"content"`
	Size      int64  `json:"size"`
	Truncated bool   `json:"truncated,omitempty"`
}

type ReadMultipleResult

type ReadMultipleResult struct {
	Files  []ReadFileResult `json:"files"`
	Errors []FileError      `json:"errors,omitempty"`
}

type SearchFilesResult

type SearchFilesResult struct {
	Pattern string   `json:"pattern"`
	Files   []string `json:"files"`
}

type ToolDefinition

type ToolDefinition struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	InputSchema json.RawMessage `json:"inputSchema"`
}

type ToolHandler

type ToolHandler func(ctx context.Context, args json.RawMessage, root *os.Root) (interface{}, error)

type WriteFileResult

type WriteFileResult struct {
	Path         string `json:"path"`
	BytesWritten int64  `json:"bytes_written"`
}

Jump to

Keyboard shortcuts

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