mnemosyne-core 2.1.5 → 2.1.8

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.
Binary file
Binary file
@@ -4038,8 +4038,8 @@
4038
4038
  // ═══════════════════════════════════════════════════════════
4039
4039
  // GLOBALS & CONFIG
4040
4040
  // ═══════════════════════════════════════════════════════════
4041
- const API = "http://localhost:7321";
4042
- const WS = `ws://localhost:7321/ws`;
4041
+ const API = `${window.location.protocol}//${window.location.host}`;
4042
+ const WS = `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/ws`;
4043
4043
  let nodes = [], links = [];
4044
4044
  let selected = null;
4045
4045
  let currentMemory = "";
@@ -4605,7 +4605,7 @@ async function loadProjects() {
4605
4605
  const saved = localStorage.getItem("nexus-current-project");
4606
4606
  if (saved && projects.some(p => p.name === saved)) {
4607
4607
  selectProject(saved, false);
4608
- } else if (projects.length === 1) {
4608
+ } else if (projects.length >= 1) {
4609
4609
  selectProject(projects[0].name, false);
4610
4610
  } else {
4611
4611
  updateProjectButtonLabel(currentMemory || "");
@@ -4937,9 +4937,9 @@ function updateMinimap() {
4937
4937
  // Draw/update mini nodes
4938
4938
  const nodes = minimap.selectAll(".minimap-node").data(simNodes, d => d.id);
4939
4939
  nodes.exit().remove();
4940
- const nodesEnter = nodes.enter().append("rect").attr("class", d => `minimap-node ${d.type === 'root' ? 'root' : ''} ${selectedAtom?.id === d.id ? 'selected' : ''}`);
4940
+ const nodesEnter = nodes.enter().append("rect").attr("class", d => `minimap-node ${d.type === 'root' ? 'root' : ''} ${selected?.id === d.id ? 'selected' : ''}`);
4941
4941
  nodesEnter.merge(nodes)
4942
- .attr("class", d => `minimap-node ${d.type === 'root' ? 'root' : ''} ${selectedAtom?.id === d.id ? 'selected' : ''}`)
4942
+ .attr("class", d => `minimap-node ${d.type === 'root' ? 'root' : ''} ${selected?.id === d.id ? 'selected' : ''}`)
4943
4943
  .attr("x", d => mx(d.x) - 1.5)
4944
4944
  .attr("y", d => my(d.y) - 1.5)
4945
4945
  .attr("width", 3)
package/dist/index.js CHANGED
@@ -201,7 +201,7 @@ function getVersion() {
201
201
  const pkg = JSON.parse(readFileSync6(resolve9(process.cwd(), "package.json"), "utf-8"));
202
202
  return pkg.version;
203
203
  } catch {
204
- return "2.1.5";
204
+ return "2.1.8";
205
205
  }
206
206
  }
207
207
  }
@@ -4598,8 +4598,9 @@ var Store = class extends EventEmitter {
4598
4598
  vals.push(this.now());
4599
4599
  sets.push("version = version + 1");
4600
4600
  vals.push(id);
4601
+ const sql = `UPDATE atoms SET ${sets.join(", ")} WHERE id = ?`;
4601
4602
  try {
4602
- this.stmt(`UPDATE atoms SET ${sets.join(", ")} WHERE id = ?`).run(...vals);
4603
+ this.stmt(sql).run(...vals);
4603
4604
  } catch (err) {
4604
4605
  if (err.message?.includes("malformed") || err.message?.includes("corrupt")) {
4605
4606
  throw new Error(`Database appears corrupted. Run "mnemosyne doctor --data-dir ./data" or delete the data directory and run "mnemosyne init" again.`);
@@ -5390,7 +5391,7 @@ function getVersion2() {
5390
5391
  const pkg = JSON.parse(readFileSync6(resolve9(process.cwd(), "package.json"), "utf-8"));
5391
5392
  return pkg.version;
5392
5393
  } catch {
5393
- return "2.1.5";
5394
+ return "2.1.8";
5394
5395
  }
5395
5396
  }
5396
5397
  }
@@ -5629,7 +5630,7 @@ CREATE TRIGGER IF NOT EXISTS trig_search_atoms_insert AFTER INSERT ON atoms BEGI
5629
5630
  END;
5630
5631
 
5631
5632
  CREATE TRIGGER IF NOT EXISTS trig_search_atoms_update AFTER UPDATE ON atoms BEGIN
5632
- UPDATE search_atoms SET title = new.title, summary = COALESCE(new.summary, '') WHERE rowid = new.rowid;
5633
+ INSERT OR REPLACE INTO search_atoms(rowid, title, summary) VALUES (new.rowid, new.title, COALESCE(new.summary, ''));
5633
5634
  END;
5634
5635
 
5635
5636
  CREATE TRIGGER IF NOT EXISTS trig_search_atoms_delete AFTER DELETE ON atoms BEGIN
@@ -5977,7 +5978,7 @@ function getVersion3() {
5977
5978
  const pkg = JSON.parse(readFileSync6(resolve9(process.cwd(), "package.json"), "utf-8"));
5978
5979
  return pkg.version;
5979
5980
  } catch {
5980
- return "2.1.5";
5981
+ return "2.1.8";
5981
5982
  }
5982
5983
  }
5983
5984
  }
@@ -7143,7 +7144,7 @@ var PKG_VERSION = (() => {
7143
7144
  const pkg = JSON.parse(require("fs").readFileSync(require("path").resolve(__dirname, "../../package.json"), "utf-8"));
7144
7145
  return pkg.version;
7145
7146
  } catch {
7146
- return "2.1.5";
7147
+ return "2.1.8";
7147
7148
  }
7148
7149
  })();
7149
7150
  function handleHealth(store, pathname, method, res) {
@@ -7426,6 +7427,10 @@ function getDb() {
7426
7427
  db.pragma("journal_mode = WAL");
7427
7428
  db.pragma("foreign_keys = ON");
7428
7429
  db.pragma("synchronous = NORMAL");
7430
+ try {
7431
+ db.pragma("wal_checkpoint(TRUNCATE)");
7432
+ } catch {
7433
+ }
7429
7434
  try {
7430
7435
  const { getLoadablePath } = require("sqlite-vec");
7431
7436
  db.loadExtension(getLoadablePath());
@@ -7504,7 +7509,7 @@ var MnemosyneServer = class {
7504
7509
  const wss = new import_websocket_server.default({ server: this.httpServer });
7505
7510
  this.wsHandler = new WebSocketHandler(wss, this.store);
7506
7511
  }
7507
- const version = cfg?.server?.version || "2.1.5";
7512
+ const version = cfg?.server?.version || "2.1.8";
7508
7513
  this.httpServer.listen(port, () => {
7509
7514
  console.log(`Mnemosyne v${version} \u2014 port ${port}`);
7510
7515
  console.log(`Dashboard: http://${host}:${port}/dashboard`);