adhdev 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/cli-entrypoint.js +7216 -5706
  2. package/dist/cli-entrypoint.js.map +1 -1
  3. package/dist/index.js +7199 -5688
  4. package/dist/index.js.map +1 -1
  5. package/package.json +2 -2
  6. package/providers/_builtin/COMPATIBILITY.md +0 -217
  7. package/providers/_builtin/CONTRIBUTING.md +0 -141
  8. package/providers/_builtin/README.md +0 -51
  9. package/providers/_builtin/_helpers/index.js +0 -188
  10. package/providers/_builtin/acp/agentpool/provider.json +0 -54
  11. package/providers/_builtin/acp/amp/provider.json +0 -52
  12. package/providers/_builtin/acp/auggie/provider.json +0 -57
  13. package/providers/_builtin/acp/autodev/provider.json +0 -54
  14. package/providers/_builtin/acp/autohand/provider.json +0 -52
  15. package/providers/_builtin/acp/blackbox-ai/provider.json +0 -54
  16. package/providers/_builtin/acp/claude-agent/provider.json +0 -57
  17. package/providers/_builtin/acp/cline-acp/provider.json +0 -54
  18. package/providers/_builtin/acp/codebuddy/provider.json +0 -54
  19. package/providers/_builtin/acp/codex-cli/provider.json +0 -57
  20. package/providers/_builtin/acp/corust-agent/provider.json +0 -52
  21. package/providers/_builtin/acp/crow-cli/provider.json +0 -54
  22. package/providers/_builtin/acp/cursor-acp/provider.json +0 -54
  23. package/providers/_builtin/acp/deepagents/provider.json +0 -52
  24. package/providers/_builtin/acp/dimcode/provider.json +0 -54
  25. package/providers/_builtin/acp/docker-cagent/provider.json +0 -57
  26. package/providers/_builtin/acp/factory-droid/provider.json +0 -60
  27. package/providers/_builtin/acp/fast-agent/provider.json +0 -52
  28. package/providers/_builtin/acp/gemini-cli/provider.json +0 -114
  29. package/providers/_builtin/acp/github-copilot/provider.json +0 -54
  30. package/providers/_builtin/acp/goose/provider.json +0 -57
  31. package/providers/_builtin/acp/junie/provider.json +0 -52
  32. package/providers/_builtin/acp/kilo/provider.json +0 -54
  33. package/providers/_builtin/acp/kimi-cli/provider.json +0 -57
  34. package/providers/_builtin/acp/minion-code/provider.json +0 -52
  35. package/providers/_builtin/acp/mistral-vibe/provider.json +0 -57
  36. package/providers/_builtin/acp/nova/provider.json +0 -54
  37. package/providers/_builtin/acp/openclaw/provider.json +0 -54
  38. package/providers/_builtin/acp/opencode/provider.json +0 -52
  39. package/providers/_builtin/acp/openhands/provider.json +0 -54
  40. package/providers/_builtin/acp/pi-acp/provider.json +0 -52
  41. package/providers/_builtin/acp/qoder/provider.json +0 -54
  42. package/providers/_builtin/acp/qwen-code/provider.json +0 -60
  43. package/providers/_builtin/acp/stakpak/provider.json +0 -54
  44. package/providers/_builtin/acp/vtcode/provider.json +0 -54
  45. package/providers/_builtin/cli/claude-cli/provider.json +0 -100
  46. package/providers/_builtin/cli/codex-cli/provider.json +0 -89
  47. package/providers/_builtin/cli/gemini-cli/provider.json +0 -93
  48. package/providers/_builtin/docs/CDP_SELECTOR_GUIDE.md +0 -370
  49. package/providers/_builtin/docs/PROVIDER_GUIDE.md +0 -916
  50. package/providers/_builtin/extension/cline/provider.json +0 -35
  51. package/providers/_builtin/extension/cline/scripts/focus_editor.js +0 -48
  52. package/providers/_builtin/extension/cline/scripts/list_chats.js +0 -100
  53. package/providers/_builtin/extension/cline/scripts/list_models.js +0 -43
  54. package/providers/_builtin/extension/cline/scripts/list_modes.js +0 -35
  55. package/providers/_builtin/extension/cline/scripts/new_session.js +0 -85
  56. package/providers/_builtin/extension/cline/scripts/open_panel.js +0 -25
  57. package/providers/_builtin/extension/cline/scripts/read_chat.js +0 -257
  58. package/providers/_builtin/extension/cline/scripts/resolve_action.js +0 -83
  59. package/providers/_builtin/extension/cline/scripts/send_message.js +0 -95
  60. package/providers/_builtin/extension/cline/scripts/set_mode.js +0 -36
  61. package/providers/_builtin/extension/cline/scripts/set_model.js +0 -36
  62. package/providers/_builtin/extension/cline/scripts/switch_session.js +0 -206
  63. package/providers/_builtin/extension/cline/scripts.js +0 -73
  64. package/providers/_builtin/extension/roo-code/provider.json +0 -35
  65. package/providers/_builtin/extension/roo-code/scripts.js +0 -659
  66. package/providers/_builtin/ide/antigravity/provider.json +0 -63
  67. package/providers/_builtin/ide/antigravity/scripts/focus_editor.js +0 -20
  68. package/providers/_builtin/ide/antigravity/scripts/legacy/list_models.js +0 -38
  69. package/providers/_builtin/ide/antigravity/scripts/legacy/list_modes.js +0 -48
  70. package/providers/_builtin/ide/antigravity/scripts/legacy/scripts.js +0 -64
  71. package/providers/_builtin/ide/antigravity/scripts/legacy/set_mode.js +0 -34
  72. package/providers/_builtin/ide/antigravity/scripts/legacy/set_model.js +0 -47
  73. package/providers/_builtin/ide/antigravity/scripts/list_chats.js +0 -137
  74. package/providers/_builtin/ide/antigravity/scripts/list_models.js +0 -61
  75. package/providers/_builtin/ide/antigravity/scripts/list_modes.js +0 -72
  76. package/providers/_builtin/ide/antigravity/scripts/new_session.js +0 -75
  77. package/providers/_builtin/ide/antigravity/scripts/read_chat.js +0 -262
  78. package/providers/_builtin/ide/antigravity/scripts/resolve_action.js +0 -68
  79. package/providers/_builtin/ide/antigravity/scripts/send_message.js +0 -56
  80. package/providers/_builtin/ide/antigravity/scripts/set_mode.js +0 -67
  81. package/providers/_builtin/ide/antigravity/scripts/set_model.js +0 -72
  82. package/providers/_builtin/ide/antigravity/scripts/switch_session.js +0 -114
  83. package/providers/_builtin/ide/antigravity/scripts.js +0 -67
  84. package/providers/_builtin/ide/cursor/provider.json +0 -59
  85. package/providers/_builtin/ide/cursor/scripts.js +0 -458
  86. package/providers/_builtin/ide/kiro/provider.json +0 -60
  87. package/providers/_builtin/ide/kiro/scripts/focus_editor.js +0 -20
  88. package/providers/_builtin/ide/kiro/scripts/open_panel.js +0 -47
  89. package/providers/_builtin/ide/kiro/scripts/resolve_action.js +0 -54
  90. package/providers/_builtin/ide/kiro/scripts/send_message.js +0 -29
  91. package/providers/_builtin/ide/kiro/scripts/webview_list_models.js +0 -39
  92. package/providers/_builtin/ide/kiro/scripts/webview_list_modes.js +0 -39
  93. package/providers/_builtin/ide/kiro/scripts/webview_list_sessions.js +0 -21
  94. package/providers/_builtin/ide/kiro/scripts/webview_new_session.js +0 -34
  95. package/providers/_builtin/ide/kiro/scripts/webview_read_chat.js +0 -68
  96. package/providers/_builtin/ide/kiro/scripts/webview_send_message.js +0 -72
  97. package/providers/_builtin/ide/kiro/scripts/webview_set_mode.js +0 -15
  98. package/providers/_builtin/ide/kiro/scripts/webview_set_model.js +0 -15
  99. package/providers/_builtin/ide/kiro/scripts/webview_switch_session.js +0 -26
  100. package/providers/_builtin/ide/kiro/scripts.js +0 -62
  101. package/providers/_builtin/ide/pearai/provider.json +0 -60
  102. package/providers/_builtin/ide/pearai/scripts/focus_editor.js +0 -20
  103. package/providers/_builtin/ide/pearai/scripts/list_sessions.js +0 -38
  104. package/providers/_builtin/ide/pearai/scripts/new_session.js +0 -55
  105. package/providers/_builtin/ide/pearai/scripts/open_panel.js +0 -46
  106. package/providers/_builtin/ide/pearai/scripts/resolve_action.js +0 -54
  107. package/providers/_builtin/ide/pearai/scripts/send_message.js +0 -29
  108. package/providers/_builtin/ide/pearai/scripts/webview_list_models.js +0 -43
  109. package/providers/_builtin/ide/pearai/scripts/webview_list_modes.js +0 -35
  110. package/providers/_builtin/ide/pearai/scripts/webview_list_sessions.js +0 -62
  111. package/providers/_builtin/ide/pearai/scripts/webview_new_session.js +0 -49
  112. package/providers/_builtin/ide/pearai/scripts/webview_read_chat.js +0 -92
  113. package/providers/_builtin/ide/pearai/scripts/webview_resolve_action.js +0 -59
  114. package/providers/_builtin/ide/pearai/scripts/webview_send_message.js +0 -72
  115. package/providers/_builtin/ide/pearai/scripts/webview_set_mode.js +0 -36
  116. package/providers/_builtin/ide/pearai/scripts/webview_set_model.js +0 -36
  117. package/providers/_builtin/ide/pearai/scripts/webview_switch_session.js +0 -34
  118. package/providers/_builtin/ide/pearai/scripts.js +0 -74
  119. package/providers/_builtin/ide/trae/provider.json +0 -59
  120. package/providers/_builtin/ide/trae/scripts/focus_editor.js +0 -20
  121. package/providers/_builtin/ide/trae/scripts/list_chats.js +0 -24
  122. package/providers/_builtin/ide/trae/scripts/list_models.js +0 -39
  123. package/providers/_builtin/ide/trae/scripts/list_modes.js +0 -39
  124. package/providers/_builtin/ide/trae/scripts/new_session.js +0 -30
  125. package/providers/_builtin/ide/trae/scripts/open_panel.js +0 -44
  126. package/providers/_builtin/ide/trae/scripts/read_chat.js +0 -113
  127. package/providers/_builtin/ide/trae/scripts/resolve_action.js +0 -54
  128. package/providers/_builtin/ide/trae/scripts/send_message.js +0 -69
  129. package/providers/_builtin/ide/trae/scripts/set_mode.js +0 -15
  130. package/providers/_builtin/ide/trae/scripts/set_model.js +0 -15
  131. package/providers/_builtin/ide/trae/scripts/switch_session.js +0 -23
  132. package/providers/_builtin/ide/trae/scripts.js +0 -57
  133. package/providers/_builtin/ide/vscode/provider.json +0 -57
  134. package/providers/_builtin/ide/vscode-insiders/provider.json +0 -55
  135. package/providers/_builtin/ide/vscodium/provider.json +0 -56
  136. package/providers/_builtin/ide/windsurf/provider.json +0 -46
  137. package/providers/_builtin/ide/windsurf/scripts/focus_editor.js +0 -30
  138. package/providers/_builtin/ide/windsurf/scripts/list_chats.js +0 -117
  139. package/providers/_builtin/ide/windsurf/scripts/list_models.js +0 -39
  140. package/providers/_builtin/ide/windsurf/scripts/list_modes.js +0 -39
  141. package/providers/_builtin/ide/windsurf/scripts/new_session.js +0 -69
  142. package/providers/_builtin/ide/windsurf/scripts/open_panel.js +0 -58
  143. package/providers/_builtin/ide/windsurf/scripts/read_chat.js +0 -297
  144. package/providers/_builtin/ide/windsurf/scripts/resolve_action.js +0 -68
  145. package/providers/_builtin/ide/windsurf/scripts/send_message.js +0 -87
  146. package/providers/_builtin/ide/windsurf/scripts/set_mode.js +0 -15
  147. package/providers/_builtin/ide/windsurf/scripts/set_model.js +0 -15
  148. package/providers/_builtin/ide/windsurf/scripts/switch_session.js +0 -58
  149. package/providers/_builtin/ide/windsurf/scripts.js +0 -57
  150. package/providers/_builtin/validate.js +0 -156
