Documentation
¶
Index ¶
- Constants
- func CreateToolSet(toolset latest.Toolset, runConfig *config.RuntimeConfig) (tools.ToolSet, error)
- func Creator(_ context.Context, toolset latest.Toolset, _ string, ...) (tools.ToolSet, error)
- func ValidateReadFileRange(line, limit *int) error
- type CreateDirectoryArgs
- type DirectoryTreeArgs
- type DirectoryTreeMeta
- type Edit
- type EditFileArgs
- type ListDirectoryArgs
- type ListDirectoryMeta
- type Opt
- type PostEditConfig
- type ReadFileArgs
- type ReadFileMeta
- type ReadMultipleFilesArgs
- type ReadMultipleFilesMeta
- type RemoveDirectoryArgs
- type SearchFilesContentArgs
- type SearchFilesContentMeta
- type ToolSet
- func (t *ToolSet) Close() error
- func (t *ToolSet) ExecutePostEditCommands(ctx context.Context, path string) error
- func (t *ToolSet) HasPostEditCommands() bool
- func (t *ToolSet) Instructions() string
- func (t *ToolSet) ResolveAndCheckPath(path string) (string, error)
- func (t *ToolSet) Tools(context.Context) ([]tools.Tool, error)
- type WriteFileArgs
Constants ¶
const ( ToolNameReadFile = types.ToolNameReadFile ToolNameReadMultipleFiles = types.ToolNameReadMultipleFiles ToolNameEditFile = types.ToolNameEditFile ToolNameWriteFile = types.ToolNameWriteFile ToolNameDirectoryTree = types.ToolNameDirectoryTree ToolNameListDirectory = types.ToolNameListDirectory ToolNameSearchFilesContent = types.ToolNameSearchFilesContent ToolNameMkdir = types.ToolNameMkdir ToolNameRmdir = types.ToolNameRmdir )
Variables ¶
This section is empty.
Functions ¶
func CreateToolSet ¶ added in v1.60.0
CreateToolSet is used by the tools registry.
func Creator ¶ added in v1.132.0
func Creator(_ context.Context, toolset latest.Toolset, _ string, runConfig *config.RuntimeConfig, _ string) (tools.ToolSet, error)
Creator builds this toolset from its YAML declaration. It matches teamloader.ToolsetCreator so it can be registered directly:
teamloader.NewToolsetRegistry(map[string]teamloader.ToolsetCreator{"filesystem": filesystem.Creator})
func ValidateReadFileRange ¶ added in v1.121.0
ValidateReadFileRange rejects explicitly supplied non-positive range values; nil means "not provided" and is always valid. It is exported so alternative read_file implementations (e.g. the ACP override) apply the same contract before doing any I/O.
Types ¶
type CreateDirectoryArgs ¶
type CreateDirectoryArgs struct {
Paths []string `json:"paths" jsonschema:"Directories to create"`
}
type DirectoryTreeArgs ¶
type DirectoryTreeArgs = types.DirectoryTreeArgs
type DirectoryTreeMeta ¶
type DirectoryTreeMeta = types.DirectoryTreeMeta
type EditFileArgs ¶
type EditFileArgs = types.EditFileArgs
func ParseEditFileArgs ¶
func ParseEditFileArgs(data []byte) (EditFileArgs, error)
ParseEditFileArgs parses edit_file arguments, including common LLM JSON malformations.
type ListDirectoryArgs ¶
type ListDirectoryArgs = types.ListDirectoryArgs
type ListDirectoryMeta ¶
type ListDirectoryMeta = types.ListDirectoryMeta
type Opt ¶
type Opt func(*ToolSet)
func WithAgentsIgnore ¶ added in v1.112.0
func WithAgentsIgnore(m *fsx.AgentsIgnoreMatcher) Opt
func WithAllowList ¶
WithAllowList restricts every filesystem operation to paths that resolve under one of the supplied roots. Each entry may be:
- "." — the agent's working directory
- "~" or "~/..." — the user's home directory
- "$VAR" / "${VAR}" — an environment variable
- any absolute or relative path (relative paths are anchored at the working directory)
Symlinks are resolved before the containment check, so a symlink inside an allowed root cannot be used to escape it. An empty or nil slice disables the allow-list and preserves the default behaviour (any path is allowed).
Invalid entries (e.g. an empty string) are logged and the allow-list is silently dropped, mirroring how WithIgnoreVCS handles construction errors.
func WithDenyList ¶
WithDenyList forbids every filesystem operation on paths that resolve under one of the supplied roots. Tokens follow the same expansion rules as WithAllowList. The deny-list takes precedence over the allow-list: a path that matches both is rejected. An empty or nil slice disables the deny-list.
func WithIgnoreVCS ¶
func WithPostEditCommands ¶
func WithPostEditCommands(postEditCommands []PostEditConfig) Opt
type PostEditConfig ¶
type PostEditConfig struct {
Path string // File path pattern (glob-style)
Cmd string // Command to execute (with $path placeholder)
}
PostEditConfig represents a post-edit command configuration
type ReadFileArgs ¶
type ReadFileArgs = types.ReadFileArgs
type ReadFileMeta ¶
type ReadFileMeta = types.ReadFileMeta
type ReadMultipleFilesArgs ¶
type ReadMultipleFilesArgs = types.ReadMultipleFilesArgs
type ReadMultipleFilesMeta ¶
type ReadMultipleFilesMeta = types.ReadMultipleFilesMeta
type RemoveDirectoryArgs ¶
type RemoveDirectoryArgs struct {
Paths []string `json:"paths" jsonschema:"Directories to remove"`
}
type SearchFilesContentArgs ¶
type SearchFilesContentArgs = types.SearchFilesContentArgs
type SearchFilesContentMeta ¶
type SearchFilesContentMeta = types.SearchFilesContentMeta
type ToolSet ¶ added in v1.60.0
type ToolSet struct {
// contains filtered or unexported fields
}
func NewFromConfig ¶ added in v1.143.0
NewFromConfig builds a filesystem toolset with its configured policies and hooks.
func (*ToolSet) Close ¶ added in v1.60.0
Close releases any *os.Root file descriptors held by the allow/deny lists. It is safe to call Close multiple times.
func (*ToolSet) ExecutePostEditCommands ¶ added in v1.143.0
ExecutePostEditCommands runs hooks after a transport writes a checked, canonical path.
func (*ToolSet) HasPostEditCommands ¶ added in v1.143.0
HasPostEditCommands reports whether writes may be changed by configured commands.
func (*ToolSet) Instructions ¶ added in v1.60.0
func (*ToolSet) ResolveAndCheckPath ¶ added in v1.143.0
ResolveAndCheckPath applies filesystem policy without reading or writing file contents. Transport adapters must also enforce containment when they access the path.
type WriteFileArgs ¶
type WriteFileArgs = types.WriteFileArgs