@solongate/proxy 0.82.97 → 0.82.99

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.
@@ -122,6 +122,16 @@ function codexHooksStatus() {
122
122
  }
123
123
  return { registered, trusted, disabled };
124
124
  }
125
+ function installedGuardVersion() {
126
+ try {
127
+ const p = globalPaths();
128
+ const s = readFileSync(join(p.hooksDir, "guard.mjs"), "utf-8");
129
+ const m = s.match(/HOOK_VERSION\s*=\s*(\d+)/);
130
+ return m ? parseInt(m[1], 10) : null;
131
+ } catch {
132
+ return null;
133
+ }
134
+ }
125
135
 
126
136
  // src/api-client/client.ts
127
137
  var DEFAULT_API_URL = "https://api.solongate.com";
@@ -1248,7 +1258,14 @@ async function collectChecks() {
1248
1258
  }
1249
1259
  try {
1250
1260
  const g = await api.settings.getGuardStatus();
1251
- checks.push({ name: "guard hook", ok: g.up_to_date ? true : "warn", detail: g.up_to_date ? `v${g.installed} (latest) \xB7 ${g.device_count} device(s)` : `v${g.installed} \u2192 v${g.latest} available \xB7 run \`solongate update\` in your terminal` });
1261
+ const here = installedGuardVersion();
1262
+ const latest = g.latest ?? here;
1263
+ const current = here != null && latest != null ? here >= latest : g.up_to_date;
1264
+ checks.push({
1265
+ name: "guard hook",
1266
+ ok: current ? true : "warn",
1267
+ detail: current ? `v${here ?? g.installed} (latest) \xB7 ${g.device_count} device(s)` : `v${here ?? g.installed} \u2192 v${latest} available \xB7 run \`solongate update\` in your terminal`
1268
+ });
1252
1269
  } catch {
1253
1270
  }
1254
1271
  }
package/dist/index.js CHANGED
@@ -11335,7 +11335,14 @@ async function collectChecks() {
11335
11335
  }
11336
11336
  try {
11337
11337
  const g = await api.settings.getGuardStatus();
11338
- checks.push({ name: "guard hook", ok: g.up_to_date ? true : "warn", detail: g.up_to_date ? `v${g.installed} (latest) \xB7 ${g.device_count} device(s)` : `v${g.installed} \u2192 v${g.latest} available \xB7 run \`solongate update\` in your terminal` });
11338
+ const here = installedGuardVersion();
11339
+ const latest = g.latest ?? here;
11340
+ const current = here != null && latest != null ? here >= latest : g.up_to_date;
11341
+ checks.push({
11342
+ name: "guard hook",
11343
+ ok: current ? true : "warn",
11344
+ detail: current ? `v${here ?? g.installed} (latest) \xB7 ${g.device_count} device(s)` : `v${here ?? g.installed} \u2192 v${latest} available \xB7 run \`solongate update\` in your terminal`
11345
+ });
11339
11346
  } catch {
11340
11347
  }
11341
11348
  }
@@ -11462,7 +11469,7 @@ function SettingsPanel({
11462
11469
  const step = setInterval(() => setDiagStep((s) => Math.min(s + 1, total - 1)), 220);
11463
11470
  return () => clearInterval(step);
11464
11471
  }, [diagBusy]);
11465
- const allowance = guestAllowance();
11472
+ void guestAllowance;
11466
11473
  const ver = currentVersion();
