@velvetmonkey/flywheel-memory 2.1.2 → 2.1.3

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 +15 -14
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -14158,7 +14158,7 @@ function registerHealthTools(server2, getIndex, getVaultPath, getConfig2 = () =>
14158
14158
  const linkDensity = Math.min(1, avgOutlinks / 3);
14159
14159
  let orphanCount = 0;
14160
14160
  for (const note of index.notes.values()) {
14161
- const bl = index.backlinks.get(note.title.toLowerCase());
14161
+ const bl = index.backlinks.get(normalizeTarget(note.path));
14162
14162
  if (!bl || bl.length === 0) orphanCount++;
14163
14163
  }
14164
14164
  const orphanRatio = 1 - orphanCount / noteCount;
@@ -16339,8 +16339,8 @@ function findContradictions2(index, entity) {
16339
16339
  entitiesToCheck.push([name, entityPath]);
16340
16340
  }
16341
16341
  }
16342
- for (const [entityName, _entityPath] of entitiesToCheck) {
16343
- const backlinks = index.backlinks.get(entityName);
16342
+ for (const [entityName, entityPath] of entitiesToCheck) {
16343
+ const backlinks = index.backlinks.get(normalizeTarget(entityPath));
16344
16344
  if (!backlinks || backlinks.length < 2) continue;
16345
16345
  const sourcePaths = [...new Set(backlinks.map((bl) => bl.source))];
16346
16346
  if (sourcePaths.length < 2) continue;
@@ -16575,8 +16575,8 @@ function registerGraphAnalysisTools(server2, getIndex, getVaultPath, getStateDb3
16575
16575
  } else {
16576
16576
  frontmatterScore = 1;
16577
16577
  }
16578
- const normalizedTitle = note.title.toLowerCase();
16579
- const backlinks = index.backlinks.get(normalizedTitle) || [];
16578
+ const normalizedPath = normalizeTarget(note.path);
16579
+ const backlinks = index.backlinks.get(normalizedPath) || [];
16580
16580
  const backlinkCount = backlinks.length;
16581
16581
  const backlinkScore = backlinkCount === 0 ? 0 : backlinkCount <= 2 ? 0.5 : 1;
16582
16582
  const maturity = (wordScore + outlinkScore + frontmatterScore + backlinkScore) / 4;
@@ -17458,7 +17458,7 @@ async function computeFrontmatter(index, notePath, vaultPath2, fields) {
17458
17458
  break;
17459
17459
  }
17460
17460
  case "backlink_count": {
17461
- const backlinks = index.backlinks.get(note?.title.toLowerCase() ?? "");
17461
+ const backlinks = index.backlinks.get(normalizeTarget(note?.path ?? ""));
17462
17462
  value = backlinks?.length ?? 0;
17463
17463
  method = "backlink_index";
17464
17464
  break;
@@ -17600,7 +17600,8 @@ function registerNoteIntelligenceTools(server2, getIndex, getVaultPath, getConfi
17600
17600
  const suggestions = matches.filter((m) => {
17601
17601
  if (m.similarity < 0.3) return false;
17602
17602
  if (excludeTags.size > 0) {
17603
- const entityNote = index.notes.get(m.entityName.toLowerCase() + ".md") ?? [...index.notes.values()].find((n) => n.title.toLowerCase() === m.entityName.toLowerCase());
17603
+ const entityPath = index.entities.get(m.entityName.toLowerCase());
17604
+ const entityNote = entityPath ? index.notes.get(entityPath) : [...index.notes.values()].find((n) => n.title.toLowerCase() === m.entityName.toLowerCase());
17604
17605
  if (entityNote) {
17605
17606
  const noteTags = Object.keys(entityNote.frontmatter).filter((k) => k === "tags").flatMap((k) => {
17606
17607
  const v = entityNote.frontmatter[k];
@@ -22756,9 +22757,9 @@ function registerActivityTools(server2, getStateDb3, getSessionId2) {
22756
22757
  import { z as z31 } from "zod";
22757
22758
 
22758
22759
  // src/core/read/similarity.ts
22759
- init_embeddings();
22760
22760
  import * as fs33 from "fs";
22761
22761
  import * as path36 from "path";
22762
+ init_embeddings();
22762
22763
 
22763
22764
  // src/core/read/mmr.ts
22764
22765
  init_embeddings();
@@ -22858,8 +22859,8 @@ function findSimilarNotes(db4, vaultPath2, index, sourcePath, options = {}) {
22858
22859
  const resolved = index.entities.get(link.target.toLowerCase());
22859
22860
  if (resolved) linkedPaths.add(resolved);
22860
22861
  }
22861
- const normalizedTitle = note.title.toLowerCase();
22862
- const backlinks = index.backlinks.get(normalizedTitle) || [];
22862
+ const normalizedPath = normalizeTarget(note.path);
22863
+ const backlinks = index.backlinks.get(normalizedPath) || [];
22863
22864
  for (const bl of backlinks) {
22864
22865
  linkedPaths.add(bl.source);
22865
22866
  }
@@ -22884,8 +22885,8 @@ function getLinkedPaths(index, sourcePath) {
22884
22885
  const resolved = index.entities.get(link.target.toLowerCase());
22885
22886
  if (resolved) linkedPaths.add(resolved);
22886
22887
  }
22887
- const normalizedTitle = note.title.toLowerCase();
22888
- const backlinks = index.backlinks.get(normalizedTitle) || [];
22888
+ const normalizedPath = normalizeTarget(note.path);
22889
+ const backlinks = index.backlinks.get(normalizedPath) || [];
22889
22890
  for (const bl of backlinks) {
22890
22891
  linkedPaths.add(bl.source);
22891
22892
  }
@@ -24648,8 +24649,8 @@ function registerVaultResources(server2, getIndex) {
24648
24649
  }
24649
24650
  let orphanCount = 0;
24650
24651
  for (const note of index.notes.values()) {
24651
- const normalizedTitle = note.title.toLowerCase();
24652
- const backlinks = index.backlinks.get(normalizedTitle);
24652
+ const normalizedPath = normalizeTarget(note.path);
24653
+ const backlinks = index.backlinks.get(normalizedPath);
24653
24654
  if (!backlinks || backlinks.length === 0) {
24654
24655
  orphanCount++;
24655
24656
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-memory",
3
- "version": "2.1.2",
4
- "description": "MCP tools that search, write, and auto-link your Obsidian vault and learn from your edits.",
3
+ "version": "2.1.3",
4
+ "description": "MCP tools that search, write, and auto-link your Obsidian vault \u2014 and learn from your edits.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "dependencies": {
55
55
  "@huggingface/transformers": "^3.8.1",
56
56
  "@modelcontextprotocol/sdk": "^1.25.1",
57
- "@velvetmonkey/vault-core": "^2.1.2",
57
+ "@velvetmonkey/vault-core": "^2.1.3",
58
58
  "better-sqlite3": "^12.0.0",
59
59
  "chokidar": "^4.0.0",
60
60
  "gray-matter": "^4.0.3",