adhdev 0.4.0 → 0.5.0

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 (150) hide show
  1. package/dist/cli-entrypoint.js +7216 -5706
  2. package/dist/cli-entrypoint.js.map +1 -1
  3. package/dist/index.js +7199 -5688
  4. package/dist/index.js.map +1 -1
  5. package/package.json +2 -2
  6. package/providers/_builtin/COMPATIBILITY.md +0 -217
  7. package/providers/_builtin/CONTRIBUTING.md +0 -141
  8. package/providers/_builtin/README.md +0 -51
  9. package/providers/_builtin/_helpers/index.js +0 -188
  10. package/providers/_builtin/acp/agentpool/provider.json +0 -54
  11. package/providers/_builtin/acp/amp/provider.json +0 -52
  12. package/providers/_builtin/acp/auggie/provider.json +0 -57
  13. package/providers/_builtin/acp/autodev/provider.json +0 -54
  14. package/providers/_builtin/acp/autohand/provider.json +0 -52
  15. package/providers/_builtin/acp/blackbox-ai/provider.json +0 -54
  16. package/providers/_builtin/acp/claude-agent/provider.json +0 -57
  17. package/providers/_builtin/acp/cline-acp/provider.json +0 -54
  18. package/providers/_builtin/acp/codebuddy/provider.json +0 -54
  19. package/providers/_builtin/acp/codex-cli/provider.json +0 -57
  20. package/providers/_builtin/acp/corust-agent/provider.json +0 -52
  21. package/providers/_builtin/acp/crow-cli/provider.json +0 -54
  22. package/providers/_builtin/acp/cursor-acp/provider.json +0 -54
  23. package/providers/_builtin/acp/deepagents/provider.json +0 -52
  24. package/providers/_builtin/acp/dimcode/provider.json +0 -54
  25. package/providers/_builtin/acp/docker-cagent/provider.json +0 -57
  26. package/providers/_builtin/acp/factory-droid/provider.json +0 -60
  27. package/providers/_builtin/acp/fast-agent/provider.json +0 -52
  28. package/providers/_builtin/acp/gemini-cli/provider.json +0 -114
  29. package/providers/_builtin/acp/github-copilot/provider.json +0 -54
  30. package/providers/_builtin/acp/goose/provider.json +0 -57
  31. package/providers/_builtin/acp/junie/provider.json +0 -52
  32. package/providers/_builtin/acp/kilo/provider.json +0 -54
  33. package/providers/_builtin/acp/kimi-cli/provider.json +0 -57
  34. package/providers/_builtin/acp/minion-code/provider.json +0 -52
  35. package/providers/_builtin/acp/mistral-vibe/provider.json +0 -57
  36. package/providers/_builtin/acp/nova/provider.json +0 -54
  37. package/providers/_builtin/acp/openclaw/provider.json +0 -54
  38. package/providers/_builtin/acp/opencode/provider.json +0 -52
  39. package/providers/_builtin/acp/openhands/provider.json +0 -54
  40. package/providers/_builtin/acp/pi-acp/provider.json +0 -52
  41. package/providers/_builtin/acp/qoder/provider.json +0 -54
  42. package/providers/_builtin/acp/qwen-code/provider.json +0 -60
  43. package/providers/_builtin/acp/stakpak/provider.json +0 -54
  44. package/providers/_builtin/acp/vtcode/provider.json +0 -54
  45. package/providers/_builtin/cli/claude-cli/provider.json +0 -100
  46. package/providers/_builtin/cli/codex-cli/provider.json +0 -89
  47. package/providers/_builtin/cli/gemini-cli/provider.json +0 -93
  48. package/providers/_builtin/docs/CDP_SELECTOR_GUIDE.md +0 -370
  49. package/providers/_builtin/docs/PROVIDER_GUIDE.md +0 -916
  50. package/providers/_builtin/extension/cline/provider.json +0 -35
  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 -35
  65. package/providers/_builtin/extension/roo-code/scripts.js +0 -659
  66. package/providers/_builtin/ide/antigravity/provider.json +0 -63
  67. package/providers/_builtin/ide/antigravity/scripts/focus_editor.js +0 -20
  68. package/providers/_builtin/ide/antigravity/scripts/legacy/list_models.js +0 -38
  69. package/providers/_builtin/ide/antigravity/scripts/legacy/list_modes.js +0 -48
  70. package/providers/_builtin/ide/antigravity/scripts/legacy/scripts.js +0 -64
  71. package/providers/_builtin/ide/antigravity/scripts/legacy/set_mode.js +0 -34
  72. package/providers/_builtin/ide/antigravity/scripts/legacy/set_model.js +0 -47
  73. package/providers/_builtin/ide/antigravity/scripts/list_chats.js +0 -137
  74. package/providers/_builtin/ide/antigravity/scripts/list_models.js +0 -61
  75. package/providers/_builtin/ide/antigravity/scripts/list_modes.js +0 -72
  76. package/providers/_builtin/ide/antigravity/scripts/new_session.js +0 -75
  77. package/providers/_builtin/ide/antigravity/scripts/read_chat.js +0 -262
  78. package/providers/_builtin/ide/antigravity/scripts/resolve_action.js +0 -68
  79. package/providers/_builtin/ide/antigravity/scripts/send_message.js +0 -56
  80. package/providers/_builtin/ide/antigravity/scripts/set_mode.js +0 -67
  81. package/providers/_builtin/ide/antigravity/scripts/set_model.js +0 -72
  82. package/providers/_builtin/ide/antigravity/scripts/switch_session.js +0 -114
  83. package/providers/_builtin/ide/antigravity/scripts.js +0 -67
  84. package/providers/_builtin/ide/cursor/provider.json +0 -59
  85. package/providers/_builtin/ide/cursor/scripts.js +0 -458
  86. package/providers/_builtin/ide/kiro/provider.json +0 -60
  87. package/providers/_builtin/ide/kiro/scripts/focus_editor.js +0 -20
  88. package/providers/_builtin/ide/kiro/scripts/open_panel.js +0 -47
  89. package/providers/_builtin/ide/kiro/scripts/resolve_action.js +0 -54
  90. package/providers/_builtin/ide/kiro/scripts/send_message.js +0 -29
  91. package/providers/_builtin/ide/kiro/scripts/webview_list_models.js +0 -39
  92. package/providers/_builtin/ide/kiro/scripts/webview_list_modes.js +0 -39
  93. package/providers/_builtin/ide/kiro/scripts/webview_list_sessions.js +0 -21
  94. package/providers/_builtin/ide/kiro/scripts/webview_new_session.js +0 -34
  95. package/providers/_builtin/ide/kiro/scripts/webview_read_chat.js +0 -68
  96. package/providers/_builtin/ide/kiro/scripts/webview_send_message.js +0 -72
  97. package/providers/_builtin/ide/kiro/scripts/webview_set_mode.js +0 -15
  98. package/providers/_builtin/ide/kiro/scripts/webview_set_model.js +0 -15
  99. package/providers/_builtin/ide/kiro/scripts/webview_switch_session.js +0 -26
  100. package/providers/_builtin/ide/kiro/scripts.js +0 -62
  101. package/providers/_builtin/ide/pearai/provider.json +0 -60
  102. package/providers/_builtin/ide/pearai/scripts/focus_editor.js +0 -20
  103. package/providers/_builtin/ide/pearai/scripts/list_sessions.js +0 -38
  104. package/providers/_builtin/ide/pearai/scripts/new_session.js +0 -55
  105. package/providers/_builtin/ide/pearai/scripts/open_panel.js +0 -46
  106. package/providers/_builtin/ide/pearai/scripts/resolve_action.js +0 -54
  107. package/providers/_builtin/ide/pearai/scripts/send_message.js +0 -29
  108. package/providers/_builtin/ide/pearai/scripts/webview_list_models.js +0 -43
  109. package/providers/_builtin/ide/pearai/scripts/webview_list_modes.js +0 -35
  110. package/providers/_builtin/ide/pearai/scripts/webview_list_sessions.js +0 -62
  111. package/providers/_builtin/ide/pearai/scripts/webview_new_session.js +0 -49
  112. package/providers/_builtin/ide/pearai/scripts/webview_read_chat.js +0 -92
  113. package/providers/_builtin/ide/pearai/scripts/webview_resolve_action.js +0 -59
  114. package/providers/_builtin/ide/pearai/scripts/webview_send_message.js +0 -72
  115. package/providers/_builtin/ide/pearai/scripts/webview_set_mode.js +0 -36
  116. package/providers/_builtin/ide/pearai/scripts/webview_set_model.js +0 -36
  117. package/providers/_builtin/ide/pearai/scripts/webview_switch_session.js +0 -34
  118. package/providers/_builtin/ide/pearai/scripts.js +0 -74
  119. package/providers/_builtin/ide/trae/provider.json +0 -59
  120. package/providers/_builtin/ide/trae/scripts/focus_editor.js +0 -20
  121. package/providers/_builtin/ide/trae/scripts/list_chats.js +0 -24
  122. package/providers/_builtin/ide/trae/scripts/list_models.js +0 -39
  123. package/providers/_builtin/ide/trae/scripts/list_modes.js +0 -39
  124. package/providers/_builtin/ide/trae/scripts/new_session.js +0 -30
  125. package/providers/_builtin/ide/trae/scripts/open_panel.js +0 -44
  126. package/providers/_builtin/ide/trae/scripts/read_chat.js +0 -113
  127. package/providers/_builtin/ide/trae/scripts/resolve_action.js +0 -54
  128. package/providers/_builtin/ide/trae/scripts/send_message.js +0 -69
  129. package/providers/_builtin/ide/trae/scripts/set_mode.js +0 -15
  130. package/providers/_builtin/ide/trae/scripts/set_model.js +0 -15
  131. package/providers/_builtin/ide/trae/scripts/switch_session.js +0 -23
  132. package/providers/_builtin/ide/trae/scripts.js +0 -57
  133. package/providers/_builtin/ide/vscode/provider.json +0 -57
  134. package/providers/_builtin/ide/vscode-insiders/provider.json +0 -55
  135. package/providers/_builtin/ide/vscodium/provider.json +0 -56
  136. package/providers/_builtin/ide/windsurf/provider.json +0 -46
  137. package/providers/_builtin/ide/windsurf/scripts/focus_editor.js +0 -30
  138. package/providers/_builtin/ide/windsurf/scripts/list_chats.js +0 -117
  139. package/providers/_builtin/ide/windsurf/scripts/list_models.js +0 -39
  140. package/providers/_builtin/ide/windsurf/scripts/list_modes.js +0 -39
  141. package/providers/_builtin/ide/windsurf/scripts/new_session.js +0 -69
  142. package/providers/_builtin/ide/windsurf/scripts/open_panel.js +0 -58
  143. package/providers/_builtin/ide/windsurf/scripts/read_chat.js +0 -297
  144. package/providers/_builtin/ide/windsurf/scripts/resolve_action.js +0 -68
  145. package/providers/_builtin/ide/windsurf/scripts/send_message.js +0 -87
  146. package/providers/_builtin/ide/windsurf/scripts/set_mode.js +0 -15
  147. package/providers/_builtin/ide/windsurf/scripts/set_model.js +0 -15
  148. package/providers/_builtin/ide/windsurf/scripts/switch_session.js +0 -58
  149. package/providers/_builtin/ide/windsurf/scripts.js +0 -57
  150. package/providers/_builtin/validate.js +0 -156
