adhdev 0.2.0 → 0.4.1

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 (145) hide show
  1. package/dist/cli-entrypoint.js +18710 -1198
  2. package/dist/cli-entrypoint.js.map +1 -1
  3. package/dist/index.js +18720 -1228
  4. package/dist/index.js.map +1 -1
  5. package/package.json +2 -2
  6. package/providers/_builtin/CONTRIBUTING.md +0 -141
  7. package/providers/_builtin/README.md +0 -51
  8. package/providers/_builtin/_helpers/index.js +0 -188
  9. package/providers/_builtin/acp/agentpool/provider.json +0 -47
  10. package/providers/_builtin/acp/amp/provider.json +0 -45
  11. package/providers/_builtin/acp/auggie/provider.json +0 -50
  12. package/providers/_builtin/acp/autodev/provider.json +0 -47
  13. package/providers/_builtin/acp/autohand/provider.json +0 -45
  14. package/providers/_builtin/acp/blackbox-ai/provider.json +0 -47
  15. package/providers/_builtin/acp/claude-agent/provider.json +0 -50
  16. package/providers/_builtin/acp/cline-acp/provider.json +0 -47
  17. package/providers/_builtin/acp/code-assistant/provider.json +0 -47
  18. package/providers/_builtin/acp/codebuddy/provider.json +0 -47
  19. package/providers/_builtin/acp/codex-cli/provider.json +0 -50
  20. package/providers/_builtin/acp/corust-agent/provider.json +0 -45
  21. package/providers/_builtin/acp/crow-cli/provider.json +0 -47
  22. package/providers/_builtin/acp/cursor-acp/provider.json +0 -47
  23. package/providers/_builtin/acp/deepagents/provider.json +0 -45
  24. package/providers/_builtin/acp/dimcode/provider.json +0 -47
  25. package/providers/_builtin/acp/docker-cagent/provider.json +0 -50
  26. package/providers/_builtin/acp/factory-droid/provider.json +0 -53
  27. package/providers/_builtin/acp/fast-agent/provider.json +0 -45
  28. package/providers/_builtin/acp/fount/provider.json +0 -47
  29. package/providers/_builtin/acp/gemini-cli/provider.json +0 -107
  30. package/providers/_builtin/acp/github-copilot/provider.json +0 -47
  31. package/providers/_builtin/acp/goose/provider.json +0 -50
  32. package/providers/_builtin/acp/junie/provider.json +0 -45
  33. package/providers/_builtin/acp/kilo/provider.json +0 -45
  34. package/providers/_builtin/acp/kimi-cli/provider.json +0 -50
  35. package/providers/_builtin/acp/kiro-cli/provider.json +0 -47
  36. package/providers/_builtin/acp/minion-code/provider.json +0 -45
  37. package/providers/_builtin/acp/mistral-vibe/provider.json +0 -50
  38. package/providers/_builtin/acp/nova/provider.json +0 -47
  39. package/providers/_builtin/acp/openclaw/provider.json +0 -47
  40. package/providers/_builtin/acp/opencode/provider.json +0 -45
  41. package/providers/_builtin/acp/openhands/provider.json +0 -47
  42. package/providers/_builtin/acp/pi-acp/provider.json +0 -45
  43. package/providers/_builtin/acp/qoder/provider.json +0 -47
  44. package/providers/_builtin/acp/qwen-code/provider.json +0 -53
  45. package/providers/_builtin/acp/stakpak/provider.json +0 -47
  46. package/providers/_builtin/acp/vtcode/provider.json +0 -47
  47. package/providers/_builtin/cli/claude-cli/provider.json +0 -78
  48. package/providers/_builtin/cli/codex-cli/provider.json +0 -60
  49. package/providers/_builtin/cli/gemini-cli/provider.json +0 -64
  50. package/providers/_builtin/extension/cline/provider.json +0 -11
  51. package/providers/_builtin/extension/cline/scripts/focus_editor.js +0 -48
  52. package/providers/_builtin/extension/cline/scripts/list_chats.js +0 -100
  53. package/providers/_builtin/extension/cline/scripts/list_models.js +0 -43
  54. package/providers/_builtin/extension/cline/scripts/list_modes.js +0 -35
  55. package/providers/_builtin/extension/cline/scripts/new_session.js +0 -85
  56. package/providers/_builtin/extension/cline/scripts/open_panel.js +0 -25
  57. package/providers/_builtin/extension/cline/scripts/read_chat.js +0 -257
  58. package/providers/_builtin/extension/cline/scripts/resolve_action.js +0 -83
  59. package/providers/_builtin/extension/cline/scripts/send_message.js +0 -95
  60. package/providers/_builtin/extension/cline/scripts/set_mode.js +0 -36
  61. package/providers/_builtin/extension/cline/scripts/set_model.js +0 -36
  62. package/providers/_builtin/extension/cline/scripts/switch_session.js +0 -206
  63. package/providers/_builtin/extension/cline/scripts.js +0 -73
  64. package/providers/_builtin/extension/roo-code/provider.json +0 -11
  65. package/providers/_builtin/extension/roo-code/scripts.js +0 -659
  66. package/providers/_builtin/ide/antigravity/provider.json +0 -32
  67. package/providers/_builtin/ide/antigravity/scripts/focus_editor.js +0 -20
  68. package/providers/_builtin/ide/antigravity/scripts/list_chats.js +0 -137
  69. package/providers/_builtin/ide/antigravity/scripts/list_models.js +0 -38
  70. package/providers/_builtin/ide/antigravity/scripts/list_modes.js +0 -48
  71. package/providers/_builtin/ide/antigravity/scripts/new_session.js +0 -75
  72. package/providers/_builtin/ide/antigravity/scripts/read_chat.js +0 -262
  73. package/providers/_builtin/ide/antigravity/scripts/resolve_action.js +0 -68
  74. package/providers/_builtin/ide/antigravity/scripts/send_message.js +0 -56
  75. package/providers/_builtin/ide/antigravity/scripts/set_mode.js +0 -34
  76. package/providers/_builtin/ide/antigravity/scripts/set_model.js +0 -47
  77. package/providers/_builtin/ide/antigravity/scripts/switch_session.js +0 -114
  78. package/providers/_builtin/ide/antigravity/scripts.js +0 -73
  79. package/providers/_builtin/ide/cursor/provider.json +0 -35
  80. package/providers/_builtin/ide/cursor/scripts.js +0 -452
  81. package/providers/_builtin/ide/kiro/provider.json +0 -36
  82. package/providers/_builtin/ide/kiro/scripts/focus_editor.js +0 -20
  83. package/providers/_builtin/ide/kiro/scripts/open_panel.js +0 -47
  84. package/providers/_builtin/ide/kiro/scripts/resolve_action.js +0 -54
  85. package/providers/_builtin/ide/kiro/scripts/send_message.js +0 -29
  86. package/providers/_builtin/ide/kiro/scripts/webview_list_models.js +0 -39
  87. package/providers/_builtin/ide/kiro/scripts/webview_list_modes.js +0 -39
  88. package/providers/_builtin/ide/kiro/scripts/webview_list_sessions.js +0 -21
  89. package/providers/_builtin/ide/kiro/scripts/webview_new_session.js +0 -34
  90. package/providers/_builtin/ide/kiro/scripts/webview_read_chat.js +0 -68
  91. package/providers/_builtin/ide/kiro/scripts/webview_send_message.js +0 -72
  92. package/providers/_builtin/ide/kiro/scripts/webview_set_mode.js +0 -15
  93. package/providers/_builtin/ide/kiro/scripts/webview_set_model.js +0 -15
  94. package/providers/_builtin/ide/kiro/scripts/webview_switch_session.js +0 -26
  95. package/providers/_builtin/ide/kiro/scripts.js +0 -62
  96. package/providers/_builtin/ide/pearai/provider.json +0 -36
  97. package/providers/_builtin/ide/pearai/scripts/focus_editor.js +0 -20
  98. package/providers/_builtin/ide/pearai/scripts/list_sessions.js +0 -38
  99. package/providers/_builtin/ide/pearai/scripts/new_session.js +0 -55
  100. package/providers/_builtin/ide/pearai/scripts/open_panel.js +0 -46
  101. package/providers/_builtin/ide/pearai/scripts/resolve_action.js +0 -54
  102. package/providers/_builtin/ide/pearai/scripts/send_message.js +0 -29
  103. package/providers/_builtin/ide/pearai/scripts/webview_list_models.js +0 -43
  104. package/providers/_builtin/ide/pearai/scripts/webview_list_modes.js +0 -35
  105. package/providers/_builtin/ide/pearai/scripts/webview_list_sessions.js +0 -62
  106. package/providers/_builtin/ide/pearai/scripts/webview_new_session.js +0 -49
  107. package/providers/_builtin/ide/pearai/scripts/webview_read_chat.js +0 -92
  108. package/providers/_builtin/ide/pearai/scripts/webview_resolve_action.js +0 -59
  109. package/providers/_builtin/ide/pearai/scripts/webview_send_message.js +0 -72
  110. package/providers/_builtin/ide/pearai/scripts/webview_set_mode.js +0 -36
  111. package/providers/_builtin/ide/pearai/scripts/webview_set_model.js +0 -36
  112. package/providers/_builtin/ide/pearai/scripts/webview_switch_session.js +0 -34
  113. package/providers/_builtin/ide/pearai/scripts.js +0 -74
  114. package/providers/_builtin/ide/trae/provider.json +0 -35
  115. package/providers/_builtin/ide/trae/scripts/focus_editor.js +0 -20
  116. package/providers/_builtin/ide/trae/scripts/list_chats.js +0 -24
  117. package/providers/_builtin/ide/trae/scripts/list_models.js +0 -39
  118. package/providers/_builtin/ide/trae/scripts/list_modes.js +0 -39
  119. package/providers/_builtin/ide/trae/scripts/new_session.js +0 -30
  120. package/providers/_builtin/ide/trae/scripts/open_panel.js +0 -44
  121. package/providers/_builtin/ide/trae/scripts/read_chat.js +0 -113
  122. package/providers/_builtin/ide/trae/scripts/resolve_action.js +0 -54
  123. package/providers/_builtin/ide/trae/scripts/send_message.js +0 -69
  124. package/providers/_builtin/ide/trae/scripts/set_mode.js +0 -15
  125. package/providers/_builtin/ide/trae/scripts/set_model.js +0 -15
  126. package/providers/_builtin/ide/trae/scripts/switch_session.js +0 -23
  127. package/providers/_builtin/ide/trae/scripts.js +0 -57
  128. package/providers/_builtin/ide/vscode/provider.json +0 -33
  129. package/providers/_builtin/ide/vscode-insiders/provider.json +0 -31
  130. package/providers/_builtin/ide/vscodium/provider.json +0 -32
  131. package/providers/_builtin/ide/windsurf/provider.json +0 -22
  132. package/providers/_builtin/ide/windsurf/scripts/focus_editor.js +0 -30
  133. package/providers/_builtin/ide/windsurf/scripts/list_chats.js +0 -117
  134. package/providers/_builtin/ide/windsurf/scripts/list_models.js +0 -39
  135. package/providers/_builtin/ide/windsurf/scripts/list_modes.js +0 -39
  136. package/providers/_builtin/ide/windsurf/scripts/new_session.js +0 -69
  137. package/providers/_builtin/ide/windsurf/scripts/open_panel.js +0 -58
  138. package/providers/_builtin/ide/windsurf/scripts/read_chat.js +0 -297
  139. package/providers/_builtin/ide/windsurf/scripts/resolve_action.js +0 -68
  140. package/providers/_builtin/ide/windsurf/scripts/send_message.js +0 -87
  141. package/providers/_builtin/ide/windsurf/scripts/set_mode.js +0 -15
  142. package/providers/_builtin/ide/windsurf/scripts/set_model.js +0 -15
  143. package/providers/_builtin/ide/windsurf/scripts/switch_session.js +0 -58
  144. package/providers/_builtin/ide/windsurf/scripts.js +0 -57
  145. package/providers/_builtin/validate.js +0 -156
