@edihasaj/recall 2.0.17 → 2.0.19

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.
Files changed (81) hide show
  1. package/README.md +12 -0
  2. package/dist/{chunk-VUVFQJWZ.js → chunk-3SI2FCYS.js} +2 -2
  3. package/dist/{chunk-Q22B7YDQ.js → chunk-5VIPRV3V.js} +5 -5
  4. package/dist/{chunk-22AJZ7UQ.js → chunk-673NQIZX.js} +2 -2
  5. package/dist/{chunk-UDLRBKC3.js → chunk-6B7YHOGI.js} +3 -3
  6. package/dist/{chunk-YIVOTIDF.js → chunk-FH2XQDYL.js} +5 -5
  7. package/dist/{chunk-KLERXJ47.js → chunk-GENJNVHG.js} +3 -3
  8. package/dist/{chunk-2COJXGP4.js → chunk-GTHCX5LX.js} +4 -3
  9. package/dist/{chunk-2COJXGP4.js.map → chunk-GTHCX5LX.js.map} +1 -1
  10. package/dist/{chunk-EY6HIDG2.js → chunk-J4IWU2BE.js} +9 -9
  11. package/dist/{chunk-Q7254IPO.js → chunk-J6YBL72P.js} +193 -15
  12. package/dist/chunk-J6YBL72P.js.map +1 -0
  13. package/dist/{chunk-YIUBD27J.js → chunk-M4JG3HMA.js} +30 -37
  14. package/dist/chunk-M4JG3HMA.js.map +1 -0
  15. package/dist/{chunk-CSBXI3ET.js → chunk-NSXTH2B4.js} +8 -4
  16. package/dist/chunk-NSXTH2B4.js.map +1 -0
  17. package/dist/{chunk-ZT67CYDS.js → chunk-QDCIXULL.js} +2 -2
  18. package/dist/{chunk-ZT67CYDS.js.map → chunk-QDCIXULL.js.map} +1 -1
  19. package/dist/{chunk-FNIIUNW6.js → chunk-QDONEJJG.js} +2 -2
  20. package/dist/{chunk-QQ6YHR7I.js → chunk-R5CG3RC4.js} +231 -26
  21. package/dist/chunk-R5CG3RC4.js.map +1 -0
  22. package/dist/{chunk-KVZN35JF.js → chunk-WDUYM3NZ.js} +7 -7
  23. package/dist/{chunk-RAQT2OBR.js → chunk-WPHCCQOC.js} +7 -7
  24. package/dist/{chunk-GK7OWVRQ.js → chunk-X3EF5QHV.js} +3 -3
  25. package/dist/{chunk-XRKUJ5B4.js → chunk-ZHJRYVOD.js} +2 -2
  26. package/dist/{cleanup-4TXIHTJT.js → cleanup-FOGHMRL5.js} +11 -11
  27. package/dist/cli.js +39 -191
  28. package/dist/cli.js.map +1 -1
  29. package/dist/{codex-trust-2JIY66CP.js → codex-trust-C2GOV764.js} +4 -4
  30. package/dist/daemon.js +143 -39
  31. package/dist/daemon.js.map +1 -1
  32. package/dist/dispatcher-OIINFHQU.js +22 -0
  33. package/dist/{embeddings-AAS7NKGB.js → embeddings-6Y7KXV5L.js} +5 -5
  34. package/dist/ingest-QFX3ZEM6.js +20 -0
  35. package/dist/{keychain-SHRO7W6J.js → keychain-DHS6XKIQ.js} +3 -3
  36. package/dist/mcp.js +15 -15
  37. package/dist/{memory-value-R2C7ZSDF.js → memory-value-U6TGLBZB.js} +11 -11
  38. package/dist/{provenance-I5GIAP7N.js → provenance-PLISLH2V.js} +9 -9
  39. package/dist/quality-AYWNSDIU.js +25 -0
  40. package/dist/retrieval-B2DYBYAJ.js +15 -0
  41. package/dist/{store-X2B6MRBH.js → store-OLSM63EZ.js} +4 -4
  42. package/dist/sync-server.js +2 -2
  43. package/dist/{tasks-H4NIS6QO.js → tasks-S5ZMXA5K.js} +11 -11
  44. package/dist/{usage-35HSDMNT.js → usage-RWS6VQBY.js} +4 -4
  45. package/package.json +1 -1
  46. package/vendor/recall-cloud-sync/PROVENANCE.md +18 -5
  47. package/vendor/recall-cloud-sync/recall-sync-local.mjs +19 -10
  48. package/vendor/recall-cloud-sync/recall-sync.mjs +40 -6
  49. package/dist/chunk-CSBXI3ET.js.map +0 -1
  50. package/dist/chunk-Q7254IPO.js.map +0 -1
  51. package/dist/chunk-QQ6YHR7I.js.map +0 -1
  52. package/dist/chunk-YIUBD27J.js.map +0 -1
  53. package/dist/dispatcher-O6NGADCQ.js +0 -22
  54. package/dist/ingest-DW3AG4M5.js +0 -20
  55. package/dist/quality-32MAXPNJ.js +0 -25
  56. package/dist/retrieval-RKYWWNWC.js +0 -15
  57. /package/dist/{chunk-VUVFQJWZ.js.map → chunk-3SI2FCYS.js.map} +0 -0
  58. /package/dist/{chunk-Q22B7YDQ.js.map → chunk-5VIPRV3V.js.map} +0 -0
  59. /package/dist/{chunk-22AJZ7UQ.js.map → chunk-673NQIZX.js.map} +0 -0
  60. /package/dist/{chunk-UDLRBKC3.js.map → chunk-6B7YHOGI.js.map} +0 -0
  61. /package/dist/{chunk-YIVOTIDF.js.map → chunk-FH2XQDYL.js.map} +0 -0
  62. /package/dist/{chunk-KLERXJ47.js.map → chunk-GENJNVHG.js.map} +0 -0
  63. /package/dist/{chunk-EY6HIDG2.js.map → chunk-J4IWU2BE.js.map} +0 -0
  64. /package/dist/{chunk-FNIIUNW6.js.map → chunk-QDONEJJG.js.map} +0 -0
  65. /package/dist/{chunk-KVZN35JF.js.map → chunk-WDUYM3NZ.js.map} +0 -0
  66. /package/dist/{chunk-RAQT2OBR.js.map → chunk-WPHCCQOC.js.map} +0 -0
  67. /package/dist/{chunk-GK7OWVRQ.js.map → chunk-X3EF5QHV.js.map} +0 -0
  68. /package/dist/{chunk-XRKUJ5B4.js.map → chunk-ZHJRYVOD.js.map} +0 -0
  69. /package/dist/{cleanup-4TXIHTJT.js.map → cleanup-FOGHMRL5.js.map} +0 -0
  70. /package/dist/{codex-trust-2JIY66CP.js.map → codex-trust-C2GOV764.js.map} +0 -0
  71. /package/dist/{dispatcher-O6NGADCQ.js.map → dispatcher-OIINFHQU.js.map} +0 -0
  72. /package/dist/{embeddings-AAS7NKGB.js.map → embeddings-6Y7KXV5L.js.map} +0 -0
  73. /package/dist/{ingest-DW3AG4M5.js.map → ingest-QFX3ZEM6.js.map} +0 -0
  74. /package/dist/{keychain-SHRO7W6J.js.map → keychain-DHS6XKIQ.js.map} +0 -0
  75. /package/dist/{memory-value-R2C7ZSDF.js.map → memory-value-U6TGLBZB.js.map} +0 -0
  76. /package/dist/{provenance-I5GIAP7N.js.map → provenance-PLISLH2V.js.map} +0 -0
  77. /package/dist/{quality-32MAXPNJ.js.map → quality-AYWNSDIU.js.map} +0 -0
  78. /package/dist/{retrieval-RKYWWNWC.js.map → retrieval-B2DYBYAJ.js.map} +0 -0
  79. /package/dist/{store-X2B6MRBH.js.map → store-OLSM63EZ.js.map} +0 -0
  80. /package/dist/{tasks-H4NIS6QO.js.map → tasks-S5ZMXA5K.js.map} +0 -0
  81. /package/dist/{usage-35HSDMNT.js.map → usage-RWS6VQBY.js.map} +0 -0
