@solongate/proxy 0.33.0 → 0.34.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
@@ -793,10 +793,10 @@ function installGeminiConfig(clientDir, guardCmd, auditCmd, _stopCmd, wrappedMcp
793
793
  }
794
794
  merged.hooks = {
795
795
  BeforeTool: [
796
- { matcher: ".*", command: guardCmd }
796
+ { matcher: ".*", hooks: [{ type: "command", command: guardCmd }] }
797
797
  ],
798
798
  AfterTool: [
799
- { matcher: ".*", command: auditCmd }
799
+ { matcher: ".*", hooks: [{ type: "command", command: auditCmd }] }
800
800
  ]
801
801
  };
802
802
  const mergedStr = JSON.stringify(merged, null, 2) + "\n";
package/dist/init.js CHANGED
@@ -379,10 +379,10 @@ function installGeminiConfig(clientDir, guardCmd, auditCmd, _stopCmd, wrappedMcp
379
379
  }
380
380
  merged.hooks = {
381
381
  BeforeTool: [
382
- { matcher: ".*", command: guardCmd }
382
+ { matcher: ".*", hooks: [{ type: "command", command: guardCmd }] }
383
383
  ],
384
384
  AfterTool: [
385
- { matcher: ".*", command: auditCmd }
385
+ { matcher: ".*", hooks: [{ type: "command", command: auditCmd }] }
386
386
  ]
387
387
  };
388
388
  const mergedStr = JSON.stringify(merged, null, 2) + "\n";
package/hooks/audit.mjs CHANGED
@@ -26,9 +26,8 @@ const API_KEY = process.env.SOLONGATE_API_KEY || dotenv.SOLONGATE_API_KEY || '';
26
26
  const API_URL = process.env.SOLONGATE_API_URL || dotenv.SOLONGATE_API_URL || 'https://api.solongate.com';
27
27
 
28
28
  // Agent identity from CLI args: node audit.mjs <agent_id> <agent_name>
29
- // Can be overridden at runtime when stdin contains gemini_version
30
- let AGENT_ID = process.argv[2] || 'claude-code';
31
- let AGENT_NAME = process.argv[3] || 'Claude Code';
29
+ const AGENT_ID = process.argv[2] || 'claude-code';
30
+ const AGENT_NAME = process.argv[3] || 'Claude Code';
32
31
 
33
32
  if (!API_KEY || !API_KEY.startsWith('sg_live_')) process.exit(0);
34
33
 
@@ -45,12 +44,6 @@ process.stdin.on('end', async () => {
45
44
  afs(resolve('.solongate', '.debug-audit-log'), debugLine);
46
45
  } catch {}
47
46
 
48
- // Auto-detect agent from stdin data (overrides CLI args if detected)
49
- if (data.gemini_version) {
50
- AGENT_ID = 'gemini-cli';
51
- AGENT_NAME = 'Gemini CLI';
52
- }
53
-
54
47
  let toolName = data.tool_name || data.toolName || '';
55
48
  let toolInput = data.tool_input || data.toolInput || data.params || {};
56
49
  if (!toolName) toolName = 'unknown';
package/hooks/guard.mjs CHANGED
@@ -41,9 +41,8 @@ const API_KEY = process.env.SOLONGATE_API_KEY || dotenv.SOLONGATE_API_KEY || '';
41
41
  const API_URL = process.env.SOLONGATE_API_URL || dotenv.SOLONGATE_API_URL || 'https://api.solongate.com';
42
42
 
43
43
  // Agent identity from CLI args: node guard.mjs <agent_id> <agent_name>
44
- // Can be overridden at runtime when stdin contains gemini_version
45
- let AGENT_ID = process.argv[2] || 'claude-code';
46
- let AGENT_NAME = process.argv[3] || 'Claude Code';
44
+ const AGENT_ID = process.argv[2] || 'claude-code';
45
+ const AGENT_NAME = process.argv[3] || 'Claude Code';
47
46
 
48
47
  // ── Per-tool block/allow output ──
49
48
  // Response format depends on the agent:
@@ -366,12 +365,6 @@ process.stdin.on('end', async () => {
366
365
  try {
367
366
  const raw = JSON.parse(input);
368
367
 
369
- // Auto-detect agent from stdin data (overrides CLI args if detected)
370
- if (raw.gemini_version) {
371
- AGENT_ID = 'gemini-cli';
372
- AGENT_NAME = 'Gemini CLI';
373
- }
374
-
375
368
  // Debug: append guard invocation to debug log
376
369
  try {
377
370
  const { appendFileSync: afs, mkdirSync: mds } = await import('node:fs');
package/hooks/stop.mjs CHANGED
@@ -27,9 +27,8 @@ const API_KEY = process.env.SOLONGATE_API_KEY || dotenv.SOLONGATE_API_KEY || '';
27
27
  const API_URL = process.env.SOLONGATE_API_URL || dotenv.SOLONGATE_API_URL || 'https://api.solongate.com';
28
28
 
29
29
  // Agent identity from CLI args: node stop.mjs <agent_id> <agent_name>
30
- // Can be overridden at runtime when stdin contains gemini_version
31
- let AGENT_ID = process.argv[2] || 'claude-code';
32
- let AGENT_NAME = process.argv[3] || 'Claude Code';
30
+ const AGENT_ID = process.argv[2] || 'claude-code';
31
+ const AGENT_NAME = process.argv[3] || 'Claude Code';
33
32
 
34
33
  if (!API_KEY || !API_KEY.startsWith('sg_live_')) process.exit(0);
35
34
 
@@ -43,12 +42,6 @@ let input = '';
43
42
  process.stdin.on('data', c => input += c);
44
43
  process.stdin.on('end', async () => {
45
44
  try {
46
- // Auto-detect agent from stdin data
47
- try {
48
- const raw = JSON.parse(input);
49
- if (raw.gemini_version) { AGENT_ID = 'gemini-cli'; AGENT_NAME = 'Gemini CLI'; }
50
- } catch {}
51
-
52
45
  // Check if tool calls were made in this turn
53
46
  if (existsSync(flagFile)) {
54
47
  // Tool calls happened → audit.mjs already logged them. Clean up flag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.33.0",
3
+ "version": "0.34.0",
4
4
  "description": "AI tool security proxy — protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
5
5
  "type": "module",
6
6
  "bin": {