@adhdev/daemon-core 0.6.53 → 0.6.56
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 +84 -34
- package/dist/index.js +631 -305
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/providers/_builtin/_helpers/index.js +26 -26
- package/providers/_builtin/cli/aider-cli/provider.json +37 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/parse_output.js +49 -0
- package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/claude-cli/provider.json +9 -2
- package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +31 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +38 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +164 -0
- package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +42 -0
- package/providers/_builtin/cli/codex-cli/provider.json +9 -2
- package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +15 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +68 -0
- package/providers/_builtin/cli/codex-cli/scripts/1.0/scripts.js +11 -0
- package/providers/_builtin/cli/cursor-cli/provider.json +37 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/detect_status.js +19 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/cursor-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/gemini-cli/provider.json +9 -2
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/detect_status.js +26 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_approval.js +22 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/parse_output.js +71 -0
- package/providers/_builtin/cli/gemini-cli/scripts/1.0/scripts.js +12 -0
- package/providers/_builtin/cli/github-copilot-cli/provider.json +37 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/detect_status.js +19 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_approval.js +9 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/github-copilot-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/goose-cli/provider.json +37 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/detect_status.js +20 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_approval.js +10 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/goose-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/cli/opencode-cli/provider.json +37 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/detect_status.js +15 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_approval.js +9 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/parse_output.js +48 -0
- package/providers/_builtin/cli/opencode-cli/scripts/1.0/scripts.js +7 -0
- package/providers/_builtin/extension/cline/scripts/1.0/focus_editor.js +5 -5
- package/providers/_builtin/extension/cline/scripts/1.0/list_chats.js +11 -11
- package/providers/_builtin/extension/cline/scripts/1.0/list_models.js +6 -6
- package/providers/_builtin/extension/cline/scripts/1.0/list_modes.js +5 -5
- package/providers/_builtin/extension/cline/scripts/1.0/new_session.js +12 -12
- package/providers/_builtin/extension/cline/scripts/1.0/open_panel.js +7 -7
- package/providers/_builtin/extension/cline/scripts/1.0/read_chat.js +29 -29
- package/providers/_builtin/extension/cline/scripts/1.0/resolve_action.js +19 -19
- package/providers/_builtin/extension/cline/scripts/1.0/send_message.js +15 -15
- package/providers/_builtin/extension/cline/scripts/1.0/set_mode.js +4 -4
- package/providers/_builtin/extension/cline/scripts/1.0/set_model.js +4 -4
- package/providers/_builtin/extension/cline/scripts/1.0/switch_session.js +21 -21
- package/providers/_builtin/extension/codex/scripts/1.0/explore_controls_webview.js +2 -2
- package/providers/_builtin/extension/codex/scripts/1.0/list_models.js +1 -1
- package/providers/_builtin/extension/codex/scripts/1.0/list_modes.js +1 -1
- package/providers/_builtin/extension/codex/scripts/1.0/new_session.js +2 -2
- package/providers/_builtin/extension/codex/scripts/1.0/read_chat.js +6 -6
- package/providers/_builtin/extension/codex/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/extension/codex/scripts/1.0/set_model.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_chats.js +19 -19
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_models.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/list_modes.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/new_session.js +17 -17
- package/providers/_builtin/ide/antigravity/scripts/1.0/read_chat.js +41 -41
- package/providers/_builtin/ide/antigravity/scripts/1.0/resolve_action.js +6 -6
- package/providers/_builtin/ide/antigravity/scripts/1.0/send_message.js +13 -13
- package/providers/_builtin/ide/antigravity/scripts/1.0/set_model.js +1 -1
- package/providers/_builtin/ide/antigravity/scripts/1.0/switch_session.js +13 -13
- package/providers/_builtin/ide/cursor/scripts/1.0/dismiss_notification.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/1.0/focus_editor.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/1.0/list_models.js +12 -12
- package/providers/_builtin/ide/cursor/scripts/1.0/list_modes.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/list_notifications.js +2 -2
- package/providers/_builtin/ide/cursor/scripts/1.0/list_sessions.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/new_session.js +1 -1
- package/providers/_builtin/ide/cursor/scripts/1.0/open_panel.js +3 -3
- package/providers/_builtin/ide/cursor/scripts/1.0/read_chat.js +9 -9
- package/providers/_builtin/ide/cursor/scripts/1.0/resolve_action.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/1.0/send_message.js +5 -5
- package/providers/_builtin/ide/cursor/scripts/1.0/set_mode.js +4 -4
- package/providers/_builtin/ide/cursor/scripts/1.0/set_model.js +12 -12
- package/providers/_builtin/ide/cursor/scripts/1.0/switch_session.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/open_panel.js +7 -7
- package/providers/_builtin/ide/kiro/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/ide/kiro/scripts/1.0/send_message.js +4 -4
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_list_sessions.js +2 -2
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_new_session.js +5 -5
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_read_chat.js +13 -13
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_resolve_action.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_send_message.js +8 -8
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_mode.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_set_model.js +1 -1
- package/providers/_builtin/ide/kiro/scripts/1.0/webview_switch_session.js +3 -3
- package/providers/_builtin/ide/pearai/.tmp/after_rich.json +157 -0
- package/providers/_builtin/ide/pearai/.tmp/after_rich_raw.json +161 -0
- package/providers/_builtin/ide/pearai/.tmp/after_switch.json +592 -0
- package/providers/_builtin/ide/pearai/.tmp/after_switch_raw.json +596 -0
- package/providers/_builtin/ide/pearai/.tmp/home_dump_raw.json +176 -0
- package/providers/_builtin/ide/pearai/.tmp/items_raw.json +778 -0
- package/providers/_builtin/ide/pearai/.tmp/webview_dump.json +157 -0
- package/providers/_builtin/ide/pearai/.tmp/webview_dump_raw.json +161 -0
- package/providers/_builtin/ide/pearai/provider.json +1 -3
- package/providers/_builtin/ide/pearai/scripts/1.0/focus_editor.js +12 -16
- package/providers/_builtin/ide/pearai/scripts/1.0/list_models.js +45 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/list_modes.js +44 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/list_sessions.js +82 -27
- package/providers/_builtin/ide/pearai/scripts/1.0/new_session.js +26 -43
- package/providers/_builtin/ide/pearai/scripts/1.0/open_panel.js +10 -33
- package/providers/_builtin/ide/pearai/scripts/1.0/read_chat.js +169 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/resolve_action.js +47 -41
- package/providers/_builtin/ide/pearai/scripts/1.0/scripts.js +36 -7
- package/providers/_builtin/ide/pearai/scripts/1.0/send_message.js +97 -22
- package/providers/_builtin/ide/pearai/scripts/1.0/set_mode.js +51 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/set_model.js +54 -0
- package/providers/_builtin/ide/pearai/scripts/1.0/switch_session.js +81 -0
- package/providers/_builtin/ide/trae/scripts/1.0/focus_editor.js +2 -2
- package/providers/_builtin/ide/trae/scripts/1.0/list_chats.js +2 -2
- package/providers/_builtin/ide/trae/scripts/1.0/new_session.js +4 -4
- package/providers/_builtin/ide/trae/scripts/1.0/open_panel.js +6 -6
- package/providers/_builtin/ide/trae/scripts/1.0/read_chat.js +13 -13
- package/providers/_builtin/ide/trae/scripts/1.0/resolve_action.js +3 -3
- package/providers/_builtin/ide/trae/scripts/1.0/send_message.js +11 -11
- package/providers/_builtin/ide/trae/scripts/1.0/switch_session.js +2 -2
- package/providers/_builtin/ide/windsurf/scripts/1.0/focus_editor.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_chats.js +4 -4
- package/providers/_builtin/ide/windsurf/scripts/1.0/list_sessions.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/new_session.js +9 -9
- package/providers/_builtin/ide/windsurf/scripts/1.0/open_panel.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0/resolve_action.js +8 -8
- package/providers/_builtin/ide/windsurf/scripts/1.0/switch_session.js +8 -8
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/focus_editor.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/list_chats.js +12 -12
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/new_session.js +15 -15
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/open_panel.js +10 -10
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/read_chat.js +33 -33
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/resolve_action.js +6 -6
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/send_message.js +16 -16
- package/providers/_builtin/ide/windsurf/scripts/1.0.bak/switch_session.js +7 -7
- package/providers/_builtin/registry.json +76 -3
- package/src/cli-adapters/provider-cli-adapter.ts +312 -258
- package/src/cli-adapters/terminal-screen.ts +95 -0
- package/src/commands/chat-commands.ts +41 -15
- package/src/commands/cli-manager.ts +4 -2
- package/src/daemon/dev-server.ts +306 -62
- package/src/providers/acp-provider-instance.ts +1 -1
- package/src/providers/cli-provider-instance.ts +23 -9
- package/src/providers/provider-loader.ts +3 -2
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_models.js +0 -43
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_modes.js +0 -35
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_list_sessions.js +0 -62
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_new_session.js +0 -49
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_read_chat.js +0 -92
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_resolve_action.js +0 -59
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_send_message.js +0 -72
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_set_mode.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_set_model.js +0 -36
- package/providers/_builtin/ide/pearai/scripts/1.0/webview_switch_session.js +0 -34
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — list_sessions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Parse sessions from sidebar cell list:
|
|
5
|
+
* Cell: .agent-sidebar-cell
|
|
6
|
+
* Title: .agent-sidebar-cell-text
|
|
7
|
+
* Selection state: data-selected="true"
|
|
8
|
+
* Active ID: [data-composer-id]extracted from
|
|
9
9
|
*
|
|
10
10
|
* → { sessions: [{ id, title, active, index }] }
|
|
11
11
|
*/
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — read_chat (v2 — thoughts, tools, terminal, DOM-ordered)
|
|
3
3
|
*
|
|
4
|
-
* DOM
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* AI
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
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
12
|
* Diff: .composer-diff-block (code changes)
|
|
13
|
-
*
|
|
13
|
+
* Approval: .run-command-review-active + button/cursor-pointer elements
|
|
14
14
|
*
|
|
15
15
|
* → { id, status, title, messages[], inputContent, activeModal }
|
|
16
16
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — resolve_action
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* approval/ button search + click:
|
|
5
|
+
* button, [role="button"], .cursor-pointer text matching
|
|
6
|
+
* Cursor (e.g. "Run⏎", "SkipEsc") → ⏎↵ remove then compare
|
|
7
7
|
*
|
|
8
|
-
* params.buttonText: string —
|
|
8
|
+
* params.buttonText: string — to find button text
|
|
9
9
|
* → { resolved: true/false, clicked?, available? }
|
|
10
10
|
*/
|
|
11
11
|
(params) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — send_message
|
|
3
3
|
*
|
|
4
|
-
* Cursor
|
|
5
|
-
* 1.
|
|
6
|
-
* 2. needsTypeAndSend: true
|
|
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
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Input selector: .aislash-editor-input[contenteditable="true"]
|
|
9
|
+
* Parameter: ${ MESSAGE } (Not used — daemon handles typing directly)
|
|
10
10
|
*/
|
|
11
11
|
(() => {
|
|
12
12
|
try {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — set_mode
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1.
|
|
6
|
-
* 2.
|
|
4
|
+
* Select target mode from mode dropdown:
|
|
5
|
+
* 1. Open dropdown
|
|
6
|
+
* 2. Click matching item
|
|
7
7
|
*
|
|
8
|
-
* params.mode: string —
|
|
8
|
+
* params.mode: string — Mode name
|
|
9
9
|
* → { success: true/false, mode? }
|
|
10
10
|
*/
|
|
11
11
|
async (params) => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — set_model
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 1.
|
|
6
|
-
* 2. Auto
|
|
7
|
-
* 3.
|
|
8
|
-
* 4.
|
|
9
|
-
* 5.
|
|
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
10
|
*
|
|
11
|
-
* params.model: string —
|
|
11
|
+
* params.model: string — Model name (🧠 may have suffix)
|
|
12
12
|
* → { success: true/false, model? }
|
|
13
13
|
*/
|
|
14
14
|
async (params) => {
|
|
@@ -24,11 +24,11 @@ async (params) => {
|
|
|
24
24
|
const menu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
25
25
|
if (!menu) return JSON.stringify({ success: false, error: 'Model picker menu not found' });
|
|
26
26
|
|
|
27
|
-
// 🧠
|
|
27
|
+
// 🧠 Handle suffix
|
|
28
28
|
const wantBrain = target.includes('🧠');
|
|
29
29
|
const searchName = target.replace(/\s*🧠\s*$/, '').trim();
|
|
30
30
|
|
|
31
|
-
// Auto
|
|
31
|
+
// Auto toggle turn off
|
|
32
32
|
const autoItem = menu.querySelector('.composer-unified-context-menu-item[data-is-selected="true"]');
|
|
33
33
|
const autoToggle = autoItem ? [...autoItem.querySelectorAll('[class*="rounded-full"]')].find(el => el.offsetWidth === 24 && el.offsetHeight === 14) : null;
|
|
34
34
|
let wasAutoOn = false;
|
|
@@ -41,7 +41,7 @@ async (params) => {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
// Filter via search input
|
|
45
45
|
const refreshedMenu = document.querySelector('[data-testid="model-picker-menu"]');
|
|
46
46
|
const searchInput = refreshedMenu?.querySelector('input[placeholder="Search models"]');
|
|
47
47
|
if (searchInput) {
|
|
@@ -51,7 +51,7 @@ async (params) => {
|
|
|
51
51
|
await new Promise(r => setTimeout(r, 300));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
// from search
|
|
55
55
|
const items = (refreshedMenu || menu).querySelectorAll('.composer-unified-context-menu-item');
|
|
56
56
|
for (const item of items) {
|
|
57
57
|
const nameEl = item.querySelector('.monaco-highlighted-label');
|
|
@@ -67,7 +67,7 @@ async (params) => {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
// Auto + close
|
|
71
71
|
if (wasAutoOn) {
|
|
72
72
|
const nm = document.querySelector('[data-testid="model-picker-menu"]');
|
|
73
73
|
const nai = nm?.querySelector('.composer-unified-context-menu-item');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor — switch_session
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* by clicking Switch session:
|
|
5
|
+
* title matching (params.title) or index (params.index)
|
|
6
6
|
*
|
|
7
7
|
* params.index: number, params.title: string|null
|
|
8
8
|
* → { switched: true/false, title?, error? }
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cursor v1 — focus_editor
|
|
3
3
|
*
|
|
4
|
-
* CURSOR.md 4-5:
|
|
4
|
+
* CURSOR.md 4-5: Selector priority
|
|
5
5
|
* [contenteditable="true"][role="textbox"]
|
|
6
6
|
* → .chat-input textarea
|
|
7
7
|
* → .composer-input
|
|
8
8
|
* → textarea
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* final Check: 2026-03-06
|
|
11
11
|
*/
|
|
12
12
|
(() => {
|
|
13
13
|
const editor = document.querySelector('[contenteditable="true"][role="textbox"]')
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kiro — open_panel
|
|
3
3
|
*
|
|
4
|
-
* Kiro AI
|
|
5
|
-
* Secondary Side Bar (#workbench.parts.auxiliarybar)
|
|
6
|
-
* "Toggle Secondary Side Bar (⌥⌘B)"
|
|
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
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Return: 'visible' | 'opened' | 'error: ...'
|
|
9
9
|
*/
|
|
10
10
|
(() => {
|
|
11
11
|
try {
|
|
12
|
-
// 1.
|
|
12
|
+
// 1. if already open Check
|
|
13
13
|
const sidebar = document.getElementById('workbench.parts.auxiliarybar');
|
|
14
14
|
if (sidebar && sidebar.offsetWidth > 0 && sidebar.offsetHeight > 0) {
|
|
15
15
|
return 'visible';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// 2.
|
|
18
|
+
// 2. Attempt to click toggle button
|
|
19
19
|
const toggleBtns = Array.from(document.querySelectorAll('li.action-item a, button, [role="button"]'));
|
|
20
20
|
for (const btn of toggleBtns) {
|
|
21
21
|
const label = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
// 3. Cmd+Shift+I
|
|
31
|
+
// 3. Cmd+Shift+I shortcut fallback (Kiro default shortcut)
|
|
32
32
|
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
33
33
|
key: 'b', code: 'KeyB', keyCode: 66,
|
|
34
34
|
metaKey: true, altKey: true, ctrlKey: false,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kiro — resolve_action
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Find approve/reject buttons + coordinates Return.
|
|
5
|
+
* Kiroapproval dialog is displayed in main DOM.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Parameter: ${ BUTTON_TEXT }
|
|
8
8
|
*/
|
|
9
9
|
(() => {
|
|
10
10
|
const want = ${ BUTTON_TEXT };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Kiro — send_message
|
|
3
3
|
*
|
|
4
|
-
* Kiro
|
|
5
|
-
* auxbar
|
|
6
|
-
*
|
|
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
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* Parameter: ${ MESSAGE }
|
|
9
9
|
*/
|
|
10
10
|
(() => {
|
|
11
11
|
try {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Kiro — webview_new_session (webview iframe
|
|
2
|
+
* Kiro — webview_new_session (webview iframe runs inside)
|
|
3
3
|
*
|
|
4
|
-
* "New Session"
|
|
5
|
-
* Kiro
|
|
4
|
+
* "New Session" button/ click.
|
|
5
|
+
* Kiro + button or "New Session" .
|
|
6
6
|
*/
|
|
7
7
|
(() => {
|
|
8
8
|
try {
|
|
9
|
-
// kiro-icon-button (+
|
|
9
|
+
// kiro-icon-button (+ button) search
|
|
10
10
|
const addBtns = document.querySelectorAll('.kiro-icon-button, button, [role="button"]');
|
|
11
11
|
for (const btn of addBtns) {
|
|
12
12
|
const ariaLabel = (btn.getAttribute('aria-label') || '').toLowerCase();
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
// Checkpoint > New Session
|
|
21
|
+
// Checkpoint > New Session area search
|
|
22
22
|
const allText = document.querySelectorAll('*');
|
|
23
23
|
for (const el of allText) {
|
|
24
24
|
if (el.children.length === 0 && (el.textContent || '').trim() === 'New Session') {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Kiro — webview_read_chat (webview iframe
|
|
2
|
+
* Kiro — webview_read_chat (webview iframe runs inside)
|
|
3
3
|
*
|
|
4
|
-
* Kiro
|
|
5
|
-
*
|
|
4
|
+
* Kiro chat UI webview iframe located at,
|
|
5
|
+
* evaluateInWebviewFrame execute.
|
|
6
6
|
*
|
|
7
|
-
* DOM
|
|
7
|
+
* DOM structure:
|
|
8
8
|
* .kiro-chat-timeline
|
|
9
|
-
* .kiro-chat-message (
|
|
10
|
-
* .kiro-chat-message-meta → .kiro-chat-message-role (
|
|
11
|
-
* .kiro-chat-message-body → .kiro-chat-message-markdown (
|
|
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
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Return: ReadChatResult { id, status, messages, inputContent? }
|
|
14
14
|
*/
|
|
15
15
|
(() => {
|
|
16
16
|
try {
|
|
@@ -104,18 +104,18 @@
|
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
// status detection activeModal extract
|
|
108
108
|
let status = 'idle';
|
|
109
109
|
let activeModal = undefined;
|
|
110
110
|
|
|
111
|
-
// "Working" / "Cancel"
|
|
111
|
+
// "Working" / "Cancel" button → generating
|
|
112
112
|
const snackbar = document.querySelector('.kiro-snackbar');
|
|
113
113
|
if (snackbar && snackbar.offsetWidth > 0) {
|
|
114
114
|
const barText = (snackbar.textContent || '').toLowerCase();
|
|
115
115
|
if (barText.includes('working') || barText.includes('cancel')) {
|
|
116
116
|
status = 'generating';
|
|
117
117
|
} else if (barText.includes('waiting') || barText.includes('input')) {
|
|
118
|
-
//
|
|
118
|
+
// Waiting for approval (waiting on your input)
|
|
119
119
|
const titleEl = snackbar.querySelector('.kiro-snackbar-title, .thinking-text');
|
|
120
120
|
const actionsEl = snackbar.querySelectorAll('.kiro-snackbar-actions button');
|
|
121
121
|
const buttons = Array.from(actionsEl).map(b => (b.textContent || '').trim());
|
|
@@ -139,11 +139,11 @@
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
//
|
|
142
|
+
// Input field content
|
|
143
143
|
const input = document.querySelector('.tiptap.ProseMirror, [contenteditable="true"]');
|
|
144
144
|
const inputContent = input ? input.textContent?.trim() : '';
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
// session
|
|
147
147
|
const tab = document.querySelector('.kiro-tabs-item.active, .kiro-tabs-item[aria-selected="true"]');
|
|
148
148
|
const title = tab?.textContent?.trim() || '';
|
|
149
149
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Kiro — webview_send_message (webview iframe
|
|
2
|
+
* Kiro — webview_send_message (webview iframe runs inside)
|
|
3
3
|
*
|
|
4
|
-
* Kiro
|
|
5
|
-
* execCommand('insertText') + Enter
|
|
4
|
+
* Kiro chat input webview iframe ProseMirror/tiptap editor.
|
|
5
|
+
* execCommand('insertText') + Enter via key event Send message.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Parameter: ${ MESSAGE }
|
|
8
8
|
*/
|
|
9
9
|
(async () => {
|
|
10
10
|
try {
|
|
11
11
|
const msg = ${ MESSAGE };
|
|
12
12
|
|
|
13
|
-
// ─── 1.
|
|
13
|
+
// ─── 1. Find input field ───
|
|
14
14
|
const editor =
|
|
15
15
|
document.querySelector('.tiptap.ProseMirror') ||
|
|
16
16
|
document.querySelector('[contenteditable="true"]') ||
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
editor.focus();
|
|
40
40
|
await new Promise(r => setTimeout(r, 100));
|
|
41
41
|
|
|
42
|
-
//
|
|
42
|
+
// all Select + delete + insert
|
|
43
43
|
const sel = window.getSelection();
|
|
44
44
|
const range = document.createRange();
|
|
45
45
|
range.selectNodeContents(editor);
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
editor.dispatchEvent(new Event('input', { bubbles: true }));
|
|
55
55
|
await new Promise(r => setTimeout(r, 400));
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
// ─── 3. button click (Enter ) ───
|
|
58
58
|
const sendBtns = Array.from(document.querySelectorAll('button, div[role="button"], span[role="button"]'))
|
|
59
59
|
.filter(b => {
|
|
60
60
|
const aria = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
await new Promise(r => setTimeout(r, 100));
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
// ─── 4. Enter
|
|
79
|
+
// ─── 4. Enter key sending (Fallback) ───
|
|
80
80
|
const enterOpts = {
|
|
81
81
|
key: 'Enter', code: 'Enter',
|
|
82
82
|
keyCode: 13, which: 13,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Kiro — webview_switch_session (webview iframe
|
|
2
|
+
* Kiro — webview_switch_session (webview iframe runs inside)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* session by clicking .
|
|
5
|
+
* Parameter: ${ SESSION_ID } ( index)
|
|
6
6
|
*/
|
|
7
7
|
(() => {
|
|
8
8
|
try {
|