@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,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor v1 — focus_editor
|
|
3
|
-
*
|
|
4
|
-
* CURSOR.md 4-5: Selector priority
|
|
5
|
-
* [contenteditable="true"][role="textbox"]
|
|
6
|
-
* → .chat-input textarea
|
|
7
|
-
* → .composer-input
|
|
8
|
-
* → textarea
|
|
9
|
-
*
|
|
10
|
-
* final Check: 2026-03-06
|
|
11
|
-
*/
|
|
12
|
-
(() => {
|
|
13
|
-
const editor = document.querySelector('[contenteditable="true"][role="textbox"]')
|
|
14
|
-
|| document.querySelector('.chat-input textarea')
|
|
15
|
-
|| document.querySelector('.composer-input')
|
|
16
|
-
|| document.querySelector('textarea.native-input')
|
|
17
|
-
|| document.querySelector('textarea');
|
|
18
|
-
if (editor) { editor.focus(); return 'focused'; }
|
|
19
|
-
return 'no editor found';
|
|
20
|
-
})()
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — open_panel
|
|
3
|
-
*
|
|
4
|
-
* Kiro AI chat panel open.
|
|
5
|
-
* Secondary Side Bar (#workbench.parts.auxiliarybar)located at.
|
|
6
|
-
* "Toggle Secondary Side Bar (⌥⌘B)" or "Kiro" via button open.
|
|
7
|
-
*
|
|
8
|
-
* Return: 'visible' | 'opened' | 'error: ...'
|
|
9
|
-
*/
|
|
10
|
-
(() => {
|
|
11
|
-
try {
|
|
12
|
-
// 1. if already open Check
|
|
13
|
-
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
14
|
-
if (sidebar && sidebar.offsetWidth > 0 && sidebar.offsetHeight > 0) {
|
|
15
|
-
return 'visible';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 2. Attempt to click toggle button
|
|
19
|
-
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
20
|
-
for (const btn of toggleBtns) {
|
|
21
|
-
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
22
|
-
if (label.includes('toggle secondary') || label.includes('toggle auxiliary') ||
|
|
23
|
-
label === 'kiro' || label.includes('kiro')) {
|
|
24
|
-
if (btn.offsetWidth > 0 || btn.offsetHeight > 0) {
|
|
25
|
-
btn.click();
|
|
26
|
-
return 'opened (toggle)';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// 3. Cmd+Shift+I shortcut fallback (Kiro default shortcut)
|
|
32
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
33
|
-
key: 'b', code: 'KeyB', keyCode: 66,
|
|
34
|
-
metaKey: true, altKey: true, ctrlKey: false,
|
|
35
|
-
bubbles: true, cancelable: true,
|
|
36
|
-
}));
|
|
37
|
-
document.dispatchEvent(new KeyboardEvent('keyup', {
|
|
38
|
-
key: 'b', code: 'KeyB', keyCode: 66,
|
|
39
|
-
metaKey: true, altKey: true, ctrlKey: false,
|
|
40
|
-
bubbles: true, cancelable: true,
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
return 'opened (⌥⌘B)';
|
|
44
|
-
} catch (e) {
|
|
45
|
-
return 'error: ' + e.message;
|
|
46
|
-
}
|
|
47
|
-
})()
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — resolve_action
|
|
3
|
-
*
|
|
4
|
-
* Find approve/reject buttons + coordinates Return.
|
|
5
|
-
* Kiroapproval dialog is displayed in main DOM.
|
|
6
|
-
*
|
|
7
|
-
* Parameter: ${ BUTTON_TEXT }
|
|
8
|
-
*/
|
|
9
|
-
(() => {
|
|
10
|
-
const want = ${ BUTTON_TEXT };
|
|
11
|
-
const wantNorm = (want || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
12
|
-
|
|
13
|
-
function norm(t) { return (t || '').replace(/\s+/g, ' ').trim().toLowerCase(); }
|
|
14
|
-
|
|
15
|
-
function matches(el) {
|
|
16
|
-
const t = norm(el.textContent);
|
|
17
|
-
if (!t || t.length > 80) return false;
|
|
18
|
-
if (t === wantNorm) return true;
|
|
19
|
-
if (t.indexOf(wantNorm) === 0) return true;
|
|
20
|
-
if (wantNorm.indexOf(t) >= 0 && t.length > 2) return true;
|
|
21
|
-
if (/^(run|approve|allow|accept|yes)\b/.test(wantNorm)) {
|
|
22
|
-
if (/^(run|allow|accept|approve)\b/.test(t)) return true;
|
|
23
|
-
}
|
|
24
|
-
if (/^(reject|deny|no|abort)\b/.test(wantNorm)) {
|
|
25
|
-
if (/^(reject|deny)\b/.test(t)) return true;
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const sel = 'button, [role="button"], .monaco-button';
|
|
31
|
-
const allBtns = [...document.querySelectorAll(sel)].filter(b => {
|
|
32
|
-
if (!b.offsetWidth || !b.getBoundingClientRect().height) return false;
|
|
33
|
-
const rect = b.getBoundingClientRect();
|
|
34
|
-
return rect.y > 0 && rect.y < window.innerHeight;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
let found = null;
|
|
38
|
-
for (let i = allBtns.length - 1; i >= 0; i--) {
|
|
39
|
-
if (matches(allBtns[i])) { found = allBtns[i]; break; }
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (found) {
|
|
43
|
-
const rect = found.getBoundingClientRect();
|
|
44
|
-
return JSON.stringify({
|
|
45
|
-
found: true,
|
|
46
|
-
text: found.textContent?.trim()?.substring(0, 40),
|
|
47
|
-
x: Math.round(rect.x + rect.width / 2),
|
|
48
|
-
y: Math.round(rect.y + rect.height / 2),
|
|
49
|
-
w: Math.round(rect.width),
|
|
50
|
-
h: Math.round(rect.height)
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return JSON.stringify({ found: false, want: wantNorm });
|
|
54
|
-
})()
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — send_message
|
|
3
|
-
*
|
|
4
|
-
* Kiro chat input is inside webview iframe, so direct access from main DOM is not possible.
|
|
5
|
-
* auxbar at the bottom of Input field calculate coordinates and return as clickCoords.
|
|
6
|
-
* CDP Input API click++Enter row.
|
|
7
|
-
*
|
|
8
|
-
* Parameter: ${ MESSAGE }
|
|
9
|
-
*/
|
|
10
|
-
(() => {
|
|
11
|
-
try {
|
|
12
|
-
const auxbar = document.getElementById('workbench.parts.auxiliarybar');
|
|
13
|
-
if (!auxbar || auxbar.offsetWidth === 0) {
|
|
14
|
-
return JSON.stringify({ sent: false, error: 'auxbar not found' });
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const rect = auxbar.getBoundingClientRect();
|
|
18
|
-
const x = Math.round(rect.x + rect.width / 2);
|
|
19
|
-
const y = Math.round(rect.y + rect.height - 80);
|
|
20
|
-
|
|
21
|
-
return JSON.stringify({
|
|
22
|
-
sent: false,
|
|
23
|
-
needsTypeAndSend: true,
|
|
24
|
-
clickCoords: { x, y },
|
|
25
|
-
});
|
|
26
|
-
} catch (e) {
|
|
27
|
-
return JSON.stringify({ sent: false, error: e.message });
|
|
28
|
-
}
|
|
29
|
-
})()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(() => { return document.documentElement.outerHTML; })()
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_list_models
|
|
3
|
-
*/
|
|
4
|
-
(async () => {
|
|
5
|
-
try {
|
|
6
|
-
const trigger = document.querySelector('.kiro-dropdown-trigger');
|
|
7
|
-
if (!trigger) {
|
|
8
|
-
return JSON.stringify({ models: [], current: 'Default', error: 'No dropdown found' });
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const current = (trigger.querySelector('.kiro-dropdown-selected-text')?.textContent || '').trim();
|
|
12
|
-
|
|
13
|
-
// Check if menu is already open
|
|
14
|
-
const wasExpanded = trigger.getAttribute('aria-expanded') === 'true';
|
|
15
|
-
|
|
16
|
-
if (!wasExpanded) {
|
|
17
|
-
trigger.click();
|
|
18
|
-
await new Promise(r => setTimeout(r, 150));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const models = [];
|
|
22
|
-
const items = document.querySelectorAll('.kiro-dropdown-item, [role="menuitem"], [role="option"]');
|
|
23
|
-
for (const item of items) {
|
|
24
|
-
const txt = (item.textContent || '').trim();
|
|
25
|
-
if (txt && txt.length < 50) {
|
|
26
|
-
models.push(txt);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Close menu
|
|
31
|
-
if (!wasExpanded) {
|
|
32
|
-
trigger.click();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return JSON.stringify({
|
|
36
|
-
models: [...new Set(models)],
|
|
37
|
-
current: current || 'Default'
|
|
38
|
-
});
|
|
39
|
-
} catch (e) {
|
|
40
|
-
return JSON.stringify({ models: [], current: '', error: e.message });
|
|
41
|
-
}
|
|
42
|
-
})()
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_list_modes
|
|
3
|
-
* Maps the Autopilot toggle to modes "Autopilot" and "Manual".
|
|
4
|
-
*/
|
|
5
|
-
(() => {
|
|
6
|
-
try {
|
|
7
|
-
const toggle = document.querySelector('#autonomy-mode-toggle-switch');
|
|
8
|
-
if (!toggle) {
|
|
9
|
-
// Fallback for older versions or if UI changed
|
|
10
|
-
return JSON.stringify({ modes: ['Default'], current: 'Default' });
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const isAutopilot = toggle.checked;
|
|
14
|
-
|
|
15
|
-
return JSON.stringify({
|
|
16
|
-
modes: ['Autopilot', 'Manual'],
|
|
17
|
-
current: isAutopilot ? 'Autopilot' : 'Manual'
|
|
18
|
-
});
|
|
19
|
-
} catch (e) {
|
|
20
|
-
return JSON.stringify({ modes: [], current: '', error: e.message });
|
|
21
|
-
}
|
|
22
|
-
})()
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_list_sessions (webview iframe runs inside)
|
|
3
|
-
*
|
|
4
|
-
* Kiro session list Return.
|
|
5
|
-
* DOM: .kiro-tabs-item
|
|
6
|
-
*/
|
|
7
|
-
(() => {
|
|
8
|
-
try {
|
|
9
|
-
const tabs = document.querySelectorAll('.kiro-tabs-item');
|
|
10
|
-
const sessions = Array.from(tabs).map((tab, i) => {
|
|
11
|
-
const label = tab.querySelector('.kiro-tabs-item-label');
|
|
12
|
-
const title = (label?.textContent || tab.textContent || '').trim();
|
|
13
|
-
const active = tab.classList.contains('active') ||
|
|
14
|
-
tab.getAttribute('aria-selected') === 'true';
|
|
15
|
-
return { id: String(i), title, active };
|
|
16
|
-
});
|
|
17
|
-
return JSON.stringify({ sessions });
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return JSON.stringify({ sessions: [], error: e.message });
|
|
20
|
-
}
|
|
21
|
-
})()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_new_session (webview iframe runs inside)
|
|
3
|
-
*
|
|
4
|
-
* "New Session" button/ click.
|
|
5
|
-
* Kiro + button or "New Session" .
|
|
6
|
-
*/
|
|
7
|
-
(() => {
|
|
8
|
-
try {
|
|
9
|
-
// kiro-icon-button (+ button) search
|
|
10
|
-
const addBtns = document.querySelectorAll('.kiro-icon-button, button, [role="button"]');
|
|
11
|
-
for (const btn of addBtns) {
|
|
12
|
-
const ariaLabel = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
13
|
-
const title = (btn.getAttribute('title') || '').toLowerCase();
|
|
14
|
-
if (ariaLabel.includes('new') || title.includes('new') ||
|
|
15
|
-
ariaLabel.includes('add') || title.includes('add')) {
|
|
16
|
-
btn.click();
|
|
17
|
-
return JSON.stringify({ created: true, method: 'button' });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Checkpoint > New Session area search
|
|
22
|
-
const allText = document.querySelectorAll('*');
|
|
23
|
-
for (const el of allText) {
|
|
24
|
-
if (el.children.length === 0 && (el.textContent || '').trim() === 'New Session') {
|
|
25
|
-
el.click();
|
|
26
|
-
return JSON.stringify({ created: true, method: 'text-click' });
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return JSON.stringify({ created: false, error: 'New Session button not found' });
|
|
31
|
-
} catch (e) {
|
|
32
|
-
return JSON.stringify({ created: false, error: e.message });
|
|
33
|
-
}
|
|
34
|
-
})()
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_read_chat (webview iframe runs inside)
|
|
3
|
-
*
|
|
4
|
-
* Kiro chat UI webview iframe located at,
|
|
5
|
-
* evaluateInWebviewFrame execute.
|
|
6
|
-
*
|
|
7
|
-
* DOM structure:
|
|
8
|
-
* .kiro-chat-timeline
|
|
9
|
-
* .kiro-chat-message (user/assistant messages)
|
|
10
|
-
* .kiro-chat-message-meta → .kiro-chat-message-role (sender)
|
|
11
|
-
* .kiro-chat-message-body → .kiro-chat-message-markdown (content)
|
|
12
|
-
*
|
|
13
|
-
* Return: ReadChatResult { id, status, messages, inputContent? }
|
|
14
|
-
*/
|
|
15
|
-
(() => {
|
|
16
|
-
try {
|
|
17
|
-
const messages = [];
|
|
18
|
-
const msgElements = document.querySelectorAll('.kiro-chat-message');
|
|
19
|
-
|
|
20
|
-
msgElements.forEach((msg, idx) => {
|
|
21
|
-
const roleMeta = msg.querySelector('.kiro-chat-message-role');
|
|
22
|
-
const roleText = (roleMeta?.textContent || '').trim();
|
|
23
|
-
const isKiro = roleText.toLowerCase().includes('kiro');
|
|
24
|
-
const role = isKiro ? 'assistant' : 'user';
|
|
25
|
-
|
|
26
|
-
let parts = [];
|
|
27
|
-
|
|
28
|
-
// A helper to traverse and build rough markdown
|
|
29
|
-
const parseNode = (node) => {
|
|
30
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
31
|
-
return node.nodeValue;
|
|
32
|
-
}
|
|
33
|
-
const tag = node.tagName?.toLowerCase();
|
|
34
|
-
if (!tag) return '';
|
|
35
|
-
|
|
36
|
-
// Kiro Thought / Tool executions
|
|
37
|
-
if (tag === 'div' && node.className.includes('kiro-thought')) {
|
|
38
|
-
const toggle = node.querySelector('.summary')?.textContent || 'thought';
|
|
39
|
-
const content = Array.from(node.querySelectorAll('.details')).map(n => n.textContent).join('\n');
|
|
40
|
-
parts.push({ kind: 'thought', content });
|
|
41
|
-
return `\n<details><summary>${toggle}</summary>\n${content}\n</details>\n`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Kiro Agent Outcomes (Terminal / Command)
|
|
45
|
-
if (tag === 'div' && node.className.includes('agent-outcome')) {
|
|
46
|
-
const label = (node.querySelector('.agent-outcome-label')?.textContent || '').toLowerCase();
|
|
47
|
-
const pre = node.querySelector('.agent-outcome-details pre, .agent-outcome-details code');
|
|
48
|
-
const codeContent = (pre?.textContent || '').trim();
|
|
49
|
-
if (codeContent) {
|
|
50
|
-
const kind = label.includes('command') || label.includes('terminal') ? 'terminal' : 'tool';
|
|
51
|
-
// Add directly to parts since this is a structured execution
|
|
52
|
-
parts.push({ kind, content: codeContent });
|
|
53
|
-
return `\n> [${kind}] ${codeContent}\n`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (tag === 'pre') {
|
|
58
|
-
const code = node.querySelector('code');
|
|
59
|
-
const lang = code?.className?.replace('language-', '') || '';
|
|
60
|
-
return `\n\`\`\`${lang}\n${node.textContent}\n\`\`\`\n`;
|
|
61
|
-
}
|
|
62
|
-
if (tag === 'code') {
|
|
63
|
-
return `\`${node.textContent}\``;
|
|
64
|
-
}
|
|
65
|
-
if (tag === 'table') {
|
|
66
|
-
let str = '\n';
|
|
67
|
-
const rows = Array.from(node.querySelectorAll('tr'));
|
|
68
|
-
rows.forEach((row, i) => {
|
|
69
|
-
const cells = Array.from(row.querySelectorAll('td, th')).map(c => c.textContent.trim());
|
|
70
|
-
str += '| ' + cells.join(' | ') + ' |\n';
|
|
71
|
-
if (i === 0 && row.querySelector('th')) {
|
|
72
|
-
str += '|' + cells.map(() => '---').join('|') + '|\n';
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return str + '\n';
|
|
76
|
-
}
|
|
77
|
-
if (tag === 'p') {
|
|
78
|
-
const text = Array.from(node.childNodes).map(parseNode).join('');
|
|
79
|
-
return text + '\n\n';
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Recursively parse children for span, div, etc
|
|
83
|
-
return Array.from(node.childNodes).map(parseNode).join('');
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const body = msg.querySelector('.kiro-chat-message-body');
|
|
87
|
-
let content = '';
|
|
88
|
-
if (body) {
|
|
89
|
-
// Parse the ENTIRE body recursively so we don't skip elements!
|
|
90
|
-
content = parseNode(body).trim();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Fallback content parsing if recursive failed
|
|
94
|
-
if (!content) {
|
|
95
|
-
content = body?.textContent?.trim() || '';
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (content) {
|
|
99
|
-
parts.push({ kind: 'text', content });
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (parts.length > 0) {
|
|
103
|
-
messages.push({ role, content: parts.map(p => p.content).join('\n'), parts });
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
// status detection activeModal extract
|
|
108
|
-
let status = 'idle';
|
|
109
|
-
let activeModal = undefined;
|
|
110
|
-
|
|
111
|
-
// "Working" / "Cancel" button → generating
|
|
112
|
-
const snackbar = document.querySelector('.kiro-snackbar');
|
|
113
|
-
if (snackbar && snackbar.offsetWidth > 0) {
|
|
114
|
-
const barText = (snackbar.textContent || '').toLowerCase();
|
|
115
|
-
if (barText.includes('working') || barText.includes('cancel')) {
|
|
116
|
-
status = 'generating';
|
|
117
|
-
} else if (barText.includes('waiting') || barText.includes('input')) {
|
|
118
|
-
// Waiting for approval (waiting on your input)
|
|
119
|
-
const titleEl = snackbar.querySelector('.kiro-snackbar-title, .thinking-text');
|
|
120
|
-
const actionsEl = snackbar.querySelectorAll('.kiro-snackbar-actions button');
|
|
121
|
-
const buttons = Array.from(actionsEl).map(b => (b.textContent || '').trim());
|
|
122
|
-
|
|
123
|
-
if (buttons.length > 0) {
|
|
124
|
-
activeModal = {
|
|
125
|
-
title: (titleEl?.textContent || '').trim(),
|
|
126
|
-
buttons,
|
|
127
|
-
type: 'approval'
|
|
128
|
-
};
|
|
129
|
-
status = 'waiting_approval';
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// If snackbar didn't catch it, fallback to Stop button checking
|
|
135
|
-
if (status === 'idle') {
|
|
136
|
-
const hasStopBtn = document.querySelector('.codicon-debug-stop, [aria-label*="stop" i], [title*="stop" i], [title*="cancel generation" i], .kiro-button[data-loading="true"]');
|
|
137
|
-
if (hasStopBtn) {
|
|
138
|
-
status = 'generating';
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Input field content
|
|
143
|
-
const input = document.querySelector('.tiptap.ProseMirror, [contenteditable="true"]');
|
|
144
|
-
const inputContent = input ? input.textContent?.trim() : '';
|
|
145
|
-
|
|
146
|
-
// session
|
|
147
|
-
const tab = document.querySelector('.kiro-tabs-item.active, .kiro-tabs-item[aria-selected="true"]');
|
|
148
|
-
const title = tab?.textContent?.trim() || '';
|
|
149
|
-
|
|
150
|
-
return JSON.stringify({
|
|
151
|
-
id: title || 'kiro-default',
|
|
152
|
-
status,
|
|
153
|
-
messages,
|
|
154
|
-
title: title || '',
|
|
155
|
-
inputContent: inputContent || '',
|
|
156
|
-
...(activeModal ? { activeModal } : {})
|
|
157
|
-
});
|
|
158
|
-
} catch (e) {
|
|
159
|
-
return JSON.stringify({ id: '', status: 'error', messages: [], error: e.message });
|
|
160
|
-
}
|
|
161
|
-
})()
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_resolve_action
|
|
3
|
-
* Kiro's approval dialog uses buttons in the kiro-snackbar.
|
|
4
|
-
* Parameter: ${ BUTTON_TEXT }
|
|
5
|
-
*/
|
|
6
|
-
(() => {
|
|
7
|
-
try {
|
|
8
|
-
const want = ${ BUTTON_TEXT };
|
|
9
|
-
const wantNorm = (want || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
10
|
-
|
|
11
|
-
function matches(el) {
|
|
12
|
-
const t = (el.textContent || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
13
|
-
if (!t) return false;
|
|
14
|
-
if (t === wantNorm || t.startsWith(wantNorm) || wantNorm.startsWith(t)) return true;
|
|
15
|
-
if (/^(run|approve|allow|accept|yes|trust)\b/.test(wantNorm)) {
|
|
16
|
-
if (/^(run|allow|accept|approve|trust)\b/.test(t)) return true;
|
|
17
|
-
}
|
|
18
|
-
if (/^(reject|deny|no|abort|cancel)\b/.test(wantNorm)) {
|
|
19
|
-
if (/^(reject|deny|cancel)\b/.test(t)) return true;
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const btns = Array.from(document.querySelectorAll('button, [role="button"]'));
|
|
25
|
-
let found = null;
|
|
26
|
-
for (const b of btns.slice().reverse()) {
|
|
27
|
-
const attrText = (b.getAttribute('title') || b.getAttribute('aria-label') || '').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
28
|
-
const hasPlay = b.querySelector('.codicon-play, .codicon-check') !== null;
|
|
29
|
-
const hasReject = b.querySelector('.codicon-chrome-close, .codicon-close') !== null;
|
|
30
|
-
|
|
31
|
-
// Check direct match
|
|
32
|
-
if (matches(b)) {
|
|
33
|
-
found = b;
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Checks for 'run/approve' intent
|
|
38
|
-
if (/^(run|approve|allow|accept|yes|trust)\b/.test(wantNorm)) {
|
|
39
|
-
if (hasPlay || attrText.includes('run') || attrText.includes('approve') || attrText.includes('allow') || attrText.includes('trust')) {
|
|
40
|
-
found = b;
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Checks for 'reject/deny/cancel' intent
|
|
46
|
-
if (/^(reject|deny|no|abort|cancel)\b/.test(wantNorm)) {
|
|
47
|
-
if (hasReject || attrText.includes('reject') || attrText.includes('deny') || attrText.includes('cancel')) {
|
|
48
|
-
found = b;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (found) {
|
|
55
|
-
found.click();
|
|
56
|
-
return JSON.stringify({ resolved: true, method: 'webview_button_click' });
|
|
57
|
-
}
|
|
58
|
-
return JSON.stringify({ resolved: false, want: wantNorm, error: 'Button not found' });
|
|
59
|
-
} catch (e) {
|
|
60
|
-
return JSON.stringify({ resolved: false, error: e.message });
|
|
61
|
-
}
|
|
62
|
-
})()
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_send_message (webview iframe runs inside)
|
|
3
|
-
*
|
|
4
|
-
* Kiro chat input webview iframe ProseMirror/tiptap editor.
|
|
5
|
-
* execCommand('insertText') + Enter via key event Send message.
|
|
6
|
-
*
|
|
7
|
-
* Parameter: ${ MESSAGE }
|
|
8
|
-
*/
|
|
9
|
-
(async () => {
|
|
10
|
-
try {
|
|
11
|
-
const msg = ${ MESSAGE };
|
|
12
|
-
|
|
13
|
-
// ─── 1. Find input field ───
|
|
14
|
-
const editor =
|
|
15
|
-
document.querySelector('.tiptap.ProseMirror') ||
|
|
16
|
-
document.querySelector('[contenteditable="true"]') ||
|
|
17
|
-
document.querySelector('textarea');
|
|
18
|
-
|
|
19
|
-
if (!editor) return JSON.stringify({ sent: false, error: 'no input found in webview' });
|
|
20
|
-
|
|
21
|
-
const isTextarea = editor.tagName === 'TEXTAREA';
|
|
22
|
-
|
|
23
|
-
if (isTextarea) {
|
|
24
|
-
editor.focus();
|
|
25
|
-
const nativeSetter = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value')?.set;
|
|
26
|
-
if (nativeSetter) nativeSetter.call(editor, msg);
|
|
27
|
-
else editor.value = msg;
|
|
28
|
-
editor.dispatchEvent(new Event('input', { bubbles: true }));
|
|
29
|
-
await new Promise(r => setTimeout(r, 300));
|
|
30
|
-
|
|
31
|
-
const enterOpts = { key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true, cancelable: true, composed: true };
|
|
32
|
-
editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
|
|
33
|
-
editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
|
|
34
|
-
editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
|
|
35
|
-
return JSON.stringify({ sent: true });
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ─── 2. contenteditable (ProseMirror / tiptap) ───
|
|
39
|
-
editor.focus();
|
|
40
|
-
await new Promise(r => setTimeout(r, 100));
|
|
41
|
-
|
|
42
|
-
// all Select + delete + insert
|
|
43
|
-
const sel = window.getSelection();
|
|
44
|
-
const range = document.createRange();
|
|
45
|
-
range.selectNodeContents(editor);
|
|
46
|
-
sel.removeAllRanges();
|
|
47
|
-
sel.addRange(range);
|
|
48
|
-
await new Promise(r => setTimeout(r, 50));
|
|
49
|
-
|
|
50
|
-
document.execCommand('delete', false, null);
|
|
51
|
-
await new Promise(r => setTimeout(r, 50));
|
|
52
|
-
document.execCommand('insertText', false, msg);
|
|
53
|
-
|
|
54
|
-
editor.dispatchEvent(new Event('input', { bubbles: true }));
|
|
55
|
-
await new Promise(r => setTimeout(r, 400));
|
|
56
|
-
|
|
57
|
-
// ─── 3. button click (Enter ) ───
|
|
58
|
-
const sendBtns = Array.from(document.querySelectorAll('button, div[role="button"], span[role="button"]'))
|
|
59
|
-
.filter(b => {
|
|
60
|
-
const aria = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
61
|
-
const title = (b.getAttribute('title') || '').toLowerCase();
|
|
62
|
-
const text = (b.textContent || '').toLowerCase();
|
|
63
|
-
const className = (b.className || '').toLowerCase();
|
|
64
|
-
return aria.includes('send') || aria.includes('submit') ||
|
|
65
|
-
title.includes('send') || title.includes('submit') ||
|
|
66
|
-
className.includes('send') || className.includes('submit') ||
|
|
67
|
-
b.querySelector('svg'); // Fallback for icon-only buttons next to input
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// Find the button closest to the editor
|
|
71
|
-
let submitBtn = null;
|
|
72
|
-
if (sendBtns.length > 0) {
|
|
73
|
-
// grab the one visually right/bottom to the editor, or just the last svg button
|
|
74
|
-
submitBtn = sendBtns[sendBtns.length - 1];
|
|
75
|
-
submitBtn.click();
|
|
76
|
-
await new Promise(r => setTimeout(r, 100));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ─── 4. Enter key sending (Fallback) ───
|
|
80
|
-
const enterOpts = {
|
|
81
|
-
key: 'Enter', code: 'Enter',
|
|
82
|
-
keyCode: 13, which: 13,
|
|
83
|
-
bubbles: true, cancelable: true, composed: true,
|
|
84
|
-
};
|
|
85
|
-
editor.dispatchEvent(new KeyboardEvent('keydown', enterOpts));
|
|
86
|
-
await new Promise(r => setTimeout(r, 50));
|
|
87
|
-
editor.dispatchEvent(new KeyboardEvent('keypress', enterOpts));
|
|
88
|
-
editor.dispatchEvent(new KeyboardEvent('keyup', enterOpts));
|
|
89
|
-
|
|
90
|
-
return JSON.stringify({ sent: true });
|
|
91
|
-
} catch (e) {
|
|
92
|
-
return JSON.stringify({ sent: false, error: e.message });
|
|
93
|
-
}
|
|
94
|
-
})()
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kiro — webview_set_mode
|
|
3
|
-
* Toggles the Autopilot switch based on requested mode.
|
|
4
|
-
* Parameter: ${ MODE }
|
|
5
|
-
*/
|
|
6
|
-
(() => {
|
|
7
|
-
try {
|
|
8
|
-
const mode = ${ MODE };
|
|
9
|
-
if (!mode) return JSON.stringify({ success: false, error: 'No mode specified' });
|
|
10
|
-
|
|
11
|
-
const toggle = document.querySelector('#autonomy-mode-toggle-switch');
|
|
12
|
-
if (!toggle) {
|
|
13
|
-
return JSON.stringify({ success: false, error: 'Autonomy toggle not found' });
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const isAutopilot = toggle.checked;
|
|
17
|
-
|
|
18
|
-
const wantAutopilot = mode.toLowerCase() === 'autopilot';
|
|
19
|
-
const wantManual = mode.toLowerCase() === 'manual';
|
|
20
|
-
|
|
21
|
-
if (wantAutopilot && !isAutopilot) {
|
|
22
|
-
toggle.click();
|
|
23
|
-
return JSON.stringify({ success: true });
|
|
24
|
-
} else if (wantManual && isAutopilot) {
|
|
25
|
-
toggle.click();
|
|
26
|
-
return JSON.stringify({ success: true });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Already in the right mode
|
|
30
|
-
return JSON.stringify({ success: true });
|
|
31
|
-
} catch (e) {
|
|
32
|
-
return JSON.stringify({ success: false, error: e.message });
|
|
33
|
-
}
|
|
34
|
-
})()
|