viewgate-wrapper 1.10.27 → 1.10.29
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/dist/cli.js +17 -36
- package/dist/components/ViewGateOverlay.d.ts.map +1 -1
- package/dist/viewgate-wrapper.js +2067 -2042
- package/dist/viewgate-wrapper.umd.cjs +12 -12
- package/package.json +3 -7
- package/mcp-server/dist/index.js +0 -222
- package/mcp-server/package.json +0 -20
package/dist/cli.js
CHANGED
|
@@ -14,31 +14,10 @@ async function setup() {
|
|
|
14
14
|
console.error(`❌ Could not find mcp_config.json at ${configPath}`);
|
|
15
15
|
process.exit(1);
|
|
16
16
|
}
|
|
17
|
-
// 2. Determine the path
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
// Check if we are running from node_modules or local dev
|
|
22
|
-
const isLocalDev = __dirname.includes('view-gate-wrapper' + path.sep + 'src') || __dirname.includes('view-gate-wrapper' + path.sep + 'dist');
|
|
23
|
-
if (isLocalDev) {
|
|
24
|
-
// Find the root of the project
|
|
25
|
-
let root = __dirname;
|
|
26
|
-
while (root !== path.parse(root).root && !fs.existsSync(path.join(root, 'package.json'))) {
|
|
27
|
-
root = path.dirname(root);
|
|
28
|
-
}
|
|
29
|
-
mcpServerPath = path.join(root, 'mcp-server', 'dist', 'index.js');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// In node_modules, we expect to be in something like node_modules/viewgate-wrapper/dist
|
|
33
|
-
mcpServerPath = path.join(__dirname, '..', 'mcp-server', 'dist', 'index.js');
|
|
34
|
-
}
|
|
35
|
-
// Normalize to forward slashes for the JSON config (cleaner on Windows)
|
|
36
|
-
const normalizedMcpPath = mcpServerPath.replace(/\\/g, '/');
|
|
37
|
-
if (!fs.existsSync(mcpServerPath)) {
|
|
38
|
-
console.error(`❌ MCP Server not found at: ${mcpServerPath}`);
|
|
39
|
-
console.log('Please ensure you have built the project: npm run build');
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
17
|
+
// 2. Determine the path or URL
|
|
18
|
+
// Since we now have a standalone server, we can point to its URL or local path.
|
|
19
|
+
// The user wants it to be scalable, so we'll prioritize a server URL.
|
|
20
|
+
const mcpServerUrl = process.env.MCP_SERVER_URL || 'https://view-gate.vercel.app/sse';
|
|
42
21
|
// 3. Read and update mcp_config.json
|
|
43
22
|
try {
|
|
44
23
|
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
@@ -48,22 +27,24 @@ async function setup() {
|
|
|
48
27
|
const currentServer = config.mcpServers.viewgate || {};
|
|
49
28
|
const env = currentServer.env || {};
|
|
50
29
|
// Default values if not present
|
|
51
|
-
const backendUrl = env.BACKEND_URL || '
|
|
52
|
-
const apiKey = env.API_KEY || '
|
|
30
|
+
const backendUrl = env.BACKEND_URL || 'http://localhost:5000';
|
|
31
|
+
const apiKey = env.API_KEY || '';
|
|
53
32
|
config.mcpServers.viewgate = {
|
|
54
|
-
command:
|
|
55
|
-
args: [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
33
|
+
command: "npx",
|
|
34
|
+
args: [
|
|
35
|
+
"-y",
|
|
36
|
+
"mcp-remote",
|
|
37
|
+
`${mcpServerUrl}${mcpServerUrl.includes('?') ? '&' : '?'}apiKey=${apiKey}`
|
|
38
|
+
],
|
|
39
|
+
env: {}
|
|
60
40
|
};
|
|
61
41
|
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
62
42
|
console.log(`✅ Updated mcp_config.json successfully!`);
|
|
63
|
-
console.log(`📍 MCP
|
|
64
|
-
if (apiKey
|
|
65
|
-
console.log('\n⚠️
|
|
43
|
+
console.log(`📍 MCP Server URL: ${mcpServerUrl}`);
|
|
44
|
+
if (!apiKey) {
|
|
45
|
+
console.log('\n⚠️ Recuerda configurar tu API_KEY en:');
|
|
66
46
|
console.log(` ${configPath}`);
|
|
47
|
+
console.log(' Puedes encontrar tu API_KEY en el Dashboard de ViewGate.');
|
|
67
48
|
}
|
|
68
49
|
}
|
|
69
50
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAwBnF,OAAO,wBAAwB,CAAC;AAkyBhC,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAwBnF,OAAO,wBAAwB,CAAC;AAkyBhC,eAAO,MAAM,eAAe,EAAE,EAg5D7B,CAAC"}
|