@solongate/proxy 0.6.1 → 0.6.2

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.
Files changed (3) hide show
  1. package/dist/index.js +19 -13
  2. package/dist/init.js +19 -13
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -664,10 +664,7 @@ function installHooks() {
664
664
  const auditPath = join(hooksDir, "audit.mjs");
665
665
  writeFileSync2(auditPath, AUDIT_SCRIPT);
666
666
  console.log(` Created ${auditPath}`);
667
- const claudeDir = resolve2(".claude");
668
- mkdirSync(claudeDir, { recursive: true });
669
- const settingsPath = join(claudeDir, "settings.json");
670
- const settings = {
667
+ const hookSettings = {
671
668
  hooks: {
672
669
  PreToolUse: [
673
670
  {
@@ -687,19 +684,28 @@ function installHooks() {
687
684
  ]
688
685
  }
689
686
  };
690
- let existing = {};
691
- try {
692
- existing = JSON.parse(readFileSync3(settingsPath, "utf-8"));
693
- } catch {
687
+ const clients = [
688
+ { name: "Claude Code", dir: ".claude" },
689
+ { name: "Cursor", dir: ".cursor" }
690
+ ];
691
+ for (const client of clients) {
692
+ const clientDir = resolve2(client.dir);
693
+ mkdirSync(clientDir, { recursive: true });
694
+ const settingsPath = join(clientDir, "settings.json");
695
+ let existing = {};
696
+ try {
697
+ existing = JSON.parse(readFileSync3(settingsPath, "utf-8"));
698
+ } catch {
699
+ }
700
+ const merged = { ...existing, hooks: hookSettings.hooks };
701
+ writeFileSync2(settingsPath, JSON.stringify(merged, null, 2) + "\n");
702
+ console.log(` Created ${settingsPath}`);
694
703
  }
695
- const merged = { ...existing, hooks: settings.hooks };
696
- writeFileSync2(settingsPath, JSON.stringify(merged, null, 2) + "\n");
697
- console.log(` Created ${settingsPath}`);
698
704
  console.log("");
699
705
  console.log(" Hooks installed:");
700
706
  console.log(" guard.mjs \u2192 blocks policy-violating calls (pre-execution)");
701
707
  console.log(" audit.mjs \u2192 logs all calls to dashboard (post-execution)");
702
- console.log(" .claude/settings.json \u2192 hooks activated for Claude Code");
708
+ console.log(" Activated for: Claude Code, Cursor");
703
709
  }
704
710
  function ensureEnvFile() {
705
711
  const envPath = resolve2(".env");
@@ -1127,7 +1133,7 @@ process.stdin.on('end', async () => {
1127
1133
 
1128
1134
  // \u2500\u2500 Self-protection: block access to hook files and settings \u2500\u2500
1129
1135
  const allStrings = scanStrings(args).map(s => s.replace(/\\\\\\\\/g, '/').toLowerCase());
1130
- const protectedPaths = ['.solongate', '.claude/settings.json', 'policy.json'];
1136
+ const protectedPaths = ['.solongate', '.claude/settings.json', '.cursor/settings.json', 'policy.json'];
1131
1137
  for (const s of allStrings) {
1132
1138
  for (const p of protectedPaths) {
1133
1139
  if (s.includes(p)) {
package/dist/init.js CHANGED
@@ -322,7 +322,7 @@ process.stdin.on('end', async () => {
322
322
 
323
323
  // \u2500\u2500 Self-protection: block access to hook files and settings \u2500\u2500
324
324
  const allStrings = scanStrings(args).map(s => s.replace(/\\\\\\\\/g, '/').toLowerCase());
325
- const protectedPaths = ['.solongate', '.claude/settings.json', 'policy.json'];
325
+ const protectedPaths = ['.solongate', '.claude/settings.json', '.cursor/settings.json', 'policy.json'];
326
326
  for (const s of allStrings) {
327
327
  for (const p of protectedPaths) {
328
328
  if (s.includes(p)) {
@@ -430,10 +430,7 @@ function installHooks() {
430
430
  const auditPath = join(hooksDir, "audit.mjs");
431
431
  writeFileSync(auditPath, AUDIT_SCRIPT);
432
432
  console.log(` Created ${auditPath}`);
433
- const claudeDir = resolve(".claude");
434
- mkdirSync(claudeDir, { recursive: true });
435
- const settingsPath = join(claudeDir, "settings.json");
436
- const settings = {
433
+ const hookSettings = {
437
434
  hooks: {
438
435
  PreToolUse: [
439
436
  {
@@ -453,19 +450,28 @@ function installHooks() {
453
450
  ]
454
451
  }
455
452
  };
456
- let existing = {};
457
- try {
458
- existing = JSON.parse(readFileSync(settingsPath, "utf-8"));
459
- } catch {
453
+ const clients = [
454
+ { name: "Claude Code", dir: ".claude" },
455
+ { name: "Cursor", dir: ".cursor" }
456
+ ];
457
+ for (const client of clients) {
458
+ const clientDir = resolve(client.dir);
459
+ mkdirSync(clientDir, { recursive: true });
460
+ const settingsPath = join(clientDir, "settings.json");
461
+ let existing = {};
462
+ try {
463
+ existing = JSON.parse(readFileSync(settingsPath, "utf-8"));
464
+ } catch {
465
+ }
466
+ const merged = { ...existing, hooks: hookSettings.hooks };
467
+ writeFileSync(settingsPath, JSON.stringify(merged, null, 2) + "\n");
468
+ console.log(` Created ${settingsPath}`);
460
469
  }
461
- const merged = { ...existing, hooks: settings.hooks };
462
- writeFileSync(settingsPath, JSON.stringify(merged, null, 2) + "\n");
463
- console.log(` Created ${settingsPath}`);
464
470
  console.log("");
465
471
  console.log(" Hooks installed:");
466
472
  console.log(" guard.mjs \u2192 blocks policy-violating calls (pre-execution)");
467
473
  console.log(" audit.mjs \u2192 logs all calls to dashboard (post-execution)");
468
- console.log(" .claude/settings.json \u2192 hooks activated for Claude Code");
474
+ console.log(" Activated for: Claude Code, Cursor");
469
475
  }
470
476
  function ensureEnvFile() {
471
477
  const envPath = resolve(".env");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
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": {