@adhdev/daemon-core 0.6.53 → 0.6.56
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/index.d.ts +84 -34
- package/dist/index.js +631 -305
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/providers/_builtin/_helpers/index.js +26 -26
- package/providers/_builtin/cli/aider-cli/provider.json +37 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_output.js +49 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/claude-cli/provider.json +9 -2
- package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +31 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +38 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +164 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +42 -0
- package/providers/_builtin/cli/codex-cli/provider.json +9 -2
- package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +15 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +68 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/scripts.js +11 -0
- package/providers/_builtin/cli/cursor-cli/provider.json +37 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/detect_status.js +19 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/gemini-cli/provider.json +9 -2
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/detect_status.js +26 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_approval.js +22 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_output.js +71 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/scripts.js +12 -0
- package/providers/_builtin/cli/github-copilot-cli/provider.json +37 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/detect_status.js +19 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_approval.js +9 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/goose-cli/provider.json +37 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/opencode-cli/provider.json +37 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/detect_status.js +15 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_approval.js +9 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/extension/cline/scripts/1.0/focus_editor.js +5 -5
- package/providers/_builtin/extension/cline/scripts/1.0/list_chats.js +11 -11
- package/providers/_builtin/extension/cline/scripts/1.0/list_models.js +6 -6
- package/providers/_builtin/extension/cline/scripts/1.0/list_modes.js +5 -5
- package/providers/_builtin/extension/cline/scripts/1.0/new_session.js +12 -12
- package/providers/_builtin/extension/cline/scripts/1.0/open_panel.js +7 -7
- package/providers/_builtin/extension/cline/scripts/1.0/read_chat.js +29 -29
- package/providers/_builtin/extension/cline/scripts/1.0/resolve_action.js +19 -19
- package/providers/_builtin/extension/cline/scripts/1.0/send_message.js +15 -15
- package/providers/_builtin/extension/cline/scripts/1.0/set_mode.js +4 -4
- package/providers/_builtin/extension/cline/scripts/1.0/set_model.js +4 -4
- package/providers/_builtin/extension/cline/scripts/1.0/switch_session.js +21 -21
- package/providers/_builtin/extension/codex/scripts/1.0/explore_controls_webview.js +2 -2
- package/providers/_builtin/extension/codex/scripts/1.0/list_models.js +1 -1
- package/providers/_builtin/extension/codex/scripts/1.0/list_modes.js +1 -1
- package/providers/_builtin/extension/codex/scripts/1.0/new_session.js +2 -2
- package/providers/_builtin/extension/codex/scripts/1.0/read_chat.js +6 -6
- package/providers/_builtin/extension/codex/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/extension/codex/scripts/1.0/set_model.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_chats.js +19 -19
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_models.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_modes.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/new_session.js +17 -17
- package/providers/_builtin/ide/antigravity/scripts/1.0/read_chat.js +41 -41
- package/providers/_builtin/ide/antigravity/scripts/1.0/resolve_action.js +6 -6
- package/providers/_builtin/ide/antigravity/scripts/1.0/send_message.js +13 -13
- package/providers/_builtin/ide/antigravity/scripts/1.0/set_model.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/switch_session.js +13 -13
- package/providers/_builtin/ide/cursor/scripts/1.0/dismiss_notification.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/1.0/focus_editor.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/1.0/list_models.js +12 -12
- package/providers/_builtin/ide/cursor/scripts/1.0/list_modes.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/list_notifications.js +2 -2
- package/providers/_builtin/ide/cursor/scripts/1.0/list_sessions.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/new_session.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/1.0/open_panel.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/1.0/read_chat.js +9 -9
- package/providers/_builtin/ide/cursor/scripts/1.0/resolve_action.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/1.0/send_message.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/set_mode.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/1.0/set_model.js +12 -12
- package/providers/_builtin/ide/cursor/scripts/1.0/switch_session.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/open_panel.js +7 -7
- package/providers/_builtin/ide/kiro/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/ide/kiro/scripts/1.0/send_message.js +4 -4
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_sessions.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_new_session.js +5 -5
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_read_chat.js +13 -13
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_resolve_action.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_send_message.js +8 -8
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_mode.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_model.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_switch_session.js +3 -3
- package/providers/_builtin/ide/pearai/.tmp/after_rich.json +157 -0
- package/providers/_builtin/ide/pearai/.tmp/after_rich_raw.json +161 -0
- package/providers/_builtin/ide/pearai/.tmp/after_switch.json +592 -0
- package/providers/_builtin/ide/pearai/.tmp/after_switch_raw.json +596 -0
- package/providers/_builtin/ide/pearai/.tmp/home_dump_raw.json +176 -0
- package/providers/_builtin/ide/pearai/.tmp/items_raw.json +778 -0
- package/providers/_builtin/ide/pearai/.tmp/webview_dump.json +157 -0
- package/providers/_builtin/ide/pearai/.tmp/webview_dump_raw.json +161 -0
- package/providers/_builtin/ide/pearai/provider.json +1 -3
- package/providers/_builtin/ide/pearai/scripts/1.0/focus_editor.js +12 -16
- package/providers/_builtin/ide/pearai/scripts/1.0/list_models.js +45 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/list_modes.js +44 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/list_sessions.js +82 -27
- package/providers/_builtin/ide/pearai/scripts/1.0/new_session.js +26 -43
- package/providers/_builtin/ide/pearai/scripts/1.0/open_panel.js +10 -33
- package/providers/_builtin/ide/pearai/scripts/1.0/read_chat.js +169 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/resolve_action.js +47 -41
- package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +36 -7
- package/providers/_builtin/ide/pearai/scripts/1.0/send_message.js +97 -22
- package/providers/_builtin/ide/pearai/scripts/1.0/set_mode.js +51 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/set_model.js +54 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/switch_session.js +81 -0
- package/providers/_builtin/ide/trae/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/trae/scripts/1.0/list_chats.js +2 -2
- package/providers/_builtin/ide/trae/scripts/1.0/new_session.js +4 -4
- package/providers/_builtin/ide/trae/scripts/1.0/open_panel.js +6 -6
- package/providers/_builtin/ide/trae/scripts/1.0/read_chat.js +13 -13
- package/providers/_builtin/ide/trae/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/ide/trae/scripts/1.0/send_message.js +11 -11
- package/providers/_builtin/ide/trae/scripts/1.0/switch_session.js +2 -2
- package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +4 -4
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +9 -9
- package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +8 -8
- package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +8 -8
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +12 -12
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +15 -15
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +10 -10
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +33 -33
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +16 -16
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +7 -7
- package/providers/_builtin/registry.json +76 -3
- package/src/cli-adapters/provider-cli-adapter.ts +312 -258
- package/src/cli-adapters/terminal-screen.ts +95 -0
- package/src/commands/chat-commands.ts +41 -15
- package/src/commands/cli-manager.ts +4 -2
- package/src/daemon/dev-server.ts +306 -62
- package/src/providers/acp-provider-instance.ts +1 -1
- package/src/providers/cli-provider-instance.ts +23 -9
- package/src/providers/provider-loader.ts +3 -2
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_models.js +0 -43
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_modes.js +0 -35
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_sessions.js +0 -62
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_new_session.js +0 -49
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_read_chat.js +0 -92
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_resolve_action.js +0 -59
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_send_message.js +0 -72
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_set_mode.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_set_model.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_switch_session.js +0 -34
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cline v1 — resolve_action
|
|
3
3
|
*
|
|
4
|
-
* Cline
|
|
5
|
-
*
|
|
6
|
-
* chatState.primaryButtonText / secondaryButtonText
|
|
4
|
+
* Cline Approve/Reject handle.
|
|
5
|
+
* Clineis uses vscode-button web component besides button tag.
|
|
6
|
+
* chatState.primaryButtonText / secondaryButtonText Exact matching.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Parameter: ${ ACTION } — "approve" or "reject"
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* 1. chatState.primaryButtonText == Approve → primary vscode-button
|
|
12
|
-
* 2. data-testid
|
|
13
|
-
* 3.
|
|
14
|
-
* 4.
|
|
10
|
+
* strategy:
|
|
11
|
+
* 1. chatState.primaryButtonText == Approve → click primary vscode-button
|
|
12
|
+
* 2. Search based on data-testid
|
|
13
|
+
* 3. text matching (button + vscode-button)
|
|
14
|
+
* 4. Pass approval directly via Fiber onSendMessage
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* final Check: 2026-03-07
|
|
17
17
|
*/
|
|
18
18
|
(() => {
|
|
19
19
|
try {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
const rejectPatterns = ['reject', 'deny', 'cancel', 'no', 'skip'];
|
|
27
27
|
const patterns = action === 'approve' ? approvePatterns : rejectPatterns;
|
|
28
28
|
|
|
29
|
-
// ───
|
|
29
|
+
// ─── Collect all clickable elements (button + vscode-button) ───
|
|
30
30
|
const allBtns = [
|
|
31
31
|
...Array.from(doc.querySelectorAll('button')),
|
|
32
32
|
...Array.from(doc.querySelectorAll('vscode-button')),
|
|
33
33
|
].filter(b => b.offsetWidth > 0 && b.offsetHeight > 0);
|
|
34
34
|
|
|
35
|
-
// ───
|
|
35
|
+
// ─── 1step: data-testid based ───
|
|
36
36
|
for (const btn of allBtns) {
|
|
37
37
|
const testId = (btn.getAttribute('data-testid') || '').toLowerCase();
|
|
38
38
|
if (action === 'approve' && (testId.includes('approve') || testId.includes('proceed') || testId.includes('accept') || testId.includes('run') || testId.includes('primary'))) {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// ───
|
|
46
|
+
// ─── 2step: text matching ───
|
|
47
47
|
for (const btn of allBtns) {
|
|
48
48
|
const text = (btn.textContent || '').trim().toLowerCase();
|
|
49
49
|
if (text.length === 0 || text.length > 40) continue;
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
// ───
|
|
55
|
+
// ─── 3step: aria-label ───
|
|
56
56
|
for (const btn of allBtns) {
|
|
57
57
|
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
58
58
|
if (patterns.some(p => label.includes(p))) {
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// ─── 4
|
|
63
|
+
// ─── Step 4: chatState based — primary/secondary button Direct matching ───
|
|
64
64
|
// chatState.primaryButtonText = "Approve", secondaryButtonText = "Reject"
|
|
65
|
-
//
|
|
65
|
+
// Largest vscode-button is primary button
|
|
66
66
|
const vscBtns = Array.from(doc.querySelectorAll('vscode-button'))
|
|
67
|
-
.filter(b => b.offsetWidth > 100); //
|
|
67
|
+
.filter(b => b.offsetWidth > 100); // Large buttons only
|
|
68
68
|
if (vscBtns.length > 0) {
|
|
69
69
|
if (action === 'approve') {
|
|
70
|
-
//
|
|
70
|
+
// Largest button is primary
|
|
71
71
|
vscBtns.sort((a, b) => b.offsetWidth - a.offsetWidth);
|
|
72
72
|
vscBtns[0].click(); return true;
|
|
73
73
|
}
|
|
74
|
-
// reject:
|
|
74
|
+
// reject: Smallest large button
|
|
75
75
|
if (action === 'reject' && vscBtns.length > 1) {
|
|
76
76
|
vscBtns.sort((a, b) => a.offsetWidth - b.offsetWidth);
|
|
77
77
|
vscBtns[0].click(); return true;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cline v1 — send_message
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1. outer webview → inner iframe
|
|
6
|
-
* 2. data-testid="chat-input" textarea
|
|
7
|
-
* 3. React
|
|
8
|
-
* 4. Fallback: data-testid="send-button"
|
|
4
|
+
* structure:
|
|
5
|
+
* 1. outer webview → access inner iframe contentDocument
|
|
6
|
+
* 2. Set value on data-testid="chat-input" textarea (React controlled)
|
|
7
|
+
* 3. React Fiberfrom Find onSend function and call directly (most reliable)
|
|
8
|
+
* 4. Fallback: data-testid="send-button" click or Enter key
|
|
9
9
|
*
|
|
10
|
-
* ⚠️ Cline
|
|
11
|
-
*
|
|
10
|
+
* ⚠️ Cline send-button is a DIV tag, and React normal click event
|
|
11
|
+
* Does not handle sending. Must call Fiber onSend() directly for correct behavior.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* final Check: 2026-03-07
|
|
14
14
|
*/
|
|
15
15
|
(async () => {
|
|
16
16
|
try {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
const doc = inner?.contentDocument || inner?.contentWindow?.document;
|
|
19
19
|
if (!doc) return 'error: no doc';
|
|
20
20
|
|
|
21
|
-
// ─── 1.
|
|
21
|
+
// ─── 1. Find input field ───
|
|
22
22
|
let target = doc.querySelector('[data-testid="chat-input"]');
|
|
23
23
|
if (!target) {
|
|
24
24
|
const textareas = doc.querySelectorAll('textarea');
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
if (!target) return 'error: no chat-input';
|
|
33
33
|
|
|
34
|
-
// ─── 2. React controlled input
|
|
34
|
+
// ─── 2. Set React controlled input value ───
|
|
35
35
|
const proto = inner.contentWindow?.HTMLTextAreaElement?.prototype
|
|
36
36
|
|| HTMLTextAreaElement.prototype;
|
|
37
37
|
const nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value')?.set;
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
target.value = ${ MESSAGE };
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// React
|
|
45
|
+
// Trigger React event
|
|
46
46
|
target.dispatchEvent(new Event('input', { bubbles: true }));
|
|
47
47
|
target.dispatchEvent(new Event('change', { bubbles: true }));
|
|
48
48
|
|
|
49
|
-
// React setState
|
|
49
|
+
// Wait for React setState to reflect
|
|
50
50
|
await new Promise(r => setTimeout(r, 300));
|
|
51
51
|
|
|
52
|
-
// ─── 3. Fiber onSend
|
|
52
|
+
// ─── 3. Fiber onSend Call directly (first) ───
|
|
53
53
|
const allEls = doc.querySelectorAll('*');
|
|
54
54
|
for (const el of allEls) {
|
|
55
55
|
const fk = Object.keys(el).find(k => k.startsWith('__reactFiber'));
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
// ─── 4. Fallback: send-button
|
|
68
|
+
// ─── 4. Fallback: send-button click ───
|
|
69
69
|
const sendBtn = doc.querySelector('[data-testid="send-button"]');
|
|
70
70
|
if (sendBtn) {
|
|
71
71
|
try {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
} catch (e) { }
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// ─── 5.
|
|
84
|
+
// ─── 5. Final Fallback: Enter key ───
|
|
85
85
|
target.focus();
|
|
86
86
|
target.dispatchEvent(new KeyboardEvent('keydown', {
|
|
87
87
|
key: 'Enter', code: 'Enter', keyCode: 13,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cline — set_mode
|
|
3
|
-
*
|
|
3
|
+
* mode selectorfrom Select specified mode
|
|
4
4
|
* ${MODE} → JSON.stringify(modeName)
|
|
5
5
|
* → { success: boolean }
|
|
6
6
|
*/
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
const trigger = doc.querySelector('[data-testid="mode-selector-trigger"], [data-testid="mode-switch"]');
|
|
15
15
|
if (!trigger) return JSON.stringify({ success: false, error: 'no mode trigger' });
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// Open dropdown
|
|
18
18
|
trigger.click();
|
|
19
19
|
await new Promise(r => setTimeout(r, 300));
|
|
20
20
|
|
|
21
|
-
//
|
|
21
|
+
// Search target mode from options
|
|
22
22
|
const options = doc.querySelectorAll('[data-testid*="mode-option"], [role="option"], [class*="dropdown"] [class*="item"], [class*="listbox"] [class*="option"]');
|
|
23
23
|
for (const opt of options) {
|
|
24
24
|
const text = (opt.textContent || '').trim();
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// close
|
|
33
33
|
doc.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
34
34
|
return JSON.stringify({ success: false, error: 'mode not found: ' + target });
|
|
35
35
|
} catch (e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cline — set_model
|
|
3
|
-
*
|
|
3
|
+
* from Select specified model
|
|
4
4
|
* ${MODEL} → JSON.stringify(modelName)
|
|
5
5
|
* → { success: boolean }
|
|
6
6
|
*/
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
const trigger = doc.querySelector('[data-testid="model-selector"], [data-testid*="model-dropdown"], [data-testid="dropdown-trigger"]');
|
|
15
15
|
if (!trigger) return JSON.stringify({ success: false, error: 'no model trigger' });
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// Open dropdown
|
|
18
18
|
trigger.click();
|
|
19
19
|
await new Promise(r => setTimeout(r, 300));
|
|
20
20
|
|
|
21
|
-
//
|
|
21
|
+
// Search target model from options
|
|
22
22
|
const options = doc.querySelectorAll('[data-testid*="dropdown-option"], [role="option"], [class*="dropdown"] [class*="item"], [class*="listbox"] [class*="option"]');
|
|
23
23
|
for (const opt of options) {
|
|
24
24
|
const text = (opt.textContent || '').trim();
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// close
|
|
33
33
|
doc.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
34
34
|
return JSON.stringify({ success: false, error: 'model not found: ' + target });
|
|
35
35
|
} catch (e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cline v1 — switch_session (Fiber hooks → showTaskWithId gRPC)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1.
|
|
6
|
-
* 2. Done
|
|
7
|
-
* 3. Virtuoso
|
|
8
|
-
* 4.
|
|
9
|
-
* 5. showTaskWithId(taskId)
|
|
4
|
+
* strategy:
|
|
5
|
+
* 1. Find taskHistory, showHistoryView in Fiber DFS
|
|
6
|
+
* 2. Done by clicking history close → showHistoryView() → reopen
|
|
7
|
+
* 3. Virtuoso Render wait (max 5 secs, retry every 500ms + scroll/resize )
|
|
8
|
+
* 4. Rendered item Fiber hooksfrom showTaskWithId callback extract
|
|
9
|
+
* 5. showTaskWithId(taskId) call → Switch Task via gRPC
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Parameter: ${ SESSION_ID } — task ID (number string) or title
|
|
12
|
+
* final Check: 2026-03-07
|
|
13
13
|
*/
|
|
14
14
|
(async () => {
|
|
15
15
|
try {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
return fiber;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
// ─── 1.
|
|
34
|
+
// ─── 1. Find taskHistory, showHistoryView in Fiber DFS ───
|
|
35
35
|
const root = doc.getElementById('root');
|
|
36
36
|
if (!root) return false;
|
|
37
37
|
const rootFk = findFiberKey(root);
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
|
|
74
74
|
if (!taskHistory || taskHistory.length === 0) return false;
|
|
75
75
|
|
|
76
|
-
//
|
|
76
|
+
// target task search (ID or title matching)
|
|
77
77
|
const norm = s => (s || '').trim().toLowerCase().replace(/\s+/g, ' ');
|
|
78
78
|
const idNorm = norm(sessionId);
|
|
79
79
|
let targetTask = taskHistory.find(t => String(t.id) === sessionId);
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
if (!targetTask) return false;
|
|
87
87
|
const targetId = String(targetTask.id);
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
// ─── 2. showHistoryView Fiber root DFS retry ───
|
|
90
90
|
if (!showHistoryView) {
|
|
91
|
-
// DOM
|
|
91
|
+
// DOM element-based search (when not found from Fiber root)
|
|
92
92
|
for (const el of doc.querySelectorAll('*')) {
|
|
93
93
|
let fiber = getFiber(el);
|
|
94
94
|
for (let d = 0; d < 20 && fiber; d++) {
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
}
|
|
105
105
|
if (!showHistoryView) return false;
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
// Done
|
|
107
|
+
// ─── 3. history toggle (close → open) ───
|
|
108
|
+
// Done via button close
|
|
109
109
|
const doneBtn = Array.from(doc.querySelectorAll('button'))
|
|
110
110
|
.find(b => b.textContent.trim() === 'Done' && b.offsetHeight > 0);
|
|
111
111
|
if (doneBtn) {
|
|
@@ -113,14 +113,14 @@
|
|
|
113
113
|
await new Promise(r => setTimeout(r, 400));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
//
|
|
116
|
+
// history open
|
|
117
117
|
showHistoryView();
|
|
118
118
|
|
|
119
|
-
// ─── 4. Virtuoso
|
|
119
|
+
// ─── 4. Virtuoso Render wait (max 5 secs, retry every 500ms) ───
|
|
120
120
|
let il = null;
|
|
121
121
|
for (let attempt = 0; attempt < 10; attempt++) {
|
|
122
122
|
await new Promise(r => setTimeout(r, 500));
|
|
123
|
-
// scroll + resize
|
|
123
|
+
// Trigger scroll + resize
|
|
124
124
|
const sd = doc.querySelector('.overflow-y-scroll, [data-testid=virtuoso-scroller]');
|
|
125
125
|
if (sd) {
|
|
126
126
|
sd.dispatchEvent(new Event('scroll', { bubbles: true }));
|
|
@@ -132,12 +132,12 @@
|
|
|
132
132
|
|
|
133
133
|
if (!il || il.children.length === 0) return false;
|
|
134
134
|
|
|
135
|
-
// ─── 5. Fiber
|
|
135
|
+
// ─── 5. Fiber hooksfrom showTaskWithId extract ───
|
|
136
136
|
let showTaskFn = null;
|
|
137
137
|
const findFiberKeySimple = (el) => Object.keys(el).find(k => k.startsWith('__reactFiber'));
|
|
138
138
|
|
|
139
139
|
for (const child of il.children) {
|
|
140
|
-
//
|
|
140
|
+
// Search in child or all elements inside child
|
|
141
141
|
const targets = [child, ...child.querySelectorAll('*')];
|
|
142
142
|
for (const el of targets) {
|
|
143
143
|
const fk = findFiberKeySimple(el);
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
if (showTaskFn) break;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
// Fallback: Fiber DFS
|
|
171
|
+
// Fallback: Fiber DFS all search
|
|
172
172
|
if (!showTaskFn) {
|
|
173
173
|
const visited2 = new Set();
|
|
174
174
|
const dfs2 = (f, depth) => {
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
|
|
194
194
|
if (!showTaskFn) return false;
|
|
195
195
|
|
|
196
|
-
// ─── 6. showTaskWithId(targetId)
|
|
196
|
+
// ─── 6. showTaskWithId(targetId) call ───
|
|
197
197
|
try {
|
|
198
198
|
await showTaskFn(targetId);
|
|
199
199
|
} catch {
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
const newChatBtn = allButtons.find(b => {
|
|
50
50
|
const label = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
51
51
|
const text = (b.textContent || '').trim().toLowerCase();
|
|
52
|
-
return label.includes('new') || label.includes('
|
|
52
|
+
return label.includes('new') || label.includes('new') || text.includes('new') || text.includes('new');
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
// 6. Look for back/navigation buttons
|
|
56
56
|
const backBtn = allButtons.find(b => {
|
|
57
57
|
const label = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
58
|
-
return label.includes('back') || label.includes('
|
|
58
|
+
return label.includes('back') || label.includes('back') || label.includes('go back');
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
return JSON.stringify({
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
const items = menu.querySelectorAll('[role="menuitem"], [role="menuitemradio"], div[class*="cursor-interaction"]');
|
|
36
36
|
for (const item of items) {
|
|
37
37
|
const text = (item.textContent || '').trim();
|
|
38
|
-
if (text && text.length > 0 && text.length < 60 && !text.includes('
|
|
38
|
+
if (text && text.length > 0 && text.length < 60 && !text.includes('Select model') && !text.includes('Model')) {
|
|
39
39
|
models.push({
|
|
40
40
|
name: text,
|
|
41
41
|
selected: text === currentModel,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Codex Extension — new_session
|
|
3
|
-
* Clicks the "
|
|
3
|
+
* Clicks the "New chat" / "New chat" button
|
|
4
4
|
*/
|
|
5
5
|
(() => {
|
|
6
6
|
try {
|
|
7
7
|
const buttons = Array.from(document.querySelectorAll('button')).filter(b => b.offsetWidth > 0);
|
|
8
8
|
const newChatBtn = buttons.find(b => {
|
|
9
9
|
const label = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
10
|
-
return label.includes('
|
|
10
|
+
return label.includes('New chat') || label.includes('new chat') || label.includes('new');
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
if (newChatBtn) {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
const headerEl = doc.querySelector('[style*="view-transition-name: header-title"]');
|
|
53
53
|
const headerText = (headerEl?.textContent || '').trim();
|
|
54
|
-
const isTaskList = headerText === '
|
|
54
|
+
const isTaskList = headerText === 'Tasks' || headerText === 'Tasks';
|
|
55
55
|
|
|
56
56
|
// If we accidentally evaluated inside the Tasks webview instead of Chat, tell Daemon to try the next matching webview
|
|
57
57
|
if (isTaskList) {
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
|
|
315
315
|
const buttonLabels = buttons.map(getBtnLabel).map(t => t.toLowerCase());
|
|
316
316
|
|
|
317
|
-
if (buttonLabels.some(l => l.includes('cancel') || l.includes('
|
|
317
|
+
if (buttonLabels.some(l => l.includes('cancel') || l.includes('cancel') || l.includes('stop') || l.includes('stop'))) {
|
|
318
318
|
status = 'generating';
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -365,8 +365,8 @@
|
|
|
365
365
|
if (approvalArea) {
|
|
366
366
|
// ─── Codex Approval Panel (request-input-panel based) ───
|
|
367
367
|
// The approval form has:
|
|
368
|
-
// - Option items as plain divs (e.g., "1.\
|
|
369
|
-
// - Action buttons (e.g., "
|
|
368
|
+
// - Option items as plain divs (e.g., "1.\nyes", "2.\nyes,...", "3.\nno,...")
|
|
369
|
+
// - Action buttons (e.g., "skip", "Submit⏎") as <button> elements
|
|
370
370
|
// We need to extract BOTH for the dashboard.
|
|
371
371
|
|
|
372
372
|
// Find parent container that has all options (level 3 from textarea, btns >= 4)
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
|
|
400
400
|
// Extract numbered option text items (the entire panel text, split by option numbering)
|
|
401
401
|
const panelText = (approvalArea.innerText || '').trim();
|
|
402
|
-
// Parse "1.\
|
|
402
|
+
// Parse "1.\nyes\n2.\nyes,...\n3.\nno,...\nskip\nSubmit⏎" format
|
|
403
403
|
const optionMatches = panelText.match(/\d+\.\n[^\n]+(?:\n[^\d][^\n]*)*/g) || [];
|
|
404
404
|
let options = optionMatches.map(o => o.replace(/\n/g, '').trim()).filter(o => o.length > 0);
|
|
405
405
|
|
|
@@ -492,7 +492,7 @@
|
|
|
492
492
|
}
|
|
493
493
|
|
|
494
494
|
// ─── 6. Task info ───
|
|
495
|
-
const taskBtn = doc.querySelector('[aria-label*="
|
|
495
|
+
const taskBtn = doc.querySelector('[aria-label*="Tasks"], [aria-label*="task" i]');
|
|
496
496
|
const taskInfo = taskBtn ? (taskBtn.textContent || '').trim() : '';
|
|
497
497
|
|
|
498
498
|
return JSON.stringify({
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
const actionLower = (action || '').toLowerCase();
|
|
19
19
|
const patterns = {
|
|
20
|
-
approve: /^(approve|accept|allow|confirm|run|proceed|yes
|
|
20
|
+
approve: /^(approve|accept|allow|confirm|run|proceed|yes|approval|허용|execute|Check)/i,
|
|
21
21
|
deny: /^(deny|reject|no|거부|아니오)/i,
|
|
22
|
-
cancel: /^(cancel|stop
|
|
22
|
+
cancel: /^(cancel|stop|cancel|stop)/i,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
// Determine what to search for: use buttonText if provided, otherwise match action pattern
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
const clickedText = getBtnLabel(targetBtn);
|
|
64
64
|
if (/^\d+\./.test(clickedText)) {
|
|
65
65
|
setTimeout(() => {
|
|
66
|
-
const submitBtn = buttons.find(b => /^(
|
|
66
|
+
const submitBtn = buttons.find(b => /^(Submit|submit)/i.test(getBtnLabel(b)));
|
|
67
67
|
if (submitBtn && submitBtn !== targetBtn) submitBtn.click();
|
|
68
68
|
}, 150);
|
|
69
69
|
}
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
const available = Array.from(items)
|
|
72
72
|
.map(el => (el.textContent || '').trim())
|
|
73
|
-
.filter(t => t.length > 0 && t.length < 60 && !t.includes('
|
|
73
|
+
.filter(t => t.length > 0 && t.length < 60 && !t.includes('Select model'));
|
|
74
74
|
|
|
75
75
|
resolve(JSON.stringify({
|
|
76
76
|
success: false,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor v1 — focus_editor
|
|
3
3
|
*
|
|
4
|
-
* CURSOR.md 4-5:
|
|
4
|
+
* CURSOR.md 4-5: Selector priority
|
|
5
5
|
* [contenteditable="true"][role="textbox"]
|
|
6
6
|
* → .chat-input textarea
|
|
7
7
|
* → .composer-input
|
|
8
8
|
* → textarea
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* final Check: 2026-03-06
|
|
11
11
|
*/
|
|
12
12
|
(() => {
|
|
13
13
|
const editor = document.querySelector('[contenteditable="true"][role="textbox"]')
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Antigravity v1 — list_chats (v3 —
|
|
2
|
+
* Antigravity v1 — list_chats (v3 — enhanced selector)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* history toggle click open conversation list panel,
|
|
5
|
+
* DOMfrom parse conversation list directly, close panel and return results.
|
|
6
6
|
*
|
|
7
|
-
* DOM
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* ├──
|
|
13
|
-
* ├──
|
|
14
|
-
* └──
|
|
7
|
+
* DOM structure (2026-03-03 Check):
|
|
8
|
+
* toggle: [data-past-conversations-toggle="true"]
|
|
9
|
+
* panel: input[placeholder="Select a conversation"] near
|
|
10
|
+
* section header: .opacity-50 text (Current, Recent, Other)
|
|
11
|
+
* row: .cursor-pointer.justify-between.rounded-md
|
|
12
|
+
* ├── Title: span > span
|
|
13
|
+
* ├── workspace: .opacity-50.truncate > span
|
|
14
|
+
* └── time: .opacity-50.flex-shrink-0
|
|
15
15
|
*/
|
|
16
16
|
(async () => {
|
|
17
17
|
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
|
|
18
18
|
|
|
19
19
|
try {
|
|
20
|
-
|
|
20
|
+
// 1. toggle click history panel open
|
|
21
21
|
const toggle = document.querySelector('[data-past-conversations-toggle="true"]');
|
|
22
22
|
if (!toggle) return [];
|
|
23
23
|
toggle.click();
|
|
24
24
|
await sleep(1000);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
// 2. Exact search input search (placeholder matching)
|
|
27
27
|
const allInputs = document.querySelectorAll('input[type="text"]');
|
|
28
28
|
let searchInput = null;
|
|
29
29
|
for (const inp of allInputs) {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
return [];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// 3. "Current"
|
|
41
|
+
// 3. "Current" Search conversation list scroll container based on text
|
|
42
42
|
let container = null;
|
|
43
43
|
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null);
|
|
44
44
|
while (walker.nextNode()) {
|
|
45
45
|
if (walker.currentNode.textContent.trim() === 'Current') {
|
|
46
|
-
// "Current"
|
|
46
|
+
// "Current" text ancestor — climb up to overflow-auto/scroll container
|
|
47
47
|
let el = walker.currentNode.parentElement;
|
|
48
48
|
for (let i = 0; i < 10 && el; i++) {
|
|
49
49
|
const cls = (el.className || '');
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
el = el.parentElement;
|
|
55
55
|
}
|
|
56
|
-
// overflow
|
|
56
|
+
// If overflow container not found, use ancestor with most rows
|
|
57
57
|
if (!container) {
|
|
58
58
|
el = walker.currentNode.parentElement;
|
|
59
59
|
let bestEl = null;
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
//
|
|
75
|
+
// fallback: "Current" textwhen absent (new conversation etc. after) searchInput based
|
|
76
76
|
if (!container && searchInput) {
|
|
77
77
|
let el = searchInput.parentElement;
|
|
78
78
|
for (let i = 0; i < 10 && el; i++) {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
return [];
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
// 4.
|
|
96
|
+
// 4. conversation row parsing
|
|
97
97
|
const rows = container.querySelectorAll('[class*="cursor-pointer"][class*="justify-between"][class*="rounded-md"]');
|
|
98
98
|
const chats = [];
|
|
99
99
|
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
// 5.
|
|
129
|
+
// 5. panel close
|
|
130
130
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', bubbles: true }));
|
|
131
131
|
|
|
132
132
|
return chats;
|