aaronsb_obsidian-mcp-plugin/src
Aaron Bockelie 9191bbdee8 feat(graph): vault-wide statistics when sourcePath omitted (closes #132)
Before: graph.statistics threw 'Source path is required' when called
without sourcePath, blocking the baseline use case (vault health
snapshots, dashboards). Users had to pick an arbitrary seed and reason
about its neighborhood — not representative.

After: when sourcePath is omitted, return a new vaultStatistics shape:

  totalNotes            — count of .md files in the vault
  totalLinks            — sum of resolved link occurrences (Obsidian
                          semantics: A→B referenced 3× counts as 3)
  orphanCount           — singletons (no links in either direction)
  averageDegree         — 2 * totalLinks / totalNotes
  largestComponentSize  — biggest connected subgraph (undirected)
  isolatedClusters      — total connected-component count,
                          inclusive of singletons (so non-trivial =
                          isolatedClusters - orphanCount)

Per-node statistics behaviour is unchanged when sourcePath is provided.

Implementation: GraphTraversal.getVaultStatistics does one O(V+E)
pass over the resolvedLinks adjacency, plus BFS for components.
Treats the graph as undirected for component analysis (a link from A
to B means A and B are in the same component) while keeping link
counts directed (matches how metadataCache exposes them).

Tests: tests/graph-statistics-vault-wide.test.ts covers the
vault-wide path (the topology described above), per-node fallback,
empty vault, repeated occurrences, non-md filtering, and the
directed-edges-undirected-components invariant.
2026-05-25 16:21:24 -05:00
..
config feat: Complete semantic MCP integration with direct Obsidian API 2025-06-27 12:33:59 -05:00
formatters fix(formatter): emit verbatim content in default vault.read (PR #205 blocking review) 2026-05-19 00:38:29 -05:00
indexing fix: Address all review bot required issues - async, directives, globals 2026-02-04 17:08:43 -06:00
security feat(vault.list): Coherent pagination + agent next-call hints 2026-05-15 13:30:45 -05:00
semantic fix(dispatch): address PR #212 review findings 2026-05-25 08:31:37 -05:00
tools feat(graph): vault-wide statistics when sourcePath omitted (closes #132) 2026-05-25 16:21:24 -05:00
types fix: Eliminate all eslint any-type violations for Obsidian plugin review 2026-02-03 21:51:55 -06:00
utils feat(graph): vault-wide statistics when sourcePath omitted (closes #132) 2026-05-25 16:21:24 -05:00
validation fix: Address all review bot required issues - async, directives, globals 2026-02-04 17:08:43 -06:00
browser-mcp-server.ts fix: Address all review bot required issues - async, directives, globals 2026-02-04 17:08:43 -06:00
main-complex.ts chore(lint): support eslint-plugin-obsidianmd@0.3.0 2026-05-15 15:01:03 -05:00
main-simple.ts fix: Eliminate all eslint any-type violations for Obsidian plugin review 2026-02-03 21:51:55 -06:00
main.ts fix(network): address PR #211 self-review findings (ADR-107) 2026-05-24 17:06:16 -05:00
mcp-server.ts fix(network): address PR #211 self-review findings (ADR-107) 2026-05-24 17:06:16 -05:00
node-mcp-server.ts feat(network): wire classifier into server, settings, UI (ADR-107) 2026-05-24 16:56:24 -05:00
version.ts chore: Bump version to 0.11.31 2026-05-25 14:58:16 -05:00