11467
11474
  useEffect7(() => {
11468
11475
  let live2 = true;
@@ -11534,7 +11541,6 @@ function SettingsPanel({
11534
11541
  const rowsAll = [
11535
11542
  ...accounts.map((acc) => ({ kind: "acct", acc })),
11536
11543
  { kind: "acct-add" },
11537
- ...allowance ? [{ kind: "allowance", used: allowance.used, limit: allowance.limit }] : [],
11538
11544
  ...locked ? [] : [
11539
11545
  { kind: "guard" },
11540
11546
  { kind: "self" },
package/dist/tui/index.js CHANGED
@@ -4364,7 +4364,14 @@ async function collectChecks() {
4364
4364
  }
4365
4365
  try {
4366
4366
  const g = await api.settings.getGuardStatus();
4367
- checks.push({ name: "guard hook", ok: g.up_to_date ? true : "warn", detail: g.up_to_date ? `v${g.installed} (latest) \xB7 ${g.device_count} device(s)` : `v${g.installed} \u2192 v${g.latest} available \xB7 run \`solongate update\` in your terminal` });
4367
+ const here = installedGuardVersion();
4368
+ const latest = g.latest ?? here;
4369
+ const current = here != null && latest != null ? here >= latest : g.up_to_date;
4370
+ checks.push({
4371
+ name: "guard hook",
4372
+ ok: current ? true : "warn",
4373
+ detail: current ? `v${here ?? g.installed} (latest) \xB7 ${g.device_count} device(s)` : `v${here ?? g.installed} \u2192 v${latest} available \xB7 run \`solongate update\` in your terminal`
4374
+ });
4368
4375
  } catch {
4369
4376
  }
4370
4377
  }
@@ -4658,7 +4665,7 @@ function SettingsPanel({
4658
4665
  const step = setInterval(() => setDiagStep((s) => Math.min(s + 1, total - 1)), 220);
4659
4666
  return () => clearInterval(step);
4660
4667
  }, [diagBusy]);
4661
- const allowance = guestAllowance();
4668
+ void guestAllowance;
4662
4669
  const ver = currentVersion();
4663
4670
  useEffect7(() => {
4664
4671
  let live2 = true;
@@ -4730,7 +4737,6 @@ function SettingsPanel({
4730
4737
  const rowsAll = [
4731
4738
  ...accounts.map((acc) => ({ kind: "acct", acc })),
4732
4739
  { kind: "acct-add" },
4733
- ...allowance ? [{ kind: "allowance", used: allowance.used, limit: allowance.limit }] : [],
4734
4740
  ...locked ? [] : [
4735
4741
  { kind: "guard" },
4736
4742
  { kind: "self" },
@@ -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 = 68;
6539
+ var HOOK_VERSION = 69;
6540
6540
  function localLogsOnly(security) {
6541
6541
  if (security && typeof security === "object") {
6542
6542
  const l = security.localLogs;
@@ -7957,7 +7957,7 @@ function securityLayerCheck(toolName, args, cfg, agentKey) {
7957
7957
  try {
7958
7958
  const q = cfg.guestQuota;
7959
7959
  if (q && q.exhausted) {
7960
- return `Guest allowance used up (${q.limit} tool calls). Create an account at https://auth.solongate.com to carry on \u2014 your project, its policy and everything recorded carry over, and this device keeps working. To stop guarding this machine instead: solongate \u2192 Settings \u2192 guard \u2192 d.`;
7960
+ return `Guest allowance used up (${q.limit} tool calls). Create an account at https://auth.solongate.com to carry on. Your project, its policy and everything recorded carry over, and this device keeps working. To stop guarding this machine instead: solongate, Settings, guard, then press d.`;
7961
7961
  }
7962
7962
  if (cfg.dlpBlock) {
7963
7963
  const hit = dlpScan(args, cfg.dlpBlock);
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 = 68;
35
+ const HOOK_VERSION = 69;
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.
@@ -1772,7 +1772,7 @@ function securityLayerCheck(toolName, args, cfg, agentKey) {
1772
1772
  // call through after the allowance is gone.
1773
1773
  const q = cfg.guestQuota;
1774
1774
  if (q && q.exhausted) {
1775
- return `Guest allowance used up (${q.limit} tool calls). Create an account at https://auth.solongate.com to carry on your project, its policy and everything recorded carry over, and this device keeps working. To stop guarding this machine instead: solongate Settings guard d.`;
1775
+ return `Guest allowance used up (${q.limit} tool calls). Create an account at https://auth.solongate.com to carry on. Your project, its policy and everything recorded carry over, and this device keeps working. To stop guarding this machine instead: solongate, Settings, guard, then press d.`;
1776
1776
  }
1777
1777
  if (cfg.dlpBlock) {
1778
1778
  const hit = dlpScan(args, cfg.dlpBlock);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.97",
3
+ "version": "0.82.99",
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": {