@zoer7788/mcp-nexus-node 0.1.4 → 0.1.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/cli.js +11 -4
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -90,6 +90,11 @@ function run(cmd, args, options = {}) {
|
|
|
90
90
|
return out.stdout.trim();
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
function runInteractive(cmd, args) {
|
|
94
|
+
const out = spawnSync(cmd, args, { stdio: "inherit" });
|
|
95
|
+
if (out.status !== 0) throw new Error(`${cmd} failed`);
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
function commandExists(cmd) {
|
|
94
99
|
return Boolean(commandPath(cmd));
|
|
95
100
|
}
|
|
@@ -147,16 +152,17 @@ function cloudflaredCommand() {
|
|
|
147
152
|
const local = join(binDir, "cloudflared");
|
|
148
153
|
if (existsSync(local)) return local;
|
|
149
154
|
ensureState();
|
|
150
|
-
console.log(
|
|
151
|
-
|
|
155
|
+
console.log(`Installing cloudflared to ${local}...`);
|
|
156
|
+
runInteractive("sh", ["-lc", `curl -L --fail -o ${quote(local)} ${quote(cloudflaredDownloadUrl())} && chmod +x ${quote(local)}`]);
|
|
152
157
|
return local;
|
|
153
158
|
}
|
|
154
159
|
|
|
155
160
|
function ensureCloudflareAuth() {
|
|
156
161
|
const certFile = join(home, ".cloudflared", "cert.pem");
|
|
157
162
|
if (existsSync(certFile)) return;
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
const cloudflared = cloudflaredCommand();
|
|
164
|
+
console.log("Cloudflare authorization required. Open the printed URL in your local browser.");
|
|
165
|
+
const out = spawnSync(cloudflared, ["tunnel", "login"], { stdio: "inherit" });
|
|
160
166
|
if (out.status !== 0) throw new Error("cloudflared tunnel login failed");
|
|
161
167
|
if (!existsSync(certFile)) throw new Error(`cloudflared login did not create ${certFile}`);
|
|
162
168
|
}
|
|
@@ -191,6 +197,7 @@ function findProject(name) {
|
|
|
191
197
|
function devspaceCommand() {
|
|
192
198
|
const explicit = process.env.DEVSPACE_CLI;
|
|
193
199
|
if (explicit && existsSync(explicit)) return ["node", explicit];
|
|
200
|
+
try { return ["node", require.resolve("@zoer7788/devspace/dist/cli.js")]; } catch {}
|
|
194
201
|
try { return ["node", require.resolve("@waishnav/devspace/dist/cli.js")]; } catch {}
|
|
195
202
|
const bundled = join(packageDir, "vendor", "devspace", "dist", "cli.js");
|
|
196
203
|
if (existsSync(bundled)) return ["node", bundled];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoer7788/mcp-nexus-node",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Remote node for MCP Nexus pairing and DevSpace project control.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"check": "node --check cli.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@
|
|
18
|
+
"@zoer7788/devspace": "^1.0.4"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|