@solongate/proxy 0.15.0 → 0.15.1
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 +40 -11
- package/dist/init.js +40 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -386,7 +386,8 @@ async function prompt(question) {
|
|
|
386
386
|
function parseInitArgs(argv) {
|
|
387
387
|
const args = argv.slice(2);
|
|
388
388
|
const options = {
|
|
389
|
-
all: false
|
|
389
|
+
all: false,
|
|
390
|
+
tools: []
|
|
390
391
|
};
|
|
391
392
|
for (let i = 0; i < args.length; i++) {
|
|
392
393
|
switch (args[i]) {
|
|
@@ -402,6 +403,24 @@ function parseInitArgs(argv) {
|
|
|
402
403
|
case "--all":
|
|
403
404
|
options.all = true;
|
|
404
405
|
break;
|
|
406
|
+
case "--claude":
|
|
407
|
+
options.tools.push("claude");
|
|
408
|
+
break;
|
|
409
|
+
case "--cursor":
|
|
410
|
+
options.tools.push("cursor");
|
|
411
|
+
break;
|
|
412
|
+
case "--gemini":
|
|
413
|
+
options.tools.push("gemini");
|
|
414
|
+
break;
|
|
415
|
+
case "--antigravity":
|
|
416
|
+
options.tools.push("antigravity");
|
|
417
|
+
break;
|
|
418
|
+
case "--openclaw":
|
|
419
|
+
options.tools.push("openclaw");
|
|
420
|
+
break;
|
|
421
|
+
case "--perplexity":
|
|
422
|
+
options.tools.push("perplexity");
|
|
423
|
+
break;
|
|
405
424
|
case "--help":
|
|
406
425
|
case "-h":
|
|
407
426
|
printHelp();
|
|
@@ -424,8 +443,17 @@ OPTIONS
|
|
|
424
443
|
--all Protect all servers without prompting
|
|
425
444
|
-h, --help Show this help message
|
|
426
445
|
|
|
446
|
+
AI TOOL HOOKS (default: all)
|
|
447
|
+
--claude Install hooks for Claude Code
|
|
448
|
+
--cursor Install hooks for Cursor
|
|
449
|
+
--gemini Install hooks for Gemini CLI
|
|
450
|
+
--antigravity Install hooks for Antigravity
|
|
451
|
+
--openclaw Install hooks for OpenClaw
|
|
452
|
+
--perplexity Install hooks for Perplexity
|
|
453
|
+
|
|
427
454
|
EXAMPLES
|
|
428
|
-
npx @solongate/proxy init --all # Protect everything
|
|
455
|
+
npx @solongate/proxy init --all # Protect everything, all tools
|
|
456
|
+
npx @solongate/proxy init --all --claude --cursor # Only Claude + Cursor hooks
|
|
429
457
|
npx @solongate/proxy init --all --policy policy.json # With custom policy
|
|
430
458
|
`;
|
|
431
459
|
console.log(help);
|
|
@@ -433,7 +461,7 @@ EXAMPLES
|
|
|
433
461
|
function readHookScript(filename) {
|
|
434
462
|
return readFileSync3(join(HOOKS_DIR, filename), "utf-8");
|
|
435
463
|
}
|
|
436
|
-
function installHooks() {
|
|
464
|
+
function installHooks(selectedTools = []) {
|
|
437
465
|
const hooksDir = resolve2(".solongate", "hooks");
|
|
438
466
|
mkdirSync2(hooksDir, { recursive: true });
|
|
439
467
|
const guardPath = join(hooksDir, "guard.mjs");
|
|
@@ -462,14 +490,15 @@ function installHooks() {
|
|
|
462
490
|
]
|
|
463
491
|
}
|
|
464
492
|
};
|
|
465
|
-
const
|
|
466
|
-
{ name: "Claude Code", dir: ".claude" },
|
|
467
|
-
{ name: "Cursor", dir: ".cursor" },
|
|
468
|
-
{ name: "Gemini CLI", dir: ".gemini" },
|
|
469
|
-
{ name: "Antigravity", dir: ".antigravity" },
|
|
470
|
-
{ name: "OpenClaw", dir: ".openclaw" },
|
|
471
|
-
{ name: "Perplexity", dir: ".perplexity" }
|
|
493
|
+
const allClients = [
|
|
494
|
+
{ name: "Claude Code", dir: ".claude", key: "claude" },
|
|
495
|
+
{ name: "Cursor", dir: ".cursor", key: "cursor" },
|
|
496
|
+
{ name: "Gemini CLI", dir: ".gemini", key: "gemini" },
|
|
497
|
+
{ name: "Antigravity", dir: ".antigravity", key: "antigravity" },
|
|
498
|
+
{ name: "OpenClaw", dir: ".openclaw", key: "openclaw" },
|
|
499
|
+
{ name: "Perplexity", dir: ".perplexity", key: "perplexity" }
|
|
472
500
|
];
|
|
501
|
+
const clients = selectedTools.length > 0 ? allClients.filter((c3) => selectedTools.includes(c3.key)) : allClients;
|
|
473
502
|
const activatedNames = [];
|
|
474
503
|
for (const client of clients) {
|
|
475
504
|
const clientDir = resolve2(client.dir);
|
|
@@ -622,7 +651,7 @@ async function main() {
|
|
|
622
651
|
console.log(" All servers are already protected by SolonGate!");
|
|
623
652
|
ensureEnvFile();
|
|
624
653
|
console.log("");
|
|
625
|
-
installHooks();
|
|
654
|
+
installHooks(options.tools);
|
|
626
655
|
process.exit(0);
|
|
627
656
|
}
|
|
628
657
|
if (!options.all) {
|
package/dist/init.js
CHANGED
|
@@ -91,7 +91,8 @@ async function prompt(question) {
|
|
|
91
91
|
function parseInitArgs(argv) {
|
|
92
92
|
const args = argv.slice(2);
|
|
93
93
|
const options = {
|
|
94
|
-
all: false
|
|
94
|
+
all: false,
|
|
95
|
+
tools: []
|
|
95
96
|
};
|
|
96
97
|
for (let i = 0; i < args.length; i++) {
|
|
97
98
|
switch (args[i]) {
|
|
@@ -107,6 +108,24 @@ function parseInitArgs(argv) {
|
|
|
107
108
|
case "--all":
|
|
108
109
|
options.all = true;
|
|
109
110
|
break;
|
|
111
|
+
case "--claude":
|
|
112
|
+
options.tools.push("claude");
|
|
113
|
+
break;
|
|
114
|
+
case "--cursor":
|
|
115
|
+
options.tools.push("cursor");
|
|
116
|
+
break;
|
|
117
|
+
case "--gemini":
|
|
118
|
+
options.tools.push("gemini");
|
|
119
|
+
break;
|
|
120
|
+
case "--antigravity":
|
|
121
|
+
options.tools.push("antigravity");
|
|
122
|
+
break;
|
|
123
|
+
case "--openclaw":
|
|
124
|
+
options.tools.push("openclaw");
|
|
125
|
+
break;
|
|
126
|
+
case "--perplexity":
|
|
127
|
+
options.tools.push("perplexity");
|
|
128
|
+
break;
|
|
110
129
|
case "--help":
|
|
111
130
|
case "-h":
|
|
112
131
|
printHelp();
|
|
@@ -129,8 +148,17 @@ OPTIONS
|
|
|
129
148
|
--all Protect all servers without prompting
|
|
130
149
|
-h, --help Show this help message
|
|
131
150
|
|
|
151
|
+
AI TOOL HOOKS (default: all)
|
|
152
|
+
--claude Install hooks for Claude Code
|
|
153
|
+
--cursor Install hooks for Cursor
|
|
154
|
+
--gemini Install hooks for Gemini CLI
|
|
155
|
+
--antigravity Install hooks for Antigravity
|
|
156
|
+
--openclaw Install hooks for OpenClaw
|
|
157
|
+
--perplexity Install hooks for Perplexity
|
|
158
|
+
|
|
132
159
|
EXAMPLES
|
|
133
|
-
npx @solongate/proxy init --all # Protect everything
|
|
160
|
+
npx @solongate/proxy init --all # Protect everything, all tools
|
|
161
|
+
npx @solongate/proxy init --all --claude --cursor # Only Claude + Cursor hooks
|
|
134
162
|
npx @solongate/proxy init --all --policy policy.json # With custom policy
|
|
135
163
|
`;
|
|
136
164
|
console.log(help);
|
|
@@ -140,7 +168,7 @@ var HOOKS_DIR = resolve(__dirname, "..", "hooks");
|
|
|
140
168
|
function readHookScript(filename) {
|
|
141
169
|
return readFileSync(join(HOOKS_DIR, filename), "utf-8");
|
|
142
170
|
}
|
|
143
|
-
function installHooks() {
|
|
171
|
+
function installHooks(selectedTools = []) {
|
|
144
172
|
const hooksDir = resolve(".solongate", "hooks");
|
|
145
173
|
mkdirSync(hooksDir, { recursive: true });
|
|
146
174
|
const guardPath = join(hooksDir, "guard.mjs");
|
|
@@ -169,14 +197,15 @@ function installHooks() {
|
|
|
169
197
|
]
|
|
170
198
|
}
|
|
171
199
|
};
|
|
172
|
-
const
|
|
173
|
-
{ name: "Claude Code", dir: ".claude" },
|
|
174
|
-
{ name: "Cursor", dir: ".cursor" },
|
|
175
|
-
{ name: "Gemini CLI", dir: ".gemini" },
|
|
176
|
-
{ name: "Antigravity", dir: ".antigravity" },
|
|
177
|
-
{ name: "OpenClaw", dir: ".openclaw" },
|
|
178
|
-
{ name: "Perplexity", dir: ".perplexity" }
|
|
200
|
+
const allClients = [
|
|
201
|
+
{ name: "Claude Code", dir: ".claude", key: "claude" },
|
|
202
|
+
{ name: "Cursor", dir: ".cursor", key: "cursor" },
|
|
203
|
+
{ name: "Gemini CLI", dir: ".gemini", key: "gemini" },
|
|
204
|
+
{ name: "Antigravity", dir: ".antigravity", key: "antigravity" },
|
|
205
|
+
{ name: "OpenClaw", dir: ".openclaw", key: "openclaw" },
|
|
206
|
+
{ name: "Perplexity", dir: ".perplexity", key: "perplexity" }
|
|
179
207
|
];
|
|
208
|
+
const clients = selectedTools.length > 0 ? allClients.filter((c) => selectedTools.includes(c.key)) : allClients;
|
|
180
209
|
const activatedNames = [];
|
|
181
210
|
for (const client of clients) {
|
|
182
211
|
const clientDir = resolve(client.dir);
|
|
@@ -329,7 +358,7 @@ async function main() {
|
|
|
329
358
|
console.log(" All servers are already protected by SolonGate!");
|
|
330
359
|
ensureEnvFile();
|
|
331
360
|
console.log("");
|
|
332
|
-
installHooks();
|
|
361
|
+
installHooks(options.tools);
|
|
333
362
|
process.exit(0);
|
|
334
363
|
}
|
|
335
364
|
if (!options.all) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
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": {
|