@velvetmonkey/flywheel-memory 2.0.74 → 2.0.75

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 (2) hide show
  1. package/dist/index.js +18 -14
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -9843,21 +9843,23 @@ function registerQueryTools(server2, getIndex, getVaultPath, getStateDb) {
9843
9843
  if (hasEmbeddingsIndex()) {
9844
9844
  try {
9845
9845
  const semanticResults = await semanticSearch(query, limit);
9846
- const fts5Ranked = fts5Results.map((r) => ({ path: r.path, title: r.title, snippet: r.snippet }));
9847
- const semanticRanked = semanticResults.map((r) => ({ path: r.path, title: r.title }));
9848
- const entityRankedList = entityResults.map((r) => ({ path: r.path, title: r.name }));
9846
+ const normalizePath2 = (p) => p.replace(/\\/g, "/").replace(/\/+/g, "/");
9847
+ const fts5Ranked = fts5Results.map((r) => ({ path: normalizePath2(r.path), title: r.title, snippet: r.snippet }));
9848
+ const semanticRanked = semanticResults.map((r) => ({ path: normalizePath2(r.path), title: r.title }));
9849
+ const entityRankedList = entityResults.map((r) => ({ path: normalizePath2(r.path), title: r.name }));
9850
+ const edgeRankedNorm = edgeRanked.map((r) => ({ path: normalizePath2(r.path), title: r.title }));
9849
9851
  const rrfLists = [fts5Ranked, semanticRanked, entityRankedList];
9850
- if (edgeRanked.length > 0) rrfLists.push(edgeRanked);
9852
+ if (edgeRankedNorm.length > 0) rrfLists.push(edgeRankedNorm);
9851
9853
  const rrfScores = reciprocalRankFusion(...rrfLists);
9852
9854
  const allPaths = /* @__PURE__ */ new Set([
9853
- ...fts5Results.map((r) => r.path),
9854
- ...semanticResults.map((r) => r.path),
9855
- ...entityResults.map((r) => r.path),
9856
- ...edgeRanked.map((r) => r.path)
9855
+ ...fts5Results.map((r) => normalizePath2(r.path)),
9856
+ ...semanticResults.map((r) => normalizePath2(r.path)),
9857
+ ...entityResults.map((r) => normalizePath2(r.path)),
9858
+ ...edgeRanked.map((r) => normalizePath2(r.path))
9857
9859
  ]);
9858
- const fts5Map = new Map(fts5Results.map((r) => [r.path, r]));
9859
- const semanticMap = new Map(semanticResults.map((r) => [r.path, r]));
9860
- const entityMap = new Map(entityResults.map((r) => [r.path, r]));
9860
+ const fts5Map = new Map(fts5Results.map((r) => [normalizePath2(r.path), r]));
9861
+ const semanticMap = new Map(semanticResults.map((r) => [normalizePath2(r.path), r]));
9862
+ const entityMap = new Map(entityResults.map((r) => [normalizePath2(r.path), r]));
9861
9863
  const merged = Array.from(allPaths).map((p) => ({
9862
9864
  path: p,
9863
9865
  title: fts5Map.get(p)?.title || semanticMap.get(p)?.title || entityMap.get(p)?.name || p.replace(/\.md$/, "").split("/").pop() || p,
@@ -9880,10 +9882,12 @@ function registerQueryTools(server2, getIndex, getVaultPath, getStateDb) {
9880
9882
  }
9881
9883
  }
9882
9884
  if (entityResults.length > 0) {
9883
- const fts5Map = new Map(fts5Results.map((r) => [r.path, r]));
9884
- const entityRanked = entityResults.filter((r) => !fts5Map.has(r.path));
9885
+ const normalizePath2 = (p) => p.replace(/\\/g, "/").replace(/\/+/g, "/");
9886
+ const fts5Map = new Map(fts5Results.map((r) => [normalizePath2(r.path), r]));
9887
+ const entityNormMap = new Map(entityResults.map((r) => [normalizePath2(r.path), r]));
9888
+ const entityRanked = entityResults.filter((r) => !fts5Map.has(normalizePath2(r.path)));
9885
9889
  const merged = [
9886
- ...fts5Results.map((r) => ({ path: r.path, title: r.title, snippet: r.snippet, in_entity: fts5Map.has(r.path) && entityResults.some((e) => e.path === r.path) })),
9890
+ ...fts5Results.map((r) => ({ path: r.path, title: r.title, snippet: r.snippet, in_entity: entityNormMap.has(normalizePath2(r.path)) })),
9887
9891
  ...entityRanked.map((r) => ({ path: r.path, title: r.name, snippet: void 0, in_entity: true }))
9888
9892
  ];
9889
9893
  return { content: [{ type: "text", text: JSON.stringify({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-memory",
3
- "version": "2.0.74",
3
+ "version": "2.0.75",
4
4
  "description": "MCP server that gives Claude full read/write access to your Obsidian vault. Select from 51 tools for search, backlinks, graph queries, mutations, agent memory, and hybrid semantic search.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@modelcontextprotocol/sdk": "^1.25.1",
55
- "@velvetmonkey/vault-core": "^2.0.74",
55
+ "@velvetmonkey/vault-core": "^2.0.75",
56
56
  "better-sqlite3": "^11.0.0",
57
57
  "chokidar": "^4.0.0",
58
58
  "gray-matter": "^4.0.3",