@solongate/proxy 0.81.22 → 0.81.23

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
@@ -8193,6 +8193,9 @@ function ruleSummary(r) {
8193
8193
  function PoliciesPanel({ focused }) {
8194
8194
  const list6 = useLoader(() => api.policies.list());
8195
8195
  const policies = list6.data?.policies ?? [];
8196
+ const activeQ = useLoader(() => api.policies.active());
8197
+ const activeId = activeQ.data?.policy?.id ?? null;
8198
+ const activeBy = activeQ.data?.matched_by;
8196
8199
  const [view, setView] = useState3("list");
8197
8200
  const [pi, setPi] = useState3(0);
8198
8201
  const [ri, setRi] = useState3(0);
@@ -8265,6 +8268,20 @@ function PoliciesPanel({ focused }) {
8265
8268
  else if (key.return || key.rightArrow) {
8266
8269
  setStatus(null);
8267
8270
  setView("rules");
8271
+ } else if (input === "a") {
8272
+ if (selected) {
8273
+ setStatus("Activating\u2026");
8274
+ void api.policies.setActive(selected.id).then(() => {
8275
+ setStatus(`\u2713 "${selected.name}" is now the ACTIVE policy (pinned) \xB7 reaches agents in ~30s`);
8276
+ activeQ.reload();
8277
+ }).catch((e) => setStatus("\u2717 " + (e instanceof Error ? e.message : String(e))));
8278
+ }
8279
+ } else if (input === "x") {
8280
+ setStatus("Deactivating\u2026");
8281
+ void api.policies.setActive(null).then(() => {
8282
+ setStatus("\u2713 active policy: NONE \u2014 no rules enforced, w/b grants are refused");
8283
+ activeQ.reload();
8284
+ }).catch((e) => setStatus("\u2717 " + (e instanceof Error ? e.message : String(e))));
8268
8285
  }
8269
8286
  return;
8270
8287
  }
@@ -8345,8 +8362,19 @@ function PoliciesPanel({ focused }) {
8345
8362
  { isActive: focused && !editing }
8346
8363
  );
8347
8364
  if (view === "list") {
8365
+ const activeName = activeId ? policies.find((p) => p.id === activeId)?.name ?? activeId : null;
8348
8366
  return /* @__PURE__ */ jsx3(DataView, { loading: list6.loading && !list6.data, error: list6.error, empty: !!list6.data && policies.length === 0, emptyText: "No policies.", children: /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
8349
- /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: focused ? "\u2191\u2193 select \xB7 enter open" : "press \u2192 to browse" }),
8367
+ /* @__PURE__ */ jsxs3(Box3, { children: [
8368
+ /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: "active: " }),
8369
+ activeQ.loading && !activeQ.data ? /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: "\u2026" }) : activeName ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
8370
+ /* @__PURE__ */ jsxs3(Text3, { color: theme.ok, bold: true, children: [
8371
+ "\u25CF ",
8372
+ truncate2(activeName, 28)
8373
+ ] }),
8374
+ /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: activeBy ? ` (${activeBy})` : "" })
8375
+ ] }) : /* @__PURE__ */ jsx3(Text3, { color: theme.bad, bold: true, children: "\u25CB NONE \u2014 nothing enforced, grants refused" })
8376
+ ] }),
8377
+ /* @__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" }),
8350
8378
  /* @__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: [
8351
8379
  (i === pi ? "\u25B8 " : " ") + truncate2(p.name, 26).padEnd(27),
8352
8380
  /* @__PURE__ */ jsxs3(Text3, { color: theme.dim, children: [
@@ -8355,8 +8383,10 @@ function PoliciesPanel({ focused }) {
8355
8383
  p.rules.length,
8356
8384
  " rules \xB7 v",
8357
8385
  p.version
8358
- ] })
8359
- ] }, p.id)) })
8386
+ ] }),
8387
+ p.id === activeId ? /* @__PURE__ */ jsx3(Text3, { color: theme.ok, bold: true, children: " \u25CF ACTIVE" }) : null
8388
+ ] }, p.id)) }),
8389
+ status ? /* @__PURE__ */ jsx3(Text3, { color: status.startsWith("\u2717") ? theme.bad : theme.ok, children: status }) : null
8360
8390
  ] }) });
8361
8391
  }
8362
8392
  const dirtyTag = dirty ? /* @__PURE__ */ jsx3(Text3, { color: theme.warn, children: " \u25CF unsaved (s save \xB7 x discard)" }) : null;
