@solongate/proxy 0.4.3 → 0.4.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/dist/index.js CHANGED
@@ -539,17 +539,25 @@ function readConfig(filePath) {
539
539
  throw new Error(`Unrecognized config format in ${filePath}`);
540
540
  }
541
541
  function isAlreadyProtected(server) {
542
- const cmdStr = [server.command, ...server.args ?? []].join(" ");
543
- return cmdStr.includes("solongate") || cmdStr.includes("solongate-proxy");
542
+ const args = server.args ?? [];
543
+ if (server.command === "solongate-proxy") return true;
544
+ if (server.command === "@solongate/proxy") return true;
545
+ for (const arg of args) {
546
+ if (arg === "-y" || arg === "--yes") continue;
547
+ if (arg === "@solongate/proxy" || arg === "solongate-proxy") return true;
548
+ if (arg.endsWith("/proxy/dist/index.js") && arg.includes("solongate")) return true;
549
+ break;
550
+ }
551
+ return false;
544
552
  }
545
553
  function wrapServer(server, policy, apiKey) {
554
+ const env = { ...server.env ?? {} };
555
+ env.SOLONGATE_API_KEY = apiKey;
546
556
  return {
547
557
  command: "npx",
548
558
  args: [
549
559
  "-y",
550
560
  "@solongate/proxy",
551
- "--api-key",
552
- apiKey,
553
561
  "--policy",
554
562
  policy,
555
563
  "--verbose",
@@ -557,7 +565,7 @@ function wrapServer(server, policy, apiKey) {
557
565
  server.command,
558
566
  ...server.args ?? []
559
567
  ],
560
- ...server.env ? { env: server.env } : {}
568
+ env
561
569
  };
562
570
  }
563
571
  async function prompt(question) {
package/dist/init.js CHANGED
@@ -34,17 +34,25 @@ function readConfig(filePath) {
34
34
  throw new Error(`Unrecognized config format in ${filePath}`);
35
35
  }
36
36
  function isAlreadyProtected(server) {
37
- const cmdStr = [server.command, ...server.args ?? []].join(" ");
38
- return cmdStr.includes("solongate") || cmdStr.includes("solongate-proxy");
37
+ const args = server.args ?? [];
38
+ if (server.command === "solongate-proxy") return true;
39
+ if (server.command === "@solongate/proxy") return true;
40
+ for (const arg of args) {
41
+ if (arg === "-y" || arg === "--yes") continue;
42
+ if (arg === "@solongate/proxy" || arg === "solongate-proxy") return true;
43
+ if (arg.endsWith("/proxy/dist/index.js") && arg.includes("solongate")) return true;
44
+ break;
45
+ }
46
+ return false;
39
47
  }
40
48
  function wrapServer(server, policy, apiKey) {
49
+ const env = { ...server.env ?? {} };
50
+ env.SOLONGATE_API_KEY = apiKey;
41
51
  return {
42
52
  command: "npx",
43
53
  args: [
44
54
  "-y",
45
55
  "@solongate/proxy",
46
- "--api-key",
47
- apiKey,
48
56
  "--policy",
49
57
  policy,
50
58
  "--verbose",
@@ -52,7 +60,7 @@ function wrapServer(server, policy, apiKey) {
52
60
  server.command,
53
61
  ...server.args ?? []
54
62
  ],
55
- ...server.env ? { env: server.env } : {}
63
+ env
56
64
  };
57
65
  }
58
66
  async function prompt(question) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "MCP security proxy — protect any MCP server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
5
5
  "type": "module",
6
6
  "bin": {