@solongate/proxy 0.82.16 → 0.82.17

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.
@@ -6536,7 +6536,7 @@ import { resolve, join, dirname, isAbsolute } from "node:path";
6536
6536
  import { homedir } from "node:os";
6537
6537
  import { gunzipSync } from "node:zlib";
6538
6538
  import { createHash } from "node:crypto";
6539
- var HOOK_VERSION = 44;
6539
+ var HOOK_VERSION = 45;
6540
6540
  function localLogsOnly(security) {
6541
6541
  if (security && typeof security === "object") {
6542
6542
  const l = security.localLogs;
@@ -6799,8 +6799,8 @@ function sgFinish(code) {
6799
6799
  function blockTool(reason) {
6800
6800
  if (AGENT_TYPE === "antigravity") {
6801
6801
  process.stdout.write(JSON.stringify({
6802
- decision: "deny",
6803
- reason: `[SolonGate] ${reason}`
6802
+ allow_tool: false,
6803
+ deny_reason: `[SolonGate] ${reason}`
6804
6804
  }));
6805
6805
  sgFinish(0);
6806
6806
  } else {
@@ -6818,7 +6818,7 @@ function blockTool(reason) {
6818
6818
  }
6819
6819
  function allowTool() {
6820
6820
  if (AGENT_TYPE === "antigravity") {
6821
- process.stdout.write(JSON.stringify({ decision: "allow" }));
6821
+ process.stdout.write(JSON.stringify({ allow_tool: true }));
6822
6822
  }
6823
6823
  sgFinish(0);
6824
6824
  }
@@ -7966,7 +7966,7 @@ if (!REFRESH_MODE) {
7966
7966
  }
7967
7967
  await maybeSelfUpdate();
7968
7968
  if (AGENT_TYPE === "antigravity") {
7969
- process.stdout.write(JSON.stringify({ decision: "deny", reason: ghostHit }));
7969
+ process.stdout.write(JSON.stringify({ allow_tool: false, deny_reason: ghostHit }));
7970
7970
  sgFinish(0);
7971
7971
  }
7972
7972
  process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", permissionDecisionReason: ghostHit } }));
package/hooks/guard.mjs CHANGED
@@ -32,7 +32,7 @@ import { createHash } from 'node:crypto';
32
32
  // the installed hook self-updates when the cloud version is higher (see
33
33
  // maybeSelfUpdate). This is what makes guard fixes propagate without a manual
34
34
  // reinstall — the same trust model as the OPA WASM this hook already runs.
35
- const HOOK_VERSION = 44;
35
+ const HOOK_VERSION = 45;
36
36
 
37
37
  // True when local log storage is ON. In that mode logs are kept LOCAL ONLY and
38
38
  // nothing is sent to the cloud audit log.
@@ -345,7 +345,12 @@ if (REFRESH_MODE) { try { setTimeout(() => { try { process.exit(process.exitCode
345
345
  // ── Per-tool block/allow output ──
346
346
  // Response format depends on the agent:
347
347
  // Claude Code: exit 2 + stderr = BLOCK, exit 0 = ALLOW
348
- // Antigravity CLI: {"decision": "deny/allow", "reason": "..."} on stdout (exit 0)
348
+ // Antigravity CLI: its PreToolUse hook result is a protobuf message decoded from
349
+ // stdout JSON — BLOCK = {"allow_tool": false, "deny_reason": "..."}, ALLOW =
350
+ // {"allow_tool": true} (exit 0). NOTE: {"decision":"deny"} is Antigravity's
351
+ // *Stop* hook schema, NOT the tool gate — agy silently runs the tool if we
352
+ // send that, so the field names here are load-bearing (verified in the agy
353
+ // 1.1.5 binary: AllowTool bool / DenyReason string).
349
354
 
350
355
  // Terminate the hook WITHOUT forcing process.exit(). On Windows + Node 24, calling
351
356
  // process.exit() right after a fetch() (the cloud audit-log POST) aborts with
@@ -380,8 +385,8 @@ function sgFinish(code) {
380
385
  function blockTool(reason) {
381
386
  if (AGENT_TYPE === 'antigravity') {
382
387
  process.stdout.write(JSON.stringify({
383
- decision: 'deny',
384
- reason: `[SolonGate] ${reason}`,
388
+ allow_tool: false,
389
+ deny_reason: `[SolonGate] ${reason}`,
385
390
  }));
386
391
  sgFinish(0);
387
392
  } else {
@@ -409,7 +414,7 @@ function blockTool(reason) {
409
414
 
410
415
  function allowTool() {
411
416
  if (AGENT_TYPE === 'antigravity') {
412
- process.stdout.write(JSON.stringify({ decision: 'allow' }));
417
+ process.stdout.write(JSON.stringify({ allow_tool: true }));
413
418
  }
414
419
  sgFinish(0);
415
420
  }
@@ -1816,7 +1821,7 @@ if (!REFRESH_MODE) { try { input += readFileSync(0, 'utf-8'); } catch {} }
1816
1821
  });
1817
1822
  } catch {}
1818
1823
  await maybeSelfUpdate();
1819
- if (AGENT_TYPE === 'antigravity') { process.stdout.write(JSON.stringify({ decision: 'deny', reason: ghostHit })); sgFinish(0); }
1824
+ if (AGENT_TYPE === 'antigravity') { process.stdout.write(JSON.stringify({ allow_tool: false, deny_reason: ghostHit })); sgFinish(0); }
1820
1825
  // Claude Code: JSON deny on stdout + exit 2 (reason on stderr). Exit 2 is
1821
1826
  // the only block enforced in auto-accept mode (see blockTool); the JSON is
1822
1827
  // the Windows fallback. ghostHit is a bare "No such file or directory", so
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.16",
3
+ "version": "0.82.17",
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": {