mnemospark 0.2.0 → 0.2.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.
- package/dist/cli.js +6 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2803,10 +2803,12 @@ import { privateKeyToAccount as privateKeyToAccount5 } from "viem/accounts";
|
|
|
2803
2803
|
// src/cloud-datastore.ts
|
|
2804
2804
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2805
2805
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
2806
|
+
import { createRequire as createRequire2 } from "module";
|
|
2806
2807
|
import { homedir as homedir5 } from "os";
|
|
2807
2808
|
import { dirname as dirname4, join as join7 } from "path";
|
|
2808
2809
|
var DB_SUBPATH = join7(".openclaw", "mnemospark", "state.db");
|
|
2809
2810
|
var SCHEMA_VERSION = 3;
|
|
2811
|
+
var require3 = createRequire2(import.meta.url);
|
|
2810
2812
|
function resolveDbPath(homeDir) {
|
|
2811
2813
|
return join7(homeDir ?? homedir5(), DB_SUBPATH);
|
|
2812
2814
|
}
|
|
@@ -2822,12 +2824,12 @@ async function createCloudDatastore(homeDir) {
|
|
|
2822
2824
|
throw new Error("SQLite disabled by MNEMOSPARK_DISABLE_SQLITE=1");
|
|
2823
2825
|
}
|
|
2824
2826
|
await mkdir4(dirname4(dbPath), { recursive: true });
|
|
2825
|
-
const sqliteMod =
|
|
2826
|
-
const
|
|
2827
|
-
if (!
|
|
2827
|
+
const sqliteMod = require3("node:sqlite");
|
|
2828
|
+
const DatabaseSyncCtor = sqliteMod.DatabaseSync;
|
|
2829
|
+
if (!DatabaseSyncCtor) {
|
|
2828
2830
|
throw new Error("node:sqlite DatabaseSync is unavailable");
|
|
2829
2831
|
}
|
|
2830
|
-
const nextDb = new
|
|
2832
|
+
const nextDb = new DatabaseSyncCtor(dbPath);
|
|
2831
2833
|
nextDb.exec("PRAGMA journal_mode=WAL;");
|
|
2832
2834
|
nextDb.exec("PRAGMA foreign_keys=ON;");
|
|
2833
2835
|
nextDb.exec(`
|