fs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFSMemory

func NewFSMemory(cfg FSMemoryConfig) (agentkit.ToolPack, error)

NewFSMemory registers tool/fs-memory: In-memory workspace file tools for tests and smoke runs.

func NewFSWorkspace

func NewFSWorkspace(cfg FSWorkspaceConfig, deps FSWorkspaceDeps) (agentkit.ToolPack, error)

NewFSWorkspace registers tool/fs-workspace: Workspace file tools (read, write, edit, grep, find, ls).

Types

type EditInput

type EditInput struct {
	Path  string     `json:"path" jsonschema:"required,description=Path to the file to edit"`
	Edits []FileEdit `json:"edits" jsonschema:"required"`
}

type EditOutput

type EditOutput struct {
	Path    string `json:"path"`
	Applied bool   `json:"applied"`
}

type FSMemoryConfig

type FSMemoryConfig struct {
	// Files is seed contents, keyed by path.
	Files map[string]string `json:"files"`
	// MaxBytes is read truncation limit; defaults to 1 MiB.
	MaxBytes int `json:"maxBytes,omitempty"`
	// MaxMatches is grep cap per call; defaults to 100.
	MaxMatches int `json:"maxMatches,omitempty"`
	// MaxResults is find cap per call; defaults to 200.
	MaxResults int `json:"maxResults,omitempty"`
	// Tools limits which model tools are registered; empty means all six.
	Tools []string `json:"tools,omitempty"`
}

type FSWorkspaceConfig

type FSWorkspaceConfig struct {
	// Root is directory relative to the workspace root; may use the global: or local: scope prefix.
	Root string `json:"root"`
	// MaxBytes is read truncation limit; defaults to 1 MiB.
	MaxBytes int `json:"maxBytes,omitempty"`
	// MaxMatches is grep cap per call; defaults to 100.
	MaxMatches int `json:"maxMatches,omitempty"`
	// MaxResults is find cap per call; defaults to 200.
	MaxResults int `json:"maxResults,omitempty"`
	// ReadOnly rejects write and edit operations.
	ReadOnly bool `json:"readOnly,omitempty"`
	// Tools limits which model tools are registered; empty means all six (read, write, edit, grep, find, ls).
	Tools []string `json:"tools,omitempty"`
}

type FSWorkspaceDeps

type FSWorkspaceDeps struct {
	Workspace workspace.Service `json:"workspace"`
}

type FileEdit

type FileEdit struct {
	OldText string `json:"oldText" jsonschema:"required,description=Exact text to replace in the original file"`
	NewText string `json:"newText" jsonschema:"required,description=Replacement text"`
}

type FindInput

type FindInput struct {
	Pattern string `json:"pattern" jsonschema:"required,description=Filename glob pattern, e.g. *.go"`
	Path    string `json:"path" jsonschema:"description=Directory to search (default: workspace root)"`
}

type FindOutput

type FindOutput = filesystem.FindResult

type GrepInput

type GrepInput struct {
	Pattern    string `json:"pattern" jsonschema:"required,description=Regular expression to search for"`
	Path       string `json:"path" jsonschema:"description=Directory or file to search (default: workspace root)"`
	Glob       string `json:"glob" jsonschema:"description=Optional filename glob filter, e.g. *.go"`
	IgnoreCase bool   `json:"ignoreCase" jsonschema:"description=Case-insensitive search"`
}

type GrepOutput

type GrepOutput = filesystem.GrepResult

type ListDirInput

type ListDirInput struct {
	Path string `json:"path" jsonschema:"description=Directory path relative to the workspace (default: root)"`
}

type ListDirOutput

type ListDirOutput struct {
	Entries []filesystem.DirEntry `json:"entries"`
}

type ReadInput

type ReadInput struct {
	Path string `json:"path" jsonschema:"required,description=File path relative to the workspace"`
}

type ReadOutput

type ReadOutput struct {
	Content string `json:"content"`
}

type WriteInput

type WriteInput struct {
	Path    string `json:"path" jsonschema:"required,description=File path relative to the workspace"`
	Content string `json:"content" jsonschema:"required,description=Full file content to write"`
}

type WriteOutput

type WriteOutput struct {
	Path string `json:"path"`
}

Jump to

Keyboard shortcuts

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