@solongate/proxy 0.16.1 → 0.17.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 CHANGED
@@ -462,7 +462,28 @@ EXAMPLES
462
462
  function readHookScript(filename) {
463
463
  return readFileSync3(join(HOOKS_DIR, filename), "utf-8");
464
464
  }
465
+ function unlockProtectedDirs() {
466
+ const dirs = [".solongate", ".claude", ".cursor", ".gemini", ".antigravity", ".openclaw", ".perplexity"];
467
+ for (const dir of dirs) {
468
+ const fullDir = resolve2(dir);
469
+ if (!existsSync3(fullDir)) continue;
470
+ try {
471
+ if (process.platform === "win32") {
472
+ execSync(`icacls "${fullDir}" /remove:d *S-1-1-0 /T /Q`, { stdio: "ignore" });
473
+ execSync(`attrib -R /S /D "${fullDir}"`, { stdio: "ignore" });
474
+ } else {
475
+ try {
476
+ execSync(`chattr -i -R "${fullDir}"`, { stdio: "ignore" });
477
+ } catch {
478
+ }
479
+ execSync(`chmod -R u+w "${fullDir}"`, { stdio: "ignore" });
480
+ }
481
+ } catch {
482
+ }
483
+ }
484
+ }
465
485
  function installHooks(selectedTools = []) {
486
+ unlockProtectedDirs();
466
487
  const hooksDir = resolve2(".solongate", "hooks");
467
488
  mkdirSync2(hooksDir, { recursive: true });
468
489
  const guardPath = join(hooksDir, "guard.mjs");
@@ -522,6 +543,7 @@ function installHooks(selectedTools = []) {
522
543
  const fullDir = resolve2(dir);
523
544
  if (existsSync3(fullDir)) {
524
545
  try {
546
+ execSync(`icacls "${fullDir}" /deny *S-1-1-0:(OI)(CI)(W,D) /T /Q`, { stdio: "ignore" });
525
547
  execSync(`attrib +R /S /D "${fullDir}"`, { stdio: "ignore" });
526
548
  } catch {
527
549
  }
@@ -535,10 +557,14 @@ function installHooks(selectedTools = []) {
535
557
  execSync(`chmod -R a-w "${fullDir}"`, { stdio: "ignore" });
536
558
  } catch {
537
559
  }
560
+ try {
561
+ execSync(`chattr +i -R "${fullDir}"`, { stdio: "ignore" });
562
+ } catch {
563
+ }
538
564
  }
539
565
  }
540
566
  }
541
- console.log(" OS-level read-only protection applied");
567
+ console.log(" OS-level DENY protection applied (icacls/chmod)");
542
568
  } catch {
543
569
  }
544
570
  console.log("");
package/dist/init.js CHANGED
@@ -169,7 +169,28 @@ var HOOKS_DIR = resolve(__dirname, "..", "hooks");
169
169
  function readHookScript(filename) {
170
170
  return readFileSync(join(HOOKS_DIR, filename), "utf-8");
171
171
  }
172
+ function unlockProtectedDirs() {
173
+ const dirs = [".solongate", ".claude", ".cursor", ".gemini", ".antigravity", ".openclaw", ".perplexity"];
174
+ for (const dir of dirs) {
175
+ const fullDir = resolve(dir);
176
+ if (!existsSync(fullDir)) continue;
177
+ try {
178
+ if (process.platform === "win32") {
179
+ execSync(`icacls "${fullDir}" /remove:d *S-1-1-0 /T /Q`, { stdio: "ignore" });
180
+ execSync(`attrib -R /S /D "${fullDir}"`, { stdio: "ignore" });
181
+ } else {
182
+ try {
183
+ execSync(`chattr -i -R "${fullDir}"`, { stdio: "ignore" });
184
+ } catch {
185
+ }
186
+ execSync(`chmod -R u+w "${fullDir}"`, { stdio: "ignore" });
187
+ }
188
+ } catch {
189
+ }
190
+ }
191
+ }
172
192
  function installHooks(selectedTools = []) {
193
+ unlockProtectedDirs();
173
194
  const hooksDir = resolve(".solongate", "hooks");
174
195
  mkdirSync(hooksDir, { recursive: true });
175
196
  const guardPath = join(hooksDir, "guard.mjs");
@@ -229,6 +250,7 @@ function installHooks(selectedTools = []) {
229
250
  const fullDir = resolve(dir);
230
251
  if (existsSync(fullDir)) {
231
252
  try {
253
+ execSync(`icacls "${fullDir}" /deny *S-1-1-0:(OI)(CI)(W,D) /T /Q`, { stdio: "ignore" });
232
254
  execSync(`attrib +R /S /D "${fullDir}"`, { stdio: "ignore" });
233
255
  } catch {
234
256
  }
@@ -242,10 +264,14 @@ function installHooks(selectedTools = []) {
242
264
  execSync(`chmod -R a-w "${fullDir}"`, { stdio: "ignore" });
243
265
  } catch {
244
266
  }
267
+ try {
268
+ execSync(`chattr +i -R "${fullDir}"`, { stdio: "ignore" });
269
+ } catch {
270
+ }
245
271
  }
246
272
  }
247
273
  }
248
- console.log(" OS-level read-only protection applied");
274
+ console.log(" OS-level DENY protection applied (icacls/chmod)");
249
275
  } catch {
250
276
  }
251
277
  console.log("");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.16.1",
3
+ "version": "0.17.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": {