@velvetmonkey/flywheel-memory 2.0.158 → 2.1.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 +25 -18
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -677,8 +677,13 @@ function diagnoseEmbeddings(vaultPath2) {
677
677
  } else {
678
678
  checks.push({ name: "entity_orphans", status: "ok", detail: "0 orphaned" });
679
679
  }
680
- } catch {
681
- checks.push({ name: "entity_orphans", status: "warning", detail: "Could not check entity embeddings" });
680
+ } catch (e) {
681
+ const msg = String(e);
682
+ if (msg.includes("no such table")) {
683
+ checks.push({ name: "entity_orphans", status: "ok", detail: "No entity embeddings table" });
684
+ } else {
685
+ checks.push({ name: "entity_orphans", status: "warning", detail: "Could not check entity orphans" });
686
+ }
682
687
  }
683
688
  try {
684
689
  const samples = db4.prepare("SELECT embedding FROM note_embeddings ORDER BY RANDOM() LIMIT 3").all();
@@ -25052,19 +25057,8 @@ function registerAllTools(targetServer, ctx) {
25052
25057
  var __filename = fileURLToPath2(import.meta.url);
25053
25058
  var __dirname = dirname7(__filename);
25054
25059
  var pkg = JSON.parse(readFileSync6(join21(__dirname, "../package.json"), "utf-8"));
25055
- var _earlyVaultConfigs = parseVaultConfig();
25056
- var vaultPath = _earlyVaultConfigs ? _earlyVaultConfigs[0].path : process.env.PROJECT_PATH || process.env.VAULT_PATH || findVaultRoot();
25060
+ var vaultPath;
25057
25061
  var resolvedVaultPath;
25058
- try {
25059
- resolvedVaultPath = realpathSync(vaultPath).replace(/\\/g, "/");
25060
- } catch {
25061
- resolvedVaultPath = vaultPath.replace(/\\/g, "/");
25062
- }
25063
- if (!existsSync3(resolvedVaultPath)) {
25064
- console.error(`[flywheel] Fatal: vault path does not exist: ${resolvedVaultPath}`);
25065
- console.error(`[flywheel] Set PROJECT_PATH or VAULT_PATH to a valid Obsidian vault directory.`);
25066
- process.exit(1);
25067
- }
25068
25062
  var vaultIndex;
25069
25063
  var flywheelConfig = {};
25070
25064
  var stateDb = null;
@@ -25328,10 +25322,21 @@ async function bootVault(ctx, startTime) {
25328
25322
  }
25329
25323
  }
25330
25324
  async function main() {
25325
+ const vaultConfigs = parseVaultConfig();
25326
+ vaultPath = vaultConfigs ? vaultConfigs[0].path : process.env.PROJECT_PATH || process.env.VAULT_PATH || findVaultRoot();
25327
+ try {
25328
+ resolvedVaultPath = realpathSync(vaultPath).replace(/\\/g, "/");
25329
+ } catch {
25330
+ resolvedVaultPath = vaultPath.replace(/\\/g, "/");
25331
+ }
25332
+ if (!existsSync3(resolvedVaultPath)) {
25333
+ console.error(`[flywheel] Fatal: vault path does not exist: ${resolvedVaultPath}`);
25334
+ console.error(`[flywheel] Set PROJECT_PATH or VAULT_PATH to a valid Obsidian vault directory.`);
25335
+ process.exit(1);
25336
+ }
25331
25337
  serverLog("server", `Starting Flywheel Memory v${pkg.version}...`);
25332
25338
  serverLog("server", `Vault: ${vaultPath}`);
25333
25339
  const startTime = Date.now();
25334
- const vaultConfigs = parseVaultConfig();
25335
25340
  if (vaultConfigs) {
25336
25341
  vaultRegistry = new VaultRegistry(vaultConfigs[0].name);
25337
25342
  serverLog("server", `Multi-vault mode: ${vaultConfigs.map((v) => v.name).join(", ")}`);
@@ -25818,17 +25823,19 @@ async function runPostIndexWork(ctx) {
25818
25823
  }
25819
25824
  if (process.argv.includes("--init-semantic")) {
25820
25825
  (async () => {
25826
+ const semanticVaultConfigs = parseVaultConfig();
25827
+ const semanticVaultPath = semanticVaultConfigs ? semanticVaultConfigs[0].path : process.env.PROJECT_PATH || process.env.VAULT_PATH || findVaultRoot();
25821
25828
  console.error("[Semantic] Pre-warming semantic search...");
25822
- console.error(`[Semantic] Vault: ${vaultPath}`);
25829
+ console.error(`[Semantic] Vault: ${semanticVaultPath}`);
25823
25830
  try {
25824
- const db4 = openStateDb(vaultPath);
25831
+ const db4 = openStateDb(semanticVaultPath);
25825
25832
  setEmbeddingsDatabase(db4.db);
25826
25833
  const storedModel = getStoredEmbeddingModel();
25827
25834
  if (storedModel && storedModel !== getActiveModelId()) {
25828
25835
  console.error(`[Semantic] Model changed ${storedModel} \u2192 ${getActiveModelId()}, clearing`);
25829
25836
  clearEmbeddingsForRebuild();
25830
25837
  }
25831
- const progress = await buildEmbeddingsIndex(vaultPath, (p) => {
25838
+ const progress = await buildEmbeddingsIndex(semanticVaultPath, (p) => {
25832
25839
  if (p.current % 50 === 0 || p.current === p.total) {
25833
25840
  console.error(`[Semantic] Embedding ${p.current}/${p.total} notes (${p.skipped} skipped)...`);
25834
25841
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-memory",
3
- "version": "2.0.158",
4
- "description": "MCP tools that search, write, and auto-link your Obsidian vault \u2014 and learn from your edits.",
3
+ "version": "2.1.1",
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",
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.0.158",
57
+ "@velvetmonkey/vault-core": "^2.1.1",
58
58
  "better-sqlite3": "^12.0.0",
59
59
  "chokidar": "^4.0.0",
60
60
  "gray-matter": "^4.0.3",