adhdev 0.1.53 → 0.2.0

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.
Files changed (109) hide show
  1. package/dist/cli-entrypoint.js +12020 -0
  2. package/dist/cli-entrypoint.js.map +1 -0
  3. package/dist/index.js +9789 -9864
  4. package/dist/index.js.map +1 -0
  5. package/package.json +19 -16
  6. package/providers/_builtin/CONTRIBUTING.md +141 -0
  7. package/providers/_builtin/README.md +51 -0
  8. package/providers/_builtin/acp/agentpool/provider.json +47 -0
  9. package/providers/_builtin/acp/amp/provider.json +45 -0
  10. package/providers/_builtin/acp/auggie/provider.json +50 -0
  11. package/providers/_builtin/acp/autodev/provider.json +47 -0
  12. package/providers/_builtin/acp/autohand/provider.json +45 -0
  13. package/providers/_builtin/acp/blackbox-ai/provider.json +47 -0
  14. package/providers/_builtin/acp/claude-agent/provider.json +50 -0
  15. package/providers/_builtin/acp/cline-acp/provider.json +47 -0
  16. package/providers/_builtin/acp/code-assistant/provider.json +47 -0
  17. package/providers/_builtin/acp/codebuddy/provider.json +47 -0
  18. package/providers/_builtin/acp/codex-cli/provider.json +50 -0
  19. package/providers/_builtin/acp/corust-agent/provider.json +45 -0
  20. package/providers/_builtin/acp/crow-cli/provider.json +47 -0
  21. package/providers/_builtin/acp/cursor-acp/provider.json +47 -0
  22. package/providers/_builtin/acp/deepagents/provider.json +45 -0
  23. package/providers/_builtin/acp/dimcode/provider.json +47 -0
  24. package/providers/_builtin/acp/docker-cagent/provider.json +50 -0
  25. package/providers/_builtin/acp/factory-droid/provider.json +53 -0
  26. package/providers/_builtin/acp/fast-agent/provider.json +45 -0
  27. package/providers/_builtin/acp/fount/provider.json +47 -0
  28. package/providers/_builtin/acp/gemini-cli/provider.json +107 -0
  29. package/providers/_builtin/acp/github-copilot/provider.json +47 -0
  30. package/providers/_builtin/acp/goose/provider.json +50 -0
  31. package/providers/_builtin/acp/junie/provider.json +45 -0
  32. package/providers/_builtin/acp/kilo/provider.json +45 -0
  33. package/providers/_builtin/acp/kimi-cli/provider.json +50 -0
  34. package/providers/_builtin/acp/kiro-cli/provider.json +47 -0
  35. package/providers/_builtin/acp/minion-code/provider.json +45 -0
  36. package/providers/_builtin/acp/mistral-vibe/provider.json +50 -0
  37. package/providers/_builtin/acp/nova/provider.json +47 -0
  38. package/providers/_builtin/acp/openclaw/provider.json +47 -0
  39. package/providers/_builtin/acp/opencode/provider.json +45 -0
  40. package/providers/_builtin/acp/openhands/provider.json +47 -0
  41. package/providers/_builtin/acp/pi-acp/provider.json +45 -0
  42. package/providers/_builtin/acp/qoder/provider.json +47 -0
  43. package/providers/_builtin/acp/qwen-code/provider.json +53 -0
  44. package/providers/_builtin/acp/stakpak/provider.json +47 -0
  45. package/providers/_builtin/acp/vtcode/provider.json +47 -0
  46. package/providers/_builtin/cli/claude-cli/provider.json +78 -0
  47. package/providers/_builtin/cli/codex-cli/provider.json +60 -0
  48. package/providers/_builtin/cli/gemini-cli/provider.json +64 -0
  49. package/providers/_builtin/extension/cline/provider.json +11 -0
  50. package/providers/_builtin/extension/cline/scripts/open_panel.js +1 -1
  51. package/providers/_builtin/extension/cline/{provider.js → scripts.js} +29 -55
  52. package/providers/_builtin/extension/roo-code/provider.json +11 -0
  53. package/providers/_builtin/extension/roo-code/{provider.js → scripts.js} +27 -97
  54. package/providers/_builtin/ide/antigravity/provider.json +32 -0
  55. package/providers/_builtin/ide/antigravity/scripts.js +73 -0
  56. package/providers/_builtin/ide/cursor/provider.json +35 -0
  57. package/providers/_builtin/ide/cursor/{provider.js → scripts.js} +31 -69
  58. package/providers/_builtin/ide/kiro/provider.json +36 -0
  59. package/providers/_builtin/ide/kiro/scripts/webview_send_message.js +72 -0
  60. package/providers/_builtin/ide/kiro/scripts.js +62 -0
  61. package/providers/_builtin/ide/pearai/provider.json +36 -0
  62. package/providers/_builtin/ide/pearai/scripts/list_sessions.js +38 -0
  63. package/providers/_builtin/ide/pearai/scripts/new_session.js +55 -0
  64. package/providers/_builtin/ide/pearai/scripts/webview_list_sessions.js +62 -0
  65. package/providers/_builtin/ide/pearai/scripts/webview_new_session.js +32 -4
  66. package/providers/_builtin/ide/pearai/scripts/webview_send_message.js +72 -0
  67. package/providers/_builtin/ide/pearai/scripts/webview_switch_session.js +34 -0
  68. package/providers/_builtin/ide/pearai/scripts.js +74 -0
  69. package/providers/_builtin/ide/trae/provider.json +35 -0
  70. package/providers/_builtin/ide/trae/scripts/send_message.js +53 -3
  71. package/providers/_builtin/ide/trae/scripts.js +57 -0
  72. package/providers/_builtin/ide/vscode/provider.json +33 -0
  73. package/providers/_builtin/ide/vscode-insiders/provider.json +31 -0
  74. package/providers/_builtin/ide/vscodium/provider.json +32 -0
  75. package/providers/_builtin/ide/windsurf/provider.json +22 -0
  76. package/providers/_builtin/ide/windsurf/scripts.js +57 -0
  77. package/providers/_builtin/validate.js +156 -0
  78. package/README.md +0 -43
  79. package/dist/dev-console-monaco.js +0 -176
  80. package/dist/dev-console.css +0 -326
  81. package/dist/dev-console.html +0 -148
  82. package/dist/dev-console.js +0 -1165
  83. package/dist/index.d.ts +0 -2
  84. package/dist/node_datachannel-LPY6EJH5.node +0 -0
  85. package/providers/_builtin/acp/codex-cli/provider.js +0 -54
  86. package/providers/_builtin/acp/goose/provider.js +0 -32
  87. package/providers/_builtin/acp/opencode/provider.js +0 -32
  88. package/providers/_builtin/cli/claude-cli/provider.js +0 -125
  89. package/providers/_builtin/cli/codex-cli/provider.js +0 -77
  90. package/providers/_builtin/cli/gemini-cli/provider.js +0 -121
  91. package/providers/_builtin/ide/antigravity/provider.js +0 -114
  92. package/providers/_builtin/ide/cursor/provider.js.backup +0 -116
  93. package/providers/_builtin/ide/cursor/provider.js.bak +0 -127
  94. package/providers/_builtin/ide/cursor/scripts_backup/focus_editor.js +0 -20
  95. package/providers/_builtin/ide/cursor/scripts_backup/list_chats.js +0 -111
  96. package/providers/_builtin/ide/cursor/scripts_backup/new_session.js +0 -62
  97. package/providers/_builtin/ide/cursor/scripts_backup/open_panel.js +0 -31
  98. package/providers/_builtin/ide/cursor/scripts_backup/read_chat.js +0 -433
  99. package/providers/_builtin/ide/cursor/scripts_backup/resolve_action.js +0 -90
  100. package/providers/_builtin/ide/cursor/scripts_backup/send_message.js +0 -86
  101. package/providers/_builtin/ide/cursor/scripts_backup/switch_session.js +0 -63
  102. package/providers/_builtin/ide/kiro/provider.js +0 -86
  103. package/providers/_builtin/ide/pearai/provider.js +0 -88
  104. package/providers/_builtin/ide/trae/provider.js +0 -83
  105. package/providers/_builtin/ide/vscode/provider.js +0 -36
  106. package/providers/_builtin/ide/vscode-insiders/provider.js +0 -27
  107. package/providers/_builtin/ide/vscodium/provider.js +0 -27
  108. package/providers/_builtin/ide/windsurf/provider.js +0 -76
  109. /package/providers/{_helpers → _builtin/_helpers}/index.js +0 -0
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
Binary file
@@ -1,54 +0,0 @@
1
- /**
2
- * Codex CLI — ACP Provider
3
- *
4
- * Category: acp (Agent Client Protocol — JSON-RPC over stdio)
5
- *
6
- * Uses @zed-industries/codex-acp adapter:
7
- * https://github.com/zed-industries/codex-acp
8
- *
9
- * Install: npm install -g @zed-industries/codex-acp
10
- * Auth: OPENAI_API_KEY or CODEX_API_KEY environment variable
11
- *
12
- * @type {import('../../../../src/providers/contracts').ProviderModule}
13
- */
14
- module.exports = {
15
- type: 'codex-acp',
16
- name: 'Codex (ACP)',
17
- category: 'acp',
18
-
19
- displayName: 'Codex (ACP)',
20
- icon: '🤖',
21
-
22
- // ACP spawn config — uses codex-acp adapter
23
- spawn: {
24
- command: 'codex-acp',
25
- args: [],
26
- shell: false,
27
- },
28
-
29
- // Settings
30
- settings: {
31
- approvalAlert: {
32
- type: 'boolean',
33
- default: true,
34
- public: true,
35
- label: 'Approval Alerts',
36
- description: 'Show notification when Codex requires approval',
37
- },
38
- longGeneratingAlert: {
39
- type: 'boolean',
40
- default: true,
41
- public: true,
42
- label: 'Long Generation Alert',
43
- description: 'Alert when generation takes too long',
44
- },
45
- longGeneratingThresholdSec: {
46
- type: 'number',
47
- default: 180,
48
- public: true,
49
- label: 'Long Generation Threshold (sec)',
50
- min: 30,
51
- max: 600,
52
- },
53
- },
54
- };
@@ -1,32 +0,0 @@
1
- /**
2
- * Goose (Block) — ACP Provider
3
- *
4
- * Category: acp (Agent Client Protocol — JSON-RPC over stdio)
5
- *
6
- * Goose: https://block.github.io/goose/docs/guides/acp-clients
7
- *
8
- * @type {import('../../../../src/providers/contracts').ProviderModule}
9
- */
10
- module.exports = {
11
- type: 'goose',
12
- name: 'Goose',
13
- category: 'acp',
14
-
15
- displayName: 'Goose',
16
- icon: '🪿',
17
-
18
- spawn: {
19
- command: 'goose',
20
- args: ['acp'],
21
- shell: false,
22
- },
23
-
24
- settings: {
25
- approvalAlert: {
26
- type: 'boolean',
27
- default: true,
28
- public: true,
29
- label: 'Approval Alerts',
30
- },
31
- },
32
- };
@@ -1,32 +0,0 @@
1
- /**
2
- * OpenCode — ACP Provider
3
- *
4
- * Category: acp (Agent Client Protocol — JSON-RPC over stdio)
5
- *
6
- * SST OpenCode: https://github.com/sst/opencode
7
- *
8
- * @type {import('../../../../src/providers/contracts').ProviderModule}
9
- */
10
- module.exports = {
11
- type: 'opencode',
12
- name: 'OpenCode',
13
- category: 'acp',
14
-
15
- displayName: 'OpenCode',
16
- icon: '🟢',
17
-
18
- spawn: {
19
- command: 'opencode',
20
- args: ['--acp'],
21
- shell: false,
22
- },
23
-
24
- settings: {
25
- approvalAlert: {
26
- type: 'boolean',
27
- default: true,
28
- public: true,
29
- label: 'Approval Alerts',
30
- },
31
- },
32
- };
@@ -1,125 +0,0 @@
1
- /**
2
- * Claude Code — CLI Provider
3
- *
4
- * Category: cli (PTY 기반 — node-pty로 claude 프로세스 관리)
5
- *
6
- * Claude Code는 ⏺/⎿ 프리픽스로 응답 구조를 표시.
7
- * TerminalBuffer를 사용하여 스크린 콘텐츠를 읽음.
8
- *
9
- * @type {import('../../../../src/providers/contracts').ProviderModule}
10
- */
11
- module.exports = {
12
- type: 'claude-cli',
13
- name: 'Claude Code',
14
- category: 'cli',
15
-
16
- // ─── Provider Settings (대시보드에서 제어 가능) ───
17
- settings: {
18
- mode: {
19
- type: 'select',
20
- default: 'terminal',
21
- public: true,
22
- label: '표시 모드',
23
- description: 'terminal: PTY 터미널 뷰, chat: 파싱된 대화 뷰',
24
- options: ['terminal', 'chat'],
25
- },
26
- notifications: {
27
- type: 'boolean',
28
- default: true,
29
- public: true,
30
- label: '알림',
31
- description: '상태 변경 시 알림을 표시합니다',
32
- },
33
- autoApprove: {
34
- type: 'boolean',
35
- default: false,
36
- public: true,
37
- label: '자동 승인',
38
- description: '도구 실행 승인을 자동으로 허용합니다',
39
- },
40
- },
41
-
42
- // ─── CLI 실행 설정 ───
43
- binary: 'claude',
44
- spawn: {
45
- command: 'claude',
46
- args: [],
47
- shell: false,
48
- env: {},
49
- },
50
-
51
- // ─── PTY 출력 패턴 매칭 ───
52
- patterns: {
53
- prompt: [
54
- /❯\s*$/m,
55
- /[a-zA-Z0-9._-]+\s*>\s*$/m,
56
- /claude\s*>\s*$/m,
57
- /➜\s+.*\s*$/m,
58
- /\s+✗\s*$/m,
59
- /\?\s*for\s*shortcuts/i,
60
- /effort/i,
61
- ],
62
- generating: [
63
- /esc\s+to\s+interrupt/i,
64
- /⎋\s*to\s+interrupt/i,
65
- /press\s+esc\s+to\s+interrupt/i,
66
- /accept\s+edits\s+on/i,
67
- /shift\+tab\s+to\s+cycle/i,
68
- ],
69
- approval: [
70
- /allow\s+once/i,
71
- /always\s+allow/i,
72
- /\(y\)es\s*\/\s*\(n\)o/i,
73
- /\[y\/n\/a\]/i,
74
- /do\s+you\s+want\s+to\s+(run|proceed|allow|execute|make|create|delete|write|edit)/i,
75
- /proceed\?/i,
76
- /esc\s+to\s+cancel/i,
77
- /tab\s+to\s+amend/i,
78
- /yes,\s+allow\s+all\s+edits/i,
79
- ],
80
- ready: [
81
- /❯\s*$/m,
82
- /\?\s*for\s*shortcuts/i,
83
- ],
84
- },
85
-
86
- /**
87
- * Claude Code TUI 아티팩트 제거
88
- * ⏺ 프리픽스 응답 본문 추출, TUI 크롬 제거
89
- */
90
- cleanOutput(raw, _lastUserInput) {
91
- const allSegments = [];
92
- for (const line of raw.split('\n')) {
93
- const segs = line.split('\r').map(s => s.trim()).filter(Boolean);
94
- allSegments.push(...segs);
95
- }
96
-
97
- const responseLines = [];
98
- let foundResponse = false;
99
- for (const seg of allSegments) {
100
- if (seg.startsWith('⏺')) {
101
- foundResponse = true;
102
- responseLines.push(seg.replace(/^⏺\s*/, ''));
103
- continue;
104
- }
105
- if (seg.startsWith('⎿')) {
106
- if (foundResponse) responseLines.push(seg.replace(/^⎿\s*/, ''));
107
- continue;
108
- }
109
- if (foundResponse) {
110
- const s = seg.trim();
111
- // TUI junk
112
- if (/^❯/.test(s)) continue;
113
- if (/^\?\s*for\s*shortcuts/.test(s)) continue;
114
- if (/^[╭╰│├╮╯─═]+$/.test(s)) continue;
115
- if (/^◐\s/.test(s) || /\/effort/.test(s)) continue;
116
- if (/esc\s*to\s*interrupt/i.test(s)) continue;
117
- if (/^0;/.test(s)) continue;
118
- if (/^[✻✶✳✢✽·◆◇◐◑◒◓⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏]/.test(s) && s.length < 40) continue;
119
- responseLines.push(seg);
120
- }
121
- }
122
-
123
- return responseLines.join('\n').replace(/\n{3,}/g, '\n\n').trim();
124
- },
125
- };
@@ -1,77 +0,0 @@
1
- /**
2
- * Codex CLI — CLI Provider
3
- *
4
- * Category: cli (PTY 기반 — node-pty로 codex 프로세스 관리)
5
- *
6
- * OpenAI Codex CLI — 비교적 단순한 TUI.
7
- *
8
- * @type {import('../../../../src/providers/contracts').ProviderModule}
9
- */
10
- module.exports = {
11
- type: 'codex-cli',
12
- name: 'Codex CLI',
13
- category: 'cli',
14
-
15
- settings: {
16
- mode: {
17
- type: 'select', default: 'terminal', public: true,
18
- label: '표시 모드', options: ['terminal', 'chat'],
19
- },
20
- notifications: {
21
- type: 'boolean', default: true, public: true,
22
- label: '알림',
23
- },
24
- },
25
-
26
- // ─── CLI 실행 설정 ───
27
- binary: 'codex',
28
- spawn: {
29
- command: 'codex',
30
- args: ['--full-auto'],
31
- shell: false,
32
- env: {},
33
- },
34
-
35
- // ─── PTY 출력 패턴 매칭 ───
36
- patterns: {
37
- prompt: [
38
- /[❯>]\s*$/,
39
- /codex\s*>\s*$/m,
40
- /\$\s*$/m,
41
- ],
42
- generating: [
43
- /generating/i,
44
- /thinking/i,
45
- /esc\s+to\s+(interrupt|cancel)/i,
46
- ],
47
- approval: [
48
- /\(y\)es\s*\/\s*\(n\)o/i,
49
- /\[y\/n\]/i,
50
- /do\s+you\s+want\s+to\s+(run|proceed|allow|execute)/i,
51
- /proceed\?/i,
52
- /approve/i,
53
- ],
54
- ready: [
55
- /[❯>]\s*$/,
56
- /codex\s*>\s*$/m,
57
- ],
58
- },
59
-
60
- /**
61
- * Codex CLI 출력 정리 — 프롬프트, 상태바 제거
62
- */
63
- cleanOutput(raw, _lastUserInput) {
64
- const lines = raw.split('\n');
65
- const cleaned = [];
66
- for (const line of lines) {
67
- const t = line.trim();
68
- if (!t) { cleaned.push(''); continue; }
69
- if (/^[❯>]\s*$/.test(t)) continue;
70
- if (/^codex\s*>/.test(t)) continue;
71
- if (/^\$\s*$/.test(t)) continue;
72
- if (/^[\u2500\u2501\u2550]{4,}/.test(t)) continue;
73
- cleaned.push(line);
74
- }
75
- return cleaned.join('\n').replace(/\n{3,}/g, '\n\n').trim();
76
- },
77
- };
@@ -1,121 +0,0 @@
1
- /**
2
- * Gemini CLI — CLI Provider
3
- *
4
- * Category: cli (PTY 기반 — node-pty로 gemini 프로세스 관리)
5
- *
6
- * Gemini CLI는 INK/React TUI를 사용하여 터미널에 렌더링.
7
- * 출력에 박스 문자, 구분선, 상태바 등 TUI 아티팩트가 포함됨.
8
- * cleanOutput()에서 이를 제거하여 순수 응답만 추출.
9
- *
10
- * @type {import('../../../../src/providers/contracts').ProviderModule}
11
- */
12
- module.exports = {
13
- type: 'gemini-cli',
14
- name: 'Gemini CLI',
15
- category: 'cli',
16
-
17
- settings: {
18
- mode: {
19
- type: 'select', default: 'terminal', public: true,
20
- label: '표시 모드', options: ['terminal', 'chat'],
21
- },
22
- notifications: {
23
- type: 'boolean', default: true, public: true,
24
- label: '알림',
25
- },
26
- },
27
-
28
- // ─── CLI 실행 설정 ───
29
- binary: 'gemini',
30
- spawn: {
31
- command: 'gemini',
32
- args: ['--yolo'],
33
- shell: true,
34
- env: {},
35
- },
36
-
37
- // ─── PTY 출력 패턴 매칭 ───
38
- patterns: {
39
- prompt: [
40
- /Type your message/,
41
- /[❯>]\s*$/,
42
- /\n\s*[❯>]\s*$/,
43
- ],
44
- generating: [
45
- /esc\s+to\s+interrupt/i,
46
- /⎋\s*to\s+interrupt/i,
47
- /press\s+esc\s+to\s+interrupt/i,
48
- /accept\s+edits\s+on/i,
49
- /shift\+tab\s+to\s+cycle/i,
50
- /ctrl\+c\s+to\s+(cancel|interrupt|stop)/i,
51
- ],
52
- approval: [
53
- /allow\s+once/i,
54
- /always\s+allow/i,
55
- /\(y\)es\s*\/\s*\(n\)o/i,
56
- /\[y\/n\/a\]/i,
57
- /do\s+you\s+want\s+to\s+(run|proceed|allow|execute)/i,
58
- /proceed\?/i,
59
- ],
60
- ready: [
61
- /[❯>]\s*$/,
62
- /Gemini \d/i,
63
- ],
64
- },
65
-
66
- /**
67
- * Gemini CLI TUI 아티팩트 제거 — AI 응답 본문만 추출
68
- * INK/React TUI의 박스 문자, 구분선, 상태바, 프롬프트 등을 제거
69
- */
70
- cleanOutput(raw, lastUserInput) {
71
- const lines = raw.split('\n');
72
- const cleaned = [];
73
-
74
- for (const line of lines) {
75
- const trimmed = line.trim();
76
- if (!trimmed) { cleaned.push(''); continue; }
77
-
78
- // 박스 문자 줄
79
- if (/^[\u256d\u256e\u2570\u256f\u2502\u251c\u2524\u252c\u2534\u253c\u2500\u2501\u2550\u2554\u2557\u255a\u255d\u2551]+$/.test(trimmed)) continue;
80
- if (/^[\u256d\u2570]\u2500\u2500/.test(trimmed) || /\u2500\u2500[\u256e\u256f]$/.test(trimmed)) continue;
81
- if (/^\u2502.*\u2502$/.test(trimmed)) continue;
82
-
83
- // 구분선
84
- if (/[\u2500\u2501\u2550\u2580\u2584]{4,}/.test(trimmed)) continue;
85
-
86
- // 상태바/메타
87
- if (/^YOLO\s+ctrl\+y/i.test(trimmed)) continue;
88
- if (/^\? for shortcuts/.test(trimmed)) continue;
89
- if (/^\/model\s/i.test(trimmed)) continue;
90
- if (/^~\s.*no sandbox/i.test(trimmed)) continue;
91
- if (/^Type your message/i.test(trimmed)) continue;
92
- if (/ctrl\+[a-z]/i.test(trimmed) && trimmed.length < 50) continue;
93
-
94
- // 단축키 도움말
95
- if (/Shortcuts?\s*\(for more/i.test(trimmed)) continue;
96
- if (/shell mode|cycle mode|paste images|select file or folder/i.test(trimmed)) continue;
97
-
98
- // 프롬프트 줄
99
- if (/^[❯>]\s*$/.test(trimmed)) continue;
100
- if (/^[*•]\s*$/.test(trimmed)) continue;
101
-
102
- // 사용자 입력 에코
103
- if (lastUserInput && /^[*•]\s/.test(trimmed)) {
104
- const bulletContent = trimmed.replace(/^[*•]\s*/, '').trim();
105
- if (bulletContent === lastUserInput.trim()) continue;
106
- }
107
-
108
- // 업데이트/인증 안내
109
- if (/Gemini CLI update available/i.test(trimmed)) continue;
110
- if (/brew upgrade gemini-cli/i.test(trimmed)) continue;
111
- if (/Waiting for auth/i.test(trimmed)) continue;
112
-
113
- // 스피너 문자만 있는 줄
114
- if (/^[\u280b\u2819\u2839\u2838\u283c\u2834\u2826\u2827\u2807\u280f\s]+$/.test(trimmed)) continue;
115
-
116
- cleaned.push(line);
117
- }
118
-
119
- return cleaned.join('\n').replace(/\n{3,}/g, '\n\n').trim();
120
- },
121
- };
@@ -1,114 +0,0 @@
1
- /**
2
- * Antigravity — IDE Provider
3
- *
4
- * Category: ide (workbench CDP session — iframe 없음, 직접 DOM 접근)
5
- *
6
- * 특이 사항:
7
- * - contenteditable[role="textbox"] 입력 (Lexical 에디터)
8
- * - send_message에서 Enter keydown+keypress+keyup full sequence 필요 (composed: true)
9
- * - switch_session에서 CDP 마우스 클릭 좌표 반환 (needsTypeAndSend 아님, Input.dispatchMouseEvent)
10
- * - resolve_action 사용
11
- *
12
- * @type {import('../../../src/providers/contracts').ProviderModule}
13
- */
14
- const fs = require('fs');
15
- const path = require('path');
16
-
17
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
18
-
19
- function loadScript(name) {
20
- try {
21
- return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8');
22
- } catch {
23
- return null;
24
- }
25
- }
26
-
27
- module.exports = {
28
- // ─── 메타데이터 ───
29
- type: 'antigravity',
30
- name: 'Antigravity',
31
- category: 'ide',
32
-
33
- // ─── IDE 인프라 ───
34
- displayName: 'Antigravity',
35
- icon: '🚀',
36
- cli: 'antigravity',
37
- cdpPorts: [9335, 9336],
38
- processNames: {
39
- darwin: 'Antigravity',
40
- win32: ['Antigravity.exe'],
41
- },
42
- paths: {
43
- darwin: ['/Applications/Antigravity.app'],
44
- win32: ['C:\\Users\\*\\AppData\\Local\\Programs\\antigravity\\Antigravity.exe'],
45
- linux: ['/opt/Antigravity', '/usr/share/antigravity'],
46
- },
47
-
48
- // ─── Input method ───
49
- inputMethod: 'cdp-type-and-send',
50
- inputSelector: '[contenteditable="true"][role="textbox"]',
51
-
52
- // ─── CDP 스크립트 ───
53
- scripts: {
54
- readChat() {
55
- return loadScript('read_chat.js');
56
- },
57
-
58
- sendMessage(text) {
59
- const script = loadScript('send_message.js');
60
- if (!script) return null;
61
- // ${ MESSAGE } 템플릿 변수 치환
62
- return script.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text));
63
- },
64
-
65
- listSessions() {
66
- return loadScript('list_chats.js');
67
- },
68
-
69
- switchSession(sessionId) {
70
- const script = loadScript('switch_session.js');
71
- if (!script) return null;
72
- return script.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId));
73
- },
74
-
75
- newSession() {
76
- return loadScript('new_session.js');
77
- },
78
-
79
- resolveAction(params) {
80
- const action = typeof params === 'string' ? params : params?.action || 'approve';
81
- const buttonText = params?.button || params?.buttonText
82
- || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
83
- const script = loadScript('resolve_action.js');
84
- if (!script) return null;
85
- return script.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText));
86
- },
87
-
88
- focusEditor() {
89
- return loadScript('focus_editor.js');
90
- },
91
-
92
- listModels() {
93
- return loadScript('list_models.js');
94
- },
95
-
96
- setModel(params) {
97
- const model = typeof params === 'string' ? params : params?.model;
98
- const script = loadScript('set_model.js');
99
- if (!script) return null;
100
- return script.replace(/\$\{\s*MODEL\s*\}/g, JSON.stringify(model));
101
- },
102
-
103
- listModes() {
104
- return loadScript('list_modes.js');
105
- },
106
-
107
- setMode(params) {
108
- const mode = typeof params === 'string' ? params : params?.mode;
109
- const script = loadScript('set_mode.js');
110
- if (!script) return null;
111
- return script.replace(/\$\{\s*MODE\s*\}/g, JSON.stringify(mode));
112
- },
113
- },
114
- };
@@ -1,116 +0,0 @@
1
- /**
2
- * Cursor — IDE Provider
3
- *
4
- * Category: ide (workbench CDP session — iframe 없음)
5
- *
6
- * 특이 사항:
7
- * - .composer-view 컨테이너 (data-composer-id, data-composer-status)
8
- * - contenteditable[role="textbox"] 또는 textarea.native-input
9
- * - Fiber summaries 기반 제목 추출
10
- * - 6단계 모달 감지 계층 (overlay → run-command-review → ancestor → dialog → inline → quickInput → AI msg)
11
- * - resolve_modal 사용
12
- *
13
- * @type {import('../../../src/providers/contracts').ProviderModule}
14
- */
15
- const fs = require('fs');
16
- const path = require('path');
17
-
18
- const SCRIPTS_DIR = path.join(__dirname, 'scripts');
19
-
20
- function loadScript(name) {
21
- try {
22
- return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8');
23
- } catch {
24
- return null;
25
- }
26
- }
27
-
28
- module.exports = {
29
- type: 'cursor',
30
- name: 'Cursor',
31
- category: 'ide',
32
-
33
- // ─── IDE 인프라 ───
34
- displayName: 'Cursor',
35
- icon: '⚡',
36
- cli: 'cursor',
37
- cdpPorts: [9333, 9334],
38
- processNames: {
39
- darwin: 'Cursor',
40
- win32: ['Cursor.exe'],
41
- },
42
- paths: {
43
- darwin: ['/Applications/Cursor.app'],
44
- win32: ['C:\\Users\\*\\AppData\\Local\\Programs\\cursor\\Cursor.exe'],
45
- linux: ['/opt/Cursor', '/usr/share/cursor'],
46
- },
47
-
48
- inputMethod: 'cdp-type-and-send',
49
- inputSelector: '[contenteditable="true"][role="textbox"]',
50
-
51
- scripts: {
52
- readChat() {
53
- return loadScript('read_chat.js');
54
- },
55
-
56
- sendMessage(text) {
57
- const script = loadScript('send_message.js');
58
- if (!script) return null;
59
- return script.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text));
60
- },
61
-
62
- listSessions() {
63
- return loadScript('list_chats.js');
64
- },
65
-
66
- switchSession(sessionId) {
67
- const script = loadScript('switch_session.js');
68
- if (!script) return null;
69
- return script.replace(/\$\{\s*SESSION_ID\s*\}/g, JSON.stringify(sessionId));
70
- },
71
-
72
- newSession() {
73
- return loadScript('new_session.js');
74
- },
75
-
76
- resolveModal(buttonText) {
77
- const script = loadScript('resolve_modal.js');
78
- if (!script) return null;
79
- return script.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText));
80
- },
81
-
82
- focusEditor() {
83
- return loadScript('focus_editor.js');
84
- },
85
-
86
- openPanel() {
87
- return loadScript('open_panel.js');
88
- },
89
-
90
- probe() {
91
- return `(() => {
92
- const checks = [];
93
- try {
94
- const composer = document.querySelector('.composer-view, .chat-view, [data-composer-id]');
95
- checks.push({ name: 'composer_view', passed: !!composer });
96
-
97
- const editor = document.querySelector('[contenteditable="true"][role="textbox"]')
98
- || document.querySelector('textarea.native-input');
99
- checks.push({ name: 'editor', passed: !!editor });
100
-
101
- const composerId = composer?.getAttribute('data-composer-id');
102
- checks.push({ name: 'composer_id', passed: !!composerId });
103
-
104
- const msgEls = document.querySelectorAll('[data-message-id]');
105
- checks.push({ name: 'message_elements', passed: msgEls.length > 0, message: msgEls.length + ' messages' });
106
-
107
- const healthy = checks.filter(c => c.passed).length >= 2;
108
- return JSON.stringify({ healthy, checks });
109
- } catch (e) {
110
- checks.push({ name: 'error', passed: false, message: e.message });
111
- return JSON.stringify({ healthy: false, checks });
112
- }
113
- })()`;
114
- },
115
- },
116
- };