@@ -0,0 +1,22 @@
1
+ import {
2
+ buildPrompt,
3
+ dispatchPendingTasks,
4
+ formatDispatchReport,
5
+ hasAnyLlmProvider
6
+ } from "./chunk-R5CG3RC4.js";
7
+ import "./chunk-ZHJRYVOD.js";
8
+ import "./chunk-WDUYM3NZ.js";
9
+ import "./chunk-6B7YHOGI.js";
10
+ import "./chunk-3SI2FCYS.js";
11
+ import "./chunk-NSXTH2B4.js";
12
+ import "./chunk-QDONEJJG.js";
13
+ import "./chunk-GENJNVHG.js";
14
+ import "./chunk-GTHCX5LX.js";
15
+ import "./chunk-QDCIXULL.js";
16
+ export {
17
+ buildPrompt,
18
+ dispatchPendingTasks,
19
+ formatDispatchReport,
20
+ hasAnyLlmProvider
21
+ };
22
+ //# sourceMappingURL=dispatcher-OIINFHQU.js.map
@@ -21,10 +21,10 @@ import {
21
21
  storeEmbedding,
22
22
  syncMemoryEmbedding,
23
23
  verifyEmbeddings
24
- } from "./chunk-CSBXI3ET.js";
25
- import "./chunk-FNIIUNW6.js";
26
- import "./chunk-2COJXGP4.js";
27
- import "./chunk-ZT67CYDS.js";
24
+ } from "./chunk-NSXTH2B4.js";
25
+ import "./chunk-QDONEJJG.js";
26
+ import "./chunk-GTHCX5LX.js";
27
+ import "./chunk-QDCIXULL.js";
28
28
  export {
29
29
  bootstrapEmbeddings,
30
30
  cosineSimilarity,
@@ -49,4 +49,4 @@ export {
49
49
  syncMemoryEmbedding,
50
50
  verifyEmbeddings
51
51
  };
52
- //# sourceMappingURL=embeddings-AAS7NKGB.js.map
52
+ //# sourceMappingURL=embeddings-6Y7KXV5L.js.map
@@ -0,0 +1,20 @@
1
+ import {
2
+ ingestMemoryExtraction,
3
+ ingestMemoryHeuristic,
4
+ mergeAndIngest,
5
+ safeIngestMemoryById
6
+ } from "./chunk-WDUYM3NZ.js";
7
+ import "./chunk-6B7YHOGI.js";
8
+ import "./chunk-3SI2FCYS.js";
9
+ import "./chunk-NSXTH2B4.js";
10
+ import "./chunk-QDONEJJG.js";
11
+ import "./chunk-GENJNVHG.js";
12
+ import "./chunk-GTHCX5LX.js";
13
+ import "./chunk-QDCIXULL.js";
14
+ export {
15
+ ingestMemoryExtraction,
16
+ ingestMemoryHeuristic,
17
+ mergeAndIngest,
18
+ safeIngestMemoryById
19
+ };
20
+ //# sourceMappingURL=ingest-QFX3ZEM6.js.map
@@ -8,8 +8,8 @@ import {
8
8
  listCredentials,
9
9
  setApiKey,
10
10
  setAzureConfig
11
- } from "./chunk-FNIIUNW6.js";
12
- import "./chunk-ZT67CYDS.js";
11
+ } from "./chunk-QDONEJJG.js";
12
+ import "./chunk-QDCIXULL.js";
13
13
  init_keychain();
