mnemosyne-core 2.1.5 → 2.1.6

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.
package/dist/cli/index.js CHANGED
@@ -7599,7 +7599,7 @@ var require_package = __commonJS({
7599
7599
  "package.json"(exports2, module2) {
7600
7600
  module2.exports = {
7601
7601
  name: "mnemosyne-core",
7602
- version: "2.1.5",
7602
+ version: "2.1.6",
7603
7603
  description: "Unified memory engine for AI agents \u2014 graph atoms, semantic search, and collaborative memory",
7604
7604
  logo: "logo.png",
7605
7605
  author: "Arman Aslanyan <aslanyanarman88@gmail.com> (https://www.linkedin.com/in/arman-aslanyan/)",
@@ -8144,8 +8144,9 @@ var Store = class extends EventEmitter {
8144
8144
  vals.push(this.now());
8145
8145
  sets.push("version = version + 1");
8146
8146
  vals.push(id);
8147
+ const sql = `UPDATE atoms SET ${sets.join(", ")} WHERE id = ?`;
8147
8148
  try {
8148
- this.stmt(`UPDATE atoms SET ${sets.join(", ")} WHERE id = ?`).run(...vals);
8149
+ this.stmt(sql).run(...vals);
8149
8150
  } catch (err) {
8150
8151
  if (err.message?.includes("malformed") || err.message?.includes("corrupt")) {
8151
8152
  throw new Error(`Database appears corrupted. Run "mnemosyne doctor --data-dir ./data" or delete the data directory and run "mnemosyne init" again.`);
@@ -9175,7 +9176,7 @@ CREATE TRIGGER IF NOT EXISTS trig_search_atoms_insert AFTER INSERT ON atoms BEGI
9175
9176
  END;
9176
9177
 
9177
9178
  CREATE TRIGGER IF NOT EXISTS trig_search_atoms_update AFTER UPDATE ON atoms BEGIN
9178
- UPDATE search_atoms SET title = new.title, summary = COALESCE(new.summary, '') WHERE rowid = new.rowid;
9179
+ INSERT OR REPLACE INTO search_atoms(rowid, title, summary) VALUES (new.rowid, new.title, COALESCE(new.summary, ''));
9179
9180
  END;
9180
9181
 
9181
9182
  CREATE TRIGGER IF NOT EXISTS trig_search_atoms_delete AFTER DELETE ON atoms BEGIN
@@ -10919,6 +10920,10 @@ function getDb() {
10919
10920
  db.pragma("journal_mode = WAL");
10920
10921
  db.pragma("foreign_keys = ON");
10921
10922
  db.pragma("synchronous = NORMAL");
10923
+ try {
10924
+ db.pragma("wal_checkpoint(TRUNCATE)");
10925
+ } catch {
10926
+ }
10922
10927
  try {
10923
10928
  const { getLoadablePath } = require("sqlite-vec");
10924
10929
  db.loadExtension(getLoadablePath());