@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,33 +1,35 @@
1
1
  import {
2
2
  runUpdate
3
- } from "./chunk-P24ZU5QV.js";
3
+ } from "./chunk-AOEOYL3S.js";
4
4
  import {
5
5
  resolvePriority
6
- } from "./chunk-3QNUDDY2.js";
6
+ } from "./chunk-KZEANWJS.js";
7
7
  import {
8
8
  buildInvalidTypeError
9
- } from "./chunk-4M6RZJXF.js";
9
+ } from "./chunk-WWNL6WMH.js";
10
10
  import {
11
+ applyAcceptanceCriteriaMutations,
11
12
  applyTagRemovals,
12
13
  mergeAdditiveTags,
13
14
  parseOptionalNonNegativeInteger,
14
- parseTags
15
- } from "./chunk-A5EQPNV7.js";
15
+ parseTags,
16
+ splitAcceptanceCriteria
17
+ } from "./chunk-GVT754PX.js";
16
18
  import {
17
19
  createCheckpointId,
18
20
  loadMutationCheckpoint,
19
21
  restoreCheckpointItems,
20
22
  writeMutationCheckpoint
21
- } from "./chunk-XVB6BATY.js";
23
+ } from "./chunk-72LQ4TKV.js";
22
24
  import {
23
25
  hasListFilters
24
26
  } from "./chunk-KWYX6ZIR.js";
25
27
  import {
26
28
  runList
27
- } from "./chunk-YIC5NGXF.js";
29
+ } from "./chunk-RMF7LMBS.js";
28
30
  import {
29
31
  runRestore
30
- } from "./chunk-FQODDTE7.js";
32
+ } from "./chunk-WUVEBQW6.js";
31
33
  import {
32
34
  resolveAuthor
33
35
  } from "./chunk-YRYYFGV3.js";
@@ -40,7 +42,7 @@ import {
40
42
  resolveIsoOrRelative,
41
43
  stableValueEquals,
42
44
  toItemRecord
43
- } from "./chunk-RLLOZAM2.js";
45
+ } from "./chunk-IY6VZ3IW.js";
44
46
  import {
45
47
  EXIT_CODE,
46
48
  PmCliError,
@@ -53,13 +55,13 @@ import {
53
55
  resolveRuntimeStatusRegistry,
54
56
  resolveTypeName,
55
57
  toErrorMessage
56
- } from "./chunk-WCBB6VI3.js";
58
+ } from "./chunk-7AVEY74G.js";
57
59
 
58
60
  // dist/cli/commands/update-many.js
59
61
  !(function() {
60
62
  try {
61
63
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
62
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "19acba6b-a459-52ce-b267-6f1d0db63265");
64
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c71478fc-d38f-5d1b-b0de-632e04f83a80");
63
65
  } catch (e2) {
64
66
  }
65
67
  })();
@@ -396,6 +398,20 @@ var buildTagMutationPlan = (row, update) => {
396
398
  }
397
399
  return { field: "tags", before: existing, after };
398
400
  };
