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.
- package/dist/cli-entrypoint.js +18710 -1198
- package/dist/cli-entrypoint.js.map +1 -1
- package/dist/index.js +18720 -1228
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/providers/_builtin/CONTRIBUTING.md +0 -141
- package/providers/_builtin/README.md +0 -51
- package/providers/_builtin/_helpers/index.js +0 -188
- package/providers/_builtin/acp/agentpool/provider.json +0 -47
- package/providers/_builtin/acp/amp/provider.json +0 -45
- package/providers/_builtin/acp/auggie/provider.json +0 -50
- package/providers/_builtin/acp/autodev/provider.json +0 -47
- package/providers/_builtin/acp/autohand/provider.json +0 -45
- package/providers/_builtin/acp/blackbox-ai/provider.json +0 -47
- package/providers/_builtin/acp/claude-agent/provider.json +0 -50
- package/providers/_builtin/acp/cline-acp/provider.json +0 -47
- package/providers/_builtin/acp/code-assistant/provider.json +0 -47
- package/providers/_builtin/acp/codebuddy/provider.json +0 -47
- package/providers/_builtin/acp/codex-cli/provider.json +0 -50
- package/providers/_builtin/acp/corust-agent/provider.json +0 -45
- package/providers/_builtin/acp/crow-cli/provider.json +0 -47
- package/providers/_builtin/acp/cursor-acp/provider.json +0 -47
- package/providers/_builtin/acp/deepagents/provider.json +0 -45
- package/providers/_builtin/acp/dimcode/provider.json +0 -47
- package/providers/_builtin/acp/docker-cagent/provider.json +0 -50
- package/providers/_builtin/acp/factory-droid/provider.json +0 -53
- package/providers/_builtin/acp/fast-agent/provider.json +0 -45
- package/providers/_builtin/acp/fount/provider.json +0 -47
- package/providers/_builtin/acp/gemini-cli/provider.json +0 -107
- package/providers/_builtin/acp/github-copilot/provider.json +0 -47
- package/providers/_builtin/acp/goose/provider.json +0 -50
- package/providers/_builtin/acp/junie/provider.json +0 -45
- package/providers/_builtin/acp/kilo/provider.json +0 -45
- package/providers/_builtin/acp/kimi-cli/provider.json +0 -50
- package/providers/_builtin/acp/kiro-cli/provider.json +0 -47
- package/providers/_builtin/acp/minion-code/provider.json +0 -45
- package/providers/_builtin/acp/mistral-vibe/provider.json +0 -50
- package/providers/_builtin/acp/nova/provider.json +0 -47
- package/providers/_builtin/acp/openclaw/provider.json +0 -47
- package/providers/_builtin/acp/opencode/provider.json +0 -45
- package/providers/_builtin/acp/openhands/provider.json +0 -47
- package/providers/_builtin/acp/pi-acp/provider.json +0 -45
- package/providers/_builtin/acp/qoder/provider.json +0 -47
- package/providers/_builtin/acp/qwen-code/provider.json +0 -53
- package/providers/_builtin/acp/stakpak/provider.json +0 -47
- package/providers/_builtin/acp/vtcode/provider.json +0 -47
- package/providers/_builtin/cli/claude-cli/provider.json +0 -78
- package/providers/_builtin/cli/codex-cli/provider.json +0 -60
- package/providers/_builtin/cli/gemini-cli/provider.json +0 -64
- package/providers/_builtin/extension/cline/provider.json +0 -11
- package/providers/_builtin/extension/cline/scripts/focus_editor.js +0 -48
- package/providers/_builtin/extension/cline/scripts/list_chats.js +0 -100
- package/providers/_builtin/extension/cline/scripts/list_models.js +0 -43
- package/providers/_builtin/extension/cline/scripts/list_modes.js +0 -35
- package/providers/_builtin/extension/cline/scripts/new_session.js +0 -85
- package/providers/_builtin/extension/cline/scripts/open_panel.js +0 -25
- package/providers/_builtin/extension/cline/scripts/read_chat.js +0 -257
- package/providers/_builtin/extension/cline/scripts/resolve_action.js +0 -83
- package/providers/_builtin/extension/cline/scripts/send_message.js +0 -95
- package/providers/_builtin/extension/cline/scripts/set_mode.js +0 -36
- package/providers/_builtin/extension/cline/scripts/set_model.js +0 -36
- package/providers/_builtin/extension/cline/scripts/switch_session.js +0 -206
- package/providers/_builtin/extension/cline/scripts.js +0 -73
- package/providers/_builtin/extension/roo-code/provider.json +0 -11
- package/providers/_builtin/extension/roo-code/scripts.js +0 -659
- package/providers/_builtin/ide/antigravity/provider.json +0 -32
- package/providers/_builtin/ide/antigravity/scripts/focus_editor.js +0 -20
- package/providers/_builtin/ide/antigravity/scripts/list_chats.js +0 -137
- package/providers/_builtin/ide/antigravity/scripts/list_models.js +0 -38
- package/providers/_builtin/ide/antigravity/scripts/list_modes.js +0 -48
- package/providers/_builtin/ide/antigravity/scripts/new_session.js +0 -75
- package/providers/_builtin/ide/antigravity/scripts/read_chat.js +0 -262
- package/providers/_builtin/ide/antigravity/scripts/resolve_action.js +0 -68
- package/providers/_builtin/ide/antigravity/scripts/send_message.js +0 -56
- package/providers/_builtin/ide/antigravity/scripts/set_mode.js +0 -34
- package/providers/_builtin/ide/antigravity/scripts/set_model.js +0 -47
- package/providers/_builtin/ide/antigravity/scripts/switch_session.js +0 -114
- package/providers/_builtin/ide/antigravity/scripts.js +0 -73
- package/providers/_builtin/ide/cursor/provider.json +0 -35
- package/providers/_builtin/ide/cursor/scripts.js +0 -452
- package/providers/_builtin/ide/kiro/provider.json +0 -36
- package/providers/_builtin/ide/kiro/scripts/focus_editor.js +0 -20
- package/providers/_builtin/ide/kiro/scripts/open_panel.js +0 -47
- package/providers/_builtin/ide/kiro/scripts/resolve_action.js +0 -54
- package/providers/_builtin/ide/kiro/scripts/send_message.js +0 -29
- package/providers/_builtin/ide/kiro/scripts/webview_list_models.js +0 -39
- package/providers/_builtin/ide/kiro/scripts/webview_list_modes.js +0 -39
- package/providers/_builtin/ide/kiro/scripts/webview_list_sessions.js +0 -21
- package/providers/_builtin/ide/kiro/scripts/webview_new_session.js +0 -34
- package/providers/_builtin/ide/kiro/scripts/webview_read_chat.js +0 -68
- package/providers/_builtin/ide/kiro/scripts/webview_send_message.js +0 -72
- package/providers/_builtin/ide/kiro/scripts/webview_set_mode.js +0 -15
- package/providers/_builtin/ide/kiro/scripts/webview_set_model.js +0 -15
- package/providers/_builtin/ide/kiro/scripts/webview_switch_session.js +0 -26
- package/providers/_builtin/ide/kiro/scripts.js +0 -62
- package/providers/_builtin/ide/pearai/provider.json +0 -36
- package/providers/_builtin/ide/pearai/scripts/focus_editor.js +0 -20
- package/providers/_builtin/ide/pearai/scripts/list_sessions.js +0 -38
- package/providers/_builtin/ide/pearai/scripts/new_session.js +0 -55
- package/providers/_builtin/ide/pearai/scripts/open_panel.js +0 -46
- package/providers/_builtin/ide/pearai/scripts/resolve_action.js +0 -54
- package/providers/_builtin/ide/pearai/scripts/send_message.js +0 -29
- package/providers/_builtin/ide/pearai/scripts/webview_list_models.js +0 -43
- package/providers/_builtin/ide/pearai/scripts/webview_list_modes.js +0 -35
- package/providers/_builtin/ide/pearai/scripts/webview_list_sessions.js +0 -62
- package/providers/_builtin/ide/pearai/scripts/webview_new_session.js +0 -49
- package/providers/_builtin/ide/pearai/scripts/webview_read_chat.js +0 -92
- package/providers/_builtin/ide/pearai/scripts/webview_resolve_action.js +0 -59
- package/providers/_builtin/ide/pearai/scripts/webview_send_message.js +0 -72
- package/providers/_builtin/ide/pearai/scripts/webview_set_mode.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/webview_set_model.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/webview_switch_session.js +0 -34
- package/providers/_builtin/ide/pearai/scripts.js +0 -74
- package/providers/_builtin/ide/trae/provider.json +0 -35
- package/providers/_builtin/ide/trae/scripts/focus_editor.js +0 -20
- package/providers/_builtin/ide/trae/scripts/list_chats.js +0 -24
- package/providers/_builtin/ide/trae/scripts/list_models.js +0 -39
- package/providers/_builtin/ide/trae/scripts/list_modes.js +0 -39
- package/providers/_builtin/ide/trae/scripts/new_session.js +0 -30
- package/providers/_builtin/ide/trae/scripts/open_panel.js +0 -44
- package/providers/_builtin/ide/trae/scripts/read_chat.js +0 -113
- package/providers/_builtin/ide/trae/scripts/resolve_action.js +0 -54
- package/providers/_builtin/ide/trae/scripts/send_message.js +0 -69
- package/providers/_builtin/ide/trae/scripts/set_mode.js +0 -15
- package/providers/_builtin/ide/trae/scripts/set_model.js +0 -15
- package/providers/_builtin/ide/trae/scripts/switch_session.js +0 -23
- package/providers/_builtin/ide/trae/scripts.js +0 -57
- package/providers/_builtin/ide/vscode/provider.json +0 -33
- package/providers/_builtin/ide/vscode-insiders/provider.json +0 -31
- package/providers/_builtin/ide/vscodium/provider.json +0 -32
- package/providers/_builtin/ide/windsurf/provider.json +0 -22
- package/providers/_builtin/ide/windsurf/scripts/focus_editor.js +0 -30
- package/providers/_builtin/ide/windsurf/scripts/list_chats.js +0 -117
- package/providers/_builtin/ide/windsurf/scripts/list_models.js +0 -39
- package/providers/_builtin/ide/windsurf/scripts/list_modes.js +0 -39
- package/providers/_builtin/ide/windsurf/scripts/new_session.js +0 -69
- package/providers/_builtin/ide/windsurf/scripts/open_panel.js +0 -58
- package/providers/_builtin/ide/windsurf/scripts/read_chat.js +0 -297
- package/providers/_builtin/ide/windsurf/scripts/resolve_action.js +0 -68
- package/providers/_builtin/ide/windsurf/scripts/send_message.js +0 -87
- package/providers/_builtin/ide/windsurf/scripts/set_mode.js +0 -15
- package/providers/_builtin/ide/windsurf/scripts/set_model.js +0 -15
- package/providers/_builtin/ide/windsurf/scripts/switch_session.js +0 -58
- package/providers/_builtin/ide/windsurf/scripts.js +0 -57
- package/providers/_builtin/validate.js +0 -156
|
@@ -1,452 +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
|
-
const h = p.querySelector('.composer-human-message');
|
|
43
|
-
const userText = h ? h.textContent.trim().substring(0, 6000) : '';
|
|
44
|
-
if (h) msgs.push({ role: 'user', content: userText, index: msgs.length });
|
|
45
|
-
// pair의 첫 번째 자식은 사용자 메시지 블록 — 그 안의 rendered는 건너뜀
|
|
46
|
-
const firstChild = p.children[0];
|
|
47
|
-
p.querySelectorAll('.composer-rendered-message').forEach(a => {
|
|
48
|
-
if (firstChild && firstChild.contains(a)) return;
|
|
49
|
-
if (a.closest('.composer-human-message')) return;
|
|
50
|
-
const t = a.textContent.trim();
|
|
51
|
-
if (t && t !== userText) msgs.push({ role: 'assistant', content: t.substring(0, 6000), index: msgs.length });
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
const inputEl = document.querySelector('.aislash-editor-input[contenteditable="true"]');
|
|
55
|
-
const inputContent = inputEl?.textContent?.trim() || '';
|
|
56
|
-
const titleParts = document.title.split(' — ');
|
|
57
|
-
const projectTitle = (titleParts.length >= 2 ? titleParts[titleParts.length - 2] : titleParts[0] || '').trim();
|
|
58
|
-
return JSON.stringify({ id, status, title: projectTitle, messages: msgs, inputContent, activeModal });
|
|
59
|
-
} catch(e) {
|
|
60
|
-
return JSON.stringify({ id: '', status: 'error', messages: [] });
|
|
61
|
-
}
|
|
62
|
-
})()`;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
module.exports.sendMessage = function sendMessage(params) {
|
|
66
|
-
const text = typeof params === 'string' ? params : params?.text;
|
|
67
|
-
return `(() => {
|
|
68
|
-
try {
|
|
69
|
-
const input = document.querySelector('.aislash-editor-input[contenteditable="true"]');
|
|
70
|
-
if (!input) return JSON.stringify({ sent: false, error: 'Input box not found' });
|
|
71
|
-
return JSON.stringify({
|
|
72
|
-
sent: false,
|
|
73
|
-
needsTypeAndSend: true,
|
|
74
|
-
selector: '.aislash-editor-input[contenteditable="true"]',
|
|
75
|
-
});
|
|
76
|
-
} catch(e) {
|
|
77
|
-
return JSON.stringify({ sent: false, error: e.message });
|
|
78
|
-
}
|
|
79
|
-
})()`;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
module.exports.listSessions = function listSessions(params) {
|
|
83
|
-
return `(() => {
|
|
84
|
-
try {
|
|
85
|
-
const sessions = [];
|
|
86
|
-
const cells = [...document.querySelectorAll('.agent-sidebar-cell')];
|
|
87
|
-
const activeComposer = document.querySelector('[data-composer-id]');
|
|
88
|
-
const activeId = activeComposer?.getAttribute('data-composer-id') || null;
|
|
89
|
-
cells.forEach((cell, i) => {
|
|
90
|
-
const titleEl = cell.querySelector('.agent-sidebar-cell-text');
|
|
91
|
-
const title = titleEl?.textContent?.trim() || 'Untitled';
|
|
92
|
-
const isSelected = cell.getAttribute('data-selected') === 'true';
|
|
93
|
-
sessions.push({
|
|
94
|
-
id: isSelected && activeId ? activeId : 'sidebar-' + i,
|
|
95
|
-
title,
|
|
96
|
-
active: isSelected,
|
|
97
|
-
index: i,
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
// If no sidebar cells, fallback to current composer
|
|
101
|
-
if (sessions.length === 0 && activeComposer) {
|
|
102
|
-
sessions.push({
|
|
103
|
-
id: activeId,
|
|
104
|
-
title: document.title.split(' — ')[0],
|
|
105
|
-
active: true,
|
|
106
|
-
index: 0,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return JSON.stringify({ sessions });
|
|
110
|
-
} catch(e) {
|
|
111
|
-
return JSON.stringify({ sessions: [], error: e.message });
|
|
112
|
-
}
|
|
113
|
-
})()`;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
module.exports.switchSession = function switchSession(params) {
|
|
117
|
-
const index = typeof params === 'number' ? params : params?.index;
|
|
118
|
-
const title = typeof params === 'string' ? params : params?.title;
|
|
119
|
-
return `(() => {
|
|
120
|
-
try {
|
|
121
|
-
const cells = [...document.querySelectorAll('.agent-sidebar-cell')];
|
|
122
|
-
let target;
|
|
123
|
-
if (${JSON.stringify(title)}) {
|
|
124
|
-
target = cells.find(c => {
|
|
125
|
-
const t = c.querySelector('.agent-sidebar-cell-text')?.textContent?.trim() || '';
|
|
126
|
-
return t.toLowerCase().includes(${JSON.stringify((title||'').toLowerCase())});
|
|
127
|
-
});
|
|
128
|
-
} else {
|
|
129
|
-
target = cells[${index ?? 0}];
|
|
130
|
-
}
|
|
131
|
-
if (!target) return JSON.stringify({ switched: false, error: 'Session not found', available: cells.length });
|
|
132
|
-
target.click();
|
|
133
|
-
return JSON.stringify({ switched: true, title: target.querySelector('.agent-sidebar-cell-text')?.textContent?.trim() });
|
|
134
|
-
} catch(e) {
|
|
135
|
-
return JSON.stringify({ switched: false, error: e.message });
|
|
136
|
-
}
|
|
137
|
-
})()`;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
module.exports.newSession = function newSession(params) {
|
|
141
|
-
return `(() => {
|
|
142
|
-
try {
|
|
143
|
-
const newBtn = [...document.querySelectorAll('a.action-label.codicon-add-two, [aria-label*="New Chat"], [aria-label*="New Composer"]')]
|
|
144
|
-
.find(a => a.offsetWidth > 0);
|
|
145
|
-
if (newBtn) { newBtn.click(); return JSON.stringify({ created: true }); }
|
|
146
|
-
return JSON.stringify({ created: false, error: 'New Chat button not found' });
|
|
147
|
-
} catch(e) {
|
|
148
|
-
return JSON.stringify({ created: false, error: e.message });
|
|
149
|
-
}
|
|
150
|
-
})()`;
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
module.exports.focusEditor = function focusEditor(params) {
|
|
154
|
-
return `(() => {
|
|
155
|
-
try {
|
|
156
|
-
const input = document.querySelector('.aislash-editor-input[contenteditable="true"]');
|
|
157
|
-
if (input) { input.focus(); return 'focused'; }
|
|
158
|
-
return 'not_found';
|
|
159
|
-
} catch(e) { return 'error'; }
|
|
160
|
-
})()`;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
module.exports.openPanel = function openPanel(params) {
|
|
164
|
-
return `(() => {
|
|
165
|
-
try {
|
|
166
|
-
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
167
|
-
if (sidebar && sidebar.offsetWidth > 0) {
|
|
168
|
-
const chatView = document.querySelector('[data-composer-id]');
|
|
169
|
-
if (chatView) return 'visible';
|
|
170
|
-
}
|
|
171
|
-
const btns = [...document.querySelectorAll('li.action-item a, button, [role="tab"]')];
|
|
172
|
-
const toggle = btns.find(b => {
|
|
173
|
-
const label = (b.textContent || b.getAttribute('aria-label') || '').toLowerCase();
|
|
174
|
-
return /agent|chat|composer|cursor tab/i.test(label);
|
|
175
|
-
});
|
|
176
|
-
if (toggle) { toggle.click(); return 'opened'; }
|
|
177
|
-
return 'not_found';
|
|
178
|
-
} catch (e) { return 'error'; }
|
|
179
|
-
})()`;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
module.exports.resolveAction = function resolveAction(params) {
|
|
183
|
-
const action = typeof params === 'string' ? params : params?.action || 'approve';
|
|
184
|
-
const buttonText = params?.button || params?.buttonText
|
|
185
|
-
|| (action === 'approve' ? 'Run' : action === 'reject' ? 'Skip' : action);
|
|
186
|
-
return `(() => {
|
|
187
|
-
try {
|
|
188
|
-
const btns = [...document.querySelectorAll('button, [role="button"], .cursor-pointer')].filter(b => b.offsetWidth > 0);
|
|
189
|
-
const searchText = ${JSON.stringify((buttonText||'').toLowerCase())};
|
|
190
|
-
const target = btns.find(b => (b.textContent||'').trim().replace(/[⏎↵]/g, '').trim().toLowerCase().includes(searchText));
|
|
191
|
-
if (target) { target.click(); return JSON.stringify({ resolved: true, clicked: target.textContent.trim() }); }
|
|
192
|
-
return JSON.stringify({ resolved: false, available: btns.map(b => b.textContent.trim()).filter(Boolean).slice(0, 15) });
|
|
193
|
-
} catch(e) { return JSON.stringify({ resolved: false, error: e.message }); }
|
|
194
|
-
})()`;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
module.exports.listNotifications = function listNotifications(params) {
|
|
198
|
-
const filter = typeof params === 'string' ? params : params?.message;
|
|
199
|
-
return `(() => {
|
|
200
|
-
try {
|
|
201
|
-
const toasts = [...document.querySelectorAll('.notifications-toasts .notification-toast, .notification-list-item')];
|
|
202
|
-
const visible = toasts.filter(t => t.offsetWidth > 0).map((t, i) => ({
|
|
203
|
-
index: i,
|
|
204
|
-
message: t.querySelector('.notification-list-item-message')?.textContent?.trim() || t.textContent?.trim().substring(0, 200),
|
|
205
|
-
severity: t.querySelector('.codicon-error') ? 'error' : t.querySelector('.codicon-warning') ? 'warning' : 'info',
|
|
206
|
-
buttons: [...t.querySelectorAll('.notification-list-item-buttons-container button, .monaco-button')].map(b => b.textContent?.trim()).filter(Boolean),
|
|
207
|
-
}));
|
|
208
|
-
const f = ${JSON.stringify(filter || null)};
|
|
209
|
-
return JSON.stringify(f ? visible.filter(n => n.message.toLowerCase().includes(f.toLowerCase())) : visible);
|
|
210
|
-
} catch(e) { return JSON.stringify([]); }
|
|
211
|
-
})()`;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
module.exports.dismissNotification = function dismissNotification(params) {
|
|
215
|
-
const index = typeof params === 'number' ? params : params?.index;
|
|
216
|
-
const button = typeof params === 'string' ? params : params?.button;
|
|
217
|
-
const message = params?.message;
|
|
218
|
-
return `(() => {
|
|
219
|
-
try {
|
|
220
|
-
const toasts = [...document.querySelectorAll('.notifications-toasts .notification-toast, .notification-list-item')].filter(t => t.offsetWidth > 0);
|
|
221
|
-
let toast;
|
|
222
|
-
if (${JSON.stringify(message)}) {
|
|
223
|
-
toast = toasts.find(t => (t.querySelector('.notification-list-item-message')?.textContent || t.textContent || '').toLowerCase().includes(${JSON.stringify((message||'').toLowerCase())}));
|
|
224
|
-
} else {
|
|
225
|
-
toast = toasts[${index ?? 0}];
|
|
226
|
-
}
|
|
227
|
-
if (!toast) return JSON.stringify({ dismissed: false, error: 'Toast not found', count: toasts.length });
|
|
228
|
-
if (${JSON.stringify(button)}) {
|
|
229
|
-
const btn = [...toast.querySelectorAll('button')].find(b => b.textContent?.trim().toLowerCase().includes(${JSON.stringify((button||'').toLowerCase())}));
|
|
230
|
-
if (btn) { btn.click(); return JSON.stringify({ dismissed: true, clicked: btn.textContent.trim() }); }
|
|
231
|
-
return JSON.stringify({ dismissed: false, error: 'Button not found' });
|
|
232
|
-
}
|
|
233
|
-
const closeBtn = toast.querySelector('.codicon-notifications-clear, .clear-notification-action, .codicon-close');
|
|
234
|
-
if (closeBtn) { closeBtn.click(); return JSON.stringify({ dismissed: true }); }
|
|
235
|
-
return JSON.stringify({ dismissed: false, error: 'Close button not found' });
|
|
236
|
-
} catch(e) { return JSON.stringify({ dismissed: false, error: e.message }); }
|
|
237
|
-
})()`;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
module.exports.listModels = function listModels(params) {
|
|
241
|
-
return `(async () => {
|
|
242
|
-
try {
|
|
243
|
-
let current = '';
|
|
244
|
-
const models = [];
|
|
245
|
-
|
|
246
|
-
// 현재 모델: .composer-unified-dropdown-model 텍스트
|
|
247
|
-
const modelBtn = document.querySelector('.composer-unified-dropdown-model');
|
|
248
|
-
if (modelBtn) {
|
|
249
|
-
current = modelBtn.textContent?.trim() || '';
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// 드롭다운 열기
|
|
253
|
-
if (modelBtn) {
|
|
254
|
-
modelBtn.click();
|
|
255
|
-
await new Promise(r => setTimeout(r, 500));
|
|
256
|
-
|
|
257
|
-
const menu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
258
|
-
if (menu) {
|
|
259
|
-
// Auto 토글 확인 및 끄기
|
|
260
|
-
const autoItem = menu.querySelector('.composer-unified-context-menu-item[data-is-selected="true"]');
|
|
261
|
-
const autoToggle = autoItem ? [...autoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24 && el.offsetHeight === 14) : null;
|
|
262
|
-
let wasAutoOn = false;
|
|
263
|
-
if (autoToggle) {
|
|
264
|
-
const bgStyle = autoToggle.getAttribute('style') || '';
|
|
265
|
-
wasAutoOn = bgStyle.includes('green');
|
|
266
|
-
if (wasAutoOn) {
|
|
267
|
-
autoToggle.click();
|
|
268
|
-
await new Promise(r => setTimeout(r, 500));
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// 모델 목록 수집 (Auto 끈 상태)
|
|
273
|
-
const refreshedMenu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
274
|
-
if (refreshedMenu) {
|
|
275
|
-
const items = refreshedMenu.querySelectorAll('.composer-unified-context-menu-item');
|
|
276
|
-
for (const item of items) {
|
|
277
|
-
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
278
|
-
const name = nameEl?.textContent?.trim() || '';
|
|
279
|
-
if (name && name !== 'Add Models') {
|
|
280
|
-
// Think 모드 감지: codicon-br (brain) 아이콘
|
|
281
|
-
const hasBrain = !!item.querySelector('[class*="codicon-br"]');
|
|
282
|
-
const displayName = hasBrain ? name + ' 🧠' : name;
|
|
283
|
-
models.push(displayName);
|
|
284
|
-
if (item.getAttribute('data-is-selected') === 'true') current = displayName;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Auto 다시 켜기 (원래 상태 복원)
|
|
290
|
-
if (wasAutoOn) {
|
|
291
|
-
const newMenu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
292
|
-
const newAutoItem = newMenu?.querySelector('.composer-unified-context-menu-item');
|
|
293
|
-
const newToggle = newAutoItem ? [...newAutoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24) : null;
|
|
294
|
-
if (newToggle) {
|
|
295
|
-
newToggle.click();
|
|
296
|
-
await new Promise(r => setTimeout(r, 200));
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// 닫기 (Escape)
|
|
302
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return JSON.stringify({ models, current });
|
|
306
|
-
} catch(e) { return JSON.stringify({ models: [], current: '', error: e.message }); }
|
|
307
|
-
})()`;
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
module.exports.setModel = function setModel(params) {
|
|
311
|
-
const model = typeof params === 'string' ? params : params?.model;
|
|
312
|
-
const escaped = JSON.stringify(model);
|
|
313
|
-
return `(async () => {
|
|
314
|
-
try {
|
|
315
|
-
const target = ${escaped};
|
|
316
|
-
|
|
317
|
-
// 모델 드롭다운 열기
|
|
318
|
-
const modelBtn = document.querySelector('.composer-unified-dropdown-model');
|
|
319
|
-
if (!modelBtn) return JSON.stringify({ success: false, error: 'Model button not found' });
|
|
320
|
-
|
|
321
|
-
modelBtn.click();
|
|
322
|
-
await new Promise(r => setTimeout(r, 500));
|
|
323
|
-
|
|
324
|
-
const menu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
325
|
-
if (!menu) return JSON.stringify({ success: false, error: 'Model picker menu not found' });
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
// 🧠 접미사 처리
|
|
329
|
-
const wantBrain = target.includes('🧠');
|
|
330
|
-
const searchName = target.replace(/\\s*🧠\\s*$/, '').trim();
|
|
331
|
-
|
|
332
|
-
// Auto 토글 끄기 (모델 목록 노출)
|
|
333
|
-
const autoItem = menu.querySelector('.composer-unified-context-menu-item[data-is-selected="true"]');
|
|
334
|
-
const autoToggle = autoItem ? [...autoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24 && el.offsetHeight === 14) : null;
|
|
335
|
-
let wasAutoOn = false;
|
|
336
|
-
if (autoToggle) {
|
|
337
|
-
const bgStyle = autoToggle.getAttribute('style') || '';
|
|
338
|
-
wasAutoOn = bgStyle.includes('green');
|
|
339
|
-
if (wasAutoOn) {
|
|
340
|
-
autoToggle.click();
|
|
341
|
-
await new Promise(r => setTimeout(r, 500));
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// 검색 입력으로 필터링
|
|
346
|
-
const refreshedMenu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
347
|
-
const searchInput = refreshedMenu?.querySelector('input[placeholder="Search models"]');
|
|
348
|
-
if (searchInput) {
|
|
349
|
-
searchInput.focus();
|
|
350
|
-
searchInput.value = searchName;
|
|
351
|
-
searchInput.dispatchEvent(new Event('input', { bubbles: true }));
|
|
352
|
-
await new Promise(r => setTimeout(r, 300));
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// 아이템에서 찾기 (brain 아이콘 매칭)
|
|
356
|
-
const items = (refreshedMenu || menu).querySelectorAll('.composer-unified-context-menu-item');
|
|
357
|
-
for (const item of items) {
|
|
358
|
-
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
359
|
-
const name = nameEl?.textContent?.trim() || '';
|
|
360
|
-
if (!name || name === 'Add Models') continue;
|
|
361
|
-
const hasBrain = !!item.querySelector('[class*="codicon-br"]');
|
|
362
|
-
|
|
363
|
-
if (name.toLowerCase().includes(searchName.toLowerCase()) && hasBrain === wantBrain) {
|
|
364
|
-
item.click();
|
|
365
|
-
await new Promise(r => setTimeout(r, 200));
|
|
366
|
-
const displayName = hasBrain ? name + ' 🧠' : name;
|
|
367
|
-
return JSON.stringify({ success: true, model: displayName });
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
// Auto 복원 + 닫기
|
|
372
|
-
if (wasAutoOn) {
|
|
373
|
-
const nm = document.querySelector('[data-testid="model-picker-menu"]');
|
|
374
|
-
const nai = nm?.querySelector('.composer-unified-context-menu-item');
|
|
375
|
-
const nt = nai ? [...nai.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24) : null;
|
|
376
|
-
if (nt) nt.click();
|
|
377
|
-
await new Promise(r => setTimeout(r, 200));
|
|
378
|
-
}
|
|
379
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
380
|
-
return JSON.stringify({ success: false, error: 'model not found: ' + target });
|
|
381
|
-
} catch(e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
382
|
-
})()`;
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
module.exports.listModes = function listModes(params) {
|
|
386
|
-
return `(async () => {
|
|
387
|
-
try {
|
|
388
|
-
const modes = [];
|
|
389
|
-
let current = '';
|
|
390
|
-
|
|
391
|
-
// 모드 드롭다운 버튼 (아이콘, model이 아닌 unified-dropdown)
|
|
392
|
-
const modeBtn = document.querySelector('.composer-unified-dropdown:not(.composer-unified-dropdown-model)');
|
|
393
|
-
if (!modeBtn) return JSON.stringify({ modes: [], current: '', error: 'Mode button not found' });
|
|
394
|
-
|
|
395
|
-
modeBtn.click();
|
|
396
|
-
await new Promise(r => setTimeout(r, 500));
|
|
397
|
-
|
|
398
|
-
// 팝오버에서 아이템 수집
|
|
399
|
-
const menu = document.querySelector('[data-testid="model-picker-menu"]') || document.querySelector('.typeahead-popover');
|
|
400
|
-
if (menu) {
|
|
401
|
-
const items = menu.querySelectorAll('.composer-unified-context-menu-item');
|
|
402
|
-
for (const item of items) {
|
|
403
|
-
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
404
|
-
const name = nameEl?.textContent?.trim() || '';
|
|
405
|
-
if (name) {
|
|
406
|
-
modes.push(name);
|
|
407
|
-
if (item.getAttribute('data-is-selected') === 'true') current = name;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// 닫기
|
|
413
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
414
|
-
|
|
415
|
-
return JSON.stringify({ modes, current });
|
|
416
|
-
} catch(e) { return JSON.stringify({ modes: [], current: '', error: e.message }); }
|
|
417
|
-
})()`;
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
module.exports.setMode = function setMode(params) {
|
|
421
|
-
const mode = typeof params === 'string' ? params : params?.mode;
|
|
422
|
-
const escaped = JSON.stringify(mode);
|
|
423
|
-
return `(async () => {
|
|
424
|
-
try {
|
|
425
|
-
const target = ${escaped};
|
|
426
|
-
|
|
427
|
-
const modeBtn = document.querySelector('.composer-unified-dropdown:not(.composer-unified-dropdown-model)');
|
|
428
|
-
if (!modeBtn) return JSON.stringify({ success: false, error: 'Mode button not found' });
|
|
429
|
-
|
|
430
|
-
modeBtn.click();
|
|
431
|
-
await new Promise(r => setTimeout(r, 500));
|
|
432
|
-
|
|
433
|
-
const menu = document.querySelector('[data-testid="model-picker-menu"]') || document.querySelector('.typeahead-popover');
|
|
434
|
-
if (!menu) return JSON.stringify({ success: false, error: 'Mode menu not found' });
|
|
435
|
-
|
|
436
|
-
const items = menu.querySelectorAll('.composer-unified-context-menu-item');
|
|
437
|
-
for (const item of items) {
|
|
438
|
-
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
439
|
-
const name = nameEl?.textContent?.trim() || '';
|
|
440
|
-
if (name && (name === target || name.toLowerCase() === target.toLowerCase())) {
|
|
441
|
-
item.click();
|
|
442
|
-
await new Promise(r => setTimeout(r, 200));
|
|
443
|
-
return JSON.stringify({ success: true, mode: name });
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
448
|
-
return JSON.stringify({ success: false, error: 'mode not found: ' + target });
|
|
449
|
-
} catch(e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
450
|
-
})()`;
|
|
451
|
-
};
|
|
452
|
-
|
|
@@ -1,36 +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
|
-
}
|
|
@@ -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,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — open_panel
|
|
3
|
-
*
|
|
4
|
-
* Kiro AI 채팅 패널 열기.
|
|
5
|
-
* Secondary Side Bar (#workbench.parts.auxiliarybar)에 위치.
|
|
6
|
-
* "Toggle Secondary Side Bar (⌥⌘B)" 또는 "Kiro" 버튼으로 열기.
|
|
7
|
-
*
|
|
8
|
-
* 반환: 'visible' | 'opened' | 'error: ...'
|
|
9
|
-
*/
|
|
10
|
-
(() => {
|
|
11
|
-
try {
|
|
12
|
-
// 1. 이미 열려 있는지 확인
|
|
13
|
-
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
14
|
-
if (sidebar && sidebar.offsetWidth > 0 && sidebar.offsetHeight > 0) {
|
|
15
|
-
return 'visible';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 2. Toggle 버튼 클릭 시도
|
|
19
|
-
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
20
|
-
for (const btn of toggleBtns) {
|
|
21
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
22
|
-
if (label.includes('toggle secondary') || label.includes('toggle auxiliary') ||
|
|
23
|
-
label === 'kiro' || label.includes('kiro')) {
|
|
24
|
-
if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
|
|
25
|
-
btn.click();
|
|
26
|
-
return 'opened (toggle)';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// 3. Cmd+Shift+I 단축키 폴백 (Kiro 기본 단축키)
|
|
32
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
33
|
-
key: 'b', code: 'KeyB', keyCode: 66,
|
|
34
|
-
metaKey: true, altKey: true, ctrlKey: false,
|
|
35
|
-
bubbles: true, cancelable: true,
|
|
36
|
-
}));
|
|
37
|
-
document.dispatchEvent(new KeyboardEvent('keyup', {
|
|
38
|
-
key: 'b', code: 'KeyB', keyCode: 66,
|
|
39
|
-
metaKey: true, altKey: true, ctrlKey: false,
|
|
40
|
-
bubbles: true, cancelable: true,
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
return 'opened (⌥⌘B)';
|
|
44
|
-
} catch (e) {
|
|
45
|
-
return 'error: ' + e.message;
|
|
46
|
-
}
|
|
47
|
-
})()
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — resolve_action
|
|
3
|
-
*
|
|
4
|
-
* 승인/거부 버튼 찾기 + 좌표 반환.
|
|
5
|
-
* Kiro의 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
|
-
* Kiro — send_message
|
|
3
|
-
*
|
|
4
|
-
* Kiro의 채팅 입력은 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
|
-
})()
|
|
@@ -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
|
-
})()
|