eassist-mcp 1.0.4 → 1.0.6
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/build/auth.js +8 -2
- package/build/client.js +2 -1
- package/package.json +1 -1
package/build/auth.js
CHANGED
|
@@ -53,13 +53,19 @@ class AuthManager {
|
|
|
53
53
|
const apiUrl = this.getApiUrl();
|
|
54
54
|
const sessionId = crypto.randomBytes(16).toString('hex');
|
|
55
55
|
const authUrl = `${apiUrl}/api/auth/mcp?session_id=${sessionId}`;
|
|
56
|
-
console.error(
|
|
56
|
+
console.error('\n' + '='.repeat(60));
|
|
57
|
+
console.error(' EAssist Authentication Required');
|
|
58
|
+
console.error('='.repeat(60));
|
|
59
|
+
console.error('\n Open this URL in your browser to sign in:\n');
|
|
60
|
+
console.error(` ${authUrl}\n`);
|
|
61
|
+
console.error(' (If the browser opens automatically, complete sign-in there)');
|
|
62
|
+
console.error('='.repeat(60) + '\n');
|
|
57
63
|
try {
|
|
58
64
|
const { default: open } = await import('open');
|
|
59
65
|
await open(authUrl);
|
|
60
66
|
}
|
|
61
67
|
catch {
|
|
62
|
-
|
|
68
|
+
// URL already printed above — user can copy-paste it
|
|
63
69
|
}
|
|
64
70
|
// Poll the backend until it has the token (user completes OAuth in browser)
|
|
65
71
|
const pollUrl = `${apiUrl}/api/auth/mcp/result?session_id=${sessionId}`;
|
package/build/client.js
CHANGED
|
@@ -2,7 +2,8 @@ import axios from 'axios';
|
|
|
2
2
|
import { auth } from './auth.js';
|
|
3
3
|
const DEFAULT_API_URL = 'https://eassist.forsysinc.com';
|
|
4
4
|
function getApiUrl() {
|
|
5
|
-
|
|
5
|
+
const base = (process.env.EASSIST_API_URL ?? DEFAULT_API_URL).replace(/\/$/, '');
|
|
6
|
+
return base.endsWith('/api') ? base : base + '/api';
|
|
6
7
|
}
|
|
7
8
|
async function headers() {
|
|
8
9
|
const token = await auth.getValidToken();
|