@adhdev/daemon-core 0.6.52 → 0.6.55
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 +77 -35
- package/dist/index.js +717 -275
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/providers/_builtin/_helpers/index.js +26 -26
- package/providers/_builtin/cli/aider-cli/provider.json +37 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_output.js +49 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/claude-cli/provider.json +9 -2
- package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +31 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +38 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +164 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +42 -0
- package/providers/_builtin/cli/codex-cli/provider.json +9 -2
- package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +15 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +68 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/scripts.js +11 -0
- package/providers/_builtin/cli/cursor-cli/provider.json +37 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/detect_status.js +19 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/gemini-cli/provider.json +9 -2
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/detect_status.js +26 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_approval.js +22 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_output.js +71 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/scripts.js +12 -0
- package/providers/_builtin/cli/github-copilot-cli/provider.json +37 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/detect_status.js +19 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_approval.js +9 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/goose-cli/provider.json +37 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/opencode-cli/provider.json +37 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/detect_status.js +15 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_approval.js +9 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/extension/cline/scripts/1.0/focus_editor.js +5 -5
- package/providers/_builtin/extension/cline/scripts/1.0/list_chats.js +11 -11
- package/providers/_builtin/extension/cline/scripts/1.0/list_models.js +6 -6
- package/providers/_builtin/extension/cline/scripts/1.0/list_modes.js +5 -5
- package/providers/_builtin/extension/cline/scripts/1.0/new_session.js +12 -12
- package/providers/_builtin/extension/cline/scripts/1.0/open_panel.js +7 -7
- package/providers/_builtin/extension/cline/scripts/1.0/read_chat.js +29 -29
- package/providers/_builtin/extension/cline/scripts/1.0/resolve_action.js +19 -19
- package/providers/_builtin/extension/cline/scripts/1.0/send_message.js +15 -15
- package/providers/_builtin/extension/cline/scripts/1.0/set_mode.js +4 -4
- package/providers/_builtin/extension/cline/scripts/1.0/set_model.js +4 -4
- package/providers/_builtin/extension/cline/scripts/1.0/switch_session.js +21 -21
- package/providers/_builtin/extension/codex/scripts/1.0/explore_controls_webview.js +2 -2
- package/providers/_builtin/extension/codex/scripts/1.0/list_models.js +1 -1
- package/providers/_builtin/extension/codex/scripts/1.0/list_modes.js +1 -1
- package/providers/_builtin/extension/codex/scripts/1.0/new_session.js +2 -2
- package/providers/_builtin/extension/codex/scripts/1.0/read_chat.js +6 -6
- package/providers/_builtin/extension/codex/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/extension/codex/scripts/1.0/set_model.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_chats.js +19 -19
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_models.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_modes.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/new_session.js +17 -17
- package/providers/_builtin/ide/antigravity/scripts/1.0/read_chat.js +41 -41
- package/providers/_builtin/ide/antigravity/scripts/1.0/resolve_action.js +6 -6
- package/providers/_builtin/ide/antigravity/scripts/1.0/send_message.js +13 -13
- package/providers/_builtin/ide/antigravity/scripts/1.0/set_model.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/switch_session.js +13 -13
- package/providers/_builtin/ide/cursor/scripts/1.0/dismiss_notification.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/1.0/focus_editor.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/1.0/list_models.js +12 -12
- package/providers/_builtin/ide/cursor/scripts/1.0/list_modes.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/list_notifications.js +2 -2
- package/providers/_builtin/ide/cursor/scripts/1.0/list_sessions.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/new_session.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/1.0/open_panel.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/1.0/read_chat.js +9 -9
- package/providers/_builtin/ide/cursor/scripts/1.0/resolve_action.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/1.0/send_message.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/set_mode.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/1.0/set_model.js +12 -12
- package/providers/_builtin/ide/cursor/scripts/1.0/switch_session.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/open_panel.js +7 -7
- package/providers/_builtin/ide/kiro/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/ide/kiro/scripts/1.0/send_message.js +4 -4
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_sessions.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_new_session.js +5 -5
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_read_chat.js +13 -13
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_resolve_action.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_send_message.js +8 -8
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_mode.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_model.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_switch_session.js +3 -3
- package/providers/_builtin/ide/pearai/.tmp/after_rich.json +157 -0
- package/providers/_builtin/ide/pearai/.tmp/after_rich_raw.json +161 -0
- package/providers/_builtin/ide/pearai/.tmp/after_switch.json +592 -0
- package/providers/_builtin/ide/pearai/.tmp/after_switch_raw.json +596 -0
- package/providers/_builtin/ide/pearai/.tmp/home_dump_raw.json +176 -0
- package/providers/_builtin/ide/pearai/.tmp/items_raw.json +778 -0
- package/providers/_builtin/ide/pearai/.tmp/webview_dump.json +157 -0
- package/providers/_builtin/ide/pearai/.tmp/webview_dump_raw.json +161 -0
- package/providers/_builtin/ide/pearai/provider.json +1 -3
- package/providers/_builtin/ide/pearai/scripts/1.0/focus_editor.js +12 -16
- package/providers/_builtin/ide/pearai/scripts/1.0/list_models.js +45 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/list_modes.js +44 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/list_sessions.js +82 -27
- package/providers/_builtin/ide/pearai/scripts/1.0/new_session.js +26 -43
- package/providers/_builtin/ide/pearai/scripts/1.0/open_panel.js +10 -33
- package/providers/_builtin/ide/pearai/scripts/1.0/read_chat.js +169 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/resolve_action.js +47 -41
- package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +36 -7
- package/providers/_builtin/ide/pearai/scripts/1.0/send_message.js +97 -22
- package/providers/_builtin/ide/pearai/scripts/1.0/set_mode.js +51 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/set_model.js +54 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/switch_session.js +81 -0
- package/providers/_builtin/ide/trae/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/trae/scripts/1.0/list_chats.js +2 -2
- package/providers/_builtin/ide/trae/scripts/1.0/new_session.js +4 -4
- package/providers/_builtin/ide/trae/scripts/1.0/open_panel.js +6 -6
- package/providers/_builtin/ide/trae/scripts/1.0/read_chat.js +13 -13
- package/providers/_builtin/ide/trae/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/ide/trae/scripts/1.0/send_message.js +11 -11
- package/providers/_builtin/ide/trae/scripts/1.0/switch_session.js +2 -2
- package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +4 -4
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +9 -9
- package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +8 -8
- package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +8 -8
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +12 -12
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +15 -15
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +10 -10
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +33 -33
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +16 -16
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +7 -7
- package/providers/_builtin/registry.json +76 -3
- package/src/cli-adapters/provider-cli-adapter.ts +267 -251
- package/src/cli-adapters/terminal-screen.ts +268 -0
- package/src/commands/chat-commands.ts +41 -15
- package/src/commands/cli-manager.ts +4 -2
- package/src/daemon/dev-server.ts +245 -35
- package/src/providers/acp-provider-instance.ts +1 -1
- package/src/providers/cli-provider-instance.ts +21 -8
- package/src/providers/provider-loader.ts +6 -6
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_models.js +0 -43
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_modes.js +0 -35
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_sessions.js +0 -62
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_new_session.js +0 -49
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_read_chat.js +0 -92
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_resolve_action.js +0 -59
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_send_message.js +0 -72
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_set_mode.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_set_model.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_switch_session.js +0 -34
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — list_sessions
|
|
3
3
|
*
|
|
4
|
-
* Cascade
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
4
|
+
* Cascade session get list.
|
|
5
|
+
* 1. top tabs ([id^="cascade-tab-"])
|
|
6
|
+
* 2. history panel ([data-kb-navigate="true"])
|
|
7
7
|
*/
|
|
8
8
|
(async () => {
|
|
9
9
|
try {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
const seenIds = new Set();
|
|
21
21
|
const seenTitles = new Set();
|
|
22
22
|
|
|
23
|
-
// 1.
|
|
23
|
+
// 1. top tabs
|
|
24
24
|
const tabs = Array.from(document.querySelectorAll('[id^="cascade-tab-"]')).filter(isVisible);
|
|
25
25
|
for (const tab of tabs) {
|
|
26
26
|
const fullId = tab.id || '';
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
const title = normalize(tab.textContent);
|
|
29
29
|
if (!title || title === 'New Cascade') continue;
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// Check active status: specific class or internal element class or ARIA attribute
|
|
32
32
|
const isActive = tab.classList.contains('bg-ide-tab-active-background-color') ||
|
|
33
33
|
!!tab.querySelector('.bg-ide-tab-active-background-color') ||
|
|
34
34
|
tab.getAttribute('aria-selected') === 'true';
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// 2.
|
|
46
|
+
// 2. history panel
|
|
47
47
|
const historyButton = Array.from(cascade.querySelectorAll('button')).find(el => isVisible(el) && /lucide-history/.test(el.innerHTML || ''));
|
|
48
48
|
const existingPanel = Array.from(cascade.querySelectorAll('div')).find(el => isVisible(el) && (String(el.className || '').includes('group/panel') || el.hasAttribute('data-kb-navigate')));
|
|
49
49
|
const wasOpen = !!existingPanel;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — new_session
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* new Cascade session start.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1.
|
|
8
|
-
* 2.
|
|
9
|
-
* 3. Codicon
|
|
10
|
-
* 4. Cmd+L
|
|
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
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* "New Chat"
|
|
12
|
+
* Windsurffrom Cascadeis an AI chat panel,
|
|
13
|
+
* "New Chat" or "+" starts New session via button.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
16
16
|
*/
|
|
17
17
|
(async () => {
|
|
18
18
|
try {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — open_panel
|
|
3
3
|
*
|
|
4
|
-
* Cascade(AI
|
|
4
|
+
* Cascade(AI chat) If panel is closed when present open.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Cmd+L
|
|
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
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Return: 'visible' | 'opened' | 'error: ...'
|
|
11
|
+
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
12
12
|
*/
|
|
13
13
|
(async () => {
|
|
14
14
|
try {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — resolve_action
|
|
3
3
|
*
|
|
4
|
-
* Cascade
|
|
4
|
+
* Cascade panel approval/ button Return.
|
|
5
5
|
*/
|
|
6
6
|
(async (params) => {
|
|
7
7
|
try {
|
|
8
8
|
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
9
9
|
const normalize = (text) => (text || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
//
|
|
12
12
|
const want = normalize(params?.buttonText || params?.button || params?.action || 'run');
|
|
13
13
|
|
|
14
14
|
const isMatch = (text) => {
|
|
15
15
|
const t = normalize(text);
|
|
16
16
|
if (!t) return false;
|
|
17
|
-
//
|
|
17
|
+
// Positive action (Run / Accept)
|
|
18
18
|
if (want === 'run' || want === 'approve' || want === 'accept') {
|
|
19
19
|
return /run|allow|approve|accept|apply|ok|yes|proceed|continue|keep/i.test(t);
|
|
20
20
|
}
|
|
21
|
-
//
|
|
21
|
+
// Negative action (Skip / Reject)
|
|
22
22
|
if (want === 'skip' || want === 'reject' || want === 'deny') {
|
|
23
23
|
return /skip|deny|reject|cancel|no|discard/i.test(t);
|
|
24
24
|
}
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
|
|
35
35
|
const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root') || document;
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// button
|
|
38
38
|
const buttons = Array.from(cascade.querySelectorAll('button, [role="button"], .monaco-button'))
|
|
39
39
|
.filter(el => isVisible(el) && !el.disabled && !el.classList.contains('disabled'));
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
// (latest) with button first
|
|
42
42
|
const target = buttons.reverse().find(el => {
|
|
43
43
|
const label = el.innerText || el.textContent || el.getAttribute('aria-label') || '';
|
|
44
44
|
return isMatch(label);
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
target.focus?.();
|
|
49
49
|
const rect = target.getBoundingClientRect();
|
|
50
50
|
|
|
51
|
-
// Synthetic click (DOM
|
|
51
|
+
// Synthetic click (DOM level)
|
|
52
52
|
try {
|
|
53
53
|
const init = { bubbles: true, cancelable: true, view: window, buttons: 1 };
|
|
54
54
|
target.dispatchEvent(new MouseEvent('mousedown', init));
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
// button On failure Enter ( when)
|
|
68
68
|
if (want === 'run' || want === 'approve' || want === 'accept') {
|
|
69
69
|
const cmdEnter = (type) => document.dispatchEvent(new KeyboardEvent(type, { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, metaKey: true, bubbles: true, cancelable: true }));
|
|
70
70
|
cmdEnter('keydown');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — switch_session
|
|
3
3
|
*
|
|
4
|
-
* Cascade
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
4
|
+
* Cascade session(conversation) .
|
|
5
|
+
* 1. top tabs ([id^="cascade-tab-"])
|
|
6
|
+
* 2. history panel ([data-kb-navigate="true"])
|
|
7
7
|
*/
|
|
8
8
|
(async (params) => {
|
|
9
9
|
try {
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
|
|
32
32
|
let target = null;
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// 1. ID search (top tabs first)
|
|
35
35
|
if (id) {
|
|
36
36
|
target = document.getElementById(`cascade-tab-${id}`) || document.getElementById(id);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// 2. top tabsfrom title search
|
|
40
40
|
if (!target && title) {
|
|
41
41
|
const tabs = Array.from(document.querySelectorAll('[id^="cascade-tab-"]'));
|
|
42
42
|
target = tabs.find(tab => normalize(tab.textContent).includes(title));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// 3.
|
|
45
|
+
// 3. history panelfrom search
|
|
46
46
|
if (!target) {
|
|
47
47
|
const cascade = document.querySelector('#windsurf\\.cascadePanel') || document.querySelector('.chat-client-root');
|
|
48
48
|
if (cascade) {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (!target) {
|
|
66
|
-
//
|
|
66
|
+
// Close history panel
|
|
67
67
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
|
|
68
68
|
return JSON.stringify({ switched: false, error: 'Session not found among visible tabs or history rows' });
|
|
69
69
|
}
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
const coords = clickSequence(target.querySelector('.cursor-pointer') || target);
|
|
72
72
|
await wait(200);
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
// Close history panel ( )
|
|
75
75
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', code: 'Escape', keyCode: 27, which: 27, bubbles: true, cancelable: true }));
|
|
76
76
|
|
|
77
77
|
return JSON.stringify({ switched: true, coords });
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — focus_editor
|
|
3
3
|
*
|
|
4
|
-
* Cascade(
|
|
5
|
-
* Windsurf
|
|
4
|
+
* Cascade(chat) focus on input field.
|
|
5
|
+
* Windsurf VS Code fork, chat UI "Cascade"is called.
|
|
6
6
|
*
|
|
7
|
-
* DOM
|
|
7
|
+
* DOM structure:
|
|
8
8
|
* #windsurf.cascadePanel → .chat-client-root
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* input: [contenteditable="true"][role="textbox"]
|
|
10
|
+
* or textarea ()
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* final Check: Windsurf (2026-03-06)
|
|
13
13
|
*/
|
|
14
14
|
(() => {
|
|
15
15
|
try {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — list_chats
|
|
3
3
|
*
|
|
4
|
-
* Cascade
|
|
5
|
-
*
|
|
6
|
-
* cascade-tab-{uuid}
|
|
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
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
9
9
|
*/
|
|
10
10
|
(async () => {
|
|
11
11
|
try {
|
|
12
|
-
|
|
12
|
+
// ─── 1. If panel is closed open ───
|
|
13
13
|
let tabs = document.querySelectorAll('[id^="cascade-tab-"]');
|
|
14
14
|
if (tabs.length === 0) {
|
|
15
|
-
// Cascade
|
|
15
|
+
// Check if Cascade panel is visible Check
|
|
16
16
|
const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
|
|
17
17
|
document.querySelector('.chat-client-root');
|
|
18
18
|
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
(sidebar && sidebar.offsetWidth > 0 && cascade);
|
|
21
21
|
|
|
22
22
|
if (!panelVisible) {
|
|
23
|
-
//
|
|
23
|
+
// Attempt to click toggle button
|
|
24
24
|
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
25
25
|
let toggled = false;
|
|
26
26
|
for (const btn of toggleBtns) {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
// button Cmd+L
|
|
38
38
|
if (!toggled) {
|
|
39
39
|
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
40
40
|
key: 'l', code: 'KeyL', keyCode: 76,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}));
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
//
|
|
51
|
+
// Wait for panel render (max 3 seconds)
|
|
52
52
|
for (let i = 0; i < 30; i++) {
|
|
53
53
|
await new Promise(r => setTimeout(r, 100));
|
|
54
54
|
tabs = document.querySelectorAll('[id^="cascade-tab-"]');
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
// ─── 2. ───
|
|
61
61
|
tabs = document.querySelectorAll('[id^="cascade-tab-"]');
|
|
62
62
|
if (tabs.length === 0) return [];
|
|
63
63
|
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
let cascadeId = tabId;
|
|
74
74
|
let status = 'completed';
|
|
75
75
|
|
|
76
|
-
// React Fiber
|
|
76
|
+
// Extract title from React Fiber
|
|
77
77
|
const fk = Object.keys(tab).find(k => k.startsWith('__reactFiber'));
|
|
78
78
|
if (fk) {
|
|
79
79
|
let fiber = tab[fk];
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
// DOM
|
|
98
|
+
// DOM fallback
|
|
99
99
|
if (!title) {
|
|
100
100
|
title = tab.textContent?.trim().substring(0, 100) || ('Chat ' + (result.length + 1));
|
|
101
101
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — new_session
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* new Cascade session start.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* 1.
|
|
8
|
-
* 2.
|
|
9
|
-
* 3. Codicon
|
|
10
|
-
* 4. Cmd+L
|
|
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
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* "New Chat"
|
|
12
|
+
* Windsurffrom Cascadeis an AI chat panel,
|
|
13
|
+
* "New Chat" or "+" starts New session via button.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
16
16
|
*/
|
|
17
17
|
(() => {
|
|
18
18
|
try {
|
|
19
|
-
// ─── 1. aria-label
|
|
19
|
+
// ─── 1. Based on aria-label ───
|
|
20
20
|
const allBtns = Array.from(document.querySelectorAll('button, [role="button"], .action-item'))
|
|
21
21
|
.filter(b => b.offsetWidth > 0);
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// ─── 2.
|
|
33
|
+
// ─── 2. text-based ───
|
|
34
34
|
for (const btn of allBtns) {
|
|
35
35
|
const text = (btn.textContent || '').trim();
|
|
36
36
|
if (text === '+' || text === 'New Chat' || text === 'New Cascade' ||
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// ─── 3. Codicon
|
|
43
|
+
// ─── 3. Codicon icon(+) based ───
|
|
44
44
|
for (const btn of allBtns) {
|
|
45
45
|
const hasPlus = btn.querySelector('.codicon-plus, .codicon-add, [class*="plus"]');
|
|
46
46
|
if (hasPlus) {
|
|
47
47
|
const label = (btn.getAttribute('aria-label') || btn.getAttribute('title') || '').toLowerCase();
|
|
48
|
-
|
|
48
|
+
// Cascade-related context or empty label New session button
|
|
49
49
|
if (label.includes('chat') || label.includes('cascade') ||
|
|
50
50
|
label.includes('new') || label === '') {
|
|
51
51
|
btn.click();
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
//
|
|
57
|
+
// ─── 4. Cmd+L (macOS: metaKey, Windows/Linux: ctrlKey) ───
|
|
58
|
+
// Windsurffrom Cmd+Lis Cascade Toggle panel/New session create
|
|
59
59
|
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
60
60
|
key: 'l', code: 'KeyL', keyCode: 76,
|
|
61
61
|
metaKey: true, ctrlKey: false,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — open_panel
|
|
3
3
|
*
|
|
4
|
-
* Cascade(AI
|
|
4
|
+
* Cascade(AI chat) If panel is closed when present open.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Cmd+L
|
|
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
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Return: 'visible' | 'opened' | 'error: ...'
|
|
11
|
+
* final Check: Windsurf 1.108.x (2026-03-10)
|
|
12
12
|
*/
|
|
13
13
|
(() => {
|
|
14
14
|
try {
|
|
15
|
-
// ─── 1. Cascade
|
|
15
|
+
// ─── 1. Check if Cascade panel is already open ───
|
|
16
16
|
const cascade = document.querySelector('#windsurf\\.cascadePanel') ||
|
|
17
17
|
document.querySelector('.chat-client-root');
|
|
18
18
|
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// panelexists and visible means already open
|
|
21
21
|
if (cascade && cascade.offsetWidth > 0 && cascade.offsetHeight > 0) {
|
|
22
22
|
return 'visible';
|
|
23
23
|
}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
return 'visible';
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// ─── 2.
|
|
28
|
+
// ─── 2. Attempt to click toggle button ───
|
|
29
29
|
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
30
30
|
for (const btn of toggleBtns) {
|
|
31
31
|
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
// ─── 3. Cmd+L
|
|
41
|
+
// ─── 3. Cmd+L shortcut fallback (Windsurf official shortcut) ───
|
|
42
42
|
// keyCode: 76, modifiers: 4 (Meta/Cmd)
|
|
43
43
|
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
44
44
|
key: 'l', code: 'KeyL', keyCode: 76,
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Windsurf v1 — read_chat (v1 — Cascade DOM + Fiber)
|
|
3
3
|
*
|
|
4
|
-
* Windsurf
|
|
4
|
+
* Windsurf VS Code fork, chat UI is "Cascade"is called.
|
|
5
5
|
*
|
|
6
|
-
* DOM
|
|
6
|
+
* DOM structure:
|
|
7
7
|
* #windsurf.cascadePanel → .chat-client-root
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* scroll: .cascade-scrollbar
|
|
9
|
+
* list: .cascade-scrollbar .pb-20 > .flex.flex-col > .flex.flex-col.gap-2\.5
|
|
10
|
+
* use : hasProse=false, hasWhitespace=true
|
|
11
|
+
* AI : [class*="prose"] (prose-sm)
|
|
12
|
+
* UI: .mark-js-ignore (ignore)
|
|
13
|
+
* input: [data-lexical-editor="true"]
|
|
14
14
|
*
|
|
15
15
|
* Fiber props:
|
|
16
|
-
* cascadeId:
|
|
17
|
-
*
|
|
18
|
-
* hasPendingTerminalCommand:
|
|
19
|
-
*
|
|
16
|
+
* cascadeId: session ID
|
|
17
|
+
* isRunning: create status
|
|
18
|
+
* hasPendingTerminalCommand: approval wait
|
|
19
|
+
* copyableText: AI response source
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* final Check: Windsurf (2026-03-06)
|
|
22
22
|
*/
|
|
23
23
|
(() => {
|
|
24
24
|
try {
|
|
25
|
-
// ─── 1.
|
|
25
|
+
// ─── 1. Container ───
|
|
26
26
|
const cascade = document.querySelector('#windsurf\\.cascadePanel')
|
|
27
27
|
|| document.querySelector('.chat-client-root');
|
|
28
28
|
if (!cascade) {
|
|
29
29
|
return { id: 'no_cascade', status: 'idle', title: 'No Cascade', messages: [], inputContent: '', activeModal: null };
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
// ─── 2.
|
|
32
|
+
// ─── 2. Extract cascadeId, isRunning from Fiber (search from turn elements) ───
|
|
33
33
|
let cascadeId = 'cascade';
|
|
34
34
|
let isRunning = false;
|
|
35
35
|
let hasPendingCmd = false;
|
|
36
36
|
try {
|
|
37
|
-
//
|
|
37
|
+
// Search Fiber from turn elements (cascadeId found at depth 6 from cascadePanel root)
|
|
38
38
|
const scrollArea = cascade.querySelector('.cascade-scrollbar');
|
|
39
39
|
const gapEls = scrollArea ? scrollArea.querySelectorAll('[class*="gap-2"]') : [];
|
|
40
40
|
let firstTurn = null;
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
}
|
|
58
58
|
} catch (_) { }
|
|
59
59
|
|
|
60
|
-
// ─── 3.
|
|
60
|
+
// ─── 3. status detection ───
|
|
61
61
|
let status = 'idle';
|
|
62
62
|
if (isRunning) status = 'generating';
|
|
63
63
|
|
|
64
|
-
// Signal A: Stop
|
|
64
|
+
// Signal A: Stop button
|
|
65
65
|
if (status === 'idle') {
|
|
66
66
|
const allBtns = Array.from(document.querySelectorAll('button'));
|
|
67
67
|
const stopBtn = allBtns.find(b => {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
if (stopBtn) status = 'generating';
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
// Signal B:
|
|
77
|
+
// Signal B: input field placeholder
|
|
78
78
|
if (status === 'idle') {
|
|
79
79
|
const editor = cascade.querySelector('[data-lexical-editor="true"]');
|
|
80
80
|
if (editor) {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
const titleParts = document.title.split(' \u2014 ');
|
|
87
87
|
const title = (titleParts.length >= 2 ? titleParts[titleParts.length - 1] : titleParts[0] || '').trim() || 'Cascade';
|
|
88
88
|
|
|
89
|
-
// ─── 4. HTML → Markdown
|
|
89
|
+
// ─── 4. HTML → Markdown converter ───
|
|
90
90
|
const BLOCK_TAGS = new Set(['DIV', 'P', 'BR', 'LI', 'TR', 'SECTION', 'ARTICLE', 'HEADER', 'FOOTER']);
|
|
91
91
|
function extractCodeText(node) {
|
|
92
92
|
if (node.nodeType === 3) return node.textContent || '';
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
return md;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
// ─── 5.
|
|
174
|
+
// ─── 5. Collect messages ───
|
|
175
175
|
const collected = [];
|
|
176
176
|
const seenHashes = new Set();
|
|
177
177
|
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
return { id: cascadeId, status, title, messages: [], inputContent: '', activeModal: null };
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
// list Container search: .gap-2.5 with 2+ children
|
|
184
184
|
let msgContainer = null;
|
|
185
185
|
const gapEls = scrollArea.querySelectorAll('[class*="gap-2"]');
|
|
186
186
|
for (const el of gapEls) {
|
|
@@ -192,17 +192,17 @@
|
|
|
192
192
|
if (msgContainer) {
|
|
193
193
|
const turns = Array.from(msgContainer.children);
|
|
194
194
|
for (const turn of turns) {
|
|
195
|
-
// .mark-js-ignore =
|
|
195
|
+
// .mark-js-ignore = feedback UI → skip
|
|
196
196
|
if ((turn.className || '').includes('mark-js-ignore')) continue;
|
|
197
197
|
if (turn.offsetHeight < 10) continue;
|
|
198
198
|
|
|
199
|
-
//
|
|
199
|
+
// Determine role: .prose = AI, otherwise user
|
|
200
200
|
const proseEl = turn.querySelector('[class*="prose"]');
|
|
201
201
|
const role = proseEl ? 'assistant' : 'user';
|
|
202
202
|
|
|
203
203
|
let text = '';
|
|
204
204
|
if (role === 'assistant') {
|
|
205
|
-
|
|
205
|
+
// AI: Fiber copyableText use ( !)
|
|
206
206
|
try {
|
|
207
207
|
const fk = Object.keys(turn).find(k => k.startsWith('__reactFiber'));
|
|
208
208
|
if (fk) {
|
|
@@ -218,13 +218,13 @@
|
|
|
218
218
|
}
|
|
219
219
|
} catch (_) { }
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
// In Fiber HTML→Markdown
|
|
222
222
|
if (!text) {
|
|
223
223
|
const mdRoot = proseEl || turn;
|
|
224
224
|
text = getCleanMd(mdRoot);
|
|
225
225
|
}
|
|
226
226
|
} else {
|
|
227
|
-
//
|
|
227
|
+
// User: whitespace-pre-wrap elementfrom text extract
|
|
228
228
|
const whitespace = turn.querySelector('[class*="whitespace"]');
|
|
229
229
|
text = (whitespace || turn).innerText?.trim() || '';
|
|
230
230
|
}
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
// DOM
|
|
241
|
+
// DOM Order sorting
|
|
242
242
|
collected.sort((a, b) => {
|
|
243
243
|
const pos = a.el.compareDocumentPosition(b.el);
|
|
244
244
|
if (pos & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
return 0;
|
|
247
247
|
});
|
|
248
248
|
|
|
249
|
-
//
|
|
249
|
+
// latest 30only
|
|
250
250
|
const trimmed = collected.length > 30 ? collected.slice(-30) : collected;
|
|
251
251
|
|
|
252
252
|
const final = trimmed.map((m, i) => ({
|
|
@@ -257,13 +257,13 @@
|
|
|
257
257
|
kind: 'standard'
|
|
258
258
|
}));
|
|
259
259
|
|
|
260
|
-
// ─── 6.
|
|
260
|
+
// ─── 6. input field ───
|
|
261
261
|
const editor = cascade.querySelector('[data-lexical-editor="true"]')
|
|
262
262
|
|| cascade.querySelector('[contenteditable="true"][role="textbox"]')
|
|
263
263
|
|| cascade.querySelector('textarea:not(.xterm-helper-textarea)');
|
|
264
264
|
const inputContent = editor ? (editor.innerText || editor.value || '').trim() : '';
|
|
265
265
|
|
|
266
|
-
// ─── 7.
|
|
266
|
+
// ─── 7. modal/approval detect ───
|
|
267
267
|
let activeModal = null;
|
|
268
268
|
try {
|
|
269
269
|
// Fiber: hasPendingTerminalCommand
|
|
@@ -277,7 +277,7 @@
|
|
|
277
277
|
activeModal = { message: 'Terminal command pending', buttons: btnTexts.length > 0 ? btnTexts : ['Run', 'Reject'] };
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
// Dialog
|
|
280
|
+
// Dialog fallback
|
|
281
281
|
if (!activeModal) {
|
|
282
282
|
const dialog = document.querySelector('.monaco-dialog-box, [role="dialog"]');
|
|
283
283
|
if (dialog && dialog.offsetWidth > 80) {
|
|
@@ -290,7 +290,7 @@
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
//
|
|
293
|
+
// Inline approval buttons
|
|
294
294
|
if (!activeModal) {
|
|
295
295
|
const allBtns = Array.from(document.querySelectorAll('button')).filter(b => b.offsetWidth > 0);
|
|
296
296
|
const approvalBtns = allBtns.filter(b => {
|