@solongate/proxy 0.81.1 → 0.81.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.
package/hooks/audit.mjs CHANGED
@@ -392,8 +392,13 @@ const AGENT_NAME = process.argv[3] || 'Claude Code';
392
392
  if (!API_KEY || !(API_KEY.startsWith('sg_live_') || API_KEY.startsWith('sg_test_'))) process.exit(0);
393
393
 
394
394
  let input = '';
395
- process.stdin.on('data', c => input += c);
396
- process.stdin.on('end', async () => {
395
+ // Read stdin SYNCHRONOUSLY (fd 0). Calling process.exit() from inside the
396
+ // process.stdin stream 'end' callback aborts on Windows + Node 24 with
397
+ // `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c`
398
+ // (libuv double-closes the stdin pipe handle during teardown). Reading fd 0 to
399
+ // EOF avoids creating that handle, so the exits below tear down cleanly.
400
+ try { input += readFileSync(0, 'utf-8'); } catch {}
401
+ ;(async () => {
397
402
  try {
398
403
  const data = JSON.parse(input);
399
404
  let EMITTED_PAYLOAD = null;
@@ -581,4 +586,4 @@ process.stdin.on('end', async () => {
581
586
  } catch {
582
587
  process.exit(0);
583
588
  }
584
- });
589
+ })();
@@ -7654,8 +7654,13 @@ function readReferencedFiles(args, cwd) {
7654
7654
  }
7655
7655
  return out;
7656
7656
  }
7657
- process.stdin.on("data", (c) => input += c);
7658
- process.stdin.on("end", async () => {
7657
+ if (!REFRESH_MODE) {
7658
+ try {
7659
+ input += readFileSync(0, "utf-8");
7660
+ } catch {
7661
+ }
7662
+ }
7663
+ (async () => {
7659
7664
  if (REFRESH_MODE)
7660
7665
  return;
7661
7666
  if (process.env.SOLONGATE_DEBUG) {
@@ -7898,4 +7903,4 @@ process.stdin.on("end", async () => {
7898
7903
  }
7899
7904
  await maybeSelfUpdate();
7900
7905
  allowTool();
7901
- });
7906
+ })();
package/hooks/guard.mjs CHANGED
@@ -1402,8 +1402,16 @@ function readReferencedFiles(args, cwd) {
1402
1402
  return out;
1403
1403
  }
1404
1404
 
1405
- process.stdin.on('data', c => input += c);
1406
- process.stdin.on('end', async () => {
1405
+ // Read stdin SYNCHRONOUSLY (fd 0) instead of via the process.stdin stream. On
1406
+ // Windows + Node 24, calling process.exit() from inside the stdin stream's 'end'
1407
+ // callback aborts with `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING),
1408
+ // file src\win\async.c` — libuv double-closes the stdin pipe handle mid-teardown,
1409
+ // the hook crashes before its exit code lands, and Claude Code treats the DENY as
1410
+ // a non-blocking hook failure (so the block never applies). Reading fd 0 to EOF
1411
+ // synchronously never creates that pipe handle, and the exit below no longer runs
1412
+ // inside a stream callback, so the loop tears down cleanly.
1413
+ if (!REFRESH_MODE) { try { input += readFileSync(0, 'utf-8'); } catch {} }
1414
+ ;(async () => {
1407
1415
  // Background-refresh invocation has no tool call to evaluate — it already ran
1408
1416
  // refreshPolicyCache() at startup; do nothing on the (empty) stdin.
1409
1417
  if (REFRESH_MODE) return;
@@ -1709,4 +1717,4 @@ process.stdin.on('end', async () => {
1709
1717
  } catch {}
1710
1718
  await maybeSelfUpdate();
1711
1719
  allowTool();
1712
- });
1720
+ })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.81.1",
3
+ "version": "0.81.2",
4
4
  "description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
5
5
  "type": "module",
6
6
  "bin": {