@unbrained/pm-cli 2026.5.29 → 2026.5.31

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 (274) hide show
  1. package/CHANGELOG.md +54 -12
  2. package/dist/cli/bootstrap-args.d.ts +1 -1
  3. package/dist/cli/bootstrap-args.js +59 -9
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commands/activity.js +4 -4
  6. package/dist/cli/commands/activity.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +83 -11
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close.js +4 -4
  10. package/dist/cli/commands/close.js.map +1 -1
  11. package/dist/cli/commands/completion.js +4 -4
  12. package/dist/cli/commands/completion.js.map +1 -1
  13. package/dist/cli/commands/create.js +50 -7
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/deps.js +4 -4
  16. package/dist/cli/commands/deps.js.map +1 -1
  17. package/dist/cli/commands/extension/install-sources.d.ts +3 -0
  18. package/dist/cli/commands/extension/install-sources.js +29 -4
  19. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  20. package/dist/cli/commands/extension.js +26 -5
  21. package/dist/cli/commands/extension.js.map +1 -1
  22. package/dist/cli/commands/get.js +6 -3
  23. package/dist/cli/commands/get.js.map +1 -1
  24. package/dist/cli/commands/list.js +25 -6
  25. package/dist/cli/commands/list.js.map +1 -1
  26. package/dist/cli/commands/reindex.js +3 -3
  27. package/dist/cli/commands/reindex.js.map +1 -1
  28. package/dist/cli/commands/search.d.ts +17 -0
  29. package/dist/cli/commands/search.js +40 -10
  30. package/dist/cli/commands/search.js.map +1 -1
  31. package/dist/cli/commands/stats.js +4 -4
  32. package/dist/cli/commands/stats.js.map +1 -1
  33. package/dist/cli/commands/test-all.js +4 -4
  34. package/dist/cli/commands/test-all.js.map +1 -1
  35. package/dist/cli/main.d.ts +2 -0
  36. package/dist/cli/main.js +39 -11
  37. package/dist/cli/main.js.map +1 -1
  38. package/dist/cli/register-list-query.js +10 -12
  39. package/dist/cli/register-list-query.js.map +1 -1
  40. package/dist/cli/register-mutation.js +20 -22
  41. package/dist/cli/register-mutation.js.map +1 -1
  42. package/dist/cli/register-operations.js +32 -25
  43. package/dist/cli/register-operations.js.map +1 -1
  44. package/dist/cli/register-setup.js +7 -9
  45. package/dist/cli/register-setup.js.map +1 -1
  46. package/dist/cli/registration-helpers.js +6 -3
  47. package/dist/cli/registration-helpers.js.map +1 -1
  48. package/dist/cli/search-refresh.d.ts +2 -0
  49. package/dist/cli/search-refresh.js +13 -0
  50. package/dist/cli/search-refresh.js.map +1 -0
  51. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +17 -0
  52. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js.map +7 -0
  53. package/dist/cli-bundle/chunks/aggregate-ADUOSFRO.js +209 -0
  54. package/dist/cli-bundle/chunks/aggregate-ADUOSFRO.js.map +7 -0
  55. package/dist/cli-bundle/chunks/append-JD2DETU7.js +73 -0
  56. package/dist/cli-bundle/chunks/append-JD2DETU7.js.map +7 -0
  57. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js +27 -0
  58. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js.map +7 -0
  59. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js +1636 -0
  60. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +7 -0
  61. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +189 -0
  62. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +7 -0
  63. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js +330 -0
  64. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +7 -0
  65. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js +1770 -0
  66. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +7 -0
  67. package/dist/cli-bundle/chunks/chunk-6YCV7WSL.js +552 -0
  68. package/dist/cli-bundle/chunks/chunk-6YCV7WSL.js.map +7 -0
  69. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js +202 -0
  70. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +7 -0
  71. package/dist/cli-bundle/chunks/chunk-A7E7PUVX.js +157 -0
  72. package/dist/cli-bundle/chunks/chunk-A7E7PUVX.js.map +7 -0
  73. package/dist/cli-bundle/chunks/chunk-AKOOMO3T.js +90 -0
  74. package/dist/cli-bundle/chunks/chunk-AKOOMO3T.js.map +7 -0
  75. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js +950 -0
  76. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +7 -0
  77. package/dist/cli-bundle/chunks/chunk-CEFIVZPG.js +79 -0
  78. package/dist/cli-bundle/chunks/chunk-CEFIVZPG.js.map +7 -0
  79. package/dist/cli-bundle/chunks/chunk-D7AOMPRH.js +349 -0
  80. package/dist/cli-bundle/chunks/chunk-D7AOMPRH.js.map +7 -0
  81. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +56 -0
  82. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +7 -0
  83. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +47 -0
  84. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +7 -0
  85. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +56 -0
  86. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +7 -0
  87. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js +435 -0
  88. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +7 -0
  89. package/dist/cli-bundle/chunks/chunk-G57E5D7T.js +185 -0
  90. package/dist/cli-bundle/chunks/chunk-G57E5D7T.js.map +7 -0
  91. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js +3621 -0
  92. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +7 -0
  93. package/dist/cli-bundle/chunks/chunk-JFWUHHS2.js +233 -0
  94. package/dist/cli-bundle/chunks/chunk-JFWUHHS2.js.map +7 -0
  95. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js +1861 -0
  96. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +7 -0
  97. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js +648 -0
  98. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +7 -0
  99. package/dist/cli-bundle/chunks/chunk-KBQY3YG5.js +122 -0
  100. package/dist/cli-bundle/chunks/chunk-KBQY3YG5.js.map +7 -0
  101. package/dist/cli-bundle/chunks/chunk-L2FXEKDB.js +185 -0
  102. package/dist/cli-bundle/chunks/chunk-L2FXEKDB.js.map +7 -0
  103. package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js +189 -0
  104. package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +7 -0
  105. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js +5153 -0
  106. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +7 -0
  107. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js +1345 -0
  108. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +7 -0
  109. package/dist/cli-bundle/chunks/chunk-NGN7UV5K.js +341 -0
  110. package/dist/cli-bundle/chunks/chunk-NGN7UV5K.js.map +7 -0
  111. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js +18 -0
  112. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js.map +7 -0
  113. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js +2929 -0
  114. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +7 -0
  115. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js +674 -0
  116. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +7 -0
  117. package/dist/cli-bundle/chunks/chunk-PVNQLCIS.js +176 -0
  118. package/dist/cli-bundle/chunks/chunk-PVNQLCIS.js.map +7 -0
  119. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js +1680 -0
  120. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +7 -0
  121. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js +20 -0
  122. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js.map +7 -0
  123. package/dist/cli-bundle/chunks/chunk-SEXQN4KL.js +60 -0
  124. package/dist/cli-bundle/chunks/chunk-SEXQN4KL.js.map +7 -0
  125. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js +362 -0
  126. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +7 -0
  127. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +141 -0
  128. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +7 -0
  129. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js +632 -0
  130. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +7 -0
  131. package/dist/cli-bundle/chunks/chunk-WJ2NAC37.js +252 -0
  132. package/dist/cli-bundle/chunks/chunk-WJ2NAC37.js.map +7 -0
  133. package/dist/cli-bundle/chunks/claim-EE4TKKCV.js +133 -0
  134. package/dist/cli-bundle/chunks/claim-EE4TKKCV.js.map +7 -0
  135. package/dist/cli-bundle/chunks/close-XY4CSAYF.js +14 -0
  136. package/dist/cli-bundle/chunks/close-XY4CSAYF.js.map +7 -0
  137. package/dist/cli-bundle/chunks/comments-AAKJQ6LW.js +104 -0
  138. package/dist/cli-bundle/chunks/comments-AAKJQ6LW.js.map +7 -0
  139. package/dist/cli-bundle/chunks/config-V3FZOKLI.js +1577 -0
  140. package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +7 -0
  141. package/dist/cli-bundle/chunks/context-RZ5QPNJB.js +1458 -0
  142. package/dist/cli-bundle/chunks/context-RZ5QPNJB.js.map +7 -0
  143. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js +1245 -0
  144. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +7 -0
  145. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +28 -0
  146. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js.map +7 -0
  147. package/dist/cli-bundle/chunks/delete-RHCTEORS.js +59 -0
  148. package/dist/cli-bundle/chunks/delete-RHCTEORS.js.map +7 -0
  149. package/dist/cli-bundle/chunks/deps-MZYCMLAO.js +229 -0
  150. package/dist/cli-bundle/chunks/deps-MZYCMLAO.js.map +7 -0
  151. package/dist/cli-bundle/chunks/docs-FXXUCZYU.js +35 -0
  152. package/dist/cli-bundle/chunks/docs-FXXUCZYU.js.map +7 -0
  153. package/dist/cli-bundle/chunks/extension-B4WL7BQU.js +25 -0
  154. package/dist/cli-bundle/chunks/extension-B4WL7BQU.js.map +7 -0
  155. package/dist/cli-bundle/chunks/files-WVOX67PE.js +286 -0
  156. package/dist/cli-bundle/chunks/files-WVOX67PE.js.map +7 -0
  157. package/dist/cli-bundle/chunks/gc-JWNF66EC.js +181 -0
  158. package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +7 -0
  159. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js +198 -0
  160. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +7 -0
  161. package/dist/cli-bundle/chunks/health-TCWL55KM.js +1233 -0
  162. package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +7 -0
  163. package/dist/cli-bundle/chunks/history-A2JUDXUE.js +21 -0
  164. package/dist/cli-bundle/chunks/history-A2JUDXUE.js.map +7 -0
  165. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +20 -0
  166. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js.map +7 -0
  167. package/dist/cli-bundle/chunks/history-repair-ZWSTDRH2.js +198 -0
  168. package/dist/cli-bundle/chunks/history-repair-ZWSTDRH2.js.map +7 -0
  169. package/dist/cli-bundle/chunks/init-M2WUB4YH.js +16 -0
  170. package/dist/cli-bundle/chunks/init-M2WUB4YH.js.map +7 -0
  171. package/dist/cli-bundle/chunks/learnings-NXTWE3FR.js +48 -0
  172. package/dist/cli-bundle/chunks/learnings-NXTWE3FR.js.map +7 -0
  173. package/dist/cli-bundle/chunks/list-OGWQPC26.js +20 -0
  174. package/dist/cli-bundle/chunks/list-OGWQPC26.js.map +7 -0
  175. package/dist/cli-bundle/chunks/notes-DFS5ZGOO.js +48 -0
  176. package/dist/cli-bundle/chunks/notes-DFS5ZGOO.js.map +7 -0
  177. package/dist/cli-bundle/chunks/plan-67AB2PLM.js +1175 -0
  178. package/dist/cli-bundle/chunks/plan-67AB2PLM.js.map +7 -0
  179. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js +232 -0
  180. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +7 -0
  181. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js +712 -0
  182. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +7 -0
  183. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js +374 -0
  184. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +7 -0
  185. package/dist/cli-bundle/chunks/register-setup-V56GDRUS.js +246 -0
  186. package/dist/cli-bundle/chunks/register-setup-V56GDRUS.js.map +7 -0
  187. package/dist/cli-bundle/chunks/restore-MB2ISME7.js +18 -0
  188. package/dist/cli-bundle/chunks/restore-MB2ISME7.js.map +7 -0
  189. package/dist/cli-bundle/chunks/schema-Q622KC46.js +119 -0
  190. package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +7 -0
  191. package/dist/cli-bundle/chunks/search-HENBL456.js +1135 -0
  192. package/dist/cli-bundle/chunks/search-HENBL456.js.map +7 -0
  193. package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +124 -0
  194. package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +7 -0
  195. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +32 -0
  196. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js.map +7 -0
  197. package/dist/cli-bundle/chunks/test-all-G2AZOHXI.js +332 -0
  198. package/dist/cli-bundle/chunks/test-all-G2AZOHXI.js.map +7 -0
  199. package/dist/cli-bundle/chunks/test-runs-GX5HTPSF.js +939 -0
  200. package/dist/cli-bundle/chunks/test-runs-GX5HTPSF.js.map +7 -0
  201. package/dist/cli-bundle/chunks/update-H6SCWNMA.js +22 -0
  202. package/dist/cli-bundle/chunks/update-H6SCWNMA.js.map +7 -0
  203. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js +676 -0
  204. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +7 -0
  205. package/dist/cli-bundle/chunks/upgrade-H5HHM5UV.js +271 -0
  206. package/dist/cli-bundle/chunks/upgrade-H5HHM5UV.js.map +7 -0
  207. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js +1110 -0
  208. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +7 -0
  209. package/dist/cli-bundle/main.js +6952 -0
  210. package/dist/cli-bundle/main.js.map +7 -0
  211. package/dist/cli.js +1 -1
  212. package/dist/core/config/nested-settings.d.ts +2 -0
  213. package/dist/core/config/nested-settings.js +17 -2
  214. package/dist/core/config/nested-settings.js.map +1 -1
  215. package/dist/core/item/item-type-definition.js +6 -2
  216. package/dist/core/item/item-type-definition.js.map +1 -1
  217. package/dist/core/item/type-registry.d.ts +4 -0
  218. package/dist/core/item/type-registry.js +10 -2
  219. package/dist/core/item/type-registry.js.map +1 -1
  220. package/dist/core/item/type-synonyms.d.ts +20 -0
  221. package/dist/core/item/type-synonyms.js +42 -0
  222. package/dist/core/item/type-synonyms.js.map +1 -0
  223. package/dist/core/search/background-refresh.d.ts +53 -0
  224. package/dist/core/search/background-refresh.js +286 -0
  225. package/dist/core/search/background-refresh.js.map +1 -0
  226. package/dist/core/search/cache.d.ts +20 -1
  227. package/dist/core/search/cache.js +76 -5
  228. package/dist/core/search/cache.js.map +1 -1
  229. package/dist/core/search/semantic-defaults.js +73 -32
  230. package/dist/core/search/semantic-defaults.js.map +1 -1
  231. package/dist/core/search/vector-stores.js +7 -3
  232. package/dist/core/search/vector-stores.js.map +1 -1
  233. package/dist/core/sentry/helpers.d.ts +1 -1
  234. package/dist/core/sentry/helpers.js +4 -4
  235. package/dist/core/sentry/helpers.js.map +1 -1
  236. package/dist/core/shared/constants.d.ts +2 -2
  237. package/dist/core/shared/constants.js +3 -3
  238. package/dist/core/shared/constants.js.map +1 -1
  239. package/dist/core/shared/html-entity-decode.d.ts +2 -1
  240. package/dist/core/shared/html-entity-decode.js +14 -9
  241. package/dist/core/shared/html-entity-decode.js.map +1 -1
  242. package/dist/core/shared/time.js +52 -2
  243. package/dist/core/shared/time.js.map +1 -1
  244. package/dist/core/store/front-matter-cache.d.ts +24 -0
  245. package/dist/core/store/front-matter-cache.js +119 -8
  246. package/dist/core/store/front-matter-cache.js.map +1 -1
  247. package/dist/core/store/item-format-migration.js +25 -15
  248. package/dist/core/store/item-format-migration.js.map +1 -1
  249. package/dist/core/store/item-store.d.ts +7 -0
  250. package/dist/core/store/item-store.js +13 -3
  251. package/dist/core/store/item-store.js.map +1 -1
  252. package/dist/core/store/settings-validator.d.ts +1 -0
  253. package/dist/core/store/settings-validator.js +7 -2
  254. package/dist/core/store/settings-validator.js.map +1 -1
  255. package/dist/core/store/settings.js +19 -3
  256. package/dist/core/store/settings.js.map +1 -1
  257. package/dist/core/telemetry/runtime.d.ts +10 -0
  258. package/dist/core/telemetry/runtime.js +86 -2
  259. package/dist/core/telemetry/runtime.js.map +1 -1
  260. package/dist/mcp/server.js +3 -3
  261. package/dist/mcp/server.js.map +1 -1
  262. package/dist/sdk/cli-contracts/tool-parameter-tables.js +4 -4
  263. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  264. package/dist/sdk/cli-contracts.js +29 -8
  265. package/dist/sdk/cli-contracts.js.map +1 -1
  266. package/dist/types.d.ts +9 -1
  267. package/dist/types.js +2 -2
  268. package/dist/types.js.map +1 -1
  269. package/docs/CONFIGURATION.md +11 -0
  270. package/docs/RELEASING.md +1 -1
  271. package/package.json +7 -5
  272. package/packages/pm-calendar/extensions/calendar/index.js +27 -2
  273. package/packages/pm-calendar/extensions/calendar/index.ts +28 -2
  274. package/scripts/bundle-cli.mjs +39 -0
