vanguard-cli 3.1.16 ā 3.1.17
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/bin/vanguard.js +2 -2
- package/lib/commands/scan.js +7 -0
- package/lib/services/scanner.js +3 -1
- package/package.json +1 -1
package/bin/vanguard.js
CHANGED
|
@@ -18,7 +18,7 @@ const program = new Command();
|
|
|
18
18
|
async function handleAction(actionName, logicFn) {
|
|
19
19
|
const isConfigured =
|
|
20
20
|
(config.get('AI_PROVIDER') === 'gemini' && config.get('GEMINI_KEY')) ||
|
|
21
|
-
(config.get('AI_PROVIDER') === 'ollama');
|
|
21
|
+
(config.get('AI_PROVIDER') === 'ollama' && config.get('OLLAMA_MODEL'));
|
|
22
22
|
|
|
23
23
|
if (!isConfigured) {
|
|
24
24
|
// showBanner();
|
|
@@ -105,7 +105,7 @@ program.parse(process.argv);
|
|
|
105
105
|
if (!process.argv.slice(2).length) {
|
|
106
106
|
const isConfigured =
|
|
107
107
|
(config.get('AI_PROVIDER') === 'gemini' && config.get('GEMINI_KEY')) ||
|
|
108
|
-
(config.get('AI_PROVIDER') === 'ollama');
|
|
108
|
+
(config.get('AI_PROVIDER') === 'ollama' && config.get('OLLAMA_MODEL'));
|
|
109
109
|
|
|
110
110
|
if (!isConfigured) {
|
|
111
111
|
// showBanner();
|
package/lib/commands/scan.js
CHANGED
|
@@ -41,6 +41,9 @@ export async function handlePull(cmdOptions, programOptions) {
|
|
|
41
41
|
try {
|
|
42
42
|
analysis = await scanner.scan('git_diff', diff, spinner);
|
|
43
43
|
} catch (err) {
|
|
44
|
+
if (err.message === 'CRITICAL_AUTH_FAILURE') {
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
44
47
|
let msg = err.message;
|
|
45
48
|
if (msg.includes('[GoogleGenerativeAI Error]')) {
|
|
46
49
|
msg = msg.split('[')[0].trim();
|
|
@@ -131,6 +134,10 @@ export async function handleClone(url, directory, programOptions) {
|
|
|
131
134
|
CacheManager.save(file, content, 'SAFE');
|
|
132
135
|
}
|
|
133
136
|
} catch (err) {
|
|
137
|
+
if (err.message === 'CRITICAL_AUTH_FAILURE') {
|
|
138
|
+
await cleanupSandbox(tempPath);
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
134
141
|
let msg = err.message;
|
|
135
142
|
// Clean up Google's noisy JSON error if it slipped through
|
|
136
143
|
if (msg.includes('[GoogleGenerativeAI Error]')) {
|
package/lib/services/scanner.js
CHANGED
|
@@ -122,7 +122,9 @@ RESPONSE FORMAT (JSON ONLY):
|
|
|
122
122
|
console.log(chalk.red('\nā Critical: Gemini API Key is invalid, expired, or missing permissions.'));
|
|
123
123
|
console.log(chalk.yellow('š Run "vanguard config" to update your credentials.'));
|
|
124
124
|
// We fail closed - do not allow the scan to proceed or return 'safe'
|
|
125
|
-
process.exit(1)
|
|
125
|
+
// process.exit(1) can cause UV_HANDLE_CLOSING assertion on Windows if async ops are pending.
|
|
126
|
+
// Instead, throw a specific error that the caller can catch and exit cleanly.
|
|
127
|
+
throw new Error('CRITICAL_AUTH_FAILURE');
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
if (isServerErr && attempt === 1) {
|