@hanna84/mcp-writing 3.14.0 → 3.15.0
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/CHANGELOG.md +14 -0
- package/README.md +3 -2
- package/package.json +4 -1
- package/src/structure/chapter-indexing.js +58 -0
- package/src/structure/epigraph-indexing.js +110 -3
- package/src/structure/structure-diagnostics.js +361 -1
- package/src/structure/structure-export.js +17 -1
- package/src/structure/structure-restore.js +808 -0
- package/src/sync/sync.js +79 -10
- package/src/tools/editing.js +7 -3
- package/src/tools/metadata.js +100 -82
- package/src/tools/review-bundles.js +4 -4
- package/src/tools/search.js +7 -7
- package/src/tools/styleguide.js +2 -2
- package/src/tools/sync.js +40 -6
- package/src/workflows/workflow-catalogue.js +5 -4
|
@@ -45,6 +45,22 @@ function sha256(value) {
|
|
|
45
45
|
return crypto.createHash("sha256").update(value).digest("hex");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export function computeStructureChecksum(snapshot) {
|
|
49
|
+
const {
|
|
50
|
+
export: exportMetadata = {},
|
|
51
|
+
...rest
|
|
52
|
+
} = snapshot ?? {};
|
|
53
|
+
const {
|
|
54
|
+
structure_checksum: _structureChecksum,
|
|
55
|
+
...checksumExportMetadata
|
|
56
|
+
} = exportMetadata;
|
|
57
|
+
|
|
58
|
+
return sha256(stableStringify({
|
|
59
|
+
export: checksumExportMetadata,
|
|
60
|
+
...rest,
|
|
61
|
+
}, 0));
|
|
62
|
+
}
|
|
63
|
+
|
|
48
64
|
export function defaultStructureExportFileName(projectId) {
|
|
49
65
|
const slug = String(projectId ?? "project")
|
|
50
66
|
.toLowerCase()
|
|
@@ -173,7 +189,7 @@ export function buildStructureExport(db, { projectId, syncDir }) {
|
|
|
173
189
|
epigraphs,
|
|
174
190
|
};
|
|
175
191
|
|
|
176
|
-
const structureChecksum =
|
|
192
|
+
const structureChecksum = computeStructureChecksum(baseSnapshot);
|
|
177
193
|
return {
|
|
178
194
|
ok: true,
|
|
179
195
|
snapshot: {
|