Commit graph

129 commits

Author SHA1 Message Date
Peter Steinberger
45f087496a Fix Swift build by renaming Version.swift.development to Version.swift
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 23:58:59 +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
5c4cdbc7d5 Apply SwiftFormat to test files 2025-06-07 23:03:13 +01:00
Peter Steinberger
ebbb75ef1b Fix Swift tests after error handling improvements 2025-06-07 23:02:41 +01:00
Peter Steinberger
94c09b1c7a Apply SwiftFormat changes 2025-06-07 22:58:07 +01:00
Peter Steinberger
27f229e802 Fix linting issues in peekaboo-cli.ts 2025-06-07 22:57:49 +01:00
Peter Steinberger
bb2f0f8401 Update package-lock.json for v1.0.0-beta.11 2025-06-07 22:56:52 +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
de5a0cb97e Fix Screen Recording permission detection and improve error reporting
- Replace broken CGDisplayBounds check with ScreenCaptureKit API
- Add proper error handling to detect permission-related failures
- Add server_status subcommand to expose permission status via JSON
- Ensure users get clear error messages when permissions are missing

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 22:51:49 +01:00
Peter Steinberger
a491adbdf1 Enhance error handling with specific exit codes and user-friendly messages
- Add distinct exit codes for different error conditions in Swift CLI
- Map exit codes to clear, actionable error messages in Node.js server
- Replace generic "Swift CLI execution failed" with specific guidance
- Improve permission error messages to guide users to System Settings

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 22:44:07 +01:00
Peter Steinberger
bd49a9c772 Fix SwiftFormat/SwiftLint consistency
- Generate enum instead of struct in build script
- Prevents formatting conflicts during release process
- Maintains alignment with SwiftFormat enumNamespaces rule
2025-05-27 01:30:32 +02:00
Peter Steinberger
a1505f3469 Fix SwiftFormat trailing whitespace 2025-05-27 01:23:39 +02:00
Peter Steinberger
f6e9cbc7b9 Migrate to ScreenCaptureKit 2025-05-27 01:22:52 +02: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
4be8c69e77 Fix TypeScript compilation errors
- Added missing imports for ToolResponse and z in index.ts
- Added missing imports for WindowInfo and TargetApplicationInfo in list.ts
- Fixed type casting for ImageCaptureData in image.ts
- Added proper return type annotations to handlers
- Fixed content array metadata type to Record<string, unknown>
- Added const assertions for all 'text' type literals
- Fixed return types for helper functions in list.ts
- Added minItems and maxItems to JSONSchema interface

All TypeScript compilation errors resolved

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 01:10:35 +02:00
Peter Steinberger
cbecd6181d Fix all ESLint warnings
- Fixed long lines by splitting template literals
- Replaced all 'any' types with proper types:
  - Used ToolResponse type instead of any
  - Used z.ZodError for Zod validation errors
  - Created JSONSchema interface for zod-to-json-schema
  - Added ServerStatusData interface
  - Used Record<string, unknown> for metadata
  - Created ZodDefAny type for internal Zod properties
- Fixed quote style to use double quotes
- Removed trailing spaces

All ESLint issues resolved (0 errors, 0 warnings)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 01:03:36 +02:00
Peter Steinberger
9295dd1ed0 Fix server status test by properly mocking fs module
- Mock fs.readFile in beforeEach to return valid package.json
- Mock fs module with existsSync and accessSync for CLI checks

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:44:33 +02:00
Peter Steinberger
b640074c33 Fix ESLint errors in image-summary.ts
- Remove unused variables target and mode
- Fix quote style to use double quotes

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:43:34 +02:00
Peter Steinberger
c6abc9d168 Fix test failures after refactoring
- Fix buildSwiftCliArgs import in image tests
- Update buildSwiftCliArgs to match expected behavior (capture-focus default, warning messages)
- Fix image summary builder logic to properly generate summaries
- Update server status test to match new implementation that doesn't use executeSwiftCli

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:42:46 +02:00
Peter Steinberger
35083b18cc Update ESLint config to handle caught errors pattern
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:36:10 +02:00
Peter Steinberger
68f3997b5b Prepare for v1.0.0-beta.10 release
- Update version in package.json
- Update package-lock.json
- Add comprehensive changelog entry for beta.10

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:35:39 +02:00
Peter Steinberger
44364221d6 Complete MCP best practices compliance and code cleanup
- Fix all critical ESLint errors (unused variables, wrong types)
- Split image.ts into smaller modules for better maintainability:
  - image-analysis.ts: AI provider analysis logic
  - image-summary.ts: Summary text generation
  - image-cli-args.ts: Swift CLI argument building
