@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,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-PW52BB6L.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultUserId
|
|
6
|
+
} from "./chunk-TU5EHSDE.js";
|
|
7
|
+
import {
|
|
8
|
+
getEngine
|
|
9
|
+
} from "./chunk-2ZBEEETG.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/compress.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const result = await engine.compress(userId);
|
|
20
|
+
if (format === "text") {
|
|
21
|
+
process.stdout.write(`Compression completed for user: ${userId}
|
|
22
|
+
`);
|
|
23
|
+
process.stdout.write(` Groups compressed: ${result.compressed}
|
|
24
|
+
`);
|
|
25
|
+
process.stdout.write(` Memories archived: ${result.removed}
|
|
26
|
+
`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
output({ userId, ...result }, format);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
run
|
|
33
|
+
};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-PW52BB6L.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultUserId
|
|
6
|
+
} from "./chunk-TU5EHSDE.js";
|
|
7
|
+
import {
|
|
8
|
+
getEngine
|
|
9
|
+
} from "./chunk-2ZBEEETG.js";
|
|
4
10
|
import {
|
|
5
|
-
getEngine,
|
|
6
11
|
output
|
|
7
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
8
13
|
|
|
9
14
|
// src/commands/count.ts
|
|
10
15
|
async function run(options) {
|
|
11
16
|
const { args, format, db, noEmbeddings } = options;
|
|
12
|
-
const userId =
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
13
18
|
const engine = await getEngine({ db, noEmbeddings });
|
|
14
19
|
const count = await engine.count(userId);
|
|
15
20
|
output({ userId, count }, format);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-NU5ZJJXP.js";
|
|
4
|
+
import {
|
|
5
|
+
getEngine
|
|
6
|
+
} from "./chunk-72IW6TAV.js";
|
|
7
|
+
import {
|
|
8
|
+
output
|
|
9
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
10
|
+
import {
|
|
11
|
+
getDefaultUserId
|
|
12
|
+
} from "./chunk-SEPYQK3J.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/count.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const count = await engine.count(userId);
|
|
20
|
+
output({ userId, count }, format);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
run
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-TGGGIJC4.js";
|
|
4
|
+
import {
|
|
5
|
+
getEngine
|
|
6
|
+
} from "./chunk-POK32V2J.js";
|
|
7
|
+
import {
|
|
8
|
+
output
|
|
9
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
10
|
+
import {
|
|
11
|
+
getDefaultUserId
|
|
12
|
+
} from "./chunk-TU5EHSDE.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/count.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const count = await engine.count(userId);
|
|
20
|
+
output({ userId, count }, format);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
run
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-HXZ7MAT6.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultUserId
|
|
6
|
+
} from "./chunk-JGE6RXXH.js";
|
|
7
|
+
import {
|
|
8
|
+
getEngine
|
|
9
|
+
} from "./chunk-2ZBEEETG.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/count.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const count = await engine.count(userId);
|
|
20
|
+
output({ userId, count }, format);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
run
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-HXZ7MAT6.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultUserId
|
|
6
|
+
} from "./chunk-TU5EHSDE.js";
|
|
7
|
+
import {
|
|
8
|
+
getEngine
|
|
9
|
+
} from "./chunk-2ZBEEETG.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/count.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const count = await engine.count(userId);
|
|
20
|
+
output({ userId, count }, format);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
run
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-HXZ7MAT6.js";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultUserId
|
|
6
|
+
} from "./chunk-KSKRPUZZ.js";
|
|
7
|
+
import {
|
|
8
|
+
getEngine
|
|
9
|
+
} from "./chunk-EZVP3OY7.js";
|
|
10
|
+
import {
|
|
11
|
+
output
|
|
12
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/count.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const count = await engine.count(userId);
|
|
20
|
+
output({ userId, count }, format);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
run
|
|
24
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
optionalOption
|
|
3
|
+
} from "./chunk-VZQURGWB.js";
|
|
4
|
+
import {
|
|
5
|
+
getEngine
|
|
6
|
+
} from "./chunk-72IW6TAV.js";
|
|
7
|
+
import {
|
|
8
|
+
output
|
|
9
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
10
|
+
import {
|
|
11
|
+
getDefaultUserId
|
|
12
|
+
} from "./chunk-SEPYQK3J.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/count.ts
|
|
15
|
+
async function run(options) {
|
|
16
|
+
const { args, format, db, noEmbeddings } = options;
|
|
17
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
18
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
19
|
+
const count = await engine.count(userId);
|
|
20
|
+
output({ userId, count }, format);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
run
|
|
24
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasFlag
|
|
3
|
+
} from "./chunk-VZQURGWB.js";
|
|
4
|
+
import {
|
|
5
|
+
getEngine
|
|
6
|
+
} from "./chunk-72IW6TAV.js";
|
|
7
|
+
import {
|
|
8
|
+
output,
|
|
9
|
+
outputError
|
|
10
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
11
|
+
import "./chunk-SEPYQK3J.js";
|
|
12
|
+
|
|
13
|
+
// src/commands/feedback.ts
|
|
14
|
+
async function run(options) {
|
|
15
|
+
const { args, format, db, noEmbeddings } = options;
|
|
16
|
+
const memoryId = args.find((a) => !a.startsWith("-"));
|
|
17
|
+
if (!memoryId) {
|
|
18
|
+
outputError("Usage: memrosetta feedback <memoryId> --helpful | --not-helpful", format);
|
|
19
|
+
process.exitCode = 1;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const helpful = hasFlag(args, "--helpful");
|
|
23
|
+
const notHelpful = hasFlag(args, "--not-helpful");
|
|
24
|
+
if (!helpful && !notHelpful) {
|
|
25
|
+
outputError("Specify --helpful or --not-helpful", format);
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (helpful && notHelpful) {
|
|
30
|
+
outputError("Specify either --helpful or --not-helpful, not both", format);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
35
|
+
await engine.feedback(memoryId, helpful);
|
|
36
|
+
output({ memoryId, helpful }, format);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
run
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
hasFlag
|
|
3
|
+
} from "./chunk-NU5ZJJXP.js";
|
|
4
|
+
import {
|
|
5
|
+
getEngine
|
|
6
|
+
} from "./chunk-72IW6TAV.js";
|
|
7
|
+
import {
|
|
8
|
+
output,
|
|
9
|
+
outputError
|
|
10
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
11
|
+
import "./chunk-SEPYQK3J.js";
|
|
12
|
+
|
|
13
|
+
// src/commands/feedback.ts
|
|
14
|
+
async function run(options) {
|
|
15
|
+
const { args, format, db, noEmbeddings } = options;
|
|
16
|
+
const memoryId = args.find((a) => !a.startsWith("-"));
|
|
17
|
+
if (!memoryId) {
|
|
18
|
+
outputError("Usage: memrosetta feedback <memoryId> --helpful | --not-helpful", format);
|
|
19
|
+
process.exitCode = 1;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const helpful = hasFlag(args, "--helpful");
|
|
23
|
+
const notHelpful = hasFlag(args, "--not-helpful");
|
|
24
|
+
if (!helpful && !notHelpful) {
|
|
25
|
+
outputError("Specify --helpful or --not-helpful", format);
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (helpful && notHelpful) {
|
|
30
|
+
outputError("Specify either --helpful or --not-helpful, not both", format);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
35
|
+
await engine.feedback(memoryId, helpful);
|
|
36
|
+
output({ memoryId, helpful }, format);
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
run
|
|
40
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEngine
|
|
3
|
+
} from "./chunk-72IW6TAV.js";
|
|
4
|
+
import {
|
|
5
|
+
output,
|
|
6
|
+
outputError
|
|
7
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
8
|
+
import "./chunk-SEPYQK3J.js";
|
|
9
|
+
|
|
10
|
+
// src/commands/get.ts
|
|
11
|
+
async function run(options) {
|
|
12
|
+
const { args, format, db, noEmbeddings } = options;
|
|
13
|
+
const memoryId = args.find((a) => !a.startsWith("-") && a !== "get");
|
|
14
|
+
if (!memoryId) {
|
|
15
|
+
outputError("Missing memory ID. Usage: memrosetta get <memory-id>", format);
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
20
|
+
const memory = await engine.getById(memoryId);
|
|
21
|
+
if (!memory) {
|
|
22
|
+
outputError(`Memory not found: ${memoryId}`, format);
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
output(memory, format);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
run
|
|
30
|
+
};
|
package/dist/hooks/on-prompt.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getEngineWithTimeout,
|
|
5
5
|
isValidTranscriptPath,
|
|
6
6
|
sanitizeSessionId
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-MISLIVUL.js";
|
|
8
8
|
import {
|
|
9
9
|
extractMemories,
|
|
10
10
|
parseTranscript,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "../chunk-KR63XYFW.js";
|
|
14
14
|
import {
|
|
15
15
|
getConfig
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-SEPYQK3J.js";
|
|
17
17
|
|
|
18
18
|
// src/hooks/on-prompt.ts
|
|
19
19
|
import { existsSync, statSync } from "fs";
|
package/dist/hooks/on-stop.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getEngine,
|
|
5
5
|
isValidTranscriptPath,
|
|
6
6
|
sanitizeSessionId
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-MISLIVUL.js";
|
|
8
8
|
import {
|
|
9
9
|
extractMemories,
|
|
10
10
|
parseTranscript,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "../chunk-KR63XYFW.js";
|
|
13
13
|
import {
|
|
14
14
|
getConfig
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-SEPYQK3J.js";
|
|
16
16
|
|
|
17
17
|
// src/hooks/on-stop.ts
|
|
18
18
|
import { existsSync } from "fs";
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
parseGlobalArgs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NU5ZJJXP.js";
|
|
5
5
|
import {
|
|
6
6
|
closeEngine
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-72IW6TAV.js";
|
|
8
8
|
import {
|
|
9
9
|
outputError
|
|
10
10
|
} from "./chunk-ET6TNQOJ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-SEPYQK3J.js";
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
var HELP_TEXT = `memrosetta - AI long-term memory engine CLI
|
|
@@ -32,6 +32,7 @@ Commands:
|
|
|
32
32
|
maintain Run maintenance (recompute scores, update tiers, compress)
|
|
33
33
|
compress Run compression only
|
|
34
34
|
update Update to latest version
|
|
35
|
+
sync Manage multi-device sync (enable/disable/status/now/device-id)
|
|
35
36
|
|
|
36
37
|
Init Options:
|
|
37
38
|
(no flag) Initialize DB + MCP server (base setup)
|
|
@@ -54,6 +55,15 @@ Global Options:
|
|
|
54
55
|
--help, -h Show help
|
|
55
56
|
--version, -v Show version
|
|
56
57
|
|
|
58
|
+
Sync Subcommands:
|
|
59
|
+
memrosetta sync enable --server <url> # Enable sync, hidden API key prompt
|
|
60
|
+
memrosetta sync enable --server <url> --key-stdin # Read API key from stdin
|
|
61
|
+
memrosetta sync disable # Disable sync (keeps server/key)
|
|
62
|
+
memrosetta sync status # Show sync state + pending ops
|
|
63
|
+
memrosetta sync now # Push + pull now
|
|
64
|
+
memrosetta sync now --push-only # Push only
|
|
65
|
+
memrosetta sync device-id # Print current device id
|
|
66
|
+
|
|
57
67
|
Examples:
|
|
58
68
|
memrosetta init # DB + MCP server
|
|
59
69
|
memrosetta init --claude-code # DB + MCP + Claude Code hooks
|
|
@@ -65,6 +75,8 @@ Examples:
|
|
|
65
75
|
memrosetta reset --all # Remove all integrations
|
|
66
76
|
memrosetta store --user obst --content "Prefers TypeScript" --type preference
|
|
67
77
|
memrosetta search --user obst --query "language preference" --format text
|
|
78
|
+
memrosetta sync enable --server https://your-sync.example.com
|
|
79
|
+
memrosetta sync status --format text
|
|
68
80
|
`;
|
|
69
81
|
async function main() {
|
|
70
82
|
const rawArgs = process.argv.slice(2);
|
|
@@ -93,77 +105,77 @@ async function main() {
|
|
|
93
105
|
try {
|
|
94
106
|
switch (command) {
|
|
95
107
|
case "store": {
|
|
96
|
-
const mod = await import("./store-
|
|
108
|
+
const mod = await import("./store-2USP33HQ.js");
|
|
97
109
|
await mod.run(commandOptions);
|
|
98
110
|
break;
|
|
99
111
|
}
|
|
100
112
|
case "search": {
|
|
101
|
-
const mod = await import("./search-
|
|
113
|
+
const mod = await import("./search-PT4POELX.js");
|
|
102
114
|
await mod.run(commandOptions);
|
|
103
115
|
break;
|
|
104
116
|
}
|
|
105
117
|
case "ingest": {
|
|
106
|
-
const mod = await import("./ingest-
|
|
118
|
+
const mod = await import("./ingest-GSJMWDV5.js");
|
|
107
119
|
await mod.run(commandOptions);
|
|
108
120
|
break;
|
|
109
121
|
}
|
|
110
122
|
case "get": {
|
|
111
|
-
const mod = await import("./get-
|
|
123
|
+
const mod = await import("./get-NY5H3MUA.js");
|
|
112
124
|
await mod.run(commandOptions);
|
|
113
125
|
break;
|
|
114
126
|
}
|
|
115
127
|
case "count": {
|
|
116
|
-
const mod = await import("./count-
|
|
128
|
+
const mod = await import("./count-AMSEVDWR.js");
|
|
117
129
|
await mod.run(commandOptions);
|
|
118
130
|
break;
|
|
119
131
|
}
|
|
120
132
|
case "clear": {
|
|
121
|
-
const mod = await import("./clear-
|
|
133
|
+
const mod = await import("./clear-5SZVGYBX.js");
|
|
122
134
|
await mod.run(commandOptions);
|
|
123
135
|
break;
|
|
124
136
|
}
|
|
125
137
|
case "relate": {
|
|
126
|
-
const mod = await import("./relate-
|
|
138
|
+
const mod = await import("./relate-SGZLG7JU.js");
|
|
127
139
|
await mod.run(commandOptions);
|
|
128
140
|
break;
|
|
129
141
|
}
|
|
130
142
|
case "invalidate": {
|
|
131
|
-
const mod = await import("./invalidate-
|
|
143
|
+
const mod = await import("./invalidate-BY5VNFSE.js");
|
|
132
144
|
await mod.run(commandOptions);
|
|
133
145
|
break;
|
|
134
146
|
}
|
|
135
147
|
case "feedback": {
|
|
136
|
-
const mod = await import("./feedback-
|
|
148
|
+
const mod = await import("./feedback-XGBKFQXC.js");
|
|
137
149
|
await mod.run(commandOptions);
|
|
138
150
|
break;
|
|
139
151
|
}
|
|
140
152
|
case "working-memory": {
|
|
141
|
-
const mod = await import("./working-memory-
|
|
153
|
+
const mod = await import("./working-memory-UYVEJJYW.js");
|
|
142
154
|
await mod.run(commandOptions);
|
|
143
155
|
break;
|
|
144
156
|
}
|
|
145
157
|
case "maintain": {
|
|
146
|
-
const mod = await import("./maintain-
|
|
158
|
+
const mod = await import("./maintain-SGM56XKE.js");
|
|
147
159
|
await mod.run(commandOptions);
|
|
148
160
|
break;
|
|
149
161
|
}
|
|
150
162
|
case "compress": {
|
|
151
|
-
const mod = await import("./compress-
|
|
163
|
+
const mod = await import("./compress-YNY6YNFU.js");
|
|
152
164
|
await mod.run(commandOptions);
|
|
153
165
|
break;
|
|
154
166
|
}
|
|
155
167
|
case "status": {
|
|
156
|
-
const mod = await import("./status-
|
|
168
|
+
const mod = await import("./status-TVY32MZD.js");
|
|
157
169
|
await mod.run(commandOptions);
|
|
158
170
|
break;
|
|
159
171
|
}
|
|
160
172
|
case "init": {
|
|
161
|
-
const mod = await import("./init-
|
|
173
|
+
const mod = await import("./init-GRVRJ6RO.js");
|
|
162
174
|
await mod.run(commandOptions);
|
|
163
175
|
break;
|
|
164
176
|
}
|
|
165
177
|
case "reset": {
|
|
166
|
-
const mod = await import("./reset-
|
|
178
|
+
const mod = await import("./reset-CYY4KYAB.js");
|
|
167
179
|
await mod.run(commandOptions);
|
|
168
180
|
break;
|
|
169
181
|
}
|
|
@@ -172,6 +184,11 @@ async function main() {
|
|
|
172
184
|
await mod.run();
|
|
173
185
|
break;
|
|
174
186
|
}
|
|
187
|
+
case "sync": {
|
|
188
|
+
const mod = await import("./sync-WURX2HJZ.js");
|
|
189
|
+
await mod.run(commandOptions);
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
175
192
|
default:
|
|
176
193
|
outputError(`Unknown command: ${command}`, opts.format);
|
|
177
194
|
process.exitCode = 1;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
classifyTurn,
|
|
3
|
+
parseTranscriptContent
|
|
4
|
+
} from "./chunk-KR63XYFW.js";
|
|
5
|
+
import {
|
|
6
|
+
optionalOption
|
|
7
|
+
} from "./chunk-HXZ7MAT6.js";
|
|
8
|
+
import {
|
|
9
|
+
getDefaultUserId
|
|
10
|
+
} from "./chunk-TU5EHSDE.js";
|
|
11
|
+
import {
|
|
12
|
+
getEngine
|
|
13
|
+
} from "./chunk-2ZBEEETG.js";
|
|
14
|
+
import {
|
|
15
|
+
output,
|
|
16
|
+
outputError
|
|
17
|
+
} from "./chunk-ET6TNQOJ.js";
|
|
18
|
+
|
|
19
|
+
// src/commands/ingest.ts
|
|
20
|
+
import { readFileSync } from "fs";
|
|
21
|
+
function turnsToMemories(turns, userId, namespace, sessionShort) {
|
|
22
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
23
|
+
const memories = [];
|
|
24
|
+
for (let i = 0; i < turns.length; i++) {
|
|
25
|
+
const turn = turns[i];
|
|
26
|
+
if (turn.content.length < 20) continue;
|
|
27
|
+
const content = turn.content.length > 500 ? turn.content.slice(0, 497) + "..." : turn.content;
|
|
28
|
+
memories.push({
|
|
29
|
+
userId,
|
|
30
|
+
namespace: namespace ?? `session-${sessionShort}`,
|
|
31
|
+
memoryType: classifyTurn(turn),
|
|
32
|
+
content,
|
|
33
|
+
documentDate: now,
|
|
34
|
+
sourceId: `cc-${sessionShort}-${i}`,
|
|
35
|
+
confidence: turn.role === "user" ? 0.9 : 0.8
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return memories;
|
|
39
|
+
}
|
|
40
|
+
async function readStdin() {
|
|
41
|
+
const chunks = [];
|
|
42
|
+
for await (const chunk of process.stdin) {
|
|
43
|
+
chunks.push(chunk);
|
|
44
|
+
}
|
|
45
|
+
return Buffer.concat(chunks).toString("utf-8").trim();
|
|
46
|
+
}
|
|
47
|
+
async function run(options) {
|
|
48
|
+
const { args, format, db, noEmbeddings } = options;
|
|
49
|
+
const userId = optionalOption(args, "--user") ?? getDefaultUserId();
|
|
50
|
+
const file = optionalOption(args, "--file");
|
|
51
|
+
const namespace = optionalOption(args, "--namespace");
|
|
52
|
+
let content;
|
|
53
|
+
if (file) {
|
|
54
|
+
try {
|
|
55
|
+
content = readFileSync(file, "utf-8");
|
|
56
|
+
} catch (err) {
|
|
57
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
58
|
+
outputError(`Failed to read file: ${msg}`, format);
|
|
59
|
+
process.exitCode = 1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
content = await readStdin();
|
|
64
|
+
}
|
|
65
|
+
if (!content) {
|
|
66
|
+
outputError("No transcript content provided", format);
|
|
67
|
+
process.exitCode = 1;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const parsed = parseTranscriptContent(content);
|
|
71
|
+
const sessionShort = parsed.sessionId ? parsed.sessionId.slice(0, 8) : "unknown";
|
|
72
|
+
const memories = turnsToMemories(
|
|
73
|
+
parsed.turns,
|
|
74
|
+
userId,
|
|
75
|
+
namespace,
|
|
76
|
+
sessionShort
|
|
77
|
+
);
|
|
78
|
+
if (memories.length === 0) {
|
|
79
|
+
output({ stored: 0, message: "No memories extracted from transcript" }, format);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const engine = await getEngine({ db, noEmbeddings });
|
|
83
|
+
const stored = await engine.storeBatch(memories);
|
|
84
|
+
output(
|
|
85
|
+
{
|
|
86
|
+
stored: stored.length,
|
|
87
|
+
sessionId: parsed.sessionId || void 0,
|
|
88
|
+
namespace: namespace ?? `session-${sessionShort}`
|
|
89
|
+
},
|
|
90
|
+
format
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
run
|
|
95
|
+
};
|