@adhdev/daemon-core 0.6.58 → 0.6.59

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 (245) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +87 -89
  3. package/dist/index.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/detection/ide-detector.ts +1 -1
  6. package/src/providers/provider-loader.ts +3 -6
  7. package/providers/_builtin/.github/workflows/generate-registry.yml +0 -76
  8. package/providers/_builtin/COMPATIBILITY.md +0 -217
  9. package/providers/_builtin/CONTRIBUTING.md +0 -200
  10. package/providers/_builtin/README.md +0 -119
  11. package/providers/_builtin/_helpers/index.js +0 -188
  12. package/providers/_builtin/acp/agentpool/provider.json +0 -54
  13. package/providers/_builtin/acp/amp/provider.json +0 -52
  14. package/providers/_builtin/acp/auggie/provider.json +0 -57
  15. package/providers/_builtin/acp/autodev/provider.json +0 -54
  16. package/providers/_builtin/acp/autohand/provider.json +0 -52
  17. package/providers/_builtin/acp/blackbox-ai/provider.json +0 -54
  18. package/providers/_builtin/acp/claude-agent/provider.json +0 -57
  19. package/providers/_builtin/acp/cline-acp/provider.json +0 -54
  20. package/providers/_builtin/acp/codebuddy/provider.json +0 -54
  21. package/providers/_builtin/acp/codex-cli/provider.json +0 -57
  22. package/providers/_builtin/acp/corust-agent/provider.json +0 -52
  23. package/providers/_builtin/acp/crow-cli/provider.json +0 -54
  24. package/providers/_builtin/acp/cursor-acp/provider.json +0 -54
  25. package/providers/_builtin/acp/deepagents/provider.json +0 -52
  26. package/providers/_builtin/acp/dimcode/provider.json +0 -54
  27. package/providers/_builtin/acp/docker-cagent/provider.json +0 -57
  28. package/providers/_builtin/acp/factory-droid/provider.json +0 -60
  29. package/providers/_builtin/acp/fast-agent/provider.json +0 -52
  30. package/providers/_builtin/acp/gemini-cli/provider.json +0 -114
  31. package/providers/_builtin/acp/github-copilot/provider.json +0 -54
  32. package/providers/_builtin/acp/goose/provider.json +0 -57
  33. package/providers/_builtin/acp/junie/provider.json +0 -52
  34. package/providers/_builtin/acp/kilo/provider.json +0 -54
  35. package/providers/_builtin/acp/kimi-cli/provider.json +0 -57
  36. package/providers/_builtin/acp/minion-code/provider.json +0 -52
  37. package/providers/_builtin/acp/mistral-vibe/provider.json +0 -57
  38. package/providers/_builtin/acp/nova/provider.json +0 -54
  39. package/providers/_builtin/acp/openclaw/provider.json +0 -54
  40. package/providers/_builtin/acp/opencode/provider.json +0 -52
  41. package/providers/_builtin/acp/openhands/provider.json +0 -54
  42. package/providers/_builtin/acp/pi-acp/provider.json +0 -52
  43. package/providers/_builtin/acp/qoder/provider.json +0 -54
  44. package/providers/_builtin/acp/qwen-code/provider.json +0 -60
  45. package/providers/_builtin/acp/stakpak/provider.json +0 -54
  46. package/providers/_builtin/acp/vtcode/provider.json +0 -54
  47. package/providers/_builtin/cli/aider-cli/provider.json +0 -37
  48. package/providers/_builtin/cli/aider-cli/scripts/1.0/detect_status.js +0 -20
  49. package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_approval.js +0 -10
  50. package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_output.js +0 -97
  51. package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +0 -7
  52. package/providers/_builtin/cli/claude-cli/provider.json +0 -121
  53. package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +0 -83
  54. package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +0 -97
  55. package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +0 -417
  56. package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +0 -42
  57. package/providers/_builtin/cli/codex-cli/provider.json +0 -90
  58. package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +0 -54
  59. package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +0 -91
  60. package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +0 -522
  61. package/providers/_builtin/cli/codex-cli/scripts/1.0/scripts.js +0 -11
  62. package/providers/_builtin/cli/cursor-cli/provider.json +0 -37
  63. package/providers/_builtin/cli/cursor-cli/scripts/1.0/detect_status.js +0 -19
  64. package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_approval.js +0 -10
  65. package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_output.js +0 -48
  66. package/providers/_builtin/cli/cursor-cli/scripts/1.0/scripts.js +0 -7
  67. package/providers/_builtin/cli/gemini-cli/provider.json +0 -109
  68. package/providers/_builtin/cli/gemini-cli/scripts/1.0/detect_status.js +0 -26
  69. package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_approval.js +0 -22
  70. package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_output.js +0 -71
  71. package/providers/_builtin/cli/gemini-cli/scripts/1.0/scripts.js +0 -12
  72. package/providers/_builtin/cli/github-copilot-cli/provider.json +0 -37
  73. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/detect_status.js +0 -19
  74. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_approval.js +0 -9
  75. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_output.js +0 -48
  76. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/scripts.js +0 -7
  77. package/providers/_builtin/cli/goose-cli/provider.json +0 -37
  78. package/providers/_builtin/cli/goose-cli/scripts/1.0/detect_status.js +0 -20
  79. package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_approval.js +0 -10
  80. package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_output.js +0 -48
  81. package/providers/_builtin/cli/goose-cli/scripts/1.0/scripts.js +0 -7
  82. package/providers/_builtin/cli/opencode-cli/provider.json +0 -37
  83. package/providers/_builtin/cli/opencode-cli/scripts/1.0/detect_status.js +0 -15
  84. package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_approval.js +0 -9
  85. package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_output.js +0 -48
  86. package/providers/_builtin/cli/opencode-cli/scripts/1.0/scripts.js +0 -7
  87. package/providers/_builtin/docs/CDP_SELECTOR_GUIDE.md +0 -370
  88. package/providers/_builtin/docs/PROVIDER_GUIDE.md +0 -916
  89. package/providers/_builtin/extension/cline/provider.json +0 -37
  90. package/providers/_builtin/extension/cline/scripts/1.0/focus_editor.js +0 -48
  91. package/providers/_builtin/extension/cline/scripts/1.0/list_chats.js +0 -100
  92. package/providers/_builtin/extension/cline/scripts/1.0/list_models.js +0 -43
  93. package/providers/_builtin/extension/cline/scripts/1.0/list_modes.js +0 -35
  94. package/providers/_builtin/extension/cline/scripts/1.0/new_session.js +0 -85
  95. package/providers/_builtin/extension/cline/scripts/1.0/open_panel.js +0 -25
  96. package/providers/_builtin/extension/cline/scripts/1.0/read_chat.js +0 -270
  97. package/providers/_builtin/extension/cline/scripts/1.0/resolve_action.js +0 -83
  98. package/providers/_builtin/extension/cline/scripts/1.0/scripts.js +0 -82
  99. package/providers/_builtin/extension/cline/scripts/1.0/send_message.js +0 -95
  100. package/providers/_builtin/extension/cline/scripts/1.0/set_mode.js +0 -36
  101. package/providers/_builtin/extension/cline/scripts/1.0/set_model.js +0 -36
  102. package/providers/_builtin/extension/cline/scripts/1.0/switch_session.js +0 -206
  103. package/providers/_builtin/extension/codex/provider.json +0 -38
  104. package/providers/_builtin/extension/codex/scripts/1.0/click_conversation_webview.js +0 -24
  105. package/providers/_builtin/extension/codex/scripts/1.0/explore_chat_webview.js +0 -110
  106. package/providers/_builtin/extension/codex/scripts/1.0/explore_controls_webview.js +0 -75
  107. package/providers/_builtin/extension/codex/scripts/1.0/explore_dom.js +0 -58
  108. package/providers/_builtin/extension/codex/scripts/1.0/explore_dropdown_webview.js +0 -64
  109. package/providers/_builtin/extension/codex/scripts/1.0/inspect_code_webview.js +0 -55
  110. package/providers/_builtin/extension/codex/scripts/1.0/list_models.js +0 -63
  111. package/providers/_builtin/extension/codex/scripts/1.0/list_modes.js +0 -140
  112. package/providers/_builtin/extension/codex/scripts/1.0/message_structure_webview.js +0 -79
  113. package/providers/_builtin/extension/codex/scripts/1.0/new_session.js +0 -26
  114. package/providers/_builtin/extension/codex/scripts/1.0/read_chat.js +0 -516
  115. package/providers/_builtin/extension/codex/scripts/1.0/resolve_action.js +0 -82
  116. package/providers/_builtin/extension/codex/scripts/1.0/send_message.js +0 -42
  117. package/providers/_builtin/extension/codex/scripts/1.0/set_mode.js +0 -165
  118. package/providers/_builtin/extension/codex/scripts/1.0/set_model.js +0 -86
  119. package/providers/_builtin/extension/roo-code/provider.json +0 -37
  120. package/providers/_builtin/extension/roo-code/scripts/1.0/scripts.js +0 -82
  121. package/providers/_builtin/ide/antigravity/provider.json +0 -88
  122. package/providers/_builtin/ide/antigravity/scripts/1.0/focus_editor.js +0 -20
  123. package/providers/_builtin/ide/antigravity/scripts/1.0/list_chats.js +0 -137
  124. package/providers/_builtin/ide/antigravity/scripts/1.0/list_models.js +0 -61
  125. package/providers/_builtin/ide/antigravity/scripts/1.0/list_modes.js +0 -72
  126. package/providers/_builtin/ide/antigravity/scripts/1.0/new_session.js +0 -75
  127. package/providers/_builtin/ide/antigravity/scripts/1.0/read_chat.js +0 -352
  128. package/providers/_builtin/ide/antigravity/scripts/1.0/resolve_action.js +0 -63
  129. package/providers/_builtin/ide/antigravity/scripts/1.0/scripts.js +0 -67
  130. package/providers/_builtin/ide/antigravity/scripts/1.0/send_message.js +0 -56
  131. package/providers/_builtin/ide/antigravity/scripts/1.0/set_mode.js +0 -67
  132. package/providers/_builtin/ide/antigravity/scripts/1.0/set_model.js +0 -72
  133. package/providers/_builtin/ide/antigravity/scripts/1.0/switch_session.js +0 -114
  134. package/providers/_builtin/ide/cursor/provider.json +0 -70
  135. package/providers/_builtin/ide/cursor/scripts/1.0/dismiss_notification.js +0 -30
  136. package/providers/_builtin/ide/cursor/scripts/1.0/focus_editor.js +0 -13
  137. package/providers/_builtin/ide/cursor/scripts/1.0/list_models.js +0 -78
  138. package/providers/_builtin/ide/cursor/scripts/1.0/list_modes.js +0 -40
  139. package/providers/_builtin/ide/cursor/scripts/1.0/list_notifications.js +0 -23
  140. package/providers/_builtin/ide/cursor/scripts/1.0/list_sessions.js +0 -42
  141. package/providers/_builtin/ide/cursor/scripts/1.0/new_session.js +0 -20
  142. package/providers/_builtin/ide/cursor/scripts/1.0/open_panel.js +0 -23
  143. package/providers/_builtin/ide/cursor/scripts/1.0/read_chat.js +0 -318
  144. package/providers/_builtin/ide/cursor/scripts/1.0/resolve_action.js +0 -19
  145. package/providers/_builtin/ide/cursor/scripts/1.0/scripts.js +0 -78
  146. package/providers/_builtin/ide/cursor/scripts/1.0/send_message.js +0 -23
  147. package/providers/_builtin/ide/cursor/scripts/1.0/set_mode.js +0 -38
  148. package/providers/_builtin/ide/cursor/scripts/1.0/set_model.js +0 -81
  149. package/providers/_builtin/ide/cursor/scripts/1.0/switch_session.js +0 -28
  150. package/providers/_builtin/ide/kiro/provider.json +0 -68
  151. package/providers/_builtin/ide/kiro/scripts/1.0/focus_editor.js +0 -20
  152. package/providers/_builtin/ide/kiro/scripts/1.0/open_panel.js +0 -47
  153. package/providers/_builtin/ide/kiro/scripts/1.0/resolve_action.js +0 -54
  154. package/providers/_builtin/ide/kiro/scripts/1.0/send_message.js +0 -29
  155. package/providers/_builtin/ide/kiro/scripts/1.0/webview_dump_html.js +0 -1
  156. package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_models.js +0 -42
  157. package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_modes.js +0 -22
  158. package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_sessions.js +0 -21
  159. package/providers/_builtin/ide/kiro/scripts/1.0/webview_new_session.js +0 -34
  160. package/providers/_builtin/ide/kiro/scripts/1.0/webview_read_chat.js +0 -161
  161. package/providers/_builtin/ide/kiro/scripts/1.0/webview_resolve_action.js +0 -62
  162. package/providers/_builtin/ide/kiro/scripts/1.0/webview_send_message.js +0 -94
  163. package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_mode.js +0 -34
  164. package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_model.js +0 -47
  165. package/providers/_builtin/ide/kiro/scripts/1.0/webview_switch_session.js +0 -26
  166. package/providers/_builtin/ide/pearai/.tmp/after_rich.json +0 -157
  167. package/providers/_builtin/ide/pearai/.tmp/after_rich_raw.json +0 -161
  168. package/providers/_builtin/ide/pearai/.tmp/after_switch.json +0 -592
  169. package/providers/_builtin/ide/pearai/.tmp/after_switch_raw.json +0 -596
  170. package/providers/_builtin/ide/pearai/.tmp/home_dump_raw.json +0 -176
  171. package/providers/_builtin/ide/pearai/.tmp/items_raw.json +0 -778
  172. package/providers/_builtin/ide/pearai/.tmp/webview_dump.json +0 -157
  173. package/providers/_builtin/ide/pearai/.tmp/webview_dump_raw.json +0 -161
  174. package/providers/_builtin/ide/pearai/provider.json +0 -71
  175. package/providers/_builtin/ide/pearai/scripts/1.0/focus_editor.js +0 -16
  176. package/providers/_builtin/ide/pearai/scripts/1.0/list_models.js +0 -45
  177. package/providers/_builtin/ide/pearai/scripts/1.0/list_modes.js +0 -44
  178. package/providers/_builtin/ide/pearai/scripts/1.0/list_sessions.js +0 -93
  179. package/providers/_builtin/ide/pearai/scripts/1.0/new_session.js +0 -38
  180. package/providers/_builtin/ide/pearai/scripts/1.0/open_panel.js +0 -23
  181. package/providers/_builtin/ide/pearai/scripts/1.0/read_chat.js +0 -169
  182. package/providers/_builtin/ide/pearai/scripts/1.0/resolve_action.js +0 -60
  183. package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +0 -111
  184. package/providers/_builtin/ide/pearai/scripts/1.0/send_message.js +0 -104
  185. package/providers/_builtin/ide/pearai/scripts/1.0/set_mode.js +0 -51
  186. package/providers/_builtin/ide/pearai/scripts/1.0/set_model.js +0 -54
  187. package/providers/_builtin/ide/pearai/scripts/1.0/switch_session.js +0 -81
  188. package/providers/_builtin/ide/trae/provider.json +0 -72
  189. package/providers/_builtin/ide/trae/scripts/1.0/focus_editor.js +0 -20
  190. package/providers/_builtin/ide/trae/scripts/1.0/list_chats.js +0 -24
  191. package/providers/_builtin/ide/trae/scripts/1.0/list_models.js +0 -39
  192. package/providers/_builtin/ide/trae/scripts/1.0/list_modes.js +0 -39
  193. package/providers/_builtin/ide/trae/scripts/1.0/new_session.js +0 -30
  194. package/providers/_builtin/ide/trae/scripts/1.0/open_panel.js +0 -44
  195. package/providers/_builtin/ide/trae/scripts/1.0/read_chat.js +0 -113
  196. package/providers/_builtin/ide/trae/scripts/1.0/resolve_action.js +0 -54
  197. package/providers/_builtin/ide/trae/scripts/1.0/scripts.js +0 -82
  198. package/providers/_builtin/ide/trae/scripts/1.0/send_message.js +0 -69
  199. package/providers/_builtin/ide/trae/scripts/1.0/set_mode.js +0 -15
  200. package/providers/_builtin/ide/trae/scripts/1.0/set_model.js +0 -15
  201. package/providers/_builtin/ide/trae/scripts/1.0/switch_session.js +0 -23
  202. package/providers/_builtin/ide/vscode/provider.json +0 -74
  203. package/providers/_builtin/ide/vscode/scripts/1.0/focus_editor.js +0 -1
  204. package/providers/_builtin/ide/vscode/scripts/1.0/list_models.js +0 -1
  205. package/providers/_builtin/ide/vscode/scripts/1.0/list_sessions.js +0 -1
  206. package/providers/_builtin/ide/vscode/scripts/1.0/new_session.js +0 -1
  207. package/providers/_builtin/ide/vscode/scripts/1.0/open_panel.js +0 -1
  208. package/providers/_builtin/ide/vscode/scripts/1.0/read_chat.js +0 -1
  209. package/providers/_builtin/ide/vscode/scripts/1.0/resolve_action.js +0 -1
  210. package/providers/_builtin/ide/vscode/scripts/1.0/scripts.js +0 -25
  211. package/providers/_builtin/ide/vscode/scripts/1.0/send_message.js +0 -1
  212. package/providers/_builtin/ide/vscode/scripts/1.0/set_model.js +0 -1
  213. package/providers/_builtin/ide/vscode/scripts/1.0/switch_session.js +0 -1
  214. package/providers/_builtin/ide/vscode-insiders/provider.json +0 -68
  215. package/providers/_builtin/ide/vscodium/provider.json +0 -69
  216. package/providers/_builtin/ide/windsurf/provider.json +0 -57
  217. package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +0 -36
  218. package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +0 -23
  219. package/providers/_builtin/ide/windsurf/scripts/1.0/list_models.js +0 -56
  220. package/providers/_builtin/ide/windsurf/scripts/1.0/list_modes.js +0 -63
  221. package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +0 -79
  222. package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +0 -58
  223. package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +0 -67
  224. package/providers/_builtin/ide/windsurf/scripts/1.0/read_chat.js +0 -253
  225. package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +0 -82
  226. package/providers/_builtin/ide/windsurf/scripts/1.0/scripts.js +0 -82
  227. package/providers/_builtin/ide/windsurf/scripts/1.0/send_message.js +0 -20
  228. package/providers/_builtin/ide/windsurf/scripts/1.0/set_mode.js +0 -43
  229. package/providers/_builtin/ide/windsurf/scripts/1.0/set_model.js +0 -49
  230. package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +0 -82
  231. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +0 -30
  232. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +0 -117
  233. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_models.js +0 -39
  234. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_modes.js +0 -39
  235. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +0 -69
  236. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +0 -58
  237. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +0 -315
  238. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +0 -68
  239. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/scripts.js +0 -82
  240. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +0 -87
  241. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_mode.js +0 -15
  242. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_model.js +0 -15
  243. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +0 -58
  244. package/providers/_builtin/registry.json +0 -376
  245. package/providers/_builtin/validate.js +0 -156