@@ -1,15 +0,0 @@
1
- /**
2
- * Generic fallback — set_model
3
- * ${ MODEL }
4
- */
5
- (() => {
6
- try {
7
- const want = ${ MODEL } || '';
8
- const norm = (t) => t.toLowerCase().trim();
9
-
10
- // Very basic click attempt
11
- return JSON.stringify({ success: false, error: 'Model selection requires UI interaction not supported by generic script' });
12
- } catch (e) {
13
- return JSON.stringify({ success: false, error: e.message });
14
- }
15
- })()
@@ -1,23 +0,0 @@
1
- /**
2
- * Trae — switch_session
3
- *
4
- * Trae 세션 탭 전환.
5
- * 파라미터: ${ SESSION_ID }
6
- */
7
- (() => {
8
- try {
9
- const targetId = ${ SESSION_ID };
10
- const tabs = document.querySelectorAll('.chat-tab-header, [class*="tab-item"], [class*="TabItem"]');
11
- const idx = parseInt(targetId, 10);
12
-
13
- if (isNaN(idx) || idx < 0 || idx >= tabs.length) {
14
- return JSON.stringify({ switched: false, error: `invalid index: ${targetId}` });
15
- }
16
-
17
- tabs[idx].click();
18
- const title = (tabs[idx].textContent || '').replace('✕', '').trim();
19
- return JSON.stringify({ switched: true, title });
20
- } catch (e) {
21
- return JSON.stringify({ switched: false, error: e.message });
22
- }
23
- })()
@@ -1,57 +0,0 @@
1
- /**
2
- * CDP Scripts for Trae
3
- */
4
-
5
- const fs = require('fs');
6
- const path = require('path');
7
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
8
- function loadScript(name) {
9
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
10
- catch { return null; }
11
- }
12
-
13
-
14
- module.exports.readChat = function readChat() { return loadScript('read_chat.js'); };
15
-
16
- module.exports.sendMessage = function sendMessage(text) {
17
- const s = loadScript('send_message.js');
18
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
19
- };
20
-
21
- module.exports.resolveAction = function resolveAction(params) {
22
- const action = typeof params === 'string' ? params : params?.action || 'approve';
23
- const buttonText = params?.button || params?.buttonText
24
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
25
- const s = loadScript('resolve_action.js');
26
- return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
27
- };
28
-
29
- module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
30
-
31
- module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
32
-
33
- module.exports.newSession = function newSession() { return loadScript('new_session.js'); };
34
-
35
- module.exports.listSessions = function listSessions() { return loadScript('list_chats.js'); };
36
-
37
- module.exports.switchSession = function switchSession(sessionId) {
38
- const s = loadScript('switch_session.js');
39
- return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
40
- };
41
-
42
- module.exports.listModels = function listModels() { return loadScript('list_models.js'); };
43
-
44
- module.exports.setModel = function setModel(params) {
45
- const model = typeof params === 'string' ? params : params?.model;
46
- const s = loadScript('set_model.js');
47
- return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
48
- };
49
-
50
- module.exports.listModes = function listModes() { return loadScript('list_modes.js'); };
51
-
52
- module.exports.setMode = function setMode(params) {
53
- const mode = typeof params === 'string' ? params : params?.mode;
54
- const s = loadScript('set_mode.js');
55
- return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
56
- };
57
-
@@ -1,57 +0,0 @@
1
- {
2
- "type": "vscode",
3
- "name": "Visual Studio Code",
4
- "category": "ide",
5
- "displayName": "VS Code",
6
- "icon": "💙",
7
- "cli": "code",
8
- "cdpPorts": [
9
- 9339,
10
- 9340
11
- ],
12
- "processNames": {
13
- "darwin": "Visual Studio Code",
14
- "win32": [
15
- "Code.exe"
16
- ]
17
- },
18
- "paths": {
19
- "darwin": [
20
- "/Applications/Visual Studio Code.app"
21
- ],
22
- "win32": [
23
- "C:\\Program Files\\Microsoft VS Code\\Code.exe",
24
- "C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
25
- ],
26
- "linux": [
27
- "/usr/share/code",
28
- "/snap/code/current"
29
- ]
30
- },
31
- "inputMethod": "cdp-type-and-send",
32
- "inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
33
- "settings": {
34
- "approvalAlert": {
35
- "type": "boolean",
36
- "default": true,
37
- "public": true,
38
- "label": "Approval Notifications",
39
- "description": "Show notification when approval is needed"
40
- },
41
- "longGeneratingAlert": {
42
- "type": "boolean",
43
- "default": true,
44
- "public": true,
45
- "label": "Long Generation Alert",
46
- "description": "Alert when generation takes too long"
47
- },
48
- "longGeneratingThresholdSec": {
49
- "type": "number",
50
- "default": 180,
51
- "public": true,
52
- "label": "Long Generation Threshold (sec)",
53
- "min": 30,
54
- "max": 600
55
- }
56
- }
57
- }
@@ -1,55 +0,0 @@
1
- {
2
- "type": "vscode-insiders",
3
- "name": "Visual Studio Code - Insiders",
4
- "category": "ide",
5
- "displayName": "VS Code Insiders",
6
- "icon": "💚",
7
- "cli": "code-insiders",
8
- "cdpPorts": [
9
- 9341,
10
- 9342
11
- ],
12
- "processNames": {
13
- "darwin": "Visual Studio Code - Insiders",
14
- "win32": [
15
- "Code - Insiders.exe"
16
- ]
17
- },
18
- "paths": {
19
- "darwin": [
20
- "/Applications/Visual Studio Code - Insiders.app"
21
- ],
22
- "win32": [
23
- "C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe"
24
- ],
25
- "linux": [
26
- "/usr/share/code-insiders"
27
- ]
28
- },
29
- "inputMethod": "cdp-type-and-send",
30
- "inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
31
- "settings": {
32
- "approvalAlert": {
33
- "type": "boolean",
34
- "default": true,
35
- "public": true,
36
- "label": "Approval Notifications",
37
- "description": "Show notification when approval is needed"
38
- },
39
- "longGeneratingAlert": {
40
- "type": "boolean",
41
- "default": true,
42
- "public": true,
43
- "label": "Long Generation Alert",
44
- "description": "Alert when generation takes too long"
45
- },
46
- "longGeneratingThresholdSec": {
47
- "type": "number",
48
- "default": 180,
49
- "public": true,
50
- "label": "Long Generation Threshold (sec)",
51
- "min": 30,
52
- "max": 600
53
- }
54
- }
55
- }
@@ -1,56 +0,0 @@
1
- {
2
- "type": "vscodium",
3
- "name": "VSCodium",
4
- "category": "ide",
5
- "displayName": "VSCodium",
6
- "icon": "💚",
7
- "cli": "codium",
8
- "cdpPorts": [
9
- 9343,
10
- 9344
11
- ],
12
- "processNames": {
13
- "darwin": "VSCodium",
14
- "win32": [
15
- "VSCodium.exe"
16
- ]
17
- },
18
- "paths": {
19
- "darwin": [
20
- "/Applications/VSCodium.app"
21
- ],
22
- "win32": [
23
- "C:\\Program Files\\VSCodium\\VSCodium.exe"
24
- ],
25
- "linux": [
26
- "/usr/share/codium",
27
- "/snap/codium/current"
28
- ]
29
- },
30
- "inputMethod": "cdp-type-and-send",
31
- "inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
32
- "settings": {
33
- "approvalAlert": {
34
- "type": "boolean",
35
- "default": true,
36
- "public": true,
37
- "label": "Approval Notifications",
38
- "description": "Show notification when approval is needed"
39
- },
40
- "longGeneratingAlert": {
41
- "type": "boolean",
42
- "default": true,
43
- "public": true,
44
- "label": "Long Generation Alert",
45
- "description": "Alert when generation takes too long"
46
- },
47
- "longGeneratingThresholdSec": {
48
- "type": "number",
49
- "default": 180,
50
- "public": true,
51
- "label": "Long Generation Threshold (sec)",
52
- "min": 30,
53
- "max": 600
54
- }
55
- }
56
- }
@@ -1,46 +0,0 @@
1
- {
2
- "type": "windsurf",
3
- "name": "Windsurf",
4
- "category": "ide",
5
- "displayName": "Windsurf",
6
- "icon": "🏄",
7
- "cli": "windsurf",
8
- "cdpPorts": [
9
- 9337,
10
- 9338
11
- ],
12
- "processNames": {
13
- "darwin": "Windsurf"
14
- },
15
- "paths": {
16
- "darwin": [
17
- "/Applications/Windsurf.app"
18
- ]
19
- },
20
- "inputMethod": "cdp-type-and-send",
21
- "inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
22
- "settings": {
23
- "approvalAlert": {
24
- "type": "boolean",
25
- "default": true,
26
- "public": true,
27
- "label": "Approval Notifications",
28
- "description": "Show notification when approval is needed"
29
- },
30
- "longGeneratingAlert": {
31
- "type": "boolean",
32
- "default": true,
33
- "public": true,
34
- "label": "Long Generation Alert",
35
- "description": "Alert when generation takes too long"
36
- },
37
- "longGeneratingThresholdSec": {
38
- "type": "number",
39
- "default": 180,
40
- "public": true,
41
- "label": "Long Generation Threshold (sec)",
42
- "min": 30,
43
- "max": 600
44
- }
45
- }
46
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * Windsurf v1 — focus_editor
3
- *
4
- * Cascade(채팅) 입력창에 포커스를 맞춥니다.
5
- * Windsurf는 VS Code 포크로, 채팅 UI를 "Cascade"라고 부릅니다.
6
- *
7
- * DOM 구조:
8
- * #windsurf.cascadePanel → .chat-client-root
9
- * 입력: [contenteditable="true"][role="textbox"]
10
- * 또는 textarea (미로그인)
11
- *
12
- * 최종 확인: Windsurf (2026-03-06)
13
- */
14
- (() => {
15
- try {
16
- const editor =
17
- document.querySelector('[contenteditable="true"][role="textbox"]') ||
18
- document.querySelector('[data-lexical-editor="true"]') ||
19
- document.querySelector('.chat-input textarea') ||
20
- document.querySelector('.cascade-input [contenteditable="true"]') ||
21
- document.querySelector('textarea:not(.xterm-helper-textarea)');
22
- if (editor) {
23
- editor.focus();
24
- return true;
25
- }
26
- return false;
27
- } catch (e) {
28
- return false;
29
- }
30
- })()
@@ -1,117 +0,0 @@
1
- /**
2
- * Windsurf v1 — list_chats
3
- *
4
- * Cascade 탭 목록을 가져옵니다.
5
- * 패널이 닫혀 있으면 먼저 열고 탭이 렌더링될 때까지 대기합니다.
6
- * cascade-tab-{uuid} 요소들의 React Fiber에서 제목을 추출합니다.
7
- *
8
- * 최종 확인: Windsurf 1.108.x (2026-03-10)
9
- */
10
- (async () => {
11
- try {
12
- // ─── 1. 패널이 닫혀 있으면 열기 ───
13
- let tabs = document.querySelectorAll('[id^="cascade-tab-"]');
14
- if (tabs.length === 0) {
15
- // Cascade 패널 보이는지 확인
16
- const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
17
- document.querySelector('.chat-client-root');
18
- const sidebar = document.getElementById('workbench.parts.auxiliarybar');
19
- const panelVisible = (cascade && cascade.offsetWidth > 0) ||
20
- (sidebar && sidebar.offsetWidth > 0 && cascade);
21
-
22
- if (!panelVisible) {
23
- // Toggle 버튼 클릭 시도
24
- const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
25
- let toggled = false;
26
- for (const btn of toggleBtns) {
27
- const label = (btn.getAttribute('aria-label') || '').toLowerCase();
28
- if (label.includes('toggle cascade') || label.includes('toggle secondary') ||
29
- label.includes('toggle auxiliary') || label.includes('cascade')) {
30
- if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
31
- btn.click();
32
- toggled = true;
33
- break;
34
- }
35
- }
36
- }
37
- // 버튼 없으면 Cmd+L
38
- if (!toggled) {
39
- document.dispatchEvent(new KeyboardEvent('keydown', {
40
- key: 'l', code: 'KeyL', keyCode: 76,
41
- metaKey: true, ctrlKey: false,
42
- bubbles: true, cancelable: true,
43
- }));
44
- document.dispatchEvent(new KeyboardEvent('keyup', {
45
- key: 'l', code: 'KeyL', keyCode: 76,
46
- metaKey: true, ctrlKey: false,
47
- bubbles: true, cancelable: true,
48
- }));
49
- }
50
-
51
- // 패널 렌더링 대기 (최대 3초)
52
- for (let i = 0; i < 30; i++) {
53
- await new Promise(r => setTimeout(r, 100));
54
- tabs = document.querySelectorAll('[id^="cascade-tab-"]');
55
- if (tabs.length > 0) break;
56
- }
57
- }
58
- }
59
-
60
- // ─── 2. 탭 정보 수집 ───
61
- tabs = document.querySelectorAll('[id^="cascade-tab-"]');
62
- if (tabs.length === 0) return [];
63
-
64
- const result = [];
65
- const seen = new Set();
66
-
67
- tabs.forEach(tab => {
68
- const tabId = tab.id.replace('cascade-tab-', '');
69
- if (seen.has(tabId)) return;
70
- seen.add(tabId);
71
-
72
- let title = '';
73
- let cascadeId = tabId;
74
- let status = 'completed';
75
-
76
- // React Fiber에서 제목 추출
77
- const fk = Object.keys(tab).find(k => k.startsWith('__reactFiber'));
78
- if (fk) {
79
- let fiber = tab[fk];
80
- for (let d = 0; d < 30 && fiber; d++) {
81
- const p = fiber.memoizedProps;
82
- if (p) {
83
- if (p.title && typeof p.title === 'string') {
84
- title = p.title;
85
- }
86
- if (p.cascadeId) {
87
- cascadeId = p.cascadeId;
88
- }
89
- if (p.status && typeof p.status === 'string') {
90
- status = p.status;
91
- }
92
- if (title) break;
93
- }
94
- fiber = fiber.return;
95
- }
96
- }
97
-
98
- // DOM 폴백
99
- if (!title) {
100
- title = tab.textContent?.trim().substring(0, 100) || ('Chat ' + (result.length + 1));
101
- }
102
-
103
- const isVisible = tab.offsetHeight > 0 && tab.offsetWidth > 0;
104
-
105
- result.push({
106
- id: tabId,
107
- title: title.substring(0, 100),
108
- status: status,
109
- active: isVisible
110
- });
111
- });
112
-
113
- return result;
114
- } catch (e) {
115
- return [];
116
- }
117
- })()
@@ -1,39 +0,0 @@
1
- /**
2
- * Generic fallback — list_models
3
- */
4
- (() => {
5
- try {
6
- const models = [];
7
- let current = '';
8
-
9
- // Try generic Model string from select/button
10
- const sel = document.querySelectorAll('select, [class*="model"], [id*="model"]');
11
- for (const el of sel) {
12
- const txt = (el.textContent || '').trim();
13
- if (txt && /claude|gpt|gemini|sonnet|opus/i.test(txt)) {
14
- if (txt.length < 50) {
15
- models.push(txt);
16
- if (!current) current = txt;
17
- }
18
- }
19
- }
20
-
21
- if (models.length === 0) {
22
- const btns = document.querySelectorAll('button');
23
- for (const b of btns) {
24
- const txt = (b.textContent || '').trim();
25
- if (txt && /claude|gpt|gemini|sonnet/i.test(txt) && txt.length < 30) {
26
- models.push(txt);
27
- current = txt;
28
- }
29
- }
30
- }
31
-
32
- return JSON.stringify({
33
- models: [...new Set(models)],
34
- current: current || 'Default'
35
- });
36
- } catch (e) {
37
- return JSON.stringify({ models: [], current: '', error: e.message });
38
- }
39
- })()
@@ -1,39 +0,0 @@
1
- /**
2
- * Generic fallback — list_models
3
- */
4
- (() => {
5
- try {
6
- const models = [];
7
- let current = '';
8
-
9
- // Try generic Model string from select/button
10
- const sel = document.querySelectorAll('select, [class*="model"], [id*="model"]');
11
- for (const el of sel) {
12
- const txt = (el.textContent || '').trim();
13
- if (txt && /claude|gpt|gemini|sonnet|opus/i.test(txt)) {
14
- if (txt.length < 50) {
15
- models.push(txt);
16
- if (!current) current = txt;
17
- }
18
- }
19
- }
20
-
21
- if (models.length === 0) {
22
- const btns = document.querySelectorAll('button');
23
- for (const b of btns) {
24
- const txt = (b.textContent || '').trim();
25
- if (txt && /claude|gpt|gemini|sonnet/i.test(txt) && txt.length < 30) {
26
- models.push(txt);
27
- current = txt;
28
- }
29
- }
30
- }
31
-
32
- return JSON.stringify({
33
- models: [...new Set(models)],
34
- current: current || 'Default'
35
- });
36
- } catch (e) {
37
- return JSON.stringify({ models: [], current: '', error: e.message });
38
- }
39
- })()
@@ -1,69 +0,0 @@
1
- /**
2
- * Windsurf v1 — new_session
3
- *
4
- * 새 Cascade 세션을 시작합니다.
5
- *
6
- * 전략:
7
- * 1. aria-label 기반 "New" 버튼 탐색
8
- * 2. 텍스트 기반 버튼 탐색
9
- * 3. Codicon 아이콘(+) 기반 탐색
10
- * 4. Cmd+L 단축키 폴백 (Windsurf에서 새 Cascade 열기)
11
- *
12
- * Windsurf에서는 Cascade가 AI 채팅 패널이며,
13
- * "New Chat" 또는 "+" 버튼으로 새 세션을 시작합니다.
14
- *
15
- * 최종 확인: Windsurf 1.108.x (2026-03-10)
16
- */
17
- (() => {
18
- try {
19
- // ─── 1. aria-label 기반 ───
20
- const allBtns = Array.from(document.querySelectorAll('button, [role="button"], .action-item'))
21
- .filter(b => b.offsetWidth > 0);
22
-
23
- for (const btn of allBtns) {
24
- const label = (btn.getAttribute('aria-label') || '').toLowerCase();
25
- if (label.includes('new chat') || label.includes('new cascade') ||
26
- label.includes('new conversation') || label.includes('start new') ||
27
- label.includes('new session')) {
28
- btn.click();
29
- return 'clicked (aria)';
30
- }
31
- }
32
-
33
- // ─── 2. 텍스트 기반 ───
34
- for (const btn of allBtns) {
35
- const text = (btn.textContent || '').trim();
36
- if (text === '+' || text === 'New Chat' || text === 'New Cascade' ||
37
- text === 'Start New Chat' || text === 'New Session') {
38
- btn.click();
39
- return 'clicked (text)';
40
- }
41
- }
42
-
43
- // ─── 3. Codicon 아이콘(+) 기반 ───
44
- for (const btn of allBtns) {
45
- const hasPlus = btn.querySelector('.codicon-plus, .codicon-add, [class*="plus"]');
46
- if (hasPlus) {
47
- const label = (btn.getAttribute('aria-label') || btn.getAttribute('title') || '').toLowerCase();
48
- // Cascade 관련 컨텍스트이거나 라벨이 비어있으면 새 세션 버튼일 가능성
49
- if (label.includes('chat') || label.includes('cascade') ||
50
- label.includes('new') || label === '') {
51
- btn.click();
52
- return 'clicked (icon)';
53
- }
54
- }
55
- }
56
-
57
- // ─── 4. Cmd+L 단축키 (macOS: metaKey, Windows/Linux: ctrlKey) ───
58
- // Windsurf에서 Cmd+L은 Cascade 패널 토글/새 세션 생성
59
- document.dispatchEvent(new KeyboardEvent('keydown', {
60
- key: 'l', code: 'KeyL', keyCode: 76,
61
- metaKey: true, ctrlKey: false,
62
- bubbles: true, cancelable: true,
63
- }));
64
-
65
- return 'sent Cmd+L';
66
- } catch (e) {
67
- return 'error: ' + e.message;
68
- }
69
- })()
@@ -1,58 +0,0 @@
1
- /**
2
- * Windsurf v1 — open_panel
3
- *
4
- * Cascade(AI 채팅) 패널이 닫혀 있을 때 열기.
5
- *
6
- * Windsurf의 Cascade 패널은 Secondary Side Bar (#workbench.parts.auxiliarybar)에 위치.
7
- * 닫혀 있으면 offsetWidth === 0.
8
- * Cmd+L 단축키로 열 수 있음 (WINDSURF.md §2.5).
9
- *
10
- * 반환: 'visible' | 'opened' | 'error: ...'
11
- * 최종 확인: Windsurf 1.108.x (2026-03-10)
12
- */
13
- (() => {
14
- try {
15
- // ─── 1. Cascade 패널이 이미 열려 있는지 확인 ───
16
- const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
17
- document.querySelector('.chat-client-root');
18
- const sidebar = document.getElementById('workbench.parts.auxiliarybar');
19
-
20
- // 패널이 존재하고 보이면 이미 열린 상태
21
- if (cascade && cascade.offsetWidth > 0 && cascade.offsetHeight > 0) {
22
- return 'visible';
23
- }
24
- if (sidebar && sidebar.offsetWidth > 0 && sidebar.offsetHeight > 0 && cascade) {
25
- return 'visible';
26
- }
27
-
28
- // ─── 2. Toggle 버튼 클릭 시도 ───
29
- const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
30
- for (const btn of toggleBtns) {
31
- const label = (btn.getAttribute('aria-label') || '').toLowerCase();
32
- if (label.includes('toggle cascade') || label.includes('toggle secondary') ||
33
- label.includes('toggle auxiliary') || label.includes('cascade')) {
34
- if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
35
- btn.click();
36
- return 'opened (toggle)';
37
- }
38
- }
39
- }
40
-
41
- // ─── 3. Cmd+L 단축키 폴백 (Windsurf 공식 단축키) ───
42
- // keyCode: 76, modifiers: 4 (Meta/Cmd)
43
- document.dispatchEvent(new KeyboardEvent('keydown', {
44
- key: 'l', code: 'KeyL', keyCode: 76,
45
- metaKey: true, ctrlKey: false,
46
- bubbles: true, cancelable: true,
47
- }));
48
- document.dispatchEvent(new KeyboardEvent('keyup', {
49
- key: 'l', code: 'KeyL', keyCode: 76,
50
- metaKey: true, ctrlKey: false,
51
- bubbles: true, cancelable: true,
52
- }));
53
-
54
- return 'opened (Cmd+L)';
55
- } catch (e) {
56
- return 'error: ' + e.message;
57
- }
58
- })()