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