@solongate/proxy 0.83.55 → 0.83.56

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.
@@ -12,19 +12,6 @@ export interface AuditQuery {
12
12
  signal?: 'dlp' | 'ratelimit';
13
13
  }
14
14
  export declare function list(query?: AuditQuery): Promise<AuditList>;
15
- export declare function remove(ids: string[]): Promise<{
16
- deleted: {
17
- logs: number;
18
- agents: number;
19
- };
20
- }>;
21
- /** Deletes EVERY audit log of the project (agents/sessions are kept). */
22
- export declare function removeAll(): Promise<{
23
- deleted: {
24
- logs: number;
25
- agents: number;
26
- };
27
- }>;
28
15
  export declare function whitelist(id: string, scope?: 'exact' | 'tool'): Promise<{
29
16
  ok: true;
30
17
  deduped: boolean;
@@ -480,19 +480,11 @@ var audit_exports = {};
480
480
  __export(audit_exports, {
481
481
  block: () => block,
482
482
  list: () => list2,
483
- remove: () => remove2,
484
- removeAll: () => removeAll,
485
483
  whitelist: () => whitelist
486
484
  });
487
485
  function list2(query = {}) {
488
486
  return request("GET", "/audit-logs", { query });
489
487
  }
490
- function remove2(ids) {
491
- return request("DELETE", "/audit-logs", { body: { ids } });
492
- }
493
- function removeAll() {
494
- return request("DELETE", "/audit-logs", { body: { scope: "logs" } });
495
- }
496
488
  function whitelist(id, scope = "exact") {
497
489
  return request("POST", `/audit-logs/${encodeURIComponent(id)}/whitelist`, { body: { scope } });
498
490
  }
package/dist/index.js CHANGED
@@ -7926,31 +7926,6 @@ function tailLines(file, maxBytes = 131072) {
7926
7926
  return [];
7927
7927
  }
7928
7928
  }