@@ -9603,7 +9633,7 @@ var init_App = __esm({
9603
9633
  HELP = [
9604
9634
  ["Global", [["\u2191\u2193", "move between sections"], ["\u2192 / enter", "open a section"], ["\u2190 / esc", "back to the menu"], ["?", "this help"], ["q", "quit"]]],
9605
9635
  ["Live", [["\u2191\u2193", "select a stream row"], ["enter", "full entry content"], ["w", "whitelist the selected DENY"], ["b", "block the selected ALLOW"], ["d / x / r", "filter denies / dlp / rate-limit"], ["f", "local / cloud filter"], ["/", "search"], ["s", "sessions (\u2191\u2193 pick, enter open)"], ["space", "copy mode (freeze)"]]],
9606
- ["Policies", [["\u2191\u2193", "browse / select"], ["enter", "open rules \u2192 open a rule"], ["space", "toggle a rule on/off"], ["e", "flip effect"], ["n", "new rule"], ["d", "delete rule"], ["m", "flip mode"], ["D", "dry-run the draft"], ["v", "versions / rollback"], ["s", "save"], ["x", "discard"]]],
9636
+ ["Policies", [["\u2191\u2193", "browse / select"], ["a", "activate (pin) selected policy"], ["x", "deactivate \u2014 no active policy"], ["enter", "open rules \u2192 open a rule"], ["space", "toggle a rule on/off"], ["e", "flip effect"], ["n", "new rule"], ["d", "delete rule"], ["m", "flip mode"], ["D", "dry-run the draft"], ["v", "versions / rollback"], ["s", "save"], ["x", "discard"]]],
9607
9637
  ["Rate limit / DLP", [["\u2191\u2193", "field / pattern"], ["\u2190\u2192", "adjust (shift = \xB110)"], ["space", "toggle pattern"], ["m", "mode"], ["a / d", "add / remove custom"], ["g", "ghost mode"], ["P", "self-protection"], ["s", "save"]]],
9608
9638
  ["Audit", [["\u2191\u2193", "select (list scrolls)"], ["enter", "full entry detail"], ["f / g", "decision / signal filter"], ["t / n / /", "tool / agent / search"], ["c", "clear filters"]]],
9609
9639
  ["Settings", [["\u2191\u2193", "move"], ["enter / space", "toggle \xB7 edit \xB7 add"], ["e", "webhook events"], ["d d", "delete"], ["r", "refresh"]]]
package/dist/tui/index.js CHANGED
@@ -1586,6 +1586,9 @@ function ruleSummary(r) {
1586
1586
  function PoliciesPanel({ focused }) {
1587
1587
  const list5 = useLoader(() => api.policies.list());
1588
1588
  const policies = list5.data?.policies ?? [];
1589
+ const activeQ = useLoader(() => api.policies.active());
1590
+ const activeId = activeQ.data?.policy?.id ?? null;
1591
+ const activeBy = activeQ.data?.matched_by;
1589
1592
  const [view, setView] = useState3("list");
1590
1593
  const [pi, setPi] = useState3(0);
1591
1594
  const [ri, setRi] = useState3(0);
@@ -1658,6 +1661,20 @@ function PoliciesPanel({ focused }) {
1658
1661
  else if (key.return || key.rightArrow) {
1659
1662
  setStatus(null);
1660
1663
  setView("rules");
1664
+ } else if (input === "a") {
1665
+ if (selected) {
1666
+ setStatus("Activating\u2026");
1667
+ void api.policies.setActive(selected.id).then(() => {
1668
+ setStatus(`\u2713 "${selected.name}" is now the ACTIVE policy (pinned) \xB7 reaches agents in ~30s`);
1669
+ activeQ.reload();
1670
+ }).catch((e) => setStatus("\u2717 " + (e instanceof Error ? e.message : String(e))));
1671
+ }
1672
+ } else if (input === "x") {
1673
+ setStatus("Deactivating\u2026");
1674
+ void api.policies.setActive(null).then(() => {
1675
+ setStatus("\u2713 active policy: NONE \u2014 no rules enforced, w/b grants are refused");
1676
+ activeQ.reload();
1677
+ }).catch((e) => setStatus("\u2717 " + (e instanceof Error ? e.message : String(e))));
1661
1678
  }
1662
1679
  return;
1663
1680
  }
@@ -1738,8 +1755,19 @@ function PoliciesPanel({ focused }) {
1738
1755
  { isActive: focused && !editing }
1739
1756
  );
1740
1757
  if (view === "list") {
1758
+ const activeName = activeId ? policies.find((p) => p.id === activeId)?.name ?? activeId : null;
1741
1759
  return /* @__PURE__ */ jsx3(DataView, { loading: list5.loading && !list5.data, error: list5.error, empty: !!list5.data && policies.length === 0, emptyText: "No policies.", children: /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
1742
- /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: focused ? "\u2191\u2193 select \xB7 enter open" : "press \u2192 to browse" }),
1760
+ /* @__PURE__ */ jsxs3(Box3, { children: [
1761
+ /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: "active: " }),
1762
+ activeQ.loading && !activeQ.data ? /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: "\u2026" }) : activeName ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
1763
+ /* @__PURE__ */ jsxs3(Text3, { color: theme.ok, bold: true, children: [
1764
+ "\u25CF ",
1765
+ truncate(activeName, 28)
1766
+ ] }),
1767
+ /* @__PURE__ */ jsx3(Text3, { color: theme.dim, children: activeBy ? ` (${activeBy})` : "" })
1768
+ ] }) : /* @__PURE__ */ jsx3(Text3, { color: theme.bad, bold: true, children: "\u25CB NONE \u2014 nothing enforced, grants refused" })
1769
+ ] }),
1770
+ /* @__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" }),
1743
1771
  /* @__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: [
1744
1772
  (i === pi ? "\u25B8 " : " ") + truncate(p.name, 26).padEnd(27),
1745
1773
  /* @__PURE__ */ jsxs3(Text3, { color: theme.dim, children: [
@@ -1748,8 +1776,10 @@ function PoliciesPanel({ focused }) {
1748
1776
  p.rules.length,
1749
1777
  " rules \xB7 v",
1750
1778
  p.version
1751
- ] })
1752
- ] }, p.id)) })
1779
+ ] }),
1780
+ p.id === activeId ? /* @__PURE__ */ jsx3(Text3, { color: theme.ok, bold: true, children: " \u25CF ACTIVE" }) : null
1781
+ ] }, p.id)) }),
1782
+ status ? /* @__PURE__ */ jsx3(Text3, { color: status.startsWith("\u2717") ? theme.bad : theme.ok, children: status }) : null
1753
1783
  ] }) });
