@unbrained/pm-cli 2026.7.2 → 2026.7.4

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 (546) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +29 -0
  3. package/CONTRIBUTING.md +38 -9
  4. package/README.md +1 -5
  5. package/dist/cli/commander-usage.js +54 -41
  6. package/dist/cli/commander-usage.js.map +1 -1
  7. package/dist/cli/commands/activity.js +79 -57
  8. package/dist/cli/commands/activity.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +3 -3
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/close-many.js +106 -65
  12. package/dist/cli/commands/close-many.js.map +1 -1
  13. package/dist/cli/commands/completion.js +231 -345
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/create.d.ts +2 -59
  16. package/dist/cli/commands/create.js +38 -39
  17. package/dist/cli/commands/create.js.map +1 -1
  18. package/dist/cli/commands/extension/doctor.js +56 -67
  19. package/dist/cli/commands/extension/doctor.js.map +1 -1
  20. package/dist/cli/commands/extension/scaffold.js +54 -133
  21. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  22. package/dist/cli/commands/extension/shared.js +21 -15
  23. package/dist/cli/commands/extension/shared.js.map +1 -1
  24. package/dist/cli/commands/files.js +3 -3
  25. package/dist/cli/commands/files.js.map +1 -1
  26. package/dist/cli/commands/health.js +101 -112
  27. package/dist/cli/commands/health.js.map +1 -1
  28. package/dist/cli/commands/history-compact.js +9 -18
  29. package/dist/cli/commands/history-compact.js.map +1 -1
  30. package/dist/cli/commands/history-repair.js +9 -19
  31. package/dist/cli/commands/history-repair.js.map +1 -1
  32. package/dist/cli/commands/init-agent-guidance.js +160 -111
  33. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  34. package/dist/cli/commands/init.js +3 -3
  35. package/dist/cli/commands/init.js.map +1 -1
  36. package/dist/cli/commands/item-filter-options.d.ts +2 -0
  37. package/dist/cli/commands/item-filter-options.js +2 -2
  38. package/dist/cli/commands/item-filter-options.js.map +1 -1
  39. package/dist/cli/commands/mutation-command-options.d.ts +78 -0
  40. package/dist/cli/commands/mutation-command-options.js +10 -0
  41. package/dist/cli/commands/mutation-command-options.js.map +1 -0
  42. package/dist/cli/commands/next.js +13 -10
  43. package/dist/cli/commands/next.js.map +1 -1
  44. package/dist/cli/commands/profile.js +23 -15
  45. package/dist/cli/commands/profile.js.map +1 -1
  46. package/dist/cli/commands/reindex.js +3 -3
  47. package/dist/cli/commands/reindex.js.map +1 -1
  48. package/dist/cli/commands/shared-unset-fields.d.ts +19 -0
  49. package/dist/cli/commands/shared-unset-fields.js +31 -2
  50. package/dist/cli/commands/shared-unset-fields.js.map +1 -1
  51. package/dist/cli/commands/update.d.ts +2 -59
  52. package/dist/cli/commands/update.js +26 -97
  53. package/dist/cli/commands/update.js.map +1 -1
  54. package/dist/cli/commands/validate.d.ts +2 -0
  55. package/dist/cli/commands/validate.js +16 -4
  56. package/dist/cli/commands/validate.js.map +1 -1
  57. package/dist/cli/error-guidance.js +9 -6
  58. package/dist/cli/error-guidance.js.map +1 -1
  59. package/dist/cli/extension-command-help.js +27 -19
  60. package/dist/cli/extension-command-help.js.map +1 -1
  61. package/dist/cli/help-json-payload.js +57 -49
  62. package/dist/cli/help-json-payload.js.map +1 -1
  63. package/dist/cli/main.js +48 -32
  64. package/dist/cli/main.js.map +1 -1
  65. package/dist/cli/register-list-query.js +215 -213
  66. package/dist/cli/register-list-query.js.map +1 -1
  67. package/dist/cli/register-mutation.js +368 -368
  68. package/dist/cli/register-mutation.js.map +1 -1
  69. package/dist/cli/register-operations.js +303 -299
  70. package/dist/cli/register-operations.js.map +1 -1
  71. package/dist/cli/registration-helpers.d.ts +4 -0
  72. package/dist/cli/registration-helpers.js +51 -56
  73. package/dist/cli/registration-helpers.js.map +1 -1
  74. package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +16 -0
  75. package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js → activity-OENQCYZD.js} +9 -9
  76. package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js → aggregate-EC4LWS3U.js} +8 -8
  77. package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js → aggregate-RCB3QJJE.js} +8 -8
  78. package/dist/cli-bundle/chunks/{append-H32VOR2Y.js → append-ADBOI3A6.js} +8 -8
  79. package/dist/cli-bundle/chunks/{append-UBM632FK.js → append-XLEKVVWB.js} +8 -8
  80. package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js → chunk-2LRMWMZ6.js} +7 -7
  81. package/dist/cli-bundle/chunks/{chunk-2227673O.js → chunk-2ONH3WG6.js} +32 -13
  82. package/dist/cli-bundle/chunks/{chunk-2227673O.js.map → chunk-2ONH3WG6.js.map} +1 -1
  83. package/dist/cli-bundle/chunks/{chunk-MNBPX5JS.js → chunk-2VK677OA.js} +72 -49
  84. package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +7 -0
  85. package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js → chunk-3C5T3ZEO.js} +2 -2
  86. package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js → chunk-3MLQZI3H.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js → chunk-4EVY7CQN.js} +2 -2
  88. package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js → chunk-4IW7STMB.js} +7 -7
  89. package/dist/cli-bundle/chunks/{chunk-6YCYF2AI.js → chunk-4KPQQ42D.js} +166 -110
  90. package/dist/cli-bundle/chunks/chunk-4KPQQ42D.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js → chunk-4OXNQHKQ.js} +23 -17
  92. package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js.map → chunk-4OXNQHKQ.js.map} +2 -2
  93. package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js → chunk-4PJYRA3V.js} +31 -12
  94. package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js.map → chunk-4PJYRA3V.js.map} +3 -3
  95. package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js → chunk-4SHME4VR.js} +2 -2
  96. package/dist/cli-bundle/chunks/{chunk-6ITZLD4T.js → chunk-5FYY76HR.js} +28 -99
  97. package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js → chunk-6QY2NA2M.js} +24 -18
  99. package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js.map → chunk-6QY2NA2M.js.map} +1 -1
  100. package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js → chunk-6YB7HG2J.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js → chunk-724VLYDJ.js} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-XCHUVHKU.js → chunk-75VMARGO.js} +11 -11
  103. package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-XWGEMNBR.js → chunk-7745CXNI.js} +119 -195
  105. package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-YPKFV2JR.js → chunk-7G5SUU6F.js} +76 -54
  107. package/dist/cli-bundle/chunks/chunk-7G5SUU6F.js.map +1 -0
  108. package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js → chunk-7ITQSEBL.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-W47SML5B.js → chunk-A222YWOQ.js} +7 -7
  110. package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js → chunk-A2W3XKAD.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js → chunk-AOP2EMK3.js} +3 -3
  112. package/dist/cli-bundle/chunks/{chunk-RM37OPYK.js → chunk-AZMPKLIA.js} +72 -49
  113. package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-7NSPKJUS.js → chunk-BDDYM4LH.js} +262 -252
  115. package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-JXAUVO6X.js → chunk-CN4OAA2G.js} +55 -20
  117. package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +7 -0
  118. package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js → chunk-CQFZRLXQ.js} +3 -3
  119. package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js → chunk-CQISNF3Z.js} +7 -7
  120. package/dist/cli-bundle/chunks/{chunk-S62UANU7.js → chunk-D2LDM35X.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-GRRG3MCT.js → chunk-DEIDJQZK.js} +57 -136
  122. package/dist/cli-bundle/chunks/chunk-DEIDJQZK.js.map +7 -0
  123. package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js → chunk-DJ5S2LDY.js} +7 -7
  124. package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js → chunk-EB4BBEZD.js} +6 -6
  125. package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js → chunk-EH23N5FX.js} +2 -2
  126. package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js → chunk-FDNJMYZB.js} +6 -6
  127. package/dist/cli-bundle/chunks/{chunk-K2VYLVX4.js → chunk-FMWQRMHS.js} +33 -6
  128. package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js → chunk-HL742IBM.js} +4 -4
  130. package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js → chunk-J4KNRDI3.js} +59 -70
  131. package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js.map → chunk-J4KNRDI3.js.map} +1 -1
  132. package/dist/cli-bundle/chunks/{chunk-66Z3X7ZG.js → chunk-JYLFF7GJ.js} +166 -110
  133. package/dist/cli-bundle/chunks/chunk-JYLFF7GJ.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GFMSLORL.js → chunk-JZJJEJBR.js} +75 -53
  135. package/dist/cli-bundle/chunks/chunk-JZJJEJBR.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-7TH5NMVB.js → chunk-KKHIQOTN.js} +25 -19
  137. package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +7 -0
  138. package/dist/cli-bundle/chunks/{chunk-5GVTFFTC.js → chunk-LLQLLAKU.js} +118 -194
  139. package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +1 -0
  140. package/dist/cli-bundle/chunks/{chunk-KIYCOJ63.js → chunk-M34MVAOP.js} +58 -137
  141. package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +1 -0
  142. package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js → chunk-M6PR5BC6.js} +7 -7
  143. package/dist/cli-bundle/chunks/{chunk-XEWQKDYZ.js → chunk-MTB4PRA3.js} +10 -10
  144. package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js → chunk-MZ4NH46V.js} +2 -2
  146. package/dist/cli-bundle/chunks/{chunk-AIAIXG7I.js → chunk-MZG6I2Q2.js} +39 -5
  147. package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js → chunk-N2LOJUBB.js} +2 -2
  149. package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js → chunk-NGDK3KEZ.js} +5 -5
  150. package/dist/cli-bundle/chunks/{chunk-SYNKD3ZG.js → chunk-NHDR3UCW.js} +46 -60
  151. package/dist/cli-bundle/chunks/chunk-NHDR3UCW.js.map +7 -0
  152. package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js → chunk-NHKXOMZ5.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js → chunk-OTSP6UEX.js} +7 -7
  154. package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js → chunk-PUVPC5DL.js} +4 -4
  155. package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js → chunk-PV5JS7MP.js} +3 -3
  156. package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js → chunk-Q2266G4S.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js → chunk-Q3XVLRCJ.js} +9 -9
  158. package/dist/cli-bundle/chunks/{chunk-AJEBCRIY.js → chunk-QFXFKYNQ.js} +47 -61
  159. package/dist/cli-bundle/chunks/chunk-QFXFKYNQ.js.map +1 -0
  160. package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js → chunk-R7EMP4JG.js} +9 -9
  161. package/dist/cli-bundle/chunks/{chunk-SPM2XLWI.js → chunk-SBNT6SLO.js} +22 -7
  162. package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-I66WE2HE.js → chunk-SL2ANJSV.js} +260 -250
  164. package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +1 -0
  165. package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js → chunk-T5RTYLZJ.js} +3 -3
  166. package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js → chunk-TGYDJEJH.js} +7 -7
  167. package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js → chunk-TO4KCIOT.js} +3 -3
  168. package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js → chunk-TUV7SIWZ.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js → chunk-UGDONITK.js} +58 -69
  170. package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js.map → chunk-UGDONITK.js.map} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-NRZS637N.js → chunk-UYLA5ROU.js} +56 -21
  172. package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +1 -0
  173. package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js → chunk-V655JQ5J.js} +8 -8
  174. package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js → chunk-W5X3AHJN.js} +2 -2
  175. package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js → chunk-WBWRQS32.js} +5 -5
  176. package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js → chunk-WOOB7PV7.js} +3 -3
  177. package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js → chunk-WSDIALO4.js} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js → chunk-WTXDLBSZ.js} +2 -2
  179. package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js → chunk-XBIYI23P.js} +8 -8
  180. package/dist/cli-bundle/chunks/{chunk-7W4H4K26.js → chunk-XFO2NJY6.js} +29 -100
  181. package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-TPOFWBMY.js → chunk-XQCWTSLO.js} +26 -20
  183. package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js → chunk-Y2VSCQ77.js} +4 -4
  185. package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js → chunk-YZR7UMZ6.js} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-YLZZ6T54.js → chunk-YZWXMDNH.js} +23 -8
  187. package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js → chunk-ZIEGTQCY.js} +3 -3
  189. package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js → chunk-ZZWMJVW2.js} +4 -4
  190. package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js → claim-D6L33A5Y.js} +8 -8
  191. package/dist/cli-bundle/chunks/{claim-SENTPZBN.js → claim-YAFUTPVK.js} +8 -8
  192. package/dist/cli-bundle/chunks/close-KLDLHAOP.js +14 -0
  193. package/dist/cli-bundle/chunks/{close-424MX4CU.js → close-TGYXG7TV.js} +7 -7
  194. package/dist/cli-bundle/chunks/{close-many-SWY34BII.js → close-many-4QSWKCRU.js} +119 -76
  195. package/dist/cli-bundle/chunks/close-many-4QSWKCRU.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{close-many-2IV4J2TR.js → close-many-SNA6LNZH.js} +120 -77
  197. package/dist/cli-bundle/chunks/close-many-SNA6LNZH.js.map +1 -0
  198. package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js → comments-QC6ARR5X.js} +9 -9
  199. package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js → comments-ZHVYGUVC.js} +9 -9
  200. package/dist/cli-bundle/chunks/{config-G74GISC4.js → config-O6W2EU2G.js} +7 -7
  201. package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js → config-XQRFJXJP.js} +7 -7
  202. package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js → context-IHE3IXN5.js} +12 -12
  203. package/dist/cli-bundle/chunks/{context-ZQY54JNS.js → context-WSYWBEUL.js} +12 -12
  204. package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js → contracts-CVBINC7C.js} +3 -3
  205. package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js → contracts-NLCDIZAT.js} +3 -3
  206. package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js → copy-7MUQC44A.js} +5 -5
  207. package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js → copy-ANWXDJVC.js} +5 -5
  208. package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +28 -0
  209. package/dist/cli-bundle/chunks/{create-VSKYSOCD.js → create-JIA2IFCO.js} +12 -12
  210. package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js → delete-5OLYWQIC.js} +5 -5
  211. package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js → delete-INHKCIRN.js} +5 -5
  212. package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js → deps-CCSWGZW7.js} +5 -5
  213. package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js → deps-IYEID3QX.js} +5 -5
  214. package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js → docs-3XZK22WF.js} +7 -7
  215. package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js → docs-PKO7OEIM.js} +7 -7
  216. package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js → eval-5XYP6NMY.js} +10 -10
  217. package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js → eval-O4WGQYDI.js} +10 -10
  218. package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js → extension-PVGRRZZG.js} +11 -11
  219. package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js → extension-T7JNTAAA.js} +11 -11
  220. package/dist/cli-bundle/chunks/{files-5D65CHGE.js → files-7IU56S6R.js} +10 -10
  221. package/dist/cli-bundle/chunks/files-7IU56S6R.js.map +1 -0
  222. package/dist/cli-bundle/chunks/{files-GPIG77EN.js → files-W7HH5EOD.js} +9 -9
  223. package/dist/cli-bundle/chunks/{files-GPIG77EN.js.map → files-W7HH5EOD.js.map} +1 -1
  224. package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js → focus-6FA5KYRY.js} +6 -6
  225. package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js → focus-CQ63JFDG.js} +6 -6
  226. package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js → gc-3BG67KTO.js} +3 -3
  227. package/dist/cli-bundle/chunks/{gc-VZIXDL32.js → gc-PEZYGNVB.js} +3 -3
  228. package/dist/cli-bundle/chunks/{get-GIBRUUOP.js → get-J6CSJ4SX.js} +10 -10
  229. package/dist/cli-bundle/chunks/{get-IOVAN6RU.js → get-KJTKGNEQ.js} +10 -10
  230. package/dist/cli-bundle/chunks/{health-L2U3AFKV.js → health-32UQICEL.js} +115 -123
  231. package/dist/cli-bundle/chunks/health-32UQICEL.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{health-MM7AWXYF.js → health-ZUZG5ULV.js} +114 -122
  233. package/dist/cli-bundle/chunks/health-ZUZG5ULV.js.map +7 -0
  234. package/dist/cli-bundle/chunks/history-IOH6FKG7.js +18 -0
  235. package/dist/cli-bundle/chunks/{history-IL7XCEX2.js → history-W6QVR6FA.js} +8 -8
  236. package/dist/cli-bundle/chunks/{history-compact-HALOTOU7.js → history-compact-F355EGL4.js} +20 -27
  237. package/dist/cli-bundle/chunks/history-compact-F355EGL4.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{history-compact-MV25P7DM.js → history-compact-JQ6ZGYSJ.js} +19 -26
  239. package/dist/cli-bundle/chunks/history-compact-JQ6ZGYSJ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js → history-redact-TUWOUYX5.js} +9 -9
  241. package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +19 -0
  242. package/dist/cli-bundle/chunks/{history-repair-44MODPQF.js → history-repair-MPCAIKYE.js} +20 -28
  243. package/dist/cli-bundle/chunks/history-repair-MPCAIKYE.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{history-repair-CPNAOCNF.js → history-repair-ZKS3LKPV.js} +19 -27
  245. package/dist/cli-bundle/chunks/history-repair-ZKS3LKPV.js.map +7 -0
  246. package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +22 -0
  247. package/dist/cli-bundle/chunks/{init-F27NHENZ.js → init-MAA6UMNQ.js} +12 -12
  248. package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js → learnings-EYC3OKS2.js} +9 -9
  249. package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js → learnings-HKJJUVTA.js} +9 -9
  250. package/dist/cli-bundle/chunks/{list-VMPWTURB.js → list-HFD5737R.js} +8 -8
  251. package/dist/cli-bundle/chunks/{list-HPMEKCAA.js → list-KN3TL5Y5.js} +8 -8
  252. package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js → next-DQUMFAHG.js} +25 -22
  253. package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js.map → next-DQUMFAHG.js.map} +2 -2
  254. package/dist/cli-bundle/chunks/{next-QM6YJIIS.js → next-JUEYC5HE.js} +26 -23
  255. package/dist/cli-bundle/chunks/next-JUEYC5HE.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js → notes-XATYT43P.js} +9 -9
  257. package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js → notes-ZG6RLZXB.js} +9 -9
  258. package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js → plan-5NWQL2DH.js} +12 -12
  259. package/dist/cli-bundle/chunks/{plan-C5IMM335.js → plan-DVVLX7LK.js} +12 -12
  260. package/dist/cli-bundle/chunks/{profile-CCOKZ2IQ.js → profile-54DZ4CLB.js} +27 -19
  261. package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +1 -0
  262. package/dist/cli-bundle/chunks/{profile-HUCENIEQ.js → profile-PLIQVEOY.js} +26 -18
  263. package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{register-list-query-ROSNIL52.js → register-list-query-PNRAHNIQ.js} +181 -172
  265. package/dist/cli-bundle/chunks/register-list-query-PNRAHNIQ.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{register-list-query-XN4ZRHSV.js → register-list-query-WRS6ACUW.js} +180 -171
  267. package/dist/cli-bundle/chunks/register-list-query-WRS6ACUW.js.map +7 -0
  268. package/dist/cli-bundle/chunks/{register-mutation-KRLAHEL2.js → register-mutation-ET6E4VLE.js} +367 -361
  269. package/dist/cli-bundle/chunks/register-mutation-ET6E4VLE.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-mutation-CFSB2MS3.js → register-mutation-K2MNRWGI.js} +368 -362
  271. package/dist/cli-bundle/chunks/register-mutation-K2MNRWGI.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{register-operations-MBN4KGUM.js → register-operations-6DQRUTIX.js} +310 -305
  273. package/dist/cli-bundle/chunks/register-operations-6DQRUTIX.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-operations-4PASGJDB.js → register-operations-73UDWMVB.js} +309 -304
  275. package/dist/cli-bundle/chunks/register-operations-73UDWMVB.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js → register-setup-FXZJ2CEJ.js} +15 -15
  277. package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js → register-setup-LYYCMQFV.js} +15 -15
  278. package/dist/cli-bundle/chunks/restore-L27TMMCF.js +17 -0
  279. package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js → restore-R6YJHQK3.js} +9 -9
  280. package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js → scheduling-shortcuts-LE4S7OI7.js} +12 -12
  281. package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js → scheduling-shortcuts-OGODPUBL.js} +12 -12
  282. package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js → schema-ICCD3HOP.js} +7 -7
  283. package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js → schema-RHH23PQX.js} +7 -7
  284. package/dist/cli-bundle/chunks/{search-FP7MEU4S.js → search-HDDKOPFE.js} +10 -10
  285. package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js → search-Z2VGP2Q5.js} +10 -10
  286. package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js → stats-DHMRXHOB.js} +6 -6
  287. package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js → stats-ETFP37MB.js} +6 -6
  288. package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js → telemetry-NUZNKDCP.js} +4 -4
  289. package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js → telemetry-ZRBM22QD.js} +4 -4
  290. package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js → test-H36PM746.js} +15 -15
  291. package/dist/cli-bundle/chunks/{test-YCDAUBWF.js → test-XNKTIP4Y.js} +15 -15
  292. package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js → test-all-APCBSXQI.js} +17 -17
  293. package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js → test-all-KIK3OYBY.js} +17 -17
  294. package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js → test-runs-5SLLV3XU.js} +4 -4
  295. package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js → test-runs-L3WKLO67.js} +4 -4
  296. package/dist/cli-bundle/chunks/update-RQKI3AMW.js +24 -0
  297. package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js → update-ZM7NJWHY.js} +15 -15
  298. package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js → update-many-GFCQG6ZQ.js} +28 -28
  299. package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js → update-many-XGTJ7QIU.js} +28 -28
  300. package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js → upgrade-KJ3JGELR.js} +11 -11
  301. package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js → upgrade-RBRQ7PQU.js} +11 -11
  302. package/dist/cli-bundle/chunks/{validate-732RWS5W.js → validate-EW6TGC7R.js} +31 -21
  303. package/dist/cli-bundle/chunks/validate-EW6TGC7R.js.map +7 -0
  304. package/dist/cli-bundle/chunks/{validate-W7H5TEDC.js → validate-T6PR5WAL.js} +32 -22
  305. package/dist/cli-bundle/chunks/validate-T6PR5WAL.js.map +1 -0
  306. package/dist/cli-bundle/main.js +180 -122
  307. package/dist/cli-bundle/main.js.map +3 -3
  308. package/dist/core/extensions/extension-types.d.ts +1 -2
  309. package/dist/core/extensions/extension-types.js +2 -2
  310. package/dist/core/extensions/extension-types.js.map +1 -1
  311. package/dist/core/history/history-rewrite.d.ts +10 -0
  312. package/dist/core/history/history-rewrite.js +27 -3
  313. package/dist/core/history/history-rewrite.js.map +1 -1
  314. package/dist/core/item/type-registry.d.ts +1 -0
  315. package/dist/core/item/type-registry.js +180 -194
  316. package/dist/core/item/type-registry.js.map +1 -1
  317. package/dist/core/schema/runtime-schema.js +65 -54
  318. package/dist/core/schema/runtime-schema.js.map +1 -1
  319. package/dist/core/schema/status-defs-file.js +26 -3
  320. package/dist/core/schema/status-defs-file.js.map +1 -1
  321. package/dist/core/search/corpus.js +25 -19
  322. package/dist/core/search/corpus.js.map +1 -1
  323. package/dist/core/shared/memo.d.ts +12 -0
  324. package/dist/core/shared/memo.js +25 -0
  325. package/dist/core/shared/memo.js.map +1 -0
  326. package/dist/core/shared/serialization.js +24 -14
  327. package/dist/core/shared/serialization.js.map +1 -1
  328. package/dist/core/shared/time.js +26 -4
  329. package/dist/core/shared/time.js.map +1 -1
  330. package/dist/core/store/front-matter-cache.d.ts +5 -0
  331. package/dist/core/store/front-matter-cache.js +79 -20
  332. package/dist/core/store/front-matter-cache.js.map +1 -1
  333. package/dist/sdk/cli-contracts/flag-contracts.js +73 -99
  334. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  335. package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
  336. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  337. package/dist/sdk/cli-contracts/tool-schema.js +55 -94
  338. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  339. package/dist/sdk/compose.js +51 -42
  340. package/dist/sdk/compose.js.map +1 -1
  341. package/dist/sdk/package-import-adapters.d.ts +90 -2
  342. package/dist/sdk/package-import-adapters.js +274 -2
  343. package/dist/sdk/package-import-adapters.js.map +1 -1
  344. package/dist/sdk/runtime.d.ts +1 -1
  345. package/dist/sdk/runtime.js +3 -3
  346. package/dist/sdk/runtime.js.map +1 -1
  347. package/docs/AGENT_GUIDE.md +2 -2
  348. package/docs/ARCHITECTURE.md +2 -2
  349. package/docs/COMMANDS.md +8 -4
  350. package/docs/CONFIGURATION.md +1 -1
  351. package/docs/EXTENSIONS.md +12 -12
  352. package/docs/ONBOARDING.md +4 -2
  353. package/docs/README.md +2 -0
  354. package/docs/examples/starter-extension/README.md +11 -10
  355. package/marketplace.json +3 -3
  356. package/package.json +4 -3
  357. package/packages/pm-beads/extensions/beads/runtime-loader.ts +27 -40
  358. package/packages/pm-beads/extensions/beads/runtime.ts +106 -223
  359. package/packages/pm-calendar/extensions/calendar/runtime.ts +21 -18
  360. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +9 -11
  361. package/packages/pm-todos/extensions/todos/runtime-loader.ts +48 -76
  362. package/packages/pm-todos/extensions/todos/runtime.ts +61 -257
  363. package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
  364. package/plugins/pm-claude/README.md +6 -3
  365. package/plugins/pm-claude/commands/pm-init.md +1 -1
  366. package/plugins/pm-claude/scripts/pm-mcp-server.mjs +73 -31
  367. package/plugins/pm-codex/scripts/pm-mcp-server.mjs +80 -34
  368. package/scripts/install.ps1 +7 -7
  369. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +0 -16
  370. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +0 -7
  372. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +0 -7
  373. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +0 -1
  374. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +0 -7
  375. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +0 -7
  376. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-AIAIXG7I.js.map +0 -7
  378. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +0 -1
  379. package/dist/cli-bundle/chunks/chunk-GFMSLORL.js.map +0 -7
  380. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +0 -1
  382. package/dist/cli-bundle/chunks/chunk-JXAUVO6X.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-K2VYLVX4.js.map +0 -1
  384. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +0 -7
  386. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +0 -1
  387. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +0 -1
  388. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +0 -7
  389. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +0 -7
  390. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +0 -1
  391. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +0 -1
  392. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +0 -7
  393. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +0 -7
  394. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +0 -1
  395. package/dist/cli-bundle/chunks/chunk-YPKFV2JR.js.map +0 -1
  396. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +0 -14
  397. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +0 -1
  398. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +0 -7
  399. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +0 -28
  400. package/dist/cli-bundle/chunks/files-5D65CHGE.js.map +0 -1
  401. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +0 -1
  402. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +0 -7
  403. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +0 -18
  404. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +0 -1
  405. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +0 -7
  406. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +0 -19
  407. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +0 -1
  408. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +0 -7
  409. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +0 -22
  410. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +0 -1
  411. package/dist/cli-bundle/chunks/profile-CCOKZ2IQ.js.map +0 -1
  412. package/dist/cli-bundle/chunks/profile-HUCENIEQ.js.map +0 -7
  413. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +0 -1
  414. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +0 -7
  415. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +0 -1
  416. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +0 -7
  417. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +0 -7
  418. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +0 -1
  419. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +0 -17
  420. package/dist/cli-bundle/chunks/update-MTCFES6X.js +0 -24
  421. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +0 -7
  422. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +0 -1
  423. /package/dist/cli-bundle/chunks/{activity-WEIEMM73.js.map → activity-IDS5GSYG.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js.map → activity-OENQCYZD.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js.map → aggregate-EC4LWS3U.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js.map → aggregate-RCB3QJJE.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{append-H32VOR2Y.js.map → append-ADBOI3A6.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{append-UBM632FK.js.map → append-XLEKVVWB.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js.map → chunk-2LRMWMZ6.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js.map → chunk-3C5T3ZEO.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js.map → chunk-3MLQZI3H.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js.map → chunk-4EVY7CQN.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js.map → chunk-4IW7STMB.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js.map → chunk-4SHME4VR.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js.map → chunk-6YB7HG2J.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js.map → chunk-724VLYDJ.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js.map → chunk-7ITQSEBL.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{chunk-W47SML5B.js.map → chunk-A222YWOQ.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js.map → chunk-A2W3XKAD.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js.map → chunk-AOP2EMK3.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js.map → chunk-CQFZRLXQ.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js.map → chunk-CQISNF3Z.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{chunk-S62UANU7.js.map → chunk-D2LDM35X.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js.map → chunk-DJ5S2LDY.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js.map → chunk-EB4BBEZD.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js.map → chunk-EH23N5FX.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js.map → chunk-FDNJMYZB.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js.map → chunk-HL742IBM.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js.map → chunk-M6PR5BC6.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js.map → chunk-MZ4NH46V.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js.map → chunk-N2LOJUBB.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js.map → chunk-NGDK3KEZ.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js.map → chunk-NHKXOMZ5.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js.map → chunk-OTSP6UEX.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js.map → chunk-PUVPC5DL.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js.map → chunk-PV5JS7MP.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js.map → chunk-Q2266G4S.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js.map → chunk-Q3XVLRCJ.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js.map → chunk-R7EMP4JG.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js.map → chunk-T5RTYLZJ.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js.map → chunk-TGYDJEJH.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js.map → chunk-TO4KCIOT.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js.map → chunk-TUV7SIWZ.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js.map → chunk-V655JQ5J.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js.map → chunk-W5X3AHJN.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js.map → chunk-WBWRQS32.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js.map → chunk-WOOB7PV7.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js.map → chunk-WSDIALO4.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js.map → chunk-WTXDLBSZ.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js.map → chunk-XBIYI23P.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js.map → chunk-Y2VSCQ77.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js.map → chunk-YZR7UMZ6.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js.map → chunk-ZIEGTQCY.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js.map → chunk-ZZWMJVW2.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js.map → claim-D6L33A5Y.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{claim-SENTPZBN.js.map → claim-YAFUTPVK.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{close-YCWQQPDS.js.map → close-KLDLHAOP.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{close-424MX4CU.js.map → close-TGYXG7TV.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js.map → comments-QC6ARR5X.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js.map → comments-ZHVYGUVC.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{config-G74GISC4.js.map → config-O6W2EU2G.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js.map → config-XQRFJXJP.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js.map → context-IHE3IXN5.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{context-ZQY54JNS.js.map → context-WSYWBEUL.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js.map → contracts-CVBINC7C.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js.map → contracts-NLCDIZAT.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js.map → copy-7MUQC44A.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js.map → copy-ANWXDJVC.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{create-XTMAPS7I.js.map → create-AJ6HUR5W.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{create-VSKYSOCD.js.map → create-JIA2IFCO.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js.map → delete-5OLYWQIC.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js.map → delete-INHKCIRN.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js.map → deps-CCSWGZW7.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js.map → deps-IYEID3QX.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js.map → docs-3XZK22WF.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js.map → docs-PKO7OEIM.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js.map → eval-5XYP6NMY.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js.map → eval-O4WGQYDI.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js.map → extension-PVGRRZZG.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js.map → extension-T7JNTAAA.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js.map → focus-6FA5KYRY.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js.map → focus-CQ63JFDG.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js.map → gc-3BG67KTO.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{gc-VZIXDL32.js.map → gc-PEZYGNVB.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{get-GIBRUUOP.js.map → get-J6CSJ4SX.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{get-IOVAN6RU.js.map → get-KJTKGNEQ.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{history-DD7L7BNL.js.map → history-IOH6FKG7.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{history-IL7XCEX2.js.map → history-W6QVR6FA.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js.map → history-redact-TUWOUYX5.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{history-redact-IX4YEWMY.js.map → history-redact-VVDOARNO.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{init-HHVQQP6C.js.map → init-CZLEEE6Q.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{init-F27NHENZ.js.map → init-MAA6UMNQ.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js.map → learnings-EYC3OKS2.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js.map → learnings-HKJJUVTA.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{list-VMPWTURB.js.map → list-HFD5737R.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{list-HPMEKCAA.js.map → list-KN3TL5Y5.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js.map → notes-XATYT43P.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js.map → notes-ZG6RLZXB.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js.map → plan-5NWQL2DH.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{plan-C5IMM335.js.map → plan-DVVLX7LK.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js.map → register-setup-FXZJ2CEJ.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js.map → register-setup-LYYCMQFV.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{restore-5UEAGG3W.js.map → restore-L27TMMCF.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js.map → restore-R6YJHQK3.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js.map → scheduling-shortcuts-LE4S7OI7.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js.map → scheduling-shortcuts-OGODPUBL.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js.map → schema-ICCD3HOP.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js.map → schema-RHH23PQX.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{search-FP7MEU4S.js.map → search-HDDKOPFE.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js.map → search-Z2VGP2Q5.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js.map → stats-DHMRXHOB.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js.map → stats-ETFP37MB.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js.map → telemetry-NUZNKDCP.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js.map → telemetry-ZRBM22QD.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js.map → test-H36PM746.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{test-YCDAUBWF.js.map → test-XNKTIP4Y.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js.map → test-all-APCBSXQI.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js.map → test-all-KIK3OYBY.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js.map → test-runs-5SLLV3XU.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js.map → test-runs-L3WKLO67.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{update-MTCFES6X.js.map → update-RQKI3AMW.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js.map → update-ZM7NJWHY.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js.map → update-many-GFCQG6ZQ.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js.map → update-many-XGTJ7QIU.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js.map → upgrade-KJ3JGELR.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js.map → upgrade-RBRQ7PQU.js.map} +0 -0
@@ -4,7 +4,7 @@
4
4
  * Provides CLI runtime support for Register Mutation.
5
5
  */
6
6
 
7
- !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]="6581ddaf-4643-5ccc-9aff-1569d1759846")}catch(e){}}();
7
+ !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]="506e1f95-1444-5306-9a5e-c1fb3726b2df")}catch(e){}}();
8
8
  import { Option } from "commander";
9
9
  import { resolveBodyFileContent } from "../core/io/body-file.js";
10
10
  import { EXIT_CODE } from "../core/shared/constants.js";
@@ -18,7 +18,7 @@ import { BUILTIN_ITEM_TYPE_VALUES } from "../types/index.js";
18
18
  // positional exactly matches a known type AND no --title was given, we throw
19
19
  // instead of silently creating a Task titled with the type name.
20
20
  const BUILTIN_TYPE_NAME_LOOKUP = new Set(BUILTIN_ITEM_TYPE_VALUES.map((value) => value.toLowerCase()));
21
- import { collect, extractUpdateManyMutationOptionSource, formatHookWarnings, getGlobalOptions, invalidateSearchCachesForMutation, normalizeCreateOptions, normalizeUpdateOptions, printError, printResult, writeStdout, } from "./registration-helpers.js";
21
+ import { collect, extractUpdateManyMutationOptionSource, formatHookWarnings, getGlobalOptions, invalidateSearchCachesForMutation, normalizeCreateOptions, normalizeUpdateOptions, printError, printResult, readOptionString, writeStdout, } from "./registration-helpers.js";
22
22
  /**
23
23
  * Register a flag and hide it from `--help` text while keeping it fully
24
24
  * functional as a parse-time alias. The option still appears in
@@ -33,6 +33,11 @@ function addHiddenOption(command, flags, description, repeatable) {
33
33
  }
34
34
  command.addOption(option);
35
35
  }
36
+ function addHiddenOptions(command, aliases, repeatable) {
37
+ for (const [flags, description] of aliases) {
38
+ addHiddenOption(command, flags, description, repeatable);
39
+ }
40
+ }
36
41
  const SCHEMA_SHORTHAND_RESERVED_PREFIXES = ["add-", "apply-", "list-", "remove-", "show-"];
37
42
  const SCHEMA_SHORTHAND_RESERVED_TOKENS = new Set([
38
43
  "field",
@@ -407,9 +412,6 @@ function pickStringOption(...candidates) {
407
412
  }
408
413
  return undefined;
409
414
  }
410
- function readOptionString(options, key) {
411
- return typeof options[key] === "string" ? options[key] : undefined;
412
- }
413
415
  function stringArrayOption(value) {
414
416
  if (Array.isArray(value)) {
415
417
  return value;
@@ -526,6 +528,50 @@ async function runCloseManyAction(options, command) {
526
528
  printError(`profile:command=close-many took_ms=${Date.now() - startedAt}`);
527
529
  }
528
530
  }
531
+ async function runUpdateManyAction(options, command) {
532
+ const globalOptions = getGlobalOptions(command);
533
+ const startedAt = Date.now();
534
+ const { runUpdateMany } = await import("./commands/update-many.js");
535
+ const result = await runUpdateMany({
536
+ status: readOptionString(options, "filterStatus"),
537
+ list: buildUpdateManyListOptions(options),
538
+ update: normalizeUpdateOptions(extractUpdateManyMutationOptionSource(options)),
539
+ dryRun: options.dryRun === true ? true : undefined,
540
+ rollback: readOptionString(options, "rollback"),
541
+ checkpoint: options.checkpoint === false ? false : undefined,
542
+ }, globalOptions);
543
+ await invalidateSearchCachesForMutation(globalOptions, result);
544
+ printResult(result, globalOptions);
545
+ if (globalOptions.profile) {
546
+ printError(`profile:command=update-many took_ms=${Date.now() - startedAt}`);
547
+ }
548
+ }
549
+ async function runCloseAction(id, text, options, command) {
550
+ const globalOptions = getGlobalOptions(command);
551
+ const startedAt = Date.now();
552
+ const { runClose } = await import("./commands/close.js");
553
+ const reasonFromOption = (typeof options.reason === "string" && options.reason.trim().length > 0 && options.reason) ||
554
+ (typeof options.closeReason === "string" && options.closeReason.trim().length > 0 && options.closeReason) ||
555
+ undefined;
556
+ const resolvedText = typeof text === "string" && text.length > 0 ? text : reasonFromOption;
557
+ const result = await runClose(id, resolvedText, {
558
+ author: readOptionString(options, "author"),
559
+ message: readOptionString(options, "message"),
560
+ validateClose: options.validateClose === true
561
+ ? "warn"
562
+ : readOptionString(options, "validateClose"),
563
+ force: Boolean(options.force),
564
+ duplicateOf: readOptionString(options, "duplicateOf"),
565
+ resolution: readOptionString(options, "resolution"),
566
+ expectedResult: pickStringOption(options.expectedResult, options.expected_result, options.expected),
567
+ actualResult: pickStringOption(options.actualResult, options.actual_result, options.actual),
568
+ }, globalOptions);
569
+ await invalidateSearchCachesForMutation(globalOptions, result);
570
+ printResult(result, globalOptions);
571
+ if (globalOptions.profile) {
572
+ printError(`profile:command=close took_ms=${Date.now() - startedAt}`);
573
+ }
574
+ }
529
575
  function normalizePlanAliases(options) {
530
576
  const planOptions = { ...options };
531
577
  const aliasPairs = [
@@ -791,6 +837,299 @@ async function runCommentsAction(id, text, options, command) {
791
837
  printError(`profile:command=comments took_ms=${Date.now() - startedAt}`);
792
838
  }
793
839
  }
840
+ async function runCopyAction(id, options, command) {
841
+ const globalOptions = getGlobalOptions(command);
842
+ const startedAt = Date.now();
843
+ const { runCopy } = await import("./commands/copy.js");
844
+ const result = await runCopy(id, {
845
+ title: readOptionString(options, "title"),
846
+ author: readOptionString(options, "author"),
847
+ message: readOptionString(options, "message"),
848
+ }, globalOptions);
849
+ await invalidateSearchCachesForMutation(globalOptions, result);
850
+ printResult(result, globalOptions);
851
+ if (globalOptions.profile) {
852
+ printError(`profile:command=copy took_ms=${Date.now() - startedAt}`);
853
+ }
854
+ }
855
+ async function runFocusAction(id, options, command) {
856
+ const globalOptions = getGlobalOptions(command);
857
+ const startedAt = Date.now();
858
+ const { runFocus } = await import("./commands/focus.js");
859
+ const result = await runFocus(id, { clear: options.clear === true }, globalOptions);
860
+ printResult(result, globalOptions);
861
+ if (globalOptions.profile) {
862
+ printError(`profile:command=focus took_ms=${Date.now() - startedAt}`);
863
+ }
864
+ }
865
+ async function runUpdateAction(id, options, command) {
866
+ const globalOptions = getGlobalOptions(command);
867
+ const startedAt = Date.now();
868
+ // GH-214: resolve --body-file into the existing body field before
869
+ // normalization so the rest of update is unchanged. CLI-only input alias.
870
+ if (typeof options.bodyFile === "string") {
871
+ options.body = await resolveBodyFileContent(options.bodyFile, options.body !== undefined ? String(options.body) : undefined);
872
+ delete options.bodyFile;
873
+ }
874
+ const { runUpdate } = await import("./commands/update.js");
875
+ const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);
876
+ await invalidateSearchCachesForMutation(globalOptions, result);
877
+ printResult(result, globalOptions);
878
+ if (globalOptions.profile) {
879
+ printError(`profile:command=update took_ms=${Date.now() - startedAt}`);
880
+ }
881
+ }
882
+ async function runDeleteAction(id, options, command) {
883
+ const globalOptions = getGlobalOptions(command);
884
+ const startedAt = Date.now();
885
+ const { runDelete } = await import("./commands/delete.js");
886
+ const result = await runDelete(id, {
887
+ author: readOptionString(options, "author"),
888
+ message: readOptionString(options, "message"),
889
+ force: Boolean(options.force),
890
+ dryRun: options.dryRun === true,
891
+ }, globalOptions);
892
+ if (result.dry_run !== true) {
893
+ await invalidateSearchCachesForMutation(globalOptions, result);
894
+ }
895
+ printResult(result, globalOptions);
896
+ if (globalOptions.profile) {
897
+ printError(`profile:command=delete took_ms=${Date.now() - startedAt}`);
898
+ }
899
+ }
900
+ function resolveSingleTextSource(label, positional, options) {
901
+ const addFromOption = readOptionString(options, "add");
902
+ const addFromPositional = typeof positional === "string" ? positional : undefined;
903
+ if (addFromOption !== undefined && addFromPositional !== undefined) {
904
+ throw new PmCliError(`Specify ${label} text either as positional [text] or with --add, not both`, EXIT_CODE.USAGE);
905
+ }
906
+ return addFromOption ?? addFromPositional;
907
+ }
908
+ function resolveAppendBody(text, options) {
909
+ const bodyFromOption = readOptionString(options, "body");
910
+ const bodyFromAlias = readOptionString(options, "text");
911
+ const bodyFromPositional = typeof text === "string" ? text : undefined;
912
+ const bodySourceCount = [bodyFromOption, bodyFromAlias, bodyFromPositional].filter((value) => value !== undefined).length;
913
+ if (bodySourceCount > 1) {
914
+ throw new PmCliError("Specify append text with exactly one source: positional [text], --body, or --text", EXIT_CODE.USAGE);
915
+ }
916
+ const resolvedBody = bodyFromOption ?? bodyFromAlias ?? bodyFromPositional;
917
+ if (resolvedBody === undefined) {
918
+ throw new PmCliError("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).", EXIT_CODE.USAGE);
919
+ }
920
+ return resolvedBody;
921
+ }
922
+ async function runAppendAction(id, text, options, command) {
923
+ const globalOptions = getGlobalOptions(command);
924
+ const startedAt = Date.now();
925
+ const { runAppend } = await import("./commands/append.js");
926
+ const result = await runAppend(id, {
927
+ body: resolveAppendBody(text, options),
928
+ author: readOptionString(options, "author"),
929
+ message: readOptionString(options, "message"),
930
+ force: Boolean(options.force),
931
+ }, globalOptions);
932
+ await invalidateSearchCachesForMutation(globalOptions, result);
933
+ printResult(result, globalOptions);
934
+ if (globalOptions.profile) {
935
+ printError(`profile:command=append took_ms=${Date.now() - startedAt}`);
936
+ }
937
+ }
938
+ async function runRestoreAction(id, target, options, command) {
939
+ const globalOptions = getGlobalOptions(command);
940
+ const startedAt = Date.now();
941
+ const { runRestore } = await import("./commands/restore.js");
942
+ const result = await runRestore(id, target, {
943
+ author: readOptionString(options, "author"),
944
+ message: readOptionString(options, "message"),
945
+ force: Boolean(options.force),
946
+ }, globalOptions);
947
+ await invalidateSearchCachesForMutation(globalOptions, result);
948
+ printResult(result, globalOptions);
949
+ if (globalOptions.profile) {
950
+ printError(`profile:command=restore took_ms=${Date.now() - startedAt}`);
951
+ }
952
+ }
953
+ async function runProfileAction(subcommand, name, options, command) {
954
+ const globalOptions = getGlobalOptions(command);
955
+ const startedAt = Date.now();
956
+ const profileModule = await import("./commands/profile.js");
957
+ const { PROFILE_SUBCOMMANDS } = profileModule;
958
+ const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
959
+ if (!normalizedSubcommand) {
960
+ throw new PmCliError(`pm profile requires a subcommand. Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
961
+ code: "missing_required_argument",
962
+ examples: ["pm profile list", "pm profile show agile", "pm profile apply agile --dry-run", "pm profile lint agile"],
963
+ });
964
+ }
965
+ if (!PROFILE_SUBCOMMANDS.includes(normalizedSubcommand)) {
966
+ throw new PmCliError(`Unknown pm profile subcommand "${subcommand}". Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, { code: "unknown_subcommand" });
967
+ }
968
+ const result = await dispatchProfileSubcommand(profileModule, normalizedSubcommand, name, options, globalOptions);
969
+ // Profile inspection and schema staging do not mutate item content, so search caches stay valid (mirrors pm schema).
970
+ if (globalOptions.json === true || globalOptions.defaultOutputFormat === "json") {
971
+ printResult(result, globalOptions);
972
+ }
973
+ else if (!globalOptions.quiet) {
974
+ renderProfileResultHuman(profileModule, result);
975
+ }
976
+ // `pm profile lint` is a validation gate: exit non-zero when the profile has
977
+ // error-severity findings so shell/CI callers can fail on them. Warnings keep
978
+ // `ok` true and never fail the command.
979
+ if (result.action === "lint" && !result.ok) {
980
+ process.exitCode = EXIT_CODE.GENERIC_FAILURE;
981
+ }
982
+ if (globalOptions.profile) {
983
+ printError(`profile:command=profile took_ms=${Date.now() - startedAt}`);
984
+ }
985
+ }
986
+ async function runNotesAction(id, text, options, command) {
987
+ const globalOptions = getGlobalOptions(command);
988
+ const startedAt = Date.now();
989
+ const add = resolveSingleTextSource("note", text, options);
990
+ const { runNotes } = await import("./commands/notes.js");
991
+ const result = await runNotes(id, {
992
+ add,
993
+ limit: readOptionString(options, "limit"),
994
+ author: readOptionString(options, "author"),
995
+ message: readOptionString(options, "message"),
996
+ allowAuditComment: Boolean(options.allowAuditNote || options.allowAuditComment),
997
+ force: Boolean(options.force),
998
+ }, globalOptions);
999
+ if (typeof add === "string") {
1000
+ await invalidateSearchCachesForMutation(globalOptions, result);
1001
+ }
1002
+ printResult(result, globalOptions);
1003
+ if (globalOptions.profile) {
1004
+ printError(`profile:command=notes took_ms=${Date.now() - startedAt}`);
1005
+ }
1006
+ }
1007
+ async function runLearningsAction(id, text, options, command) {
1008
+ const globalOptions = getGlobalOptions(command);
1009
+ const startedAt = Date.now();
1010
+ const add = resolveSingleTextSource("learning", text, options);
1011
+ const { runLearnings } = await import("./commands/learnings.js");
1012
+ const result = await runLearnings(id, {
1013
+ add,
1014
+ limit: readOptionString(options, "limit"),
1015
+ author: readOptionString(options, "author"),
1016
+ message: readOptionString(options, "message"),
1017
+ allowAuditComment: Boolean(options.allowAuditLearning || options.allowAuditComment),
1018
+ force: Boolean(options.force),
1019
+ }, globalOptions);
1020
+ if (typeof add === "string") {
1021
+ await invalidateSearchCachesForMutation(globalOptions, result);
1022
+ }
1023
+ printResult(result, globalOptions);
1024
+ if (globalOptions.profile) {
1025
+ printError(`profile:command=learnings took_ms=${Date.now() - startedAt}`);
1026
+ }
1027
+ }
1028
+ function readStringArrayOption(options, key) {
1029
+ return stringArrayOption(options[key]) ?? [];
1030
+ }
1031
+ async function runFilesAction(id, options, command) {
1032
+ const globalOptions = getGlobalOptions(command);
1033
+ const startedAt = Date.now();
1034
+ const addValues = readStringArrayOption(options, "add");
1035
+ const addGlobValues = readStringArrayOption(options, "addGlob");
1036
+ const removeValues = readStringArrayOption(options, "remove");
1037
+ const migrateValues = readStringArrayOption(options, "migrate");
1038
+ const { runFiles } = await import("./commands/files.js");
1039
+ const result = await runFiles(id, {
1040
+ add: addValues,
1041
+ addGlob: addGlobValues,
1042
+ remove: removeValues,
1043
+ migrate: migrateValues,
1044
+ note: readOptionString(options, "note"),
1045
+ list: Boolean(options.list),
1046
+ appendStable: Boolean(options.appendStable),
1047
+ validatePaths: Boolean(options.validatePaths),
1048
+ audit: Boolean(options.audit),
1049
+ author: readOptionString(options, "author"),
1050
+ message: readOptionString(options, "message"),
1051
+ force: Boolean(options.force),
1052
+ }, globalOptions);
1053
+ if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1054
+ await invalidateSearchCachesForMutation(globalOptions, result);
1055
+ }
1056
+ printResult(result, globalOptions);
1057
+ if (globalOptions.profile) {
1058
+ printError(`profile:command=files took_ms=${Date.now() - startedAt}`);
1059
+ }
1060
+ }
1061
+ async function runFilesDiscoverAction(id, options, command) {
1062
+ const globalOptions = getGlobalOptions(command);
1063
+ const startedAt = Date.now();
1064
+ // Flags also declared on the parent files command (--note/--append-stable/
1065
+ // --author/--message/--force) are consumed by the parent during parse, so
1066
+ // merge ancestor opts back in (own options win) instead of reading opts() alone.
1067
+ const mergedOptions = { ...command.optsWithGlobals(), ...options };
1068
+ const { runFilesDiscover } = await import("./commands/files.js");
1069
+ const result = await runFilesDiscover(id, {
1070
+ apply: Boolean(mergedOptions.apply),
1071
+ note: readOptionString(mergedOptions, "note"),
1072
+ appendStable: Boolean(mergedOptions.appendStable),
1073
+ author: readOptionString(mergedOptions, "author"),
1074
+ message: readOptionString(mergedOptions, "message"),
1075
+ force: Boolean(mergedOptions.force),
1076
+ }, globalOptions);
1077
+ if (result.changed) {
1078
+ await invalidateSearchCachesForMutation(globalOptions, result);
1079
+ }
1080
+ printResult(result, globalOptions);
1081
+ if (globalOptions.profile) {
1082
+ printError(`profile:command=files.discover took_ms=${Date.now() - startedAt}`);
1083
+ }
1084
+ }
1085
+ async function runDocsAction(id, options, command) {
1086
+ const globalOptions = getGlobalOptions(command);
1087
+ const startedAt = Date.now();
1088
+ const addValues = readStringArrayOption(options, "add");
1089
+ const addGlobValues = readStringArrayOption(options, "addGlob");
1090
+ const removeValues = readStringArrayOption(options, "remove");
1091
+ const migrateValues = readStringArrayOption(options, "migrate");
1092
+ const { runDocs } = await import("./commands/docs.js");
1093
+ const result = await runDocs(id, {
1094
+ add: addValues,
1095
+ addGlob: addGlobValues,
1096
+ remove: removeValues,
1097
+ migrate: migrateValues,
1098
+ note: readOptionString(options, "note"),
1099
+ list: Boolean(options.list),
1100
+ validatePaths: Boolean(options.validatePaths),
1101
+ audit: Boolean(options.audit),
1102
+ author: readOptionString(options, "author"),
1103
+ message: readOptionString(options, "message"),
1104
+ force: Boolean(options.force),
1105
+ }, globalOptions);
1106
+ if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1107
+ await invalidateSearchCachesForMutation(globalOptions, result);
1108
+ }
1109
+ printResult(result, globalOptions);
1110
+ if (globalOptions.profile) {
1111
+ printError(`profile:command=docs took_ms=${Date.now() - startedAt}`);
1112
+ }
1113
+ }
1114
+ async function runDepsAction(id, options, command) {
1115
+ const globalOptions = getGlobalOptions(command);
1116
+ const startedAt = Date.now();
1117
+ const { runDeps } = await import("./commands/deps.js");
1118
+ // --format and --collapse carry commander defaults ("tree"/"none"), so
1119
+ // they are always strings by the time the action runs; --maxDepth has no
1120
+ // default and may be unset. Use `as string` rather than String(...) so an
1121
+ // omitted option stays undefined instead of becoming the literal "undefined".
1122
+ const result = await runDeps(id, {
1123
+ format: options.format,
1124
+ maxDepth: readOptionString(options, "maxDepth"),
1125
+ collapse: options.collapse,
1126
+ summary: options.summary === true,
1127
+ }, globalOptions);
1128
+ printResult(result, globalOptions);
1129
+ if (globalOptions.profile) {
1130
+ printError(`profile:command=deps took_ms=${Date.now() - startedAt}`);
1131
+ }
1132
+ }
794
1133
  /**
795
1134
  * Implements register mutation commands for the public runtime surface of this module.
796
1135
  */
@@ -821,36 +1160,13 @@ export function registerMutationCommands(program) {
821
1160
  .option("--author <value>", "Mutation author")
822
1161
  .option("--message <value>", "History message")
823
1162
  .description("Copy an item into a new item id while resetting lifecycle fields.")
824
- .action(async (id, options, command) => {
825
- const globalOptions = getGlobalOptions(command);
826
- const startedAt = Date.now();
827
- const { runCopy } = await import("./commands/copy.js");
828
- const result = await runCopy(id, {
829
- title: typeof options.title === "string" ? options.title : undefined,
830
- author: typeof options.author === "string" ? options.author : undefined,
831
- message: typeof options.message === "string" ? options.message : undefined,
832
- }, globalOptions);
833
- await invalidateSearchCachesForMutation(globalOptions, result);
834
- printResult(result, globalOptions);
835
- if (globalOptions.profile) {
836
- printError(`profile:command=copy took_ms=${Date.now() - startedAt}`);
837
- }
838
- });
1163
+ .action(runCopyAction);
839
1164
  program
840
1165
  .command("focus")
841
1166
  .argument("[id]", "Item id to focus (omit to show current focus)")
842
1167
  .option("--clear", "Clear the focused item")
843
1168
  .description("Set/clear/show the session focused item that new items default --parent to.")
844
- .action(async (id, options, command) => {
845
- const globalOptions = getGlobalOptions(command);
846
- const startedAt = Date.now();
847
- const { runFocus } = await import("./commands/focus.js");
848
- const result = await runFocus(id, { clear: options.clear === true }, globalOptions);
849
- printResult(result, globalOptions);
850
- if (globalOptions.profile) {
851
- printError(`profile:command=focus took_ms=${Date.now() - startedAt}`);
852
- }
853
- });
1169
+ .action(runFocusAction);
854
1170
  const updateCommand = program
855
1171
  .command("update")
856
1172
  .argument("<id>", "Item id")
@@ -875,24 +1191,7 @@ export function registerMutationCommands(program) {
875
1191
  .option("--force", "Force ownership override");
876
1192
  addHiddenOption(updateCommand, "--allow_audit_update", "Alias for --allow-audit-update", false);
877
1193
  addHiddenOption(updateCommand, "--allow_audit_dep_update", "Alias for --allow-audit-dep-update", false);
878
- updateCommand
879
- .action(async (id, options, command) => {
880
- const globalOptions = getGlobalOptions(command);
881
- const startedAt = Date.now();
882
- // GH-214: resolve --body-file into the existing body field before
883
- // normalization so the rest of update is unchanged. CLI-only input alias.
884
- if (typeof options.bodyFile === "string") {
885
- options.body = await resolveBodyFileContent(options.bodyFile, options.body !== undefined ? String(options.body) : undefined);
886
- delete options.bodyFile;
887
- }
888
- const { runUpdate } = await import("./commands/update.js");
889
- const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);
890
- await invalidateSearchCachesForMutation(globalOptions, result);
891
- printResult(result, globalOptions);
892
- if (globalOptions.profile) {
893
- printError(`profile:command=update took_ms=${Date.now() - startedAt}`);
894
- }
895
- });
1194
+ updateCommand.action(runUpdateAction);
896
1195
  const updateManyCommand = program
897
1196
  .command("update-many")
898
1197
  .description("Bulk-update matched items with dry-run plans and rollback checkpoints.")
@@ -1000,7 +1299,7 @@ export function registerMutationCommands(program) {
1000
1299
  .option("--force", "Force ownership override");
1001
1300
  // Hidden pure snake_case underscore-duplicate aliases (kept parse-functional,
1002
1301
  // omitted from --help to save agent context).
1003
- for (const [flags, description] of [
1302
+ addHiddenOptions(updateManyCommand, [
1004
1303
  ["--filter-assignee_filter <value>", "Alias for --filter-assignee-filter"],
1005
1304
  ["--estimated_minutes <value>", "Alias for --estimated-minutes"],
1006
1305
  ["--acceptance_criteria <value>", "Alias for --acceptance-criteria"],
@@ -1018,36 +1317,14 @@ export function registerMutationCommands(program) {
1018
1317
  ["--allow_audit_update", "Alias for --allow-audit-update"],
1019
1318
  ["--allow_audit_dep_update", "Alias for --allow-audit-dep-update"],
1020
1319
  ["--filter-estimate-missing", "Alias for --filter-estimates-missing"],
1021
- ]) {
1022
- addHiddenOption(updateManyCommand, flags, description, false);
1023
- }
1024
- for (const [flags, description] of [
1320
+ ], false);
1321
+ addHiddenOptions(updateManyCommand, [
1025
1322
  ["--dep_remove <value>", "Alias for --dep-remove"],
1026
1323
  ["--type_option <value>", "Alias for --type-option"],
1027
1324
  ["--add_tags <value>", "Alias for --add-tags"],
1028
1325
  ["--remove_tags <value>", "Alias for --remove-tags"],
1029
- ]) {
1030
- addHiddenOption(updateManyCommand, flags, description, true);
1031
- }
1032
- updateManyCommand
1033
- .action(async (options, command) => {
1034
- const globalOptions = getGlobalOptions(command);
1035
- const startedAt = Date.now();
1036
- const { runUpdateMany } = await import("./commands/update-many.js");
1037
- const result = await runUpdateMany({
1038
- status: typeof options.filterStatus === "string" ? options.filterStatus : undefined,
1039
- list: buildUpdateManyListOptions(options),
1040
- update: normalizeUpdateOptions(extractUpdateManyMutationOptionSource(options)),
1041
- dryRun: options.dryRun === true ? true : undefined,
1042
- rollback: typeof options.rollback === "string" ? options.rollback : undefined,
1043
- checkpoint: options.checkpoint === false ? false : undefined,
1044
- }, globalOptions);
1045
- await invalidateSearchCachesForMutation(globalOptions, result);
1046
- printResult(result, globalOptions);
1047
- if (globalOptions.profile) {
1048
- printError(`profile:command=update-many took_ms=${Date.now() - startedAt}`);
1049
- }
1050
- });
1326
+ ], true);
1327
+ updateManyCommand.action(runUpdateManyAction);
1051
1328
  const closeCommand = program
1052
1329
  .command("close")
1053
1330
  .argument("<id>", "Item id")
@@ -1070,43 +1347,7 @@ export function registerMutationCommands(program) {
1070
1347
  // Unknown option error; the rendered help stays clean (aliases hidden).
1071
1348
  addHiddenOption(closeCommand, "--expected_result <value>", "Alias for --expected-result", false);
1072
1349
  addHiddenOption(closeCommand, "--actual_result <value>", "Alias for --actual-result", false);
1073
- closeCommand
1074
- .action(async (id, text, options, command) => {
1075
- const globalOptions = getGlobalOptions(command);
1076
- const startedAt = Date.now();
1077
- const { runClose } = await import("./commands/close.js");
1078
- const reasonFromOption = (typeof options.reason === "string" && options.reason.trim().length > 0 && options.reason) ||
1079
- (typeof options.closeReason === "string" && options.closeReason.trim().length > 0 && options.closeReason) ||
1080
- undefined;
1081
- const resolvedText = typeof text === "string" && text.length > 0 ? text : reasonFromOption;
1082
- const pickInlineString = (...candidates) => {
1083
- for (const candidate of candidates) {
1084
- if (typeof candidate === "string") {
1085
- return candidate;
1086
- }
1087
- }
1088
- return undefined;
1089
- };
1090
- const result = await runClose(id, resolvedText, {
1091
- author: typeof options.author === "string" ? options.author : undefined,
1092
- message: typeof options.message === "string" ? options.message : undefined,
1093
- validateClose: options.validateClose === true
1094
- ? "warn"
1095
- : typeof options.validateClose === "string"
1096
- ? options.validateClose
1097
- : undefined,
1098
- force: Boolean(options.force),
1099
- duplicateOf: typeof options.duplicateOf === "string" ? options.duplicateOf : undefined,
1100
- resolution: typeof options.resolution === "string" ? options.resolution : undefined,
1101
- expectedResult: pickInlineString(options.expectedResult, options.expected_result, options.expected),
1102
- actualResult: pickInlineString(options.actualResult, options.actual_result, options.actual),
1103
- }, globalOptions);
1104
- await invalidateSearchCachesForMutation(globalOptions, result);
1105
- printResult(result, globalOptions);
1106
- if (globalOptions.profile) {
1107
- printError(`profile:command=close took_ms=${Date.now() - startedAt}`);
1108
- }
1109
- });
1350
+ closeCommand.action(runCloseAction);
1110
1351
  const closeManyCommand = program
1111
1352
  .command("close-many")
1112
1353
  .description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).")
@@ -1155,24 +1396,7 @@ export function registerMutationCommands(program) {
1155
1396
  .option("--force", "Force ownership override")
1156
1397
  .option("--dry-run", "Preview the item file that would be deleted without mutating")
1157
1398
  .description("Delete an item and record the change in history.")
1158
- .action(async (id, options, command) => {
1159
- const globalOptions = getGlobalOptions(command);
1160
- const startedAt = Date.now();
1161
- const { runDelete } = await import("./commands/delete.js");
1162
- const result = await runDelete(id, {
1163
- author: typeof options.author === "string" ? options.author : undefined,
1164
- message: typeof options.message === "string" ? options.message : undefined,
1165
- force: Boolean(options.force),
1166
- dryRun: options.dryRun === true,
1167
- }, globalOptions);
1168
- if (result.dry_run !== true) {
1169
- await invalidateSearchCachesForMutation(globalOptions, result);
1170
- }
1171
- printResult(result, globalOptions);
1172
- if (globalOptions.profile) {
1173
- printError(`profile:command=delete took_ms=${Date.now() - startedAt}`);
1174
- }
1175
- });
1399
+ .action(runDeleteAction);
1176
1400
  program
1177
1401
  .command("append")
1178
1402
  .argument("<id>", "Item id")
@@ -1183,33 +1407,7 @@ export function registerMutationCommands(program) {
1183
1407
  .option("--message <value>", "Mutation message")
1184
1408
  .option("--force", "Force ownership override")
1185
1409
  .description("Append text to an item's body.")
1186
- .action(async (id, text, options, command) => {
1187
- const globalOptions = getGlobalOptions(command);
1188
- const startedAt = Date.now();
1189
- const bodyFromOption = typeof options.body === "string" ? options.body : undefined;
1190
- const bodyFromAlias = typeof options.text === "string" ? options.text : undefined;
1191
- const bodyFromPositional = typeof text === "string" ? text : undefined;
1192
- const bodySourceCount = [bodyFromOption, bodyFromAlias, bodyFromPositional].filter((value) => value !== undefined).length;
1193
- if (bodySourceCount > 1) {
1194
- throw new PmCliError("Specify append text with exactly one source: positional [text], --body, or --text", EXIT_CODE.USAGE);
1195
- }
1196
- const resolvedBody = bodyFromOption ?? bodyFromAlias ?? bodyFromPositional;
1197
- if (resolvedBody === undefined) {
1198
- throw new PmCliError("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).", EXIT_CODE.USAGE);
1199
- }
1200
- const { runAppend } = await import("./commands/append.js");
1201
- const result = await runAppend(id, {
1202
- body: resolvedBody,
1203
- author: typeof options.author === "string" ? options.author : undefined,
1204
- message: typeof options.message === "string" ? options.message : undefined,
1205
- force: Boolean(options.force),
1206
- }, globalOptions);
1207
- await invalidateSearchCachesForMutation(globalOptions, result);
1208
- printResult(result, globalOptions);
1209
- if (globalOptions.profile) {
1210
- printError(`profile:command=append took_ms=${Date.now() - startedAt}`);
1211
- }
1212
- });
1410
+ .action(runAppendAction);
1213
1411
  program
1214
1412
  .command("restore")
1215
1413
  .argument("<id>", "Item id")
@@ -1218,21 +1416,7 @@ export function registerMutationCommands(program) {
1218
1416
  .option("--message <value>", "History message")
1219
1417
  .option("--force", "Force ownership/lock override")
1220
1418
  .description("Restore an item to an earlier timestamp or version.")
1221
- .action(async (id, target, options, command) => {
1222
- const globalOptions = getGlobalOptions(command);
1223
- const startedAt = Date.now();
1224
- const { runRestore } = await import("./commands/restore.js");
1225
- const result = await runRestore(id, target, {
1226
- author: typeof options.author === "string" ? options.author : undefined,
1227
- message: typeof options.message === "string" ? options.message : undefined,
1228
- force: Boolean(options.force),
1229
- }, globalOptions);
1230
- await invalidateSearchCachesForMutation(globalOptions, result);
1231
- printResult(result, globalOptions);
1232
- if (globalOptions.profile) {
1233
- printError(`profile:command=restore took_ms=${Date.now() - startedAt}`);
1234
- }
1235
- });
1419
+ .action(runRestoreAction);
1236
1420
  const planCommand = program
1237
1421
  .command("plan")
1238
1422
  .description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.")
@@ -1299,7 +1483,7 @@ export function registerMutationCommands(program) {
1299
1483
  .option("--force", "Force ownership override");
1300
1484
  // Hidden pure snake_case underscore-duplicate aliases (kept parse-functional,
1301
1485
  // omitted from --help to save agent context).
1302
- for (const [flags, description] of [
1486
+ addHiddenOptions(planCommand, [
1303
1487
  ["--resume_context <value>", "Alias for --resume-context"],
1304
1488
  ["--from_search <value>", "Alias for --from-search"],
1305
1489
  ["--step_title <value>", "Alias for --step-title"],
@@ -1323,15 +1507,11 @@ export function registerMutationCommands(program) {
1323
1507
  ["--materialize_type <value>", "Alias for --materialize-type"],
1324
1508
  ["--materialize_parent <value>", "Alias for --materialize-parent"],
1325
1509
  ["--materialize_tags <value>", "Alias for --materialize-tags"],
1326
- ]) {
1327
- addHiddenOption(planCommand, flags, description, false);
1328
- }
1329
- for (const [flags, description] of [
1510
+ ], false);
1511
+ addHiddenOptions(planCommand, [
1330
1512
  ["--blocked_by <value>", "Alias for --blocked-by"],
1331
1513
  ["--depends_on <value>", "Alias for --depends-on"],
1332
- ]) {
1333
- addHiddenOption(planCommand, flags, description, true);
1334
- }
1514
+ ], true);
1335
1515
  planCommand.action(runPlanAction);
1336
1516
  void planCommand;
1337
1517
  program
@@ -1458,39 +1638,7 @@ export function registerMutationCommands(program) {
1458
1638
  .option("--author <value>", "Mutation author")
1459
1639
  .option("--force", "Force ownership/lock override")
1460
1640
  .description("List, show, apply, and lint project profiles — archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.");
1461
- profileCommand.action(async (subcommand, name, options, command) => {
1462
- const globalOptions = getGlobalOptions(command);
1463
- const startedAt = Date.now();
1464
- const profileModule = await import("./commands/profile.js");
1465
- const { PROFILE_SUBCOMMANDS } = profileModule;
1466
- const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
1467
- if (!normalizedSubcommand) {
1468
- throw new PmCliError(`pm profile requires a subcommand. Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
1469
- code: "missing_required_argument",
1470
- examples: ["pm profile list", "pm profile show agile", "pm profile apply agile --dry-run", "pm profile lint agile"],
1471
- });
1472
- }
1473
- if (!PROFILE_SUBCOMMANDS.includes(normalizedSubcommand)) {
1474
- throw new PmCliError(`Unknown pm profile subcommand "${subcommand}". Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, { code: "unknown_subcommand" });
1475
- }
1476
- const result = await dispatchProfileSubcommand(profileModule, normalizedSubcommand, name, options, globalOptions);
1477
- // Profile inspection and schema staging do not mutate item content, so search caches stay valid (mirrors pm schema).
1478
- if (globalOptions.json === true || globalOptions.defaultOutputFormat === "json") {
1479
- printResult(result, globalOptions);
1480
- }
1481
- else if (!globalOptions.quiet) {
1482
- renderProfileResultHuman(profileModule, result);
1483
- }
1484
- // `pm profile lint` is a validation gate: exit non-zero when the profile has
1485
- // error-severity findings so shell/CI callers can fail on them. Warnings keep
1486
- // `ok` true and never fail the command.
1487
- if (result.action === "lint" && !result.ok) {
1488
- process.exitCode = EXIT_CODE.GENERIC_FAILURE;
1489
- }
1490
- if (globalOptions.profile) {
1491
- printError(`profile:command=profile took_ms=${Date.now() - startedAt}`);
1492
- }
1493
- });
1641
+ profileCommand.action(runProfileAction);
1494
1642
  program
1495
1643
  .command("comments")
1496
1644
  .argument("<id>", "Item id")
@@ -1519,32 +1667,7 @@ export function registerMutationCommands(program) {
1519
1667
  .option("--allow-audit-comment", "Backward-compatible alias for --allow-audit-note")
1520
1668
  .option("--force", "Force ownership override")
1521
1669
  .description("List or add notes for an item.")
1522
- .action(async (id, text, options, command) => {
1523
- const globalOptions = getGlobalOptions(command);
1524
- const startedAt = Date.now();
1525
- const addFromOption = typeof options.add === "string" ? options.add : undefined;
1526
- const addFromPositional = typeof text === "string" ? text : undefined;
1527
- if (addFromOption !== undefined && addFromPositional !== undefined) {
1528
- throw new PmCliError("Specify note text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
1529
- }
1530
- const add = addFromOption ?? addFromPositional;
1531
- const { runNotes } = await import("./commands/notes.js");
1532
- const result = await runNotes(id, {
1533
- add,
1534
- limit: typeof options.limit === "string" ? options.limit : undefined,
1535
- author: typeof options.author === "string" ? options.author : undefined,
1536
- message: typeof options.message === "string" ? options.message : undefined,
1537
- allowAuditComment: Boolean(options.allowAuditNote || options.allowAuditComment),
1538
- force: Boolean(options.force),
1539
- }, globalOptions);
1540
- if (typeof add === "string") {
1541
- await invalidateSearchCachesForMutation(globalOptions, result);
1542
- }
1543
- printResult(result, globalOptions);
1544
- if (globalOptions.profile) {
1545
- printError(`profile:command=notes took_ms=${Date.now() - startedAt}`);
1546
- }
1547
- });
1670
+ .action(runNotesAction);
1548
1671
  program
1549
1672
  .command("learnings")
1550
1673
  .argument("<id>", "Item id")
@@ -1557,32 +1680,7 @@ export function registerMutationCommands(program) {
1557
1680
  .option("--allow-audit-comment", "Backward-compatible alias for --allow-audit-learning")
1558
1681
  .option("--force", "Force ownership override")
1559
1682
  .description("List or add learnings for an item.")
1560
- .action(async (id, text, options, command) => {
1561
- const globalOptions = getGlobalOptions(command);
1562
- const startedAt = Date.now();
1563
- const addFromOption = typeof options.add === "string" ? options.add : undefined;
1564
- const addFromPositional = typeof text === "string" ? text : undefined;
1565
- if (addFromOption !== undefined && addFromPositional !== undefined) {
1566
- throw new PmCliError("Specify learning text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
1567
- }
1568
- const add = addFromOption ?? addFromPositional;
1569
- const { runLearnings } = await import("./commands/learnings.js");
1570
- const result = await runLearnings(id, {
1571
- add,
1572
- limit: typeof options.limit === "string" ? options.limit : undefined,
1573
- author: typeof options.author === "string" ? options.author : undefined,
1574
- message: typeof options.message === "string" ? options.message : undefined,
1575
- allowAuditComment: Boolean(options.allowAuditLearning || options.allowAuditComment),
1576
- force: Boolean(options.force),
1577
- }, globalOptions);
1578
- if (typeof add === "string") {
1579
- await invalidateSearchCachesForMutation(globalOptions, result);
1580
- }
1581
- printResult(result, globalOptions);
1582
- if (globalOptions.profile) {
1583
- printError(`profile:command=learnings took_ms=${Date.now() - startedAt}`);
1584
- }
1585
- });
1683
+ .action(runLearningsAction);
1586
1684
  const filesCommand = program
1587
1685
  .command("files")
1588
1686
  .description("Manage files linked to an item.");
@@ -1600,36 +1698,7 @@ export function registerMutationCommands(program) {
1600
1698
  .option("--author <value>", "Mutation author")
1601
1699
  .option("--message <value>", "History message")
1602
1700
  .option("--force", "Force ownership override")
1603
- .action(async (id, options, command) => {
1604
- const globalOptions = getGlobalOptions(command);
1605
- const startedAt = Date.now();
1606
- const addValues = Array.isArray(options.add) ? options.add : [];
1607
- const addGlobValues = Array.isArray(options.addGlob) ? options.addGlob : [];
1608
- const removeValues = Array.isArray(options.remove) ? options.remove : [];
1609
- const migrateValues = Array.isArray(options.migrate) ? options.migrate : [];
1610
- const { runFiles } = await import("./commands/files.js");
1611
- const result = await runFiles(id, {
1612
- add: addValues,
1613
- addGlob: addGlobValues,
1614
- remove: removeValues,
1615
- migrate: migrateValues,
1616
- note: typeof options.note === "string" ? options.note : undefined,
1617
- list: Boolean(options.list),
1618
- appendStable: Boolean(options.appendStable),
1619
- validatePaths: Boolean(options.validatePaths),
1620
- audit: Boolean(options.audit),
1621
- author: typeof options.author === "string" ? options.author : undefined,
1622
- message: typeof options.message === "string" ? options.message : undefined,
1623
- force: Boolean(options.force),
1624
- }, globalOptions);
1625
- if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1626
- await invalidateSearchCachesForMutation(globalOptions, result);
1627
- }
1628
- printResult(result, globalOptions);
1629
- if (globalOptions.profile) {
1630
- printError(`profile:command=files took_ms=${Date.now() - startedAt}`);
1631
- }
1632
- });
1701
+ .action(runFilesAction);
1633
1702
  filesCommand
1634
1703
  .command("discover")
1635
1704
  .argument("<id>", "Item id")
@@ -1640,30 +1709,7 @@ export function registerMutationCommands(program) {
1640
1709
  .option("--message <value>", "History message")
1641
1710
  .option("--force", "Force ownership override")
1642
1711
  .description("Discover existing file paths referenced in item text and optionally link missing files.")
1643
- .action(async (id, options, command) => {
1644
- const globalOptions = getGlobalOptions(command);
1645
- const startedAt = Date.now();
1646
- // Flags also declared on the parent files command (--note/--append-stable/
1647
- // --author/--message/--force) are consumed by the parent during parse, so
1648
- // merge ancestor opts back in (own options win) instead of reading opts() alone.
1649
- const mergedOptions = { ...command.optsWithGlobals(), ...options };
1650
- const { runFilesDiscover } = await import("./commands/files.js");
1651
- const result = await runFilesDiscover(id, {
1652
- apply: Boolean(mergedOptions.apply),
1653
- note: typeof mergedOptions.note === "string" ? mergedOptions.note : undefined,
1654
- appendStable: Boolean(mergedOptions.appendStable),
1655
- author: typeof mergedOptions.author === "string" ? mergedOptions.author : undefined,
1656
- message: typeof mergedOptions.message === "string" ? mergedOptions.message : undefined,
1657
- force: Boolean(mergedOptions.force),
1658
- }, globalOptions);
1659
- if (result.changed) {
1660
- await invalidateSearchCachesForMutation(globalOptions, result);
1661
- }
1662
- printResult(result, globalOptions);
1663
- if (globalOptions.profile) {
1664
- printError(`profile:command=files.discover took_ms=${Date.now() - startedAt}`);
1665
- }
1666
- });
1712
+ .action(runFilesDiscoverAction);
1667
1713
  program
1668
1714
  .command("docs")
1669
1715
  .argument("<id>", "Item id")
@@ -1679,35 +1725,7 @@ export function registerMutationCommands(program) {
1679
1725
  .option("--message <value>", "History message")
1680
1726
  .option("--force", "Force ownership override")
1681
1727
  .description("Manage docs linked to an item.")
1682
- .action(async (id, options, command) => {
1683
- const globalOptions = getGlobalOptions(command);
1684
- const startedAt = Date.now();
1685
- const addValues = Array.isArray(options.add) ? options.add : [];
1686
- const addGlobValues = Array.isArray(options.addGlob) ? options.addGlob : [];
1687
- const removeValues = Array.isArray(options.remove) ? options.remove : [];
1688
- const migrateValues = Array.isArray(options.migrate) ? options.migrate : [];
1689
- const { runDocs } = await import("./commands/docs.js");
1690
- const result = await runDocs(id, {
1691
- add: addValues,
1692
- addGlob: addGlobValues,
1693
- remove: removeValues,
1694
- migrate: migrateValues,
1695
- note: typeof options.note === "string" ? options.note : undefined,
1696
- list: Boolean(options.list),
1697
- validatePaths: Boolean(options.validatePaths),
1698
- audit: Boolean(options.audit),
1699
- author: typeof options.author === "string" ? options.author : undefined,
1700
- message: typeof options.message === "string" ? options.message : undefined,
1701
- force: Boolean(options.force),
1702
- }, globalOptions);
1703
- if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1704
- await invalidateSearchCachesForMutation(globalOptions, result);
1705
- }
1706
- printResult(result, globalOptions);
1707
- if (globalOptions.profile) {
1708
- printError(`profile:command=docs took_ms=${Date.now() - startedAt}`);
1709
- }
1710
- });
1728
+ .action(runDocsAction);
1711
1729
  program
1712
1730
  .command("deps")
1713
1731
  .argument("<id>", "Item id")
@@ -1716,25 +1734,7 @@ export function registerMutationCommands(program) {
1716
1734
  .option("--collapse <value>", "Collapse mode (none or repeated)", "none")
1717
1735
  .option("--summary", "Return counts only without full tree/graph payload")
1718
1736
  .description("Show dependency relationships for an item.")
1719
- .action(async (id, options, command) => {
1720
- const globalOptions = getGlobalOptions(command);
1721
- const startedAt = Date.now();
1722
- const { runDeps } = await import("./commands/deps.js");
1723
- // --format and --collapse carry commander defaults ("tree"/"none"), so
1724
- // they are always strings by the time the action runs; --maxDepth has no
1725
- // default and may be unset. Use `as string` rather than String(...) so an
1726
- // omitted option stays undefined instead of becoming the literal "undefined".
1727
- const result = await runDeps(id, {
1728
- format: options.format,
1729
- maxDepth: typeof options.maxDepth === "string" ? options.maxDepth : undefined,
1730
- collapse: options.collapse,
1731
- summary: options.summary === true,
1732
- }, globalOptions);
1733
- printResult(result, globalOptions);
1734
- if (globalOptions.profile) {
1735
- printError(`profile:command=deps took_ms=${Date.now() - startedAt}`);
1736
- }
1737
- });
1737
+ .action(runDepsAction);
1738
1738
  }
1739
1739
  //# sourceMappingURL=register-mutation.js.map
1740
- //# debugId=6581ddaf-4643-5ccc-9aff-1569d1759846
1740
+ //# debugId=506e1f95-1444-5306-9a5e-c1fb3726b2df