@remnic/cli 9.45.1 → 9.45.2
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/index.js +22 -8
- package/package.json +29 -29
package/dist/index.js
CHANGED
|
@@ -259,6 +259,7 @@ import {
|
|
|
259
259
|
} from "@remnic/core/reconcile/plan.js";
|
|
260
260
|
import {
|
|
261
261
|
defaultConvergeCursorPath,
|
|
262
|
+
deriveConvergeCursorBase,
|
|
262
263
|
readConvergeCursor,
|
|
263
264
|
writeConvergeCursor
|
|
264
265
|
} from "@remnic/core/reconcile/cursor.js";
|
|
@@ -810,6 +811,7 @@ async function postPeerFileDeletion(peerUrl, namespace, filePath, baseSha256, to
|
|
|
810
811
|
}
|
|
811
812
|
async function computeConvergePlan(options = {}) {
|
|
812
813
|
const baseMap = /* @__PURE__ */ new Map();
|
|
814
|
+
const semanticAgreementMap = /* @__PURE__ */ new Map();
|
|
813
815
|
const namespacesToPlan = /* @__PURE__ */ new Set();
|
|
814
816
|
const localMap = /* @__PURE__ */ new Map();
|
|
815
817
|
const localTombstones = /* @__PURE__ */ new Map();
|
|
@@ -825,6 +827,12 @@ async function computeConvergePlan(options = {}) {
|
|
|
825
827
|
baseMap.set(ns, files);
|
|
826
828
|
}
|
|
827
829
|
}
|
|
830
|
+
if (options.semanticAgreementsByNamespace) {
|
|
831
|
+
for (const [ns, agreements] of options.semanticAgreementsByNamespace) {
|
|
832
|
+
namespacesToPlan.add(ns);
|
|
833
|
+
semanticAgreementMap.set(ns, agreements);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
828
836
|
if (options.localFilesByNamespace) {
|
|
829
837
|
for (const [ns, files] of options.localFilesByNamespace) {
|
|
830
838
|
namespacesToPlan.add(ns);
|
|
@@ -949,13 +957,16 @@ async function computeConvergePlan(options = {}) {
|
|
|
949
957
|
}
|
|
950
958
|
}
|
|
951
959
|
const memoryDir = options.cursorDir ?? config?.memoryDir;
|
|
952
|
-
if (
|
|
960
|
+
if (memoryDir && options.peerUrl && (!options.baseFilesByNamespace || !options.semanticAgreementsByNamespace)) {
|
|
953
961
|
for (const ns of namespacesToPlan) {
|
|
954
962
|
const cursorPath = defaultConvergeCursorPath(memoryDir, options.peerUrl, ns);
|
|
955
963
|
const cursor = await readConvergeCursor(cursorPath);
|
|
956
|
-
if (cursor?.baseFiles && cursor.baseFiles.length > 0) {
|
|
964
|
+
if (!options.baseFilesByNamespace && cursor?.baseFiles && cursor.baseFiles.length > 0) {
|
|
957
965
|
baseMap.set(ns, cursor.baseFiles);
|
|
958
966
|
}
|
|
967
|
+
if (!options.semanticAgreementsByNamespace && cursor?.semanticAgreements && cursor.semanticAgreements.length > 0) {
|
|
968
|
+
semanticAgreementMap.set(ns, cursor.semanticAgreements);
|
|
969
|
+
}
|
|
959
970
|
}
|
|
960
971
|
}
|
|
961
972
|
const inputs = [];
|
|
@@ -978,7 +989,7 @@ async function computeConvergePlan(options = {}) {
|
|
|
978
989
|
}
|
|
979
990
|
const conflictPolicy = options.conflictPolicy ?? config?.converge.conflictPolicy ?? DEFAULT_CONVERGE_CONFLICT_POLICY;
|
|
980
991
|
const plan = planReconciliation(inputs, { conflictPolicy });
|
|
981
|
-
return collapseActiveFactDuplicates(plan, localManifests, peerManifests);
|
|
992
|
+
return collapseActiveFactDuplicates(plan, localManifests, peerManifests, semanticAgreementMap);
|
|
982
993
|
}
|
|
983
994
|
async function executeConvergeApply(options = {}) {
|
|
984
995
|
const conflictPolicy = options.conflictPolicy ?? options.config?.converge.conflictPolicy ?? DEFAULT_CONVERGE_CONFLICT_POLICY;
|
|
@@ -1309,16 +1320,19 @@ async function updateCursorsForPlan(plan, options) {
|
|
|
1309
1320
|
const namespaces = new Set(plan.byNamespace.map((n) => n.namespace));
|
|
1310
1321
|
for (const ns of namespaces) {
|
|
1311
1322
|
const cursorPath = defaultConvergeCursorPath(memoryDir, peerUrl, ns);
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1323
|
+
const priorSemanticAgreements = options.semanticAgreementsByNamespace?.get(ns) ?? (await readConvergeCursor(cursorPath))?.semanticAgreements ?? [];
|
|
1324
|
+
const { baseFiles, semanticAgreements } = deriveConvergeCursorBase(
|
|
1325
|
+
plan.entries,
|
|
1326
|
+
ns,
|
|
1327
|
+
priorSemanticAgreements
|
|
1328
|
+
);
|
|
1316
1329
|
const cursorState = {
|
|
1317
1330
|
version: 1,
|
|
1318
1331
|
peerUrl,
|
|
1319
1332
|
namespace: ns,
|
|
1320
1333
|
lastConvergedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1321
|
-
baseFiles
|
|
1334
|
+
baseFiles,
|
|
1335
|
+
semanticAgreements
|
|
1322
1336
|
};
|
|
1323
1337
|
try {
|
|
1324
1338
|
await writeConvergeCursor(cursorPath, cursorState);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/cli",
|
|
3
|
-
"version": "9.45.
|
|
3
|
+
"version": "9.45.2",
|
|
4
4
|
"description": "CLI for Remnic memory — init, query, doctor, daemon management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"yaml": "^2.4.2",
|
|
29
|
-
"@remnic/server": "^9.45.
|
|
30
|
-
"@remnic/
|
|
31
|
-
"@remnic/
|
|
29
|
+
"@remnic/server": "^9.45.2",
|
|
30
|
+
"@remnic/core": "^9.45.2",
|
|
31
|
+
"@remnic/plugin-pi": "^9.45.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@remnic/bench": "^9.45.
|
|
35
|
-
"@remnic/export-weclone": "^9.45.
|
|
36
|
-
"@remnic/import-weclone": "^9.45.
|
|
37
|
-
"@remnic/import-chatgpt": "^9.45.
|
|
38
|
-
"@remnic/import-claude": "^9.45.
|
|
39
|
-
"@remnic/import-gemini": "^9.45.
|
|
40
|
-
"@remnic/import-lossless-claw": "^9.45.
|
|
41
|
-
"@remnic/import-mem0": "^9.45.
|
|
42
|
-
"@remnic/import-supermemory": "^9.45.
|
|
43
|
-
"@remnic/connector-limitless": "^9.45.
|
|
44
|
-
"@remnic/connector-bee": "^9.45.
|
|
45
|
-
"@remnic/connector-omi": "^9.45.
|
|
46
|
-
"@remnic/capture-audio": "^9.45.
|
|
34
|
+
"@remnic/bench": "^9.45.2",
|
|
35
|
+
"@remnic/export-weclone": "^9.45.2",
|
|
36
|
+
"@remnic/import-weclone": "^9.45.2",
|
|
37
|
+
"@remnic/import-chatgpt": "^9.45.2",
|
|
38
|
+
"@remnic/import-claude": "^9.45.2",
|
|
39
|
+
"@remnic/import-gemini": "^9.45.2",
|
|
40
|
+
"@remnic/import-lossless-claw": "^9.45.2",
|
|
41
|
+
"@remnic/import-mem0": "^9.45.2",
|
|
42
|
+
"@remnic/import-supermemory": "^9.45.2",
|
|
43
|
+
"@remnic/connector-limitless": "^9.45.2",
|
|
44
|
+
"@remnic/connector-bee": "^9.45.2",
|
|
45
|
+
"@remnic/connector-omi": "^9.45.2",
|
|
46
|
+
"@remnic/capture-audio": "^9.45.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@remnic/bench": {
|
|
@@ -89,18 +89,18 @@
|
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"tsup": "^8.5.1",
|
|
91
91
|
"typescript": "^5.9.3",
|
|
92
|
-
"@remnic/bench": "9.45.
|
|
93
|
-
"@remnic/export-weclone": "9.45.
|
|
94
|
-
"@remnic/import-
|
|
95
|
-
"@remnic/import-
|
|
96
|
-
"@remnic/import-
|
|
97
|
-
"@remnic/import-
|
|
98
|
-
"@remnic/import-
|
|
99
|
-
"@remnic/
|
|
100
|
-
"@remnic/import-
|
|
101
|
-
"@remnic/
|
|
102
|
-
"@remnic/connector-
|
|
103
|
-
"@remnic/connector-
|
|
92
|
+
"@remnic/bench": "9.45.2",
|
|
93
|
+
"@remnic/export-weclone": "9.45.2",
|
|
94
|
+
"@remnic/import-claude": "9.45.2",
|
|
95
|
+
"@remnic/import-gemini": "9.45.2",
|
|
96
|
+
"@remnic/import-weclone": "9.45.2",
|
|
97
|
+
"@remnic/import-lossless-claw": "9.45.2",
|
|
98
|
+
"@remnic/import-supermemory": "9.45.2",
|
|
99
|
+
"@remnic/connector-limitless": "9.45.2",
|
|
100
|
+
"@remnic/import-mem0": "9.45.2",
|
|
101
|
+
"@remnic/import-chatgpt": "9.45.2",
|
|
102
|
+
"@remnic/connector-omi": "9.45.2",
|
|
103
|
+
"@remnic/connector-bee": "9.45.2"
|
|
104
104
|
},
|
|
105
105
|
"license": "MIT",
|
|
106
106
|
"repository": {
|