@maverick006/vibeguard 1.0.0 → 1.0.2

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.
Files changed (3) hide show
  1. package/dist/index.js +12 -15
  2. package/package.json +3 -1
  3. package/src/index.ts +14 -14
package/dist/index.js CHANGED
@@ -9,7 +9,6 @@ const commander_1 = require("commander");
9
9
  const chalk_1 = __importDefault(require("chalk"));
10
10
  const ora_1 = __importDefault(require("ora"));
11
11
  const ai_engine_1 = require("@maverick006/ai-engine");
12
- const types_1 = require("@maverick006/types");
13
12
  const fs_1 = require("fs");
14
13
  const path_1 = require("path");
15
14
  const program = new commander_1.Command();
@@ -25,21 +24,19 @@ program
25
24
  .action(async (options) => {
26
25
  console.log(chalk_1.default.bold.magenta('\nšŸ›”ļø VibeGuard Orchestrator Initiated\n'));
27
26
  const spinner = (0, ora_1.default)('Scanning repository for vulnerabilities...').start();
28
- // Simulate orchestration of underlying tools since this is the demo CLI
29
- await new Promise(resolve => setTimeout(resolve, 2000));
27
+ // Initialize the real security orchestrator and npm audit scanner
28
+ const { Orchestrator } = require('@maverick006/security-engine');
29
+ const { NpmAuditScanner } = require('@maverick006/scanner-npm-audit');
30
+ const orchestrator = new Orchestrator([new NpmAuditScanner()]);
31
+ // Run the actual scan on the current directory
32
+ const scanResult = await orchestrator.runScan({
33
+ scanId: `scan-${Date.now()}`,
34
+ repositoryUrl: 'local',
35
+ repositoryPath: process.cwd(),
36
+ branch: 'main'
37
+ });
30
38
  spinner.succeed('Scans completed via deterministic engines');
31
- // Generate mock findings that would come from the scanners
32
- const findings = [
33
- {
34
- id: 'vg-001',
35
- title: 'SQL Injection Vulnerability',
36
- description: 'User input is directly concatenated into a SQL query, allowing for injection attacks.',
37
- severity: types_1.Severity.HIGH,
38
- scanner: 'Semgrep',
39
- file: 'src/api/users.ts',
40
- line: 42
41
- }
42
- ];
39
+ const findings = scanResult.findings;
43
40
  console.log(chalk_1.default.bold(`\nFound ${findings.length} vulnerabilities.`));
44
41
  for (const finding of findings) {
45
42
  console.log(chalk_1.default.red(`\n[${finding.severity}] ${finding.title}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maverick006/vibeguard",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "VibeGuard CLI",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -13,6 +13,8 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@maverick006/ai-engine": "*",
16
+ "@maverick006/security-engine": "*",
17
+ "@maverick006/scanner-npm-audit": "*",
16
18
  "@maverick006/types": "*",
17
19
  "chalk": "^4.1.2",
18
20
  "commander": "^11.1.0",
package/src/index.ts CHANGED
@@ -25,23 +25,23 @@ program
25
25
 
26
26
  const spinner = ora('Scanning repository for vulnerabilities...').start();
27
27
 
28
- // Simulate orchestration of underlying tools since this is the demo CLI
29
- await new Promise(resolve => setTimeout(resolve, 2000));
28
+ // Initialize the real security orchestrator and npm audit scanner
29
+ const { Orchestrator } = require('@maverick006/security-engine');
30
+ const { NpmAuditScanner } = require('@maverick006/scanner-npm-audit');
30
31
 
32
+ const orchestrator = new Orchestrator([new NpmAuditScanner()]);
33
+
34
+ // Run the actual scan on the current directory
35
+ const scanResult = await orchestrator.runScan({
36
+ scanId: `scan-${Date.now()}`,
37
+ repositoryUrl: 'local',
38
+ repositoryPath: process.cwd(),
39
+ branch: 'main'
40
+ });
41
+
31
42
  spinner.succeed('Scans completed via deterministic engines');
32
43
 
33
- // Generate mock findings that would come from the scanners
34
- const findings: NormalizedFinding[] = [
35
- {
36
- id: 'vg-001',
37
- title: 'SQL Injection Vulnerability',
38
- description: 'User input is directly concatenated into a SQL query, allowing for injection attacks.',
39
- severity: Severity.HIGH,
40
- scanner: 'Semgrep',
41
- file: 'src/api/users.ts',
42
- line: 42
43
- }
44
- ];
44
+ const findings = scanResult.findings;
45
45
 
46
46
  console.log(chalk.bold(`\nFound ${findings.length} vulnerabilities.`));
47
47