7929
- function deleteLocalEntry(at, tool, session) {
7930
- try {
7931
- const file = localLogFile();
7932
- const lines = readFileSync8(file, "utf-8").split("\n");
7933
- let removed = 0;
7934
- const kept = lines.filter((line) => {
7935
- if (!line.trim()) return false;
7936
- if (removed) return true;
7937
- try {
7938
- const j = JSON.parse(line);
7939
- const hit = Date.parse(j.ts ?? "") === at && (j.tool ?? "?") === tool && (!session || j.session_id === session);
7940
- if (hit) {
7941
- removed++;
7942
- return false;
7943
- }
7944
- } catch {
7945
- }
7946
- return true;
7947
- });
7948
- if (removed) writeFileSync6(file, kept.length ? kept.join("\n") + "\n" : "");
7949
- return removed;
7950
- } catch {
7951
- return 0;
7952
- }
7953
- }
7954
7929
  function clearLocalLog() {
7955
7930
  try {
7956
7931
  const file = localLogFile();
@@ -8495,19 +8470,11 @@ var audit_exports = {};
8495
8470
  __export(audit_exports, {
8496
8471
  block: () => block,
8497
8472
  list: () => list2,
8498
- remove: () => remove2,
8499
- removeAll: () => removeAll,
8500
8473
  whitelist: () => whitelist
8501
8474
  });
8502
8475
  function list2(query = {}) {
8503
8476
  return request("GET", "/audit-logs", { query });
8504
8477
  }
8505
- function remove2(ids) {
8506
- return request("DELETE", "/audit-logs", { body: { ids } });
8507
- }
8508
- function removeAll() {
8509
- return request("DELETE", "/audit-logs", { body: { scope: "logs" } });
8510
- }
8511
8478
  function whitelist(id, scope = "exact") {
8512
8479
  return request("POST", `/audit-logs/${encodeURIComponent(id)}/whitelist`, { body: { scope } });
8513
8480
  }
@@ -11038,7 +11005,6 @@ function AuditPanel({ active: active2, focused }) {
11038
11005
  const [si, setSi] = useState7(0);
11039
11006
  const [sessSearch, setSessSearch] = useState7("");
11040
11007
  const [sessSel, setSessSel] = useState7(0);
11041
- const [confirm, setConfirm] = useState7(null);
11042
11008
  const [msg, setMsg] = useState7(null);
11043
11009
  const [showHelp, setShowHelp] = useState7(false);
11044
11010
  const [frozen, setFrozen] = useState7(false);
@@ -11120,29 +11086,6 @@ function AuditPanel({ active: active2, focused }) {
11120
11086
  const currentSess = sessionsFiltered[Math.min(sessSel, Math.max(0, sessionsFiltered.length - 1))];
11121
11087
  const logsLoading = (source === "cloud" ? cloudQ.loading : localQ.loading) && !editing;
11122
11088
  const sessLoading = source === "cloud" ? agentsQ.loading : localQ.loading;
11123
- const doDelete = (kind) => {
11124
- setMsg({ text: "deleting\u2026", level: "ok" });
11125
- const run12 = async () => {
11126
- if (source === "cloud") {
11127
- if (kind === "one") {
11128
- if (!current) throw new Error("nothing selected");
11129
- await api.audit.remove([current.id]);
11130
- } else {
11131
- await api.audit.removeAll();
11132
- }
11133
- cloudQ.reload();
11134
- statsQ.reloadQuiet();
11135
- } else {
11136
- const n = kind === "one" && current ? deleteLocalEntry(current.at, current.tool, current.session) : kind === "all" ? clearLocalLog() : 0;
11137
- if (!n) throw new Error("entry not found in the local file");
11138
- localQ.reload();
11139
- }
11140
- };
11141
- run12().then(() => {
11142
- setMsg({ text: kind === "one" ? "\u2713 entry deleted" : `\u2713 ALL ${source} logs deleted`, level: "ok" });
11143
- toTop();
11144
- }).catch((e) => setMsg({ text: "\u2717 " + (e instanceof Error ? e.message : String(e)), level: "bad" }));
11145
- };
11146
11089
  const doExport = (kind) => {
11147
11090
  setMsg({ text: "exporting\u2026", level: "ok" });
11148
11091
  const run12 = async () => {
@@ -11193,8 +11136,7 @@ function AuditPanel({ active: active2, focused }) {
11193
11136
  return;
11194
11137
  }
11195
11138
  if (view === "logs" ? logsLoading : sessLoading) return;
11196
- if (confirm && input !== "x" && input !== "X") {
11197
- setConfirm(null);
11139
+ if (msg) {
11198
11140
  setMsg(null);
11199
11141
  }
11200
11142
  if (input === "s") {
@@ -11258,23 +11200,6 @@ function AuditPanel({ active: active2, focused }) {
11258
11200
  setGi((n) => (n + 1) % SIGNALS.length);
11259
11201
  setPage(0);
11260
11202
  toTop();
11261
- } else if (input === "x") {
11262
- if (!current) return;
11263
- if (confirm?.kind !== "one" || confirm.key !== current.id) {
11264
- setConfirm({ kind: "one", key: current.id });
11265
- setMsg({ text: `x = delete ONLY the selected entry: ${current.decision} ${current.tool} (${ago(current.at)} ago) \u2014 press x again`, level: "bad" });
11266
- return;
11267
- }
11268
- setConfirm(null);
11269
- doDelete("one");
11270
- } else if (input === "X") {
11271
- if (confirm?.kind !== "all") {
11272
- setConfirm({ kind: "all", key: "all" });
11273
- setMsg({ text: `\u26A0 X = delete ALL ${source} logs \u2014 every one of the ${total} matched entries! press X again`, level: "bad" });
11274
- return;
11275
- }
11276
- setConfirm(null);
11277
- doDelete("all");
11278
11203
  } else if (input === "e") doExport("page");
11279
11204
  else if (input === "E") doExport("all");
11280
11205
  else if (input === "t") setEditing("tool");
@@ -11588,8 +11513,6 @@ var init_Audit = __esm({
11588
11513
  ["g", "signal filter: all \u2192 dlp \u2192 ratelimit"],
11589
11514
  ["t / n", "tool / agent filter (type, enter done)"],
11590
11515
  ["/", "free-text search"],
11591
- ["x", "delete ONLY the selected entry (press x twice)"],
11592
- ["X", "delete ALL matched logs of the source (press X twice)"],
11593
11516
  ["e", "export this page \u2192 ~/.solongate/audit-export-<src>.jsonl"],
11594
11517
  ["E", "export ALL matched rows (cloud: up to 10k)"],
11595
11518
  ["c", "clear every filter (incl. session)"]
package/dist/tui/index.js CHANGED
@@ -1024,31 +1024,6 @@ function tailLines(file, maxBytes = 131072) {
1024
1024
  return [];
1025
1025
  }
1026
1026
  }
1027
- function deleteLocalEntry(at, tool, session) {
1028
- try {
1029
- const file = localLogFile();
1030
- const lines = readFileSync2(file, "utf-8").split("\n");
1031
- let removed = 0;
1032
- const kept = lines.filter((line) => {
1033
- if (!line.trim()) return false;
1034
- if (removed) return true;
1035
- try {
1036
- const j = JSON.parse(line);
1037
- const hit = Date.parse(j.ts ?? "") === at && (j.tool ?? "?") === tool && (!session || j.session_id === session);
1038
- if (hit) {
1039
- removed++;
1040
- return false;
1041
- }
1042
- } catch {
1043
- }
1044
- return true;
1045
- });
1046
- if (removed) writeFileSync(file, kept.length ? kept.join("\n") + "\n" : "");
1047
- return removed;
1048
- } catch {
1049
- return 0;
1050
- }
1051
- }
1052
1027
  function clearLocalLog() {
1053
1028
  try {
1054
1029
  const file = localLogFile();
@@ -1545,19 +1520,11 @@ var audit_exports = {};
1545
1520
  __export(audit_exports, {
1546
1521
  block: () => block,
1547
1522
  list: () => list2,
1548
- remove: () => remove2,
1549
- removeAll: () => removeAll,
1550
1523
  whitelist: () => whitelist
1551
1524
  });
1552
1525
  function list2(query = {}) {
1553
1526
  return request("GET", "/audit-logs", { query });
1554
1527
  }
1555
- function remove2(ids) {
1556
- return request("DELETE", "/audit-logs", { body: { ids } });
1557
- }
1558
- function removeAll() {
1559
- return request("DELETE", "/audit-logs", { body: { scope: "logs" } });
1560
- }
1561
1528
  function whitelist(id, scope = "exact") {
1562
1529
  return request("POST", `/audit-logs/${encodeURIComponent(id)}/whitelist`, { body: { scope } });
1563
1530
  }
@@ -4003,8 +3970,6 @@ var AUDIT_HELP = [
4003
3970
  ["g", "signal filter: all \u2192 dlp \u2192 ratelimit"],
4004
3971
  ["t / n", "tool / agent filter (type, enter done)"],
4005
3972
  ["/", "free-text search"],
4006
- ["x", "delete ONLY the selected entry (press x twice)"],
4007
- ["X", "delete ALL matched logs of the source (press X twice)"],
4008
3973
  ["e", "export this page \u2192 ~/.solongate/audit-export-<src>.jsonl"],
4009
3974
  ["E", "export ALL matched rows (cloud: up to 10k)"],
4010
3975
  ["c", "clear every filter (incl. session)"]
@@ -4055,7 +4020,6 @@ function AuditPanel({ active: active2, focused }) {
4055
4020
  const [si, setSi] = useState7(0);
4056
4021
  const [sessSearch, setSessSearch] = useState7("");
4057
4022
  const [sessSel, setSessSel] = useState7(0);
4058
- const [confirm, setConfirm] = useState7(null);
4059
4023
  const [msg, setMsg] = useState7(null);
4060
4024
  const [showHelp, setShowHelp] = useState7(false);
4061
4025
  const [frozen, setFrozen] = useState7(false);
@@ -4137,29 +4101,6 @@ function AuditPanel({ active: active2, focused }) {
4137
4101
  const currentSess = sessionsFiltered[Math.min(sessSel, Math.max(0, sessionsFiltered.length - 1))];
4138
4102
  const logsLoading = (source === "cloud" ? cloudQ.loading : localQ.loading) && !editing;
4139
4103
  const sessLoading = source === "cloud" ? agentsQ.loading : localQ.loading;
4140
- const doDelete = (kind) => {
4141
- setMsg({ text: "deleting\u2026", level: "ok" });
4142
- const run = async () => {
4143
- if (source === "cloud") {
4144
- if (kind === "one") {
4145
- if (!current) throw new Error("nothing selected");
4146
- await api.audit.remove([current.id]);
4147
- } else {
4148
- await api.audit.removeAll();
4149
- }
4150
- cloudQ.reload();
4151
- statsQ.reloadQuiet();
4152
- } else {
4153
- const n = kind === "one" && current ? deleteLocalEntry(current.at, current.tool, current.session) : kind === "all" ? clearLocalLog() : 0;
4154
- if (!n) throw new Error("entry not found in the local file");
4155
- localQ.reload();
4156
- }
4157
- };
4158
- run().then(() => {
4159
- setMsg({ text: kind === "one" ? "\u2713 entry deleted" : `\u2713 ALL ${source} logs deleted`, level: "ok" });
4160
- toTop();
4161
- }).catch((e) => setMsg({ text: "\u2717 " + (e instanceof Error ? e.message : String(e)), level: "bad" }));
4162
- };
4163
4104
  const doExport = (kind) => {
4164
4105
  setMsg({ text: "exporting\u2026", level: "ok" });
4165
4106
  const run = async () => {
@@ -4210,8 +4151,7 @@ function AuditPanel({ active: active2, focused }) {
4210
4151
  return;
4211
4152
  }
4212
4153
  if (view === "logs" ? logsLoading : sessLoading) return;
4213
- if (confirm && input !== "x" && input !== "X") {
4214
- setConfirm(null);
4154
+ if (msg) {
4215
4155
  setMsg(null);
4216
4156
  }
4217
4157
  if (input === "s") {
@@ -4275,23 +4215,6 @@ function AuditPanel({ active: active2, focused }) {
4275
4215
  setGi((n) => (n + 1) % SIGNALS.length);
4276
4216
  setPage(0);
4277
4217
  toTop();
4278
- } else if (input === "x") {
4279
- if (!current) return;
4280
- if (confirm?.kind !== "one" || confirm.key !== current.id) {
4281
- setConfirm({ kind: "one", key: current.id });
4282
- setMsg({ text: `x = delete ONLY the selected entry: ${current.decision} ${current.tool} (${ago(current.at)} ago) \u2014 press x again`, level: "bad" });
4283
- return;
4284
- }
4285
- setConfirm(null);
4286
- doDelete("one");
4287
- } else if (input === "X") {
4288
- if (confirm?.kind !== "all") {
4289
- setConfirm({ kind: "all", key: "all" });
4290
- setMsg({ text: `\u26A0 X = delete ALL ${source} logs \u2014 every one of the ${total} matched entries! press X again`, level: "bad" });
4291
- return;
4292
- }
4293
- setConfirm(null);
4294
- doDelete("all");
4295
4218
  } else if (input === "e") doExport("page");
4296
4219
  else if (input === "E") doExport("all");
4297
4220
  else if (input === "t") setEditing("tool");
@@ -77,8 +77,6 @@ export interface LocalLogLine {
77
77
  matched_rule_id?: string;
78
78
  rate_limit_burst?: boolean;
79
79
  }
80
- /** Delete ONE matching line (ts + tool [+ session]) from the local log file. */
81
- export declare function deleteLocalEntry(at: number, tool: string, session?: string | null): number;
82
80
  /**
83
81
  * Empty the local log file. Returns how many lines were removed.
84
82
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.83.55",
3
+ "version": "0.83.56",
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": {