@velvetmonkey/flywheel-memory 2.0.79 → 2.0.81

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 +49 -20
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -9913,11 +9913,16 @@ function registerQueryTools(server2, getIndex, getVaultPath, getStateDb) {
9913
9913
  const merged = Array.from(allPaths).map((p) => {
9914
9914
  const title = fts5Map.get(p)?.title || semanticMap.get(p)?.title || entityMap.get(p)?.name || p.replace(/\.md$/, "").split("/").pop() || p;
9915
9915
  const snippet = fts5Map.get(p)?.snippet;
9916
- const rrfScore = rrfScores.get(p) || 0;
9917
- return { rrfScore, ...enrichResult({ path: p, title, snippet }, index, getStateDb()) };
9916
+ return {
9917
+ ...enrichResult({ path: p, title, snippet }, index, getStateDb()),
9918
+ rrf_score: rrfScores.get(p) || 0,
9919
+ in_fts5: fts5Map.has(p),
9920
+ in_semantic: semanticMap.has(p),
9921
+ in_entity: entityMap.has(p)
9922
+ };
9918
9923
  });
9919
- merged.sort((a, b) => b.rrfScore - a.rrfScore);
9920
- const results = merged.slice(0, limit).map(({ rrfScore, ...rest }) => rest);
9924
+ merged.sort((a, b) => b.rrf_score - a.rrf_score);
9925
+ const results = merged.slice(0, limit);
9921
9926
  return { content: [{ type: "text", text: JSON.stringify({
9922
9927
  scope,
9923
9928
  method: "hybrid",
@@ -9934,8 +9939,8 @@ function registerQueryTools(server2, getIndex, getVaultPath, getStateDb) {
9934
9939
  const fts5Map = new Map(fts5Results.map((r) => [normalizePath2(r.path), r]));
9935
9940
  const entityRanked = entityResults.filter((r) => !fts5Map.has(normalizePath2(r.path)));
9936
9941
  const merged = [
9937
- ...fts5Results.map((r) => enrichResult({ path: r.path, title: r.title, snippet: r.snippet }, index, getStateDb())),
9938
- ...entityRanked.map((r) => enrichResult({ path: r.path, title: r.name }, index, getStateDb()))
9942
+ ...fts5Results.map((r) => ({ ...enrichResult({ path: r.path, title: r.title, snippet: r.snippet }, index, getStateDb()), in_fts5: true })),
9943
+ ...entityRanked.map((r) => ({ ...enrichResult({ path: r.path, title: r.name }, index, getStateDb()), in_entity: true }))
9939
9944
  ];
9940
9945
  return { content: [{ type: "text", text: JSON.stringify({
9941
9946
  scope: "content",
@@ -9945,7 +9950,7 @@ function registerQueryTools(server2, getIndex, getVaultPath, getStateDb) {
9945
9950
  results: merged.slice(0, limit)
9946
9951
  }, null, 2) }] };
9947
9952
  }
9948
- const enrichedFts5 = fts5Results.map((r) => enrichResult({ path: r.path, title: r.title, snippet: r.snippet }, index, getStateDb()));
9953
+ const enrichedFts5 = fts5Results.map((r) => ({ ...enrichResult({ path: r.path, title: r.title, snippet: r.snippet }, index, getStateDb()), in_fts5: true }));
9949
9954
  return { content: [{ type: "text", text: JSON.stringify({
9950
9955
  scope: "content",
9951
9956
  method: "fts5",
@@ -19331,8 +19336,7 @@ var ALL_CATEGORIES = [
19331
19336
  "tasks",
19332
19337
  "memory",
19333
19338
  "note-ops",
19334
- "diagnostics",
19335
- "automation"
19339
+ "diagnostics"
19336
19340
  ];
19337
19341
  var PRESETS = {
19338
19342
  // Presets
@@ -19347,8 +19351,7 @@ var PRESETS = {
19347
19351
  tasks: ["tasks"],
19348
19352
  memory: ["memory"],
19349
19353
  "note-ops": ["note-ops"],
19350
- diagnostics: ["diagnostics"],
19351
- automation: ["automation"]
19354
+ diagnostics: ["diagnostics"]
19352
19355
  };
19353
19356
  var DEFAULT_PRESET = "default";
19354
19357
  var DEPRECATED_ALIASES = {
@@ -19368,9 +19371,9 @@ var DEPRECATED_ALIASES = {
19368
19371
  paths: "graph",
19369
19372
  health: "diagnostics",
19370
19373
  analysis: "wikilinks",
19371
- git: "automation",
19372
- ops: "automation",
19373
- policy: "automation"
19374
+ git: "write",
19375
+ ops: "write",
19376
+ policy: "write"
19374
19377
  };
19375
19378
  function parseEnabledCategories() {
19376
19379
  const envValue = (process.env.FLYWHEEL_TOOLS ?? process.env.FLYWHEEL_PRESET)?.trim();
@@ -19422,12 +19425,14 @@ var TOOL_CATEGORY = {
19422
19425
  get_note_structure: "read",
19423
19426
  get_section_content: "read",
19424
19427
  find_sections: "read",
19425
- // write (5 tools) — content mutations + frontmatter + note creation
19428
+ // write (7 tools) — content mutations + frontmatter + note creation + undo + policy
19426
19429
  vault_add_to_section: "write",
19427
19430
  vault_remove_from_section: "write",
19428
19431
  vault_replace_in_section: "write",
19429
19432
  vault_update_frontmatter: "write",
19430
19433
  vault_create_note: "write",
19434
+ vault_undo_last_mutation: "write",
19435
+ policy: "write",
19431
19436
  // graph (9 tools) — structural analysis + link detail
19432
19437
  graph_analysis: "graph",
19433
19438
  get_backlinks: "graph",
@@ -19483,10 +19488,7 @@ var TOOL_CATEGORY = {
19483
19488
  server_log: "diagnostics",
19484
19489
  suggest_entity_merges: "diagnostics",
19485
19490
  dismiss_merge_suggestion: "diagnostics",
19486
- vault_init: "diagnostics",
19487
- // automation (2 tools) — git undo + policy engine
19488
- vault_undo_last_mutation: "automation",
19489
- policy: "automation"
19491
+ vault_init: "diagnostics"
19490
19492
  };
19491
19493
  function generateInstructions(categories) {
19492
19494
  const parts = [];
@@ -19513,7 +19515,34 @@ Escalation: "search" (enriched metadata + content preview) \u2192 "get_note_stru
19513
19515
  parts.push(`
19514
19516
  ## Write
19515
19517
 
19516
- Write to existing notes with "vault_add_to_section". Create new notes with "vault_create_note". Update metadata with "vault_update_frontmatter". All writes auto-link entities \u2014 no manual [[wikilinks]] needed.`);
19518
+ Write to existing notes with "vault_add_to_section". Create new notes with "vault_create_note".
19519
+ Update metadata with "vault_update_frontmatter". All writes auto-link entities \u2014 no manual [[wikilinks]] needed.
19520
+ Use "vault_undo_last_mutation" to reverse the last write.
19521
+
19522
+ **Frontmatter matters more than content** for Flywheel's intelligence. When creating or updating notes, always set:
19523
+ - \`type:\` \u2014 drives entity categorization (person, project, technology). Without it, the category is guessed from the name alone.
19524
+ - \`aliases:\` \u2014 alternative names so the entity is found when referred to differently.
19525
+ - \`description:\` \u2014 one-line summary shown in search results and used by recall.
19526
+ - Tags \u2014 used for filtering, suggestion scoring, and schema analysis.
19527
+ Good frontmatter is the highest-leverage action for improving suggestions, recall, and link quality.
19528
+
19529
+ ### Policies
19530
+
19531
+ Use "policy" to build deterministic, repeatable vault workflows. Policies are YAML files that chain
19532
+ vault tools (add/remove/replace sections, create notes, update frontmatter, toggle tasks) into
19533
+ atomic operations \u2014 all steps succeed or all roll back, committed as a single git commit.
19534
+
19535
+ Actions: "author" a policy from a description, "validate" the YAML, "preview" (dry-run),
19536
+ "execute" with variables, "list" saved policies, "revise" to modify.
19537
+
19538
+ Key capabilities:
19539
+ - **Variables** \u2014 parameterize policies (string, number, boolean, array, enum with defaults).
19540
+ - **Conditions** \u2014 branch on file/section/frontmatter state (skip steps, don't abort).
19541
+ - **Templates** \u2014 interpolate variables, builtins ({{today}}, {{now}}), and prior step outputs.
19542
+ - **Atomicity** \u2014 failure at any step rolls back all changes. One policy = one git commit.
19543
+
19544
+ Example: a "weekly-review" policy that creates a weekly note from template, pulls open tasks
19545
+ from daily notes, updates project frontmatter with hours logged, and links the review to active clients.`);
19517
19546
  }
19518
19547
  if (categories.has("memory")) {
19519
19548
  parts.push(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-memory",
3
- "version": "2.0.79",
3
+ "version": "2.0.81",
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.78",
55
+ "@velvetmonkey/vault-core": "^2.0.81",
56
56
  "better-sqlite3": "^11.0.0",
57
57
  "chokidar": "^4.0.0",
58
58
  "gray-matter": "^4.0.3",