@adhdev/daemon-core 0.6.58 → 0.6.60
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 +1 -1
- package/dist/index.js +87 -89
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/detection/ide-detector.ts +1 -1
- package/src/providers/provider-loader.ts +3 -6
- package/providers/_builtin/.github/workflows/generate-registry.yml +0 -76
- package/providers/_builtin/COMPATIBILITY.md +0 -217
- package/providers/_builtin/CONTRIBUTING.md +0 -200
- package/providers/_builtin/README.md +0 -119
- package/providers/_builtin/_helpers/index.js +0 -188
- package/providers/_builtin/acp/agentpool/provider.json +0 -54
- package/providers/_builtin/acp/amp/provider.json +0 -52
- package/providers/_builtin/acp/auggie/provider.json +0 -57
- package/providers/_builtin/acp/autodev/provider.json +0 -54
- package/providers/_builtin/acp/autohand/provider.json +0 -52
- package/providers/_builtin/acp/blackbox-ai/provider.json +0 -54
- package/providers/_builtin/acp/claude-agent/provider.json +0 -57
- package/providers/_builtin/acp/cline-acp/provider.json +0 -54
- package/providers/_builtin/acp/codebuddy/provider.json +0 -54
- package/providers/_builtin/acp/codex-cli/provider.json +0 -57
- package/providers/_builtin/acp/corust-agent/provider.json +0 -52
- package/providers/_builtin/acp/crow-cli/provider.json +0 -54
- package/providers/_builtin/acp/cursor-acp/provider.json +0 -54
- package/providers/_builtin/acp/deepagents/provider.json +0 -52
- package/providers/_builtin/acp/dimcode/provider.json +0 -54
- package/providers/_builtin/acp/docker-cagent/provider.json +0 -57
- package/providers/_builtin/acp/factory-droid/provider.json +0 -60
- package/providers/_builtin/acp/fast-agent/provider.json +0 -52
- package/providers/_builtin/acp/gemini-cli/provider.json +0 -114
- package/providers/_builtin/acp/github-copilot/provider.json +0 -54
- package/providers/_builtin/acp/goose/provider.json +0 -57
- package/providers/_builtin/acp/junie/provider.json +0 -52
- package/providers/_builtin/acp/kilo/provider.json +0 -54
- package/providers/_builtin/acp/kimi-cli/provider.json +0 -57
- package/providers/_builtin/acp/minion-code/provider.json +0 -52
- package/providers/_builtin/acp/mistral-vibe/provider.json +0 -57
- package/providers/_builtin/acp/nova/provider.json +0 -54
- package/providers/_builtin/acp/openclaw/provider.json +0 -54
- package/providers/_builtin/acp/opencode/provider.json +0 -52
- package/providers/_builtin/acp/openhands/provider.json +0 -54
- package/providers/_builtin/acp/pi-acp/provider.json +0 -52
- package/providers/_builtin/acp/qoder/provider.json +0 -54
- package/providers/_builtin/acp/qwen-code/provider.json +0 -60
- package/providers/_builtin/acp/stakpak/provider.json +0 -54
- package/providers/_builtin/acp/vtcode/provider.json +0 -54
- package/providers/_builtin/cli/aider-cli/provider.json +0 -37
- package/providers/_builtin/cli/aider-cli/scripts/1.0/detect_status.js +0 -20
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_approval.js +0 -10
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_output.js +0 -97
- package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/cli/claude-cli/provider.json +0 -121
- package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +0 -83
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +0 -97
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +0 -417
- package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +0 -42
- package/providers/_builtin/cli/codex-cli/provider.json +0 -90
- package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +0 -54
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +0 -91
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +0 -522
- package/providers/_builtin/cli/codex-cli/scripts/1.0/scripts.js +0 -11
- package/providers/_builtin/cli/cursor-cli/provider.json +0 -37
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/detect_status.js +0 -19
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_approval.js +0 -10
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_output.js +0 -48
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/cli/gemini-cli/provider.json +0 -109
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/detect_status.js +0 -26
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_approval.js +0 -22
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_output.js +0 -71
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/scripts.js +0 -12
- package/providers/_builtin/cli/github-copilot-cli/provider.json +0 -37
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/detect_status.js +0 -19
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_approval.js +0 -9
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_output.js +0 -48
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/cli/goose-cli/provider.json +0 -37
- package/providers/_builtin/cli/goose-cli/scripts/1.0/detect_status.js +0 -20
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_approval.js +0 -10
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_output.js +0 -48
- package/providers/_builtin/cli/goose-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/cli/opencode-cli/provider.json +0 -37
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/detect_status.js +0 -15
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_approval.js +0 -9
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_output.js +0 -48
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/docs/CDP_SELECTOR_GUIDE.md +0 -370
- package/providers/_builtin/docs/PROVIDER_GUIDE.md +0 -916
- package/providers/_builtin/extension/cline/provider.json +0 -37
- package/providers/_builtin/extension/cline/scripts/1.0/focus_editor.js +0 -48
- package/providers/_builtin/extension/cline/scripts/1.0/list_chats.js +0 -100
- package/providers/_builtin/extension/cline/scripts/1.0/list_models.js +0 -43
- package/providers/_builtin/extension/cline/scripts/1.0/list_modes.js +0 -35
- package/providers/_builtin/extension/cline/scripts/1.0/new_session.js +0 -85
- package/providers/_builtin/extension/cline/scripts/1.0/open_panel.js +0 -25
- package/providers/_builtin/extension/cline/scripts/1.0/read_chat.js +0 -270
- package/providers/_builtin/extension/cline/scripts/1.0/resolve_action.js +0 -83
- package/providers/_builtin/extension/cline/scripts/1.0/scripts.js +0 -82
- package/providers/_builtin/extension/cline/scripts/1.0/send_message.js +0 -95
- package/providers/_builtin/extension/cline/scripts/1.0/set_mode.js +0 -36
- package/providers/_builtin/extension/cline/scripts/1.0/set_model.js +0 -36
- package/providers/_builtin/extension/cline/scripts/1.0/switch_session.js +0 -206
- package/providers/_builtin/extension/codex/provider.json +0 -38
- package/providers/_builtin/extension/codex/scripts/1.0/click_conversation_webview.js +0 -24
- package/providers/_builtin/extension/codex/scripts/1.0/explore_chat_webview.js +0 -110
- package/providers/_builtin/extension/codex/scripts/1.0/explore_controls_webview.js +0 -75
- package/providers/_builtin/extension/codex/scripts/1.0/explore_dom.js +0 -58
- package/providers/_builtin/extension/codex/scripts/1.0/explore_dropdown_webview.js +0 -64
- package/providers/_builtin/extension/codex/scripts/1.0/inspect_code_webview.js +0 -55
- package/providers/_builtin/extension/codex/scripts/1.0/list_models.js +0 -63
- package/providers/_builtin/extension/codex/scripts/1.0/list_modes.js +0 -140
- package/providers/_builtin/extension/codex/scripts/1.0/message_structure_webview.js +0 -79
- package/providers/_builtin/extension/codex/scripts/1.0/new_session.js +0 -26
- package/providers/_builtin/extension/codex/scripts/1.0/read_chat.js +0 -516
- package/providers/_builtin/extension/codex/scripts/1.0/resolve_action.js +0 -82
- package/providers/_builtin/extension/codex/scripts/1.0/send_message.js +0 -42
- package/providers/_builtin/extension/codex/scripts/1.0/set_mode.js +0 -165
- package/providers/_builtin/extension/codex/scripts/1.0/set_model.js +0 -86
- package/providers/_builtin/extension/roo-code/provider.json +0 -37
- package/providers/_builtin/extension/roo-code/scripts/1.0/scripts.js +0 -82
- package/providers/_builtin/ide/antigravity/provider.json +0 -88
- package/providers/_builtin/ide/antigravity/scripts/1.0/focus_editor.js +0 -20
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_chats.js +0 -137
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_models.js +0 -61
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_modes.js +0 -72
- package/providers/_builtin/ide/antigravity/scripts/1.0/new_session.js +0 -75
- package/providers/_builtin/ide/antigravity/scripts/1.0/read_chat.js +0 -352
- package/providers/_builtin/ide/antigravity/scripts/1.0/resolve_action.js +0 -63
- package/providers/_builtin/ide/antigravity/scripts/1.0/scripts.js +0 -67
- package/providers/_builtin/ide/antigravity/scripts/1.0/send_message.js +0 -56
- package/providers/_builtin/ide/antigravity/scripts/1.0/set_mode.js +0 -67
- package/providers/_builtin/ide/antigravity/scripts/1.0/set_model.js +0 -72
- package/providers/_builtin/ide/antigravity/scripts/1.0/switch_session.js +0 -114
- package/providers/_builtin/ide/cursor/provider.json +0 -70
- package/providers/_builtin/ide/cursor/scripts/1.0/dismiss_notification.js +0 -30
- package/providers/_builtin/ide/cursor/scripts/1.0/focus_editor.js +0 -13
- package/providers/_builtin/ide/cursor/scripts/1.0/list_models.js +0 -78
- package/providers/_builtin/ide/cursor/scripts/1.0/list_modes.js +0 -40
- package/providers/_builtin/ide/cursor/scripts/1.0/list_notifications.js +0 -23
- package/providers/_builtin/ide/cursor/scripts/1.0/list_sessions.js +0 -42
- package/providers/_builtin/ide/cursor/scripts/1.0/new_session.js +0 -20
- package/providers/_builtin/ide/cursor/scripts/1.0/open_panel.js +0 -23
- package/providers/_builtin/ide/cursor/scripts/1.0/read_chat.js +0 -318
- package/providers/_builtin/ide/cursor/scripts/1.0/resolve_action.js +0 -19
- package/providers/_builtin/ide/cursor/scripts/1.0/scripts.js +0 -78
- package/providers/_builtin/ide/cursor/scripts/1.0/send_message.js +0 -23
- package/providers/_builtin/ide/cursor/scripts/1.0/set_mode.js +0 -38
- package/providers/_builtin/ide/cursor/scripts/1.0/set_model.js +0 -81
- package/providers/_builtin/ide/cursor/scripts/1.0/switch_session.js +0 -28
- package/providers/_builtin/ide/kiro/provider.json +0 -68
- package/providers/_builtin/ide/kiro/scripts/1.0/focus_editor.js +0 -20
- package/providers/_builtin/ide/kiro/scripts/1.0/open_panel.js +0 -47
- package/providers/_builtin/ide/kiro/scripts/1.0/resolve_action.js +0 -54
- package/providers/_builtin/ide/kiro/scripts/1.0/send_message.js +0 -29
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_dump_html.js +0 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_models.js +0 -42
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_modes.js +0 -22
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_sessions.js +0 -21
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_new_session.js +0 -34
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_read_chat.js +0 -161
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_resolve_action.js +0 -62
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_send_message.js +0 -94
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_mode.js +0 -34
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_model.js +0 -47
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_switch_session.js +0 -26
- package/providers/_builtin/ide/pearai/.tmp/after_rich.json +0 -157
- package/providers/_builtin/ide/pearai/.tmp/after_rich_raw.json +0 -161
- package/providers/_builtin/ide/pearai/.tmp/after_switch.json +0 -592
- package/providers/_builtin/ide/pearai/.tmp/after_switch_raw.json +0 -596
- package/providers/_builtin/ide/pearai/.tmp/home_dump_raw.json +0 -176
- package/providers/_builtin/ide/pearai/.tmp/items_raw.json +0 -778
- package/providers/_builtin/ide/pearai/.tmp/webview_dump.json +0 -157
- package/providers/_builtin/ide/pearai/.tmp/webview_dump_raw.json +0 -161
- package/providers/_builtin/ide/pearai/provider.json +0 -71
- package/providers/_builtin/ide/pearai/scripts/1.0/focus_editor.js +0 -16
- package/providers/_builtin/ide/pearai/scripts/1.0/list_models.js +0 -45
- package/providers/_builtin/ide/pearai/scripts/1.0/list_modes.js +0 -44
- package/providers/_builtin/ide/pearai/scripts/1.0/list_sessions.js +0 -93
- package/providers/_builtin/ide/pearai/scripts/1.0/new_session.js +0 -38
- package/providers/_builtin/ide/pearai/scripts/1.0/open_panel.js +0 -23
- package/providers/_builtin/ide/pearai/scripts/1.0/read_chat.js +0 -169
- package/providers/_builtin/ide/pearai/scripts/1.0/resolve_action.js +0 -60
- package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +0 -111
- package/providers/_builtin/ide/pearai/scripts/1.0/send_message.js +0 -104
- package/providers/_builtin/ide/pearai/scripts/1.0/set_mode.js +0 -51
- package/providers/_builtin/ide/pearai/scripts/1.0/set_model.js +0 -54
- package/providers/_builtin/ide/pearai/scripts/1.0/switch_session.js +0 -81
- package/providers/_builtin/ide/trae/provider.json +0 -72
- package/providers/_builtin/ide/trae/scripts/1.0/focus_editor.js +0 -20
- package/providers/_builtin/ide/trae/scripts/1.0/list_chats.js +0 -24
- package/providers/_builtin/ide/trae/scripts/1.0/list_models.js +0 -39
- package/providers/_builtin/ide/trae/scripts/1.0/list_modes.js +0 -39
- package/providers/_builtin/ide/trae/scripts/1.0/new_session.js +0 -30
- package/providers/_builtin/ide/trae/scripts/1.0/open_panel.js +0 -44
- package/providers/_builtin/ide/trae/scripts/1.0/read_chat.js +0 -113
- package/providers/_builtin/ide/trae/scripts/1.0/resolve_action.js +0 -54
- package/providers/_builtin/ide/trae/scripts/1.0/scripts.js +0 -82
- package/providers/_builtin/ide/trae/scripts/1.0/send_message.js +0 -69
- package/providers/_builtin/ide/trae/scripts/1.0/set_mode.js +0 -15
- package/providers/_builtin/ide/trae/scripts/1.0/set_model.js +0 -15
- package/providers/_builtin/ide/trae/scripts/1.0/switch_session.js +0 -23
- package/providers/_builtin/ide/vscode/provider.json +0 -74
- package/providers/_builtin/ide/vscode/scripts/1.0/focus_editor.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/list_models.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/list_sessions.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/new_session.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/open_panel.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/read_chat.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/resolve_action.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/scripts.js +0 -25
- package/providers/_builtin/ide/vscode/scripts/1.0/send_message.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/set_model.js +0 -1
- package/providers/_builtin/ide/vscode/scripts/1.0/switch_session.js +0 -1
- package/providers/_builtin/ide/vscode-insiders/provider.json +0 -68
- package/providers/_builtin/ide/vscodium/provider.json +0 -69
- package/providers/_builtin/ide/windsurf/provider.json +0 -57
- package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +0 -36
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +0 -23
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_models.js +0 -56
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_modes.js +0 -63
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +0 -79
- package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +0 -58
- package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +0 -67
- package/providers/_builtin/ide/windsurf/scripts/1.0/read_chat.js +0 -253
- package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +0 -82
- package/providers/_builtin/ide/windsurf/scripts/1.0/scripts.js +0 -82
- package/providers/_builtin/ide/windsurf/scripts/1.0/send_message.js +0 -20
- package/providers/_builtin/ide/windsurf/scripts/1.0/set_mode.js +0 -43
- package/providers/_builtin/ide/windsurf/scripts/1.0/set_model.js +0 -49
- package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +0 -82
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +0 -30
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +0 -117
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_models.js +0 -39
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_modes.js +0 -39
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +0 -69
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +0 -58
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +0 -315
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +0 -68
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/scripts.js +0 -82
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +0 -87
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_mode.js +0 -15
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/set_model.js +0 -15
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +0 -58
- package/providers/_builtin/registry.json +0 -376
- package/providers/_builtin/validate.js +0 -156
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cline v1 — resolve_action
|
|
3
|
-
*
|
|
4
|
-
* Cline Approve/Reject handle.
|
|
5
|
-
* Clineis uses vscode-button web component besides button tag.
|
|
6
|
-
* chatState.primaryButtonText / secondaryButtonText Exact matching.
|
|
7
|
-
*
|
|
8
|
-
* Parameter: ${ ACTION } — "approve" or "reject"
|
|
9
|
-
*
|
|
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
|
-
*
|
|
16
|
-
* final Check: 2026-03-07
|
|
17
|
-
*/
|
|
18
|
-
(() => {
|
|
19
|
-
try {
|
|
20
|
-
const inner = document.querySelector('iframe');
|
|
21
|
-
const doc = inner?.contentDocument || inner?.contentWindow?.document;
|
|
22
|
-
if (!doc) return false;
|
|
23
|
-
|
|
24
|
-
const action = ${ ACTION };
|
|
25
|
-
const approvePatterns = ['proceed', 'approve', 'allow', 'accept', 'save', 'run', 'yes', 'confirm', 'resume'];
|
|
26
|
-
const rejectPatterns = ['reject', 'deny', 'cancel', 'no', 'skip'];
|
|
27
|
-
const patterns = action === 'approve' ? approvePatterns : rejectPatterns;
|
|
28
|
-
|
|
29
|
-
// ─── Collect all clickable elements (button + vscode-button) ───
|
|
30
|
-
const allBtns = [
|
|
31
|
-
...Array.from(doc.querySelectorAll('button')),
|
|
32
|
-
...Array.from(doc.querySelectorAll('vscode-button')),
|
|
33
|
-
].filter(b => b.offsetWidth > 0 && b.offsetHeight > 0);
|
|
34
|
-
|
|
35
|
-
// ─── 1step: data-testid based ───
|
|
36
|
-
for (const btn of allBtns) {
|
|
37
|
-
const testId = (btn.getAttribute('data-testid') || '').toLowerCase();
|
|
38
|
-
if (action === 'approve' && (testId.includes('approve') || testId.includes('proceed') || testId.includes('accept') || testId.includes('run') || testId.includes('primary'))) {
|
|
39
|
-
btn.click(); return true;
|
|
40
|
-
}
|
|
41
|
-
if (action === 'reject' && (testId.includes('reject') || testId.includes('deny') || testId.includes('cancel') || testId.includes('secondary'))) {
|
|
42
|
-
btn.click(); return true;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// ─── 2step: text matching ───
|
|
47
|
-
for (const btn of allBtns) {
|
|
48
|
-
const text = (btn.textContent || '').trim().toLowerCase();
|
|
49
|
-
if (text.length === 0 || text.length > 40) continue;
|
|
50
|
-
if (patterns.some(p => text.startsWith(p) || text === p || text.includes(p))) {
|
|
51
|
-
btn.click(); return true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ─── 3step: aria-label ───
|
|
56
|
-
for (const btn of allBtns) {
|
|
57
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
58
|
-
if (patterns.some(p => label.includes(p))) {
|
|
59
|
-
btn.click(); return true;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// ─── Step 4: chatState based — primary/secondary button Direct matching ───
|
|
64
|
-
// chatState.primaryButtonText = "Approve", secondaryButtonText = "Reject"
|
|
65
|
-
// Largest vscode-button is primary button
|
|
66
|
-
const vscBtns = Array.from(doc.querySelectorAll('vscode-button'))
|
|
67
|
-
.filter(b => b.offsetWidth > 100); // Large buttons only
|
|
68
|
-
if (vscBtns.length > 0) {
|
|
69
|
-
if (action === 'approve') {
|
|
70
|
-
// Largest button is primary
|
|
71
|
-
vscBtns.sort((a, b) => b.offsetWidth - a.offsetWidth);
|
|
72
|
-
vscBtns[0].click(); return true;
|
|
73
|
-
}
|
|
74
|
-
// reject: Smallest large button
|
|
75
|
-
if (action === 'reject' && vscBtns.length > 1) {
|
|
76
|
-
vscBtns.sort((a, b) => a.offsetWidth - b.offsetWidth);
|
|
77
|
-
vscBtns[0].click(); return true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return false;
|
|
82
|
-
} catch { return false; }
|
|
83
|
-
})()
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CDP Scripts — Router
|
|
3
|
-
*
|
|
4
|
-
* Version routing is handled by ProviderLoader:
|
|
5
|
-
* Pattern:
|
|
6
|
-
* - Scripts WITHOUT params: loaded as-is (self-invoking IIFE)
|
|
7
|
-
* - Scripts WITH params: loaded as function expression, invoked with params JSON
|
|
8
|
-
* e.g. `(${script})(${JSON.stringify(params)})`
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
const fs = require('fs');
|
|
14
|
-
const path = require('path');
|
|
15
|
-
|
|
16
|
-
function load(name) {
|
|
17
|
-
try { return fs.readFileSync(path.join(__dirname, name), 'utf-8'); }
|
|
18
|
-
catch { return null; }
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function withParams(name, params) {
|
|
22
|
-
let script = load(name);
|
|
23
|
-
if (!script) return null;
|
|
24
|
-
|
|
25
|
-
// For legacy scripts checking MESSAGE, interpolate them manually
|
|
26
|
-
if (script.includes('${ MESSAGE }')) {
|
|
27
|
-
const msg = params?.MESSAGE || params?.text || '';
|
|
28
|
-
return script.replace(/\$\{ MESSAGE \}/g, JSON.stringify(msg));
|
|
29
|
-
}
|
|
30
|
-
if (script.includes('${ BUTTON_TEXT }')) {
|
|
31
|
-
const btn = params?.BUTTON_TEXT || params?.buttonText || '';
|
|
32
|
-
return script.replace(/\$\{ BUTTON_TEXT \}/g, JSON.stringify(btn));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return `(${script})(${JSON.stringify(params)})`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ─── Core (no params — IIFE) ───
|
|
39
|
-
|
|
40
|
-
module.exports.readChat = () => load('read_chat.js') || load('webview_read_chat.js');
|
|
41
|
-
module.exports.sendMessage = (params) => {
|
|
42
|
-
let s = load('send_message.js');
|
|
43
|
-
if (!s) s = load('webview_send_message.js');
|
|
44
|
-
if (!s) return null;
|
|
45
|
-
// Legacy template substitution fallback
|
|
46
|
-
if (s.includes('${ MESSAGE }')) {
|
|
47
|
-
const msg = params?.MESSAGE || params?.text || params || '';
|
|
48
|
-
return s.replace(/\$\{ MESSAGE \}/g, JSON.stringify(msg));
|
|
49
|
-
}
|
|
50
|
-
return withParams('send_message.js', params) || withParams('webview_send_message.js', params);
|
|
51
|
-
};
|
|
52
|
-
module.exports.listSessions = () => load('list_sessions.js');
|
|
53
|
-
module.exports.newSession = () => load('new_session.js');
|
|
54
|
-
module.exports.focusEditor = () => load('focus_editor.js');
|
|
55
|
-
module.exports.openPanel = () => load('open_panel.js');
|
|
56
|
-
module.exports.listModels = () => load('list_models.js');
|
|
57
|
-
module.exports.listModes = () => load('list_modes.js');
|
|
58
|
-
|
|
59
|
-
// ─── With params (function expression) ───
|
|
60
|
-
|
|
61
|
-
module.exports.switchSession = (params) => {
|
|
62
|
-
const index = typeof params === 'number' ? params : params?.index ?? 0;
|
|
63
|
-
const title = typeof params === 'string' ? params : params?.title || null;
|
|
64
|
-
return withParams('switch_session.js', { index, title });
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
module.exports.resolveAction = (params) => {
|
|
68
|
-
const action = typeof params === 'string' ? params : params?.action || 'approve';
|
|
69
|
-
const buttonText = params?.button || params?.buttonText
|
|
70
|
-
|| (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
|
|
71
|
-
return withParams('resolve_action.js', { buttonText, BUTTON_TEXT: buttonText });
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
module.exports.setModel = (params) => {
|
|
75
|
-
const model = typeof params === 'string' ? params : params?.model;
|
|
76
|
-
return withParams('set_model.js', { model });
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
module.exports.setMode = (params) => {
|
|
80
|
-
const mode = typeof params === 'string' ? params : params?.mode;
|
|
81
|
-
return withParams('set_mode.js', { mode });
|
|
82
|
-
};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cline v1 — send_message
|
|
3
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
13
|
-
* final Check: 2026-03-07
|
|
14
|
-
*/
|
|
15
|
-
(async () => {
|
|
16
|
-
try {
|
|
17
|
-
const inner = document.querySelector('iframe');
|
|
18
|
-
const doc = inner?.contentDocument || inner?.contentWindow?.document;
|
|
19
|
-
if (!doc) return 'error: no doc';
|
|
20
|
-
|
|
21
|
-
// ─── 1. Find input field ───
|
|
22
|
-
let target = doc.querySelector('[data-testid="chat-input"]');
|
|
23
|
-
if (!target) {
|
|
24
|
-
const textareas = doc.querySelectorAll('textarea');
|
|
25
|
-
for (const ta of textareas) {
|
|
26
|
-
if (ta.offsetParent !== null && ta.offsetHeight > 20) {
|
|
27
|
-
target = ta;
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (!target) return 'error: no chat-input';
|
|
33
|
-
|
|
34
|
-
// ─── 2. Set React controlled input value ───
|
|
35
|
-
const proto = inner.contentWindow?.HTMLTextAreaElement?.prototype
|
|
36
|
-
|| HTMLTextAreaElement.prototype;
|
|
37
|
-
const nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value')?.set;
|
|
38
|
-
|
|
39
|
-
if (nativeSetter) {
|
|
40
|
-
nativeSetter.call(target, ${ MESSAGE });
|
|
41
|
-
} else {
|
|
42
|
-
target.value = ${ MESSAGE };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Trigger React event
|
|
46
|
-
target.dispatchEvent(new Event('input', { bubbles: true }));
|
|
47
|
-
target.dispatchEvent(new Event('change', { bubbles: true }));
|
|
48
|
-
|
|
49
|
-
// Wait for React setState to reflect
|
|
50
|
-
await new Promise(r => setTimeout(r, 300));
|
|
51
|
-
|
|
52
|
-
// ─── 3. Fiber onSend Call directly (first) ───
|
|
53
|
-
const allEls = doc.querySelectorAll('*');
|
|
54
|
-
for (const el of allEls) {
|
|
55
|
-
const fk = Object.keys(el).find(k => k.startsWith('__reactFiber'));
|
|
56
|
-
if (!fk) continue;
|
|
57
|
-
let fiber = el[fk];
|
|
58
|
-
for (let d = 0; d < 15 && fiber; d++) {
|
|
59
|
-
const props = fiber.memoizedProps || fiber.pendingProps;
|
|
60
|
-
if (props && typeof props.onSend === 'function') {
|
|
61
|
-
props.onSend();
|
|
62
|
-
return 'sent';
|
|
63
|
-
}
|
|
64
|
-
fiber = fiber.return;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ─── 4. Fallback: send-button click ───
|
|
69
|
-
const sendBtn = doc.querySelector('[data-testid="send-button"]');
|
|
70
|
-
if (sendBtn) {
|
|
71
|
-
try {
|
|
72
|
-
const rect = sendBtn.getBoundingClientRect();
|
|
73
|
-
const opts = {
|
|
74
|
-
bubbles: true, cancelable: true, view: inner.contentWindow,
|
|
75
|
-
clientX: rect.left + rect.width / 2, clientY: rect.top + rect.height / 2
|
|
76
|
-
};
|
|
77
|
-
sendBtn.dispatchEvent(new MouseEvent('mousedown', opts));
|
|
78
|
-
sendBtn.dispatchEvent(new MouseEvent('mouseup', opts));
|
|
79
|
-
sendBtn.dispatchEvent(new MouseEvent('click', opts));
|
|
80
|
-
return 'sent';
|
|
81
|
-
} catch (e) { }
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// ─── 5. Final Fallback: Enter key ───
|
|
85
|
-
target.focus();
|
|
86
|
-
target.dispatchEvent(new KeyboardEvent('keydown', {
|
|
87
|
-
key: 'Enter', code: 'Enter', keyCode: 13,
|
|
88
|
-
bubbles: true, cancelable: true,
|
|
89
|
-
}));
|
|
90
|
-
|
|
91
|
-
return 'sent';
|
|
92
|
-
} catch (e) {
|
|
93
|
-
return 'error: ' + e.message;
|
|
94
|
-
}
|
|
95
|
-
})()
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cline — set_mode
|
|
3
|
-
* mode selectorfrom Select specified mode
|
|
4
|
-
* ${MODE} → JSON.stringify(modeName)
|
|
5
|
-
* → { success: boolean }
|
|
6
|
-
*/
|
|
7
|
-
(async () => {
|
|
8
|
-
try {
|
|
9
|
-
const inner = document.querySelector('iframe');
|
|
10
|
-
const doc = inner?.contentDocument || inner?.contentWindow?.document;
|
|
11
|
-
if (!doc) return JSON.stringify({ success: false, error: 'no doc' });
|
|
12
|
-
|
|
13
|
-
const target = ${MODE};
|
|
14
|
-
const trigger = doc.querySelector('[data-testid="mode-selector-trigger"], [data-testid="mode-switch"]');
|
|
15
|
-
if (!trigger) return JSON.stringify({ success: false, error: 'no mode trigger' });
|
|
16
|
-
|
|
17
|
-
// Open dropdown
|
|
18
|
-
trigger.click();
|
|
19
|
-
await new Promise(r => setTimeout(r, 300));
|
|
20
|
-
|
|
21
|
-
// Search target mode from options
|
|
22
|
-
const options = doc.querySelectorAll('[data-testid*="mode-option"], [role="option"], [class*="dropdown"] [class*="item"], [class*="listbox"] [class*="option"]');
|
|
23
|
-
for (const opt of options) {
|
|
24
|
-
const text = (opt.textContent || '').trim();
|
|
25
|
-
if (text === target || text.toLowerCase().includes(target.toLowerCase())) {
|
|
26
|
-
opt.click();
|
|
27
|
-
await new Promise(r => setTimeout(r, 200));
|
|
28
|
-
return JSON.stringify({ success: true, mode: text });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// close
|
|
33
|
-
doc.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
34
|
-
return JSON.stringify({ success: false, error: 'mode not found: ' + target });
|
|
35
|
-
} catch (e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
36
|
-
})()
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cline — set_model
|
|
3
|
-
* from Select specified model
|
|
4
|
-
* ${MODEL} → JSON.stringify(modelName)
|
|
5
|
-
* → { success: boolean }
|
|
6
|
-
*/
|
|
7
|
-
(async () => {
|
|
8
|
-
try {
|
|
9
|
-
const inner = document.querySelector('iframe');
|
|
10
|
-
const doc = inner?.contentDocument || inner?.contentWindow?.document;
|
|
11
|
-
if (!doc) return JSON.stringify({ success: false, error: 'no doc' });
|
|
12
|
-
|
|
13
|
-
const target = ${MODEL};
|
|
14
|
-
const trigger = doc.querySelector('[data-testid="model-selector"], [data-testid*="model-dropdown"], [data-testid="dropdown-trigger"]');
|
|
15
|
-
if (!trigger) return JSON.stringify({ success: false, error: 'no model trigger' });
|
|
16
|
-
|
|
17
|
-
// Open dropdown
|
|
18
|
-
trigger.click();
|
|
19
|
-
await new Promise(r => setTimeout(r, 300));
|
|
20
|
-
|
|
21
|
-
// Search target model from options
|
|
22
|
-
const options = doc.querySelectorAll('[data-testid*="dropdown-option"], [role="option"], [class*="dropdown"] [class*="item"], [class*="listbox"] [class*="option"]');
|
|
23
|
-
for (const opt of options) {
|
|
24
|
-
const text = (opt.textContent || '').trim();
|
|
25
|
-
if (text === target || text.includes(target)) {
|
|
26
|
-
opt.click();
|
|
27
|
-
await new Promise(r => setTimeout(r, 200));
|
|
28
|
-
return JSON.stringify({ success: true, model: text });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// close
|
|
33
|
-
doc.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
34
|
-
return JSON.stringify({ success: false, error: 'model not found: ' + target });
|
|
35
|
-
} catch (e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
36
|
-
})()
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cline v1 — switch_session (Fiber hooks → showTaskWithId gRPC)
|
|
3
|
-
*
|
|
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
|
-
*
|
|
11
|
-
* Parameter: ${ SESSION_ID } — task ID (number string) or title
|
|
12
|
-
* final Check: 2026-03-07
|
|
13
|
-
*/
|
|
14
|
-
(async () => {
|
|
15
|
-
try {
|
|
16
|
-
const inner = document.querySelector('iframe');
|
|
17
|
-
const doc = inner?.contentDocument || inner?.contentWindow?.document;
|
|
18
|
-
if (!doc) return false;
|
|
19
|
-
|
|
20
|
-
const sessionId = ${ SESSION_ID };
|
|
21
|
-
if (!sessionId) return false;
|
|
22
|
-
|
|
23
|
-
const findFiberKey = (el) => Object.keys(el).find(k =>
|
|
24
|
-
k.startsWith('__reactFiber') || k.startsWith('__reactProps') || k.startsWith('__reactContainer'));
|
|
25
|
-
const getFiber = (el) => {
|
|
26
|
-
const fk = findFiberKey(el);
|
|
27
|
-
if (!fk) return null;
|
|
28
|
-
let fiber = el[fk];
|
|
29
|
-
if (fk.startsWith('__reactContainer') && fiber?._internalRoot?.current)
|
|
30
|
-
fiber = fiber._internalRoot.current;
|
|
31
|
-
return fiber;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// ─── 1. Find taskHistory, showHistoryView in Fiber DFS ───
|
|
35
|
-
const root = doc.getElementById('root');
|
|
36
|
-
if (!root) return false;
|
|
37
|
-
const rootFk = findFiberKey(root);
|
|
38
|
-
if (!rootFk) return false;
|
|
39
|
-
let rootFiber = root[rootFk];
|
|
40
|
-
if (rootFk.startsWith('__reactContainer') && rootFiber?._internalRoot?.current)
|
|
41
|
-
rootFiber = rootFiber._internalRoot.current;
|
|
42
|
-
|
|
43
|
-
let showHistoryView = null;
|
|
44
|
-
let taskHistory = null;
|
|
45
|
-
const visited = new Set();
|
|
46
|
-
const scanFiber = (f, depth) => {
|
|
47
|
-
if (!f || depth > 60 || visited.has(f)) return;
|
|
48
|
-
visited.add(f);
|
|
49
|
-
const props = f.memoizedProps || f.pendingProps;
|
|
50
|
-
if (props) {
|
|
51
|
-
if (typeof props.showHistoryView === 'function' && !showHistoryView)
|
|
52
|
-
showHistoryView = props.showHistoryView;
|
|
53
|
-
if (props.taskHistory && Array.isArray(props.taskHistory) && !taskHistory)
|
|
54
|
-
taskHistory = props.taskHistory;
|
|
55
|
-
}
|
|
56
|
-
if (!taskHistory && f.memoizedState) {
|
|
57
|
-
let st = f.memoizedState;
|
|
58
|
-
while (st) {
|
|
59
|
-
try {
|
|
60
|
-
const ms = st.memoizedState;
|
|
61
|
-
if (ms?.taskHistory && Array.isArray(ms.taskHistory)) {
|
|
62
|
-
taskHistory = ms.taskHistory;
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
} catch { }
|
|
66
|
-
st = st.next;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (f.child) scanFiber(f.child, depth + 1);
|
|
70
|
-
if (f.sibling) scanFiber(f.sibling, depth + 1);
|
|
71
|
-
};
|
|
72
|
-
scanFiber(rootFiber, 0);
|
|
73
|
-
|
|
74
|
-
if (!taskHistory || taskHistory.length === 0) return false;
|
|
75
|
-
|
|
76
|
-
// target task search (ID or title matching)
|
|
77
|
-
const norm = s => (s || '').trim().toLowerCase().replace(/\s+/g, ' ');
|
|
78
|
-
const idNorm = norm(sessionId);
|
|
79
|
-
let targetTask = taskHistory.find(t => String(t.id) === sessionId);
|
|
80
|
-
if (!targetTask) {
|
|
81
|
-
targetTask = taskHistory.find(t => {
|
|
82
|
-
const title = norm(t.task || '');
|
|
83
|
-
return title.includes(idNorm) || idNorm.includes(title);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (!targetTask) return false;
|
|
87
|
-
const targetId = String(targetTask.id);
|
|
88
|
-
|
|
89
|
-
// ─── 2. showHistoryView Fiber root DFS retry ───
|
|
90
|
-
if (!showHistoryView) {
|
|
91
|
-
// DOM element-based search (when not found from Fiber root)
|
|
92
|
-
for (const el of doc.querySelectorAll('*')) {
|
|
93
|
-
let fiber = getFiber(el);
|
|
94
|
-
for (let d = 0; d < 20 && fiber; d++) {
|
|
95
|
-
const p = fiber.memoizedProps;
|
|
96
|
-
if (p && typeof p.showHistoryView === 'function') {
|
|
97
|
-
showHistoryView = p.showHistoryView;
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
fiber = fiber.return;
|
|
101
|
-
}
|
|
102
|
-
if (showHistoryView) break;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
if (!showHistoryView) return false;
|
|
106
|
-
|
|
107
|
-
// ─── 3. history toggle (close → open) ───
|
|
108
|
-
// Done via button close
|
|
109
|
-
const doneBtn = Array.from(doc.querySelectorAll('button'))
|
|
110
|
-
.find(b => b.textContent.trim() === 'Done' && b.offsetHeight > 0);
|
|
111
|
-
if (doneBtn) {
|
|
112
|
-
doneBtn.click();
|
|
113
|
-
await new Promise(r => setTimeout(r, 400));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// history open
|
|
117
|
-
showHistoryView();
|
|
118
|
-
|
|
119
|
-
// ─── 4. Virtuoso Render wait (max 5 secs, retry every 500ms) ───
|
|
120
|
-
let il = null;
|
|
121
|
-
for (let attempt = 0; attempt < 10; attempt++) {
|
|
122
|
-
await new Promise(r => setTimeout(r, 500));
|
|
123
|
-
// Trigger scroll + resize
|
|
124
|
-
const sd = doc.querySelector('.overflow-y-scroll, [data-testid=virtuoso-scroller]');
|
|
125
|
-
if (sd) {
|
|
126
|
-
sd.dispatchEvent(new Event('scroll', { bubbles: true }));
|
|
127
|
-
doc.defaultView?.dispatchEvent(new Event('resize'));
|
|
128
|
-
}
|
|
129
|
-
il = doc.querySelector('[data-testid=virtuoso-item-list]');
|
|
130
|
-
if (il && il.children.length > 0) break;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (!il || il.children.length === 0) return false;
|
|
134
|
-
|
|
135
|
-
// ─── 5. Fiber hooksfrom showTaskWithId extract ───
|
|
136
|
-
let showTaskFn = null;
|
|
137
|
-
const findFiberKeySimple = (el) => Object.keys(el).find(k => k.startsWith('__reactFiber'));
|
|
138
|
-
|
|
139
|
-
for (const child of il.children) {
|
|
140
|
-
// Search in child or all elements inside child
|
|
141
|
-
const targets = [child, ...child.querySelectorAll('*')];
|
|
142
|
-
for (const el of targets) {
|
|
143
|
-
const fk = findFiberKeySimple(el);
|
|
144
|
-
if (!fk) continue;
|
|
145
|
-
let fiber = el[fk];
|
|
146
|
-
for (let d = 0; d < 30 && fiber; d++) {
|
|
147
|
-
if (fiber.memoizedState) {
|
|
148
|
-
let hook = fiber.memoizedState;
|
|
149
|
-
let hookIdx = 0;
|
|
150
|
-
while (hook && hookIdx < 30) {
|
|
151
|
-
const ms = hook.memoizedState;
|
|
152
|
-
if (Array.isArray(ms) && ms.length === 2 && typeof ms[0] === 'function') {
|
|
153
|
-
const fnSrc = ms[0].toString();
|
|
154
|
-
if (fnSrc.includes('showTaskWithId')) {
|
|
155
|
-
showTaskFn = ms[0];
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
hook = hook.next;
|
|
160
|
-
hookIdx++;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
if (showTaskFn) break;
|
|
164
|
-
fiber = fiber.return;
|
|
165
|
-
}
|
|
166
|
-
if (showTaskFn) break;
|
|
167
|
-
}
|
|
168
|
-
if (showTaskFn) break;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Fallback: Fiber DFS all search
|
|
172
|
-
if (!showTaskFn) {
|
|
173
|
-
const visited2 = new Set();
|
|
174
|
-
const dfs2 = (f, depth) => {
|
|
175
|
-
if (!f || depth > 60 || visited2.has(f) || showTaskFn) return;
|
|
176
|
-
visited2.add(f);
|
|
177
|
-
if (f.memoizedState) {
|
|
178
|
-
let h = f.memoizedState; let i = 0;
|
|
179
|
-
while (h && i < 30) {
|
|
180
|
-
const ms = h.memoizedState;
|
|
181
|
-
if (Array.isArray(ms) && ms.length === 2 && typeof ms[0] === 'function' &&
|
|
182
|
-
ms[0].toString().includes('showTaskWithId')) {
|
|
183
|
-
showTaskFn = ms[0]; return;
|
|
184
|
-
}
|
|
185
|
-
h = h.next; i++;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (f.child) dfs2(f.child, depth + 1);
|
|
189
|
-
if (f.sibling) dfs2(f.sibling, depth + 1);
|
|
190
|
-
};
|
|
191
|
-
dfs2(rootFiber, 0);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
if (!showTaskFn) return false;
|
|
195
|
-
|
|
196
|
-
// ─── 6. showTaskWithId(targetId) call ───
|
|
197
|
-
try {
|
|
198
|
-
await showTaskFn(targetId);
|
|
199
|
-
} catch {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
await new Promise(r => setTimeout(r, 1500));
|
|
204
|
-
return true;
|
|
205
|
-
} catch { return false; }
|
|
206
|
-
})()
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "codex",
|
|
3
|
-
"name": "Codex",
|
|
4
|
-
"category": "extension",
|
|
5
|
-
"extensionId": "openai.chatgpt",
|
|
6
|
-
"extensionIdPattern": "extensionId=openai\\.chat",
|
|
7
|
-
"extensionIdPattern_flags": "i",
|
|
8
|
-
"webviewMatchText": "openai.chat",
|
|
9
|
-
"vscodeCommands": {
|
|
10
|
-
"focusPanel": "openai-chatgpt.focus"
|
|
11
|
-
},
|
|
12
|
-
"settings": {
|
|
13
|
-
"approvalAlert": {
|
|
14
|
-
"type": "boolean",
|
|
15
|
-
"default": true,
|
|
16
|
-
"public": true,
|
|
17
|
-
"label": "Approval Notifications",
|
|
18
|
-
"description": "Show notification when approval is needed"
|
|
19
|
-
},
|
|
20
|
-
"longGeneratingAlert": {
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"default": true,
|
|
23
|
-
"public": true,
|
|
24
|
-
"label": "Long Generation Alert",
|
|
25
|
-
"description": "Alert when generation takes too long"
|
|
26
|
-
},
|
|
27
|
-
"longGeneratingThresholdSec": {
|
|
28
|
-
"type": "number",
|
|
29
|
-
"default": 180,
|
|
30
|
-
"public": true,
|
|
31
|
-
"label": "Long Generation Threshold (sec)",
|
|
32
|
-
"min": 30,
|
|
33
|
-
"max": 600
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"defaultScriptDir": "scripts/1.0",
|
|
37
|
-
"compatibility": []
|
|
38
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Click the first conversation item to navigate into a chat
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
const buttons = document.querySelectorAll('[role="button"]');
|
|
7
|
-
for (const btn of buttons) {
|
|
8
|
-
const text = (btn.textContent || '').trim();
|
|
9
|
-
if (text.includes('hello')) {
|
|
10
|
-
btn.click();
|
|
11
|
-
return JSON.stringify({ clicked: true, text: text.substring(0, 100) });
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
// fallback: click first conversation button
|
|
15
|
-
if (buttons.length > 0) {
|
|
16
|
-
const first = buttons[0];
|
|
17
|
-
first.click();
|
|
18
|
-
return JSON.stringify({ clicked: true, text: (first.textContent||'').trim().substring(0, 100), fallback: true });
|
|
19
|
-
}
|
|
20
|
-
return JSON.stringify({ clicked: false, error: 'no conversation items found' });
|
|
21
|
-
} catch (e) {
|
|
22
|
-
return JSON.stringify({ error: e.message });
|
|
23
|
-
}
|
|
24
|
-
})()
|