Peekaboo/tests/unit/tools
Peter Steinberger d5b40c1550 feat: Implement proper frontmost window capture
Adds support for capturing the frontmost window of the frontmost application
instead of falling back to screen capture mode.

Changes:
- Added 'frontmost' case to CaptureMode enum in Swift CLI
- Implemented captureFrontmostWindow() method using NSWorkspace.shared.frontmostApplication
- Updated TypeScript to use --mode frontmost instead of defaulting to screen mode
- Added comprehensive test coverage for frontmost functionality
- Updated existing tests to reflect new behavior

The frontmost mode now:
1. Detects the currently active application
2. Captures only its frontmost window (index 0)
3. Returns a single image file with proper metadata

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 08:42:43 +01:00
..
analyze-edge-cases.test.ts test: Add comprehensive edge case tests for image and analyze tools 2025-06-08 06:50:10 +01:00
analyze.test.ts fix: Handle empty provider_config gracefully and improve case-insensitive targets 2025-06-08 08:20:30 +01:00
defensive-format-validation.test.ts fix: Add defensive validation for invalid image formats with automatic PNG fallback 2025-06-08 07:44:17 +01:00
edge-case-fixes.test.ts fix: Handle edge cases for invalid screen index and JSON null paths 2025-06-08 07:53:21 +01:00
image-edge-cases.test.ts Fix tests to match new executeSwiftCli signature with timeout parameter 2025-06-08 07:24:02 +01:00
image.test.ts feat: Implement proper frontmost window capture 2025-06-08 08:42:43 +01:00
improved-window-error-messages.test.ts feat: Improve window title matching and error messages for URLs with ports 2025-06-08 08:09:47 +01:00
invalid-format.test.ts fix: Add defensive validation for invalid image formats with automatic PNG fallback 2025-06-08 07:44:17 +01:00
list.test.ts fix: Handle empty string item_type parameter in list tool 2025-06-08 08:33:44 +01:00
multiple-app-matches.test.ts feat: Capture all windows from multiple exact app matches instead of erroring 2025-06-08 08:00:44 +01:00
path-traversal-error-handling.test.ts fix: Correct error handling for path traversal and file system errors 2025-06-08 08:05:03 +01:00
window-title-matching.test.ts feat: Improve window title matching and error messages for URLs with ports 2025-06-08 08:09:47 +01:00