@unbrained/pm-cli 2026.7.21 → 2026.7.22

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 (506) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +25 -0
  3. package/dist/cli/bundle-integrity.js +3 -3
  4. package/dist/cli/bundle-integrity.js.map +1 -1
  5. package/dist/cli/commands/contracts.d.ts +5 -0
  6. package/dist/cli/commands/contracts.js +8 -6
  7. package/dist/cli/commands/contracts.js.map +1 -1
  8. package/dist/cli/commands/copy.js +36 -20
  9. package/dist/cli/commands/copy.js.map +1 -1
  10. package/dist/cli/commands/create.js +48 -24
  11. package/dist/cli/commands/create.js.map +1 -1
  12. package/dist/cli/commands/merge.d.ts +1 -1
  13. package/dist/cli/commands/merge.js +3 -3
  14. package/dist/cli/commands/merge.js.map +1 -1
  15. package/dist/cli/commands/restore.js +40 -22
  16. package/dist/cli/commands/restore.js.map +1 -1
  17. package/dist/cli/commands/update.js +12 -9
  18. package/dist/cli/commands/update.js.map +1 -1
  19. package/dist/cli/extension-command-help.js +3 -4
  20. package/dist/cli/extension-command-help.js.map +1 -1
  21. package/dist/cli/main.d.ts +3 -2
  22. package/dist/cli/main.js +6 -6
  23. package/dist/cli/main.js.map +1 -1
  24. package/dist/cli/register-list-query.js +33 -21
  25. package/dist/cli/register-list-query.js.map +1 -1
  26. package/dist/cli/register-mutation.js +63 -37
  27. package/dist/cli/register-mutation.js.map +1 -1
  28. package/dist/cli/registration-helpers.d.ts +2 -0
  29. package/dist/cli/registration-helpers.js +3 -2
  30. package/dist/cli/registration-helpers.js.map +1 -1
  31. package/dist/cli-bundle/bundle-manifest.json +349 -341
  32. package/dist/cli-bundle/chunks/{append-7OVFYR3C.js → append-CYMA7RJT.js} +5 -5
  33. package/dist/cli-bundle/chunks/append-H53CAPMP.js +11 -0
  34. package/dist/cli-bundle/chunks/{chunk-PFNHX655.js → chunk-2P7OK4WG.js} +3 -3
  35. package/dist/cli-bundle/chunks/{chunk-EJDGV4GR.js → chunk-3EBGHNNQ.js} +3 -3
  36. package/dist/cli-bundle/chunks/{chunk-DZRV2OPA.js → chunk-3EDFN3VV.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-ZOY5K4D3.js → chunk-3PWJWLLQ.js} +2 -2
  38. package/dist/cli-bundle/chunks/{chunk-VXOOB6YX.js → chunk-3SJAR3CY.js} +4 -4
  39. package/dist/cli-bundle/chunks/{chunk-GTLCVJOE.js → chunk-3WVKMF2A.js} +3 -3
  40. package/dist/cli-bundle/chunks/{chunk-LAV26CQG.js → chunk-42SYYKA4.js} +4 -4
  41. package/dist/cli-bundle/chunks/{chunk-NLR32VFS.js → chunk-4IXLNV7W.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-BKIAH72N.js → chunk-4LTPHDKA.js} +39 -23
  43. package/dist/cli-bundle/chunks/chunk-4LTPHDKA.js.map +1 -0
  44. package/dist/cli-bundle/chunks/{chunk-ABWCF646.js → chunk-4YTQVO3V.js} +5 -5
  45. package/dist/cli-bundle/chunks/{chunk-E5XMKOSB.js → chunk-5EBRMHI6.js} +4 -4
  46. package/dist/cli-bundle/chunks/{chunk-IY6VZ3IW.js → chunk-5FAG2JUC.js} +320 -62
  47. package/dist/cli-bundle/chunks/chunk-5FAG2JUC.js.map +7 -0
  48. package/dist/cli-bundle/chunks/{chunk-GKX4NJ7U.js → chunk-5K5LHZZX.js} +6 -6
  49. package/dist/cli-bundle/chunks/{chunk-T6PPNM7V.js → chunk-5K7BOAB6.js} +4 -4
  50. package/dist/cli-bundle/chunks/{chunk-4QOB7L7I.js → chunk-5MUZ54G2.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-SF3DT5HJ.js → chunk-5QME4KX2.js} +3 -3
  52. package/dist/cli-bundle/chunks/{chunk-RMF7LMBS.js → chunk-6PDGFY3P.js} +27 -17
  53. package/dist/cli-bundle/chunks/{chunk-RMF7LMBS.js.map → chunk-6PDGFY3P.js.map} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-TRSHFPRZ.js → chunk-6PM6CPPP.js} +5 -5
  55. package/dist/cli-bundle/chunks/{chunk-O4BCOJTZ.js → chunk-7AHRY3ZB.js} +21 -16
  56. package/dist/cli-bundle/chunks/chunk-7AHRY3ZB.js.map +7 -0
  57. package/dist/cli-bundle/chunks/{chunk-OR42SO64.js → chunk-7B36A3VT.js} +4 -4
  58. package/dist/cli-bundle/chunks/{chunk-QWRVBJ4D.js → chunk-7OR2YKKD.js} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-FPBMLYPI.js → chunk-7QUV54XX.js} +4 -4
  60. package/dist/cli-bundle/chunks/{chunk-WWNL6WMH.js → chunk-7WXW6JHG.js} +2 -2
  61. package/dist/cli-bundle/chunks/{chunk-BXNDKOR2.js → chunk-A2VL5SVG.js} +4 -4
  62. package/dist/cli-bundle/chunks/chunk-AXGDUXJW.js +5 -0
  63. package/dist/cli-bundle/chunks/{chunk-IAQE32BI.js → chunk-B2AVNGG3.js} +4 -4
  64. package/dist/cli-bundle/chunks/{chunk-K36WV5J6.js → chunk-B7O44UBR.js} +71 -8
  65. package/dist/cli-bundle/chunks/chunk-B7O44UBR.js.map +1 -0
  66. package/dist/cli-bundle/chunks/{chunk-HCEBZNC3.js → chunk-BRMPF2RM.js} +4 -4
  67. package/dist/cli-bundle/chunks/{chunk-Z7VWXXJM.js → chunk-BTNKMF2A.js} +4 -4
  68. package/dist/cli-bundle/chunks/{chunk-KH44WBAT.js → chunk-CD4643VW.js} +4 -4
  69. package/dist/cli-bundle/chunks/{chunk-OWXOPDHD.js → chunk-CJEEC5O4.js} +4 -4
  70. package/dist/cli-bundle/chunks/{chunk-PZC2FUOQ.js → chunk-CTPKCZCF.js} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-7W2UAXXT.js → chunk-D4OBQVL3.js} +10 -10
  72. package/dist/cli-bundle/chunks/{chunk-EWJWSNRU.js → chunk-DM4TYC2A.js} +4 -4
  73. package/dist/cli-bundle/chunks/{chunk-VJQG4BIM.js → chunk-DSFTAQ7T.js} +3 -3
  74. package/dist/cli-bundle/chunks/{chunk-AELMUANP.js → chunk-DVB6SQU7.js} +2 -2
  75. package/dist/cli-bundle/chunks/{chunk-KBLZ3AA5.js → chunk-E3ZWOFSO.js} +4 -4
  76. package/dist/cli-bundle/chunks/chunk-EP25DV6P.js +9 -0
  77. package/dist/cli-bundle/chunks/{chunk-GTK4DTEW.js → chunk-F4VCB4WY.js} +10 -10
  78. package/dist/cli-bundle/chunks/{chunk-V22ZPOKN.js → chunk-F4XAQUQA.js} +6 -6
  79. package/dist/cli-bundle/chunks/{chunk-QOOTOD3W.js → chunk-FGR6IBAF.js} +6 -6
  80. package/dist/cli-bundle/chunks/{chunk-JSLT7WVE.js → chunk-FKBMT2Q6.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-QIH77CAG.js → chunk-G5RLSSIX.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-P7MTHPJQ.js → chunk-GEKRVH3G.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-2L6ZP22J.js → chunk-GSP6IZFU.js} +3 -3
  84. package/dist/cli-bundle/chunks/{chunk-ATBCUC7Y.js → chunk-H3MDK2VU.js} +48 -30
  85. package/dist/cli-bundle/chunks/chunk-H3MDK2VU.js.map +1 -0
  86. package/dist/cli-bundle/chunks/{chunk-ZVZGXPQ5.js → chunk-HYZZM3Q2.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-XJTABV3X.js → chunk-IBWG3OSH.js} +22 -17
  88. package/dist/cli-bundle/chunks/chunk-IBWG3OSH.js.map +1 -0
  89. package/dist/cli-bundle/chunks/{chunk-4XGJLADW.js → chunk-IHY5SX7O.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-UCBDQI5E.js → chunk-IMU7JLUI.js} +7 -7
  91. package/dist/cli-bundle/chunks/{chunk-Z75ONV25.js → chunk-IPAQAJWB.js} +77 -7
  92. package/dist/cli-bundle/chunks/chunk-IPAQAJWB.js.map +7 -0
  93. package/dist/cli-bundle/chunks/{chunk-7RW4JCU2.js → chunk-IQCD6OO3.js} +25 -13
  94. package/dist/cli-bundle/chunks/chunk-IQCD6OO3.js.map +7 -0
  95. package/dist/cli-bundle/chunks/{chunk-YQWCZ5AC.js → chunk-J3ZKFEDM.js} +38 -22
  96. package/dist/cli-bundle/chunks/chunk-J3ZKFEDM.js.map +7 -0
  97. package/dist/cli-bundle/chunks/{chunk-PEQGTJ5Q.js → chunk-JCLXCGIL.js} +3 -3
  98. package/dist/cli-bundle/chunks/{chunk-GROYI4RB.js → chunk-JLTHOYR7.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-JHJSFOAM.js → chunk-JMPVHM44.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-MATHDCGG.js → chunk-JWYG36RV.js} +8 -8
  101. package/dist/cli-bundle/chunks/{chunk-ZTVA4KLN.js → chunk-KEGVMZNA.js} +28 -16
  102. package/dist/cli-bundle/chunks/chunk-KEGVMZNA.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-VLRGDBLY.js → chunk-KEHOPUHH.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-K55VMLSS.js → chunk-KJ4ZF35M.js} +63 -13
  105. package/dist/cli-bundle/chunks/chunk-KJ4ZF35M.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-CPX275C6.js → chunk-KPCZL2YK.js} +6 -6
  107. package/dist/cli-bundle/chunks/{chunk-POG76WWZ.js → chunk-L7DZV6EZ.js} +319 -61
  108. package/dist/cli-bundle/chunks/chunk-L7DZV6EZ.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-FO6OSVEN.js → chunk-LANV45W2.js} +8 -8
  110. package/dist/cli-bundle/chunks/{chunk-LVC72YRD.js → chunk-LC5ZUXWE.js} +7 -7
  111. package/dist/cli-bundle/chunks/{chunk-SY4SFZSD.js → chunk-LE522OXA.js} +55 -30
  112. package/dist/cli-bundle/chunks/chunk-LE522OXA.js.map +7 -0
  113. package/dist/cli-bundle/chunks/{chunk-TVYYO5A7.js → chunk-MBHYQYCS.js} +2 -2
  114. package/dist/cli-bundle/chunks/{chunk-FJIFFBJX.js → chunk-MROP2RNT.js} +66 -74
  115. package/dist/cli-bundle/chunks/chunk-MROP2RNT.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{chunk-7656MAUL.js → chunk-MUAJHL2R.js} +2 -2
  117. package/dist/cli-bundle/chunks/{chunk-R3P6FZJW.js → chunk-N6QCY2AX.js} +43 -25
  118. package/dist/cli-bundle/chunks/chunk-N6QCY2AX.js.map +1 -0
  119. package/dist/cli-bundle/chunks/{chunk-7WCE6Y64.js → chunk-NUQCSV4P.js} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-SZVB53Y3.js → chunk-O3GFE2PX.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-OY7DMU5P.js → chunk-O43LEUSD.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-AMJPSANK.js → chunk-O7RH6BWP.js} +103 -44
  123. package/dist/cli-bundle/chunks/chunk-O7RH6BWP.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-NUF7ROFH.js → chunk-OODR5KYF.js} +26 -27
  125. package/dist/cli-bundle/chunks/chunk-OODR5KYF.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-LZYP423P.js → chunk-OZ25YD4Q.js} +3 -3
  127. package/dist/cli-bundle/chunks/{chunk-VZIZB6QH.js → chunk-PKYKQCTJ.js} +4 -4
  128. package/dist/cli-bundle/chunks/{chunk-UZLJOEAC.js → chunk-PMRED6QZ.js} +3 -3
  129. package/dist/cli-bundle/chunks/{chunk-ADBTSVGK.js → chunk-PPATPPI6.js} +65 -73
  130. package/dist/cli-bundle/chunks/chunk-PPATPPI6.js.map +7 -0
  131. package/dist/cli-bundle/chunks/{chunk-K4CI6Y45.js → chunk-PWGJCP2V.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-UVN66B3M.js → chunk-Q3Z2Y5WJ.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-RNPZYNHS.js → chunk-Q6YZ3VCI.js} +104 -45
  134. package/dist/cli-bundle/chunks/chunk-Q6YZ3VCI.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-7DOJC3HS.js → chunk-QE5EUHKN.js} +28 -18
  136. package/dist/cli-bundle/chunks/chunk-QE5EUHKN.js.map +1 -0
  137. package/dist/cli-bundle/chunks/{chunk-AS4SAZ5R.js → chunk-QKMMWESK.js} +25 -26
  138. package/dist/cli-bundle/chunks/chunk-QKMMWESK.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-R7QV7ICM.js → chunk-QSXN2FAN.js} +4 -4
  140. package/dist/cli-bundle/chunks/{chunk-5NTE36LD.js → chunk-RBECHH5K.js} +4 -4
  141. package/dist/cli-bundle/chunks/{chunk-JXCW2TI2.js → chunk-RPNC7M63.js} +8 -8
  142. package/dist/cli-bundle/chunks/{chunk-ICDAQ4TD.js → chunk-S2QQNTA6.js} +26 -14
  143. package/dist/cli-bundle/chunks/chunk-S2QQNTA6.js.map +1 -0
  144. package/dist/cli-bundle/chunks/{chunk-JFD5LPMI.js → chunk-SP3BAXFF.js} +29 -17
  145. package/dist/cli-bundle/chunks/chunk-SP3BAXFF.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-F2LBF7XJ.js → chunk-SUSFH6F7.js} +5 -5
  147. package/dist/cli-bundle/chunks/{chunk-VHXHVTUU.js → chunk-TDOPC7UY.js} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-HYW67VJ5.js → chunk-TLF52ZDP.js} +30 -25
  149. package/dist/cli-bundle/chunks/chunk-TLF52ZDP.js.map +1 -0
  150. package/dist/cli-bundle/chunks/{chunk-FSE2IKJQ.js → chunk-TWHG646K.js} +2 -2
  151. package/dist/cli-bundle/chunks/{chunk-OCUBRA6D.js → chunk-U7U7WGEC.js} +4 -4
  152. package/dist/cli-bundle/chunks/{chunk-PONKZPCJ.js → chunk-UFRVIIJ2.js} +4 -4
  153. package/dist/cli-bundle/chunks/{chunk-VNTCM3VW.js → chunk-VKX2VZZH.js} +8 -8
  154. package/dist/cli-bundle/chunks/{chunk-7AVEY74G.js → chunk-VTOCZ343.js} +29 -24
  155. package/dist/cli-bundle/chunks/chunk-VTOCZ343.js.map +7 -0
  156. package/dist/cli-bundle/chunks/{chunk-6JUTHVQS.js → chunk-W2JDNTN3.js} +2 -2
  157. package/dist/cli-bundle/chunks/{chunk-PQSEQD6E.js → chunk-W35PHE44.js} +62 -12
  158. package/dist/cli-bundle/chunks/chunk-W35PHE44.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-4QSQ6XDK.js → chunk-WT4KXBUD.js} +68 -31
  160. package/dist/cli-bundle/chunks/chunk-WT4KXBUD.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-RPESLSO5.js → chunk-XC5RVKHH.js} +69 -32
  162. package/dist/cli-bundle/chunks/chunk-XC5RVKHH.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-QG4GFLQ6.js → chunk-XD6UF2NB.js} +42 -24
  164. package/dist/cli-bundle/chunks/chunk-XD6UF2NB.js.map +7 -0
  165. package/dist/cli-bundle/chunks/{chunk-AF2CCM5U.js → chunk-XKRVX4B3.js} +4 -4
  166. package/dist/cli-bundle/chunks/{chunk-JGUKMMRS.js → chunk-XN4NQZJK.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-3P7UJQOX.js → chunk-YKFMLQNK.js} +2 -2
  168. package/dist/cli-bundle/chunks/{chunk-YCIUJJOD.js → chunk-YKWKMGL7.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-TOBGV45Y.js → chunk-YUKIFPWK.js} +2 -2
  170. package/dist/cli-bundle/chunks/{chunk-72LQ4TKV.js → chunk-YYEZEP3E.js} +3 -3
  171. package/dist/cli-bundle/chunks/{chunk-X3W65QK3.js → chunk-ZEY3XSZQ.js} +5 -5
  172. package/dist/cli-bundle/chunks/{chunk-MWQ2HC2A.js → chunk-ZKOQHLJP.js} +59 -34
  173. package/dist/cli-bundle/chunks/chunk-ZKOQHLJP.js.map +1 -0
  174. package/dist/cli-bundle/chunks/{chunk-QJIKE24M.js → chunk-ZQ3UMKWE.js} +2 -2
  175. package/dist/cli-bundle/chunks/{chunk-4PUUNQDV.js → chunk-ZVVEWHWK.js} +58 -33
  176. package/dist/cli-bundle/chunks/chunk-ZVVEWHWK.js.map +7 -0
  177. package/dist/cli-bundle/chunks/{chunk-OG5DVFMA.js → chunk-ZXE6SNKO.js} +5 -5
  178. package/dist/cli-bundle/chunks/close-GAUIGOQC.js +12 -0
  179. package/dist/cli-bundle/chunks/{close-QEMOYZN3.js → close-SJIEKNY4.js} +5 -5
  180. package/dist/cli-bundle/chunks/{close-many-RZVTUGBG.js → close-many-B6AIC5OQ.js} +15 -14
  181. package/dist/cli-bundle/chunks/close-many-QCINT6I2.js +24 -0
  182. package/dist/cli-bundle/chunks/comments-4SK5EUEJ.js +13 -0
  183. package/dist/cli-bundle/chunks/{comments-TPU7QRBL.js → comments-DM5KV2RS.js} +7 -7
  184. package/dist/cli-bundle/chunks/copy-4KCCLTYQ.js +10 -0
  185. package/dist/cli-bundle/chunks/{copy-DKTSSCK7.js → copy-HEP5SZHB.js} +5 -4
  186. package/dist/cli-bundle/chunks/create-BDKQFPRE.js +30 -0
  187. package/dist/cli-bundle/chunks/{create-EIFBIVNQ.js → create-VCGBCYL2.js} +11 -10
  188. package/dist/cli-bundle/chunks/delete-JWDXPR3H.js +10 -0
  189. package/dist/cli-bundle/chunks/{delete-LCS3VPDH.js → delete-ZSPBTVJD.js} +4 -4
  190. package/dist/cli-bundle/chunks/{deps-YG7UF3VR.js → deps-BZTWWOIE.js} +6 -6
  191. package/dist/cli-bundle/chunks/{deps-UH5EQQUY.js → deps-OVAJOQIE.js} +6 -6
  192. package/dist/cli-bundle/chunks/{docs-G32TK6XS.js → docs-3GFMSWLL.js} +6 -6
  193. package/dist/cli-bundle/chunks/docs-SY2NPT6Y.js +14 -0
  194. package/dist/cli-bundle/chunks/{files-4ALMCSKB.js → files-2SEL4QIU.js} +6 -6
  195. package/dist/cli-bundle/chunks/{files-3H32UQ4K.js → files-FYMMJGNN.js} +6 -6
  196. package/dist/cli-bundle/chunks/focus-4A27YJ2Z.js +10 -0
  197. package/dist/cli-bundle/chunks/{focus-7SOUT5PZ.js → focus-TEUJKTAT.js} +5 -5
  198. package/dist/cli-bundle/chunks/history-compact-7QOKL2NB.js +16 -0
  199. package/dist/cli-bundle/chunks/{history-compact-77BT2LUB.js → history-compact-U7A37VR6.js} +6 -6
  200. package/dist/cli-bundle/chunks/{history-redact-LJPZPNFA.js → history-redact-TNKUO4ZE.js} +4 -4
  201. package/dist/cli-bundle/chunks/{history-redact-PWTTJ3XS.js → history-redact-ZWRUWQY3.js} +4 -4
  202. package/dist/cli-bundle/chunks/{history-repair-I7CBNCV3.js → history-repair-6IU5VWHN.js} +7 -7
  203. package/dist/cli-bundle/chunks/history-repair-GWCGJUM2.js +17 -0
  204. package/dist/cli-bundle/chunks/learnings-DDFAUUX3.js +13 -0
  205. package/dist/cli-bundle/chunks/{learnings-KTYW3AL7.js → learnings-GOEZXMKL.js} +7 -7
  206. package/dist/cli-bundle/chunks/{notes-ZERD3KB2.js → notes-BZWODAEK.js} +7 -7
  207. package/dist/cli-bundle/chunks/notes-OBJ6FL36.js +13 -0
  208. package/dist/cli-bundle/chunks/{plan-OFJUBIM5.js → plan-V57VQTAG.js} +12 -11
  209. package/dist/cli-bundle/chunks/plan-ZMOBD6FX.js +27 -0
  210. package/dist/cli-bundle/chunks/{profile-3THJPIQY.js → profile-BG3N4ETA.js} +9 -9
  211. package/dist/cli-bundle/chunks/{profile-XEZAMMBW.js → profile-XLM45FKV.js} +9 -9
  212. package/dist/cli-bundle/chunks/{register-list-query-BR435Q2H.js → register-list-query-EYYNTGMF.js} +48 -38
  213. package/dist/cli-bundle/chunks/register-list-query-EYYNTGMF.js.map +1 -0
  214. package/dist/cli-bundle/chunks/{register-list-query-RWTWLOBE.js → register-list-query-WGXJPXXY.js} +47 -37
  215. package/dist/cli-bundle/chunks/register-list-query-WGXJPXXY.js.map +7 -0
  216. package/dist/cli-bundle/chunks/{register-mutation-HLWC2WNP.js → register-mutation-3YSDDVOL.js} +131 -105
  217. package/dist/cli-bundle/chunks/register-mutation-3YSDDVOL.js.map +1 -0
  218. package/dist/cli-bundle/chunks/{register-mutation-ZJX5AZM5.js → register-mutation-VDGUMMUY.js} +131 -105
  219. package/dist/cli-bundle/chunks/register-mutation-VDGUMMUY.js.map +7 -0
  220. package/dist/cli-bundle/chunks/{register-operations-744YBJMV.js → register-operations-H4URGAHX.js} +36 -35
  221. package/dist/cli-bundle/chunks/{register-operations-744YBJMV.js.map → register-operations-H4URGAHX.js.map} +1 -1
  222. package/dist/cli-bundle/chunks/{register-operations-UEBJH6AN.js → register-operations-HSO7X77D.js} +34 -33
  223. package/dist/cli-bundle/chunks/{register-operations-UEBJH6AN.js.map → register-operations-HSO7X77D.js.map} +1 -1
  224. package/dist/cli-bundle/chunks/{register-setup-5DA4UZXI.js → register-setup-HZ2KKXK4.js} +13 -13
  225. package/dist/cli-bundle/chunks/{register-setup-6H25M3BH.js → register-setup-WCBKJ3H3.js} +13 -13
  226. package/dist/cli-bundle/chunks/{restore-6TDVSATY.js → restore-3NGRFDPX.js} +7 -6
  227. package/dist/cli-bundle/chunks/restore-LNVNUWHE.js +15 -0
  228. package/dist/cli-bundle/chunks/{schema-TPVTIJPO.js → schema-LMFZ742C.js} +6 -6
  229. package/dist/cli-bundle/chunks/{schema-HFXFSGPG.js → schema-O34O33UW.js} +6 -6
  230. package/dist/cli-bundle/chunks/update-BN6VZSYX.js +24 -0
  231. package/dist/cli-bundle/chunks/{update-LJZCL5SI.js → update-FDLPLKOB.js} +14 -13
  232. package/dist/cli-bundle/chunks/update-many-WCKOPN3K.js +35 -0
  233. package/dist/cli-bundle/chunks/update-many-WCKOPN3K.js.map +7 -0
  234. package/dist/cli-bundle/chunks/update-many-X6DVGOMM.js +39 -0
  235. package/dist/cli-bundle/chunks/update-many-X6DVGOMM.js.map +1 -0
  236. package/dist/cli-bundle/main.js +65 -64
  237. package/dist/cli-bundle/main.js.map +2 -2
  238. package/dist/cli-bundle/sdk-runtime.js +53 -52
  239. package/dist/cli-bundle/sdk-testing.js +6 -6
  240. package/dist/cli-bundle/sdk.js +362 -56
  241. package/dist/cli-bundle/sdk.js.map +4 -4
  242. package/dist/cli.js +10 -4
  243. package/dist/cli.js.map +1 -1
  244. package/dist/core/diagnostics/remediation.js +7 -2
  245. package/dist/core/diagnostics/remediation.js.map +1 -1
  246. package/dist/core/search/background-refresh.d.ts +3 -1
  247. package/dist/core/search/background-refresh.js +34 -6
  248. package/dist/core/search/background-refresh.js.map +1 -1
  249. package/dist/core/search/cache.js +28 -5
  250. package/dist/core/search/cache.js.map +1 -1
  251. package/dist/core/shared/constants.d.ts +2 -0
  252. package/dist/core/shared/constants.js +29 -24
  253. package/dist/core/shared/constants.js.map +1 -1
  254. package/dist/core/store/item-metadata-cache.d.ts +32 -1
  255. package/dist/core/store/item-metadata-cache.js +289 -21
  256. package/dist/core/store/item-metadata-cache.js.map +1 -1
  257. package/dist/core/store/item-store.js +71 -34
  258. package/dist/core/store/item-store.js.map +1 -1
  259. package/dist/core/store/settings.js +9 -3
  260. package/dist/core/store/settings.js.map +1 -1
  261. package/dist/sdk/cli-bootstrap.js +68 -76
  262. package/dist/sdk/cli-bootstrap.js.map +1 -1
  263. package/dist/sdk/compile-cache.d.ts +16 -0
  264. package/dist/sdk/compile-cache.js +73 -0
  265. package/dist/sdk/compile-cache.js.map +1 -0
  266. package/dist/sdk/context-relevance.d.ts +16 -1
  267. package/dist/sdk/context-relevance.js +20 -8
  268. package/dist/sdk/context-relevance.js.map +1 -1
  269. package/dist/sdk/context-signal-store.d.ts +77 -0
  270. package/dist/sdk/context-signal-store.js +201 -0
  271. package/dist/sdk/context-signal-store.js.map +1 -0
  272. package/dist/sdk/dependency-provenance.d.ts +12 -0
  273. package/dist/sdk/dependency-provenance.js +38 -0
  274. package/dist/sdk/dependency-provenance.js.map +1 -0
  275. package/dist/sdk/governance/storage-integrity.d.ts +1 -1
  276. package/dist/sdk/governance/storage-integrity.js +47 -6
  277. package/dist/sdk/governance/storage-integrity.js.map +1 -1
  278. package/dist/sdk/graph/assembly.d.ts +2 -0
  279. package/dist/sdk/graph/assembly.js +51 -4
  280. package/dist/sdk/graph/assembly.js.map +1 -1
  281. package/dist/sdk/graph/run.js +12 -13
  282. package/dist/sdk/graph/run.js.map +1 -1
  283. package/dist/sdk/index.d.ts +5 -0
  284. package/dist/sdk/index.js +7 -2
  285. package/dist/sdk/index.js.map +1 -1
  286. package/dist/sdk/item-metadata-index.d.ts +11 -0
  287. package/dist/sdk/item-metadata-index.js +15 -0
  288. package/dist/sdk/item-metadata-index.js.map +1 -0
  289. package/dist/sdk/merge/index.d.ts +1 -0
  290. package/dist/sdk/merge/index.js +3 -2
  291. package/dist/sdk/merge/index.js.map +1 -1
  292. package/dist/sdk/merge/install.js +25 -9
  293. package/dist/sdk/merge/install.js.map +1 -1
  294. package/dist/sdk/merge/reconcile.d.ts +46 -0
  295. package/dist/sdk/merge/reconcile.js +46 -0
  296. package/dist/sdk/merge/reconcile.js.map +1 -0
  297. package/dist/sdk/query/list.d.ts +5 -4
  298. package/dist/sdk/query/list.js +22 -14
  299. package/dist/sdk/query/list.js.map +1 -1
  300. package/dist/sdk/relationship-history.d.ts +30 -0
  301. package/dist/sdk/relationship-history.js +75 -7
  302. package/dist/sdk/relationship-history.js.map +1 -1
  303. package/dist/sdk/relationship-migration.d.ts +42 -0
  304. package/dist/sdk/relationship-migration.js +78 -0
  305. package/dist/sdk/relationship-migration.js.map +1 -0
  306. package/dist/sdk/structured-mutations.js +4 -25
  307. package/dist/sdk/structured-mutations.js.map +1 -1
  308. package/docs/COMMANDS.md +26 -3
  309. package/docs/CONFIGURATION.md +1 -1
  310. package/docs/MERGE_SAFETY.md +14 -5
  311. package/docs/PERFORMANCE.md +28 -0
  312. package/docs/RELATIONSHIP_GRAPH.md +47 -1
  313. package/docs/SDK.md +78 -5
  314. package/marketplace.json +2 -2
  315. package/package.json +2 -2
  316. package/packages/pm-beads/package.json +1 -1
  317. package/packages/pm-calendar/package.json +1 -1
  318. package/packages/pm-command-kit/package.json +1 -1
  319. package/packages/pm-governance-audit/package.json +1 -1
  320. package/packages/pm-guide-shell/package.json +1 -1
  321. package/packages/pm-kanban/package.json +1 -1
  322. package/packages/pm-lifecycle-hooks/package.json +1 -1
  323. package/packages/pm-linked-test-adapters/package.json +1 -1
  324. package/packages/pm-search-advanced/package.json +1 -1
  325. package/packages/pm-templates/package.json +1 -1
  326. package/packages/pm-todos/package.json +1 -1
  327. package/packages/pm-vcs/package.json +1 -1
  328. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  329. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  330. package/dist/cli-bundle/chunks/append-DFETHAZL.js +0 -11
  331. package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +0 -7
  332. package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +0 -1
  333. package/dist/cli-bundle/chunks/chunk-7AVEY74G.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-7DOJC3HS.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +0 -7
  337. package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +0 -7
  338. package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +0 -7
  339. package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +0 -1
  340. package/dist/cli-bundle/chunks/chunk-BKIAH72N.js.map +0 -1
  341. package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +0 -1
  342. package/dist/cli-bundle/chunks/chunk-HYW67VJ5.js.map +0 -1
  343. package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-IY6VZ3IW.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-JFD5LPMI.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +0 -1
  347. package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +0 -7
  348. package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +0 -1
  350. package/dist/cli-bundle/chunks/chunk-O4BCOJTZ.js.map +0 -7
  351. package/dist/cli-bundle/chunks/chunk-POG76WWZ.js.map +0 -1
  352. package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-QG4GFLQ6.js.map +0 -7
  354. package/dist/cli-bundle/chunks/chunk-R3P6FZJW.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +0 -1
  356. package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +0 -7
  358. package/dist/cli-bundle/chunks/chunk-XJTABV3X.js.map +0 -1
  359. package/dist/cli-bundle/chunks/chunk-YQWCZ5AC.js.map +0 -7
  360. package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-ZTVA4KLN.js.map +0 -7
  362. package/dist/cli-bundle/chunks/close-O5QVZ6ET.js +0 -12
  363. package/dist/cli-bundle/chunks/close-many-5RZXVN4J.js +0 -23
  364. package/dist/cli-bundle/chunks/comments-Z4KV6FU3.js +0 -13
  365. package/dist/cli-bundle/chunks/copy-M7DDI6LS.js +0 -9
  366. package/dist/cli-bundle/chunks/create-RGSPN5GD.js +0 -29
  367. package/dist/cli-bundle/chunks/delete-MD7YXQLH.js +0 -10
  368. package/dist/cli-bundle/chunks/docs-JWWNRC27.js +0 -14
  369. package/dist/cli-bundle/chunks/focus-DRQ6FQH6.js +0 -10
  370. package/dist/cli-bundle/chunks/history-compact-VCKGTX64.js +0 -16
  371. package/dist/cli-bundle/chunks/history-repair-YTDZRK5E.js +0 -17
  372. package/dist/cli-bundle/chunks/learnings-CYNOICKR.js +0 -13
  373. package/dist/cli-bundle/chunks/notes-FGO63FXL.js +0 -13
  374. package/dist/cli-bundle/chunks/plan-SGCDDTYR.js +0 -26
  375. package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +0 -1
  376. package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +0 -7
  377. package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +0 -1
  378. package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +0 -7
  379. package/dist/cli-bundle/chunks/restore-RSL7C7LO.js +0 -14
  380. package/dist/cli-bundle/chunks/update-SIA7LH5Y.js +0 -23
  381. package/dist/cli-bundle/chunks/update-many-BDBZVGQL.js +0 -38
  382. package/dist/cli-bundle/chunks/update-many-MOY3A5B3.js +0 -34
  383. /package/dist/cli-bundle/chunks/{append-7OVFYR3C.js.map → append-CYMA7RJT.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{append-DFETHAZL.js.map → append-H53CAPMP.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{chunk-PFNHX655.js.map → chunk-2P7OK4WG.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{chunk-EJDGV4GR.js.map → chunk-3EBGHNNQ.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{chunk-DZRV2OPA.js.map → chunk-3EDFN3VV.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{chunk-ZOY5K4D3.js.map → chunk-3PWJWLLQ.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-VXOOB6YX.js.map → chunk-3SJAR3CY.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-GTLCVJOE.js.map → chunk-3WVKMF2A.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-LAV26CQG.js.map → chunk-42SYYKA4.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-NLR32VFS.js.map → chunk-4IXLNV7W.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-ABWCF646.js.map → chunk-4YTQVO3V.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-E5XMKOSB.js.map → chunk-5EBRMHI6.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-GKX4NJ7U.js.map → chunk-5K5LHZZX.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-T6PPNM7V.js.map → chunk-5K7BOAB6.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-4QOB7L7I.js.map → chunk-5MUZ54G2.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-SF3DT5HJ.js.map → chunk-5QME4KX2.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-TRSHFPRZ.js.map → chunk-6PM6CPPP.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-OR42SO64.js.map → chunk-7B36A3VT.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-QWRVBJ4D.js.map → chunk-7OR2YKKD.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-FPBMLYPI.js.map → chunk-7QUV54XX.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-WWNL6WMH.js.map → chunk-7WXW6JHG.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-BXNDKOR2.js.map → chunk-A2VL5SVG.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{close-QEMOYZN3.js.map → chunk-AXGDUXJW.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-IAQE32BI.js.map → chunk-B2AVNGG3.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-HCEBZNC3.js.map → chunk-BRMPF2RM.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-Z7VWXXJM.js.map → chunk-BTNKMF2A.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-KH44WBAT.js.map → chunk-CD4643VW.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-OWXOPDHD.js.map → chunk-CJEEC5O4.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-PZC2FUOQ.js.map → chunk-CTPKCZCF.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-7W2UAXXT.js.map → chunk-D4OBQVL3.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-EWJWSNRU.js.map → chunk-DM4TYC2A.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-VJQG4BIM.js.map → chunk-DSFTAQ7T.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-AELMUANP.js.map → chunk-DVB6SQU7.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-KBLZ3AA5.js.map → chunk-E3ZWOFSO.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{close-O5QVZ6ET.js.map → chunk-EP25DV6P.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-GTK4DTEW.js.map → chunk-F4VCB4WY.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-V22ZPOKN.js.map → chunk-F4XAQUQA.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-QOOTOD3W.js.map → chunk-FGR6IBAF.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-JSLT7WVE.js.map → chunk-FKBMT2Q6.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-QIH77CAG.js.map → chunk-G5RLSSIX.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-P7MTHPJQ.js.map → chunk-GEKRVH3G.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-2L6ZP22J.js.map → chunk-GSP6IZFU.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-ZVZGXPQ5.js.map → chunk-HYZZM3Q2.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-4XGJLADW.js.map → chunk-IHY5SX7O.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-UCBDQI5E.js.map → chunk-IMU7JLUI.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-PEQGTJ5Q.js.map → chunk-JCLXCGIL.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-GROYI4RB.js.map → chunk-JLTHOYR7.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-JHJSFOAM.js.map → chunk-JMPVHM44.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-MATHDCGG.js.map → chunk-JWYG36RV.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-VLRGDBLY.js.map → chunk-KEHOPUHH.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-CPX275C6.js.map → chunk-KPCZL2YK.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-FO6OSVEN.js.map → chunk-LANV45W2.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-LVC72YRD.js.map → chunk-LC5ZUXWE.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-TVYYO5A7.js.map → chunk-MBHYQYCS.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-7656MAUL.js.map → chunk-MUAJHL2R.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-7WCE6Y64.js.map → chunk-NUQCSV4P.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-SZVB53Y3.js.map → chunk-O3GFE2PX.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-OY7DMU5P.js.map → chunk-O43LEUSD.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-LZYP423P.js.map → chunk-OZ25YD4Q.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-VZIZB6QH.js.map → chunk-PKYKQCTJ.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-UZLJOEAC.js.map → chunk-PMRED6QZ.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-K4CI6Y45.js.map → chunk-PWGJCP2V.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-UVN66B3M.js.map → chunk-Q3Z2Y5WJ.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-R7QV7ICM.js.map → chunk-QSXN2FAN.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-5NTE36LD.js.map → chunk-RBECHH5K.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-JXCW2TI2.js.map → chunk-RPNC7M63.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-F2LBF7XJ.js.map → chunk-SUSFH6F7.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-VHXHVTUU.js.map → chunk-TDOPC7UY.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-FSE2IKJQ.js.map → chunk-TWHG646K.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-OCUBRA6D.js.map → chunk-U7U7WGEC.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-PONKZPCJ.js.map → chunk-UFRVIIJ2.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-VNTCM3VW.js.map → chunk-VKX2VZZH.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-6JUTHVQS.js.map → chunk-W2JDNTN3.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-AF2CCM5U.js.map → chunk-XKRVX4B3.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{chunk-JGUKMMRS.js.map → chunk-XN4NQZJK.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{chunk-3P7UJQOX.js.map → chunk-YKFMLQNK.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{chunk-YCIUJJOD.js.map → chunk-YKWKMGL7.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{chunk-TOBGV45Y.js.map → chunk-YUKIFPWK.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{chunk-72LQ4TKV.js.map → chunk-YYEZEP3E.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-X3W65QK3.js.map → chunk-ZEY3XSZQ.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-QJIKE24M.js.map → chunk-ZQ3UMKWE.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-OG5DVFMA.js.map → chunk-ZXE6SNKO.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{close-many-5RZXVN4J.js.map → close-GAUIGOQC.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{close-many-RZVTUGBG.js.map → close-SJIEKNY4.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{comments-TPU7QRBL.js.map → close-many-B6AIC5OQ.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{comments-Z4KV6FU3.js.map → close-many-QCINT6I2.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{copy-M7DDI6LS.js.map → comments-4SK5EUEJ.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{copy-DKTSSCK7.js.map → comments-DM5KV2RS.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{create-RGSPN5GD.js.map → copy-4KCCLTYQ.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{create-EIFBIVNQ.js.map → copy-HEP5SZHB.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{delete-MD7YXQLH.js.map → create-BDKQFPRE.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{delete-LCS3VPDH.js.map → create-VCGBCYL2.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{deps-YG7UF3VR.js.map → delete-JWDXPR3H.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{deps-UH5EQQUY.js.map → delete-ZSPBTVJD.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{docs-JWWNRC27.js.map → deps-BZTWWOIE.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{docs-G32TK6XS.js.map → deps-OVAJOQIE.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{files-3H32UQ4K.js.map → docs-3GFMSWLL.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{files-4ALMCSKB.js.map → docs-SY2NPT6Y.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{focus-DRQ6FQH6.js.map → files-2SEL4QIU.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{focus-7SOUT5PZ.js.map → files-FYMMJGNN.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{history-compact-VCKGTX64.js.map → focus-4A27YJ2Z.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{history-compact-77BT2LUB.js.map → focus-TEUJKTAT.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{history-redact-PWTTJ3XS.js.map → history-compact-7QOKL2NB.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{history-redact-LJPZPNFA.js.map → history-compact-U7A37VR6.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{history-repair-I7CBNCV3.js.map → history-redact-TNKUO4ZE.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{history-repair-YTDZRK5E.js.map → history-redact-ZWRUWQY3.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{learnings-KTYW3AL7.js.map → history-repair-6IU5VWHN.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{learnings-CYNOICKR.js.map → history-repair-GWCGJUM2.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{notes-FGO63FXL.js.map → learnings-DDFAUUX3.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{notes-ZERD3KB2.js.map → learnings-GOEZXMKL.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{plan-OFJUBIM5.js.map → notes-BZWODAEK.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{plan-SGCDDTYR.js.map → notes-OBJ6FL36.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{profile-3THJPIQY.js.map → plan-V57VQTAG.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{profile-XEZAMMBW.js.map → plan-ZMOBD6FX.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{restore-6TDVSATY.js.map → profile-BG3N4ETA.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{restore-RSL7C7LO.js.map → profile-XLM45FKV.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{register-setup-5DA4UZXI.js.map → register-setup-HZ2KKXK4.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{register-setup-6H25M3BH.js.map → register-setup-WCBKJ3H3.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{schema-TPVTIJPO.js.map → restore-3NGRFDPX.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{schema-HFXFSGPG.js.map → restore-LNVNUWHE.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{update-LJZCL5SI.js.map → schema-LMFZ742C.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{update-SIA7LH5Y.js.map → schema-O34O33UW.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{update-many-MOY3A5B3.js.map → update-BN6VZSYX.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{update-many-BDBZVGQL.js.map → update-FDLPLKOB.js.map} +0 -0
@@ -56,7 +56,7 @@ import {
56
56
  toErrorMessage,
57
57
  weekdayOrderIndex,
58
58
  writeFileAtomic
59
- } from "./chunk-7AVEY74G.js";
59
+ } from "./chunk-VTOCZ343.js";
60
60
 
61
61
  // dist/core/extensions/command-hook-context.js
62
62
  !(function() {
@@ -1065,7 +1065,7 @@ function clearSettingsReadCache(pmRoot) {
1065
1065
  !(function() {
1066
1066
  try {
1067
1067
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1068
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a4d073da-52c1-5f9d-885f-6ca0e8aa470a");
1068
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "7d88b8e6-fc0c-57c9-bcea-86f7f81546f3");
1069
1069
  } catch (e2) {
1070
1070
  }
1071
1071
  })();
@@ -1979,7 +1979,12 @@ async function readSettingsWithMetadata(pmRoot) {
1979
1979
  const settingsOnlySignatures = await collectSettingsReadCacheSignatures([
1980
1980
  settingsPath
1981
1981
  ]);
1982
- const raw = await readFileIfExists(settingsPath);
1982
+ let raw;
1983
+ try {
1984
+ raw = await readFileIfExists(settingsPath);
1985
+ } catch {
1986
+ return buildFallbackSettingsReadResult("settings_read_fs_error");
1987
+ }
1983
1988
  if (raw === null) {
1984
1989
  const fallback = buildFallbackSettingsReadResult();
1985
1990
  await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsOnlySignatures, [settingsPath]);
@@ -4536,26 +4541,25 @@ async function generateItemId(pmRoot, prefix, options = {}) {
4536
4541
  throw new Error(`Unable to generate unique id after ${attempts} attempts`);
4537
4542
  }
4538
4543
 
4539
- // dist/core/store/item-store.js
4540
- import fs4 from "node:fs/promises";
4541
- import path5 from "node:path";
4542
-
4543
4544
  // dist/core/store/item-metadata-cache.js
4544
4545
  import fs3 from "node:fs/promises";
4545
4546
  import path4 from "node:path";
4546
- import { createHash } from "node:crypto";
4547
+ import { createHash, randomUUID as randomUUID2 } from "node:crypto";
4547
4548
  !(function() {
4548
4549
  try {
4549
4550
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
4550
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9af59769-ef30-5386-a290-593fe42d119f");
4551
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b956bd21-1ad5-5d38-a03c-fe613b5a8aab");
4551
4552
  } catch (e2) {
4552
4553
  }
4553
4554
  })();
4554
- var CACHE_VERSION = 7;
4555
- var DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS = 1e4;
4555
+ var CACHE_VERSION = 8;
4556
+ var DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS = 500;
4557
+ var DERIVED_INDEX_LOCK_ID = "metadata-derived-index";
4556
4558
  var CACHE_FILENAME = "metadata-cache.json";
4557
4559
  var BODY_CACHE_FILENAME = "metadata-cache-bodies.json";
4558
4560
  var COLLECTIONS_CACHE_FILENAME = "metadata-cache-collections.json";
4561
+ var DELTA_CACHE_FILENAME = "metadata-cache-delta.json";
4562
+ var MANIFEST_CACHE_FILENAME = "metadata-cache-manifest.json";
4559
4563
  var HEAVY_METADATA_KEYS = [
4560
4564
  "comments",
4561
4565
  "notes",
@@ -4607,8 +4611,73 @@ function getBodyCachePath(pmRoot) {
4607
4611
  function getCollectionsCachePath(pmRoot) {
4608
4612
  return path4.join(pmRoot, "runtime", COLLECTIONS_CACHE_FILENAME);
4609
4613
  }
4614
+ function getDeltaCachePath(pmRoot) {
4615
+ return path4.join(pmRoot, "runtime", DELTA_CACHE_FILENAME);
4616
+ }
4617
+ function getManifestCachePath(pmRoot) {
4618
+ return path4.join(pmRoot, "runtime", MANIFEST_CACHE_FILENAME);
4619
+ }
4610
4620
  var ENVELOPE_MEMO_MAX_ENTRIES = 24;
4611
4621
  var envelopeMemo = /* @__PURE__ */ new Map();
4622
+ var projectedBaseCursor = /* @__PURE__ */ new WeakMap();
4623
+ function baseCursorFor(envelope) {
4624
+ return projectedBaseCursor.get(envelope) ?? envelope.source_cursor;
4625
+ }
4626
+ function applyMetadataDelta(envelope, delta) {
4627
+ const baseCursor = baseCursorFor(envelope);
4628
+ if (delta.base_source_cursor !== baseCursor || envelope.source_cursor === delta.source_cursor) {
4629
+ return;
4630
+ }
4631
+ projectedBaseCursor.set(envelope, baseCursor);
4632
+ for (const [relativePath, change] of Object.entries(delta.changes)) {
4633
+ if (change.entry)
4634
+ envelope.entries[relativePath] = change.entry;
4635
+ else
4636
+ delete envelope.entries[relativePath];
4637
+ }
4638
+ envelope.directory_signatures = delta.directory_signatures;
4639
+ envelope.source_cursor = delta.source_cursor;
4640
+ }
4641
+ function applyBodyDelta(envelope, delta) {
4642
+ if (!envelope)
4643
+ return;
4644
+ const baseCursor = baseCursorFor(envelope);
4645
+ if (delta.base_source_cursor !== baseCursor || envelope.source_cursor === delta.source_cursor) {
4646
+ return;
4647
+ }
4648
+ projectedBaseCursor.set(envelope, baseCursor);
4649
+ for (const [relativePath, change] of Object.entries(delta.changes)) {
4650
+ if (change.body)
4651
+ envelope.bodies[relativePath] = change.body;
4652
+ else
4653
+ delete envelope.bodies[relativePath];
4654
+ }
4655
+ envelope.source_cursor = delta.source_cursor;
4656
+ }
4657
+ function applyCollectionsDelta(envelope, delta) {
4658
+ if (!envelope)
4659
+ return;
4660
+ const baseCursor = baseCursorFor(envelope);
4661
+ if (delta.base_source_cursor !== baseCursor || envelope.source_cursor === delta.source_cursor) {
4662
+ return;
4663
+ }
4664
+ projectedBaseCursor.set(envelope, baseCursor);
4665
+ for (const [relativePath, change] of Object.entries(delta.changes)) {
4666
+ if (change.collections)
4667
+ envelope.collections[relativePath] = change.collections;
4668
+ else
4669
+ delete envelope.collections[relativePath];
4670
+ }
4671
+ envelope.source_cursor = delta.source_cursor;
4672
+ }
4673
+ function applyDerivedIndexDelta(metadata, bodies, collections, delta) {
4674
+ if (!metadata || !delta || metadata.context_fingerprint !== delta.context_fingerprint) {
4675
+ return;
4676
+ }
4677
+ applyMetadataDelta(metadata, delta);
4678
+ applyBodyDelta(bodies, delta);
4679
+ applyCollectionsDelta(collections, delta);
4680
+ }
4612
4681
  function memoizeEnvelope(cachePath, entry) {
4613
4682
  if (envelopeMemo.size >= ENVELOPE_MEMO_MAX_ENTRIES && !envelopeMemo.has(cachePath)) {
4614
4683
  evictOldestMemoEntries(envelopeMemo);
@@ -4648,7 +4717,7 @@ async function loadEnvelopeMemoized(cachePath, parse) {
4648
4717
  async function loadCache(pmRoot) {
4649
4718
  return await loadEnvelopeMemoized(getCachePath(pmRoot), (raw) => {
4650
4719
  const parsed = JSON.parse(raw);
4651
- if (parsed.version !== CACHE_VERSION || typeof parsed.entries !== "object" || parsed.entries === null) {
4720
+ if (parsed.version !== CACHE_VERSION || typeof parsed.source_cursor !== "string" || typeof parsed.entries !== "object" || parsed.entries === null) {
4652
4721
  return null;
4653
4722
  }
4654
4723
  return parsed;
@@ -4657,7 +4726,7 @@ async function loadCache(pmRoot) {
4657
4726
  async function loadBodyCache(pmRoot) {
4658
4727
  return await loadEnvelopeMemoized(getBodyCachePath(pmRoot), (raw) => {
4659
4728
  const parsed = JSON.parse(raw);
4660
- if (parsed.version !== CACHE_VERSION || typeof parsed.bodies !== "object" || parsed.bodies === null) {
4729
+ if (parsed.version !== CACHE_VERSION || typeof parsed.source_cursor !== "string" || typeof parsed.bodies !== "object" || parsed.bodies === null) {
4661
4730
  return null;
4662
4731
  }
4663
4732
  return parsed;
@@ -4666,12 +4735,48 @@ async function loadBodyCache(pmRoot) {
4666
4735
  async function loadCollectionsCache(pmRoot) {
4667
4736
  return await loadEnvelopeMemoized(getCollectionsCachePath(pmRoot), (raw) => {
4668
4737
  const parsed = JSON.parse(raw);
4669
- if (parsed.version !== CACHE_VERSION || typeof parsed.collections !== "object" || parsed.collections === null) {
4738
+ if (parsed.version !== CACHE_VERSION || typeof parsed.source_cursor !== "string" || typeof parsed.collections !== "object" || parsed.collections === null) {
4670
4739
  return null;
4671
4740
  }
4672
4741
  return parsed;
4673
4742
  });
4674
4743
  }
4744
+ async function loadDerivedIndexDelta(pmRoot) {
4745
+ const deltaPath = getDeltaCachePath(pmRoot);
4746
+ const envelope = await loadEnvelopeMemoized(deltaPath, (raw) => {
4747
+ const parsed = JSON.parse(raw);
4748
+ if (parsed.version !== CACHE_VERSION || typeof parsed.base_source_cursor !== "string" || typeof parsed.source_cursor !== "string" || typeof parsed.changes !== "object" || parsed.changes === null) {
4749
+ return null;
4750
+ }
4751
+ return parsed;
4752
+ });
4753
+ if (envelope)
4754
+ return { envelope, invalid: false };
4755
+ try {
4756
+ await fs3.stat(deltaPath);
4757
+ return { envelope: null, invalid: true };
4758
+ } catch {
4759
+ return { envelope: null, invalid: false };
4760
+ }
4761
+ }
4762
+ async function loadDerivedIndexManifest(pmRoot) {
4763
+ const manifestPath = getManifestCachePath(pmRoot);
4764
+ const manifest = await loadEnvelopeMemoized(manifestPath, (raw) => {
4765
+ const parsed = JSON.parse(raw);
4766
+ if (parsed.version !== CACHE_VERSION || typeof parsed.context_fingerprint !== "string" || typeof parsed.source_cursor !== "string" || !Number.isInteger(parsed.entry_count) || parsed.entry_count < 0) {
4767
+ return null;
4768
+ }
4769
+ return parsed;
4770
+ });
4771
+ if (manifest)
4772
+ return manifest;
4773
+ try {
4774
+ await fs3.stat(manifestPath);
4775
+ await removeDerivedIndexFiles(pmRoot);
4776
+ } catch {
4777
+ }
4778
+ return null;
4779
+ }
4675
4780
  async function persistCache(cachePath, envelope) {
4676
4781
  await fs3.mkdir(path4.dirname(cachePath), { recursive: true });
4677
4782
  await writeFileAtomic(cachePath, JSON.stringify(envelope));
@@ -4731,10 +4836,7 @@ async function readDirectorySignature(pmRoot, folder) {
4731
4836
  }
4732
4837
  ];
4733
4838
  } catch {
4734
- return [
4735
- folder,
4736
- { exists: false, mtime_ms: 0, ctime_ms: 0, size: 0 }
4737
- ];
4839
+ return [folder, { exists: false, mtime_ms: 0, ctime_ms: 0, size: 0 }];
4738
4840
  }
4739
4841
  }
4740
4842
  async function readDirectorySignatures(pmRoot, folders) {
@@ -4914,13 +5016,22 @@ async function persistMetadataCacheIfNeeded(params) {
4914
5016
  if (!metadataDirty && params.existingCache !== null && params.existingCache.context_fingerprint === params.contextFingerprint) {
4915
5017
  return;
4916
5018
  }
4917
- await persistCache(getCachePath(params.pmRoot), {
4918
- version: CACHE_VERSION,
4919
- context_fingerprint: params.contextFingerprint,
4920
- directory_signatures: params.directorySignatures,
4921
- entries: params.state.newEntries
4922
- }).catch(() => {
4923
- });
5019
+ try {
5020
+ await persistCache(getCachePath(params.pmRoot), {
5021
+ version: CACHE_VERSION,
5022
+ context_fingerprint: params.contextFingerprint,
5023
+ source_cursor: params.sourceCursor,
5024
+ directory_signatures: params.directorySignatures,
5025
+ entries: params.state.newEntries
5026
+ });
5027
+ await persistCache(getManifestCachePath(params.pmRoot), {
5028
+ version: CACHE_VERSION,
5029
+ context_fingerprint: params.contextFingerprint,
5030
+ source_cursor: params.sourceCursor,
5031
+ entry_count: Object.keys(params.state.newEntries).length
5032
+ });
5033
+ } catch {
5034
+ }
4924
5035
  }
4925
5036
  async function persistBodyCacheIfNeeded(params) {
4926
5037
  const bodyDirty = params.state.misses.body || Object.keys(params.previousBodies).length !== Object.keys(params.state.newBodies).length;
@@ -4930,6 +5041,7 @@ async function persistBodyCacheIfNeeded(params) {
4930
5041
  await persistCache(getBodyCachePath(params.pmRoot), {
4931
5042
  version: CACHE_VERSION,
4932
5043
  context_fingerprint: params.contextFingerprint,
5044
+ source_cursor: params.sourceCursor,
4933
5045
  bodies: params.state.newBodies
4934
5046
  }).catch(() => {
4935
5047
  });
@@ -4942,15 +5054,112 @@ async function persistCollectionsCacheIfNeeded(params) {
4942
5054
  await persistCache(getCollectionsCachePath(params.pmRoot), {
4943
5055
  version: CACHE_VERSION,
4944
5056
  context_fingerprint: params.contextFingerprint,
5057
+ source_cursor: params.sourceCursor,
4945
5058
  collections: params.state.newCollections
4946
5059
  }).catch(() => {
4947
5060
  });
4948
5061
  }
5062
+ async function acquireItemMetadataDerivedIndexLock(pmRoot, author) {
5063
+ const cache = await loadDerivedIndexManifest(pmRoot);
5064
+ if (cache === null || cache.entry_count < DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS) {
5065
+ return async () => {
5066
+ };
5067
+ }
5068
+ return acquireLock(pmRoot, DERIVED_INDEX_LOCK_ID, 30, author, false, false, 3e3);
5069
+ }
5070
+ function relativeIndexPath(pmRoot, itemPath) {
5071
+ const relative = path4.relative(pmRoot, itemPath);
5072
+ return relative === "" || relative === ".." || relative.startsWith(`..${path4.sep}`) || path4.isAbsolute(relative) ? null : relative;
5073
+ }
5074
+ async function removeDerivedIndexFiles(pmRoot) {
5075
+ await Promise.all([
5076
+ getCachePath(pmRoot),
5077
+ getBodyCachePath(pmRoot),
5078
+ getCollectionsCachePath(pmRoot),
5079
+ getDeltaCachePath(pmRoot),
5080
+ getManifestCachePath(pmRoot)
5081
+ ].map(async (cachePath) => {
5082
+ await fs3.rm(cachePath, { force: true });
5083
+ envelopeMemo.delete(cachePath);
5084
+ }));
5085
+ }
5086
+ async function createDerivedIndexDeltaChange(params) {
5087
+ if (params.mutation.document === null) {
5088
+ return { entry: null, body: null, collections: null };
5089
+ }
5090
+ const stat2 = await fs3.stat(params.mutation.itemPath);
5091
+ const split = splitHeavyMetadata(params.mutation.document.metadata);
5092
+ const signature = {
5093
+ mtime_ms: stat2.mtimeMs,
5094
+ ctime_ms: stat2.ctimeMs,
5095
+ size: stat2.size
5096
+ };
5097
+ return {
5098
+ entry: {
5099
+ ...signature,
5100
+ metadata: split.light,
5101
+ body_length: params.mutation.document.body.length
5102
+ },
5103
+ body: { ...signature, body: params.mutation.document.body },
5104
+ collections: {
5105
+ ...signature,
5106
+ collections: split.heavy
5107
+ }
5108
+ };
5109
+ }
5110
+ function selectDerivedIndexDeltaChanges(delta, contextFingerprint, baseSourceCursor) {
5111
+ return delta?.context_fingerprint === contextFingerprint && delta.base_source_cursor === baseSourceCursor ? structuredClone(delta.changes) : {};
5112
+ }
5113
+ async function refreshItemMetadataDerivedIndex(mutation) {
5114
+ const relativePath = relativeIndexPath(mutation.pmRoot, mutation.itemPath);
5115
+ const previousRelativePath = mutation.previousItemPath ? relativeIndexPath(mutation.pmRoot, mutation.previousItemPath) : void 0;
5116
+ if (relativePath === null || previousRelativePath === null) {
5117
+ await removeDerivedIndexFiles(mutation.pmRoot);
5118
+ return ["metadata_derived_index_path_invalidated"];
5119
+ }
5120
+ try {
5121
+ const contextFingerprint = computeContextFingerprint(mutation.preferredFormat, mutation.typeToFolder, mutation.schema, resolveActiveExtensionFieldNames());
5122
+ const existingCache = await loadDerivedIndexManifest(mutation.pmRoot);
5123
+ if (existingCache === null || existingCache.context_fingerprint !== contextFingerprint) {
5124
+ return [];
5125
+ }
5126
+ const baseSourceCursor = existingCache.source_cursor;
5127
+ const delta = await loadDerivedIndexDelta(mutation.pmRoot);
5128
+ if (delta.invalid) {
5129
+ await removeDerivedIndexFiles(mutation.pmRoot);
5130
+ return ["metadata_derived_index_refresh_failed"];
5131
+ }
5132
+ const changes = selectDerivedIndexDeltaChanges(delta.envelope, contextFingerprint, baseSourceCursor);
5133
+ if (previousRelativePath !== void 0) {
5134
+ changes[previousRelativePath] = {
5135
+ entry: null,
5136
+ body: null,
5137
+ collections: null
5138
+ };
5139
+ }
5140
+ changes[relativePath] = await createDerivedIndexDeltaChange({ mutation });
5141
+ await persistCache(getDeltaCachePath(mutation.pmRoot), {
5142
+ version: CACHE_VERSION,
5143
+ context_fingerprint: contextFingerprint,
5144
+ base_source_cursor: baseSourceCursor,
5145
+ source_cursor: randomUUID2(),
5146
+ directory_signatures: await readDirectorySignatures(mutation.pmRoot, [
5147
+ ...new Set(Object.values(mutation.typeToFolder))
5148
+ ]),
5149
+ changes
5150
+ });
5151
+ return [];
5152
+ } catch {
5153
+ await removeDerivedIndexFiles(mutation.pmRoot).catch(() => {
5154
+ });
5155
+ return ["metadata_derived_index_refresh_failed"];
5156
+ }
5157
+ }
4949
5158
  function sortedCachedDocumentCandidates(state) {
4950
5159
  return [...state.documentsById.values()].sort((left, right) => left.candidate.metadata.id.localeCompare(right.candidate.metadata.id)).map((entry) => entry.candidate);
4951
5160
  }
4952
- function cacheTierMatchesContext(envelope, contextFingerprint) {
4953
- return envelope?.context_fingerprint === contextFingerprint;
5161
+ function cacheTierMatchesContext(envelope, contextFingerprint, sourceCursor) {
5162
+ return envelope?.context_fingerprint === contextFingerprint && envelope.source_cursor === sourceCursor;
4954
5163
  }
4955
5164
  function hasEveryDerivedIndexPart(keys, includeBody, includeCollections, previousBodies, previousCollections) {
4956
5165
  return keys.every((key) => (!includeBody || previousBodies[key] !== void 0) && (!includeCollections || previousCollections[key] !== void 0));
@@ -4983,8 +5192,8 @@ function canUseDerivedIndex(params) {
4983
5192
  return false;
4984
5193
  }
4985
5194
  const requiredTiersMatch = [
4986
- !params.includeBody || cacheTierMatchesContext(params.existingBodyCache, params.contextFingerprint),
4987
- !params.includeCollections || cacheTierMatchesContext(params.existingCollectionsCache, params.contextFingerprint)
5195
+ !params.includeBody || cacheTierMatchesContext(params.existingBodyCache, params.contextFingerprint, params.existingCache.source_cursor),
5196
+ !params.includeCollections || cacheTierMatchesContext(params.existingCollectionsCache, params.contextFingerprint, params.existingCache.source_cursor)
4988
5197
  ];
4989
5198
  return requiredTiersMatch.every(Boolean) && hasEveryDerivedIndexPart(params.entryKeys, params.includeBody, params.includeCollections, params.previousBodies, params.previousCollections);
4990
5199
  }
@@ -4993,11 +5202,15 @@ async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFo
4993
5202
  const includeCollections = options.includeCollections !== false;
4994
5203
  const extensionFieldNames = resolveActiveExtensionFieldNames();
4995
5204
  const contextFingerprint = computeContextFingerprint(preferredFormat, typeToFolder, schema, extensionFieldNames);
5205
+ const delta = await loadDerivedIndexDelta(pmRoot);
5206
+ if (delta.invalid)
5207
+ await removeDerivedIndexFiles(pmRoot);
4996
5208
  const existingCache = await loadCache(pmRoot);
4997
- const previousEntries = selectPreviousMetadataEntries(existingCache, contextFingerprint);
4998
5209
  const existingBodyCache = includeBody ? await loadBodyCache(pmRoot) : null;
4999
- const previousBodies = selectPreviousBodyEntries(existingBodyCache, contextFingerprint);
5000
5210
  const existingCollectionsCache = includeCollections ? await loadCollectionsCache(pmRoot) : null;
5211
+ applyDerivedIndexDelta(existingCache, existingBodyCache, existingCollectionsCache, delta.envelope);
5212
+ const previousEntries = selectPreviousMetadataEntries(existingCache, contextFingerprint);
5213
+ const previousBodies = selectPreviousBodyEntries(existingBodyCache, contextFingerprint);
5001
5214
  const previousCollections = selectPreviousCollectionEntries(existingCollectionsCache, contextFingerprint);
5002
5215
  const folders = [...new Set(Object.values(typeToFolder))];
5003
5216
  const directorySignaturesBefore = await readDirectorySignatures(pmRoot, folders);
@@ -5047,9 +5260,12 @@ async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFo
5047
5260
  await Promise.all(collectCachedDocumentParseTasks(dirResults, context));
5048
5261
  const directorySignaturesAfter = await readDirectorySignatures(pmRoot, folders);
5049
5262
  const stableDirectorySignatures = directorySignaturesMatch(directorySignaturesBefore, directorySignaturesAfter) ? directorySignaturesAfter : {};
5263
+ const metadataChanged = state.misses.metadata || Object.keys(previousEntries).length !== Object.keys(state.newEntries).length || !directorySignaturesMatch(existingCache?.directory_signatures, stableDirectorySignatures);
5264
+ const sourceCursor = metadataChanged || existingCache === null ? randomUUID2() : existingCache.source_cursor;
5050
5265
  await persistMetadataCacheIfNeeded({
5051
5266
  pmRoot,
5052
5267
  contextFingerprint,
5268
+ sourceCursor,
5053
5269
  existingCache,
5054
5270
  previousEntries,
5055
5271
  directorySignatures: stableDirectorySignatures,
@@ -5059,6 +5275,7 @@ async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFo
5059
5275
  await persistBodyCacheIfNeeded({
5060
5276
  pmRoot,
5061
5277
  contextFingerprint,
5278
+ sourceCursor,
5062
5279
  existingBodyCache,
5063
5280
  previousBodies,
5064
5281
  state
@@ -5068,6 +5285,7 @@ async function listAllDocumentCandidatesCached(pmRoot, preferredFormat, typeToFo
5068
5285
  await persistCollectionsCacheIfNeeded({
5069
5286
  pmRoot,
5070
5287
  contextFingerprint,
5288
+ sourceCursor,
5071
5289
  existingCollectionsCache,
5072
5290
  previousCollections,
5073
5291
  state
@@ -5096,10 +5314,12 @@ async function listAllDocumentsCachedLight(pmRoot, preferredFormat, typeToFolder
5096
5314
  }
5097
5315
 
5098
5316
  // dist/core/store/item-store.js
5317
+ import fs4 from "node:fs/promises";
5318
+ import path5 from "node:path";
5099
5319
  !(function() {
5100
5320
  try {
5101
5321
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5102
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0e2102ef-7489-53f5-b639-1e3d582eaf63");
5322
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d3ae3183-69f2-5329-a5a8-f17ee29b4a5f");
5103
5323
  } catch (e2) {
5104
5324
  }
5105
5325
  })();
@@ -5359,30 +5579,47 @@ async function mutateItem(params) {
5359
5579
  contents: serializedAfter
5360
5580
  });
5361
5581
  const { effectiveTargetItemPath, effectiveSerializedAfter, skipItemWrite } = resolveItemStoreWriteOverride(serviceWriteOverride, targetItemPath, serializedAfter);
5362
- if (!skipItemWrite) {
5363
- await writeFileAtomic(effectiveTargetItemPath, effectiveSerializedAfter);
5364
- }
5365
- if (!skipItemWrite && effectiveTargetItemPath !== located.itemPath) {
5366
- await fs4.rm(located.itemPath);
5367
- }
5368
- const entry = createHistoryEntry({
5369
- nowIso: afterDocument.metadata.updated_at,
5370
- author: params.author,
5371
- op: params.op,
5372
- before: beforeDocument,
5373
- after: afterDocument,
5374
- message: params.message
5375
- });
5582
+ const releaseDerivedIndexLock = await acquireItemMetadataDerivedIndexLock(params.pmRoot, params.author);
5583
+ let derivedIndexWarnings = [];
5376
5584
  try {
5377
- await appendHistoryEntry(historyPath, entry);
5378
- } catch (error) {
5379
- await rollbackMutatedItemWrite({
5380
- skipItemWrite,
5381
- effectiveTargetItemPath,
5382
- originalItemPath: located.itemPath,
5383
- originalRaw
5585
+ if (!skipItemWrite) {
5586
+ await writeFileAtomic(effectiveTargetItemPath, effectiveSerializedAfter);
5587
+ }
5588
+ if (!skipItemWrite && effectiveTargetItemPath !== located.itemPath) {
5589
+ await fs4.rm(located.itemPath);
5590
+ }
5591
+ const entry = createHistoryEntry({
5592
+ nowIso: afterDocument.metadata.updated_at,
5593
+ author: params.author,
5594
+ op: params.op,
5595
+ before: beforeDocument,
5596
+ after: afterDocument,
5597
+ message: params.message
5384
5598
  });
5385
- throw error;
5599
+ try {
5600
+ await appendHistoryEntry(historyPath, entry);
5601
+ } catch (error) {
5602
+ await rollbackMutatedItemWrite({
5603
+ skipItemWrite,
5604
+ effectiveTargetItemPath,
5605
+ originalItemPath: located.itemPath,
5606
+ originalRaw
5607
+ });
5608
+ throw error;
5609
+ }
5610
+ if (!skipItemWrite) {
5611
+ derivedIndexWarnings = await refreshItemMetadataDerivedIndex({
5612
+ pmRoot: params.pmRoot,
5613
+ preferredFormat: params.settings.item_format,
5614
+ typeToFolder,
5615
+ schema: params.settings.schema,
5616
+ itemPath: effectiveTargetItemPath,
5617
+ previousItemPath: located.itemPath,
5618
+ document: afterDocument
5619
+ });
5620
+ }
5621
+ } finally {
5622
+ await releaseDerivedIndexLock();
5386
5623
  }
5387
5624
  const hookWarnings = [
5388
5625
  ...await runActiveOnWriteHooks({
@@ -5425,6 +5662,7 @@ async function mutateItem(params) {
5425
5662
  ...mutation.warnings ?? [],
5426
5663
  ...historyPolicy.warnings,
5427
5664
  ...serviceWriteOverride.warnings,
5665
+ ...derivedIndexWarnings,
5428
5666
  ...hookWarnings
5429
5667
  ]
5430
5668
  };
@@ -5494,16 +5732,32 @@ async function deleteItem(params) {
5494
5732
  ]
5495
5733
  };
5496
5734
  }
5497
- if (!skipDelete) {
5498
- await fs4.rm(effectiveItemPath);
5499
- }
5735
+ const releaseDerivedIndexLock = await acquireItemMetadataDerivedIndexLock(params.pmRoot, params.author);
5736
+ let derivedIndexWarnings = [];
5500
5737
  try {
5501
- await appendHistoryEntry(historyPath, historyEntry);
5502
- } catch (error) {
5503
5738
  if (!skipDelete) {
5504
- await writeFileAtomic(effectiveItemPath, originalRaw);
5739
+ await fs4.rm(effectiveItemPath);
5740
+ }
5741
+ try {
5742
+ await appendHistoryEntry(historyPath, historyEntry);
5743
+ } catch (error) {
5744
+ if (!skipDelete) {
5745
+ await writeFileAtomic(effectiveItemPath, originalRaw);
5746
+ }
5747
+ throw error;
5748
+ }
5749
+ if (!skipDelete) {
5750
+ derivedIndexWarnings = await refreshItemMetadataDerivedIndex({
5751
+ pmRoot: params.pmRoot,
5752
+ preferredFormat: params.settings.item_format,
5753
+ typeToFolder: prepared.typeToFolder,
5754
+ schema: params.settings.schema,
5755
+ itemPath: effectiveItemPath,
5756
+ document: null
5757
+ });
5505
5758
  }
5506
- throw error;
5759
+ } finally {
5760
+ await releaseDerivedIndexLock();
5507
5761
  }
5508
5762
  const hookWarnings = [
5509
5763
  ...await runActiveOnWriteHooks({
@@ -5542,6 +5796,7 @@ async function deleteItem(params) {
5542
5796
  ...parseWarnings,
5543
5797
  ...historyPolicy.warnings,
5544
5798
  ...serviceDeleteOverride.warnings,
5799
+ ...derivedIndexWarnings,
5545
5800
  ...hookWarnings
5546
5801
  ]
5547
5802
  };
@@ -5624,7 +5879,10 @@ export {
5624
5879
  normalizeRawItemId,
5625
5880
  normalizeItemId,
5626
5881
  generateItemId,
5882
+ DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,
5627
5883
  HEAVY_METADATA_KEYS,
5884
+ acquireItemMetadataDerivedIndexLock,
5885
+ refreshItemMetadataDerivedIndex,
5628
5886
  listAllDocumentCandidatesCached,
5629
5887
  locateItem,
5630
5888
  readLocatedItem,
@@ -5635,4 +5893,4 @@ export {
5635
5893
  mutateItem,
5636
5894
  deleteItem
5637
5895
  };
5638
- //# sourceMappingURL=chunk-IY6VZ3IW.js.map
5896
+ //# sourceMappingURL=chunk-5FAG2JUC.js.map