vg-coder-cli 2.0.39 → 2.0.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vg-coder-cli",
3
- "version": "2.0.39",
3
+ "version": "2.0.41",
4
4
  "description": "🚀 CLI tool to analyze projects, concatenate source files, count tokens, and export HTML with syntax highlighting and copy functionality",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -31,16 +31,15 @@
31
31
  "author": "VG Coder",
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "-": "^0.0.1",
35
34
  "body-parser": "^1.20.2",
36
35
  "chalk": "^4.1.2",
36
+ "clipboardy": "^5.0.2",
37
37
  "commander": "^11.1.0",
38
38
  "cors": "^2.8.5",
39
39
  "diff2html": "^3.4.52",
40
40
  "directory-tree": "^3.5.1",
41
41
  "express": "^4.18.2",
42
42
  "fs-extra": "^11.3.3",
43
- "g": "^2.0.1",
44
43
  "highlight.js": "^11.9.0",
45
44
  "ignore": "^5.3.0",
46
45
  "markdown-it": "^14.0.0",
@@ -51,7 +50,6 @@
51
50
  "socket.io": "^4.7.2",
52
51
  "socket.io-client": "^4.8.3",
53
52
  "tiktoken": "^1.0.10",
54
- "vg-coder-cli": "^2.0.38",
55
53
  "xterm": "^5.3.0",
56
54
  "xterm-addon-fit": "^0.8.0"
57
55
  },
package/src/index.js CHANGED
@@ -236,17 +236,11 @@ class VGCoderCLI {
236
236
  console.log(`📡 URL: http://localhost:${server.port}`);
237
237
  console.log(chalk.cyan('──────────────────────────────────────────────────'));
238
238
 
239
- // Only show extension guide if extension folder exists
240
- if (await fs.pathExists(extensionPath)) {
241
- console.log(chalk.yellow('\n🧩 CHƯA CÀI EXTENSION?'));
242
- console.log('1. Truy cập: chrome://extensions');
243
- console.log('2. Bật "Developer mode" (Góc phải trên)');
244
- console.log('3. Bấm "Load unpacked" và chọn thư mục dưới đây:');
245
- console.log(chalk.bgBlue.white.bold(` ${extensionPath} `));
246
- } else {
247
- console.log(chalk.yellow('\n🧩 Extension đã được đóng gói với npm package'));
248
- console.log('📦 Extension sẽ được inject tự động qua server');
249
- }
239
+ console.log(chalk.yellow('\n🧩 CHƯA CÀI EXTENSION?'));
240
+ console.log('1. Truy cập: chrome://extensions');
241
+ console.log('2. Bật "Developer mode" (Góc phải trên)');
242
+ console.log('3. Bấm "Load unpacked" và chọn thư mục dưới đây:');
243
+ console.log(chalk.bgBlue.white.bold(` ${extensionPath} `));
250
244
 
251
245
  console.log(chalk.yellow('\n👉 HƯỚNG DẪN SỬ DỤNG:'));
252
246
  console.log('1. Mở trang chat AI (ChatGPT, Claude, v.v.)');
@@ -411,10 +411,23 @@ class ApiServer {
411
411
  this.app.get('/api/extension-path', (req, res) => {
412
412
  try {
413
413
  const extensionPath = path.join(__dirname, 'views', 'vg-coder');
414
- res.json({ path: extensionPath, exists: fs.existsSync(extensionPath) });
414
+ res.json({ path:extensionPath, exists: fs.existsSync(extensionPath) });
415
415
  } catch (error) { res.status(500).json({ error: error.message }); }
416
416
  });
417
417
 
418
+ // Clipboard API - Read system clipboard from server-side
419
+ this.app.get('/api/clipboard', async (req, res) => {
420
+ try {
421
+ // Dynamically import clipboardy (ES module)
422
+ const clipboardy = await import('clipboardy');
423
+ const text = await clipboardy.default.read();
424
+ res.json({ success: true, text });
425
+ } catch (error) {
426
+ console.error('Clipboard read error:', error);
427
+ res.status(500).json({ success: false, error: error.message });
428
+ }
429
+ });
430
+
418
431
  this.app.post('/api/shutdown', async (req, res) => {
419
432
  res.json({ success: true });
420
433
  setTimeout(async () => { await this.stop(); process.exit(0); }, 500);
@@ -1,6 +1,6 @@
1
1
  import { getById, qsa, showToast } from '../utils.js';
2
2
  import { getGitDiff } from '../api.js';
3
- import { Diff2HtmlUI } from 'diff2html/lib/ui/js/diff2html-ui';
3
+ import { Diff2HtmlUI } from 'diff2html/lib-esm/src/ui/js/diff2html-ui';
4
4
 
5
5
  let isGitMode = false;
6
6