vg-coder-cli 2.0.47 → 2.0.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.
package/INTEGRATION.md CHANGED
@@ -402,7 +402,7 @@ User vẫn có thể:
402
402
 
403
403
  ```bash
404
404
  curl http://127.0.0.1:6868/health
405
- # {"status":"ok","version":"2.0.49"}
405
+ # {"status":"ok","version":"2.0.48"}
406
406
  ```
407
407
 
408
408
  ## End-to-end smoke test
package/README.md CHANGED
@@ -94,8 +94,8 @@ GET http://localhost:6868/health
94
94
  ```json
95
95
  {
96
96
  "status": "ok",
97
- "version": "1.0.10",
98
- "timestamp": "2025-11-24T15:00:00.000Z"
97
+ "version": "2.0.48",
98
+ "timestamp": "2026-05-09T10:07:13.000Z"
99
99
  }
100
100
  ```
101
101
 
@@ -308,8 +308,9 @@ curl -X POST http://localhost:6868/api/execute \
308
308
  ## 🔧 Development
309
309
 
310
310
  ```bash
311
- # Install dependencies
311
+ # Install dependencies (root + extension)
312
312
  npm install
313
+ cd vetgo-auto && npm install && cd ..
313
314
 
314
315
  # Run tests
315
316
  npm test
@@ -317,10 +318,42 @@ npm test
317
318
  # Run in dev mode
318
319
  npm run dev
319
320
 
320
- # Build and publish
321
- npm run push
321
+ # Local full build (extension + dashboard bundle + global install)
322
+ npm run build
322
323
  ```
323
324
 
325
+ ## 🚢 Release
326
+
327
+ CI tự publish lên npm khi `package.json` version đổi. Chỉ dùng 1 lệnh tuỳ loại bump:
328
+
329
+ ```bash
330
+ npm run release:patch # 2.0.48 → 2.0.49 (bug fix)
331
+ npm run release:minor # 2.0.48 → 2.1.0 (feature mới)
332
+ npm run release:major # 2.0.48 → 3.0.0 (breaking change)
333
+ ```
334
+
335
+ Mỗi lệnh tự `npm version <bump>` (commit + tag) rồi `git push --follow-tags origin main`. GitHub Actions workflow `.github/workflows/publish.yml` chạy tự động:
336
+
337
+ 1. So sánh `package.json` version với `npm view vg-coder-cli version`. Bằng nhau → skip.
338
+ 2. `npm ci` root + `vetgo-auto`, build extension, copy vào `src/server/views/vg-coder/`, build dashboard bundle.
339
+ 3. `npm publish --access public` (cần secret repo `NPM_TOKEN` — granular access token với "bypass 2FA").
340
+ 4. Tag `v<version>` (skip nếu đã có) + tạo GitHub Release auto-generated notes.
341
+
342
+ Manual trigger: GitHub repo → **Actions** → **Publish to npm** → **Run workflow**.
343
+
344
+ ### Update notifier
345
+
346
+ CLI dùng `update-notifier` v5.1.0 — sau lần chạy đầu, nếu có version mới trên npm sẽ in banner cuối tiến trình:
347
+
348
+ ```
349
+ ╭─────────────────────────────────────────╮
350
+ │ Update available 2.0.48 → 2.0.49 │
351
+ │ Run npm i -g vg-coder-cli to update │
352
+ ╰─────────────────────────────────────────╯
353
+ ```
354
+
355
+ Cache check 6h ở `~/.config/configstore/update-notifier-vg-coder-cli.json`. Tự bypass khi offline / non-interactive shell.
356
+
324
357
  ## 🤝 Đóng góp
325
358
 
326
359
  1. Fork repository
@@ -336,7 +369,20 @@ MIT License - xem file [LICENSE](LICENSE) để biết thêm chi tiết.
336
369
 
337
370
  ## 📊 Version History
338
371
 
339
- ### v1.0.10 (Latest)
372
+ ### v2.0.48 (Latest)
373
+ - 🤖 Remote Task API: external service push task chat AI Studio + nhận callback (`POST /api/tasks` + webhook)
374
+ - 🧠 Multi-worker pool: mỗi Chrome profile = 1 worker, parallel + auto-failover khi rate-limit
375
+ - 🪟 Launcher SW per profile + tab management API (`GET /api/launcher/tabs`, `POST /api/launcher/{open,close}-tab`)
376
+ - 🔁 Auto-recycle tab sau mỗi task để lock model `gemini-3-flash-preview` (free + multimodal)
377
+ - 🛡️ Auto-dismiss modal: "Start creating with media", "Link a paid API key", ToS update, preference vote
378
+ - 📸 Native screenshot (`chrome.tabs.captureVisibleTab`) thay html2canvas — 5x nhanh hơn, sạch CORS
379
+ - 🪵 Console + window.error ring buffer 200 + REST `POST /api/worker/logs`
380
+ - 🚢 GitHub Actions auto-publish khi version bump + `npm run release:{patch,minor,major}`
381
+ - 🔔 update-notifier banner cho end-user khi có version mới
382
+
383
+ Xem chi tiết: [INTEGRATION.md](INTEGRATION.md)
384
+
385
+ ### v1.0.10
340
386
  - ✨ Added API Server with REST endpoints
341
387
  - 🎨 Beautiful dashboard UI with auto-open browser
342
388
  - ⚡ Bash script execution with validation
