adhdev 0.1.47 → 0.1.49

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.
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Trae — IDE Provider
3
+ *
4
+ * Category: ide (VS Code fork by ByteDance)
5
+ * AI-powered code editor
6
+ *
7
+ * @type {import('../../../src/providers/contracts').ProviderModule}
8
+ */
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+
12
+ const SCRIPTS_DIR = path.join(__dirname, 'scripts');
13
+
14
+ function loadScript(name) {
15
+ try {
16
+ return fs.readFileSync(path.join(SCRIPTS_DIR, name), 'utf8');
17
+ } catch {
18
+ return null;
19
+ }
20
+ }
21
+
22
+ module.exports = {
23
+ type: 'trae',
24
+ name: 'Trae',
25
+ category: 'ide',
26
+
27
+ // ─── IDE 인프라 ───
28
+ displayName: 'Trae',
29
+ icon: '🔮',
30
+ cli: 'trae',
31
+ cdpPorts: [9353, 9354],
32
+ processNames: {
33
+ darwin: 'Trae',
34
+ win32: ['Trae.exe'],
35
+ linux: ['trae'],
36
+ },
37
+ paths: {
38
+ darwin: ['/Applications/Trae.app'],
39
+ win32: [
40
+ 'C:\\Users\\*\\AppData\\Local\\Programs\\trae\\Trae.exe',
41
+ ],
42
+ linux: ['/opt/trae', '/usr/share/trae'],
43
+ },
44
+
45
+ inputMethod: 'cdp-type-and-send',
46
+ inputSelector: '[contenteditable="true"][role="textbox"]',
47
+
48
+ scripts: {
49
+ readChat() { return loadScript('read_chat.js'); },
50
+ sendMessage(text) {
51
+ const s = loadScript('send_message.js');
52
+ return s ? s.replace(/\$\{\s*MESSAGE\s*\}/g, JSON.stringify(text)) : null;
53
+ },
54
+ resolveAction(params) {
55
+ const action = typeof params === 'string' ? params : params?.action || 'approve';
56
+ const buttonText = params?.button || params?.buttonText
57
+ || (action === 'approve' ? 'Accept' : action === 'reject' ? 'Reject' : action);
58
+ const s = loadScript('resolve_action.js');
59
+ return s ? s.replace(/\$\{\s*BUTTON_TEXT\s*\}/g, JSON.stringify(buttonText)) : null;
60
+ },
61
+ },
62
+ };