@solongate/proxy 0.82.50 → 0.82.52

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
@@ -9224,6 +9224,7 @@ function PoliciesPanel({ focused }) {
9224
9224
  const [status, setStatus] = useState4(null);
9225
9225
  const [pendingDel, setPendingDel] = useState4(null);
9226
9226
  const [permCursor, setPermCursor] = useState4(0);
9227
+ const [busyCreate, setBusyCreate] = useState4(false);
9227
9228
  const selected = policies[Math.min(pi, Math.max(0, policies.length - 1))];
9228
9229
  const detail = useLoader(() => selected ? api.policies.get(selected.id) : Promise.resolve(null), [selected?.id]);
9229
9230
  useEffect4(() => {
@@ -9283,11 +9284,18 @@ function PoliciesPanel({ focused }) {
9283
9284
  setCreating(null);
9284
9285
  if (!n) return;
9285
9286
  setStatus("Creating\u2026");
9287
+ setBusyCreate(true);
9286
9288
  void api.policies.create({ id: `policy-${Date.now()}`, name: n, rules: [], mode: "denylist" }).then(() => {
9287
9289
  setStatus(`\u2713 created "${n}" - open it and press n to add rules`);
9288
9290
  list5.reload();
9289
- }).catch((e) => setStatus("\u2717 " + (e instanceof Error ? e.message : String(e))));
9291
+ }).catch((e) => {
9292
+ setBusyCreate(false);
9293
+ setStatus("\u2717 " + (e instanceof Error ? e.message : String(e)));
9294
+ });
9290
9295
  }
9296
+ useEffect4(() => {
9297
+ if (busyCreate && policies.length > 0) setBusyCreate(false);
9298
+ }, [busyCreate, policies.length]);
9291
9299
  useInput3(
9292
9300
  (input, key) => {
9293
9301
  if (creating !== null) return;
@@ -9423,7 +9431,7 @@ function PoliciesPanel({ focused }) {
9423
9431
  const lWin = policies.slice(lStart, lStart + lBudget);
9424
9432
  const lAbove = lStart;
9425
9433
  const lBelow = Math.max(0, policies.length - (lStart + lBudget));
9426
- return /* @__PURE__ */ jsx4(DataView, { loading: list5.loading && !list5.data, error: list5.error, empty: !!list5.data && policies.length === 0, emptyText: "No policies.", children: /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
9434
+ return /* @__PURE__ */ jsx4(DataView, { loading: list5.loading && !list5.data, error: list5.error, empty: !!list5.data && policies.length === 0 && creating === null && !busyCreate, emptyText: "No policies yet \u2014 press n to create one.", children: /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
9427
9435
  /* @__PURE__ */ jsxs4(Box4, { children: [
9428
9436
  /* @__PURE__ */ jsx4(Text4, { color: theme.dim, children: "active: " }),
9429
9437
  activeQ.loading && !activeQ.data ? /* @__PURE__ */ jsx4(Text4, { color: theme.dim, children: "\u2026" }) : activeName ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
package/dist/tui/index.js CHANGED
@@ -2542,6 +2542,7 @@ function PoliciesPanel({ focused }) {
2542
2542
  const [status, setStatus] = useState4(null);
2543
2543
  const [pendingDel, setPendingDel] = useState4(null);
2544
2544
  const [permCursor, setPermCursor] = useState4(0);
2545
+ const [busyCreate, setBusyCreate] = useState4(false);
2545
2546
  const selected = policies[Math.min(pi, Math.max(0, policies.length - 1))];
2546
2547
  const detail = useLoader(() => selected ? api.policies.get(selected.id) : Promise.resolve(null), [selected?.id]);
2547
2548
  useEffect4(() => {
@@ -2601,11 +2602,18 @@ function PoliciesPanel({ focused }) {
2601
2602
  setCreating(null);
2602
2603
  if (!n) return;
2603
2604
  setStatus("Creating\u2026");
2605
+ setBusyCreate(true);
2604
2606
  void api.policies.create({ id: `policy-${Date.now()}`, name: n, rules: [], mode: "denylist" }).then(() => {
2605
2607
  setStatus(`\u2713 created "${n}" - open it and press n to add rules`);
2606
2608
  list5.reload();
2607
- }).catch((e) => setStatus("\u2717 " + (e instanceof Error ? e.message : String(e))));
2609
+ }).catch((e) => {
2610
+ setBusyCreate(false);
2611
+ setStatus("\u2717 " + (e instanceof Error ? e.message : String(e)));
2612
+ });
2608
2613
  }
2614
+ useEffect4(() => {
2615
+ if (busyCreate && policies.length > 0) setBusyCreate(false);
2616
+ }, [busyCreate, policies.length]);
2609
2617
  useInput3(
2610
2618
  (input, key) => {
2611
2619
  if (creating !== null) return;
@@ -2741,7 +2749,7 @@ function PoliciesPanel({ focused }) {
2741
2749
  const lWin = policies.slice(lStart, lStart + lBudget);
2742
2750
  const lAbove = lStart;
2743
2751
  const lBelow = Math.max(0, policies.length - (lStart + lBudget));
2744
- return /* @__PURE__ */ jsx4(DataView, { loading: list5.loading && !list5.data, error: list5.error, empty: !!list5.data && policies.length === 0, emptyText: "No policies.", children: /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
2752
+ return /* @__PURE__ */ jsx4(DataView, { loading: list5.loading && !list5.data, error: list5.error, empty: !!list5.data && policies.length === 0 && creating === null && !busyCreate, emptyText: "No policies yet \u2014 press n to create one.", children: /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
2745
2753
  /* @__PURE__ */ jsxs4(Box4, { children: [
2746
2754
  /* @__PURE__ */ jsx4(Text4, { color: theme.dim, children: "active: " }),
2747
2755
  activeQ.loading && !activeQ.data ? /* @__PURE__ */ jsx4(Text4, { color: theme.dim, children: "\u2026" }) : activeName ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.50",
3
+ "version": "0.82.52",
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": {