@velvetmonkey/flywheel-memory 2.5.14 → 2.6.1

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 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -14782,6 +14782,7 @@ function registerGraphTools(server2, getIndex, getVaultPath, getStateDb4) {
14782
14782
  async ({ path: notePath }) => {
14783
14783
  requireIndex();
14784
14784
  const index = getIndex();
14785
+ const vaultPath2 = getVaultPath();
14785
14786
  let resolvedPath = notePath;
14786
14787
  if (!notePath.endsWith(".md")) {
14787
14788
  const resolved = resolveTarget(index, notePath);
@@ -14791,7 +14792,20 @@ function registerGraphTools(server2, getIndex, getVaultPath, getStateDb4) {
14791
14792
  resolvedPath = notePath + ".md";
14792
14793
  }
14793
14794
  }
14794
- const forwardLinks = getForwardLinksForNote(index, resolvedPath);
14795
+ let forwardLinks = getForwardLinksForNote(index, resolvedPath);
14796
+ if (forwardLinks.length === 0) {
14797
+ try {
14798
+ const absolutePath = path18.join(vaultPath2, resolvedPath);
14799
+ const result = await parseNoteWithWarnings({ path: resolvedPath, absolutePath, modified: /* @__PURE__ */ new Date() });
14800
+ if (!result.skipped) {
14801
+ forwardLinks = result.note.outlinks.map((link) => {
14802
+ const rp = resolveTarget(index, link.target);
14803
+ return { target: link.target, alias: link.alias, line: link.line, resolvedPath: rp, exists: rp !== void 0 };
14804
+ });
14805
+ }
14806
+ } catch {
14807
+ }
14808
+ }
14795
14809
  const output = {
14796
14810
  note: resolvedPath,
14797
14811
  forward_link_count: forwardLinks.length,
@@ -14827,6 +14841,7 @@ function registerGraphTools(server2, getIndex, getVaultPath, getStateDb4) {
14827
14841
  return { content: [{ type: "text", text: JSON.stringify({ error: "StateDb not initialized" }) }] };
14828
14842
  }
14829
14843
  const limit = Math.min(requestedLimit ?? 20, MAX_LIMIT);
14844
+ const index = getIndex();
14830
14845
  const targets = getInboundTargetsForNote(stateDb2, notePath);
14831
14846
  const inPlaceholders = targets.map(() => "?").join(",");
14832
14847
  const rows = stateDb2.db.prepare(`
@@ -14848,7 +14863,8 @@ function registerGraphTools(server2, getIndex, getVaultPath, getStateDb4) {
14848
14863
  connections: rows.map((r) => ({
14849
14864
  node: r.node,
14850
14865
  weight: r.weight,
14851
- direction: r.direction
14866
+ direction: r.direction,
14867
+ resolved_path: r.direction === "outgoing" ? resolveTarget(index, r.node) ?? void 0 : void 0
14852
14868
  }))
14853
14869
  }, null, 2)
14854
14870
  }]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-memory",
3
- "version": "2.5.14",
3
+ "version": "2.6.1",
4
4
  "description": "MCP tools that search, write, and auto-link your Obsidian vault — and learn from your edits.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "dependencies": {
57
57
  "@huggingface/transformers": "^3.8.1",
58
58
  "@modelcontextprotocol/sdk": "^1.26.0",
59
- "@velvetmonkey/vault-core": "^2.5.14",
59
+ "@velvetmonkey/vault-core": "^2.6.1",
60
60
  "better-sqlite3": "^12.0.0",
61
61
  "chokidar": "^4.0.0",
62
62
  "gray-matter": "^4.0.3",