@solongate/proxy 0.81.89 → 0.81.90

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
@@ -8840,6 +8840,10 @@ function PoliciesPanel({ focused }) {
8840
8840
  setRi(0);
8841
8841
  }
8842
8842
  }, [detail.data]);
8843
+ usePoll(() => {
8844
+ list6.reloadQuiet();
8845
+ activeQ.reloadQuiet();
8846
+ }, 6e3);
8843
8847
  const mutate = (nextRules, nextMode = mode) => {
8844
8848
  setRules(nextRules);
8845
8849
  setMode(nextMode);
@@ -8876,6 +8880,13 @@ function PoliciesPanel({ focused }) {
8876
8880
  };
8877
8881
  useInput2(
8878
8882
  (input, key) => {
8883
+ if (input === "r" && !editing) {
8884
+ list6.reload();
8885
+ activeQ.reload();
8886
+ detail.reload();
8887
+ setStatus("refreshed");
8888
+ return;
8889
+ }
8879
8890
  if (view === "list") {
8880
8891
  if (key.upArrow) setPi((n) => Math.max(0, n - 1));
8881
8892
  else if (key.downArrow) setPi((n) => Math.min(policies.length - 1, n + 1));
@@ -8966,7 +8977,7 @@ function PoliciesPanel({ focused }) {
8966
8977
  /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: activeBy ? ` (${activeBy})` : "" })
8967
8978
  ] }) : /* @__PURE__ */ jsx3(Text3, { color: theme.bad, bold: true, children: "\u25CB NONE \u2014 nothing enforced, grants refused" })
8968
8979
  ] }),