14
14
  export {
15
15
  deleteApiKey,
@@ -21,4 +21,4 @@ export {
21
21
  setApiKey,
22
22
  setAzureConfig
23
23
  };
24
- //# sourceMappingURL=keychain-SHRO7W6J.js.map
24
+ //# sourceMappingURL=keychain-DHS6XKIQ.js.map
package/dist/mcp.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  createRecallMcpServer
3
- } from "./chunk-EY6HIDG2.js";
4
- import "./chunk-Q22B7YDQ.js";
5
- import "./chunk-Q7254IPO.js";
6
- import "./chunk-QQ6YHR7I.js";
7
- import "./chunk-RAQT2OBR.js";
8
- import "./chunk-XRKUJ5B4.js";
9
- import "./chunk-22AJZ7UQ.js";
10
- import "./chunk-KVZN35JF.js";
11
- import "./chunk-UDLRBKC3.js";
12
- import "./chunk-VUVFQJWZ.js";
13
- import "./chunk-CSBXI3ET.js";
14
- import "./chunk-FNIIUNW6.js";
15
- import "./chunk-KLERXJ47.js";
16
- import "./chunk-2COJXGP4.js";
3
+ } from "./chunk-J4IWU2BE.js";
4
+ import "./chunk-5VIPRV3V.js";
5
+ import "./chunk-J6YBL72P.js";
6
+ import "./chunk-R5CG3RC4.js";
7
+ import "./chunk-WPHCCQOC.js";
8
+ import "./chunk-ZHJRYVOD.js";
9
+ import "./chunk-673NQIZX.js";
10
+ import "./chunk-WDUYM3NZ.js";
11
+ import "./chunk-6B7YHOGI.js";
12
+ import "./chunk-3SI2FCYS.js";
13
+ import "./chunk-NSXTH2B4.js";
14
+ import "./chunk-QDONEJJG.js";
15
+ import "./chunk-GENJNVHG.js";
16
+ import "./chunk-GTHCX5LX.js";
17
17
  import {
18
18
  init_define_RECALL_BUILD_INFO
19
- } from "./chunk-ZT67CYDS.js";
19
+ } from "./chunk-QDCIXULL.js";
20
20
 
