tools: refactor into per-tool files with harness engineering tool surface - #16
Merged
Conversation
…face Split monolithic tools.go/resources.go into individual tool files and add features to match harness engineering patterns: - file_edit: add replace_all parameter - file_write: new tool for creating/overwriting files with auto-mkdir - file_read: binary/image detection, PDF page ranges, base64 image content - grep: output modes, context lines, case-insensitive, head_limit - glob: recursive ** patterns, mtime sorting - bash: run_in_background with bash_status, description, progress notifications - bash_status: new tool to check background command results - server: sandbox session persistence across restarts (temp file + env var) - upload: proper data: URI base64 decoding - Tool descriptions instruct AI to prefer dedicated tools over bash
| // sessionFilePath returns a deterministic temp file path for persisting the sandbox ID. | ||
| // The path is keyed by API key hash so different accounts don't collide. | ||
| func sessionFilePath() string { | ||
| h := sha256.Sum256([]byte(tlAPIKey)) |
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
tools.goandresources.gointo individual per-tool files (tool_bash.go,tool_file_read.go,tool_file_edit.go,tool_file_write.go,tool_grep.go,tool_glob.go,tool_upload.go,tool_parse.go,server.go)file_writetool for creating/overwriting files with automatic parent directory creationbash_statustool andrun_in_background/descriptionparameters tobashreplace_allparameter tofile_editgrepwith output modes (content/files_with_matches/count), context lines, case-insensitive search, andhead_limitglobto support recursive**patterns with mtime-sorted resultsfile_readwith binary detection, base64 image content for image files, and PDF page range supportTENSORLAKE_SANDBOX_IDenv vardata:URI upload to properly parse and base64-decode standard data URIstruncateOutput,isBinary,shellQuote,parseDataURI) and integration test coverage for all new featuresTest plan
go test -run 'TestTruncate|TestIsBinary|TestShellQuote|TestParseDataURI' ./...TENSORLAKE_API_KEY=... go test -v ./...