(reason: DetectReason = 'no-bundle')
| 151 | } |
| 152 | |
| 153 | export function notFoundMessage(reason: DetectReason = 'no-bundle'): string { |
| 154 | switch (reason) { |
| 155 | case 'no-bundle': |
| 156 | return `Desktop app not found at ${APPLICATIONS_BUNDLE_PATH}. Install via DMG, or omit --mode for browser mode.`; |
| 157 | case 'darwin-only': |
| 158 | return 'Desktop app is macOS-only on this release. Use --mode=browser, or omit --mode for the server fallback.'; |
| 159 | case 'headless': |
| 160 | return 'Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.'; |
| 161 | case 'force-browser': |
| 162 | return 'OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.'; |
| 163 | case 'stat-error': |
| 164 | return `Failed to inspect desktop bundle at ${APPLICATIONS_BUNDLE_PATH} (filesystem error). Check permissions or use --mode=browser.`; |
| 165 | case 'available': |
| 166 | return `Desktop app appears available at ${APPLICATIONS_BUNDLE_PATH} but launch dispatch did not fire (caller bug).`; |
| 167 | } |
| 168 | } |
no outgoing calls
no test coverage detected