@@ -0,0 +1,233 @@
1
+ import {
2
+ hashDocument,
3
+ toItemRecord
4
+ } from "./chunk-BUPWJ3IJ.js";
5
+ import {
6
+ canonicalDocument
7
+ } from "./chunk-MD7K4JYF.js";
8
+ import {
9
+ FRONT_MATTER_KEY_ORDER,
10
+ orderObject,
11
+ sha256Hex,
12
+ stableStringify
13
+ } from "./chunk-LSXGH6NE.js";
14
+
15
+ // dist/core/history/replay.js
16
+ import jsonPatch from "fast-json-patch";
17
+ !(function() {
18
+ try {
19
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
20
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a11d69ae-cb25-5c08-8722-85d4fe95b973");
21
+ } catch (e2) {
22
+ }
23
+ })();
24
+ var EMPTY_REPLAY_DOCUMENT = {
25
+ metadata: {},
26
+ body: ""
27
+ };
28
+ function cloneEmptyReplayDocument() {
29
+ return structuredClone(EMPTY_REPLAY_DOCUMENT);
30
+ }
31
+ function replayHash(document) {
32
+ try {
33
+ return hashDocument({
34
+ metadata: document.metadata,
35
+ body: document.body
36
+ });
37
+ } catch {
38
+ return sha256Hex(stableStringify({ replay_fallback: true, metadata: document.metadata, body: document.body }));
39
+ }
40
+ }
41
+ function replayToItemDocument(document) {
42
+ return {
43
+ metadata: document.metadata,
44
+ body: document.body
45
+ };
46
+ }
47
+ function toReplayDocument(document) {
48
+ if (!document.metadata || Object.keys(document.metadata).length === 0) {
49
+ return {
50
+ metadata: {},
51
+ body: document.body ?? ""
52
+ };
53
+ }
54
+ const canonical = canonicalDocument(document);
55
+ return {
56
+ metadata: orderObject(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER),
57
+ body: canonical.body
58
+ };
59
+ }
60
+ function normalizeReplayPatchPath(path) {
61
+ if (path === "/front_matter") {
62
+ return "/metadata";
63
+ }
64
+ if (path.startsWith("/front_matter/")) {
65
+ return `/metadata/${path.slice("/front_matter/".length)}`;
66
+ }
67
+ return path;
68
+ }
69
+ function normalizeReplayPatchOps(patch) {
70
+ return patch.map((operation) => ({
71
+ ...operation,
72
+ path: normalizeReplayPatchPath(operation.path),
73
+ from: operation.from ? normalizeReplayPatchPath(operation.from) : void 0
74
+ }));
75
+ }
76
+ function isReplayDocumentShape(value) {
77
+ return typeof value === "object" && value !== null && "metadata" in value && "body" in value && typeof value.body === "string" && typeof value.metadata === "object" && value.metadata !== null;
78
+ }
79
+ function tryApplyReplayPatch(current, patch) {
80
+ try {
81
+ const normalizedPatch = normalizeReplayPatchOps(patch);
82
+ const applied = jsonPatch.applyPatch(structuredClone(current), normalizedPatch, true, false).newDocument;
83
+ if (!isReplayDocumentShape(applied)) {
84
+ return { ok: false, error: new Error("history_replay_invalid_document_shape") };
85
+ }
86
+ return { ok: true, document: { metadata: applied.metadata, body: applied.body } };
87
+ } catch (error) {
88
+ return { ok: false, error };
89
+ }
90
+ }
91
+ function verifyHistoryChain(entries) {
92
+ let replay = cloneEmptyReplayDocument();
93
+ for (let index = 0; index < entries.length; index += 1) {
94
+ const entry = entries[index];
95
+ if (replayHash(replay) !== entry.before_hash) {
96
+ return {
97
+ ok: false,
98
+ errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`]
99
+ };
100
+ }
101
+ const applied = tryApplyReplayPatch(replay, entry.patch);
102
+ if (!applied.ok) {
103
+ return {
104
+ ok: false,
105
+ errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`]
106
+ };
107
+ }
108
+ replay = applied.document;
109
+ if (replayHash(replay) !== entry.after_hash) {
110
+ return {
111
+ ok: false,
112
+ errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`]
113
+ };
114
+ }
115
+ }
116
+ return { ok: true, errors: [] };
117
+ }
118
+ function tryApplySingleOp(document, op) {
119
+ try {
120
+ const applied = jsonPatch.applyPatch(structuredClone(document), [op], true, false).newDocument;
121
+ return { ok: true, document: applied };
122
+ } catch {
123
+ return { ok: false };
124
+ }
125
+ }
126
+ function lenientApplyReplayPatch(current, patch) {
127
+ let working = structuredClone(current);
128
+ let convertedReplaceToAdd = 0;
129
+ let skippedOps = 0;
130
+ for (const op of normalizeReplayPatchOps(patch)) {
131
+ const direct = tryApplySingleOp(working, op);
132
+ if (direct.ok) {
133
+ working = direct.document;
134
+ continue;
135
+ }
136
+ if (op.op === "replace") {
137
+ const asAdd = tryApplySingleOp(working, { ...op, op: "add" });
138
+ if (asAdd.ok) {
139
+ working = asAdd.document;
140
+ convertedReplaceToAdd += 1;
141
+ continue;
142
+ }
143
+ }
144
+ skippedOps += 1;
145
+ }
146
+ const candidate = working;
147
+ const document = {
148
+ metadata: typeof candidate.metadata === "object" && candidate.metadata !== null ? candidate.metadata : {},
149
+ body: typeof candidate.body === "string" ? candidate.body : current.body
150
+ };
151
+ return { document, convertedReplaceToAdd, skippedOps };
152
+ }
153
+ function reanchorHistoryEntries(entries) {
154
+ let replay = cloneEmptyReplayDocument();
155
+ const rewritten = [];
156
+ const details = [];
157
+ let entriesRehashed = 0;
158
+ let entriesPatchRepaired = 0;
159
+ let convertedReplaceToAdd = 0;
160
+ let skippedOps = 0;
161
+ for (let index = 0; index < entries.length; index += 1) {
162
+ const entry = entries[index];
163
+ const beforeHash = replayHash(replay);
164
+ const strict = tryApplyReplayPatch(replay, entry.patch);
165
+ let next;
166
+ let outPatch;
167
+ let patchRepaired = false;
168
+ let entryConverted = 0;
169
+ let entrySkipped = 0;
170
+ if (strict.ok) {
171
+ next = strict.document;
172
+ outPatch = entry.patch;
173
+ } else {
174
+ const lenient = lenientApplyReplayPatch(replay, entry.patch);
175
+ next = lenient.document;
176
+ outPatch = jsonPatch.compare(replay, next);
177
+ patchRepaired = true;
178
+ entryConverted = lenient.convertedReplaceToAdd;
179
+ entrySkipped = lenient.skippedOps;
180
+ convertedReplaceToAdd += entryConverted;
181
+ skippedOps += entrySkipped;
182
+ entriesPatchRepaired += 1;
183
+ }
184
+ const afterHash = replayHash(next);
185
+ const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;
186
+ if (rehashed) {
187
+ entriesRehashed += 1;
188
+ }
189
+ rewritten.push({
190
+ ...entry,
191
+ patch: outPatch,
192
+ before_hash: beforeHash,
193
+ after_hash: afterHash
194
+ });
195
+ details.push({
196
+ index: index + 1,
197
+ rehashed,
198
+ patch_repaired: patchRepaired,
199
+ converted_replace_to_add: entryConverted,
200
+ skipped_ops: entrySkipped
201
+ });
202
+ replay = next;
203
+ }
204
+ return {
205
+ entries: rewritten,
206
+ finalDocument: replay,
207
+ entriesRehashed,
208
+ entriesPatchRepaired,
209
+ convertedReplaceToAdd,
210
+ skippedOps,
211
+ details
212
+ };
213
+ }
214
+ function historyEntriesToRaw(entries) {
215
+ if (entries.length === 0) {
216
+ return "";
217
+ }
218
+ return `${entries.map((entry) => JSON.stringify(entry)).join("\n")}
219
+ `;
220
+ }
221
+
222
+ export {
223
+ EMPTY_REPLAY_DOCUMENT,
224
+ replayHash,
225
+ replayToItemDocument,
226
+ toReplayDocument,
227
+ normalizeReplayPatchOps,
228
+ tryApplyReplayPatch,
229
+ verifyHistoryChain,
230
+ reanchorHistoryEntries,
231
+ historyEntriesToRaw
232
+ };
233
+ //# sourceMappingURL=chunk-JFWUHHS2.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../core/history/replay.ts"],
4
+ "sourcesContent": ["import jsonPatch from \"fast-json-patch\";\nimport { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { canonicalDocument } from \"../item/item-format.js\";\nimport { toItemRecord } from \"../item/item-record.js\";\nimport { orderObject, sha256Hex, stableStringify } from \"../shared/serialization.js\";\nimport { hashDocument } from \"./history.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Shared history replay/patch mechanics single-sourced for the history, restore,\n * history-redact, and history-repair commands plus the health/validate drift checks.\n *\n * Each command keeps its own thin error-formatting wrapper so the exact CLI error\n * contracts (restore's rich patch-failure context, redact's op tag, history's\n * generic message) are preserved; only the underlying replay/patch logic is shared.\n */\n\nexport interface ReplayDocument {\n metadata: Record<string, unknown>;\n body: string;\n}\n\nexport const EMPTY_REPLAY_DOCUMENT: ReplayDocument = {\n metadata: {},\n body: \"\",\n};\n\nexport function cloneEmptyReplayDocument(): ReplayDocument {\n return structuredClone(EMPTY_REPLAY_DOCUMENT);\n}\n\nexport function replayHash(document: ReplayDocument): string {\n try {\n return hashDocument({\n metadata: document.metadata as unknown as ItemMetadata,\n body: document.body,\n });\n } catch {\n // Legacy/malformed replay states (for example a stream whose first entry never\n // established a full `create` document, so the canonicalizer cannot normalize it)\n // cannot be canonically hashed. Fall back to a deterministic structural hash so\n // re-anchor and verification stay internally consistent for these streams. Fully\n // formed documents always take the canonical path above, so valid streams are\n // unaffected.\n return sha256Hex(stableStringify({ replay_fallback: true, metadata: document.metadata, body: document.body }));\n }\n}\n\nexport function replayToItemDocument(document: ReplayDocument): ItemDocument {\n return {\n metadata: document.metadata as unknown as ItemMetadata,\n body: document.body,\n };\n}\n\n/**\n * Canonicalize an item document into the ordered replay form used when comparing\n * a replayed chain against the on-disk item (restore + history-repair reconciliation).\n */\nexport function toReplayDocument(document: ItemDocument): ReplayDocument {\n if (!document.metadata || Object.keys(document.metadata).length === 0) {\n return {\n metadata: {},\n body: document.body ?? \"\",\n };\n }\n const canonical = canonicalDocument(document);\n return {\n metadata: orderObject(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER),\n body: canonical.body,\n };\n}\n\nexport function normalizeReplayPatchPath(path: string): string {\n if (path === \"/front_matter\") {\n return \"/metadata\";\n }\n if (path.startsWith(\"/front_matter/\")) {\n return `/metadata/${path.slice(\"/front_matter/\".length)}`;\n }\n return path;\n}\n\nexport function normalizeReplayPatchOps(patch: HistoryPatchOp[]): HistoryPatchOp[] {\n return patch.map((operation) => ({\n ...operation,\n path: normalizeReplayPatchPath(operation.path),\n from: operation.from ? normalizeReplayPatchPath(operation.from) : undefined,\n }));\n}\n\nfunction isReplayDocumentShape(value: unknown): value is { metadata: Record<string, unknown>; body: string } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"metadata\" in value &&\n \"body\" in value &&\n typeof (value as { body: unknown }).body === \"string\" &&\n typeof (value as { metadata: unknown }).metadata === \"object\" &&\n (value as { metadata: unknown }).metadata !== null\n );\n}\n\nexport type ReplayApplyResult =\n | { ok: true; document: ReplayDocument }\n | { ok: false; error: unknown };\n\n/**\n * Strictly apply a history patch (front_matter->metadata normalized) to a replay\n * document. Returns a result envelope rather than throwing so each caller can\n * format its own error contract.\n */\nexport function tryApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): ReplayApplyResult {\n try {\n const normalizedPatch = normalizeReplayPatchOps(patch);\n const applied = jsonPatch.applyPatch(\n structuredClone(current),\n normalizedPatch as jsonPatch.Operation[],\n true,\n false,\n ).newDocument as unknown;\n if (!isReplayDocumentShape(applied)) {\n return { ok: false, error: new Error(\"history_replay_invalid_document_shape\") };\n }\n return { ok: true, document: { metadata: applied.metadata, body: applied.body } };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Deterministically verify a history chain: each entry's before_hash must equal\n * the prior replayed after_hash, the patch must strictly apply, and the recorded\n * after_hash must equal the replayed result.\n */\nexport function verifyHistoryChain(entries: HistoryEntry[]): { ok: boolean; errors: string[] } {\n let replay = cloneEmptyReplayDocument();\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n return {\n ok: false,\n errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`],\n };\n }\n const applied = tryApplyReplayPatch(replay, entry.patch);\n if (!applied.ok) {\n return {\n ok: false,\n errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`],\n };\n }\n replay = applied.document;\n if (replayHash(replay) !== entry.after_hash) {\n return {\n ok: false,\n errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`],\n };\n }\n }\n return { ok: true, errors: [] };\n}\n\nexport interface LenientApplyResult {\n document: ReplayDocument;\n convertedReplaceToAdd: number;\n skippedOps: number;\n}\n\nfunction tryApplySingleOp(document: unknown, op: HistoryPatchOp): { ok: true; document: unknown } | { ok: false } {\n try {\n const applied = jsonPatch.applyPatch(\n structuredClone(document),\n [op as jsonPatch.Operation],\n true,\n false,\n ).newDocument as unknown;\n return { ok: true, document: applied };\n } catch {\n return { ok: false };\n }\n}\n\n/**\n * Apply a legacy patch op-by-op, recovering from drift that strict replay rejects:\n * a `replace` whose path no longer exists is retried as `add`, and any op that\n * still cannot apply against the current replay state is skipped. The resulting\n * document is what the repaired entry's recomputed patch should target.\n */\nexport function lenientApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): LenientApplyResult {\n let working: unknown = structuredClone(current);\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (const op of normalizeReplayPatchOps(patch)) {\n const direct = tryApplySingleOp(working, op);\n if (direct.ok) {\n working = direct.document;\n continue;\n }\n if (op.op === \"replace\") {\n const asAdd = tryApplySingleOp(working, { ...op, op: \"add\" });\n if (asAdd.ok) {\n working = asAdd.document;\n convertedReplaceToAdd += 1;\n continue;\n }\n }\n skippedOps += 1;\n }\n\n const candidate = working as { metadata?: unknown; body?: unknown };\n const document: ReplayDocument = {\n metadata:\n typeof candidate.metadata === \"object\" && candidate.metadata !== null\n ? (candidate.metadata as Record<string, unknown>)\n : {},\n body: typeof candidate.body === \"string\" ? candidate.body : current.body,\n };\n return { document, convertedReplaceToAdd, skippedOps };\n}\n\nexport interface ReanchorEntryDetail {\n index: number;\n rehashed: boolean;\n patch_repaired: boolean;\n converted_replace_to_add: number;\n skipped_ops: number;\n}\n\nexport interface ReanchorResult {\n entries: HistoryEntry[];\n finalDocument: ReplayDocument;\n entriesRehashed: number;\n entriesPatchRepaired: number;\n convertedReplaceToAdd: number;\n skippedOps: number;\n details: ReanchorEntryDetail[];\n}\n\n/**\n * Re-anchor a drifted history chain: replay every entry from empty, recompute the\n * before/after hashes, and only rewrite a patch when the original op set no longer\n * strictly applies (legacy drift). Clean entries keep their patch verbatim so the\n * on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain.\n */\nexport function reanchorHistoryEntries(entries: HistoryEntry[]): ReanchorResult {\n let replay = cloneEmptyReplayDocument();\n const rewritten: HistoryEntry[] = [];\n const details: ReanchorEntryDetail[] = [];\n let entriesRehashed = 0;\n let entriesPatchRepaired = 0;\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n const beforeHash = replayHash(replay);\n const strict = tryApplyReplayPatch(replay, entry.patch);\n\n let next: ReplayDocument;\n let outPatch: HistoryPatchOp[];\n let patchRepaired = false;\n let entryConverted = 0;\n let entrySkipped = 0;\n\n if (strict.ok) {\n next = strict.document;\n outPatch = entry.patch;\n } else {\n const lenient = lenientApplyReplayPatch(replay, entry.patch);\n next = lenient.document;\n outPatch = jsonPatch.compare(replay, next) as HistoryPatchOp[];\n patchRepaired = true;\n entryConverted = lenient.convertedReplaceToAdd;\n entrySkipped = lenient.skippedOps;\n convertedReplaceToAdd += entryConverted;\n skippedOps += entrySkipped;\n entriesPatchRepaired += 1;\n }\n\n const afterHash = replayHash(next);\n const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;\n if (rehashed) {\n entriesRehashed += 1;\n }\n\n rewritten.push({\n ...entry,\n patch: outPatch,\n before_hash: beforeHash,\n after_hash: afterHash,\n });\n details.push({\n index: index + 1,\n rehashed,\n patch_repaired: patchRepaired,\n converted_replace_to_add: entryConverted,\n skipped_ops: entrySkipped,\n });\n replay = next;\n }\n\n return {\n entries: rewritten,\n finalDocument: replay,\n entriesRehashed,\n entriesPatchRepaired,\n convertedReplaceToAdd,\n skippedOps,\n details,\n };\n}\n\nexport function historyEntriesToRaw(entries: HistoryEntry[]): string {\n if (entries.length === 0) {\n return \"\";\n }\n return `${entries.map((entry) => JSON.stringify(entry)).join(\"\\n\")}\\n`;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;AAAA,OAAO,eAAe;;;;;;;;AAsBf,IAAM,wBAAwC;EACnD,UAAU,CAAA;EACV,MAAM;;AAGF,SAAU,2BAAwB;AACtC,SAAO,gBAAgB,qBAAqB;AAC9C;AAEM,SAAU,WAAW,UAAwB;AACjD,MAAI;AACF,WAAO,aAAa;MAClB,UAAU,SAAS;MACnB,MAAM,SAAS;KAChB;EACH,QAAQ;AAON,WAAO,UAAU,gBAAgB,EAAE,iBAAiB,MAAM,UAAU,SAAS,UAAU,MAAM,SAAS,KAAI,CAAE,CAAC;EAC/G;AACF;AAEM,SAAU,qBAAqB,UAAwB;AAC3D,SAAO;IACL,UAAU,SAAS;IACnB,MAAM,SAAS;;AAEnB;AAMM,SAAU,iBAAiB,UAAsB;AACrD,MAAI,CAAC,SAAS,YAAY,OAAO,KAAK,SAAS,QAAQ,EAAE,WAAW,GAAG;AACrE,WAAO;MACL,UAAU,CAAA;MACV,MAAM,SAAS,QAAQ;;EAE3B;AACA,QAAM,YAAY,kBAAkB,QAAQ;AAC5C,SAAO;IACL,UAAU,YAAY,aAAa,UAAU,QAAQ,GAAG,sBAAsB;IAC9E,MAAM,UAAU;;AAEpB;AAEM,SAAU,yBAAyB,MAAY;AACnD,MAAI,SAAS,iBAAiB;AAC5B,WAAO;EACT;AACA,MAAI,KAAK,WAAW,gBAAgB,GAAG;AACrC,WAAO,aAAa,KAAK,MAAM,iBAAiB,MAAM,CAAC;EACzD;AACA,SAAO;AACT;AAEM,SAAU,wBAAwB,OAAuB;AAC7D,SAAO,MAAM,IAAI,CAAC,eAAe;IAC/B,GAAG;IACH,MAAM,yBAAyB,UAAU,IAAI;IA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