@adhdev/daemon-core 0.6.57 → 0.6.59
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 +18 -1
- package/dist/index.js +339 -167
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +223 -48
- package/src/commands/chat-commands.ts +7 -1
- package/src/config/chat-history.ts +53 -1
- package/src/daemon/dev-server.ts +7 -9
- package/src/detection/ide-detector.ts +1 -1
- package/src/providers/cli-provider-instance.ts +10 -23
- package/src/providers/provider-instance.ts +1 -0
- package/src/providers/provider-loader.ts +3 -6
- package/src/providers/version-archive.ts +4 -1
- 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 -49
- package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/cli/claude-cli/provider.json +0 -109
- package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +0 -31
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +0 -38
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +0 -164
- package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +0 -42
- package/providers/_builtin/cli/codex-cli/provider.json +0 -88
- package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +0 -20
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +0 -15
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +0 -68
- 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 -70
- 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,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Windsurf v1 — switch_session
|
|
3
|
-
*
|
|
4
|
-
* Cascade session(conversation) .
|
|
5
|
-
* 1. top tabs ([id^="cascade-tab-"])
|
|
6
|
-
* 2. history panel ([data-kb-navigate="true"])
|
|
7
|
-
*/
|
|
8
|
-
(async (params) => {
|
|
9
|
-
try {
|
|
10
|
-
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
11
|
-
const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
12
|
-
|
|
13
|
-
const clickSequence = (el) => {
|
|
14
|
-
if (!el) return;
|
|
15
|
-
const rect = el.getBoundingClientRect();
|
|
16
|
-
// 1. Synthetic Dispatch
|
|
17
|
-
const init = { bubbles: true, cancelable: true, clientX: rect.left + rect.width / 2, clientY: rect.top + rect.height / 2, pointerId: 1, pointerType: 'mouse' };
|
|
18
|
-
el.focus?.();
|
|
19
|
-
for (const type of ['pointerdown', 'mousedown', 'pointerup', 'mouseup', 'click']) {
|
|
20
|
-
el.dispatchEvent(new PointerEvent(type, init));
|
|
21
|
-
}
|
|
22
|
-
// 2. Native click()
|
|
23
|
-
try { el.click(); } catch(e) {}
|
|
24
|
-
|
|
25
|
-
return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 };
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const id = params?.id || '';
|
|
29
|
-
const title = normalize(params?.title || '');
|
|
30
|
-
const index = Number.isFinite(params?.index) ? params.index : null;
|
|
31
|
-
|
|
32
|
-
let target = null;
|
|
33
|
-
|
|
34
|
-
// 1. ID search (top tabs first)
|
|
35
|
-
if (id) {
|
|
36
|
-
target = document.getElementById(`cascade-tab-${id}`) || document.getElementById(id);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 2. top tabsfrom title search
|
|
40
|
-
if (!target && title) {
|
|
41
|
-
const tabs = Array.from(document.querySelectorAll('[id^="cascade-tab-"]'));
|
|
42
|
-
target = tabs.find(tab => normalize(tab.textContent).includes(title));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// 3. history panelfrom search
|
|
46
|
-
if (!target) {
|
|
47
|
-
const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
|
|
48
|
-
if (cascade) {
|
|
49
|
-
const historyButton = Array.from(cascade.querySelectorAll('button')).find(el => el.offsetWidth > 0 && /lucide-history/.test(el.innerHTML || ''));
|
|
50
|
-
if (historyButton) {
|
|
51
|
-
historyButton.click();
|
|
52
|
-
await wait(350);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const rows = Array.from(document.querySelectorAll('[data-kb-navigate="true"]')).filter(el => el.offsetWidth > 0);
|
|
56
|
-
if (title) {
|
|
57
|
-
target = rows.find(row => normalize(row.textContent).includes(title));
|
|
58
|
-
}
|
|
59
|
-
if (!target && index !== null) {
|
|
60
|
-
target = rows[index];
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (!target) {
|
|
66
|
-
// Close history panel
|
|
67
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
|
|
68
|
-
return JSON.stringify({ switched: false, error: 'Session not found among visible tabs or history rows' });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const coords = clickSequence(target.querySelector('.cursor-pointer') || target);
|
|
72
|
-
await wait(200);
|
|
73
|
-
|
|
74
|
-
// Close history panel ( )
|
|
75
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
|
|
76
|
-
|
|
77
|
-
return JSON.stringify({ switched: true, coords });
|
|
78
|
-
} catch (e) {
|
|
79
|
-
return JSON.stringify({ switched: false, error: e.message });
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
|
|
@@ -1,30 +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 editor =
|
|
17
|
-
document.querySelector('[contenteditable="true"][role="textbox"]') ||
|
|
18
|
-
document.querySelector('[data-lexical-editor="true"]') ||
|
|
19
|
-
document.querySelector('.chat-input textarea') ||
|
|
20
|
-
document.querySelector('.cascade-input [contenteditable="true"]') ||
|
|
21
|
-
document.querySelector('textarea:not(.xterm-helper-textarea)');
|
|
22
|
-
if (editor) {
|
|
23
|
-
editor.focus();
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
} catch (e) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
})()
|
|
@@ -1,117 +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
|
-
// ─── 1. If panel is closed open ───
|
|
13
|
-
let tabs = document.querySelectorAll('[id^="cascade-tab-"]');
|
|
14
|
-
if (tabs.length === 0) {
|
|
15
|
-
// Check if Cascade panel is visible Check
|
|
16
|
-
const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
|
|
17
|
-
document.querySelector('.chat-client-root');
|
|
18
|
-
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
19
|
-
const panelVisible = (cascade && cascade.offsetWidth > 0) ||
|
|
20
|
-
(sidebar && sidebar.offsetWidth > 0 && cascade);
|
|
21
|
-
|
|
22
|
-
if (!panelVisible) {
|
|
23
|
-
// Attempt to click toggle button
|
|
24
|
-
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
25
|
-
let toggled = false;
|
|
26
|
-
for (const btn of toggleBtns) {
|
|
27
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
28
|
-
if (label.includes('toggle cascade') || label.includes('toggle secondary') ||
|
|
29
|
-
label.includes('toggle auxiliary') || label.includes('cascade')) {
|
|
30
|
-
if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
|
|
31
|
-
btn.click();
|
|
32
|
-
toggled = true;
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// button Cmd+L
|
|
38
|
-
if (!toggled) {
|
|
39
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
40
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
41
|
-
metaKey: true, ctrlKey: false,
|
|
42
|
-
bubbles: true, cancelable: true,
|
|
43
|
-
}));
|
|
44
|
-
document.dispatchEvent(new KeyboardEvent('keyup', {
|
|
45
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
46
|
-
metaKey: true, ctrlKey: false,
|
|
47
|
-
bubbles: true, cancelable: true,
|
|
48
|
-
}));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Wait for panel render (max 3 seconds)
|
|
52
|
-
for (let i = 0; i < 30; i++) {
|
|
53
|
-
await new Promise(r => setTimeout(r, 100));
|
|
54
|
-
tabs = document.querySelectorAll('[id^="cascade-tab-"]');
|
|
55
|
-
if (tabs.length > 0) break;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// ─── 2. ───
|
|
61
|
-
tabs = document.querySelectorAll('[id^="cascade-tab-"]');
|
|
62
|
-
if (tabs.length === 0) return [];
|
|
63
|
-
|
|
64
|
-
const result = [];
|
|
65
|
-
const seen = new Set();
|
|
66
|
-
|
|
67
|
-
tabs.forEach(tab => {
|
|
68
|
-
const tabId = tab.id.replace('cascade-tab-', '');
|
|
69
|
-
if (seen.has(tabId)) return;
|
|
70
|
-
seen.add(tabId);
|
|
71
|
-
|
|
72
|
-
let title = '';
|
|
73
|
-
let cascadeId = tabId;
|
|
74
|
-
let status = 'completed';
|
|
75
|
-
|
|
76
|
-
// Extract title from React Fiber
|
|
77
|
-
const fk = Object.keys(tab).find(k => k.startsWith('__reactFiber'));
|
|
78
|
-
if (fk) {
|
|
79
|
-
let fiber = tab[fk];
|
|
80
|
-
for (let d = 0; d < 30 && fiber; d++) {
|
|
81
|
-
const p = fiber.memoizedProps;
|
|
82
|
-
if (p) {
|
|
83
|
-
if (p.title && typeof p.title === 'string') {
|
|
84
|
-
title = p.title;
|
|
85
|
-
}
|
|
86
|
-
if (p.cascadeId) {
|
|
87
|
-
cascadeId = p.cascadeId;
|
|
88
|
-
}
|
|
89
|
-
if (p.status && typeof p.status === 'string') {
|
|
90
|
-
status = p.status;
|
|
91
|
-
}
|
|
92
|
-
if (title) break;
|
|
93
|
-
}
|
|
94
|
-
fiber = fiber.return;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// DOM fallback
|
|
99
|
-
if (!title) {
|
|
100
|
-
title = tab.textContent?.trim().substring(0, 100) || ('Chat ' + (result.length + 1));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const isVisible = tab.offsetHeight > 0 && tab.offsetWidth > 0;
|
|
104
|
-
|
|
105
|
-
result.push({
|
|
106
|
-
id: tabId,
|
|
107
|
-
title: title.substring(0, 100),
|
|
108
|
-
status: status,
|
|
109
|
-
active: isVisible
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
return result;
|
|
114
|
-
} catch (e) {
|
|
115
|
-
return [];
|
|
116
|
-
}
|
|
117
|
-
})()
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic fallback — list_models
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
const models = [];
|
|
7
|
-
let current = '';
|
|
8
|
-
|
|
9
|
-
// Try generic Model string from select/button
|
|
10
|
-
const sel = document.querySelectorAll('select, [class*="model"], [id*="model"]');
|
|
11
|
-
for (const el of sel) {
|
|
12
|
-
const txt = (el.textContent || '').trim();
|
|
13
|
-
if (txt && /claude|gpt|gemini|sonnet|opus/i.test(txt)) {
|
|
14
|
-
if (txt.length < 50) {
|
|
15
|
-
models.push(txt);
|
|
16
|
-
if (!current) current = txt;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (models.length === 0) {
|
|
22
|
-
const btns = document.querySelectorAll('button');
|
|
23
|
-
for (const b of btns) {
|
|
24
|
-
const txt = (b.textContent || '').trim();
|
|
25
|
-
if (txt && /claude|gpt|gemini|sonnet/i.test(txt) && txt.length < 30) {
|
|
26
|
-
models.push(txt);
|
|
27
|
-
current = txt;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return JSON.stringify({
|
|
33
|
-
models: [...new Set(models)],
|
|
34
|
-
current: current || 'Default'
|
|
35
|
-
});
|
|
36
|
-
} catch (e) {
|
|
37
|
-
return JSON.stringify({ models: [], current: '', error: e.message });
|
|
38
|
-
}
|
|
39
|
-
})()
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generic fallback — list_models
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
const models = [];
|
|
7
|
-
let current = '';
|
|
8
|
-
|
|
9
|
-
// Try generic Model string from select/button
|
|
10
|
-
const sel = document.querySelectorAll('select, [class*="model"], [id*="model"]');
|
|
11
|
-
for (const el of sel) {
|
|
12
|
-
const txt = (el.textContent || '').trim();
|
|
13
|
-
if (txt && /claude|gpt|gemini|sonnet|opus/i.test(txt)) {
|
|
14
|
-
if (txt.length < 50) {
|
|
15
|
-
models.push(txt);
|
|
16
|
-
if (!current) current = txt;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (models.length === 0) {
|
|
22
|
-
const btns = document.querySelectorAll('button');
|
|
23
|
-
for (const b of btns) {
|
|
24
|
-
const txt = (b.textContent || '').trim();
|
|
25
|
-
if (txt && /claude|gpt|gemini|sonnet/i.test(txt) && txt.length < 30) {
|
|
26
|
-
models.push(txt);
|
|
27
|
-
current = txt;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return JSON.stringify({
|
|
33
|
-
models: [...new Set(models)],
|
|
34
|
-
current: current || 'Default'
|
|
35
|
-
});
|
|
36
|
-
} catch (e) {
|
|
37
|
-
return JSON.stringify({ models: [], current: '', error: e.message });
|
|
38
|
-
}
|
|
39
|
-
})()
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Windsurf v1 — new_session
|
|
3
|
-
*
|
|
4
|
-
* new Cascade session start.
|
|
5
|
-
*
|
|
6
|
-
* strategy:
|
|
7
|
-
* 1. Search for "New" button based on aria-label
|
|
8
|
-
* 2. text-based button search
|
|
9
|
-
* 3. Codicon icon(+) based search
|
|
10
|
-
* 4. Cmd+L shortcut fallback (Windsurffrom new Cascade open)
|
|
11
|
-
*
|
|
12
|
-
* Windsurffrom Cascadeis an AI chat panel,
|
|
13
|
-
* "New Chat" or "+" starts New session via button.
|
|
14
|
-
*
|
|
15
|
-
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
16
|
-
*/
|
|
17
|
-
(() => {
|
|
18
|
-
try {
|
|
19
|
-
// ─── 1. Based on aria-label ───
|
|
20
|
-
const allBtns = Array.from(document.querySelectorAll('button, [role="button"], .action-item'))
|
|
21
|
-
.filter(b => b.offsetWidth > 0);
|
|
22
|
-
|
|
23
|
-
for (const btn of allBtns) {
|
|
24
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
25
|
-
if (label.includes('new chat') || label.includes('new cascade') ||
|
|
26
|
-
label.includes('new conversation') || label.includes('start new') ||
|
|
27
|
-
label.includes('new session')) {
|
|
28
|
-
btn.click();
|
|
29
|
-
return 'clicked (aria)';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// ─── 2. text-based ───
|
|
34
|
-
for (const btn of allBtns) {
|
|
35
|
-
const text = (btn.textContent || '').trim();
|
|
36
|
-
if (text === '+' || text === 'New Chat' || text === 'New Cascade' ||
|
|
37
|
-
text === 'Start New Chat' || text === 'New Session') {
|
|
38
|
-
btn.click();
|
|
39
|
-
return 'clicked (text)';
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// ─── 3. Codicon icon(+) based ───
|
|
44
|
-
for (const btn of allBtns) {
|
|
45
|
-
const hasPlus = btn.querySelector('.codicon-plus, .codicon-add, [class*="plus"]');
|
|
46
|
-
if (hasPlus) {
|
|
47
|
-
const label = (btn.getAttribute('aria-label') || btn.getAttribute('title') || '').toLowerCase();
|
|
48
|
-
// Cascade-related context or empty label New session button
|
|
49
|
-
if (label.includes('chat') || label.includes('cascade') ||
|
|
50
|
-
label.includes('new') || label === '') {
|
|
51
|
-
btn.click();
|
|
52
|
-
return 'clicked (icon)';
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ─── 4. Cmd+L (macOS: metaKey, Windows/Linux: ctrlKey) ───
|
|
58
|
-
// Windsurffrom Cmd+Lis Cascade Toggle panel/New session create
|
|
59
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
60
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
61
|
-
metaKey: true, ctrlKey: false,
|
|
62
|
-
bubbles: true, cancelable: true,
|
|
63
|
-
}));
|
|
64
|
-
|
|
65
|
-
return 'sent Cmd+L';
|
|
66
|
-
} catch (e) {
|
|
67
|
-
return 'error: ' + e.message;
|
|
68
|
-
}
|
|
69
|
-
})()
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Windsurf v1 — open_panel
|
|
3
|
-
*
|
|
4
|
-
* Cascade(AI chat) If panel is closed when present open.
|
|
5
|
-
*
|
|
6
|
-
* WindsurfCascade panel of is Secondary Side Bar (#workbench.parts.auxiliarybar)located at.
|
|
7
|
-
* closed offsetWidth === 0.
|
|
8
|
-
* Cmd+L via shortcut can be opened (WINDSURF.md §2.5).
|
|
9
|
-
*
|
|
10
|
-
* Return: 'visible' | 'opened' | 'error: ...'
|
|
11
|
-
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
12
|
-
*/
|
|
13
|
-
(() => {
|
|
14
|
-
try {
|
|
15
|
-
// ─── 1. Check if Cascade panel is already open ───
|
|
16
|
-
const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
|
|
17
|
-
document.querySelector('.chat-client-root');
|
|
18
|
-
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
19
|
-
|
|
20
|
-
// panelexists and visible means already open
|
|
21
|
-
if (cascade && cascade.offsetWidth > 0 && cascade.offsetHeight > 0) {
|
|
22
|
-
return 'visible';
|
|
23
|
-
}
|
|
24
|
-
if (sidebar && sidebar.offsetWidth > 0 && sidebar.offsetHeight > 0 && cascade) {
|
|
25
|
-
return 'visible';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// ─── 2. Attempt to click toggle button ───
|
|
29
|
-
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
30
|
-
for (const btn of toggleBtns) {
|
|
31
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
32
|
-
if (label.includes('toggle cascade') || label.includes('toggle secondary') ||
|
|
33
|
-
label.includes('toggle auxiliary') || label.includes('cascade')) {
|
|
34
|
-
if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
|
|
35
|
-
btn.click();
|
|
36
|
-
return 'opened (toggle)';
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// ─── 3. Cmd+L shortcut fallback (Windsurf official shortcut) ───
|
|
42
|
-
// keyCode: 76, modifiers: 4 (Meta/Cmd)
|
|
43
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
44
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
45
|
-
metaKey: true, ctrlKey: false,
|
|
46
|
-
bubbles: true, cancelable: true,
|
|
47
|
-
}));
|
|
48
|
-
document.dispatchEvent(new KeyboardEvent('keyup', {
|
|
49
|
-
key: 'l', code: 'KeyL', keyCode: 76,
|
|
50
|
-
metaKey: true, ctrlKey: false,
|
|
51
|
-
bubbles: true, cancelable: true,
|
|
52
|
-
}));
|
|
53
|
-
|
|
54
|
-
return 'opened (Cmd+L)';
|
|
55
|
-
} catch (e) {
|
|
56
|
-
return 'error: ' + e.message;
|
|
57
|
-
}
|
|
58
|
-
})()
|