fs

package
v0.12.21 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGrepLimit     = 250
	DefaultScanBufSize   = 64 * 1024
	MaxScanBufSize       = 1024 * 1024
	MaxLineDisplayLength = 500
)
View Source
const (
	DefaultMaxLines = 2000
	DefaultMaxBytes = 48 * 1024

	MaxReadFileBytes = 10 * 1024 * 1024
	MaxEditFileBytes = 10 * 1024 * 1024
)
View Source
const DefaultGlobLimit = 100

Variables

This section is empty.

Functions

func EditTool

func EditTool(root *os.Root, allowedWriteRoots ...string) tool.Tool

func GlobTool added in v0.6.9

func GlobTool(root *os.Root, allowedReadRoots ...string) tool.Tool

func GrepTool

func GrepTool(root *os.Root, allowedReadRoots ...string) tool.Tool

func ImageTool added in v0.10.0

func ImageTool(root *os.Root, allowedReadRoots ...string) tool.Tool

func ReadTool

func ReadTool(root *os.Root, allowedReadRoots ...string) tool.Tool

func Tools

func Tools(root *os.Root, opts *Options) []tool.Tool

func WriteTool

func WriteTool(root *os.Root, allowedWriteRoots ...string) tool.Tool

Types

type Freshness added in v0.11.2

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

Freshness tracks the on-disk state of files the session's file tools touched, so external modifications (user edits, linters, shell commands) can be detected and announced to the model. A nil Freshness disables it.

func NewFreshness added in v0.11.2

func NewFreshness(root *os.Root) *Freshness

func (*Freshness) Changed added in v0.11.2

func (f *Freshness) Changed() []string

Changed stats every tracked file and returns the paths whose on-disk state no longer matches what the session's tools last saw. Each change reports once: the record is updated (or dropped, for deleted files) so repeated sweeps stay quiet until the next external modification.

type Options added in v0.6.9

type Options struct {
	AllowedReadRoots  []string
	AllowedWriteRoots []string
	Freshness         *Freshness

	// MaxReadFileBytes switches larger files to bounded streaming reads.
	// Zero uses MaxReadFileBytes; a negative value loads files without a size limit.
	MaxReadFileBytes int64
}

Jump to

Keyboard shortcuts

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