401
+ var buildAcceptanceCriteriaMutationPlan = (row, update) => {
402
+ const before = row.acceptance_criteria;
403
+ const base = update.acceptanceCriteria === void 0 ? before : String(update.acceptanceCriteria).trim();
404
+ const mutation = applyAcceptanceCriteriaMutations(splitAcceptanceCriteria(base), update.addAc, update.removeAc);
405
+ const warnings = mutation.unmatchedRemovals.map((criterion) => `remove_ac_unmatched:${criterion}`);
406
+ const after = mutation.criteria.join("; ");
407
+ if (areValuesEqual(before, after) || before === void 0 && after === "") {
408
+ return { warnings };
409
+ }
410
+ return {
411
+ change: { field: "acceptance_criteria", before, after },
412
+ warnings
413
+ };
414
+ };
399
415
  var appendScalarMutationPlans = (changes, row, update) => {
400
416
  for (const [optionKey, itemKey] of Object.entries(UPDATE_OPTION_TO_ITEM_KEY)) {
401
417
  const candidate = update[optionKey];
@@ -430,17 +446,28 @@ var appendUnsetMutationPlans = (changes, row, unset) => {
430
446
  var buildPlannedItemDiff = (item, runtimeFieldRegistry, update = {}) => {
431
447
  const row = toItemRecord(item);
432
448
  const changes = [];
449
+ const warnings = [];
433
450
  const tagPlan = buildTagMutationPlan(row, update);
434
451
  if (tagPlan) {
435
452
  changes.push(tagPlan);
436
453
  }
437
454
  appendScalarMutationPlans(changes, row, update);
455
+ if (updateArrayValueCount(update.addAc) > 0 || updateArrayValueCount(update.removeAc) > 0) {
456
+ const composed = buildAcceptanceCriteriaMutationPlan(row, update);
457
+ const withoutAc = changes.filter((change) => change.field !== "acceptance_criteria");
458
+ changes.splice(0, changes.length, ...withoutAc);
459
+ if (composed.change !== void 0) {
460
+ changes.push(composed.change);
461
+ }
462
+ warnings.push(...composed.warnings);
463
+ }
438
464
  changes.push(...buildCollectionMutationPlans(row, update));
439
465
  appendRuntimeFieldMutationPlans(changes, row, update, runtimeFieldRegistry);
440
466
  appendUnsetMutationPlans(changes, row, update.unset);
441
467
  return {
442
468
  id: item.id,
443
- changes
469
+ changes,
470
+ ...warnings.length > 0 ? { warnings } : {}
444
471
  };
445
472
  };
446
473
  var normalizeStatusFilter = (value, statusRegistry) => {
@@ -541,6 +568,20 @@ var writeUpdateManyCheckpoint = async (params) => {
541
568
  rollback_command: `pm update-many --rollback ${params.checkpointId}`
542
569
  };
543
570
  };
571
+ var collectUnmatchedRequestedIds = (rawIds, existingItems) => {
572
+ if (rawIds == null) {
573
+ return void 0;
574
+ }
575
+ const requested = [
576
+ ...new Set(String(rawIds).split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0))
577
+ ];
578
+ const existing = new Set(existingItems.map((item) => item.id));
579
+ return requested.filter((id) => !existing.has(id));
580
+ };
581
+ var buildUnmatchedIdFields = (plan) => plan.unmatchedIds === void 0 ? {} : {
582
+ unmatched_ids: plan.unmatchedIds,
583
+ unmatched_count: plan.unmatchedIds.length
584
+ };
544
585
  var loadUpdateManyRuntimeContext = async (global2) => {
545
586
  const pmRoot = resolvePmRoot(process.cwd(), global2.path);
546
587
  if (!await pathExists(getSettingsPath(pmRoot))) {
@@ -582,12 +623,18 @@ var buildUpdateManyPlan = async (params) => {
582
623
  full: true
583
624
  }, params.global);
584
625
  const planned = listed.items.map((item) => buildPlannedItemDiff(item, params.runtime.runtimeFieldRegistry, params.options.update));
626
+ const existenceItems = params.options.list?.ids == null ? [] : (await runList(void 0, {
627
+ ids: params.options.list.ids,
628
+ noTruncate: true,
629
+ full: true
630
+ }, params.global)).items;
585
631
  return {
586
632
  listed,
587
633
  planned,
588
634
  actionable: planned.filter((row) => row.changes.length > 0),
589
635
  updateSummary: params.updateSummary,
590
- statusFilter
636
+ statusFilter,
637
+ unmatchedIds: collectUnmatchedRequestedIds(params.options.list?.ids, existenceItems)
591
638
  };
592
639
  };
593
640
  var buildUpdateManyDryRunResult = (plan) => ({
@@ -597,7 +644,8 @@ var buildUpdateManyDryRunResult = (plan) => ({
597
644
  filters: plan.listed.filters,
598
645
  planned_update_options: plan.updateSummary,
599
646
  item_plans: plan.planned,
600
- ids: []
647
+ ids: [],
648
+ ...buildUnmatchedIdFields(plan)
601
649
  });
602
650
  var buildUpdateManyNoopResult = (plan) => ({
603
651
  mode: "apply",
@@ -610,18 +658,26 @@ var buildUpdateManyNoopResult = (plan) => ({
610
658
  failed_count: 0,
611
659
  rows: plan.planned.map((row) => ({
612
660
  id: row.id,
613
- status: "skipped"
661
+ status: "skipped",
662
+ ...row.warnings ? { warnings: row.warnings } : {}
614
663
  })),
615
- ids: []
664
+ ids: [],
665
+ ...buildUnmatchedIdFields(plan)
616
666
  });
617
667
  var applyUpdateManyRows = async (params) => {
618
668
  const rows = [];
619
669
  const updatedIds = [];
620
670
  const updateMessage = params.options.update.message ?? `update-many apply ${params.checkpointId}`;
621
- const actionableById = new Set(params.actionable.map((row) => row.id));
671
+ const plannedById = new Map(params.plans.map((row) => [row.id, row]));
672
+ const actionableById = new Set(params.plans.filter((row) => row.changes.length > 0).map((row) => row.id));
622
673
  for (const item of params.items) {
623
674
  if (!actionableById.has(item.id)) {
624
- rows.push({ id: item.id, status: "skipped" });
675
+ const warnings = plannedById.get(item.id)?.warnings;
676
+ rows.push({
677
+ id: item.id,
678
+ status: "skipped",
679
+ ...warnings ? { warnings } : {}
680
+ });
625
681
  continue;
626
682
  }
627
683
  try {
@@ -667,7 +723,7 @@ var applyUpdateManyPlan = async (params) => {
667
723
  });
668
724
  const applied = await applyUpdateManyRows({
669
725
  items: params.plan.listed.items,
670
- actionable: params.plan.actionable,
726
+ plans: params.plan.planned,
671
727
  options: params.options,
672
728
  global: params.global,
673
729
  checkpointId
@@ -684,7 +740,8 @@ var applyUpdateManyPlan = async (params) => {
684
740
  skipped_count: countStatus("skipped"),
685
741
  failed_count: countStatus("failed"),
686
742
  rows: applied.rows,
687
- ids: applied.updatedIds
743
+ ids: applied.updatedIds,
744
+ ...buildUnmatchedIdFields(params.plan)
688
745
  };
689
746
  };
690
747
  var runUpdateMany = async (options, global2) => {
@@ -734,4 +791,4 @@ export {
734
791
  runUpdateMany,
735
792
  _testOnlyUpdateManyCommand
736
793
  };
737
- //# sourceMappingURL=chunk-3KPNOZOH.js.map
794
+ //# sourceMappingURL=chunk-X6K5XTTN.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/commands/update-many.ts"],
4
+ "sourcesContent": ["/**\n * @module cli/commands/update-many\n *\n * Implements the pm update many command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n createCheckpointId,\n loadMutationCheckpoint,\n restoreCheckpointItems,\n writeMutationCheckpoint,\n type MutationCheckpointItem,\n} from \"../../core/checkpoint/mutation-checkpoint.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport {\n applyAcceptanceCriteriaMutations,\n applyTagRemovals,\n mergeAdditiveTags,\n parseOptionalNonNegativeInteger,\n parseTags,\n splitAcceptanceCriteria,\n} from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport {\n resolveItemTypeRegistry,\n resolveTypeName,\n} from \"../../core/item/type-registry.js\";\nimport { collectRuntimeUpdateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport {\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeFieldRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toErrorMessage } from \"../../core/shared/primitives.js\";\nimport { stableValueEquals } from \"../../core/shared/serialization.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport type { ItemStatus, PmSettings } from \"../../types/index.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { hasListFilters } from \"./list-filter-shared.js\";\nimport {\n runList,\n type ListFullResult,\n type ListOptions,\n type ListedItem,\n} from \"./list.js\";\nimport { runRestore } from \"./restore.js\";\nimport { runUpdate, type UpdateCommandOptions } from \"./update.js\";\n\nconst UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;\nconst UPDATE_MANY_CHECKPOINT_SUBDIR = \"update-many\";\n\nconst NON_MUTATION_UPDATE_OPTION_KEYS = new Set<PropertyKey>([\n \"author\",\n \"message\",\n \"force\",\n \"ownershipMetadataBypass\",\n \"ownershipDependencyBypass\",\n]);\n\nconst UPDATE_MANY_MUTATION_FLAG_GUIDANCE = [\n \"--status\",\n \"--priority\",\n \"--type\",\n \"--tags\",\n \"--description\",\n \"--body\",\n \"--deadline\",\n \"--estimate\",\n \"--assignee\",\n \"--dep\",\n \"--dep-remove\",\n \"--comment\",\n \"--note\",\n \"--learning\",\n \"--file\",\n \"--test\",\n \"--doc\",\n \"--replace-deps\",\n \"--replace-tests\",\n \"--unset\",\n \"--clear-*\",\n].join(\", \");\n\nconst UPDATE_OPTION_TO_ITEM_KEY: Partial<\n Record<keyof UpdateCommandOptions, string>\n> = {\n title: \"title\",\n description: \"description\",\n body: \"body\",\n status: \"status\",\n closeReason: \"close_reason\",\n priority: \"priority\",\n type: \"type\",\n deadline: \"deadline\",\n estimatedMinutes: \"estimated_minutes\",\n acceptanceCriteria: \"acceptance_criteria\",\n definitionOfReady: \"definition_of_ready\",\n order: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n whyNow: \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blockedBy: \"blocked_by\",\n blockedReason: \"blocked_reason\",\n unblockNote: \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n reproSteps: \"repro_steps\",\n resolution: \"resolution\",\n expectedResult: \"expected_result\",\n actualResult: \"actual_result\",\n affectedVersion: \"affected_version\",\n fixedVersion: \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customerImpact: \"customer_impact\",\n};\n\ninterface CollectionMutationPlanDefinition {\n field: string;\n addKey: keyof UpdateCommandOptions;\n removeKey?: keyof UpdateCommandOptions;\n clearKey: keyof UpdateCommandOptions;\n replaceKey?: keyof UpdateCommandOptions;\n}\n\nconst COLLECTION_MUTATION_PLAN_DEFINITIONS: CollectionMutationPlanDefinition[] =\n [\n {\n field: \"dependencies\",\n addKey: \"dep\",\n removeKey: \"depRemove\",\n clearKey: \"clearDeps\",\n replaceKey: \"replaceDeps\",\n },\n {\n field: \"comments\",\n addKey: \"comment\",\n clearKey: \"clearComments\",\n },\n {\n field: \"notes\",\n addKey: \"note\",\n clearKey: \"clearNotes\",\n },\n {\n field: \"learnings\",\n addKey: \"learning\",\n clearKey: \"clearLearnings\",\n },\n {\n field: \"files\",\n addKey: \"file\",\n clearKey: \"clearFiles\",\n },\n {\n field: \"tests\",\n addKey: \"test\",\n clearKey: \"clearTests\",\n replaceKey: \"replaceTests\",\n },\n {\n field: \"docs\",\n addKey: \"doc\",\n clearKey: \"clearDocs\",\n },\n {\n field: \"reminders\",\n addKey: \"reminder\",\n clearKey: \"clearReminders\",\n },\n {\n field: \"events\",\n addKey: \"event\",\n clearKey: \"clearEvents\",\n },\n {\n field: \"type_options\",\n addKey: \"typeOption\",\n clearKey: \"clearTypeOptions\",\n },\n ];\n\nconst UNSET_FIELD_ALIASES: Record<string, string> = {\n close_reason: \"close_reason\",\n \"close-reason\": \"close_reason\",\n deadline: \"deadline\",\n estimate: \"estimated_minutes\",\n estimated_minutes: \"estimated_minutes\",\n \"estimated-minutes\": \"estimated_minutes\",\n acceptance_criteria: \"acceptance_criteria\",\n \"acceptance-criteria\": \"acceptance_criteria\",\n ac: \"acceptance_criteria\",\n definition_of_ready: \"definition_of_ready\",\n \"definition-of-ready\": \"definition_of_ready\",\n order: \"order\",\n rank: \"order\",\n goal: \"goal\",\n objective: \"objective\",\n value: \"value\",\n impact: \"impact\",\n outcome: \"outcome\",\n why_now: \"why_now\",\n \"why-now\": \"why_now\",\n assignee: \"assignee\",\n parent: \"parent\",\n reviewer: \"reviewer\",\n risk: \"risk\",\n confidence: \"confidence\",\n sprint: \"sprint\",\n release: \"release\",\n blocked_by: \"blocked_by\",\n \"blocked-by\": \"blocked_by\",\n blocked_reason: \"blocked_reason\",\n \"blocked-reason\": \"blocked_reason\",\n unblock_note: \"unblock_note\",\n \"unblock-note\": \"unblock_note\",\n reporter: \"reporter\",\n severity: \"severity\",\n environment: \"environment\",\n repro_steps: \"repro_steps\",\n \"repro-steps\": \"repro_steps\",\n resolution: \"resolution\",\n expected_result: \"expected_result\",\n \"expected-result\": \"expected_result\",\n actual_result: \"actual_result\",\n \"actual-result\": \"actual_result\",\n affected_version: \"affected_version\",\n \"affected-version\": \"affected_version\",\n fixed_version: \"fixed_version\",\n \"fixed-version\": \"fixed_version\",\n component: \"component\",\n regression: \"regression\",\n customer_impact: \"customer_impact\",\n \"customer-impact\": \"customer_impact\",\n type_options: \"type_options\",\n \"type-options\": \"type_options\",\n tags: \"tags\",\n};\n\ninterface UpdateManyCheckpoint {\n schema_version: number;\n id: string;\n created_at: string;\n author: string;\n status_filter: string | null;\n list_filters: Record<string, unknown>;\n update_options: Record<string, unknown>;\n items: MutationCheckpointItem[];\n}\n\n/** Documents the update many command options payload exchanged by command, SDK, and package integrations. */\nexport interface UpdateManyCommandOptions {\n /** Lifecycle state reported for status. */\n status?: string;\n /** Value that configures or reports list for this contract. */\n list: ListOptions;\n /** Value that configures or reports update for this contract. */\n update: UpdateCommandOptions;\n /** Value that configures or reports dry run for this contract. */\n dryRun?: boolean;\n /** Value that configures or reports rollback for this contract. */\n rollback?: string;\n /** Value that configures or reports checkpoint for this contract. */\n checkpoint?: boolean;\n}\n\ninterface PlannedChange {\n field: string;\n before: unknown;\n after: unknown;\n}\n\ninterface PlannedItemDiff {\n id: string;\n changes: PlannedChange[];\n warnings?: string[];\n}\n\ninterface UpdateManyApplyResultRow {\n id: string;\n status: \"updated\" | \"failed\" | \"skipped\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\ninterface UpdateManyRollbackResultRow {\n id: string;\n status: \"restored\" | \"failed\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\n/** Documents the update many result payload exchanged by command, SDK, and package integrations. */\nexport interface UpdateManyResult {\n /** Value that configures or reports mode for this contract. */\n mode: \"dry_run\" | \"apply\" | \"rollback\";\n /** Number of matched entries represented by this result. */\n matched_count: number;\n /** Value that configures or reports dry run for this contract. */\n dry_run: boolean;\n /** Value that configures or reports filters for this contract. */\n filters?: Record<string, unknown>;\n /** Inputs that customize the planned update operation. */\n planned_update_options?: Record<string, unknown>;\n /** Value that configures or reports item plans for this contract. */\n item_plans?: PlannedItemDiff[];\n /** Value that configures or reports checkpoint for this contract. */\n checkpoint?: {\n id: string;\n created_at: string;\n path: string;\n rollback_command: string;\n };\n /** Number of updated entries represented by this result. */\n updated_count?: number;\n /** Number of skipped entries represented by this result. */\n skipped_count?: number;\n /** Number of failed entries represented by this result. */\n failed_count?: number;\n /** Number of restored entries represented by this result. */\n restored_count?: number;\n /** Value that configures or reports rollback checkpoint id for this contract. */\n rollback_checkpoint_id?: string;\n /** Value that configures or reports rows for this contract. */\n rows?: UpdateManyApplyResultRow[] | UpdateManyRollbackResultRow[];\n /** Value that configures or reports ids for this contract. */\n ids: string[];\n /** Explicitly requested --ids values that matched no tracked item. */\n unmatched_ids?: string[];\n /** Number of explicitly requested --ids values that matched no tracked item. */\n unmatched_count?: number;\n}\n\n/** Removes execution-only options from the mutation summary persisted in checkpoints. */\nconst sanitizeUpdateOptionsForSummary = (\n options: UpdateCommandOptions,\n): Record<string, unknown> => {\n const summary: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(options) as Array<\n [keyof UpdateCommandOptions, unknown]\n >) {\n if (NON_MUTATION_UPDATE_OPTION_KEYS.has(key)) {\n continue;\n }\n if (value === undefined) {\n continue;\n }\n summary[key] = value;\n }\n return summary;\n};\n\n/** Reports whether an update-many request contains at least one mutation input. */\nconst hasAnyUpdateMutationInput = (options: UpdateCommandOptions): boolean => {\n return Object.keys(sanitizeUpdateOptionsForSummary(options)).length > 0;\n};\n\ntype PreviewValueNormalizer = (value: unknown) => unknown;\n\n/** Trims string preview values while preserving non-string inputs. */\nconst trimPreviewValue: PreviewValueNormalizer = (value) =>\n typeof value === \"string\" ? value.trim() : value;\n/** Converts integer-like preview values to their storage representation. */\nconst normalizeIntegerPreviewValue: PreviewValueNormalizer = (value) => {\n const trimmed = String(value).trim();\n const parsed = Number(trimmed);\n return Number.isInteger(parsed) ? parsed : trimmed;\n};\n/** Converts finite numeric preview values to their storage representation. */\nconst normalizeNumericPreviewValue: PreviewValueNormalizer = (value) => {\n const trimmed = String(value).trim();\n const parsed = Number(trimmed);\n return Number.isFinite(parsed) ? parsed : trimmed;\n};\n/** Converts supported regression tokens to their boolean storage representation. */\nconst normalizeRegressionPreviewValue: PreviewValueNormalizer = (value) => {\n const normalized = String(value).trim().toLowerCase();\n const parsed = new Map<string, boolean>([\n [\"true\", true],\n [\"1\", true],\n [\"false\", false],\n [\"0\", false],\n ]).get(normalized);\n return parsed ?? trimPreviewValue(value);\n};\n\nconst PREVIEW_VALUE_NORMALIZERS: Partial<\n Record<keyof UpdateCommandOptions, PreviewValueNormalizer>\n> = {\n priority: normalizeIntegerPreviewValue,\n estimatedMinutes: normalizeNumericPreviewValue,\n order: normalizeNumericPreviewValue,\n rank: normalizeNumericPreviewValue,\n regression: normalizeRegressionPreviewValue,\n};\n\n/** Normalizes a CLI mutation value to the storage-shaped value used by previews. */\nconst toComparablePreviewValue = (\n optionKey: keyof UpdateCommandOptions,\n value: unknown,\n): unknown => {\n if (value === undefined) {\n return undefined;\n }\n return (PREVIEW_VALUE_NORMALIZERS[optionKey] ?? trimPreviewValue)(value);\n};\n\n/** Resolves user-facing unset aliases to stored metadata keys. */\nconst normalizeUnsetField = (rawField: string): string => {\n const normalized = rawField.trim().toLowerCase().replaceAll(\"-\", \"_\");\n return UNSET_FIELD_ALIASES[normalized] ?? normalized;\n};\n\n/** Compares preview values using the canonical stable serialization contract. */\nconst areValuesEqual = (left: unknown, right: unknown): boolean => {\n return stableValueEquals(left, right);\n};\n\n/** Supplies the storage-shaped empty value for an absent collection field. */\nconst normalizeCollectionBeforeValue = (\n field: string,\n value: unknown,\n): unknown => {\n if (value !== undefined) {\n return value;\n }\n if (field === \"type_options\") {\n return {};\n }\n return [];\n};\n\n/** Counts entries in list and type-option collection values. */\nconst collectionValueCount = (field: string, value: unknown): number => {\n if (Array.isArray(value)) {\n return value.length;\n }\n if (field === \"type_options\" && value && typeof value === \"object\") {\n return Object.keys(value as Record<string, unknown>).length;\n }\n return 0;\n};\n\n/** Resolves the dominant collection mutation using apply-path precedence. */\nconst resolveCollectionMutationOperation = (params: {\n replace: boolean;\n clear: boolean;\n removeCount: number;\n}): string => {\n if (params.replace) {\n return \"replace\";\n }\n if (params.clear) {\n return \"clear_or_reset\";\n }\n return params.removeCount > 0 ? \"merge_remove\" : \"append\";\n};\n\n/** Reads an optional definition key without indexing through undefined. */\nconst readOptionalUpdateValue = (\n update: UpdateCommandOptions,\n key: keyof UpdateCommandOptions | undefined,\n): unknown => (key === undefined ? undefined : update[key]);\n\n/** Counts array-shaped mutation inputs while treating other shapes as empty. */\nconst updateArrayValueCount = (value: unknown): number =>\n Array.isArray(value) ? value.length : 0;\n\n/** Builds one collection plan when its definition has an active mutation. */\nconst buildCollectionMutationPlan = (\n definition: CollectionMutationPlanDefinition,\n row: Record<string, unknown>,\n update: UpdateCommandOptions,\n): PlannedChange | undefined => {\n const addValues = update[definition.addKey];\n const removeValues = readOptionalUpdateValue(update, definition.removeKey);\n const addCount = updateArrayValueCount(addValues);\n const removeCount = updateArrayValueCount(removeValues);\n const clear = update[definition.clearKey] === true;\n const replace =\n readOptionalUpdateValue(update, definition.replaceKey) === true;\n if (![clear, replace, addCount > 0, removeCount > 0].includes(true)) {\n return undefined;\n }\n const before = normalizeCollectionBeforeValue(\n definition.field,\n row[definition.field],\n );\n return {\n field: definition.field,\n before,\n after: {\n operation: resolveCollectionMutationOperation({\n replace,\n clear,\n removeCount,\n }),\n clear,\n replace,\n add_count: addCount,\n remove_count: removeCount,\n before_count: collectionValueCount(definition.field, before),\n },\n };\n};\n\n/** Builds collection mutation previews for every active collection option. */\nconst buildCollectionMutationPlans = (\n row: Record<string, unknown>,\n update: UpdateCommandOptions,\n): PlannedChange[] => {\n const changes: PlannedChange[] = [];\n for (const definition of COLLECTION_MUTATION_PLAN_DEFINITIONS) {\n const plan = buildCollectionMutationPlan(definition, row, update);\n if (plan !== undefined) {\n changes.push(plan);\n }\n }\n return changes;\n};\n\n/** Keeps only string tags from an existing storage value. */\nconst normalizeExistingTags = (value: unknown): string[] => {\n if (!Array.isArray(value)) {\n return [];\n }\n return value.filter((tag): tag is string => typeof tag === \"string\");\n};\n\n// Tags support three mutation modes that compose: --tags replaces, --add-tags\n// extends, --remove-tags prunes. Replicate runUpdate's resolution order so the\n// dry-run preview and the apply-mode actionable detection both account for\n// additive/subtractive tag mutations (a --add-tags-only update must NOT be\n// treated as a no-op skip).\nconst buildTagMutationPlan = (\n row: Record<string, unknown>,\n update: UpdateCommandOptions,\n): PlannedChange | undefined => {\n if (\n ![\n update.tags !== undefined,\n updateArrayValueCount(update.addTags) > 0,\n updateArrayValueCount(update.removeTags) > 0,\n ].includes(true)\n ) {\n return undefined;\n }\n const existing = normalizeExistingTags(row.tags);\n const baseTags =\n update.tags === undefined ? existing : parseTags(update.tags);\n const withAdditions = mergeAdditiveTags(baseTags, update.addTags);\n const after = applyTagRemovals(withAdditions, update.removeTags)\n .slice()\n .sort((a, b) => a.localeCompare(b));\n const before = existing.slice().sort((a, b) => a.localeCompare(b));\n if (areValuesEqual(before, after)) {\n return undefined;\n }\n return { field: \"tags\", before: existing, after };\n};\n\n// Acceptance criteria support replace (--ac) plus additive --add-ac/--remove-ac\n// (GH-612). Replicate runUpdate's resolution order so dry-run previews and\n// apply-mode actionable detection account for additive criterion mutations (an\n// --add-ac-only bulk update must NOT be treated as a no-op skip).\nconst buildAcceptanceCriteriaMutationPlan = (\n row: Record<string, unknown>,\n update: UpdateCommandOptions,\n): { change?: PlannedChange; warnings: string[] } => {\n const before = row.acceptance_criteria;\n const base =\n update.acceptanceCriteria === undefined\n ? before\n : String(update.acceptanceCriteria).trim();\n const mutation = applyAcceptanceCriteriaMutations(\n splitAcceptanceCriteria(base),\n update.addAc,\n update.removeAc,\n );\n const warnings = mutation.unmatchedRemovals.map(\n (criterion) => `remove_ac_unmatched:${criterion}`,\n );\n const after = mutation.criteria.join(\"; \");\n if (areValuesEqual(before, after) || (before === undefined && after === \"\")) {\n return { warnings };\n }\n return {\n change: { field: \"acceptance_criteria\", before, after },\n warnings,\n };\n};\n\n/** Adds changed scalar options to a planned item diff. */\nconst appendScalarMutationPlans = (\n changes: PlannedChange[],\n row: Record<string, unknown>,\n update: UpdateCommandOptions,\n): void => {\n for (const [optionKey, itemKey] of Object.entries(\n UPDATE_OPTION_TO_ITEM_KEY,\n ) as Array<[keyof UpdateCommandOptions, string]>) {\n const candidate = update[optionKey];\n if (candidate === undefined) {\n continue;\n }\n const before = row[itemKey];\n const after = toComparablePreviewValue(optionKey, candidate);\n if (!areValuesEqual(before, after)) {\n changes.push({ field: itemKey, before, after });\n }\n }\n};\n\n/** Adds changed runtime-schema fields to a planned item diff. */\nconst appendRuntimeFieldMutationPlans = (\n changes: PlannedChange[],\n row: Record<string, unknown>,\n update: UpdateCommandOptions,\n runtimeFieldRegistry: RuntimeFieldRegistry,\n): void => {\n const runtimeFieldUpdates = collectRuntimeUpdateFieldValues(\n update as Record<string, unknown>,\n runtimeFieldRegistry,\n [\"update_many\"],\n );\n for (const [field, after] of Object.entries(runtimeFieldUpdates)) {\n const before = row[field];\n if (!areValuesEqual(before, after)) {\n changes.push({ field, before, after });\n }\n }\n};\n\n/** Adds present fields requested through unset options to a planned item diff. */\nconst appendUnsetMutationPlans = (\n changes: PlannedChange[],\n row: Record<string, unknown>,\n unset: string[] | undefined,\n): void => {\n for (const rawUnsetField of unset ?? []) {\n const field = normalizeUnsetField(rawUnsetField);\n const before = row[field];\n if (before !== undefined) {\n changes.push({ field, before, after: null });\n }\n }\n};\n\n/** Builds the complete storage-shaped mutation preview for one item. */\nconst buildPlannedItemDiff = (\n item: ListedItem,\n runtimeFieldRegistry: RuntimeFieldRegistry,\n update: UpdateCommandOptions = {},\n): PlannedItemDiff => {\n const row = toItemRecord(item);\n const changes: PlannedChange[] = [];\n const warnings: string[] = [];\n const tagPlan = buildTagMutationPlan(row, update);\n if (tagPlan) {\n changes.push(tagPlan);\n }\n appendScalarMutationPlans(changes, row, update);\n if (\n updateArrayValueCount(update.addAc) > 0 ||\n updateArrayValueCount(update.removeAc) > 0\n ) {\n const composed = buildAcceptanceCriteriaMutationPlan(row, update);\n const withoutAc = changes.filter(\n (change) => change.field !== \"acceptance_criteria\",\n );\n changes.splice(0, changes.length, ...withoutAc);\n if (composed.change !== undefined) {\n changes.push(composed.change);\n }\n warnings.push(...composed.warnings);\n }\n changes.push(...buildCollectionMutationPlans(row, update));\n appendRuntimeFieldMutationPlans(changes, row, update, runtimeFieldRegistry);\n appendUnsetMutationPlans(changes, row, update.unset);\n\n return {\n id: item.id,\n changes,\n ...(warnings.length > 0 ? { warnings } : {}),\n };\n};\n\n/** Normalizes an optional list status against the runtime schema. */\nconst normalizeStatusFilter = (\n value: string | undefined,\n statusRegistry: RuntimeStatusRegistry,\n): ItemStatus | undefined => {\n if (value === undefined) {\n return undefined;\n }\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map(\n (definition) => definition.id,\n );\n throw new PmCliError(\n `Invalid --filter-status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n};\n\n/** Rejects an explicitly blank bulk ID filter before loading the corpus. */\nconst rejectBlankIdsFilter = (list: ListOptions | undefined): void => {\n if (list?.ids != null && String(list.ids).trim().length === 0) {\n throw new PmCliError(\n \"--ids requires at least one non-empty item ID\",\n EXIT_CODE.USAGE,\n );\n }\n};\n\n// GH-256: validate planned scalar enum/format fields up front so a `--dry-run`\n// preview rejects globally-invalid values exactly as apply would (true\n// preview==apply parity), and so apply itself fails fast before creating an\n// orphan checkpoint. Only VALUE/ENUM/FORMAT correctness is checked here — these\n// are invalid regardless of the matched item. Per-item governance and\n// workflow-transition rules stay in the apply path (runUpdate). Each field is\n// validated only when the caller actually provided it, reusing the exact same\n// resolvers and error messages runUpdate raises so single/bulk/dry-run stay\n// consistent.\ninterface PlannedUpdateValidationContext {\n update: UpdateCommandOptions;\n settings: PmSettings;\n statusRegistry: RuntimeStatusRegistry;\n pmRoot: string;\n}\n\ntype PlannedUpdateValidator = (context: PlannedUpdateValidationContext) => void;\n\nconst PLANNED_UPDATE_VALIDATORS: PlannedUpdateValidator[] = [\n ({ update }) => {\n if (update.priority !== undefined) {\n resolvePriority(update.priority);\n }\n },\n ({ update, settings, pmRoot }) => {\n if (update.type === undefined) {\n return;\n }\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n if (!resolveTypeName(update.type, typeRegistry)) {\n throw new PmCliError(\n buildInvalidTypeError(\n update.type,\n typeRegistry.types,\n resolveItemTypesFilePath(pmRoot, settings.schema),\n ),\n EXIT_CODE.USAGE,\n );\n }\n },\n ({ update, statusRegistry }) => {\n if (\n update.status !== undefined &&\n !normalizeStatusInput(update.status, statusRegistry)\n ) {\n const allowedStatuses = statusRegistry.definitions.map(\n (definition) => definition.id,\n );\n throw new PmCliError(\n `Invalid --status value \"${update.status}\". Allowed: ${allowedStatuses.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n },\n ({ update }) => {\n if (update.deadline !== undefined) {\n resolveIsoOrRelative(update.deadline, new Date(), \"deadline\");\n }\n },\n ({ update }) => {\n if (update.estimatedMinutes !== undefined) {\n parseOptionalNonNegativeInteger(\n update.estimatedMinutes,\n \"estimated-minutes\",\n );\n }\n },\n];\n\n/** Validates globally invalid mutation values before preview or checkpoint work. */\nconst assertPlannedUpdateValuesValid = (\n update: UpdateCommandOptions,\n settings: PmSettings,\n statusRegistry: RuntimeStatusRegistry,\n pmRoot: string,\n): void => {\n const context = { update, settings, statusRegistry, pmRoot };\n for (const validate of PLANNED_UPDATE_VALIDATORS) {\n validate(context);\n }\n};\n\n/** Restores every item captured by an update-many checkpoint. */\nconst runUpdateManyRollback = async (params: {\n pmRoot: string;\n rollbackId: string;\n options: UpdateManyCommandOptions;\n global: GlobalOptions;\n}): Promise<UpdateManyResult> => {\n const checkpoint = await loadMutationCheckpoint(\n params.pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n params.rollbackId,\n UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n );\n const restoreMessage =\n params.options.update?.message ??\n `Rollback update-many checkpoint ${checkpoint.id}`;\n const rollback = await restoreCheckpointItems(\n checkpoint.items,\n (id, targetUpdatedAt) =>\n runRestore(\n id,\n targetUpdatedAt,\n {\n author: params.options.update?.author,\n message: restoreMessage,\n force: params.options.update?.force ?? true,\n },\n params.global,\n ),\n );\n return {\n mode: \"rollback\",\n matched_count: checkpoint.items.length,\n dry_run: false,\n rollback_checkpoint_id: checkpoint.id,\n checkpoint: {\n id: checkpoint.id,\n created_at: checkpoint.created_at,\n path: checkpoint.path,\n rollback_command: `pm update-many --rollback ${checkpoint.id}`,\n },\n restored_count: rollback.restored_ids.length,\n failed_count: rollback.failed_count,\n rows: rollback.rows,\n ids: rollback.restored_ids,\n };\n};\n\n/** Persists an apply checkpoint and returns its user-facing descriptor. */\nconst writeUpdateManyCheckpoint = async (params: {\n pmRoot: string;\n checkpointId: string;\n nowValue: string;\n options: UpdateManyCommandOptions;\n statusFilter: string | undefined;\n filters: Record<string, unknown>;\n updateSummary: Record<string, unknown>;\n checkpointItems: MutationCheckpointItem[];\n}): Promise<UpdateManyResult[\"checkpoint\"]> => {\n const checkpointPayload: UpdateManyCheckpoint = {\n schema_version: UPDATE_MANY_CHECKPOINT_SCHEMA_VERSION,\n id: params.checkpointId,\n created_at: params.nowValue,\n author: resolveAuthor(params.options.update?.author, \"unknown\"),\n status_filter: params.statusFilter ?? null,\n list_filters: params.filters,\n update_options: params.updateSummary,\n items: params.checkpointItems,\n };\n const checkpointPath = await writeMutationCheckpoint(\n params.pmRoot,\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n params.checkpointId,\n checkpointPayload,\n );\n return {\n id: params.checkpointId,\n created_at: params.nowValue,\n path: checkpointPath,\n rollback_command: `pm update-many --rollback ${params.checkpointId}`,\n };\n};\n\ninterface UpdateManyRuntimeContext {\n pmRoot: string;\n settings: PmSettings;\n statusRegistry: RuntimeStatusRegistry;\n runtimeFieldRegistry: RuntimeFieldRegistry;\n}\n\ninterface UpdateManyPlan {\n listed: ListFullResult;\n planned: PlannedItemDiff[];\n actionable: PlannedItemDiff[];\n updateSummary: Record<string, unknown>;\n statusFilter: ItemStatus | undefined;\n unmatchedIds: string[] | undefined;\n}\n\n// GH-596: an explicit --ids request naming IDs that do not exist must stay\n// machine-detectable without client-side set differencing. The requested list\n// is re-derived here (same CSV split as the list filter) and compared against\n// the unfiltered storage corpus so pagination and additional query filters do\n// not misclassify existing items as nonexistent.\nconst collectUnmatchedRequestedIds = (\n rawIds: unknown,\n existingItems: ReadonlyArray<{ id: string }>,\n): string[] | undefined => {\n if (rawIds == null) {\n return undefined;\n }\n const requested = [\n ...new Set(\n String(rawIds)\n .split(\",\")\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0),\n ),\n ];\n const existing = new Set(existingItems.map((item) => item.id));\n return requested.filter((id) => !existing.has(id));\n};\n\n/** Builds the shared unmatched-id envelope fields for one prepared plan. */\nconst buildUnmatchedIdFields = (\n plan: UpdateManyPlan,\n): Pick<UpdateManyResult, \"unmatched_ids\" | \"unmatched_count\"> =>\n plan.unmatchedIds === undefined\n ? {}\n : {\n unmatched_ids: plan.unmatchedIds,\n unmatched_count: plan.unmatchedIds.length,\n };\n\n/** Loads tracker settings and runtime registries for update-many execution. */\nconst loadUpdateManyRuntimeContext = async (\n global: GlobalOptions,\n): Promise<UpdateManyRuntimeContext> => {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n return {\n pmRoot,\n settings,\n statusRegistry: resolveRuntimeStatusRegistry(settings.schema),\n runtimeFieldRegistry: resolveRuntimeFieldRegistry(settings.schema),\n };\n};\n\n/** Validates rollback exclusivity before restoring a checkpoint. */\nconst runRequestedUpdateManyRollback = (params: {\n runtime: UpdateManyRuntimeContext;\n rollbackId: string;\n options: UpdateManyCommandOptions;\n global: GlobalOptions;\n updateSummary: Record<string, unknown>;\n}): Promise<UpdateManyResult> => {\n if (params.options.dryRun === true) {\n throw new PmCliError(\n \"--dry-run cannot be combined with --rollback\",\n EXIT_CODE.USAGE,\n );\n }\n if (hasListFilters(params.options.list, params.options.status)) {\n throw new PmCliError(\n \"Rollback mode does not accept filter options\",\n EXIT_CODE.USAGE,\n );\n }\n if (Object.keys(params.updateSummary).length > 0) {\n throw new PmCliError(\n \"Rollback mode does not accept update mutation flags\",\n EXIT_CODE.USAGE,\n );\n }\n return runUpdateManyRollback({\n pmRoot: params.runtime.pmRoot,\n rollbackId: params.rollbackId,\n options: params.options,\n global: params.global,\n });\n};\n\n/** Loads complete matching rows and derives their mutation previews. */\nconst buildUpdateManyPlan = async (params: {\n options: UpdateManyCommandOptions;\n global: GlobalOptions;\n runtime: UpdateManyRuntimeContext;\n updateSummary: Record<string, unknown>;\n}): Promise<UpdateManyPlan> => {\n const statusFilter = normalizeStatusFilter(\n params.options.status,\n params.runtime.statusRegistry,\n );\n const listed = await runList(\n statusFilter,\n {\n ...params.options.list,\n compact: undefined,\n brief: undefined,\n fields: undefined,\n includeBody: true,\n full: true,\n },\n params.global,\n );\n const planned = listed.items.map((item) =>\n buildPlannedItemDiff(\n item,\n params.runtime.runtimeFieldRegistry,\n params.options.update,\n ),\n );\n const existenceItems =\n params.options.list?.ids == null\n ? []\n : (\n await runList(\n undefined,\n {\n ids: params.options.list.ids,\n noTruncate: true,\n full: true,\n },\n params.global,\n )\n ).items;\n return {\n listed,\n planned,\n actionable: planned.filter((row) => row.changes.length > 0),\n updateSummary: params.updateSummary,\n statusFilter,\n unmatchedIds: collectUnmatchedRequestedIds(\n params.options.list?.ids,\n existenceItems,\n ),\n };\n};\n\n/** Builds the non-mutating preview response for a prepared update-many plan. */\nconst buildUpdateManyDryRunResult = (\n plan: UpdateManyPlan,\n): UpdateManyResult => ({\n mode: \"dry_run\",\n matched_count: plan.listed.items.length,\n dry_run: true,\n filters: plan.listed.filters,\n planned_update_options: plan.updateSummary,\n item_plans: plan.planned,\n ids: [],\n ...buildUnmatchedIdFields(plan),\n});\n\n/** Builds the apply response for a plan whose rows are all already current. */\nconst buildUpdateManyNoopResult = (plan: UpdateManyPlan): UpdateManyResult => ({\n mode: \"apply\",\n matched_count: plan.listed.items.length,\n dry_run: false,\n filters: plan.listed.filters,\n planned_update_options: plan.updateSummary,\n updated_count: 0,\n skipped_count: plan.listed.items.length,\n failed_count: 0,\n rows: plan.planned.map((row) => ({\n id: row.id,\n status: \"skipped\" as const,\n ...(row.warnings ? { warnings: row.warnings } : {}),\n })),\n ids: [],\n ...buildUnmatchedIdFields(plan),\n});\n\n/** Applies planned item updates independently while preserving per-row failures. */\nconst applyUpdateManyRows = async (params: {\n items: ListedItem[];\n plans: PlannedItemDiff[];\n options: UpdateManyCommandOptions;\n global: GlobalOptions;\n checkpointId: string;\n}): Promise<{ rows: UpdateManyApplyResultRow[]; updatedIds: string[] }> => {\n const rows: UpdateManyApplyResultRow[] = [];\n const updatedIds: string[] = [];\n const updateMessage =\n params.options.update.message ?? `update-many apply ${params.checkpointId}`;\n const plannedById = new Map(params.plans.map((row) => [row.id, row]));\n const actionableById = new Set(\n params.plans.filter((row) => row.changes.length > 0).map((row) => row.id),\n );\n for (const item of params.items) {\n if (!actionableById.has(item.id)) {\n const warnings = plannedById.get(item.id)?.warnings;\n rows.push({\n id: item.id,\n status: \"skipped\",\n ...(warnings ? { warnings } : {}),\n });\n continue;\n }\n try {\n const result = await runUpdate(\n item.id,\n {\n ...params.options.update,\n message: updateMessage,\n runtimeFieldCommands: [\"update_many\"],\n },\n params.global,\n );\n rows.push({\n id: item.id,\n status: \"updated\",\n changed_fields: result.changed_fields,\n warnings: result.warnings,\n });\n updatedIds.push(item.id);\n } catch (error: unknown) {\n rows.push({\n id: item.id,\n status: \"failed\",\n error: toErrorMessage(error),\n });\n }\n }\n return { rows, updatedIds };\n};\n\n/** Applies a prepared plan, checkpointing actionable rows when requested. */\nconst applyUpdateManyPlan = async (params: {\n runtime: UpdateManyRuntimeContext;\n options: UpdateManyCommandOptions;\n global: GlobalOptions;\n plan: UpdateManyPlan;\n}): Promise<UpdateManyResult> => {\n if (params.plan.actionable.length === 0) {\n return buildUpdateManyNoopResult(params.plan);\n }\n const nowValue = nowIso();\n const checkpointId = createCheckpointId(\n UPDATE_MANY_CHECKPOINT_SUBDIR,\n nowValue,\n );\n const actionableById = new Set(params.plan.actionable.map((row) => row.id));\n const checkpointItems = params.plan.listed.items\n .filter((item) => actionableById.has(item.id))\n .map((item) => ({ id: item.id, target_updated_at: item.updated_at }));\n const checkpointInfo =\n params.options.checkpoint === false\n ? undefined\n : await writeUpdateManyCheckpoint({\n pmRoot: params.runtime.pmRoot,\n checkpointId,\n nowValue,\n options: params.options,\n statusFilter: params.plan.statusFilter,\n filters: params.plan.listed.filters,\n updateSummary: params.plan.updateSummary,\n checkpointItems,\n });\n const applied = await applyUpdateManyRows({\n items: params.plan.listed.items,\n plans: params.plan.planned,\n options: params.options,\n global: params.global,\n checkpointId,\n });\n /** Counts apply rows with one terminal status. */\n const countStatus = (status: UpdateManyApplyResultRow[\"status\"]): number =>\n applied.rows.filter((row) => row.status === status).length;\n return {\n mode: \"apply\",\n matched_count: params.plan.listed.items.length,\n dry_run: false,\n filters: params.plan.listed.filters,\n planned_update_options: params.plan.updateSummary,\n ...(checkpointInfo ? { checkpoint: checkpointInfo } : {}),\n updated_count: countStatus(\"updated\"),\n skipped_count: countStatus(\"skipped\"),\n failed_count: countStatus(\"failed\"),\n rows: applied.rows,\n ids: applied.updatedIds,\n ...buildUnmatchedIdFields(params.plan),\n };\n};\n\n/** Implements run update many for the public runtime surface of this module. */\nexport const runUpdateMany = async (\n options: UpdateManyCommandOptions,\n global: GlobalOptions,\n): Promise<UpdateManyResult> => {\n const runtime = await loadUpdateManyRuntimeContext(global);\n const rollbackId =\n typeof options.rollback === \"string\" ? options.rollback : undefined;\n const updateSummary = sanitizeUpdateOptionsForSummary(options.update);\n rejectBlankIdsFilter(options.list);\n if (rollbackId !== undefined) {\n return runRequestedUpdateManyRollback({\n runtime,\n rollbackId,\n options,\n global,\n updateSummary,\n });\n }\n if (!hasAnyUpdateMutationInput(options.update)) {\n throw new PmCliError(\n `No update-many mutation flags provided. Add at least one mutation flag (for example: ${UPDATE_MANY_MUTATION_FLAG_GUIDANCE}).`,\n EXIT_CODE.USAGE,\n );\n }\n assertPlannedUpdateValuesValid(\n options.update,\n runtime.settings,\n runtime.statusRegistry,\n runtime.pmRoot,\n );\n const plan = await buildUpdateManyPlan({\n options,\n global,\n runtime,\n updateSummary,\n });\n return options.dryRun === true\n ? buildUpdateManyDryRunResult(plan)\n : applyUpdateManyPlan({ runtime, options, global, plan });\n};\n\n/** Public contract for test only update many command, shared by SDK and presentation-layer consumers. */\nexport const _testOnlyUpdateManyCommand = {\n assertPlannedUpdateValuesValid,\n buildCollectionMutationPlans,\n buildPlannedItemDiff,\n buildTagMutationPlan,\n collectionValueCount,\n hasAnyUpdateMutationInput,\n hasListFilters,\n normalizeStatusFilter,\n normalizeCollectionBeforeValue,\n normalizeExistingTags,\n normalizeUnsetField,\n rejectBlankIdsFilter,\n sanitizeUpdateOptionsForSummary,\n toComparablePreviewValue,\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,IAAM,wCAAwC;AAC9C,IAAM,gCAAgC;AAEtC,IAAM,kCAAkC,oBAAI,IAAiB;EAC3D;EACA;EACA;EACA;EACA;CACD;AAED,IAAM,qCAAqC;EACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK,IAAI;AAEX,IAAM,4BAEF;EACF,OAAO;EACP,aAAa;EACb,MAAM;EACN,QAAQ;EACR,aAAa;EACb,UAAU;EACV,MAAM;EACN,UAAU;EACV,kBAAkB;EAClB,oBAAoB;EACpB,mBAAmB;EACnB,OAAO;EACP,MAAM;EACN,WAAW;EACX,OAAO;EACP,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,UAAU;EACV,QAAQ;EACR,UAAU;EACV,MAAM;EACN,YAAY;EACZ,QAAQ;EACR,SAAS;EACT,WAAW;EACX,eAAe;EACf,aAAa;EACb,UAAU;EACV,UAAU;EACV,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,gBAAgB;EAChB,cAAc;EACd,iBAAiB;EACjB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,gBAAgB;;AAWlB,IAAM,uCACJ;EACE;IACE,OAAO;IACP,QAAQ;IACR,WAAW;IACX,UAAU;IACV,YAAY;;EAEd;IACE,OAAO;IACP,QAAQ;IACR,UAAU;;EAEZ;IACE,OAAO;IACP,QAAQ;IACR,UAAU;;EAEZ;IACE,OAAO;IACP,QAAQ;IACR,UAA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BAAoB,EAAE,SAAS,SAAS,QAAAA,SAAQ,KAAI,CAAE;AAC5D;AAGO,IAAM,6BAA6B;EACxC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;",
6
+ "names": ["global"]
7
+ }
@@ -1,8 +1,8 @@
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]="c1a718f6-bc42-53b0-a337-f777e26bd386")}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]="7ea426c5-e4fc-52f3-bdd8-8e99c3e2a798")}catch(e){}}();
3
3
  import {
4
4
  createStdinTokenResolver
5
- } from "./chunk-SVAWG7EE.js";
5
+ } from "./chunk-J4FBIFU6.js";
6
6
  import {
7
7
  resolveAuthor
8
8
  } from "./chunk-CUFW7ITY.js";
@@ -10,14 +10,14 @@ import {
10
10
  mutateItem,
11
11
  readSettings,
12
12
  toItemRecord
13
- } from "./chunk-QFG4MB7P.js";
13
+ } from "./chunk-POG76WWZ.js";
14
14
  import {
15
15
  EXIT_CODE,
16
16
  PmCliError,
17
17
  getSettingsPath,
18
18
  pathExists,
19
19
  resolvePmRoot
20
- } from "./chunk-D35WYXWC.js";
20
+ } from "./chunk-HYW67VJ5.js";
21
21
 
