@solongate/proxy 0.81.21 → 0.81.22

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
@@ -7356,7 +7356,6 @@ function LivePanel({ active: active2 }) {
7356
7356
  const [actionMsg, setActionMsg] = useState2(null);
7357
7357
  const notifiedRef = useRef2(/* @__PURE__ */ new Set());
7358
7358
  const openedAtRef = useRef2(Date.now());
7359
- const activePolicyRef = useRef2(null);
7360
7359
  const [mode, setMode] = useState2("stream");
7361
7360
  const [pickIdx, setPickIdx] = useState2(0);
7362
7361
  const [detail, setDetail] = useState2(null);
@@ -7680,18 +7679,14 @@ function LivePanel({ active: active2 }) {
7680
7679
  }
7681
7680
  setActionMsg({ text: act === "whitelist" ? "whitelisting\u2026" : "blocking\u2026", level: "ok", until: Date.now() + 4e3 });
7682
7681
  try {
7682
+ const a = await api.policies.active();
7683
+ const pid = a.policy?.id ?? null;
7684
+ if (!pid) throw new Error("no active policy \u2014 rule NOT added. Activate a policy first (Policies section).");
7683
7685
  let res;
7684
7686
  if (e.source === "cloud") {
7685
7687
  const realId = e.id.slice(2);
7686
7688
  res = act === "whitelist" ? await api.audit.whitelist(realId) : await api.audit.block(realId);
7687
7689
  } else {
7688
- let pid = activePolicyRef.current;
7689
- if (!pid) {
7690
- const a = await api.policies.active();
7691
- pid = a.policy?.id ?? null;
7692
- activePolicyRef.current = pid;
7693
- }
7694
- if (!pid) throw new Error("no active policy resolves for this machine");
7695
7690
  const t = extractTarget(e.detail);
7696
7691
  res = await api.policies.addRule(pid, { toolPattern: e.tool, kind: t?.kind ?? "tool", value: t?.value, effect: act === "whitelist" ? "ALLOW" : "DENY" });
7697
7692
  }
package/dist/tui/index.js CHANGED
@@ -800,7 +800,6 @@ function LivePanel({ active: active2 }) {
800
800
  const [actionMsg, setActionMsg] = useState2(null);
801
801
  const notifiedRef = useRef2(/* @__PURE__ */ new Set());
802
802
  const openedAtRef = useRef2(Date.now());
803
- const activePolicyRef = useRef2(null);
804
803
  const [mode, setMode] = useState2("stream");
805
804
  const [pickIdx, setPickIdx] = useState2(0);
806
805
  const [detail, setDetail] = useState2(null);
@@ -1124,18 +1123,14 @@ function LivePanel({ active: active2 }) {
1124
1123
  }
1125
1124
  setActionMsg({ text: act === "whitelist" ? "whitelisting\u2026" : "blocking\u2026", level: "ok", until: Date.now() + 4e3 });
1126
1125
  try {
1126
+ const a = await api.policies.active();
1127
+ const pid = a.policy?.id ?? null;
1128
+ if (!pid) throw new Error("no active policy \u2014 rule NOT added. Activate a policy first (Policies section).");
1127
1129
  let res;
1128
1130
  if (e.source === "cloud") {
1129
1131
  const realId = e.id.slice(2);
1130
1132
  res = act === "whitelist" ? await api.audit.whitelist(realId) : await api.audit.block(realId);
1131
1133
  } else {
1132
- let pid = activePolicyRef.current;
1133
- if (!pid) {
1134
- const a = await api.policies.active();
1135
- pid = a.policy?.id ?? null;
1136
- activePolicyRef.current = pid;
1137
- }
1138
- if (!pid) throw new Error("no active policy resolves for this machine");
1139
1134
  const t = extractTarget(e.detail);
1140
1135
  res = await api.policies.addRule(pid, { toolPattern: e.tool, kind: t?.kind ?? "tool", value: t?.value, effect: act === "whitelist" ? "ALLOW" : "DENY" });
1141
1136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.81.21",
3
+ "version": "0.81.22",
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": {