21
21
  // src/mcp/server.ts
22
22
  init_define_RECALL_BUILD_INFO();
@@ -10,16 +10,16 @@ import {
10
10
  recordInjectionValueEvents,
11
11
  recordMemoryValueEvent,
12
12
  recordOutcomeValueEvent
13
- } from "./chunk-RAQT2OBR.js";
14
- import "./chunk-XRKUJ5B4.js";
15
- import "./chunk-KVZN35JF.js";
16
- import "./chunk-UDLRBKC3.js";
17
- import "./chunk-VUVFQJWZ.js";
18
- import "./chunk-CSBXI3ET.js";
19
- import "./chunk-FNIIUNW6.js";
20
- import "./chunk-KLERXJ47.js";
21
- import "./chunk-2COJXGP4.js";
22
- import "./chunk-ZT67CYDS.js";
13
+ } from "./chunk-WPHCCQOC.js";
14
+ import "./chunk-ZHJRYVOD.js";
15
+ import "./chunk-WDUYM3NZ.js";
16
+ import "./chunk-6B7YHOGI.js";
17
+ import "./chunk-3SI2FCYS.js";
18
+ import "./chunk-NSXTH2B4.js";
19
+ import "./chunk-QDONEJJG.js";
20
+ import "./chunk-GENJNVHG.js";
21
+ import "./chunk-GTHCX5LX.js";
22
+ import "./chunk-QDCIXULL.js";
23
23
  export {
24
24
  backfillMemoryValueEvents,
25
25
  computeMemoryValueReport,
@@ -33,4 +33,4 @@ export {
33
33
  recordMemoryValueEvent,
34
34
  recordOutcomeValueEvent
35
35
  };
36
- //# sourceMappingURL=memory-value-R2C7ZSDF.js.map
36
+ //# sourceMappingURL=memory-value-U6TGLBZB.js.map
@@ -3,21 +3,21 @@ import {
3
3
  hasNonDurableProvenance,
4
4
  queryMemories,
5
5
  recordAuditWithSnapshot
6
- } from "./chunk-KVZN35JF.js";
7
- import "./chunk-UDLRBKC3.js";
8
- import "./chunk-VUVFQJWZ.js";
6
+ } from "./chunk-WDUYM3NZ.js";
7
+ import "./chunk-6B7YHOGI.js";
8
+ import "./chunk-3SI2FCYS.js";
9
9
  import {
10
10
  queueMemoryEmbeddingSync
11
- } from "./chunk-CSBXI3ET.js";
12
- import "./chunk-FNIIUNW6.js";
13
- import "./chunk-KLERXJ47.js";
11
+ } from "./chunk-NSXTH2B4.js";
12
+ import "./chunk-QDONEJJG.js";
13
+ import "./chunk-GENJNVHG.js";
14
14
  import {
15
15
  eq,
16
16
  memories
17
- } from "./chunk-2COJXGP4.js";
17
+ } from "./chunk-GTHCX5LX.js";
18
18
  import {
19
19
  init_define_RECALL_BUILD_INFO
20
- } from "./chunk-ZT67CYDS.js";
20
+ } from "./chunk-QDCIXULL.js";
21
21
 
22
22
  // src/maintenance/provenance.ts
23
23
  init_define_RECALL_BUILD_INFO();