8969
- /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: focused ? "\u2191\u2193 select \xB7 enter open \xB7 a activate \xB7 x deactivate (none)" : "press \u2192 to browse" }),
8980
+ /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: focused ? "\u2191\u2193 select \xB7 enter open \xB7 a activate \xB7 x deactivate \xB7 r refresh" : "press \u2192 to browse" }),
8970
8981
  /* @__PURE__ */ jsx3(Box3, { marginTop: 1, flexDirection: "column", children: policies.map((p, i) => /* @__PURE__ */ jsxs3(Text3, { color: i === pi ? theme.accentBright : void 0, bold: i === pi, children: [
8971
8982
  (i === pi ? "\u25B8 " : " ") + truncate2(p.name, 26).padEnd(27),
8972
8983
  /* @__PURE__ */ jsxs3(Text3, { color: theme.dim, children: [
@@ -9097,8 +9108,13 @@ function RateLimitPanel({ focused }) {
9097
9108
  const [fi, setFi] = useState4(0);
9098
9109
  const [status, setStatus] = useState4(null);
9099
9110
  useEffect4(() => {
9100
- if (layersQ.data && !draft) setDraft({ ...layersQ.data.layers.rateLimit });
9101
- }, [layersQ.data, draft]);
9111
+ if (layersQ.data && !dirty) setDraft({ ...layersQ.data.layers.rateLimit });
9112
+ }, [layersQ.data, dirty]);
9113
+ usePoll(() => {
9114
+ if (!dirty) layersQ.reloadQuiet();
9115
+ historyQ.reloadQuiet();
9116
+ insightsQ.reloadQuiet();
9117
+ }, 6e3);
9102
9118
  const adjust = (dir, step) => {
9103
9119
  if (!draft) return;
9104
9120
  const field = FIELDS2[fi];
@@ -9129,13 +9145,19 @@ function RateLimitPanel({ focused }) {
9129
9145
  else if (key.leftArrow) adjust(-1, step);
9130
9146
  else if (key.rightArrow) adjust(1, step);
9131
9147
  else if (input === "s") void save();
9148
+ else if (input === "r") {
9149
+ layersQ.reload();
9150
+ historyQ.reload();
9151
+ insightsQ.reload();
9152
+ setStatus("refreshed");
9153
+ }
9132
9154
  },
9133
9155
  { isActive: focused }
9134
9156
  );
9135
9157
  const history = (historyQ.data?.history ?? []).slice().sort((a, b) => b.ts - a.ts);
9136
9158
  const lastChange = history[0];
9137
9159
  const peaks = insightsQ.data?.["peaks"] ?? { minute: 0, hour: 0, day: 0 };
9138
- const anomalies2 = (insightsQ.data?.["anomalies"] ?? []).slice().sort((a, b) => new Date(b.minute).getTime() - new Date(a.minute).getTime());
9160
+ const anomalies2 = (insightsQ.data?.["anomalies"] ?? []).slice().sort((a, b) => b.count - a.count || new Date(b.minute).getTime() - new Date(a.minute).getTime());
9139
9161
  return /* @__PURE__ */ jsx4(DataView, { loading: layersQ.loading && !draft, error: layersQ.error, children: draft ? (() => {
9140
9162
  const lim = draft.perMinute;
9141
9163
  const now = insightsQ.data ? insightsQ.data["activity"]?.minute?.slice(-1)[0]?.count ?? 0 : 0;
@@ -9147,7 +9169,7 @@ function RateLimitPanel({ focused }) {
9147
9169
  const shown = anomalies2.slice(0, burstBudget);
9148
9170
  const bw = Math.max(10, cols - 30);
9149
9171
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", height: rows, overflow: "hidden", children: [
9150
- /* @__PURE__ */ jsx4(Text4, { color: theme.dim, wrap: "truncate", children: focused ? "\u2191\u2193 field \xB7 \u2190\u2192 \xB11 \xB7 shift+\u2190\u2192 \xB110 \xB7 s save" : "press \u2192 to edit" }),
9172
+ /* @__PURE__ */ jsx4(Text4, { color: theme.dim, wrap: "truncate", children: focused ? "\u2191\u2193 field \xB7 \u2190\u2192 \xB11 \xB7 shift+\u2190\u2192 \xB110 \xB7 s save \xB7 r refresh" : "press \u2192 to edit" }),
9151
9173
  /* @__PURE__ */ jsxs4(FieldRow, { label: "Mode", active: focused && fi === 0, children: [
9152
9174
  /* @__PURE__ */ jsx4(Text4, { color: modeColor(draft.mode), bold: true, children: draft.mode }),
9153
9175
  /* @__PURE__ */ jsx4(Text4, { color: theme.dim, children: draft.mode === "off" ? " no limit" : draft.mode === "detect" ? " flag bursts, never block" : " DENY calls over the limit" })
@@ -9251,13 +9273,16 @@ function DlpPanel({ focused }) {
9251
9273
  const [newName, setNewName] = useState5("");
9252
9274
  const [input, setInput] = useState5("");
9253
9275
  useEffect5(() => {
9254
- if (q.data && !dlp) {
9276
+ if (q.data && !dirty) {
9255
9277
  setDlp({ ...q.data.layers.dlp, patterns: [...q.data.layers.dlp.patterns], custom: [...q.data.layers.dlp.custom] });
9256
9278
  setAvailable(q.data.availablePatterns);
9257
9279
  setGhostOn(q.data.layers.ghost.mode === "on");
9258
9280
  setGhostPats([...q.data.layers.ghost.patterns]);
9259
9281
  }
9260
- }, [q.data, dlp]);
9282
+ }, [q.data, dirty]);
9283
+ usePoll(() => {
9284
+ if (!dirty && !adding) q.reloadQuiet();
9285
+ }, 6e3);
9261
9286
  const mutate = (next) => {
9262
9287
  setDlp(next);
9263
9288
  setDirty(true);
package/dist/tui/index.js CHANGED
@@ -1958,6 +1958,10 @@ function PoliciesPanel({ focused }) {
1958
1958
  setRi(0);
1959
1959
  }
1960
1960
  }, [detail.data]);
1961
+ usePoll(() => {
1962
+ list5.reloadQuiet();
1963
+ activeQ.reloadQuiet();
1964
+ }, 6e3);
1961
1965
  const mutate = (nextRules, nextMode = mode) => {
1962
1966
  setRules(nextRules);
1963
1967
  setMode(nextMode);
@@ -1994,6 +1998,13 @@ function PoliciesPanel({ focused }) {
1994
1998
  };
1995
1999
  useInput2(
1996
2000
  (input, key) => {
2001
+ if (input === "r" && !editing) {
2002
+ list5.reload();
2003
+ activeQ.reload();
2004
+ detail.reload();
2005
+ setStatus("refreshed");
2006
+ return;
2007
+ }
1997
2008
  if (view === "list") {
1998
2009
  if (key.upArrow) setPi((n) => Math.max(0, n - 1));
1999
2010
  else if (key.downArrow) setPi((n) => Math.min(policies.length - 1, n + 1));
@@ -2084,7 +2095,7 @@ function PoliciesPanel({ focused }) {
2084
2095
  /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: activeBy ? ` (${activeBy})` : "" })
2085
2096
  ] }) : /* @__PURE__ */ jsx3(Text3, { color: theme.bad, bold: true, children: "\u25CB NONE \u2014 nothing enforced, grants refused" })
2086
2097
  ] }),
2087
- /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: focused ? "\u2191\u2193 select \xB7 enter open \xB7 a activate \xB7 x deactivate (none)" : "press \u2192 to browse" }),
2098
+ /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: focused ? "\u2191\u2193 select \xB7 enter open \xB7 a activate \xB7 x deactivate \xB7 r refresh" : "press \u2192 to browse" }),
2088
2099
  /* @__PURE__ */ jsx3(Box3, { marginTop: 1, flexDirection: "column", children: policies.map((p, i) => /* @__PURE__ */ jsxs3(Text3, { color: i === pi ? theme.accentBright : void 0, bold: i === pi, children: [
2089
2100
  (i === pi ? "\u25B8 " : " ") + truncate(p.name, 26).padEnd(27),
2090
2101
  /* @__PURE__ */ jsxs3(Text3, { color: theme.dim, children: [
@@ -2190,8 +2201,13 @@ function RateLimitPanel({ focused }) {
2190
2201
  const [fi, setFi] = useState4(0);
2191
2202
  const [status, setStatus] = useState4(null);
2192
2203
  useEffect4(() => {
2193
- if (layersQ.data && !draft) setDraft({ ...layersQ.data.layers.rateLimit });
2194
- }, [layersQ.data, draft]);
2204
+ if (layersQ.data && !dirty) setDraft({ ...layersQ.data.layers.rateLimit });
2205
+ }, [layersQ.data, dirty]);
2206
+ usePoll(() => {
2207
+ if (!dirty) layersQ.reloadQuiet();
2208
+ historyQ.reloadQuiet();
2209
+ insightsQ.reloadQuiet();
2210
+ }, 6e3);
2195
2211
  const adjust = (dir, step) => {
2196
2212
  if (!draft) return;
2197
2213
  const field = FIELDS2[fi];
@@ -2222,13 +2238,19 @@ function RateLimitPanel({ focused }) {
2222
2238
  else if (key.leftArrow) adjust(-1, step);
2223
2239
  else if (key.rightArrow) adjust(1, step);
2224
2240
  else if (input === "s") void save();
2241
+ else if (input === "r") {
2242
+ layersQ.reload();
2243
+ historyQ.reload();
2244
+ insightsQ.reload();
2245
+ setStatus("refreshed");
2246
+ }
2225
2247
  },
2226
2248
  { isActive: focused }
2227
2249
  );
2228
2250
  const history = (historyQ.data?.history ?? []).slice().sort((a, b) => b.ts - a.ts);
2229
2251
  const lastChange = history[0];
2230
2252
  const peaks = insightsQ.data?.["peaks"] ?? { minute: 0, hour: 0, day: 0 };
2231
- const anomalies2 = (insightsQ.data?.["anomalies"] ?? []).slice().sort((a, b) => new Date(b.minute).getTime() - new Date(a.minute).getTime());
2253
+ const anomalies2 = (insightsQ.data?.["anomalies"] ?? []).slice().sort((a, b) => b.count - a.count || new Date(b.minute).getTime() - new Date(a.minute).getTime());
2232
2254
  return /* @__PURE__ */ jsx4(DataView, { loading: layersQ.loading && !draft, error: layersQ.error, children: draft ? (() => {
2233
2255
  const lim = draft.perMinute;
2234
2256
  const now = insightsQ.data ? insightsQ.data["activity"]?.minute?.slice(-1)[0]?.count ?? 0 : 0;
@@ -2240,7 +2262,7 @@ function RateLimitPanel({ focused }) {
2240
2262
  const shown = anomalies2.slice(0, burstBudget);
2241
2263
  const bw = Math.max(10, cols - 30);
2242
2264
  return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", height: rows, overflow: "hidden", children: [
2243
- /* @__PURE__ */ jsx4(Text4, { color: theme.dim, wrap: "truncate", children: focused ? "\u2191\u2193 field \xB7 \u2190\u2192 \xB11 \xB7 shift+\u2190\u2192 \xB110 \xB7 s save" : "press \u2192 to edit" }),
2265
+ /* @__PURE__ */ jsx4(Text4, { color: theme.dim, wrap: "truncate", children: focused ? "\u2191\u2193 field \xB7 \u2190\u2192 \xB11 \xB7 shift+\u2190\u2192 \xB110 \xB7 s save \xB7 r refresh" : "press \u2192 to edit" }),
2244
2266
  /* @__PURE__ */ jsxs4(FieldRow, { label: "Mode", active: focused && fi === 0, children: [
2245
2267
  /* @__PURE__ */ jsx4(Text4, { color: modeColor(draft.mode), bold: true, children: draft.mode }),
2246
2268
  /* @__PURE__ */ jsx4(Text4, { color: theme.dim, children: draft.mode === "off" ? " no limit" : draft.mode === "detect" ? " flag bursts, never block" : " DENY calls over the limit" })
@@ -2329,13 +2351,16 @@ function DlpPanel({ focused }) {
2329
2351
  const [newName, setNewName] = useState5("");
2330
2352
  const [input, setInput] = useState5("");
2331
2353
  useEffect5(() => {
2332
- if (q.data && !dlp) {
2354
+ if (q.data && !dirty) {
2333
2355
  setDlp({ ...q.data.layers.dlp, patterns: [...q.data.layers.dlp.patterns], custom: [...q.data.layers.dlp.custom] });
2334
2356
  setAvailable(q.data.availablePatterns);
2335
2357
  setGhostOn(q.data.layers.ghost.mode === "on");
2336
2358
  setGhostPats([...q.data.layers.ghost.patterns]);
2337
2359
  }
2338
- }, [q.data, dlp]);
2360
+ }, [q.data, dirty]);
2361
+ usePoll(() => {
2362
+ if (!dirty && !adding) q.reloadQuiet();
2363
+ }, 6e3);
2339
2364
  const mutate = (next) => {
2340
2365
  setDlp(next);
2341
2366
  setDirty(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.81.89",
3
+ "version": "0.81.90",
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": {