Commit graph

10 commits

Author SHA1 Message Date
Mario Zechner
81052d9b42 Improve Git Bash not found error message
- List the specific paths that are checked
- Make it clear that default installation path should be used
2025-11-13 22:03:00 +01:00
Carlos Gutierrez
3d7edfa6d4 feat: add Windows Git Bash support to bash tool
Add platform detection and Git Bash integration for Windows:
- Detect Windows platform using process.platform
- Search for Git Bash in common installation paths
- Use taskkill for process tree termination on Windows
- Maintain backward compatibility with Unix/Linux/Mac systems
- Add helpful error message if Git Bash not found on Windows
2025-11-12 22:07:44 -07:00
Mario Zechner
29900ce647 feat: make bash tool timeout optional and configurable
- Add optional timeout parameter (in seconds) to bash tool
- No default timeout - commands run until completion unless specified
- Agent can provide timeout when needed for long-running commands
- Update README to reflect optional timeout
2025-11-12 23:53:27 +01:00
Mario Zechner
f147109da7 Fix coding agent tools to return error content instead of throwing
Tools now resolve with error messages in content blocks rather than
rejecting the promise. This matches the expected behavior where tools
always return a result, with errors indicated in the text content.

- read: Return error content for missing files
- edit: Return error content for missing files, text not found, multiple matches
- bash: Return error content for command failures, timeouts, and aborts
- All tools now include required details field in error results
2025-11-12 10:52:12 +01:00
Mario Zechner
84dcab219b Add image support in tool results across all providers
Tool results now use content blocks and can include both text and images.
All providers (Anthropic, Google, OpenAI Completions, OpenAI Responses)
correctly pass images from tool results to LLMs.

- Update ToolResultMessage type to use content blocks
- Add placeholder text for image-only tool results in Google/Anthropic
- OpenAI providers send tool result + follow-up user message with images
- Fix Anthropic JSON parsing for empty tool arguments
- Add comprehensive tests for image-only and text+image tool results
- Update README with tool result content blocks API
2025-11-12 10:45:56 +01:00
Mario Zechner
159075cad7 Improve tool execution rendering and error handling
- Show tool execution components immediately when tool calls appear in streaming
- Update components with streaming arguments as they come in
- Handle incomplete/partial arguments gracefully with optional chaining
- Fix error handling: tools now throw exceptions instead of returning error messages
- Fix bash abort handling to properly reject on abort/timeout
- Clean up error display
2025-11-11 23:05:58 +01:00
Mario Zechner
fe5706885d Clean up bash output formatting
- Remove "Command aborted by user" message (Aborted already shown separately)
- Remove STDOUT/STDERR labels - just show output cleanly
- Stderr is now separated by newline without labels
- Timeout and error messages moved to end of output
2025-11-11 21:09:50 +01:00
Mario Zechner
6e9fa8dde1 Fix bash abort to kill entire process tree immediately
- Switch from exec() to spawn() with detached: true
- Create new process group for spawned commands
- Kill entire process group with process.kill(-pid) on abort
- This ensures commands like "sleep 4 && echo hello" abort immediately
- Previous implementation only killed parent shell, leaving subprocesses running
2025-11-11 21:07:39 +01:00
Mario Zechner
dc1e2f928b Add /thinking command and improve TUI UX
- Add /thinking slash command with autocomplete for setting reasoning levels (off, minimal, low, medium, high)
- Fix Ctrl+C behavior: remove hardcoded exit in TUI, let focused component handle it
- Add empty lines before and after tool execution components for better visual separation
- Fix stats rendering: display stats AFTER tool executions complete (matches web-ui behavior)
- Remove "Press Ctrl+C again to exit" message, show "(esc to interrupt)" in loader instead
- Add bash tool abort signal support with immediate SIGKILL on interrupt
- Make Text and Markdown components return empty arrays when no actual text content
- Add setCustomBgRgb() method to Markdown for dynamic background colors
2025-11-11 20:28:10 +01:00
Mario Zechner
ffc9be8867 Agent package + coding agent WIP, refactored web-ui prompts 2025-10-17 11:47:01 +02:00