@@ -47,4 +47,4 @@ function quarantineGeneratedMemories(db, apply = false) {
47
47
  export {
48
48
  quarantineGeneratedMemories
49
49
  };
50
- //# sourceMappingURL=provenance-I5GIAP7N.js.map
50
+ //# sourceMappingURL=provenance-PLISLH2V.js.map
@@ -0,0 +1,25 @@
1
+ import {
2
+ computeQualityReport,
3
+ diffQualitySnapshots,
4
+ formatQualityReport,
5
+ listQualitySnapshots,
6
+ recordQualitySnapshot
7
+ } from "./chunk-FH2XQDYL.js";
8
+ import "./chunk-WPHCCQOC.js";
9
+ import "./chunk-ZHJRYVOD.js";
10
+ import "./chunk-WDUYM3NZ.js";
11
+ import "./chunk-6B7YHOGI.js";
12
+ import "./chunk-3SI2FCYS.js";
13
+ import "./chunk-NSXTH2B4.js";
14
+ import "./chunk-QDONEJJG.js";
15
+ import "./chunk-GENJNVHG.js";
16
+ import "./chunk-GTHCX5LX.js";
17
+ import "./chunk-QDCIXULL.js";
18
+ export {
19
+ computeQualityReport,
20
+ diffQualitySnapshots,
21
+ formatQualityReport,
22
+ listQualitySnapshots,
23
+ recordQualitySnapshot
24
+ };
25
+ //# sourceMappingURL=quality-AYWNSDIU.js.map
@@ -0,0 +1,15 @@
1
+ import {
2
+ graphQuery
3
+ } from "./chunk-5VIPRV3V.js";
4
+ import "./chunk-WDUYM3NZ.js";
5
+ import "./chunk-6B7YHOGI.js";
6
+ import "./chunk-3SI2FCYS.js";
7
+ import "./chunk-NSXTH2B4.js";
8
+ import "./chunk-QDONEJJG.js";
9
+ import "./chunk-GENJNVHG.js";
10
+ import "./chunk-GTHCX5LX.js";
11
+ import "./chunk-QDCIXULL.js";
12
+ export {
13
+ graphQuery
14
+ };
15
+ //# sourceMappingURL=retrieval-B2DYBYAJ.js.map
@@ -12,9 +12,9 @@ import {
12
12
  neighborsOf,
13
13
  upsertEntity,
14
14
  upsertRelation
15
- } from "./chunk-KLERXJ47.js";
16
- import "./chunk-2COJXGP4.js";
17
- import "./chunk-ZT67CYDS.js";
15
+ } from "./chunk-GENJNVHG.js";
16
+ import "./chunk-GTHCX5LX.js";
17
+ import "./chunk-QDCIXULL.js";
18
18
  export {
19
19
  clearGraph,
20
20
  countEntities,
@@ -30,4 +30,4 @@ export {
30
30
  upsertEntity,
31
31
  upsertRelation
32
32
  };
33
- //# sourceMappingURL=store-X2B6MRBH.js.map
33
+ //# sourceMappingURL=store-OLSM63EZ.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Sentry
3
- } from "./chunk-22AJZ7UQ.js";
3
+ } from "./chunk-673NQIZX.js";
4
4
  import {
5
5
  init_define_RECALL_BUILD_INFO
6
- } from "./chunk-ZT67CYDS.js";
6
+ } from "./chunk-QDCIXULL.js";
7
7
 
8
8
  // src/sync/server.ts
9
9
  init_define_RECALL_BUILD_INFO();
@@ -32,16 +32,16 @@ import {
32
32
  submitTask,
33
33
  sweepExpiredLeases,
34
34
  targetKey
35
- } from "./chunk-QQ6YHR7I.js";
36
- import "./chunk-XRKUJ5B4.js";
37
- import "./chunk-KVZN35JF.js";
38
- import "./chunk-UDLRBKC3.js";
39
- import "./chunk-VUVFQJWZ.js";
40
- import "./chunk-CSBXI3ET.js";
41
- import "./chunk-FNIIUNW6.js";
42
- import "./chunk-KLERXJ47.js";
43
- import "./chunk-2COJXGP4.js";
44
- import "./chunk-ZT67CYDS.js";
35
+ } from "./chunk-R5CG3RC4.js";
36
+ import "./chunk-ZHJRYVOD.js";
37
+ import "./chunk-WDUYM3NZ.js";
38
+ import "./chunk-6B7YHOGI.js";
39
+ import "./chunk-3SI2FCYS.js";
40
+ import "./chunk-NSXTH2B4.js";
41
+ import "./chunk-QDONEJJG.js";
42
+ import "./chunk-GENJNVHG.js";
43
+ import "./chunk-GTHCX5LX.js";
44
+ import "./chunk-QDCIXULL.js";
45
45
  export {
46
46
  DEFAULT_ENQUEUE_CONFIG,
47
47
  DEFAULT_LEASE_SECONDS,
@@ -77,4 +77,4 @@ export {
77
77
  sweepExpiredLeases,
78
78
  targetKey
79
79
  };
80
- //# sourceMappingURL=tasks-H4NIS6QO.js.map
80
+ //# sourceMappingURL=tasks-S5ZMXA5K.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  desc
3
- } from "./chunk-UDLRBKC3.js";
3
+ } from "./chunk-6B7YHOGI.js";
4
4
  import {
5
5
  gte,
6
6
  llmUsage,
7
7
  sql
8
- } from "./chunk-2COJXGP4.js";
8
+ } from "./chunk-GTHCX5LX.js";
9
9
  import {
10
10
  init_define_RECALL_BUILD_INFO
11
- } from "./chunk-ZT67CYDS.js";
11
+ } from "./chunk-QDCIXULL.js";
12
12
 
