@adhdev/daemon-core 0.5.3

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 (217) hide show
  1. package/dist/index.d.ts +2662 -0
  2. package/dist/index.js +11341 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +48 -0
  5. package/providers/_builtin/.github/workflows/generate-registry.yml +57 -0
  6. package/providers/_builtin/COMPATIBILITY.md +217 -0
  7. package/providers/_builtin/CONTRIBUTING.md +200 -0
  8. package/providers/_builtin/README.md +119 -0
  9. package/providers/_builtin/_helpers/index.js +188 -0
  10. package/providers/_builtin/acp/agentpool/provider.json +54 -0
  11. package/providers/_builtin/acp/amp/provider.json +52 -0
  12. package/providers/_builtin/acp/auggie/provider.json +57 -0
  13. package/providers/_builtin/acp/autodev/provider.json +54 -0
  14. package/providers/_builtin/acp/autohand/provider.json +52 -0
  15. package/providers/_builtin/acp/blackbox-ai/provider.json +54 -0
  16. package/providers/_builtin/acp/claude-agent/provider.json +57 -0
  17. package/providers/_builtin/acp/cline-acp/provider.json +54 -0
  18. package/providers/_builtin/acp/codebuddy/provider.json +54 -0
  19. package/providers/_builtin/acp/codex-cli/provider.json +57 -0
  20. package/providers/_builtin/acp/corust-agent/provider.json +52 -0
  21. package/providers/_builtin/acp/crow-cli/provider.json +54 -0
  22. package/providers/_builtin/acp/cursor-acp/provider.json +54 -0
  23. package/providers/_builtin/acp/deepagents/provider.json +52 -0
  24. package/providers/_builtin/acp/dimcode/provider.json +54 -0
  25. package/providers/_builtin/acp/docker-cagent/provider.json +57 -0
  26. package/providers/_builtin/acp/factory-droid/provider.json +60 -0
  27. package/providers/_builtin/acp/fast-agent/provider.json +52 -0
  28. package/providers/_builtin/acp/gemini-cli/provider.json +114 -0
  29. package/providers/_builtin/acp/github-copilot/provider.json +54 -0
  30. package/providers/_builtin/acp/goose/provider.json +57 -0
  31. package/providers/_builtin/acp/junie/provider.json +52 -0
  32. package/providers/_builtin/acp/kilo/provider.json +54 -0
  33. package/providers/_builtin/acp/kimi-cli/provider.json +57 -0
  34. package/providers/_builtin/acp/minion-code/provider.json +52 -0
  35. package/providers/_builtin/acp/mistral-vibe/provider.json +57 -0
  36. package/providers/_builtin/acp/nova/provider.json +54 -0
  37. package/providers/_builtin/acp/openclaw/provider.json +54 -0
  38. package/providers/_builtin/acp/opencode/provider.json +52 -0
  39. package/providers/_builtin/acp/openhands/provider.json +54 -0
  40. package/providers/_builtin/acp/pi-acp/provider.json +52 -0
  41. package/providers/_builtin/acp/qoder/provider.json +54 -0
  42. package/providers/_builtin/acp/qwen-code/provider.json +60 -0
  43. package/providers/_builtin/acp/stakpak/provider.json +54 -0
  44. package/providers/_builtin/acp/vtcode/provider.json +54 -0
  45. package/providers/_builtin/cli/claude-cli/provider.json +100 -0
  46. package/providers/_builtin/cli/codex-cli/provider.json +89 -0
  47. package/providers/_builtin/cli/gemini-cli/provider.json +93 -0
  48. package/providers/_builtin/docs/CDP_SELECTOR_GUIDE.md +370 -0
  49. package/providers/_builtin/docs/PROVIDER_GUIDE.md +916 -0
  50. package/providers/_builtin/extension/cline/provider.json +35 -0
  51. package/providers/_builtin/extension/cline/scripts/focus_editor.js +48 -0
  52. package/providers/_builtin/extension/cline/scripts/list_chats.js +100 -0
  53. package/providers/_builtin/extension/cline/scripts/list_models.js +43 -0
  54. package/providers/_builtin/extension/cline/scripts/list_modes.js +35 -0
  55. package/providers/_builtin/extension/cline/scripts/new_session.js +85 -0
  56. package/providers/_builtin/extension/cline/scripts/open_panel.js +25 -0
  57. package/providers/_builtin/extension/cline/scripts/read_chat.js +257 -0
  58. package/providers/_builtin/extension/cline/scripts/resolve_action.js +83 -0
  59. package/providers/_builtin/extension/cline/scripts/send_message.js +95 -0
  60. package/providers/_builtin/extension/cline/scripts/set_mode.js +36 -0
  61. package/providers/_builtin/extension/cline/scripts/set_model.js +36 -0
  62. package/providers/_builtin/extension/cline/scripts/switch_session.js +206 -0
  63. package/providers/_builtin/extension/cline/scripts.js +73 -0
  64. package/providers/_builtin/extension/roo-code/provider.json +35 -0
  65. package/providers/_builtin/extension/roo-code/scripts.js +659 -0
  66. package/providers/_builtin/ide/antigravity/provider.json +68 -0
  67. package/providers/_builtin/ide/antigravity/scripts/1.106/focus_editor.js +20 -0
  68. package/providers/_builtin/ide/antigravity/scripts/1.106/list_chats.js +137 -0
  69. package/providers/_builtin/ide/antigravity/scripts/1.106/list_models.js +38 -0
  70. package/providers/_builtin/ide/antigravity/scripts/1.106/list_modes.js +48 -0
  71. package/providers/_builtin/ide/antigravity/scripts/1.106/new_session.js +75 -0
  72. package/providers/_builtin/ide/antigravity/scripts/1.106/read_chat.js +262 -0
  73. package/providers/_builtin/ide/antigravity/scripts/1.106/resolve_action.js +68 -0
  74. package/providers/_builtin/ide/antigravity/scripts/1.106/scripts.js +57 -0
  75. package/providers/_builtin/ide/antigravity/scripts/1.106/send_message.js +56 -0
  76. package/providers/_builtin/ide/antigravity/scripts/1.106/set_mode.js +34 -0
  77. package/providers/_builtin/ide/antigravity/scripts/1.106/set_model.js +47 -0
  78. package/providers/_builtin/ide/antigravity/scripts/1.106/switch_session.js +114 -0
  79. package/providers/_builtin/ide/antigravity/scripts/1.107/focus_editor.js +20 -0
  80. package/providers/_builtin/ide/antigravity/scripts/1.107/list_chats.js +137 -0
  81. package/providers/_builtin/ide/antigravity/scripts/1.107/list_models.js +61 -0
  82. package/providers/_builtin/ide/antigravity/scripts/1.107/list_modes.js +72 -0
  83. package/providers/_builtin/ide/antigravity/scripts/1.107/new_session.js +75 -0
  84. package/providers/_builtin/ide/antigravity/scripts/1.107/read_chat.js +262 -0
  85. package/providers/_builtin/ide/antigravity/scripts/1.107/resolve_action.js +68 -0
  86. package/providers/_builtin/ide/antigravity/scripts/1.107/scripts.js +67 -0
  87. package/providers/_builtin/ide/antigravity/scripts/1.107/send_message.js +56 -0
  88. package/providers/_builtin/ide/antigravity/scripts/1.107/set_mode.js +67 -0
  89. package/providers/_builtin/ide/antigravity/scripts/1.107/set_model.js +72 -0
  90. package/providers/_builtin/ide/antigravity/scripts/1.107/switch_session.js +114 -0
  91. package/providers/_builtin/ide/cursor/provider.json +70 -0
  92. package/providers/_builtin/ide/cursor/scripts/0.49/dismiss_notification.js +30 -0
  93. package/providers/_builtin/ide/cursor/scripts/0.49/focus_editor.js +13 -0
  94. package/providers/_builtin/ide/cursor/scripts/0.49/list_models.js +78 -0
  95. package/providers/_builtin/ide/cursor/scripts/0.49/list_modes.js +40 -0
  96. package/providers/_builtin/ide/cursor/scripts/0.49/list_notifications.js +23 -0
  97. package/providers/_builtin/ide/cursor/scripts/0.49/list_sessions.js +42 -0
  98. package/providers/_builtin/ide/cursor/scripts/0.49/new_session.js +20 -0
  99. package/providers/_builtin/ide/cursor/scripts/0.49/open_panel.js +23 -0
  100. package/providers/_builtin/ide/cursor/scripts/0.49/read_chat.js +75 -0
  101. package/providers/_builtin/ide/cursor/scripts/0.49/resolve_action.js +19 -0
  102. package/providers/_builtin/ide/cursor/scripts/0.49/scripts.js +78 -0
  103. package/providers/_builtin/ide/cursor/scripts/0.49/send_message.js +23 -0
  104. package/providers/_builtin/ide/cursor/scripts/0.49/set_mode.js +38 -0
  105. package/providers/_builtin/ide/cursor/scripts/0.49/set_model.js +81 -0
  106. package/providers/_builtin/ide/cursor/scripts/0.49/switch_session.js +28 -0
  107. package/providers/_builtin/ide/kiro/provider.json +67 -0
  108. package/providers/_builtin/ide/kiro/scripts/focus_editor.js +20 -0
  109. package/providers/_builtin/ide/kiro/scripts/open_panel.js +47 -0
  110. package/providers/_builtin/ide/kiro/scripts/resolve_action.js +54 -0
  111. package/providers/_builtin/ide/kiro/scripts/send_message.js +29 -0
  112. package/providers/_builtin/ide/kiro/scripts/webview_list_models.js +39 -0
  113. package/providers/_builtin/ide/kiro/scripts/webview_list_modes.js +39 -0
  114. package/providers/_builtin/ide/kiro/scripts/webview_list_sessions.js +21 -0
  115. package/providers/_builtin/ide/kiro/scripts/webview_new_session.js +34 -0
  116. package/providers/_builtin/ide/kiro/scripts/webview_read_chat.js +68 -0
  117. package/providers/_builtin/ide/kiro/scripts/webview_send_message.js +72 -0
  118. package/providers/_builtin/ide/kiro/scripts/webview_set_mode.js +15 -0
  119. package/providers/_builtin/ide/kiro/scripts/webview_set_model.js +15 -0
  120. package/providers/_builtin/ide/kiro/scripts/webview_switch_session.js +26 -0
  121. package/providers/_builtin/ide/kiro/scripts.js +62 -0
  122. package/providers/_builtin/ide/pearai/provider.json +67 -0
  123. package/providers/_builtin/ide/pearai/scripts/focus_editor.js +20 -0
  124. package/providers/_builtin/ide/pearai/scripts/list_sessions.js +38 -0
  125. package/providers/_builtin/ide/pearai/scripts/new_session.js +55 -0
  126. package/providers/_builtin/ide/pearai/scripts/open_panel.js +46 -0
  127. package/providers/_builtin/ide/pearai/scripts/resolve_action.js +54 -0
  128. package/providers/_builtin/ide/pearai/scripts/send_message.js +29 -0
  129. package/providers/_builtin/ide/pearai/scripts/webview_list_models.js +43 -0
  130. package/providers/_builtin/ide/pearai/scripts/webview_list_modes.js +35 -0
  131. package/providers/_builtin/ide/pearai/scripts/webview_list_sessions.js +62 -0
  132. package/providers/_builtin/ide/pearai/scripts/webview_new_session.js +49 -0
  133. package/providers/_builtin/ide/pearai/scripts/webview_read_chat.js +92 -0
  134. package/providers/_builtin/ide/pearai/scripts/webview_resolve_action.js +59 -0
  135. package/providers/_builtin/ide/pearai/scripts/webview_send_message.js +72 -0
  136. package/providers/_builtin/ide/pearai/scripts/webview_set_mode.js +36 -0
  137. package/providers/_builtin/ide/pearai/scripts/webview_set_model.js +36 -0
  138. package/providers/_builtin/ide/pearai/scripts/webview_switch_session.js +34 -0
  139. package/providers/_builtin/ide/pearai/scripts.js +74 -0
  140. package/providers/_builtin/ide/trae/provider.json +66 -0
  141. package/providers/_builtin/ide/trae/scripts/focus_editor.js +20 -0
  142. package/providers/_builtin/ide/trae/scripts/list_chats.js +24 -0
  143. package/providers/_builtin/ide/trae/scripts/list_models.js +39 -0
  144. package/providers/_builtin/ide/trae/scripts/list_modes.js +39 -0
  145. package/providers/_builtin/ide/trae/scripts/new_session.js +30 -0
  146. package/providers/_builtin/ide/trae/scripts/open_panel.js +44 -0
  147. package/providers/_builtin/ide/trae/scripts/read_chat.js +113 -0
  148. package/providers/_builtin/ide/trae/scripts/resolve_action.js +54 -0
  149. package/providers/_builtin/ide/trae/scripts/send_message.js +69 -0
  150. package/providers/_builtin/ide/trae/scripts/set_mode.js +15 -0
  151. package/providers/_builtin/ide/trae/scripts/set_model.js +15 -0
  152. package/providers/_builtin/ide/trae/scripts/switch_session.js +23 -0
  153. package/providers/_builtin/ide/trae/scripts.js +57 -0
  154. package/providers/_builtin/ide/vscode/provider.json +64 -0
  155. package/providers/_builtin/ide/vscode-insiders/provider.json +62 -0
  156. package/providers/_builtin/ide/vscodium/provider.json +63 -0
  157. package/providers/_builtin/ide/windsurf/provider.json +53 -0
  158. package/providers/_builtin/ide/windsurf/scripts/focus_editor.js +30 -0
  159. package/providers/_builtin/ide/windsurf/scripts/list_chats.js +117 -0
  160. package/providers/_builtin/ide/windsurf/scripts/list_models.js +39 -0
  161. package/providers/_builtin/ide/windsurf/scripts/list_modes.js +39 -0
  162. package/providers/_builtin/ide/windsurf/scripts/new_session.js +69 -0
  163. package/providers/_builtin/ide/windsurf/scripts/open_panel.js +58 -0
  164. package/providers/_builtin/ide/windsurf/scripts/read_chat.js +297 -0
  165. package/providers/_builtin/ide/windsurf/scripts/resolve_action.js +68 -0
  166. package/providers/_builtin/ide/windsurf/scripts/send_message.js +87 -0
  167. package/providers/_builtin/ide/windsurf/scripts/set_mode.js +15 -0
  168. package/providers/_builtin/ide/windsurf/scripts/set_model.js +15 -0
  169. package/providers/_builtin/ide/windsurf/scripts/switch_session.js +58 -0
  170. package/providers/_builtin/ide/windsurf/scripts.js +57 -0
  171. package/providers/_builtin/registry.json +266 -0
  172. package/providers/_builtin/validate.js +156 -0
  173. package/src/agent-stream/index.ts +6 -0
  174. package/src/agent-stream/manager.ts +286 -0
  175. package/src/agent-stream/poller.ts +154 -0
  176. package/src/agent-stream/provider-adapter.ts +138 -0
  177. package/src/agent-stream/types.ts +61 -0
  178. package/src/boot/daemon-lifecycle.ts +252 -0
  179. package/src/cdp/devtools.ts +335 -0
  180. package/src/cdp/initializer.ts +191 -0
  181. package/src/cdp/manager.ts +897 -0
  182. package/src/cdp/scanner.ts +185 -0
  183. package/src/cdp/setup.ts +150 -0
  184. package/src/cli-adapter-types.ts +25 -0
  185. package/src/cli-adapters/provider-cli-adapter.ts +448 -0
  186. package/src/commands/cdp-commands.ts +208 -0
  187. package/src/commands/chat-commands.ts +675 -0
  188. package/src/commands/cli-manager.ts +353 -0
  189. package/src/commands/handler.ts +328 -0
  190. package/src/commands/router.ts +258 -0
  191. package/src/commands/stream-commands.ts +325 -0
  192. package/src/config/chat-history.ts +211 -0
  193. package/src/config/config.ts +219 -0
  194. package/src/daemon/dev-server.ts +2378 -0
  195. package/src/daemon/scaffold-template.ts +394 -0
  196. package/src/daemon-core.ts +50 -0
  197. package/src/detection/cli-detector.ts +89 -0
  198. package/src/detection/ide-detector.ts +157 -0
  199. package/src/index.ts +103 -0
  200. package/src/installer.ts +263 -0
  201. package/src/ipc-protocol.ts +133 -0
  202. package/src/launch.ts +433 -0
  203. package/src/logging/command-log.ts +180 -0
  204. package/src/logging/logger.ts +316 -0
  205. package/src/providers/acp-provider-instance.ts +1140 -0
  206. package/src/providers/cli-provider-instance.ts +207 -0
  207. package/src/providers/contracts.ts +524 -0
  208. package/src/providers/extension-provider-instance.ts +156 -0
  209. package/src/providers/ide-provider-instance.ts +377 -0
  210. package/src/providers/index.ts +18 -0
  211. package/src/providers/provider-instance-manager.ts +182 -0
  212. package/src/providers/provider-instance.ts +112 -0
  213. package/src/providers/provider-loader.ts +1031 -0
  214. package/src/providers/status-monitor.ts +125 -0
  215. package/src/providers/version-archive.ts +266 -0
  216. package/src/status/reporter.ts +294 -0
  217. package/src/types.ts +206 -0
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Windsurf v1 — resolve_action
3
+ *
4
+ * 승인 다이얼로그/인라인 버튼을 클릭합니다.
5
+ *
6
+ * 파라미터: ${ BUTTON_TEXT } — 클릭할 버튼 텍스트 (lowercase)
7
+ *
8
+ * 최종 확인: Windsurf (2026-03-06)
9
+ */
10
+ (() => {
11
+ try {
12
+ const want = ${ BUTTON_TEXT };
13
+ const normalize = (s) => (s || '').replace(/[\s\u200b\u00a0]+/g, ' ').trim().toLowerCase();
14
+ const matches = (text) => {
15
+ const t = normalize(text);
16
+ if (!t) return false;
17
+ if (t === want) return true;
18
+ if (t.indexOf(want) === 0) return true;
19
+ if (want === 'run' && (/^run\s*/.test(t) || t === 'enter' || t === '⏎')) return true;
20
+ if (want === 'approve' && (t.includes('approve') || t === 'always allow' || t === 'allow')) return true;
21
+ if (want === 'reject' && (t.includes('reject') || t === 'deny' || t === 'always deny')) return true;
22
+ return false;
23
+ };
24
+ const click = (el) => {
25
+ el.focus?.();
26
+ const rect = el.getBoundingClientRect();
27
+ const x = rect.left + rect.width / 2;
28
+ const y = rect.top + rect.height / 2;
29
+ for (const type of ['pointerdown', 'mousedown', 'pointerup', 'mouseup', 'click']) {
30
+ el.dispatchEvent(new PointerEvent(type, {
31
+ bubbles: true, cancelable: true, view: window,
32
+ clientX: x, clientY: y, pointerId: 1, pointerType: 'mouse'
33
+ }));
34
+ }
35
+ return true;
36
+ };
37
+
38
+ // 1. Dialog 내부
39
+ const dialog = document.querySelector('.monaco-dialog-box, [role="dialog"]');
40
+ if (dialog && dialog.offsetWidth > 80) {
41
+ const btns = dialog.querySelectorAll('.monaco-button, button');
42
+ for (const b of btns) {
43
+ if (matches(b.textContent)) return click(b);
44
+ }
45
+ }
46
+
47
+ // 2. 모든 보이는 버튼
48
+ const sel = 'button, [role="button"], .monaco-button';
49
+ const allBtns = Array.from(document.querySelectorAll(sel))
50
+ .filter(b => b.offsetWidth > 0 && b.offsetHeight > 0);
51
+ for (const b of allBtns) {
52
+ if (matches(b.textContent)) return click(b);
53
+ }
54
+
55
+ // 3. Enter 키 폴백 (run)
56
+ if (want === 'run') {
57
+ document.activeElement?.dispatchEvent(new KeyboardEvent('keydown', {
58
+ key: 'Enter', code: 'Enter', keyCode: 13,
59
+ bubbles: true, cancelable: true
60
+ }));
61
+ return true;
62
+ }
63
+
64
+ return false;
65
+ } catch (e) {
66
+ return false;
67
+ }
68
+ })()
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Windsurf v1 — send_message
3
+ *
4
+ * Windsurf는 Lexical 에디터 ([data-lexical-editor="true"])를 사용합니다.
5
+ * contenteditable div이므로 execCommand('insertText') 또는 InputEvent로 입력 가능.
6
+ *
7
+ * ⚠️ Lexical은 입력 이벤트를 정밀하게 감지하므로:
8
+ * - execCommand('insertText')가 가장 안정적
9
+ * - nativeSetter 방식은 동작하지 않음
10
+ * - InputEvent('insertText')를 폴백으로 사용
11
+ *
12
+ * Enter 키는 KeyboardEvent 전체 시퀀스 필요 (keydown + keypress + keyup).
13
+ *
14
+ * 파라미터: ${ MESSAGE }
15
+ * 최종 확인: Windsurf 1.108.x (2026-03-10)
16
+ */
17
+ (async () => {
18
+ try {
19
+ const msg = ${ MESSAGE };
20
+
21
+ // ─── 1. Lexical 에디터 찾기 (폴백 체인) ───
22
+ const editor =
23
+ document.querySelector('[data-lexical-editor="true"]') ||
24
+ document.querySelector('[contenteditable="true"][role="textbox"]') ||
25
+ document.querySelector('.cascade-input [contenteditable="true"]') ||
26
+ document.querySelector('.chat-input textarea') ||
27
+ document.querySelector('textarea:not(.xterm-helper-textarea)');
28
+
29
+ if (!editor) return 'error: no input found';
30
+
31
+ const isTextarea = editor.tagName === 'TEXTAREA';
32
+
33
+ if (isTextarea) {
34
+ // ─── textarea 폴백 (미로그인 등) ───
35
+ editor.focus();
36
+ const proto = HTMLTextAreaElement.prototype;
37
+ const nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value')?.set;
38
+ if (nativeSetter) nativeSetter.call(editor, msg);
39
+ else editor.value = msg;
40
+
41
+ editor.dispatchEvent(new Event('input', { bubbles: true }));
42
+ editor.dispatchEvent(new Event('change', { bubbles: true }));
43
+
44
+ await new Promise(r => setTimeout(r, 300));
45
+
46
+ const enterOpts = {
47
+ key: 'Enter', code: 'Enter',
48
+ keyCode: 13, which: 13,
49
+ bubbles: true, cancelable: true, composed: true,
50
+ };
51
+ editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
52
+ editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
53
+ editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
54
+
55
+ return 'sent';
56
+ }
57
+
58
+ // ─── 2. contenteditable (Lexical) 에디터 ───
59
+ editor.focus();
60
+
61
+ // 기존 내용 선택 후 삭제
62
+ document.execCommand('selectAll', false, null);
63
+ document.execCommand('delete', false, null);
64
+
65
+ // 텍스트 삽입 (Lexical은 execCommand('insertText')를 인식)
66
+ document.execCommand('insertText', false, msg);
67
+
68
+ // React/Lexical에 변경 알림
69
+ editor.dispatchEvent(new Event('input', { bubbles: true }));
70
+
71
+ await new Promise(r => setTimeout(r, 300));
72
+
73
+ // ─── 3. Enter 키 전송 (전체 시퀀스) ───
74
+ const enterOpts = {
75
+ key: 'Enter', code: 'Enter',
76
+ keyCode: 13, which: 13,
77
+ bubbles: true, cancelable: true, composed: true,
78
+ };
79
+ editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
80
+ editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
81
+ editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
82
+
83
+ return 'sent';
84
+ } catch (e) {
85
+ return 'error: ' + e.message;
86
+ }
87
+ })()
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generic fallback — set_model
3
+ * ${ MODEL }
4
+ */
5
+ (() => {
6
+ try {
7
+ const want = ${ MODEL } || '';
8
+ const norm = (t) => t.toLowerCase().trim();
9
+
10
+ // Very basic click attempt
11
+ return JSON.stringify({ success: false, error: 'Model selection requires UI interaction not supported by generic script' });
12
+ } catch (e) {
13
+ return JSON.stringify({ success: false, error: e.message });
14
+ }
15
+ })()
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generic fallback — set_model
3
+ * ${ MODEL }
4
+ */
5
+ (() => {
6
+ try {
7
+ const want = ${ MODEL } || '';
8
+ const norm = (t) => t.toLowerCase().trim();
9
+
10
+ // Very basic click attempt
11
+ return JSON.stringify({ success: false, error: 'Model selection requires UI interaction not supported by generic script' });
12
+ } catch (e) {
13
+ return JSON.stringify({ success: false, error: e.message });
14
+ }
15
+ })()
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Windsurf v1 — switch_session
3
+ *
4
+ * Cascade 세션(대화) 탭을 전환합니다.
5
+ * cascade-tab-{id} 내부의 실제 클릭 가능한 자식 DIV의
6
+ * React onClick 핸들러를 직접 호출합니다.
7
+ *
8
+ * 파라미터: ${ SESSION_ID } — 전환할 세션 ID (cascade-tab의 UUID)
9
+ *
10
+ * 최종 확인: Windsurf 1.108.x (2026-03-10)
11
+ */
12
+ (() => {
13
+ try {
14
+ const id = ${ SESSION_ID };
15
+
16
+ // Helper: find React onClick on an element or its children
17
+ function clickReact(el) {
18
+ // Check element itself and children for React onClick
19
+ const targets = [el, ...el.querySelectorAll('*')];
20
+ for (const t of targets) {
21
+ const rp = Object.keys(t).find(k => k.startsWith('__reactProps'));
22
+ if (rp && typeof t[rp].onClick === 'function') {
23
+ t[rp].onClick({
24
+ preventDefault: () => { },
25
+ stopPropagation: () => { },
26
+ nativeEvent: { stopImmediatePropagation: () => { } },
27
+ target: t, currentTarget: t, button: 0, type: 'click'
28
+ });
29
+ return true;
30
+ }
31
+ }
32
+ return false;
33
+ }
34
+
35
+ // 1. cascade-tab-{id} 요소 찾기
36
+ const tab = document.getElementById('cascade-tab-' + id);
37
+ if (tab) {
38
+ if (clickReact(tab)) return 'switched';
39
+ // Fallback: DOM click
40
+ tab.click();
41
+ return 'switched-dom';
42
+ }
43
+
44
+ // 2. 제목으로 매칭
45
+ const tabs = document.querySelectorAll('[id^="cascade-tab-"]');
46
+ for (const t of tabs) {
47
+ if (t.textContent?.trim() === id) {
48
+ if (clickReact(t)) return 'switched-by-title';
49
+ t.click();
50
+ return 'switched-by-title-dom';
51
+ }
52
+ }
53
+
54
+ return 'not_found';
55
+ } catch (e) {
56
+ return 'error: ' + e.message;
57
+ }
58
+ })()
@@ -0,0 +1,57 @@
1
+ /**
2
+ * CDP Scripts for Windsurf
3
+ */
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const SCRIPTS_DIR = path.join(__dirname, 'scripts');
8
+ function loadScript(name) {
9
+ try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
10
+ catch { return null; }
11
+ }
12
+
13
+
14
+ module.exports.readChat = function readChat() { return loadScript('read_chat.js'); };
15
+
16
+ module.exports.sendMessage = function sendMessage(text) {
17
+ const s = loadScript('send_message.js');
18
+ return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
19
+ };
20
+
21
+ module.exports.listSessions = function listSessions() { return loadScript('list_chats.js'); };
22
+
23
+ module.exports.switchSession = function switchSession(sessionId) {
24
+ const s = loadScript('switch_session.js');
25
+ return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
26
+ };
27
+
28
+ module.exports.newSession = function newSession() { return loadScript('new_session.js'); };
29
+
30
+ module.exports.resolveAction = function resolveAction(params) {
31
+ const action = typeof params === 'string' ? params : params?.action || 'approve';
32
+ const buttonText = params?.button || params?.buttonText
33
+ || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
34
+ const s = loadScript('resolve_action.js');
35
+ return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
36
+ };
37
+
38
+ module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
39
+
40
+ module.exports.listModels = function listModels() { return loadScript('list_models.js'); };
41
+
42
+ module.exports.setModel = function setModel(params) {
43
+ const model = typeof params === 'string' ? params : params?.model;
44
+ const s = loadScript('set_model.js');
45
+ return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
46
+ };
47
+
48
+ module.exports.listModes = function listModes() { return loadScript('list_modes.js'); };
49
+
50
+ module.exports.setMode = function setMode(params) {
51
+ const mode = typeof params === 'string' ? params : params?.mode;
52
+ const s = loadScript('set_mode.js');
53
+ return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
54
+ };
55
+
56
+ module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
57
+
@@ -0,0 +1,266 @@
1
+ {
2
+ "version": "2026.03.19",
3
+ "providers": {
4
+ "agentpool-acp": {
5
+ "providerVersion": "0.0.0",
6
+ "category": "acp",
7
+ "name": "AgentPool (ACP)"
8
+ },
9
+ "amp-acp": {
10
+ "providerVersion": "0.0.0",
11
+ "category": "acp",
12
+ "name": "Amp (ACP)"
13
+ },
14
+ "auggie-acp": {
15
+ "providerVersion": "0.0.0",
16
+ "category": "acp",
17
+ "name": "Auggie CLI (ACP)"
18
+ },
19
+ "autodev-acp": {
20
+ "providerVersion": "0.0.0",
21
+ "category": "acp",
22
+ "name": "AutoDev (ACP)"
23
+ },
24
+ "autohand-acp": {
25
+ "providerVersion": "0.0.0",
26
+ "category": "acp",
27
+ "name": "Autohand Code (ACP)"
28
+ },
29
+ "blackbox-ai-acp": {
30
+ "providerVersion": "0.0.0",
31
+ "category": "acp",
32
+ "name": "Blackbox AI (ACP)"
33
+ },
34
+ "claude-agent-acp": {
35
+ "providerVersion": "0.0.0",
36
+ "category": "acp",
37
+ "name": "Claude Agent (ACP)"
38
+ },
39
+ "cline-acp": {
40
+ "providerVersion": "0.0.0",
41
+ "category": "acp",
42
+ "name": "Cline (ACP)"
43
+ },
44
+ "codebuddy-acp": {
45
+ "providerVersion": "0.0.0",
46
+ "category": "acp",
47
+ "name": "Codebuddy Code (ACP)"
48
+ },
49
+ "codex-acp": {
50
+ "providerVersion": "0.0.0",
51
+ "category": "acp",
52
+ "name": "Codex (ACP)"
53
+ },
54
+ "corust-agent-acp": {
55
+ "providerVersion": "0.0.0",
56
+ "category": "acp",
57
+ "name": "Corust Agent (ACP)"
58
+ },
59
+ "crow-cli-acp": {
60
+ "providerVersion": "0.0.0",
61
+ "category": "acp",
62
+ "name": "crow-cli (ACP)"
63
+ },
64
+ "cursor-acp": {
65
+ "providerVersion": "0.0.0",
66
+ "category": "acp",
67
+ "name": "Cursor (ACP)"
68
+ },
69
+ "deepagents-acp": {
70
+ "providerVersion": "0.0.0",
71
+ "category": "acp",
72
+ "name": "DeepAgents (ACP)"
73
+ },
74
+ "dimcode-acp": {
75
+ "providerVersion": "0.0.0",
76
+ "category": "acp",
77
+ "name": "DimCode (ACP)"
78
+ },
79
+ "docker-cagent-acp": {
80
+ "providerVersion": "0.0.0",
81
+ "category": "acp",
82
+ "name": "Docker cagent (ACP)"
83
+ },
84
+ "factory-droid-acp": {
85
+ "providerVersion": "0.0.0",
86
+ "category": "acp",
87
+ "name": "Factory Droid (ACP)"
88
+ },
89
+ "fast-agent-acp": {
90
+ "providerVersion": "0.0.0",
91
+ "category": "acp",
92
+ "name": "fast-agent (ACP)"
93
+ },
94
+ "gemini-acp": {
95
+ "providerVersion": "0.0.0",
96
+ "category": "acp",
97
+ "name": "Gemini CLI (ACP)"
98
+ },
99
+ "github-copilot-acp": {
100
+ "providerVersion": "0.0.0",
101
+ "category": "acp",
102
+ "name": "GitHub Copilot (ACP)"
103
+ },
104
+ "goose-acp": {
105
+ "providerVersion": "0.0.0",
106
+ "category": "acp",
107
+ "name": "Goose (ACP)"
108
+ },
109
+ "junie-acp": {
110
+ "providerVersion": "0.0.0",
111
+ "category": "acp",
112
+ "name": "Junie (ACP)"
113
+ },
114
+ "kilo-acp": {
115
+ "providerVersion": "0.0.0",
116
+ "category": "acp",
117
+ "name": "Kilo (ACP)"
118
+ },
119
+ "kimi-acp": {
120
+ "providerVersion": "0.0.0",
121
+ "category": "acp",
122
+ "name": "Kimi CLI (ACP)"
123
+ },
124
+ "minion-code-acp": {
125
+ "providerVersion": "0.0.0",
126
+ "category": "acp",
127
+ "name": "Minion Code (ACP)"
128
+ },
129
+ "mistral-vibe-acp": {
130
+ "providerVersion": "0.0.0",
131
+ "category": "acp",
132
+ "name": "Mistral Vibe (ACP)"
133
+ },
134
+ "nova-acp": {
135
+ "providerVersion": "0.0.0",
136
+ "category": "acp",
137
+ "name": "Nova (ACP)"
138
+ },
139
+ "openclaw-acp": {
140
+ "providerVersion": "0.0.0",
141
+ "category": "acp",
142
+ "name": "OpenClaw (ACP)"
143
+ },
144
+ "opencode-acp": {
145
+ "providerVersion": "0.0.0",
146
+ "category": "acp",
147
+ "name": "OpenCode (ACP)"
148
+ },
149
+ "openhands-acp": {
150
+ "providerVersion": "0.0.0",
151
+ "category": "acp",
152
+ "name": "OpenHands (ACP)"
153
+ },
154
+ "pi-acp": {
155
+ "providerVersion": "0.0.0",
156
+ "category": "acp",
157
+ "name": "pi ACP"
158
+ },
159
+ "qoder-acp": {
160
+ "providerVersion": "0.0.0",
161
+ "category": "acp",
162
+ "name": "Qoder CLI (ACP)"
163
+ },
164
+ "qwen-code-acp": {
165
+ "providerVersion": "0.0.0",
166
+ "category": "acp",
167
+ "name": "Qwen Code (ACP)"
168
+ },
169
+ "stakpak-acp": {
170
+ "providerVersion": "0.0.0",
171
+ "category": "acp",
172
+ "name": "Stakpak (ACP)"
173
+ },
174
+ "vtcode-acp": {
175
+ "providerVersion": "0.0.0",
176
+ "category": "acp",
177
+ "name": "VT Code (ACP)"
178
+ },
179
+ "claude-cli": {
180
+ "providerVersion": "0.0.0",
181
+ "category": "cli",
182
+ "name": "Claude Code"
183
+ },
184
+ "codex-cli": {
185
+ "providerVersion": "0.0.0",
186
+ "category": "cli",
187
+ "name": "Codex CLI"
188
+ },
189
+ "gemini-cli": {
190
+ "providerVersion": "0.0.0",
191
+ "category": "cli",
192
+ "name": "Gemini CLI"
193
+ },
194
+ "cline": {
195
+ "providerVersion": "0.0.0",
196
+ "category": "extension",
197
+ "name": "Cline"
198
+ },
199
+ "roo-code": {
200
+ "providerVersion": "0.0.0",
201
+ "category": "extension",
202
+ "name": "Roo Code"
203
+ },
204
+ "antigravity": {
205
+ "providerVersion": "1.0.0",
206
+ "category": "ide",
207
+ "name": "Antigravity",
208
+ "compatibility": [
209
+ {
210
+ "ideVersion": ">=1.107.0",
211
+ "scriptDir": "scripts/1.107"
212
+ },
213
+ {
214
+ "ideVersion": ">=1.105.0",
215
+ "scriptDir": "scripts/1.106"
216
+ }
217
+ ]
218
+ },
219
+ "cursor": {
220
+ "providerVersion": "1.0.0",
221
+ "category": "ide",
222
+ "name": "Cursor",
223
+ "compatibility": [
224
+ {
225
+ "ideVersion": ">=0.49.0",
226
+ "scriptDir": "scripts/0.49"
227
+ }
228
+ ]
229
+ },
230
+ "kiro": {
231
+ "providerVersion": "0.0.0",
232
+ "category": "ide",
233
+ "name": "Kiro"
234
+ },
235
+ "pearai": {
236
+ "providerVersion": "0.0.0",
237
+ "category": "ide",
238
+ "name": "PearAI"
239
+ },
240
+ "trae": {
241
+ "providerVersion": "0.0.0",
242
+ "category": "ide",
243
+ "name": "Trae"
244
+ },
245
+ "vscode-insiders": {
246
+ "providerVersion": "0.0.0",
247
+ "category": "ide",
248
+ "name": "Visual Studio Code - Insiders"
249
+ },
250
+ "vscode": {
251
+ "providerVersion": "0.0.0",
252
+ "category": "ide",
253
+ "name": "Visual Studio Code"
254
+ },
255
+ "vscodium": {
256
+ "providerVersion": "0.0.0",
257
+ "category": "ide",
258
+ "name": "VSCodium"
259
+ },
260
+ "windsurf": {
261
+ "providerVersion": "0.0.0",
262
+ "category": "ide",
263
+ "name": "Windsurf"
264
+ }
265
+ }
266
+ }