@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.
@@ -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 = sha256(stableStringify(baseSnapshot, 0));
192
+ const structureChecksum = computeStructureChecksum(baseSnapshot);
177
193
  return {
178
194
  ok: true,
179
195
  snapshot: {