@remnic/cli 1.0.14 → 1.0.15
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 +13 -9
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -97,6 +97,7 @@ import {
|
|
|
97
97
|
offlineSyncStateFromSnapshot,
|
|
98
98
|
readOfflineSyncState,
|
|
99
99
|
summarizeOfflineSyncChangeset,
|
|
100
|
+
summarizeOfflineSyncPendingChanges,
|
|
100
101
|
writeOfflineSyncState,
|
|
101
102
|
buildActionConfidenceInputFromOptions,
|
|
102
103
|
evaluateActionConfidence,
|
|
@@ -6882,14 +6883,16 @@ function isMissingOfflineContentError(error) {
|
|
|
6882
6883
|
return /^missing decoded content for /.test(message);
|
|
6883
6884
|
}
|
|
6884
6885
|
async function hydrateOfflineSnapshotContent(args) {
|
|
6886
|
+
const snapshot = normalizeOfflineSyncSnapshot(args.snapshot);
|
|
6885
6887
|
const neededFiles = offlineSnapshotContentFilesForApply({
|
|
6886
|
-
snapshot
|
|
6888
|
+
snapshot,
|
|
6887
6889
|
baseFiles: args.baseFiles,
|
|
6888
6890
|
currentFiles: args.currentFiles
|
|
6889
6891
|
});
|
|
6890
|
-
if (neededFiles.length === 0) return args.snapshot;
|
|
6891
|
-
const expectedByPath = new Map(
|
|
6892
|
+
if (neededFiles.length === 0) return { ...args.snapshot, files: snapshot.files };
|
|
6893
|
+
const expectedByPath = new Map(snapshot.files.map((file) => [file.path, file]));
|
|
6892
6894
|
const contentByPath = /* @__PURE__ */ new Map();
|
|
6895
|
+
const updatedByPath = /* @__PURE__ */ new Map();
|
|
6893
6896
|
try {
|
|
6894
6897
|
for (const batch of chunkOfflineFileContentBatches(neededFiles)) {
|
|
6895
6898
|
const partial = await fetchOfflineFiles({
|
|
@@ -6902,12 +6905,12 @@ async function hydrateOfflineSnapshotContent(args) {
|
|
|
6902
6905
|
for (const file of partial.files) {
|
|
6903
6906
|
const expected = expectedByPath.get(file.path);
|
|
6904
6907
|
if (!expected) continue;
|
|
6905
|
-
if (file.sha256 !== expected.sha256 || file.bytes !== expected.bytes) {
|
|
6906
|
-
throw new Error(`remote file changed while fetching offline content: ${file.path}`);
|
|
6907
|
-
}
|
|
6908
6908
|
if (typeof file.contentBase64 !== "string") {
|
|
6909
6909
|
throw new Error(`remote offline content response omitted contentBase64 for ${file.path}`);
|
|
6910
6910
|
}
|
|
6911
|
+
if (file.sha256 !== expected.sha256 || file.bytes !== expected.bytes || file.mtimeMs !== expected.mtimeMs) {
|
|
6912
|
+
updatedByPath.set(file.path, file);
|
|
6913
|
+
}
|
|
6911
6914
|
contentByPath.set(file.path, file.contentBase64);
|
|
6912
6915
|
}
|
|
6913
6916
|
}
|
|
@@ -6929,7 +6932,9 @@ async function hydrateOfflineSnapshotContent(args) {
|
|
|
6929
6932
|
}
|
|
6930
6933
|
return {
|
|
6931
6934
|
...args.snapshot,
|
|
6932
|
-
files:
|
|
6935
|
+
files: snapshot.files.map((file) => {
|
|
6936
|
+
const updated = updatedByPath.get(file.path);
|
|
6937
|
+
if (updated) return updated;
|
|
6933
6938
|
const contentBase64 = contentByPath.get(file.path);
|
|
6934
6939
|
return contentBase64 === void 0 ? file : { ...file, contentBase64 };
|
|
6935
6940
|
})
|
|
@@ -7273,14 +7278,13 @@ Environment fallbacks:
|
|
|
7273
7278
|
});
|
|
7274
7279
|
}
|
|
7275
7280
|
const storageIo = await createOfflineStorageIo(memoryDir);
|
|
7276
|
-
const
|
|
7281
|
+
const summary = await summarizeOfflineSyncPendingChanges({
|
|
7277
7282
|
root: memoryDir,
|
|
7278
7283
|
sourceId: localOfflineSourceId(memoryDir),
|
|
7279
7284
|
baseFiles: state?.baseFiles ?? [],
|
|
7280
7285
|
includeTranscripts,
|
|
7281
7286
|
readFile: storageIo.readFile
|
|
7282
7287
|
});
|
|
7283
|
-
const summary = summarizeOfflineSyncChangeset(changeset);
|
|
7284
7288
|
if (json) {
|
|
7285
7289
|
console.log(JSON.stringify({ statePath: statePath ?? null, state, pending: summary }, null, 2));
|
|
7286
7290
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "CLI for Remnic memory — init, query, doctor, daemon management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"yaml": "^2.4.2",
|
|
29
|
-
"@remnic/plugin-pi": "^1.0.
|
|
29
|
+
"@remnic/plugin-pi": "^1.0.1",
|
|
30
30
|
"@remnic/server": "^1.0.5",
|
|
31
|
-
"@remnic/core": "^1.1.
|
|
31
|
+
"@remnic/core": "^1.1.21"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@remnic/bench": "^1.0.0",
|