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/cli.js
CHANGED
|
@@ -2752,10 +2752,12 @@ import { privateKeyToAccount as privateKeyToAccount5 } from "viem/accounts";
|
|
|
2752
2752
|
// src/cloud-datastore.ts
|
|
2753
2753
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2754
2754
|
import { mkdir as mkdir4 } from "fs/promises";
|
|
2755
|
+
import { createRequire as createRequire2 } from "module";
|
|
2755
2756
|
import { homedir as homedir5 } from "os";
|
|
2756
2757
|
import { dirname as dirname4, join as join7 } from "path";
|
|
2757
2758
|
var DB_SUBPATH = join7(".openclaw", "mnemospark", "state.db");
|
|
2758
2759
|
var SCHEMA_VERSION = 3;
|
|
2760
|
+
var require3 = createRequire2(import.meta.url);
|
|
2759
2761
|
function resolveDbPath(homeDir) {
|
|
2760
2762
|
return join7(homeDir ?? homedir5(), DB_SUBPATH);
|
|
2761
2763
|
}
|
|
@@ -2771,12 +2773,12 @@ async function createCloudDatastore(homeDir) {
|
|
|
2771
2773
|
throw new Error("SQLite disabled by MNEMOSPARK_DISABLE_SQLITE=1");
|
|
2772
2774
|
}
|
|
2773
2775
|
await mkdir4(dirname4(dbPath), { recursive: true });
|
|
2774
|
-
const sqliteMod =
|
|
2775
|
-
const
|
|
2776
|
-
if (!
|
|
2776
|
+
const sqliteMod = require3("node:sqlite");
|
|
2777
|
+
const DatabaseSyncCtor = sqliteMod.DatabaseSync;
|
|
2778
|
+
if (!DatabaseSyncCtor) {
|
|
2777
2779
|
throw new Error("node:sqlite DatabaseSync is unavailable");
|
|
2778
2780
|
}
|
|
2779
|
-
const nextDb = new
|
|
2781
|
+
const nextDb = new DatabaseSyncCtor(dbPath);
|
|
2780
2782
|
nextDb.exec("PRAGMA journal_mode=WAL;");
|
|
2781
2783
|
nextDb.exec("PRAGMA foreign_keys=ON;");
|
|
2782
2784
|
nextDb.exec(`
|