package/bin/vg-coder.js CHANGED
@@ -4,6 +4,13 @@
4
4
  * VG Coder CLI Entry Point
5
5
  */
6
6
 
7
+ // Notify the user when a newer version is on npm. See bin/vg.js for details.
8
+ try {
9
+ const updateNotifier = require('update-notifier');
10
+ const pkg = require('../package.json');
11
+ updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 * 6 }).notify({ defer: true });
12
+ } catch (_) { /* ignore */ }
13
+
7
14
  const VGCoderCLI = require('../src/index');
8
15
 
9
16
  // Create and run CLI
package/bin/vg.js CHANGED
@@ -4,6 +4,16 @@
4
4
  * VG Coder CLI Entry Point
5
5
  */
6
6
 
7
+ // Notify the user when a newer version is on npm. update-notifier caches
8
+ // the check (default ~6 hours via configstore) and prints a banner on
9
+ // next process exit (defer: true) so it never blocks startup. Wrapped in
10
+ // try/catch so a missing module / offline environment never breaks the CLI.
11
+ try {
12
+ const updateNotifier = require('update-notifier');
13
+ const pkg = require('../package.json');
14
+ updateNotifier({ pkg, updateCheckInterval: 1000 * 60 * 60 * 6 }).notify({ defer: true });
15
+ } catch (_) { /* ignore */ }
16
+
7
17
  const VGCoderCLI = require('../src/index');
8
18
 
9
19
  // Create and run CLI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vg-coder-cli",
3
- "version": "2.0.47",
3
+ "version": "2.0.49",
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": {
@@ -19,7 +19,10 @@
19
19
  "build:copy": "node scripts/build.js",
20
20
  "build": "npm run deploy-scripts && npm run build:extension && npm run build:copy && npm run build:inject && npm run install:local",
21
21
  "push": "npm run build && npm pack && npm publish",
22
- "build:inject": "gulp"
22
+ "build:inject": "gulp",
23
+ "release:patch": "npm version patch -m \"chore: release v%s\" && git push --follow-tags origin main",
24
+ "release:minor": "npm version minor -m \"chore: release v%s\" && git push --follow-tags origin main",
25
+ "release:major": "npm version major -m \"chore: release v%s\" && git push --follow-tags origin main"
23
26
  },
24
27
  "keywords": [
25
28
  "cli",
@@ -52,6 +55,7 @@
52
55
  "socket.io": "^4.7.2",
53
56
  "socket.io-client": "^4.8.3",
54
57
  "tiktoken": "^1.0.10",
58
+ "update-notifier": "^5.1.0",
55
59
  "xterm": "^5.3.0",
56
60
  "xterm-addon-fit": "^0.8.0"
57
61
  },
package/src/index.js CHANGED
@@ -56,6 +56,7 @@ class VGCoderCLI {
56
56
  .alias('s')
57
57
  .description('Khởi động API server')
58
58
  .option('-p, --port <port>', 'Port cho server', '6868')
59
+ .option('--host <host>', 'Bind address (loopback mặc định, set 0.0.0.0 để LAN/Docker)', process.env.VG_HOST || '127.0.0.1')
59
60
  .action(this.handleStart.bind(this));
60
61
  }
61
62
 
@@ -220,7 +221,7 @@ class VGCoderCLI {
220
221
 
221
222
  console.log(chalk.blue('\n🚀 Starting VG Coder Server...'));
222
223
 
223
- const server = new ApiServer(initialPort);
224
+ const server = new ApiServer(initialPort, options.host);
224
225
  const lockAcquired = await projectManager.acquireLock(initialPort);
225
226
  if (!lockAcquired) throw new Error('Failed to acquire leader lock');
226
227
 
@@ -22,8 +22,9 @@ const taskStore = require('./task-store');
22
22
  const multer = require('multer');
23
23
 
24
24
  class ApiServer {
25
- constructor(port = 6868) {
25
+ constructor(port = 6868, host = process.env.VG_HOST || '127.0.0.1') {
26
26
  this.port = port;
27
+ this.host = host;
27
28
  this.app = express();
28
29
  this.httpServer = http.createServer(this.app);
29
30
  this.io = new Server(this.httpServer, { cors: { origin: "*" } });
@@ -797,11 +798,15 @@ class ApiServer {
797
798
  }
798
799
  };
799
800
  this.httpServer.once('error', onError);
800
- this.server = this.httpServer.listen(port, '127.0.0.1', () => {
801
+ this.server = this.httpServer.listen(port, this.host, () => {
801
802
  this.httpServer.removeListener('error', onError);
802
803
  this.port = this.server.address().port;
803
- console.log(chalk.green(`🚀 Server Online: http://localhost:${this.port}`));
804
- console.log(chalk.blue(`📦 Dist served at: http://localhost:${this.port}/dist`));
804
+ const display = this.host === '0.0.0.0' ? 'localhost' : this.host;
805
+ console.log(chalk.green(`🚀 Server Online: http://${display}:${this.port}`));
806
+ if (this.host === '0.0.0.0') {
807
+ console.log(chalk.gray(` (binding 0.0.0.0 — reachable from LAN/Docker)`));
808
+ }
809
+ console.log(chalk.blue(`📦 Dist served at: http://${display}:${this.port}/dist`));
805
810
  taskQueue.rehydrateFromProjects(this.projectManager).catch(err => {
806
811
  console.log(chalk.yellow(`[TaskQueue] Rehydrate failed: ${err.message}`));
807
812
  });