@adhdev/daemon-core 0.6.57 → 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 (241) hide show
  1. package/dist/index.d.ts +18 -1
  2. package/dist/index.js +339 -167
  3. package/dist/index.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/cli-adapters/provider-cli-adapter.ts +223 -48
  6. package/src/commands/chat-commands.ts +7 -1
  7. package/src/config/chat-history.ts +53 -1
  8. package/src/daemon/dev-server.ts +7 -9
  9. package/src/detection/ide-detector.ts +1 -1
  10. package/src/providers/cli-provider-instance.ts +10 -23
  11. package/src/providers/provider-instance.ts +1 -0
  12. package/src/providers/provider-loader.ts +3 -6
  13. package/src/providers/version-archive.ts +4 -1
  14. package/providers/_builtin/.github/workflows/generate-registry.yml +0 -76
  15. package/providers/_builtin/COMPATIBILITY.md +0 -217
  16. package/providers/_builtin/CONTRIBUTING.md +0 -200
  17. package/providers/_builtin/README.md +0 -119
  18. package/providers/_builtin/_helpers/index.js +0 -188
  19. package/providers/_builtin/acp/agentpool/provider.json +0 -54
  20. package/providers/_builtin/acp/amp/provider.json +0 -52
  21. package/providers/_builtin/acp/auggie/provider.json +0 -57
  22. package/providers/_builtin/acp/autodev/provider.json +0 -54
  23. package/providers/_builtin/acp/autohand/provider.json +0 -52
  24. package/providers/_builtin/acp/blackbox-ai/provider.json +0 -54
  25. package/providers/_builtin/acp/claude-agent/provider.json +0 -57
  26. package/providers/_builtin/acp/cline-acp/provider.json +0 -54
  27. package/providers/_builtin/acp/codebuddy/provider.json +0 -54
  28. package/providers/_builtin/acp/codex-cli/provider.json +0 -57
  29. package/providers/_builtin/acp/corust-agent/provider.json +0 -52
  30. package/providers/_builtin/acp/crow-cli/provider.json +0 -54
  31. package/providers/_builtin/acp/cursor-acp/provider.json +0 -54
  32. package/providers/_builtin/acp/deepagents/provider.json +0 -52
  33. package/providers/_builtin/acp/dimcode/provider.json +0 -54
  34. package/providers/_builtin/acp/docker-cagent/provider.json +0 -57
  35. package/providers/_builtin/acp/factory-droid/provider.json +0 -60
  36. package/providers/_builtin/acp/fast-agent/provider.json +0 -52
  37. package/providers/_builtin/acp/gemini-cli/provider.json +0 -114
  38. package/providers/_builtin/acp/github-copilot/provider.json +0 -54
  39. package/providers/_builtin/acp/goose/provider.json +0 -57
  40. package/providers/_builtin/acp/junie/provider.json +0 -52
  41. package/providers/_builtin/acp/kilo/provider.json +0 -54
  42. package/providers/_builtin/acp/kimi-cli/provider.json +0 -57
  43. package/providers/_builtin/acp/minion-code/provider.json +0 -52
  44. package/providers/_builtin/acp/mistral-vibe/provider.json +0 -57
  45. package/providers/_builtin/acp/nova/provider.json +0 -54
  46. package/providers/_builtin/acp/openclaw/provider.json +0 -54
  47. package/providers/_builtin/acp/opencode/provider.json +0 -52
  48. package/providers/_builtin/acp/openhands/provider.json +0 -54
  49. package/providers/_builtin/acp/pi-acp/provider.json +0 -52
  50. package/providers/_builtin/acp/qoder/provider.json +0 -54
  51. package/providers/_builtin/acp/qwen-code/provider.json +0 -60
  52. package/providers/_builtin/acp/stakpak/provider.json +0 -54
  53. package/providers/_builtin/acp/vtcode/provider.json +0 -54
  54. package/providers/_builtin/cli/aider-cli/provider.json +0 -37
  55. package/providers/_builtin/cli/aider-cli/scripts/1.0/detect_status.js +0 -20
  56. package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_approval.js +0 -10
  57. package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_output.js +0 -49
  58. package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +0 -7
  59. package/providers/_builtin/cli/claude-cli/provider.json +0 -109
  60. package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +0 -31
  61. package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +0 -38
  62. package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +0 -164
  63. package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +0 -42
  64. package/providers/_builtin/cli/codex-cli/provider.json +0 -88
  65. package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +0 -20
  66. package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +0 -15
  67. package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +0 -68
  68. package/providers/_builtin/cli/codex-cli/scripts/1.0/scripts.js +0 -11
  69. package/providers/_builtin/cli/cursor-cli/provider.json +0 -37
  70. package/providers/_builtin/cli/cursor-cli/scripts/1.0/detect_status.js +0 -19
  71. package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_approval.js +0 -10
  72. package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_output.js +0 -48
  73. package/providers/_builtin/cli/cursor-cli/scripts/1.0/scripts.js +0 -7
  74. package/providers/_builtin/cli/gemini-cli/provider.json +0 -109
  75. package/providers/_builtin/cli/gemini-cli/scripts/1.0/detect_status.js +0 -26
  76. package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_approval.js +0 -22
  77. package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_output.js +0 -71
  78. package/providers/_builtin/cli/gemini-cli/scripts/1.0/scripts.js +0 -12
  79. package/providers/_builtin/cli/github-copilot-cli/provider.json +0 -37
  80. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/detect_status.js +0 -19
  81. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_approval.js +0 -9
  82. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_output.js +0 -48
  83. package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/scripts.js +0 -7
  84. package/providers/_builtin/cli/goose-cli/provider.json +0 -37
  85. package/providers/_builtin/cli/goose-cli/scripts/1.0/detect_status.js +0 -20
  86. package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_approval.js +0 -10
  87. package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_output.js +0 -48
  88. package/providers/_builtin/cli/goose-cli/scripts/1.0/scripts.js +0 -7
  89. package/providers/_builtin/cli/opencode-cli/provider.json +0 -37
  90. package/providers/_builtin/cli/opencode-cli/scripts/1.0/detect_status.js +0 -15
  91. package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_approval.js +0 -9
  92. package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_output.js +0 -48
  93. package/providers/_builtin/cli/opencode-cli/scripts/1.0/scripts.js +0 -7
  94. package/providers/_builtin/docs/CDP_SELECTOR_GUIDE.md +0 -370
  95. package/providers/_builtin/docs/PROVIDER_GUIDE.md +0 -916
  96. package/providers/_builtin/extension/cline/provider.json +0 -37
  97. package/providers/_builtin/extension/cline/scripts/1.0/focus_editor.js +0 -48
  98. package/providers/_builtin/extension/cline/scripts/1.0/list_chats.js +0 -100
  99. package/providers/_builtin/extension/cline/scripts/1.0/list_models.js +0 -43
  100. package/providers/_builtin/extension/cline/scripts/1.0/list_modes.js +0 -35
  101. package/providers/_builtin/extension/cline/scripts/1.0/new_session.js +0 -85
  102. package/providers/_builtin/extension/cline/scripts/1.0/open_panel.js +0 -25
  103. package/providers/_builtin/extension/cline/scripts/1.0/read_chat.js +0 -270
  104. package/providers/_builtin/extension/cline/scripts/1.0/resolve_action.js +0 -83
  105. package/providers/_builtin/extension/cline/scripts/1.0/scripts.js +0 -82
  106. package/providers/_builtin/extension/cline/scripts/1.0/send_message.js +0 -95
  107. package/providers/_builtin/extension/cline/scripts/1.0/set_mode.js +0 -36
  108. package/providers/_builtin/extension/cline/scripts/1.0/set_model.js +0 -36
  109. package/providers/_builtin/extension/cline/scripts/1.0/switch_session.js +0 -206
  110. package/providers/_builtin/extension/codex/provider.json +0 -38
  111. package/providers/_builtin/extension/codex/scripts/1.0/click_conversation_webview.js +0 -24
  112. package/providers/_builtin/extension/codex/scripts/1.0/explore_chat_webview.js +0 -110
  113. package/providers/_builtin/extension/codex/scripts/1.0/explore_controls_webview.js +0 -75
  114. package/providers/_builtin/extension/codex/scripts/1.0/explore_dom.js +0 -58
  115. package/providers/_builtin/extension/codex/scripts/1.0/explore_dropdown_webview.js +0 -64
  116. package/providers/_builtin/extension/codex/scripts/1.0/inspect_code_webview.js +0 -55
  117. package/providers/_builtin/extension/codex/scripts/1.0/list_models.js +0 -63
  118. package/providers/_builtin/extension/codex/scripts/1.0/list_modes.js +0 -140
  119. package/providers/_builtin/extension/codex/scripts/1.0/message_structure_webview.js +0 -79
  120. package/providers/_builtin/extension/codex/scripts/1.0/new_session.js +0 -26
  121. package/providers/_builtin/extension/codex/scripts/1.0/read_chat.js +0 -516
  122. package/providers/_builtin/extension/codex/scripts/1.0/resolve_action.js +0 -82
  123. package/providers/_builtin/extension/codex/scripts/1.0/send_message.js +0 -42
  124. package/providers/_builtin/extension/codex/scripts/1.0/set_mode.js +0 -165
  125. package/providers/_builtin/extension/codex/scripts/1.0/set_model.js +0 -86
  126. package/providers/_builtin/extension/roo-code/provider.json +0 -37
  127. package/providers/_builtin/extension/roo-code/scripts/1.0/scripts.js +0 -82
  128. package/providers/_builtin/ide/antigravity/provider.json +0 -88
  129. package/providers/_builtin/ide/antigravity/scripts/1.0/focus_editor.js +0 -20
  130. package/providers/_builtin/ide/antigravity/scripts/1.0/list_chats.js +0 -137
  131. package/providers/_builtin/ide/antigravity/scripts/1.0/list_models.js +0 -61
  132. package/providers/_builtin/ide/antigravity/scripts/1.0/list_modes.js +0 -72
  133. package/providers/_builtin/ide/antigravity/scripts/1.0/new_session.js +0 -75
  134. package/providers/_builtin/ide/antigravity/scripts/1.0/read_chat.js +0 -352
  135. package/providers/_builtin/ide/antigravity/scripts/1.0/resolve_action.js +0 -63
  136. package/providers/_builtin/ide/antigravity/scripts/1.0/scripts.js +0 -67
  137. package/providers/_builtin/ide/antigravity/scripts/1.0/send_message.js +0 -56
  138. package/providers/_builtin/ide/antigravity/scripts/1.0/set_mode.js +0 -67
  139. package/providers/_builtin/ide/antigravity/scripts/1.0/set_model.js +0 -72
  140. package/providers/_builtin/ide/antigravity/scripts/1.0/switch_session.js +0 -114
  141. package/providers/_builtin/ide/cursor/provider.json +0 -70
  142. package/providers/_builtin/ide/cursor/scripts/1.0/dismiss_notification.js +0 -30
  143. package/providers/_builtin/ide/cursor/scripts/1.0/focus_editor.js +0 -13
  144. package/providers/_builtin/ide/cursor/scripts/1.0/list_models.js +0 -78
  145. package/providers/_builtin/ide/cursor/scripts/1.0/list_modes.js +0 -40
  146. package/providers/_builtin/ide/cursor/scripts/1.0/list_notifications.js +0 -23
  147. package/providers/_builtin/ide/cursor/scripts/1.0/list_sessions.js +0 -42
  148. package/providers/_builtin/ide/cursor/scripts/1.0/new_session.js +0 -20
  149. package/providers/_builtin/ide/cursor/scripts/1.0/open_panel.js +0 -23
  150. package/providers/_builtin/ide/cursor/scripts/1.0/read_chat.js +0 -318
  151. package/providers/_builtin/ide/cursor/scripts/1.0/resolve_action.js +0 -19
  152. package/providers/_builtin/ide/cursor/scripts/1.0/scripts.js +0 -78
  153. package/providers/_builtin/ide/cursor/scripts/1.0/send_message.js +0 -23
  154. package/providers/_builtin/ide/cursor/scripts/1.0/set_mode.js +0 -38
  155. package/providers/_builtin/ide/cursor/scripts/1.0/set_model.js +0 -81
  156. package/providers/_builtin/ide/cursor/scripts/1.0/switch_session.js +0 -28
  157. package/providers/_builtin/ide/kiro/provider.json +0 -68
  158. package/providers/_builtin/ide/kiro/scripts/1.0/focus_editor.js +0 -20
  159. package/providers/_builtin/ide/kiro/scripts/1.0/open_panel.js +0 -47
  160. package/providers/_builtin/ide/kiro/scripts/1.0/resolve_action.js +0 -54
  161. package/providers/_builtin/ide/kiro/scripts/1.0/send_message.js +0 -29
  162. package/providers/_builtin/ide/kiro/scripts/1.0/webview_dump_html.js +0 -1
  163. package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_models.js +0 -42
  164. package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_modes.js +0 -22
  165. package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_sessions.js +0 -21
  166. package/providers/_builtin/ide/kiro/scripts/1.0/webview_new_session.js +0 -34
  167. package/providers/_builtin/ide/kiro/scripts/1.0/webview_read_chat.js +0 -161
  168. package/providers/_builtin/ide/kiro/scripts/1.0/webview_resolve_action.js +0 -62
  169. package/providers/_builtin/ide/kiro/scripts/1.0/webview_send_message.js +0 -94
  170. package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_mode.js +0 -34
  171. package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_model.js +0 -47
  172. package/providers/_builtin/ide/kiro/scripts/1.0/webview_switch_session.js +0 -26
  173. package/providers/_builtin/ide/pearai/.tmp/after_rich.json +0 -157
  174. package/providers/_builtin/ide/pearai/.tmp/after_rich_raw.json +0 -161
  175. package/providers/_builtin/ide/pearai/.tmp/after_switch.json +0 -592
  176. package/providers/_builtin/ide/pearai/.tmp/after_switch_raw.json +0 -596
  177. package/providers/_builtin/ide/pearai/.tmp/home_dump_raw.json +0 -176
  178. package/providers/_builtin/ide/pearai/.tmp/items_raw.json +0 -778
  179. package/providers/_builtin/ide/pearai/.tmp/webview_dump.json +0 -157
  180. package/providers/_builtin/ide/pearai/.tmp/webview_dump_raw.json +0 -161
  181. package/providers/_builtin/ide/pearai/provider.json +0 -71
  182. package/providers/_builtin/ide/pearai/scripts/1.0/focus_editor.js +0 -16
  183. package/providers/_builtin/ide/pearai/scripts/1.0/list_models.js +0 -45
  184. package/providers/_builtin/ide/pearai/scripts/1.0/list_modes.js +0 -44
  185. package/providers/_builtin/ide/pearai/scripts/1.0/list_sessions.js +0 -93
  186. package/providers/_builtin/ide/pearai/scripts/1.0/new_session.js +0 -38
  187. package/providers/_builtin/ide/pearai/scripts/1.0/open_panel.js +0 -23
  188. package/providers/_builtin/ide/pearai/scripts/1.0/read_chat.js +0 -169
  189. package/providers/_builtin/ide/pearai/scripts/1.0/resolve_action.js +0 -60
  190. package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +0 -111
  191. package/providers/_builtin/ide/pearai/scripts/1.0/send_message.js +0 -104
  192. package/providers/_builtin/ide/pearai/scripts/1.0/set_mode.js +0 -51
  193. package/providers/_builtin/ide/pearai/scripts/1.0/set_model.js +0 -54
  194. package/providers/_builtin/ide/pearai/scripts/1.0/switch_session.js +0 -81
  195. package/providers/_builtin/ide/trae/provider.json +0 -72
  196. package/providers/_builtin/ide/trae/scripts/1.0/focus_editor.js +0 -20
  197. package/providers/_builtin/ide/trae/scripts/1.0/list_chats.js +0 -24
  198. package/providers/_builtin/ide/trae/scripts/1.0/list_models.js +0 -39
  199. package/providers/_builtin/ide/trae/scripts/1.0/list_modes.js +0 -39
  200. package/providers/_builtin/ide/trae/scripts/1.0/new_session.js +0 -30
  201. package/providers/_builtin/ide/trae/scripts/1.0/open_panel.js +0 -44
  202. package/providers/_builtin/ide/trae/scripts/1.0/read_chat.js +0 -113
  203. package/providers/_builtin/ide/trae/scripts/1.0/resolve_action.js +0 -54
  204. package/providers/_builtin/ide/trae/scripts/1.0/scripts.js +0 -82
  205. package/providers/_builtin/ide/trae/scripts/1.0/send_message.js +0 -69
  206. package/providers/_builtin/ide/trae/scripts/1.0/set_mode.js +0 -15
  207. package/providers/_builtin/ide/trae/scripts/1.0/set_model.js +0 -15
  208. package/providers/_builtin/ide/trae/scripts/1.0/switch_session.js +0 -23
  209. package/providers/_builtin/ide/vscode/provider.json +0 -70
  210. package/providers/_builtin/ide/vscode-insiders/provider.json +0 -68
  211. package/providers/_builtin/ide/vscodium/provider.json +0 -69
  212. package/providers/_builtin/ide/windsurf/provider.json +0 -57
  213. package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +0 -36
  214. package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +0 -23
  215. package/providers/_builtin/ide/windsurf/scripts/1.0/list_models.js +0 -56
  216. package/providers/_builtin/ide/windsurf/scripts/1.0/list_modes.js +0 -63
  217. package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +0 -79
  218. package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +0 -58
  219. package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +0 -67
  220. package/providers/_builtin/ide/windsurf/scripts/1.0/read_chat.js +0 -253
  221. package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +0 -82
  222. package/providers/_builtin/ide/windsurf/scripts/1.0/scripts.js +0 -82
  223. package/providers/_builtin/ide/windsurf/scripts/1.0/send_message.js +0 -20
  224. package/providers/_builtin/ide/windsurf/scripts/1.0/set_mode.js +0 -43
  225. package/providers/_builtin/ide/windsurf/scripts/1.0/set_model.js +0 -49
  226. package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +0 -82
  227. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +0 -30
  228. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +0 -117
  229. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_models.js +0 -39
  230. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_modes.js +0 -39
  231. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +0 -69
  232. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +0 -58
  233. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +0 -315
  234. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +0 -68
  235. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/scripts.js +0 -82
  236. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +0 -87
  237. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_mode.js +0 -15
  238. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_model.js +0 -15
  239. package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +0 -58
  240. package/providers/_builtin/registry.json +0 -376
  241. package/providers/_builtin/validate.js +0 -156
@@ -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
- })()