@ngocsangairvds/vsaf 3.1.11 → 3.1.13

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": "@ngocsangairvds/vsaf",
3
- "version": "3.1.11",
3
+ "version": "3.1.13",
4
4
  "description": "VSAF — Agentic AI SDLC Framework. 3 integrated tools: BMAD, GitNexus, Superpowers. 2-layer review.",
5
5
  "keywords": ["claude", "claude-code", "ai", "sdlc", "framework", "bmad", "gitnexus", "superpowers"],
6
6
  "bin": {
package/src/global.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
  const path = require('path');
3
3
  const fs = require('fs');
4
- const os = require('os');
5
4
  const { ok, info, warn, step, hasCommand, exec, copyDir, copyFile, CLAUDE_HOME, isWindows } = require('./utils');
6
5
 
7
6
  const PKG_ROOT = path.join(__dirname, '..');
@@ -64,47 +63,29 @@ function installBinary(name, installFn) {
64
63
  }
65
64
 
66
65
  function ensureLadybugDbWindows() {
67
- step('LadybugDB native binary (Windows)');
66
+ step('LadybugDB native binding (Windows)');
68
67
 
69
- // 1. Check if npm optional dep is present
70
68
  try {
71
69
  const npmRoot = require('child_process')
72
70
  .execSync('npm root -g', { encoding: 'utf8', shell: true }).trim();
73
- const ladybugPath = path.join(npmRoot, 'gitnexus', 'node_modules', '@ladybugdb', 'core-win32-x64');
74
- if (fs.existsSync(ladybugPath)) {
75
- ok('LadybugDB Windows binary present');
71
+ const nativePath = path.join(npmRoot, 'gitnexus', 'node_modules', '@ladybugdb', 'core', 'lbugjs.node');
72
+ if (fs.existsSync(nativePath)) {
73
+ ok('LadybugDB native binding present (lbugjs.node)');
76
74
  return;
77
75
  }
78
- warn('LadybugDB Windows binary missing — installing via npm...');
76
+ warn('LadybugDB native binding missing — installing @ladybugdb/core-win32-x64...');
79
77
  const gitnexusDir = path.join(npmRoot, 'gitnexus');
80
78
  if (exec('npm install @ladybugdb/core-win32-x64 --no-save', { cwd: gitnexusDir })) {
81
- ok('LadybugDB Windows binary installed');
82
- return;
79
+ ok('LadybugDB native binding installed');
80
+ } else {
81
+ warn('Could not install LadybugDB binding. Run manually:');
82
+ warn(' cd "' + gitnexusDir + '"');
83
+ warn(' npm install @ladybugdb/core-win32-x64 --no-save');
83
84
  }
84
- } catch { /* fall through to bundled binary */ }
85
-
86
- // 2. Fallback: extract bundled lbug.exe
87
- const lbugZip = path.join(PKG_ROOT, 'assets', 'lbug_cli-windows-x86_64.zip');
88
- const lbugDest = path.join(os.homedir(), '.vsaf', 'bin');
89
- const lbugExe = path.join(lbugDest, 'lbug.exe');
90
-
91
- if (fs.existsSync(lbugExe)) {
92
- ok('lbug.exe already installed at ' + lbugDest);
93
- return;
94
- }
95
-
96
- if (!fs.existsSync(lbugZip)) {
97
- warn('Could not install LadybugDB binary — bundled zip not found');
98
- return;
99
- }
100
-
101
- info('Extracting bundled lbug.exe...');
102
- fs.mkdirSync(lbugDest, { recursive: true });
103
- if (exec(`powershell -Command "Expand-Archive -Path '${lbugZip}' -DestinationPath '${lbugDest}' -Force"`)) {
104
- ok('lbug.exe extracted to ' + lbugDest);
105
- info('Add to PATH: ' + lbugDest);
106
- } else {
107
- warn('Failed to extract lbug.exe');
85
+ } catch {
86
+ warn('Could not verify LadybugDB binding — if gitnexus analyze fails at 60%, run:');
87
+ info(' npm root -g (find global node_modules path)');
88
+ info(' cd <path>\\gitnexus && npm install @ladybugdb/core-win32-x64 --no-save');
108
89
  }
109
90
  }
110
91
 
package/src/utils.js CHANGED
@@ -52,10 +52,19 @@ function copyFile(src, dst) {
52
52
  fs.copyFileSync(src, dst);
53
53
  }
54
54
 
55
+ function hasGitCommits() {
56
+ try {
57
+ execSync('git rev-parse HEAD', { stdio: 'pipe', shell: true });
58
+ return true;
59
+ } catch {
60
+ return false;
61
+ }
62
+ }
63
+
55
64
  function getPlatform() {
56
65
  if (process.platform === 'win32') return 'windows';
57
66
  if (process.platform === 'darwin') return 'macos';
58
67
  return 'linux';
59
68
  }
60
69
 
61
- module.exports = { ok, info, warn, step, hasCommand, exec, copyDir, copyFile, CLAUDE_HOME, isWindows, getPlatform };
70
+ module.exports = { ok, info, warn, step, hasCommand, exec, copyDir, copyFile, CLAUDE_HOME, isWindows, getPlatform, hasGitCommits };
package/src/workflow.js CHANGED
@@ -1,6 +1,47 @@
1
1
  'use strict';
2
2
 
3
- const { ok, info, warn, step, hasCommand, exec, isWindows } = require('./utils');
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+ const { ok, info, warn, step, hasCommand, exec, isWindows, hasGitCommits } = require('./utils');
6
+
7
+ function preflightCheck() {
8
+ // Check: is this a git repo?
9
+ if (!fs.existsSync(path.join(process.cwd(), '.git'))) {
10
+ warn('Not a git repository. Run: git init');
11
+ return false;
12
+ }
13
+
14
+ // Check: does the repo have at least one commit?
15
+ if (!hasGitCommits()) {
16
+ warn('Repository has no commits yet.');
17
+ warn('GitNexus requires at least one commit to index.');
18
+ info('Fix: create an initial commit first:');
19
+ info(' git add .');
20
+ info(' git commit -m "initial commit"');
21
+ info('Then retry: vsaf index');
22
+ return false;
23
+ }
24
+
25
+ // Check (Windows): is LadybugDB native binding present?
26
+ if (isWindows) {
27
+ try {
28
+ const npmRoot = require('child_process')
29
+ .execSync('npm root -g', { encoding: 'utf8', shell: true }).trim();
30
+ const lbugNode = path.join(npmRoot, 'gitnexus', 'node_modules', '@ladybugdb', 'core', 'lbugjs.node');
31
+ if (!fs.existsSync(lbugNode)) {
32
+ warn('LadybugDB native binding missing (lbugjs.node).');
33
+ warn('gitnexus analyze will fail at 60% without it.');
34
+ info('Fix: run this in CMD:');
35
+ info(' cd "' + path.join(npmRoot, 'gitnexus') + '"');
36
+ info(' npm install @ladybugdb/core-win32-x64 --no-save');
37
+ info('Then retry: vsaf index');
38
+ return false;
39
+ }
40
+ } catch { /* can't check, proceed anyway */ }
41
+ }
42
+
43
+ return true;
44
+ }
4
45
 
5
46
  function runIndex() {
6
47
  step('Index');
@@ -10,9 +51,12 @@ function runIndex() {
10
51
  return false;
11
52
  }
12
53
 
13
- const analyzeCmd = 'gitnexus analyze';
54
+ if (!preflightCheck()) {
55
+ return false;
56
+ }
57
+
14
58
  info('Running gitnexus analyze...');
15
- const gitnexusOk = exec(analyzeCmd);
59
+ const gitnexusOk = exec('gitnexus analyze --skip-git');
16
60
  if (gitnexusOk) {
17
61
  ok('GitNexus index updated');
18
62
  } else {
Binary file