@vheins/local-memory-mcp 0.7.1 → 0.7.3
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/{chunk-J4O2HJ2K.js → chunk-ZCK6RZFX.js} +48 -11
- package/dist/dashboard/public/assets/{index-CRhOgOlp.js → index-Bd8FKzVy.js} +2 -2
- package/dist/dashboard/public/index.html +1 -1
- package/dist/dashboard/server.js +63 -32
- package/dist/mcp/server.js +55 -29
- package/dist/prompts/export-task-to-github.md +61 -0
- package/dist/prompts/import-github-issues.md +8 -3
- package/package.json +2 -1
|
@@ -1899,7 +1899,6 @@ function resolveDbPath() {
|
|
|
1899
1899
|
return standardPath;
|
|
1900
1900
|
}
|
|
1901
1901
|
var DB_PATH = resolveDbPath();
|
|
1902
|
-
var dbPathInstance = "";
|
|
1903
1902
|
var sqlJsReady = null;
|
|
1904
1903
|
var sqlJsModule = null;
|
|
1905
1904
|
async function getSqlJs() {
|
|
@@ -1934,9 +1933,12 @@ var SQLiteStore = class _SQLiteStore {
|
|
|
1934
1933
|
system;
|
|
1935
1934
|
summaries;
|
|
1936
1935
|
_ready;
|
|
1936
|
+
lastLoadedAt = 0;
|
|
1937
|
+
saveDbPtr;
|
|
1938
|
+
dbPathInstance;
|
|
1937
1939
|
constructor(dbPath) {
|
|
1938
1940
|
const finalPath = dbPath ?? DB_PATH;
|
|
1939
|
-
dbPathInstance = finalPath;
|
|
1941
|
+
this.dbPathInstance = finalPath;
|
|
1940
1942
|
warmUpSqlJs();
|
|
1941
1943
|
this.db = {};
|
|
1942
1944
|
this.memories = {};
|
|
@@ -1963,23 +1965,58 @@ var SQLiteStore = class _SQLiteStore {
|
|
|
1963
1965
|
db = new SQL.Database();
|
|
1964
1966
|
}
|
|
1965
1967
|
}
|
|
1966
|
-
|
|
1968
|
+
this.saveDbPtr = createSaveFunction(db, finalPath);
|
|
1969
|
+
const wrappedSaveDb = () => {
|
|
1970
|
+
if (this.saveDbPtr) {
|
|
1971
|
+
this.saveDbPtr();
|
|
1972
|
+
this.lastLoadedAt = Date.now();
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1967
1975
|
db.run("PRAGMA journal_mode = WAL");
|
|
1968
1976
|
db.run("PRAGMA synchronous = NORMAL");
|
|
1969
1977
|
db.run("PRAGMA busy_timeout = 5000");
|
|
1970
|
-
const migrator = new MigrationManager(db,
|
|
1978
|
+
const migrator = new MigrationManager(db, wrappedSaveDb);
|
|
1971
1979
|
migrator.migrate();
|
|
1972
1980
|
migrator.addMemoryCodeColumn();
|
|
1973
1981
|
Object.assign(this, {
|
|
1974
1982
|
db,
|
|
1975
|
-
memories: new MemoryEntity(db,
|
|
1976
|
-
tasks: new TaskEntity(db,
|
|
1977
|
-
actions: new ActionEntity(db,
|
|
1978
|
-
system: new SystemEntity(db,
|
|
1979
|
-
summaries: new SummaryEntity(db,
|
|
1983
|
+
memories: new MemoryEntity(db, wrappedSaveDb),
|
|
1984
|
+
tasks: new TaskEntity(db, wrappedSaveDb),
|
|
1985
|
+
actions: new ActionEntity(db, wrappedSaveDb),
|
|
1986
|
+
system: new SystemEntity(db, wrappedSaveDb),
|
|
1987
|
+
summaries: new SummaryEntity(db, wrappedSaveDb)
|
|
1980
1988
|
});
|
|
1989
|
+
this.lastLoadedAt = Date.now();
|
|
1981
1990
|
if (finalPath !== ":memory:") {
|
|
1982
|
-
|
|
1991
|
+
wrappedSaveDb();
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
async refresh(force = false) {
|
|
1995
|
+
const path5 = this.getDbPath();
|
|
1996
|
+
if (path5 === ":memory:") return;
|
|
1997
|
+
try {
|
|
1998
|
+
const stats = fs2.statSync(path5);
|
|
1999
|
+
const mtime = stats.mtimeMs;
|
|
2000
|
+
if (force || mtime > this.lastLoadedAt) {
|
|
2001
|
+
const SQL = await getSqlJs();
|
|
2002
|
+
const fileBuffer = fs2.readFileSync(path5);
|
|
2003
|
+
const newDb = new SQL.Database(fileBuffer);
|
|
2004
|
+
const wrappedSaveDb = () => {
|
|
2005
|
+
if (this.saveDbPtr) {
|
|
2006
|
+
this.saveDbPtr();
|
|
2007
|
+
this.lastLoadedAt = Date.now();
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
this.db = newDb;
|
|
2011
|
+
this.memories = new MemoryEntity(newDb, wrappedSaveDb);
|
|
2012
|
+
this.tasks = new TaskEntity(newDb, wrappedSaveDb);
|
|
2013
|
+
this.actions = new ActionEntity(newDb, wrappedSaveDb);
|
|
2014
|
+
this.system = new SystemEntity(newDb, wrappedSaveDb);
|
|
2015
|
+
this.summaries = new SummaryEntity(newDb, wrappedSaveDb);
|
|
2016
|
+
this.lastLoadedAt = Date.now();
|
|
2017
|
+
}
|
|
2018
|
+
} catch (e) {
|
|
2019
|
+
console.error("Failed to refresh database from disk:", e);
|
|
1983
2020
|
}
|
|
1984
2021
|
}
|
|
1985
2022
|
async ready() {
|
|
@@ -1991,7 +2028,7 @@ var SQLiteStore = class _SQLiteStore {
|
|
|
1991
2028
|
return store;
|
|
1992
2029
|
}
|
|
1993
2030
|
getDbPath() {
|
|
1994
|
-
return dbPathInstance;
|
|
2031
|
+
return this.dbPathInstance;
|
|
1995
2032
|
}
|
|
1996
2033
|
close() {
|
|
1997
2034
|
if (this.db && this.db.close) {
|