22
22
  // dist/cli/commands/append.js
23
23
  async function runAppend(id, options, global) {
@@ -33,6 +33,16 @@ async function runAppend(id, options, global) {
33
33
  const author = resolveAuthor(options.author, settings.author_default);
34
34
  const bodyInput = await stdinResolver.resolveValue(options.body, "--body");
35
35
  const appended = bodyInput.trim();
36
+ if (appended.length === 0) {
37
+ throw new PmCliError("--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.", EXIT_CODE.USAGE, {
38
+ code: "append_empty_body",
39
+ required: "Provide non-empty body text positionally, via --body, or with - for stdin.",
40
+ examples: [
41
+ 'pm append pm-a1b2 --body "Progress note"',
42
+ "pm append pm-a1b2 --body -"
43
+ ]
44
+ });
45
+ }
36
46
  const result = await mutateItem({
37
47
  pmRoot,
38
48
  settings,
@@ -42,9 +52,6 @@ async function runAppend(id, options, global) {
42
52
  message: options.message,
43
53
  force: options.force,
44
54
  mutate(document) {
45
- if (appended.length === 0) {
46
- return { changedFields: [] };
47
- }
48
55
  const spacer = document.body.trim().length > 0 ? "\n\n" : "";
49
56
  document.body = `${document.body.replace(/\s+$/, "")}${spacer}${appended}
50
57
  `;
@@ -53,7 +60,7 @@ async function runAppend(id, options, global) {
53
60
  });
54
61
  return {
55
62
  item: toItemRecord(result.item),
56
- appended: appended.length > 0 ? appended : "",
63
+ appended,
57
64
  changed_fields: result.changedFields
58
65
  };
59
66
  }
@@ -61,6 +68,6 @@ async function runAppend(id, options, global) {
61
68
  export {
62
69
  runAppend
63
70
  };
64
- //# sourceMappingURL=chunk-G33XIMRT.js.map
71
+ //# sourceMappingURL=chunk-XJF7CDNH.js.map
65
72
 
66
- //# debugId=c1a718f6-bc42-53b0-a337-f777e26bd386
73
+ //# debugId=7ea426c5-e4fc-52f3-bdd8-8e99c3e2a798
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/append.ts"],"sourcesContent":["/**\n * @module cli/commands/append\n *\n * Implements the pm append command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\n/** Documents the append command options payload exchanged by command, SDK, and package integrations. */\nexport interface AppendCommandOptions {\n /** Value that configures or reports body for this contract. */\n body: string;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the append result payload exchanged by command, SDK, and package integrations. */\nexport interface AppendResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports appended for this contract. */\n appended: string;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields: string[];\n}\n\n/** Implements run append for the public runtime surface of this module. */\nexport async function runAppend(\n id: string,\n options: AppendCommandOptions,\n global: GlobalOptions,\n): Promise<AppendResult> {\n if (options.body === undefined) {\n throw new PmCliError(\"Missing required --body text\", EXIT_CODE.USAGE);\n }\n const stdinResolver = createStdinTokenResolver();\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const author = resolveAuthor(options.author, settings.author_default);\n // options.body is guaranteed defined by the guard above, so resolveValue returns a defined string.\n const bodyInput = await stdinResolver.resolveValue(options.body, \"--body\");\n const appended = (bodyInput as string).trim();\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"append\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n if (appended.length === 0) {\n return { changedFields: [] };\n }\n const spacer = document.body.trim().length > 0 ? \"\\n\\n\" : \"\";\n document.body = `${document.body.replace(/\\s+$/, \"\")}${spacer}${appended}\\n`;\n return { changedFields: [\"body\"] };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n appended: appended.length > 0 ? appended : \"\",\n changed_fields: result.changedFields,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,eAAsB,UACpB,IACA,SACA,QAAqB;AAErB,MAAI,QAAQ,SAAS,QAAW;AAC9B,UAAM,IAAI,WAAW,gCAAgC,UAAU,KAAK;EACtE;AACA,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WACR,iCAAiC,MAAM,wBACvC,UAAU,SAAS;EAEvB;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AAEpE,QAAM,YAAY,MAAM,cAAc,aAAa,QAAQ,MAAM,QAAQ;AACzE,QAAM,WAAY,UAAqB,KAAI;AAE3C,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA,IAAI;IACJ;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,OAAO,UAAQ;AACb,UAAI,SAAS,WAAW,GAAG;AACzB,eAAO,EAAE,eAAe,CAAA,EAAE;MAC5B;AACA,YAAM,SAAS,SAAS,KAAK,KAAI,EAAG,SAAS,IAAI,SAAS;AAC1D,eAAS,OAAO,GAAG,SAAS,KAAK,QAAQ,QAAQ,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ;;AACxE,aAAO,EAAE,eAAe,CAAC,MAAM,EAAC;IAClC;GACD;AAED,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,UAAU,SAAS,SAAS,IAAI,WAAW;IAC3C,gBAAgB,OAAO;;AAE3B","debugId":"c1a718f6-bc42-53b0-a337-f777e26bd386"}
1
+ {"version":3,"sources":["../../../../../../../../cli/commands/append.ts"],"sourcesContent":["/**\n * @module cli/commands/append\n *\n * Implements the pm append command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\n/** Documents the append command options payload exchanged by command, SDK, and package integrations. */\nexport interface AppendCommandOptions {\n /** Value that configures or reports body for this contract. */\n body: string;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n}\n\n/** Documents the append result payload exchanged by command, SDK, and package integrations. */\nexport interface AppendResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports appended for this contract. */\n appended: string;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields: string[];\n}\n\n/** Implements run append for the public runtime surface of this module. */\nexport async function runAppend(\n id: string,\n options: AppendCommandOptions,\n global: GlobalOptions,\n): Promise<AppendResult> {\n if (options.body === undefined) {\n throw new PmCliError(\"Missing required --body text\", EXIT_CODE.USAGE);\n }\n const stdinResolver = createStdinTokenResolver();\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const settings = await readSettings(pmRoot);\n const author = resolveAuthor(options.author, settings.author_default);\n // options.body is guaranteed defined by the guard above, so resolveValue returns a defined string.\n const bodyInput = await stdinResolver.resolveValue(options.body, \"--body\");\n const appended = (bodyInput as string).trim();\n if (appended.length === 0) {\n throw new PmCliError(\n \"--body text cannot be empty; append requires non-blank content and empty appends would only rewrite updated_at.\",\n EXIT_CODE.USAGE,\n {\n code: \"append_empty_body\",\n required:\n \"Provide non-empty body text positionally, via --body, or with - for stdin.\",\n examples: [\n 'pm append pm-a1b2 --body \"Progress note\"',\n \"pm append pm-a1b2 --body -\",\n ],\n },\n );\n }\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"append\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n const spacer = document.body.trim().length > 0 ? \"\\n\\n\" : \"\";\n document.body = `${document.body.replace(/\\s+$/, \"\")}${spacer}${appended}\\n`;\n return { changedFields: [\"body\"] };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n appended,\n changed_fields: result.changedFields,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,eAAsB,UACpB,IACA,SACA,QAAqB;AAErB,MAAI,QAAQ,SAAS,QAAW;AAC9B,UAAM,IAAI,WAAW,gCAAgC,UAAU,KAAK;EACtE;AACA,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WACR,iCAAiC,MAAM,wBACvC,UAAU,SAAS;EAEvB;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AAEpE,QAAM,YAAY,MAAM,cAAc,aAAa,QAAQ,MAAM,QAAQ;AACzE,QAAM,WAAY,UAAqB,KAAI;AAC3C,MAAI,SAAS,WAAW,GAAG;AACzB,UAAM,IAAI,WACR,mHACA,UAAU,OACV;MACE,MAAM;MACN,UACE;MACF,UAAU;QACR;QACA;;KAEH;EAEL;AAEA,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA,IAAI;IACJ;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,OAAO,UAAQ;AACb,YAAM,SAAS,SAAS,KAAK,KAAI,EAAG,SAAS,IAAI,SAAS;AAC1D,eAAS,OAAO,GAAG,SAAS,KAAK,QAAQ,QAAQ,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ;;AACxE,aAAO,EAAE,eAAe,CAAC,MAAM,EAAC;IAClC;GACD;AAED,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B;IACA,gBAAgB,OAAO;;AAE3B","debugId":"7ea426c5-e4fc-52f3-bdd8-8e99c3e2a798"}
@@ -1,3 +1,7 @@
1
+ import {
2
+ computeHistoryDiff,
3
+ patchPathToChangedField
4
+ } from "./chunk-TYHJDFYW.js";
1
5
  import {
2
6
  collectRuntimeFilterValues,
3
7
  matchesRuntimeFilters,
@@ -5,28 +9,28 @@ import {
5
9
  parsePriority,
6
10
  parseType,
7
11
  runList
8
- } from "./chunk-YIC5NGXF.js";
12
+ } from "./chunk-RMF7LMBS.js";
9
13
  import {
10
14
  parseLimit
11
- } from "./chunk-7CHWLT2J.js";
15
+ } from "./chunk-UVN66B3M.js";
12
16
  import {
13
17
  createQueryFingerprint,
14
18
  encodeQueryCursor,
15
19
  resolveQueryCursorStart
16
- } from "./chunk-QYGK2XQ3.js";
20
+ } from "./chunk-GTLCVJOE.js";
17
21
  import {
18
22
  collectBlockedByIds,
19
23
  collectDependencyBlockedIds,
20
24
  computeActionabilityReport,
21
25
  resolveItemBlockers
22
- } from "./chunk-W6IEJXNC.js";
26
+ } from "./chunk-TVYYO5A7.js";
27
+ import {
28
+ readHistoryEntries
29
+ } from "./chunk-C3KD7U3T.js";
23
30
  import {
24
- cloneEmptyReplayDocument,
25
31
  normalizeReplayPatchOps,
26
- readHistoryEntries,
27
- tryApplyReplayPatch,
28
32
  verifyHistoryChain
29
- } from "./chunk-RWAIRGBC.js";
33
+ } from "./chunk-E6LEMURX.js";
30
34
  import {
31
35
  acquireLock,
32
36
  compareTimestampStrings,
@@ -47,7 +51,7 @@ import {
47
51
  resolveIsoOrRelative,
48
52
  runActiveOnReadHooks,
49
53
  runActiveServiceOverride
50
- } from "./chunk-RLLOZAM2.js";
54
+ } from "./chunk-IY6VZ3IW.js";
51
55
  import {
52
56
  CONTEXT_DEPTH_VALUES,
53
57
  CONTEXT_SECTION_VALUES,
@@ -63,7 +67,7 @@ import {
63
67
  resolveRuntimeFieldRegistry,
64
68
  resolveRuntimeStatusRegistry,
65
69
  weekdayOrderIndex
66
- } from "./chunk-WCBB6VI3.js";
70
+ } from "./chunk-7AVEY74G.js";
67
71
 
68
72
  // dist/sdk/context-usage.js
69
73
  import { randomUUID } from "node:crypto";
@@ -232,105 +236,6 @@ async function readContextUsageAffinity(options) {
232
236
  };
233
237
  }
234
238
 
235
- // dist/core/history/history-diff.js
236
- !(function() {
237
- try {
238
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
239
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "86354a77-3238-519c-818f-c2989d885298");
240
- } catch (e2) {
241
- }
242
- })();
243
- function decodeJsonPointerSegment(segment) {
244
- return segment.replaceAll("~1", "/").replaceAll("~0", "~");
245
- }
246
- function patchPathToChangedField(path3) {
247
- if (path3 === "/body" || path3.startsWith("/body/"))
248
- return "body";
249
- if (path3 === "/metadata" || path3.startsWith("/metadata/") || path3 === "/front_matter" || path3.startsWith("/front_matter/")) {
250
- const segment2 = path3.replace(/^\/(?:metadata|front_matter)\/?/, "").split("/")[0];
251
- if (!segment2)
252
- return "metadata";
253
- return decodeJsonPointerSegment(segment2);
254
- }
255
- const segment = path3.replace(/^\//, "").split("/")[0];
256
- return segment ? decodeJsonPointerSegment(segment) : "root";
257
- }
258
- function readFieldValue(doc, field) {
259
- if (field === "body")
260
- return doc.body;
261
- if (field === "metadata")
262
- return doc.metadata;
263
- if (field === "root")
264
- return doc;
265
- return doc.metadata[field];
266
- }
267
- function computeHistoryDiff(fullEntries, options) {
268
- const windowStartIndex = options?.windowStartIndex ?? 0;
269
- const fieldFilter = options?.field;
270
- if (fullEntries.length === 0 || windowStartIndex >= fullEntries.length) {
271
- return [];
272
- }
273
- let current = cloneEmptyReplayDocument();
274
- const result = [];
275
- for (let p = 0; p < fullEntries.length; p += 1) {
276
- const entry = fullEntries[p];
277
- const beforeDoc = current;
278
- const applied = tryApplyReplayPatch(current, entry.patch);
279
- let afterDoc;
280
- if (applied.ok) {
281
- afterDoc = applied.document;
282
- current = afterDoc;
283
- } else {
284
- afterDoc = beforeDoc;
285
- }
286
- const changedFieldSet = /* @__PURE__ */ new Set();
287
- for (const patchOp of entry.patch) {
288
- changedFieldSet.add(patchPathToChangedField(patchOp.path));
289
- if (patchOp.from !== void 0) {
290
- changedFieldSet.add(patchPathToChangedField(patchOp.from));
291
- }
292
- }
293
- const sortedFields = [...changedFieldSet].sort((a, b) => a.localeCompare(b));
294
- if (p >= windowStartIndex) {
295
- if (fieldFilter !== void 0) {
296
- if (!changedFieldSet.has(fieldFilter)) {
297
- continue;
298
- }
299
- const change = {
300
- field: fieldFilter,
301
- before: readFieldValue(beforeDoc, fieldFilter),
302
- after: readFieldValue(afterDoc, fieldFilter)
303
- };
304
- result.push({
305
- index: p + 1,
306
- ts: entry.ts,
307
- op: entry.op,
308
- author: entry.author,
309
- patch_ops: entry.patch.length,
310
- changed_fields: [fieldFilter],
311
- changes: [change]
312
- });
313
- } else {
314
- const changes = sortedFields.map((field) => ({
315
- field,
316
- before: readFieldValue(beforeDoc, field),
317
- after: readFieldValue(afterDoc, field)
318
- }));
319
- result.push({
320
- index: p + 1,
321
- ts: entry.ts,
322
- op: entry.op,
323
- author: entry.author,
324
- patch_ops: entry.patch.length,
325
- changed_fields: sortedFields,
326
- changes
327
- });
328
- }
329
- }
330
- }
331
- return result;
332
- }
333
-
334
239
  // dist/cli/shared-parsers.js
335
240
  !(function() {
336
241
  try {
@@ -622,7 +527,7 @@ import { encode as encodeToon } from "@toon-format/toon";
622
527
  !(function() {
623
528
  try {
624
529
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
625
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b5e68203-be1d-5e70-b080-a4e2006b8ee1");
530
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c7eb75b9-9734-508b-a672-6350e4f87f8c");
626
531
  } catch (e2) {
627
532
  }
628
533
  })();
@@ -2040,7 +1945,7 @@ function packContextCandidates(candidates, options) {
2040
1945
  !(function() {
2041
1946
  try {
2042
1947
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
2043
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "73237ae4-dd9f-5a67-9053-b2ffed05b1cf");
1948
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "3c9a4dc5-c2a6-5f6c-9dcf-979aac771091");
2044
1949
  } catch (e2) {
2045
1950
  }
2046
1951
  })();
@@ -3724,4 +3629,4 @@ export {
3724
3629
  renderNextMarkdown,
3725
3630
  collectStaleVectorizationIds
3726
3631
  };
3727
- //# sourceMappingURL=chunk-AR24KW26.js.map
3632
+ //# sourceMappingURL=chunk-YBT7O4KT.js.map