@solongate/proxy 0.14.0 → 0.15.0
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 +10 -2
- package/dist/init.js +10 -2
- package/hooks/guard.mjs +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -464,8 +464,13 @@ function installHooks() {
|
|
|
464
464
|
};
|
|
465
465
|
const clients = [
|
|
466
466
|
{ name: "Claude Code", dir: ".claude" },
|
|
467
|
-
{ name: "Cursor", dir: ".cursor" }
|
|
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" }
|
|
468
472
|
];
|
|
473
|
+
const activatedNames = [];
|
|
469
474
|
for (const client of clients) {
|
|
470
475
|
const clientDir = resolve2(client.dir);
|
|
471
476
|
mkdirSync2(clientDir, { recursive: true });
|
|
@@ -478,12 +483,13 @@ function installHooks() {
|
|
|
478
483
|
const merged = { ...existing, hooks: hookSettings.hooks };
|
|
479
484
|
writeFileSync2(settingsPath, JSON.stringify(merged, null, 2) + "\n");
|
|
480
485
|
console.log(` Created ${settingsPath}`);
|
|
486
|
+
activatedNames.push(client.name);
|
|
481
487
|
}
|
|
482
488
|
console.log("");
|
|
483
489
|
console.log(" Hooks installed:");
|
|
484
490
|
console.log(" guard.mjs \u2192 blocks policy-violating calls (pre-execution)");
|
|
485
491
|
console.log(" audit.mjs \u2192 logs all calls to dashboard (post-execution)");
|
|
486
|
-
console.log(
|
|
492
|
+
console.log(` Activated for: ${activatedNames.join(", ")}`);
|
|
487
493
|
}
|
|
488
494
|
function ensureEnvFile() {
|
|
489
495
|
const envPath = resolve2(".env");
|
|
@@ -735,6 +741,8 @@ async function main() {
|
|
|
735
741
|
console.log(" \u2502 \u2502");
|
|
736
742
|
console.log(" \u2502 MCP servers \u2192 Protected via proxy \u2502");
|
|
737
743
|
console.log(" \u2502 AI tools \u2192 Guarded via hooks \u2502");
|
|
744
|
+
console.log(" \u2502 Claude, Cursor, Gemini, Antigravity, \u2502");
|
|
745
|
+
console.log(" \u2502 OpenClaw, Perplexity \u2502");
|
|
738
746
|
console.log(" \u2502 API key \u2192 Set in .env \u2502");
|
|
739
747
|
console.log(" \u2502 \u2502");
|
|
740
748
|
console.log(" \u2502 View logs: https://dashboard.solongate.com \u2502");
|
package/dist/init.js
CHANGED
|
@@ -171,8 +171,13 @@ function installHooks() {
|
|
|
171
171
|
};
|
|
172
172
|
const clients = [
|
|
173
173
|
{ name: "Claude Code", dir: ".claude" },
|
|
174
|
-
{ name: "Cursor", dir: ".cursor" }
|
|
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" }
|
|
175
179
|
];
|
|
180
|
+
const activatedNames = [];
|
|
176
181
|
for (const client of clients) {
|
|
177
182
|
const clientDir = resolve(client.dir);
|
|
178
183
|
mkdirSync(clientDir, { recursive: true });
|
|
@@ -185,12 +190,13 @@ function installHooks() {
|
|
|
185
190
|
const merged = { ...existing, hooks: hookSettings.hooks };
|
|
186
191
|
writeFileSync(settingsPath, JSON.stringify(merged, null, 2) + "\n");
|
|
187
192
|
console.log(` Created ${settingsPath}`);
|
|
193
|
+
activatedNames.push(client.name);
|
|
188
194
|
}
|
|
189
195
|
console.log("");
|
|
190
196
|
console.log(" Hooks installed:");
|
|
191
197
|
console.log(" guard.mjs \u2192 blocks policy-violating calls (pre-execution)");
|
|
192
198
|
console.log(" audit.mjs \u2192 logs all calls to dashboard (post-execution)");
|
|
193
|
-
console.log(
|
|
199
|
+
console.log(` Activated for: ${activatedNames.join(", ")}`);
|
|
194
200
|
}
|
|
195
201
|
function ensureEnvFile() {
|
|
196
202
|
const envPath = resolve(".env");
|
|
@@ -442,6 +448,8 @@ async function main() {
|
|
|
442
448
|
console.log(" \u2502 \u2502");
|
|
443
449
|
console.log(" \u2502 MCP servers \u2192 Protected via proxy \u2502");
|
|
444
450
|
console.log(" \u2502 AI tools \u2192 Guarded via hooks \u2502");
|
|
451
|
+
console.log(" \u2502 Claude, Cursor, Gemini, Antigravity, \u2502");
|
|
452
|
+
console.log(" \u2502 OpenClaw, Perplexity \u2502");
|
|
445
453
|
console.log(" \u2502 API key \u2192 Set in .env \u2502");
|
|
446
454
|
console.log(" \u2502 \u2502");
|
|
447
455
|
console.log(" \u2502 View logs: https://dashboard.solongate.com \u2502");
|
package/hooks/guard.mjs
CHANGED
|
@@ -120,7 +120,8 @@ function detectPromptInjection(text, customCategories = [], threshold = 0.5) {
|
|
|
120
120
|
if (matched.length === 0) return null;
|
|
121
121
|
const score = Math.min(1.0, maxWeight + 0.05 * (matched.length - 1));
|
|
122
122
|
const trustScore = 1.0 - score;
|
|
123
|
-
|
|
123
|
+
const blocked = Math.round(trustScore * 1000) < Math.round(threshold * 1000);
|
|
124
|
+
return { score, trustScore, categories: matched, blocked };
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
// ── Glob Matching ──
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
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": {
|