@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,188 +0,0 @@
1
- /**
2
- * Provider Helpers — Shared utilities
3
- *
4
- * Common functions available via require in each provider.js.
5
- * Usage is optional — each provider.js can be self-contained.
6
- *
7
- * Usage (inside provider.js):
8
- * const { getWebviewDoc, htmlToMd, waitFor } = require('../../_helpers/index.js');
9
- */
10
-
11
- /**
12
- * Access contentDocument of extension webview iframe
13
- * @param {string} [selector='iframe'] - iframe selector
14
- * @returns {string} JS code for CDP evaluate (sets document variable)
15
- */
16
- function getWebviewDoc(selector = 'iframe') {
17
- return `
18
- const _iframe = document.querySelector('${selector}');
19
- const _doc = _iframe ? (_iframe.contentDocument || _iframe.contentWindow?.document) : document;
20
- `;
21
- }
22
-
23
- /**
24
- * React Fiber data extraction helper code
25
- * Traverse memoizedState starting from specific entry points
26
- * @param {string[]} entrySelectors - Entry point CSS selectors
27
- * @param {number} [maxDepth=200] - Max Fiber tree traversal depth
28
- * @returns {string} JS code for CDP evaluate (sets _fiberData variable)
29
- */
30
- function getFiber(entrySelectors, maxDepth = 200) {
31
- const sels = JSON.stringify(entrySelectors);
32
- return `
33
- let _fiberData = null;
34
- const _entryPoints = ${sels};
35
- for (const sel of _entryPoints) {
36
- const el = document.querySelector(sel);
37
- if (!el) continue;
38
- const fk = Object.keys(el).find(k => k.startsWith('__reactFiber'));
39
- if (!fk) continue;
40
- let fib = el[fk];
41
- for (let d = 0; d < ${maxDepth} && fib; d++) {
42
- if (fib.memoizedState) {
43
- let s = fib.memoizedState;
44
- while (s) {
45
- try {
46
- const memo = s.memoizedState;
47
- if (memo && typeof memo === 'object') {
48
- _fiberData = memo;
49
- break;
50
- }
51
- } catch(e) {}
52
- s = s.next;
53
- }
54
- }
55
- if (_fiberData) break;
56
- fib = fib.return;
57
- }
58
- if (_fiberData) break;
59
- }
60
- `;
61
- }
62
-
63
- /**
64
- * Generate text input + Enter submission code
65
- * @param {string} varName - Variable name containing the text
66
- * @param {string} selectorExpr - JS expression referencing the editor element
67
- * @returns {string} JS code for CDP evaluate
68
- */
69
- function typeAndSubmit(varName, selectorExpr) {
70
- return `
71
- const _editor = ${selectorExpr};
72
- if (_editor) {
73
- _editor.focus();
74
- document.execCommand('selectAll', false, null);
75
- document.execCommand('delete', false, null);
76
- document.execCommand('insertText', false, ${varName});
77
- _editor.dispatchEvent(new Event('input', { bubbles: true }));
78
- await new Promise(r => setTimeout(r, 300));
79
- const _enterOpts = { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true, cancelable: true, composed: true };
80
- _editor.dispatchEvent(new KeyboardEvent('keydown', _enterOpts));
81
- _editor.dispatchEvent(new KeyboardEvent('keypress', _enterOpts));
82
- _editor.dispatchEvent(new KeyboardEvent('keyup', _enterOpts));
83
- }
84
- `;
85
- }
86
-
87
- /**
88
- * Generate element wait code
89
- * @param {string} selector - CSS selector
90
- * @param {number} [timeout=5000] - Max wait time (ms)
91
- * @returns {string} JS code for CDP evaluate (expression → element or null)
92
- */
93
- function waitFor(selector, timeout = 5000) {
94
- return `
95
- await new Promise((resolve) => {
96
- const _t = Date.now();
97
- const _check = () => {
98
- const el = document.querySelector('${selector}');
99
- if (el && el.offsetWidth > 0) return resolve(el);
100
- if (Date.now() - _t > ${timeout}) return resolve(null);
101
- setTimeout(_check, 200);
102
- };
103
- _check();
104
- })
105
- `;
106
- }
107
-
108
- /**
109
- * HTML → Markdown conversion function (CDP code string)
110
- * Dashboard uses ReactMarkdown+remarkGfm, so HTML must be converted to GFM
111
- * @returns {string} htmlToMd, childrenToMd function declaration code
112
- */
113
- function htmlToMdCode() {
114
- return `
115
- function htmlToMd(node) {
116
- if (node.nodeType === 3) return node.textContent || '';
117
- if (node.nodeType !== 1) return '';
118
- const tag = node.tagName;
119
- if (tag === 'STYLE' || tag === 'SCRIPT' || tag === 'SVG') return '';
120
- if (tag === 'TABLE') {
121
- const rows = Array.from(node.querySelectorAll('tr'));
122
- if (rows.length === 0) return '';
123
- const table = rows.map(tr => Array.from(tr.querySelectorAll('th, td')).map(cell => (cell.textContent || '').trim().replace(/\\|/g, '\\\\|')));
124
- if (table.length === 0) return '';
125
- const colCount = Math.max(...table.map(r => r.length));
126
- const header = table[0];
127
- const sep = Array(colCount).fill('---');
128
- const body = table.slice(1);
129
- let md = '| ' + header.join(' | ') + ' |\\n';
130
- md += '| ' + sep.join(' | ') + ' |\\n';
131
- for (const row of body) {
132
- while (row.length < colCount) row.push('');
133
- md += '| ' + row.join(' | ') + ' |\\n';
134
- }
135
- return '\\n' + md + '\\n';
136
- }
137
- if (tag === 'UL') return '\\n' + Array.from(node.children).map(li => '- ' + childrenToMd(li).trim()).join('\\n') + '\\n';
138
- if (tag === 'OL') return '\\n' + Array.from(node.children).map((li, i) => (i + 1) + '. ' + childrenToMd(li).trim()).join('\\n') + '\\n';
139
- if (tag === 'LI') return childrenToMd(node);
140
- if (tag === 'H1') return '\\n# ' + childrenToMd(node).trim() + '\\n';
141
- if (tag === 'H2') return '\\n## ' + childrenToMd(node).trim() + '\\n';
142
- if (tag === 'H3') return '\\n### ' + childrenToMd(node).trim() + '\\n';
143
- if (tag === 'H4') return '\\n#### ' + childrenToMd(node).trim() + '\\n';
144
- if (tag === 'STRONG' || tag === 'B') return '**' + childrenToMd(node).trim() + '**';
145
- if (tag === 'EM' || tag === 'I') return '*' + childrenToMd(node).trim() + '*';
146
- if (tag === 'PRE') {
147
- const codeEl = node.querySelector('code');
148
- const lang = codeEl ? (codeEl.className.match(/language-(\\w+)/)?.[1] || '') : '';
149
- const code = (codeEl || node).textContent || '';
150
- return '\\n\`\`\`' + lang + '\\n' + code.trim() + '\\n\`\`\`\\n';
151
- }
152
- if (tag === 'CODE') {
153
- if (node.parentElement && node.parentElement.tagName === 'PRE') return node.textContent || '';
154
- return '\`' + (node.textContent || '').trim() + '\`';
155
- }
156
- if (tag === 'BLOCKQUOTE') return '\\n> ' + childrenToMd(node).trim().replace(/\\n/g, '\\n> ') + '\\n';
157
- if (tag === 'A') return '[' + childrenToMd(node).trim() + '](' + (node.getAttribute('href') || '') + ')';
158
- if (tag === 'BR') return '\\n';
159
- if (tag === 'P') return '\\n' + childrenToMd(node).trim() + '\\n';
160
- return childrenToMd(node);
161
- }
162
- function childrenToMd(node) {
163
- return Array.from(node.childNodes).map(htmlToMd).join('');
164
- }
165
- `;
166
- }
167
-
168
- /**
169
- * Noise text filtering (status messages, MCP, etc.)
170
- * @param {string} text - Original text
171
- * @returns {boolean} true if noise
172
- */
173
- function isNoiseText(text) {
174
- const low = (text || '').trim().toLowerCase();
175
- if (low.length > 60) return false;
176
- if (/^(analyzed\s+\d|edited\s+\d|ran\s+\S|terminal\s|reading|searching)/i.test(low)) return true;
177
- if (/^(mcp|customizationmcp|serversexport)/i.test(low)) return true;
178
- return false;
179
- }
180
-
181
- module.exports = {
182
- getWebviewDoc,
183
- getFiber,
184
- typeAndSubmit,
185
- waitFor,
186
- htmlToMdCode,
187
- isNoiseText,
188
- };
@@ -1,54 +0,0 @@
1
- {
2
- "type": "agentpool-acp",
3
- "name": "AgentPool (ACP)",
4
- "category": "acp",
5
- "displayName": "AgentPool",
6
- "icon": "🏊",
7
- "install": "pip install agentpool (Python/uvx)",
8
- "spawn": {
9
- "command": "agentpool",
10
- "args": [
11
- "acp"
12
- ],
13
- "shell": false
14
- },
15
- "auth": [
16
- {
17
- "type": "agent",
18
- "id": "agentpool",
19
- "name": "AgentPool Auth",
20
- "description": "Configure provider through AgentPool setup"
21
- }
22
- ],
23
- "settings": {
24
- "autoApprove": {
25
- "type": "boolean",
26
- "default": false,
27
- "public": true,
28
- "label": "Auto Approve",
29
- "description": "Automatically approve all tool calls without user confirmation"
30
- },
31
- "approvalAlert": {
32
- "type": "boolean",
33
- "default": true,
34
- "public": true,
35
- "label": "Approval Alerts",
36
- "description": "Show notification when agent requires approval"
37
- },
38
- "longGeneratingAlert": {
39
- "type": "boolean",
40
- "default": true,
41
- "public": true,
42
- "label": "Long Generation Alert",
43
- "description": "Alert when generation takes too long"
44
- },
45
- "longGeneratingThresholdSec": {
46
- "type": "number",
47
- "default": 180,
48
- "public": true,
49
- "label": "Long Generation Threshold (sec)",
50
- "min": 30,
51
- "max": 600
52
- }
53
- }
54
- }
@@ -1,52 +0,0 @@
1
- {
2
- "type": "amp-acp",
3
- "name": "Amp (ACP)",
4
- "category": "acp",
5
- "displayName": "Amp",
6
- "icon": "⚡",
7
- "install": "Binary download from GitHub: https://github.com/tao12345666333/amp-acp/releases",
8
- "spawn": {
9
- "command": "amp-acp",
10
- "args": [],
11
- "shell": false
12
- },
13
- "auth": [
14
- {
15
- "type": "agent",
16
- "id": "amp-auth",
17
- "name": "Amp Authentication",
18
- "description": "Authenticate through Amp setup flow"
19
- }
20
- ],
21
- "settings": {
22
- "autoApprove": {
23
- "type": "boolean",
24
- "default": false,
25
- "public": true,
26
- "label": "Auto Approve",
27
- "description": "Automatically approve all tool calls without user confirmation"
28
- },
29
- "approvalAlert": {
30
- "type": "boolean",
31
- "default": true,
32
- "public": true,
33
- "label": "Approval Alerts",
34
- "description": "Show notification when Amp requires approval"
35
- },
36
- "longGeneratingAlert": {
37
- "type": "boolean",
38
- "default": true,
39
- "public": true,
40
- "label": "Long Generation Alert",
41
- "description": "Alert when generation takes too long"
42
- },
43
- "longGeneratingThresholdSec": {
44
- "type": "number",
45
- "default": 180,
46
- "public": true,
47
- "label": "Long Generation Threshold (sec)",
48
- "min": 30,
49
- "max": 600
50
- }
51
- }
52
- }
@@ -1,57 +0,0 @@
1
- {
2
- "type": "auggie-acp",
3
- "name": "Auggie CLI (ACP)",
4
- "category": "acp",
5
- "displayName": "Auggie CLI",
6
- "icon": "🧠",
7
- "install": "npm install -g @augmentcode/auggie",
8
- "spawn": {
9
- "command": "auggie",
10
- "args": [
11
- "--acp"
12
- ],
13
- "shell": false,
14
- "env": {
15
- "AUGMENT_DISABLE_AUTO_UPDATE": "1"
16
- }
17
- },
18
- "auth": [
19
- {
20
- "type": "agent",
21
- "id": "augment",
22
- "name": "Augment Code Auth",
23
- "description": "Authenticate through Augment Code setup"
24
- }
25
- ],
26
- "settings": {
27
- "autoApprove": {
28
- "type": "boolean",
29
- "default": false,
30
- "public": true,
31
- "label": "Auto Approve",
32
- "description": "Automatically approve all tool calls without user confirmation"
33
- },
34
- "approvalAlert": {
35
- "type": "boolean",
36
- "default": true,
37
- "public": true,
38
- "label": "Approval Alerts",
39
- "description": "Show notification when agent requires approval"
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,54 +0,0 @@
1
- {
2
- "type": "autodev-acp",
3
- "name": "AutoDev (ACP)",
4
- "category": "acp",
5
- "displayName": "AutoDev",
6
- "icon": "🤖",
7
- "install": "Download from https://github.com/phodal/auto-dev/releases",
8
- "spawn": {
9
- "command": "autodev",
10
- "args": [
11
- "acp"
12
- ],
13
- "shell": false
14
- },
15
- "auth": [
16
- {
17
- "type": "agent",
18
- "id": "autodev",
19
- "name": "AutoDev Auth",
20
- "description": "Configure provider through AutoDev setup"
21
- }
22
- ],
23
- "settings": {
24
- "autoApprove": {
25
- "type": "boolean",
26
- "default": false,
27
- "public": true,
28
- "label": "Auto Approve",
29
- "description": "Automatically approve all tool calls without user confirmation"
30
- },
31
- "approvalAlert": {
32
- "type": "boolean",
33
- "default": true,
34
- "public": true,
35
- "label": "Approval Alerts",
36
- "description": "Show notification when agent requires approval"
37
- },
38
- "longGeneratingAlert": {
39
- "type": "boolean",
40
- "default": true,
41
- "public": true,
42
- "label": "Long Generation Alert",
43
- "description": "Alert when generation takes too long"
44
- },
45
- "longGeneratingThresholdSec": {
46
- "type": "number",
47
- "default": 180,
48
- "public": true,
49
- "label": "Long Generation Threshold (sec)",
50
- "min": 30,
51
- "max": 600
52
- }
53
- }
54
- }
@@ -1,52 +0,0 @@
1
- {
2
- "type": "autohand-acp",
3
- "name": "Autohand Code (ACP)",
4
- "category": "acp",
5
- "displayName": "Autohand Code",
6
- "icon": "🤖",
7
- "install": "npm install -g @autohandai/autohand-acp",
8
- "spawn": {
9
- "command": "autohand-acp",
10
- "args": [],
11
- "shell": false
12
- },
13
- "auth": [
14
- {
15
- "type": "agent",
16
- "id": "autohand",
17
- "name": "Autohand Auth",
18
- "description": "Authenticate through Autohand AI setup"
19
- }
20
- ],
21
- "settings": {
22
- "autoApprove": {
23
- "type": "boolean",
24
- "default": false,
25
- "public": true,
26
- "label": "Auto Approve",
27
- "description": "Automatically approve all tool calls without user confirmation"
28
- },
29
- "approvalAlert": {
30
- "type": "boolean",
31
- "default": true,
32
- "public": true,
33
- "label": "Approval Alerts",
34
- "description": "Show notification when agent requires approval"
35
- },
36
- "longGeneratingAlert": {
37
- "type": "boolean",
38
- "default": true,
39
- "public": true,
40
- "label": "Long Generation Alert",
41
- "description": "Alert when generation takes too long"
42
- },
43
- "longGeneratingThresholdSec": {
44
- "type": "number",
45
- "default": 180,
46
- "public": true,
47
- "label": "Long Generation Threshold (sec)",
48
- "min": 30,
49
- "max": 600
50
- }
51
- }
52
- }
@@ -1,54 +0,0 @@
1
- {
2
- "type": "blackbox-ai-acp",
3
- "name": "Blackbox AI (ACP)",
4
- "category": "acp",
5
- "displayName": "Blackbox AI",
6
- "icon": "⬛",
7
- "install": "Download from https://docs.blackbox.ai/features/blackbox-cli",
8
- "spawn": {
9
- "command": "blackbox",
10
- "args": [
11
- "acp"
12
- ],
13
- "shell": false
14
- },
15
- "auth": [
16
- {
17
- "type": "agent",
18
- "id": "blackbox",
19
- "name": "Blackbox Auth",
20
- "description": "Authenticate with Blackbox AI account"
21
- }
22
- ],
23
- "settings": {
24
- "autoApprove": {
25
- "type": "boolean",
26
- "default": false,
27
- "public": true,
28
- "label": "Auto Approve",
29
- "description": "Automatically approve all tool calls without user confirmation"
30
- },
31
- "approvalAlert": {
32
- "type": "boolean",
33
- "default": true,
34
- "public": true,
35
- "label": "Approval Alerts",
36
- "description": "Show notification when agent requires approval"
37
- },
38
- "longGeneratingAlert": {
39
- "type": "boolean",
40
- "default": true,
41
- "public": true,
42
- "label": "Long Generation Alert",
43
- "description": "Alert when generation takes too long"
44
- },
45
- "longGeneratingThresholdSec": {
46
- "type": "number",
47
- "default": 180,
48
- "public": true,
49
- "label": "Long Generation Threshold (sec)",
50
- "min": 30,
51
- "max": 600
52
- }
53
- }
54
- }
@@ -1,57 +0,0 @@
1
- {
2
- "type": "claude-agent-acp",
3
- "name": "Claude Agent (ACP)",
4
- "category": "acp",
5
- "displayName": "Claude Agent",
6
- "icon": "🟠",
7
- "install": "npm install -g @zed-industries/claude-agent-acp (requires ANTHROPIC_API_KEY)",
8
- "spawn": {
9
- "command": "claude-agent-acp",
10
- "args": [],
11
- "shell": false
12
- },
13
- "auth": [
14
- {
15
- "type": "env_var",
16
- "id": "anthropic",
17
- "name": "Anthropic API Key",
18
- "vars": [
19
- {
20
- "name": "ANTHROPIC_API_KEY"
21
- }
22
- ],
23
- "link": "https://console.anthropic.com/settings/keys"
24
- }
25
- ],
26
- "settings": {
27
- "autoApprove": {
28
- "type": "boolean",
29
- "default": false,
30
- "public": true,
31
- "label": "Auto Approve",
32
- "description": "Automatically approve all tool calls without user confirmation"
33
- },
34
- "approvalAlert": {
35
- "type": "boolean",
36
- "default": true,
37
- "public": true,
38
- "label": "Approval Alerts",
39
- "description": "Show notification when Claude requires approval"
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,54 +0,0 @@
1
- {
2
- "type": "cline-acp",
3
- "name": "Cline (ACP)",
4
- "category": "acp",
5
- "displayName": "Cline (ACP)",
6
- "icon": "🔵",
7
- "install": "npm install -g cline",
8
- "spawn": {
9
- "command": "cline",
10
- "args": [
11
- "--acp"
12
- ],
13
- "shell": false
14
- },
15
- "auth": [
16
- {
17
- "type": "agent",
18
- "id": "cline-settings",
19
- "name": "Cline Settings",
20
- "description": "Configure API keys through Cline interactive setup"
21
- }
22
- ],
23
- "settings": {
24
- "autoApprove": {
25
- "type": "boolean",
26
- "default": false,
27
- "public": true,
28
- "label": "Auto Approve",
29
- "description": "Automatically approve all tool calls without user confirmation"
30
- },
31
- "approvalAlert": {
32
- "type": "boolean",
33
- "default": true,
34
- "public": true,
35
- "label": "Approval Alerts",
36
- "description": "Show notification when Cline requires approval"
37
- },
38
- "longGeneratingAlert": {
39
- "type": "boolean",
40
- "default": true,
41
- "public": true,
42
- "label": "Long Generation Alert",
43
- "description": "Alert when generation takes too long"
44
- },
45
- "longGeneratingThresholdSec": {
46
- "type": "number",
47
- "default": 180,
48
- "public": true,
49
- "label": "Long Generation Threshold (sec)",
50
- "min": 30,
51
- "max": 600
52
- }
53
- }
54
- }
@@ -1,54 +0,0 @@
1
- {
2
- "type": "codebuddy-acp",
3
- "name": "Codebuddy Code (ACP)",
4
- "category": "acp",
5
- "displayName": "Codebuddy Code",
6
- "icon": "🐧",
7
- "install": "npm install -g @tencent-ai/codebuddy-code",
8
- "spawn": {
9
- "command": "codebuddy-code",
10
- "args": [
11
- "--acp"
12
- ],
13
- "shell": false
14
- },
15
- "auth": [
16
- {
17
- "type": "agent",
18
- "id": "tencent",
19
- "name": "Tencent Cloud Auth",
20
- "description": "Authenticate through Tencent Cloud account"
21
- }
22
- ],
23
- "settings": {
24
- "autoApprove": {
25
- "type": "boolean",
26
- "default": false,
27
- "public": true,
28
- "label": "Auto Approve",
29
- "description": "Automatically approve all tool calls without user confirmation"
30
- },
31
- "approvalAlert": {
32
- "type": "boolean",
33
- "default": true,
34
- "public": true,
35
- "label": "Approval Alerts",
36
- "description": "Show notification when agent requires approval"
37
- },
38
- "longGeneratingAlert": {
39
- "type": "boolean",
40
- "default": true,
41
- "public": true,
42
- "label": "Long Generation Alert",
43
- "description": "Alert when generation takes too long"
44
- },
45
- "longGeneratingThresholdSec": {
46
- "type": "number",
47
- "default": 180,
48
- "public": true,
49
- "label": "Long Generation Threshold (sec)",
50
- "min": 30,
51
- "max": 600
52
- }
53
- }
54
- }