@memrosetta/cli 0.3.2 → 0.4.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/chunk-356QK7TK.js +533 -0
- package/dist/chunk-3LSITXZ4.js +69 -0
- package/dist/chunk-6IOTBMUB.js +570 -0
- package/dist/chunk-72IW6TAV.js +59 -0
- package/dist/chunk-BGXZ3MDD.js +341 -0
- package/dist/chunk-EZVP3OY7.js +52 -0
- package/dist/chunk-FCHV2JMZ.js +347 -0
- package/dist/{chunk-F7ZMZ6HN.js → chunk-HXZ7MAT6.js} +2 -1
- package/dist/chunk-IM6H35RB.js +341 -0
- package/dist/chunk-JGE6RXXH.js +48 -0
- package/dist/chunk-JPBSMZ26.js +343 -0
- package/dist/chunk-KSKRPUZZ.js +43 -0
- package/dist/chunk-L6S3TXHR.js +326 -0
- package/dist/chunk-MISLIVUL.js +70 -0
- package/dist/chunk-NU5ZJJXP.js +63 -0
- package/dist/{chunk-326TFH4F.js → chunk-OCCU5YEG.js} +11 -42
- package/dist/chunk-PW52BB6L.js +61 -0
- package/dist/chunk-RABFL4EN.js +528 -0
- package/dist/chunk-RDUU53MG.js +343 -0
- package/dist/chunk-RYPYJJ2K.js +70 -0
- package/dist/chunk-SEPYQK3J.js +60 -0
- package/dist/{chunk-CATBN3ZT.js → chunk-TQOH7ZXN.js} +6 -18
- package/dist/chunk-Y6NH6K27.js +209 -0
- package/dist/{clear-MTL4CQM3.js → clear-47OFIDME.js} +10 -5
- package/dist/clear-4RQW6SYW.js +39 -0
- package/dist/clear-5SZVGYBX.js +39 -0
- package/dist/clear-BYRCL5ZN.js +39 -0
- package/dist/clear-ETQ7XFMV.js +39 -0
- package/dist/clear-P6H55OKZ.js +39 -0
- package/dist/clear-T3TWJQKL.js +39 -0
- package/dist/{compress-Z46R4N4M.js → compress-HDNYPXZ3.js} +10 -5
- package/dist/compress-S6MS4QW7.js +33 -0
- package/dist/compress-SEFTKZMU.js +33 -0
- package/dist/compress-TVWXLW3L.js +33 -0
- package/dist/compress-VLYNZ5BQ.js +33 -0
- package/dist/compress-YNY6YNFU.js +33 -0
- package/dist/compress-ZXWRRGHT.js +33 -0
- package/dist/{count-4TZ3C524.js → count-26AGY5XL.js} +10 -5
- package/dist/count-AMSEVDWR.js +24 -0
- package/dist/count-AVG5ZIRW.js +24 -0
- package/dist/count-CJIYYJKN.js +24 -0
- package/dist/count-KFFD4ML7.js +24 -0
- package/dist/count-UUAD3GEJ.js +24 -0
- package/dist/count-Z67KBEMV.js +24 -0
- package/dist/feedback-QDOWDWHM.js +40 -0
- package/dist/feedback-XGBKFQXC.js +40 -0
- package/dist/{get-B6AL75EW.js → get-75MGS4LN.js} +4 -2
- package/dist/get-NY5H3MUA.js +30 -0
- package/dist/hooks/on-prompt.js +2 -2
- package/dist/hooks/on-stop.js +2 -2
- package/dist/index.js +35 -18
- package/dist/ingest-A3BAI2C4.js +95 -0
- package/dist/ingest-E7QDD5NY.js +95 -0
- package/dist/ingest-GSJMWDV5.js +95 -0
- package/dist/ingest-IGI7RXR4.js +95 -0
- package/dist/ingest-JPIHSH7W.js +95 -0
- package/dist/ingest-QGXA4Y6C.js +95 -0
- package/dist/ingest-TZEVA25F.js +95 -0
- package/dist/init-2PRW64KV.js +146 -0
- package/dist/init-C3CONL23.js +146 -0
- package/dist/init-DAKOWQSW.js +169 -0
- package/dist/init-FYPMJDRN.js +146 -0
- package/dist/{init-C335O4TX.js → init-GCT4XEI6.js} +2 -2
- package/dist/init-GRVRJ6RO.js +205 -0
- package/dist/init-HBEIXY3N.js +146 -0
- package/dist/init-LK4UQISR.js +205 -0
- package/dist/init-MISGIVCC.js +146 -0
- package/dist/init-MNM4TXXJ.js +146 -0
- package/dist/{init-YAGOXYWG.js → init-OQW3KXTR.js} +2 -2
- package/dist/init-SIEKAILM.js +113 -0
- package/dist/init-TM7GTHTJ.js +146 -0
- package/dist/init-VYWOSISP.js +146 -0
- package/dist/init-WCL7FZOJ.js +182 -0
- package/dist/init-ZLUDTJAP.js +182 -0
- package/dist/invalidate-BY5VNFSE.js +25 -0
- package/dist/{invalidate-C54IVIGL.js → invalidate-D2O4VWZU.js} +4 -2
- package/dist/{maintain-ZPHG47YY.js → maintain-B65WIMGJ.js} +10 -5
- package/dist/maintain-EWOU3DGT.js +37 -0
- package/dist/maintain-FELKLG7O.js +37 -0
- package/dist/maintain-SGM56XKE.js +37 -0
- package/dist/maintain-VX2VWB2L.js +37 -0
- package/dist/maintain-WRRDXEG3.js +37 -0
- package/dist/maintain-XTCSOQBU.js +37 -0
- package/dist/{relate-R6DQUJCQ.js → relate-2QMG5H2I.js} +5 -3
- package/dist/relate-C22YYJZT.js +46 -0
- package/dist/relate-L5464WV5.js +47 -0
- package/dist/relate-SGZLG7JU.js +47 -0
- package/dist/relate-V5RYMJJ5.js +47 -0
- package/dist/relate-W4BXPFJA.js +46 -0
- package/dist/reset-45EUG44R.js +95 -0
- package/dist/reset-5NDHFUC3.js +95 -0
- package/dist/reset-C7I3LA5M.js +95 -0
- package/dist/reset-CYY4KYAB.js +129 -0
- package/dist/reset-F6F2R6BR.js +95 -0
- package/dist/reset-K3K4K5CT.js +95 -0
- package/dist/reset-K4WZJ4WU.js +95 -0
- package/dist/{reset-P63V46RN.js → reset-NNQQJN6L.js} +2 -2
- package/dist/{reset-GPV46GSD.js → reset-P5FXLI4E.js} +2 -2
- package/dist/reset-SORHIEKY.js +112 -0
- package/dist/reset-SVJMWYAK.js +95 -0
- package/dist/reset-W22RJGYZ.js +112 -0
- package/dist/reset-W3QVA632.js +95 -0
- package/dist/reset-WYEU6XJQ.js +112 -0
- package/dist/{search-YEYKOEXC.js → search-2SU5WQYK.js} +9 -4
- package/dist/search-5EE3XB2R.js +48 -0
- package/dist/search-BJ2YV5IS.js +48 -0
- package/dist/search-L6P3XY47.js +48 -0
- package/dist/search-PT4POELX.js +48 -0
- package/dist/search-UA7Y55LQ.js +48 -0
- package/dist/search-ZKLRJXFT.js +48 -0
- package/dist/status-3XVXJF7M.js +170 -0
- package/dist/status-4THJLSJL.js +131 -0
- package/dist/status-4UYY7TOE.js +131 -0
- package/dist/status-7G3RMR6A.js +139 -0
- package/dist/status-7M4TJVDH.js +170 -0
- package/dist/status-7MEEKEC2.js +131 -0
- package/dist/status-BQL4VJ6Y.js +149 -0
- package/dist/status-BTEVCZ5K.js +125 -0
- package/dist/status-F3NZGGPH.js +131 -0
- package/dist/status-GQMXOMRN.js +131 -0
- package/dist/status-HJGTMHTD.js +131 -0
- package/dist/{status-AMMF6QGI.js → status-IEKR6SSH.js} +35 -6
- package/dist/status-JJGVWESB.js +139 -0
- package/dist/status-LDVRVYZH.js +131 -0
- package/dist/{status-XNQRRFWF.js → status-TATIX3R6.js} +1 -1
- package/dist/{status-PYD6U7U7.js → status-TVY32MZD.js} +10 -3
- package/dist/{store-ZMERYHI6.js → store-2USP33HQ.js} +12 -7
- package/dist/store-6D5OJ2DX.js +91 -0
- package/dist/store-I4JNJWAZ.js +91 -0
- package/dist/store-R4LXYE57.js +91 -0
- package/dist/store-UMR2NOT7.js +91 -0
- package/dist/store-XCFYGYBE.js +91 -0
- package/dist/store-ZDI5AH4M.js +91 -0
- package/dist/sync-643GTA5X.js +319 -0
- package/dist/sync-BPVMHW34.js +319 -0
- package/dist/sync-OZQLBYT2.js +317 -0
- package/dist/sync-WURX2HJZ.js +321 -0
- package/dist/update-XJLMXCDZ.js +36 -0
- package/dist/{working-memory-2RRQFX4Q.js → working-memory-2U33JHJB.js} +10 -6
- package/dist/working-memory-35TMFU3P.js +53 -0
- package/dist/working-memory-IBWGIXLW.js +53 -0
- package/dist/working-memory-RZE3GYQZ.js +53 -0
- package/dist/working-memory-UYVEJJYW.js +53 -0
- package/dist/working-memory-VP6L2QV6.js +53 -0
- package/dist/working-memory-WGB5DZ3B.js +53 -0
- package/package.json +5 -4
- package/dist/chunk-MWLPPS7U.js +0 -133
- package/dist/ingest-ZOR3XSAE.js +0 -152
- package/dist/init-7VFBCA4O.js +0 -26
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isClaudeCodeConfigured,
|
|
3
|
+
isCursorConfigured,
|
|
4
|
+
isGenericMCPConfigured
|
|
5
|
+
} from "./chunk-RDUU53MG.js";
|
|
6
|
+
import {
|
|
7
|
+
getConfig
|
|
8
|
+
} from "./chunk-TU5EHSDE.js";
|
|
9
|
+
import {
|
|
10
|
+
getDefaultDbPath
|
|
11
|
+
} from "./chunk-2ZBEEETG.js";
|
|
12
|
+
import {
|
|
13
|
+
output
|
|
14
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/status.ts
|
|
17
|
+
import { existsSync, statSync } from "fs";
|
|
18
|
+
import { createRequire } from "module";
|
|
19
|
+
function getVersion() {
|
|
20
|
+
const require2 = createRequire(import.meta.url);
|
|
21
|
+
const pkg = require2("../../package.json");
|
|
22
|
+
return pkg.version;
|
|
23
|
+
}
|
|
24
|
+
async function run(options) {
|
|
25
|
+
const { format, db, noEmbeddings } = options;
|
|
26
|
+
const dbPath = db ?? getDefaultDbPath();
|
|
27
|
+
const exists = existsSync(dbPath);
|
|
28
|
+
let sizeBytes = 0;
|
|
29
|
+
let sizeFormatted = "0B";
|
|
30
|
+
let memoryCount = 0;
|
|
31
|
+
let userList = [];
|
|
32
|
+
const embeddingsEnabled = !noEmbeddings;
|
|
33
|
+
if (exists) {
|
|
34
|
+
const stat = statSync(dbPath);
|
|
35
|
+
sizeBytes = stat.size;
|
|
36
|
+
sizeFormatted = formatSize(sizeBytes);
|
|
37
|
+
try {
|
|
38
|
+
const Database = (await import("better-sqlite3")).default;
|
|
39
|
+
const dbConn = new Database(dbPath);
|
|
40
|
+
dbConn.pragma("journal_mode = WAL");
|
|
41
|
+
const countRow = dbConn.prepare("SELECT COUNT(*) as count FROM memories").get();
|
|
42
|
+
memoryCount = countRow.count;
|
|
43
|
+
const userRows = dbConn.prepare("SELECT DISTINCT user_id FROM memories ORDER BY user_id").all();
|
|
44
|
+
userList = userRows.map((r) => r.user_id);
|
|
45
|
+
dbConn.close();
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const claudeCodeStatus = isClaudeCodeConfigured();
|
|
50
|
+
const cursorStatus = isCursorConfigured();
|
|
51
|
+
const mcpStatus = isGenericMCPConfigured();
|
|
52
|
+
if (format === "text") {
|
|
53
|
+
process.stdout.write("MemRosetta Status\n");
|
|
54
|
+
process.stdout.write(`${"=".repeat(40)}
|
|
55
|
+
|
|
56
|
+
`);
|
|
57
|
+
process.stdout.write(
|
|
58
|
+
`Database: ${dbPath} (${exists ? `exists, ${sizeFormatted}` : "not found"})
|
|
59
|
+
`
|
|
60
|
+
);
|
|
61
|
+
process.stdout.write(`Memories: ${memoryCount}
|
|
62
|
+
`);
|
|
63
|
+
if (userList.length > 0) {
|
|
64
|
+
process.stdout.write(
|
|
65
|
+
`Users: ${userList.length} (${userList.join(", ")})
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
} else {
|
|
69
|
+
process.stdout.write("Users: 0\n");
|
|
70
|
+
}
|
|
71
|
+
const embeddingModelLabel = getEmbeddingModelLabel();
|
|
72
|
+
process.stdout.write(
|
|
73
|
+
`Embeddings: ${embeddingsEnabled ? `enabled (${embeddingModelLabel})` : "disabled"}
|
|
74
|
+
`
|
|
75
|
+
);
|
|
76
|
+
process.stdout.write("\nIntegrations:\n");
|
|
77
|
+
process.stdout.write(
|
|
78
|
+
` Claude Code: ${claudeCodeStatus ? "configured (hooks + MCP)" : "not configured"}
|
|
79
|
+
`
|
|
80
|
+
);
|
|
81
|
+
process.stdout.write(
|
|
82
|
+
` Cursor: ${cursorStatus ? "configured (MCP)" : "not configured"}
|
|
83
|
+
`
|
|
84
|
+
);
|
|
85
|
+
process.stdout.write(
|
|
86
|
+
` MCP (generic): ${mcpStatus ? "configured" : "not configured"}
|
|
87
|
+
`
|
|
88
|
+
);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
output(
|
|
92
|
+
{
|
|
93
|
+
version: getVersion(),
|
|
94
|
+
database: {
|
|
95
|
+
path: dbPath,
|
|
96
|
+
exists,
|
|
97
|
+
sizeBytes,
|
|
98
|
+
sizeFormatted
|
|
99
|
+
},
|
|
100
|
+
memories: memoryCount,
|
|
101
|
+
users: userList,
|
|
102
|
+
embeddings: embeddingsEnabled,
|
|
103
|
+
embeddingModel: getEmbeddingModelLabel(),
|
|
104
|
+
embeddingPreset: getConfig().embeddingPreset ?? "en",
|
|
105
|
+
integrations: {
|
|
106
|
+
claudeCode: claudeCodeStatus,
|
|
107
|
+
cursor: cursorStatus,
|
|
108
|
+
mcp: mcpStatus
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
format
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function formatSize(bytes) {
|
|
115
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
116
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
117
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
118
|
+
}
|
|
119
|
+
var PRESET_MODEL_LABELS = {
|
|
120
|
+
en: "bge-small-en-v1.5",
|
|
121
|
+
multilingual: "multilingual-e5-small",
|
|
122
|
+
ko: "ko-sroberta-multitask"
|
|
123
|
+
};
|
|
124
|
+
function getEmbeddingModelLabel() {
|
|
125
|
+
const config = getConfig();
|
|
126
|
+
const preset = config.embeddingPreset ?? "en";
|
|
127
|
+
return PRESET_MODEL_LABELS[preset] ?? preset;
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
run
|
|
131
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isClaudeCodeConfigured,
|
|
3
|
+
isCursorConfigured,
|
|
4
|
+
isGenericMCPConfigured
|
|
5
|
+
} from "./chunk-L6S3TXHR.js";
|
|
6
|
+
import {
|
|
7
|
+
getConfig
|
|
8
|
+
} from "./chunk-JGE6RXXH.js";
|
|
9
|
+
import {
|
|
10
|
+
getDefaultDbPath
|
|
11
|
+
} from "./chunk-2ZBEEETG.js";
|
|
12
|
+
import {
|
|
13
|
+
output
|
|
14
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/status.ts
|
|
17
|
+
import { existsSync, statSync } from "fs";
|
|
18
|
+
import { createRequire } from "module";
|
|
19
|
+
function getVersion() {
|
|
20
|
+
const require2 = createRequire(import.meta.url);
|
|
21
|
+
const pkg = require2("../../package.json");
|
|
22
|
+
return pkg.version;
|
|
23
|
+
}
|
|
24
|
+
async function run(options) {
|
|
25
|
+
const { format, db, noEmbeddings } = options;
|
|
26
|
+
const dbPath = db ?? getDefaultDbPath();
|
|
27
|
+
const exists = existsSync(dbPath);
|
|
28
|
+
let sizeBytes = 0;
|
|
29
|
+
let sizeFormatted = "0B";
|
|
30
|
+
let memoryCount = 0;
|
|
31
|
+
let userList = [];
|
|
32
|
+
const embeddingsEnabled = !noEmbeddings;
|
|
33
|
+
if (exists) {
|
|
34
|
+
const stat = statSync(dbPath);
|
|
35
|
+
sizeBytes = stat.size;
|
|
36
|
+
sizeFormatted = formatSize(sizeBytes);
|
|
37
|
+
try {
|
|
38
|
+
const Database = (await import("better-sqlite3")).default;
|
|
39
|
+
const dbConn = new Database(dbPath);
|
|
40
|
+
dbConn.pragma("journal_mode = WAL");
|
|
41
|
+
const countRow = dbConn.prepare("SELECT COUNT(*) as count FROM memories").get();
|
|
42
|
+
memoryCount = countRow.count;
|
|
43
|
+
const userRows = dbConn.prepare("SELECT DISTINCT user_id FROM memories ORDER BY user_id").all();
|
|
44
|
+
userList = userRows.map((r) => r.user_id);
|
|
45
|
+
dbConn.close();
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const claudeCodeStatus = isClaudeCodeConfigured();
|
|
50
|
+
const cursorStatus = isCursorConfigured();
|
|
51
|
+
const mcpStatus = isGenericMCPConfigured();
|
|
52
|
+
if (format === "text") {
|
|
53
|
+
process.stdout.write("MemRosetta Status\n");
|
|
54
|
+
process.stdout.write(`${"=".repeat(40)}
|
|
55
|
+
|
|
56
|
+
`);
|
|
57
|
+
process.stdout.write(
|
|
58
|
+
`Database: ${dbPath} (${exists ? `exists, ${sizeFormatted}` : "not found"})
|
|
59
|
+
`
|
|
60
|
+
);
|
|
61
|
+
process.stdout.write(`Memories: ${memoryCount}
|
|
62
|
+
`);
|
|
63
|
+
if (userList.length > 0) {
|
|
64
|
+
process.stdout.write(
|
|
65
|
+
`Users: ${userList.length} (${userList.join(", ")})
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
} else {
|
|
69
|
+
process.stdout.write("Users: 0\n");
|
|
70
|
+
}
|
|
71
|
+
const embeddingModelLabel = getEmbeddingModelLabel();
|
|
72
|
+
process.stdout.write(
|
|
73
|
+
`Embeddings: ${embeddingsEnabled ? `enabled (${embeddingModelLabel})` : "disabled"}
|
|
74
|
+
`
|
|
75
|
+
);
|
|
76
|
+
process.stdout.write("\nIntegrations:\n");
|
|
77
|
+
process.stdout.write(
|
|
78
|
+
` Claude Code: ${claudeCodeStatus ? "configured (hooks + MCP)" : "not configured"}
|
|
79
|
+
`
|
|
80
|
+
);
|
|
81
|
+
process.stdout.write(
|
|
82
|
+
` Cursor: ${cursorStatus ? "configured (MCP)" : "not configured"}
|
|
83
|
+
`
|
|
84
|
+
);
|
|
85
|
+
process.stdout.write(
|
|
86
|
+
` MCP (generic): ${mcpStatus ? "configured" : "not configured"}
|
|
87
|
+
`
|
|
88
|
+
);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
output(
|
|
92
|
+
{
|
|
93
|
+
version: getVersion(),
|
|
94
|
+
database: {
|
|
95
|
+
path: dbPath,
|
|
96
|
+
exists,
|
|
97
|
+
sizeBytes,
|
|
98
|
+
sizeFormatted
|
|
99
|
+
},
|
|
100
|
+
memories: memoryCount,
|
|
101
|
+
users: userList,
|
|
102
|
+
embeddings: embeddingsEnabled,
|
|
103
|
+
embeddingModel: getEmbeddingModelLabel(),
|
|
104
|
+
embeddingPreset: getConfig().embeddingPreset ?? "en",
|
|
105
|
+
integrations: {
|
|
106
|
+
claudeCode: claudeCodeStatus,
|
|
107
|
+
cursor: cursorStatus,
|
|
108
|
+
mcp: mcpStatus
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
format
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function formatSize(bytes) {
|
|
115
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
116
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
117
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
118
|
+
}
|
|
119
|
+
var PRESET_MODEL_LABELS = {
|
|
120
|
+
en: "bge-small-en-v1.5",
|
|
121
|
+
multilingual: "multilingual-e5-small",
|
|
122
|
+
ko: "ko-sroberta-multitask"
|
|
123
|
+
};
|
|
124
|
+
function getEmbeddingModelLabel() {
|
|
125
|
+
const config = getConfig();
|
|
126
|
+
const preset = config.embeddingPreset ?? "en";
|
|
127
|
+
return PRESET_MODEL_LABELS[preset] ?? preset;
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
run
|
|
131
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isClaudeCodeConfigured,
|
|
3
|
+
isCodexConfigured,
|
|
4
|
+
isCursorConfigured,
|
|
5
|
+
isGenericMCPConfigured
|
|
6
|
+
} from "./chunk-6IOTBMUB.js";
|
|
7
|
+
import {
|
|
8
|
+
getDefaultDbPath
|
|
9
|
+
} from "./chunk-POK32V2J.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
13
|
+
import {
|
|
14
|
+
getConfig
|
|
15
|
+
} from "./chunk-TU5EHSDE.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/status.ts
|
|
18
|
+
import { existsSync, statSync } from "fs";
|
|
19
|
+
import { createRequire } from "module";
|
|
20
|
+
function getVersion() {
|
|
21
|
+
const require2 = createRequire(import.meta.url);
|
|
22
|
+
const pkg = require2("../../package.json");
|
|
23
|
+
return pkg.version;
|
|
24
|
+
}
|
|
25
|
+
async function run(options) {
|
|
26
|
+
const { format, db, noEmbeddings } = options;
|
|
27
|
+
const config = getConfig();
|
|
28
|
+
const dbPath = db ?? config.dbPath ?? getDefaultDbPath();
|
|
29
|
+
const exists = existsSync(dbPath);
|
|
30
|
+
let sizeBytes = 0;
|
|
31
|
+
let sizeFormatted = "0B";
|
|
32
|
+
let memoryCount = 0;
|
|
33
|
+
let userList = [];
|
|
34
|
+
const embeddingsEnabled = !noEmbeddings && config.enableEmbeddings !== false;
|
|
35
|
+
if (exists) {
|
|
36
|
+
const stat = statSync(dbPath);
|
|
37
|
+
sizeBytes = stat.size;
|
|
38
|
+
sizeFormatted = formatSize(sizeBytes);
|
|
39
|
+
try {
|
|
40
|
+
const Database = (await import("better-sqlite3")).default;
|
|
41
|
+
const dbConn = new Database(dbPath);
|
|
42
|
+
dbConn.pragma("journal_mode = WAL");
|
|
43
|
+
const countRow = dbConn.prepare("SELECT COUNT(*) as count FROM memories").get();
|
|
44
|
+
memoryCount = countRow.count;
|
|
45
|
+
const userRows = dbConn.prepare("SELECT DISTINCT user_id FROM memories ORDER BY user_id").all();
|
|
46
|
+
userList = userRows.map((r) => r.user_id);
|
|
47
|
+
dbConn.close();
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const claudeCodeStatus = isClaudeCodeConfigured();
|
|
52
|
+
const cursorStatus = isCursorConfigured();
|
|
53
|
+
const codexStatus = isCodexConfigured();
|
|
54
|
+
const mcpStatus = isGenericMCPConfigured();
|
|
55
|
+
if (format === "text") {
|
|
56
|
+
process.stdout.write("MemRosetta Status\n");
|
|
57
|
+
process.stdout.write(`${"=".repeat(40)}
|
|
58
|
+
|
|
59
|
+
`);
|
|
60
|
+
process.stdout.write(
|
|
61
|
+
`Database: ${dbPath} (${exists ? `exists, ${sizeFormatted}` : "not found"})
|
|
62
|
+
`
|
|
63
|
+
);
|
|
64
|
+
process.stdout.write(`Memories: ${memoryCount}
|
|
65
|
+
`);
|
|
66
|
+
if (userList.length > 0) {
|
|
67
|
+
process.stdout.write(
|
|
68
|
+
`Users: ${userList.length} (${userList.join(", ")})
|
|
69
|
+
`
|
|
70
|
+
);
|
|
71
|
+
} else {
|
|
72
|
+
process.stdout.write("Users: 0\n");
|
|
73
|
+
}
|
|
74
|
+
const embeddingModelLabel = getEmbeddingModelLabel();
|
|
75
|
+
process.stdout.write(
|
|
76
|
+
`Embeddings: ${embeddingsEnabled ? `enabled (${embeddingModelLabel})` : "disabled"}
|
|
77
|
+
`
|
|
78
|
+
);
|
|
79
|
+
process.stdout.write("\nIntegrations:\n");
|
|
80
|
+
process.stdout.write(
|
|
81
|
+
` Claude Code: ${claudeCodeStatus ? "configured (hooks + MCP)" : "not configured"}
|
|
82
|
+
`
|
|
83
|
+
);
|
|
84
|
+
process.stdout.write(
|
|
85
|
+
` Cursor: ${cursorStatus ? "configured (MCP)" : "not configured"}
|
|
86
|
+
`
|
|
87
|
+
);
|
|
88
|
+
process.stdout.write(
|
|
89
|
+
` Codex: ${codexStatus ? "configured (MCP)" : "not configured"}
|
|
90
|
+
`
|
|
91
|
+
);
|
|
92
|
+
process.stdout.write(
|
|
93
|
+
` MCP (generic): ${mcpStatus ? "configured" : "not configured"}
|
|
94
|
+
`
|
|
95
|
+
);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
output(
|
|
99
|
+
{
|
|
100
|
+
version: getVersion(),
|
|
101
|
+
database: {
|
|
102
|
+
path: dbPath,
|
|
103
|
+
exists,
|
|
104
|
+
sizeBytes,
|
|
105
|
+
sizeFormatted
|
|
106
|
+
},
|
|
107
|
+
memories: memoryCount,
|
|
108
|
+
users: userList,
|
|
109
|
+
embeddings: embeddingsEnabled,
|
|
110
|
+
embeddingModel: getEmbeddingModelLabel(),
|
|
111
|
+
embeddingPreset: getConfig().embeddingPreset ?? "en",
|
|
112
|
+
integrations: {
|
|
113
|
+
claudeCode: claudeCodeStatus,
|
|
114
|
+
cursor: cursorStatus,
|
|
115
|
+
codex: codexStatus,
|
|
116
|
+
mcp: mcpStatus
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
format
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
function formatSize(bytes) {
|
|
123
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
124
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
125
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
126
|
+
}
|
|
127
|
+
var PRESET_MODEL_LABELS = {
|
|
128
|
+
en: "bge-small-en-v1.5",
|
|
129
|
+
multilingual: "multilingual-e5-small",
|
|
130
|
+
ko: "ko-sroberta-multitask"
|
|
131
|
+
};
|
|
132
|
+
function getEmbeddingModelLabel() {
|
|
133
|
+
const config = getConfig();
|
|
134
|
+
const preset = config.embeddingPreset ?? "en";
|
|
135
|
+
return PRESET_MODEL_LABELS[preset] ?? preset;
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
run
|
|
139
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isClaudeCodeConfigured,
|
|
3
|
+
isCodexConfigured,
|
|
4
|
+
isCursorConfigured,
|
|
5
|
+
isGenericMCPConfigured
|
|
6
|
+
} from "./chunk-TQOH7ZXN.js";
|
|
7
|
+
import {
|
|
8
|
+
getDefaultDbPath
|
|
9
|
+
} from "./chunk-POK32V2J.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
13
|
+
import {
|
|
14
|
+
getConfig
|
|
15
|
+
} from "./chunk-TU5EHSDE.js";
|
|
16
|
+
|
|
17
|
+
// src/commands/status.ts
|
|
18
|
+
import { existsSync, statSync, readFileSync } from "fs";
|
|
19
|
+
import { dirname, join } from "path";
|
|
20
|
+
import { fileURLToPath } from "url";
|
|
21
|
+
import { createRequire } from "module";
|
|
22
|
+
function getVersion() {
|
|
23
|
+
const strategies = [
|
|
24
|
+
// 1. Relative to source (dev/source checkout via tsx)
|
|
25
|
+
() => {
|
|
26
|
+
const require2 = createRequire(import.meta.url);
|
|
27
|
+
return require2("../../package.json").version;
|
|
28
|
+
},
|
|
29
|
+
// 2. Resolve from npm package
|
|
30
|
+
() => {
|
|
31
|
+
const require2 = createRequire(import.meta.url);
|
|
32
|
+
return require2("@memrosetta/cli/package.json").version;
|
|
33
|
+
},
|
|
34
|
+
// 3. Walk up to find package.json from current file location
|
|
35
|
+
() => {
|
|
36
|
+
const dir = dirname(fileURLToPath(import.meta.url));
|
|
37
|
+
for (let d = dir, i = 0; i < 5; i++) {
|
|
38
|
+
const candidate = join(d, "package.json");
|
|
39
|
+
if (existsSync(candidate)) {
|
|
40
|
+
const pkg = JSON.parse(readFileSync(candidate, "utf-8"));
|
|
41
|
+
if (pkg.name?.includes("memrosetta") && pkg.version) return pkg.version;
|
|
42
|
+
}
|
|
43
|
+
d = dirname(d);
|
|
44
|
+
}
|
|
45
|
+
throw new Error("not found");
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
for (const strategy of strategies) {
|
|
49
|
+
try {
|
|
50
|
+
return strategy();
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return "unknown";
|
|
55
|
+
}
|
|
56
|
+
async function run(options) {
|
|
57
|
+
const { format, db, noEmbeddings } = options;
|
|
58
|
+
const config = getConfig();
|
|
59
|
+
const dbPath = db ?? config.dbPath ?? getDefaultDbPath();
|
|
60
|
+
const exists = existsSync(dbPath);
|
|
61
|
+
let sizeBytes = 0;
|
|
62
|
+
let sizeFormatted = "0B";
|
|
63
|
+
let memoryCount = 0;
|
|
64
|
+
let userList = [];
|
|
65
|
+
const embeddingsEnabled = !noEmbeddings && config.enableEmbeddings !== false;
|
|
66
|
+
if (exists) {
|
|
67
|
+
const stat = statSync(dbPath);
|
|
68
|
+
sizeBytes = stat.size;
|
|
69
|
+
sizeFormatted = formatSize(sizeBytes);
|
|
70
|
+
try {
|
|
71
|
+
const Database = (await import("better-sqlite3")).default;
|
|
72
|
+
const dbConn = new Database(dbPath);
|
|
73
|
+
dbConn.pragma("journal_mode = WAL");
|
|
74
|
+
const countRow = dbConn.prepare("SELECT COUNT(*) as count FROM memories").get();
|
|
75
|
+
memoryCount = countRow.count;
|
|
76
|
+
const userRows = dbConn.prepare("SELECT DISTINCT user_id FROM memories ORDER BY user_id").all();
|
|
77
|
+
userList = userRows.map((r) => r.user_id);
|
|
78
|
+
dbConn.close();
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const claudeCodeStatus = isClaudeCodeConfigured();
|
|
83
|
+
const cursorStatus = isCursorConfigured();
|
|
84
|
+
const codexStatus = isCodexConfigured();
|
|
85
|
+
const mcpStatus = isGenericMCPConfigured();
|
|
86
|
+
if (format === "text") {
|
|
87
|
+
process.stdout.write("MemRosetta Status\n");
|
|
88
|
+
process.stdout.write(`${"=".repeat(40)}
|
|
89
|
+
|
|
90
|
+
`);
|
|
91
|
+
process.stdout.write(
|
|
92
|
+
`Database: ${dbPath} (${exists ? `exists, ${sizeFormatted}` : "not found"})
|
|
93
|
+
`
|
|
94
|
+
);
|
|
95
|
+
process.stdout.write(`Memories: ${memoryCount}
|
|
96
|
+
`);
|
|
97
|
+
if (userList.length > 0) {
|
|
98
|
+
process.stdout.write(
|
|
99
|
+
`Users: ${userList.length} (${userList.join(", ")})
|
|
100
|
+
`
|
|
101
|
+
);
|
|
102
|
+
} else {
|
|
103
|
+
process.stdout.write("Users: 0\n");
|
|
104
|
+
}
|
|
105
|
+
const embeddingModelLabel = getEmbeddingModelLabel();
|
|
106
|
+
process.stdout.write(
|
|
107
|
+
`Embeddings: ${embeddingsEnabled ? `enabled (${embeddingModelLabel})` : "disabled"}
|
|
108
|
+
`
|
|
109
|
+
);
|
|
110
|
+
process.stdout.write("\nIntegrations:\n");
|
|
111
|
+
process.stdout.write(
|
|
112
|
+
` Claude Code: ${claudeCodeStatus ? "configured (hooks + MCP)" : "not configured"}
|
|
113
|
+
`
|
|
114
|
+
);
|
|
115
|
+
process.stdout.write(
|
|
116
|
+
` Cursor: ${cursorStatus ? "configured (MCP)" : "not configured"}
|
|
117
|
+
`
|
|
118
|
+
);
|
|
119
|
+
process.stdout.write(
|
|
120
|
+
` Codex: ${codexStatus ? "configured (MCP)" : "not configured"}
|
|
121
|
+
`
|
|
122
|
+
);
|
|
123
|
+
process.stdout.write(
|
|
124
|
+
` MCP (generic): ${mcpStatus ? "configured" : "not configured"}
|
|
125
|
+
`
|
|
126
|
+
);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
output(
|
|
130
|
+
{
|
|
131
|
+
version: getVersion(),
|
|
132
|
+
database: {
|
|
133
|
+
path: dbPath,
|
|
134
|
+
exists,
|
|
135
|
+
sizeBytes,
|
|
136
|
+
sizeFormatted
|
|
137
|
+
},
|
|
138
|
+
memories: memoryCount,
|
|
139
|
+
users: userList,
|
|
140
|
+
embeddings: embeddingsEnabled,
|
|
141
|
+
embeddingModel: getEmbeddingModelLabel(),
|
|
142
|
+
embeddingPreset: getConfig().embeddingPreset ?? "en",
|
|
143
|
+
integrations: {
|
|
144
|
+
claudeCode: claudeCodeStatus,
|
|
145
|
+
cursor: cursorStatus,
|
|
146
|
+
codex: codexStatus,
|
|
147
|
+
mcp: mcpStatus
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
format
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
function formatSize(bytes) {
|
|
154
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
155
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
156
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
157
|
+
}
|
|
158
|
+
var PRESET_MODEL_LABELS = {
|
|
159
|
+
en: "bge-small-en-v1.5",
|
|
160
|
+
multilingual: "multilingual-e5-small",
|
|
161
|
+
ko: "ko-sroberta-multitask"
|
|
162
|
+
};
|
|
163
|
+
function getEmbeddingModelLabel() {
|
|
164
|
+
const config = getConfig();
|
|
165
|
+
const preset = config.embeddingPreset ?? "en";
|
|
166
|
+
return PRESET_MODEL_LABELS[preset] ?? preset;
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
run
|
|
170
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isClaudeCodeConfigured,
|
|
3
|
+
isCursorConfigured,
|
|
4
|
+
isGenericMCPConfigured
|
|
5
|
+
} from "./chunk-RABFL4EN.js";
|
|
6
|
+
import {
|
|
7
|
+
getConfig
|
|
8
|
+
} from "./chunk-TU5EHSDE.js";
|
|
9
|
+
import {
|
|
10
|
+
getDefaultDbPath
|
|
11
|
+
} from "./chunk-2ZBEEETG.js";
|
|
12
|
+
import {
|
|
13
|
+
output
|
|
14
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/status.ts
|
|
17
|
+
import { existsSync, statSync } from "fs";
|
|
18
|
+
import { createRequire } from "module";
|
|
19
|
+
function getVersion() {
|
|
20
|
+
const require2 = createRequire(import.meta.url);
|
|
21
|
+
const pkg = require2("../../package.json");
|
|
22
|
+
return pkg.version;
|
|
23
|
+
}
|
|
24
|
+
async function run(options) {
|
|
25
|
+
const { format, db, noEmbeddings } = options;
|
|
26
|
+
const dbPath = db ?? getDefaultDbPath();
|
|
27
|
+
const exists = existsSync(dbPath);
|
|
28
|
+
let sizeBytes = 0;
|
|
29
|
+
let sizeFormatted = "0B";
|
|
30
|
+
let memoryCount = 0;
|
|
31
|
+
let userList = [];
|
|
32
|
+
const embeddingsEnabled = !noEmbeddings;
|
|
33
|
+
if (exists) {
|
|
34
|
+
const stat = statSync(dbPath);
|
|
35
|
+
sizeBytes = stat.size;
|
|
36
|
+
sizeFormatted = formatSize(sizeBytes);
|
|
37
|
+
try {
|
|
38
|
+
const Database = (await import("better-sqlite3")).default;
|
|
39
|
+
const dbConn = new Database(dbPath);
|
|
40
|
+
dbConn.pragma("journal_mode = WAL");
|
|
41
|
+
const countRow = dbConn.prepare("SELECT COUNT(*) as count FROM memories").get();
|
|
42
|
+
memoryCount = countRow.count;
|
|
43
|
+
const userRows = dbConn.prepare("SELECT DISTINCT user_id FROM memories ORDER BY user_id").all();
|
|
44
|
+
userList = userRows.map((r) => r.user_id);
|
|
45
|
+
dbConn.close();
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const claudeCodeStatus = isClaudeCodeConfigured();
|
|
50
|
+
const cursorStatus = isCursorConfigured();
|
|
51
|
+
const mcpStatus = isGenericMCPConfigured();
|
|
52
|
+
if (format === "text") {
|
|
53
|
+
process.stdout.write("MemRosetta Status\n");
|
|
54
|
+
process.stdout.write(`${"=".repeat(40)}
|
|
55
|
+
|
|
56
|
+
`);
|
|
57
|
+
process.stdout.write(
|
|
58
|
+
`Database: ${dbPath} (${exists ? `exists, ${sizeFormatted}` : "not found"})
|
|
59
|
+
`
|
|
60
|
+
);
|
|
61
|
+
process.stdout.write(`Memories: ${memoryCount}
|
|
62
|
+
`);
|
|
63
|
+
if (userList.length > 0) {
|
|
64
|
+
process.stdout.write(
|
|
65
|
+
`Users: ${userList.length} (${userList.join(", ")})
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
} else {
|
|
69
|
+
process.stdout.write("Users: 0\n");
|
|
70
|
+
}
|
|
71
|
+
const embeddingModelLabel = getEmbeddingModelLabel();
|
|
72
|
+
process.stdout.write(
|
|
73
|
+
`Embeddings: ${embeddingsEnabled ? `enabled (${embeddingModelLabel})` : "disabled"}
|
|
74
|
+
`
|
|
75
|
+
);
|
|
76
|
+
process.stdout.write("\nIntegrations:\n");
|
|
77
|
+
process.stdout.write(
|
|
78
|
+
` Claude Code: ${claudeCodeStatus ? "configured (hooks + MCP)" : "not configured"}
|
|
79
|
+
`
|
|
80
|
+
);
|
|
81
|
+
process.stdout.write(
|
|
82
|
+
` Cursor: ${cursorStatus ? "configured (MCP)" : "not configured"}
|
|
83
|
+
`
|
|
84
|
+
);
|
|
85
|
+
process.stdout.write(
|
|
86
|
+
` MCP (generic): ${mcpStatus ? "configured" : "not configured"}
|
|
87
|
+
`
|
|
88
|
+
);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
output(
|
|
92
|
+
{
|
|
93
|
+
version: getVersion(),
|
|
94
|
+
database: {
|
|
95
|
+
path: dbPath,
|
|
96
|
+
exists,
|
|
97
|
+
sizeBytes,
|
|
98
|
+
sizeFormatted
|
|
99
|
+
},
|
|
100
|
+
memories: memoryCount,
|
|
101
|
+
users: userList,
|
|
102
|
+
embeddings: embeddingsEnabled,
|
|
103
|
+
embeddingModel: getEmbeddingModelLabel(),
|
|
104
|
+
embeddingPreset: getConfig().embeddingPreset ?? "en",
|
|
105
|
+
integrations: {
|
|
106
|
+
claudeCode: claudeCodeStatus,
|
|
107
|
+
cursor: cursorStatus,
|
|
108
|
+
mcp: mcpStatus
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
format
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function formatSize(bytes) {
|
|
115
|
+
if (bytes < 1024) return `${bytes}B`;
|
|
116
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
117
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
118
|
+
}
|
|
119
|
+
var PRESET_MODEL_LABELS = {
|
|
120
|
+
en: "bge-small-en-v1.5",
|
|
121
|
+
multilingual: "multilingual-e5-small",
|
|
122
|
+
ko: "ko-sroberta-multitask"
|
|
123
|
+
};
|
|
124
|
+
function getEmbeddingModelLabel() {
|
|
125
|
+
const config = getConfig();
|
|
126
|
+
const preset = config.embeddingPreset ?? "en";
|
|
127
|
+
return PRESET_MODEL_LABELS[preset] ?? preset;
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
run
|
|
131
|
+
};
|