-
Notifications
You must be signed in to change notification settings - Fork 43
Fix linux smart connections detection #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix linux smart connections detection #23
Conversation
- Added fallback detection method using plugin system - Smart Connections doesn't always expose window.SmartSearch on Linux - Now checks app.plugins.plugins['smart-connections'].env as fallback - Caches the API reference in window.SmartSearch for consistency - Added proper TypeScript types for the smart-connections plugin Fixes issue where Smart Connections shows as not installed on Linux despite being fully functional.
- Removed duplicate App interface declaration from types.ts - Updated existing smart-connections type in mcp-server-install/types.ts - Added SmartConnections import for proper typing - Fixed type errors caught by bun run check
`versions.json` files to `0.2.24` to reflect the latest changes.
✅ Deploy Preview for superb-starlight-b5acb5 canceled.
|
I'm having a detection issue on macOS as well -- noting that this may help in that scenario as well. |
|
I am also encountering a detection issue for this on Windows as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Clean solution with proper fallback detection for Linux compatibility. Good catch on the caniuse-lite
dependency resolution too.
The implementation maintains existing behavior while gracefully handling the platform difference. Ready to merge! 🚀
- Integrates Smart Connections v3.0+ smart_sources.lookup() API - Maintains cross-platform detection fallback from PR #23 - Creates compatibility wrapper for v3.0 result format transformation - Preserves backwards compatibility with v2.x via window.SmartSearch - Fixes detection issues on Linux, macOS, and Windows
Description
This PR fixes an issue where the Smart Connections plugin is not detected by MCP Tools on Linux systems, even though Smart Connections is installed and fully functional.
Problem
On Linux, Smart Connections doesn't consistently expose its API via
window.SmartSearch
. Instead, it's accessible through Obsidian's plugin system atapp.plugins.plugins["smart-connections"].env
.Solution
Added a fallback detection mechanism that:
window.SmartSearch
(works on some platforms)app.plugins.plugins["smart-connections"].env
(fixes Linux)window.SmartSearch
for consistencyChanges
loadSmartSearchAPI
function inpackages/obsidian-plugin/src/shared/index.ts
env
property on the smart-connections pluginTesting
Tested on Linux (Ubuntu) with:
Before fix: Smart Connections shows as ❌ not installed
After fix: Smart Connections shows as ✅ installed
✅ All TypeScript checks pass (
bun run check
)Related Issues
Fixes detection issue on Linux systems where Smart Connections is functional but not detected.