@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,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex Extension — Chat View DOM Explorer
|
|
3
|
-
* Run after clicking into a conversation to see message structure
|
|
4
|
-
*/
|
|
5
|
-
(() => {
|
|
6
|
-
try {
|
|
7
|
-
const root = document.getElementById('root');
|
|
8
|
-
if (!root) return JSON.stringify({ error: 'no root' });
|
|
9
|
-
|
|
10
|
-
// Header info
|
|
11
|
-
const headerEl = document.querySelector('[style*="view-transition-name: header-title"]');
|
|
12
|
-
const headerText = headerEl?.textContent?.trim() || '';
|
|
13
|
-
|
|
14
|
-
// Find thread/message area (look for common React patterns)
|
|
15
|
-
// Codex uses React + ProseMirror
|
|
16
|
-
const allDivs = document.querySelectorAll('div');
|
|
17
|
-
|
|
18
|
-
// Find message containers by looking for role/class patterns
|
|
19
|
-
const messageAreas = [];
|
|
20
|
-
for (const div of allDivs) {
|
|
21
|
-
const cls = (div.className && typeof div.className === 'string') ? div.className : '';
|
|
22
|
-
if (cls.includes('thread') || cls.includes('message') ||
|
|
23
|
-
cls.includes('turn-') || cls.includes('agent-') ||
|
|
24
|
-
div.getAttribute('data-message-id') ||
|
|
25
|
-
div.getAttribute('data-turn-id')) {
|
|
26
|
-
messageAreas.push({
|
|
27
|
-
class: cls.substring(0, 300),
|
|
28
|
-
dataMessageId: div.getAttribute('data-message-id'),
|
|
29
|
-
dataTurnId: div.getAttribute('data-turn-id'),
|
|
30
|
-
role: div.getAttribute('role'),
|
|
31
|
-
childCount: div.children?.length || 0,
|
|
32
|
-
text: (div.textContent || '').trim().substring(0, 300),
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Look for the actual message list/scroll container
|
|
38
|
-
const scrollContainers = document.querySelectorAll('[class*="overflow-y-auto"], [class*="scroll"]');
|
|
39
|
-
const scrollInfo = Array.from(scrollContainers).slice(0, 10).map(el => ({
|
|
40
|
-
tag: el.tagName?.toLowerCase(),
|
|
41
|
-
class: (el.className && typeof el.className === 'string') ? el.className.substring(0, 300) : null,
|
|
42
|
-
childCount: el.children?.length || 0,
|
|
43
|
-
scrollHeight: el.scrollHeight,
|
|
44
|
-
clientHeight: el.clientHeight,
|
|
45
|
-
text: (el.textContent || '').trim().substring(0, 200),
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
// Find React Fiber data
|
|
49
|
-
let fiberInfo = null;
|
|
50
|
-
const rootEl = document.getElementById('root');
|
|
51
|
-
if (rootEl) {
|
|
52
|
-
const fiberKey = Object.keys(rootEl).find(k =>
|
|
53
|
-
k.startsWith('__reactFiber') || k.startsWith('__reactInternalInstance')
|
|
54
|
-
);
|
|
55
|
-
if (fiberKey) {
|
|
56
|
-
let fiber = rootEl[fiberKey];
|
|
57
|
-
const stateSnapshots = [];
|
|
58
|
-
for (let d = 0; d < 30 && fiber; d++) {
|
|
59
|
-
const props = fiber.memoizedProps || fiber.pendingProps;
|
|
60
|
-
const state = fiber.memoizedState;
|
|
61
|
-
if (props) {
|
|
62
|
-
const propKeys = Object.keys(props).filter(k => k !== 'children');
|
|
63
|
-
if (propKeys.length > 0) {
|
|
64
|
-
stateSnapshots.push({
|
|
65
|
-
depth: d,
|
|
66
|
-
type: fiber.type?.name || fiber.type?.displayName || (typeof fiber.type === 'string' ? fiber.type : '?'),
|
|
67
|
-
propKeys: propKeys.slice(0, 10),
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
fiber = fiber.child || fiber.return;
|
|
72
|
-
if (stateSnapshots.length > 15) break;
|
|
73
|
-
}
|
|
74
|
-
fiberInfo = stateSnapshots;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Full structure dump of children of root
|
|
79
|
-
const rootChildren = rootEl ? Array.from(rootEl.children) : [];
|
|
80
|
-
const structure = [];
|
|
81
|
-
const dumpChildren = (el, depth, maxDepth) => {
|
|
82
|
-
if (depth > maxDepth) return;
|
|
83
|
-
for (const child of el.children) {
|
|
84
|
-
const cls = (child.className && typeof child.className === 'string') ? child.className : '';
|
|
85
|
-
structure.push({
|
|
86
|
-
depth,
|
|
87
|
-
tag: child.tagName?.toLowerCase(),
|
|
88
|
-
class: cls.substring(0, 200),
|
|
89
|
-
id: child.id || null,
|
|
90
|
-
childCount: child.children?.length || 0,
|
|
91
|
-
text: child.children?.length === 0 ? (child.textContent || '').trim().substring(0, 100) : '',
|
|
92
|
-
});
|
|
93
|
-
if (structure.length < 60) {
|
|
94
|
-
dumpChildren(child, depth + 1, maxDepth);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
if (rootEl) dumpChildren(rootEl, 0, 4);
|
|
99
|
-
|
|
100
|
-
return JSON.stringify({
|
|
101
|
-
headerText,
|
|
102
|
-
messageAreas: messageAreas.slice(0, 20),
|
|
103
|
-
scrollContainers: scrollInfo,
|
|
104
|
-
fiberInfo,
|
|
105
|
-
structure: structure.slice(0, 60),
|
|
106
|
-
});
|
|
107
|
-
} catch (e) {
|
|
108
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
109
|
-
}
|
|
110
|
-
})()
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex — Explore model/mode selectors and session management UI
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
// 1. Model selector area — footer buttons
|
|
7
|
-
const footerArea = document.querySelector('[class*="thread-composer-max-width"][class*="pb-2"]')
|
|
8
|
-
|| document.querySelector('[class*="thread-composer-max-width"]');
|
|
9
|
-
|
|
10
|
-
const footerButtons = footerArea ? Array.from(footerArea.querySelectorAll('button')).map(b => ({
|
|
11
|
-
text: (b.textContent || '').trim().substring(0, 80),
|
|
12
|
-
ariaLabel: b.getAttribute('aria-label')?.substring(0, 80),
|
|
13
|
-
ariaHasPopup: b.getAttribute('aria-haspopup'),
|
|
14
|
-
ariaExpanded: b.getAttribute('aria-expanded'),
|
|
15
|
-
dataState: b.getAttribute('data-state'),
|
|
16
|
-
id: b.id || null,
|
|
17
|
-
class: b.className?.substring(0, 150),
|
|
18
|
-
})) : [];
|
|
19
|
-
|
|
20
|
-
// 2. Look for dropdown/popover menus
|
|
21
|
-
const popovers = document.querySelectorAll('[role="menu"], [role="listbox"], [data-radix-popper-content-wrapper], [data-side]');
|
|
22
|
-
const popoverInfo = Array.from(popovers).map(el => ({
|
|
23
|
-
tag: el.tagName?.toLowerCase(),
|
|
24
|
-
role: el.getAttribute('role'),
|
|
25
|
-
class: (el.className && typeof el.className === 'string') ? el.className.substring(0, 200) : null,
|
|
26
|
-
childCount: el.children?.length || 0,
|
|
27
|
-
text: (el.textContent || '').trim().substring(0, 300),
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
// 3. Header buttons (back, new chat, etc.)
|
|
31
|
-
const headerArea = document.querySelector('[class*="draggable"]');
|
|
32
|
-
const headerButtons = headerArea ? Array.from(headerArea.querySelectorAll('button')).map(b => ({
|
|
33
|
-
text: (b.textContent || '').trim().substring(0, 60),
|
|
34
|
-
ariaLabel: b.getAttribute('aria-label')?.substring(0, 80),
|
|
35
|
-
class: b.className?.substring(0, 100),
|
|
36
|
-
})) : [];
|
|
37
|
-
|
|
38
|
-
// 4. All buttons with aria-labels (important for functionality mapping)
|
|
39
|
-
const allButtons = Array.from(document.querySelectorAll('button')).filter(b => b.offsetWidth > 0);
|
|
40
|
-
const labeledButtons = allButtons
|
|
41
|
-
.filter(b => b.getAttribute('aria-label'))
|
|
42
|
-
.map(b => ({
|
|
43
|
-
text: (b.textContent || '').trim().substring(0, 60),
|
|
44
|
-
ariaLabel: b.getAttribute('aria-label')?.substring(0, 80),
|
|
45
|
-
ariaHasPopup: b.getAttribute('aria-haspopup'),
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
// 5. Check for "new chat" button
|
|
49
|
-
const newChatBtn = allButtons.find(b => {
|
|
50
|
-
const label = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
51
|
-
const text = (b.textContent || '').trim().toLowerCase();
|
|
52
|
-
return label.includes('new') || label.includes('new') || text.includes('new') || text.includes('new');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// 6. Look for back/navigation buttons
|
|
56
|
-
const backBtn = allButtons.find(b => {
|
|
57
|
-
const label = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
58
|
-
return label.includes('back') || label.includes('back') || label.includes('go back');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return JSON.stringify({
|
|
62
|
-
footerButtons,
|
|
63
|
-
headerButtons,
|
|
64
|
-
labeledButtons,
|
|
65
|
-
popoverCount: popovers.length,
|
|
66
|
-
popovers: popoverInfo,
|
|
67
|
-
hasNewChatBtn: !!newChatBtn,
|
|
68
|
-
newChatBtnLabel: newChatBtn?.getAttribute('aria-label') || null,
|
|
69
|
-
hasBackBtn: !!backBtn,
|
|
70
|
-
backBtnLabel: backBtn?.getAttribute('aria-label') || null,
|
|
71
|
-
});
|
|
72
|
-
} catch (e) {
|
|
73
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
74
|
-
}
|
|
75
|
-
})()
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug script — enumerate all buttons in all frames
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
const results = {};
|
|
7
|
-
|
|
8
|
-
// Frame 1: document (child frame / execution context)
|
|
9
|
-
const allBtns1 = Array.from(document.querySelectorAll('button'));
|
|
10
|
-
const visibleBtns1 = allBtns1.filter(b => b.offsetWidth > 0);
|
|
11
|
-
const menuBtns1 = visibleBtns1.filter(b => b.getAttribute('aria-haspopup') === 'menu');
|
|
12
|
-
results.childFrame = {
|
|
13
|
-
hasRoot: !!document.getElementById('root'),
|
|
14
|
-
totalBtns: allBtns1.length,
|
|
15
|
-
visibleBtns: visibleBtns1.length,
|
|
16
|
-
menuBtns: menuBtns1.length,
|
|
17
|
-
menuBtnTexts: menuBtns1.map(b => (b.textContent||'').trim().slice(0,40)),
|
|
18
|
-
sampleBtnTexts: visibleBtns1.slice(0,10).map(b => ({
|
|
19
|
-
t: (b.textContent||'').trim().slice(0,40),
|
|
20
|
-
hp: b.getAttribute('aria-haspopup'),
|
|
21
|
-
w: b.offsetWidth
|
|
22
|
-
}))
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Frame 2: inner iframe (if available)
|
|
26
|
-
const iframes = document.querySelectorAll('iframe');
|
|
27
|
-
results.iframeCount = iframes.length;
|
|
28
|
-
for (let i = 0; i < Math.min(iframes.length, 3); i++) {
|
|
29
|
-
try {
|
|
30
|
-
const innerDoc = iframes[i].contentDocument || iframes[i].contentWindow?.document;
|
|
31
|
-
if (innerDoc) {
|
|
32
|
-
const allBtns2 = Array.from(innerDoc.querySelectorAll('button'));
|
|
33
|
-
const visibleBtns2 = allBtns2.filter(b => b.offsetWidth > 0);
|
|
34
|
-
const menuBtns2 = visibleBtns2.filter(b => b.getAttribute('aria-haspopup') === 'menu');
|
|
35
|
-
results['innerFrame_' + i] = {
|
|
36
|
-
hasRoot: !!innerDoc.getElementById('root'),
|
|
37
|
-
url: iframes[i].src?.slice(0, 100),
|
|
38
|
-
totalBtns: allBtns2.length,
|
|
39
|
-
visibleBtns: visibleBtns2.length,
|
|
40
|
-
menuBtns: menuBtns2.length,
|
|
41
|
-
menuBtnTexts: menuBtns2.map(b => (b.textContent||'').trim().slice(0,40)),
|
|
42
|
-
sampleBtnTexts: visibleBtns2.slice(0,10).map(b => ({
|
|
43
|
-
t: (b.textContent||'').trim().slice(0,40),
|
|
44
|
-
hp: b.getAttribute('aria-haspopup'),
|
|
45
|
-
w: b.offsetWidth
|
|
46
|
-
}))
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
} catch(e) {
|
|
50
|
-
results['innerFrame_' + i] = { error: e.message };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return JSON.stringify(results);
|
|
55
|
-
} catch(e) {
|
|
56
|
-
return JSON.stringify({error: e.message});
|
|
57
|
-
}
|
|
58
|
-
})()
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex — Test different click methods on model button
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
const buttons = Array.from(document.querySelectorAll('button')).filter(b => b.offsetWidth > 0);
|
|
7
|
-
const modelBtn = buttons.find(b => {
|
|
8
|
-
const text = (b.textContent || '').trim();
|
|
9
|
-
return /^(GPT-|gpt-|o\d|claude-)/i.test(text) && b.getAttribute('aria-haspopup') === 'menu';
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
if (!modelBtn) return JSON.stringify({ error: 'Model button not found' });
|
|
13
|
-
|
|
14
|
-
const rect = modelBtn.getBoundingClientRect();
|
|
15
|
-
const x = rect.left + rect.width / 2;
|
|
16
|
-
const y = rect.top + rect.height / 2;
|
|
17
|
-
|
|
18
|
-
// Method 1: MouseEvent sequence (more realistic)
|
|
19
|
-
modelBtn.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, clientX: x, clientY: y }));
|
|
20
|
-
modelBtn.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, clientX: x, clientY: y }));
|
|
21
|
-
modelBtn.dispatchEvent(new PointerEvent('pointerup', { bubbles: true, clientX: x, clientY: y }));
|
|
22
|
-
modelBtn.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, clientX: x, clientY: y }));
|
|
23
|
-
modelBtn.dispatchEvent(new MouseEvent('click', { bubbles: true, clientX: x, clientY: y }));
|
|
24
|
-
|
|
25
|
-
return new Promise((resolve) => {
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
const btnState = {
|
|
28
|
-
ariaExpanded: modelBtn.getAttribute('aria-expanded'),
|
|
29
|
-
dataState: modelBtn.getAttribute('data-state'),
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Check for open elements
|
|
33
|
-
const allElements = document.querySelectorAll('*');
|
|
34
|
-
const openElements = [];
|
|
35
|
-
for (const el of allElements) {
|
|
36
|
-
const ds = el.getAttribute('data-state');
|
|
37
|
-
const role = el.getAttribute('role');
|
|
38
|
-
if (ds === 'open' || role === 'menu' || role === 'listbox') {
|
|
39
|
-
openElements.push({
|
|
40
|
-
tag: el.tagName?.toLowerCase(),
|
|
41
|
-
role, dataState: ds,
|
|
42
|
-
childCount: el.children?.length || 0,
|
|
43
|
-
text: (el.textContent || '').trim().substring(0, 300),
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Close
|
|
49
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
50
|
-
key: 'Escape', code: 'Escape', keyCode: 27, bubbles: true
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
resolve(JSON.stringify({
|
|
54
|
-
btnRect: { x: Math.round(x), y: Math.round(y), w: Math.round(rect.width), h: Math.round(rect.height) },
|
|
55
|
-
btnState,
|
|
56
|
-
openElementCount: openElements.length,
|
|
57
|
-
openElements,
|
|
58
|
-
}));
|
|
59
|
-
}, 800);
|
|
60
|
-
});
|
|
61
|
-
} catch (e) {
|
|
62
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
63
|
-
}
|
|
64
|
-
})()
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check the raw DOM structure of message 15 (code block message)
|
|
3
|
-
*/
|
|
4
|
-
(() => {
|
|
5
|
-
try {
|
|
6
|
-
const turnEls = document.querySelectorAll('[data-content-search-turn-key]');
|
|
7
|
-
const results = [];
|
|
8
|
-
|
|
9
|
-
for (const turnEl of turnEls) {
|
|
10
|
-
const unitEls = turnEl.querySelectorAll('[data-content-search-unit-key]');
|
|
11
|
-
for (const unitEl of unitEls) {
|
|
12
|
-
const unitKey = unitEl.getAttribute('data-content-search-unit-key') || '';
|
|
13
|
-
const parts = unitKey.split(':');
|
|
14
|
-
const role = parts[parts.length - 1];
|
|
15
|
-
|
|
16
|
-
if (role === 'assistant') {
|
|
17
|
-
// Look for code/pre elements
|
|
18
|
-
const pres = unitEl.querySelectorAll('pre');
|
|
19
|
-
const codes = unitEl.querySelectorAll('code');
|
|
20
|
-
|
|
21
|
-
if (pres.length > 0 || codes.length > 0) {
|
|
22
|
-
// Dump the inner structure
|
|
23
|
-
const dumpEl = (el, depth) => {
|
|
24
|
-
if (depth > 5) return [];
|
|
25
|
-
const items = [];
|
|
26
|
-
for (const child of el.children) {
|
|
27
|
-
items.push({
|
|
28
|
-
depth,
|
|
29
|
-
tag: child.tagName?.toLowerCase(),
|
|
30
|
-
class: (child.className && typeof child.className === 'string') ? child.className.substring(0, 150) : null,
|
|
31
|
-
text: child.children.length === 0 ? (child.textContent || '').substring(0, 100) : '',
|
|
32
|
-
childCount: child.children.length,
|
|
33
|
-
});
|
|
34
|
-
items.push(...dumpEl(child, depth + 1));
|
|
35
|
-
}
|
|
36
|
-
return items;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
results.push({
|
|
40
|
-
unitKey: unitKey.substring(0, 60),
|
|
41
|
-
preCount: pres.length,
|
|
42
|
-
codeCount: codes.length,
|
|
43
|
-
innerHTML: unitEl.innerHTML?.substring(0, 2000),
|
|
44
|
-
tree: dumpEl(unitEl, 0).slice(0, 30),
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return JSON.stringify({ messages: results.slice(-3) });
|
|
52
|
-
} catch (e) {
|
|
53
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
54
|
-
}
|
|
55
|
-
})()
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex Extension — list_models
|
|
3
|
-
*
|
|
4
|
-
* Opens the model selector dropdown via pointer events,
|
|
5
|
-
* reads available models from the Radix menu, then closes.
|
|
6
|
-
*/
|
|
7
|
-
(() => {
|
|
8
|
-
try {
|
|
9
|
-
const buttons = Array.from(document.querySelectorAll('button')).filter(b => b.offsetWidth > 0);
|
|
10
|
-
const modelBtn = buttons.find(b => {
|
|
11
|
-
const text = (b.textContent || '').trim();
|
|
12
|
-
return /^(GPT-|gpt-|o\d|claude-)/i.test(text) && b.getAttribute('aria-haspopup') === 'menu';
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
if (!modelBtn) return JSON.stringify({ error: 'Model selector button not found' });
|
|
16
|
-
|
|
17
|
-
const currentModel = (modelBtn.textContent || '').trim();
|
|
18
|
-
|
|
19
|
-
// Open dropdown with full pointer event sequence (required for Radix)
|
|
20
|
-
const rect = modelBtn.getBoundingClientRect();
|
|
21
|
-
const x = rect.left + rect.width / 2;
|
|
22
|
-
const y = rect.top + rect.height / 2;
|
|
23
|
-
modelBtn.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, clientX: x, clientY: y }));
|
|
24
|
-
modelBtn.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, clientX: x, clientY: y }));
|
|
25
|
-
modelBtn.dispatchEvent(new PointerEvent('pointerup', { bubbles: true, clientX: x, clientY: y }));
|
|
26
|
-
modelBtn.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, clientX: x, clientY: y }));
|
|
27
|
-
modelBtn.dispatchEvent(new MouseEvent('click', { bubbles: true, clientX: x, clientY: y }));
|
|
28
|
-
|
|
29
|
-
return new Promise((resolve) => {
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
// Read menu items
|
|
32
|
-
const menu = document.querySelector('[role="menu"][data-state="open"]');
|
|
33
|
-
const models = [];
|
|
34
|
-
if (menu) {
|
|
35
|
-
const items = menu.querySelectorAll('[role="menuitem"], [role="menuitemradio"], div[class*="cursor-interaction"]');
|
|
36
|
-
for (const item of items) {
|
|
37
|
-
const text = (item.textContent || '').trim();
|
|
38
|
-
if (text && text.length > 0 && text.length < 60 && !text.includes('Select model') && !text.includes('Model')) {
|
|
39
|
-
models.push({
|
|
40
|
-
name: text,
|
|
41
|
-
selected: text === currentModel,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Close dropdown
|
|
48
|
-
document.dispatchEvent(new KeyboardEvent('keydown', {
|
|
49
|
-
key: 'Escape', code: 'Escape', keyCode: 27, bubbles: true
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
resolve(JSON.stringify({
|
|
53
|
-
currentModel,
|
|
54
|
-
current: currentModel,
|
|
55
|
-
models,
|
|
56
|
-
count: models.length,
|
|
57
|
-
}));
|
|
58
|
-
}, 500);
|
|
59
|
-
});
|
|
60
|
-
} catch (e) {
|
|
61
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
62
|
-
}
|
|
63
|
-
})()
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex Extension — list_modes
|
|
3
|
-
*
|
|
4
|
-
* Finds the mode / autonomy dropdown next to the model chip in the composer footer,
|
|
5
|
-
* opens it (Radix), reads options, closes. UI expects `modes` + `current` (see ModelModeBar).
|
|
6
|
-
*
|
|
7
|
-
* Uses the same multi-searchRoot strategy as readChat for reliable mode button discovery.
|
|
8
|
-
*/
|
|
9
|
-
(() => {
|
|
10
|
-
try {
|
|
11
|
-
function resolveDoc() {
|
|
12
|
-
let doc = document;
|
|
13
|
-
let root = doc.getElementById('root');
|
|
14
|
-
if (!root) {
|
|
15
|
-
const iframes = doc.querySelectorAll('iframe');
|
|
16
|
-
for (const iframe of iframes) {
|
|
17
|
-
try {
|
|
18
|
-
const innerDoc = iframe.contentDocument || iframe.contentWindow?.document;
|
|
19
|
-
if (innerDoc?.getElementById('root')) {
|
|
20
|
-
doc = innerDoc;
|
|
21
|
-
root = innerDoc.getElementById('root');
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
} catch (e) { /* cross-origin */ }
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return { doc, root };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function isModelText(text) {
|
|
31
|
-
return /^(GPT-|gpt-|o\d|claude-|sonnet|opus)/i.test(text);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Find the mode menu button using the same multi-root strategy as readChat.
|
|
36
|
-
* Searches multiple container scopes and both doc frames.
|
|
37
|
-
*/
|
|
38
|
-
function findModeButton(doc) {
|
|
39
|
-
for (const d of [doc, document]) {
|
|
40
|
-
const searchRoots = [
|
|
41
|
-
d.querySelector('[class*="thread-composer-max-width"]'),
|
|
42
|
-
d.querySelector('[class*="thread-composer"]'),
|
|
43
|
-
d.querySelector('[class*="pb-2"]'),
|
|
44
|
-
d.body,
|
|
45
|
-
].filter(Boolean);
|
|
46
|
-
|
|
47
|
-
for (const searchRoot of searchRoots) {
|
|
48
|
-
const menuBtns = Array.from(searchRoot.querySelectorAll('button[aria-haspopup="menu"]'))
|
|
49
|
-
.filter(b => b.offsetWidth > 0);
|
|
50
|
-
for (const btn of menuBtns) {
|
|
51
|
-
const text = (btn.textContent || '').trim();
|
|
52
|
-
// Skip model buttons — we want the mode button
|
|
53
|
-
if (!isModelText(text) && text.length > 0 && text.length < 30) {
|
|
54
|
-
return btn;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function openMenu(btn) {
|
|
63
|
-
const rect = btn.getBoundingClientRect();
|
|
64
|
-
const cx = rect.left + rect.width / 2;
|
|
65
|
-
const cy = rect.top + rect.height / 2;
|
|
66
|
-
btn.dispatchEvent(
|
|
67
|
-
new PointerEvent('pointerdown', { bubbles: true, clientX: cx, clientY: cy, pointerId: 1 }),
|
|
68
|
-
);
|
|
69
|
-
btn.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, clientX: cx, clientY: cy }));
|
|
70
|
-
btn.dispatchEvent(
|
|
71
|
-
new PointerEvent('pointerup', { bubbles: true, clientX: cx, clientY: cy, pointerId: 1 }),
|
|
72
|
-
);
|
|
73
|
-
btn.dispatchEvent(new MouseEvent('mouseup', { bubbles: true, clientX: cx, clientY: cy }));
|
|
74
|
-
btn.dispatchEvent(new MouseEvent('click', { bubbles: true, clientX: cx, clientY: cy }));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const { doc, root } = resolveDoc();
|
|
78
|
-
if (!root) return JSON.stringify({ modes: [], current: '', currentMode: '', error: 'no root' });
|
|
79
|
-
|
|
80
|
-
const modeBtn = findModeButton(doc);
|
|
81
|
-
if (!modeBtn) {
|
|
82
|
-
return JSON.stringify({
|
|
83
|
-
modes: [],
|
|
84
|
-
current: '',
|
|
85
|
-
currentMode: '',
|
|
86
|
-
error: 'mode menu button not found',
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const menuDoc = modeBtn.ownerDocument || doc;
|
|
91
|
-
const currentLabel = (modeBtn.textContent || '').trim();
|
|
92
|
-
openMenu(modeBtn);
|
|
93
|
-
|
|
94
|
-
return new Promise((resolve) => {
|
|
95
|
-
setTimeout(() => {
|
|
96
|
-
let menu = menuDoc.querySelector('[role="menu"][data-state="open"]');
|
|
97
|
-
if (!menu) {
|
|
98
|
-
menu = menuDoc.querySelector('[role="menu"]');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const collected = [];
|
|
102
|
-
if (menu) {
|
|
103
|
-
const items = menu.querySelectorAll(
|
|
104
|
-
'[role="menuitem"], [role="menuitemradio"], [role="option"], div[class*="cursor-interaction"]',
|
|
105
|
-
);
|
|
106
|
-
for (const item of items) {
|
|
107
|
-
const text = (item.textContent || '').trim();
|
|
108
|
-
if (
|
|
109
|
-
text &&
|
|
110
|
-
text.length > 0 &&
|
|
111
|
-
text.length < 80 &&
|
|
112
|
-
!/^model|^model\b|^select\b/i.test(text)
|
|
113
|
-
) {
|
|
114
|
-
collected.push(text);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
menuDoc.dispatchEvent(
|
|
120
|
-
new KeyboardEvent('keydown', {
|
|
121
|
-
key: 'Escape',
|
|
122
|
-
code: 'Escape',
|
|
123
|
-
keyCode: 27,
|
|
124
|
-
bubbles: true,
|
|
125
|
-
}),
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
const modes = [...new Set(collected)];
|
|
129
|
-
const out = {
|
|
130
|
-
modes: modes.length > 0 ? modes : currentLabel ? [currentLabel] : [],
|
|
131
|
-
current: currentLabel,
|
|
132
|
-
currentMode: currentLabel,
|
|
133
|
-
};
|
|
134
|
-
resolve(JSON.stringify(out));
|
|
135
|
-
}, 550);
|
|
136
|
-
});
|
|
137
|
-
} catch (e) {
|
|
138
|
-
return JSON.stringify({ error: e.message || String(e), modes: [], current: '', currentMode: '' });
|
|
139
|
-
}
|
|
140
|
-
})();
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex — Message structure deep dive
|
|
3
|
-
* Find the actual message DOM elements within the thread
|
|
4
|
-
*/
|
|
5
|
-
(() => {
|
|
6
|
-
try {
|
|
7
|
-
// The thread content area
|
|
8
|
-
const threadContent = document.querySelector('[class*="thread-content"]')
|
|
9
|
-
|| document.querySelector('[class*="overflow-y-auto"][class*="px-panel"]');
|
|
10
|
-
if (!threadContent) return JSON.stringify({ error: 'no thread content area' });
|
|
11
|
-
|
|
12
|
-
// Get ALL elements with data attributes
|
|
13
|
-
const dataAttrs = [];
|
|
14
|
-
threadContent.querySelectorAll('*').forEach(el => {
|
|
15
|
-
const attrs = el.attributes;
|
|
16
|
-
for (let i = 0; i < attrs.length; i++) {
|
|
17
|
-
if (attrs[i].name.startsWith('data-')) {
|
|
18
|
-
dataAttrs.push({
|
|
19
|
-
tag: el.tagName?.toLowerCase(),
|
|
20
|
-
attr: attrs[i].name,
|
|
21
|
-
value: attrs[i].value?.substring(0, 100),
|
|
22
|
-
class: (el.className && typeof el.className === 'string') ? el.className.substring(0, 150) : null,
|
|
23
|
-
text: (el.textContent || '').trim().substring(0, 100),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// Dump full tree of message area (limited depth)
|
|
30
|
-
const tree = [];
|
|
31
|
-
const walk = (el, depth) => {
|
|
32
|
-
if (depth > 6 || tree.length > 80) return;
|
|
33
|
-
const cls = (el.className && typeof el.className === 'string') ? el.className : '';
|
|
34
|
-
tree.push({
|
|
35
|
-
depth,
|
|
36
|
-
tag: el.tagName?.toLowerCase(),
|
|
37
|
-
class: cls.substring(0, 250),
|
|
38
|
-
id: el.id || null,
|
|
39
|
-
role: el.getAttribute('role'),
|
|
40
|
-
childCount: el.children?.length || 0,
|
|
41
|
-
isLeaf: el.children?.length === 0,
|
|
42
|
-
text: el.children?.length === 0 ? (el.textContent || '').trim().substring(0, 150) : '',
|
|
43
|
-
});
|
|
44
|
-
for (const child of el.children) {
|
|
45
|
-
walk(child, depth + 1);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
walk(threadContent, 0);
|
|
49
|
-
|
|
50
|
-
// Also check the composer/input area
|
|
51
|
-
const proseMirror = document.querySelector('.ProseMirror');
|
|
52
|
-
const composerInfo = proseMirror ? {
|
|
53
|
-
tag: proseMirror.tagName?.toLowerCase(),
|
|
54
|
-
class: proseMirror.className?.substring(0, 200),
|
|
55
|
-
contentEditable: proseMirror.contentEditable,
|
|
56
|
-
text: (proseMirror.textContent || '').trim().substring(0, 100),
|
|
57
|
-
childCount: proseMirror.children?.length || 0,
|
|
58
|
-
innerHTML: proseMirror.innerHTML?.substring(0, 300),
|
|
59
|
-
} : null;
|
|
60
|
-
|
|
61
|
-
// Footer area (model, mode selectors)
|
|
62
|
-
const footer = document.querySelector('[class*="thread-composer-max-width"][class*="pb-2"]');
|
|
63
|
-
const footerButtons = footer ? Array.from(footer.querySelectorAll('button')).map(b => ({
|
|
64
|
-
text: (b.textContent || '').trim().substring(0, 60),
|
|
65
|
-
class: b.className?.substring(0, 100),
|
|
66
|
-
ariaLabel: b.getAttribute('aria-label')?.substring(0, 60),
|
|
67
|
-
})) : [];
|
|
68
|
-
|
|
69
|
-
return JSON.stringify({
|
|
70
|
-
threadContentClass: (threadContent.className && typeof threadContent.className === 'string') ? threadContent.className.substring(0, 300) : null,
|
|
71
|
-
dataAttrs: dataAttrs.slice(0, 30),
|
|
72
|
-
tree: tree.slice(0, 80),
|
|
73
|
-
composerInfo,
|
|
74
|
-
footerButtons,
|
|
75
|
-
});
|
|
76
|
-
} catch (e) {
|
|
77
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
78
|
-
}
|
|
79
|
-
})()
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex Extension — new_session
|
|
3
|
-
* Clicks the "New chat" / "New chat" button
|
|
4
|
-
*/
|
|
5
|
-
(() => {
|
|
6
|
-
try {
|
|
7
|
-
const buttons = Array.from(document.querySelectorAll('button')).filter(b => b.offsetWidth > 0);
|
|
8
|
-
const newChatBtn = buttons.find(b => {
|
|
9
|
-
const label = (b.getAttribute('aria-label') || '').toLowerCase();
|
|
10
|
-
return label.includes('New chat') || label.includes('new chat') || label.includes('new');
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
if (newChatBtn) {
|
|
14
|
-
newChatBtn.click();
|
|
15
|
-
return JSON.stringify({ success: true, action: 'new_session' });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return JSON.stringify({
|
|
19
|
-
success: false,
|
|
20
|
-
error: 'New chat button not found',
|
|
21
|
-
available: buttons.map(b => b.getAttribute('aria-label')).filter(Boolean),
|
|
22
|
-
});
|
|
23
|
-
} catch (e) {
|
|
24
|
-
return JSON.stringify({ error: e.message || String(e) });
|
|
25
|
-
}
|
|
26
|
-
})()
|