@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,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Trae — send_message
|
|
3
|
-
*
|
|
4
|
-
* Trae .chat-input-v2-input-box-editable (contenteditable / Lexical) use.
|
|
5
|
-
* Lexical inside state to correctly update Selection API + execCommand use.
|
|
6
|
-
*
|
|
7
|
-
* Parameter: ${ MESSAGE }
|
|
8
|
-
*/
|
|
9
|
-
(async () => {
|
|
10
|
-
try {
|
|
11
|
-
const msg = ${ MESSAGE };
|
|
12
|
-
|
|
13
|
-
// ─── 1. Find input field ───
|
|
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. focus + all Select + delete + insert ───
|
|
22
|
-
editor.focus();
|
|
23
|
-
await new Promise(r => setTimeout(r, 100));
|
|
24
|
-
|
|
25
|
-
// Selection API all Select
|
|
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
|
-
// Delete and insert (sync 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 event
|
|
39
|
-
editor.dispatchEvent(new Event('input', { bubbles: true }));
|
|
40
|
-
await new Promise(r => setTimeout(r, 500));
|
|
41
|
-
|
|
42
|
-
// ─── 3. send button click ───
|
|
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
|
-
// button If still disabled, try Enter key
|
|
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
|
-
// If still fails needsTypeAndSend fallback
|
|
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 Switch session tab.
|
|
5
|
-
* Parameter: ${ 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,74 +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
|
-
"targetFilter": {
|
|
13
|
-
"urlIncludes": "workbench.html",
|
|
14
|
-
"urlExcludes": [
|
|
15
|
-
"agent"
|
|
16
|
-
],
|
|
17
|
-
"titleExcludes": "extension-output|ADHDev CDP|Debug Console|Output\\s*$|Launchpad"
|
|
18
|
-
},
|
|
19
|
-
"processNames": {
|
|
20
|
-
"darwin": "Visual Studio Code",
|
|
21
|
-
"win32": [
|
|
22
|
-
"Code.exe"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"paths": {
|
|
26
|
-
"darwin": [
|
|
27
|
-
"/Applications/Visual Studio Code.app"
|
|
28
|
-
],
|
|
29
|
-
"win32": [
|
|
30
|
-
"C:\\Program Files\\Microsoft VS Code\\Code.exe",
|
|
31
|
-
"C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe"
|
|
32
|
-
],
|
|
33
|
-
"linux": [
|
|
34
|
-
"/usr/share/code",
|
|
35
|
-
"/snap/code/current"
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
"inputMethod": "cdp-type-and-send",
|
|
39
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
|
|
40
|
-
"versionCommand": {
|
|
41
|
-
"darwin": "\"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code\" --version",
|
|
42
|
-
"win32": "\"C:\\Program Files\\Microsoft VS Code\\bin\\code\" --version",
|
|
43
|
-
"linux": "code --version"
|
|
44
|
-
},
|
|
45
|
-
"providerVersion": "0.0.0",
|
|
46
|
-
"compatibility": [
|
|
47
|
-
{ "ideVersion": ">=1.0.0", "scriptDir": "scripts/1.0" }
|
|
48
|
-
],
|
|
49
|
-
"defaultScriptDir": "scripts/1.0",
|
|
50
|
-
"settings": {
|
|
51
|
-
"approvalAlert": {
|
|
52
|
-
"type": "boolean",
|
|
53
|
-
"default": true,
|
|
54
|
-
"public": true,
|
|
55
|
-
"label": "Approval Notifications",
|
|
56
|
-
"description": "Show notification when approval is needed"
|
|
57
|
-
},
|
|
58
|
-
"longGeneratingAlert": {
|
|
59
|
-
"type": "boolean",
|
|
60
|
-
"default": true,
|
|
61
|
-
"public": true,
|
|
62
|
-
"label": "Long Generation Alert",
|
|
63
|
-
"description": "Alert when generation takes too long"
|
|
64
|
-
},
|
|
65
|
-
"longGeneratingThresholdSec": {
|
|
66
|
-
"type": "number",
|
|
67
|
-
"default": 180,
|
|
68
|
-
"public": true,
|
|
69
|
-
"label": "Long Generation Threshold (sec)",
|
|
70
|
-
"min": 30,
|
|
71
|
-
"max": 600
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Visual Studio Code (Native GitHub Copilot Chat) — Scripts
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
// ─── IDE Core ───
|
|
7
|
-
openPanel: require('./open_panel.js'),
|
|
8
|
-
focusEditor: require('./focus_editor.js'),
|
|
9
|
-
|
|
10
|
-
// ─── Chat Interaction ───
|
|
11
|
-
sendMessage: require('./send_message.js'),
|
|
12
|
-
readChat: require('./read_chat.js'),
|
|
13
|
-
|
|
14
|
-
// ─── Session Management ───
|
|
15
|
-
newSession: require('./new_session.js'),
|
|
16
|
-
listSessions: require('./list_sessions.js'),
|
|
17
|
-
switchSession: require('./switch_session.js'),
|
|
18
|
-
|
|
19
|
-
// ─── Resolution ───
|
|
20
|
-
resolveAction: require('./resolve_action.js'),
|
|
21
|
-
|
|
22
|
-
// ─── Models ───
|
|
23
|
-
listModels: require('./list_models.js'),
|
|
24
|
-
setModel: require('./set_model.js'),
|
|
25
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = async function(args, context) { return { error: "Not implemented" }; };
|
|
@@ -1,68 +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
|
-
"targetFilter": {
|
|
13
|
-
"urlIncludes": "workbench.html",
|
|
14
|
-
"urlExcludes": [
|
|
15
|
-
"agent"
|
|
16
|
-
],
|
|
17
|
-
"titleExcludes": "extension-output|ADHDev CDP|Debug Console|Output\\s*$|Launchpad"
|
|
18
|
-
},
|
|
19
|
-
"processNames": {
|
|
20
|
-
"darwin": "Visual Studio Code - Insiders",
|
|
21
|
-
"win32": [
|
|
22
|
-
"Code - Insiders.exe"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"paths": {
|
|
26
|
-
"darwin": [
|
|
27
|
-
"/Applications/Visual Studio Code - Insiders.app"
|
|
28
|
-
],
|
|
29
|
-
"win32": [
|
|
30
|
-
"C:\\Program Files\\Microsoft VS Code Insiders\\Code - Insiders.exe"
|
|
31
|
-
],
|
|
32
|
-
"linux": [
|
|
33
|
-
"/usr/share/code-insiders"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
"inputMethod": "cdp-type-and-send",
|
|
37
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
|
|
38
|
-
"versionCommand": "code-insiders --version",
|
|
39
|
-
"providerVersion": "0.0.0",
|
|
40
|
-
"compatibility": [
|
|
41
|
-
{ "ideVersion": ">=1.0.0", "scriptDir": "scripts/1.0" }
|
|
42
|
-
],
|
|
43
|
-
"defaultScriptDir": "scripts/1.0",
|
|
44
|
-
"settings": {
|
|
45
|
-
"approvalAlert": {
|
|
46
|
-
"type": "boolean",
|
|
47
|
-
"default": true,
|
|
48
|
-
"public": true,
|
|
49
|
-
"label": "Approval Notifications",
|
|
50
|
-
"description": "Show notification when approval is needed"
|
|
51
|
-
},
|
|
52
|
-
"longGeneratingAlert": {
|
|
53
|
-
"type": "boolean",
|
|
54
|
-
"default": true,
|
|
55
|
-
"public": true,
|
|
56
|
-
"label": "Long Generation Alert",
|
|
57
|
-
"description": "Alert when generation takes too long"
|
|
58
|
-
},
|
|
59
|
-
"longGeneratingThresholdSec": {
|
|
60
|
-
"type": "number",
|
|
61
|
-
"default": 180,
|
|
62
|
-
"public": true,
|
|
63
|
-
"label": "Long Generation Threshold (sec)",
|
|
64
|
-
"min": 30,
|
|
65
|
-
"max": 600
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,69 +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
|
-
"targetFilter": {
|
|
13
|
-
"urlIncludes": "workbench.html",
|
|
14
|
-
"urlExcludes": [
|
|
15
|
-
"agent"
|
|
16
|
-
],
|
|
17
|
-
"titleExcludes": "extension-output|ADHDev CDP|Debug Console|Output\\s*$|Launchpad"
|
|
18
|
-
},
|
|
19
|
-
"processNames": {
|
|
20
|
-
"darwin": "VSCodium",
|
|
21
|
-
"win32": [
|
|
22
|
-
"VSCodium.exe"
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
"paths": {
|
|
26
|
-
"darwin": [
|
|
27
|
-
"/Applications/VSCodium.app"
|
|
28
|
-
],
|
|
29
|
-
"win32": [
|
|
30
|
-
"C:\\Program Files\\VSCodium\\VSCodium.exe"
|
|
31
|
-
],
|
|
32
|
-
"linux": [
|
|
33
|
-
"/usr/share/codium",
|
|
34
|
-
"/snap/codium/current"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
"inputMethod": "cdp-type-and-send",
|
|
38
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
|
|
39
|
-
"versionCommand": "codium --version",
|
|
40
|
-
"providerVersion": "0.0.0",
|
|
41
|
-
"compatibility": [
|
|
42
|
-
{ "ideVersion": ">=1.0.0", "scriptDir": "scripts/1.0" }
|
|
43
|
-
],
|
|
44
|
-
"defaultScriptDir": "scripts/1.0",
|
|
45
|
-
"settings": {
|
|
46
|
-
"approvalAlert": {
|
|
47
|
-
"type": "boolean",
|
|
48
|
-
"default": true,
|
|
49
|
-
"public": true,
|
|
50
|
-
"label": "Approval Notifications",
|
|
51
|
-
"description": "Show notification when approval is needed"
|
|
52
|
-
},
|
|
53
|
-
"longGeneratingAlert": {
|
|
54
|
-
"type": "boolean",
|
|
55
|
-
"default": true,
|
|
56
|
-
"public": true,
|
|
57
|
-
"label": "Long Generation Alert",
|
|
58
|
-
"description": "Alert when generation takes too long"
|
|
59
|
-
},
|
|
60
|
-
"longGeneratingThresholdSec": {
|
|
61
|
-
"type": "number",
|
|
62
|
-
"default": 180,
|
|
63
|
-
"public": true,
|
|
64
|
-
"label": "Long Generation Threshold (sec)",
|
|
65
|
-
"min": 30,
|
|
66
|
-
"max": 600
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,57 +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
|
-
"targetFilter": {
|
|
13
|
-
"urlIncludes": "workbench.html",
|
|
14
|
-
"urlExcludes": [
|
|
15
|
-
"agent"
|
|
16
|
-
],
|
|
17
|
-
"titleExcludes": "extension-output|ADHDev CDP|Debug Console|Output\\s*$|Launchpad"
|
|
18
|
-
},
|
|
19
|
-
"processNames": {
|
|
20
|
-
"darwin": "Windsurf"
|
|
21
|
-
},
|
|
22
|
-
"paths": {
|
|
23
|
-
"darwin": [
|
|
24
|
-
"/Applications/Windsurf.app"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
"versionCommand": "windsurf --version",
|
|
28
|
-
"providerVersion": "1.0.0",
|
|
29
|
-
"compatibility": [
|
|
30
|
-
{ "ideVersion": ">=1.0.0", "scriptDir": "scripts/1.0" }
|
|
31
|
-
],
|
|
32
|
-
"defaultScriptDir": "scripts/1.0",
|
|
33
|
-
"settings": {
|
|
34
|
-
"approvalAlert": {
|
|
35
|
-
"type": "boolean",
|
|
36
|
-
"default": true,
|
|
37
|
-
"public": true,
|
|
38
|
-
"label": "Approval Notifications",
|
|
39
|
-
"description": "Show notification when approval is needed"
|
|
40
|
-
},
|
|
41
|
-
"longGeneratingAlert": {
|
|
42
|
-
"type": "boolean",
|
|
43
|
-
"default": true,
|
|
44
|
-
"public": true,
|
|
45
|
-
"label": "Long Generation Alert",
|
|
46
|
-
"description": "Alert when generation takes too long"
|
|
47
|
-
},
|
|
48
|
-
"longGeneratingThresholdSec": {
|
|
49
|
-
"type": "number",
|
|
50
|
-
"default": 180,
|
|
51
|
-
"public": true,
|
|
52
|
-
"label": "Long Generation Threshold (sec)",
|
|
53
|
-
"min": 30,
|
|
54
|
-
"max": 600
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Windsurf v1 — focus_editor
|
|
3
|
-
*
|
|
4
|
-
* Cascade(chat) focus on input field.
|
|
5
|
-
* Windsurf VS Code fork, chat UI "Cascade"is called.
|
|
6
|
-
*
|
|
7
|
-
* DOM structure:
|
|
8
|
-
* #windsurf.cascadePanel → .chat-client-root
|
|
9
|
-
* input: [contenteditable="true"][role="textbox"]
|
|
10
|
-
* or textarea ()
|
|
11
|
-
*
|
|
12
|
-
* final Check: Windsurf (2026-03-06)
|
|
13
|
-
*/
|
|
14
|
-
(() => {
|
|
15
|
-
try {
|
|
16
|
-
const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
|
|
17
|
-
const root = cascade || document;
|
|
18
|
-
const editor =
|
|
19
|
-
root.querySelector('[data-lexical-editor="true"]') ||
|
|
20
|
-
root.querySelector('[contenteditable="true"][role="textbox"]') ||
|
|
21
|
-
root.querySelector('.chat-input textarea') ||
|
|
22
|
-
root.querySelector('.cascade-input [contenteditable="true"]') ||
|
|
23
|
-
root.querySelector('textarea:not(.xterm-helper-textarea)');
|
|
24
|
-
|
|
25
|
-
if (!editor) {
|
|
26
|
-
return JSON.stringify({ focused: false });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
editor.focus();
|
|
30
|
-
if (typeof editor.click === 'function') editor.click();
|
|
31
|
-
|
|
32
|
-
return JSON.stringify({ focused: document.activeElement === editor || editor.contains?.(document.activeElement) || true });
|
|
33
|
-
} catch (e) {
|
|
34
|
-
return JSON.stringify({ focused: false, error: e.message });
|
|
35
|
-
}
|
|
36
|
-
})()
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Windsurf v1 — list_chats
|
|
3
|
-
*
|
|
4
|
-
* Cascade get tab list.
|
|
5
|
-
* If panel is closed open first and wait until tab is rendered.
|
|
6
|
-
* cascade-tab-{uuid} element React Fiberfrom title extract.
|
|
7
|
-
*
|
|
8
|
-
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
9
|
-
*/
|
|
10
|
-
(async () => {
|
|
11
|
-
try {
|
|
12
|
-
const tabs = Array.from(document.querySelectorAll('[id^="cascade-tab-"]')).filter(el => el.offsetWidth > 0 && el.offsetHeight > 0);
|
|
13
|
-
const sessions = tabs.map((tab, index) => ({
|
|
14
|
-
id: tab.id.replace(/^cascade-tab-/, ''),
|
|
15
|
-
title: (tab.textContent || '').replace(/\s+/g, ' ').trim() || `Chat ${index + 1}`,
|
|
16
|
-
active: /bg-ide-tab-active-background-color/.test(tab.innerHTML || ''),
|
|
17
|
-
index,
|
|
18
|
-
}));
|
|
19
|
-
return JSON.stringify({ sessions });
|
|
20
|
-
} catch (e) {
|
|
21
|
-
return JSON.stringify({ sessions: [], error: e.message });
|
|
22
|
-
}
|
|
23
|
-
})()
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic fallback — list_models
|
|
3
|
-
*/
|
|
4
|
-
(async () => {
|
|
5
|
-
try {
|
|
6
|
-
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
7
|
-
const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
|
|
8
|
-
if (!cascade) {
|
|
9
|
-
return JSON.stringify({ models: [], current: '' });
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim();
|
|
13
|
-
const modelRegex = /(claude|gpt|gemini|sonnet|opus|swe|deepseek|qwen|grok|o1|o3|codex)/i;
|
|
14
|
-
const getCurrentButton = () => {
|
|
15
|
-
const buttons = Array.from(cascade.querySelectorAll('button')).filter(el => el.offsetWidth > 0 && el.offsetHeight > 0);
|
|
16
|
-
const composerButtons = buttons.filter(el => el.getBoundingClientRect().y > window.innerHeight - 90);
|
|
17
|
-
return composerButtons.find(el => {
|
|
18
|
-
const text = normalize(el.innerText || el.textContent);
|
|
19
|
-
return text && text.length <= 60 && modelRegex.test(text) && !/run|skip|accept|reject/i.test(text);
|
|
20
|
-
}) || null;
|
|
21
|
-
};
|
|
22
|
-
const getMenuButtons = () => Array.from(document.querySelectorAll('button')).filter(el => {
|
|
23
|
-
if (!(el.offsetWidth > 0 && el.offsetHeight > 0)) return false;
|
|
24
|
-
const rect = el.getBoundingClientRect();
|
|
25
|
-
const text = normalize(el.innerText || el.textContent);
|
|
26
|
-
return rect.width >= 180 && rect.height >= 20 && rect.x > window.innerWidth - 320 && modelRegex.test(text);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const currentButton = getCurrentButton();
|
|
30
|
-
const current = currentButton ? normalize(currentButton.innerText || currentButton.textContent) : '';
|
|
31
|
-
const wasOpen = getMenuButtons().length > 0;
|
|
32
|
-
|
|
33
|
-
if (!wasOpen && currentButton) {
|
|
34
|
-
currentButton.click();
|
|
35
|
-
await wait(250);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const models = getMenuButtons().map(el => normalize(el.innerText || el.textContent)).filter(Boolean);
|
|
39
|
-
const unique = [];
|
|
40
|
-
const seen = new Set();
|
|
41
|
-
for (const name of models) {
|
|
42
|
-
const key = name.toLowerCase();
|
|
43
|
-
if (seen.has(key)) continue;
|
|
44
|
-
seen.add(key);
|
|
45
|
-
unique.push({ name, id: key.replace(/[^a-z0-9]+/g, '-') });
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (!wasOpen) {
|
|
49
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return JSON.stringify({ models: unique, current });
|
|
53
|
-
} catch (e) {
|
|
54
|
-
return JSON.stringify({ models: [], current: '', error: e.message });
|
|
55
|
-
}
|
|
56
|
-
})()
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic fallback — list_models
|
|
3
|
-
*/
|
|
4
|
-
(async () => {
|
|
5
|
-
try {
|
|
6
|
-
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
7
|
-
const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
|
|
8
|
-
if (!cascade) {
|
|
9
|
-
return JSON.stringify({ modes: [], current: '' });
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim();
|
|
13
|
-
const getModeButton = () => {
|
|
14
|
-
const buttons = Array.from(cascade.querySelectorAll('button')).filter(el => el.offsetWidth > 0 && el.offsetHeight > 0);
|
|
15
|
-
return buttons.find(el => {
|
|
16
|
-
const rect = el.getBoundingClientRect();
|
|
17
|
-
return rect.y > window.innerHeight - 90 && /lucide-code|lucide-message|lucide-search|lucide-wand|lucide-pencil/i.test(el.innerHTML);
|
|
18
|
-
}) || null;
|
|
19
|
-
};
|
|
20
|
-
const inferCurrent = (button) => {
|
|
21
|
-
if (!button) return '';
|
|
22
|
-
if (/lucide-code/i.test(button.innerHTML)) return 'Code';
|
|
23
|
-
if (/lucide-message/i.test(button.innerHTML)) return 'Ask';
|
|
24
|
-
if (/lucide-search/i.test(button.innerHTML)) return 'Search';
|
|
25
|
-
if (/lucide-pencil|lucide-pen|lucide-wand/i.test(button.innerHTML)) return 'Write';
|
|
26
|
-
return '';
|
|
27
|
-
};
|
|
28
|
-
const getMenuButtons = () => Array.from(document.querySelectorAll('button')).filter(el => {
|
|
29
|
-
if (!(el.offsetWidth > 0 && el.offsetHeight > 0)) return false;
|
|
30
|
-
const rect = el.getBoundingClientRect();
|
|
31
|
-
const text = normalize(el.innerText || el.textContent);
|
|
32
|
-
return rect.x > window.innerWidth - 320 && rect.width >= 180 && /^(Code|Ask|Search|Write)\b/i.test(text);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const modeButton = getModeButton();
|
|
36
|
-
const current = inferCurrent(modeButton);
|
|
37
|
-
const wasOpen = getMenuButtons().length > 0;
|
|
38
|
-
|
|
39
|
-
if (!wasOpen && modeButton) {
|
|
40
|
-
modeButton.click();
|
|
41
|
-
await wait(200);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const modes = [];
|
|
45
|
-
const seen = new Set();
|
|
46
|
-
for (const button of getMenuButtons()) {
|
|
47
|
-
const name = normalize((button.innerText || button.textContent || '').split('\n')[0]);
|
|
48
|
-
if (!name) continue;
|
|
49
|
-
const key = name.toLowerCase();
|
|
50
|
-
if (seen.has(key)) continue;
|
|
51
|
-
seen.add(key);
|
|
52
|
-
modes.push({ name, id: key });
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!wasOpen) {
|
|
56
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return JSON.stringify({ modes, current });
|
|
60
|
-
} catch (e) {
|
|
61
|
-
return JSON.stringify({ modes: [], current: '', error: e.message });
|
|
62
|
-
}
|
|
63
|
-
})()
|