@bsbofmusic/memos-memu-local-memory-tools-for-agent 1.0.3 → 1.0.4

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/bin/mcp-server.js CHANGED
@@ -16,7 +16,7 @@ import { memuk_search } from '../src/tools/memuk.js';
16
16
  import { verify_memory_system } from '../src/tools/verify.js';
17
17
 
18
18
  const server = new Server(
19
- { name: 'memos-memu-local-memory-tools-for-agent', version: '1.0.3' },
19
+ { name: 'memos-memu-local-memory-tools-for-agent', version: '1.0.4' },
20
20
  { capabilities: { tools: {} } }
21
21
  );
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsbofmusic/memos-memu-local-memory-tools-for-agent",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "MCP server — one-shot install + query for memos (PostgreSQL) and memuK (SQLite) local memory. Designed for OpenClaw agents.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -125,6 +125,8 @@ export async function install_memory_system() {
125
125
  fs.mkdirSync(memukDir, { recursive: true });
126
126
  }
127
127
 
128
+ // Always initialize as a fresh SQLite DB — overwrite if exists to avoid
129
+ // schema corruption from partial appends.
128
130
  const schema = `
129
131
  CREATE TABLE IF NOT EXISTS memu_memory_items (
130
132
  id TEXT PRIMARY KEY,
@@ -146,16 +148,13 @@ CREATE TABLE IF NOT EXISTS memu_raw_memos (
146
148
  created_ts INTEGER,
147
149
  synced_at TEXT DEFAULT (datetime('now', 'localtime'))
148
150
  );
151
+ -- Initialize checkpoint with a placeholder so table is not empty
152
+ INSERT OR IGNORE INTO memu_sync_checkpoint (key, value) VALUES ('last_memo_id', '0');
149
153
  `.trim();
150
154
 
151
155
  try {
152
- if (fs.existsSync(env.memukPath)) {
153
- const fd = fs.openSync(env.memukPath, 'a');
154
- fs.writeSync(fd, '\n' + schema + '\n');
155
- fs.closeSync(fd);
156
- } else {
157
- fs.writeFileSync(env.memukPath, schema + '\n');
158
- }
156
+ // Always write fresh schema — avoids partial schema from previous installs
157
+ fs.writeFileSync(env.memukPath, schema + '\n');
159
158
  const testCount = sqlite('SELECT COUNT(*) FROM memu_memory_items;', env.memukPath).trim();
160
159
  report.ok('memuK SQLite', `Schema initialized · ${testCount} memory_items`);
161
160
  } catch (err) {