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,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — list_chats
|
|
3
|
-
*
|
|
4
|
-
* Trae 메인 DOM에서 탭 / 세션 목록 가져오기.
|
|
5
|
-
*/
|
|
6
|
-
(() => {
|
|
7
|
-
try {
|
|
8
|
-
const tabs = document.querySelectorAll('.chat-tab-header, [class*="tab-item"], [class*="TabItem"]');
|
|
9
|
-
if (tabs.length === 0) return JSON.stringify({ sessions: [] });
|
|
10
|
-
|
|
11
|
-
const sessions = Array.from(tabs).map((tab, i) => {
|
|
12
|
-
const title = (tab.textContent || '').replace('✕', '').trim();
|
|
13
|
-
const active = tab.classList.contains('active') ||
|
|
14
|
-
tab.getAttribute('aria-selected') === 'true' ||
|
|
15
|
-
(tab.className || '').toLowerCase().includes('active');
|
|
16
|
-
return { id: String(i), title, active };
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
// 탭 목록이 보이지 않으면 사이드바의 히스토리 버튼 확인
|
|
20
|
-
return JSON.stringify({ sessions });
|
|
21
|
-
} catch (e) {
|
|
22
|
-
return JSON.stringify({ error: e.message, sessions: [] });
|
|
23
|
-
}
|
|
24
|
-
})()
|
|
@@ -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,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,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — new_session
|
|
3
|
-
*
|
|
4
|
-
* "New Task" 생성 (⌃⌘N 단축키 또는 버튼 클릭).
|
|
5
|
-
* Trae는 메인 DOM에서 접근 가능.
|
|
6
|
-
*/
|
|
7
|
-
(() => {
|
|
8
|
-
try {
|
|
9
|
-
// 버튼 찾기
|
|
10
|
-
const buttons = document.querySelectorAll('button, [role="button"], .action-item a');
|
|
11
|
-
for (const btn of buttons) {
|
|
12
|
-
const text = (btn.textContent || '').trim();
|
|
13
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
14
|
-
if (text.includes('New Task') || label.includes('new task') || label.includes('new chat')) {
|
|
15
|
-
btn.click();
|
|
16
|
-
return JSON.stringify({ created: true, method: 'button' });
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 단축키 폴백: ⌃⌘N
|
|
21
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
22
|
-
key: 'n', code: 'KeyN', keyCode: 78,
|
|
23
|
-
metaKey: true, ctrlKey: true,
|
|
24
|
-
bubbles: true, cancelable: true,
|
|
25
|
-
}));
|
|
26
|
-
return JSON.stringify({ created: true, method: 'shortcut' });
|
|
27
|
-
} catch (e) {
|
|
28
|
-
return JSON.stringify({ created: false, error: e.message });
|
|
29
|
-
}
|
|
30
|
-
})()
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — open_panel
|
|
3
|
-
*
|
|
4
|
-
* Trae AI 채팅 패널 열기.
|
|
5
|
-
* "TRAE" 버튼 또는 ⌘L 단축키로 열기.
|
|
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. "TRAE" 버튼 클릭 시도
|
|
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') || '');
|
|
21
|
-
if (label === 'TRAE' || label.toLowerCase().includes('toggle secondary') ||
|
|
22
|
-
label.toLowerCase().includes('toggle auxiliary')) {
|
|
23
|
-
btn.click();
|
|
24
|
-
return 'opened (toggle)';
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// 3. Cmd+L 단축키 폴백 (Trae 기본 단축키)
|
|
29
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
30
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
31
|
-
metaKey: true, ctrlKey: false,
|
|
32
|
-
bubbles: true, cancelable: true,
|
|
33
|
-
}));
|
|
34
|
-
document.dispatchEvent(new KeyboardEvent('keyup', {
|
|
35
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
36
|
-
metaKey: true, ctrlKey: false,
|
|
37
|
-
bubbles: true, cancelable: true,
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
return 'opened (⌘L)';
|
|
41
|
-
} catch (e) {
|
|
42
|
-
return 'error: ' + e.message;
|
|
43
|
-
}
|
|
44
|
-
})()
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — read_chat
|
|
3
|
-
*
|
|
4
|
-
* Trae는 메인 DOM에서 직접 채팅 내용에 접근 가능.
|
|
5
|
-
* 채팅 턴은 .chat-turn 요소로 구분.
|
|
6
|
-
* 유저: .user-chat-bubble-request__content-wrapper
|
|
7
|
-
* 어시스턴트: .assistant-chat-turn-content .chat-markdown
|
|
8
|
-
*
|
|
9
|
-
* 반환: ReadChatResult { id, status, messages, title?, inputContent?, activeModal? }
|
|
10
|
-
*/
|
|
11
|
-
(() => {
|
|
12
|
-
try {
|
|
13
|
-
const auxbar = document.getElementById('workbench.parts.auxiliarybar');
|
|
14
|
-
if (!auxbar || auxbar.offsetWidth === 0) {
|
|
15
|
-
return JSON.stringify({ id: '', status: 'idle', messages: [] });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// ─── 1. 메시지 수집 ───
|
|
19
|
-
const messages = [];
|
|
20
|
-
const turns = auxbar.querySelectorAll('.chat-turn');
|
|
21
|
-
|
|
22
|
-
turns.forEach((turn, idx) => {
|
|
23
|
-
// User message
|
|
24
|
-
const userBubble = turn.querySelector('.user-chat-bubble-request__content-wrapper');
|
|
25
|
-
if (userBubble) {
|
|
26
|
-
messages.push({
|
|
27
|
-
role: 'user',
|
|
28
|
-
content: userBubble.textContent.trim(),
|
|
29
|
-
index: idx,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Assistant message
|
|
34
|
-
const assistantEl = turn.querySelector('.assistant-chat-turn-content');
|
|
35
|
-
if (assistantEl) {
|
|
36
|
-
const mdBlocks = assistantEl.querySelectorAll('.chat-markdown-p, .chat-markdown pre');
|
|
37
|
-
let content = '';
|
|
38
|
-
if (mdBlocks.length > 0) {
|
|
39
|
-
content = Array.from(mdBlocks).map(b => b.textContent.trim()).join('\n');
|
|
40
|
-
} else {
|
|
41
|
-
content = assistantEl.textContent.trim();
|
|
42
|
-
}
|
|
43
|
-
if (content) {
|
|
44
|
-
messages.push({
|
|
45
|
-
role: 'assistant',
|
|
46
|
-
content: content,
|
|
47
|
-
index: idx,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// ─── 2. 상태 감지 ───
|
|
54
|
-
let status = 'idle';
|
|
55
|
-
|
|
56
|
-
// Stop 버튼 존재 → generating
|
|
57
|
-
const stopBtn = auxbar.querySelector('button[class*="stop"], [aria-label*="stop" i], [aria-label*="Stop"]');
|
|
58
|
-
if (stopBtn && stopBtn.offsetWidth > 0) {
|
|
59
|
-
status = 'generating';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// progress bar 활성 → generating
|
|
63
|
-
const progress = auxbar.querySelector('.monaco-progress-container:not(.done)');
|
|
64
|
-
if (progress && progress.offsetWidth > 0) {
|
|
65
|
-
status = 'generating';
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// latest-assistant-bar가 가장 정확한 상태 표시 (최종 판정)
|
|
69
|
-
const latestBar = auxbar.querySelector('.latest-assistant-bar');
|
|
70
|
-
if (latestBar) {
|
|
71
|
-
const barText = latestBar.textContent.toLowerCase();
|
|
72
|
-
if (barText.includes('completed') || barText.includes('done')) {
|
|
73
|
-
status = 'idle';
|
|
74
|
-
} else if (barText.includes('thinking') || barText.includes('generating') || barText.includes('running') || barText.includes('searching')) {
|
|
75
|
-
status = 'generating';
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ─── 3. 승인 대기 모달 ───
|
|
80
|
-
let activeModal = null;
|
|
81
|
-
const dialogs = auxbar.querySelectorAll('[role="dialog"], .monaco-dialog-box, [class*="approval"], [class*="confirm"]');
|
|
82
|
-
if (dialogs.length > 0) {
|
|
83
|
-
const dialog = dialogs[0];
|
|
84
|
-
const buttons = Array.from(dialog.querySelectorAll('button')).map(b => b.textContent.trim()).filter(Boolean);
|
|
85
|
-
if (buttons.length > 0) {
|
|
86
|
-
activeModal = {
|
|
87
|
-
message: dialog.textContent.trim().substring(0, 200),
|
|
88
|
-
buttons: buttons,
|
|
89
|
-
};
|
|
90
|
-
status = 'waiting_approval';
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// ─── 4. 입력 필드 내용 ───
|
|
95
|
-
const input = auxbar.querySelector('.chat-input-v2-input-box-editable, [contenteditable="true"]');
|
|
96
|
-
const inputContent = input ? input.textContent.trim() : '';
|
|
97
|
-
|
|
98
|
-
// ─── 5. 세션 ID / 타이틀 ───
|
|
99
|
-
const sessionTab = auxbar.querySelector('[class*="session-tab"], [class*="chat-title"]');
|
|
100
|
-
const title = sessionTab ? sessionTab.textContent.trim() : '';
|
|
101
|
-
|
|
102
|
-
return JSON.stringify({
|
|
103
|
-
id: title || 'trae-default',
|
|
104
|
-
status: status,
|
|
105
|
-
messages: messages,
|
|
106
|
-
title: title || undefined,
|
|
107
|
-
inputContent: inputContent || undefined,
|
|
108
|
-
activeModal: activeModal,
|
|
109
|
-
});
|
|
110
|
-
} catch (e) {
|
|
111
|
-
return JSON.stringify({ id: '', status: 'error', messages: [], error: e.message });
|
|
112
|
-
}
|
|
113
|
-
})()
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — resolve_action
|
|
3
|
-
*
|
|
4
|
-
* 승인/거부 버튼 찾기 + 좌표 반환.
|
|
5
|
-
* Trae의 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,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — send_message
|
|
3
|
-
*
|
|
4
|
-
* Trae는 .chat-input-v2-input-box-editable (contenteditable / Lexical) 사용.
|
|
5
|
-
* Lexical의 내부 state를 올바르게 업데이트하기 위해 Selection API + execCommand 사용.
|
|
6
|
-
*
|
|
7
|
-
* 파라미터: ${ MESSAGE }
|
|
8
|
-
*/
|
|
9
|
-
(async () => {
|
|
10
|
-
try {
|
|
11
|
-
const msg = ${ MESSAGE };
|
|
12
|
-
|
|
13
|
-
// ─── 1. 입력 필드 찾기 ───
|
|
14
|
-
const editor =
|
|
15
|
-
document.querySelector('.chat-input-v2-input-box-editable') ||
|
|
16
|
-
document.querySelector('[contenteditable="true"][role="textbox"]') ||
|
|
17
|
-
document.querySelector('[data-lexical-editor="true"]');
|
|
18
|
-
|
|
19
|
-
if (!editor) return JSON.stringify({ sent: false, error: 'no input found' });
|
|
20
|
-
|
|
21
|
-
// ─── 2. 포커스 + 전체 선택 + 삭제 + 삽입 ───
|
|
22
|
-
editor.focus();
|
|
23
|
-
await new Promise(r => setTimeout(r, 100));
|
|
24
|
-
|
|
25
|
-
// Selection API로 전체 선택
|
|
26
|
-
const sel = window.getSelection();
|
|
27
|
-
const range = document.createRange();
|
|
28
|
-
range.selectNodeContents(editor);
|
|
29
|
-
sel.removeAllRanges();
|
|
30
|
-
sel.addRange(range);
|
|
31
|
-
await new Promise(r => setTimeout(r, 50));
|
|
32
|
-
|
|
33
|
-
// 삭제 후 삽입 (Lexical state 동기화)
|
|
34
|
-
document.execCommand('delete', false, null);
|
|
35
|
-
await new Promise(r => setTimeout(r, 50));
|
|
36
|
-
document.execCommand('insertText', false, msg);
|
|
37
|
-
|
|
38
|
-
// Input 이벤트
|
|
39
|
-
editor.dispatchEvent(new Event('input', { bubbles: true }));
|
|
40
|
-
await new Promise(r => setTimeout(r, 500));
|
|
41
|
-
|
|
42
|
-
// ─── 3. send 버튼 클릭 ───
|
|
43
|
-
const sendBtn = document.querySelector('.chat-input-v2-send-button');
|
|
44
|
-
if (sendBtn && !sendBtn.disabled) {
|
|
45
|
-
sendBtn.click();
|
|
46
|
-
return JSON.stringify({ sent: true, method: 'button' });
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 버튼이 아직 disabled이면 Enter 키 시도
|
|
50
|
-
const enterOpts = {
|
|
51
|
-
key: 'Enter', code: 'Enter',
|
|
52
|
-
keyCode: 13, which: 13,
|
|
53
|
-
bubbles: true, cancelable: true, composed: true,
|
|
54
|
-
};
|
|
55
|
-
editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
|
|
56
|
-
await new Promise(r => setTimeout(r, 50));
|
|
57
|
-
editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
|
|
58
|
-
editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
|
|
59
|
-
|
|
60
|
-
// 여전히 안 되면 needsTypeAndSend 폴백
|
|
61
|
-
return JSON.stringify({
|
|
62
|
-
sent: false,
|
|
63
|
-
needsTypeAndSend: true,
|
|
64
|
-
selector: '.chat-input-v2-input-box-editable',
|
|
65
|
-
});
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return JSON.stringify({ sent: false, error: e.message });
|
|
68
|
-
}
|
|
69
|
-
})()
|
|
@@ -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,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — switch_session
|
|
3
|
-
*
|
|
4
|
-
* Trae 세션 탭 전환.
|
|
5
|
-
* 파라미터: ${ SESSION_ID }
|
|
6
|
-
*/
|
|
7
|
-
(() => {
|
|
8
|
-
try {
|
|
9
|
-
const targetId = ${ SESSION_ID };
|
|
10
|
-
const tabs = document.querySelectorAll('.chat-tab-header, [class*="tab-item"], [class*="TabItem"]');
|
|
11
|
-
const idx = parseInt(targetId, 10);
|
|
12
|
-
|
|
13
|
-
if (isNaN(idx) || idx < 0 || idx >= tabs.length) {
|
|
14
|
-
return JSON.stringify({ switched: false, error: `invalid index: ${targetId}` });
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
tabs[idx].click();
|
|
18
|
-
const title = (tabs[idx].textContent || '').replace('✕', '').trim();
|
|
19
|
-
return JSON.stringify({ switched: true, title });
|
|
20
|
-
} catch (e) {
|
|
21
|
-
return JSON.stringify({ switched: false, error: e.message });
|
|
22
|
-
}
|
|
23
|
-
})()
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CDP Scripts for Trae
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const SCRIPTS_DIR = path.join(__dirname, 'scripts');
|
|
8
|
-
function loadScript(name) {
|
|
9
|
-
try { return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8'); }
|
|
10
|
-
catch { return null; }
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
module.exports.readChat = function readChat() { return loadScript('read_chat.js'); };
|
|
15
|
-
|
|
16
|
-
module.exports.sendMessage = function sendMessage(text) {
|
|
17
|
-
const s = loadScript('send_message.js');
|
|
18
|
-
return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
module.exports.resolveAction = function resolveAction(params) {
|
|
22
|
-
const action = typeof params === 'string' ? params : params?.action || 'approve';
|
|
23
|
-
const buttonText = params?.button || params?.buttonText
|
|
24
|
-
|| (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
|
|
25
|
-
const s = loadScript('resolve_action.js');
|
|
26
|
-
return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
module.exports.openPanel = function openPanel() { return loadScript('open_panel.js'); };
|
|
30
|
-
|
|
31
|
-
module.exports.focusEditor = function focusEditor() { return loadScript('focus_editor.js'); };
|
|
32
|
-
|
|
33
|
-
module.exports.newSession = function newSession() { return loadScript('new_session.js'); };
|
|
34
|
-
|
|
35
|
-
module.exports.listSessions = function listSessions() { return loadScript('list_chats.js'); };
|
|
36
|
-
|
|
37
|
-
module.exports.switchSession = function switchSession(sessionId) {
|
|
38
|
-
const s = loadScript('switch_session.js');
|
|
39
|
-
return s ? s.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId)) : null;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
module.exports.listModels = function listModels() { return loadScript('list_models.js'); };
|
|
43
|
-
|
|
44
|
-
module.exports.setModel = function setModel(params) {
|
|
45
|
-
const model = typeof params === 'string' ? params : params?.model;
|
|
46
|
-
const s = loadScript('set_model.js');
|
|
47
|
-
return s ? s.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model)) : null;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
module.exports.listModes = function listModes() { return loadScript('list_modes.js'); };
|
|
51
|
-
|
|
52
|
-
module.exports.setMode = function setMode(params) {
|
|
53
|
-
const mode = typeof params === 'string' ? params : params?.mode;
|
|
54
|
-
const s = loadScript('set_mode.js');
|
|
55
|
-
return s ? s.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode)) : null;
|
|
56
|
-
};
|
|
57
|
-
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "vscode",
|
|
3
|
-
"name": "Visual Studio Code",
|
|
4
|
-
"category": "ide",
|
|
5
|
-
"displayName": "VS Code",
|
|
6
|
-
"icon": "💙",
|
|
7
|
-
"cli": "code",
|
|
8
|
-
"cdpPorts": [
|
|
9
|
-
9339,
|
|
10
|
-
9340
|
|
11
|
-
],
|
|
12
|
-
"processNames": {
|
|
13
|
-
"darwin": "Visual Studio Code",
|
|
14
|
-
"win32": [
|
|
15
|
-
"Code.exe"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"paths": {
|
|
19
|
-
"darwin": [
|
|
20
|
-
"/Applications/Visual Studio Code.app"
|
|
21
|
-
],
|
|
22
|
-
"win32": [
|
|
23
|
-
"C:\\Program Files\\Microsoft VS Code\\Code.exe",
|
|
24
|
-
"C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
|
|
25
|
-
],
|
|
26
|
-
"linux": [
|
|
27
|
-
"/usr/share/code",
|
|
28
|
-
"/snap/code/current"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
"inputMethod": "cdp-type-and-send",
|
|
32
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]"
|
|
33
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "vscode-insiders",
|
|
3
|
-
"name": "Visual Studio Code - Insiders",
|
|
4
|
-
"category": "ide",
|
|
5
|
-
"displayName": "VS Code Insiders",
|
|
6
|
-
"icon": "💚",
|
|
7
|
-
"cli": "code-insiders",
|
|
8
|
-
"cdpPorts": [
|
|
9
|
-
9341,
|
|
10
|
-
9342
|
|
11
|
-
],
|
|
12
|
-
"processNames": {
|
|
13
|
-
"darwin": "Visual Studio Code - Insiders",
|
|
14
|
-
"win32": [
|
|
15
|
-
"Code - Insiders.exe"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"paths": {
|
|
19
|
-
"darwin": [
|
|
20
|
-
"/Applications/Visual Studio Code - Insiders.app"
|
|
21
|
-
],
|
|
22
|
-
"win32": [
|
|
23
|
-
"C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe"
|
|
24
|
-
],
|
|
25
|
-
"linux": [
|
|
26
|
-
"/usr/share/code-insiders"
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
|
-
"inputMethod": "cdp-type-and-send",
|
|
30
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]"
|
|
31
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "vscodium",
|
|
3
|
-
"name": "VSCodium",
|
|
4
|
-
"category": "ide",
|
|
5
|
-
"displayName": "VSCodium",
|
|
6
|
-
"icon": "💚",
|
|
7
|
-
"cli": "codium",
|
|
8
|
-
"cdpPorts": [
|
|
9
|
-
9343,
|
|
10
|
-
9344
|
|
11
|
-
],
|
|
12
|
-
"processNames": {
|
|
13
|
-
"darwin": "VSCodium",
|
|
14
|
-
"win32": [
|
|
15
|
-
"VSCodium.exe"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"paths": {
|
|
19
|
-
"darwin": [
|
|
20
|
-
"/Applications/VSCodium.app"
|
|
21
|
-
],
|
|
22
|
-
"win32": [
|
|
23
|
-
"C:\\Program Files\\VSCodium\\VSCodium.exe"
|
|
24
|
-
],
|
|
25
|
-
"linux": [
|
|
26
|
-
"/usr/share/codium",
|
|
27
|
-
"/snap/codium/current"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"inputMethod": "cdp-type-and-send",
|
|
31
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]"
|
|
32
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "windsurf",
|
|
3
|
-
"name": "Windsurf",
|
|
4
|
-
"category": "ide",
|
|
5
|
-
"displayName": "Windsurf",
|
|
6
|
-
"icon": "🏄",
|
|
7
|
-
"cli": "windsurf",
|
|
8
|
-
"cdpPorts": [
|
|
9
|
-
9337,
|
|
10
|
-
9338
|
|
11
|
-
],
|
|
12
|
-
"processNames": {
|
|
13
|
-
"darwin": "Windsurf"
|
|
14
|
-
},
|
|
15
|
-
"paths": {
|
|
16
|
-
"darwin": [
|
|
17
|
-
"/Applications/Windsurf.app"
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"inputMethod": "cdp-type-and-send",
|
|
21
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]"
|
|
22
|
-
}
|