@@ -1,43 +0,0 @@
1
- /**
2
- * Generic fallback — set_model
3
- * ${ MODEL }
4
- */
5
- (async (params) => {
6
- try {
7
- const want = (params?.mode || '').trim();
8
- if (!want) {
9
- return JSON.stringify({ success: false, error: 'Missing mode' });
10
- }
11
-
12
- const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
13
- const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
14
- const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim().toLowerCase();
15
- const modeButton = Array.from((cascade || document).querySelectorAll('button')).find(el => {
16
- const rect = el.getBoundingClientRect();
17
- return rect.y > window.innerHeight - 90 && /lucide-code|lucide-message|lucide-search|lucide-wand|lucide-pencil/i.test(el.innerHTML || '');
18
- });
19
-
20
- if (modeButton) {
21
- modeButton.click();
22
- await wait(200);
23
- }
24
-
25
- const target = Array.from(document.querySelectorAll('button')).find(el => {
26
- if (!(el.offsetWidth > 0 && el.offsetHeight > 0)) return false;
27
- const rect = el.getBoundingClientRect();
28
- const text = normalize((el.innerText || el.textContent || '').split('\n')[0]);
29
- return rect.x > window.innerWidth - 320 && rect.width >= 180 && (text === normalize(want) || text.includes(normalize(want)) || normalize(want).includes(text));
30
- });
31
-
32
- if (!target) {
33
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
34
- return JSON.stringify({ success: false, error: 'Mode not found' });
35
- }
36
-
37
- target.click();
38
- await wait(200);
39
- return JSON.stringify({ success: true });
40
- } catch (e) {
41
- return JSON.stringify({ success: false, error: e.message });
42
- }
43
- })
@@ -1,49 +0,0 @@
1
- /**
2
- * Generic fallback — set_model
3
- * ${ MODEL }
4
- */
5
- (async (params) => {
6
- try {
7
- const want = (params?.model || '').trim();
8
- if (!want) {
9
- return JSON.stringify({ success: false, error: 'Missing model' });
10
- }
11
-
12
- const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
13
- const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
14
- const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim().toLowerCase();
15
- const currentButton = Array.from((cascade || document).querySelectorAll('button')).find(el => {
16
- const rect = el.getBoundingClientRect();
17
- const text = (el.innerText || el.textContent || '').trim();
18
- return rect.y > window.innerHeight - 90 && rect.width < 140 && /(claude|gpt|gemini|sonnet|opus|swe|deepseek|qwen|grok|o1|o3|codex)/i.test(text);
19
- });
20
-
21
- if (currentButton) {
22
- currentButton.click();
23
- await wait(250);
24
- }
25
-
26
- const target = Array.from(document.querySelectorAll('button')).find(el => {
27
- if (!(el.offsetWidth > 0 && el.offsetHeight > 0)) return false;
28
- const rect = el.getBoundingClientRect();
29
- const text = normalize(el.innerText || el.textContent);
30
- return rect.x > window.innerWidth - 320 && rect.width >= 180 && (text === normalize(want) || text.includes(normalize(want)) || normalize(want).includes(text));
31
- });
32
-
33
- if (!target) {
34
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
35
- return JSON.stringify({ success: false, error: 'Model not found' });
36
- }
37
-
38
- if ((target.className || '').includes('cursor-not-allowed') || target.disabled) {
39
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
40
- return JSON.stringify({ success: false, error: 'Model is disabled' });
41
- }
42
-
43
- target.click();
44
- await wait(250);
45
- return JSON.stringify({ success: true });
46
- } catch (e) {
47
- return JSON.stringify({ success: false, error: e.message });
48
- }
49
- })
@@ -1,82 +0,0 @@
1
- /**
2
- * Windsurf v1 — switch_session
3
- *
4
- * Cascade session(conversation) .
5
- * 1. top tabs ([id^="cascade-tab-"])
6
- * 2. history panel ([data-kb-navigate="true"])
7
- */
8
- (async (params) => {
9
- try {
10
- const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
11
- const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim().toLowerCase();
12
-
13
- const clickSequence = (el) => {
14
- if (!el) return;
15
- const rect = el.getBoundingClientRect();
16
- // 1. Synthetic Dispatch
17
- const init = { bubbles: true, cancelable: true, clientX: rect.left + rect.width / 2, clientY: rect.top + rect.height / 2, pointerId: 1, pointerType: 'mouse' };
18
- el.focus?.();
19
- for (const type of ['pointerdown', 'mousedown', 'pointerup', 'mouseup', 'click']) {
20
- el.dispatchEvent(new PointerEvent(type, init));
21
- }
22
- // 2. Native click()
23
- try { el.click(); } catch(e) {}
24
-
25
- return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
26
- };
27
-
28
- const id = params?.id || '';
29
- const title = normalize(params?.title || '');
30
- const index = Number.isFinite(params?.index) ? params.index : null;
31
-
32
- let target = null;
33
-
34
- // 1. ID search (top tabs first)
35
- if (id) {
36
- target = document.getElementById(`cascade-tab-${id}`) || document.getElementById(id);
37
- }
38
-
39
- // 2. top tabsfrom title search
40
- if (!target && title) {
41
- const tabs = Array.from(document.querySelectorAll('[id^="cascade-tab-"]'));
42
- target = tabs.find(tab => normalize(tab.textContent).includes(title));
43
- }
44
-
45
- // 3. history panelfrom search
46
- if (!target) {
47
- const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
48
- if (cascade) {
49
- const historyButton = Array.from(cascade.querySelectorAll('button')).find(el => el.offsetWidth > 0 && /lucide-history/.test(el.innerHTML || ''));
50
- if (historyButton) {
51
- historyButton.click();
52
- await wait(350);
53
- }
54
-
55
- const rows = Array.from(document.querySelectorAll('[data-kb-navigate="true"]')).filter(el => el.offsetWidth > 0);
56
- if (title) {
57
- target = rows.find(row => normalize(row.textContent).includes(title));
58
- }
59
- if (!target && index !== null) {
60
- target = rows[index];
61
- }
62
- }
63
- }
64
-
65
- if (!target) {
66
- // Close history panel
67
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
68
- return JSON.stringify({ switched: false, error: 'Session not found among visible tabs or history rows' });
69
- }
70
-
71
- const coords = clickSequence(target.querySelector('.cursor-pointer') || target);
72
- await wait(200);
73
-
74
- // Close history panel ( )
75
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
76
-
77
- return JSON.stringify({ switched: true, coords });
78
- } catch (e) {
79
- return JSON.stringify({ switched: false, error: e.message });
80
- }
81
- })
82
-
@@ -1,30 +0,0 @@
1
- /**
2
- * Windsurf v1 — focus_editor
3
- *
4
- * Cascade(chat) focus on input field.
5
- * Windsurf VS Code fork, chat UI "Cascade"is called.
6
- *
7
- * DOM structure:
8
- * #windsurf.cascadePanel → .chat-client-root
9
- * input: [contenteditable="true"][role="textbox"]
10
- * or textarea ()
11
- *
12
- * final Check: 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 get tab list.
5
- * If panel is closed open first and wait until tab is rendered.
6
- * cascade-tab-{uuid} element React Fiberfrom title extract.
7
- *
8
- * final Check: Windsurf 1.108.x (2026-03-10)
9
- */
10
- (async () => {
11
- try {
12
- // ─── 1. If panel is closed open ───
13
- let tabs = document.querySelectorAll('[id^="cascade-tab-"]');
14
- if (tabs.length === 0) {
15
- // Check if Cascade panel is visible Check
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
- // Attempt to click toggle button
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
- // button 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
- // Wait for panel render (max 3 seconds)
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
- // Extract title from 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 fallback
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
- * new Cascade session start.
5
- *
6
- * strategy:
7
- * 1. Search for "New" button based on aria-label
8
- * 2. text-based button search
9
- * 3. Codicon icon(+) based search
10
- * 4. Cmd+L shortcut fallback (Windsurffrom new Cascade open)
11
- *
12
- * Windsurffrom Cascadeis an AI chat panel,
13
- * "New Chat" or "+" starts New session via button.
14
- *
15
- * final Check: Windsurf 1.108.x (2026-03-10)
16
- */
17
- (() => {
18
- try {
19
- // ─── 1. Based on 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. text-based ───
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 icon(+) based ───
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-related context or empty label New session button
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
- // Windsurffrom Cmd+Lis Cascade Toggle panel/New session create
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 chat) If panel is closed when present open.
5
- *
6
- * WindsurfCascade panel of is Secondary Side Bar (#workbench.parts.auxiliarybar)located at.
7
- * closed offsetWidth === 0.
8
- * Cmd+L via shortcut can be opened (WINDSURF.md §2.5).
9
- *
10
- * Return: 'visible' | 'opened' | 'error: ...'
11
- * final Check: Windsurf 1.108.x (2026-03-10)
12
- */
13
- (() => {
14
- try {
15
- // ─── 1. Check if Cascade panel is already open ───
16
- const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
17
- document.querySelector('.chat-client-root');
18
- const sidebar = document.getElementById('workbench.parts.auxiliarybar');
19
-
20
- // panelexists and visible means already open
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. Attempt to click toggle button ───
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 shortcut fallback (Windsurf official shortcut) ───
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
- })()