@@ -1,67 +0,0 @@
1
- /**
2
- * Antigravity CDP Scripts
3
- *
4
- * Version routing is handled by ProviderLoader:
5
- * - provider.json "versions" field declares script directory overrides
6
- * - VersionArchive detects installed Antigravity version at daemon startup
7
- * - resolve() picks scripts/legacy/ for < 1.107.0, scripts/ for >= 1.107.0
8
- *
9
- * To add support for a new breaking version:
10
- * 1. Create scripts/v<next>/ with updated scripts
11
- * 2. Add entry to provider.json "versions" field:
12
- * "< X.Y.Z": { "__dir": "scripts/v<next>" }
13
- * 3. Update "testedVersions" in provider.json
14
- */
15
-
16
- 'use strict';
17
-
18
- const fs = require('fs');
19
- const path = require('path');
20
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
21
-
22
- function load(name) {
23
- try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf-8'); }
24
- catch { return null; }
25
- }
26
-
27
- module.exports.readChat = () => load('read_chat.js');
28
- module.exports.focusEditor = () => load('focus_editor.js');
29
- module.exports.listSessions = () => load('list_chats.js');
30
- module.exports.newSession = () => load('new_session.js');
31
- module.exports.listModels = () => load('list_models.js');
32
- module.exports.listModes = () => load('list_modes.js');
33
-
34
- module.exports.sendMessage = (text) => {
35
- const script = load('send_message.js');
36
- if (!script) return null;
37
- return script.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text));
38
- };
39
-
40
- module.exports.switchSession = (sessionId) => {
41
- const script = load('switch_session.js');
42
- if (!script) return null;
43
- return script.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId));
44
- };
45
-
46
- module.exports.resolveAction = (params) => {
47
- const action = typeof params === 'string' ? params : params?.action || 'approve';
48
- const buttonText = params?.button || params?.buttonText
49
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
50
- const script = load('resolve_action.js');
51
- if (!script) return null;
52
- return script.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText));
53
- };
54
-
55
- module.exports.setModel = (params) => {
56
- const model = typeof params === 'string' ? params : params?.model;
57
- const script = load('set_model.js');
58
- if (!script) return null;
59
- return script.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model));
60
- };
61
-
62
- module.exports.setMode = (params) => {
63
- const mode = typeof params === 'string' ? params : params?.mode;
64
- const script = load('set_mode.js');
65
- if (!script) return null;
66
- return script.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode));
67
- };
@@ -1,59 +0,0 @@
1
- {
2
- "type": "cursor",
3
- "name": "Cursor",
4
- "category": "ide",
5
- "displayName": "Cursor",
6
- "icon": "⚡",
7
- "cli": "cursor",
8
- "cdpPorts": [
9
- 9333,
10
- 9334
11
- ],
12
- "processNames": {
13
- "darwin": "Cursor",
14
- "win32": [
15
- "Cursor.exe"
16
- ]
17
- },
18
- "paths": {
19
- "darwin": [
20
- "/Applications/Cursor.app"
21
- ],
22
- "win32": [
23
- "C:\\Users\\*\\AppData\\Local\\Programs\\cursor\\Cursor.exe"
24
- ],
25
- "linux": [
26
- "/opt/Cursor",
27
- "/usr/share/cursor"
28
- ]
29
- },
30
- "inputMethod": "cdp-type-and-send",
31
- "inputSelector": ".aislash-editor-input[contenteditable=\"true\"]",
32
- "vscodeCommands": {
33
- "changeModel": "cursor.model"
34
- },
35
- "settings": {
36
- "approvalAlert": {
37
- "type": "boolean",
38
- "default": true,
39
- "public": true,
40
- "label": "Approval Notifications",
41
- "description": "Show notification when approval is needed"
42
- },
43
- "longGeneratingAlert": {
44
- "type": "boolean",
45
- "default": true,
46
- "public": true,
47
- "label": "Long Generation Alert",
48
- "description": "Alert when generation takes too long"
49
- },
50
- "longGeneratingThresholdSec": {
51
- "type": "number",
52
- "default": 180,
53
- "public": true,
54
- "label": "Long Generation Threshold (sec)",
55
- "min": 30,
56
- "max": 600
57
- }
58
- }
59
- }
@@ -1,458 +0,0 @@
1
- /**
2
- * CDP Scripts for Cursor
3
- */
4
-
5
- module.exports.readChat = function readChat(params) {
6
- return `(() => {
7
- try {
8
- const c = document.querySelector('[data-composer-id]');
9
- const id = c?.getAttribute('data-composer-id') || 'active';
10
- const rawStatus = c?.getAttribute('data-composer-status') || 'idle';
11
- let status = rawStatus;
12
- if (rawStatus === 'thinking' || rawStatus === 'streaming') status = 'generating';
13
- else if (rawStatus === 'completed' || rawStatus === 'idle' || !rawStatus) status = 'idle';
14
-
15
- // Detect approval dialogs
16
- let activeModal = null;
17
-
18
- // Primary signal: Cursor uses .run-command-review-active on conversations container
19
- const reviewActive = !!document.querySelector('.run-command-review-active');
20
-
21
- // Also check clickable elements (Cursor uses divs with cursor-pointer, not buttons)
22
- // Note: Cursor concatenates button text with shortcut key labels (e.g. "SkipEsc", "Run⏎")
23
- const clickableEls = [...document.querySelectorAll('button, [role="button"], .cursor-pointer')].filter(b =>
24
- b.offsetWidth > 0 && /^(accept|reject|approve|deny|run|skip|allow|cancel)/i.test((b.textContent || b.getAttribute('aria-label') || '').trim())
25
- );
26
-
27
- if (reviewActive || clickableEls.length > 0) {
28
- status = 'waiting_approval';
29
- const reviewContainer = document.querySelector('.run-command-review-active');
30
- // Find the tool call context — last rendered message has the command being reviewed
31
- const renderedMsgs = reviewContainer?.querySelectorAll('.composer-rendered-message');
32
- const lastRendered = renderedMsgs?.length ? renderedMsgs[renderedMsgs.length - 1] : null;
33
- const toolMsg = lastRendered || reviewContainer?.querySelector('.composer-tool-former-message:last-of-type');
34
- activeModal = {
35
- message: toolMsg?.textContent?.trim()?.substring(0, 200) || 'Command approval required',
36
- buttons: clickableEls.map(b => b.textContent.trim().replace(/[⏎↵]/g, '').trim()).filter(Boolean),
37
- };
38
- }
39
-
40
- const msgs = [];
41
- document.querySelectorAll('.composer-human-ai-pair-container').forEach((p, i) => {
42
- if (p.children.length === 0) return; // skip virtual-scroll placeholders
43
- const h = p.querySelector('.composer-human-message');
44
- if (h) {
45
- const userText = (h.innerText || '').trim().substring(0, 6000);
46
- if (userText) msgs.push({ role: 'user', content: userText, index: msgs.length });
47
- }
48
- // Iterate direct children after the first (user message block)
49
- for (let ci = 1; ci < p.children.length; ci++) {
50
- const b = p.children[ci];
51
- if ((b.className || '').includes('opacity-50')) continue;
52
- const t = (b.innerText || '').trim();
53
- if (t.length < 2) continue;
54
- // Filter noise: "Thought for Xs", "Explored N files"
55
- if (/^Thought\\nfor \\d+s?$/i.test(t) || /^Explored\\n/i.test(t)) continue;
56
- const hasTool = b.querySelector('.composer-tool-former-message, .composer-diff-block, .composer-code-block-container');
57
- msgs.push({ role: hasTool ? 'tool' : 'assistant', content: t.substring(0, 6000), index: msgs.length });
58
- }
59
- });
60
- const inputEl = document.querySelector('.aislash-editor-input[contenteditable="true"]');
61
- const inputContent = inputEl?.textContent?.trim() || '';
62
- const titleParts = document.title.split(' — ');
63
- const projectTitle = (titleParts.length >= 2 ? titleParts[titleParts.length - 2] : titleParts[0] || '').trim();
64
- return JSON.stringify({ id, status, title: projectTitle, messages: msgs, inputContent, activeModal });
65
- } catch(e) {
66
- return JSON.stringify({ id: '', status: 'error', messages: [] });
67
- }
68
- })()`;
69
- };
70
-
71
- module.exports.sendMessage = function sendMessage(params) {
72
- const text = typeof params === 'string' ? params : params?.text;
73
- return `(() => {
74
- try {
75
- const input = document.querySelector('.aislash-editor-input[contenteditable="true"]');
76
- if (!input) return JSON.stringify({ sent: false, error: 'Input box not found' });
77
- return JSON.stringify({
78
- sent: false,
79
- needsTypeAndSend: true,
80
- selector: '.aislash-editor-input[contenteditable="true"]',
81
- });
82
- } catch(e) {
83
- return JSON.stringify({ sent: false, error: e.message });
84
- }
85
- })()`;
86
- };
87
-
88
- module.exports.listSessions = function listSessions(params) {
89
- return `(() => {
90
- try {
91
- const sessions = [];
92
- const cells = [...document.querySelectorAll('.agent-sidebar-cell')];
93
- const activeComposer = document.querySelector('[data-composer-id]');
94
- const activeId = activeComposer?.getAttribute('data-composer-id') || null;
95
- cells.forEach((cell, i) => {
96
- const titleEl = cell.querySelector('.agent-sidebar-cell-text');
97
- const title = titleEl?.textContent?.trim() || 'Untitled';
98
- const isSelected = cell.getAttribute('data-selected') === 'true';
99
- sessions.push({
100
- id: isSelected && activeId ? activeId : 'sidebar-' + i,
101
- title,
102
- active: isSelected,
103
- index: i,
104
- });
105
- });
106
- // If no sidebar cells, fallback to current composer
107
- if (sessions.length === 0 && activeComposer) {
108
- sessions.push({
109
- id: activeId,
110
- title: document.title.split(' — ')[0],
111
- active: true,
112
- index: 0,
113
- });
114
- }
115
- return JSON.stringify({ sessions });
116
- } catch(e) {
117
- return JSON.stringify({ sessions: [], error: e.message });
118
- }
119
- })()`;
120
- };
121
-
122
- module.exports.switchSession = function switchSession(params) {
123
- const index = typeof params === 'number' ? params : params?.index;
124
- const title = typeof params === 'string' ? params : params?.title;
125
- return `(() => {
126
- try {
127
- const cells = [...document.querySelectorAll('.agent-sidebar-cell')];
128
- let target;
129
- if (${JSON.stringify(title)}) {
130
- target = cells.find(c => {
131
- const t = c.querySelector('.agent-sidebar-cell-text')?.textContent?.trim() || '';
132
- return t.toLowerCase().includes(${JSON.stringify((title||'').toLowerCase())});
133
- });
134
- } else {
135
- target = cells[${index ?? 0}];
136
- }
137
- if (!target) return JSON.stringify({ switched: false, error: 'Session not found', available: cells.length });
138
- target.click();
139
- return JSON.stringify({ switched: true, title: target.querySelector('.agent-sidebar-cell-text')?.textContent?.trim() });
140
- } catch(e) {
141
- return JSON.stringify({ switched: false, error: e.message });
142
- }
143
- })()`;
144
- };
145
-
146
- module.exports.newSession = function newSession(params) {
147
- return `(() => {
148
- try {
149
- const newBtn = [...document.querySelectorAll('a.action-label.codicon-add-two, [aria-label*="New Chat"], [aria-label*="New Composer"]')]
150
- .find(a => a.offsetWidth > 0);
151
- if (newBtn) { newBtn.click(); return JSON.stringify({ created: true }); }
152
- return JSON.stringify({ created: false, error: 'New Chat button not found' });
153
- } catch(e) {
154
- return JSON.stringify({ created: false, error: e.message });
155
- }
156
- })()`;
157
- };
158
-
159
- module.exports.focusEditor = function focusEditor(params) {
160
- return `(() => {
161
- try {
162
- const input = document.querySelector('.aislash-editor-input[contenteditable="true"]');
163
- if (input) { input.focus(); return 'focused'; }
164
- return 'not_found';
165
- } catch(e) { return 'error'; }
166
- })()`;
167
- };
168
-
169
- module.exports.openPanel = function openPanel(params) {
170
- return `(() => {
171
- try {
172
- const sidebar = document.getElementById('workbench.parts.auxiliarybar');
173
- if (sidebar && sidebar.offsetWidth > 0) {
174
- const chatView = document.querySelector('[data-composer-id]');
175
- if (chatView) return 'visible';
176
- }
177
- const btns = [...document.querySelectorAll('li.action-item a, button, [role="tab"]')];
178
- const toggle = btns.find(b => {
179
- const label = (b.textContent || b.getAttribute('aria-label') || '').toLowerCase();
180
- return /agent|chat|composer|cursor tab/i.test(label);
181
- });
182
- if (toggle) { toggle.click(); return 'opened'; }
183
- return 'not_found';
184
- } catch (e) { return 'error'; }
185
- })()`;
186
- };
187
-
188
- module.exports.resolveAction = function resolveAction(params) {
189
- const action = typeof params === 'string' ? params : params?.action || 'approve';
190
- const buttonText = params?.button || params?.buttonText
191
- || (action === 'approve' ? 'Run' : action === 'reject' ? 'Skip' : action);
192
- return `(() => {
193
- try {
194
- const btns = [...document.querySelectorAll('button, [role="button"], .cursor-pointer')].filter(b => b.offsetWidth > 0);
195
- const searchText = ${JSON.stringify((buttonText||'').toLowerCase())};
196
- const target = btns.find(b => (b.textContent||'').trim().replace(/[⏎↵]/g, '').trim().toLowerCase().includes(searchText));
197
- if (target) { target.click(); return JSON.stringify({ resolved: true, clicked: target.textContent.trim() }); }
198
- return JSON.stringify({ resolved: false, available: btns.map(b => b.textContent.trim()).filter(Boolean).slice(0, 15) });
199
- } catch(e) { return JSON.stringify({ resolved: false, error: e.message }); }
200
- })()`;
201
- };
202
-
203
- module.exports.listNotifications = function listNotifications(params) {
204
- const filter = typeof params === 'string' ? params : params?.message;
205
- return `(() => {
206
- try {
207
- const toasts = [...document.querySelectorAll('.notifications-toasts .notification-toast, .notification-list-item')];
208
- const visible = toasts.filter(t => t.offsetWidth > 0).map((t, i) => ({
209
- index: i,
210
- message: t.querySelector('.notification-list-item-message')?.textContent?.trim() || t.textContent?.trim().substring(0, 200),
211
- severity: t.querySelector('.codicon-error') ? 'error' : t.querySelector('.codicon-warning') ? 'warning' : 'info',
212
- buttons: [...t.querySelectorAll('.notification-list-item-buttons-container button, .monaco-button')].map(b => b.textContent?.trim()).filter(Boolean),
213
- }));
214
- const f = ${JSON.stringify(filter || null)};
215
- return JSON.stringify(f ? visible.filter(n => n.message.toLowerCase().includes(f.toLowerCase())) : visible);
216
- } catch(e) { return JSON.stringify([]); }
217
- })()`;
218
- };
219
-
220
- module.exports.dismissNotification = function dismissNotification(params) {
221
- const index = typeof params === 'number' ? params : params?.index;
222
- const button = typeof params === 'string' ? params : params?.button;
223
- const message = params?.message;
224
- return `(() => {
225
- try {
226
- const toasts = [...document.querySelectorAll('.notifications-toasts .notification-toast, .notification-list-item')].filter(t => t.offsetWidth > 0);
227
- let toast;
228
- if (${JSON.stringify(message)}) {
229
- toast = toasts.find(t => (t.querySelector('.notification-list-item-message')?.textContent || t.textContent || '').toLowerCase().includes(${JSON.stringify((message||'').toLowerCase())}));
230
- } else {
231
- toast = toasts[${index ?? 0}];
232
- }
233
- if (!toast) return JSON.stringify({ dismissed: false, error: 'Toast not found', count: toasts.length });
234
- if (${JSON.stringify(button)}) {
235
- const btn = [...toast.querySelectorAll('button')].find(b => b.textContent?.trim().toLowerCase().includes(${JSON.stringify((button||'').toLowerCase())}));
236
- if (btn) { btn.click(); return JSON.stringify({ dismissed: true, clicked: btn.textContent.trim() }); }
237
- return JSON.stringify({ dismissed: false, error: 'Button not found' });
238
- }
239
- const closeBtn = toast.querySelector('.codicon-notifications-clear, .clear-notification-action, .codicon-close');
240
- if (closeBtn) { closeBtn.click(); return JSON.stringify({ dismissed: true }); }
241
- return JSON.stringify({ dismissed: false, error: 'Close button not found' });
242
- } catch(e) { return JSON.stringify({ dismissed: false, error: e.message }); }
243
- })()`;
244
- };
245
-
246
- module.exports.listModels = function listModels(params) {
247
- return `(async () => {
248
- try {
249
- let current = '';
250
- const models = [];
251
-
252
- // 현재 모델: .composer-unified-dropdown-model 텍스트
253
- const modelBtn = document.querySelector('.composer-unified-dropdown-model');
254
- if (modelBtn) {
255
- current = modelBtn.textContent?.trim() || '';
256
- }
257
-
258
- // 드롭다운 열기
259
- if (modelBtn) {
260
- modelBtn.click();
261
- await new Promise(r => setTimeout(r, 500));
262
-
263
- const menu = document.querySelector('[data-testid="model-picker-menu"]');
264
- if (menu) {
265
- // Auto 토글 확인 및 끄기
266
- const autoItem = menu.querySelector('.composer-unified-context-menu-item[data-is-selected="true"]');
267
- const autoToggle = autoItem ? [...autoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24 && el.offsetHeight === 14) : null;
268
- let wasAutoOn = false;
269
- if (autoToggle) {
270
- const bgStyle = autoToggle.getAttribute('style') || '';
271
- wasAutoOn = bgStyle.includes('green');
272
- if (wasAutoOn) {
273
- autoToggle.click();
274
- await new Promise(r => setTimeout(r, 500));
275
- }
276
- }
277
-
278
- // 모델 목록 수집 (Auto 끈 상태)
279
- const refreshedMenu = document.querySelector('[data-testid="model-picker-menu"]');
280
- if (refreshedMenu) {
281
- const items = refreshedMenu.querySelectorAll('.composer-unified-context-menu-item');
282
- for (const item of items) {
283
- const nameEl = item.querySelector('.monaco-highlighted-label');
284
- const name = nameEl?.textContent?.trim() || '';
285
- if (name && name !== 'Add Models') {
286
- // Think 모드 감지: codicon-br (brain) 아이콘
287
- const hasBrain = !!item.querySelector('[class*="codicon-br"]');
288
- const displayName = hasBrain ? name + ' 🧠' : name;
289
- models.push(displayName);
290
- if (item.getAttribute('data-is-selected') === 'true') current = displayName;
291
- }
292
- }
293
- }
294
-
295
- // Auto 다시 켜기 (원래 상태 복원)
296
- if (wasAutoOn) {
297
- const newMenu = document.querySelector('[data-testid="model-picker-menu"]');
298
- const newAutoItem = newMenu?.querySelector('.composer-unified-context-menu-item');
299
- const newToggle = newAutoItem ? [...newAutoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24) : null;
300
- if (newToggle) {
301
- newToggle.click();
302
- await new Promise(r => setTimeout(r, 200));
303
- }
304
- }
305
- }
306
-
307
- // 닫기 (Escape)
308
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
309
- }
310
-
311
- return JSON.stringify({ models, current });
312
- } catch(e) { return JSON.stringify({ models: [], current: '', error: e.message }); }
313
- })()`;
314
- };
315
-
316
- module.exports.setModel = function setModel(params) {
317
- const model = typeof params === 'string' ? params : params?.model;
318
- const escaped = JSON.stringify(model);
319
- return `(async () => {
320
- try {
321
- const target = ${escaped};
322
-
323
- // 모델 드롭다운 열기
324
- const modelBtn = document.querySelector('.composer-unified-dropdown-model');
325
- if (!modelBtn) return JSON.stringify({ success: false, error: 'Model button not found' });
326
-
327
- modelBtn.click();
328
- await new Promise(r => setTimeout(r, 500));
329
-
330
- const menu = document.querySelector('[data-testid="model-picker-menu"]');
331
- if (!menu) return JSON.stringify({ success: false, error: 'Model picker menu not found' });
332
-
333
-
334
- // 🧠 접미사 처리
335
- const wantBrain = target.includes('🧠');
336
- const searchName = target.replace(/\\s*🧠\\s*$/, '').trim();
337
-
338
- // Auto 토글 끄기 (모델 목록 노출)
339
- const autoItem = menu.querySelector('.composer-unified-context-menu-item[data-is-selected="true"]');
340
- const autoToggle = autoItem ? [...autoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24 && el.offsetHeight === 14) : null;
341
- let wasAutoOn = false;
342
- if (autoToggle) {
343
- const bgStyle = autoToggle.getAttribute('style') || '';
344
- wasAutoOn = bgStyle.includes('green');
345
- if (wasAutoOn) {
346
- autoToggle.click();
347
- await new Promise(r => setTimeout(r, 500));
348
- }
349
- }
350
-
351
- // 검색 입력으로 필터링
352
- const refreshedMenu = document.querySelector('[data-testid="model-picker-menu"]');
353
- const searchInput = refreshedMenu?.querySelector('input[placeholder="Search models"]');
354
- if (searchInput) {
355
- searchInput.focus();
356
- searchInput.value = searchName;
357
- searchInput.dispatchEvent(new Event('input', { bubbles: true }));
358
- await new Promise(r => setTimeout(r, 300));
359
- }
360
-
361
- // 아이템에서 찾기 (brain 아이콘 매칭)
362
- const items = (refreshedMenu || menu).querySelectorAll('.composer-unified-context-menu-item');
363
- for (const item of items) {
364
- const nameEl = item.querySelector('.monaco-highlighted-label');
365
- const name = nameEl?.textContent?.trim() || '';
366
- if (!name || name === 'Add Models') continue;
367
- const hasBrain = !!item.querySelector('[class*="codicon-br"]');
368
-
369
- if (name.toLowerCase().includes(searchName.toLowerCase()) && hasBrain === wantBrain) {
370
- item.click();
371
- await new Promise(r => setTimeout(r, 200));
372
- const displayName = hasBrain ? name + ' 🧠' : name;
373
- return JSON.stringify({ success: true, model: displayName });
374
- }
375
- }
376
-
377
- // Auto 복원 + 닫기
378
- if (wasAutoOn) {
379
- const nm = document.querySelector('[data-testid="model-picker-menu"]');
380
- const nai = nm?.querySelector('.composer-unified-context-menu-item');
381
- const nt = nai ? [...nai.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24) : null;
382
- if (nt) nt.click();
383
- await new Promise(r => setTimeout(r, 200));
384
- }
385
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
386
- return JSON.stringify({ success: false, error: 'model not found: ' + target });
387
- } catch(e) { return JSON.stringify({ success: false, error: e.message }); }
388
- })()`;
389
- };
390
-
391
- module.exports.listModes = function listModes(params) {
392
- return `(async () => {
393
- try {
394
- const modes = [];
395
- let current = '';
396
-
397
- // 모드 드롭다운 버튼 (아이콘, model이 아닌 unified-dropdown)
398
- const modeBtn = document.querySelector('.composer-unified-dropdown:not(.composer-unified-dropdown-model)');
399
- if (!modeBtn) return JSON.stringify({ modes: [], current: '', error: 'Mode button not found' });
400
-
401
- modeBtn.click();
402
- await new Promise(r => setTimeout(r, 500));
403
-
404
- // 팝오버에서 아이템 수집
405
- const menu = document.querySelector('[data-testid="model-picker-menu"]') || document.querySelector('.typeahead-popover');
406
- if (menu) {
407
- const items = menu.querySelectorAll('.composer-unified-context-menu-item');
408
- for (const item of items) {
409
- const nameEl = item.querySelector('.monaco-highlighted-label');
410
- const name = nameEl?.textContent?.trim() || '';
411
- if (name) {
412
- modes.push(name);
413
- if (item.getAttribute('data-is-selected') === 'true') current = name;
414
- }
415
- }
416
- }
417
-
418
- // 닫기
419
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
420
-
421
- return JSON.stringify({ modes, current });
422
- } catch(e) { return JSON.stringify({ modes: [], current: '', error: e.message }); }
423
- })()`;
424
- };
425
-
426
- module.exports.setMode = function setMode(params) {
427
- const mode = typeof params === 'string' ? params : params?.mode;
428
- const escaped = JSON.stringify(mode);
429
- return `(async () => {
430
- try {
431
- const target = ${escaped};
432
-
433
- const modeBtn = document.querySelector('.composer-unified-dropdown:not(.composer-unified-dropdown-model)');
434
- if (!modeBtn) return JSON.stringify({ success: false, error: 'Mode button not found' });
435
-
436
- modeBtn.click();
437
- await new Promise(r => setTimeout(r, 500));
438
-
439
- const menu = document.querySelector('[data-testid="model-picker-menu"]') || document.querySelector('.typeahead-popover');
440
- if (!menu) return JSON.stringify({ success: false, error: 'Mode menu not found' });
441
-
442
- const items = menu.querySelectorAll('.composer-unified-context-menu-item');
443
- for (const item of items) {
444
- const nameEl = item.querySelector('.monaco-highlighted-label');
445
- const name = nameEl?.textContent?.trim() || '';
446
- if (name && (name === target || name.toLowerCase() === target.toLowerCase())) {
447
- item.click();
448
- await new Promise(r => setTimeout(r, 200));
449
- return JSON.stringify({ success: true, mode: name });
450
- }
451
- }
452
-
453
- document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
454
- return JSON.stringify({ success: false, error: 'mode not found: ' + target });
455
- } catch(e) { return JSON.stringify({ success: false, error: e.message }); }
456
- })()`;
457
- };
458
-
@@ -1,60 +0,0 @@
1
- {
2
- "type": "kiro",
3
- "name": "Kiro",
4
- "category": "ide",
5
- "displayName": "Kiro",
6
- "icon": "🪁",
7
- "cli": "kiro",
8
- "cdpPorts": [
9
- 9351,
10
- 9352
11
- ],
12
- "processNames": {
13
- "darwin": "Kiro",
14
- "win32": [
15
- "Kiro.exe"
16
- ],
17
- "linux": [
18
- "kiro"
19
- ]
20
- },
21
- "paths": {
22
- "darwin": [
23
- "/Applications/Kiro.app"
24
- ],
25
- "win32": [
26
- "C:\\Users\\*\\AppData\\Local\\Programs\\kiro\\Kiro.exe"
27
- ],
28
- "linux": [
29
- "/opt/kiro",
30
- "/usr/share/kiro"
31
- ]
32
- },
33
- "inputMethod": "cdp-type-and-send",
34
- "inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
35
- "webviewMatchText": "kiro",
36
- "settings": {
37
- "approvalAlert": {
38
- "type": "boolean",
39
- "default": true,
40
- "public": true,
41
- "label": "Approval Notifications",
42
- "description": "Show notification when approval is needed"
43
- },
44
- "longGeneratingAlert": {
45
- "type": "boolean",
46
- "default": true,
47
- "public": true,
48
- "label": "Long Generation Alert",
49
- "description": "Alert when generation takes too long"
50
- },
51
- "longGeneratingThresholdSec": {
52
- "type": "number",
53
- "default": 180,
54
- "public": true,
55
- "label": "Long Generation Threshold (sec)",
56
- "min": 30,
57
- "max": 600
58
- }
59
- }
60
- }
@@ -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
- })()