filesystem

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package filesystem provides types for filesystem operations in the MCP server. These types are used for serializing file metadata, directory trees, and edit operations between the MCP client and server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EditOperation

type EditOperation struct {
	OldText       string `json:"oldText"`
	NewText       string `json:"newText"`
	RequireUnique *bool  `json:"requireUnique,omitempty"`
	Occurrence    *int   `json:"occurrence,omitempty"`
}

EditOperation represents a single find/replace edit for the edit_file tool. OldText specifies the text to find, NewText specifies the replacement. If RequireUnique is true (default), the operation fails if OldText appears more than once. Occurrence can select a specific match (1-indexed) when multiple matches exist.

type FileInfo

type FileInfo struct {
	Size        int64  `json:"size"`
	Created     string `json:"created,omitempty"`
	Modified    string `json:"modified"`
	Accessed    string `json:"accessed,omitempty"`
	IsDirectory bool   `json:"isDirectory"`
	IsFile      bool   `json:"isFile"`
	Permissions string `json:"permissions"`
}

FileInfo contains metadata about a file or directory. It is returned by the get_file_info tool and provides details such as size, timestamps, type (file/directory), and Unix permissions.

func (FileInfo) String

func (f FileInfo) String() string

type TreeEntry

type TreeEntry struct {
	Name     string       `json:"name"`
	Type     string       `json:"type"` // "file" or "directory"
	Children []*TreeEntry `json:"children,omitempty"`
}

TreeEntry represents a node in a directory tree structure. It is returned by the directory_tree tool and recursively contains child entries for directories. Type is either "file" or "directory".

func (TreeEntry) String

func (t TreeEntry) String() string

Jump to

Keyboard shortcuts

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