@solongate/proxy 0.59.1 → 0.59.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.
@@ -6535,7 +6535,7 @@ import { resolve, join, dirname, isAbsolute } from "node:path";
6535
6535
  import { homedir } from "node:os";
6536
6536
  import { gunzipSync } from "node:zlib";
6537
6537
  import { createHash } from "node:crypto";
6538
- var HOOK_VERSION = 30;
6538
+ var HOOK_VERSION = 31;
6539
6539
  function localLogsOnly(security) {
6540
6540
  const l = security && security.localLogs;
6541
6541
  return !!(l && l.enabled && typeof l.path === "string" && l.path.trim());
@@ -7646,7 +7646,7 @@ process.stdin.on("end", async () => {
7646
7646
  let securityCfg = null;
7647
7647
  const agentKey = (AGENT_ID || "default").replace(/[^a-zA-Z0-9_-]/g, "_");
7648
7648
  const policyCacheFile = join(resolve(homedir(), ".solongate"), ".policy-cache-" + agentKey + ".json");
7649
- const POLICY_TTL_MS = 6e4;
7649
+ const POLICY_TTL_MS = 1e4;
7650
7650
  try {
7651
7651
  let dashboardPolicy = null;
7652
7652
  let staleCache = null;
package/hooks/guard.mjs CHANGED
@@ -31,7 +31,7 @@ import { createHash } from 'node:crypto';
31
31
  // the installed hook self-updates when the cloud version is higher (see
32
32
  // maybeSelfUpdate). This is what makes guard fixes propagate without a manual
33
33
  // reinstall — the same trust model as the OPA WASM this hook already runs.
34
- const HOOK_VERSION = 30;
34
+ const HOOK_VERSION = 31;
35
35
 
36
36
  // True when local log storage is ON. In that mode logs are kept LOCAL ONLY and
37
37
  // nothing is sent to the cloud audit log.
@@ -1432,11 +1432,14 @@ process.stdin.on('end', async () => {
1432
1432
  const agentKey = (AGENT_ID || 'default').replace(/[^a-zA-Z0-9_-]/g, '_');
1433
1433
  const policyCacheFile = join(resolve(homedir(), '.solongate'), '.policy-cache-' + agentKey + '.json');
1434
1434
  // Serve the cached policy without any network for TTL seconds. This is a HOT
1435
- // PATH — it runs before every single tool call so a short TTL means we
1436
- // block on a cloud round-trip on nearly every action. A dashboard-managed
1437
- // policy changes rarely, so 60s freshness is plenty; the previous 3s made the
1438
- // cache useless and put an 8s-timeout fetch in front of most tool calls.
1439
- const POLICY_TTL_MS = 60_000;
1435
+ // PATH — it runs before every tool call. The original 3s TTL was slow not
1436
+ // because of the number but because it paired an 8s-timeout blocking fetch
1437
+ // with an every-3s cadence (and stacked behind the WASM fetch + a shared
1438
+ // rate limit). With those fixed 2s timeout, WASM decoupled (24h/fp),
1439
+ // last-known-good stale fallback — a short TTL is cheap again: one small
1440
+ // ~200ms GET on a single call per window, others read the cache with no
1441
+ // network. So keep freshness tight (10s propagation) at negligible cost.
1442
+ const POLICY_TTL_MS = 10_000;
1440
1443
  try {
1441
1444
  let dashboardPolicy = null;
1442
1445
  // Last-known-good cache, kept even past the TTL so we can fall back on it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.59.1",
3
+ "version": "0.59.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": {