@sandprivacy/sandgate 0.1.0 → 0.1.1

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.
@@ -95,6 +95,20 @@ export async function startRelay(opts) {
95
95
  return res.end(iconPng(parseInt(iconMatch[1], 10)));
96
96
  }
97
97
  // --- API ---
98
+ if (req.method === "GET" && url.pathname === "/api/health") {
99
+ let activeRequests = 0;
100
+ for (const p of pairings.values()) {
101
+ for (const e of p.requests.values())
102
+ if (e.decision === undefined)
103
+ activeRequests++;
104
+ }
105
+ return json(res, 200, {
106
+ ok: true,
107
+ uptime_sec: Math.round(process.uptime()),
108
+ pairings: Object.keys(state.subscriptions).length,
109
+ active_requests: activeRequests,
110
+ });
111
+ }
98
112
  if (req.method === "GET" && url.pathname === "/api/vapid") {
99
113
  return json(res, 200, { publicKey: state.vapid.publicKey });
100
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandprivacy/sandgate",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The human gateway for AI agents — approvals, 2FA codes and email verification, self-hosted. Your agent asks; you decide; secrets never touch the LLM.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",