-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoding_tool_factory.py
More file actions
1816 lines (1461 loc) · 60.8 KB
/
Copy pathcoding_tool_factory.py
File metadata and controls
1816 lines (1461 loc) · 60.8 KB
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Factory classes for creating OS-specific detectors.
This module provides factory classes that create appropriate detector instances
based on the operating system.
"""
import platform
from typing import Optional
# Base classes
from .coding_tool_base import (
BaseDeviceIdExtractor,
BaseToolDetector,
BaseCursorRulesExtractor,
BaseClaudeRulesExtractor,
BaseWindsurfRulesExtractor,
BaseClineRulesExtractor,
BaseRooRulesExtractor,
BaseAntigravityRulesExtractor,
BaseKiloCodeRulesExtractor,
BaseGeminiCliRulesExtractor,
BaseCodexRulesExtractor,
BaseOpenCodeRulesExtractor,
BaseCursorCliRulesExtractor,
BaseCopilotCliRulesExtractor,
BaseCopilotCliSettingsExtractor,
BaseCopilotCliSkillsExtractor,
BaseMCPConfigExtractor,
BaseClaudeSettingsExtractor,
BaseCursorSettingsExtractor,
BaseOpenClawDetector,
BaseCopilotDetector,
BaseJunieRulesExtractor,
BaseClaudeSkillsExtractor,
BaseClaudeCoworkSkillsExtractor,
BaseCursorSkillsExtractor,
BaseClineSkillsExtractor,
)
# macOS - Shared
from .macos import MacOSDeviceIdExtractor, MacOSCursorDetector, MacOSClaudeDetector
from .macos import MacOSClaudeCoworkDetector, MacOSClaudeCoworkSkillsExtractor
# macOS - Cursor
from .macos.cursor.cursor_rules_extractor import MacOSCursorRulesExtractor
from .macos.cursor.mcp_config_extractor import MacOSCursorMCPConfigExtractor
from .macos.cursor.settings_extractor import MacOSCursorSettingsExtractor
# macOS - Claude Code
from .macos.claude_code.claude_rules_extractor import MacOSClaudeRulesExtractor
from .macos.claude_code.mcp_config_extractor import MacOSClaudeMCPConfigExtractor
from .macos.claude_code.settings_extractor import MacOSClaudeSettingsExtractor
from .macos.claude_code.skills_extractor import MacOSClaudeSkillsExtractor
from .macos.cursor.skills_extractor import MacOSCursorSkillsExtractor
# macOS - Windsurf
from .macos.windsurf.windsurf import MacOSWindsurfDetector
from .macos.windsurf.windsurf_rules_extractor import MacOSWindsurfRulesExtractor
from .macos.windsurf.mcp_config_extractor import MacOSWindsurfMCPConfigExtractor
# macOS - Roo Code
from .macos.roo_code.roo_code import MacOSRooDetector
from .macos.roo_code.mcp_config_extractor import MacOSRooMCPConfigExtractor
from .macos.roo_code.roo_code_rules_extractor import MacOSRooRulesExtractor
# Windows - Roo Code
from .windows.roo_code.roo_code import WindowsRooDetector
from .windows.roo_code.mcp_config_extractor import WindowsRooMCPConfigExtractor
from .windows.roo_code.roo_code_rules_extractor import WindowsRooRulesExtractor
# macOS - Cline
from .macos.cline.cline import MacOSClineDetector
from .macos.cline.cline_rules_extractor import MacOSClineRulesExtractor
from .macos.cline.mcp_config_extractor import MacOSClineMCPConfigExtractor
from .macos.cline.skills_extractor import MacOSClineSkillsExtractor
# macOS - Antigravity
from .macos.antigravity.antigravity import MacOSAntigravityDetector
from .macos.antigravity.antigravity_rules_extractor import MacOSAntigravityRulesExtractor
from .macos.antigravity.mcp_config_extractor import MacOSAntigravityMCPConfigExtractor
# macOS - Kilo Code
from .macos.kilocode.kilocode import MacOSKiloCodeDetector
from .macos.kilocode.kilocode_rules_extractor import MacOSKiloCodeRulesExtractor
from .macos.kilocode.mcp_config_extractor import MacOSKiloCodeMCPConfigExtractor
# macOS - Gemini CLI
from .macos.gemini_cli.gemini_cli import MacOSGeminiCliDetector
from .macos.gemini_cli.gemini_cli_rules_extractor import MacOSGeminiCliRulesExtractor
from .macos.gemini_cli.mcp_config_extractor import MacOSGeminiCliMCPConfigExtractor
# macOS - Cursor CLI
from .macos.cursor_cli.cursor_cli import MacOSCursorCliDetector
from .macos.cursor_cli.cursor_cli_rules_extractor import MacOSCursorCliRulesExtractor
from .macos.cursor_cli.settings_extractor import MacOSCursorCliSettingsExtractor
from .macos.cursor_cli.mcp_config_extractor import MacOSCursorCliMCPConfigExtractor
# macOS - Codex
from .macos.codex.codex import MacOSCodexDetector
from .macos.codex.codex_rules_extractor import MacOSCodexRulesExtractor
from .macos.codex.mcp_config_extractor import MacOSCodexMCPConfigExtractor
# macOS - Replit
from .macos.replit.replit import MacOSReplitDetector
# macOS - OpenClaw
from .macos.openclaw.detect_openclaw import MacOSOpenClawDetector
# Windows - OpenClaw
from .windows.openclaw.detect_openclaw import WindowsOpenClawDetector
# macOS - Copilot
from .macos.github_copilot.detect_copilot import MacOSCopilotDetector
from .macos.github_copilot.mcp_config_extractor import MacOSGitHubCopilotMCPConfigExtractor
from .macos.github_copilot.copilot_rules_extractor import MacOSGitHubCopilotRulesExtractor
# macOS - Copilot CLI (standalone @github/copilot agentic terminal tool)
from .macos.copilot_cli.copilot_cli import MacOSCopilotCliDetector
from .macos.copilot_cli.mcp_config_extractor import MacOSCopilotCliMCPConfigExtractor
from .macos.copilot_cli.copilot_cli_rules_extractor import MacOSCopilotCliRulesExtractor
from .macos.copilot_cli.copilot_cli_settings_extractor import MacOSCopilotCliSettingsExtractor
from .macos.copilot_cli.copilot_cli_skills_extractor import MacOSCopilotCliSkillsExtractor
# Windows - Copilot
from .windows.github_copilot.detect_copilot import WindowsGitHubCopilotDetector
from .windows.github_copilot.mcp_config_extractor import WindowsGitHubCopilotMCPConfigExtractor
from .windows.github_copilot.copilot_rules_extractor import WindowsGitHubCopilotRulesExtractor
# Windows - Copilot CLI (standalone @github/copilot agentic terminal tool)
from .windows.copilot_cli.copilot_cli import WindowsCopilotCliDetector
from .windows.copilot_cli.mcp_config_extractor import WindowsCopilotCliMCPConfigExtractor
from .windows.copilot_cli.copilot_cli_rules_extractor import WindowsCopilotCliRulesExtractor
from .windows.copilot_cli.copilot_cli_settings_extractor import WindowsCopilotCliSettingsExtractor
from .windows.copilot_cli.copilot_cli_skills_extractor import WindowsCopilotCliSkillsExtractor
# Windows - Replit
from .windows.replit.replit import WindowsReplitDetector
# Windows - Codex
from .windows.codex.codex import WindowsCodexDetector
from .windows.codex.codex_rules_extractor import WindowsCodexRulesExtractor
from .windows.codex.mcp_config_extractor import WindowsCodexMCPConfigExtractor
# macOS - OpenCode
from .macos.opencode.opencode import MacOSOpenCodeDetector
from .macos.opencode.opencode_rules_extractor import MacOSOpenCodeRulesExtractor
from .macos.opencode.mcp_config_extractor import MacOSOpenCodeMCPConfigExtractor
# macOS - JetBrains
from .macos.jetbrains.jetbrains import MacOSJetBrainsDetector
from .macos.jetbrains.mcp_config_extractor import MacOSJetBrainsMCPConfigExtractor
# macOS - Junie
from .macos.junie.junie import MacOSJunieDetector
from .macos.junie.mcp_config_extractor import MacOSJunieMCPConfigExtractor
from .macos.junie.junie_rules_extractor import MacOSJunieRulesExtractor
# Windows - Junie
from .windows.junie.junie import WindowsJunieDetector
from .windows.junie.mcp_config_extractor import WindowsJunieMCPConfigExtractor
from .windows.junie.junie_rules_extractor import WindowsJunieRulesExtractor
# Windows - JetBrains
from .windows.jetbrains.jetbrains import WindowsJetBrainsDetector
from .windows.jetbrains.mcp_config_extractor import WindowsJetBrainsMCPConfigExtractor
# Windows - OpenCode
from .windows.opencode.opencode import WindowsOpenCodeDetector
from .windows.opencode.opencode_rules_extractor import WindowsOpenCodeRulesExtractor
from .windows.opencode.mcp_config_extractor import WindowsOpenCodeMCPConfigExtractor
# Windows - Gemini CLI
from .windows.gemini_cli.gemini_cli import WindowsGeminiCliDetector
from .windows.gemini_cli.gemini_cli_rules_extractor import WindowsGeminiCliRulesExtractor
from .windows.gemini_cli.mcp_config_extractor import WindowsGeminiCliMCPConfigExtractor
# Windows - Cursor CLI
from .windows.cursor_cli.cursor_cli import WindowsCursorCliDetector
from .windows.cursor_cli.cursor_cli_rules_extractor import WindowsCursorCliRulesExtractor
from .windows.cursor_cli.settings_extractor import WindowsCursorCliSettingsExtractor
from .windows.cursor_cli.mcp_config_extractor import WindowsCursorCliMCPConfigExtractor
# Windows - Shared
from .windows import WindowsDeviceIdExtractor, WindowsCursorDetector, WindowsClaudeDetector
from .windows import WindowsClaudeCoworkDetector, WindowsClaudeCoworkSkillsExtractor
# Linux - Shared
from .linux import (
LinuxDeviceIdExtractor,
LinuxClaudeDetector,
LinuxClaudeSettingsExtractor,
LinuxClaudeSkillsExtractor,
LinuxCursorDetector,
LinuxCursorSettingsExtractor,
LinuxCursorSkillsExtractor,
LinuxWindsurfDetector,
LinuxRooDetector,
LinuxRooRulesExtractor,
LinuxRooMCPConfigExtractor,
LinuxClineDetector,
LinuxClineRulesExtractor,
LinuxClineMCPConfigExtractor,
LinuxClineSkillsExtractor,
LinuxAntigravityDetector,
LinuxAntigravityRulesExtractor,
LinuxAntigravityMCPConfigExtractor,
LinuxKiloCodeDetector,
LinuxKiloCodeRulesExtractor,
LinuxKiloCodeMCPConfigExtractor,
LinuxGeminiCliDetector,
LinuxGeminiCliRulesExtractor,
LinuxGeminiCliMCPConfigExtractor,
LinuxCursorCliDetector,
LinuxCursorCliRulesExtractor,
LinuxCursorCliMCPConfigExtractor,
LinuxCursorCliSettingsExtractor,
LinuxCopilotCliDetector,
LinuxCopilotCliMCPConfigExtractor,
LinuxCopilotCliRulesExtractor,
LinuxCopilotCliSettingsExtractor,
LinuxCopilotCliSkillsExtractor,
LinuxCodexDetector,
LinuxCodexRulesExtractor,
LinuxCodexMCPConfigExtractor,
LinuxOpenCodeDetector,
LinuxOpenCodeRulesExtractor,
LinuxOpenCodeMCPConfigExtractor,
LinuxOpenClawDetector,
LinuxReplitDetector,
LinuxJetBrainsDetector,
LinuxJetBrainsMCPConfigExtractor,
LinuxCopilotDetector,
LinuxGitHubCopilotRulesExtractor,
LinuxGitHubCopilotMCPConfigExtractor,
LinuxClaudeCoworkDetector,
LinuxClaudeCoworkSkillsExtractor,
LinuxJunieDetector,
LinuxJunieRulesExtractor,
LinuxJunieMCPConfigExtractor,
)
# Linux - Claude Code
from .linux.claude_code.claude_rules_extractor import LinuxClaudeRulesExtractor
from .linux.claude_code.mcp_config_extractor import LinuxClaudeMCPConfigExtractor
# Linux - Cursor
from .linux.cursor.cursor_rules_extractor import LinuxCursorRulesExtractor
from .linux.cursor.mcp_config_extractor import LinuxCursorMCPConfigExtractor
# Linux - Windsurf
from .linux.windsurf.windsurf_rules_extractor import LinuxWindsurfRulesExtractor
from .linux.windsurf.mcp_config_extractor import LinuxWindsurfMCPConfigExtractor
# Windows - Cursor
from .windows.cursor.cursor_rules_extractor import WindowsCursorRulesExtractor
from .windows.cursor.mcp_config_extractor import WindowsCursorMCPConfigExtractor
from .windows.cursor.settings_extractor import WindowsCursorSettingsExtractor
# Windows - Claude Code
from .windows.claude_code.claude_rules_extractor import WindowsClaudeRulesExtractor
from .windows.claude_code.mcp_config_extractor import WindowsClaudeMCPConfigExtractor
from .windows.claude_code.settings_extractor import WindowsClaudeSettingsExtractor
from .windows.claude_code.skills_extractor import WindowsClaudeSkillsExtractor
from .windows.cursor.skills_extractor import WindowsCursorSkillsExtractor
# Windows - Windsurf
from .windows.windsurf.windsurf import WindowsWindsurfDetector
from .windows.windsurf.windsurf_rules_extractor import WindowsWindsurfRulesExtractor
from .windows.windsurf.mcp_config_extractor import WindowsWindsurfMCPConfigExtractor
# Windows - Antigravity
from .windows.antigravity.antigravity import WindowsAntigravityDetector
from .windows.antigravity.antigravity_rules_extractor import WindowsAntigravityRulesExtractor
from .windows.antigravity.mcp_config_extractor import WindowsAntigravityMCPConfigExtractor
# Windows - Cline
from .windows.cline.cline import WindowsClineDetector
from .windows.cline.cline_rules_extractor import WindowsClineRulesExtractor
from .windows.cline.mcp_config_extractor import WindowsClineMCPConfigExtractor
from .windows.cline.skills_extractor import WindowsClineSkillsExtractor
# Windows - Kilo Code
from .windows.kilocode.kilocode import WindowsKiloCodeDetector
from .windows.kilocode.kilocode_rules_extractor import WindowsKiloCodeRulesExtractor
from .windows.kilocode.mcp_config_extractor import WindowsKiloCodeMCPConfigExtractor
class DeviceIdExtractorFactory:
"""Factory for creating OS-specific device ID extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseDeviceIdExtractor:
"""
Create appropriate device ID extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseDeviceIdExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSDeviceIdExtractor()
elif os_name == "Windows":
return WindowsDeviceIdExtractor()
elif os_name == "Linux":
return LinuxDeviceIdExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class ToolDetectorFactory:
"""Factory for creating OS-specific tool detectors."""
@staticmethod
def create_cursor_detector(os_name: Optional[str] = None) -> BaseToolDetector:
"""
Create appropriate Cursor detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCursorDetector()
elif os_name == "Windows":
return WindowsCursorDetector()
elif os_name == "Linux":
return LinuxCursorDetector()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
@staticmethod
def create_claude_detector(os_name: Optional[str] = None) -> BaseToolDetector:
"""
Create appropriate Claude Code detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSClaudeDetector()
elif os_name == "Windows":
return WindowsClaudeDetector()
elif os_name == "Linux":
return LinuxClaudeDetector()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
@staticmethod
def create_claude_cowork_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Claude Cowork detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSClaudeCoworkDetector()
elif os_name == "Windows":
return WindowsClaudeCoworkDetector()
elif os_name == "Linux":
return LinuxClaudeCoworkDetector()
else:
return None
@staticmethod
def create_windsurf_detector(os_name: Optional[str] = None) -> BaseToolDetector:
"""
Create appropriate Windsurf detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSWindsurfDetector()
elif os_name == "Windows":
return WindowsWindsurfDetector()
elif os_name == "Linux":
return LinuxWindsurfDetector()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
@staticmethod
def create_roo_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Roo Code detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSRooDetector()
elif os_name == "Windows":
return WindowsRooDetector()
elif os_name == "Linux":
return LinuxRooDetector()
else:
return None
@staticmethod
def create_cline_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Cline detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSClineDetector()
elif os_name == "Windows":
return WindowsClineDetector()
elif os_name == "Linux":
return LinuxClineDetector()
else:
return None
@staticmethod
def create_antigravity_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Antigravity detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSAntigravityDetector()
elif os_name == "Windows":
return WindowsAntigravityDetector()
elif os_name == "Linux":
return LinuxAntigravityDetector()
else:
return None
@staticmethod
def create_kilocode_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Kilo Code detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSKiloCodeDetector()
elif os_name == "Windows":
return WindowsKiloCodeDetector()
elif os_name == "Linux":
return LinuxKiloCodeDetector()
else:
return None
@staticmethod
def create_gemini_cli_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Gemini CLI detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSGeminiCliDetector()
elif os_name == "Windows":
return WindowsGeminiCliDetector()
elif os_name == "Linux":
return LinuxGeminiCliDetector()
else:
return None
@staticmethod
def create_cursor_cli_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Cursor CLI detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCursorCliDetector()
elif os_name == "Windows":
return WindowsCursorCliDetector()
elif os_name == "Linux":
return LinuxCursorCliDetector()
else:
return None
@staticmethod
def create_codex_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Codex detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCodexDetector()
elif os_name == "Windows":
return WindowsCodexDetector()
elif os_name == "Linux":
return LinuxCodexDetector()
else:
return None
@staticmethod
def create_replit_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Replit detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSReplitDetector()
elif os_name == "Windows":
return WindowsReplitDetector()
elif os_name == "Linux":
return LinuxReplitDetector()
else:
return None
@staticmethod
def create_opencode_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate OpenCode detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSOpenCodeDetector()
elif os_name == "Windows":
return WindowsOpenCodeDetector()
elif os_name == "Linux":
return LinuxOpenCodeDetector()
else:
return None
@staticmethod
def create_openclaw_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate OpenClaw detector for the OS.
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSOpenClawDetector()
elif os_name == "Windows":
return WindowsOpenClawDetector()
elif os_name == "Linux":
return LinuxOpenClawDetector()
else:
return None
@staticmethod
def create_copilot_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate Copilot detector for the OS.
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCopilotDetector()
elif os_name == "Windows":
return WindowsGitHubCopilotDetector()
elif os_name == "Linux":
return LinuxCopilotDetector()
else:
return None
@staticmethod
def create_copilot_cli_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate GitHub Copilot CLI detector for the OS.
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCopilotCliDetector()
elif os_name == "Windows":
return WindowsCopilotCliDetector()
elif os_name == "Linux":
return LinuxCopilotCliDetector()
else:
return None
@staticmethod
def create_jetbrains_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Create appropriate JetBrains IDEs detector for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseToolDetector instance or None if OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSJetBrainsDetector()
elif os_name == "Windows":
return WindowsJetBrainsDetector()
elif os_name == "Linux":
return LinuxJetBrainsDetector()
else:
return None
@staticmethod
def create_junie_detector(os_name: Optional[str] = None) -> Optional[BaseToolDetector]:
"""
Junie detector for the OS.
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSJunieDetector()
elif os_name == "Linux":
return LinuxJunieDetector()
elif os_name == "Windows":
return WindowsJunieDetector()
else:
return None
@staticmethod
def create_all_tool_detectors(os_name: Optional[str] = None) -> list:
"""
Create all supported tool detectors for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
List of BaseToolDetector instances (None values are filtered out)
"""
if os_name is None:
os_name = platform.system()
detectors = [
ToolDetectorFactory.create_cursor_detector(os_name),
ToolDetectorFactory.create_claude_detector(os_name),
ToolDetectorFactory.create_windsurf_detector(os_name),
ToolDetectorFactory.create_roo_detector(os_name),
]
# Add Claude Cowork detector for macOS, Windows, and Linux
claude_cowork_detector = ToolDetectorFactory.create_claude_cowork_detector(os_name)
if claude_cowork_detector is not None:
detectors.append(claude_cowork_detector)
# Add Cline detector for macOS and Windows
cline_detector = ToolDetectorFactory.create_cline_detector(os_name)
if cline_detector is not None:
detectors.append(cline_detector)
# Add Antigravity detector for both macOS and Windows
antigravity_detector = ToolDetectorFactory.create_antigravity_detector(os_name)
if antigravity_detector is not None:
detectors.append(antigravity_detector)
# Add Kilo Code detector for macOS and Windows
kilocode_detector = ToolDetectorFactory.create_kilocode_detector(os_name)
if kilocode_detector is not None:
detectors.append(kilocode_detector)
# Add Gemini CLI detector for macOS and Windows
gemini_cli_detector = ToolDetectorFactory.create_gemini_cli_detector(os_name)
if gemini_cli_detector is not None:
detectors.append(gemini_cli_detector)
# Add Cursor CLI detector for macOS and Windows
cursor_cli_detector = ToolDetectorFactory.create_cursor_cli_detector(os_name)
if cursor_cli_detector is not None:
detectors.append(cursor_cli_detector)
# Add Codex detector for macOS
codex_detector = ToolDetectorFactory.create_codex_detector(os_name)
if codex_detector is not None:
detectors.append(codex_detector)
# Add Replit detector for macOS
replit_detector = ToolDetectorFactory.create_replit_detector(os_name)
if replit_detector is not None:
detectors.append(replit_detector)
# Add OpenCode detector for macOS
opencode_detector = ToolDetectorFactory.create_opencode_detector(os_name)
if opencode_detector is not None:
detectors.append(opencode_detector)
openclaw_detector = ToolDetectorFactory.create_openclaw_detector(os_name)
if openclaw_detector is not None:
detectors.append(openclaw_detector)
copilot_detector = ToolDetectorFactory.create_copilot_detector(os_name)
if copilot_detector is not None:
detectors.append(copilot_detector)
# Add GitHub Copilot CLI detector (macOS + Windows)
copilot_cli_detector = ToolDetectorFactory.create_copilot_cli_detector(os_name)
if copilot_cli_detector is not None:
detectors.append(copilot_cli_detector)
# Add JetBrains detector for macOS
jetbrains_detector = ToolDetectorFactory.create_jetbrains_detector(os_name)
if jetbrains_detector is not None:
detectors.append(jetbrains_detector)
junie_detector = ToolDetectorFactory.create_junie_detector(os_name)
if junie_detector is not None:
detectors.append(junie_detector)
# Filter out None values
return [detector for detector in detectors if detector is not None]
class CursorRulesExtractorFactory:
"""Factory for creating OS-specific cursor rules extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseCursorRulesExtractor:
"""
Create appropriate cursor rules extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseCursorRulesExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCursorRulesExtractor()
elif os_name == "Windows":
return WindowsCursorRulesExtractor()
elif os_name == "Linux":
return LinuxCursorRulesExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class ClaudeRulesExtractorFactory:
"""Factory for creating OS-specific Claude Code rules extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseClaudeRulesExtractor:
"""
Create appropriate Claude Code rules extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseClaudeRulesExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSClaudeRulesExtractor()
elif os_name == "Windows":
return WindowsClaudeRulesExtractor()
elif os_name == "Linux":
return LinuxClaudeRulesExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class CursorMCPConfigExtractorFactory:
"""Factory for creating OS-specific Cursor MCP config extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseMCPConfigExtractor:
"""
Create appropriate Cursor MCP config extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseMCPConfigExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCursorMCPConfigExtractor()
elif os_name == "Windows":
return WindowsCursorMCPConfigExtractor()
elif os_name == "Linux":
return LinuxCursorMCPConfigExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class ClaudeMCPConfigExtractorFactory:
"""Factory for creating OS-specific Claude Code MCP config extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseMCPConfigExtractor:
"""
Create appropriate Claude Code MCP config extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseMCPConfigExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSClaudeMCPConfigExtractor()
elif os_name == "Windows":
return WindowsClaudeMCPConfigExtractor()
elif os_name == "Linux":
return LinuxClaudeMCPConfigExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class ClaudeSettingsExtractorFactory:
"""Factory for creating OS-specific Claude Code settings extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseClaudeSettingsExtractor:
"""
Create appropriate Claude Code settings extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseClaudeSettingsExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSClaudeSettingsExtractor()
elif os_name == "Windows":
return WindowsClaudeSettingsExtractor()
elif os_name == "Linux":
return LinuxClaudeSettingsExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class CursorSettingsExtractorFactory:
"""Factory for creating OS-specific Cursor IDE settings extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseCursorSettingsExtractor:
"""
Create appropriate Cursor IDE settings extractor for the OS.
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":
return MacOSCursorSettingsExtractor()
elif os_name == "Windows":
return WindowsCursorSettingsExtractor()
elif os_name == "Linux":
return LinuxCursorSettingsExtractor()
else:
raise ValueError(f"Unsupported operating system: {os_name}")
class WindsurfRulesExtractorFactory:
"""Factory for creating OS-specific Windsurf rules extractors."""
@staticmethod
def create(os_name: Optional[str] = None) -> BaseWindsurfRulesExtractor:
"""
Create appropriate Windsurf rules extractor for the OS.
Args:
os_name: Operating system name (defaults to current OS)
Returns:
BaseWindsurfRulesExtractor instance
Raises:
ValueError: If OS is not supported
"""
if os_name is None:
os_name = platform.system()
if os_name == "Darwin":