@solongate/proxy 0.81.51 → 0.81.53

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.
@@ -82,6 +82,9 @@ export declare function createWebhook(body: {
82
82
  export declare function deleteWebhook(id: string): Promise<{
83
83
  ok: true;
84
84
  }>;
85
+ export declare function sendTestWebhook(id: string): Promise<{
86
+ delivered: boolean;
87
+ }>;
85
88
  export declare function updateWebhook(id: string, patch: {
86
89
  enabled?: boolean;
87
90
  events?: DenialWebhook['events'];
@@ -221,6 +221,7 @@ __export(settings_exports, {
221
221
  getSecurityLayers: () => getSecurityLayers,
222
222
  getSelfProtection: () => getSelfProtection,
223
223
  getWebhooks: () => getWebhooks,
224
+ sendTestWebhook: () => sendTestWebhook,
224
225
  setAlertEnabled: () => setAlertEnabled,
225
226
  setLocalLogs: () => setLocalLogs,
226
227
  setSecurityLayers: () => setSecurityLayers,
@@ -275,6 +276,9 @@ function createWebhook(body) {
275
276
  function deleteWebhook(id) {
276
277
  return request("DELETE", "/settings/denial-webhook", { query: { id } });
277
278
  }
279
+ function sendTestWebhook(id) {
280
+ return request("POST", "/settings/denial-webhook/send-test", { body: { id } });
281
+ }
278
282
  function updateWebhook(id, patch) {
279
283
  return request("PATCH", "/settings/denial-webhook", { body: { id, ...patch } });
280
284
  }
package/dist/index.js CHANGED
@@ -7394,6 +7394,7 @@ __export(settings_exports, {
7394
7394
  getSecurityLayers: () => getSecurityLayers,
7395
7395
  getSelfProtection: () => getSelfProtection,
7396
7396
  getWebhooks: () => getWebhooks,
7397
+ sendTestWebhook: () => sendTestWebhook,
7397
7398
  setAlertEnabled: () => setAlertEnabled,
7398
7399
  setLocalLogs: () => setLocalLogs,
7399
7400
  setSecurityLayers: () => setSecurityLayers,
@@ -7448,6 +7449,9 @@ function createWebhook(body) {
7448
7449
  function deleteWebhook(id) {
7449
7450
  return request("DELETE", "/settings/denial-webhook", { query: { id } });
7450
7451
  }
7452
+ function sendTestWebhook(id) {
7453
+ return request("POST", "/settings/denial-webhook/send-test", { body: { id } });
7454
+ }
7451
7455
  function updateWebhook(id, patch) {
7452
7456
  return request("PATCH", "/settings/denial-webhook", { body: { id, ...patch } });
7453
7457
  }
@@ -10233,10 +10237,20 @@ function SettingsPanel({
10233
10237
  setSel((n) => Math.min(rowsAll.length - 1, n + 1));
10234
10238
  setConfirmDel(null);
10235
10239
  } else if (key.return || inp === " ") activate(cur);
10236
- else if (inp === "m" && cur.kind === "acct") {
10237
- const ok = setActiveAccount({ apiKey: cur.acc.apiKey, apiUrl: cur.acc.apiUrl });
10238
- setMsg(ok ? { text: `\u2713 ${acctLabel(cur.acc)} is now the ACTIVE key (guard + logging)`, level: "ok" } : { text: "\u2717 could not set active", level: "bad" });
10239
- refreshAccounts();
10240
+ else if (inp === "m") {
10241
+ if (cur.kind === "acct") {
10242
+ const ok = setActiveAccount({ apiKey: cur.acc.apiKey, apiUrl: cur.acc.apiUrl });
10243
+ setMsg(ok ? { text: `\u2713 ${acctLabel(cur.acc)} is now the ACTIVE key (guard + logging)`, level: "ok" } : { text: "\u2717 could not set active", level: "bad" });
10244
+ refreshAccounts();
10245
+ } else if (cur.kind === "wh" || cur.kind === "alert" || cur.kind === "ll-enabled" || cur.kind === "ll-server") activate(cur);
10246
+ } else if (inp === "t" && cur.kind === "wh") {
10247
+ run12(
10248
+ "test event sent \u2014 check your endpoint",
10249
+ () => api.settings.sendTestWebhook(cur.wh.id).then((r) => {
10250
+ if (!r.delivered) throw new Error("endpoint rejected the test (non-2xx response)");
10251
+ }),
10252
+ whQ.reload
10253
+ );
10240
10254
  } else if (inp === "n") beginLogin();
10241
10255
  else if (inp === "e" && cur.kind === "wh") {
10242
10256
  const next = EVENTS[(EVENTS.indexOf(cur.wh.events) + 1) % EVENTS.length];
@@ -10296,7 +10310,7 @@ function SettingsPanel({
10296
10310
  return i >= start && i < start + listBudget;
10297
10311
  };
10298
10312
  return /* @__PURE__ */ jsx7(DataView, { loading, error, children: /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
10299
- /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: focused ? "\u2191\u2193 move \xB7 enter view-toggle-edit \xB7 m make active \xB7 n add account \xB7 e events \xB7 d delete \xB7 r refresh" : "press \u2192 to configure" }),
10313
+ /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: focused ? "\u2191\u2193 move \xB7 enter/m act \xB7 t test webhook \xB7 n add account \xB7 e events \xB7 d delete \xB7 r refresh" : "press \u2192 to configure" }),
10300
10314
  editing ? /* @__PURE__ */ jsxs7(Box7, { children: [
10301
10315
  /* @__PURE__ */ jsx7(Text7, { color: theme.warn, children: editing === "path" ? "local log path: " : editing === "wh-url" ? "webhook url: " : "channel (slack url / email / telegram id): " }),
10302
10316
  /* @__PURE__ */ jsx7(TextInput5, { value: input, onChange: setInput, onSubmit: submitInput })
@@ -12599,6 +12613,28 @@ function fileInfo(dir) {
12599
12613
  }
12600
12614
  async function runLogsServer() {
12601
12615
  const argv = process.argv.slice(3);
12616
+ const verb = argv[0];
12617
+ if (verb === "start" || verb === "stop" || verb === "status") {
12618
+ const d = await Promise.resolve().then(() => (init_logs_server_daemon(), logs_server_daemon_exports));
12619
+ if (verb === "start") {
12620
+ d.startLogsServerDaemon();
12621
+ await new Promise((r) => setTimeout(r, 800));
12622
+ const st = d.logsServerStatus();
12623
+ process.stdout.write(
12624
+ st.running ? `[SolonGate] Local logs service running on http://127.0.0.1:${st.port} \u2014 background service, survives closing this terminal. Disable: solongate logs-server stop
12625
+ ` : `[SolonGate] Could not start the local logs service \u2014 see ~/.solongate/logs-server.log
12626
+ `
12627
+ );
12628
+ } else if (verb === "stop") {
12629
+ d.stopLogsServerDaemon();
12630
+ process.stdout.write("[SolonGate] Local logs service stopped and disabled (re-enable from the dataroom Settings or with `solongate logs-server start`).\n");
12631
+ } else {
12632
+ const st = d.logsServerStatus();
12633
+ process.stdout.write(`[SolonGate] Local logs service: ${st.running ? `running on http://127.0.0.1:${st.port} (pid ${st.pid})` : "stopped"} \xB7 desired ${st.desired}
12634
+ `);
12635
+ }
12636
+ return;
12637
+ }
12602
12638
  const portArg = argv[argv.indexOf("--port") + 1];
12603
12639
  const port = Number(process.env.SOLONGATE_LOGS_PORT || (argv.includes("--port") ? portArg : "") || DEFAULT_PORT) || DEFAULT_PORT;
12604
12640
  const server = createServer2(async (req, res) => {
@@ -187,6 +187,28 @@ function fileInfo(dir) {
187
187
  }
188
188
  async function runLogsServer() {
189
189
  const argv = process.argv.slice(3);
190
+ const verb = argv[0];
191
+ if (verb === "start" || verb === "stop" || verb === "status") {
192
+ const d = await Promise.resolve().then(() => (init_logs_server_daemon(), logs_server_daemon_exports));
193
+ if (verb === "start") {
194
+ d.startLogsServerDaemon();
195
+ await new Promise((r) => setTimeout(r, 800));
196
+ const st = d.logsServerStatus();
197
+ process.stdout.write(
198
+ st.running ? `[SolonGate] Local logs service running on http://127.0.0.1:${st.port} \u2014 background service, survives closing this terminal. Disable: solongate logs-server stop
199
+ ` : `[SolonGate] Could not start the local logs service \u2014 see ~/.solongate/logs-server.log
200
+ `
201
+ );
202
+ } else if (verb === "stop") {
203
+ d.stopLogsServerDaemon();
204
+ process.stdout.write("[SolonGate] Local logs service stopped and disabled (re-enable from the dataroom Settings or with `solongate logs-server start`).\n");
205
+ } else {
206
+ const st = d.logsServerStatus();
207
+ process.stdout.write(`[SolonGate] Local logs service: ${st.running ? `running on http://127.0.0.1:${st.port} (pid ${st.pid})` : "stopped"} \xB7 desired ${st.desired}
208
+ `);
209
+ }
210
+ return;
211
+ }
190
212
  const portArg = argv[argv.indexOf("--port") + 1];
191
213
  const port = Number(process.env.SOLONGATE_LOGS_PORT || (argv.includes("--port") ? portArg : "") || DEFAULT_PORT) || DEFAULT_PORT;
192
214
  const server = createServer(async (req, res) => {
package/dist/tui/index.js CHANGED
@@ -550,6 +550,7 @@ __export(settings_exports, {
550
550
  getSecurityLayers: () => getSecurityLayers,
551
551
  getSelfProtection: () => getSelfProtection,
552
552
  getWebhooks: () => getWebhooks,
553
+ sendTestWebhook: () => sendTestWebhook,
553
554
  setAlertEnabled: () => setAlertEnabled,
554
555
  setLocalLogs: () => setLocalLogs,
555
556
  setSecurityLayers: () => setSecurityLayers,
@@ -604,6 +605,9 @@ function createWebhook(body) {
604
605
  function deleteWebhook(id) {
605
606
  return request("DELETE", "/settings/denial-webhook", { query: { id } });
606
607
  }
608
+ function sendTestWebhook(id) {
609
+ return request("POST", "/settings/denial-webhook/send-test", { body: { id } });
610
+ }
607
611
  function updateWebhook(id, patch) {
608
612
  return request("PATCH", "/settings/denial-webhook", { body: { id, ...patch } });
609
613
  }
@@ -3347,10 +3351,20 @@ function SettingsPanel({
3347
3351
  setSel((n) => Math.min(rowsAll.length - 1, n + 1));
3348
3352
  setConfirmDel(null);
3349
3353
  } else if (key.return || inp === " ") activate(cur);
3350
- else if (inp === "m" && cur.kind === "acct") {
3351
- const ok = setActiveAccount({ apiKey: cur.acc.apiKey, apiUrl: cur.acc.apiUrl });
3352
- setMsg(ok ? { text: `\u2713 ${acctLabel(cur.acc)} is now the ACTIVE key (guard + logging)`, level: "ok" } : { text: "\u2717 could not set active", level: "bad" });
3353
- refreshAccounts();
3354
+ else if (inp === "m") {
3355
+ if (cur.kind === "acct") {
3356
+ const ok = setActiveAccount({ apiKey: cur.acc.apiKey, apiUrl: cur.acc.apiUrl });
3357
+ setMsg(ok ? { text: `\u2713 ${acctLabel(cur.acc)} is now the ACTIVE key (guard + logging)`, level: "ok" } : { text: "\u2717 could not set active", level: "bad" });
3358
+ refreshAccounts();
3359
+ } else if (cur.kind === "wh" || cur.kind === "alert" || cur.kind === "ll-enabled" || cur.kind === "ll-server") activate(cur);
3360
+ } else if (inp === "t" && cur.kind === "wh") {
3361
+ run(
3362
+ "test event sent \u2014 check your endpoint",
3363
+ () => api.settings.sendTestWebhook(cur.wh.id).then((r) => {
3364
+ if (!r.delivered) throw new Error("endpoint rejected the test (non-2xx response)");
3365
+ }),
3366
+ whQ.reload
3367
+ );
3354
3368
  } else if (inp === "n") beginLogin();
3355
3369
  else if (inp === "e" && cur.kind === "wh") {
3356
3370
  const next = EVENTS[(EVENTS.indexOf(cur.wh.events) + 1) % EVENTS.length];
@@ -3410,7 +3424,7 @@ function SettingsPanel({
3410
3424
  return i >= start && i < start + listBudget;
3411
3425
  };
3412
3426
  return /* @__PURE__ */ jsx7(DataView, { loading, error, children: /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
3413
- /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: focused ? "\u2191\u2193 move \xB7 enter view-toggle-edit \xB7 m make active \xB7 n add account \xB7 e events \xB7 d delete \xB7 r refresh" : "press \u2192 to configure" }),
3427
+ /* @__PURE__ */ jsx7(Text7, { color: theme.dim, children: focused ? "\u2191\u2193 move \xB7 enter/m act \xB7 t test webhook \xB7 n add account \xB7 e events \xB7 d delete \xB7 r refresh" : "press \u2192 to configure" }),
3414
3428
  editing ? /* @__PURE__ */ jsxs7(Box7, { children: [
3415
3429
  /* @__PURE__ */ jsx7(Text7, { color: theme.warn, children: editing === "path" ? "local log path: " : editing === "wh-url" ? "webhook url: " : "channel (slack url / email / telegram id): " }),
3416
3430
  /* @__PURE__ */ jsx7(TextInput5, { value: input, onChange: setInput, onSubmit: submitInput })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.81.51",
3
+ "version": "0.81.53",
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": {