@unbrained/pm-cli 2026.7.19 → 2026.7.20

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 (600) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +2 -0
  3. package/CHANGELOG.md +36 -0
  4. package/dist/cli/commands/append.js +13 -6
  5. package/dist/cli/commands/append.js.map +1 -1
  6. package/dist/cli/commands/calendar.d.ts +1 -1
  7. package/dist/cli/commands/calendar.js +2 -2
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/comments.js +2 -5
  10. package/dist/cli/commands/comments.js.map +1 -1
  11. package/dist/cli/commands/completion.js +11 -3
  12. package/dist/cli/commands/completion.js.map +1 -1
  13. package/dist/cli/commands/context.d.ts +1 -1
  14. package/dist/cli/commands/context.js +2 -2
  15. package/dist/cli/commands/context.js.map +1 -1
  16. package/dist/cli/commands/contracts.js +4 -3
  17. package/dist/cli/commands/contracts.js.map +1 -1
  18. package/dist/cli/commands/copy.js +5 -3
  19. package/dist/cli/commands/copy.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +3 -1
  21. package/dist/cli/commands/create.js +5 -3
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/merge.d.ts +8 -0
  24. package/dist/cli/commands/merge.js +12 -0
  25. package/dist/cli/commands/merge.js.map +1 -0
  26. package/dist/cli/commands/plan.d.ts +1 -1
  27. package/dist/cli/commands/plan.js +2 -2
  28. package/dist/cli/commands/plan.js.map +1 -1
  29. package/dist/cli/commands/update-many.d.ts +5 -0
  30. package/dist/cli/commands/update-many.js +81 -6
  31. package/dist/cli/commands/update-many.js.map +1 -1
  32. package/dist/cli/commands/update.d.ts +5 -1
  33. package/dist/cli/commands/update.js +50 -4
  34. package/dist/cli/commands/update.js.map +1 -1
  35. package/dist/cli/register-list-query.js +14 -2
  36. package/dist/cli/register-list-query.js.map +1 -1
  37. package/dist/cli/register-mutation.js +61 -2
  38. package/dist/cli/register-mutation.js.map +1 -1
  39. package/dist/cli/register-operations.js +5 -3
  40. package/dist/cli/register-operations.js.map +1 -1
  41. package/dist/cli/registration-helpers.js +4 -2
  42. package/dist/cli/registration-helpers.js.map +1 -1
  43. package/dist/cli-bundle/bundle-manifest.json +365 -333
  44. package/dist/cli-bundle/chunks/{append-MBXHNWSX.js → append-E6V54WOQ.js} +5 -5
  45. package/dist/cli-bundle/chunks/append-NNJ3EFIT.js +11 -0
  46. package/dist/cli-bundle/chunks/{chunk-M4B4RK4J.js → chunk-2BO4CA46.js} +14 -238
  47. package/dist/cli-bundle/chunks/{chunk-M4B4RK4J.js.map → chunk-2BO4CA46.js.map} +1 -1
  48. package/dist/cli-bundle/chunks/{chunk-MQOSMBWV.js → chunk-3AO5VSDR.js} +25 -6
  49. package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +7 -0
  50. package/dist/cli-bundle/chunks/{chunk-ODEIDKGW.js → chunk-3LPFHE3P.js} +596 -154
  51. package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +1 -0
  52. package/dist/cli-bundle/chunks/{chunk-YGEA4CLH.js → chunk-3MCTMJXI.js} +4 -4
  53. package/dist/cli-bundle/chunks/{chunk-N7FCFJ76.js → chunk-3P7UJQOX.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-7B7IHMLH.js → chunk-3VY6MIEO.js} +3 -3
  55. package/dist/cli-bundle/chunks/{chunk-3EZZTFL2.js → chunk-4F6BWJ4J.js} +51 -43
  56. package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +7 -0
  57. package/dist/cli-bundle/chunks/{chunk-VA3H7VVC.js → chunk-4L23AGQ7.js} +9 -7
  58. package/dist/cli-bundle/chunks/chunk-4L23AGQ7.js.map +1 -0
  59. package/dist/cli-bundle/chunks/{chunk-5S6IZXK7.js → chunk-4U4Z6AHI.js} +7 -7
  60. package/dist/cli-bundle/chunks/{chunk-UOIFZ66L.js → chunk-4XGJLADW.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-SUNZKVAH.js → chunk-5IZJWSDB.js} +5 -5
  62. package/dist/cli-bundle/chunks/{chunk-QQ77W23U.js → chunk-5NTE36LD.js} +4 -4
  63. package/dist/cli-bundle/chunks/{chunk-EVAN5VJA.js → chunk-5OK4UGFV.js} +5 -8
  64. package/dist/cli-bundle/chunks/{chunk-EVAN5VJA.js.map → chunk-5OK4UGFV.js.map} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-H3YKUVDR.js → chunk-5UX66S6U.js} +26 -7
  66. package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +1 -0
  67. package/dist/cli-bundle/chunks/{chunk-KGPLSHJD.js → chunk-6C2ZZX5Z.js} +2 -2
  68. package/dist/cli-bundle/chunks/{chunk-Q5NHJ6RO.js → chunk-6JUTHVQS.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-NTS2RKHN.js → chunk-6VIJ7UA5.js} +15 -15
  70. package/dist/cli-bundle/chunks/{chunk-BBGR4FKQ.js → chunk-6XMUURSS.js} +6 -6
  71. package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-XVB6BATY.js → chunk-72LQ4TKV.js} +3 -3
  73. package/dist/cli-bundle/chunks/{chunk-WCBB6VI3.js → chunk-7AVEY74G.js} +8 -5
  74. package/dist/cli-bundle/chunks/chunk-7AVEY74G.js.map +7 -0
  75. package/dist/cli-bundle/chunks/{chunk-YG56M3NE.js → chunk-7DOJC3HS.js} +8 -8
  76. package/dist/cli-bundle/chunks/chunk-7DOJC3HS.js.map +1 -0
  77. package/dist/cli-bundle/chunks/{chunk-KZ5AC6B5.js → chunk-7WCE6Y64.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-VQOG2ETB.js → chunk-AF2CCM5U.js} +4 -4
  79. package/dist/cli-bundle/chunks/{chunk-P24ZU5QV.js → chunk-AOEOYL3S.js} +49 -12
  80. package/dist/cli-bundle/chunks/chunk-AOEOYL3S.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-BZKE2O5V.js → chunk-BKIAH72N.js} +8 -6
  82. package/dist/cli-bundle/chunks/chunk-BKIAH72N.js.map +1 -0
  83. package/dist/cli-bundle/chunks/{chunk-RWAIRGBC.js → chunk-C3KD7U3T.js} +12 -243
  84. package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +7 -0
  85. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +334 -0
  86. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{chunk-TELI67UP.js → chunk-CQTQKUUV.js} +6 -9
  88. package/dist/cli-bundle/chunks/{chunk-TELI67UP.js.map → chunk-CQTQKUUV.js.map} +1 -1
  89. package/dist/cli-bundle/chunks/{chunk-ZUCBPXNA.js → chunk-D6NXDNP3.js} +5 -5
  90. package/dist/cli-bundle/chunks/chunk-D6NXDNP3.js.map +7 -0
  91. package/dist/cli-bundle/chunks/{chunk-EAV3P54W.js → chunk-DAQ45GCS.js} +5 -5
  92. package/dist/cli-bundle/chunks/{chunk-6V4T4RD3.js → chunk-DVDBQA3B.js} +79 -22
  93. package/dist/cli-bundle/chunks/chunk-DVDBQA3B.js.map +1 -0
  94. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +249 -0
  95. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +7 -0
  96. package/dist/cli-bundle/chunks/{chunk-ZF52NVRT.js → chunk-E7ICD63T.js} +131 -179
  97. package/dist/cli-bundle/chunks/chunk-E7ICD63T.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-RX53WHFI.js → chunk-EJDGV4GR.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-IXG5CMBR.js → chunk-FDHPAVVB.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-KAE727L2.js → chunk-FSRHYUDA.js} +2 -2
  101. package/dist/cli-bundle/chunks/chunk-FSRHYUDA.js.map +7 -0
  102. package/dist/cli-bundle/chunks/{chunk-46Z6FAVP.js → chunk-G3COA6GS.js} +51 -43
  103. package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-A4FVWFZY.js → chunk-GFQP7HAZ.js} +8 -6
  105. package/dist/cli-bundle/chunks/chunk-GFQP7HAZ.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-2XPDCXK5.js → chunk-GIQSU6S2.js} +6 -6
  107. package/dist/cli-bundle/chunks/chunk-GIQSU6S2.js.map +1 -0
  108. package/dist/cli-bundle/chunks/{chunk-V4QHAMI5.js → chunk-GROYI4RB.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-77XFQRTD.js → chunk-GSJSM5BJ.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-QYGK2XQ3.js → chunk-GTLCVJOE.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-VSQE43NO.js → chunk-GV2262OF.js} +4 -4
  112. package/dist/cli-bundle/chunks/{chunk-N2TEEOXJ.js → chunk-GVI6FAFG.js} +8 -6
  113. package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-A5EQPNV7.js → chunk-GVT754PX.js} +44 -3
  115. package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-Y2VSGFT4.js → chunk-HB3P4M52.js} +22 -7
  117. package/dist/cli-bundle/chunks/chunk-HB3P4M52.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-STBCBDKF.js → chunk-HCEBZNC3.js} +6 -6
  119. package/dist/cli-bundle/chunks/{chunk-EEECAV5M.js → chunk-HEWM6CEN.js} +80 -25
  120. package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +7 -0
  121. package/dist/cli-bundle/chunks/{chunk-GKCEEXMA.js → chunk-HQ3SB4CN.js} +21 -6
  122. package/dist/cli-bundle/chunks/{chunk-GKCEEXMA.js.map → chunk-HQ3SB4CN.js.map} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-U6RYD446.js → chunk-HRW7GF6T.js} +7 -7
  124. package/dist/cli-bundle/chunks/{chunk-D35WYXWC.js → chunk-HYW67VJ5.js} +6 -3
  125. package/dist/cli-bundle/chunks/chunk-HYW67VJ5.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-OKWJUL6F.js → chunk-I577UHC7.js} +16 -9
  127. package/dist/cli-bundle/chunks/{chunk-OKWJUL6F.js.map → chunk-I577UHC7.js.map} +2 -2
  128. package/dist/cli-bundle/chunks/{chunk-XDWXPG2E.js → chunk-IAQE32BI.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-66SRNEBK.js → chunk-IJNK6WW2.js} +3 -3
  130. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js +623 -0
  131. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-A3GAQLBH.js → chunk-IX677TRO.js} +75 -12
  133. package/dist/cli-bundle/chunks/chunk-IX677TRO.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-RLLOZAM2.js → chunk-IY6VZ3IW.js} +29 -8
  135. package/dist/cli-bundle/chunks/chunk-IY6VZ3IW.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-SVAWG7EE.js → chunk-J4FBIFU6.js} +45 -4
  137. package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-AGEBQRBG.js → chunk-JAPE62Y5.js} +9 -9
  139. package/dist/cli-bundle/chunks/{chunk-UWAQI3B7.js → chunk-JGUKMMRS.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-UU6EP25G.js → chunk-JH2ZSLO3.js} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-GRDK25BN.js → chunk-JHJSFOAM.js} +6 -6
  142. package/dist/cli-bundle/chunks/{chunk-FQO5THHM.js → chunk-JM6YAXTR.js} +2 -2
  143. package/dist/cli-bundle/chunks/{chunk-E7KBMWEF.js → chunk-JSLT7WVE.js} +2 -2
  144. package/dist/cli-bundle/chunks/{chunk-FIUTBFC6.js → chunk-K4CI6Y45.js} +2 -2
  145. package/dist/cli-bundle/chunks/{chunk-IEMXESIS.js → chunk-KSPWRNVP.js} +7 -7
  146. package/dist/cli-bundle/chunks/{chunk-3QNUDDY2.js → chunk-KZEANWJS.js} +14 -12
  147. package/dist/cli-bundle/chunks/{chunk-3QNUDDY2.js.map → chunk-KZEANWJS.js.map} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-BFJP4VYC.js → chunk-L7BH7IWU.js} +4 -4
  149. package/dist/cli-bundle/chunks/{chunk-2UCG5H6B.js → chunk-LPEYZRUR.js} +3 -3
  150. package/dist/cli-bundle/chunks/{chunk-FQF6VVPH.js → chunk-MYSS5H2A.js} +9 -7
  151. package/dist/cli-bundle/chunks/{chunk-FQF6VVPH.js.map → chunk-MYSS5H2A.js.map} +1 -1
  152. package/dist/cli-bundle/chunks/{chunk-IR3GOO6E.js → chunk-NHT3F4WZ.js} +15 -15
  153. package/dist/cli-bundle/chunks/{chunk-6BNV3G6C.js → chunk-NLR32VFS.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-BDC4TW4B.js → chunk-OV7MSW3I.js} +15 -13
  155. package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +1 -0
  156. package/dist/cli-bundle/chunks/{chunk-EI3UIMZM.js → chunk-OWXOPDHD.js} +4 -4
  157. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +246 -0
  158. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-AQUNTB7G.js → chunk-PEQGTJ5Q.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-QFG4MB7P.js → chunk-POG76WWZ.js} +28 -7
  161. package/dist/cli-bundle/chunks/chunk-POG76WWZ.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-MI3346YW.js → chunk-QANSTTC7.js} +129 -170
  163. package/dist/cli-bundle/chunks/chunk-QANSTTC7.js.map +1 -0
  164. package/dist/cli-bundle/chunks/{chunk-T6MOTLOJ.js → chunk-QJKL5PHS.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-SBW7EQC4.js → chunk-QLZ643FM.js} +76 -13
  166. package/dist/cli-bundle/chunks/chunk-QLZ643FM.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-XKVHL3MB.js → chunk-QWRVBJ4D.js} +2 -2
  168. package/dist/cli-bundle/chunks/chunk-R3EWPG4A.js +106 -0
  169. package/dist/cli-bundle/chunks/chunk-R3EWPG4A.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +344 -0
  171. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{chunk-VFA5EIEN.js → chunk-R7QV7ICM.js} +4 -4
  173. package/dist/cli-bundle/chunks/{chunk-NPEYH6CE.js → chunk-RDV4ZFYS.js} +12 -10
  174. package/dist/cli-bundle/chunks/{chunk-NPEYH6CE.js.map → chunk-RDV4ZFYS.js.map} +1 -1
  175. package/dist/cli-bundle/chunks/{chunk-K2L6FZBX.js → chunk-RJO3YAFM.js} +4 -4
  176. package/dist/cli-bundle/chunks/{chunk-YIC5NGXF.js → chunk-RMF7LMBS.js} +7 -7
  177. package/dist/cli-bundle/chunks/{chunk-YIC5NGXF.js.map → chunk-RMF7LMBS.js.map} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-MRXAHR4B.js → chunk-RZJLNXFG.js} +50 -13
  179. package/dist/cli-bundle/chunks/chunk-RZJLNXFG.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-DJAGYYCQ.js → chunk-SC2HMDGB.js} +19 -3
  181. package/dist/cli-bundle/chunks/chunk-SC2HMDGB.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-SGJB6PXA.js → chunk-SF3DT5HJ.js} +3 -3
  183. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js +604 -0
  184. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-Q3K5XPAQ.js → chunk-SR3JOATZ.js} +18 -2
  186. package/dist/cli-bundle/chunks/chunk-SR3JOATZ.js.map +7 -0
  187. package/dist/cli-bundle/chunks/{chunk-DUDLSQFG.js → chunk-SSKOQNMS.js} +14 -12
  188. package/dist/cli-bundle/chunks/{chunk-DUDLSQFG.js.map → chunk-SSKOQNMS.js.map} +1 -1
  189. package/dist/cli-bundle/chunks/{chunk-UNNCT5QY.js → chunk-SZVB53Y3.js} +3 -3
  190. package/dist/cli-bundle/chunks/{chunk-JBW2S2C6.js → chunk-T44FMVRL.js} +613 -157
  191. package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +7 -0
  192. package/dist/cli-bundle/chunks/{chunk-GFZB5CLP.js → chunk-T6PPNM7V.js} +4 -4
  193. package/dist/cli-bundle/chunks/{chunk-UE7LK3RE.js → chunk-THAOZG4U.js} +9 -7
  194. package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{chunk-IGBBTPM5.js → chunk-TOBGV45Y.js} +4 -4
  196. package/dist/cli-bundle/chunks/chunk-TOBGV45Y.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-W6IEJXNC.js → chunk-TVYYO5A7.js} +2 -2
  198. package/dist/cli-bundle/chunks/chunk-TYHJDFYW.js +109 -0
  199. package/dist/cli-bundle/chunks/chunk-TYHJDFYW.js.map +7 -0
  200. package/dist/cli-bundle/chunks/{chunk-DOASIOQR.js → chunk-UQLXSG72.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-IDUTGRDM.js → chunk-URXVHN3L.js} +3 -3
  202. package/dist/cli-bundle/chunks/chunk-URXVHN3L.js.map +1 -0
  203. package/dist/cli-bundle/chunks/{chunk-7CHWLT2J.js → chunk-UVN66B3M.js} +2 -2
  204. package/dist/cli-bundle/chunks/{chunk-Q6JPYR7I.js → chunk-UX6SSO2I.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-JPWUZOMR.js → chunk-UZDQXNUB.js} +75 -20
  206. package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-OK7VSX3N.js → chunk-UZLJOEAC.js} +3 -3
  208. package/dist/cli-bundle/chunks/{chunk-4PSJVGRE.js → chunk-VDO2JMD4.js} +7 -7
  209. package/dist/cli-bundle/chunks/{chunk-IRJ6F23W.js → chunk-VQIHNHMJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-FQODDTE7.js → chunk-WUVEBQW6.js} +7 -5
  211. package/dist/cli-bundle/chunks/{chunk-FQODDTE7.js.map → chunk-WUVEBQW6.js.map} +1 -1
  212. package/dist/cli-bundle/chunks/{chunk-Q4PSG2GV.js → chunk-WVA4DVNV.js} +5 -5
  213. package/dist/cli-bundle/chunks/{chunk-Q4PSG2GV.js.map → chunk-WVA4DVNV.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/{chunk-4M6RZJXF.js → chunk-WWNL6WMH.js} +3 -3
  215. package/dist/cli-bundle/chunks/chunk-WWNL6WMH.js.map +7 -0
  216. package/dist/cli-bundle/chunks/{chunk-3KPNOZOH.js → chunk-X6K5XTTN.js} +78 -21
  217. package/dist/cli-bundle/chunks/chunk-X6K5XTTN.js.map +7 -0
  218. package/dist/cli-bundle/chunks/{chunk-G33XIMRT.js → chunk-XJF7CDNH.js} +17 -10
  219. package/dist/cli-bundle/chunks/{chunk-G33XIMRT.js.map → chunk-XJF7CDNH.js.map} +1 -1
  220. package/dist/cli-bundle/chunks/{chunk-AR24KW26.js → chunk-YBT7O4KT.js} +17 -112
  221. package/dist/cli-bundle/chunks/chunk-YBT7O4KT.js.map +7 -0
  222. package/dist/cli-bundle/chunks/{chunk-CZA2DXCV.js → chunk-YQQNAKW3.js} +17 -105
  223. package/dist/cli-bundle/chunks/chunk-YQQNAKW3.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-OKPZDH43.js → chunk-YQWCZ5AC.js} +7 -5
  225. package/dist/cli-bundle/chunks/{chunk-OKPZDH43.js.map → chunk-YQWCZ5AC.js.map} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-LT5UWU7H.js → chunk-ZOJ3LR7O.js} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-3HSRP6T2.js → chunk-ZOY5K4D3.js} +2 -2
  228. package/dist/cli-bundle/chunks/{chunk-XXWDEQ6O.js → chunk-ZV2NTVMJ.js} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-UW6HCMP2.js → chunk-ZYPFOO3L.js} +9 -9
  230. package/dist/cli-bundle/chunks/close-O5QVZ6ET.js +12 -0
  231. package/dist/cli-bundle/chunks/{close-7NWA3GLA.js → close-QEMOYZN3.js} +5 -5
  232. package/dist/cli-bundle/chunks/close-many-SDA426VT.js +24 -0
  233. package/dist/cli-bundle/chunks/{close-many-YALQ7AXS.js → close-many-UTZANOCQ.js} +15 -14
  234. package/dist/cli-bundle/chunks/{comments-SQIQ5WYR.js → comments-LZN6FXXC.js} +7 -7
  235. package/dist/cli-bundle/chunks/comments-VBQ345ND.js +13 -0
  236. package/dist/cli-bundle/chunks/{copy-YDAMENCP.js → copy-DKTSSCK7.js} +4 -4
  237. package/dist/cli-bundle/chunks/copy-M7DDI6LS.js +9 -0
  238. package/dist/cli-bundle/chunks/{create-JSL6CXU3.js → create-GG4RBCGC.js} +11 -11
  239. package/dist/cli-bundle/chunks/create-JBC5KUW6.js +29 -0
  240. package/dist/cli-bundle/chunks/{delete-IGVOZEU2.js → delete-LCS3VPDH.js} +4 -4
  241. package/dist/cli-bundle/chunks/delete-MD7YXQLH.js +10 -0
  242. package/dist/cli-bundle/chunks/{deps-BQAXUQAK.js → deps-DELOO4TL.js} +6 -6
  243. package/dist/cli-bundle/chunks/{deps-CBPPSS6J.js → deps-FI4O6NQS.js} +6 -6
  244. package/dist/cli-bundle/chunks/docs-2UYBP5D6.js +14 -0
  245. package/dist/cli-bundle/chunks/{docs-NS2AZWCN.js → docs-6Z2MP526.js} +6 -6
  246. package/dist/cli-bundle/chunks/{files-XUUBQ76I.js → files-HEUGSJZL.js} +6 -6
  247. package/dist/cli-bundle/chunks/{files-PVWEPT5J.js → files-HKEAN5MA.js} +6 -6
  248. package/dist/cli-bundle/chunks/{focus-DHBHKK3E.js → focus-7SOUT5PZ.js} +5 -5
  249. package/dist/cli-bundle/chunks/focus-DRQ6FQH6.js +10 -0
  250. package/dist/cli-bundle/chunks/history-compact-65YVN5DB.js +17 -0
  251. package/dist/cli-bundle/chunks/{history-compact-3TNPYVFG.js → history-compact-7NDVP3PT.js} +7 -6
  252. package/dist/cli-bundle/chunks/{history-redact-KKFDICCF.js → history-redact-7YBL4XSG.js} +5 -4
  253. package/dist/cli-bundle/chunks/{history-redact-ELRL73XN.js → history-redact-IZGNJBU4.js} +5 -4
  254. package/dist/cli-bundle/chunks/{history-repair-J7WKZFAG.js → history-repair-7M4PYQUH.js} +8 -6
  255. package/dist/cli-bundle/chunks/history-repair-GNGETJLI.js +18 -0
  256. package/dist/cli-bundle/chunks/learnings-3YXDRWFT.js +13 -0
  257. package/dist/cli-bundle/chunks/{learnings-X4D6JCCG.js → learnings-ALC6IMNL.js} +7 -7
  258. package/dist/cli-bundle/chunks/notes-7JMLQ447.js +13 -0
  259. package/dist/cli-bundle/chunks/{notes-UQC6VS6N.js → notes-JFCLTC5C.js} +7 -7
  260. package/dist/cli-bundle/chunks/plan-KOIPWVOZ.js +26 -0
  261. package/dist/cli-bundle/chunks/{plan-5GKRBJJO.js → plan-T3XB3WTK.js} +12 -12
  262. package/dist/cli-bundle/chunks/{profile-5PQAPCLF.js → profile-OILJHKUW.js} +12 -11
  263. package/dist/cli-bundle/chunks/{profile-CW4BD3FO.js → profile-RJXA7PGS.js} +12 -11
  264. package/dist/cli-bundle/chunks/{register-list-query-PHIPDFP2.js → register-list-query-CFVG75P3.js} +30 -21
  265. package/dist/cli-bundle/chunks/{register-list-query-PHIPDFP2.js.map → register-list-query-CFVG75P3.js.map} +1 -1
  266. package/dist/cli-bundle/chunks/{register-list-query-HTDQE6VI.js → register-list-query-E7UVY4TN.js} +29 -20
  267. package/dist/cli-bundle/chunks/{register-list-query-HTDQE6VI.js.map → register-list-query-E7UVY4TN.js.map} +2 -2
  268. package/dist/cli-bundle/chunks/{register-mutation-BLEWM5I6.js → register-mutation-4VJTXBZW.js} +86 -32
  269. package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-mutation-OTYHR7J6.js → register-mutation-IQ55E25C.js} +78 -33
  271. package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{register-operations-AMCUFYEW.js → register-operations-AR7RMX4W.js} +42 -38
  273. package/dist/cli-bundle/chunks/register-operations-AR7RMX4W.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-operations-MRLHOZYR.js → register-operations-NOLZGORC.js} +41 -37
  275. package/dist/cli-bundle/chunks/register-operations-NOLZGORC.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-ZVKTDL4G.js → register-setup-BB77VUEE.js} +17 -16
  277. package/dist/cli-bundle/chunks/{register-setup-ZVKTDL4G.js.map → register-setup-BB77VUEE.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{register-setup-N2FOSWAG.js → register-setup-EYZ7VTPZ.js} +15 -14
  279. package/dist/cli-bundle/chunks/{register-setup-N2FOSWAG.js.map → register-setup-EYZ7VTPZ.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/restore-L6IAGOD7.js +15 -0
  281. package/dist/cli-bundle/chunks/{restore-HEQAG6EK.js → restore-ZH65GZFB.js} +7 -6
  282. package/dist/cli-bundle/chunks/{schema-Q5DAWJ2S.js → schema-4ERWM5QJ.js} +7 -6
  283. package/dist/cli-bundle/chunks/{schema-MAXAIHEC.js → schema-55DL3Q52.js} +7 -6
  284. package/dist/cli-bundle/chunks/{update-DWFXXJKP.js → update-FW6FKDOP.js} +15 -15
  285. package/dist/cli-bundle/chunks/update-TJHSPRPT.js +23 -0
  286. package/dist/cli-bundle/chunks/update-many-NNALYQCN.js +35 -0
  287. package/dist/cli-bundle/chunks/update-many-PWXX5WHO.js +39 -0
  288. package/dist/cli-bundle/main.js +62 -59
  289. package/dist/cli-bundle/main.js.map +1 -1
  290. package/dist/cli-bundle/sdk-runtime.js +62 -59
  291. package/dist/cli-bundle/sdk-testing.js +8 -8
  292. package/dist/cli-bundle/sdk.js +327 -57
  293. package/dist/cli-bundle/sdk.js.map +4 -4
  294. package/dist/core/config/nested-settings.d.ts +2 -0
  295. package/dist/core/config/nested-settings.js +18 -2
  296. package/dist/core/config/nested-settings.js.map +1 -1
  297. package/dist/core/diagnostics/remediation.js +38 -2
  298. package/dist/core/diagnostics/remediation.js.map +1 -1
  299. package/dist/core/extensions/extension-types.d.ts +1 -1
  300. package/dist/core/extensions/extension-types.js +2 -2
  301. package/dist/core/extensions/extension-types.js.map +1 -1
  302. package/dist/core/item/id.d.ts +19 -2
  303. package/dist/core/item/id.js +27 -6
  304. package/dist/core/item/id.js.map +1 -1
  305. package/dist/core/item/parse.d.ts +7 -0
  306. package/dist/core/item/parse.js +48 -2
  307. package/dist/core/item/parse.js.map +1 -1
  308. package/dist/core/schema/item-types-file.d.ts +2 -2
  309. package/dist/core/schema/item-types-file.js +2 -2
  310. package/dist/core/schema/item-types-file.js.map +1 -1
  311. package/dist/core/schema/runtime-schema.d.ts +3 -3
  312. package/dist/core/schema/runtime-schema.js +2 -2
  313. package/dist/core/schema/runtime-schema.js.map +1 -1
  314. package/dist/core/schema/type-workflows.d.ts +2 -2
  315. package/dist/core/schema/type-workflows.js +2 -2
  316. package/dist/core/schema/type-workflows.js.map +1 -1
  317. package/dist/core/shared/constants.js +5 -2
  318. package/dist/core/shared/constants.js.map +1 -1
  319. package/dist/core/store/settings-validator.d.ts +4 -0
  320. package/dist/core/store/settings-validator.js +8 -2
  321. package/dist/core/store/settings-validator.js.map +1 -1
  322. package/dist/core/store/settings.js +8 -2
  323. package/dist/core/store/settings.js.map +1 -1
  324. package/dist/sdk/annotations.js +24 -2
  325. package/dist/sdk/annotations.js.map +1 -1
  326. package/dist/sdk/cli-bootstrap.d.ts +1 -1
  327. package/dist/sdk/cli-bootstrap.js +3 -3
  328. package/dist/sdk/cli-bootstrap.js.map +1 -1
  329. package/dist/sdk/cli-contracts/commander-mutation-options.js +22 -2
  330. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  331. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  332. package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
  333. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  334. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  335. package/dist/sdk/cli-contracts/flag-contracts.js +17 -2
  336. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  337. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +512 -0
  338. package/dist/sdk/cli-contracts/tool-option-contracts.js +21 -11
  339. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  340. package/dist/sdk/cli-contracts/tool-parameter-tables.js +13 -3
  341. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  342. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -0
  343. package/dist/sdk/cli-contracts/tool-schema.js +14 -10
  344. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  345. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +69 -0
  346. package/dist/sdk/cli-contracts/typed-action-inputs.js +5 -0
  347. package/dist/sdk/cli-contracts/typed-action-inputs.js.map +1 -0
  348. package/dist/sdk/cli-contracts.d.ts +4 -3
  349. package/dist/sdk/cli-contracts.js +5 -5
  350. package/dist/sdk/cli-contracts.js.map +1 -1
  351. package/dist/sdk/extension/describe.d.ts +1 -1
  352. package/dist/sdk/extension/describe.js +2 -2
  353. package/dist/sdk/extension/describe.js.map +1 -1
  354. package/dist/sdk/extension/install-runtime.js +5 -3
  355. package/dist/sdk/extension/install-runtime.js.map +1 -1
  356. package/dist/sdk/extension.d.ts +2 -2
  357. package/dist/sdk/extension.js +2 -2
  358. package/dist/sdk/extension.js.map +1 -1
  359. package/dist/sdk/governance/gc.d.ts +14 -1
  360. package/dist/sdk/governance/gc.js +38 -2
  361. package/dist/sdk/governance/gc.js.map +1 -1
  362. package/dist/sdk/governance/storage-integrity.d.ts +84 -0
  363. package/dist/sdk/governance/storage-integrity.js +240 -0
  364. package/dist/sdk/governance/storage-integrity.js.map +1 -0
  365. package/dist/sdk/governance/validate.d.ts +3 -1
  366. package/dist/sdk/governance/validate.js +56 -2
  367. package/dist/sdk/governance/validate.js.map +1 -1
  368. package/dist/sdk/history-read.d.ts +1 -1
  369. package/dist/sdk/history-read.js +2 -2
  370. package/dist/sdk/history-read.js.map +1 -1
  371. package/dist/sdk/history-repair.d.ts +36 -0
  372. package/dist/sdk/history-repair.js +69 -4
  373. package/dist/sdk/history-repair.js.map +1 -1
  374. package/dist/sdk/index.d.ts +5 -2
  375. package/dist/sdk/index.js +5 -2
  376. package/dist/sdk/index.js.map +1 -1
  377. package/dist/sdk/init.js +3 -3
  378. package/dist/sdk/init.js.map +1 -1
  379. package/dist/sdk/item-transaction.d.ts +131 -0
  380. package/dist/sdk/item-transaction.js +280 -0
  381. package/dist/sdk/item-transaction.js.map +1 -0
  382. package/dist/sdk/merge/driver.d.ts +75 -0
  383. package/dist/sdk/merge/driver.js +166 -0
  384. package/dist/sdk/merge/driver.js.map +1 -0
  385. package/dist/sdk/merge/index.d.ts +11 -0
  386. package/dist/sdk/merge/index.js +15 -0
  387. package/dist/sdk/merge/index.js.map +1 -0
  388. package/dist/sdk/merge/install.d.ts +90 -0
  389. package/dist/sdk/merge/install.js +318 -0
  390. package/dist/sdk/merge/install.js.map +1 -0
  391. package/dist/sdk/merge/three-way.d.ts +126 -0
  392. package/dist/sdk/merge/three-way.js +545 -0
  393. package/dist/sdk/merge/three-way.js.map +1 -0
  394. package/dist/sdk/query/list.d.ts +19 -2
  395. package/dist/sdk/query/list.js +5 -2
  396. package/dist/sdk/query/list.js.map +1 -1
  397. package/dist/sdk/runtime.d.ts +17 -14
  398. package/dist/sdk/runtime.js +5 -5
  399. package/dist/sdk/runtime.js.map +1 -1
  400. package/dist/sdk/schema.d.ts +2 -2
  401. package/dist/sdk/schema.js +29 -2
  402. package/dist/sdk/schema.js.map +1 -1
  403. package/dist/sdk/stats.d.ts +1 -1
  404. package/dist/sdk/stats.js +2 -2
  405. package/dist/sdk/stats.js.map +1 -1
  406. package/dist/sdk/workspace-transaction-gc.d.ts +46 -0
  407. package/dist/sdk/workspace-transaction-gc.js +155 -0
  408. package/dist/sdk/workspace-transaction-gc.js.map +1 -0
  409. package/dist/sdk/workspace.d.ts +28 -4
  410. package/dist/sdk/workspace.js +61 -15
  411. package/dist/sdk/workspace.js.map +1 -1
  412. package/dist/types.d.ts +11 -7
  413. package/dist/types.js +2 -2
  414. package/dist/types.js.map +1 -1
  415. package/docs/AGENT_GUIDE.md +58 -47
  416. package/docs/COMMANDS.md +7 -0
  417. package/docs/CONFIGURATION.md +2 -0
  418. package/docs/MERGE_SAFETY.md +99 -0
  419. package/docs/README.md +1 -0
  420. package/docs/SDK.md +56 -0
  421. package/marketplace.json +2 -2
  422. package/package.json +3 -2
  423. package/packages/pm-beads/package.json +1 -1
  424. package/packages/pm-calendar/package.json +1 -1
  425. package/packages/pm-command-kit/package.json +1 -1
  426. package/packages/pm-governance-audit/package.json +1 -1
  427. package/packages/pm-guide-shell/package.json +1 -1
  428. package/packages/pm-kanban/package.json +1 -1
  429. package/packages/pm-lifecycle-hooks/package.json +1 -1
  430. package/packages/pm-linked-test-adapters/package.json +1 -1
  431. package/packages/pm-search-advanced/package.json +1 -1
  432. package/packages/pm-templates/package.json +1 -1
  433. package/packages/pm-todos/package.json +1 -1
  434. package/packages/pm-vcs/package.json +1 -1
  435. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  436. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  437. package/dist/cli-bundle/chunks/append-XUYF7NON.js +0 -11
  438. package/dist/cli-bundle/chunks/chunk-2XPDCXK5.js.map +0 -1
  439. package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +0 -7
  440. package/dist/cli-bundle/chunks/chunk-3KPNOZOH.js.map +0 -7
  441. package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +0 -1
  442. package/dist/cli-bundle/chunks/chunk-4M6RZJXF.js.map +0 -7
  443. package/dist/cli-bundle/chunks/chunk-6V4T4RD3.js.map +0 -1
  444. package/dist/cli-bundle/chunks/chunk-A3GAQLBH.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-A4FVWFZY.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-A5EQPNV7.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-BBGR4FKQ.js.map +0 -1
  449. package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-BZKE2O5V.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-DJAGYYCQ.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-EEECAV5M.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-H3YKUVDR.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-IDUTGRDM.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-IGBBTPM5.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-JPWUZOMR.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-KAE727L2.js.map +0 -7
  461. package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-MQOSMBWV.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-N2TEEOXJ.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +0 -1
  466. package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-Q3K5XPAQ.js.map +0 -7
  468. package/dist/cli-bundle/chunks/chunk-QFG4MB7P.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-RLLOZAM2.js.map +0 -7
  470. package/dist/cli-bundle/chunks/chunk-RWAIRGBC.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-SBW7EQC4.js.map +0 -1
  472. package/dist/cli-bundle/chunks/chunk-SVAWG7EE.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-UE7LK3RE.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-VA3H7VVC.js.map +0 -1
  475. package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +0 -7
  476. package/dist/cli-bundle/chunks/chunk-Y2VSGFT4.js.map +0 -1
  477. package/dist/cli-bundle/chunks/chunk-YG56M3NE.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-ZUCBPXNA.js.map +0 -7
  480. package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +0 -12
  481. package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +0 -23
  482. package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +0 -13
  483. package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +0 -9
  484. package/dist/cli-bundle/chunks/create-LXMLYJNM.js +0 -29
  485. package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +0 -10
  486. package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +0 -14
  487. package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +0 -10
  488. package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +0 -16
  489. package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +0 -16
  490. package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +0 -13
  491. package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +0 -13
  492. package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +0 -26
  493. package/dist/cli-bundle/chunks/register-mutation-BLEWM5I6.js.map +0 -7
  494. package/dist/cli-bundle/chunks/register-mutation-OTYHR7J6.js.map +0 -1
  495. package/dist/cli-bundle/chunks/register-operations-AMCUFYEW.js.map +0 -1
  496. package/dist/cli-bundle/chunks/register-operations-MRLHOZYR.js.map +0 -7
  497. package/dist/cli-bundle/chunks/restore-A55MLFAI.js +0 -14
  498. package/dist/cli-bundle/chunks/update-5DTSCWVF.js +0 -23
  499. package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +0 -34
  500. package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +0 -38
  501. /package/dist/cli-bundle/chunks/{append-MBXHNWSX.js.map → append-E6V54WOQ.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{append-XUYF7NON.js.map → append-NNJ3EFIT.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{chunk-YGEA4CLH.js.map → chunk-3MCTMJXI.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{chunk-N7FCFJ76.js.map → chunk-3P7UJQOX.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{chunk-7B7IHMLH.js.map → chunk-3VY6MIEO.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{chunk-5S6IZXK7.js.map → chunk-4U4Z6AHI.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{chunk-UOIFZ66L.js.map → chunk-4XGJLADW.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{chunk-SUNZKVAH.js.map → chunk-5IZJWSDB.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{chunk-QQ77W23U.js.map → chunk-5NTE36LD.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{chunk-KGPLSHJD.js.map → chunk-6C2ZZX5Z.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-Q5NHJ6RO.js.map → chunk-6JUTHVQS.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-NTS2RKHN.js.map → chunk-6VIJ7UA5.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-XVB6BATY.js.map → chunk-72LQ4TKV.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-KZ5AC6B5.js.map → chunk-7WCE6Y64.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-VQOG2ETB.js.map → chunk-AF2CCM5U.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-EAV3P54W.js.map → chunk-DAQ45GCS.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-RX53WHFI.js.map → chunk-EJDGV4GR.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-IXG5CMBR.js.map → chunk-FDHPAVVB.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-V4QHAMI5.js.map → chunk-GROYI4RB.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-77XFQRTD.js.map → chunk-GSJSM5BJ.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-QYGK2XQ3.js.map → chunk-GTLCVJOE.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-VSQE43NO.js.map → chunk-GV2262OF.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-STBCBDKF.js.map → chunk-HCEBZNC3.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-U6RYD446.js.map → chunk-HRW7GF6T.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-XDWXPG2E.js.map → chunk-IAQE32BI.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-66SRNEBK.js.map → chunk-IJNK6WW2.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-AGEBQRBG.js.map → chunk-JAPE62Y5.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-UWAQI3B7.js.map → chunk-JGUKMMRS.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-UU6EP25G.js.map → chunk-JH2ZSLO3.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-GRDK25BN.js.map → chunk-JHJSFOAM.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-FQO5THHM.js.map → chunk-JM6YAXTR.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-E7KBMWEF.js.map → chunk-JSLT7WVE.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-FIUTBFC6.js.map → chunk-K4CI6Y45.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-IEMXESIS.js.map → chunk-KSPWRNVP.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-BFJP4VYC.js.map → chunk-L7BH7IWU.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-2UCG5H6B.js.map → chunk-LPEYZRUR.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-IR3GOO6E.js.map → chunk-NHT3F4WZ.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-6BNV3G6C.js.map → chunk-NLR32VFS.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-EI3UIMZM.js.map → chunk-OWXOPDHD.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-AQUNTB7G.js.map → chunk-PEQGTJ5Q.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-T6MOTLOJ.js.map → chunk-QJKL5PHS.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-XKVHL3MB.js.map → chunk-QWRVBJ4D.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-VFA5EIEN.js.map → chunk-R7QV7ICM.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-K2L6FZBX.js.map → chunk-RJO3YAFM.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-SGJB6PXA.js.map → chunk-SF3DT5HJ.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-UNNCT5QY.js.map → chunk-SZVB53Y3.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-GFZB5CLP.js.map → chunk-T6PPNM7V.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-W6IEJXNC.js.map → chunk-TVYYO5A7.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-DOASIOQR.js.map → chunk-UQLXSG72.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-7CHWLT2J.js.map → chunk-UVN66B3M.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-Q6JPYR7I.js.map → chunk-UX6SSO2I.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-OK7VSX3N.js.map → chunk-UZLJOEAC.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-4PSJVGRE.js.map → chunk-VDO2JMD4.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IRJ6F23W.js.map → chunk-VQIHNHMJ.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-LT5UWU7H.js.map → chunk-ZOJ3LR7O.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-3HSRP6T2.js.map → chunk-ZOY5K4D3.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-XXWDEQ6O.js.map → chunk-ZV2NTVMJ.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-UW6HCMP2.js.map → chunk-ZYPFOO3L.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{close-ZZCDDWJT.js.map → close-O5QVZ6ET.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{close-7NWA3GLA.js.map → close-QEMOYZN3.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{close-many-QCZHFCON.js.map → close-many-SDA426VT.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{close-many-YALQ7AXS.js.map → close-many-UTZANOCQ.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{comments-SQIQ5WYR.js.map → comments-LZN6FXXC.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{comments-FMQNYPSZ.js.map → comments-VBQ345ND.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{copy-YDAMENCP.js.map → copy-DKTSSCK7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{copy-GI3RCVZP.js.map → copy-M7DDI6LS.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{create-JSL6CXU3.js.map → create-GG4RBCGC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{create-LXMLYJNM.js.map → create-JBC5KUW6.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{delete-IGVOZEU2.js.map → delete-LCS3VPDH.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{delete-5DFAXJNI.js.map → delete-MD7YXQLH.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{deps-BQAXUQAK.js.map → deps-DELOO4TL.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{deps-CBPPSS6J.js.map → deps-FI4O6NQS.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{docs-KCWPLQOV.js.map → docs-2UYBP5D6.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{docs-NS2AZWCN.js.map → docs-6Z2MP526.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{files-XUUBQ76I.js.map → files-HEUGSJZL.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{files-PVWEPT5J.js.map → files-HKEAN5MA.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{focus-DHBHKK3E.js.map → focus-7SOUT5PZ.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{focus-3EJVFI3D.js.map → focus-DRQ6FQH6.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-compact-JHYVDYLW.js.map → history-compact-65YVN5DB.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-compact-3TNPYVFG.js.map → history-compact-7NDVP3PT.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{history-redact-KKFDICCF.js.map → history-redact-7YBL4XSG.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{history-redact-ELRL73XN.js.map → history-redact-IZGNJBU4.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{history-repair-J7WKZFAG.js.map → history-repair-7M4PYQUH.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{history-repair-REMI7DDI.js.map → history-repair-GNGETJLI.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{learnings-O6V5WDCV.js.map → learnings-3YXDRWFT.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{learnings-X4D6JCCG.js.map → learnings-ALC6IMNL.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{notes-ZSZREWZA.js.map → notes-7JMLQ447.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{notes-UQC6VS6N.js.map → notes-JFCLTC5C.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{plan-EZW2YDDY.js.map → plan-KOIPWVOZ.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{plan-5GKRBJJO.js.map → plan-T3XB3WTK.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{profile-5PQAPCLF.js.map → profile-OILJHKUW.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{profile-CW4BD3FO.js.map → profile-RJXA7PGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{restore-A55MLFAI.js.map → restore-L6IAGOD7.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{restore-HEQAG6EK.js.map → restore-ZH65GZFB.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{schema-Q5DAWJ2S.js.map → schema-4ERWM5QJ.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{schema-MAXAIHEC.js.map → schema-55DL3Q52.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-DWFXXJKP.js.map → update-FW6FKDOP.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{update-5DTSCWVF.js.map → update-TJHSPRPT.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{update-many-6T4ZLZS7.js.map → update-many-NNALYQCN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{update-many-MYRK6VBJ.js.map → update-many-PWXX5WHO.js.map} +0 -0
@@ -1,19 +1,19 @@
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]="b111adf0-7ac6-5083-9fb7-c9a093abf43b")}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]="4c96022d-a7de-55fa-835e-c7cf3a43e0b8")}catch(e){}}();
3
3
  import {
4
4
  runUpdate
5
- } from "./chunk-MRXAHR4B.js";
5
+ } from "./chunk-RZJLNXFG.js";
6
6
  import {
7
7
  buildCapabilityContractMetadata,
8
8
  buildRegistrationCollisionRemediation,
9
9
  collectUnknownCapabilityGuidance,
10
10
  readManagedExtensionState,
11
11
  runInit
12
- } from "./chunk-MI3346YW.js";
12
+ } from "./chunk-QANSTTC7.js";
13
13
  import {
14
14
  collectStaleVectorizationIds,
15
15
  runNext
16
- } from "./chunk-CZA2DXCV.js";
16
+ } from "./chunk-YQQNAKW3.js";
17
17
  import {
18
18
  buildVectorizationEmbeddingIdentity,
19
19
  hasVectorizationEmbeddingIdentityChanged,
@@ -23,10 +23,10 @@ import {
23
23
  resolveProviderConfigSource,
24
24
  resolveSettingsWithSemanticRuntimeDefaults,
25
25
  resolveVectorStores
26
- } from "./chunk-UE7LK3RE.js";
26
+ } from "./chunk-THAOZG4U.js";
27
27
  import {
28
28
  scanHistoryDrift
29
- } from "./chunk-XXWDEQ6O.js";
29
+ } from "./chunk-ZV2NTVMJ.js";
30
30
  import {
31
31
  ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,
32
32
  ACTIVITY_FLAG_CONTRACTS,
@@ -83,6 +83,7 @@ import {
83
83
  LEARNINGS_FLAG_CONTRACTS,
84
84
  LIST_COMMANDER_STRING_OPTION_CONTRACTS,
85
85
  LIST_FILTER_FLAG_CONTRACTS,
86
+ MERGE_FLAG_CONTRACTS,
86
87
  NEXT_FLAG_CONTRACTS,
87
88
  NOTES_FLAG_CONTRACTS,
88
89
  PACKAGE_FLAG_CONTRACTS,
@@ -118,10 +119,13 @@ import {
118
119
  UPGRADE_FLAG_CONTRACTS,
119
120
  VALIDATE_FLAG_CONTRACTS,
120
121
  compactFlagAliasContracts
121
- } from "./chunk-JPWUZOMR.js";
122
+ } from "./chunk-UZDQXNUB.js";
123
+ import {
124
+ auditMergeAttributeFence
125
+ } from "./chunk-CFHAODHQ.js";
122
126
  import {
123
127
  wrapOwnershipConflict
124
- } from "./chunk-Y2VSGFT4.js";
128
+ } from "./chunk-HB3P4M52.js";
125
129
  import {
126
130
  LINKED_TEST_PM_CONTEXT_MODE_VALUES,
127
131
  LINKED_TEST_PROTECTED_ENV_KEYS,
@@ -138,38 +142,38 @@ import {
138
142
  parseLinkedTestRegexList,
139
143
  parseLinkedTestStringList,
140
144
  runCreate
141
- } from "./chunk-BDC4TW4B.js";
145
+ } from "./chunk-OV7MSW3I.js";
142
146
  import {
143
147
  collectDanglingDependencyReferences
144
- } from "./chunk-77XFQRTD.js";
148
+ } from "./chunk-GSJSM5BJ.js";
145
149
  import {
146
150
  runDocs
147
- } from "./chunk-LT5UWU7H.js";
151
+ } from "./chunk-ZOJ3LR7O.js";
148
152
  import {
149
153
  runFiles
150
- } from "./chunk-YGEA4CLH.js";
154
+ } from "./chunk-3MCTMJXI.js";
151
155
  import {
152
156
  isRemoteLinkedArtifactReference
153
- } from "./chunk-VSQE43NO.js";
157
+ } from "./chunk-GV2262OF.js";
154
158
  import {
155
159
  createStdinTokenResolver,
156
160
  parseCsvKv,
157
161
  parseOptionalNumber
158
- } from "./chunk-SVAWG7EE.js";
162
+ } from "./chunk-J4FBIFU6.js";
159
163
  import {
160
164
  computeContentFieldUtilization
161
- } from "./chunk-YG56M3NE.js";
165
+ } from "./chunk-7DOJC3HS.js";
162
166
  import {
163
167
  computeMetadataCoverage,
164
168
  groupItemsByDimension,
165
169
  lifecycleClassifierFromStatusRegistry
166
- } from "./chunk-XKVHL3MB.js";
170
+ } from "./chunk-QWRVBJ4D.js";
167
171
  import {
168
172
  parseLimit
169
- } from "./chunk-FIUTBFC6.js";
173
+ } from "./chunk-K4CI6Y45.js";
170
174
  import {
171
175
  readHistoryEntries
172
- } from "./chunk-M4B4RK4J.js";
176
+ } from "./chunk-2BO4CA46.js";
173
177
  import {
174
178
  resolveAuthor
175
179
  } from "./chunk-CUFW7ITY.js";
@@ -199,7 +203,7 @@ import {
199
203
  stableValueEquals,
200
204
  toItemRecord,
201
205
  writeSettings
202
- } from "./chunk-QFG4MB7P.js";
206
+ } from "./chunk-POG76WWZ.js";
203
207
  import {
204
208
  DEFAULT_VALIDATE_CLOSURE_LIKE_METADATA_FIELD_PATTERNS,
205
209
  DEFAULT_VALIDATE_STALE_BLOCKER_REASON_PATTERNS,
@@ -246,7 +250,7 @@ import {
246
250
  statusIsTerminal,
247
251
  toNonEmptyStringOrUndefined,
248
252
  writeFileAtomic
249
- } from "./chunk-D35WYXWC.js";
253
+ } from "./chunk-HYW67VJ5.js";
250
254
 
251
255
  // dist/core/telemetry/observability.js
252
256
  var SETUP_ROOT_COMMANDS = /* @__PURE__ */ new Set([
@@ -2952,6 +2956,7 @@ var CORE_COMMAND_FLAG_CONTRACT_ENTRIES = [
2952
2956
  ["history-compact", HISTORY_COMPACT_FLAG_CONTRACTS],
2953
2957
  ["history-redact", HISTORY_REDACT_FLAG_CONTRACTS],
2954
2958
  ["history-repair", HISTORY_REPAIR_FLAG_CONTRACTS],
2959
+ ["merge", MERGE_FLAG_CONTRACTS],
2955
2960
  ["schema", SCHEMA_FLAG_CONTRACTS],
2956
2961
  ["profile", PROFILE_FLAG_CONTRACTS],
2957
2962
  ["plan", PLAN_FLAG_CONTRACTS],
@@ -4256,17 +4261,144 @@ function runRemind(title, options, global) {
4256
4261
  return runCreate(createOptions, global);
4257
4262
  }
4258
4263
 
4259
- // dist/sdk/governance/gc.js
4260
- import fs3 from "node:fs/promises";
4261
- import path4 from "node:path";
4262
-
4263
- // dist/core/checkpoint/checkpoint-gc.js
4264
+ // dist/sdk/workspace-transaction-gc.js
4264
4265
  import fs from "node:fs/promises";
4265
4266
  import path2 from "node:path";
4266
- var MILLISECONDS_PER_DAY2 = 864e5;
4267
+ var MILLISECONDS_PER_DAY2 = 24 * 60 * 60 * 1e3;
4268
+ var TERMINAL_JOURNAL_STATUSES = /* @__PURE__ */ new Set(["committed", "compensated"]);
4267
4269
  function isErrno(error, code) {
4268
4270
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
4269
4271
  }
4272
+ function readJournalStatusAndTimestamp(raw) {
4273
+ let parsed;
4274
+ try {
4275
+ parsed = JSON.parse(raw);
4276
+ } catch {
4277
+ return { status: null, updatedAt: null };
4278
+ }
4279
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
4280
+ return { status: null, updatedAt: null };
4281
+ }
4282
+ const record = parsed;
4283
+ return {
4284
+ status: typeof record.status === "string" ? record.status : null,
4285
+ updatedAt: typeof record.updatedAt === "string" ? record.updatedAt : null
4286
+ };
4287
+ }
4288
+ function classifyWorkspaceTransactionJournal(file, status, updatedAt, nowMs2, retentionMs) {
4289
+ const updatedAtMs = updatedAt === null ? Number.NaN : Date.parse(updatedAt);
4290
+ if (status === null || !Number.isFinite(updatedAtMs)) {
4291
+ return {
4292
+ entry: {
4293
+ file,
4294
+ status,
4295
+ age_seconds: null,
4296
+ stale: false,
4297
+ reason: "unparseable"
4298
+ },
4299
+ remove: false
4300
+ };
4301
+ }
4302
+ const ageMs = nowMs2 - updatedAtMs;
4303
+ if (!TERMINAL_JOURNAL_STATUSES.has(status)) {
4304
+ return {
4305
+ entry: {
4306
+ file,
4307
+ status,
4308
+ age_seconds: Math.floor(ageMs / 1e3),
4309
+ stale: false,
4310
+ reason: "active"
4311
+ },
4312
+ remove: false
4313
+ };
4314
+ }
4315
+ if (!(ageMs > retentionMs)) {
4316
+ return {
4317
+ entry: {
4318
+ file,
4319
+ status,
4320
+ age_seconds: Math.floor(ageMs / 1e3),
4321
+ stale: false,
4322
+ reason: "fresh"
4323
+ },
4324
+ remove: false
4325
+ };
4326
+ }
4327
+ return {
4328
+ entry: {
4329
+ file,
4330
+ status,
4331
+ age_seconds: Math.floor(ageMs / 1e3),
4332
+ stale: true
4333
+ },
4334
+ remove: true
4335
+ };
4336
+ }
4337
+ async function processWorkspaceTransactionJournal(absolutePath, relativePath, fileName, options) {
4338
+ const warnings = options.hooks?.onRead ? await options.hooks.onRead(absolutePath) : [];
4339
+ const journal = readJournalStatusAndTimestamp(await fs.readFile(absolutePath, "utf8"));
4340
+ const decision = classifyWorkspaceTransactionJournal(relativePath, journal.status, journal.updatedAt, options.nowMs, options.retentionMs);
4341
+ if (decision.entry.reason === "unparseable") {
4342
+ warnings.push(`transaction_journal_unparseable:${fileName}`);
4343
+ }
4344
+ if (decision.remove && !options.dryRun) {
4345
+ await fs.rm(absolutePath, { force: true });
4346
+ if (options.hooks?.onWrite) {
4347
+ warnings.push(...await options.hooks.onWrite(absolutePath));
4348
+ }
4349
+ }
4350
+ return { decision, warnings };
4351
+ }
4352
+ async function runWorkspaceTransactionGc(pmRoot, options) {
4353
+ const { dryRun, hooks } = options;
4354
+ const nowMs2 = options.now ?? Date.now();
4355
+ const retentionMs = Math.max(0, options.retentionDays) * MILLISECONDS_PER_DAY2;
4356
+ const journalsDir = path2.join(pmRoot, "transactions", "sdk");
4357
+ const result = {
4358
+ scanned: 0,
4359
+ removed: [],
4360
+ retained: [],
4361
+ warnings: [],
4362
+ entries: []
4363
+ };
4364
+ let files;
4365
+ try {
4366
+ files = (await fs.readdir(journalsDir)).filter((file) => file.endsWith(".json")).sort((left, right) => left.localeCompare(right));
4367
+ } catch (error) {
4368
+ if (isErrno(error, "ENOENT")) {
4369
+ return result;
4370
+ }
4371
+ throw error;
4372
+ }
4373
+ for (const file of files) {
4374
+ const absPath = path2.join(journalsDir, file);
4375
+ const relPath = `transactions/sdk/${file}`;
4376
+ const fileResult = await processWorkspaceTransactionJournal(absPath, relPath, file, { dryRun, hooks, nowMs: nowMs2, retentionMs });
4377
+ result.warnings.push(...fileResult.warnings);
4378
+ result.scanned += 1;
4379
+ const { decision } = fileResult;
4380
+ if (!decision.remove) {
4381
+ result.retained.push(relPath);
4382
+ result.entries.push(decision.entry);
4383
+ continue;
4384
+ }
4385
+ result.removed.push(relPath);
4386
+ result.entries.push(decision.entry);
4387
+ }
4388
+ return result;
4389
+ }
4390
+
4391
+ // dist/sdk/governance/gc.js
4392
+ import fs4 from "node:fs/promises";
4393
+ import path5 from "node:path";
4394
+
4395
+ // dist/core/checkpoint/checkpoint-gc.js
4396
+ import fs2 from "node:fs/promises";
4397
+ import path3 from "node:path";
4398
+ var MILLISECONDS_PER_DAY3 = 864e5;
4399
+ function isErrno2(error, code) {
4400
+ return typeof error === "object" && error !== null && "code" in error && error.code === code;
4401
+ }
4270
4402
  function readCheckpointCreatedAt(raw) {
4271
4403
  let parsed;
4272
4404
  try {
@@ -4283,9 +4415,9 @@ function readCheckpointCreatedAt(raw) {
4283
4415
  async function collectCheckpointFiles(checkpointsDir, warnings) {
4284
4416
  let dirEntries;
4285
4417
  try {
4286
- dirEntries = await fs.readdir(checkpointsDir, { withFileTypes: true });
4418
+ dirEntries = await fs2.readdir(checkpointsDir, { withFileTypes: true });
4287
4419
  } catch (error) {
4288
- if (isErrno(error, "ENOENT")) {
4420
+ if (isErrno2(error, "ENOENT")) {
4289
4421
  return [];
4290
4422
  }
4291
4423
  throw error;
@@ -4293,12 +4425,12 @@ async function collectCheckpointFiles(checkpointsDir, warnings) {
4293
4425
  const files = [];
4294
4426
  for (const entry of dirEntries) {
4295
4427
  if (entry.isDirectory()) {
4296
- const subdir = path2.join(checkpointsDir, entry.name);
4428
+ const subdir = path3.join(checkpointsDir, entry.name);
4297
4429
  let nested;
4298
4430
  try {
4299
- nested = await fs.readdir(subdir);
4431
+ nested = await fs2.readdir(subdir);
4300
4432
  } catch (error) {
4301
- if (!isErrno(error, "ENOENT")) {
4433
+ if (!isErrno2(error, "ENOENT")) {
4302
4434
  warnings.push(`checkpoint_subdir_unreadable:${entry.name}`);
4303
4435
  }
4304
4436
  continue;
@@ -4317,8 +4449,8 @@ async function collectCheckpointFiles(checkpointsDir, warnings) {
4317
4449
  async function runCheckpointGc(pmRoot, options) {
4318
4450
  const { dryRun, hooks } = options;
4319
4451
  const nowMs2 = options.now ?? Date.now();
4320
- const retentionMs = Math.max(0, options.retentionDays) * MILLISECONDS_PER_DAY2;
4321
- const checkpointsDir = path2.join(pmRoot, "checkpoints");
4452
+ const retentionMs = Math.max(0, options.retentionDays) * MILLISECONDS_PER_DAY3;
4453
+ const checkpointsDir = path3.join(pmRoot, "checkpoints");
4322
4454
  const result = {
4323
4455
  scanned: 0,
4324
4456
  removed: [],
@@ -4328,7 +4460,7 @@ async function runCheckpointGc(pmRoot, options) {
4328
4460
  };
4329
4461
  const files = await collectCheckpointFiles(checkpointsDir, result.warnings);
4330
4462
  for (const relName of files) {
4331
- const absPath = path2.join(checkpointsDir, relName);
4463
+ const absPath = path3.join(checkpointsDir, relName);
4332
4464
  const relPath = `checkpoints/${relName}`;
4333
4465
  result.scanned += 1;
4334
4466
  if (hooks?.onRead) {
@@ -4336,9 +4468,9 @@ async function runCheckpointGc(pmRoot, options) {
4336
4468
  }
4337
4469
  let raw;
4338
4470
  try {
4339
- raw = await fs.readFile(absPath, "utf8");
4471
+ raw = await fs2.readFile(absPath, "utf8");
4340
4472
  } catch (readError) {
4341
- if (isErrno(readError, "ENOENT")) {
4473
+ if (isErrno2(readError, "ENOENT")) {
4342
4474
  result.scanned -= 1;
4343
4475
  continue;
4344
4476
  }
@@ -4382,9 +4514,9 @@ async function runCheckpointGc(pmRoot, options) {
4382
4514
  }
4383
4515
  if (!dryRun) {
4384
4516
  try {
4385
- await fs.unlink(absPath);
4517
+ await fs2.unlink(absPath);
4386
4518
  } catch (unlinkError) {
4387
- if (!isErrno(unlinkError, "ENOENT")) {
4519
+ if (!isErrno2(unlinkError, "ENOENT")) {
4388
4520
  result.warnings.push(`checkpoint_remove_failed:${relName}`);
4389
4521
  result.retained.push(relPath);
4390
4522
  result.entries.push(entry);
@@ -4402,8 +4534,8 @@ async function runCheckpointGc(pmRoot, options) {
4402
4534
  }
4403
4535
 
4404
4536
  // dist/core/lock/lock-gc.js
4405
- import fs2 from "node:fs/promises";
4406
- import path3 from "node:path";
4537
+ import fs3 from "node:fs/promises";
4538
+ import path4 from "node:path";
4407
4539
  function parseLock(raw) {
4408
4540
  let parsed;
4409
4541
  try {
@@ -4421,7 +4553,7 @@ function parseLock(raw) {
4421
4553
  }
4422
4554
  return { id, owner, created_at, ttl_seconds };
4423
4555
  }
4424
- function isErrno2(error, code) {
4556
+ function isErrno3(error, code) {
4425
4557
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
4426
4558
  }
4427
4559
  function classifyLockContent(file, raw, nowMs2) {
@@ -4476,7 +4608,7 @@ function classifyLockContent(file, raw, nowMs2) {
4476
4608
  }
4477
4609
  async function scanLockHealth(pmRoot, now) {
4478
4610
  const nowMs2 = now ?? Date.now();
4479
- const locksDir = path3.join(pmRoot, "locks");
4611
+ const locksDir = path4.join(pmRoot, "locks");
4480
4612
  const scan = {
4481
4613
  scanned: 0,
4482
4614
  active_lock_count: 0,
@@ -4486,10 +4618,10 @@ async function scanLockHealth(pmRoot, now) {
4486
4618
  };
4487
4619
  let dirEntries;
4488
4620
  try {
4489
- const rawDir = await fs2.readdir(locksDir);
4621
+ const rawDir = await fs3.readdir(locksDir);
4490
4622
  dirEntries = rawDir.filter((f) => f.endsWith(".lock")).sort();
4491
4623
  } catch (error) {
4492
- if (isErrno2(error, "ENOENT")) {
4624
+ if (isErrno3(error, "ENOENT")) {
4493
4625
  return scan;
4494
4626
  }
4495
4627
  throw error;
@@ -4497,9 +4629,9 @@ async function scanLockHealth(pmRoot, now) {
4497
4629
  for (const file of dirEntries) {
4498
4630
  let raw;
4499
4631
  try {
4500
- raw = await fs2.readFile(path3.join(locksDir, file), "utf8");
4632
+ raw = await fs3.readFile(path4.join(locksDir, file), "utf8");
4501
4633
  } catch (readError) {
4502
- if (isErrno2(readError, "ENOENT")) {
4634
+ if (isErrno3(readError, "ENOENT")) {
4503
4635
  continue;
4504
4636
  }
4505
4637
  scan.scanned += 1;
@@ -4521,7 +4653,7 @@ async function scanLockHealth(pmRoot, now) {
4521
4653
  async function runLockGc(pmRoot, options) {
4522
4654
  const { dryRun, hooks } = options;
4523
4655
  const nowMs2 = options.now ?? Date.now();
4524
- const locksDir = path3.join(pmRoot, "locks");
4656
+ const locksDir = path4.join(pmRoot, "locks");
4525
4657
  const result = {
4526
4658
  scanned: 0,
4527
4659
  removed: [],
@@ -4531,17 +4663,17 @@ async function runLockGc(pmRoot, options) {
4531
4663
  };
4532
4664
  let dirEntries;
4533
4665
  try {
4534
- const raw = await fs2.readdir(locksDir);
4666
+ const raw = await fs3.readdir(locksDir);
4535
4667
  dirEntries = raw.filter((f) => f.endsWith(".lock")).sort();
4536
4668
  } catch (error) {
4537
- if (isErrno2(error, "ENOENT")) {
4669
+ if (isErrno3(error, "ENOENT")) {
4538
4670
  return result;
4539
4671
  }
4540
4672
  throw error;
4541
4673
  }
4542
4674
  for (const file of dirEntries) {
4543
4675
  result.scanned += 1;
4544
- const absPath = path3.join(locksDir, file);
4676
+ const absPath = path4.join(locksDir, file);
4545
4677
  const relPath = `locks/${file}`;
4546
4678
  if (hooks?.onRead) {
4547
4679
  const hookWarnings = await hooks.onRead(absPath);
@@ -4549,9 +4681,9 @@ async function runLockGc(pmRoot, options) {
4549
4681
  }
4550
4682
  let raw;
4551
4683
  try {
4552
- raw = await fs2.readFile(absPath, "utf8");
4684
+ raw = await fs3.readFile(absPath, "utf8");
4553
4685
  } catch (readError) {
4554
- if (isErrno2(readError, "ENOENT")) {
4686
+ if (isErrno3(readError, "ENOENT")) {
4555
4687
  result.scanned -= 1;
4556
4688
  continue;
4557
4689
  }
@@ -4589,9 +4721,9 @@ async function runLockGc(pmRoot, options) {
4589
4721
  }
4590
4722
  if (!dryRun) {
4591
4723
  try {
4592
- await fs2.unlink(absPath);
4724
+ await fs3.unlink(absPath);
4593
4725
  } catch (unlinkError) {
4594
- if (!isErrno2(unlinkError, "ENOENT")) {
4726
+ if (!isErrno3(unlinkError, "ENOENT")) {
4595
4727
  result.warnings.push(`lock_remove_failed:${file}`);
4596
4728
  result.retained.push(relPath);
4597
4729
  result.entries.push(classified.entry);
@@ -4615,7 +4747,8 @@ var GC_SCOPE_VALUES = [
4615
4747
  "embeddings",
4616
4748
  "runtime",
4617
4749
  "locks",
4618
- "checkpoints"
4750
+ "checkpoints",
4751
+ "transactions"
4619
4752
  ];
4620
4753
  var GC_TARGETS = [
4621
4754
  {
@@ -4664,18 +4797,18 @@ var GC_TARGETS = [
4664
4797
  kind: "file"
4665
4798
  }
4666
4799
  ];
4667
- function isErrno3(error, code) {
4800
+ function isErrno4(error, code) {
4668
4801
  return typeof error === "object" && error !== null && "code" in error && error.code === code;
4669
4802
  }
4670
4803
  async function removeCacheFile(pmRoot, target, dryRun) {
4671
4804
  const relativePath = target.relativePath;
4672
- const absolutePath = path4.join(pmRoot, relativePath);
4805
+ const absolutePath = path5.join(pmRoot, relativePath);
4673
4806
  const warnings = await runActiveOnReadHooks({
4674
4807
  path: absolutePath,
4675
4808
  scope: "project"
4676
4809
  });
4677
4810
  try {
4678
- const stats = await fs3.stat(absolutePath);
4811
+ const stats = await fs4.stat(absolutePath);
4679
4812
  if (target.kind === "file" && !stats.isFile()) {
4680
4813
  return {
4681
4814
  removed: false,
@@ -4695,9 +4828,9 @@ async function removeCacheFile(pmRoot, target, dryRun) {
4695
4828
  };
4696
4829
  }
4697
4830
  if (target.kind === "file") {
4698
- await fs3.unlink(absolutePath);
4831
+ await fs4.unlink(absolutePath);
4699
4832
  } else {
4700
- await fs3.rm(absolutePath, { recursive: true, force: true });
4833
+ await fs4.rm(absolutePath, { recursive: true, force: true });
4701
4834
  }
4702
4835
  const writeWarnings = await runActiveOnWriteHooks({
4703
4836
  path: absolutePath,
@@ -4709,7 +4842,7 @@ async function removeCacheFile(pmRoot, target, dryRun) {
4709
4842
  warnings: [...warnings, ...writeWarnings]
4710
4843
  };
4711
4844
  } catch (error) {
4712
- if (isErrno3(error, "ENOENT")) {
4845
+ if (isErrno4(error, "ENOENT")) {
4713
4846
  return {
4714
4847
  removed: false,
4715
4848
  warnings
@@ -4751,6 +4884,9 @@ function buildGcGuidance(params) {
4751
4884
  if (!params.dryRun && params.removed.some((entry) => entry.startsWith("checkpoints/"))) {
4752
4885
  guidance.push('Aged rollback checkpoints were removed; their "pm update-many"/"pm close-many --rollback" windows are no longer recoverable.');
4753
4886
  }
4887
+ if (!params.dryRun && params.removed.some((entry) => entry.startsWith("transactions/"))) {
4888
+ guidance.push("Aged terminal workspace-transaction journals were removed; replaying those transactionIds re-executes their idempotent steps instead of short-circuiting.");
4889
+ }
4754
4890
  return guidance;
4755
4891
  }
4756
4892
  async function runGc(global, options = {}) {
@@ -4796,6 +4932,31 @@ async function runGc(global, options = {}) {
4796
4932
  retained: lockResult.retained.length
4797
4933
  };
4798
4934
  }
4935
+ let transactionsSummary;
4936
+ if (scopes.includes("transactions")) {
4937
+ const retentionDays = settings.checkpoints.retention_days;
4938
+ const transactionResult = await runWorkspaceTransactionGc(pmRoot, {
4939
+ dryRun,
4940
+ retentionDays,
4941
+ hooks: {
4942
+ onRead: (journalPath) => runActiveOnReadHooks({ path: journalPath, scope: "project" }),
4943
+ onWrite: (journalPath) => runActiveOnWriteHooks({
4944
+ path: journalPath,
4945
+ scope: "project",
4946
+ op: "gc:transaction_journal_remove"
4947
+ })
4948
+ }
4949
+ });
4950
+ removed.push(...transactionResult.removed);
4951
+ retained.push(...transactionResult.retained);
4952
+ warnings.push(...transactionResult.warnings);
4953
+ transactionsSummary = {
4954
+ scanned: transactionResult.scanned,
4955
+ removed: transactionResult.removed.length,
4956
+ retained: transactionResult.retained.length,
4957
+ retention_days: retentionDays
4958
+ };
4959
+ }
4799
4960
  let checkpointsSummary;
4800
4961
  if (scopes.includes("checkpoints")) {
4801
4962
  const retentionDays = settings.checkpoints.retention_days;
@@ -4839,14 +5000,15 @@ async function runGc(global, options = {}) {
4839
5000
  warnings,
4840
5001
  ...locksSummary ? { locks: locksSummary } : {},
4841
5002
  ...checkpointsSummary ? { checkpoints: checkpointsSummary } : {},
5003
+ ...transactionsSummary ? { transactions: transactionsSummary } : {},
4842
5004
  guidance,
4843
5005
  generated_at: nowIso()
4844
5006
  };
4845
5007
  }
4846
5008
 
4847
5009
  // dist/sdk/author-attribution.js
4848
- import fs4 from "node:fs/promises";
4849
- import path5 from "node:path";
5010
+ import fs5 from "node:fs/promises";
5011
+ import path6 from "node:path";
4850
5012
  var HISTORY_AUTHOR_ATTRIBUTION_BASELINE = "2026-07-15T06:22:12.276Z";
4851
5013
  var HISTORY_AUTHOR_ATTRIBUTION_BASELINE_MS = Date.parse(HISTORY_AUTHOR_ATTRIBUTION_BASELINE);
4852
5014
  var HISTORY_AUTHOR_EVENT_CLASSIFICATIONS = [
@@ -4895,10 +5057,10 @@ var inspectHistoryAuthorStream = (itemId, raw, sampleLimit = 20) => {
4895
5057
  };
4896
5058
  };
4897
5059
  var scanHistoryAuthorAttribution = async (pmRoot, sampleLimit = 20) => {
4898
- const historyDirectory = path5.join(pmRoot, "history");
5060
+ const historyDirectory = path6.join(pmRoot, "history");
4899
5061
  let fileNames;
4900
5062
  try {
4901
- fileNames = (await fs4.readdir(historyDirectory)).filter((fileName) => fileName.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
5063
+ fileNames = (await fs5.readdir(historyDirectory)).filter((fileName) => fileName.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
4902
5064
  } catch {
4903
5065
  fileNames = [];
4904
5066
  }
@@ -4912,7 +5074,7 @@ var scanHistoryAuthorAttribution = async (pmRoot, sampleLimit = 20) => {
4912
5074
  for (const fileName of fileNames) {
4913
5075
  let raw;
4914
5076
  try {
4915
- raw = await fs4.readFile(path5.join(historyDirectory, fileName), "utf8");
5077
+ raw = await fs5.readFile(path6.join(historyDirectory, fileName), "utf8");
4916
5078
  } catch {
4917
5079
  continue;
4918
5080
  }
@@ -4940,8 +5102,8 @@ var scanHistoryAuthorAttribution = async (pmRoot, sampleLimit = 20) => {
4940
5102
  };
4941
5103
 
4942
5104
  // dist/sdk/governance/health.js
4943
- import fs5 from "node:fs/promises";
4944
- import path6 from "node:path";
5105
+ import fs6 from "node:fs/promises";
5106
+ import path7 from "node:path";
4945
5107
 
4946
5108
  // dist/core/diagnostics/remediation.js
4947
5109
  var REMEDIATION_REGISTRY = Object.freeze([
@@ -5050,6 +5212,42 @@ var REMEDIATION_REGISTRY = Object.freeze([
5050
5212
  command: "pm history-repair <id>",
5051
5213
  summary: "A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain."
5052
5214
  },
5215
+ // --- pm validate: storage_integrity (post-merge corruption detection) ---
5216
+ {
5217
+ code: "validate_storage_unreadable_items",
5218
+ command: "pm validate --check-storage-integrity --verbose-diagnostics",
5219
+ summary: "An on-disk item file cannot be parsed (for example a botched merge resolution with stale TOON count headers); repair or restore the file at the reported path \u2014 list commands silently skip it while pm get hard-errors."
5220
+ },
5221
+ {
5222
+ code: "validate_storage_duplicate_item_ids",
5223
+ command: "pm validate --check-storage-integrity --verbose-diagnostics",
5224
+ summary: "One item id is claimed by multiple item documents \u2014 usually two branches minting the same id for different items before merging (GH-600). Keep one document, recreate the other item under a fresh id (pm copy, then delete the colliding file), and consider raising ids.token_length for concurrent multi-agent work."
5225
+ },
5226
+ {
5227
+ code: "validate_storage_history_conflict_markers",
5228
+ command: "pm merge driver history <base> <ours> <theirs>",
5229
+ summary: "A history stream contains unresolved Git conflict markers; re-merge it with the pm history merge driver (or resolve the markers by hand), then run pm history-repair for the item."
5230
+ },
5231
+ {
5232
+ code: "validate_storage_unparseable_history",
5233
+ command: "pm history-repair <id>",
5234
+ summary: "A history stream's newest line is not valid JSONL; repair or restore the stream before further mutations."
5235
+ },
5236
+ {
5237
+ code: "validate_storage_resurrected_items",
5238
+ command: "pm delete <id>",
5239
+ summary: "A live item's newest history operation is a delete: a delete/modify merge silently resurrected it. Decide the winner \u2014 re-delete the item, or keep it and append a mutation documenting the revival."
5240
+ },
5241
+ {
5242
+ code: "validate_storage_unparseable_config",
5243
+ command: "pm merge driver json <base> <ours> <theirs>",
5244
+ summary: "settings.json or a schema file cannot be parsed, so pm silently falls back to defaults; re-merge it with the pm JSON merge driver or fix the file by hand, then rerun pm validate."
5245
+ },
5246
+ {
5247
+ code: "validate_merge_fence_drift",
5248
+ command: "pm merge install",
5249
+ summary: "The committed .gitattributes merge fence no longer matches the active schema's type folders or tracker JSONL stores; rerun pm merge install (and commit .gitattributes) so every tracker artifact keeps its field-aware merge driver."
5250
+ },
5053
5251
  // --- pm health (integrity) + pm validate (format_version): item format version ---
5054
5252
  {
5055
5253
  code: "integrity_item_outdated_format_version",
@@ -5316,8 +5514,8 @@ function buildRemediationCommands(warnings) {
5316
5514
  var PM_TELEMETRY_SOURCE_CONTEXT_SET2 = new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);
5317
5515
  var STALE_VECTORIZATION_SUMMARY_LIMIT = 25;
5318
5516
  var BRIEF_HEALTH_DETAIL_LIMIT = 8;
5319
- var TELEMETRY_QUEUE_RELATIVE_PATH2 = path6.join("runtime", "telemetry", "events.jsonl");
5320
- var TELEMETRY_STATE_RELATIVE_PATH2 = path6.join("runtime", "telemetry", "state.json");
5517
+ var TELEMETRY_QUEUE_RELATIVE_PATH2 = path7.join("runtime", "telemetry", "events.jsonl");
5518
+ var TELEMETRY_STATE_RELATIVE_PATH2 = path7.join("runtime", "telemetry", "state.json");
5321
5519
  var TELEMETRY_ENDPOINT_PROBE_TIMEOUT_MS = 2500;
5322
5520
  var TELEMETRY_QUEUE_HIGH_WATER_MARK = 500;
5323
5521
  var TELEMETRY_QUEUE_HIGH_RETRY_THRESHOLD = TELEMETRY_MAX_QUEUE_ENTRY_ATTEMPTS - 3;
@@ -5349,29 +5547,29 @@ function isExpectedUnmanagedExtension(name, directory) {
5349
5547
  }
5350
5548
  async function isDirectory(targetPath) {
5351
5549
  try {
5352
- const stats = await fs5.stat(targetPath);
5550
+ const stats = await fs6.stat(targetPath);
5353
5551
  return stats.isDirectory();
5354
5552
  } catch {
5355
5553
  return false;
5356
5554
  }
5357
5555
  }
5358
5556
  async function countHistoryStreams(pmRoot, compactPolicy) {
5359
- const historyDir = path6.join(pmRoot, "history");
5557
+ const historyDir = path7.join(pmRoot, "history");
5360
5558
  if (!await isDirectory(historyDir)) {
5361
5559
  return { count: 0, warnings: [], over_threshold: [], max_entries: null };
5362
5560
  }
5363
- const historyFiles = (await fs5.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
5561
+ const historyFiles = (await fs6.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
5364
5562
  const policyActive = compactPolicy.enabled;
5365
5563
  const maxEntries = policyActive ? compactPolicy.max_entries : null;
5366
5564
  const warnings = [];
5367
5565
  const overThreshold = [];
5368
5566
  for (const fileName of historyFiles) {
5369
- const streamPath = path6.join(historyDir, fileName);
5567
+ const streamPath = path7.join(historyDir, fileName);
5370
5568
  warnings.push(...await runActiveOnReadHooks({ path: streamPath, scope: "project" }));
5371
5569
  if (!policyActive) {
5372
5570
  continue;
5373
5571
  }
5374
- const raw = await fs5.readFile(streamPath, "utf8");
5572
+ const raw = await fs6.readFile(streamPath, "utf8");
5375
5573
  let entries = 0;
5376
5574
  for (const line of raw.split(/\r?\n/)) {
5377
5575
  if (line.trim().length > 0) {
@@ -5393,16 +5591,16 @@ async function countHistoryStreams(pmRoot, compactPolicy) {
5393
5591
  };
5394
5592
  }
5395
5593
  function normalizeRelativePath(pmRoot, targetPath) {
5396
- return path6.relative(pmRoot, targetPath).replaceAll("\\", "/");
5594
+ return path7.relative(pmRoot, targetPath).replaceAll("\\", "/");
5397
5595
  }
5398
5596
  async function listItemDocumentPaths(pmRoot, typeToFolder) {
5399
5597
  const folders = [...new Set(Object.values(typeToFolder))].sort((left, right) => left.localeCompare(right));
5400
5598
  const itemPaths = [];
5401
5599
  for (const folder of folders) {
5402
- const directoryPath = path6.join(pmRoot, folder);
5600
+ const directoryPath = path7.join(pmRoot, folder);
5403
5601
  let entries = [];
5404
5602
  try {
5405
- entries = await fs5.readdir(directoryPath);
5603
+ entries = await fs6.readdir(directoryPath);
5406
5604
  } catch (error) {
5407
5605
  if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
5408
5606
  continue;
@@ -5413,7 +5611,7 @@ async function listItemDocumentPaths(pmRoot, typeToFolder) {
5413
5611
  if (!ITEM_FILE_EXTENSIONS.some((extension) => entry.toLowerCase().endsWith(extension))) {
5414
5612
  continue;
5415
5613
  }
5416
- itemPaths.push(path6.join(directoryPath, entry));
5614
+ itemPaths.push(path7.join(directoryPath, entry));
5417
5615
  }
5418
5616
  }
5419
5617
  itemPaths.sort((left, right) => normalizeRelativePath(pmRoot, left).localeCompare(normalizeRelativePath(pmRoot, right)));
@@ -5433,7 +5631,7 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
5433
5631
  const relativePath = normalizeRelativePath(pmRoot, itemPath);
5434
5632
  let raw = "";
5435
5633
  try {
5436
- raw = await fs5.readFile(itemPath, "utf8");
5634
+ raw = await fs6.readFile(itemPath, "utf8");
5437
5635
  } catch {
5438
5636
  itemUnreadable.push(relativePath);
5439
5637
  continue;
@@ -5462,13 +5660,13 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
5462
5660
  }
5463
5661
  }
5464
5662
  const formatVersionScan = scanItemFormatVersions(formatVersionEntries);
5465
- const historyDir = path6.join(pmRoot, "history");
5663
+ const historyDir = path7.join(pmRoot, "history");
5466
5664
  const historyUnreadable = [];
5467
5665
  const historyConflictMarkers = [];
5468
5666
  const historyInvalidJson = [];
5469
5667
  let historyFiles = [];
5470
5668
  try {
5471
- historyFiles = (await fs5.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
5669
+ historyFiles = (await fs6.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((left, right) => left.localeCompare(right));
5472
5670
  } catch (error) {
5473
5671
  if (shouldReportHistoryDirectoryUnreadable(error)) {
5474
5672
  historyUnreadable.push("history");
@@ -5476,10 +5674,10 @@ async function buildIntegrityCheck(pmRoot, typeToFolder, schema) {
5476
5674
  }
5477
5675
  for (const fileName of historyFiles) {
5478
5676
  const itemId = fileName.slice(0, -".jsonl".length);
5479
- const historyPath = path6.join(historyDir, fileName);
5677
+ const historyPath = path7.join(historyDir, fileName);
5480
5678
  let raw = "";
5481
5679
  try {
5482
- raw = await fs5.readFile(historyPath, "utf8");
5680
+ raw = await fs6.readFile(historyPath, "utf8");
5483
5681
  } catch {
5484
5682
  historyUnreadable.push(itemId);
5485
5683
  continue;
@@ -6273,8 +6471,8 @@ async function probeTelemetryEndpointHealth(endpoint) {
6273
6471
  }
6274
6472
  async function buildTelemetryCheck(settings, options) {
6275
6473
  const globalPmRoot = resolveGlobalPmRoot(process.cwd());
6276
- const queuePath2 = path6.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2);
6277
- const statePath = path6.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2);
6474
+ const queuePath2 = path7.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH2);
6475
+ const statePath = path7.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH2);
6278
6476
  const queueRaw = await readFileIfExists(queuePath2);
6279
6477
  const queueExists = queueRaw !== null;
6280
6478
  const queueSizeBytes = queueRaw ? Buffer.byteLength(queueRaw, "utf8") : 0;
@@ -6605,7 +6803,7 @@ async function scanHealthDirectories(pmRoot, typeRegistry, strictDirectories) {
6605
6803
  const missingOptionalDirs = [];
6606
6804
  const hookWarnings = [];
6607
6805
  for (const relativeDir of [...requiredDirs, ...optionalDirs]) {
6608
- const directoryPath = path6.join(pmRoot, relativeDir);
6806
+ const directoryPath = path7.join(pmRoot, relativeDir);
6609
6807
  hookWarnings.push(...await runActiveOnReadHooks({
6610
6808
  path: directoryPath,
6611
6809
  scope: "project"
@@ -6904,8 +7102,8 @@ var _testOnlyHealthCommand = {
6904
7102
  };
6905
7103
 
6906
7104
  // dist/sdk/stats.js
6907
- import fs6 from "node:fs/promises";
6908
- import path7 from "node:path";
7105
+ import fs7 from "node:fs/promises";
7106
+ import path8 from "node:path";
6909
7107
 
6910
7108
  // dist/core/history/history-storage-stats.js
6911
7109
  function shouldReplaceExtreme(candidate, current, candidateTieBreaker, currentTieBreaker, direction, tieDirection = "min") {
@@ -7012,7 +7210,7 @@ function countNonEmptyLines(raw) {
7012
7210
  return raw.split(/\r?\n/u).filter((line) => line.trim().length > 0).length;
7013
7211
  }
7014
7212
  async function readHistoryStreamContents(pmRoot) {
7015
- const historyDir = path7.join(pmRoot, "history");
7213
+ const historyDir = path8.join(pmRoot, "history");
7016
7214
  if (!await pathExists(historyDir)) {
7017
7215
  return [];
7018
7216
  }
@@ -7020,10 +7218,10 @@ async function readHistoryStreamContents(pmRoot) {
7020
7218
  path: historyDir,
7021
7219
  scope: "project"
7022
7220
  });
7023
- const historyFiles = (await fs6.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((a, b) => a.localeCompare(b));
7221
+ const historyFiles = (await fs7.readdir(historyDir)).filter((entry) => entry.endsWith(".jsonl")).sort((a, b) => a.localeCompare(b));
7024
7222
  const streams = [];
7025
7223
  for (const file of historyFiles) {
7026
- const historyPath = path7.join(historyDir, file);
7224
+ const historyPath = path8.join(historyDir, file);
7027
7225
  const raw = await readFileIfExists(historyPath);
7028
7226
  if (raw === null) {
7029
7227
  continue;
@@ -7096,11 +7294,11 @@ async function runStats(global, options = {}) {
7096
7294
  }
7097
7295
 
7098
7296
  // dist/sdk/telemetry.js
7099
- import fs7 from "node:fs/promises";
7100
- import path8 from "node:path";
7101
- var TELEMETRY_QUEUE_RELATIVE_PATH3 = path8.join("runtime", "telemetry", "events.jsonl");
7102
- var TELEMETRY_STATE_RELATIVE_PATH3 = path8.join("runtime", "telemetry", "state.json");
7103
- var TELEMETRY_RUNTIME_RELATIVE_PATH = path8.join("runtime", "telemetry");
7297
+ import fs8 from "node:fs/promises";
7298
+ import path9 from "node:path";
7299
+ var TELEMETRY_QUEUE_RELATIVE_PATH3 = path9.join("runtime", "telemetry", "events.jsonl");
7300
+ var TELEMETRY_STATE_RELATIVE_PATH3 = path9.join("runtime", "telemetry", "state.json");
7301
+ var TELEMETRY_RUNTIME_RELATIVE_PATH = path9.join("runtime", "telemetry");
7104
7302
  var DEFAULT_STATS_LIMIT = 20;
7105
7303
  var TELEMETRY_SUBCOMMANDS = [
7106
7304
  "status",
@@ -7317,8 +7515,8 @@ var readTelemetryRuntimeState = async (statePath) => {
7317
7515
  var nullableTelemetryStateValue = (value) => value ?? null;
7318
7516
  var buildTelemetryStatusSummary = async (globalPmRoot) => {
7319
7517
  const settings = await readSettings(globalPmRoot);
7320
- const queuePath2 = path8.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH3);
7321
- const statePath = path8.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH3);
7518
+ const queuePath2 = path9.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH3);
7519
+ const statePath = path9.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH3);
7322
7520
  const queueRaw = await readFileIfExists(queuePath2);
7323
7521
  const queue = parseTelemetryQueue2(queueRaw);
7324
7522
  const runtimeState = await readTelemetryRuntimeState(statePath);
@@ -7396,9 +7594,9 @@ var runTelemetryClear = async (_options, context) => {
7396
7594
  if (settingsChanged) {
7397
7595
  await writeSettings(context.globalPmRoot, settings, "telemetry:clear");
7398
7596
  }
7399
- const telemetryRuntimePath = path8.join(context.globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
7597
+ const telemetryRuntimePath = path9.join(context.globalPmRoot, TELEMETRY_RUNTIME_RELATIVE_PATH);
7400
7598
  const existed = await pathExists(telemetryRuntimePath);
7401
- await fs7.rm(telemetryRuntimePath, { recursive: true, force: true });
7599
+ await fs8.rm(telemetryRuntimePath, { recursive: true, force: true });
7402
7600
  return {
7403
7601
  action: "telemetry",
7404
7602
  subcommand: "clear",
@@ -7422,8 +7620,8 @@ var runTelemetry = async (options, _global) => {
7422
7620
  const globalPmRoot = resolveGlobalPmRoot(process.cwd());
7423
7621
  return TELEMETRY_COMMAND_HANDLERS[subcommand](options, {
7424
7622
  globalPmRoot,
7425
- queuePath: path8.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH3),
7426
- statePath: path8.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH3)
7623
+ queuePath: path9.join(globalPmRoot, TELEMETRY_QUEUE_RELATIVE_PATH3),
7624
+ statePath: path9.join(globalPmRoot, TELEMETRY_STATE_RELATIVE_PATH3)
7427
7625
  });
7428
7626
  };
7429
7627
 
@@ -7887,7 +8085,7 @@ function firstPositionalToken(tokens, flagsWithValue = /* @__PURE__ */ new Set()
7887
8085
  import { spawn as spawn2 } from "node:child_process";
7888
8086
  import { cp, mkdir as mkdir2, mkdtemp, readdir as readdir2, rm as rm2 } from "node:fs/promises";
7889
8087
  import { tmpdir } from "node:os";
7890
- import path9 from "node:path";
8088
+ import path10 from "node:path";
7891
8089
 
7892
8090
  // dist/core/test/item-test-run-tracking.js
7893
8091
  var DEFAULT_TRACKED_TEST_RUN_HISTORY_LIMIT = 20;
@@ -8875,7 +9073,7 @@ async function copyIntoSandboxIfPresent(sourcePath, targetPath, recursive = fals
8875
9073
  if (!await pathExists(sourcePath)) {
8876
9074
  return;
8877
9075
  }
8878
- await mkdir2(path9.dirname(targetPath), { recursive: true });
9076
+ await mkdir2(path10.dirname(targetPath), { recursive: true });
8879
9077
  try {
8880
9078
  if (recursive) {
8881
9079
  await cp(sourcePath, targetPath, { recursive: true, force: true });
@@ -8891,9 +9089,9 @@ async function copyIntoSandboxIfPresent(sourcePath, targetPath, recursive = fals
8891
9089
  }
8892
9090
  async function seedLinkedTestSandbox(sandboxPmPath, sandboxGlobalPath, sourceRoots) {
8893
9091
  await copyIntoSandboxIfPresent(getSettingsPath(sourceRoots.projectPmRoot), getSettingsPath(sandboxPmPath));
8894
- await copyIntoSandboxIfPresent(path9.join(sourceRoots.projectPmRoot, "extensions"), path9.join(sandboxPmPath, "extensions"), true);
9092
+ await copyIntoSandboxIfPresent(path10.join(sourceRoots.projectPmRoot, "extensions"), path10.join(sandboxPmPath, "extensions"), true);
8895
9093
  await copyIntoSandboxIfPresent(getSettingsPath(sourceRoots.globalPmRoot), getSettingsPath(sandboxGlobalPath));
8896
- await copyIntoSandboxIfPresent(path9.join(sourceRoots.globalPmRoot, "extensions"), path9.join(sandboxGlobalPath, "extensions"), true);
9094
+ await copyIntoSandboxIfPresent(path10.join(sourceRoots.globalPmRoot, "extensions"), path10.join(sandboxGlobalPath, "extensions"), true);
8897
9095
  }
8898
9096
  async function seedLinkedTestTrackerData(sourceRoot, sandboxRoot) {
8899
9097
  if (!await pathExists(sourceRoot)) {
@@ -8904,8 +9102,8 @@ async function seedLinkedTestTrackerData(sourceRoot, sandboxRoot) {
8904
9102
  if (LINKED_TEST_TRACKER_DIRS_TO_SKIP.has(entry.name)) {
8905
9103
  continue;
8906
9104
  }
8907
- const sourcePath = path9.join(sourceRoot, entry.name);
8908
- const targetPath = path9.join(sandboxRoot, entry.name);
9105
+ const sourcePath = path10.join(sourceRoot, entry.name);
9106
+ const targetPath = path10.join(sandboxRoot, entry.name);
8909
9107
  if (entry.isDirectory()) {
8910
9108
  await copyIntoSandboxIfPresent(sourcePath, targetPath, true);
8911
9109
  continue;
@@ -8925,7 +9123,7 @@ async function countLinkedTestItemFiles(pmRoot) {
8925
9123
  if (!entry.isDirectory() || LINKED_TEST_ITEM_COUNT_DIRS_TO_SKIP.has(entry.name)) {
8926
9124
  continue;
8927
9125
  }
8928
- const folderPath = path9.join(pmRoot, entry.name);
9126
+ const folderPath = path10.join(pmRoot, entry.name);
8929
9127
  let files;
8930
9128
  try {
8931
9129
  files = await readdir2(folderPath, { withFileTypes: true });
@@ -9120,10 +9318,10 @@ ${stderr}`;
9120
9318
  function createLinkedTestSandboxLayout(sandboxRoot) {
9121
9319
  return {
9122
9320
  root: sandboxRoot,
9123
- schemaProjectPmPath: path9.join(sandboxRoot, "schema", "project", ".agents", "pm"),
9124
- schemaGlobalPmPath: path9.join(sandboxRoot, "schema", "global"),
9125
- trackerProjectPmPath: path9.join(sandboxRoot, "tracker", "project", ".agents", "pm"),
9126
- trackerGlobalPmPath: path9.join(sandboxRoot, "tracker", "global")
9321
+ schemaProjectPmPath: path10.join(sandboxRoot, "schema", "project", ".agents", "pm"),
9322
+ schemaGlobalPmPath: path10.join(sandboxRoot, "schema", "global"),
9323
+ trackerProjectPmPath: path10.join(sandboxRoot, "tracker", "project", ".agents", "pm"),
9324
+ trackerGlobalPmPath: path10.join(sandboxRoot, "tracker", "global")
9127
9325
  };
9128
9326
  }
9129
9327
  async function initializeLinkedTestSandboxes(layout) {
@@ -9323,7 +9521,7 @@ async function runSingleLinkedTest(params) {
9323
9521
  }
9324
9522
  async function runLinkedTests(tests, defaultTimeoutSeconds, options) {
9325
9523
  const results = [];
9326
- const sandboxRoot = await mkdtemp(path9.join(tmpdir(), "pm-linked-test-"));
9524
+ const sandboxRoot = await mkdtemp(path10.join(tmpdir(), "pm-linked-test-"));
9327
9525
  const layout = createLinkedTestSandboxLayout(sandboxRoot);
9328
9526
  const runLevelPmContextMode = parsePmContextMode(options?.pmContext);
9329
9527
  const progressMode = options?.progress === true ? "always" : "auto";
@@ -10037,10 +10235,10 @@ var runTestAll = async (options, global) => {
10037
10235
  import os2 from "node:os";
10038
10236
 
10039
10237
  // dist/core/test/background-runs.js
10040
- import fs8 from "node:fs/promises";
10238
+ import fs9 from "node:fs/promises";
10041
10239
  import { spawn as spawn3 } from "node:child_process";
10042
10240
  import { createHash, randomBytes } from "node:crypto";
10043
- import path10 from "node:path";
10241
+ import path11 from "node:path";
10044
10242
  var BACKGROUND_RUN_ACTIVE_STATUSES = /* @__PURE__ */ new Set([
10045
10243
  "queued",
10046
10244
  "running"
@@ -10078,7 +10276,7 @@ function buildBackgroundTestRunFingerprint(kind, commandArgs, pmRoot) {
10078
10276
  const payload = {
10079
10277
  kind,
10080
10278
  command: normalizeCommandArgs(commandArgs),
10081
- pm_root: path10.resolve(pmRoot)
10279
+ pm_root: path11.resolve(pmRoot)
10082
10280
  };
10083
10281
  return createHash("sha256").update(JSON.stringify(payload)).digest("hex");
10084
10282
  }
@@ -10133,8 +10331,8 @@ async function listBackgroundRunRecordPaths(pmRoot) {
10133
10331
  if (!await pathExists(recordsRoot)) {
10134
10332
  return [];
10135
10333
  }
10136
- const entries = await fs8.readdir(recordsRoot, { withFileTypes: true });
10137
- return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => path10.join(recordsRoot, entry.name)).sort((left, right) => right.localeCompare(left));
10334
+ const entries = await fs9.readdir(recordsRoot, { withFileTypes: true });
10335
+ return entries.filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => path11.join(recordsRoot, entry.name)).sort((left, right) => right.localeCompare(left));
10138
10336
  }
10139
10337
  function parseLinuxRssStatus(raw) {
10140
10338
  const match = raw.match(/^VmRSS:\s+(\d+)\s+kB$/m);
@@ -10148,7 +10346,7 @@ async function readLinuxRssBytes(pid) {
10148
10346
  return void 0;
10149
10347
  }
10150
10348
  try {
10151
- const raw = await fs8.readFile(`/proc/${pid}/status`, "utf8");
10349
+ const raw = await fs9.readFile(`/proc/${pid}/status`, "utf8");
10152
10350
  return parseLinuxRssStatus(raw);
10153
10351
  } catch {
10154
10352
  return void 0;
@@ -10176,7 +10374,7 @@ async function readLinuxCpuSeconds(pid) {
10176
10374
  return {};
10177
10375
  }
10178
10376
  try {
10179
- const raw = await fs8.readFile(`/proc/${pid}/stat`, "utf8");
10377
+ const raw = await fs9.readFile(`/proc/${pid}/stat`, "utf8");
10180
10378
  return parseLinuxCpuStat(raw);
10181
10379
  } catch {
10182
10380
  return {};
@@ -10312,18 +10510,18 @@ function tailLines(value, limit) {
10312
10510
  async function resolveBackgroundCliEntry(cwd) {
10313
10511
  const configured = process.env.PM_BACKGROUND_CLI_ENTRY?.trim();
10314
10512
  if (configured && configured.length > 0) {
10315
- const resolvedConfigured = path10.resolve(cwd, configured);
10513
+ const resolvedConfigured = path11.resolve(cwd, configured);
10316
10514
  if (await pathExists(resolvedConfigured)) {
10317
10515
  return resolvedConfigured;
10318
10516
  }
10319
10517
  }
10320
- const distEntry = path10.resolve(cwd, "dist", "cli.js");
10518
+ const distEntry = path11.resolve(cwd, "dist", "cli.js");
10321
10519
  if (await pathExists(distEntry)) {
10322
10520
  return distEntry;
10323
10521
  }
10324
10522
  const argvEntry = process.argv[1]?.trim();
10325
10523
  if (argvEntry && argvEntry.length > 0) {
10326
- const resolvedArgvEntry = path10.resolve(cwd, argvEntry);
10524
+ const resolvedArgvEntry = path11.resolve(cwd, argvEntry);
10327
10525
  if (await pathExists(resolvedArgvEntry)) {
10328
10526
  return resolvedArgvEntry;
10329
10527
  }
@@ -10380,8 +10578,8 @@ async function startBackgroundTestRun(options) {
10380
10578
  const stdoutPath = getTestRunStdoutPath(options.pmRoot, runId);
10381
10579
  const stderrPath = getTestRunStderrPath(options.pmRoot, runId);
10382
10580
  const resultPath = getTestRunResultPath(options.pmRoot, runId);
10383
- await fs8.writeFile(stdoutPath, "", "utf8");
10384
- await fs8.writeFile(stderrPath, "", "utf8");
10581
+ await fs9.writeFile(stdoutPath, "", "utf8");
10582
+ await fs9.writeFile(stderrPath, "", "utf8");
10385
10583
  const record = {
10386
10584
  id: runId,
10387
10585
  kind: options.kind,
@@ -10460,7 +10658,7 @@ async function spawnBackgroundTestRunWorker(options) {
10460
10658
  }
10461
10659
  async function appendFileOrdered(queue, filePath, text) {
10462
10660
  await queue;
10463
- await fs8.appendFile(filePath, text, "utf8");
10661
+ await fs9.appendFile(filePath, text, "utf8");
10464
10662
  }
10465
10663
  function resolvePositiveEnvInteger(name, fallback) {
10466
10664
  const parsed = Number.parseInt(process.env[name] ?? "", 10);
@@ -11040,10 +11238,10 @@ async function runTestRunsWorker(runId, global) {
11040
11238
  }
11041
11239
 
11042
11240
  // dist/sdk/governance/validate.js
11043
- import fs9 from "node:fs/promises";
11241
+ import fs11 from "node:fs/promises";
11044
11242
  import { realpathSync } from "node:fs";
11045
11243
  import { execFile } from "node:child_process";
11046
- import path11 from "node:path";
11244
+ import path13 from "node:path";
11047
11245
  import { promisify } from "node:util";
11048
11246
 
11049
11247
  // dist/core/validate/fix-planning.js
@@ -11349,8 +11547,8 @@ function buildMissingLinkedPathRows(rows, lookup) {
11349
11547
  });
11350
11548
  }
11351
11549
  }
11352
- return [...buckets.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([path12, bucket]) => ({
11353
- path: path12,
11550
+ return [...buckets.entries()].sort(([left], [right]) => left.localeCompare(right)).map(([path14, bucket]) => ({
11551
+ path: path14,
11354
11552
  classification: bucket.classification,
11355
11553
  items: [...bucket.owners.values()].map((owner) => {
11356
11554
  const metadata = lookup(owner.item_id);
@@ -11380,6 +11578,199 @@ function summarizeMissingLinkedPathRows(rows) {
11380
11578
  return lines;
11381
11579
  }
11382
11580
 
11581
+ // dist/sdk/governance/storage-integrity.js
11582
+ import fs10 from "node:fs/promises";
11583
+ import path12 from "node:path";
11584
+ async function listItemFilesOnDisk(pmRoot, typeToFolder) {
11585
+ const folders = [...new Set(Object.values(typeToFolder))];
11586
+ const found = [];
11587
+ await Promise.all(folders.map(async (folder) => {
11588
+ let entries;
11589
+ try {
11590
+ entries = await fs10.readdir(path12.join(pmRoot, folder));
11591
+ } catch {
11592
+ return;
11593
+ }
11594
+ for (const entry of entries) {
11595
+ for (const extension of ITEM_FILE_EXTENSIONS) {
11596
+ if (entry.toLowerCase().endsWith(extension)) {
11597
+ found.push({
11598
+ relativePath: `${folder}/${entry}`,
11599
+ id: entry.slice(0, -extension.length)
11600
+ });
11601
+ break;
11602
+ }
11603
+ }
11604
+ }
11605
+ }));
11606
+ return found.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
11607
+ }
11608
+ function scanHistoryStreamContent(accumulator, raw) {
11609
+ const { id, relativePath, liveItemIds, out } = accumulator;
11610
+ out.scanned += 1;
11611
+ const conflictMarker = findFirstMergeConflictMarker(raw);
11612
+ if (conflictMarker) {
11613
+ out.conflictMarkers.push({
11614
+ id,
11615
+ path: relativePath,
11616
+ line: conflictMarker.line,
11617
+ detail: `unresolved merge conflict marker ${conflictMarker.marker}`
11618
+ });
11619
+ return;
11620
+ }
11621
+ let latestEntry = null;
11622
+ const lines = raw.split(/\r?\n/).map((line, index) => ({ content: line.trim(), number: index + 1 })).filter((line) => line.content.length > 0);
11623
+ for (const line of lines) {
11624
+ try {
11625
+ const parsed = JSON.parse(line.content);
11626
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
11627
+ throw new TypeError("history entry must be an object");
11628
+ }
11629
+ latestEntry = parsed;
11630
+ } catch {
11631
+ out.unparseable.push({
11632
+ id,
11633
+ path: relativePath,
11634
+ line: line.number,
11635
+ detail: "history line is not a valid JSON object"
11636
+ });
11637
+ return;
11638
+ }
11639
+ }
11640
+ if (latestEntry === null) {
11641
+ return;
11642
+ }
11643
+ if (latestEntry.op === "delete" && liveItemIds.has(id)) {
11644
+ out.resurrected.push({
11645
+ id,
11646
+ deleted_at: typeof latestEntry.ts === "string" ? latestEntry.ts : "",
11647
+ deleted_by: typeof latestEntry.author === "string" ? latestEntry.author : ""
11648
+ });
11649
+ }
11650
+ if (latestEntry.op === "history_repair" && Array.isArray(latestEntry.patch) && latestEntry.patch.length > 0) {
11651
+ out.repairReconciliations += 1;
11652
+ }
11653
+ }
11654
+ async function scanHistoryStreams(pmRoot, liveItemIds) {
11655
+ const out = {
11656
+ conflictMarkers: [],
11657
+ unparseable: [],
11658
+ resurrected: [],
11659
+ repairReconciliations: 0,
11660
+ scanned: 0
11661
+ };
11662
+ let entries;
11663
+ try {
11664
+ entries = await fs10.readdir(path12.join(pmRoot, "history"));
11665
+ } catch {
11666
+ return out;
11667
+ }
11668
+ for (const entry of entries.sort((left, right) => left.localeCompare(right))) {
11669
+ if (!entry.endsWith(".jsonl")) {
11670
+ continue;
11671
+ }
11672
+ const raw = await fs10.readFile(path12.join(pmRoot, "history", entry), "utf8");
11673
+ scanHistoryStreamContent({
11674
+ id: entry.slice(0, -".jsonl".length),
11675
+ relativePath: `history/${entry}`,
11676
+ liveItemIds,
11677
+ out
11678
+ }, raw);
11679
+ }
11680
+ return out;
11681
+ }
11682
+ function describeUnparseableJson(raw) {
11683
+ const conflictMarker = findFirstMergeConflictMarker(raw);
11684
+ if (conflictMarker) {
11685
+ return `unresolved merge conflict marker ${conflictMarker.marker} at line ${conflictMarker.line}`;
11686
+ }
11687
+ try {
11688
+ JSON.parse(raw);
11689
+ return null;
11690
+ } catch (error) {
11691
+ return `invalid JSON (${String(error)})`;
11692
+ }
11693
+ }
11694
+ async function scanConfigFiles(pmRoot) {
11695
+ const unparseable = [];
11696
+ let scanned = 0;
11697
+ const settingsRaw = await readFileIfExists(getSettingsPath(pmRoot));
11698
+ if (settingsRaw !== null) {
11699
+ scanned += 1;
11700
+ const detail = describeUnparseableJson(settingsRaw);
11701
+ if (detail !== null) {
11702
+ unparseable.push({ path: "settings.json", detail });
11703
+ }
11704
+ }
11705
+ let schemaEntries;
11706
+ try {
11707
+ schemaEntries = await fs10.readdir(path12.join(pmRoot, "schema"));
11708
+ } catch {
11709
+ return { scanned, unparseable };
11710
+ }
11711
+ for (const entry of schemaEntries.sort((left, right) => left.localeCompare(right))) {
11712
+ if (!entry.endsWith(".json")) {
11713
+ continue;
11714
+ }
11715
+ const raw = await fs10.readFile(path12.join(pmRoot, "schema", entry), "utf8");
11716
+ scanned += 1;
11717
+ const detail = describeUnparseableJson(raw);
11718
+ if (detail !== null) {
11719
+ unparseable.push({ path: `schema/${entry}`, detail });
11720
+ }
11721
+ }
11722
+ return { scanned, unparseable };
11723
+ }
11724
+ async function scanStorageIntegrity(pmRoot, parsedItemIds, typeToFolder, itemParseOptions = {}) {
11725
+ const itemFiles = await listItemFilesOnDisk(pmRoot, typeToFolder);
11726
+ const idsOnDisk = new Set(itemFiles.map((file) => file.id));
11727
+ const pathsById = /* @__PURE__ */ new Map();
11728
+ for (const file of itemFiles) {
11729
+ const paths = pathsById.get(file.id);
11730
+ if (paths === void 0) {
11731
+ pathsById.set(file.id, [file.relativePath]);
11732
+ } else {
11733
+ paths.push(file.relativePath);
11734
+ }
11735
+ }
11736
+ const duplicateItemIds = [...pathsById.entries()].filter(([, paths]) => paths.length > 1).map(([id, paths]) => ({
11737
+ id,
11738
+ paths: [...paths].sort((left, right) => left.localeCompare(right))
11739
+ })).sort((left, right) => left.id.localeCompare(right.id));
11740
+ const unreadableItemFiles = (await Promise.all(itemFiles.map(async (file) => {
11741
+ if (!parsedItemIds.has(file.id)) {
11742
+ return { path: file.relativePath, id: file.id };
11743
+ }
11744
+ try {
11745
+ const absolutePath = path12.join(pmRoot, file.relativePath);
11746
+ parseItemDocument(await fs10.readFile(absolutePath, "utf8"), {
11747
+ format: absolutePath.toLowerCase().endsWith(".md") ? "json_markdown" : "toon",
11748
+ schema: itemParseOptions.schema,
11749
+ extensionFieldNames: itemParseOptions.extensionFieldNames
11750
+ });
11751
+ return null;
11752
+ } catch {
11753
+ return { path: file.relativePath, id: file.id };
11754
+ }
11755
+ }))).filter((row) => row !== null);
11756
+ const historyScan = await scanHistoryStreams(pmRoot, idsOnDisk);
11757
+ const configScan = await scanConfigFiles(pmRoot);
11758
+ return {
11759
+ item_files_on_disk: itemFiles.length,
11760
+ item_ids_on_disk: idsOnDisk.size,
11761
+ parsed_items: parsedItemIds.size,
11762
+ unreadable_item_files: unreadableItemFiles,
11763
+ duplicate_item_ids: duplicateItemIds,
11764
+ history_streams_scanned: historyScan.scanned,
11765
+ history_conflict_marker_streams: historyScan.conflictMarkers,
11766
+ history_unparseable_streams: historyScan.unparseable,
11767
+ resurrected_items: historyScan.resurrected,
11768
+ history_repair_reconciliations: historyScan.repairReconciliations,
11769
+ config_files_scanned: configScan.scanned,
11770
+ unparseable_config_files: configScan.unparseable
11771
+ };
11772
+ }
11773
+
11383
11774
  // dist/sdk/governance/validate.js
11384
11775
  var FILE_SCAN_DIRECTORIES = ["src", "tests", "docs"];
11385
11776
  var FILE_SCAN_ROOT_FILES = [
@@ -11687,16 +12078,16 @@ function resolveFileScanMode(scanMode) {
11687
12078
  throw new PmCliError(`Unknown --scan-mode value "${scanMode}". Supported values: ${VALIDATE_FILE_SCAN_MODES.join(", ")}.`, EXIT_CODE.USAGE);
11688
12079
  }
11689
12080
  function resolveWorkspaceRoot(pmRoot) {
11690
- const resolvedPmRoot = path11.resolve(pmRoot);
12081
+ const resolvedPmRoot = path13.resolve(pmRoot);
11691
12082
  const normalizedPmRoot = resolvedPmRoot.replaceAll("\\", "/");
11692
12083
  if (normalizedPmRoot.endsWith("/.agents/pm")) {
11693
- return path11.dirname(path11.dirname(resolvedPmRoot));
12084
+ return path13.dirname(path13.dirname(resolvedPmRoot));
11694
12085
  }
11695
- const resolvedCwd = path11.resolve(process.cwd());
12086
+ const resolvedCwd = path13.resolve(process.cwd());
11696
12087
  const canonicalPmRoot = realpathForWorkspaceRoot(resolvedPmRoot);
11697
12088
  const canonicalCwd = realpathForWorkspaceRoot(resolvedCwd);
11698
- const relativeFromPmRoot = path11.relative(canonicalPmRoot, canonicalCwd);
11699
- const cwdInsidePmRoot = relativeFromPmRoot.length === 0 || !relativeFromPmRoot.startsWith("..") && !path11.isAbsolute(relativeFromPmRoot);
12089
+ const relativeFromPmRoot = path13.relative(canonicalPmRoot, canonicalCwd);
12090
+ const cwdInsidePmRoot = relativeFromPmRoot.length === 0 || !relativeFromPmRoot.startsWith("..") && !path13.isAbsolute(relativeFromPmRoot);
11700
12091
  if (cwdInsidePmRoot) {
11701
12092
  return resolvedPmRoot;
11702
12093
  }
@@ -11706,14 +12097,14 @@ function realpathForWorkspaceRoot(inputPath) {
11706
12097
  try {
11707
12098
  return realpathSync.native(inputPath);
11708
12099
  } catch {
11709
- return path11.resolve(inputPath);
12100
+ return path13.resolve(inputPath);
11710
12101
  }
11711
12102
  }
11712
12103
  async function listFilesRecursive(basePath, relativePath, output) {
11713
- const targetDirectory = relativePath.length > 0 ? path11.join(basePath, relativePath) : basePath;
12104
+ const targetDirectory = relativePath.length > 0 ? path13.join(basePath, relativePath) : basePath;
11714
12105
  let entries;
11715
12106
  try {
11716
- entries = await fs9.readdir(targetDirectory, { withFileTypes: true });
12107
+ entries = await fs11.readdir(targetDirectory, { withFileTypes: true });
11717
12108
  } catch (error) {
11718
12109
  if (typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT") {
11719
12110
  return;
@@ -11724,7 +12115,7 @@ async function listFilesRecursive(basePath, relativePath, output) {
11724
12115
  if (entry.name.startsWith(".")) {
11725
12116
  continue;
11726
12117
  }
11727
- const childRelative = relativePath.length > 0 ? path11.join(relativePath, entry.name) : entry.name;
12118
+ const childRelative = relativePath.length > 0 ? path13.join(relativePath, entry.name) : entry.name;
11728
12119
  if (entry.isDirectory()) {
11729
12120
  if (DIRECTORY_IGNORE_SET.has(entry.name)) {
11730
12121
  continue;
@@ -11744,9 +12135,9 @@ async function collectDefaultProjectFileCandidates(workspaceRoot) {
11744
12135
  await listFilesRecursive(workspaceRoot, directory, discovered);
11745
12136
  }
11746
12137
  for (const candidate of FILE_SCAN_ROOT_FILES) {
11747
- const absolute = path11.join(workspaceRoot, candidate);
12138
+ const absolute = path13.join(workspaceRoot, candidate);
11748
12139
  try {
11749
- const stats = await fs9.stat(absolute);
12140
+ const stats = await fs11.stat(absolute);
11750
12141
  if (stats.isFile()) {
11751
12142
  discovered.push(normalizeRelativePath2(candidate));
11752
12143
  }
@@ -11776,7 +12167,7 @@ function resolvePmInternalCandidatePrefixes(pmRoot, workspaceRoot) {
11776
12167
  if (configuredDefault.length > 0) {
11777
12168
  prefixes.add(configuredDefault);
11778
12169
  }
11779
- const relativePmRoot = normalizeRelativeDirectoryPath(path11.relative(workspaceRoot, pmRoot));
12170
+ const relativePmRoot = normalizeRelativeDirectoryPath(path13.relative(workspaceRoot, pmRoot));
11780
12171
  if (relativePmRoot.length > 0 && !relativePmRoot.startsWith("..")) {
11781
12172
  prefixes.add(relativePmRoot);
11782
12173
  }
@@ -11895,6 +12286,9 @@ function resolveRequestedChecks(options) {
11895
12286
  if (options.checkCommandReferences) {
11896
12287
  requested.add("command_references");
11897
12288
  }
12289
+ if (options.checkStorageIntegrity) {
12290
+ requested.add("storage_integrity");
12291
+ }
11898
12292
  if (requested.size === 0) {
11899
12293
  if (options.autoFix) {
11900
12294
  requested.add("metadata");
@@ -11912,6 +12306,7 @@ function resolveRequestedChecks(options) {
11912
12306
  requested.add("command_references");
11913
12307
  requested.add("history_drift");
11914
12308
  requested.add("format_version");
12309
+ requested.add("storage_integrity");
11915
12310
  }
11916
12311
  return requested;
11917
12312
  }
@@ -12256,30 +12651,30 @@ function resolveLifecycleDependencyCycleSamplePath(component, graph) {
12256
12651
  return [start, start];
12257
12652
  }
12258
12653
  const componentSet = new Set(component);
12259
- const path12 = [start];
12654
+ const path14 = [start];
12260
12655
  const visited = /* @__PURE__ */ new Set([start]);
12261
12656
  const search = (current) => {
12262
12657
  const neighbors = (graph.get(current) ?? []).filter((candidate) => componentSet.has(candidate));
12263
12658
  for (const next of neighbors) {
12264
- if (next === start && path12.length > 1) {
12265
- path12.push(start);
12659
+ if (next === start && path14.length > 1) {
12660
+ path14.push(start);
12266
12661
  return true;
12267
12662
  }
12268
12663
  if (visited.has(next)) {
12269
12664
  continue;
12270
12665
  }
12271
12666
  visited.add(next);
12272
- path12.push(next);
12667
+ path14.push(next);
12273
12668
  if (search(next)) {
12274
12669
  return true;
12275
12670
  }
12276
- path12.pop();
12671
+ path14.pop();
12277
12672
  visited.delete(next);
12278
12673
  }
12279
12674
  return false;
12280
12675
  };
12281
12676
  if (search(start)) {
12282
- return [...path12];
12677
+ return [...path14];
12283
12678
  }
12284
12679
  return [...component, start];
12285
12680
  }
@@ -12537,12 +12932,12 @@ function linkedArtifactPathExceedsFilesystemLimits(artifactPath) {
12537
12932
  return normalized.length > LINKED_ARTIFACT_MAX_PATH_LENGTH || normalized.split(/[\\/]/).some((segment) => segment.length > LINKED_ARTIFACT_MAX_SEGMENT_LENGTH);
12538
12933
  }
12539
12934
  async function linkedArtifactIsMissing(workspaceRoot, artifactPath) {
12540
- const absolutePath = path11.isAbsolute(artifactPath) ? artifactPath : path11.resolve(workspaceRoot, artifactPath);
12935
+ const absolutePath = path13.isAbsolute(artifactPath) ? artifactPath : path13.resolve(workspaceRoot, artifactPath);
12541
12936
  if (linkedArtifactPathExceedsFilesystemLimits(absolutePath)) {
12542
12937
  return false;
12543
12938
  }
12544
12939
  try {
12545
- const stats = await fs9.stat(absolutePath);
12940
+ const stats = await fs11.stat(absolutePath);
12546
12941
  return !stats.isFile() && !stats.isDirectory();
12547
12942
  } catch (error) {
12548
12943
  const code = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
@@ -13036,6 +13431,49 @@ var _testOnlyValidateCommand = {
13036
13431
  summarizeDuplicateIssueCodes,
13037
13432
  toMeaningfulString
13038
13433
  };
13434
+ async function buildStorageIntegrityCheck(pmRoot, items, typeToFolder, settings) {
13435
+ const scan = await scanStorageIntegrity(pmRoot, new Set(items.map((item) => item.id)), typeToFolder, {
13436
+ schema: settings.schema,
13437
+ extensionFieldNames: collectRegisteredItemFieldNames(getActiveExtensionRegistrations())
13438
+ });
13439
+ const warnings = [];
13440
+ if (scan.unreadable_item_files.length > 0) {
13441
+ warnings.push(`validate_storage_unreadable_items:${scan.unreadable_item_files.length}`);
13442
+ }
13443
+ if (scan.duplicate_item_ids.length > 0) {
13444
+ warnings.push(`validate_storage_duplicate_item_ids:${scan.duplicate_item_ids.length}`);
13445
+ }
13446
+ if (scan.history_conflict_marker_streams.length > 0) {
13447
+ warnings.push(`validate_storage_history_conflict_markers:${scan.history_conflict_marker_streams.length}`);
13448
+ }
13449
+ if (scan.history_unparseable_streams.length > 0) {
13450
+ warnings.push(`validate_storage_unparseable_history:${scan.history_unparseable_streams.length}`);
13451
+ }
13452
+ if (scan.resurrected_items.length > 0) {
13453
+ warnings.push(`validate_storage_resurrected_items:${scan.resurrected_items.length}`);
13454
+ }
13455
+ if (scan.unparseable_config_files.length > 0) {
13456
+ warnings.push(`validate_storage_unparseable_config:${scan.unparseable_config_files.length}`);
13457
+ }
13458
+ const errorCount = warnings.length;
13459
+ const fenceAudit = await auditMergeAttributeFence(pmRoot, [
13460
+ ...new Set(Object.values(typeToFolder))
13461
+ ]);
13462
+ if (fenceAudit.status === "drift") {
13463
+ warnings.push(`validate_merge_fence_drift:${fenceAudit.missing_patterns.length + fenceAudit.stale_patterns.length}`);
13464
+ }
13465
+ return {
13466
+ check: {
13467
+ name: "storage_integrity",
13468
+ // Corruption findings fail the check; fence drift alone is a warning —
13469
+ // the workspace data is intact, but future merges of uncovered paths
13470
+ // would fall back to git's default text driver.
13471
+ status: errorCount > 0 ? "error" : warnings.length > 0 ? "warn" : "ok",
13472
+ details: { ...scan, merge_fence: fenceAudit }
13473
+ },
13474
+ warnings
13475
+ };
13476
+ }
13039
13477
  function recordValidateCheck(state, built, fixHintsEnabled) {
13040
13478
  if (fixHintsEnabled) {
13041
13479
  attachValidateFixHints(built.check, built.warnings);
@@ -13086,6 +13524,9 @@ async function executeRequestedValidateChecks(params) {
13086
13524
  if (params.requestedChecks.has("format_version")) {
13087
13525
  recordValidateCheck(state, buildFormatVersionCheck(params.items, fullDiagnostics), fixHintsEnabled);
13088
13526
  }
13527
+ if (params.requestedChecks.has("storage_integrity")) {
13528
+ recordValidateCheck(state, await buildStorageIntegrityCheck(params.pmRoot, params.items, resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations()).type_to_folder, params.settings), fixHintsEnabled);
13529
+ }
13089
13530
  return state;
13090
13531
  }
13091
13532
  function planValidateFixes(options, state, settings) {
@@ -13223,6 +13664,7 @@ export {
13223
13664
  runMeet,
13224
13665
  runEvent,
13225
13666
  runRemind,
13667
+ runWorkspaceTransactionGc,
13226
13668
  runGc,
13227
13669
  inspectHistoryAuthorStream,
13228
13670
  scanHistoryAuthorAttribution,
@@ -13251,6 +13693,6 @@ export {
13251
13693
  runValidate2,
13252
13694
  resolveStartTaskInProgressStatus
13253
13695
  };
13254
- //# sourceMappingURL=chunk-ODEIDKGW.js.map
13696
+ //# sourceMappingURL=chunk-3LPFHE3P.js.map
13255
13697
 
13256
- //# debugId=b111adf0-7ac6-5083-9fb7-c9a093abf43b
13698
+ //# debugId=4c96022d-a7de-55fa-835e-c7cf3a43e0b8