Skip to main content

Module file_tools

Module file_tools 

Source
Expand description

Filesystem tools read, write and edit, and the harness shell.

The file tools route file access through the calling agent’s sandbox, so they behave the same against host and container filesystems. Their texts and limits are the harness’s, which differ from the SDK’s vended read/write/edit. shell is the SDK’s stateless sandbox shell (strands::vended_tools::shell::make_shell).

Constants§

EDIT_DESCRIPTION
The edit tool description.
READ_DESCRIPTION
The read tool description (READ_DESCRIPTION).
WRITE_DESCRIPTION
The write tool description.

Functions§

edit_tool
The harness edit tool (edit): replaces old_str, which must appear exactly once, with new_str.
read_tool
The harness read tool.
shell_tool
The harness shell built-in (makeShell(builtinTools.shell)): the SDK’s stateless sandbox shell, whose schema is command and timeout only. description replaces the SDK’s default description (ShellConfig.description).
write_tool
The harness write tool (write): writes the whole file through the agent’s sandbox and reports the line count.