13
13
  // src/llm/usage.ts
14
14
  init_define_RECALL_BUILD_INFO();
@@ -105,4 +105,4 @@ export {
105
105
  formatUsageReport,
106
106
  summarizeUsage
107
107
  };
108
- //# sourceMappingURL=usage-35HSDMNT.js.map
108
+ //# sourceMappingURL=usage-RWS6VQBY.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edihasaj/recall",
3
- "version": "2.0.17",
3
+ "version": "2.0.19",
4
4
  "description": "Cross-tool coding memory and instruction compiler",
5
5
  "license": "MIT",
6
6
  "homepage": "https://recallmemory.dev/",
@@ -3,18 +3,31 @@
3
3
  Bundled so Recall can run optional cloud sync inside its own daemon, without the
4
4
  separate `Recall Cloud Sync` helper, LaunchAgent or `~/.recall-cloud-sync` install.
5
5
 
6
- ## Upstream files (byte-identical copies, do not edit here)
6
+ ## Upstream snapshot and reviewed backports
7
7
 
8
8
  Source: `recall-cloud` repository, `scripts/`, commit `6ad7bfe921ca5d5aab53c95c464664ae57a8d2f3` (2026-10-12).
9
9
 
10
+ The two sync modules include the October 28, 2026 privacy-verification backport
11
+ from `recall-cloud/scripts`, commit `218a03d`: transactional failure on invalid encrypted payloads,
12
+ key verification before upload, and a full encrypted pull on watcher restart.
13
+ The upload projection also backports optional note-column selection from
14
+ upstream `13b0b58` without importing unrelated installer and outcome changes.
15
+ The token module remains byte-identical to the original snapshot. Maintain
16
+ changes upstream first, then apply the focused backport; do not develop a second
17
+ sync engine here.
18
+
10
19
  | File | sha256 |
11
20
  |---|---|
12
- | `recall-sync.mjs` | `01e5fb2dad66d86ee8c4de126c3efddc4553d86506ce2d7b9c20eb5e6cef5c19` |
13
- | `recall-sync-local.mjs` | `084ad070f468924e5cb9a32c5b6fb7d9d2ea8c3f347838d4360cc1a7cef62e7a` |
21
+ | `recall-sync.mjs` | `4c1404f91144e03a6d75038776ec2c976f696a89cfcc560d086d2540593b2223` |
22
+ | `recall-sync-local.mjs` | `d2b4d1172fc1e39be52fac1eb4fc8b64cb5ae83969e70944188fde4406c7cadb` |
14
23
  | `private-token.mjs` | `4450e12ccf9509d33bf65cb7ef084d059a96898e0bef1adc438b14cf37eb484d` |
15
24
 
16
- To update, copy the three files from `recall-cloud/scripts/`, update the commit and
17
- hashes above, and run `npx vitest run test/cloud-packaging.test.ts`.
25
+ To refresh the complete snapshot, stage the upstream module graph together,
26
+ including any new relative imports, update the commit and hashes above, and
27
+ run `npx vitest run test/cloud-packaging.test.ts`. For a focused backport, keep
28
+ its source and scope here. The upstream `scripts/recall-sync-private.test.mjs`
29
+ also runs against this engine by setting `RECALL_SYNC_ENGINE` to its absolute
30
+ path, exercising actual HTTP push/pull, restore, key failure and retry safety.
18
31
 
19
32
  ## Recall-authored
20
33
 
@@ -196,20 +196,29 @@ function isExpiredRejectedTombstone(row, retentionDays, now) {
196
196
  return updatedMs < now - retentionDays * 86_400_000;
197
197
  }
198
198
 
