@adhdev/daemon-core 0.6.57 → 0.6.59
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 +18 -1
- package/dist/index.js +339 -167
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +223 -48
- package/src/commands/chat-commands.ts +7 -1
- package/src/config/chat-history.ts +53 -1
- package/src/daemon/dev-server.ts +7 -9
- package/src/detection/ide-detector.ts +1 -1
- package/src/providers/cli-provider-instance.ts +10 -23
- package/src/providers/provider-instance.ts +1 -0
- package/src/providers/provider-loader.ts +3 -6
- package/src/providers/version-archive.ts +4 -1
- 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 -49
- package/providers/_builtin/cli/aider-cli/scripts/1.0/scripts.js +0 -7
- package/providers/_builtin/cli/claude-cli/provider.json +0 -109
- package/providers/_builtin/cli/claude-cli/scripts/1.0/detect_status.js +0 -31
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_approval.js +0 -38
- package/providers/_builtin/cli/claude-cli/scripts/1.0/parse_output.js +0 -164
- package/providers/_builtin/cli/claude-cli/scripts/1.0/scripts.js +0 -42
- package/providers/_builtin/cli/codex-cli/provider.json +0 -88
- package/providers/_builtin/cli/codex-cli/scripts/1.0/detect_status.js +0 -20
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_approval.js +0 -15
- package/providers/_builtin/cli/codex-cli/scripts/1.0/parse_output.js +0 -68
- 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 -70
- 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,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code CLI Scripts — v1.0
|
|
3
|
-
*
|
|
4
|
-
* CLI scripts differ from IDE scripts:
|
|
5
|
-
* - IDE scripts return JS code strings for CDP evaluate (browser context)
|
|
6
|
-
* - CLI scripts are Node.js functions that receive PTY buffer and return structured data
|
|
7
|
-
*
|
|
8
|
-
* Each export receives an `input` object:
|
|
9
|
-
* { buffer: string, rawBuffer: string, recentBuffer: string, messages: Array }
|
|
10
|
-
* and returns a result conforming to the output contract.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
'use strict';
|
|
14
|
-
|
|
15
|
-
const fs = require('fs');
|
|
16
|
-
const path = require('path');
|
|
17
|
-
const DIR = __dirname;
|
|
18
|
-
|
|
19
|
-
function loadModule(name) {
|
|
20
|
-
try { return require(path.join(DIR, name)); }
|
|
21
|
-
catch { return null; }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// ─── Core ───
|
|
25
|
-
|
|
26
|
-
/** Parse full PTY output → ReadChatResult */
|
|
27
|
-
module.exports.parseOutput = (input) => {
|
|
28
|
-
const mod = loadModule('parse_output.js');
|
|
29
|
-
return mod ? mod(input) : null;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
/** Lightweight status detection (100ms polling) → AgentStatus string */
|
|
33
|
-
module.exports.detectStatus = (input) => {
|
|
34
|
-
const mod = loadModule('detect_status.js');
|
|
35
|
-
return mod ? mod(input) : null;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/** Parse approval modal from PTY output → ModalInfo | null */
|
|
39
|
-
module.exports.parseApproval = (input) => {
|
|
40
|
-
const mod = loadModule('parse_approval.js');
|
|
41
|
-
return mod ? mod(input) : null;
|
|
42
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "codex-cli",
|
|
3
|
-
"name": "Codex CLI",
|
|
4
|
-
"category": "cli",
|
|
5
|
-
"aliases": [
|
|
6
|
-
"codex"
|
|
7
|
-
],
|
|
8
|
-
"icon": "🧠",
|
|
9
|
-
"displayName": "Codex CLI",
|
|
10
|
-
"settings": {
|
|
11
|
-
"mode": {
|
|
12
|
-
"type": "select",
|
|
13
|
-
"default": "chat",
|
|
14
|
-
"public": true,
|
|
15
|
-
"label": "Display Mode",
|
|
16
|
-
"description": "terminal: Native PTY view, chat: Parsed message view",
|
|
17
|
-
"options": [
|
|
18
|
-
"terminal",
|
|
19
|
-
"chat"
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"notifications": {
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"default": true,
|
|
25
|
-
"public": true,
|
|
26
|
-
"label": "Notifications",
|
|
27
|
-
"description": "Display notifications on state changes"
|
|
28
|
-
},
|
|
29
|
-
"autoApprove": {
|
|
30
|
-
"type": "boolean",
|
|
31
|
-
"default": false,
|
|
32
|
-
"public": true,
|
|
33
|
-
"label": "Auto Approve",
|
|
34
|
-
"description": "Automatically approve all tool calls without user confirmation"
|
|
35
|
-
},
|
|
36
|
-
"approvalAlert": {
|
|
37
|
-
"type": "boolean",
|
|
38
|
-
"default": true,
|
|
39
|
-
"public": true,
|
|
40
|
-
"label": "Approval Notifications",
|
|
41
|
-
"description": "Show notification when approval is needed"
|
|
42
|
-
},
|
|
43
|
-
"longGeneratingAlert": {
|
|
44
|
-
"type": "boolean",
|
|
45
|
-
"default": true,
|
|
46
|
-
"public": true,
|
|
47
|
-
"label": "Long Generation Alert",
|
|
48
|
-
"description": "Alert when generation takes too long"
|
|
49
|
-
},
|
|
50
|
-
"longGeneratingThresholdSec": {
|
|
51
|
-
"type": "number",
|
|
52
|
-
"default": 180,
|
|
53
|
-
"public": true,
|
|
54
|
-
"label": "Long Generation Threshold (sec)",
|
|
55
|
-
"min": 30,
|
|
56
|
-
"max": 600
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"binary": "codex",
|
|
60
|
-
"spawn": {
|
|
61
|
-
"command": "codex",
|
|
62
|
-
"args": [],
|
|
63
|
-
"shell": false,
|
|
64
|
-
"env": {}
|
|
65
|
-
},
|
|
66
|
-
"patterns": {
|
|
67
|
-
"prompt": [
|
|
68
|
-
{ "source": "To get started, describe a task or try one of these commands", "flags": "i" },
|
|
69
|
-
{ "source": "^>\\s*$", "flags": "m" }
|
|
70
|
-
],
|
|
71
|
-
"generating": [
|
|
72
|
-
{ "source": "Working \\(\\d+s", "flags": "i" }
|
|
73
|
-
],
|
|
74
|
-
"approval": [
|
|
75
|
-
{ "source": "Always approve this session", "flags": "i" },
|
|
76
|
-
{ "source": "Approve and run now", "flags": "i" },
|
|
77
|
-
{ "source": "Allow command\\?", "flags": "i" }
|
|
78
|
-
],
|
|
79
|
-
"ready": []
|
|
80
|
-
},
|
|
81
|
-
"compatibility": [
|
|
82
|
-
{
|
|
83
|
-
"ideVersion": ">=0.42.0",
|
|
84
|
-
"scriptDir": "scripts/1.0"
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
"defaultScriptDir": "scripts/1.0"
|
|
88
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex CLI — detect_status
|
|
3
|
-
* OpenAI Codex CLI uses a different TUI pattern.
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
module.exports = function detectStatus(input) {
|
|
7
|
-
const { tail } = input;
|
|
8
|
-
if (!tail) return 'idle';
|
|
9
|
-
|
|
10
|
-
// waiting_approval
|
|
11
|
-
if (/approve|deny|allow|reject/i.test(tail) && /\[.*\]/i.test(tail)) return 'waiting_approval';
|
|
12
|
-
if (/Run command/i.test(tail) && /\(y\/n\)/i.test(tail)) return 'waiting_approval';
|
|
13
|
-
|
|
14
|
-
// generating
|
|
15
|
-
if (/[\u2800-\u28ff]/.test(tail)) return 'generating';
|
|
16
|
-
if (/[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]/.test(tail)) return 'generating';
|
|
17
|
-
if (/thinking|processing|running/i.test(tail)) return 'generating';
|
|
18
|
-
|
|
19
|
-
return 'idle';
|
|
20
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex CLI — parse_approval
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
module.exports = function parseApproval(input) {
|
|
6
|
-
const { tail } = input;
|
|
7
|
-
if (!tail) return null;
|
|
8
|
-
const hasApproval = /approve|allow/i.test(tail) && /deny|reject/i.test(tail);
|
|
9
|
-
if (!hasApproval && !/\(y\/n\)/i.test(tail)) return null;
|
|
10
|
-
const lines = tail.split('\n').map(l => l.trim()).filter(l => l && !/^[─═╭╮╰╯│]+$/.test(l));
|
|
11
|
-
return {
|
|
12
|
-
message: lines.slice(-5).join(' ').slice(0, 200) || 'Approval required',
|
|
13
|
-
buttons: ['Approve', 'Deny'],
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex CLI — parse_output
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
const detectStatus = require('./detect_status.js');
|
|
6
|
-
const parseApproval = require('./parse_approval.js');
|
|
7
|
-
|
|
8
|
-
function splitTurns(buffer) {
|
|
9
|
-
const messages = [];
|
|
10
|
-
if (!buffer || buffer.length < 5) return messages;
|
|
11
|
-
const lines = buffer.split('\n');
|
|
12
|
-
let currentRole = null;
|
|
13
|
-
let currentContent = [];
|
|
14
|
-
let msgIndex = 0;
|
|
15
|
-
let started = false;
|
|
16
|
-
|
|
17
|
-
for (const line of lines) {
|
|
18
|
-
const trimmed = line.trim();
|
|
19
|
-
const userMatch = trimmed.match(/^[❯›>$]\s+(.+)$/);
|
|
20
|
-
if (userMatch && userMatch[1].length > 1) {
|
|
21
|
-
started = true;
|
|
22
|
-
if (currentRole && currentContent.length > 0) {
|
|
23
|
-
const text = currentContent.join('\n').trim();
|
|
24
|
-
if (text.length > 1) {
|
|
25
|
-
messages.push({ id: `msg_${msgIndex}`, role: currentRole, content: text.slice(0, 6000), index: msgIndex, kind: 'standard' });
|
|
26
|
-
msgIndex++;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
currentRole = 'user';
|
|
30
|
-
currentContent = [userMatch[1]];
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
if (!started) continue;
|
|
34
|
-
if (currentRole === 'user' && trimmed && !userMatch) {
|
|
35
|
-
const text = currentContent.join('\n').trim();
|
|
36
|
-
if (text.length > 1) {
|
|
37
|
-
messages.push({ id: `msg_${msgIndex}`, role: 'user', content: text, index: msgIndex, kind: 'standard' });
|
|
38
|
-
msgIndex++;
|
|
39
|
-
}
|
|
40
|
-
currentRole = 'assistant';
|
|
41
|
-
currentContent = [];
|
|
42
|
-
}
|
|
43
|
-
if (!trimmed) continue;
|
|
44
|
-
if (/^[─═╭╮╰╯│]+$/.test(trimmed)) continue;
|
|
45
|
-
if (/^[\u2800-\u28ff]+$/.test(trimmed)) continue;
|
|
46
|
-
if (currentRole) currentContent.push(trimmed);
|
|
47
|
-
}
|
|
48
|
-
if (currentRole && currentContent.length > 0) {
|
|
49
|
-
const text = currentContent.join('\n').trim();
|
|
50
|
-
if (text.length > 1) {
|
|
51
|
-
messages.push({ id: `msg_${msgIndex}`, role: currentRole, content: text.slice(0, 6000), index: msgIndex, kind: 'standard' });
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return messages.length > 50 ? messages.slice(-50) : messages;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
module.exports = function parseOutput(input) {
|
|
58
|
-
const { buffer, recentBuffer, partialResponse, screenText } = input;
|
|
59
|
-
const transcript = screenText || buffer;
|
|
60
|
-
const tail = recentBuffer || (transcript || '').slice(-500);
|
|
61
|
-
const status = detectStatus({ tail });
|
|
62
|
-
const activeModal = status === 'waiting_approval' ? parseApproval({ buffer: transcript, tail }) : null;
|
|
63
|
-
const messages = splitTurns(transcript);
|
|
64
|
-
if (status === 'generating' && partialResponse && partialResponse.trim().length > 2) {
|
|
65
|
-
messages.push({ id: 'msg_partial', role: 'assistant', content: partialResponse.trim().slice(0, 6000), index: messages.length, kind: 'standard', meta: { streaming: true } });
|
|
66
|
-
}
|
|
67
|
-
return { id: 'cli_session', status, title: 'Codex CLI', messages, activeModal };
|
|
68
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex CLI Scripts — v1.0
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
const path = require('path');
|
|
6
|
-
const DIR = __dirname;
|
|
7
|
-
function loadModule(name) { try { return require(path.join(DIR, name)); } catch { return null; } }
|
|
8
|
-
|
|
9
|
-
module.exports.parseOutput = (input) => { const m = loadModule('parse_output.js'); return m ? m(input) : null; };
|
|
10
|
-
module.exports.detectStatus = (input) => { const m = loadModule('detect_status.js'); return m ? m(input) : null; };
|
|
11
|
-
module.exports.parseApproval = (input) => { const m = loadModule('parse_approval.js'); return m ? m(input) : null; };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "cursor-cli",
|
|
3
|
-
"name": "Cursor CLI",
|
|
4
|
-
"category": "cli",
|
|
5
|
-
"aliases": [
|
|
6
|
-
"cursor"
|
|
7
|
-
],
|
|
8
|
-
"icon": "🤖",
|
|
9
|
-
"displayName": "Cursor CLI",
|
|
10
|
-
"settings": {
|
|
11
|
-
"mode": {
|
|
12
|
-
"type": "select",
|
|
13
|
-
"default": "chat",
|
|
14
|
-
"public": true,
|
|
15
|
-
"label": "Display Mode",
|
|
16
|
-
"description": "terminal: Native PTY view, chat: Parsed message view",
|
|
17
|
-
"options": [
|
|
18
|
-
"terminal",
|
|
19
|
-
"chat"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"binary": "agent",
|
|
24
|
-
"spawn": {
|
|
25
|
-
"command": "agent",
|
|
26
|
-
"args": [],
|
|
27
|
-
"shell": true,
|
|
28
|
-
"env": {}
|
|
29
|
-
},
|
|
30
|
-
"compatibility": [
|
|
31
|
-
{
|
|
32
|
-
"ideVersion": ">=2026.0.0",
|
|
33
|
-
"scriptDir": "scripts/1.0"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"defaultScriptDir": "scripts/1.0"
|
|
37
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor CLI — detect_status
|
|
3
|
-
* Cursor's terminal agent uses similar TUI patterns to Claude.
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
module.exports = function detectStatus(input) {
|
|
7
|
-
const { tail } = input;
|
|
8
|
-
if (!tail) return 'idle';
|
|
9
|
-
// waiting_approval
|
|
10
|
-
if (/Allow\s*once/i.test(tail) || /Always\s*allow/i.test(tail)) return 'waiting_approval';
|
|
11
|
-
if (/\(y\/n\)/i.test(tail) || /\[Y\/n\]/i.test(tail)) return 'waiting_approval';
|
|
12
|
-
if (/approve|confirm/i.test(tail) && /deny|cancel/i.test(tail)) return 'waiting_approval';
|
|
13
|
-
// generating
|
|
14
|
-
if (/[\u2800-\u28ff]/.test(tail)) return 'generating';
|
|
15
|
-
if (/[⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]/.test(tail)) return 'generating';
|
|
16
|
-
if (/thinking|processing|generating/i.test(tail)) return 'generating';
|
|
17
|
-
if (/esc to (cancel|interrupt|stop)/i.test(tail)) return 'generating';
|
|
18
|
-
return 'idle';
|
|
19
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
module.exports = function parseApproval(input) {
|
|
3
|
-
const { tail } = input;
|
|
4
|
-
if (!tail) return null;
|
|
5
|
-
const hasApproval = /Allow\s*once/i.test(tail) || /Always\s*allow/i.test(tail) ||
|
|
6
|
-
/\(y\/n\)/i.test(tail) || (/approve/i.test(tail) && /deny/i.test(tail));
|
|
7
|
-
if (!hasApproval) return null;
|
|
8
|
-
const lines = tail.split('\n').map(l => l.trim()).filter(l => l && !/^[─═╭╮╰╯│]+$/.test(l));
|
|
9
|
-
return { message: lines.slice(-5).join(' ').slice(0, 200) || 'Approval required', buttons: ['Allow', 'Always allow', 'Deny'] };
|
|
10
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const detectStatus = require('./detect_status.js');
|
|
3
|
-
const parseApproval = require('./parse_approval.js');
|
|
4
|
-
|
|
5
|
-
function splitTurns(buffer) {
|
|
6
|
-
const messages = [];
|
|
7
|
-
if (!buffer || buffer.length < 5) return messages;
|
|
8
|
-
const lines = buffer.split('\n');
|
|
9
|
-
let currentRole = null, currentContent = [], msgIndex = 0, started = false;
|
|
10
|
-
for (const line of lines) {
|
|
11
|
-
const trimmed = line.trim();
|
|
12
|
-
const userMatch = trimmed.match(/^[❯›>$]\s+(.+)$/);
|
|
13
|
-
if (userMatch && userMatch[1].length > 1) {
|
|
14
|
-
started = true;
|
|
15
|
-
if (currentRole && currentContent.length > 0) {
|
|
16
|
-
const text = currentContent.join('\n').trim();
|
|
17
|
-
if (text.length > 1) { messages.push({ id: `msg_${msgIndex}`, role: currentRole, content: text.slice(0, 6000), index: msgIndex, kind: 'standard' }); msgIndex++; }
|
|
18
|
-
}
|
|
19
|
-
currentRole = 'user'; currentContent = [userMatch[1]]; continue;
|
|
20
|
-
}
|
|
21
|
-
if (!started) continue;
|
|
22
|
-
if (currentRole === 'user' && trimmed && !userMatch) {
|
|
23
|
-
const text = currentContent.join('\n').trim();
|
|
24
|
-
if (text.length > 1) { messages.push({ id: `msg_${msgIndex}`, role: 'user', content: text, index: msgIndex, kind: 'standard' }); msgIndex++; }
|
|
25
|
-
currentRole = 'assistant'; currentContent = [];
|
|
26
|
-
}
|
|
27
|
-
if (!trimmed || /^[─═╭╮╰╯│]+$/.test(trimmed) || /^[\u2800-\u28ff]+$/.test(trimmed)) continue;
|
|
28
|
-
if (currentRole) currentContent.push(trimmed);
|
|
29
|
-
}
|
|
30
|
-
if (currentRole && currentContent.length > 0) {
|
|
31
|
-
const text = currentContent.join('\n').trim();
|
|
32
|
-
if (text.length > 1) messages.push({ id: `msg_${msgIndex}`, role: currentRole, content: text.slice(0, 6000), index: msgIndex, kind: 'standard' });
|
|
33
|
-
}
|
|
34
|
-
return messages.length > 50 ? messages.slice(-50) : messages;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
module.exports = function parseOutput(input) {
|
|
38
|
-
const { buffer, recentBuffer, partialResponse, screenText } = input;
|
|
39
|
-
const transcript = screenText || buffer;
|
|
40
|
-
const tail = recentBuffer || (transcript || '').slice(-500);
|
|
41
|
-
const status = detectStatus({ tail });
|
|
42
|
-
const activeModal = status === 'waiting_approval' ? parseApproval({ buffer: transcript, tail }) : null;
|
|
43
|
-
const messages = splitTurns(transcript);
|
|
44
|
-
if (status === 'generating' && partialResponse && partialResponse.trim().length > 2) {
|
|
45
|
-
messages.push({ id: 'msg_partial', role: 'assistant', content: partialResponse.trim().slice(0, 6000), index: messages.length, kind: 'standard', meta: { streaming: true } });
|
|
46
|
-
}
|
|
47
|
-
return { id: 'cli_session', status, title: 'Cursor CLI', messages, activeModal };
|
|
48
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const DIR = __dirname;
|
|
4
|
-
function loadModule(name) { try { return require(path.join(DIR, name)); } catch { return null; } }
|
|
5
|
-
module.exports.parseOutput = (input) => { const m = loadModule('parse_output.js'); return m ? m(input) : null; };
|
|
6
|
-
module.exports.detectStatus = (input) => { const m = loadModule('detect_status.js'); return m ? m(input) : null; };
|
|
7
|
-
module.exports.parseApproval = (input) => { const m = loadModule('parse_approval.js'); return m ? m(input) : null; };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "gemini-cli",
|
|
3
|
-
"name": "Gemini CLI",
|
|
4
|
-
"category": "cli",
|
|
5
|
-
"aliases": [
|
|
6
|
-
"gemini"
|
|
7
|
-
],
|
|
8
|
-
"icon": "♊",
|
|
9
|
-
"displayName": "Gemini CLI",
|
|
10
|
-
"settings": {
|
|
11
|
-
"mode": {
|
|
12
|
-
"type": "select",
|
|
13
|
-
"default": "chat",
|
|
14
|
-
"public": true,
|
|
15
|
-
"label": "Display Mode",
|
|
16
|
-
"description": "terminal: Native PTY view, chat: Parsed message view",
|
|
17
|
-
"options": [
|
|
18
|
-
"terminal",
|
|
19
|
-
"chat"
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
"notifications": {
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"default": true,
|
|
25
|
-
"public": true,
|
|
26
|
-
"label": "Notifications",
|
|
27
|
-
"description": "Display notifications on state changes"
|
|
28
|
-
},
|
|
29
|
-
"autoApprove": {
|
|
30
|
-
"type": "boolean",
|
|
31
|
-
"default": false,
|
|
32
|
-
"public": true,
|
|
33
|
-
"label": "Auto Approve",
|
|
34
|
-
"description": "Automatically approve all tool calls without user confirmation"
|
|
35
|
-
},
|
|
36
|
-
"approvalAlert": {
|
|
37
|
-
"type": "boolean",
|
|
38
|
-
"default": true,
|
|
39
|
-
"public": true,
|
|
40
|
-
"label": "Approval Notifications",
|
|
41
|
-
"description": "Show notification when approval is needed"
|
|
42
|
-
},
|
|
43
|
-
"longGeneratingAlert": {
|
|
44
|
-
"type": "boolean",
|
|
45
|
-
"default": true,
|
|
46
|
-
"public": true,
|
|
47
|
-
"label": "Long Generation Alert",
|
|
48
|
-
"description": "Alert when generation takes too long"
|
|
49
|
-
},
|
|
50
|
-
"longGeneratingThresholdSec": {
|
|
51
|
-
"type": "number",
|
|
52
|
-
"default": 180,
|
|
53
|
-
"public": true,
|
|
54
|
-
"label": "Long Generation Threshold (sec)",
|
|
55
|
-
"min": 30,
|
|
56
|
-
"max": 600
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"binary": "gemini",
|
|
60
|
-
"spawn": {
|
|
61
|
-
"command": "gemini",
|
|
62
|
-
"args": [
|
|
63
|
-
"--yolo"
|
|
64
|
-
],
|
|
65
|
-
"shell": true,
|
|
66
|
-
"env": {}
|
|
67
|
-
},
|
|
68
|
-
"patterns": {
|
|
69
|
-
"prompt": [
|
|
70
|
-
{ "source": "\\?\\s*for\\s*shortcuts", "flags": "i" },
|
|
71
|
-
{ "source": "^>\\s*$", "flags": "m" },
|
|
72
|
-
{ "source": "[›❯]\\s*$", "flags": "m" },
|
|
73
|
-
{ "source": "sandbox", "flags": "i" },
|
|
74
|
-
{ "source": "Type your message", "flags": "i" }
|
|
75
|
-
],
|
|
76
|
-
"generating": [
|
|
77
|
-
{ "source": "[\\u2800-\\u28ff]", "flags": "" },
|
|
78
|
-
{ "source": "[▀▄▌▐░▒▓█]", "flags": "" },
|
|
79
|
-
{ "source": "Thinking", "flags": "i" },
|
|
80
|
-
{ "source": "Generating", "flags": "i" },
|
|
81
|
-
{ "source": "esc to (cancel|interrupt|stop)", "flags": "i" }
|
|
82
|
-
],
|
|
83
|
-
"approval": [
|
|
84
|
-
{ "source": "Allow\\s*once", "flags": "i" },
|
|
85
|
-
{ "source": "Always\\s*allow", "flags": "i" },
|
|
86
|
-
{ "source": "\\(y/n\\)", "flags": "i" },
|
|
87
|
-
{ "source": "\\[Y/n\\]", "flags": "i" },
|
|
88
|
-
{ "source": "Run\\s*this\\s*command", "flags": "i" },
|
|
89
|
-
{ "source": "Deny", "flags": "i" },
|
|
90
|
-
{ "source": "auto-?approve", "flags": "i" }
|
|
91
|
-
],
|
|
92
|
-
"ready": [
|
|
93
|
-
{ "source": "\\?\\s*for\\s*shortcuts", "flags": "i" },
|
|
94
|
-
{ "source": "sandbox", "flags": "i" }
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
"approvalKeys": {
|
|
98
|
-
"0": "y",
|
|
99
|
-
"1": "a",
|
|
100
|
-
"2": "n"
|
|
101
|
-
},
|
|
102
|
-
"compatibility": [
|
|
103
|
-
{
|
|
104
|
-
"ideVersion": ">=0.35.0",
|
|
105
|
-
"scriptDir": "scripts/1.0"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
"defaultScriptDir": "scripts/1.0"
|
|
109
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI — detect_status
|
|
3
|
-
* Input: { tail: string }
|
|
4
|
-
* Output: 'idle' | 'generating' | 'waiting_approval'
|
|
5
|
-
*/
|
|
6
|
-
'use strict';
|
|
7
|
-
module.exports = function detectStatus(input) {
|
|
8
|
-
const { tail } = input;
|
|
9
|
-
if (!tail) return 'idle';
|
|
10
|
-
|
|
11
|
-
// waiting_approval
|
|
12
|
-
if (/Allow\s*once/i.test(tail) || /Always\s*allow/i.test(tail)) return 'waiting_approval';
|
|
13
|
-
if (/\(y\/n\)/i.test(tail) || /\[Y\/n\]/i.test(tail)) return 'waiting_approval';
|
|
14
|
-
if (/Run\s*this\s*command/i.test(tail)) return 'waiting_approval';
|
|
15
|
-
if (/Deny/i.test(tail) && /Allow/i.test(tail)) return 'waiting_approval';
|
|
16
|
-
if (/auto-?approve/i.test(tail) && /Deny/i.test(tail)) return 'waiting_approval';
|
|
17
|
-
|
|
18
|
-
// generating
|
|
19
|
-
if (/[\u2800-\u28ff]/.test(tail)) return 'generating';
|
|
20
|
-
if (/[▀▄▌▐░▒▓█]/.test(tail)) return 'generating';
|
|
21
|
-
if (/Thinking/i.test(tail)) return 'generating';
|
|
22
|
-
if (/Generating/i.test(tail)) return 'generating';
|
|
23
|
-
if (/esc to (cancel|interrupt|stop)/i.test(tail)) return 'generating';
|
|
24
|
-
|
|
25
|
-
return 'idle';
|
|
26
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI — parse_approval
|
|
3
|
-
* Input: { buffer: string, tail: string }
|
|
4
|
-
* Output: { message: string, buttons: string[] } | null
|
|
5
|
-
*/
|
|
6
|
-
'use strict';
|
|
7
|
-
module.exports = function parseApproval(input) {
|
|
8
|
-
const { tail } = input;
|
|
9
|
-
if (!tail) return null;
|
|
10
|
-
|
|
11
|
-
const hasApproval =
|
|
12
|
-
/Allow\s*once/i.test(tail) || /Always\s*allow/i.test(tail) ||
|
|
13
|
-
/Run\s*this\s*command/i.test(tail) || /Deny/i.test(tail) ||
|
|
14
|
-
/\(y\/n\)/i.test(tail) || /\[Y\/n\]/i.test(tail);
|
|
15
|
-
if (!hasApproval) return null;
|
|
16
|
-
|
|
17
|
-
const lines = tail.split('\n').map(l => l.trim()).filter(l => l && !/^[─═╭╮╰╯│]+$/.test(l));
|
|
18
|
-
return {
|
|
19
|
-
message: lines.slice(-5).join(' ').slice(0, 200) || 'Approval required',
|
|
20
|
-
buttons: ['Allow (y)', 'Always allow (a)', 'Deny (n)'],
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI — parse_output
|
|
3
|
-
* Input: CliScriptInput
|
|
4
|
-
* Output: ReadChatResult
|
|
5
|
-
*/
|
|
6
|
-
'use strict';
|
|
7
|
-
const detectStatus = require('./detect_status.js');
|
|
8
|
-
const parseApproval = require('./parse_approval.js');
|
|
9
|
-
|
|
10
|
-
function splitTurns(buffer) {
|
|
11
|
-
const messages = [];
|
|
12
|
-
if (!buffer || buffer.length < 5) return messages;
|
|
13
|
-
const lines = buffer.split('\n');
|
|
14
|
-
let currentRole = null;
|
|
15
|
-
let currentContent = [];
|
|
16
|
-
let msgIndex = 0;
|
|
17
|
-
let started = false;
|
|
18
|
-
|
|
19
|
-
for (const line of lines) {
|
|
20
|
-
const trimmed = line.trim();
|
|
21
|
-
const userMatch = trimmed.match(/^[❯›>]\s+(.+)$/);
|
|
22
|
-
if (userMatch && userMatch[1].length > 1) {
|
|
23
|
-
started = true;
|
|
24
|
-
if (currentRole && currentContent.length > 0) {
|
|
25
|
-
const text = currentContent.join('\n').trim();
|
|
26
|
-
if (text.length > 1) {
|
|
27
|
-
messages.push({ id: `msg_${msgIndex}`, role: currentRole, content: text.slice(0, 6000), index: msgIndex, kind: 'standard' });
|
|
28
|
-
msgIndex++;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
currentRole = 'user';
|
|
32
|
-
currentContent = [userMatch[1]];
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
if (!started) continue;
|
|
36
|
-
if (currentRole === 'user' && trimmed && !userMatch) {
|
|
37
|
-
const text = currentContent.join('\n').trim();
|
|
38
|
-
if (text.length > 1) {
|
|
39
|
-
messages.push({ id: `msg_${msgIndex}`, role: 'user', content: text, index: msgIndex, kind: 'standard' });
|
|
40
|
-
msgIndex++;
|
|
41
|
-
}
|
|
42
|
-
currentRole = 'assistant';
|
|
43
|
-
currentContent = [];
|
|
44
|
-
}
|
|
45
|
-
if (!trimmed) continue;
|
|
46
|
-
if (/^[─═╭╮╰╯│┌┐└┘├┤┬┴┼]+$/.test(trimmed)) continue;
|
|
47
|
-
if (/^[\u2800-\u28ff]+$/.test(trimmed)) continue;
|
|
48
|
-
if (/^sandbox/i.test(trimmed)) continue;
|
|
49
|
-
if (currentRole) currentContent.push(trimmed);
|
|
50
|
-
}
|
|
51
|
-
if (currentRole && currentContent.length > 0) {
|
|
52
|
-
const text = currentContent.join('\n').trim();
|
|
53
|
-
if (text.length > 1) {
|
|
54
|
-
messages.push({ id: `msg_${msgIndex}`, role: currentRole, content: text.slice(0, 6000), index: msgIndex, kind: 'standard' });
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return messages.length > 50 ? messages.slice(-50) : messages;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
module.exports = function parseOutput(input) {
|
|
61
|
-
const { buffer, recentBuffer, partialResponse, screenText } = input;
|
|
62
|
-
const transcript = screenText || buffer;
|
|
63
|
-
const tail = recentBuffer || (transcript || '').slice(-500);
|
|
64
|
-
const status = detectStatus({ tail });
|
|
65
|
-
const activeModal = status === 'waiting_approval' ? parseApproval({ buffer: transcript, tail }) : null;
|
|
66
|
-
const messages = splitTurns(transcript);
|
|
67
|
-
if (status === 'generating' && partialResponse && partialResponse.trim().length > 2) {
|
|
68
|
-
messages.push({ id: 'msg_partial', role: 'assistant', content: partialResponse.trim().slice(0, 6000), index: messages.length, kind: 'standard', meta: { streaming: true } });
|
|
69
|
-
}
|
|
70
|
-
return { id: 'cli_session', status, title: 'Gemini CLI', messages, activeModal };
|
|
71
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI Scripts — v1.0
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const DIR = __dirname;
|
|
8
|
-
function loadModule(name) { try { return require(path.join(DIR, name)); } catch { return null; } }
|
|
9
|
-
|
|
10
|
-
module.exports.parseOutput = (input) => { const m = loadModule('parse_output.js'); return m ? m(input) : null; };
|
|
11
|
-
module.exports.detectStatus = (input) => { const m = loadModule('detect_status.js'); return m ? m(input) : null; };
|
|
12
|
-
module.exports.parseApproval = (input) => { const m = loadModule('parse_approval.js'); return m ? m(input) : null; };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": "github-copilot-cli",
|
|
3
|
-
"name": "GitHub Copilot CLI",
|
|
4
|
-
"category": "cli",
|
|
5
|
-
"aliases": [
|
|
6
|
-
"gh-copilot"
|
|
7
|
-
],
|
|
8
|
-
"icon": "🤖",
|
|
9
|
-
"displayName": "GitHub Copilot CLI",
|
|
10
|
-
"settings": {
|
|
11
|
-
"mode": {
|
|
12
|
-
"type": "select",
|
|
13
|
-
"default": "chat",
|
|
14
|
-
"public": true,
|
|
15
|
-
"label": "Display Mode",
|
|
16
|
-
"description": "terminal: Native PTY view, chat: Parsed message view",
|
|
17
|
-
"options": [
|
|
18
|
-
"terminal",
|
|
19
|
-
"chat"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"binary": "gh",
|
|
24
|
-
"spawn": {
|
|
25
|
-
"command": "gh",
|
|
26
|
-
"args": ["copilot"],
|
|
27
|
-
"shell": true,
|
|
28
|
-
"env": {}
|
|
29
|
-
},
|
|
30
|
-
"compatibility": [
|
|
31
|
-
{
|
|
32
|
-
"ideVersion": ">=1.0.0",
|
|
33
|
-
"scriptDir": "scripts/1.0"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"defaultScriptDir": "scripts/1.0"
|
|
37
|
-
}
|