Commit graph

16 commits

Author SHA1 Message Date
Peter Steinberger
606290ec79 Lower macOS requirement from 15.0 to 14.0
Based on API usage analysis, Peekaboo only requires macOS 14.0 (Sonoma), not macOS 15.0 (Sequoia). The APIs we use:
- SCScreenshotManager.captureImage: macOS 14.0+
- configuration.shouldBeOpaque: macOS 14.0+
- Typed throws syntax: Works with macOS 14.0

This change makes Peekaboo available to more users who haven't upgraded to Sequoia yet.

Also fixed warning about undefined modelName in AI providers by using nullish coalescing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 20:48:00 +01:00
Peter Steinberger
17dea6ad79 fix: Prevent security vulnerability from malformed app targets
Addresses critical edge case where malformed app targets with multiple leading colons
(e.g., "::::::::::::::::Finder") created empty app names that would match ALL system
processes. This could potentially expose sensitive information or cause unintended
system-wide captures.

Key improvements:
- Enhanced app target parsing to validate non-empty app names
- Added fallback logic to extract valid app names from malformed inputs
- Default to screen mode when all parts are empty (security-first approach)
- Comprehensive test coverage for edge cases
- Improved backward compatibility with hidden path parameters

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 08:16:39 +01:00
Peter Steinberger
dd680eb638 feat: Improve window title matching and error messages for URLs with ports
When users search for windows with URLs containing ports (e.g., 'http://example.com:8080'),
the system now provides much better debugging information when the window isn't found.

Key improvements:
- Enhanced window not found errors now list all available window titles
- Added specific guidance for URL-based searches (try without protocol)
- New CaptureError.windowTitleNotFound with detailed debugging info
- Comprehensive test coverage for colon parsing in app targets
- Better error messages help users understand why matching failed

Example improved error:
"Window with title containing 'http://example.com:8080' not found in Google Chrome.
Available windows: 'example.com:8080 - Google Chrome', 'New Tab - Google Chrome'.
Note: For URLs, try without the protocol (e.g., 'example.com:8080' instead of 'http://example.com:8080')."

This addresses the common issue where browsers display simplified URLs in window titles
without the protocol, making it easier for users to find the correct matching pattern.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 08:09:47 +01:00
Peter Steinberger
ab882069b4 fix: Add defensive validation for invalid image formats with automatic PNG fallback
Implements robust handling for invalid image formats (like 'bmp', 'gif', 'webp') that bypass schema validation:

- Added defensive format validation in image tool handler
- Automatic path correction to ensure file extensions match actual format used
- Warning messages in response when format fallback occurs
- Comprehensive unit and integration test coverage for edge cases

This ensures invalid formats automatically fall back to PNG as requested, preventing
Swift CLI rejection and incorrect file extensions in output paths.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 07:44:17 +01:00
Peter Steinberger
94e966fa98 feat: Add fuzzy matching for application names
- Implement Levenshtein distance algorithm for fuzzy app name matching
- Handle common typos like "Chromee" → "Google Chrome"
- Add window-specific labels in analysis results
- Improve error messages with app name suggestions
- Fix TypeScript JSON parsing for error responses
- Update tests for new error message formats

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 05:22:58 +01:00
Peter Steinberger
282d00f5d9 Add auto capture focus mode and fix list tool validation
- Added new "auto" capture focus mode that intelligently brings windows to foreground only when needed
- Changed default capture_focus from "background" to "auto" for better screenshot success rates
- Fixed list tool server_status validation to allow empty include_window_details arrays
- Added comprehensive tests for new auto mode functionality
- Enhanced error messages for better user experience

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-08 04:31:28 +01:00
Peter Steinberger
b1ddf6f1b6 Enhance Swift testing framework and test coverage
- Update CI configuration to use macOS-15 runner with Xcode 16.3
- Expand test coverage with comprehensive new test suites:
  * JSONOutputTests.swift - JSON encoding/decoding and MCP compliance
  * LoggerTests.swift - Thread-safe logging functionality
  * ImageCaptureLogicTests.swift - Image capture command logic
  * TestTags.swift - Centralized test tagging system
- Improve existing tests with Swift Testing patterns and async support
- Make Logger thread-safe with concurrent dispatch queue
- Add performance, concurrency, and edge case testing
- Fix compilation issues and optimize test performance

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 23:57:26 +01:00
Peter Steinberger
4e5e15c5a5 Prepare for 1.0.0-beta.11 release
- Update version to 1.0.0-beta.11 in package.json and Swift version file
- Update CHANGELOG.md with today's date
- Fix test expectations for new error message format
- Build universal Swift binary with latest changes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 22:56:33 +01:00
Peter Steinberger
4636aec9d4 Fix test expectation for unknown type fallback
Changed from 'any' to 'string' to match the updated implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 01:11:10 +02:00
Peter Steinberger
7bf63a225c Implement missing best practices
- Add npm run inspector script for MCP inspector tool
- Synchronize Swift CLI version with package.json (1.0.0-beta.9)
- Update macOS version requirement to v14 (Sonoma) for n-1 support
- Add Swift compiler warnings check in prepare-release script
- Convert tests/setup.ts from Jest to Vitest syntax
- Update server status tests to match new format

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-26 23:46:03 +02:00
Peter Steinberger
6396e299be Prepare for v1.0.0-beta.3 release 2025-05-25 14:07:21 +02:00
Peter Steinberger
ed59bb58dc Combine image + analyze 2025-05-25 13:32:39 +02:00
Peter Steinberger
97eba5e97e Add tests; finish peekabo cli rename 2025-05-25 01:28:34 +02:00
Peter Steinberger
857ce73b94 rename swift-cli to peekaboo-cli 2025-05-25 01:28:06 +02:00
Peter Steinberger
670e1c485a Add GitHub Actions CI workflow for Node.js builds
- Configure CI to run on macOS-latest
- Test with Node.js 20.x and 22.x
- Run npm build and tests on push/PR

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-25 01:25:35 +02:00
Peter Steinberger
a7970d8de7 Add tests 2025-05-23 05:40:31 +02:00