shroud-privacy 2.2.9 → 2.2.11

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.
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Real-time security dashboard — lightweight HTTP endpoint.
3
+ *
4
+ * Serves JSON snapshots of all agent sessions, security events,
5
+ * profiling baselines, and injection detection stats. Designed
6
+ * for Grafana, custom UIs, or direct curl consumption.
7
+ *
8
+ * Zero external dependencies — uses Node's built-in http module.
9
+ *
10
+ * Endpoints:
11
+ * GET /health — liveness check
12
+ * GET /api/overview — high-level security summary
13
+ * GET /api/agents — all agent sessions with profiling status
14
+ * GET /api/agents/:buildId — single agent detail
15
+ * GET /api/events — recent security events (last 100)
16
+ * GET /api/events/stream — SSE stream of security events (real-time)
17
+ * GET /api/profiling — profiling baselines for all agents
18
+ * GET /api/profiling/:buildId — single agent baseline detail
19
+ * GET /api/stats — obfuscation + security stats combined
20
+ */
21
+ import { createServer } from "node:http";
22
+ import type { SecurityEventBus } from "./security-event.js";
23
+ import type { AgentSessionTracker } from "./agent-session.js";
24
+ import type { BaselineStore } from "./profiler-store.js";
25
+ import type { Obfuscator } from "./obfuscator.js";
26
+ import type { BehaviouralProfiler } from "./profiler.js";
27
+ import type { ShroudConfig } from "./types.js";
28
+ import type { PolicyEngine } from "./policy.js";
29
+ export interface DashboardDeps {
30
+ securityBus: SecurityEventBus | null;
31
+ agentTracker: AgentSessionTracker;
32
+ baselineStore: BaselineStore | null;
33
+ obfuscator: Obfuscator;
34
+ profiler: BehaviouralProfiler | null;
35
+ config: ShroudConfig;
36
+ policyEngine: PolicyEngine | null;
37
+ }
38
+ /**
39
+ * Start the dashboard HTTP server.
40
+ * Returns the server instance for cleanup.
41
+ */
42
+ export declare function startDashboard(port: number, deps: DashboardDeps): ReturnType<typeof createServer>;