feature: add file operation tools (list, read, write, search, find)#6
Open
hjpinheiro wants to merge 1 commit into
Open
feature: add file operation tools (list, read, write, search, find)#6hjpinheiro wants to merge 1 commit into
hjpinheiro wants to merge 1 commit into
Conversation
… search_files, find_in_files) The plugin currently only supports uploading files from Dify and downloading files to Dify. These 5 new tools cover the fundamental file operations needed for working with files inside a sandbox: - list_files: list directory contents (name, size, type, permissions) - read_file: read text file content as UTF-8 - write_file: create or overwrite a text file - search_files: find files by glob pattern (like find -name) - find_in_files: search file contents by pattern (like grep -r) All tools require sandbox_id explicitly, following the existing convention of upload_file and download_file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The plugin currently only supports uploading files from Dify and downloading files to Dify. These 5 new tools cover the fundamental file operations needed for working with files inside a sandbox:
list_filessandbox.fs.list_files(path)read_filesandbox.fs.download_file(path)write_filesandbox.fs.upload_file(data, path)search_filesfind -name)sandbox.fs.search_files(path, pattern)find_in_filesgrep -r)sandbox.fs.find_files(path, pattern)Design
All tools follow the existing convention of
upload_fileanddownload_file:sandbox_idis required (explicit, no magic discovery)create_json_messagewith structured resultsread_fileandlist_filesalso yieldcreate_text_messagefor human-readable outputNew parameters in YAML
Each tool has 2-3 parameters (following the upstream's minimal style):
list_files:sandbox_id,pathread_file:sandbox_id,remote_pathwrite_file:sandbox_id,remote_path,contentsearch_files:sandbox_id,path,patternfind_in_files:sandbox_id,path,patternFiles
tools/{list_files,read_file,write_file,search_files,find_in_files}.{py,yaml}provider/daytona.yaml(5 new tool registrations)Testing
.pyfiles passpy_compile.yamlfiles passyaml.safe_loadprovider/daytona.yamlvalidates with 12 total tools (7 original + 5 new)