@mneme-ai/core 2.58.0 → 2.60.0

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.
Files changed (37) hide show
  1. package/dist/agent_manifest.d.ts.map +1 -1
  2. package/dist/agent_manifest.js +9 -0
  3. package/dist/agent_manifest.js.map +1 -1
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +10 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/release_gate/sdk_surface_auditor.d.ts +106 -0
  9. package/dist/release_gate/sdk_surface_auditor.d.ts.map +1 -0
  10. package/dist/release_gate/sdk_surface_auditor.js +167 -0
  11. package/dist/release_gate/sdk_surface_auditor.js.map +1 -0
  12. package/dist/release_gate/wiring_doctor.d.ts.map +1 -1
  13. package/dist/release_gate/wiring_doctor.js +21 -1
  14. package/dist/release_gate/wiring_doctor.js.map +1 -1
  15. package/dist/skeleton_key/bypass_graph.d.ts +56 -0
  16. package/dist/skeleton_key/bypass_graph.d.ts.map +1 -0
  17. package/dist/skeleton_key/bypass_graph.js +89 -0
  18. package/dist/skeleton_key/bypass_graph.js.map +1 -0
  19. package/dist/skeleton_key/capability_probe.d.ts +58 -0
  20. package/dist/skeleton_key/capability_probe.d.ts.map +1 -0
  21. package/dist/skeleton_key/capability_probe.js +149 -0
  22. package/dist/skeleton_key/capability_probe.js.map +1 -0
  23. package/dist/skeleton_key/index.d.ts +142 -0
  24. package/dist/skeleton_key/index.d.ts.map +1 -0
  25. package/dist/skeleton_key/index.js +321 -0
  26. package/dist/skeleton_key/index.js.map +1 -0
  27. package/dist/skeleton_key/risk_heuristics.d.ts +46 -0
  28. package/dist/skeleton_key/risk_heuristics.d.ts.map +1 -0
  29. package/dist/skeleton_key/risk_heuristics.js +206 -0
  30. package/dist/skeleton_key/risk_heuristics.js.map +1 -0
  31. package/dist/truth_gate/claims.d.ts.map +1 -1
  32. package/dist/truth_gate/claims.js +38 -0
  33. package/dist/truth_gate/claims.js.map +1 -1
  34. package/dist/truth_gate/probes.d.ts.map +1 -1
  35. package/dist/truth_gate/probes.js +99 -0
  36. package/dist/truth_gate/probes.js.map +1 -1
  37. package/package.json +5 -1
