- [x] Explore repository structure and understand existing tools pattern - [x] Create tools_readdir.go file with read_dir tool implementation - [x] Add GetReadDirToolDefinition() function following the pattern of read_text_file - [x] Register the new tool in tools.go GenerateTabStateAndTools function - [x] Create comprehensive tests in tools_readdir_test.go - [x] Test the implementation manually with various scenarios - [x] Run Go tests to ensure no regressions - [x] Run security check with CodeQL - No vulnerabilities found - [x] Revert unintended changes to tsunami demo go.mod and go.sum files - [x] Fix sorting to happen before truncation and preserve real total count ## Summary Successfully implemented a new `read_dir` AI tool that reads and lists directory contents, following the same pattern as the existing `read_text_file` tool. **Key Features:** - Supports path expansion (including ~) - Sorts directories first, then files (sorting happens BEFORE truncation) - Truncates output to prevent overwhelming responses (default 1000 entries) - Preserves the real total count even when truncated - Requires user approval for security - Provides detailed file/directory information (name, type, size, permissions, modification time) - Returns both structured data and formatted listing **Files Changed:** - `pkg/aiusechat/tools_readdir.go` - Main implementation (189 lines) - `pkg/aiusechat/tools_readdir_test.go` - Comprehensive tests (211 lines) - `pkg/aiusechat/tools.go` - Tool registration (1 line) **Testing:** - ✅ All 6 unit tests passing (including new test for sort-before-truncate) - ✅ Manual testing with real directories successful - ✅ CodeQL security scan passed with no vulnerabilities - ✅ Go build and vet successful <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > Right now we have AI tools in go at pkg/aichat ... see tools.go, tools_readfile.go. i'd like to add a new tool to read directories in the style of readfile. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> Co-authored-by: sawka <mike@commandline.dev> |
||
|---|---|---|
| .github | ||
| .roo/rules | ||
| .storybook | ||
| .vscode | ||
| .zed | ||
| aiprompts | ||
| assets | ||
| build | ||
| cmd | ||
| db | ||
| docs | ||
| emain | ||
| frontend | ||
| pkg | ||
| public | ||
| schema | ||
| testdriver | ||
| tests/copytests | ||
| tsunami | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .golangci.yml | ||
| .prettierignore | ||
| ACKNOWLEDGEMENTS.md | ||
| BUILD.md | ||
| CNAME | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| electron-builder.config.cjs | ||
| electron.vite.config.ts | ||
| eslint.config.js | ||
| go.mod | ||
| go.sum | ||
| index.html | ||
| LICENSE | ||
| NOTICE | ||
| package-lock.json | ||
| package.json | ||
| prettier.config.cjs | ||
| README.md | ||
| RELEASES.md | ||
| ROADMAP.md | ||
| SECURITY.md | ||
| staticcheck.conf | ||
| Taskfile.yml | ||
| tsconfig.json | ||
| version.cjs | ||
| vitest.config.ts | ||
Wave Terminal
Wave is an open-source terminal that combines traditional terminal features with graphical capabilities like file previews, web browsing, and AI assistance. It runs on MacOS, Linux, and Windows.
Modern development involves constantly switching between terminals and browsers - checking documentation, previewing files, monitoring systems, and using AI tools. Wave brings these graphical tools directly into the terminal, letting you control them from the command line. This means you can stay in your terminal workflow while still having access to the visual interfaces you need.
Key Features
- Flexible drag & drop interface to organize terminal blocks, editors, web browsers, and AI assistants
- Built-in editor for seamlessly editing remote files with syntax highlighting and modern editor features
- Rich file preview system for remote files (markdown, images, video, PDFs, CSVs, directories)
- Integrated AI chat with support for multiple models (OpenAI, Claude, Azure, Perplexity, Ollama)
- Command Blocks for isolating and monitoring individual commands with auto-close options
- One-click remote connections with full terminal and file system access
- Rich customization including tab themes, terminal styles, and background images
- Powerful
wshcommand system for managing your workspace from the CLI and sharing data between terminal sessions
Installation
Wave Terminal works on macOS, Linux, and Windows.
Platform-specific installation instructions can be found here.
You can also install Wave Terminal directly from: www.waveterm.dev/download.
Minimum requirements
Wave Terminal runs on the following platforms:
- macOS 11 or later (arm64, x64)
- Windows 10 1809 or later (x64)
- Linux based on glibc-2.28 or later (Debian 10, RHEL 8, Ubuntu 20.04, etc.) (arm64, x64)
The WSH helper runs on the following platforms:
- macOS 11 or later (arm64, x64)
- Windows 10 or later (arm64, x64)
- Linux Kernel 2.6.32 or later (x64), Linux Kernel 3.1 or later (arm64)
Roadmap
Wave is constantly improving! Our roadmap will be continuously updated with our goals for each release. You can find it here.
Want to provide input to our future releases? Connect with us on Discord or open a Feature Request!
Links
- Homepage — https://www.waveterm.dev
- Download Page — https://www.waveterm.dev/download
- Documentation — https://docs.waveterm.dev
- Legacy Documentation — https://legacydocs.waveterm.dev
- Blog — https://blog.waveterm.dev
- X — https://x.com/wavetermdev
- Discord Community — https://discord.gg/XfvZ334gwU
Building from Source
Contributing
Wave uses GitHub Issues for issue tracking.
Find more information in our Contributions Guide, which includes:
License
Wave Terminal is licensed under the Apache-2.0 License. For more information on our dependencies, see here.
