feat(cua-driver-rs): port Swift launch_app name fallbacks to Rust - #1577
feat(cua-driver-rs): port Swift launch_app name fallbacks to Rust#1577hippoley wants to merge 1 commit into
Conversation
…oses trycua#1523) Ports Swift AppLauncher.locate(name:) Pass 3 from PR trycua#1492 (3b5c372) to the Rust cua-driver-rs port. locate_by_name() now runs a three-pass chain that mirrors Swift exactly: Pass 1 (unchanged): exact filesystem <name>.app lookup in canonical roots (/Applications, /System/Applications, ~/Applications, etc.). Pass 2 (unchanged): LaunchServices bundle-id lookup via NSWorkspace.URLForApplicationWithBundleIdentifier — lets callers pass a bundle identifier in the name slot (e.g. name=com.apple.calculator) without switching to the bundle_id parameter. Pass 3 (new): case-insensitive fuzzy scan: a) localizedName from running NSRunningApplication instances — locale-aware, covers e.g. 計算機 on JP macOS for Calculator. b) CFBundleDisplayName > CFBundleName > bundle stem from each candidate bundle's Info.plist in the canonical roots. Before this PR (Rust binary): launch_app name=com.apple.calculator -> Could not locate app launch_app name=CALCULATOR -> Could not locate app After this PR (Rust binary): launch_app name=com.apple.calculator -> pid=..., resolved via Pass 2 launch_app name=CALCULATOR -> pid=..., resolved via Pass 3 launch_app name=Calculator -> pid=..., regression guard Files changed: - apps/mod.rs: expand locate_by_name with Pass 3 (3a + 3b) - tests/integration/test_api_parity.py: add 3 new parity tests: test_mcp_launch_app_by_name_accepts_bundle_id test_mcp_launch_app_by_name_case_insensitive test_mcp_launch_app_by_name_unknown_raises_error - PARITY.md: document Pass 3 under Fixed (macOS)
|
@nishantpurohit04 is attempting to deploy a commit to the Cua Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughEnhanced macOS ChangesmacOS app name resolution with three-pass matching
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Ports Swift
AppLauncher.locate(name:)Pass 3 from PR #1492 (3b5c372d) to the Rustcua-driver-rsport. Closes #1523.locate_by_name()now runs the same three-pass chain as Swift:<name>.applookup in canonical rootsnameslot)localizedNamefrom runningNSRunningApplication(locale-aware)CFBundleDisplayName/CFBundleName/ stem scan, case-insensitiveBefore / After
Files changed
apps/mod.rs— expandlocate_by_namewith Pass 3 (3a + 3b)tests/integration/test_api_parity.py— 3 new parity testsPARITY.md— document Pass 3 under Fixed (macOS)Closes #1523
Summary by CodeRabbit
Release Notes
New Features
Tests