@@ -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,21 +0,0 @@
1
- /**
2
- * Kiro — webview_list_sessions (webview iframe 내부에서 실행)
3
- *
4
- * Kiro의 세션 탭 목록을 반환.
5
- * DOM: .kiro-tabs-item
6
- */
7
- (() => {
8
- try {
9
- const tabs = document.querySelectorAll('.kiro-tabs-item');
10
- const sessions = Array.from(tabs).map((tab, i) => {
11
- const label = tab.querySelector('.kiro-tabs-item-label');
12
- const title = (label?.textContent || tab.textContent || '').trim();
13
- const active = tab.classList.contains('active') ||
14
- tab.getAttribute('aria-selected') === 'true';
15
- return { id: String(i), title, active };
16
- });
17
- return JSON.stringify({ sessions });
18
- } catch (e) {
19
- return JSON.stringify({ sessions: [], error: e.message });
20
- }
21
- })()
@@ -1,34 +0,0 @@
1
- /**
2
- * Kiro — webview_new_session (webview iframe 내부에서 실행)
3
- *
4
- * "New Session" 버튼/탭 클릭.
5
- * Kiro는 탭 바에 + 버튼 또는 "New Session" 액션이 있음.
6
- */
7
- (() => {
8
- try {
9
- // kiro-icon-button (+ 버튼) 찾기
10
- const addBtns = document.querySelectorAll('.kiro-icon-button, button, [role="button"]');
11
- for (const btn of addBtns) {
12
- const ariaLabel = (btn.getAttribute('aria-label') || '').toLowerCase();
13
- const title = (btn.getAttribute('title') || '').toLowerCase();
14
- if (ariaLabel.includes('new') || title.includes('new') ||
15
- ariaLabel.includes('add') || title.includes('add')) {
16
- btn.click();
17
- return JSON.stringify({ created: true, method: 'button' });
18
- }
19
- }
20
-
21
- // Checkpoint > New Session 영역 찾기
22
- const allText = document.querySelectorAll('*');
23
- for (const el of allText) {
24
- if (el.children.length === 0 && (el.textContent || '').trim() === 'New Session') {
25
- el.click();
26
- return JSON.stringify({ created: true, method: 'text-click' });
27
- }
28
- }
29
-
30
- return JSON.stringify({ created: false, error: 'New Session button not found' });
31
- } catch (e) {
32
- return JSON.stringify({ created: false, error: e.message });
33
- }
34
- })()
@@ -1,68 +0,0 @@
1
- /**
2
- * Kiro — webview_read_chat (webview iframe 내부에서 실행)
3
- *
4
- * Kiro의 채팅 UI는 webview iframe 안에 위치하며,
5
- * 데몬의 evaluateInWebviewFrame을 통해 실행됨.
6
- *
7
- * DOM 구조:
8
- * .kiro-chat-timeline
9
- * .kiro-chat-message (유저/어시스턴트 메시지)
10
- * .kiro-chat-message-meta → .kiro-chat-message-role (발신자)
11
- * .kiro-chat-message-body → .kiro-chat-message-markdown (내용)
12
- *
13
- * 반환: ReadChatResult { id, status, messages, inputContent? }
14
- */
15
- (() => {
16
- try {
17
- const messages = [];
18
- const msgElements = document.querySelectorAll('.kiro-chat-message');
19
-
20
- msgElements.forEach((msg, idx) => {
21
- const roleMeta = msg.querySelector('.kiro-chat-message-role');
22
- const roleText = (roleMeta?.textContent || '').trim();
23
- const isKiro = roleText.toLowerCase() === 'kiro';
24
- const role = isKiro ? 'assistant' : 'user';
25
-
26
- const body = msg.querySelector('.kiro-chat-message-body');
27
- let content = '';
28
- if (body) {
29
- const markdown = body.querySelector('.kiro-chat-message-markdown');
30
- content = (markdown || body).textContent?.trim() || '';
31
- }
32
-
33
- if (content) {
34
- messages.push({ role, content, index: idx });
35
- }
36
- });
37
-
38
- // 상태 감지
39
- let status = 'idle';
40
-
41
- // "Working" / "Cancel" 버튼 → generating
42
- const workingBar = document.querySelector('.kiro-snackbar');
43
- if (workingBar && workingBar.offsetWidth > 0) {
44
- const barText = (workingBar.textContent || '').toLowerCase();
45
- if (barText.includes('working') || barText.includes('cancel')) {
46
- status = 'generating';
47
- }
48
- }
49
-
50
- // 입력 필드 내용
51
- const input = document.querySelector('.tiptap.ProseMirror, [contenteditable="true"]');
52
- const inputContent = input ? input.textContent?.trim() : '';
53
-
54
- // 세션 탭
55
- const tab = document.querySelector('.kiro-tabs-item.active, .kiro-tabs-item[aria-selected="true"]');
56
- const title = tab?.textContent?.trim() || '';
57
-
58
- return JSON.stringify({
59
- id: title || 'kiro-default',
60
- status,
61
- messages,
62
- title: title || undefined,
63
- inputContent: inputContent || undefined,
64
- });
65
- } catch (e) {
66
- return JSON.stringify({ id: '', status: 'error', messages: [], error: e.message });
67
- }
68
- })()
@@ -1,72 +0,0 @@
1
- /**
2
- * Kiro — webview_send_message (webview iframe 내부에서 실행)
3
- *
4
- * Kiro의 채팅 입력은 webview iframe 안의 ProseMirror/tiptap 에디터.
5
- * execCommand('insertText') + Enter 키 이벤트로 메시지 전송.
6
- *
7
- * 파라미터: ${ MESSAGE }
8
- */
9
- (async () => {
10
- try {
11
- const msg = ${ MESSAGE };
12
-
13
- // ─── 1. 입력 필드 찾기 ───
14
- const editor =
15
- document.querySelector('.tiptap.ProseMirror') ||
16
- document.querySelector('[contenteditable="true"]') ||
17
- document.querySelector('textarea');
18
-
19
- if (!editor) return JSON.stringify({ sent: false, error: 'no input found in webview' });
20
-
21
- const isTextarea = editor.tagName === 'TEXTAREA';
22
-
23
- if (isTextarea) {
24
- editor.focus();
25
- const nativeSetter = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value')?.set;
26
- if (nativeSetter) nativeSetter.call(editor, msg);
27
- else editor.value = msg;
28
- editor.dispatchEvent(new Event('input', { bubbles: true }));
29
- await new Promise(r => setTimeout(r, 300));
30
-
31
- const enterOpts = { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true, cancelable: true, composed: true };
32
- editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
33
- editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
34
- editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
35
- return JSON.stringify({ sent: true });
36
- }
37
-
38
- // ─── 2. contenteditable (ProseMirror / tiptap) ───
39
- editor.focus();
40
- await new Promise(r => setTimeout(r, 100));
41
-
42
- // 전체 선택 + 삭제 + 삽입
43
- const sel = window.getSelection();
44
- const range = document.createRange();
45
- range.selectNodeContents(editor);
46
- sel.removeAllRanges();
47
- sel.addRange(range);
48
- await new Promise(r => setTimeout(r, 50));
49
-
50
- document.execCommand('delete', false, null);
51
- await new Promise(r => setTimeout(r, 50));
52
- document.execCommand('insertText', false, msg);
53
-
54
- editor.dispatchEvent(new Event('input', { bubbles: true }));
55
- await new Promise(r => setTimeout(r, 400));
56
-
57
- // ─── 3. Enter 키 전송 ───
58
- const enterOpts = {
59
- key: 'Enter', code: 'Enter',
60
- keyCode: 13, which: 13,
61
- bubbles: true, cancelable: true, composed: true,
62
- };
63
- editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
64
- await new Promise(r => setTimeout(r, 50));
65
- editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
66
- editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
67
-
68
- return JSON.stringify({ sent: true });
69
- } catch (e) {
70
- return JSON.stringify({ sent: false, error: e.message });
71
- }
72
- })()
@@ -1,15 +0,0 @@
1
- /**
2
- * Generic fallback — set_model
3
- * ${ MODEL }
4
- */
5
- (() => {
6
- try {
7
- const want = ${ MODEL } || '';
8
- const norm = (t) => t.toLowerCase().trim();
9
-
10
- // Very basic click attempt
11
- return JSON.stringify({ success: false, error: 'Model selection requires UI interaction not supported by generic script' });
12
- } catch (e) {
13
- return JSON.stringify({ success: false, error: e.message });
14
- }
15
- })()
@@ -1,15 +0,0 @@
1
- /**
2
- * Generic fallback — set_model
3
- * ${ MODEL }
4
- */
5
- (() => {
6
- try {
7
- const want = ${ MODEL } || '';
8
- const norm = (t) => t.toLowerCase().trim();
9
-
10
- // Very basic click attempt
11
- return JSON.stringify({ success: false, error: 'Model selection requires UI interaction not supported by generic script' });
12
- } catch (e) {
13
- return JSON.stringify({ success: false, error: e.message });
14
- }
15
- })()
@@ -1,26 +0,0 @@
1
- /**
2
- * Kiro — webview_switch_session (webview iframe 내부에서 실행)
3
- *
4
- * 세션 탭 클릭으로 전환.
5
- * 파라미터: ${ SESSION_ID } (탭 인덱스)
6
- */
7
- (() => {
8
- try {
9
- const targetId = ${ SESSION_ID };
10
- const tabs = document.querySelectorAll('.kiro-tabs-item');
11
- const idx = parseInt(targetId, 10);
12
-
13
- if (isNaN(idx) || idx < 0 || idx >= tabs.length) {
14
- return JSON.stringify({ switched: false, error: `Invalid session index: ${targetId}, total: ${tabs.length}` });
15
- }
16
-
17
- tabs[idx].click();
18
- const label = tabs[idx].querySelector('.kiro-tabs-item-label');
19
- return JSON.stringify({
20
- switched: true,
21
- title: (label?.textContent || tabs[idx].textContent || '').trim(),
22
- });
23
- } catch (e) {
24
- return JSON.stringify({ switched: false, error: e.message });
25
- }
26
- })()
@@ -1,62 +0,0 @@
1
- /**
2
- * CDP Scripts for Kiro
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.webviewReadChat = function webviewReadChat() { return loadScript('webview_read_chat.js'); };
15
-
16
- module.exports.webviewSendMessage = function webviewSendMessage(text) {
17
- const s = loadScript('webview_send_message.js');
18
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
19
- };
20
-
21
- module.exports.sendMessage = function sendMessage(text) {
22
- const s = loadScript('send_message.js');
23
- return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
24
- };
25
-
26
- module.exports.resolveAction = function resolveAction(params) {
27
- const action = typeof params === 'string' ? params : params?.action || 'approve';
28
- const buttonText = params?.button || params?.buttonText
29
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
30
- const s = loadScript('resolve_action.js');
31
- return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
32
- };
33
-
34
- module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
35
-
36
- module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
37
-
38
- module.exports.webviewListSessions = function webviewListSessions() { return loadScript('webview_list_sessions.js'); };
39
-
40
- module.exports.webviewNewSession = function webviewNewSession() { return loadScript('webview_new_session.js'); };
41
-
42
- module.exports.webviewSwitchSession = function webviewSwitchSession(sessionId) {
43
- const s = loadScript('webview_switch_session.js');
44
- return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
45
- };
46
-
47
- module.exports.webviewListModels = function webviewListModels() { return loadScript('webview_list_models.js'); };
48
-
49
- module.exports.webviewSetModel = function webviewSetModel(params) {
50
- const model = typeof params === 'string' ? params : params?.model;
51
- const s = loadScript('webview_set_model.js');
52
- return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
53
- };
54
-
55
- module.exports.webviewListModes = function webviewListModes() { return loadScript('webview_list_modes.js'); };
56
-
57
- module.exports.webviewSetMode = function webviewSetMode(params) {
58
- const mode = typeof params === 'string' ? params : params?.mode;
59
- const s = loadScript('webview_set_mode.js');
60
- return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
61
- };
62
-
@@ -1,36 +0,0 @@
1
- {
2
- "type": "pearai",
3
- "name": "PearAI",
4
- "category": "ide",
5
- "displayName": "PearAI",
6
- "icon": "🍐",
7
- "cli": "pearai",
8
- "cdpPorts": [
9
- 9355,
10
- 9356
11
- ],
12
- "processNames": {
13
- "darwin": "PearAI",
14
- "win32": [
15
- "PearAI.exe"
16
- ],
17
- "linux": [
18
- "pearai"
19
- ]
20
- },
21
- "paths": {
22
- "darwin": [
23
- "/Applications/PearAI.app"
24
- ],
25
- "win32": [
26
- "C:\\Users\\*\\AppData\\Local\\Programs\\pearai\\PearAI.exe"
27
- ],
28
- "linux": [
29
- "/opt/pearai",
30
- "/usr/share/pearai"
31
- ]
32
- },
33
- "inputMethod": "cdp-type-and-send",
34
- "inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
35
- "webviewMatchText": "chat-text-area"
36
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Cursor v1 — focus_editor
3
- *
4
- * CURSOR.md 4-5: 셀렉터 우선순위
5
- * [contenteditable="true"][role="textbox"]
6
- * → .chat-input textarea
7
- * → .composer-input
8
- * → textarea
9
- *
10
- * 최종 확인: 2026-03-06
11
- */
12
- (() => {
13
- const editor = document.querySelector('[contenteditable="true"][role="textbox"]')
14
- || document.querySelector('.chat-input textarea')
15
- || document.querySelector('.composer-input')
16
- || document.querySelector('textarea.native-input')
17
- || document.querySelector('textarea');
18
- if (editor) { editor.focus(); return 'focused'; }
19
- return 'no editor found';
20
- })()
@@ -1,38 +0,0 @@
1
- /**
2
- * PearAI — list_sessions (IDE 메인 프레임에서 실행)
3
- *
4
- * 히스토리 패널 토글 버튼을 클릭하여 히스토리 뷰를 오픈합니다.
5
- * 히스토리 뷰가 열리면 webviewListSessions로 항목을 읽을 수 있습니다.
6
- */
7
- (() => {
8
- try {
9
- // Panel title bar에서 히스토리 관련 버튼 찾기
10
- const actionBtns = document.querySelectorAll('.action-item a.action-label, .action-item .action-label');
11
- for (const btn of actionBtns) {
12
- const title = (btn.getAttribute('title') || '').toLowerCase();
13
- const ariaLabel = (btn.getAttribute('aria-label') || '').toLowerCase();
14
- const cls = btn.className || '';
15
-
16
- if (title.includes('history') || title.includes('히스토리') ||
17
- ariaLabel.includes('history') || ariaLabel.includes('히스토리') ||
18
- cls.includes('codicon-history')) {
19
- btn.click();
20
- return JSON.stringify({ toggled: true, method: 'panelAction', title: btn.getAttribute('title') });
21
- }
22
- }
23
-
24
- // Broader search
25
- const allBtns = document.querySelectorAll('a[title], button[title]');
26
- for (const btn of allBtns) {
27
- const title = (btn.getAttribute('title') || '').toLowerCase();
28
- if (title.includes('history') || title.includes('task history')) {
29
- btn.click();
30
- return JSON.stringify({ toggled: true, method: 'titleBtn', title: btn.getAttribute('title') });
31
- }
32
- }
33
-
34
- return JSON.stringify({ toggled: false, error: 'History toggle button not found' });
35
- } catch (e) {
36
- return JSON.stringify({ toggled: false, error: e.message });
37
- }
38
- })()
@@ -1,55 +0,0 @@
1
- /**
2
- * PearAI — new_session (IDE 메인 프레임에서 실행)
3
- *
4
- * Panel title bar의 "+" 버튼(New Task)을 찾아 클릭합니다.
5
- * PearAI(Roo Code 기반)에서 새 태스크 버튼은 webview 바깥의 VS Code panel 헤더에 위치합니다.
6
- */
7
- (() => {
8
- try {
9
- // Strategy 1: Find the codicon-add / plus button in panel title actions
10
- const actionBtns = document.querySelectorAll('.panel .title .actions-container .action-item a, .pane-header .actions-container .action-item a, .title-actions .action-item a');
11
- for (const btn of actionBtns) {
12
- const title = btn.getAttribute('title') || '';
13
- const ariaLabel = btn.getAttribute('aria-label') || '';
14
- const cls = btn.className || '';
15
-
16
- if (title.toLowerCase().includes('new task') ||
17
- title.toLowerCase().includes('new chat') ||
18
- ariaLabel.toLowerCase().includes('new task') ||
19
- ariaLabel.toLowerCase().includes('new chat') ||
20
- cls.includes('codicon-add') ||
21
- cls.includes('codicon-plus')) {
22
- btn.click();
23
- return JSON.stringify({ created: true, method: 'panelAction', title: title || ariaLabel });
24
- }
25
- }
26
-
27
- // Strategy 2: Broader search for action items with "+" or "new"
28
- const allActions = document.querySelectorAll('.action-item a.action-label');
29
- for (const a of allActions) {
30
- const title = (a.getAttribute('title') || '').toLowerCase();
31
- const cls = a.className || '';
32
- if ((title.includes('new') && title.includes('task')) ||
33
- (title.includes('plus') || cls.includes('codicon-add'))) {
34
- a.click();
35
- return JSON.stringify({ created: true, method: 'actionLabel', title: a.getAttribute('title') });
36
- }
37
- }
38
-
39
- // Strategy 3: Use keybinding (Cmd+Shift+P -> "new task")
40
- // Simulate keyboard shortcut for Roo Code: typically there's a command
41
- // registered as roo-cline.plusButtonClicked or similar
42
- const allBtns = document.querySelectorAll('a[title], button[title]');
43
- const matches = [];
44
- for (const btn of allBtns) {
45
- const t = btn.getAttribute('title') || '';
46
- if (t.toLowerCase().includes('new') || t.toLowerCase().includes('plus') || t === '+') {
47
- matches.push({ tag: btn.tagName, title: t, cls: (btn.className || '').substring(0, 60) });
48
- }
49
- }
50
-
51
- return JSON.stringify({ created: false, error: 'New Task button not found in panel', candidates: matches.slice(0, 5) });
52
- } catch (e) {
53
- return JSON.stringify({ created: false, error: e.message });
54
- }
55
- })()
@@ -1,46 +0,0 @@
1
- /**
2
- * PearAI — open_panel
3
- *
4
- * PearAI 채팅 패널 열기.
5
- * "Toggle PearAI Side Bar (⌘;)" 버튼으로 열기.
6
- *
7
- * 반환: 'visible' | 'opened' | 'error: ...'
8
- */
9
- (() => {
10
- try {
11
- // 1. 이미 열려 있는지 확인
12
- const sidebar = document.getElementById('workbench.parts.auxiliarybar');
13
- if (sidebar && sidebar.offsetWidth > 0 && sidebar.offsetHeight > 0) {
14
- return 'visible';
15
- }
16
-
17
- // 2. Toggle 버튼 클릭 시도
18
- const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
19
- for (const btn of toggleBtns) {
20
- const label = (btn.getAttribute('aria-label') || '').toLowerCase();
21
- if (label.includes('toggle pearai') || label.includes('toggle secondary') ||
22
- label.includes('toggle auxiliary')) {
23
- if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
24
- btn.click();
25
- return 'opened (toggle)';
26
- }
27
- }
28
- }
29
-
30
- // 3. Cmd+; 단축키 폴백 (PearAI 기본 단축키)
31
- document.dispatchEvent(new KeyboardEvent('keydown', {
32
- key: ';', code: 'Semicolon', keyCode: 186,
33
- metaKey: true, ctrlKey: false,
34
- bubbles: true, cancelable: true,
35
- }));
36
- document.dispatchEvent(new KeyboardEvent('keyup', {
37
- key: ';', code: 'Semicolon', keyCode: 186,
38
- metaKey: true, ctrlKey: false,
39
- bubbles: true, cancelable: true,
40
- }));
41
-
42
- return 'opened (⌘;)';
43
- } catch (e) {
44
- return 'error: ' + e.message;
45
- }
46
- })()
@@ -1,54 +0,0 @@
1
- /**
2
- * PearAI — resolve_action
3
- *
4
- * 승인/거부 버튼 찾기 + 좌표 반환.
5
- * PearAI의 approval 다이얼로그는 메인 DOM에 표시됨.
6
- *
7
- * 파라미터: ${ BUTTON_TEXT }
8
- */
9
- (() => {
10
- const want = ${ BUTTON_TEXT };
11
- const wantNorm = (want || '').replace(/\s+/g, ' ').trim().toLowerCase();
12
-
13
- function norm(t) { return (t || '').replace(/\s+/g, ' ').trim().toLowerCase(); }
14
-
15
- function matches(el) {
16
- const t = norm(el.textContent);
17
- if (!t || t.length > 80) return false;
18
- if (t === wantNorm) return true;
19
- if (t.indexOf(wantNorm) === 0) return true;
20
- if (wantNorm.indexOf(t) >= 0 && t.length > 2) return true;
21
- if (/^(run|approve|allow|accept|yes)\b/.test(wantNorm)) {
22
- if (/^(run|allow|accept|approve)\b/.test(t)) return true;
23
- }
24
- if (/^(reject|deny|no|abort)\b/.test(wantNorm)) {
25
- if (/^(reject|deny)\b/.test(t)) return true;
26
- }
27
- return false;
28
- }
29
-
30
- const sel = 'button, [role="button"], .monaco-button';
31
- const allBtns = [...document.querySelectorAll(sel)].filter(b => {
32
- if (!b.offsetWidth || !b.getBoundingClientRect().height) return false;
33
- const rect = b.getBoundingClientRect();
34
- return rect.y > 0 && rect.y < window.innerHeight;
35
- });
36
-
37
- let found = null;
38
- for (let i = allBtns.length - 1; i >= 0; i--) {
39
- if (matches(allBtns[i])) { found = allBtns[i]; break; }
40
- }
41
-
42
- if (found) {
43
- const rect = found.getBoundingClientRect();
44
- return JSON.stringify({
45
- found: true,
46
- text: found.textContent?.trim()?.substring(0, 40),
47
- x: Math.round(rect.x + rect.width / 2),
48
- y: Math.round(rect.y + rect.height / 2),
49
- w: Math.round(rect.width),
50
- h: Math.round(rect.height)
51
- });
52
- }
53
- return JSON.stringify({ found: false, want: wantNorm });
54
- })()
@@ -1,29 +0,0 @@
1
- /**
2
- * PearAI — send_message
3
- *
4
- * PearAI의 채팅 입력은 webview iframe 안에 있어 메인 DOM에서 직접 접근 불가.
5
- * auxbar 하단의 입력 필드 좌표를 계산하여 clickCoords로 반환.
6
- * 데몬이 CDP Input API로 해당 좌표에 클릭+타이핑+Enter를 수행.
7
- *
8
- * 파라미터: ${ MESSAGE }
9
- */
10
- (() => {
11
- try {
12
- const auxbar = document.getElementById('workbench.parts.auxiliarybar');
13
- if (!auxbar || auxbar.offsetWidth === 0) {
14
- return JSON.stringify({ sent: false, error: 'auxbar not found' });
15
- }
16
-
17
- const rect = auxbar.getBoundingClientRect();
18
- const x = Math.round(rect.x + rect.width / 2);
19
- const y = Math.round(rect.y + rect.height - 80);
20
-
21
- return JSON.stringify({
22
- sent: false,
23
- needsTypeAndSend: true,
24
- clickCoords: { x, y },
25
- });
26
- } catch (e) {
27
- return JSON.stringify({ sent: false, error: e.message });
28
- }
29
- })()