199
+ export function decryptCloudPayload(record, e2ee, decrypt) {
200
+ try {
201
+ if (!record.contentCiphertext || !record.contentNonce || !decrypt) throw new Error();
202
+ const payload = JSON.parse(decrypt(e2ee.key, record.contentCiphertext, record.contentNonce));
203
+ if (!payload || typeof payload.text !== "string" || !payload.text.trim()
204
+ || !payload.recall || typeof payload.recall !== "object" || Array.isArray(payload.recall)) {
205
+ throw new Error();
206
+ }
207
+ return payload;
208
+ } catch {
209
+ // Do not leak crypto errors, record contents, or keys to engine logs.
210
+ throw new Error("E2EE verification failed. Check the original passphrase; encrypted data may also be damaged. Sync was stopped.");
211
+ }
212
+ }
213
+
199
214
  function cloudRecordToLocalRow(record, { deviceId, e2ee, decrypt, deviceAliases }) {
200
215
  let text = record.contentPlaintext;
201
216
  let metadata = record.metadata && typeof record.metadata === "object" ? record.metadata : {};
202
217
  if (record.encryptionMode === "e2ee") {
203
- if (!e2ee || !decrypt || !record.contentCiphertext || !record.contentNonce) return null;
204
- try {
205
- const payload = JSON.parse(
206
- decrypt(e2ee.key, record.contentCiphertext, record.contentNonce)
207
- );
208
- text = payload.text;
209
- metadata = { ...metadata, recall: payload.recall };
210
- } catch {
211
- return null;
212
- }
218
+ if (!e2ee) return null;
219
+ const payload = decryptCloudPayload(record, e2ee, decrypt);
220
+ text = payload.text;
221
+ metadata = { ...metadata, recall: payload.recall };
213
222
  }
214
223
  if (typeof text !== "string" || !text.trim()) return null;
215
224
 
@@ -14,6 +14,7 @@ import { dirname, join, resolve } from "node:path";
14
14
  import { fileURLToPath, pathToFileURL } from "node:url";
15
15
  import {
16
16
  applyPulledRecords,
17
+ decryptCloudPayload,
17
18
  canonicalExternalId,
18
19
  cloudExternalIdForRow
19
20
  } from "./recall-sync-local.mjs";
@@ -160,7 +161,7 @@ async function main() {
160
161
  }
161
162
  }
162
163
 
