From 1132f12a2f8f350b98f3899bc57002d0a9f7bdab Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Sun, 28 Dec 2025 21:26:57 -0800 Subject: [PATCH] feat(conversation-assistant): auto-open Full Disk Access settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Auto-detect interactive vs SSH batch mode - In batch mode, automatically open System Settings to FDA pane - Use osascript with fallback to URL scheme for reliable GUI launch - Improves remote installation UX by showing settings immediately 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../conversation-assistant/macos/install.sh | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/features/conversation-assistant/macos/install.sh b/features/conversation-assistant/macos/install.sh index c6b11ba71..b7e591b3d 100755 --- a/features/conversation-assistant/macos/install.sh +++ b/features/conversation-assistant/macos/install.sh @@ -238,21 +238,42 @@ show_permissions_guide() { echo "The Conversation Assistant requires Full Disk Access to read the iMessage database." echo "" echo "To grant access:" - echo " 1. Open System Settings → Privacy & Security → Full Disk Access" + echo " 1. System Settings will open to Full Disk Access" echo " 2. Click the '+' button" echo " 3. Navigate to: $INSTALL_DIR/$APP_NAME.app" echo " 4. Select the app and click 'Open'" echo " 5. Enable the toggle next to $APP_NAME" echo "" - read -p "Press Enter to open System Settings, or 'n' to skip: " open_settings - - if [[ "$open_settings" != "n" && "$open_settings" != "N" ]]; then - # Open System Settings to the correct pane (macOS Ventura+) - open "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles" + # Check if running interactively (has a TTY) + if [[ -t 0 ]]; then + read -p "Press Enter to open System Settings, or 'n' to skip: " open_settings + if [[ "$open_settings" != "n" && "$open_settings" != "N" ]]; then + open_fda_settings + fi + else + # Non-interactive mode (SSH batch) - auto-open settings + print_info "Opening System Settings → Full Disk Access..." + open_fda_settings fi } +open_fda_settings() { + # Open System Settings to Full Disk Access pane (macOS Ventura+) + # Use osascript to ensure it opens in the user's GUI session (works via SSH) + osascript -e 'tell application "System Settings" + activate + delay 0.5 + tell application "System Events" + keystroke "Full Disk Access" + delay 0.3 + key code 36 + end tell + end tell' 2>/dev/null || \ + open "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles" 2>/dev/null || \ + open "/System/Applications/System Settings.app" 2>/dev/null +} + register_device() { print_step "Starting the agent for device registration..."