@unbrained/pm-cli 2026.6.5 → 2026.6.6

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 (413) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +12 -4
  4. package/dist/cli/commands/completion.js +21 -7
  5. package/dist/cli/commands/completion.js.map +1 -1
  6. package/dist/cli/commands/contracts.js +5 -3
  7. package/dist/cli/commands/contracts.js.map +1 -1
  8. package/dist/cli/commands/gc.d.ts +8 -1
  9. package/dist/cli/commands/gc.js +26 -3
  10. package/dist/cli/commands/gc.js.map +1 -1
  11. package/dist/cli/commands/health.js +15 -2
  12. package/dist/cli/commands/health.js.map +1 -1
  13. package/dist/cli/commands/history.d.ts +4 -1
  14. package/dist/cli/commands/history.js +12 -24
  15. package/dist/cli/commands/history.js.map +1 -1
  16. package/dist/cli/commands/index.d.ts +1 -0
  17. package/dist/cli/commands/index.js +3 -2
  18. package/dist/cli/commands/index.js.map +1 -1
  19. package/dist/cli/commands/stats.d.ts +8 -1
  20. package/dist/cli/commands/stats.js +18 -17
  21. package/dist/cli/commands/stats.js.map +1 -1
  22. package/dist/cli/commands/telemetry.d.ts +8 -0
  23. package/dist/cli/commands/telemetry.js +253 -0
  24. package/dist/cli/commands/telemetry.js.map +1 -0
  25. package/dist/cli/help-content.js +11 -2
  26. package/dist/cli/help-content.js.map +1 -1
  27. package/dist/cli/register-list-query.js +7 -4
  28. package/dist/cli/register-list-query.js.map +1 -1
  29. package/dist/cli/register-operations.js +29 -6
  30. package/dist/cli/register-operations.js.map +1 -1
  31. package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
  32. package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js → activity-JM6DTDND.js} +11 -11
  33. package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js → aggregate-GI7WSZPH.js} +10 -10
  34. package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js → aggregate-VNAHUNNF.js} +10 -10
  35. package/dist/cli-bundle/chunks/{append-5JE3YGXU.js → append-7H5N64R2.js} +8 -8
  36. package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js → append-WMKRXKCE.js} +8 -8
  37. package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js → chunk-23YFZ3IG.js} +12 -12
  38. package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js → chunk-2HVRUSQA.js} +3 -3
  39. package/dist/cli-bundle/chunks/{chunk-V3JQ4IPL.js → chunk-2RSPZI5H.js} +102 -22
  40. package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
  41. package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js → chunk-2VBQ6ZXS.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js → chunk-2VVCGBNV.js} +9 -9
  43. package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js → chunk-3BWOVLTH.js} +8 -8
  44. package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js → chunk-3FI4SEFT.js} +5 -5
  45. package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js → chunk-3LB74A67.js} +6 -6
  46. package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js → chunk-3VAM3NNM.js} +3 -3
  47. package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js → chunk-4LL6TK5B.js} +5 -5
  48. package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js → chunk-52MAOQ6J.js} +4 -4
  49. package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js → chunk-5FDATVEZ.js} +4 -4
  50. package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js → chunk-5SFCOO6B.js} +76 -7
  51. package/dist/cli-bundle/chunks/{chunk-4LTBNUYT.js.map → chunk-5SFCOO6B.js.map} +1 -1
  52. package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js → chunk-6ER6DXH5.js} +9 -9
  53. package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js → chunk-6P6GGMOG.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js → chunk-77GFDHGF.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js → chunk-AO442XLN.js} +3 -3
  56. package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js → chunk-AY43SBIN.js} +6 -6
  57. package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js → chunk-BQHUILZS.js} +5 -5
  58. package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js → chunk-E5FJNAZA.js} +3 -3
  59. package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js → chunk-ECCMVXGM.js} +3 -3
  60. package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js → chunk-FRAUKRU2.js} +5 -5
  61. package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js → chunk-GCOQW437.js} +3 -3
  62. package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js → chunk-GGYWB3Y2.js} +6 -6
  63. package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js → chunk-GU2ZJ2VV.js} +5 -5
  64. package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js → chunk-GXSUPCBV.js} +5 -4
  65. package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js → chunk-HZGUAH22.js} +2 -2
  66. package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js → chunk-I2HSTRJF.js} +5 -5
  67. package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js → chunk-I6BNFU5X.js} +3 -3
  68. package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js → chunk-IJGCZSIQ.js} +12 -12
  69. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
  70. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js → chunk-KAG77BY3.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js → chunk-KJ33AOCY.js} +3 -3
  73. package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js → chunk-KJE2FOS4.js} +2 -2
  74. package/dist/cli-bundle/chunks/{chunk-GNHVV4SY.js → chunk-KWU6HG75.js} +37 -14
  75. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js → chunk-LB3RUL2N.js} +3 -3
  77. package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js → chunk-LCM63IXU.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js → chunk-ME2YH6FN.js} +7 -7
  79. package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js → chunk-MITFDD35.js} +12 -12
  80. package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js → chunk-N7ACFE26.js} +3 -3
  81. package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js → chunk-NUZ5HKR4.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js → chunk-OVQCEJPG.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js → chunk-OZ7NSQHL.js} +8 -8
  84. package/dist/cli-bundle/chunks/{chunk-TK633IVD.js → chunk-PDDFYW4X.js} +5 -5
  85. package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js → chunk-PIU6RSL3.js} +9 -9
  86. package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js → chunk-PO3GSVFV.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-WIKR7KFL.js → chunk-PRJCELV4.js} +108 -21
  88. package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
  89. package/dist/cli-bundle/chunks/{chunk-ZQ4F6EC4.js → chunk-PROOHX4K.js} +38 -15
  90. package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
  91. package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js → chunk-Q7SPNHLW.js} +8 -8
  92. package/dist/cli-bundle/chunks/{chunk-RANZIID5.js → chunk-QO7EBBOM.js} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js → chunk-R6UFP2GE.js} +7 -7
  94. package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js → chunk-RWPSOIEE.js} +7 -7
  95. package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js → chunk-RZN6VURO.js} +3 -3
  96. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
  97. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-KA24HME7.js → chunk-T3LC5LKB.js} +2 -2
  99. package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js → chunk-TCD3R2PF.js} +2 -2
  100. package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js → chunk-TPH5XEVD.js} +3 -3
  101. package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js → chunk-U5SXYXSY.js} +75 -6
  102. package/dist/cli-bundle/chunks/{chunk-SRVKTWPR.js.map → chunk-U5SXYXSY.js.map} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js → chunk-UBOPJT3S.js} +9 -9
  104. package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js → chunk-UM2GBHS4.js} +5 -4
  105. package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js → chunk-W7XABV4H.js} +8 -8
  106. package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js → chunk-WKY2IBOQ.js} +3 -3
  107. package/dist/cli-bundle/chunks/{chunk-7K24QB23.js → chunk-WOPXVEZP.js} +5 -5
  108. package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js → chunk-WSMOSYRD.js} +12 -12
  109. package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js → chunk-XLTD2HN3.js} +2 -2
  110. package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js → chunk-XSJCLN2R.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js → chunk-XTGLRY2Y.js} +6 -6
  112. package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js → chunk-YL2DJGYS.js} +7 -7
  113. package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js → claim-4DBF6RVG.js} +10 -10
  114. package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js → claim-X2P4IB7J.js} +10 -10
  115. package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
  116. package/dist/cli-bundle/chunks/{close-65DFYAVS.js → close-PTYFA45H.js} +8 -8
  117. package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js → close-many-7CGIDPTJ.js} +15 -15
  118. package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js → close-many-ERFO6LHR.js} +15 -15
  119. package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js → comments-OONGABK5.js} +10 -10
  120. package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js → comments-QKBYCWKD.js} +10 -10
  121. package/dist/cli-bundle/chunks/{config-DDPYIA6J.js → config-6FXCQKIF.js} +8 -8
  122. package/dist/cli-bundle/chunks/{config-5ON3ADRH.js → config-U4RZ4CQB.js} +8 -8
  123. package/dist/cli-bundle/chunks/{context-E6U3DWVM.js → context-FYYJGFWS.js} +13 -13
  124. package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js → context-YMJ3Z2HQ.js} +13 -13
  125. package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js → contracts-QDB6OMLQ.js} +10 -6
  126. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
  127. package/dist/cli-bundle/chunks/{contracts-CXSFM45B.js → contracts-RFSPGVVJ.js} +9 -5
  128. package/dist/cli-bundle/chunks/{contracts-LCSX5R53.js.map → contracts-RFSPGVVJ.js.map} +7 -1
  129. package/dist/cli-bundle/chunks/{create-WYFKN2U4.js → create-I5L4EYYZ.js} +13 -13
  130. package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
  131. package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js → delete-7HPGI4GZ.js} +7 -7
  132. package/dist/cli-bundle/chunks/{delete-RONNH4F4.js → delete-VXUPH5RS.js} +7 -7
  133. package/dist/cli-bundle/chunks/{deps-WII3O4HB.js → deps-JSRRWC3Z.js} +7 -7
  134. package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js → deps-SCZIFK2Z.js} +7 -7
  135. package/dist/cli-bundle/chunks/{docs-PDREIMLS.js → docs-GJK6K4VP.js} +9 -9
  136. package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js → docs-WW4N3MBM.js} +9 -9
  137. package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js → extension-J7IBMFTD.js} +4 -4
  138. package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js → extension-VDY2U33M.js} +4 -4
  139. package/dist/cli-bundle/chunks/{files-2PN7UM2D.js → files-ISZJGILQ.js} +9 -9
  140. package/dist/cli-bundle/chunks/{files-MXYS5W4M.js → files-WKOD326U.js} +9 -9
  141. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
  142. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
  143. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
  144. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{get-WXMLRG7M.js → get-RV37HT3G.js} +10 -10
  146. package/dist/cli-bundle/chunks/{get-CINFEUIY.js → get-WXU6WI5P.js} +10 -10
  147. package/dist/cli-bundle/chunks/{health-IT5DBPRJ.js → health-6L6EH4WR.js} +26 -13
  148. package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{health-5VPOJQ53.js → health-LOI2HHKB.js} +27 -14
  150. package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
  151. package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
  152. package/dist/cli-bundle/chunks/{history-FLZIP7PM.js → history-PKN67D5O.js} +10 -10
  153. package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
  154. package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js → history-redact-V4FOJGS7.js} +11 -11
  155. package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js → history-repair-HIBCBIKK.js} +11 -11
  156. package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js → history-repair-SDMHR7JT.js} +11 -11
  157. package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
  158. package/dist/cli-bundle/chunks/{init-6MRFVOLH.js → init-P56QYWJF.js} +8 -8
  159. package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js → learnings-GDFRG5J7.js} +10 -10
  160. package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js → learnings-MIXSESLK.js} +10 -10
  161. package/dist/cli-bundle/chunks/{list-DBRECOG4.js → list-FGOWQMSM.js} +10 -10
  162. package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
  163. package/dist/cli-bundle/chunks/{notes-42LIC3UE.js → notes-4XVSH2AZ.js} +10 -10
  164. package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js → notes-5UK3GEH2.js} +10 -10
  165. package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js → plan-DUMBV3QB.js} +13 -13
  166. package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js → plan-SLMODHWX.js} +13 -13
  167. package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js → register-list-query-POCFZ5JW.js} +24 -22
  168. package/dist/cli-bundle/chunks/{register-list-query-EMNSIUO4.js.map → register-list-query-POCFZ5JW.js.map} +1 -1
  169. package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js → register-list-query-WST76HSQ.js} +23 -21
  170. package/dist/cli-bundle/chunks/{register-list-query-AG3XKXWL.js.map → register-list-query-WST76HSQ.js.map} +2 -2
  171. package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js → register-mutation-N5GSUZJV.js} +30 -30
  172. package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js → register-mutation-OA675SOU.js} +30 -30
  173. package/dist/cli-bundle/chunks/{register-operations-KYUOOOOD.js → register-operations-GNHBE5I3.js} +47 -34
  174. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
  175. package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js → register-operations-N3PMHXH5.js} +46 -33
  176. package/dist/cli-bundle/chunks/{register-operations-Q54JQZUN.js.map → register-operations-N3PMHXH5.js.map} +2 -2
  177. package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js → register-setup-JIMPKJKV.js} +15 -15
  178. package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js → register-setup-ZHJI2DI3.js} +15 -15
  179. package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
  180. package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js → restore-PBL6T5TW.js} +11 -11
  181. package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js → schema-2NOO6NGB.js} +8 -8
  182. package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js → schema-EBI4NLUO.js} +8 -8
  183. package/dist/cli-bundle/chunks/{search-C7NPB7G7.js → search-JPUQTVCY.js} +10 -10
  184. package/dist/cli-bundle/chunks/{search-5A3BMFA7.js → search-OA6JX27A.js} +10 -10
  185. package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
  186. package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
  187. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
  188. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
  189. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
  190. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
  191. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
  192. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js → test-MXX3E5JL.js} +13 -13
  194. package/dist/cli-bundle/chunks/{test-OFYONO3C.js → test-WBROAJIE.js} +13 -13
  195. package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js → test-all-N6NSRDTV.js} +13 -13
  196. package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js → test-all-NTOZ7C3M.js} +13 -13
  197. package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js → test-runs-V6A7LPWZ.js} +5 -5
  198. package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js → test-runs-WMVTQU3Y.js} +5 -5
  199. package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
  200. package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
  201. package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js → update-many-EM6OXYGO.js} +22 -22
  202. package/dist/cli-bundle/chunks/{update-many-322CCH2L.js → update-many-KGGEYABR.js} +22 -22
  203. package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js → upgrade-BLI7XBAJ.js} +4 -4
  204. package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js → upgrade-LXPOQKFV.js} +4 -4
  205. package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js → validate-AGOAUOVW.js} +15 -15
  206. package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js → validate-L5J6A7YO.js} +15 -15
  207. package/dist/cli-bundle/main.js +42 -1451
  208. package/dist/cli-bundle/main.js.map +4 -4
  209. package/dist/core/history/history-diff.d.ts +47 -0
  210. package/dist/core/history/history-diff.js +152 -0
  211. package/dist/core/history/history-diff.js.map +1 -0
  212. package/dist/core/history/history-storage-stats.d.ts +31 -0
  213. package/dist/core/history/history-storage-stats.js +101 -0
  214. package/dist/core/history/history-storage-stats.js.map +1 -0
  215. package/dist/core/lock/lock-gc.d.ts +46 -0
  216. package/dist/core/lock/lock-gc.js +194 -0
  217. package/dist/core/lock/lock-gc.js.map +1 -0
  218. package/dist/core/shared/serial-queue.d.ts +12 -0
  219. package/dist/core/shared/serial-queue.js +43 -0
  220. package/dist/core/shared/serial-queue.js.map +1 -0
  221. package/dist/core/store/settings.d.ts +19 -1
  222. package/dist/core/store/settings.js +92 -7
  223. package/dist/core/store/settings.js.map +1 -1
  224. package/dist/core/telemetry/observability.js +3 -3
  225. package/dist/core/telemetry/observability.js.map +1 -1
  226. package/dist/core/telemetry/runtime.js +16 -4
  227. package/dist/core/telemetry/runtime.js.map +1 -1
  228. package/dist/mcp/server.d.ts +1 -0
  229. package/dist/mcp/server.js +155 -37
  230. package/dist/mcp/server.js.map +1 -1
  231. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  232. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  233. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  234. package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -7
  235. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  236. package/dist/sdk/cli-contracts.d.ts +23 -0
  237. package/dist/sdk/cli-contracts.js +41 -7
  238. package/dist/sdk/cli-contracts.js.map +1 -1
  239. package/docs/AGENT_GUIDE.md +1 -1
  240. package/docs/ARCHITECTURE.md +11 -1
  241. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  242. package/docs/COMMANDS.md +33 -2
  243. package/docs/CONFIGURATION.md +9 -1
  244. package/docs/EXTENSIONS.md +7 -0
  245. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
  246. package/docs/ONBOARDING.md +165 -0
  247. package/docs/QUICKSTART.md +1 -1
  248. package/docs/README.md +12 -4
  249. package/docs/RELEASING.md +36 -1
  250. package/docs/TESTING.md +19 -1
  251. package/package.json +5 -2
  252. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  253. package/plugins/pm-claude/README.md +7 -4
  254. package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
  255. package/plugins/pm-claude/commands/pm-init.md +1 -1
  256. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +0 -16
  257. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +0 -1
  258. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +0 -1
  259. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +0 -7
  260. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +0 -7
  261. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +0 -13
  262. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +0 -7
  263. package/dist/cli-bundle/chunks/create-ATONSAZW.js +0 -27
  264. package/dist/cli-bundle/chunks/gc-GT552UJH.js +0 -178
  265. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +0 -1
  266. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +0 -181
  267. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +0 -7
  268. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +0 -1
  269. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +0 -7
  270. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +0 -20
  271. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +0 -19
  272. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +0 -16
  273. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +0 -20
  274. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +0 -1
  275. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +0 -17
  276. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +0 -120
  277. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +0 -1
  278. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +0 -123
  279. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +0 -7
  280. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +0 -25
  281. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +0 -21
  282. /package/dist/cli-bundle/chunks/{activity-P5BUMWP3.js.map → activity-CVXTCHYY.js.map} +0 -0
  283. /package/dist/cli-bundle/chunks/{activity-3RWRRNOW.js.map → activity-JM6DTDND.js.map} +0 -0
  284. /package/dist/cli-bundle/chunks/{aggregate-J35K7WZB.js.map → aggregate-GI7WSZPH.js.map} +0 -0
  285. /package/dist/cli-bundle/chunks/{aggregate-OOAGKWRG.js.map → aggregate-VNAHUNNF.js.map} +0 -0
  286. /package/dist/cli-bundle/chunks/{append-5JE3YGXU.js.map → append-7H5N64R2.js.map} +0 -0
  287. /package/dist/cli-bundle/chunks/{append-PNN6UIBZ.js.map → append-WMKRXKCE.js.map} +0 -0
  288. /package/dist/cli-bundle/chunks/{chunk-D5X7N6FI.js.map → chunk-23YFZ3IG.js.map} +0 -0
  289. /package/dist/cli-bundle/chunks/{chunk-FVXM3GKS.js.map → chunk-2HVRUSQA.js.map} +0 -0
  290. /package/dist/cli-bundle/chunks/{chunk-SZQCER6S.js.map → chunk-2VBQ6ZXS.js.map} +0 -0
  291. /package/dist/cli-bundle/chunks/{chunk-A6PEXMYN.js.map → chunk-2VVCGBNV.js.map} +0 -0
  292. /package/dist/cli-bundle/chunks/{chunk-UOVLWB47.js.map → chunk-3BWOVLTH.js.map} +0 -0
  293. /package/dist/cli-bundle/chunks/{chunk-5IRA6IYD.js.map → chunk-3FI4SEFT.js.map} +0 -0
  294. /package/dist/cli-bundle/chunks/{chunk-3OH4DAEB.js.map → chunk-3LB74A67.js.map} +0 -0
  295. /package/dist/cli-bundle/chunks/{chunk-GFWHHMVV.js.map → chunk-3VAM3NNM.js.map} +0 -0
  296. /package/dist/cli-bundle/chunks/{chunk-4QCR4QW3.js.map → chunk-4LL6TK5B.js.map} +0 -0
  297. /package/dist/cli-bundle/chunks/{chunk-TBQVUNVH.js.map → chunk-52MAOQ6J.js.map} +0 -0
  298. /package/dist/cli-bundle/chunks/{chunk-5KB4X7YY.js.map → chunk-5FDATVEZ.js.map} +0 -0
  299. /package/dist/cli-bundle/chunks/{chunk-GCAVRLGE.js.map → chunk-6ER6DXH5.js.map} +0 -0
  300. /package/dist/cli-bundle/chunks/{chunk-26KTVXJW.js.map → chunk-6P6GGMOG.js.map} +0 -0
  301. /package/dist/cli-bundle/chunks/{chunk-MISYRLEP.js.map → chunk-77GFDHGF.js.map} +0 -0
  302. /package/dist/cli-bundle/chunks/{chunk-HPH6X4ZZ.js.map → chunk-AO442XLN.js.map} +0 -0
  303. /package/dist/cli-bundle/chunks/{chunk-ORTLYVA4.js.map → chunk-AY43SBIN.js.map} +0 -0
  304. /package/dist/cli-bundle/chunks/{chunk-D3WUNETC.js.map → chunk-BQHUILZS.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{chunk-KCMIYKTA.js.map → chunk-E5FJNAZA.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{chunk-OIQIXTNB.js.map → chunk-ECCMVXGM.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-5PAOPUZX.js.map → chunk-FRAUKRU2.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-JQI2HE55.js.map → chunk-GCOQW437.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-CWT53EYT.js.map → chunk-GGYWB3Y2.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-ATBVS6WW.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-ASQM3IF5.js.map → chunk-GXSUPCBV.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-SSFMJCPF.js.map → chunk-HZGUAH22.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-GPGAYASV.js.map → chunk-I2HSTRJF.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-RQAWLSUU.js.map → chunk-I6BNFU5X.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-OUF3ARDX.js.map → chunk-IJGCZSIQ.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-XX5LRINW.js.map → chunk-KAG77BY3.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-BNL6S7QH.js.map → chunk-KJ33AOCY.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-4PJQSECJ.js.map → chunk-KJE2FOS4.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-KBG47ZOY.js.map → chunk-LB3RUL2N.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-HZOS2UG5.js.map → chunk-LCM63IXU.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-VGO2T3TY.js.map → chunk-ME2YH6FN.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-ZRVSMOMR.js.map → chunk-MITFDD35.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-Y2AKE2HS.js.map → chunk-N7ACFE26.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-AXXKLVTW.js.map → chunk-NUZ5HKR4.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-KK6YPGH3.js.map → chunk-OVQCEJPG.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-B3N4TKNL.js.map → chunk-OZ7NSQHL.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-TK633IVD.js.map → chunk-PDDFYW4X.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-DFIZGAI5.js.map → chunk-PIU6RSL3.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-O5IBJE6S.js.map → chunk-PO3GSVFV.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-N5YF3VFN.js.map → chunk-Q7SPNHLW.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-RANZIID5.js.map → chunk-QO7EBBOM.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-LDJK7SHN.js.map → chunk-R6UFP2GE.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-CCUFLH4J.js.map → chunk-RWPSOIEE.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-UFCG3SWR.js.map → chunk-RZN6VURO.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-KA24HME7.js.map → chunk-T3LC5LKB.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-NQP3ECKF.js.map → chunk-TCD3R2PF.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-EHXPIKKP.js.map → chunk-TPH5XEVD.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-T2ORWB6D.js.map → chunk-UBOPJT3S.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-S3CV7JGJ.js.map → chunk-UM2GBHS4.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-G5BACLYH.js.map → chunk-W7XABV4H.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-K47WAYQV.js.map → chunk-WKY2IBOQ.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-7K24QB23.js.map → chunk-WOPXVEZP.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-DFUSXJDE.js.map → chunk-WSMOSYRD.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-CJDQB2ED.js.map → chunk-XLTD2HN3.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-TQ3ZK6VD.js.map → chunk-XSJCLN2R.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-XG7RJYHV.js.map → chunk-XTGLRY2Y.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-JB4RGL4V.js.map → chunk-YL2DJGYS.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{claim-AZLP7YFO.js.map → claim-4DBF6RVG.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{claim-ZFA7HKU4.js.map → claim-X2P4IB7J.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{close-RMHQ3KWH.js.map → close-3HDWDA3L.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{close-65DFYAVS.js.map → close-PTYFA45H.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{close-many-UKZSQGM7.js.map → close-many-7CGIDPTJ.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{close-many-AKPZNSGI.js.map → close-many-ERFO6LHR.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{comments-CJWXQI7X.js.map → comments-OONGABK5.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{comments-AGBNSJJH.js.map → comments-QKBYCWKD.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{config-DDPYIA6J.js.map → config-6FXCQKIF.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{config-5ON3ADRH.js.map → config-U4RZ4CQB.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{context-E6U3DWVM.js.map → context-FYYJGFWS.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{context-ZOJEN5VT.js.map → context-YMJ3Z2HQ.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{create-WYFKN2U4.js.map → create-I5L4EYYZ.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{create-ATONSAZW.js.map → create-JTZNCTQC.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{delete-ZXWC56WO.js.map → delete-7HPGI4GZ.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{delete-RONNH4F4.js.map → delete-VXUPH5RS.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{deps-WII3O4HB.js.map → deps-JSRRWC3Z.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{deps-EHXIFOZR.js.map → deps-SCZIFK2Z.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{docs-PDREIMLS.js.map → docs-GJK6K4VP.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{docs-JMVCFNHH.js.map → docs-WW4N3MBM.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{extension-G6UXSM5S.js.map → extension-J7IBMFTD.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{extension-B4ROVWJD.js.map → extension-VDY2U33M.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{files-2PN7UM2D.js.map → files-ISZJGILQ.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{files-MXYS5W4M.js.map → files-WKOD326U.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{get-WXMLRG7M.js.map → get-RV37HT3G.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{get-CINFEUIY.js.map → get-WXU6WI5P.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{history-6FC4H6HI.js.map → history-2BA3T5AE.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{history-FLZIP7PM.js.map → history-PKN67D5O.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{history-redact-XKYEZDBL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{history-redact-SSZBAD76.js.map → history-redact-V4FOJGS7.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{history-repair-KC5ZOJRZ.js.map → history-repair-HIBCBIKK.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{history-repair-X7CO5JJZ.js.map → history-repair-SDMHR7JT.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{init-KHX3FEEM.js.map → init-HIVSNX3O.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{init-6MRFVOLH.js.map → init-P56QYWJF.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{learnings-DCX55BNX.js.map → learnings-GDFRG5J7.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{learnings-A3CLB5CO.js.map → learnings-MIXSESLK.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{list-DBRECOG4.js.map → list-FGOWQMSM.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{list-53LZ2AEO.js.map → list-MUSQNMTD.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{notes-42LIC3UE.js.map → notes-4XVSH2AZ.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{notes-P5O3VMQ3.js.map → notes-5UK3GEH2.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{plan-IGTE3WOJ.js.map → plan-DUMBV3QB.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{plan-HDQXEUKD.js.map → plan-SLMODHWX.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{register-mutation-M3YS6XDO.js.map → register-mutation-N5GSUZJV.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{register-mutation-RSMT6DPK.js.map → register-mutation-OA675SOU.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{register-setup-DI6P7X75.js.map → register-setup-JIMPKJKV.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{register-setup-YJKIQRKA.js.map → register-setup-ZHJI2DI3.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{restore-JL5QIH7H.js.map → restore-D4RGNX33.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{restore-2XVTBLKQ.js.map → restore-PBL6T5TW.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{schema-V6BX65Q2.js.map → schema-2NOO6NGB.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{schema-LVXZWFGY.js.map → schema-EBI4NLUO.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{search-C7NPB7G7.js.map → search-JPUQTVCY.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{search-5A3BMFA7.js.map → search-OA6JX27A.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{test-RJ4ZF35X.js.map → test-MXX3E5JL.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{test-OFYONO3C.js.map → test-WBROAJIE.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{test-all-OJE6CIO7.js.map → test-all-N6NSRDTV.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{test-all-EEMKNTGU.js.map → test-all-NTOZ7C3M.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{test-runs-IPOPFOAF.js.map → test-runs-V6A7LPWZ.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{test-runs-L2M7WKH7.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{update-6YEHPVXH.js.map → update-OSV3NAQB.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{update-PYLVHMRD.js.map → update-YRXSUGYQ.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{update-many-DYWGW57M.js.map → update-many-EM6OXYGO.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{update-many-322CCH2L.js.map → update-many-KGGEYABR.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{upgrade-2U727SAM.js.map → upgrade-BLI7XBAJ.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{upgrade-3W3RVSNM.js.map → upgrade-LXPOQKFV.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{validate-ZFVWPEEN.js.map → validate-AGOAUOVW.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{validate-GZ24NYHO.js.map → validate-L5J6A7YO.js.map} +0 -0
@@ -1,27 +1,29 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c3c3a6a6-848a-5fe4-b29e-00bb9da9ec29")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="553e38e9-7271-599b-ac5e-73e58e64f044")}catch(e){}}();
3
3
  import {
4
+ cloneEmptyReplayDocument,
5
+ tryApplyReplayPatch,
4
6
  verifyHistoryChain
5
- } from "./chunk-ASQM3IF5.js";
7
+ } from "./chunk-GXSUPCBV.js";
6
8
  import {
7
9
  parseLimit
8
- } from "./chunk-GFWHHMVV.js";
10
+ } from "./chunk-3VAM3NNM.js";
9
11
  import {
10
12
  enforceHistoryStreamPolicyForItem,
11
13
  hashDocument,
12
14
  hashEmptyDocument,
13
15
  locateItem,
14
16
  readLocatedItem
15
- } from "./chunk-CWT53EYT.js";
17
+ } from "./chunk-GGYWB3Y2.js";
16
18
  import {
17
19
  normalizeItemId
18
- } from "./chunk-SSFMJCPF.js";
20
+ } from "./chunk-HZGUAH22.js";
19
21
  import {
20
22
  findFirstMergeConflictMarker
21
- } from "./chunk-KBG47ZOY.js";
23
+ } from "./chunk-LB3RUL2N.js";
22
24
  import {
23
25
  resolveItemTypeRegistry
24
- } from "./chunk-SZQCER6S.js";
26
+ } from "./chunk-2VBQ6ZXS.js";
25
27
  import {
26
28
  EXIT_CODE,
27
29
  PmCliError,
@@ -33,31 +35,106 @@ import {
33
35
  readSettings,
34
36
  resolvePmRoot,
35
37
  runActiveOnReadHooks
36
- } from "./chunk-4LTBNUYT.js";
38
+ } from "./chunk-5SFCOO6B.js";
37
39
 
38
- // dist/cli/commands/history.js
39
- function limitEntries(values, limit) {
40
- if (limit === void 0)
41
- return values;
42
- return values.slice(Math.max(0, values.length - limit));
43
- }
40
+ // dist/core/history/history-diff.js
44
41
  function decodeJsonPointerSegment(segment) {
45
42
  return segment.replaceAll("~1", "/").replaceAll("~0", "~");
46
43
  }
47
44
  function patchPathToChangedField(path) {
48
- if (path === "/body" || path.startsWith("/body/")) {
45
+ if (path === "/body" || path.startsWith("/body/"))
49
46
  return "body";
50
- }
51
47
  if (path === "/metadata" || path.startsWith("/metadata/") || path === "/front_matter" || path.startsWith("/front_matter/")) {
52
48
  const segment2 = path.replace(/^\/(?:metadata|front_matter)\/?/, "").split("/")[0];
53
- if (!segment2) {
49
+ if (!segment2)
54
50
  return "metadata";
55
- }
56
51
  return decodeJsonPointerSegment(segment2);
57
52
  }
58
53
  const segment = path.replace(/^\//, "").split("/")[0];
59
54
  return segment ? decodeJsonPointerSegment(segment) : "root";
60
55
  }
56
+ function readFieldValue(doc, field) {
57
+ if (field === "body")
58
+ return doc.body;
59
+ if (field === "metadata")
60
+ return doc.metadata;
61
+ if (field === "root")
62
+ return doc;
63
+ return doc.metadata[field];
64
+ }
65
+ function computeHistoryDiff(fullEntries, options) {
66
+ const windowStartIndex = options?.windowStartIndex ?? 0;
67
+ const fieldFilter = options?.field;
68
+ if (fullEntries.length === 0 || windowStartIndex >= fullEntries.length) {
69
+ return [];
70
+ }
71
+ let current = cloneEmptyReplayDocument();
72
+ const result = [];
73
+ for (let p = 0; p < fullEntries.length; p += 1) {
74
+ const entry = fullEntries[p];
75
+ const beforeDoc = current;
76
+ const applied = tryApplyReplayPatch(current, entry.patch);
77
+ let afterDoc;
78
+ if (applied.ok) {
79
+ afterDoc = applied.document;
80
+ current = afterDoc;
81
+ } else {
82
+ afterDoc = beforeDoc;
83
+ }
84
+ const changedFieldSet = /* @__PURE__ */ new Set();
85
+ for (const patchOp of entry.patch) {
86
+ changedFieldSet.add(patchPathToChangedField(patchOp.path));
87
+ if (patchOp.from !== void 0) {
88
+ changedFieldSet.add(patchPathToChangedField(patchOp.from));
89
+ }
90
+ }
91
+ const sortedFields = [...changedFieldSet].sort((a, b) => a.localeCompare(b));
92
+ if (p >= windowStartIndex) {
93
+ if (fieldFilter !== void 0) {
94
+ if (!changedFieldSet.has(fieldFilter)) {
95
+ continue;
96
+ }
97
+ const change = {
98
+ field: fieldFilter,
99
+ before: readFieldValue(beforeDoc, fieldFilter),
100
+ after: readFieldValue(afterDoc, fieldFilter)
101
+ };
102
+ result.push({
103
+ index: p + 1,
104
+ ts: entry.ts,
105
+ op: entry.op,
106
+ author: entry.author,
107
+ patch_ops: entry.patch.length,
108
+ changed_fields: [fieldFilter],
109
+ changes: [change]
110
+ });
111
+ } else {
112
+ const changes = sortedFields.map((field) => ({
113
+ field,
114
+ before: readFieldValue(beforeDoc, field),
115
+ after: readFieldValue(afterDoc, field)
116
+ }));
117
+ result.push({
118
+ index: p + 1,
119
+ ts: entry.ts,
120
+ op: entry.op,
121
+ author: entry.author,
122
+ patch_ops: entry.patch.length,
123
+ changed_fields: sortedFields,
124
+ changes
125
+ });
126
+ }
127
+ }
128
+ }
129
+ return result;
130
+ }
131
+
132
+ // dist/cli/commands/history.js
133
+ function limitEntries(values, limit) {
134
+ if (limit === void 0)
135
+ return values;
136
+ return values.slice(Math.max(0, values.length - limit));
137
+ }
61
138
  function buildDiffEntries(entries, startIndex) {
62
139
  return entries.map((entry, index) => {
63
140
  const changedFields = /* @__PURE__ */ new Set();
@@ -148,8 +225,11 @@ async function runHistory(id, options, global) {
148
225
  count: history.length,
149
226
  limit: limit ?? null
150
227
  };
151
- if (options.diff) {
152
- result.diff = compact ? [] : buildDiffEntries(history, Math.max(0, fullHistory.length - history.length));
228
+ if (options.diff || options.field !== void 0) {
229
+ result.diff = computeHistoryDiff(fullHistory, {
230
+ windowStartIndex: Math.max(0, fullHistory.length - history.length),
231
+ field: options.field
232
+ });
153
233
  }
154
234
  if (options.verify) {
155
235
  const verification = verifyHistoryChain(fullHistory);
@@ -181,6 +261,6 @@ export {
181
261
  readHistoryEntries,
182
262
  runHistory
183
263
  };
184
- //# sourceMappingURL=chunk-V3JQ4IPL.js.map
264
+ //# sourceMappingURL=chunk-2RSPZI5H.js.map
185
265
 
186
- //# debugId=c3c3a6a6-848a-5fe4-b29e-00bb9da9ec29
266
+ //# debugId=553e38e9-7271-599b-ac5e-73e58e64f044
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../core/history/history-diff.ts","../../../../../../../../cli/commands/history.ts"],"sourcesContent":["import { cloneEmptyReplayDocument, tryApplyReplayPatch, type ReplayDocument } from \"./replay.js\";\nimport type { HistoryEntry } from \"../../types/index.js\";\n\nexport interface HistoryFieldChange {\n field: string;\n // before and after are the raw field values captured by replaying the history chain.\n // `undefined` is intentional: it signals that the field was absent in the document at\n // that point (e.g. after a JSON-Patch `remove` op). JSON serialization will omit\n // undefined values, which correctly communicates \"field did not exist\".\n before: unknown;\n after: unknown;\n}\n\nexport interface HistoryDiffValueEntry {\n /** 1-based position in the FULL stream (fullEntries index + 1). */\n index: number;\n ts: string;\n op: string;\n author: string;\n /** Number of JSON-patch operations in this entry (entry.patch.length). */\n patch_ops: number;\n /** Unique field names touched by this entry, sorted by localeCompare. */\n changed_fields: string[];\n /** Per-field before/after values, sorted by field name (localeCompare). */\n changes: HistoryFieldChange[];\n}\n\n// ---------------------------------------------------------------------------\n// JSON-Pointer helpers (ported from src/cli/commands/history.ts so the\n// orchestrator can replace the private copy there with an import from here).\n// ---------------------------------------------------------------------------\n\nfunction decodeJsonPointerSegment(segment: string): string {\n return segment.replaceAll(\"~1\", \"/\").replaceAll(\"~0\", \"~\");\n}\n\n/**\n * Map a JSON-Patch path string to a human-readable changed-field name.\n *\n * Rules (in priority order):\n * - \"/body\" or \"/body/…\" → \"body\"\n * - \"/metadata/…\" or \"/front_matter/…\"\n * with a first segment → that decoded segment (e.g. \"status\")\n * without a first segment (bare prefix) → \"metadata\"\n * - \"/\" (root pointer, empty segment after strip) → \"root\"\n * - anything else → decoded first path segment\n */\nexport function patchPathToChangedField(path: string): string {\n if (path === \"/body\" || path.startsWith(\"/body/\")) return \"body\";\n if (\n path === \"/metadata\" ||\n path.startsWith(\"/metadata/\") ||\n path === \"/front_matter\" ||\n path.startsWith(\"/front_matter/\")\n ) {\n const segment = path.replace(/^\\/(?:metadata|front_matter)\\/?/, \"\").split(\"/\")[0];\n if (!segment) return \"metadata\";\n return decodeJsonPointerSegment(segment);\n }\n const segment = path.replace(/^\\//, \"\").split(\"/\")[0];\n return segment ? decodeJsonPointerSegment(segment) : \"root\";\n}\n\n// ---------------------------------------------------------------------------\n// Field-value reader\n// ---------------------------------------------------------------------------\n\n/**\n * Extract the before/after value for a logical field from a replay document.\n *\n * - \"body\" → doc.body\n * - \"metadata\" → doc.metadata (the whole object, for a bare /metadata replace)\n * - \"root\" → the whole document (for a bare \"/\" patch op)\n * - other → doc.metadata[field] (may be undefined when the field was absent)\n */\nfunction readFieldValue(doc: ReplayDocument, field: string): unknown {\n if (field === \"body\") return doc.body;\n if (field === \"metadata\") return doc.metadata;\n if (field === \"root\") return doc;\n return doc.metadata[field];\n}\n\n// ---------------------------------------------------------------------------\n// Main export\n// ---------------------------------------------------------------------------\n\n/**\n * Replay a full history entry stream and produce enriched diff entries with\n * per-field before/after values.\n *\n * @param fullEntries The complete ordered history chain to replay.\n * @param options.windowStartIndex 0-based index into fullEntries at which the\n * DISPLAYED window begins. Entries before this index are still replayed (so\n * state is accurate) but are not emitted. Defaults to 0.\n * @param options.field When supplied, only entries that changed this field are\n * emitted, and each emitted entry's `changes` and `changed_fields` are\n * restricted to that single field.\n */\nexport function computeHistoryDiff(\n fullEntries: HistoryEntry[],\n options?: { windowStartIndex?: number; field?: string },\n): HistoryDiffValueEntry[] {\n const windowStartIndex = options?.windowStartIndex ?? 0;\n const fieldFilter = options?.field;\n\n if (fullEntries.length === 0 || windowStartIndex >= fullEntries.length) {\n return [];\n }\n\n let current = cloneEmptyReplayDocument();\n const result: HistoryDiffValueEntry[] = [];\n\n for (let p = 0; p < fullEntries.length; p += 1) {\n const entry = fullEntries[p];\n\n // Capture before state.\n const beforeDoc = current;\n\n // Attempt to apply patch.\n const applied = tryApplyReplayPatch(current, entry.patch);\n let afterDoc: ReplayDocument;\n if (applied.ok) {\n afterDoc = applied.document;\n current = afterDoc;\n } else {\n // Patch failed — use before state as after (cannot trust partial result).\n // Do NOT advance current; keep prior replay state.\n afterDoc = beforeDoc;\n }\n\n // Collect changed field names from patch paths (and from: paths for move/copy).\n const changedFieldSet = new Set<string>();\n for (const patchOp of entry.patch) {\n changedFieldSet.add(patchPathToChangedField(patchOp.path));\n if (patchOp.from !== undefined) {\n changedFieldSet.add(patchPathToChangedField(patchOp.from));\n }\n }\n const sortedFields = [...changedFieldSet].sort((a, b) => a.localeCompare(b));\n\n // Only emit entries in the display window.\n if (p >= windowStartIndex) {\n // Apply field filter: skip this entry entirely if it doesn't touch the\n // requested field; otherwise narrow down to only that field.\n if (fieldFilter !== undefined) {\n if (!changedFieldSet.has(fieldFilter)) {\n // This entry does not touch the requested field — skip it.\n continue;\n }\n // Emit only the filtered field.\n const change: HistoryFieldChange = {\n field: fieldFilter,\n before: readFieldValue(beforeDoc, fieldFilter),\n after: readFieldValue(afterDoc, fieldFilter),\n };\n result.push({\n index: p + 1,\n ts: entry.ts,\n op: entry.op,\n author: entry.author,\n patch_ops: entry.patch.length,\n changed_fields: [fieldFilter],\n changes: [change],\n });\n } else {\n // Emit all changed fields.\n const changes: HistoryFieldChange[] = sortedFields.map((field) => ({\n field,\n before: readFieldValue(beforeDoc, field),\n after: readFieldValue(afterDoc, field),\n }));\n result.push({\n index: p + 1,\n ts: entry.ts,\n op: entry.op,\n author: entry.author,\n patch_ops: entry.patch.length,\n changed_fields: sortedFields,\n changes,\n });\n }\n }\n }\n\n return result;\n}\n","import { pathExists, readFileIfExists } from \"../../core/fs/fs-utils.js\";\nimport { computeHistoryDiff, patchPathToChangedField, type HistoryDiffValueEntry } from \"../../core/history/history-diff.js\";\nimport { hashDocument, hashEmptyDocument } from \"../../core/history/history.js\";\nimport { verifyHistoryChain } from \"../../core/history/replay.js\";\nimport { enforceHistoryStreamPolicyForItem } from \"../../core/history/history-stream-policy.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../../core/shared/conflict-markers.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { getActiveExtensionRegistrations, runActiveOnReadHooks } from \"../../core/extensions/index.js\";\nimport { normalizeItemId } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { locateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\nimport type { HistoryEntry } from \"../../types/index.js\";\n\nexport { verifyHistoryChain } from \"../../core/history/replay.js\";\n\nexport interface HistoryCommandOptions {\n limit?: string;\n diff?: boolean;\n /** Restrict --diff to a single field's before/after transitions (implies --diff). */\n field?: string;\n verify?: boolean;\n compact?: boolean;\n}\n\nexport interface HistoryDiffEntry {\n index: number;\n ts: string;\n op: string;\n author: string;\n patch_ops: number;\n changed_fields: string[];\n}\n\nexport interface HistoryVerificationResult {\n ok: boolean;\n entries: number;\n errors: string[];\n latest_after_hash?: string;\n current_item_hash?: string;\n current_matches_latest?: boolean;\n}\n\nexport interface HistoryResult {\n id: string;\n history: HistoryEntry[];\n compact_history?: HistoryDiffEntry[];\n compact: boolean;\n count: number;\n limit: number | null;\n diff?: HistoryDiffValueEntry[];\n verification?: HistoryVerificationResult;\n}\n\nfunction limitEntries<T>(values: T[], limit: number | undefined): T[] {\n if (limit === undefined) return values;\n return values.slice(Math.max(0, values.length - limit));\n}\n\nfunction buildDiffEntries(entries: HistoryEntry[], startIndex: number): HistoryDiffEntry[] {\n return entries.map((entry, index) => {\n const changedFields = new Set<string>();\n for (const op of entry.patch) {\n changedFields.add(patchPathToChangedField(op.path));\n if (op.from) {\n changedFields.add(patchPathToChangedField(op.from));\n }\n }\n return {\n index: startIndex + index + 1,\n ts: entry.ts,\n op: entry.op,\n author: entry.author,\n patch_ops: entry.patch.length,\n changed_fields: [...changedFields].sort((left, right) => left.localeCompare(right)),\n };\n });\n}\n\nexport async function readHistoryEntries(historyPath: string, itemId: string): Promise<HistoryEntry[]> {\n const raw = await readFileIfExists(historyPath);\n if (raw === null) {\n return [];\n }\n await runActiveOnReadHooks({\n path: historyPath,\n scope: \"project\",\n });\n if (raw.trim() === \"\") {\n return [];\n }\n const conflictMarker = findFirstMergeConflictMarker(raw);\n if (conflictMarker) {\n throw new PmCliError(\n `History for ${itemId} contains merge conflict markers at line ${conflictMarker.line} (${conflictMarker.marker}). Resolve <<<<<<< ======= >>>>>>> markers and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n {\n code: \"history_merge_conflict_markers_detected\",\n required: \"Repair the history stream by resolving merge-conflict markers.\",\n why: \"Conflict markers break JSONL parsing and invalidate deterministic audit history.\",\n examples: [`pm history ${itemId}`, `pm restore ${itemId} <timestamp-or-version>`],\n nextSteps: [\"Resolve or restore the history file, then rerun the command.\"],\n },\n );\n }\n\n const entries: HistoryEntry[] = [];\n const lines = raw.split(/\\r?\\n/);\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]?.trim();\n if (!line) continue;\n try {\n entries.push(JSON.parse(line) as HistoryEntry);\n } catch {\n throw new PmCliError(\n `History for ${itemId} contains invalid JSON at line ${index + 1}. Repair or restore the history stream and retry.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n }\n return entries;\n}\n\nexport async function runHistory(id: string, options: HistoryCommandOptions, global: GlobalOptions): Promise<HistoryResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const limit = parseLimit(options.limit);\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const normalizedId = normalizeItemId(id, settings.id_prefix);\n const located = await locateItem(\n pmRoot,\n normalizedId,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n const resolvedId = located?.id ?? normalizedId;\n const historyPath = getHistoryPath(pmRoot, resolvedId);\n if (!located && !(await pathExists(historyPath))) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n if (located) {\n await enforceHistoryStreamPolicyForItem({\n pmRoot,\n settings,\n itemId: located.id,\n commandLabel: \"history\",\n });\n }\n\n const fullHistory = await readHistoryEntries(historyPath, resolvedId);\n const history = limitEntries(fullHistory, limit);\n const compact = options.compact === true;\n const compactHistory = compact ? buildDiffEntries(history, Math.max(0, fullHistory.length - history.length)) : undefined;\n const result: HistoryResult = {\n id: resolvedId,\n history: compact ? [] : history,\n compact_history: compactHistory,\n compact,\n count: history.length,\n limit: limit ?? null,\n };\n\n if (options.diff || options.field !== undefined) {\n // --diff replays the full chain to surface per-field before/after values for\n // the displayed window (the latest --limit entries). --field narrows to a\n // single field's transitions (\"when did status change?\"). Unlike the compact\n // projection above, the value diff is independent of the compact/full toggle.\n result.diff = computeHistoryDiff(fullHistory, {\n windowStartIndex: Math.max(0, fullHistory.length - history.length),\n field: options.field,\n });\n }\n\n if (options.verify) {\n const verification = verifyHistoryChain(fullHistory);\n const latestAfterHash = fullHistory.length > 0 ? fullHistory[fullHistory.length - 1].after_hash : hashEmptyDocument();\n let currentItemHash: string | undefined;\n let currentMatchesLatest: boolean | undefined;\n const errors = [...verification.errors];\n\n if (located) {\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n currentItemHash = hashDocument(loaded.document);\n currentMatchesLatest = currentItemHash === latestAfterHash;\n if (!currentMatchesLatest) {\n errors.push(\"verify_failed:current_item_hash_mismatch\");\n }\n }\n\n result.verification = {\n ok: errors.length === 0,\n entries: fullHistory.length,\n errors,\n latest_after_hash: fullHistory.length > 0 ? fullHistory[fullHistory.length - 1].after_hash : undefined,\n current_item_hash: currentItemHash,\n current_matches_latest: currentMatchesLatest,\n };\n }\n\n return result;\n}\n"],"names":["segment"],"mappings":"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","debugId":"553e38e9-7271-599b-ac5e-73e58e64f044"}
@@ -6,7 +6,7 @@ import {
6
6
  normalizeItemTypeDefinition,
7
7
  normalizeItemTypeStringList,
8
8
  strictPolicyCommand
9
- } from "./chunk-4LTBNUYT.js";
9
+ } from "./chunk-5SFCOO6B.js";
10
10
 
11
11
  // dist/core/item/type-registry.js
12
12
  var DEFAULT_REQUIRED_CREATE_FIELDS = [
@@ -626,6 +626,6 @@ export {
626
626
  resolveCommandOptionPolicyState,
627
627
  validateTypeOptions
628
628
  };
629
- //# sourceMappingURL=chunk-SZQCER6S.js.map
629
+ //# sourceMappingURL=chunk-2VBQ6ZXS.js.map
630
630
 
631
631
  //# debugId=504f2618-801b-5331-a3a6-ff97713cf336
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-J27KIHTG.js";
6
6
  import {
7
7
  readHistoryEntries
8
- } from "./chunk-V3JQ4IPL.js";
8
+ } from "./chunk-2RSPZI5H.js";
9
9
  import {
10
10
  EMPTY_REPLAY_DOCUMENT,
11
11
  normalizeReplayPatchOps,
12
12
  replayHash,
13
13
  toReplayDocument
14
- } from "./chunk-ASQM3IF5.js";
14
+ } from "./chunk-GXSUPCBV.js";
15
15
  import {
16
16
  acquireLock,
17
17
  appendHistoryEntry,
@@ -19,21 +19,21 @@ import {
19
19
  enforceHistoryStreamPolicyForItem,
20
20
  locateItem,
21
21
  readLocatedItem
22
- } from "./chunk-CWT53EYT.js";
22
+ } from "./chunk-GGYWB3Y2.js";
23
23
  import {
24
24
  normalizeItemId,
25
25
  normalizeRawItemId
26
- } from "./chunk-SSFMJCPF.js";
26
+ } from "./chunk-HZGUAH22.js";
27
27
  import {
28
28
  canonicalDocument,
29
29
  serializeItemDocument
30
- } from "./chunk-KBG47ZOY.js";
30
+ } from "./chunk-LB3RUL2N.js";
31
31
  import {
32
32
  resolveItemTypeRegistry
33
- } from "./chunk-SZQCER6S.js";
33
+ } from "./chunk-2VBQ6ZXS.js";
34
34
  import {
35
35
  nowIso
36
- } from "./chunk-NQP3ECKF.js";
36
+ } from "./chunk-TCD3R2PF.js";
37
37
  import {
38
38
  EXIT_CODE,
39
39
  PmCliError,
@@ -49,7 +49,7 @@ import {
49
49
  resolvePmRoot,
50
50
  runActiveOnWriteHooks,
51
51
  writeFileAtomic
52
- } from "./chunk-4LTBNUYT.js";
52
+ } from "./chunk-5SFCOO6B.js";
53
53
 
54
54
  // dist/cli/commands/restore.js
55
55
  import jsonPatch from "fast-json-patch";
@@ -375,6 +375,6 @@ async function runRestore(id, target, options, global) {
375
375
  export {
376
376
  runRestore
377
377
  };
378
- //# sourceMappingURL=chunk-A6PEXMYN.js.map
378
+ //# sourceMappingURL=chunk-2VVCGBNV.js.map
379
379
 
380
380
  //# debugId=da2f3582-6928-5ecb-a08e-764043714391
@@ -14,27 +14,27 @@ import {
14
14
  parseLinkedTestMinLines,
15
15
  parseLinkedTestRegexList,
16
16
  parseLinkedTestStringList
17
- } from "./chunk-KCMIYKTA.js";
17
+ } from "./chunk-E5FJNAZA.js";
18
18
  import {
19
19
  createStdinTokenResolver,
20
20
  parseCsvKv,
21
21
  parseOptionalNumber
22
- } from "./chunk-O5IBJE6S.js";
22
+ } from "./chunk-PO3GSVFV.js";
23
23
  import {
24
24
  runInit
25
- } from "./chunk-ORTLYVA4.js";
25
+ } from "./chunk-AY43SBIN.js";
26
26
  import {
27
27
  locateItem,
28
28
  mutateItem,
29
29
  readLocatedItem
30
- } from "./chunk-CWT53EYT.js";
30
+ } from "./chunk-GGYWB3Y2.js";
31
31
  import {
32
32
  resolveItemTypeRegistry
33
- } from "./chunk-SZQCER6S.js";
33
+ } from "./chunk-2VBQ6ZXS.js";
34
34
  import {
35
35
  compareTimestampStrings,
36
36
  nowIso
37
- } from "./chunk-NQP3ECKF.js";
37
+ } from "./chunk-TCD3R2PF.js";
38
38
  import {
39
39
  EXIT_CODE,
40
40
  ITEM_FILE_EXTENSIONS,
@@ -47,7 +47,7 @@ import {
47
47
  resolveGlobalPmRoot,
48
48
  resolvePmRoot,
49
49
  stableValueEquals
50
- } from "./chunk-4LTBNUYT.js";
50
+ } from "./chunk-5SFCOO6B.js";
51
51
 
52
52
  // dist/cli/commands/test.js
53
53
  import { spawn } from "node:child_process";
@@ -1659,6 +1659,6 @@ export {
1659
1659
  runLinkedTests,
1660
1660
  runTest
1661
1661
  };
1662
- //# sourceMappingURL=chunk-UOVLWB47.js.map
1662
+ //# sourceMappingURL=chunk-3BWOVLTH.js.map
1663
1663
 
1664
1664
  //# debugId=fb2ef78d-78c8-5583-8c98-89541410a9ff
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  locateItem,
3
3
  readLocatedItem
4
- } from "./chunk-XG7RJYHV.js";
4
+ } from "./chunk-XTGLRY2Y.js";
5
5
  import {
6
6
  resolveItemTypeRegistry
7
- } from "./chunk-4PJQSECJ.js";
7
+ } from "./chunk-KJE2FOS4.js";
8
8
  import {
9
9
  nowIso
10
- } from "./chunk-RANZIID5.js";
10
+ } from "./chunk-QO7EBBOM.js";
11
11
  import {
12
12
  getActiveExtensionRegistrations,
13
13
  getSettingsPath,
@@ -21,7 +21,7 @@ import {
21
21
  toNonEmptyString,
22
22
  trimTrailingSlashes,
23
23
  writeFileAtomic
24
- } from "./chunk-SRVKTWPR.js";
24
+ } from "./chunk-U5SXYXSY.js";
25
25
 
26
26
  // dist/core/search/http-client.js
27
27
  !(function() {
@@ -1888,4 +1888,4 @@ export {
1888
1888
  refreshSemanticEmbeddingsForMutatedItems,
1889
1889
  refreshSearchArtifactsForMutation
1890
1890
  };
1891
- //# sourceMappingURL=chunk-5IRA6IYD.js.map
1891
+ //# sourceMappingURL=chunk-3FI4SEFT.js.map
@@ -3,16 +3,16 @@ import {
3
3
  parseItemTypesFile,
4
4
  serializeItemTypesFile,
5
5
  upsertItemType
6
- } from "./chunk-KK6YPGH3.js";
6
+ } from "./chunk-OVQCEJPG.js";
7
7
  import {
8
8
  runExtension
9
- } from "./chunk-OIQIXTNB.js";
9
+ } from "./chunk-ECCMVXGM.js";
10
10
  import {
11
11
  normalizePrefix
12
- } from "./chunk-KA24HME7.js";
12
+ } from "./chunk-T3LC5LKB.js";
13
13
  import {
14
14
  resolveItemTypeRegistry
15
- } from "./chunk-4PJQSECJ.js";
15
+ } from "./chunk-KJE2FOS4.js";
16
16
  import {
17
17
  DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
18
18
  EXIT_CODE,
@@ -31,7 +31,7 @@ import {
31
31
  runActiveOnWriteHooks,
32
32
  writeFileAtomic,
33
33
  writeSettings
34
- } from "./chunk-SRVKTWPR.js";
34
+ } from "./chunk-U5SXYXSY.js";
35
35
 
36
36
  // dist/cli/commands/init.js
37
37
  import fs2 from "node:fs/promises";
@@ -758,4 +758,4 @@ export {
758
758
  summarizeInitResult,
759
759
  runInit
760
760
  };
761
- //# sourceMappingURL=chunk-3OH4DAEB.js.map
761
+ //# sourceMappingURL=chunk-3LB74A67.js.map
@@ -2,11 +2,11 @@
2
2
  !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5290e29c-a147-56df-94c4-59907951e37f")}catch(e){}}();
3
3
  import {
4
4
  resolveTypeName
5
- } from "./chunk-SZQCER6S.js";
5
+ } from "./chunk-2VBQ6ZXS.js";
6
6
  import {
7
7
  EXIT_CODE,
8
8
  PmCliError
9
- } from "./chunk-4LTBNUYT.js";
9
+ } from "./chunk-5SFCOO6B.js";
10
10
 
11
11
  // dist/cli/shared-parsers.js
12
12
  function parseLimit(raw, label = "--limit") {
@@ -52,6 +52,6 @@ export {
52
52
  parsePriority,
53
53
  parseType
54
54
  };
55
- //# sourceMappingURL=chunk-GFWHHMVV.js.map
55
+ //# sourceMappingURL=chunk-3VAM3NNM.js.map
56
56
 
57
57
  //# debugId=5290e29c-a147-56df-94c4-59907951e37f
@@ -3,13 +3,13 @@
3
3
  import {
4
4
  locateItem,
5
5
  readLocatedItem
6
- } from "./chunk-CWT53EYT.js";
6
+ } from "./chunk-GGYWB3Y2.js";
7
7
  import {
8
8
  resolveItemTypeRegistry
9
- } from "./chunk-SZQCER6S.js";
9
+ } from "./chunk-2VBQ6ZXS.js";
10
10
  import {
11
11
  nowIso
12
- } from "./chunk-NQP3ECKF.js";
12
+ } from "./chunk-TCD3R2PF.js";
13
13
  import {
14
14
  getActiveExtensionRegistrations,
15
15
  getSettingsPath,
@@ -23,7 +23,7 @@ import {
23
23
  toNonEmptyString,
24
24
  trimTrailingSlashes,
25
25
  writeFileAtomic
26
- } from "./chunk-4LTBNUYT.js";
26
+ } from "./chunk-5SFCOO6B.js";
27
27
 
28
28
  // dist/core/search/http-client.js
29
29
  var DEFAULT_SEARCH_HTTP_TIMEOUT_MS = 3e4;
@@ -1827,6 +1827,6 @@ export {
1827
1827
  refreshSemanticEmbeddingsForMutatedItems,
1828
1828
  refreshSearchArtifactsForMutation
1829
1829
  };
1830
- //# sourceMappingURL=chunk-4QCR4QW3.js.map
1830
+ //# sourceMappingURL=chunk-4LL6TK5B.js.map
1831
1831
 
1832
1832
  //# debugId=4b15a57b-7749-5749-88f4-6d73a35071b5
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  verifyHistoryChain
3
- } from "./chunk-S3CV7JGJ.js";
3
+ } from "./chunk-UM2GBHS4.js";
4
4
  import {
5
5
  hashDocument
6
- } from "./chunk-XG7RJYHV.js";
6
+ } from "./chunk-XTGLRY2Y.js";
7
7
  import {
8
8
  getHistoryPath,
9
9
  writeFileAtomic
10
- } from "./chunk-SRVKTWPR.js";
10
+ } from "./chunk-U5SXYXSY.js";
11
11
 
12
12
  // dist/core/history/drift-scan.js
13
13
  import fs from "fs/promises";
@@ -419,4 +419,4 @@ export {
419
419
  buildRemediationMap,
420
420
  buildRemediationCommands
421
421
  };
422
- //# sourceMappingURL=chunk-TBQVUNVH.js.map
422
+ //# sourceMappingURL=chunk-52MAOQ6J.js.map
@@ -2,14 +2,14 @@
2
2
  !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7064c464-ee52-5164-a51a-6a337b42c837")}catch(e){}}();
3
3
  import {
4
4
  verifyHistoryChain
5
- } from "./chunk-ASQM3IF5.js";
5
+ } from "./chunk-GXSUPCBV.js";
6
6
  import {
7
7
  hashDocument
8
- } from "./chunk-CWT53EYT.js";
8
+ } from "./chunk-GGYWB3Y2.js";
9
9
  import {
10
10
  getHistoryPath,
11
11
  writeFileAtomic
12
- } from "./chunk-4LTBNUYT.js";
12
+ } from "./chunk-5SFCOO6B.js";
13
13
 
14
14
  // dist/core/history/drift-scan.js
15
15
  import fs from "fs/promises";
@@ -407,6 +407,6 @@ export {
407
407
  buildRemediationMap,
408
408
  buildRemediationCommands
409
409
  };
410
- //# sourceMappingURL=chunk-5KB4X7YY.js.map
410
+ //# sourceMappingURL=chunk-5FDATVEZ.js.map
411
411
 
412
412
  //# debugId=7064c464-ee52-5164-a51a-6a337b42c837
@@ -1,6 +1,6 @@
1
1
  // dist/core/fs/fs-utils.js
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ba0e58d6-49b8-5381-ad9e-e68ab249dc60")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2113715d-ebf3-5135-897f-495b04e82b35")}catch(e){}}();
4
4
  import fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import crypto from "node:crypto";
@@ -4854,6 +4854,7 @@ function normalizeItemTypeDefinition(definition, options = {}) {
4854
4854
 
4855
4855
  // dist/core/store/settings.js
4856
4856
  var SETTINGS_WRITE_OP = "settings:write";
4857
+ var SETTINGS_PERSIST_SOURCE_SYMBOL = /* @__PURE__ */ Symbol("pm.settings.persist_source");
4857
4858
  function resolveGovernanceKnobsFromPreset(preset) {
4858
4859
  return structuredClone(GOVERNANCE_PRESET_DEFAULTS[preset]);
4859
4860
  }
@@ -4928,6 +4929,64 @@ function normalizeSearchMutationRefreshPolicy(value) {
4928
4929
  }
4929
4930
  return SETTINGS_DEFAULTS.search.mutation_refresh_policy;
4930
4931
  }
4932
+ function buildSettingsPersistSourceSnapshot(parsedSettings, runtimeSettings) {
4933
+ const sourceSchema = parsedSettings.schema;
4934
+ const sourceStatuses = Array.isArray(sourceSchema?.statuses) ? sourceSchema?.statuses : void 0;
4935
+ const sourceFields = Array.isArray(sourceSchema?.fields) ? sourceSchema?.fields : void 0;
4936
+ const sourceTypeWorkflows = Array.isArray(sourceSchema?.type_workflows) ? sourceSchema?.type_workflows : void 0;
4937
+ return {
4938
+ has_source_item_type_definitions: Array.isArray(parsedSettings.item_types?.definitions),
4939
+ source_item_type_definitions: normalizeItemTypeDefinitions(parsedSettings.item_types?.definitions),
4940
+ has_source_schema_statuses: sourceStatuses !== void 0,
4941
+ source_schema_statuses: sourceStatuses ? structuredClone(sourceStatuses) : [],
4942
+ has_source_schema_fields: sourceFields !== void 0,
4943
+ source_schema_fields: sourceFields ? structuredClone(sourceFields) : [],
4944
+ has_source_schema_type_workflows: sourceTypeWorkflows !== void 0,
4945
+ source_schema_type_workflows: sourceTypeWorkflows ? structuredClone(sourceTypeWorkflows) : [],
4946
+ runtime_item_type_definitions: normalizeItemTypeDefinitions(runtimeSettings.item_types?.definitions),
4947
+ runtime_schema_statuses: structuredClone(runtimeSettings.schema.statuses),
4948
+ runtime_schema_fields: structuredClone(runtimeSettings.schema.fields),
4949
+ runtime_schema_type_workflows: structuredClone(runtimeSettings.schema.type_workflows ?? [])
4950
+ };
4951
+ }
4952
+ function attachSettingsPersistSourceSnapshot(settings, source) {
4953
+ Object.defineProperty(settings, SETTINGS_PERSIST_SOURCE_SYMBOL, {
4954
+ value: source,
4955
+ writable: true,
4956
+ configurable: true,
4957
+ enumerable: false
4958
+ });
4959
+ }
4960
+ function getSettingsPersistSourceSnapshot(settings) {
4961
+ const candidate = settings[SETTINGS_PERSIST_SOURCE_SYMBOL];
4962
+ if (!candidate || typeof candidate !== "object") {
4963
+ return void 0;
4964
+ }
4965
+ return candidate;
4966
+ }
4967
+ function resolvePersistedFileBackedSchemaSections(settings, source) {
4968
+ const normalizedSchema = normalizeRuntimeSchemaSettings(settings.schema);
4969
+ const currentItemTypeDefinitions = normalizeItemTypeDefinitions(settings.item_types?.definitions);
4970
+ if (!source) {
4971
+ return {
4972
+ item_type_definitions: currentItemTypeDefinitions,
4973
+ schema_statuses: normalizedSchema.statuses,
4974
+ schema_fields: normalizedSchema.fields,
4975
+ schema_type_workflows: normalizedSchema.type_workflows
4976
+ };
4977
+ }
4978
+ const currentTypeWorkflows = normalizedSchema.type_workflows ?? [];
4979
+ const itemTypeDefinitionsUnchanged = stableValueEquals(currentItemTypeDefinitions, source.runtime_item_type_definitions);
4980
+ const schemaStatusesUnchanged = stableValueEquals(normalizedSchema.statuses, source.runtime_schema_statuses);
4981
+ const schemaFieldsUnchanged = stableValueEquals(normalizedSchema.fields, source.runtime_schema_fields);
4982
+ const schemaTypeWorkflowsUnchanged = stableValueEquals(currentTypeWorkflows, source.runtime_schema_type_workflows);
4983
+ return {
4984
+ item_type_definitions: itemTypeDefinitionsUnchanged ? source.has_source_item_type_definitions ? normalizeItemTypeDefinitions(source.source_item_type_definitions) : [] : currentItemTypeDefinitions,
4985
+ schema_statuses: schemaStatusesUnchanged ? source.has_source_schema_statuses ? structuredClone(source.source_schema_statuses) : [] : normalizedSchema.statuses,
4986
+ schema_fields: schemaFieldsUnchanged ? source.has_source_schema_fields ? structuredClone(source.source_schema_fields) : [] : normalizedSchema.fields,
4987
+ schema_type_workflows: schemaTypeWorkflowsUnchanged ? source.has_source_schema_type_workflows ? structuredClone(source.source_schema_type_workflows) : void 0 : normalizedSchema.type_workflows
4988
+ };
4989
+ }
4931
4990
  function buildFallbackSettingsReadResult(warning) {
4932
4991
  return {
4933
4992
  settings: cloneDefaults(),
@@ -5173,8 +5232,10 @@ function mergeSettings(settings) {
5173
5232
  }
5174
5233
  };
5175
5234
  }
5176
- function serializeSettings(settings) {
5235
+ function serializeSettings(settings, options = {}) {
5177
5236
  const governance = resolveGovernanceKnobs(settings);
5237
+ const normalizedSchema = normalizeRuntimeSchemaSettings(settings.schema);
5238
+ const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(settings, options.persist_source);
5178
5239
  const normalizedSettings = {
5179
5240
  ...settings,
5180
5241
  item_format: "toon",
@@ -5191,9 +5252,14 @@ function serializeSettings(settings) {
5191
5252
  governance,
5192
5253
  agent_guidance: normalizeAgentGuidanceSettings(settings.agent_guidance),
5193
5254
  item_types: {
5194
- definitions: normalizeItemTypeDefinitions(settings.item_types?.definitions)
5255
+ definitions: persistedFileBackedSections.item_type_definitions
5256
+ },
5257
+ schema: {
5258
+ ...normalizedSchema,
5259
+ statuses: persistedFileBackedSections.schema_statuses,
5260
+ fields: persistedFileBackedSections.schema_fields,
5261
+ type_workflows: persistedFileBackedSections.schema_type_workflows
5195
5262
  },
5196
- schema: normalizeRuntimeSchemaSettings(settings.schema),
5197
5263
  search: {
5198
5264
  ...SETTINGS_DEFAULTS.search,
5199
5265
  ...settings.search,
@@ -5391,6 +5457,7 @@ async function readSettingsWithMetadata(pmRoot) {
5391
5457
  },
5392
5458
  schema: loadedSchemaSections.schema
5393
5459
  };
5460
+ attachSettingsPersistSourceSnapshot(settings, buildSettingsPersistSourceSnapshot(validated.data, settings));
5394
5461
  return {
5395
5462
  settings,
5396
5463
  metadata: {
@@ -5411,7 +5478,9 @@ async function readSettings(pmRoot) {
5411
5478
  }
5412
5479
  async function writeSettings(pmRoot, settings, op = SETTINGS_WRITE_OP) {
5413
5480
  const settingsPath = getSettingsPath(pmRoot);
5414
- await writeFileAtomic(settingsPath, serializeSettings(settings));
5481
+ await writeFileAtomic(settingsPath, serializeSettings(settings, {
5482
+ persist_source: getSettingsPersistSourceSnapshot(settings)
5483
+ }));
5415
5484
  await runActiveOnWriteHooks({
5416
5485
  path: settingsPath,
5417
5486
  scope: "project",
@@ -5548,6 +5617,6 @@ export {
5548
5617
  readSettings,
5549
5618
  writeSettings
5550
5619
  };
5551
- //# sourceMappingURL=chunk-4LTBNUYT.js.map
5620
+ //# sourceMappingURL=chunk-5SFCOO6B.js.map
5552
5621
 
5553
- //# debugId=ba0e58d6-49b8-5381-ad9e-e68ab249dc60
5622
+ //# debugId=2113715d-ebf3-5135-897f-495b04e82b35