163
- async function push(options) {
164
+ async function push(options, { verifiedE2ee = false } = {}) {
164
165
  const api = requiredApi(options.api ?? process.env.RECALL_CLOUD_API);
165
166
  const token = resolveToken(options);
166
167
  const dbPath = resolve(expandHome(options.db ?? process.env.RECALL_DB ?? DEFAULT_DB));
@@ -189,6 +190,10 @@ async function push(options) {
189
190
  return;
190
191
  }
191
192
 
193
+ // A mistyped key on a new device must not overwrite existing ciphertext.
194
+ // Watch verifies through its preceding pull; standalone push verifies here.
195
+ if (e2ee && !verifiedE2ee) await verifyRemoteEncryption(api, token, e2ee);
196
+
192
197
  let accepted = 0;
193
198
  // Rows the server actually wrote. `accepted` only counts records that
194
199
  // survived the ACL filter; the updated_at guard can still drop stale ones,
@@ -436,16 +441,31 @@ async function watch(options) {
436
441
  process.on("SIGINT", () => stop("SIGINT"));
437
442
  process.on("SIGTERM", () => stop("SIGTERM"));
438
443
 
444
+ const privateSync = resolveE2ee(loopOptions);
445
+ let needsKeyVerification = Boolean(privateSync);
439
446
  while (running) {
440
447
  try {
441
448
  const lastFullMs = Date.parse(String(cursor.fullReconciledAt ?? ""));
442
- const fullReconcile = !Number.isFinite(lastFullMs)
449
+ const fullReconcile = needsKeyVerification || !Number.isFinite(lastFullMs)
443
450
  || Date.now() - lastFullMs >= fullReconcileSeconds * 1000;
451
+ // Verify/import encrypted data before any upload, even with saved cursors.
452
+ // Failed decryption rolls back the pull and never advances its cursor.
453
+ if (privateSync) {
454
+ // Key verification must not inherit the user's incremental batch limit.
455
+ if (needsKeyVerification) await retryTransientSync(() => verifyRemoteEncryption(api, token, privateSync));
456
+ const verified = await retryTransientSync(() => retrySqliteBusy(() => pull({
457
+ ...loopOptions,
458
+ since: fullReconcile ? undefined : cursor.pull?.updatedAt,
459
+ sinceId: fullReconcile ? undefined : cursor.pull?.id
460
+ })));
461
+ if (verified.cursor) cursor.pull = verified.cursor;
462
+ needsKeyVerification = false;
463
+ }
444
464
  const pushResult = await retryTransientSync(() => push({
445
465
  ...loopOptions,
446
466
  after: fullReconcile ? undefined : cursor.push?.updatedAt,
447
467
  afterId: fullReconcile ? undefined : cursor.push?.id
448
- }));
468
+ }, { verifiedE2ee: Boolean(privateSync) }));
449
469
  if (pushResult?.cursor) cursor.push = pushResult.cursor;
450
470
  state.entries[stateKey] = cursor;
451
471
  saveSyncState(statePath, state);
@@ -933,6 +953,8 @@ function readRecallMemories(dbPath, statusSet, limit, cursor = {}) {
933
953
  const db = new Database(dbPath, { readonly: true, fileMustExist: true });
934
954
  try {
935
955
  db.pragma("query_only = ON");
956
+ const columns = new Set(db.prepare("PRAGMA table_info(memories)").all().map((column) => column.name));
957
+ const note = columns.has("note") ? ", note" : "";
936
958
  const placeholders = [...statusSet].map(() => "?").join(",");
937
959
  const cursorClause = cursor.after
938
960
  ? "AND (updated_at > ? OR (updated_at = ? AND id > ?))"
@@ -947,7 +969,7 @@ function readRecallMemories(dbPath, statusSet, limit, cursor = {}) {
947
969
  id, type, text, scope, path_scope, repo, status, confidence, source,
948
970
  evidence, capture_context, supersedes, created_at, updated_at,
949
971
  last_validated_at, last_injected_at, injection_count, override_count,
950
- repetition_count, team_id, sync_version, auto_inject, dedupe_key
972
+ repetition_count, team_id, sync_version, auto_inject, dedupe_key${note}
951
973
  FROM memories
952
974
  WHERE status IN (${placeholders})
953
975
  ${cursorClause}
@@ -1054,6 +1076,14 @@ function toCloudRecord(row, deviceId, e2ee = null, deviceAliases = {}) {
1054
1076
  };
1055
1077
  }
1056
1078
 
1079
+ async function verifyRemoteEncryption(api, token, e2ee) {
1080
+ const remote = await fetchAllSyncRecords({ api, token, max: 100001 });
1081
+ if (remote.length > 100000) throw new Error("E2EE verification exceeded the safe record limit; sync was stopped.");
1082
+ for (const record of remote) {
1083
+ if (record.encryptionMode === "e2ee") decryptCloudPayload(record, e2ee, e2eeDecrypt);
1084
+ }
1085
+ }
1086
+
1057
1087
  async function fetchAllSyncRecords({ api, token, since = null, sinceId = null, max = 100000 }) {
1058
1088
  const all = [];
1059
1089
  let cursorTime = since ?? null;
@@ -1066,11 +1096,14 @@ async function fetchAllSyncRecords({ api, token, since = null, sinceId = null, m
1066
1096
  token,
1067
1097
  body: { since: cursorTime, sinceId: cursorId, limit: pageSize }
1068
1098
  });
1069
- const batch = Array.isArray(result.records) ? result.records : [];
1099
+ if (!Array.isArray(result.records)) throw new Error("Invalid Cloud sync response: records are missing");
1100
+ const batch = result.records;
1070
1101
  if (batch.length === 0) break;
1071
1102
  all.push(...batch);
1072
1103
  const last = batch[batch.length - 1];
1073
- if (!last?.updatedAt || !last?.externalId || batch.length < pageSize) break;
1104
+ if (!last?.updatedAt || !last?.externalId) throw new Error("Invalid Cloud sync response: cursor is missing");
1105
+ if (batch.length < pageSize) break;
1106
+ if (last.updatedAt === cursorTime && last.externalId === cursorId) throw new Error("Invalid Cloud sync response: cursor did not advance");
1074
1107
  cursorTime = last.updatedAt;
1075
1108
  cursorId = last.externalId;
1076
1109
  }
@@ -1093,6 +1126,7 @@ async function fetchJson(url, { method, token, body }) {
1093
1126
  try {
1094
1127
  const parsed = text ? JSON.parse(text) : {};
1095
1128
  if (typeof parsed.error === "string") detail = parsed.error;
1129
+ else if (typeof parsed.detail === "string") detail = parsed.detail;
1096
1130
  } catch {
1097
1131
  // HTML proxy errors are intentionally not echoed into long-lived logs.
1098
1132
  }