- Reduce image.ts from 472 to 246 lines
- Add proper TypeScript types throughout (reduce 'any' usage)
- Fix logger type imports and use proper Pino Logger type
- Update ESLint to ignore test files (handled by vitest)
- Clean up all trailing spaces and formatting issues
- Export buildSwiftCliArgs for test compatibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:32:54 +02:00
Peter Steinberger
54a01ecc46 Fix remaining MCP best practices compliance issues
- Add LICENSE and README.md to npm package files array
- Enhance list tool's server_status as comprehensive info command:
  - Shows MCP version, Swift CLI status and version
  - Displays system permissions (screen recording, accessibility)
  - Lists environment configuration and potential issues
  - Checks log file accessibility
- Implement dynamic version injection for Swift CLI via build script
- Add ESLint configuration (.eslintrc.json) and npm scripts
- Fix critical ESLint issues (console.error, unused imports, prefer-const)
- Add Pino fallback logic when log directory is not writable
- Update default log path to ~/Library/Logs/peekaboo-mcp.log (macOS system log directory)
- Update README to document new log path
- Add Version.swift to .gitignore (auto-generated file)
- Create Version.swift.development for local development
- Add execPeekaboo utility function for simple CLI execution

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-27 00:25:21 +02:00
Peter Steinberger
731b89b779 Prepare release 2025-05-27 00:21:29 +02:00
Peter Steinberger
66cc0e76ea Update Swift tools version to 5.9 for macOS v14 support
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-26 23:47:16 +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
b9f7e2da7a Release v1.0.0-beta.9 - Updated server status formatting
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-25 22:17:14 +02:00
Peter Steinberger
eeabb3eb20 Tweak tool text 2025-05-25 22:15:13 +02:00
Peter Steinberger
4011a86900 Release v1.0.0-beta.8 - Updated server status formatting 2025-05-25 22:07:37 +02:00
Peter Steinberger
cfc236153a Fix server description 2025-05-25 22:06:50 +02:00
Peter Steinberger
9bc178f74c Release v1.0.0-beta.7 2025-05-25 21:59:58 +02:00
Peter Steinberger
2ac01774b2 Tweak server status 2025-05-25 21:59:03 +02:00
Peter Steinberger
8971795ccc Release v1.0.0-beta.6 - Updated tool descriptions 2025-05-25 21:51:39 +02:00
Peter Steinberger
d0cdd645d3 Better tool formatting 2025-05-25 21:50:38 +02:00
Peter Steinberger
22bc42ac3b Release v1.0.0-beta.5 2025-05-25 21:36:00 +02:00
Peter Steinberger
32bf6b9eaf Release testing 2025-05-25 21:21:53 +02:00
Peter Steinberger
1a5aefeded Prepare for v1.0.0-beta.4 release
- Update CHANGELOG with beta.4 features and fixes
- Add example test script for users
2025-05-25 21:11:31 +02:00
Peter Steinberger
3a9a467308 Fix missing args test to properly capture error output 2025-05-25 21:00:38 +02:00
Peter Steinberger
93a1baf596 Fix Swift CLI integration tests to match actual command structure 2025-05-25 19:41:12 +02:00
Peter Steinberger
61d6ef0cee Fix invalid command test to properly capture error output 2025-05-25 19:38:14 +02:00
Peter Steinberger
7fadd6e5f1 Update invalid command test to match actual Swift CLI behavior 2025-05-25 19:36:15 +02:00
Peter Steinberger
4e640fc297 Fix Swift CLI invalid command test to match actual error output 2025-05-25 19:34:25 +02:00
Peter Steinberger
228ee053b2 Fix JSON structure expectations in Swift CLI tests
- Update to expect success/data wrapper in JSON responses
- Match actual Swift CLI output format
2025-05-25 19:30:43 +02:00
Peter Steinberger
41a43117d6 Remove duplicate errorOutput variable declaration 2025-05-25 19:29:38 +02:00
Peter Steinberger
b51a418ec3 Fix Swift CLI tests in release script
- Replace non-existent server_status command with list apps
- Update command names to match actual Swift CLI (apps not running_applications)
- Fix expected JSON structure to match actual output
2025-05-25 19:29:04 +02:00
Peter Steinberger
fe3e63f7cb Apply SwiftFormat formatting 2025-05-25 19:27:38 +02:00
Peter Steinberger
71bab246ac Replace failing test with valid screen index test
- Remove test expecting validation error that doesn't exist
- Add test for screen-index parameter instead
2025-05-25 19:27:20 +02:00
Peter Steinberger
2940a9187d Fix SwiftLint identifier name violation
- Change 'i' to 'index' in WindowManagerTests loop
2025-05-25 19:26:36 +02:00
Peter Steinberger
a547e3a578 Apply SwiftFormat to test files
- Fix import ordering
- Apply consistent formatting
- Add missing newlines at end of files
2025-05-25 19:25:58 +02:00
Peter Steinberger
431ff502a8 Fix ApplicationInfo property name in test
- Change 'name' to 'app_name' to match actual ApplicationInfo struct
2025-05-25 19:25:35 +02:00