1754
1784
  }
1755
1785
  const dirtyTag = dirty ? /* @__PURE__ */ jsx3(Text3, { color: theme.warn, children: " \u25CF unsaved (s save \xB7 x discard)" }) : null;
@@ -2875,7 +2905,7 @@ function App() {
2875
2905
  var HELP = [
2876
2906
  ["Global", [["\u2191\u2193", "move between sections"], ["\u2192 / enter", "open a section"], ["\u2190 / esc", "back to the menu"], ["?", "this help"], ["q", "quit"]]],
2877
2907
  ["Live", [["\u2191\u2193", "select a stream row"], ["enter", "full entry content"], ["w", "whitelist the selected DENY"], ["b", "block the selected ALLOW"], ["d / x / r", "filter denies / dlp / rate-limit"], ["f", "local / cloud filter"], ["/", "search"], ["s", "sessions (\u2191\u2193 pick, enter open)"], ["space", "copy mode (freeze)"]]],
2878
- ["Policies", [["\u2191\u2193", "browse / select"], ["enter", "open rules \u2192 open a rule"], ["space", "toggle a rule on/off"], ["e", "flip effect"], ["n", "new rule"], ["d", "delete rule"], ["m", "flip mode"], ["D", "dry-run the draft"], ["v", "versions / rollback"], ["s", "save"], ["x", "discard"]]],
2908
+ ["Policies", [["\u2191\u2193", "browse / select"], ["a", "activate (pin) selected policy"], ["x", "deactivate \u2014 no active policy"], ["enter", "open rules \u2192 open a rule"], ["space", "toggle a rule on/off"], ["e", "flip effect"], ["n", "new rule"], ["d", "delete rule"], ["m", "flip mode"], ["D", "dry-run the draft"], ["v", "versions / rollback"], ["s", "save"], ["x", "discard"]]],
2879
2909
  ["Rate limit / DLP", [["\u2191\u2193", "field / pattern"], ["\u2190\u2192", "adjust (shift = \xB110)"], ["space", "toggle pattern"], ["m", "mode"], ["a / d", "add / remove custom"], ["g", "ghost mode"], ["P", "self-protection"], ["s", "save"]]],
2880
2910
  ["Audit", [["\u2191\u2193", "select (list scrolls)"], ["enter", "full entry detail"], ["f / g", "decision / signal filter"], ["t / n / /", "tool / agent / search"], ["c", "clear filters"]]],
2881
2911
  ["Settings", [["\u2191\u2193", "move"], ["enter / space", "toggle \xB7 edit \xB7 add"], ["e", "webhook events"], ["d d", "delete"], ["r", "refresh"]]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.81.22",
3
+ "version": "0.81.23",
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": {