vg-coder-cli 2.0.9 → 2.0.10
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/README.md +19 -0
- package/SYSTEM_PROMPT.md +157 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +206 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +206 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/detectors/index.html +116 -0
- package/coverage/lcov-report/src/detectors/project-detector.js.html +1084 -0
- package/coverage/lcov-report/src/exporter/html-exporter.js.html +2839 -0
- package/coverage/lcov-report/src/exporter/index.html +116 -0
- package/coverage/lcov-report/src/ignore/ignore-manager.js.html +979 -0
- package/coverage/lcov-report/src/ignore/index.html +116 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.js.html +928 -0
- package/coverage/lcov-report/src/scanner/file-scanner.js.html +1903 -0
- package/coverage/lcov-report/src/scanner/index.html +116 -0
- package/coverage/lcov-report/src/tokenizer/index.html +116 -0
- package/coverage/lcov-report/src/tokenizer/token-manager.js.html +1252 -0
- package/coverage/lcov-report/src/utils/helpers.js.html +469 -0
- package/coverage/lcov-report/src/utils/index.html +116 -0
- package/coverage/lcov.info +1396 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/detectors/index.html +116 -0
- package/coverage/src/detectors/project-detector.js.html +1084 -0
- package/coverage/src/exporter/html-exporter.js.html +2839 -0
- package/coverage/src/exporter/index.html +116 -0
- package/coverage/src/ignore/ignore-manager.js.html +979 -0
- package/coverage/src/ignore/index.html +116 -0
- package/coverage/src/index.html +116 -0
- package/coverage/src/index.js.html +928 -0
- package/coverage/src/scanner/file-scanner.js.html +1903 -0
- package/coverage/src/scanner/index.html +116 -0
- package/coverage/src/tokenizer/index.html +116 -0
- package/coverage/src/tokenizer/token-manager.js.html +1252 -0
- package/coverage/src/utils/helpers.js.html +469 -0
- package/coverage/src/utils/index.html +116 -0
- package/jest.config.js +16 -0
- package/package.json +5 -3
- package/scripts/build.js +40 -0
- package/src/server/api-server.js +15 -0
- package/src/server/views/css/structure.css +63 -37
- package/src/server/views/dashboard.css +176 -312
- package/src/server/views/dashboard.html +149 -120
- package/src/server/views/js/main.js +60 -0
- package/src/server/views/vg-coder/assets/icon128.png +0 -0
- package/src/server/views/vg-coder/assets/icon16.png +0 -0
- package/src/server/views/vg-coder/assets/icon48.png +0 -0
- package/src/server/views/vg-coder/background.js +2 -0
- package/src/server/views/vg-coder/background.js.LICENSE.txt +118 -0
- package/src/server/views/vg-coder/controller.js +1 -0
- package/src/server/views/vg-coder/manifest.json +58 -0
- package/src/server/views/vg-coder/options.css +164 -0
- package/src/server/views/vg-coder/options.html +48 -0
- package/src/server/views/vg-coder/options.js +1 -0
- package/src/server/views/vg-coder/rules.json +23 -0
- package/vg-coder-cli-2.0.10.tgz +0 -0
- package/vg-coder.zip +0 -0
- package/vg-coder-cli-2.0.8.tgz +0 -0
- package/vg-coder-cli-2.0.9.tgz +0 -0
|
@@ -5,14 +5,11 @@
|
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
<meta name="viewport"
|
|
7
7
|
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
8
|
-
<
|
|
9
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
10
|
-
<title>VG Coder API Dashboard</title>
|
|
8
|
+
<title>VG Coder - Split View</title>
|
|
11
9
|
<link rel="stylesheet" href="/dashboard.css">
|
|
12
10
|
<link rel="stylesheet" href="/css/structure.css">
|
|
13
11
|
<script>
|
|
14
|
-
|
|
15
|
-
(function() {
|
|
12
|
+
(function () {
|
|
16
13
|
const savedTheme = localStorage.getItem('theme') || 'light';
|
|
17
14
|
document.documentElement.setAttribute('data-theme', savedTheme);
|
|
18
15
|
})();
|
|
@@ -20,138 +17,170 @@
|
|
|
20
17
|
</head>
|
|
21
18
|
|
|
22
19
|
<body>
|
|
23
|
-
<div class="
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<div
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<!-- System Prompt Section -->
|
|
37
|
-
<div class="system-prompt-card">
|
|
38
|
-
<div class="system-prompt-header" onclick="toggleSystemPrompt()">
|
|
39
|
-
<div class="header-title-group">
|
|
40
|
-
<button class="btn-icon-head" onclick="copySystemPromptFromHeader(event)" title="Copy System Prompt">
|
|
41
|
-
📋
|
|
20
|
+
<div class="split-layout">
|
|
21
|
+
<!-- CỘT TRÁI: Giao diện VG Coder cũ -->
|
|
22
|
+
<div class="left-panel">
|
|
23
|
+
<div class="container">
|
|
24
|
+
<div class="header">
|
|
25
|
+
<div class="header-content">
|
|
26
|
+
<span class="status" id="status">● Server Starting...</span>
|
|
27
|
+
<div style="height: 5px;"></div>
|
|
28
|
+
</div>
|
|
29
|
+
<button class="theme-toggle" id="theme-toggle" title="Toggle Dark Mode">
|
|
30
|
+
<span id="theme-icon">🌙</span>
|
|
42
31
|
</button>
|
|
43
|
-
<h2>System Prompt</h2>
|
|
44
32
|
</div>
|
|
45
|
-
<span class="toggle-icon" id="toggle-icon">▼</span>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="system-prompt-content" id="system-prompt-content">
|
|
48
|
-
<div class="prompt-text" id="prompt-text"></div>
|
|
49
|
-
<button class="btn btn-copy" onclick="copySystemPrompt(event)">
|
|
50
|
-
<span id="copy-icon">📋</span>
|
|
51
|
-
<span id="copy-text">Copy System Prompt</span>
|
|
52
|
-
</button>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
33
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
34
|
+
<!-- System Prompt Section -->
|
|
35
|
+
<div class="system-prompt-card">
|
|
36
|
+
<div class="system-prompt-header" onclick="toggleSystemPrompt()">
|
|
37
|
+
<div class="header-title-group">
|
|
38
|
+
<button class="btn-icon-head" onclick="copySystemPromptFromHeader(event)"
|
|
39
|
+
title="Copy System Prompt">
|
|
40
|
+
📋
|
|
41
|
+
</button>
|
|
42
|
+
<h2>System Prompt</h2>
|
|
43
|
+
</div>
|
|
44
|
+
<span class="toggle-icon" id="toggle-icon">▼</span>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="system-prompt-content" id="system-prompt-content">
|
|
47
|
+
<div class="prompt-text" id="prompt-text"></div>
|
|
48
|
+
<button class="btn btn-copy" onclick="copySystemPrompt(event)">
|
|
49
|
+
<span id="copy-icon">📋</span>
|
|
50
|
+
<span id="copy-text">Copy System Prompt</span>
|
|
51
|
+
</button>
|
|
64
52
|
</div>
|
|
65
|
-
<!-- Right side: Download Icon -->
|
|
66
|
-
<button class="btn-icon-head" onclick="testAnalyze(event)" title="Download Project Source">
|
|
67
|
-
📥
|
|
68
|
-
</button>
|
|
69
|
-
</div>
|
|
70
|
-
<p class="endpoint-desc">Phân tích dự án và lấy toàn bộ source code.</p>
|
|
71
|
-
<div class="form-group">
|
|
72
|
-
<label>Path</label>
|
|
73
|
-
<input type="text" id="analyze-path" value="." placeholder="Project path (e.g. .)">
|
|
74
|
-
</div>
|
|
75
|
-
<div class="btn-group">
|
|
76
|
-
<!-- Big Download button removed as it's now in the header -->
|
|
77
|
-
<button class="btn btn-copy" onclick="copyAnalyzeResult(event)">
|
|
78
|
-
<span id="analyze-copy-icon">📋</span>
|
|
79
|
-
<span id="analyze-copy-text">Copy Text</span>
|
|
80
|
-
</button>
|
|
81
53
|
</div>
|
|
82
|
-
<div class="response" id="analyze-response"></div>
|
|
83
|
-
</div>
|
|
84
54
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
55
|
+
<!-- Extension Installation Guide -->
|
|
56
|
+
<div class="system-prompt-card" id="extension-card">
|
|
57
|
+
<div class="system-prompt-header" onclick="toggleExtensionGuide()">
|
|
58
|
+
<div class="header-title-group">
|
|
59
|
+
<span style="font-size: 16px;">🧩</span>
|
|
60
|
+
<h2>Cài đặt Chrome Extension</h2>
|
|
61
|
+
</div>
|
|
62
|
+
<span class="toggle-icon" id="ext-toggle-icon">▼</span>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="system-prompt-content" id="extension-content">
|
|
65
|
+
<div class="extension-steps">
|
|
66
|
+
<ol>
|
|
67
|
+
<li style="margin-bottom: 8px;">
|
|
68
|
+
Copy link này và dán vào tab mới:
|
|
69
|
+
<div class="form-group" style="margin-top: 5px; margin-bottom: 0;">
|
|
70
|
+
<div style="display: flex; gap: 5px;">
|
|
71
|
+
<input type="text" id="chrome-url-input" readonly value="chrome://extensions" onclick="this.select()" style="font-family: monospace;">
|
|
72
|
+
<button class="btn btn-copy" style="flex: 0 0 40px; padding: 0;" onclick="copyChromeUrl(event)" title="Copy URL">
|
|
73
|
+
<span>📋</span>
|
|
74
|
+
</button>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</li>
|
|
78
|
+
<li>Bật <b>Developer mode</b> (Góc phải trên cùng)</li>
|
|
79
|
+
<li>Chọn <b>Load unpacked</b></li>
|
|
80
|
+
<li>Dán đường dẫn bên dưới vào:</li>
|
|
81
|
+
</ol>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="form-group">
|
|
84
|
+
<input type="text" id="extension-path-input" readonly value="Loading path..." onclick="this.select()">
|
|
85
|
+
</div>
|
|
86
|
+
<button class="btn btn-copy" onclick="copyExtensionPath(event)">
|
|
87
|
+
<span id="ext-copy-icon">📋</span>
|
|
88
|
+
<span id="ext-copy-text">Copy Path</span>
|
|
89
|
+
</button>
|
|
91
90
|
</div>
|
|
92
|
-
<!-- Could add an execute icon here later if needed -->
|
|
93
|
-
</div>
|
|
94
|
-
<p class="endpoint-desc">Thực thi bash script với syntax validation.</p>
|
|
95
|
-
<div class="form-group">
|
|
96
|
-
<label>Bash Script</label>
|
|
97
|
-
<textarea id="execute-bash"
|
|
98
|
-
placeholder="mkdir -p src/test echo 'Hello' > src/test/hello.txt"></textarea>
|
|
99
|
-
</div>
|
|
100
|
-
<div class="btn-group">
|
|
101
|
-
<button class="btn" onclick="testExecute(event)">
|
|
102
|
-
<span>▶️</span>
|
|
103
|
-
<span>Run Script</span>
|
|
104
|
-
</button>
|
|
105
|
-
<button class="btn" onclick="executeFromClipboard(event)">
|
|
106
|
-
<span>📋</span>
|
|
107
|
-
<span>Paste & Run</span>
|
|
108
|
-
</button>
|
|
109
91
|
</div>
|
|
110
|
-
<div class="response" id="execute-response"></div>
|
|
111
|
-
</div>
|
|
112
92
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
93
|
+
<div class="endpoints">
|
|
94
|
+
<!-- Analyze -->
|
|
95
|
+
<div class="endpoint-card">
|
|
96
|
+
<div class="endpoint-header">
|
|
97
|
+
<div class="endpoint-title-group">
|
|
98
|
+
<span class="method post">POST</span>
|
|
99
|
+
<span class="endpoint-path">/analyze</span>
|
|
100
|
+
</div>
|
|
101
|
+
<button class="btn-icon-head" onclick="testAnalyze(event)" title="Download Project Source">
|
|
102
|
+
📥
|
|
103
|
+
</button>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="form-group">
|
|
106
|
+
<input type="text" id="analyze-path" value="." placeholder="Project path (e.g. .)">
|
|
107
|
+
</div>
|
|
108
|
+
<div class="btn-group">
|
|
109
|
+
<button class="btn btn-copy" onclick="copyAnalyzeResult(event)">
|
|
110
|
+
<span id="analyze-copy-icon">📋</span>
|
|
111
|
+
<span id="analyze-copy-text">Copy Text</span>
|
|
112
|
+
</button>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="response" id="analyze-response"></div>
|
|
119
115
|
</div>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
116
|
+
|
|
117
|
+
<!-- Execute Bash -->
|
|
118
|
+
<div class="endpoint-card">
|
|
119
|
+
<div class="endpoint-header">
|
|
120
|
+
<div class="endpoint-title-group">
|
|
121
|
+
<span class="method post">POST</span>
|
|
122
|
+
<span class="endpoint-path">/execute</span>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="form-group">
|
|
126
|
+
<textarea id="execute-bash"
|
|
127
|
+
placeholder="mkdir -p src/test echo 'Hello' > src/test/hello.txt"></textarea>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="btn-group">
|
|
130
|
+
<button class="btn" onclick="testExecute(event)">
|
|
131
|
+
<span>▶️</span> Run
|
|
132
|
+
</button>
|
|
133
|
+
<button class="btn" onclick="executeFromClipboard(event)">
|
|
134
|
+
<span>📋</span> Paste & Run
|
|
135
|
+
</button>
|
|
136
|
+
</div>
|
|
137
|
+
<div class="response" id="execute-response"></div>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<!-- Structure -->
|
|
141
|
+
<div class="endpoint-card">
|
|
142
|
+
<div class="endpoint-header">
|
|
143
|
+
<div class="endpoint-title-group">
|
|
144
|
+
<span class="method get" style="background: var(--ios-blue); color: white;">GET</span>
|
|
145
|
+
<span class="endpoint-path">/structure</span>
|
|
146
|
+
</div>
|
|
147
|
+
<button class="btn-icon-head" onclick="copySelectedStructure(event)" title="Copy Selected">
|
|
148
|
+
📋
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="form-group">
|
|
152
|
+
<input type="text" id="structure-path" value="." placeholder="Project path">
|
|
153
|
+
</div>
|
|
154
|
+
<div class="btn-group">
|
|
155
|
+
<button class="btn" onclick="testStructure(event)">
|
|
156
|
+
<span>🌳</span> View
|
|
157
|
+
</button>
|
|
158
|
+
</div>
|
|
159
|
+
<div class="tree-container" id="structure-tree" style="display: none;">
|
|
160
|
+
<div class="tree-header">
|
|
161
|
+
<span>Tree</span>
|
|
162
|
+
<span class="tree-total-tokens" id="total-tokens-badge">0 tokens</span>
|
|
163
|
+
</div>
|
|
164
|
+
<div class="tree-content" id="tree-content"></div>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="response" id="structure-response" style="display: none;"></div>
|
|
145
167
|
</div>
|
|
146
|
-
<div class="tree-content" id="tree-content"></div>
|
|
147
168
|
</div>
|
|
148
|
-
<div
|
|
169
|
+
<div style="height: 50px;"></div> <!-- Spacer for scrolling -->
|
|
149
170
|
</div>
|
|
150
171
|
</div>
|
|
172
|
+
|
|
173
|
+
<!-- CỘT PHẢI: Iframe ChatGPT -->
|
|
174
|
+
<div class="right-panel">
|
|
175
|
+
<div class="iframe-placeholder">
|
|
176
|
+
<p>⚠️ Nếu trang trắng, hãy cài Extension <b>"Ignore X-Frame-Options"</b></p>
|
|
177
|
+
<a href="https://chatgpt.com" target="_blank" class="link-fallback">Mở ChatGPT tab mới ↗</a>
|
|
178
|
+
</div>
|
|
179
|
+
<iframe src="https://chatgpt.com" title="ChatGPT Integration"></iframe>
|
|
180
|
+
</div>
|
|
151
181
|
</div>
|
|
152
182
|
|
|
153
183
|
<div class="toast" id="toast"></div>
|
|
154
|
-
|
|
155
184
|
<script type="module" src="/js/main.js"></script>
|
|
156
185
|
</body>
|
|
157
186
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { SYSTEM_PROMPT } from './config.js';
|
|
3
3
|
import { checkHealth } from './api.js';
|
|
4
4
|
import './handlers.js'; // Import to register global functions
|
|
5
|
+
import { showToast, showCopiedState } from './utils.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Initialize application on DOM ready
|
|
@@ -15,6 +16,9 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|
|
15
16
|
|
|
16
17
|
// Initialize Theme
|
|
17
18
|
initTheme();
|
|
19
|
+
|
|
20
|
+
// Load Extension Path
|
|
21
|
+
loadExtensionPath();
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
/**
|
|
@@ -70,3 +74,59 @@ function updateThemeIcon(theme) {
|
|
|
70
74
|
themeIcon.textContent = '🌙';
|
|
71
75
|
}
|
|
72
76
|
}
|
|
77
|
+
|
|
78
|
+
// Extension Helpers
|
|
79
|
+
async function loadExtensionPath() {
|
|
80
|
+
try {
|
|
81
|
+
const res = await fetch('/api/extension-path');
|
|
82
|
+
const data = await res.json();
|
|
83
|
+
const input = document.getElementById('extension-path-input');
|
|
84
|
+
|
|
85
|
+
if (data.exists) {
|
|
86
|
+
input.value = data.path;
|
|
87
|
+
} else {
|
|
88
|
+
input.value = "Error: Extension folder not found. Run 'npm run build' first.";
|
|
89
|
+
input.style.color = "var(--ios-red)";
|
|
90
|
+
}
|
|
91
|
+
} catch (err) {
|
|
92
|
+
console.error('Failed to load extension path', err);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Expose extension handlers to window for onclick events
|
|
97
|
+
window.toggleExtensionGuide = function() {
|
|
98
|
+
const content = document.getElementById('extension-content');
|
|
99
|
+
const icon = document.getElementById('ext-toggle-icon');
|
|
100
|
+
content.classList.toggle('open');
|
|
101
|
+
icon.classList.toggle('open');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
window.copyExtensionPath = function(event) {
|
|
105
|
+
const input = document.getElementById('extension-path-input');
|
|
106
|
+
const btn = event.currentTarget;
|
|
107
|
+
const icon = document.getElementById('ext-copy-icon');
|
|
108
|
+
const text = document.getElementById('ext-copy-text');
|
|
109
|
+
|
|
110
|
+
navigator.clipboard.writeText(input.value).then(() => {
|
|
111
|
+
showCopiedState(btn, icon, text, '📋', 'Copy Path');
|
|
112
|
+
showToast('Đã copy đường dẫn extension', 'success');
|
|
113
|
+
}).catch(err => {
|
|
114
|
+
showToast('Lỗi copy: ' + err.message, 'error');
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
window.copyChromeUrl = function(event) {
|
|
119
|
+
const input = document.getElementById('chrome-url-input');
|
|
120
|
+
const btn = event.currentTarget;
|
|
121
|
+
const originalText = btn.innerHTML;
|
|
122
|
+
|
|
123
|
+
navigator.clipboard.writeText(input.value).then(() => {
|
|
124
|
+
btn.innerHTML = '✓';
|
|
125
|
+
showToast('Đã copy URL', 'success');
|
|
126
|
+
setTimeout(() => {
|
|
127
|
+
btn.innerHTML = originalText;
|
|
128
|
+
}, 1500);
|
|
129
|
+
}).catch(err => {
|
|
130
|
+
showToast('Lỗi copy: ' + err.message, 'error');
|
|
131
|
+
});
|
|
132
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|