@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,318 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor — read_chat (v2 — thoughts, tools, terminal, DOM-ordered)
|
|
3
|
-
*
|
|
4
|
-
* DOM structure (v0.49):
|
|
5
|
-
* Composer: [data-composer-id] + [data-composer-status]
|
|
6
|
-
* Message pair: .composer-human-ai-pair-container
|
|
7
|
-
* User: .composer-human-message
|
|
8
|
-
* AI text: .composer-rendered-message (assistant content)
|
|
9
|
-
* Thinking: .ui-step-group-collapsible → header "Thought briefly"
|
|
10
|
-
* Tool: .composer-tool-former-message (file edits, reads)
|
|
11
|
-
* Code block: .composer-code-block-container (terminal commands)
|
|
12
|
-
* Diff: .composer-diff-block (code changes)
|
|
13
|
-
* Approval: .run-command-review-active + button/cursor-pointer elements
|
|
14
|
-
*
|
|
15
|
-
* → { id, status, title, messages[], inputContent, activeModal }
|
|
16
|
-
*/
|
|
17
|
-
(() => {
|
|
18
|
-
try {
|
|
19
|
-
const c = document.querySelector('[data-composer-id]');
|
|
20
|
-
const id = c?.getAttribute('data-composer-id') || 'active';
|
|
21
|
-
const rawStatus = c?.getAttribute('data-composer-status') || 'idle';
|
|
22
|
-
let status = rawStatus;
|
|
23
|
-
if (rawStatus === 'thinking' || rawStatus === 'streaming') status = 'generating';
|
|
24
|
-
else if (rawStatus === 'completed' || rawStatus === 'cancelled' || rawStatus === 'idle' || !rawStatus) status = 'idle';
|
|
25
|
-
|
|
26
|
-
// ─── Approval Detection ───
|
|
27
|
-
let activeModal = null;
|
|
28
|
-
const reviewActive = !!document.querySelector('.run-command-review-active');
|
|
29
|
-
const clickableEls = [...document.querySelectorAll('button, [role="button"], .cursor-pointer')].filter(b =>
|
|
30
|
-
b.offsetWidth > 0 && /^(accept|reject|approve|deny|run|skip|allow|cancel)/i.test((b.textContent || b.getAttribute('aria-label') || '').trim())
|
|
31
|
-
);
|
|
32
|
-
if (reviewActive || clickableEls.length > 0) {
|
|
33
|
-
status = 'waiting_approval';
|
|
34
|
-
const reviewContainer = document.querySelector('.run-command-review-active');
|
|
35
|
-
const renderedMsgs = reviewContainer?.querySelectorAll('.composer-rendered-message');
|
|
36
|
-
const lastRendered = renderedMsgs?.length ? renderedMsgs[renderedMsgs.length - 1] : null;
|
|
37
|
-
const toolMsg = lastRendered || reviewContainer?.querySelector('.composer-tool-former-message:last-of-type');
|
|
38
|
-
activeModal = {
|
|
39
|
-
message: toolMsg?.textContent?.trim()?.substring(0, 200) || 'Command approval required',
|
|
40
|
-
buttons: clickableEls.map(b => b.textContent.trim().replace(/[⏎↵]/g, '').trim()).filter(Boolean),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ─── Message Collection ───
|
|
45
|
-
const collected = [];
|
|
46
|
-
const seenHashes = new Set();
|
|
47
|
-
|
|
48
|
-
// Markdown Extractor to preserve tables/lists structure properly instead of flat innerText
|
|
49
|
-
function extractMarkdown(node) {
|
|
50
|
-
if (!node) return '';
|
|
51
|
-
if (node.nodeType === 3) return node.textContent;
|
|
52
|
-
if (node.nodeType !== 1) return '';
|
|
53
|
-
|
|
54
|
-
const tag = node.tagName.toLowerCase();
|
|
55
|
-
|
|
56
|
-
// Stop extracting into nested block containers that we already process as separate items
|
|
57
|
-
if (node.classList && (
|
|
58
|
-
node.classList.contains('composer-tool-former-message') ||
|
|
59
|
-
node.classList.contains('composer-code-block-container') ||
|
|
60
|
-
node.classList.contains('composer-diff-block')
|
|
61
|
-
)) {
|
|
62
|
-
return '';
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
let res = '';
|
|
66
|
-
if (tag === 'p' || tag === 'div') {
|
|
67
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
68
|
-
return res + '\n\n';
|
|
69
|
-
}
|
|
70
|
-
if (/^h[1-6]$/.test(tag)) {
|
|
71
|
-
const level = parseInt(tag.charAt(1), 10);
|
|
72
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
73
|
-
return '#'.repeat(level) + ' ' + res.trim() + '\n\n';
|
|
74
|
-
}
|
|
75
|
-
if (tag === 'ul' || tag === 'ol') {
|
|
76
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
77
|
-
return res + '\n';
|
|
78
|
-
}
|
|
79
|
-
if (tag === 'li') {
|
|
80
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
81
|
-
return '- ' + res.trim() + '\n';
|
|
82
|
-
}
|
|
83
|
-
if (tag === 'strong' || tag === 'b') {
|
|
84
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
85
|
-
return '**' + res + '**';
|
|
86
|
-
}
|
|
87
|
-
if (tag === 'em' || tag === 'i') {
|
|
88
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
89
|
-
return '*' + res + '*';
|
|
90
|
-
}
|
|
91
|
-
if (tag === 'code') {
|
|
92
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
93
|
-
return '`' + res + '`';
|
|
94
|
-
}
|
|
95
|
-
if (tag === 'pre') {
|
|
96
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
97
|
-
return '\n```\n' + res.trim() + '\n```\n\n';
|
|
98
|
-
}
|
|
99
|
-
if (tag === 'a') {
|
|
100
|
-
let text = '';
|
|
101
|
-
for (let i = 0; i < node.childNodes.length; i++) text += extractMarkdown(node.childNodes[i]);
|
|
102
|
-
return '[' + text + '](' + (node.href || '') + ')';
|
|
103
|
-
}
|
|
104
|
-
if (tag === 'table') {
|
|
105
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
106
|
-
return '\n' + res.trim() + '\n\n';
|
|
107
|
-
}
|
|
108
|
-
if (tag === 'thead') {
|
|
109
|
-
const tr = node.querySelector('tr');
|
|
110
|
-
if (tr) {
|
|
111
|
-
const ths = Array.from(tr.querySelectorAll('th')).map(th => extractMarkdown(th).trim());
|
|
112
|
-
return '| ' + ths.join(' | ') + ' |\n| ' + ths.map(() => '---').join(' | ') + ' |\n';
|
|
113
|
-
}
|
|
114
|
-
return '';
|
|
115
|
-
}
|
|
116
|
-
if (tag === 'tbody') {
|
|
117
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
118
|
-
return res;
|
|
119
|
-
}
|
|
120
|
-
if (tag === 'tr' && (!node.parentElement || node.parentElement.tagName.toLowerCase() !== 'thead')) {
|
|
121
|
-
const tds = Array.from(node.querySelectorAll('td')).map(td => extractMarkdown(td).trim().replace(/\n/g, '<br>'));
|
|
122
|
-
return '| ' + tds.join(' | ') + ' |\n';
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Default
|
|
126
|
-
for (let i = 0; i < node.childNodes.length; i++) res += extractMarkdown(node.childNodes[i]);
|
|
127
|
-
return res;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
document.querySelectorAll('.composer-human-ai-pair-container').forEach((pair) => {
|
|
131
|
-
if (pair.children.length === 0) return; // virtual-scroll placeholder
|
|
132
|
-
|
|
133
|
-
// ─── User Message ───
|
|
134
|
-
const humanEl = pair.querySelector('.composer-human-message');
|
|
135
|
-
if (humanEl) {
|
|
136
|
-
const userText = (humanEl.innerText || '').trim().substring(0, 6000);
|
|
137
|
-
if (userText) {
|
|
138
|
-
const hash = 'user:' + userText.slice(0, 200);
|
|
139
|
-
if (!seenHashes.has(hash)) {
|
|
140
|
-
seenHashes.add(hash);
|
|
141
|
-
collected.push({ role: 'user', text: userText, el: humanEl, kind: 'standard' });
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// ─── AI Message Blocks ───
|
|
147
|
-
const aiBlocks = Array.from(pair.querySelectorAll('.composer-assistant-message, [data-message-role="ai"], [data-message-role="assistant"]'));
|
|
148
|
-
for (const block of aiBlocks) {
|
|
149
|
-
|
|
150
|
-
// ─── Thinking ("Thought briefly", etc) ───
|
|
151
|
-
const uiStepGroup = block.querySelectorAll('.ui-step-group-collapsible, [class*="collapsible"]');
|
|
152
|
-
if (uiStepGroup.length > 0) {
|
|
153
|
-
uiStepGroup.forEach(group => {
|
|
154
|
-
const collapsibleHeader = group.querySelector('.ui-collapsible-header');
|
|
155
|
-
const spans = collapsibleHeader?.querySelectorAll('span');
|
|
156
|
-
const headerText = spans && spans.length > 0
|
|
157
|
-
? Array.from(spans).map(s => (s.textContent || '').trim()).filter(Boolean).join(' ')
|
|
158
|
-
: (collapsibleHeader?.innerText || collapsibleHeader?.textContent || '').trim();
|
|
159
|
-
|
|
160
|
-
// "Thought briefly", "Thought for Xs" — thinking content
|
|
161
|
-
if (headerText && /thought/i.test(headerText)) {
|
|
162
|
-
// Try to get expanded thought content
|
|
163
|
-
const contentEl = block.querySelector('.ui-collapsible-content, [class*="collapsible-content"]');
|
|
164
|
-
const thinkText = contentEl ? (contentEl.innerText || '').trim() : '';
|
|
165
|
-
const label = headerText;
|
|
166
|
-
const hash = 'think:' + (thinkText || headerText).slice(0, 200);
|
|
167
|
-
|
|
168
|
-
if (!seenHashes.has(hash)) {
|
|
169
|
-
seenHashes.add(hash);
|
|
170
|
-
// Prepend thinking into collected as a special block
|
|
171
|
-
let combined = `> **${label}**\n> \n`;
|
|
172
|
-
if (thinkText) {
|
|
173
|
-
combined += thinkText.split('\n').map(l => `> ${l}`).join('\n');
|
|
174
|
-
} else {
|
|
175
|
-
combined += '> ...\n'; // collapsed
|
|
176
|
-
}
|
|
177
|
-
collected.push({ role: 'assistant', text: combined, el: group, kind: 'thought' });
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
// Note: If the entire block is just a thought, maybe continue, but usually there's rendered text after.
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// ─── Tools (Reads, Edits, etc) ───
|
|
185
|
-
const toolMsgs = block.querySelectorAll('.composer-tool-former-message');
|
|
186
|
-
if (toolMsgs.length > 0) {
|
|
187
|
-
toolMsgs.forEach(tm => {
|
|
188
|
-
let cleanText = '';
|
|
189
|
-
// For file modifications/reads, try to just grab the file path (first line)
|
|
190
|
-
// It usually looks like: "MachineDetail.tsx+3-1 Read file"
|
|
191
|
-
const rawText = (tm.innerText || '').trim();
|
|
192
|
-
if (rawText) {
|
|
193
|
-
cleanText = rawText.split('\n')[0].substring(0, 80)
|
|
194
|
-
.replace(/(?:Skip|Run|Accept|Reject)(?:Esc)?$/g, '').trim();
|
|
195
|
-
// If it looks like code/JSX, truncate further
|
|
196
|
-
if (/[<>{}()=]/.test(cleanText) && cleanText.length > 50) {
|
|
197
|
-
cleanText = cleanText.substring(0, 50) + '…';
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
if (!cleanText || cleanText.length < 2) return;
|
|
201
|
-
const hash = 'tool:' + cleanText;
|
|
202
|
-
if (!seenHashes.has(hash)) {
|
|
203
|
-
seenHashes.add(hash);
|
|
204
|
-
collected.push({ role: 'assistant', text: cleanText, el: tm, kind: 'tool' });
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// ─── Code blocks / Terminal ───
|
|
210
|
-
const codeBlocks = block.querySelectorAll('.composer-code-block-container');
|
|
211
|
-
if (codeBlocks.length > 0) {
|
|
212
|
-
codeBlocks.forEach(cb => {
|
|
213
|
-
let codeText = (cb.textContent || '').trim().substring(0, 3000);
|
|
214
|
-
// Strip button text noise
|
|
215
|
-
codeText = codeText.replace(/(?:Skip|Run|Accept|Reject)(?:Esc|⏎|↵)?\s*$/g, '').trim();
|
|
216
|
-
codeText = codeText.replace(/\n(?:Skip|Run|Accept|Reject)(?:Esc|⏎|↵)?\s*/g, '\n').trim();
|
|
217
|
-
if (codeText.length < 2) return;
|
|
218
|
-
// Detect if it's a terminal command vs code block
|
|
219
|
-
const isTerminal = cb.querySelector('[class*="terminal"]') ||
|
|
220
|
-
cb.closest('.run-command-review-active') ||
|
|
221
|
-
/^\$\s/.test(codeText) ||
|
|
222
|
-
/^(?:cd |npm |node |npx |git |make |docker |curl |wget |ls |cat |mkdir |rm |mv |cp )/i.test(codeText);
|
|
223
|
-
const hash = (isTerminal ? 'term:' : 'code:') + codeText.slice(0, 200);
|
|
224
|
-
if (!seenHashes.has(hash)) {
|
|
225
|
-
seenHashes.add(hash);
|
|
226
|
-
// For terminal: extract first line as label
|
|
227
|
-
const label = isTerminal ? codeText.split('\n')[0].substring(0, 100) : undefined;
|
|
228
|
-
collected.push({
|
|
229
|
-
role: 'assistant',
|
|
230
|
-
text: codeText,
|
|
231
|
-
el: cb,
|
|
232
|
-
kind: isTerminal ? 'terminal' : 'code',
|
|
233
|
-
label
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// ─── Diff Blocks ───
|
|
240
|
-
const diffBlocks = block.querySelectorAll('.composer-diff-block');
|
|
241
|
-
if (diffBlocks.length > 0) {
|
|
242
|
-
diffBlocks.forEach(db => {
|
|
243
|
-
const diffText = (db.textContent || '').trim().substring(0, 2000);
|
|
244
|
-
if (diffText.length < 5) return;
|
|
245
|
-
const hash = 'diff:' + diffText.slice(0, 200);
|
|
246
|
-
if (!seenHashes.has(hash)) {
|
|
247
|
-
seenHashes.add(hash);
|
|
248
|
-
collected.push({ role: 'assistant', text: diffText, el: db, kind: 'tool' });
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// ─── Rendered assistant message ───
|
|
254
|
-
const rendered = block.classList.contains('composer-rendered-message') ? block : block.querySelector('.composer-rendered-message');
|
|
255
|
-
if (rendered) {
|
|
256
|
-
const t = extractMarkdown(rendered).replace(/\n{3,}/g, '\n\n').trim();
|
|
257
|
-
if (t.length >= 2) {
|
|
258
|
-
// Strip button noise from end
|
|
259
|
-
const clean = t.replace(/(?:Skip|Run|Accept|Reject)(?:Esc)?\s*$/g, '').trim();
|
|
260
|
-
if (clean.length >= 2) {
|
|
261
|
-
const hash = 'assistant:' + clean.slice(0, 200);
|
|
262
|
-
if (!seenHashes.has(hash)) {
|
|
263
|
-
seenHashes.add(hash);
|
|
264
|
-
collected.push({ role: 'assistant', text: clean.substring(0, 6000), el: rendered, kind: 'standard' });
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// ─── Fallback: any remaining text block ───
|
|
272
|
-
const t = (block.innerText || '').trim();
|
|
273
|
-
if (t.length < 2) continue;
|
|
274
|
-
// Filter noise
|
|
275
|
-
if (/^Thought\nfor \d+s?$/i.test(t) || /^Explored\n/i.test(t)) continue;
|
|
276
|
-
if (/^.{1,80}\n\d+s$/.test(t) && !t.includes('\n\n')) continue;
|
|
277
|
-
|
|
278
|
-
const hash = 'other:' + t.slice(0, 200);
|
|
279
|
-
if (!seenHashes.has(hash)) {
|
|
280
|
-
seenHashes.add(hash);
|
|
281
|
-
collected.push({ role: 'assistant', text: t.substring(0, 6000), el: block, kind: 'standard' });
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
// ─── DOM Order Sort ───
|
|
287
|
-
collected.sort((a, b) => {
|
|
288
|
-
const pos = a.el.compareDocumentPosition(b.el);
|
|
289
|
-
if (pos & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
290
|
-
if (pos & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
291
|
-
return 0;
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
// Keep last 50 messages
|
|
295
|
-
const trimmed = collected.length > 50 ? collected.slice(-50) : collected;
|
|
296
|
-
|
|
297
|
-
const messages = trimmed.map((m, i) => ({
|
|
298
|
-
id: 'msg_' + i,
|
|
299
|
-
role: m.role,
|
|
300
|
-
content: m.text.length > 6000 ? m.text.slice(0, 6000) + '\n[... truncated]' : m.text,
|
|
301
|
-
index: i,
|
|
302
|
-
kind: m.kind || 'standard',
|
|
303
|
-
meta: m.meta || undefined,
|
|
304
|
-
}));
|
|
305
|
-
|
|
306
|
-
// ─── Input Content ───
|
|
307
|
-
const inputEl = document.querySelector('.aislash-editor-input[contenteditable="true"]');
|
|
308
|
-
const inputContent = inputEl?.textContent?.trim() || '';
|
|
309
|
-
|
|
310
|
-
// ─── Title ───
|
|
311
|
-
const titleParts = document.title.split(' — ');
|
|
312
|
-
const projectTitle = (titleParts.length >= 2 ? titleParts[titleParts.length - 1] : titleParts[0] || '').trim();
|
|
313
|
-
|
|
314
|
-
return JSON.stringify({ id, status, title: projectTitle, messages, inputContent, activeModal });
|
|
315
|
-
} catch(e) {
|
|
316
|
-
return JSON.stringify({ id: '', status: 'error', error: e.message, messages: [] });
|
|
317
|
-
}
|
|
318
|
-
})()
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor — resolve_action
|
|
3
|
-
*
|
|
4
|
-
* approval/ button search + click:
|
|
5
|
-
* button, [role="button"], .cursor-pointer text matching
|
|
6
|
-
* Cursor (e.g. "Run⏎", "SkipEsc") → ⏎↵ remove then compare
|
|
7
|
-
*
|
|
8
|
-
* params.buttonText: string — to find button text
|
|
9
|
-
* → { resolved: true/false, clicked?, available? }
|
|
10
|
-
*/
|
|
11
|
-
(params) => {
|
|
12
|
-
try {
|
|
13
|
-
const btns = [...document.querySelectorAll('button, [role="button"], .cursor-pointer')].filter(b => b.offsetWidth > 0);
|
|
14
|
-
const searchText = (params.buttonText || params.action || params.button || '').toLowerCase();
|
|
15
|
-
const target = btns.find(b => (b.textContent||'').trim().replace(/[⏎↵]/g, '').trim().toLowerCase().includes(searchText));
|
|
16
|
-
if (target) { target.click(); return JSON.stringify({ resolved: true, clicked: target.textContent.trim() }); }
|
|
17
|
-
return JSON.stringify({ resolved: false, available: btns.map(b => b.textContent.trim()).filter(Boolean).slice(0, 15) });
|
|
18
|
-
} catch(e) { return JSON.stringify({ resolved: false, error: e.message }); }
|
|
19
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor CDP Scripts — Router
|
|
3
|
-
*
|
|
4
|
-
* Version routing is handled by ProviderLoader:
|
|
5
|
-
* - provider.json "compatibility" field declares script directory overrides
|
|
6
|
-
* - VersionArchive detects installed Cursor version at daemon startup
|
|
7
|
-
* - resolve() picks the appropriate scripts/ directory
|
|
8
|
-
*
|
|
9
|
-
* Pattern:
|
|
10
|
-
* - Scripts WITHOUT params: loaded as-is (self-invoking IIFE)
|
|
11
|
-
* - Scripts WITH params: loaded as function expression, invoked with params JSON
|
|
12
|
-
* e.g. `(${script})(${JSON.stringify(params)})`
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
'use strict';
|
|
16
|
-
|
|
17
|
-
const fs = require('fs');
|
|
18
|
-
const path = require('path');
|
|
19
|
-
|
|
20
|
-
function load(name) {
|
|
21
|
-
try { return fs.readFileSync(path.join(__dirname, name), 'utf-8'); }
|
|
22
|
-
catch { return null; }
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Wrap a function-expression script with params invocation */
|
|
26
|
-
function withParams(name, params) {
|
|
27
|
-
const script = load(name);
|
|
28
|
-
if (!script) return null;
|
|
29
|
-
return `(${script})(${JSON.stringify(params)})`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// ─── Core (no params — IIFE) ───
|
|
33
|
-
|
|
34
|
-
module.exports.readChat = () => load('read_chat.js');
|
|
35
|
-
module.exports.sendMessage = () => load('send_message.js');
|
|
36
|
-
module.exports.listSessions = () => load('list_sessions.js');
|
|
37
|
-
module.exports.newSession = () => load('new_session.js');
|
|
38
|
-
module.exports.focusEditor = () => load('focus_editor.js');
|
|
39
|
-
module.exports.openPanel = () => load('open_panel.js');
|
|
40
|
-
module.exports.listModels = () => load('list_models.js');
|
|
41
|
-
module.exports.listModes = () => load('list_modes.js');
|
|
42
|
-
|
|
43
|
-
// ─── With params (function expression) ───
|
|
44
|
-
|
|
45
|
-
module.exports.switchSession = (params) => {
|
|
46
|
-
const index = typeof params === 'number' ? params : params?.index ?? 0;
|
|
47
|
-
const title = typeof params === 'string' ? params : params?.title || null;
|
|
48
|
-
return withParams('switch_session.js', { index, title });
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
module.exports.resolveAction = (params) => {
|
|
52
|
-
const action = typeof params === 'string' ? params : params?.action || 'approve';
|
|
53
|
-
const buttonText = params?.button || params?.buttonText
|
|
54
|
-
|| (action === 'approve' ? 'Run' : action === 'reject' ? 'Skip' : action);
|
|
55
|
-
return withParams('resolve_action.js', { buttonText });
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
module.exports.listNotifications = (params) => {
|
|
59
|
-
const filter = typeof params === 'string' ? params : params?.message || null;
|
|
60
|
-
return withParams('list_notifications.js', { filter });
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
module.exports.dismissNotification = (params) => {
|
|
64
|
-
const index = typeof params === 'number' ? params : params?.index ?? 0;
|
|
65
|
-
const button = typeof params === 'string' ? params : params?.button || null;
|
|
66
|
-
const message = params?.message || null;
|
|
67
|
-
return withParams('dismiss_notification.js', { index, button, message });
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
module.exports.setModel = (params) => {
|
|
71
|
-
const model = typeof params === 'string' ? params : params?.model;
|
|
72
|
-
return withParams('set_model.js', { model });
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
module.exports.setMode = (params) => {
|
|
76
|
-
const mode = typeof params === 'string' ? params : params?.mode;
|
|
77
|
-
return withParams('set_mode.js', { mode });
|
|
78
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor — send_message
|
|
3
|
-
*
|
|
4
|
-
* Cursor uses cdp-type-and-send approach:
|
|
5
|
-
* 1. Verify input field exists
|
|
6
|
-
* 2. Returns needsTypeAndSend: true → daemon handles typing + Enter via CDP
|
|
7
|
-
*
|
|
8
|
-
* Input selector: .aislash-editor-input[contenteditable="true"]
|
|
9
|
-
* Parameter: ${ MESSAGE } (Not used — daemon handles typing directly)
|
|
10
|
-
*/
|
|
11
|
-
(() => {
|
|
12
|
-
try {
|
|
13
|
-
const input = document.querySelector('.aislash-editor-input[contenteditable="true"]');
|
|
14
|
-
if (!input) return JSON.stringify({ sent: false, error: 'Input box not found' });
|
|
15
|
-
return JSON.stringify({
|
|
16
|
-
sent: false,
|
|
17
|
-
needsTypeAndSend: true,
|
|
18
|
-
selector: '.aislash-editor-input[contenteditable="true"]',
|
|
19
|
-
});
|
|
20
|
-
} catch(e) {
|
|
21
|
-
return JSON.stringify({ sent: false, error: e.message });
|
|
22
|
-
}
|
|
23
|
-
})()
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor — set_mode
|
|
3
|
-
*
|
|
4
|
-
* Select target mode from mode dropdown:
|
|
5
|
-
* 1. Open dropdown
|
|
6
|
-
* 2. Click matching item
|
|
7
|
-
*
|
|
8
|
-
* params.mode: string — Mode name
|
|
9
|
-
* → { success: true/false, mode? }
|
|
10
|
-
*/
|
|
11
|
-
async (params) => {
|
|
12
|
-
try {
|
|
13
|
-
const target = params.mode;
|
|
14
|
-
|
|
15
|
-
const modeBtn = document.querySelector('.composer-unified-dropdown:not(.composer-unified-dropdown-model)');
|
|
16
|
-
if (!modeBtn) return JSON.stringify({ success: false, error: 'Mode button not found' });
|
|
17
|
-
|
|
18
|
-
modeBtn.click();
|
|
19
|
-
await new Promise(r => setTimeout(r, 500));
|
|
20
|
-
|
|
21
|
-
const menu = document.querySelector('[data-testid="model-picker-menu"]') || document.querySelector('.typeahead-popover');
|
|
22
|
-
if (!menu) return JSON.stringify({ success: false, error: 'Mode menu not found' });
|
|
23
|
-
|
|
24
|
-
const items = menu.querySelectorAll('.composer-unified-context-menu-item');
|
|
25
|
-
for (const item of items) {
|
|
26
|
-
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
27
|
-
const name = nameEl?.textContent?.trim() || '';
|
|
28
|
-
if (name && (name === target || name.toLowerCase() === target.toLowerCase())) {
|
|
29
|
-
item.click();
|
|
30
|
-
await new Promise(r => setTimeout(r, 200));
|
|
31
|
-
return JSON.stringify({ success: true, mode: name });
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
36
|
-
return JSON.stringify({ success: false, error: 'mode not found: ' + target });
|
|
37
|
-
} catch(e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
38
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor — set_model
|
|
3
|
-
*
|
|
4
|
-
* Select target model from model dropdown:
|
|
5
|
-
* 1. Open dropdown
|
|
6
|
-
* 2. Turn off Auto toggle (if needed)
|
|
7
|
-
* 3. Filter via search input
|
|
8
|
-
* 4. Click matching item
|
|
9
|
-
* 5. Restore original Auto state
|
|
10
|
-
*
|
|
11
|
-
* params.model: string — Model name (🧠 may have suffix)
|
|
12
|
-
* → { success: true/false, model? }
|
|
13
|
-
*/
|
|
14
|
-
async (params) => {
|
|
15
|
-
try {
|
|
16
|
-
const target = params.model;
|
|
17
|
-
|
|
18
|
-
const modelBtn = document.querySelector('.composer-unified-dropdown-model');
|
|
19
|
-
if (!modelBtn) return JSON.stringify({ success: false, error: 'Model button not found' });
|
|
20
|
-
|
|
21
|
-
modelBtn.click();
|
|
22
|
-
await new Promise(r => setTimeout(r, 500));
|
|
23
|
-
|
|
24
|
-
const menu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
25
|
-
if (!menu) return JSON.stringify({ success: false, error: 'Model picker menu not found' });
|
|
26
|
-
|
|
27
|
-
// 🧠 Handle suffix
|
|
28
|
-
const wantBrain = target.includes('🧠');
|
|
29
|
-
const searchName = target.replace(/\s*🧠\s*$/, '').trim();
|
|
30
|
-
|
|
31
|
-
// Auto toggle turn off
|
|
32
|
-
const autoItem = menu.querySelector('.composer-unified-context-menu-item[data-is-selected="true"]');
|
|
33
|
-
const autoToggle = autoItem ? [...autoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24 && el.offsetHeight === 14) : null;
|
|
34
|
-
let wasAutoOn = false;
|
|
35
|
-
if (autoToggle) {
|
|
36
|
-
const bgStyle = autoToggle.getAttribute('style') || '';
|
|
37
|
-
wasAutoOn = bgStyle.includes('green');
|
|
38
|
-
if (wasAutoOn) {
|
|
39
|
-
autoToggle.click();
|
|
40
|
-
await new Promise(r => setTimeout(r, 500));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Filter via search input
|
|
45
|
-
const refreshedMenu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
46
|
-
const searchInput = refreshedMenu?.querySelector('input[placeholder="Search models"]');
|
|
47
|
-
if (searchInput) {
|
|
48
|
-
searchInput.focus();
|
|
49
|
-
searchInput.value = searchName;
|
|
50
|
-
searchInput.dispatchEvent(new Event('input', { bubbles: true }));
|
|
51
|
-
await new Promise(r => setTimeout(r, 300));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// from search
|
|
55
|
-
const items = (refreshedMenu || menu).querySelectorAll('.composer-unified-context-menu-item');
|
|
56
|
-
for (const item of items) {
|
|
57
|
-
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
58
|
-
const name = nameEl?.textContent?.trim() || '';
|
|
59
|
-
if (!name || name === 'Add Models') continue;
|
|
60
|
-
const hasBrain = !!item.querySelector('[class*="codicon-br"]');
|
|
61
|
-
|
|
62
|
-
if (name.toLowerCase().includes(searchName.toLowerCase()) && hasBrain === wantBrain) {
|
|
63
|
-
item.click();
|
|
64
|
-
await new Promise(r => setTimeout(r, 200));
|
|
65
|
-
const displayName = hasBrain ? name + ' 🧠' : name;
|
|
66
|
-
return JSON.stringify({ success: true, model: displayName });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Auto + close
|
|
71
|
-
if (wasAutoOn) {
|
|
72
|
-
const nm = document.querySelector('[data-testid="model-picker-menu"]');
|
|
73
|
-
const nai = nm?.querySelector('.composer-unified-context-menu-item');
|
|
74
|
-
const nt = nai ? [...nai.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24) : null;
|
|
75
|
-
if (nt) nt.click();
|
|
76
|
-
await new Promise(r => setTimeout(r, 200));
|
|
77
|
-
}
|
|
78
|
-
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
|
|
79
|
-
return JSON.stringify({ success: false, error: 'model not found: ' + target });
|
|
80
|
-
} catch(e) { return JSON.stringify({ success: false, error: e.message }); }
|
|
81
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor — switch_session
|
|
3
|
-
*
|
|
4
|
-
* by clicking Switch session:
|
|
5
|
-
* title matching (params.title) or index (params.index)
|
|
6
|
-
*
|
|
7
|
-
* params.index: number, params.title: string|null
|
|
8
|
-
* → { switched: true/false, title?, error? }
|
|
9
|
-
*/
|
|
10
|
-
(params) => {
|
|
11
|
-
try {
|
|
12
|
-
const cells = [...document.querySelectorAll('.agent-sidebar-cell')];
|
|
13
|
-
let target;
|
|
14
|
-
if (params.title) {
|
|
15
|
-
target = cells.find(c => {
|
|
16
|
-
const t = c.querySelector('.agent-sidebar-cell-text')?.textContent?.trim() || '';
|
|
17
|
-
return t.toLowerCase().includes(params.title.toLowerCase());
|
|
18
|
-
});
|
|
19
|
-
} else {
|
|
20
|
-
target = cells[params.index || 0];
|
|
21
|
-
}
|
|
22
|
-
if (!target) return JSON.stringify({ switched: false, error: 'Session not found', available: cells.length });
|
|
23
|
-
target.click();
|
|
24
|
-
return JSON.stringify({ switched: true, title: target.querySelector('.agent-sidebar-cell-text')?.textContent?.trim() });
|
|
25
|
-
} catch(e) {
|
|
26
|
-
return JSON.stringify({ switched: false, error: e.message });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "kiro",
|
|
3
|
-
"name": "Kiro",
|
|
4
|
-
"category": "ide",
|
|
5
|
-
"displayName": "Kiro",
|
|
6
|
-
"icon": "🪁",
|
|
7
|
-
"cli": "kiro",
|
|
8
|
-
"cdpPorts": [
|
|
9
|
-
9351,
|
|
10
|
-
9352
|
|
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": "Kiro",
|
|
21
|
-
"win32": [
|
|
22
|
-
"Kiro.exe"
|
|
23
|
-
],
|
|
24
|
-
"linux": [
|
|
25
|
-
"kiro"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"paths": {
|
|
29
|
-
"darwin": [
|
|
30
|
-
"/Applications/Kiro.app"
|
|
31
|
-
],
|
|
32
|
-
"win32": [
|
|
33
|
-
"C:\\Users\\*\\AppData\\Local\\Programs\\kiro\\Kiro.exe"
|
|
34
|
-
],
|
|
35
|
-
"linux": [
|
|
36
|
-
"/opt/kiro",
|
|
37
|
-
"/usr/share/kiro"
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
"inputMethod": "cdp-type-and-send",
|
|
41
|
-
"inputSelector": "[contenteditable=\"true\"][role=\"textbox\"]",
|
|
42
|
-
"settings": {
|
|
43
|
-
"approvalAlert": {
|
|
44
|
-
"type": "boolean",
|
|
45
|
-
"default": true,
|
|
46
|
-
"public": true,
|
|
47
|
-
"label": "Approval Notifications",
|
|
48
|
-
"description": "Show notification when approval is needed"
|
|
49
|
-
},
|
|
50
|
-
"longGeneratingAlert": {
|
|
51
|
-
"type": "boolean",
|
|
52
|
-
"default": true,
|
|
53
|
-
"public": true,
|
|
54
|
-
"label": "Long Generation Alert",
|
|
55
|
-
"description": "Alert when generation takes too long"
|
|
56
|
-
},
|
|
57
|
-
"longGeneratingThresholdSec": {
|
|
58
|
-
"type": "number",
|
|
59
|
-
"default": 180,
|
|
60
|
-
"public": true,
|
|
61
|
-
"label": "Long Generation Threshold (sec)",
|
|
62
|
-
"min": 30,
|
|
63
|
-
"max": 600
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"defaultScriptDir": "scripts/1.0",
|
|
67
|
-
"compatibility": []
|
|
68
|
-
}
|