@vibe-assurance/cli 1.0.3 → 1.0.5
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 +4 -3
- package/src/commands/login.js +1 -0
- package/src/config/credentials.js +11 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-assurance/cli",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Vibe Assurance CLI - Connect
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Vibe Assurance CLI - Connect AI coding agents to your governance platform via MCP",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"vibe": "./bin/vibe.js"
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"vibe-assurance",
|
|
15
15
|
"governance",
|
|
16
16
|
"mcp",
|
|
17
|
-
"
|
|
17
|
+
"model-context-protocol",
|
|
18
|
+
"ai-agents",
|
|
18
19
|
"compliance",
|
|
19
20
|
"security"
|
|
20
21
|
],
|
package/src/commands/login.js
CHANGED
|
@@ -145,6 +145,7 @@ async function login() {
|
|
|
145
145
|
console.log(' 1. Run `vibe setup-claude` to configure Claude Code');
|
|
146
146
|
console.log(' 2. Restart Claude Code');
|
|
147
147
|
console.log(' 3. Start using vibe_* tools in your conversations');
|
|
148
|
+
process.exit(0); // Exit cleanly after successful login
|
|
148
149
|
} catch (err) {
|
|
149
150
|
cleanup();
|
|
150
151
|
spinner.fail(`Authentication failed: ${err.message}`);
|
|
@@ -90,7 +90,10 @@ async function deleteCredentials() {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* Check if credentials exist and
|
|
93
|
+
* Check if credentials exist and can be used (valid or refreshable)
|
|
94
|
+
* Returns true if:
|
|
95
|
+
* - Access token exists and is not expired, OR
|
|
96
|
+
* - Access token is expired but refresh token exists (will auto-refresh on API call)
|
|
94
97
|
* @returns {Promise<boolean>}
|
|
95
98
|
*/
|
|
96
99
|
async function hasValidCredentials() {
|
|
@@ -99,14 +102,19 @@ async function hasValidCredentials() {
|
|
|
99
102
|
return false;
|
|
100
103
|
}
|
|
101
104
|
|
|
102
|
-
// Check if token is expired (with 5 minute buffer)
|
|
105
|
+
// Check if access token is expired (with 5 minute buffer)
|
|
103
106
|
if (creds.expiresAt) {
|
|
104
107
|
const expiresAt = new Date(creds.expiresAt);
|
|
105
108
|
const now = new Date();
|
|
106
109
|
const bufferMs = 5 * 60 * 1000; // 5 minutes
|
|
107
110
|
|
|
108
111
|
if (expiresAt.getTime() - bufferMs < now.getTime()) {
|
|
109
|
-
|
|
112
|
+
// Access token expired - check if we have a refresh token
|
|
113
|
+
// If we do, the API client will auto-refresh on first request
|
|
114
|
+
if (creds.refreshToken) {
|
|
115
|
+
return true; // Can refresh, so credentials are usable
|
|
116
|
+
}
|
|
117
|
+
return false; // No refresh token, truly expired
|
|
110
118
|
}
|
|
111
119
|
}
|
|
112
120
|
|