forked from johnneerdael/multiplatform-cursor-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
143 lines (120 loc) · 4.69 KB
/
.cursorrules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Cross-Platform Migration Task
## Issues Found
1. Windows-specific Path Handling
- Using `process.env.LOCALAPPDATA` for Cursor.exe path
- Windows-style path separators in path.join operations
- Hard-coded Windows paths in documentation
2. Windows-specific Dependencies
- `node-windows` dependency for window management
- Heavy reliance on `node-window-manager` for Windows-specific window operations
- `robotjs` for Windows-specific keyboard/mouse automation
3. Windows-specific APIs
- Windows-specific window handling in WindowsApiService
- Windows-specific process management
- Windows-specific keyboard event handling
## Migration Plan
[X] 1. Path Handling
- Replace Windows-specific path handling with path.join and process.platform checks
- Update documentation with cross-platform examples
- Create platform-specific path resolvers
[X] 2. Window Management
- Create platform-agnostic window management interface
- Implement platform-specific adapters (Windows/MacOS/Linux)
- Replace direct Windows API calls with adapter interface
[X] 3. Process Management
- Create cross-platform process spawning logic
- Handle platform-specific executable paths
- Implement platform-specific process detection
[X] 4. Keyboard/Mouse Automation
- Create platform-agnostic input automation interface
- Replace robotjs with @nut-tree/nut-js
- Implement platform-specific input handling
[X] 5. Configuration
- Add platform-specific configuration options
- Create default configs for each supported platform
- Update environment variable handling
## Completed Tasks
1. Created PathResolver utility for cross-platform path handling
2. Created platform-agnostic window management interface
3. Implemented Windows and macOS window managers
4. Implemented Linux window manager using xdotool
5. Created cross-platform input automation service using @nut-tree/nut-js
6. Updated CursorInstanceManager to use new abstractions
7. Updated documentation with cross-platform instructions
8. Added comprehensive test suite for window managers
9. Added structured error handling system
10. Added logging system with context tracking
11. Added tests for input automation service
12. Added tests for path resolver
13. Created platform-specific installation scripts
14. Added integration tests for window management
15. Added integration tests for input automation
16. Added GitHub Actions workflows for testing and releases
## Next Steps
1. Add performance monitoring and metrics
2. Create platform-specific uninstallation scripts
## Priority Files to Update
1. ~~src/services/WindowsApiService.ts~~ (Replaced with new window manager)
2. ~~src/managers/CursorInstanceManager.ts~~ (Updated)
3. ~~src/types/node-windows.d.ts~~ (No longer needed)
4. ~~src/test/* files~~ (Added comprehensive tests)
5. ~~README.md~~ (Updated with cross-platform instructions)
## Dependencies
1. Added:
- @nut-tree/nut-js (cross-platform input automation)
- active-win (cross-platform window detection)
- winston (logging)
2. Removed:
- robotjs (Windows-specific)
- node-windows (Windows-specific)
- node-window-manager (Windows-specific)
## Platform Support
1. Windows:
- Uses native window management through active-win
- Input automation through @nut-tree/nut-js
- PowerShell installation script with scheduled task
2. macOS:
- Uses AppleScript for window management
- Input automation through @nut-tree/nut-js
- Requires accessibility permissions
- Launch agent for auto-start
3. Linux:
- Uses xdotool for window management
- Input automation through @nut-tree/nut-js
- Requires X11 and xdotool
- Systemd service for auto-start
- udev rules for input devices
## Testing
1. Unit Tests:
- Window manager tests for each platform
- Error handling tests
- Input automation tests
- Path resolver tests
2. Integration Tests:
- Cross-platform window management
- Input automation scenarios
- Error recovery scenarios
3. Platform-Specific Tests:
- Windows: Native window handling
- macOS: AppleScript integration
- Linux: xdotool commands
4. CI/CD:
- GitHub Actions workflow for PR tests
- GitHub Actions workflow for releases
- Cross-platform test matrix
- Automated artifact uploads
## Installation
1. Windows:
- PowerShell script with admin privileges
- Creates scheduled task for auto-start
- Sets up necessary directories and permissions
2. macOS:
- Bash script with sudo
- Creates launch agent for auto-start
- Handles accessibility permissions
- Sets up Xcode Command Line Tools
3. Linux:
- Bash script with sudo
- Supports apt, dnf, and pacman
- Creates systemd user service
- Sets up udev rules for input devices