vanguard-cli 3.1.12 → 3.1.15
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/lib/services/scanner.js +13 -3
- package/lib/utils/ui.js +4 -12
- package/package.json +1 -1
- package/vanguard-malware-lab/core.js +0 -12
- package/vanguard-malware-lab/package.json +0 -11
package/lib/services/scanner.js
CHANGED
|
@@ -85,19 +85,29 @@ RESPONSE FORMAT (JSON ONLY):
|
|
|
85
85
|
const isServerErr = error.message.includes('500') || error.message.includes('503');
|
|
86
86
|
|
|
87
87
|
if (isRateLimit && attempt <= maxAttempts) {
|
|
88
|
-
const waitTime = attempt === 1 ? 30 : 60;
|
|
88
|
+
const waitTime = attempt === 1 ? 30 : 60;
|
|
89
89
|
if (spinner) {
|
|
90
90
|
const originalText = spinner.text;
|
|
91
91
|
for (let i = waitTime; i > 0; i--) {
|
|
92
|
-
spinner.text = `❄️ Quota hit
|
|
92
|
+
spinner.text = `❄️ Quota hit (${i}s). Waiting... (Tip: Ctrl+C -> 'vanguard config' to switch AI)`;
|
|
93
93
|
await sleep(1000);
|
|
94
94
|
}
|
|
95
95
|
spinner.text = originalText;
|
|
96
96
|
} else {
|
|
97
|
-
console.log(chalk.yellow(`\n⚠️ Rate limit hit. Cooling down for ${waitTime}s (
|
|
97
|
+
console.log(chalk.yellow(`\n⚠️ Rate limit hit. Cooling down for ${waitTime}s... (Tip: 'vanguard config' to switch AI)`));
|
|
98
98
|
await sleep(waitTime * 1000);
|
|
99
99
|
}
|
|
100
100
|
return this.scanWithRetry(filePath, content, spinner, attempt + 1);
|
|
101
|
+
} else if (isRateLimit) {
|
|
102
|
+
// Final failure after retries
|
|
103
|
+
console.log(chalk.blue('\n💡 Tip: Gemini Quota exceeded? Switch to local offline mode:'));
|
|
104
|
+
console.log(chalk.cyan(' vanguard config -> Select "Local Ollama"'));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const isOllamaError = error.message.includes('Ollama error') || error.message.includes('fetch failed');
|
|
108
|
+
if (isOllamaError) {
|
|
109
|
+
console.log(chalk.blue('\n💡 Tip: Local AI failing? Switch to Cloud fallback:'));
|
|
110
|
+
console.log(chalk.cyan(' vanguard config -> Select "Google Gemini"'));
|
|
101
111
|
}
|
|
102
112
|
|
|
103
113
|
if (isServerErr && attempt === 1) {
|
package/lib/utils/ui.js
CHANGED
|
@@ -49,20 +49,12 @@ export function showAlert(analysis) {
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
export function showFooter() {
|
|
52
|
+
console.log(chalk.dim('\n──────────────────────────────────────────────────────────────────────'));
|
|
52
53
|
console.log(
|
|
53
|
-
chalk.
|
|
54
|
+
chalk.green('🤝 Contribute: ') + chalk.underline('https://github.com/bazobehram/vanguard')
|
|
54
55
|
);
|
|
55
56
|
console.log(
|
|
56
|
-
chalk.
|
|
57
|
-
);
|
|
58
|
-
console.log(
|
|
59
|
-
chalk.green('🤝 Contribute: ') + chalk.underline('https://github.com/bazobehram/vanguard/pulls')
|
|
60
|
-
);
|
|
61
|
-
console.log(
|
|
62
|
-
chalk.cyan('☕ Support the project: ') +
|
|
63
|
-
chalk.underline('https://www.buymeacoffee.com/bazobehram')
|
|
64
|
-
);
|
|
65
|
-
console.log(
|
|
66
|
-
chalk.dim('----------------------------------------------------------------------\n')
|
|
57
|
+
chalk.cyan('☕ Support: ') + chalk.underline('https://www.buymeacoffee.com/bazobehram')
|
|
67
58
|
);
|
|
59
|
+
console.log(chalk.dim('──────────────────────────────────────────────────────────────────────\n'));
|
|
68
60
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 🚨 THREAT VECTOR: PROJECT_OMEGA (MOCK)
|
|
3
|
-
* This file contains the mock threat signature we added to lib/threats.json.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
function initializeSystem() {
|
|
7
|
-
console.log("System initializing...");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// ALERT: PROJECT_OMEGA sequence initiated
|
|
11
|
-
const secretKey = "SG0uLi4uIHRoaXMgaXMgYSBzZWNyZXQ=";
|
|
12
|
-
initializeSystem();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vanguard-malware-lab",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Educational test repository for supply chain security auditing.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"postinstall": "node ./scripts/postinstall.js"
|
|
7
|
-
},
|
|
8
|
-
"dependencies": {
|
|
9
|
-
"axios": "^1.6.0"
|
|
10
|
-
}
|
|
11
|
-
}
|