@@ -0,0 +1,89 @@
1
+ /**
2
+ * v2.60.0 — SKELETON KEY bypass graph.
3
+ *
4
+ * Models MCP servers as graph nodes; edges = capability overlap. Computes
5
+ * transitive bypass paths so we surface that e.g. shell-mcp + git-mcp +
6
+ * file-mcp = THREE independent ways to delete the repo, even if each is
7
+ * "lightly scoped" in isolation.
8
+ *
9
+ * Most security audit tools stop at single-server analysis. SKELETON KEY
10
+ * computes the GRAPH because the actual security model is the union of
11
+ * all capabilities reachable through ANY allowed server.
12
+ */
13
+ /** Goal → set of contributing capabilities (any one enables it). */
14
+ const GOAL_TO_CAPABILITIES = {
15
+ delete_repo: ["exec", "write_fs", "git_write"],
16
+ exfiltrate_secret: ["read_fs", "network", "exec", "read_memory"],
17
+ drop_database: ["db_ddl", "exec"],
18
+ modify_ci_pipeline: ["git_write", "write_fs", "exec"],
19
+ unauthorized_cloud_change: ["cloud_mutate", "exec"],
20
+ ssrf_internal_network: ["browser_automation", "network", "exec"],
21
+ };
22
+ export function buildBypassGraph(nodes) {
23
+ // Capability inverted index.
24
+ const capToServers = new Map();
25
+ for (const n of nodes) {
26
+ for (const c of n.risk.capabilities) {
27
+ const list = capToServers.get(c) ?? [];
28
+ list.push(n);
29
+ capToServers.set(c, list);
30
+ }
31
+ }
32
+ const overlaps = [];
33
+ for (const [cap, servers] of capToServers.entries()) {
34
+ if (servers.length >= 2) {
35
+ overlaps.push({
36
+ capability: cap,
37
+ servers: servers.map((s) => s.name),
38
+ count: servers.length,
39
+ });
40
+ }
41
+ }
42
+ overlaps.sort((a, b) => b.count - a.count);
43
+ const bypassPaths = [];
44
+ for (const [goal, requiredCaps] of Object.entries(GOAL_TO_CAPABILITIES)) {
45
+ // For each contributing cap, collect ALL servers that expose it.
46
+ const stepsByCap = [];
47
+ for (const cap of requiredCaps) {
48
+ const servers = capToServers.get(cap) ?? [];
49
+ if (servers.length > 0)
50
+ stepsByCap.push({ cap, servers });
51
+ }
52
+ // If at least 2 different capabilities are reachable (or 1 cap with 2+ servers),
53
+ // we can build a bypass narrative.
54
+ const totalDistinctServers = new Set();
55
+ for (const s of stepsByCap)
56
+ for (const x of s.servers)
57
+ totalDistinctServers.add(x.name);
58
+ if (totalDistinctServers.size >= 2) {
59
+ // Pick the lowest-friction route: one server per required cap.
60
+ const steps = stepsByCap.map((s) => ({
61
+ server: s.servers[0].name,
62
+ via: s.cap,
63
+ }));
64
+ const allSeverities = stepsByCap.flatMap((s) => s.servers.map((x) => x.risk.severity));
65
+ // Weakest link = the LOWEST severity any path step requires — the attacker only
66
+ // needs the easiest unguarded surface.
67
+ const weakestSeverity = Math.min(...allSeverities);
68
+ bypassPaths.push({
69
+ goal,
70
+ steps,
71
+ weakestSeverity,
72
+ narrative: `${goal.replace(/_/g, " ")}: attacker can chain ${steps.map((s) => `\`${s.server}\`(${s.via})`).join(" → ")} (weakest-link severity ${(weakestSeverity * 100).toFixed(0)}%)`,
73
+ });
74
+ }
75
+ }
76
+ bypassPaths.sort((a, b) => b.weakestSeverity - a.weakestSeverity);
77
+ return { nodes, overlaps, bypassPaths };
78
+ }
79
+ /**
80
+ * Compute a single risk-budget score 0..N.
81
+ * = Σ (severity × capability count per server).
82
+ * Lower = safer.
83
+ */
84
+ export function totalRiskBudget(nodes) {
85
+ return +nodes
86
+ .reduce((s, n) => s + n.risk.severity * Math.max(1, n.risk.capabilities.length), 0)
87
+ .toFixed(2);
88
+ }
89
+ //# sourceMappingURL=bypass_graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bypass_graph.js","sourceRoot":"","sources":["../../src/skeleton_key/bypass_graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA8BH,oEAAoE;AACpE,MAAM,oBAAoB,GAA6B;IACrD,WAAW,EAAE,CAAC,MAAM,EAAE,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CAAC;YACvF,gFAAgF;YAChF,uCAAuC;YACvC,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;YACnD,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI;gBACJ,KAAK;gBACL,eAAe;gBACf,SAAS,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,wBAAwB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;aACxL,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,GAAG,CAAC,CAAC,eAAe,CAAC,CAAC;IAElE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAmB;IACjD,OAAO,CAAC,KAAK;SACV,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SAClF,OAAO,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * v2.60.0 — SKELETON KEY capability probe.
3
+ *
4
+ * Dark-magic angle (parallel to AUTOPROBE for CLI tools): instead of
5
+ * guessing a server's risk from its NAME ("filesystem-mcp" → assume
6
+ * write-fs), we EMPIRICALLY spawn the server in a JSON-RPC handshake
7
+ * and ask it for its tools/list. Then we KNOW which tools it exposes,
8
+ * and we can promote the heuristic capabilities to the actual ones.
9
+ *
10
+ * Hand-written rules can be out of date or guess wrong; an empirical
11
+ * tools/list cannot — it's what the server actually serves.
12
+ *
13
+ * Safety contract:
14
+ * - We only call `initialize` + `tools/list` (read-only JSON-RPC).
15
+ * - We never `tools/call` from inside the probe.
16
+ * - 5s timeout; force-kill on hang.
17
+ * - All spawns happen in a child process; failures are caught.
18
+ */
19
+ export interface ProbeInput {
20
+ /** Server name (used for logging). */
21
+ name: string;
22
+ /** Command to execute (e.g. "node", "mneme", "uvx"). */
23
+ command: string;
24
+ /** Args to pass (e.g. ["server.js"], ["mcp"]). */
25
+ args?: string[];
26
+ /** Env vars to inject. */
27
+ env?: Record<string, string>;
28
+ /** Per-probe timeout ms (default 8000). */
29
+ timeoutMs?: number;
30
+ }
31
+ export interface ProbedTool {
32
+ /** Tool name as the server returned it. */
33
+ name: string;
34
+ /** Optional description. */
35
+ description?: string;
36
+ /** Capability tags we INFER from the tool name + description. */
37
+ inferredCapabilities: string[];
38
+ }
39
+ export interface ProbeResult {
40
+ name: string;
41
+ /** True if we got a tools/list response. */
42
+ reachable: boolean;
43
+ tools: ProbedTool[];
44
+ /** All distinct capabilities inferred across the tools. */
45
+ capabilities: string[];
46
+ /** Latency to first tools/list response. */
47
+ latencyMs: number;
48
+ /** Brief failure reason when reachable=false. */
49
+ reason?: string;
50
+ }
51
+ /**
52
+ * Probe a single MCP server via JSON-RPC over stdio.
53
+ * Sends `initialize` + `tools/list` then exits.
54
+ *
55
+ * NEVER throws — returns reachable:false with reason on any failure.
56
+ */
57
+ export declare function probeServer(input: ProbeInput): Promise<ProbeResult>;
58
+ //# sourceMappingURL=capability_probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability_probe.d.ts","sourceRoot":"","sources":["../../src/skeleton_key/capability_probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,2DAA2D;IAC3D,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAyBD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAyFzE"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * v2.60.0 — SKELETON KEY capability probe.
3
+ *
4
+ * Dark-magic angle (parallel to AUTOPROBE for CLI tools): instead of
5
+ * guessing a server's risk from its NAME ("filesystem-mcp" → assume
6
+ * write-fs), we EMPIRICALLY spawn the server in a JSON-RPC handshake
7
+ * and ask it for its tools/list. Then we KNOW which tools it exposes,
8
+ * and we can promote the heuristic capabilities to the actual ones.
9
+ *
10
+ * Hand-written rules can be out of date or guess wrong; an empirical
11
+ * tools/list cannot — it's what the server actually serves.
12
+ *
13
+ * Safety contract:
14
+ * - We only call `initialize` + `tools/list` (read-only JSON-RPC).
15
+ * - We never `tools/call` from inside the probe.
16
+ * - 5s timeout; force-kill on hang.
17
+ * - All spawns happen in a child process; failures are caught.
18
+ */
19
+ import { spawn } from "node:child_process";
20
+ import { performance } from "node:perf_hooks";
21
+ // Tool-name → capability tags. Conservative: when in doubt, flag the cap.
22
+ const TOOL_NAME_CAPABILITY_HINTS = [
23
+ { rx: /\b(exec|spawn|shell|bash|cmd|command|process)/i, caps: ["exec"] },
24
+ { rx: /\b(read[_-]?file|cat|stat|ls|find|search[_-]?file)/i, caps: ["read_fs"] },
25
+ { rx: /\b(write[_-]?file|create[_-]?file|delete|rm|unlink|mkdir|move|rename|edit[_-]?file|patch)/i, caps: ["write_fs"] },
26
+ { rx: /\b(fetch|http|request|get_url|post|put)/i, caps: ["network"] },
27
+ { rx: /\b(query|select|insert|update|delete|drop|alter|create[_-]?table)/i, caps: ["db_read", "db_write"] },
28
+ { rx: /\b(drop[_-]?(table|database)|truncate)/i, caps: ["db_ddl"] },
29
+ { rx: /\b(git[_-]?(push|commit|tag|reset|merge)|create[_-]?(repo|branch|pr|pull[_-]?request))/i, caps: ["git_write"] },
30
+ { rx: /\b(apply|create|delete|patch)[_-]?(deployment|pod|service|configmap|secret|namespace)/i, caps: ["cluster_mutate"] },
31
+ { rx: /\b(start[_-]?instance|terminate|create[_-]?bucket|delete[_-]?bucket|put[_-]?object)/i, caps: ["cloud_mutate"] },
32
+ { rx: /\b(navigate|click|screenshot|page[_-]?(open|close))/i, caps: ["browser_automation", "network"] },
33
+ ];
34
+ function inferCapabilities(toolName, description) {
35
+ const blob = `${toolName} ${description ?? ""}`.toLowerCase();
36
+ const caps = new Set();
37
+ for (const hint of TOOL_NAME_CAPABILITY_HINTS) {
38
+ if (hint.rx.test(blob))
39
+ hint.caps.forEach((c) => caps.add(c));
40
+ }
41
+ return Array.from(caps);
42
+ }
43
+ /**
44
+ * Probe a single MCP server via JSON-RPC over stdio.
45
+ * Sends `initialize` + `tools/list` then exits.
46
+ *
47
+ * NEVER throws — returns reachable:false with reason on any failure.
48
+ */
49
+ export async function probeServer(input) {
50
+ const t0 = performance.now();
51
+ const timeoutMs = input.timeoutMs ?? 8000;
52
+ return new Promise((resolve) => {
53
+ let done = false;
54
+ const finalize = (r) => {
55
+ if (done)
56
+ return;
57
+ done = true;
58
+ resolve({ name: input.name, latencyMs: +(performance.now() - t0).toFixed(2), ...r });
59
+ };
60
+ let child;
61
+ try {
62
+ child = spawn(input.command, input.args ?? [], {
63
+ env: { ...process.env, ...(input.env ?? {}) },
64
+ stdio: ["pipe", "pipe", "pipe"],
65
+ });
66
+ }
67
+ catch (e) {
68
+ finalize({ reachable: false, tools: [], capabilities: [], reason: `spawn failed: ${e.message}` });
69
+ return;
70
+ }
71
+ const timer = setTimeout(() => {
72
+ try {
73
+ child.kill();
74
+ }
75
+ catch { /* noop */ }
76
+ finalize({ reachable: false, tools: [], capabilities: [], reason: `timeout (${timeoutMs}ms)` });
77
+ }, timeoutMs);
78
+ let stdoutBuf = "";
79
+ let initialized = false;
80
+ child.stdout.on("data", (chunk) => {
81
+ stdoutBuf += chunk.toString("utf8");
82
+ let nl;
83
+ while ((nl = stdoutBuf.indexOf("\n")) !== -1) {
84
+ const line = stdoutBuf.slice(0, nl).trim();
85
+ stdoutBuf = stdoutBuf.slice(nl + 1);
86
+ if (!line)
87
+ continue;
88
+ try {
89
+ const msg = JSON.parse(line);
90
+ if (msg.id === 1 && msg.result) {
91
+ initialized = true;
92
+ // Send tools/list
93
+ child.stdin.write(JSON.stringify({ jsonrpc: "2.0", id: 2, method: "tools/list", params: {} }) + "\n");
94
+ }
95
+ else if (msg.id === 2 && msg.result) {
96
+ const rawTools = (msg.result.tools ?? []);
97
+ const tools = rawTools.filter((t) => typeof t.name === "string").map((t) => ({
98
+ name: t.name,
99
+ description: t.description,
100
+ inferredCapabilities: inferCapabilities(t.name, t.description),
101
+ }));
102
+ const capSet = new Set();
103
+ for (const t of tools)
104
+ for (const c of t.inferredCapabilities)
105
+ capSet.add(c);
106
+ clearTimeout(timer);
107
+ try {
108
+ child.kill();
109
+ }
110
+ catch { /* noop */ }
111
+ finalize({ reachable: true, tools, capabilities: Array.from(capSet) });
112
+ }
113
+ }
114
+ catch {
115
+ // Non-JSON line (server stderr leaking) — ignore.
116
+ }
117
+ }
118
+ });
119
+ child.stderr.on("data", () => { });
120
+ child.on("error", (e) => {
121
+ clearTimeout(timer);
122
+ finalize({ reachable: false, tools: [], capabilities: [], reason: `child error: ${e.message}` });
123
+ });
124
+ child.on("exit", () => {
125
+ if (!initialized) {
126
+ clearTimeout(timer);
127
+ finalize({ reachable: false, tools: [], capabilities: [], reason: "server exited before responding" });
128
+ }
129
+ });
130
+ // Send initialize after the child is up.
131
+ try {
132
+ child.stdin.write(JSON.stringify({
133
+ jsonrpc: "2.0",
134
+ id: 1,
135
+ method: "initialize",
136
+ params: {
137
+ protocolVersion: "2024-11-05",
138
+ capabilities: {},
139
+ clientInfo: { name: "mneme-skeleton-key", version: "1.0.0" },
140
+ },
141
+ }) + "\n");
142
+ }
143
+ catch (e) {
144
+ clearTimeout(timer);
145
+ finalize({ reachable: false, tools: [], capabilities: [], reason: `init write failed: ${e.message}` });
146
+ }
147
+ });
148
+ }
149
+ //# sourceMappingURL=capability_probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability_probe.js","sourceRoot":"","sources":["../../src/skeleton_key/capability_probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAqC9C,0EAA0E;AAC1E,MAAM,0BAA0B,GAA0C;IACxE,EAAE,EAAE,EAAE,gDAAgD,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE;IACxE,EAAE,EAAE,EAAE,qDAAqD,EAAE,IAAI,EAAE,CAAC,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5
+ * no central security review. Users wire 5-15 servers into Claude
6
+ * Desktop / Cursor / Continue / Cline without realizing the
7
+ * UNION of their capabilities = a much larger attack surface than any
8
+ * individual server.
9
+ *
10
+ * SKELETON KEY is the first MCP security auditor. Five wild innovations:
11
+ *
12
+ * 1. EMPIRICAL CAPABILITY PROBE — spawn each MCP server + read its
13
+ * real tools/list (not name-guess). Hand-written rules can lie;
14
+ * a tools/list cannot.
15
+ *
16
+ * 2. TRANSITIVE BYPASS GRAPH — model servers as graph nodes; edges =
17
+ * capability overlap; compute paths to attacker goals (delete_repo,
18
+ * exfiltrate_secret, drop_database, etc). Most audit tools stop at
19
+ * single-server analysis. We compute the graph.
20
+ *
21
+ * 3. HMAC CONFIG PINNING — snapshot the user's MCP configs; detect
22
+ * tampering / silent new-server-added on next audit. Tamper-evident
23
+ * drift report.
24
+ *
25
+ * 4. RISK BUDGET — single score 0..N quantifying total surface. User
26
+ * sets a budget (e.g. 5.0); new servers that push over budget are
27
+ * refused at install time.
28
+ *
29
+ * 5. CWE COMPLIANCE MAPPING — every finding maps to a CWE id, making
30
+ * the output audit-grade for security teams.
31
+ *
32
+ * Pure ESM. Defensive — never throws on disk / parse / spawn errors.
33
+ */
34
+ import { type RiskHeuristic } from "./risk_heuristics.js";
35
+ import { type BypassGraph } from "./bypass_graph.js";
36
+ export interface McpServerConfig {
37
+ /** Server name (key in the host's mcpServers map). */
38
+ name: string;
39
+ /** spawn command. */
40
+ command?: string;
41
+ /** spawn args. */
42
+ args?: string[];
43
+ /** env map. */
44
+ env?: Record<string, string>;
45
+ /** Source file the config came from. */
46
+ source: string;
47
+ }
48
+ export interface SkeletonKeyAudit {
49
+ ok: boolean;
50
+ at: string;
51
+ totalServers: number;
52
+ /** All distinct config files that contributed servers. */
53
+ sources: string[];
54
+ /** Per-server risk findings, sorted by severity desc. */
55
+ findings: Array<{
56
+ server: string;
57
+ risk: RiskHeuristic;
58
+ /** "heuristic" if matched by name; "empirical" if capability-probe upgraded. */
59
+ source: "heuristic" | "empirical" | "unknown";
60
+ /** When empirical, the tool count we discovered. */
61
+ toolCount?: number;
62
+ }>;
63
+ /** Capability overlaps + bypass paths. */
64
+ graph: BypassGraph;
65
+ /** Total risk budget score (sum). */
66
+ riskBudget: number;
67
+ /** User-set budget cap (default 5.0). */
68
+ budgetCap: number;
69
+ /** True iff riskBudget ≤ budgetCap. */
70
+ withinBudget: boolean;
71
+ /** Plain-English summary. */
72
+ summary: string;
73
+ /** HMAC seal of the audit body for tamper detection. */
74
+ hmac: string;
75
+ }
76
+ export interface AuditOpts {
77
+ /** Override discovery paths. */
78
+ configPaths?: string[];
79
+ /** Set the budget cap (default 5.0). */
80
+ budgetCap?: number;
81
+ /** Run empirical capability probe on each server (slow; ~1-2s per server). */
82
+ empiricalProbe?: boolean;
83
+ /** Limit empirical probe to specific server names. */
84
+ probeOnly?: string[];
85
+ }
86
+ /** Default paths for Claude Desktop / Cursor / Continue / Cline configs. */
87
+ export declare function defaultConfigPaths(): string[];
88
+ /**
89
+ * Read each config file, extract MCP server declarations.
90
+ * Tolerates multiple known schemas: claude_desktop, cursor settings,
91
+ * continue, cline, windsurf.
92
+ */
93
+ export declare function discoverServers(configPaths: string[]): McpServerConfig[];
94
+ export declare function auditMcpConfigs(opts?: AuditOpts): Promise<SkeletonKeyAudit>;
95
+ export declare function verifyAudit(a: SkeletonKeyAudit): boolean;
96
+ export interface ConfigSnapshot {
97
+ at: string;
98
+ /** SHA-like digest of every discovered server (deterministic). */
99
+ servers: Array<{
100
+ name: string;
101
+ commandHash: string;
102
+ source: string;
103
+ }>;
104
+ hmac: string;
105
+ }
106
+ export declare function pinConfigSnapshot(cwd: string, configPaths?: string[]): ConfigSnapshot;
107
+ export interface DriftReport {
108
+ ok: boolean;
109
+ hasSnapshot: boolean;
110
+ added: Array<{
111
+ name: string;
112
+ source: string;
113
+ }>;
114
+ removed: Array<{
115
+ name: string;
116
+ source: string;
117
+ }>;
118
+ modified: Array<{
119
+ name: string;
120
+ oldHash: string;
121
+ newHash: string;
122
+ }>;
123
+ snapshotAt?: string;
124
+ currentAt: string;
125
+ hint: string;
126
+ }
127
+ export declare function detectConfigDrift(cwd: string, configPaths?: string[]): DriftReport;
128
+ export interface Recommendation {
129
+ server: string;
130
+ severity: number;
131
+ cwe: string;
132
+ action: string;
133
+ }
134
+ export declare function buildRecommendations(audit: SkeletonKeyAudit): Recommendation[];
135
+ export declare function renderAuditBanner(a: SkeletonKeyAudit): string;
136
+ export { RISK_HEURISTICS, UNKNOWN_HEURISTIC, matchHeuristic } from "./risk_heuristics.js";
137
+ export type { RiskHeuristic } from "./risk_heuristics.js";
138
+ export { buildBypassGraph, totalRiskBudget } from "./bypass_graph.js";
139
+ export type { BypassGraph, BypassPath, CapabilityOverlap, ServerNode } from "./bypass_graph.js";
140
+ export { probeServer } from "./capability_probe.js";
141
+ export type { ProbeInput, ProbeResult, ProbedTool } from "./capability_probe.js";
142
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skeleton_key/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAOH,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,mBAAmB,CAAC;AAO3B,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe;IACf,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,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