@solongate/proxy 0.81.66 → 0.81.68
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/api-client/settings.d.ts +1 -0
- package/dist/index.js +13 -9
- package/dist/tui/index.js +12 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10202,6 +10202,7 @@ function SettingsPanel({
|
|
|
10202
10202
|
signal: rule?.signal ?? "any",
|
|
10203
10203
|
threshold: rule?.threshold ?? THRESH_MIN,
|
|
10204
10204
|
windowSeconds: rule?.windowSeconds ?? 300,
|
|
10205
|
+
enabled: rule?.enabled ?? true,
|
|
10205
10206
|
field: rule ? 1 : 0
|
|
10206
10207
|
// new rule starts on the target; existing on signal
|
|
10207
10208
|
});
|
|
@@ -10229,11 +10230,11 @@ function SettingsPanel({
|
|
|
10229
10230
|
return;
|
|
10230
10231
|
}
|
|
10231
10232
|
const channels = editor.channel === "email" ? { emails: [t.value], telegram: [] } : { telegram: [t.value], emails: [] };
|
|
10232
|
-
const body = { signal: editor.signal, threshold: editor.threshold, windowSeconds: editor.windowSeconds, ...channels };
|
|
10233
|
+
const body = { signal: editor.signal, threshold: editor.threshold, windowSeconds: editor.windowSeconds, enabled: editor.enabled, ...channels };
|
|
10233
10234
|
const id = editor.id;
|
|
10234
10235
|
setEditor(null);
|
|
10235
10236
|
if (id) run12("alert updated", () => api.settings.updateAlert(id, body), alertQ.reload);
|
|
10236
|
-
else run12(`${editor.channel} alert added`, () => api.settings.createAlert({ name: "
|
|
10237
|
+
else run12(`${editor.channel} alert added`, () => api.settings.createAlert({ name: "SolonGate alert", ...body }), alertQ.reload);
|
|
10237
10238
|
};
|
|
10238
10239
|
const activate = (r) => {
|
|
10239
10240
|
if (r.kind === "acct") {
|
|
@@ -10317,13 +10318,15 @@ function SettingsPanel({
|
|
|
10317
10318
|
saveEditor();
|
|
10318
10319
|
return;
|
|
10319
10320
|
}
|
|
10320
|
-
|
|
10321
|
-
|
|
10321
|
+
const nFields = editorFieldCount(editor);
|
|
10322
|
+
if (key.upArrow) setEditor({ ...editor, field: (editor.field + nFields - 1) % nFields });
|
|
10323
|
+
else if (key.downArrow) setEditor({ ...editor, field: (editor.field + 1) % nFields });
|
|
10322
10324
|
else if (key.leftArrow || key.rightArrow) {
|
|
10323
10325
|
const d = key.rightArrow ? 1 : -1;
|
|
10324
10326
|
if (editor.field === 1) setEditor({ ...editor, signal: SIGNALS2[(SIGNALS2.indexOf(editor.signal) + d + SIGNALS2.length) % SIGNALS2.length] });
|
|
10325
10327
|
else if (editor.field === 2) setEditor({ ...editor, threshold: Math.max(THRESH_MIN, Math.min(THRESH_MAX, editor.threshold + d * 5)) });
|
|
10326
10328
|
else if (editor.field === 3) setEditor({ ...editor, windowSeconds: WINDOWS[Math.max(0, Math.min(WINDOWS.length - 1, nearestWindowIdx(editor.windowSeconds) + d))] });
|
|
10329
|
+
else if (editor.field === 4) setEditor({ ...editor, enabled: !editor.enabled });
|
|
10327
10330
|
}
|
|
10328
10331
|
return;
|
|
10329
10332
|
}
|
|
@@ -10435,9 +10438,10 @@ function SettingsPanel({
|
|
|
10435
10438
|
fieldRow(0, "target", editor.target ? /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: truncate2(editor.target, cols - 16) }) : /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: "empty \u2014 press e" }), "press e to edit"),
|
|
10436
10439
|
fieldRow(1, "signal", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: SIGNAL_LABEL[editor.signal] }), "\u2190\u2192 change"),
|
|
10437
10440
|
fieldRow(2, "threshold", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: `\u2265 ${editor.threshold}` }), "\u2190\u2192 \xB15"),
|
|
10438
|
-
fieldRow(3, "window", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: winLabel(editor.windowSeconds) }), "\u2190\u2192 change")
|
|
10441
|
+
fieldRow(3, "window", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: winLabel(editor.windowSeconds) }), "\u2190\u2192 change"),
|
|
10442
|
+
editor.id ? fieldRow(4, "status", editor.enabled ? /* @__PURE__ */ jsx7(Text7, { color: theme.ok, children: "on" }) : /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: "off" }), "\u2190\u2192 turn on/off") : null
|
|
10439
10443
|
] }),
|
|
10440
|
-
/* @__PURE__ */ jsx7(Box7, { marginTop: 1, children: /* @__PURE__ */ jsxs7(Text7, { color: theme.dim, children: [
|
|
10444
|
+
/* @__PURE__ */ jsx7(Box7, { marginTop: 1, children: editor.id && !editor.enabled ? /* @__PURE__ */ jsx7(Text7, { color: theme.warn, children: "disabled \u2014 this alert will NOT fire until you set status back to on" }) : /* @__PURE__ */ jsxs7(Text7, { color: theme.dim, children: [
|
|
10441
10445
|
"fires when ",
|
|
10442
10446
|
/* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: SIGNAL_LABEL[editor.signal] }),
|
|
10443
10447
|
" reach ",
|
|
@@ -10548,7 +10552,7 @@ function SettingsPanel({
|
|
|
10548
10552
|
PROTECTION: "guard hook version + self-protection toggle",
|
|
10549
10553
|
"LOCAL LOGS": "mirror every decision to a file + dashboard link",
|
|
10550
10554
|
WEBHOOKS: `POST events to a URL (${webhooks.length}) \xB7 t tests`,
|
|
10551
|
-
ALERTS: `one email + one telegram (${alerts.length}) \xB7 enter edits`
|
|
10555
|
+
ALERTS: `one email + one telegram (${alerts.length}) \xB7 enter edits \xB7 m on/off`
|
|
10552
10556
|
};
|
|
10553
10557
|
const lineEls = [];
|
|
10554
10558
|
const lineKey = [];
|
|
@@ -10600,7 +10604,7 @@ function SettingsPanel({
|
|
|
10600
10604
|
/* @__PURE__ */ jsx7(Box7, { flexDirection: "column", height: budget, overflow: "hidden", children: win })
|
|
10601
10605
|
] }) });
|
|
10602
10606
|
}
|
|
10603
|
-
var EVENTS, SPIN2, SIGNALS2, SIGNAL_LABEL, WINDOWS, winLabel, THRESH_MIN, THRESH_MAX, nearestWindowIdx,
|
|
10607
|
+
var EVENTS, SPIN2, SIGNALS2, SIGNAL_LABEL, WINDOWS, winLabel, THRESH_MIN, THRESH_MAX, nearestWindowIdx, editorFieldCount, acctLabel, alertChannel;
|
|
10604
10608
|
var init_Settings = __esm({
|
|
10605
10609
|
"src/tui/panels/Settings.tsx"() {
|
|
10606
10610
|
"use strict";
|
|
@@ -10624,7 +10628,7 @@ var init_Settings = __esm({
|
|
|
10624
10628
|
for (let i = 1; i < WINDOWS.length; i++) if (Math.abs(WINDOWS[i] - s) < Math.abs(WINDOWS[best] - s)) best = i;
|
|
10625
10629
|
return best;
|
|
10626
10630
|
};
|
|
10627
|
-
|
|
10631
|
+
editorFieldCount = (e) => e.id ? 5 : 4;
|
|
10628
10632
|
acctLabel = (a) => a.email || a.user || "account \u2026" + a.apiKey.slice(-4);
|
|
10629
10633
|
alertChannel = (r) => r.emails && r.emails.length ? "email" : r.telegram && r.telegram.length ? "telegram" : null;
|
|
10630
10634
|
}
|
package/dist/tui/index.js
CHANGED
|
@@ -3204,7 +3204,7 @@ var nearestWindowIdx = (s) => {
|
|
|
3204
3204
|
for (let i = 1; i < WINDOWS.length; i++) if (Math.abs(WINDOWS[i] - s) < Math.abs(WINDOWS[best] - s)) best = i;
|
|
3205
3205
|
return best;
|
|
3206
3206
|
};
|
|
3207
|
-
var
|
|
3207
|
+
var editorFieldCount = (e) => e.id ? 5 : 4;
|
|
3208
3208
|
var acctLabel = (a) => a.email || a.user || "account \u2026" + a.apiKey.slice(-4);
|
|
3209
3209
|
var alertChannel = (r) => r.emails && r.emails.length ? "email" : r.telegram && r.telegram.length ? "telegram" : null;
|
|
3210
3210
|
function SettingsPanel({
|
|
@@ -3329,6 +3329,7 @@ function SettingsPanel({
|
|
|
3329
3329
|
signal: rule?.signal ?? "any",
|
|
3330
3330
|
threshold: rule?.threshold ?? THRESH_MIN,
|
|
3331
3331
|
windowSeconds: rule?.windowSeconds ?? 300,
|
|
3332
|
+
enabled: rule?.enabled ?? true,
|
|
3332
3333
|
field: rule ? 1 : 0
|
|
3333
3334
|
// new rule starts on the target; existing on signal
|
|
3334
3335
|
});
|
|
@@ -3356,11 +3357,11 @@ function SettingsPanel({
|
|
|
3356
3357
|
return;
|
|
3357
3358
|
}
|
|
3358
3359
|
const channels = editor.channel === "email" ? { emails: [t.value], telegram: [] } : { telegram: [t.value], emails: [] };
|
|
3359
|
-
const body = { signal: editor.signal, threshold: editor.threshold, windowSeconds: editor.windowSeconds, ...channels };
|
|
3360
|
+
const body = { signal: editor.signal, threshold: editor.threshold, windowSeconds: editor.windowSeconds, enabled: editor.enabled, ...channels };
|
|
3360
3361
|
const id = editor.id;
|
|
3361
3362
|
setEditor(null);
|
|
3362
3363
|
if (id) run("alert updated", () => api.settings.updateAlert(id, body), alertQ.reload);
|
|
3363
|
-
else run(`${editor.channel} alert added`, () => api.settings.createAlert({ name: "
|
|
3364
|
+
else run(`${editor.channel} alert added`, () => api.settings.createAlert({ name: "SolonGate alert", ...body }), alertQ.reload);
|
|
3364
3365
|
};
|
|
3365
3366
|
const activate = (r) => {
|
|
3366
3367
|
if (r.kind === "acct") {
|
|
@@ -3444,13 +3445,15 @@ function SettingsPanel({
|
|
|
3444
3445
|
saveEditor();
|
|
3445
3446
|
return;
|
|
3446
3447
|
}
|
|
3447
|
-
|
|
3448
|
-
|
|
3448
|
+
const nFields = editorFieldCount(editor);
|
|
3449
|
+
if (key.upArrow) setEditor({ ...editor, field: (editor.field + nFields - 1) % nFields });
|
|
3450
|
+
else if (key.downArrow) setEditor({ ...editor, field: (editor.field + 1) % nFields });
|
|
3449
3451
|
else if (key.leftArrow || key.rightArrow) {
|
|
3450
3452
|
const d = key.rightArrow ? 1 : -1;
|
|
3451
3453
|
if (editor.field === 1) setEditor({ ...editor, signal: SIGNALS2[(SIGNALS2.indexOf(editor.signal) + d + SIGNALS2.length) % SIGNALS2.length] });
|
|
3452
3454
|
else if (editor.field === 2) setEditor({ ...editor, threshold: Math.max(THRESH_MIN, Math.min(THRESH_MAX, editor.threshold + d * 5)) });
|
|
3453
3455
|
else if (editor.field === 3) setEditor({ ...editor, windowSeconds: WINDOWS[Math.max(0, Math.min(WINDOWS.length - 1, nearestWindowIdx(editor.windowSeconds) + d))] });
|
|
3456
|
+
else if (editor.field === 4) setEditor({ ...editor, enabled: !editor.enabled });
|
|
3454
3457
|
}
|
|
3455
3458
|
return;
|
|
3456
3459
|
}
|
|
@@ -3562,9 +3565,10 @@ function SettingsPanel({
|
|
|
3562
3565
|
fieldRow(0, "target", editor.target ? /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: truncate(editor.target, cols - 16) }) : /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: "empty \u2014 press e" }), "press e to edit"),
|
|
3563
3566
|
fieldRow(1, "signal", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: SIGNAL_LABEL[editor.signal] }), "\u2190\u2192 change"),
|
|
3564
3567
|
fieldRow(2, "threshold", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: `\u2265 ${editor.threshold}` }), "\u2190\u2192 \xB15"),
|
|
3565
|
-
fieldRow(3, "window", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: winLabel(editor.windowSeconds) }), "\u2190\u2192 change")
|
|
3568
|
+
fieldRow(3, "window", /* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: winLabel(editor.windowSeconds) }), "\u2190\u2192 change"),
|
|
3569
|
+
editor.id ? fieldRow(4, "status", editor.enabled ? /* @__PURE__ */ jsx7(Text7, { color: theme.ok, children: "on" }) : /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: "off" }), "\u2190\u2192 turn on/off") : null
|
|
3566
3570
|
] }),
|
|
3567
|
-
/* @__PURE__ */ jsx7(Box7, { marginTop: 1, children: /* @__PURE__ */ jsxs7(Text7, { color: theme.dim, children: [
|
|
3571
|
+
/* @__PURE__ */ jsx7(Box7, { marginTop: 1, children: editor.id && !editor.enabled ? /* @__PURE__ */ jsx7(Text7, { color: theme.warn, children: "disabled \u2014 this alert will NOT fire until you set status back to on" }) : /* @__PURE__ */ jsxs7(Text7, { color: theme.dim, children: [
|
|
3568
3572
|
"fires when ",
|
|
3569
3573
|
/* @__PURE__ */ jsx7(Text7, { color: theme.accent, children: SIGNAL_LABEL[editor.signal] }),
|
|
3570
3574
|
" reach ",
|
|
@@ -3675,7 +3679,7 @@ function SettingsPanel({
|
|
|
3675
3679
|
PROTECTION: "guard hook version + self-protection toggle",
|
|
3676
3680
|
"LOCAL LOGS": "mirror every decision to a file + dashboard link",
|
|
3677
3681
|
WEBHOOKS: `POST events to a URL (${webhooks.length}) \xB7 t tests`,
|
|
3678
|
-
ALERTS: `one email + one telegram (${alerts.length}) \xB7 enter edits`
|
|
3682
|
+
ALERTS: `one email + one telegram (${alerts.length}) \xB7 enter edits \xB7 m on/off`
|
|
3679
3683
|
};
|
|
3680
3684
|
const lineEls = [];
|
|
3681
3685
|
const lineKey = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.68",
|
|
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": {
|