@unbrained/pm-cli 2026.7.1 → 2026.7.3

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 (625) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +25 -0
  3. package/CONTRIBUTING.md +2 -2
  4. package/README.md +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +110 -86
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/activity.js +79 -57
  9. package/dist/cli/commands/activity.js.map +1 -1
  10. package/dist/cli/commands/aggregate.js +102 -79
  11. package/dist/cli/commands/aggregate.js.map +1 -1
  12. package/dist/cli/commands/calendar.js +278 -243
  13. package/dist/cli/commands/calendar.js.map +1 -1
  14. package/dist/cli/commands/close-many.js +176 -114
  15. package/dist/cli/commands/close-many.js.map +1 -1
  16. package/dist/cli/commands/close.js +157 -129
  17. package/dist/cli/commands/close.js.map +1 -1
  18. package/dist/cli/commands/comments-audit.js +50 -42
  19. package/dist/cli/commands/comments-audit.js.map +1 -1
  20. package/dist/cli/commands/config.d.ts +2 -0
  21. package/dist/cli/commands/config.js +443 -879
  22. package/dist/cli/commands/config.js.map +1 -1
  23. package/dist/cli/commands/context.js +365 -287
  24. package/dist/cli/commands/context.js.map +1 -1
  25. package/dist/cli/commands/contracts.js +352 -238
  26. package/dist/cli/commands/contracts.js.map +1 -1
  27. package/dist/cli/commands/create.js +32 -17
  28. package/dist/cli/commands/create.js.map +1 -1
  29. package/dist/cli/commands/dedupe-audit.js +46 -39
  30. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  31. package/dist/cli/commands/dedupe-merge.js +88 -69
  32. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +56 -67
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/shared.js +21 -15
  36. package/dist/cli/commands/extension/shared.js.map +1 -1
  37. package/dist/cli/commands/get.js +114 -81
  38. package/dist/cli/commands/get.js.map +1 -1
  39. package/dist/cli/commands/health.d.ts +17 -0
  40. package/dist/cli/commands/health.js +545 -417
  41. package/dist/cli/commands/health.js.map +1 -1
  42. package/dist/cli/commands/history-compact.js +209 -140
  43. package/dist/cli/commands/history-compact.js.map +1 -1
  44. package/dist/cli/commands/history-redact.js +162 -119
  45. package/dist/cli/commands/history-redact.js.map +1 -1
  46. package/dist/cli/commands/history-repair.js +120 -85
  47. package/dist/cli/commands/history-repair.js.map +1 -1
  48. package/dist/cli/commands/init-agent-guidance.js +32 -19
  49. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  50. package/dist/cli/commands/init.d.ts +8 -2
  51. package/dist/cli/commands/init.js +263 -162
  52. package/dist/cli/commands/init.js.map +1 -1
  53. package/dist/cli/commands/list.js +152 -102
  54. package/dist/cli/commands/list.js.map +1 -1
  55. package/dist/cli/commands/next.js +60 -40
  56. package/dist/cli/commands/next.js.map +1 -1
  57. package/dist/cli/commands/plan.js +373 -298
  58. package/dist/cli/commands/plan.js.map +1 -1
  59. package/dist/cli/commands/profile.js +23 -15
  60. package/dist/cli/commands/profile.js.map +1 -1
  61. package/dist/cli/commands/recurrence-parsers.js +43 -25
  62. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  63. package/dist/cli/commands/reindex.d.ts +21 -5
  64. package/dist/cli/commands/reindex.js +345 -205
  65. package/dist/cli/commands/reindex.js.map +1 -1
  66. package/dist/cli/commands/restore.d.ts +8 -7
  67. package/dist/cli/commands/restore.js +105 -69
  68. package/dist/cli/commands/restore.js.map +1 -1
  69. package/dist/cli/commands/schema.js +33 -30
  70. package/dist/cli/commands/schema.js.map +1 -1
  71. package/dist/cli/commands/search.d.ts +10 -2
  72. package/dist/cli/commands/search.js +503 -470
  73. package/dist/cli/commands/search.js.map +1 -1
  74. package/dist/cli/commands/telemetry.js +98 -87
  75. package/dist/cli/commands/telemetry.js.map +1 -1
  76. package/dist/cli/commands/test-all.js +237 -168
  77. package/dist/cli/commands/test-all.js.map +1 -1
  78. package/dist/cli/commands/test.d.ts +6 -5
  79. package/dist/cli/commands/test.js +424 -344
  80. package/dist/cli/commands/test.js.map +1 -1
  81. package/dist/cli/commands/update-many.js +57 -42
  82. package/dist/cli/commands/update-many.js.map +1 -1
  83. package/dist/cli/commands/update.d.ts +1 -1
  84. package/dist/cli/commands/update.js +738 -671
  85. package/dist/cli/commands/update.js.map +1 -1
  86. package/dist/cli/commands/validate.d.ts +20 -1
  87. package/dist/cli/commands/validate.js +478 -343
  88. package/dist/cli/commands/validate.js.map +1 -1
  89. package/dist/cli/error-guidance.js +406 -361
  90. package/dist/cli/error-guidance.js.map +1 -1
  91. package/dist/cli/extension-command-help.js +27 -19
  92. package/dist/cli/extension-command-help.js.map +1 -1
  93. package/dist/cli/help-json-payload.js +57 -49
  94. package/dist/cli/help-json-payload.js.map +1 -1
  95. package/dist/cli/main.d.ts +47 -0
  96. package/dist/cli/main.js +474 -371
  97. package/dist/cli/main.js.map +1 -1
  98. package/dist/cli/migration-gates.js +22 -45
  99. package/dist/cli/migration-gates.js.map +1 -1
  100. package/dist/cli/register-list-query.js +299 -310
  101. package/dist/cli/register-list-query.js.map +1 -1
  102. package/dist/cli/register-mutation.js +763 -779
  103. package/dist/cli/register-mutation.js.map +1 -1
  104. package/dist/cli/register-operations.js +386 -362
  105. package/dist/cli/register-operations.js.map +1 -1
  106. package/dist/cli/register-setup.js +120 -101
  107. package/dist/cli/register-setup.js.map +1 -1
  108. package/dist/cli/registration-helpers.d.ts +4 -0
  109. package/dist/cli/registration-helpers.js +45 -56
  110. package/dist/cli/registration-helpers.js.map +1 -1
  111. package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
  112. package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
  113. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
  114. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
  115. package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
  116. package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
  118. package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
  119. package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
  120. package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
  121. package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
  123. package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
  126. package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
  127. package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
  128. package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
  133. package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
  134. package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
  136. package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
  140. package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
  141. package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
  142. package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
  144. package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  146. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  147. package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
  148. package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
  150. package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
  152. package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
  154. package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
  156. package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
  158. package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
  159. package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
  162. package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
  164. package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
  166. package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
  168. package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
  170. package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
  172. package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
  173. package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
  175. package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
  177. package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
  179. package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
  180. package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
  182. package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
  184. package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
  186. package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
  188. package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
  190. package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
  191. package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
  193. package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
  194. package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
  196. package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
  198. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
  199. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
  200. package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
  202. package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
  204. package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
  206. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
  208. package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
  209. package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
  210. package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
  211. package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
  212. package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
  213. package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
  214. package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
  216. package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
  218. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
  219. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
  220. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
  221. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
  222. package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
  223. package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
  225. package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
  226. package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
  227. package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
  228. package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
  229. package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
  230. package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
  231. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
  232. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
  233. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
  234. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
  235. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
  236. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
  237. package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
  238. package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
  239. package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
  240. package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
  241. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  242. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  243. package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
  244. package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
  246. package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
  248. package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
  249. package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
  250. package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
  251. package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
  252. package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
  254. package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
  256. package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
  257. package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
  258. package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
  259. package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
  260. package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
  262. package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
  263. package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
  264. package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
  265. package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
  266. package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
  267. package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
  268. package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
  269. package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
  270. package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
  271. package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
  272. package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
  273. package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
  274. package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
  275. package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
  276. package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
  277. package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
  278. package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
  279. package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
  280. package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
  281. package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
  282. package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
  283. package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
  284. package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
  285. package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
  286. package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
  287. package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
  288. package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
  289. package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
  290. package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
  291. package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
  292. package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
  294. package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
  295. package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
  296. package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
  297. package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
  298. package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
  299. package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
  300. package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
  301. package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
  302. package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
  303. package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
  304. package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
  306. package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
  307. package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
  308. package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
  309. package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
  310. package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
  311. package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
  312. package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
  313. package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
  314. package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
  315. package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
  316. package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
  317. package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
  318. package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
  319. package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
  320. package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
  322. package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
  323. package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
  324. package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
  325. package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
  326. package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
  327. package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
  328. package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
  329. package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
  330. package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
  331. package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
  332. package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
  333. package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
  334. package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
  335. package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
  336. package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
  337. package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
  338. package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
  339. package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
  340. package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
  341. package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
  342. package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
  343. package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
  344. package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
  345. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
  346. package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
  347. package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
  348. package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
  349. package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
  350. package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
  351. package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
  352. package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
  353. package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
  354. package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
  355. package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
  356. package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
  357. package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
  358. package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
  359. package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
  360. package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
  361. package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
  362. package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
  363. package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
  364. package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
  365. package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
  366. package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
  367. package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
  368. package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
  369. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
  370. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
  371. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
  372. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
  373. package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
  374. package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
  375. package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
  376. package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
  377. package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
  378. package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
  379. package/dist/cli-bundle/main.js +1107 -916
  380. package/dist/cli-bundle/main.js.map +3 -3
  381. package/dist/core/config/nested-settings.js +89 -67
  382. package/dist/core/config/nested-settings.js.map +1 -1
  383. package/dist/core/governance/metadata-coverage.js +20 -28
  384. package/dist/core/governance/metadata-coverage.js.map +1 -1
  385. package/dist/core/history/drift-scan.js +93 -81
  386. package/dist/core/history/drift-scan.js.map +1 -1
  387. package/dist/core/item/item-type-definition.js +14 -14
  388. package/dist/core/item/item-type-definition.js.map +1 -1
  389. package/dist/core/item/type-registry.js +114 -99
  390. package/dist/core/item/type-registry.js.map +1 -1
  391. package/dist/core/output/mutation-projection.js +42 -26
  392. package/dist/core/output/mutation-projection.js.map +1 -1
  393. package/dist/core/schema/runtime-schema.js +97 -80
  394. package/dist/core/schema/runtime-schema.js.map +1 -1
  395. package/dist/core/schema/status-defs-file.js +26 -3
  396. package/dist/core/schema/status-defs-file.js.map +1 -1
  397. package/dist/core/search/corpus.js +25 -19
  398. package/dist/core/search/corpus.js.map +1 -1
  399. package/dist/core/search/semantic-defaults.js +64 -37
  400. package/dist/core/search/semantic-defaults.js.map +1 -1
  401. package/dist/core/search/vector-stores.js +32 -17
  402. package/dist/core/search/vector-stores.js.map +1 -1
  403. package/dist/core/sentry/helpers.js +31 -28
  404. package/dist/core/sentry/helpers.js.map +1 -1
  405. package/dist/core/sentry/instrument.js +54 -43
  406. package/dist/core/sentry/instrument.js.map +1 -1
  407. package/dist/core/shared/memo.d.ts +12 -0
  408. package/dist/core/shared/memo.js +25 -0
  409. package/dist/core/shared/memo.js.map +1 -0
  410. package/dist/core/shared/serialization.js +24 -14
  411. package/dist/core/shared/serialization.js.map +1 -1
  412. package/dist/core/shared/time.js +26 -4
  413. package/dist/core/shared/time.js.map +1 -1
  414. package/dist/core/store/front-matter-cache.d.ts +5 -0
  415. package/dist/core/store/front-matter-cache.js +316 -171
  416. package/dist/core/store/front-matter-cache.js.map +1 -1
  417. package/dist/core/store/item-store.js +33 -26
  418. package/dist/core/store/item-store.js.map +1 -1
  419. package/dist/core/store/settings.js +247 -203
  420. package/dist/core/store/settings.js.map +1 -1
  421. package/dist/core/test/background-runs.js +189 -160
  422. package/dist/core/test/background-runs.js.map +1 -1
  423. package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
  424. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  425. package/dist/sdk/compose.js +51 -42
  426. package/dist/sdk/compose.js.map +1 -1
  427. package/docs/AGENT_GUIDE.md +2 -2
  428. package/docs/ARCHITECTURE.md +2 -2
  429. package/docs/COMMANDS.md +8 -4
  430. package/docs/CONFIGURATION.md +1 -1
  431. package/docs/EXTENSIONS.md +12 -12
  432. package/docs/ONBOARDING.md +4 -2
  433. package/docs/README.md +2 -0
  434. package/docs/examples/starter-extension/README.md +11 -10
  435. package/marketplace.json +3 -3
  436. package/package.json +2 -2
  437. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  438. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  439. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  440. package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
  441. package/plugins/pm-claude/README.md +6 -3
  442. package/plugins/pm-claude/commands/pm-init.md +1 -1
  443. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
  444. package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
  445. package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
  447. package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
  469. package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
  470. package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
  478. package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
  479. package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
  481. package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
  483. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
  484. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
  485. package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
  486. package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
  487. package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
  488. package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
  489. package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
  490. package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
  491. package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
  492. package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
  493. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
  494. package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
  495. package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
  496. package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
  497. package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
  498. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
  499. package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
  500. package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
  501. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
  502. package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
  503. package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
  504. package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
  505. package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
  506. package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
  507. package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
  508. package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
  509. package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
  510. package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
  511. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
  512. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
  513. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
  514. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
  515. package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
  516. package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
  517. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
  518. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
  522. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
  523. package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
  524. package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
  525. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
  526. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
  527. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
  528. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
  529. package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
  531. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
  532. package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
  533. package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
  534. /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
@@ -1,5 +1,5 @@
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]="83d6617e-974e-5c3a-904a-d8671268dbd1")}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]="919c1fe0-eaf0-51d1-9788-48d73b423eb3")}catch(e){}}();
3
3
  import {
4
4
  splitCommaList
5
5
  } from "./chunk-P4SESZGT.js";
@@ -10,26 +10,27 @@ import {
10
10
  getGlobalOptions,
11
11
  invalidateSearchCachesForMutation,
12
12
  normalizeCreateOptions,
13
- normalizeUpdateOptions
14
- } from "./chunk-CWFNTKQJ.js";
13
+ normalizeUpdateOptions,
14
+ readOptionString
15
+ } from "./chunk-RJH5VQHW.js";
15
16
  import {
16
17
  printError,
17
18
  printResult,
18
19
  writeStdout
19
- } from "./chunk-NWMZWYYB.js";
20
- import "./chunk-UYUYDGIB.js";
20
+ } from "./chunk-T3P7PMZP.js";
21
+ import "./chunk-OGLGI22K.js";
21
22
  import {
22
23
  CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,
23
24
  UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS
24
- } from "./chunk-HXTQJXWT.js";
25
- import "./chunk-JSU5P7VS.js";
26
- import "./chunk-QCWF6IYD.js";
27
- import "./chunk-AXIDKKAT.js";
25
+ } from "./chunk-572FKBRL.js";
26
+ import "./chunk-4WB6S4YX.js";
27
+ import "./chunk-YSDFIY7N.js";
28
+ import "./chunk-CXR3CMBQ.js";
28
29
  import {
29
30
  BUILTIN_ITEM_TYPE_VALUES,
30
31
  EXIT_CODE,
31
32
  PmCliError
32
- } from "./chunk-7R4QEMZZ.js";
33
+ } from "./chunk-L4SLHV6G.js";
33
34
 
34
35
  // dist/cli/register-mutation.js
35
36
  import { Option } from "commander";
@@ -102,6 +103,11 @@ function addHiddenOption(command, flags, description, repeatable) {
102
103
  }
103
104
  command.addOption(option);
104
105
  }
106
+ function addHiddenOptions(command, aliases, repeatable) {
107
+ for (const [flags, description] of aliases) {
108
+ addHiddenOption(command, flags, description, repeatable);
109
+ }
110
+ }
105
111
  var SCHEMA_SHORTHAND_RESERVED_PREFIXES = ["add-", "apply-", "list-", "remove-", "show-"];
106
112
  var SCHEMA_SHORTHAND_RESERVED_TOKENS = /* @__PURE__ */ new Set([
107
113
  "field",
@@ -397,107 +403,709 @@ function buildUpdateManyListOptions(options) {
397
403
  includeBody: true
398
404
  };
399
405
  }
400
- function registerMutationCommands(program) {
401
- const createCommand = program.command("create").argument("[typeOrTitle]", 'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)').argument("[title]", "Item title when the first argument is an item type").description("Create a new project management item.");
402
- registerCommanderOptionContracts(createCommand, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
403
- createCommand.option("--body-file <path>", "Load the item markdown body from a file (mutually exclusive with --body)").option("--clear-deps", "Clear dependency entries").option("--clear-comments", "Clear comments").option("--clear-notes", "Clear notes").option("--clear-learnings", "Clear learnings").option("--clear-files", "Clear linked files").option("--clear-tests", "Clear linked tests").option("--clear-docs", "Clear linked docs").option("--clear-reminders", "Clear reminders").option("--clear-events", "Clear events").option("--clear-type-options", "Clear type options").action(async (typeOrTitle, secondTitle, options, command) => {
404
- const globalOptions = getGlobalOptions(command);
405
- const startedAt = Date.now();
406
- let positionalType;
407
- let positionalTitle;
408
- if (typeof secondTitle === "string" && secondTitle.length > 0) {
409
- positionalType = typeOrTitle;
410
- positionalTitle = secondTitle;
411
- } else if (typeof typeOrTitle === "string" && typeOrTitle.length > 0) {
412
- const explicitTitleProvided = typeof options.title === "string" && options.title.trim().length > 0;
413
- if (explicitTitleProvided && options.type === void 0) {
414
- positionalType = typeOrTitle;
415
- } else {
416
- positionalTitle = typeOrTitle;
417
- }
418
- }
419
- if (positionalType === void 0 && typeof positionalTitle === "string" && positionalTitle.length > 0 && options.title === void 0 && options.type === void 0 && BUILTIN_TYPE_NAME_LOOKUP.has(positionalTitle.trim().toLowerCase())) {
420
- const matchedType = positionalTitle.trim();
421
- throw new PmCliError(`pm create needs a title \u2014 "${matchedType}" looks like an item type, not a title. Use either: pm create ${matchedType} "<title>" or pm create "<title>" --type ${matchedType}.`, EXIT_CODE.USAGE, {
422
- code: "create_positional_type_without_title",
423
- why: 'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "' + matchedType + '".',
424
- examples: [
425
- `pm create ${matchedType} "Wire up SSO for the agent harness"`,
426
- `pm create "Wire up SSO for the agent harness" --type ${matchedType}`
427
- ],
428
- nextSteps: [
429
- `Re-run with both type and title: pm create ${matchedType} "<title>"`
430
- ]
431
- });
432
- }
433
- if (typeof positionalType === "string" && positionalType.length > 0 && options.type === void 0) {
434
- options.type = positionalType;
435
- }
436
- if (typeof positionalTitle === "string" && positionalTitle.length > 0 && options.title === void 0) {
437
- options.title = positionalTitle;
406
+ function pickStringOption(...candidates) {
407
+ for (const candidate of candidates) {
408
+ if (typeof candidate === "string") {
409
+ return candidate;
438
410
  }
439
- if (typeof options.bodyFile === "string") {
440
- options.body = await resolveBodyFileContent(options.bodyFile, options.body !== void 0 ? String(options.body) : void 0);
441
- delete options.bodyFile;
442
- }
443
- const normalized = normalizeCreateOptions(options, { requireType: false });
444
- const { runCreate } = await import("./create-RLRJMRTM.js");
445
- const result = await runCreate(normalized, globalOptions);
446
- await invalidateSearchCachesForMutation(globalOptions, result);
447
- printResult(result, globalOptions);
448
- if (globalOptions.profile) {
449
- printError(`profile:command=create took_ms=${Date.now() - startedAt}`);
411
+ }
412
+ return void 0;
413
+ }
414
+ function stringArrayOption(value) {
415
+ if (Array.isArray(value)) {
416
+ return value;
417
+ }
418
+ if (typeof value === "string") {
419
+ return [value];
420
+ }
421
+ return void 0;
422
+ }
423
+ function resolveCreatePositionals(typeOrTitle, secondTitle, options) {
424
+ if (typeof secondTitle === "string" && secondTitle.length > 0) {
425
+ return { positionalType: typeOrTitle, positionalTitle: secondTitle };
426
+ }
427
+ if (typeof typeOrTitle !== "string" || typeOrTitle.length === 0) {
428
+ return { positionalType: void 0, positionalTitle: void 0 };
429
+ }
430
+ const explicitTitleProvided = typeof options.title === "string" && options.title.trim().length > 0;
431
+ return explicitTitleProvided && options.type === void 0 ? { positionalType: typeOrTitle, positionalTitle: void 0 } : { positionalType: void 0, positionalTitle: typeOrTitle };
432
+ }
433
+ function assertCreatePositionalTypeHasTitle(positionalType, positionalTitle, options) {
434
+ if (positionalType !== void 0 || typeof positionalTitle !== "string" || positionalTitle.length === 0 || options.title !== void 0 || options.type !== void 0 || !BUILTIN_TYPE_NAME_LOOKUP.has(positionalTitle.trim().toLowerCase())) {
435
+ return;
436
+ }
437
+ const matchedType = positionalTitle.trim();
438
+ throw new PmCliError(`pm create needs a title \u2014 "${matchedType}" looks like an item type, not a title. Use either: pm create ${matchedType} "<title>" or pm create "<title>" --type ${matchedType}.`, EXIT_CODE.USAGE, {
439
+ code: "create_positional_type_without_title",
440
+ why: 'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "' + matchedType + '".',
441
+ examples: [
442
+ `pm create ${matchedType} "Wire up SSO for the agent harness"`,
443
+ `pm create "Wire up SSO for the agent harness" --type ${matchedType}`
444
+ ],
445
+ nextSteps: [
446
+ `Re-run with both type and title: pm create ${matchedType} "<title>"`
447
+ ]
448
+ });
449
+ }
450
+ async function runCreateAction(typeOrTitle, secondTitle, options, command) {
451
+ const globalOptions = getGlobalOptions(command);
452
+ const startedAt = Date.now();
453
+ const positionals = resolveCreatePositionals(typeOrTitle, secondTitle, options);
454
+ assertCreatePositionalTypeHasTitle(positionals.positionalType, positionals.positionalTitle, options);
455
+ if (typeof positionals.positionalType === "string" && positionals.positionalType.length > 0 && options.type === void 0) {
456
+ options.type = positionals.positionalType;
457
+ }
458
+ if (typeof positionals.positionalTitle === "string" && positionals.positionalTitle.length > 0 && options.title === void 0) {
459
+ options.title = positionals.positionalTitle;
460
+ }
461
+ if (typeof options.bodyFile === "string") {
462
+ options.body = await resolveBodyFileContent(options.bodyFile, options.body !== void 0 ? String(options.body) : void 0);
463
+ delete options.bodyFile;
464
+ }
465
+ const normalized = normalizeCreateOptions(options, { requireType: false });
466
+ const { runCreate } = await import("./create-PM45M6PE.js");
467
+ const result = await runCreate(normalized, globalOptions);
468
+ await invalidateSearchCachesForMutation(globalOptions, result);
469
+ printResult(result, globalOptions);
470
+ if (globalOptions.profile) {
471
+ printError(`profile:command=create took_ms=${Date.now() - startedAt}`);
472
+ }
473
+ }
474
+ function buildCloseManyListOptions(options) {
475
+ return {
476
+ type: readOptionString(options, "filterType"),
477
+ tag: readOptionString(options, "filterTag"),
478
+ priority: readOptionString(options, "filterPriority"),
479
+ deadlineBefore: readOptionString(options, "filterDeadlineBefore"),
480
+ deadlineAfter: readOptionString(options, "filterDeadlineAfter"),
481
+ updatedAfter: readOptionString(options, "filterUpdatedAfter"),
482
+ updatedBefore: readOptionString(options, "filterUpdatedBefore"),
483
+ createdAfter: readOptionString(options, "filterCreatedAfter"),
484
+ createdBefore: readOptionString(options, "filterCreatedBefore"),
485
+ ids: readOptionString(options, "ids"),
486
+ assignee: readOptionString(options, "filterAssignee"),
487
+ assigneeFilter: pickStringOption(options.filterAssigneeFilter, options.filterAssignee_filter),
488
+ parent: readOptionString(options, "filterParent"),
489
+ sprint: readOptionString(options, "filterSprint"),
490
+ release: readOptionString(options, "filterRelease"),
491
+ ...mapBulkContentAndGovernanceFilters(options),
492
+ limit: readOptionString(options, "limit"),
493
+ offset: readOptionString(options, "offset")
494
+ };
495
+ }
496
+ async function runCloseManyAction(options, command) {
497
+ const globalOptions = getGlobalOptions(command);
498
+ const startedAt = Date.now();
499
+ const { runCloseMany } = await import("./close-many-JKUJMHLG.js");
500
+ const result = await runCloseMany({
501
+ status: readOptionString(options, "filterStatus"),
502
+ list: buildCloseManyListOptions(options),
503
+ reason: readOptionString(options, "reason"),
504
+ resolution: readOptionString(options, "resolution"),
505
+ expectedResult: pickStringOption(options.expectedResult, options.expected_result, options.expected),
506
+ actualResult: pickStringOption(options.actualResult, options.actual_result, options.actual),
507
+ validateClose: options.validateClose === true ? "warn" : readOptionString(options, "validateClose"),
508
+ author: readOptionString(options, "author"),
509
+ message: readOptionString(options, "message"),
510
+ force: Boolean(options.force),
511
+ dryRun: options.dryRun === true ? true : void 0,
512
+ rollback: readOptionString(options, "rollback"),
513
+ checkpoint: options.checkpoint === false ? false : void 0
514
+ }, globalOptions);
515
+ await invalidateSearchCachesForMutation(globalOptions, result);
516
+ printResult(result, globalOptions);
517
+ if (globalOptions.profile) {
518
+ printError(`profile:command=close-many took_ms=${Date.now() - startedAt}`);
519
+ }
520
+ }
521
+ async function runUpdateManyAction(options, command) {
522
+ const globalOptions = getGlobalOptions(command);
523
+ const startedAt = Date.now();
524
+ const { runUpdateMany } = await import("./update-many-BEMTDA2X.js");
525
+ const result = await runUpdateMany({
526
+ status: readOptionString(options, "filterStatus"),
527
+ list: buildUpdateManyListOptions(options),
528
+ update: normalizeUpdateOptions(extractUpdateManyMutationOptionSource(options)),
529
+ dryRun: options.dryRun === true ? true : void 0,
530
+ rollback: readOptionString(options, "rollback"),
531
+ checkpoint: options.checkpoint === false ? false : void 0
532
+ }, globalOptions);
533
+ await invalidateSearchCachesForMutation(globalOptions, result);
534
+ printResult(result, globalOptions);
535
+ if (globalOptions.profile) {
536
+ printError(`profile:command=update-many took_ms=${Date.now() - startedAt}`);
537
+ }
538
+ }
539
+ async function runCloseAction(id, text, options, command) {
540
+ const globalOptions = getGlobalOptions(command);
541
+ const startedAt = Date.now();
542
+ const { runClose } = await import("./close-AFVKPR57.js");
543
+ const reasonFromOption = typeof options.reason === "string" && options.reason.trim().length > 0 && options.reason || typeof options.closeReason === "string" && options.closeReason.trim().length > 0 && options.closeReason || void 0;
544
+ const resolvedText = typeof text === "string" && text.length > 0 ? text : reasonFromOption;
545
+ const result = await runClose(id, resolvedText, {
546
+ author: readOptionString(options, "author"),
547
+ message: readOptionString(options, "message"),
548
+ validateClose: options.validateClose === true ? "warn" : readOptionString(options, "validateClose"),
549
+ force: Boolean(options.force),
550
+ duplicateOf: readOptionString(options, "duplicateOf"),
551
+ resolution: readOptionString(options, "resolution"),
552
+ expectedResult: pickStringOption(options.expectedResult, options.expected_result, options.expected),
553
+ actualResult: pickStringOption(options.actualResult, options.actual_result, options.actual)
554
+ }, globalOptions);
555
+ await invalidateSearchCachesForMutation(globalOptions, result);
556
+ printResult(result, globalOptions);
557
+ if (globalOptions.profile) {
558
+ printError(`profile:command=close took_ms=${Date.now() - startedAt}`);
559
+ }
560
+ }
561
+ function normalizePlanAliases(options) {
562
+ const planOptions = { ...options };
563
+ const aliasPairs = [
564
+ ["blocked_by", "blockedBy"],
565
+ ["resume_context", "resumeContext"],
566
+ ["from_search", "fromSearch"],
567
+ ["step_title", "stepTitle"],
568
+ ["step_body", "stepBody"],
569
+ ["step_owner", "stepOwner"],
570
+ ["step_status", "stepStatus"],
571
+ ["step_evidence", "stepEvidence"],
572
+ ["step_blocked_reason", "stepBlockedReason"],
573
+ ["step_replacement", "stepReplacement"],
574
+ ["depends_on", "dependsOn"],
575
+ ["link_kind", "linkKind"],
576
+ ["link_note", "linkNote"],
577
+ ["promote_to_item_dep", "promoteToItemDep"],
578
+ ["allow_multiple_active", "allowMultipleActive"],
579
+ ["decision_text", "decisionText"],
580
+ ["decision_rationale", "decisionRationale"],
581
+ ["decision_evidence", "decisionEvidence"],
582
+ ["discovery_text", "discoveryText"],
583
+ ["validation_text", "validationText"],
584
+ ["validation_command", "validationCommand"],
585
+ ["validation_expected", "validationExpected"],
586
+ ["materialize_type", "materializeType"],
587
+ ["materialize_parent", "materializeParent"],
588
+ ["materialize_tags", "materializeTags"]
589
+ ];
590
+ for (const [snake, camel] of aliasPairs) {
591
+ if (planOptions[snake] !== void 0 && planOptions[camel] === void 0) {
592
+ planOptions[camel] = planOptions[snake];
450
593
  }
594
+ }
595
+ return planOptions;
596
+ }
597
+ function assertKnownPlanSubcommand(subcommand, normalized, allowed) {
598
+ if (!normalized) {
599
+ throw new PmCliError(`pm plan requires a subcommand. Allowed: ${allowed.join(", ")}`, EXIT_CODE.USAGE, {
600
+ code: "missing_required_argument",
601
+ examples: [
602
+ 'pm plan create --title "Refactor lock retry"',
603
+ "pm plan show pm-a1b2 --depth standard",
604
+ 'pm plan add-step pm-a1b2 --step-title "Read lock.ts"'
605
+ ]
606
+ });
607
+ }
608
+ if (allowed.includes(normalized)) {
609
+ return;
610
+ }
611
+ const examples = normalized === "list" || normalized === "ls" ? ["pm list --type Plan", "pm list-all --type Plan"] : void 0;
612
+ throw new PmCliError(`Unknown pm plan subcommand "${subcommand}". Allowed: ${allowed.join(", ")}`, EXIT_CODE.USAGE, examples ? { code: "unknown_subcommand", examples } : void 0);
613
+ }
614
+ function parsePlanReorderTo(normalizedSubcommand, reorderToken) {
615
+ if (normalizedSubcommand !== "reorder-step" || typeof reorderToken !== "string") {
616
+ return void 0;
617
+ }
618
+ const parsed = Number.parseInt(reorderToken, 10);
619
+ if (!Number.isFinite(parsed)) {
620
+ throw new PmCliError(`reorder-step requires an integer new order, got "${reorderToken}"`, EXIT_CODE.USAGE);
621
+ }
622
+ return parsed;
623
+ }
624
+ async function runPlanAction(subcommand, id, stepRef, reorderToken, options, command) {
625
+ const globalOptions = getGlobalOptions(command);
626
+ const startedAt = Date.now();
627
+ const { runPlan, PLAN_SUBCOMMANDS } = await import("./plan-JO6V7BXO.js");
628
+ const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
629
+ assertKnownPlanSubcommand(subcommand, normalizedSubcommand, PLAN_SUBCOMMANDS);
630
+ const planOptions = normalizePlanAliases(options);
631
+ const reorderTo = parsePlanReorderTo(normalizedSubcommand, reorderToken);
632
+ const planId = normalizedSubcommand === "create" && typeof id === "string" && id.length > 0 && planOptions.title === void 0 ? void 0 : id;
633
+ if (planId === void 0 && typeof id === "string" && id.length > 0) {
634
+ planOptions.title = id;
635
+ }
636
+ const result = await runPlan({
637
+ subcommand: normalizedSubcommand,
638
+ id: planId,
639
+ stepRef,
640
+ reorderTo,
641
+ options: planOptions,
642
+ global: globalOptions
451
643
  });
452
- program.command("copy").argument("<id>", "Source item id").option("--title <value>", "Optional title override for the copied item").option("--author <value>", "Mutation author").option("--message <value>", "History message").description("Copy an item into a new item id while resetting lifecycle fields.").action(async (id, options, command) => {
453
- const globalOptions = getGlobalOptions(command);
454
- const startedAt = Date.now();
455
- const { runCopy } = await import("./copy-DEM4DATS.js");
456
- const result = await runCopy(id, {
457
- title: typeof options.title === "string" ? options.title : void 0,
458
- author: typeof options.author === "string" ? options.author : void 0,
459
- message: typeof options.message === "string" ? options.message : void 0
644
+ await invalidateSearchCachesForMutation(globalOptions, result);
645
+ printResult(result, globalOptions);
646
+ if (globalOptions.profile) {
647
+ printError(`profile:command=plan took_ms=${Date.now() - startedAt}`);
648
+ }
649
+ }
650
+ function parseNonNegativeIntFlag(raw, flag) {
651
+ if (typeof raw !== "string") {
652
+ return void 0;
653
+ }
654
+ if (!/^\d+$/.test(raw.trim())) {
655
+ throw new PmCliError(`history-compact ${flag} must be a non-negative integer.`, EXIT_CODE.USAGE);
656
+ }
657
+ return Number.parseInt(raw, 10);
658
+ }
659
+ async function runHistoryCompactAction(id, options, command) {
660
+ const globalOptions = getGlobalOptions(command);
661
+ const startedAt = Date.now();
662
+ const { runHistoryCompact, runHistoryCompactBulk, assertHistoryCompactTarget } = await import("./history-compact-V5DNAQHH.js");
663
+ const ids = typeof options.ids === "string" ? splitCommaList(options.ids) : void 0;
664
+ const allOver = parseNonNegativeIntFlag(options.allOver, "--all-over");
665
+ const minEntries = parseNonNegativeIntFlag(options.minEntries, "--min-entries");
666
+ if (options.closed === true && options.allStreams === true) {
667
+ throw new PmCliError("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.", EXIT_CODE.USAGE);
668
+ }
669
+ const scope = options.closed === true ? "closed" : options.allStreams === true ? "all-streams" : void 0;
670
+ const isBulk = ids !== void 0 || allOver !== void 0 || scope !== void 0;
671
+ if (isBulk && typeof options.before === "string") {
672
+ throw new PmCliError("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).", EXIT_CODE.USAGE);
673
+ }
674
+ assertHistoryCompactTarget(id, { ids, allOver, scope });
675
+ if (id === void 0) {
676
+ const result = await runHistoryCompactBulk({
677
+ ids,
678
+ scope,
679
+ allOver,
680
+ minEntries,
681
+ dryRun: options.dryRun === true,
682
+ author: readOptionString(options, "author"),
683
+ message: readOptionString(options, "message"),
684
+ force: Boolean(options.force)
460
685
  }, globalOptions);
461
- await invalidateSearchCachesForMutation(globalOptions, result);
462
686
  printResult(result, globalOptions);
463
- if (globalOptions.profile) {
464
- printError(`profile:command=copy took_ms=${Date.now() - startedAt}`);
687
+ if (result.totals.items_errored > 0) {
688
+ process.exitCode = EXIT_CODE.GENERIC_FAILURE;
465
689
  }
690
+ } else {
691
+ const result = await runHistoryCompact(id, {
692
+ before: readOptionString(options, "before"),
693
+ dryRun: options.dryRun === true,
694
+ author: readOptionString(options, "author"),
695
+ message: readOptionString(options, "message"),
696
+ force: Boolean(options.force)
697
+ }, globalOptions);
698
+ printResult(result, globalOptions);
699
+ }
700
+ if (globalOptions.profile) {
701
+ printError(`profile:command=history-compact took_ms=${Date.now() - startedAt}`);
702
+ }
703
+ }
704
+ function splitCollectedCommaList(raw) {
705
+ if (!Array.isArray(raw)) {
706
+ return void 0;
707
+ }
708
+ return raw.flatMap((value) => value.split(",")).map((value) => value.trim()).filter((value) => value.length > 0);
709
+ }
710
+ async function runSchemaAction(subcommand, name, options, command) {
711
+ const globalOptions = getGlobalOptions(command);
712
+ const startedAt = Date.now();
713
+ const schemaModule = await import("./schema-IB2NZZWD.js");
714
+ const { SCHEMA_SUBCOMMANDS } = schemaModule;
715
+ let normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
716
+ let typeName = name;
717
+ assertSchemaSubcommandPresent(normalizedSubcommand, SCHEMA_SUBCOMMANDS);
718
+ if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand) && typeName === void 0 && !looksLikeSchemaSubcommandTypo(normalizedSubcommand)) {
719
+ typeName = subcommand;
720
+ normalizedSubcommand = "add-type";
721
+ }
722
+ if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand)) {
723
+ throw new PmCliError(`Unknown pm schema subcommand "${subcommand}". Allowed: ${SCHEMA_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, { code: "unknown_subcommand" });
724
+ }
725
+ const result = await dispatchSchemaSubcommand(schemaModule, {
726
+ normalizedSubcommand,
727
+ typeName,
728
+ options,
729
+ aliases: stringArrayOption(options.alias),
730
+ roles: stringArrayOption(options.role),
731
+ commands: splitCollectedCommaList(options.commands),
732
+ requiredTypes: splitCollectedCommaList(options.requiredTypes),
733
+ defaultStatus: pickStringOption(options.defaultStatus, options.default_status),
734
+ order: parseSchemaOrderOption(options.order),
735
+ minCount: parseSchemaOrderOption(options.minCount),
736
+ author: readOptionString(options, "author"),
737
+ force: Boolean(options.force),
738
+ description: readOptionString(options, "description"),
739
+ globalOptions
466
740
  });
467
- program.command("focus").argument("[id]", "Item id to focus (omit to show current focus)").option("--clear", "Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(async (id, options, command) => {
468
- const globalOptions = getGlobalOptions(command);
469
- const startedAt = Date.now();
470
- const { runFocus } = await import("./focus-DWYIG7GU.js");
471
- const result = await runFocus(id, { clear: options.clear === true }, globalOptions);
741
+ if (globalOptions.json === true || globalOptions.defaultOutputFormat === "json") {
472
742
  printResult(result, globalOptions);
473
- if (globalOptions.profile) {
474
- printError(`profile:command=focus took_ms=${Date.now() - startedAt}`);
475
- }
743
+ } else if (!globalOptions.quiet) {
744
+ renderSchemaResultHuman(schemaModule, result);
745
+ }
746
+ if (globalOptions.profile) {
747
+ printError(`profile:command=schema took_ms=${Date.now() - startedAt}`);
748
+ }
749
+ }
750
+ function assertSchemaSubcommandPresent(normalizedSubcommand, allowed) {
751
+ if (normalizedSubcommand) {
752
+ return;
753
+ }
754
+ throw new PmCliError(`pm schema requires a subcommand. Allowed: ${allowed.join(", ")}`, EXIT_CODE.USAGE, {
755
+ code: "missing_required_argument",
756
+ examples: [
757
+ "pm schema list",
758
+ "pm schema show Task",
759
+ "pm schema show-status open",
760
+ 'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',
761
+ "pm schema remove-type Spike",
762
+ "pm schema add-status review --role active --alias in_review",
763
+ "pm schema remove-status review",
764
+ "pm schema add-field severity_level --type string --commands create,update",
765
+ "pm schema list-fields",
766
+ "pm schema apply-preset agile",
767
+ "pm schema add-type --infer --min-count 10"
768
+ ]
476
769
  });
770
+ }
771
+ function resolveCommentSources(text, options) {
772
+ const editIndex = typeof options.edit === "number" ? options.edit : void 0;
773
+ const deleteIndex = typeof options.delete === "number" ? options.delete : void 0;
774
+ const addFromOption = readOptionString(options, "add");
775
+ const addFromPositional = typeof text === "string" ? text : void 0;
776
+ const readFromStdin = options.stdin === true;
777
+ const readFromFile = readOptionString(options, "file");
778
+ const sourceCount = Number(addFromOption !== void 0) + Number(addFromPositional !== void 0) + Number(readFromStdin) + Number(readFromFile !== void 0);
779
+ if (sourceCount > 1) {
780
+ if (addFromOption !== void 0 && addFromPositional !== void 0 && !readFromStdin && readFromFile === void 0) {
781
+ throw new PmCliError("Specify comment text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
782
+ }
783
+ throw new PmCliError("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file", EXIT_CODE.USAGE);
784
+ }
785
+ const add = addFromOption ?? addFromPositional;
786
+ const isMutation = typeof add === "string" || readFromStdin || readFromFile !== void 0 || editIndex !== void 0 || deleteIndex !== void 0;
787
+ return { add, readFromStdin, readFromFile, editIndex, deleteIndex, isMutation };
788
+ }
789
+ async function runCommentsAction(id, text, options, command) {
790
+ const globalOptions = getGlobalOptions(command);
791
+ const startedAt = Date.now();
792
+ const sources = resolveCommentSources(text, options);
793
+ const { runComments } = await import("./comments-RW23R3VE.js");
794
+ const result = await runComments(id, {
795
+ add: sources.add,
796
+ stdin: sources.readFromStdin,
797
+ file: sources.readFromFile,
798
+ edit: sources.editIndex,
799
+ delete: sources.deleteIndex,
800
+ limit: readOptionString(options, "limit"),
801
+ author: readOptionString(options, "author"),
802
+ message: readOptionString(options, "message"),
803
+ allowAuditComment: Boolean(options.allowAuditComment),
804
+ force: Boolean(options.force)
805
+ }, globalOptions);
806
+ if (sources.isMutation) {
807
+ await invalidateSearchCachesForMutation(globalOptions, result);
808
+ }
809
+ printResult(result, globalOptions);
810
+ if (globalOptions.profile) {
811
+ printError(`profile:command=comments took_ms=${Date.now() - startedAt}`);
812
+ }
813
+ }
814
+ async function runCopyAction(id, options, command) {
815
+ const globalOptions = getGlobalOptions(command);
816
+ const startedAt = Date.now();
817
+ const { runCopy } = await import("./copy-6XOR3HKN.js");
818
+ const result = await runCopy(id, {
819
+ title: readOptionString(options, "title"),
820
+ author: readOptionString(options, "author"),
821
+ message: readOptionString(options, "message")
822
+ }, globalOptions);
823
+ await invalidateSearchCachesForMutation(globalOptions, result);
824
+ printResult(result, globalOptions);
825
+ if (globalOptions.profile) {
826
+ printError(`profile:command=copy took_ms=${Date.now() - startedAt}`);
827
+ }
828
+ }
829
+ async function runFocusAction(id, options, command) {
830
+ const globalOptions = getGlobalOptions(command);
831
+ const startedAt = Date.now();
832
+ const { runFocus } = await import("./focus-2Q3K76G2.js");
833
+ const result = await runFocus(id, { clear: options.clear === true }, globalOptions);
834
+ printResult(result, globalOptions);
835
+ if (globalOptions.profile) {
836
+ printError(`profile:command=focus took_ms=${Date.now() - startedAt}`);
837
+ }
838
+ }
839
+ async function runUpdateAction(id, options, command) {
840
+ const globalOptions = getGlobalOptions(command);
841
+ const startedAt = Date.now();
842
+ if (typeof options.bodyFile === "string") {
843
+ options.body = await resolveBodyFileContent(options.bodyFile, options.body !== void 0 ? String(options.body) : void 0);
844
+ delete options.bodyFile;
845
+ }
846
+ const { runUpdate } = await import("./update-IKJZWLQC.js");
847
+ const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);
848
+ await invalidateSearchCachesForMutation(globalOptions, result);
849
+ printResult(result, globalOptions);
850
+ if (globalOptions.profile) {
851
+ printError(`profile:command=update took_ms=${Date.now() - startedAt}`);
852
+ }
853
+ }
854
+ async function runDeleteAction(id, options, command) {
855
+ const globalOptions = getGlobalOptions(command);
856
+ const startedAt = Date.now();
857
+ const { runDelete } = await import("./delete-LPISP43T.js");
858
+ const result = await runDelete(id, {
859
+ author: readOptionString(options, "author"),
860
+ message: readOptionString(options, "message"),
861
+ force: Boolean(options.force),
862
+ dryRun: options.dryRun === true
863
+ }, globalOptions);
864
+ if (result.dry_run !== true) {
865
+ await invalidateSearchCachesForMutation(globalOptions, result);
866
+ }
867
+ printResult(result, globalOptions);
868
+ if (globalOptions.profile) {
869
+ printError(`profile:command=delete took_ms=${Date.now() - startedAt}`);
870
+ }
871
+ }
872
+ function resolveSingleTextSource(label, positional, options) {
873
+ const addFromOption = readOptionString(options, "add");
874
+ const addFromPositional = typeof positional === "string" ? positional : void 0;
875
+ if (addFromOption !== void 0 && addFromPositional !== void 0) {
876
+ throw new PmCliError(`Specify ${label} text either as positional [text] or with --add, not both`, EXIT_CODE.USAGE);
877
+ }
878
+ return addFromOption ?? addFromPositional;
879
+ }
880
+ function resolveAppendBody(text, options) {
881
+ const bodyFromOption = readOptionString(options, "body");
882
+ const bodyFromAlias = readOptionString(options, "text");
883
+ const bodyFromPositional = typeof text === "string" ? text : void 0;
884
+ const bodySourceCount = [bodyFromOption, bodyFromAlias, bodyFromPositional].filter((value) => value !== void 0).length;
885
+ if (bodySourceCount > 1) {
886
+ throw new PmCliError("Specify append text with exactly one source: positional [text], --body, or --text", EXIT_CODE.USAGE);
887
+ }
888
+ const resolvedBody = bodyFromOption ?? bodyFromAlias ?? bodyFromPositional;
889
+ if (resolvedBody === void 0) {
890
+ throw new PmCliError("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).", EXIT_CODE.USAGE);
891
+ }
892
+ return resolvedBody;
893
+ }
894
+ async function runAppendAction(id, text, options, command) {
895
+ const globalOptions = getGlobalOptions(command);
896
+ const startedAt = Date.now();
897
+ const { runAppend } = await import("./append-JFG4WQMG.js");
898
+ const result = await runAppend(id, {
899
+ body: resolveAppendBody(text, options),
900
+ author: readOptionString(options, "author"),
901
+ message: readOptionString(options, "message"),
902
+ force: Boolean(options.force)
903
+ }, globalOptions);
904
+ await invalidateSearchCachesForMutation(globalOptions, result);
905
+ printResult(result, globalOptions);
906
+ if (globalOptions.profile) {
907
+ printError(`profile:command=append took_ms=${Date.now() - startedAt}`);
908
+ }
909
+ }
910
+ async function runRestoreAction(id, target, options, command) {
911
+ const globalOptions = getGlobalOptions(command);
912
+ const startedAt = Date.now();
913
+ const { runRestore } = await import("./restore-44IHMMZZ.js");
914
+ const result = await runRestore(id, target, {
915
+ author: readOptionString(options, "author"),
916
+ message: readOptionString(options, "message"),
917
+ force: Boolean(options.force)
918
+ }, globalOptions);
919
+ await invalidateSearchCachesForMutation(globalOptions, result);
920
+ printResult(result, globalOptions);
921
+ if (globalOptions.profile) {
922
+ printError(`profile:command=restore took_ms=${Date.now() - startedAt}`);
923
+ }
924
+ }
925
+ async function runProfileAction(subcommand, name, options, command) {
926
+ const globalOptions = getGlobalOptions(command);
927
+ const startedAt = Date.now();
928
+ const profileModule = await import("./profile-WIQY2KCV.js");
929
+ const { PROFILE_SUBCOMMANDS } = profileModule;
930
+ const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
931
+ if (!normalizedSubcommand) {
932
+ throw new PmCliError(`pm profile requires a subcommand. Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
933
+ code: "missing_required_argument",
934
+ examples: ["pm profile list", "pm profile show agile", "pm profile apply agile --dry-run", "pm profile lint agile"]
935
+ });
936
+ }
937
+ if (!PROFILE_SUBCOMMANDS.includes(normalizedSubcommand)) {
938
+ throw new PmCliError(`Unknown pm profile subcommand "${subcommand}". Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, { code: "unknown_subcommand" });
939
+ }
940
+ const result = await dispatchProfileSubcommand(profileModule, normalizedSubcommand, name, options, globalOptions);
941
+ if (globalOptions.json === true || globalOptions.defaultOutputFormat === "json") {
942
+ printResult(result, globalOptions);
943
+ } else if (!globalOptions.quiet) {
944
+ renderProfileResultHuman(profileModule, result);
945
+ }
946
+ if (result.action === "lint" && !result.ok) {
947
+ process.exitCode = EXIT_CODE.GENERIC_FAILURE;
948
+ }
949
+ if (globalOptions.profile) {
950
+ printError(`profile:command=profile took_ms=${Date.now() - startedAt}`);
951
+ }
952
+ }
953
+ async function runNotesAction(id, text, options, command) {
954
+ const globalOptions = getGlobalOptions(command);
955
+ const startedAt = Date.now();
956
+ const add = resolveSingleTextSource("note", text, options);
957
+ const { runNotes } = await import("./notes-W4UEICGF.js");
958
+ const result = await runNotes(id, {
959
+ add,
960
+ limit: readOptionString(options, "limit"),
961
+ author: readOptionString(options, "author"),
962
+ message: readOptionString(options, "message"),
963
+ allowAuditComment: Boolean(options.allowAuditNote || options.allowAuditComment),
964
+ force: Boolean(options.force)
965
+ }, globalOptions);
966
+ if (typeof add === "string") {
967
+ await invalidateSearchCachesForMutation(globalOptions, result);
968
+ }
969
+ printResult(result, globalOptions);
970
+ if (globalOptions.profile) {
971
+ printError(`profile:command=notes took_ms=${Date.now() - startedAt}`);
972
+ }
973
+ }
974
+ async function runLearningsAction(id, text, options, command) {
975
+ const globalOptions = getGlobalOptions(command);
976
+ const startedAt = Date.now();
977
+ const add = resolveSingleTextSource("learning", text, options);
978
+ const { runLearnings } = await import("./learnings-4BHWFFUV.js");
979
+ const result = await runLearnings(id, {
980
+ add,
981
+ limit: readOptionString(options, "limit"),
982
+ author: readOptionString(options, "author"),
983
+ message: readOptionString(options, "message"),
984
+ allowAuditComment: Boolean(options.allowAuditLearning || options.allowAuditComment),
985
+ force: Boolean(options.force)
986
+ }, globalOptions);
987
+ if (typeof add === "string") {
988
+ await invalidateSearchCachesForMutation(globalOptions, result);
989
+ }
990
+ printResult(result, globalOptions);
991
+ if (globalOptions.profile) {
992
+ printError(`profile:command=learnings took_ms=${Date.now() - startedAt}`);
993
+ }
994
+ }
995
+ function readStringArrayOption(options, key) {
996
+ return stringArrayOption(options[key]) ?? [];
997
+ }
998
+ async function runFilesAction(id, options, command) {
999
+ const globalOptions = getGlobalOptions(command);
1000
+ const startedAt = Date.now();
1001
+ const addValues = readStringArrayOption(options, "add");
1002
+ const addGlobValues = readStringArrayOption(options, "addGlob");
1003
+ const removeValues = readStringArrayOption(options, "remove");
1004
+ const migrateValues = readStringArrayOption(options, "migrate");
1005
+ const { runFiles } = await import("./files-6SGKHS6O.js");
1006
+ const result = await runFiles(id, {
1007
+ add: addValues,
1008
+ addGlob: addGlobValues,
1009
+ remove: removeValues,
1010
+ migrate: migrateValues,
1011
+ note: readOptionString(options, "note"),
1012
+ list: Boolean(options.list),
1013
+ appendStable: Boolean(options.appendStable),
1014
+ validatePaths: Boolean(options.validatePaths),
1015
+ audit: Boolean(options.audit),
1016
+ author: readOptionString(options, "author"),
1017
+ message: readOptionString(options, "message"),
1018
+ force: Boolean(options.force)
1019
+ }, globalOptions);
1020
+ if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1021
+ await invalidateSearchCachesForMutation(globalOptions, result);
1022
+ }
1023
+ printResult(result, globalOptions);
1024
+ if (globalOptions.profile) {
1025
+ printError(`profile:command=files took_ms=${Date.now() - startedAt}`);
1026
+ }
1027
+ }
1028
+ async function runFilesDiscoverAction(id, options, command) {
1029
+ const globalOptions = getGlobalOptions(command);
1030
+ const startedAt = Date.now();
1031
+ const mergedOptions = { ...command.optsWithGlobals(), ...options };
1032
+ const { runFilesDiscover } = await import("./files-6SGKHS6O.js");
1033
+ const result = await runFilesDiscover(id, {
1034
+ apply: Boolean(mergedOptions.apply),
1035
+ note: readOptionString(mergedOptions, "note"),
1036
+ appendStable: Boolean(mergedOptions.appendStable),
1037
+ author: readOptionString(mergedOptions, "author"),
1038
+ message: readOptionString(mergedOptions, "message"),
1039
+ force: Boolean(mergedOptions.force)
1040
+ }, globalOptions);
1041
+ if (result.changed) {
1042
+ await invalidateSearchCachesForMutation(globalOptions, result);
1043
+ }
1044
+ printResult(result, globalOptions);
1045
+ if (globalOptions.profile) {
1046
+ printError(`profile:command=files.discover took_ms=${Date.now() - startedAt}`);
1047
+ }
1048
+ }
1049
+ async function runDocsAction(id, options, command) {
1050
+ const globalOptions = getGlobalOptions(command);
1051
+ const startedAt = Date.now();
1052
+ const addValues = readStringArrayOption(options, "add");
1053
+ const addGlobValues = readStringArrayOption(options, "addGlob");
1054
+ const removeValues = readStringArrayOption(options, "remove");
1055
+ const migrateValues = readStringArrayOption(options, "migrate");
1056
+ const { runDocs } = await import("./docs-6LQ3GLM7.js");
1057
+ const result = await runDocs(id, {
1058
+ add: addValues,
1059
+ addGlob: addGlobValues,
1060
+ remove: removeValues,
1061
+ migrate: migrateValues,
1062
+ note: readOptionString(options, "note"),
1063
+ list: Boolean(options.list),
1064
+ validatePaths: Boolean(options.validatePaths),
1065
+ audit: Boolean(options.audit),
1066
+ author: readOptionString(options, "author"),
1067
+ message: readOptionString(options, "message"),
1068
+ force: Boolean(options.force)
1069
+ }, globalOptions);
1070
+ if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1071
+ await invalidateSearchCachesForMutation(globalOptions, result);
1072
+ }
1073
+ printResult(result, globalOptions);
1074
+ if (globalOptions.profile) {
1075
+ printError(`profile:command=docs took_ms=${Date.now() - startedAt}`);
1076
+ }
1077
+ }
1078
+ async function runDepsAction(id, options, command) {
1079
+ const globalOptions = getGlobalOptions(command);
1080
+ const startedAt = Date.now();
1081
+ const { runDeps } = await import("./deps-WATKQDE3.js");
1082
+ const result = await runDeps(id, {
1083
+ format: options.format,
1084
+ maxDepth: readOptionString(options, "maxDepth"),
1085
+ collapse: options.collapse,
1086
+ summary: options.summary === true
1087
+ }, globalOptions);
1088
+ printResult(result, globalOptions);
1089
+ if (globalOptions.profile) {
1090
+ printError(`profile:command=deps took_ms=${Date.now() - startedAt}`);
1091
+ }
1092
+ }
1093
+ function registerMutationCommands(program) {
1094
+ const createCommand = program.command("create").argument("[typeOrTitle]", 'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)').argument("[title]", "Item title when the first argument is an item type").description("Create a new project management item.");
1095
+ registerCommanderOptionContracts(createCommand, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
1096
+ createCommand.option("--body-file <path>", "Load the item markdown body from a file (mutually exclusive with --body)").option("--clear-deps", "Clear dependency entries").option("--clear-comments", "Clear comments").option("--clear-notes", "Clear notes").option("--clear-learnings", "Clear learnings").option("--clear-files", "Clear linked files").option("--clear-tests", "Clear linked tests").option("--clear-docs", "Clear linked docs").option("--clear-reminders", "Clear reminders").option("--clear-events", "Clear events").option("--clear-type-options", "Clear type options").action(runCreateAction);
1097
+ program.command("copy").argument("<id>", "Source item id").option("--title <value>", "Optional title override for the copied item").option("--author <value>", "Mutation author").option("--message <value>", "History message").description("Copy an item into a new item id while resetting lifecycle fields.").action(runCopyAction);
1098
+ program.command("focus").argument("[id]", "Item id to focus (omit to show current focus)").option("--clear", "Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(runFocusAction);
477
1099
  const updateCommand = program.command("update").argument("<id>", "Item id").description("Update item fields and metadata.");
478
1100
  registerCommanderOptionContracts(updateCommand, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
479
1101
  updateCommand.option("--body-file <path>", "Load the item markdown body from a file (mutually exclusive with --body)").option("--replace-deps", "Atomically replace dependency entries with the provided --dep values").option("--replace-tests", "Atomically replace linked test entries with the provided --test values").option("--clear-deps", "Clear dependency entries").option("--clear-comments", "Clear comments").option("--clear-notes", "Clear notes").option("--clear-learnings", "Clear learnings").option("--clear-files", "Clear linked files").option("--clear-tests", "Clear linked tests").option("--clear-docs", "Clear linked docs").option("--clear-reminders", "Clear reminders").option("--clear-events", "Clear events").option("--clear-type-options", "Clear type options").option("--allow-audit-update", "Allow non-owner metadata-only audit updates without requiring --force").option("--allow-audit-dep-update", "Allow non-owner append-only dependency updates without requiring --force").option("--force", "Force ownership override");
480
1102
  addHiddenOption(updateCommand, "--allow_audit_update", "Alias for --allow-audit-update", false);
481
1103
  addHiddenOption(updateCommand, "--allow_audit_dep_update", "Alias for --allow-audit-dep-update", false);
482
- updateCommand.action(async (id, options, command) => {
483
- const globalOptions = getGlobalOptions(command);
484
- const startedAt = Date.now();
485
- if (typeof options.bodyFile === "string") {
486
- options.body = await resolveBodyFileContent(options.bodyFile, options.body !== void 0 ? String(options.body) : void 0);
487
- delete options.bodyFile;
488
- }
489
- const { runUpdate } = await import("./update-KFX2SIAC.js");
490
- const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);
491
- await invalidateSearchCachesForMutation(globalOptions, result);
492
- printResult(result, globalOptions);
493
- if (globalOptions.profile) {
494
- printError(`profile:command=update took_ms=${Date.now() - startedAt}`);
495
- }
496
- });
1104
+ updateCommand.action(runUpdateAction);
497
1105
  const updateManyCommand = program.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>", "Filter by status before applying updates").option("--filter-type <value>", "Filter by item type before applying updates").option("--filter-tag <value>", "Filter by tag before applying updates").option("--filter-priority <value>", "Filter by priority before applying updates").option("--filter-deadline-before <value>", "Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>", "Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>", "Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>", "Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>", "Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>", "Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>", "Filter by assignee before applying updates").option("--filter-assignee-filter <value>", "Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>", "Filter by parent item ID before applying updates").option("--filter-sprint <value>", "Filter by sprint before applying updates").option("--filter-release <value>", "Filter by release before applying updates").option("--filter-ac-missing", "Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing", "Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing", "Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing", "Select only items missing any tracked metadata (AC, estimate, or resolution)");
498
1106
  registerBulkContentAndGovernanceFilters(updateManyCommand, "applying updates");
499
1107
  updateManyCommand.option("--ids <value>", "Restrict to an explicit comma-separated ID allowlist (intersected with other filters)").option("--limit <n>", "Limit matched item count before apply/preview").option("--offset <n>", "Skip first n matched rows before apply/preview").option("--dry-run", "Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>", "Rollback a prior update-many checkpoint ID").option("--no-checkpoint", "Disable checkpoint creation during apply mode").option("--title, -t <value>", "Set title").option("--description, -d <value>", "Set description").option("--body, -b <value>", "Set body (allow empty string)").option("--status, -s <value>", "Set status (use close command for closed)").option("--priority, -p <value>", "Set priority").option("--type <value>", "Set type").option("--tags <value>", "Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>", "Add tags additively without replacing existing (repeatable; CSV accepted)", collect).option("--remove-tags <value>", "Remove tags from the existing list (repeatable; CSV accepted)", collect).option("--deadline <value>", "Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>", "Set estimated minutes").option("--acceptance-criteria <value>", "Set acceptance criteria").option("--ac <value>", "Alias for --acceptance-criteria").option("--definition-of-ready <value>", "Set definition of ready").option("--order <value>", "Set planning order/rank integer").option("--rank <value>", "Alias for --order").option("--goal <value>", "Set goal identifier").option("--objective <value>", "Set objective identifier").option("--value <value>", "Set business value summary").option("--impact <value>", "Set business impact summary").option("--outcome <value>", "Set expected outcome summary").option("--why-now <value>", "Set why-now rationale").option("--assignee <value>", "Set assignee").option("--parent <value>", "Set parent item ID").option("--reviewer <value>", "Set reviewer").option("--risk <value>", "Set risk level").option("--confidence <value>", "Set confidence level").option("--sprint <value>", "Set sprint identifier").option("--release <value>", "Set release identifier").option("--blocked-by <value>", "Set blocked-by item ID or reason").option("--blocked-reason <value>", "Set blocked reason").option("--unblock-note <value>", "Set unblock rationale note").option("--reporter <value>", "Set issue reporter").option("--severity <value>", "Set issue severity").option("--environment <value>", "Set issue environment context").option("--repro-steps <value>", "Set issue reproduction steps").option("--resolution <value>", "Set issue resolution summary").option("--expected-result <value>", "Set issue expected behavior").option("--expected <value>", "Short alias for --expected-result").option("--actual-result <value>", "Set issue observed behavior").option("--actual <value>", "Short alias for --actual-result").option("--affected-version <value>", "Set affected version identifier").option("--fixed-version <value>", "Set fixed version identifier").option("--component <value>", "Set issue component ownership").option("--regression <value>", "Set regression marker: true|false|1|0").option("--customer-impact <value>", "Set customer impact summary").option("--dep <value>", "Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>", collect).option("--dep-remove <value>", "Remove dependency entries by id/kind/author/timestamp signature", collect).option("--replace-deps", "Atomically replace dependency entries with provided --dep values").option("--replace-tests", "Atomically replace linked tests with provided --test values").option("--comment <value>", "Add comment seed author=<value>,created_at=<iso|now>,text=<value>", collect).option("--note <value>", "Add note seed author=<value>,created_at=<iso|now>,text=<value>", collect).option("--learning <value>", "Add learning seed author=<value>,created_at=<iso|now>,text=<value>", collect).option("--file <value>", "Add linked file path=<value>,scope=<project|global>,note=<text>", collect).option("--test <value>", "Add linked test command=<value>,path=<value>,scope=<project|global>", collect).option("--doc <value>", "Add linked doc path=<value>,scope=<project|global>,note=<text>", collect).option("--reminder <value>", "Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>", collect).option("--event <value>", "Add event entry start=<iso|relative>,end=<iso|relative>,recur_*", collect).option("--type-option <value>", "Set type options key=value (repeatable)", collect).option("--unset <field>", "Clear scalar metadata field by name (repeatable)", collect).option("--clear-deps", "Clear dependency entries").option("--clear-comments", "Clear comments").option("--clear-notes", "Clear notes").option("--clear-learnings", "Clear learnings").option("--clear-files", "Clear linked files").option("--clear-tests", "Clear linked tests").option("--clear-docs", "Clear linked docs").option("--clear-reminders", "Clear reminders").option("--clear-events", "Clear events").option("--clear-type-options", "Clear type options").option("--allow-audit-update", "Allow non-owner metadata-only audit updates without requiring --force").option("--allow-audit-dep-update", "Allow non-owner append-only dependency updates without requiring --force").option("--author <value>", "Mutation author").option("--message <value>", "Mutation message").option("--force", "Force ownership override");
500
- for (const [flags, description] of [
1108
+ addHiddenOptions(updateManyCommand, [
501
1109
  ["--filter-assignee_filter <value>", "Alias for --filter-assignee-filter"],
502
1110
  ["--estimated_minutes <value>", "Alias for --estimated-minutes"],
503
1111
  ["--acceptance_criteria <value>", "Alias for --acceptance-criteria"],
@@ -515,188 +1123,30 @@ function registerMutationCommands(program) {
515
1123
  ["--allow_audit_update", "Alias for --allow-audit-update"],
516
1124
  ["--allow_audit_dep_update", "Alias for --allow-audit-dep-update"],
517
1125
  ["--filter-estimate-missing", "Alias for --filter-estimates-missing"]
518
- ]) {
519
- addHiddenOption(updateManyCommand, flags, description, false);
520
- }
521
- for (const [flags, description] of [
1126
+ ], false);
1127
+ addHiddenOptions(updateManyCommand, [
522
1128
  ["--dep_remove <value>", "Alias for --dep-remove"],
523
1129
  ["--type_option <value>", "Alias for --type-option"],
524
1130
  ["--add_tags <value>", "Alias for --add-tags"],
525
1131
  ["--remove_tags <value>", "Alias for --remove-tags"]
526
- ]) {
527
- addHiddenOption(updateManyCommand, flags, description, true);
528
- }
529
- updateManyCommand.action(async (options, command) => {
530
- const globalOptions = getGlobalOptions(command);
531
- const startedAt = Date.now();
532
- const { runUpdateMany } = await import("./update-many-RNSBX2TA.js");
533
- const result = await runUpdateMany({
534
- status: typeof options.filterStatus === "string" ? options.filterStatus : void 0,
535
- list: buildUpdateManyListOptions(options),
536
- update: normalizeUpdateOptions(extractUpdateManyMutationOptionSource(options)),
537
- dryRun: options.dryRun === true ? true : void 0,
538
- rollback: typeof options.rollback === "string" ? options.rollback : void 0,
539
- checkpoint: options.checkpoint === false ? false : void 0
540
- }, globalOptions);
541
- await invalidateSearchCachesForMutation(globalOptions, result);
542
- printResult(result, globalOptions);
543
- if (globalOptions.profile) {
544
- printError(`profile:command=update-many took_ms=${Date.now() - startedAt}`);
545
- }
546
- });
1132
+ ], true);
1133
+ updateManyCommand.action(runUpdateManyAction);
547
1134
  const closeCommand = program.command("close").argument("<id>", "Item id").argument("[text]", "Close reason text (alias: --reason)").option("-r, --reason <value>", "Close reason text (alias for positional <text>)").option("--close-reason <value>", "Close reason text (alias for positional <text>)").option("-d, --duplicate-of <id>", "Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>", "Mutation author").option("-m, --message <value>", "History message").option("--validate-close [mode]", 'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>", "Set the closure resolution summary inline (same field --validate-close strict checks; previously required a prior pm update)").option("--expected-result <value>", "Set the expected-result note inline (closure validation field)").option("--expected <value>", "Short alias for --expected-result").option("--actual-result <value>", "Set the actual-result note inline (closure validation field)").option("--actual <value>", "Short alias for --actual-result").option("--force", "Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");
548
1135
  addHiddenOption(closeCommand, "--expected_result <value>", "Alias for --expected-result", false);
549
1136
  addHiddenOption(closeCommand, "--actual_result <value>", "Alias for --actual-result", false);
550
- closeCommand.action(async (id, text, options, command) => {
551
- const globalOptions = getGlobalOptions(command);
552
- const startedAt = Date.now();
553
- const { runClose } = await import("./close-TQYAAFJP.js");
554
- const reasonFromOption = typeof options.reason === "string" && options.reason.trim().length > 0 && options.reason || typeof options.closeReason === "string" && options.closeReason.trim().length > 0 && options.closeReason || void 0;
555
- const resolvedText = typeof text === "string" && text.length > 0 ? text : reasonFromOption;
556
- const pickInlineString = (...candidates) => {
557
- for (const candidate of candidates) {
558
- if (typeof candidate === "string") {
559
- return candidate;
560
- }
561
- }
562
- return void 0;
563
- };
564
- const result = await runClose(id, resolvedText, {
565
- author: typeof options.author === "string" ? options.author : void 0,
566
- message: typeof options.message === "string" ? options.message : void 0,
567
- validateClose: options.validateClose === true ? "warn" : typeof options.validateClose === "string" ? options.validateClose : void 0,
568
- force: Boolean(options.force),
569
- duplicateOf: typeof options.duplicateOf === "string" ? options.duplicateOf : void 0,
570
- resolution: typeof options.resolution === "string" ? options.resolution : void 0,
571
- expectedResult: pickInlineString(options.expectedResult, options.expected_result, options.expected),
572
- actualResult: pickInlineString(options.actualResult, options.actual_result, options.actual)
573
- }, globalOptions);
574
- await invalidateSearchCachesForMutation(globalOptions, result);
575
- printResult(result, globalOptions);
576
- if (globalOptions.profile) {
577
- printError(`profile:command=close took_ms=${Date.now() - startedAt}`);
578
- }
579
- });
1137
+ closeCommand.action(runCloseAction);
580
1138
  const closeManyCommand = program.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>", "Filter by status before closing").option("--filter-type <value>", "Filter by item type before closing").option("--filter-tag <value>", "Filter by tag before closing").option("--filter-priority <value>", "Filter by priority before closing").option("--filter-deadline-before <value>", "Filter by deadline upper bound before closing").option("--filter-deadline-after <value>", "Filter by deadline lower bound before closing").option("--filter-updated-after <value>", "Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>", "Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>", "Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>", "Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>", "Filter by assignee before closing").option("--filter-assignee-filter <value>", "Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>", "Filter by parent item ID before closing").option("--filter-sprint <value>", "Filter by sprint before closing").option("--filter-release <value>", "Filter by release before closing");
581
1139
  registerBulkContentAndGovernanceFilters(closeManyCommand, "closing");
582
1140
  closeManyCommand.option("--ids <value>", "Restrict to an explicit comma-separated ID allowlist (intersected with other filters)").option("--limit <n>", "Limit matched item count before apply/preview").option("--offset <n>", "Skip first n matched rows before apply/preview").option("--reason <value>", "Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--resolution <value>", "Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>", "Shared expected-result note (closure-validation field)").option("--expected <value>", "Short alias for --expected-result").option("--actual-result <value>", "Shared actual-result note (closure-validation field)").option("--actual <value>", "Short alias for --actual-result").option("--validate-close [mode]", 'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Re-close already-terminal matches and override ownership").option("--dry-run", "Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>", "Rollback a prior close-many checkpoint ID").option("--no-checkpoint", "Disable checkpoint creation during apply mode");
583
1141
  addHiddenOption(closeManyCommand, "--filter-assignee_filter <value>", "Alias for --filter-assignee-filter", false);
584
1142
  addHiddenOption(closeManyCommand, "--expected_result <value>", "Alias for --expected-result", false);
585
1143
  addHiddenOption(closeManyCommand, "--actual_result <value>", "Alias for --actual-result", false);
586
- closeManyCommand.action(async (options, command) => {
587
- const globalOptions = getGlobalOptions(command);
588
- const startedAt = Date.now();
589
- const pickString = (...candidates) => {
590
- for (const candidate of candidates) {
591
- if (typeof candidate === "string") {
592
- return candidate;
593
- }
594
- }
595
- return void 0;
596
- };
597
- const { runCloseMany } = await import("./close-many-LDRVEQY2.js");
598
- const result = await runCloseMany({
599
- status: typeof options.filterStatus === "string" ? options.filterStatus : void 0,
600
- list: {
601
- type: typeof options.filterType === "string" ? options.filterType : void 0,
602
- tag: typeof options.filterTag === "string" ? options.filterTag : void 0,
603
- priority: typeof options.filterPriority === "string" ? options.filterPriority : void 0,
604
- deadlineBefore: typeof options.filterDeadlineBefore === "string" ? options.filterDeadlineBefore : void 0,
605
- deadlineAfter: typeof options.filterDeadlineAfter === "string" ? options.filterDeadlineAfter : void 0,
606
- updatedAfter: typeof options.filterUpdatedAfter === "string" ? options.filterUpdatedAfter : void 0,
607
- updatedBefore: typeof options.filterUpdatedBefore === "string" ? options.filterUpdatedBefore : void 0,
608
- createdAfter: typeof options.filterCreatedAfter === "string" ? options.filterCreatedAfter : void 0,
609
- createdBefore: typeof options.filterCreatedBefore === "string" ? options.filterCreatedBefore : void 0,
610
- ids: typeof options.ids === "string" ? options.ids : void 0,
611
- assignee: typeof options.filterAssignee === "string" ? options.filterAssignee : void 0,
612
- assigneeFilter: pickString(options.filterAssigneeFilter, options.filterAssignee_filter),
613
- parent: typeof options.filterParent === "string" ? options.filterParent : void 0,
614
- sprint: typeof options.filterSprint === "string" ? options.filterSprint : void 0,
615
- release: typeof options.filterRelease === "string" ? options.filterRelease : void 0,
616
- ...mapBulkContentAndGovernanceFilters(options),
617
- limit: typeof options.limit === "string" ? options.limit : void 0,
618
- offset: typeof options.offset === "string" ? options.offset : void 0
619
- },
620
- reason: typeof options.reason === "string" ? options.reason : void 0,
621
- resolution: typeof options.resolution === "string" ? options.resolution : void 0,
622
- expectedResult: pickString(options.expectedResult, options.expected_result, options.expected),
623
- actualResult: pickString(options.actualResult, options.actual_result, options.actual),
624
- validateClose: options.validateClose === true ? "warn" : typeof options.validateClose === "string" ? options.validateClose : void 0,
625
- author: typeof options.author === "string" ? options.author : void 0,
626
- message: typeof options.message === "string" ? options.message : void 0,
627
- force: Boolean(options.force),
628
- dryRun: options.dryRun === true ? true : void 0,
629
- rollback: typeof options.rollback === "string" ? options.rollback : void 0,
630
- checkpoint: options.checkpoint === false ? false : void 0
631
- }, globalOptions);
632
- await invalidateSearchCachesForMutation(globalOptions, result);
633
- printResult(result, globalOptions);
634
- if (globalOptions.profile) {
635
- printError(`profile:command=close-many took_ms=${Date.now() - startedAt}`);
636
- }
637
- });
638
- program.command("delete").argument("<id>", "Item id").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").option("--dry-run", "Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(async (id, options, command) => {
639
- const globalOptions = getGlobalOptions(command);
640
- const startedAt = Date.now();
641
- const { runDelete } = await import("./delete-LSVHAB4Y.js");
642
- const result = await runDelete(id, {
643
- author: typeof options.author === "string" ? options.author : void 0,
644
- message: typeof options.message === "string" ? options.message : void 0,
645
- force: Boolean(options.force),
646
- dryRun: options.dryRun === true
647
- }, globalOptions);
648
- if (result.dry_run !== true) {
649
- await invalidateSearchCachesForMutation(globalOptions, result);
650
- }
651
- printResult(result, globalOptions);
652
- if (globalOptions.profile) {
653
- printError(`profile:command=delete took_ms=${Date.now() - startedAt}`);
654
- }
655
- });
656
- program.command("append").argument("<id>", "Item id").argument("[text]", "Optional body text shorthand (equivalent to --body; use - for stdin)").option("--body <value>", "Text to append to body (or - for stdin)").option("--text <value>", "Alias for --body").option("--author <value>", "Mutation author").option("--message <value>", "Mutation message").option("--force", "Force ownership override").description("Append text to an item's body.").action(async (id, text, options, command) => {
657
- const globalOptions = getGlobalOptions(command);
658
- const startedAt = Date.now();
659
- const bodyFromOption = typeof options.body === "string" ? options.body : void 0;
660
- const bodyFromAlias = typeof options.text === "string" ? options.text : void 0;
661
- const bodyFromPositional = typeof text === "string" ? text : void 0;
662
- const bodySourceCount = [bodyFromOption, bodyFromAlias, bodyFromPositional].filter((value) => value !== void 0).length;
663
- if (bodySourceCount > 1) {
664
- throw new PmCliError("Specify append text with exactly one source: positional [text], --body, or --text", EXIT_CODE.USAGE);
665
- }
666
- const resolvedBody = bodyFromOption ?? bodyFromAlias ?? bodyFromPositional;
667
- if (resolvedBody === void 0) {
668
- throw new PmCliError("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).", EXIT_CODE.USAGE);
669
- }
670
- const { runAppend } = await import("./append-QCFJSDFL.js");
671
- const result = await runAppend(id, {
672
- body: resolvedBody,
673
- author: typeof options.author === "string" ? options.author : void 0,
674
- message: typeof options.message === "string" ? options.message : void 0,
675
- force: Boolean(options.force)
676
- }, globalOptions);
677
- await invalidateSearchCachesForMutation(globalOptions, result);
678
- printResult(result, globalOptions);
679
- if (globalOptions.profile) {
680
- printError(`profile:command=append took_ms=${Date.now() - startedAt}`);
681
- }
682
- });
683
- program.command("restore").argument("<id>", "Item id").argument("<target>", "Restore target timestamp or version number").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership/lock override").description("Restore an item to an earlier timestamp or version.").action(async (id, target, options, command) => {
684
- const globalOptions = getGlobalOptions(command);
685
- const startedAt = Date.now();
686
- const { runRestore } = await import("./restore-4MHZFJ2E.js");
687
- const result = await runRestore(id, target, {
688
- author: typeof options.author === "string" ? options.author : void 0,
689
- message: typeof options.message === "string" ? options.message : void 0,
690
- force: Boolean(options.force)
691
- }, globalOptions);
692
- await invalidateSearchCachesForMutation(globalOptions, result);
693
- printResult(result, globalOptions);
694
- if (globalOptions.profile) {
695
- printError(`profile:command=restore took_ms=${Date.now() - startedAt}`);
696
- }
697
- });
1144
+ closeManyCommand.action(runCloseManyAction);
1145
+ program.command("delete").argument("<id>", "Item id").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").option("--dry-run", "Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(runDeleteAction);
1146
+ program.command("append").argument("<id>", "Item id").argument("[text]", "Optional body text shorthand (equivalent to --body; use - for stdin)").option("--body <value>", "Text to append to body (or - for stdin)").option("--text <value>", "Alias for --body").option("--author <value>", "Mutation author").option("--message <value>", "Mutation message").option("--force", "Force ownership override").description("Append text to an item's body.").action(runAppendAction);
1147
+ program.command("restore").argument("<id>", "Item id").argument("<target>", "Restore target timestamp or version number").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership/lock override").description("Restore an item to an earlier timestamp or version.").action(runRestoreAction);
698
1148
  const planCommand = program.command("plan").description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.").argument("[subcommand]", "Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]", "Plan id (required for non-create subcommands); for create this may be the positional title").argument("[stepRef]", "Step reference: stable id (plan-step-001) or order integer").argument("[reorderTo]", "New order integer for reorder-step").option("--title <value>", "Plan title").option("--description <value>", "Plan description").option("--scope <value>", "Short scope statement of the target change or investigation").option("--parent <value>", "Parent pm item id").option("--related <value>", "Related pm item ids (repeatable, csv-friendly)", collect).option("--blocks <value>", "Pm item ids this plan blocks (repeatable, csv-friendly)", collect).option("--blocked-by <value>", "Pm item ids that block this plan (repeatable, csv-friendly)", collect).option("--harness <value>", "Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>", "Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>", "Compact context summary for a future stateless agent").option("--tags <value>", "Comma-separated tags").option("--priority <value>", "Priority 0-4").option("--body <value>", "Plan item body").option("--claim", "Claim the plan on create for the author").option("--from-search <value>", "Record the search query that led to plan creation").option("--template <value>", "Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>", "Step title for add-step / update-step").option("--step <value>", "Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)", collect).option("--step-body <value>", "Step body text").option("--step-owner <value>", "Step owner").option("--step-status <value>", "Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>", "Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>", "Step blocked reason (required when blocking)").option("--step-replacement <value>", "Replacement reference for a superseded step").option("--depends-on <value>", "Pm item ids the step depends on (repeatable, csv-friendly)", collect).option("--link <value>", "Pm item id to link (repeatable, csv-friendly)", collect).option("--link-kind <value>", "Link kind: related|blocks|blocked_by|depends_on|discovered_from|implements|verifies|supersedes").option("--link-note <value>", "Optional note for the link").option("--promote-to-item-dep", "Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active", "Allow multiple steps to be in_progress at once").option("--file <value>", "Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)", collect).option("--test <value>", "Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)", collect).option("--doc <value>", "Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)", collect).option("--decision-text <value>", "Decision log entry text").option("--decision <value>", "Alias for --decision-text").option("--decision-rationale <value>", "Decision log entry rationale").option("--decision-evidence <value>", "Decision log entry evidence").option("--discovery-text <value>", "Discovery log entry text").option("--discovery <value>", "Alias for --discovery-text").option("--validation-text <value>", "Validation log entry text").option("--validation <value>", "Alias for --validation-text").option("--validation-command <value>", "Validation log entry command").option("--validation-expected <value>", "Validation log entry expected outcome").option("--depth <value>", "Show depth: brief|standard|deep (default: brief)").option("--fields <value>", "Comma-separated field projection for show output").option("--steps <value>", "Comma-separated step ids/orders for materialize").option("--materialize-type <value>", "Item type for materialized steps (default: Task)").option("--materialize-parent <value>", "Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>", "Comma-separated tags for materialized children").option("--author <value>", "Mutation author").option("--message <value>", "Mutation message").option("--force", "Force ownership override");
699
- for (const [flags, description] of [
1149
+ addHiddenOptions(planCommand, [
700
1150
  ["--resume_context <value>", "Alias for --resume-context"],
701
1151
  ["--from_search <value>", "Alias for --from-search"],
702
1152
  ["--step_title <value>", "Alias for --step-title"],
@@ -720,103 +1170,17 @@ function registerMutationCommands(program) {
720
1170
  ["--materialize_type <value>", "Alias for --materialize-type"],
721
1171
  ["--materialize_parent <value>", "Alias for --materialize-parent"],
722
1172
  ["--materialize_tags <value>", "Alias for --materialize-tags"]
723
- ]) {
724
- addHiddenOption(planCommand, flags, description, false);
725
- }
726
- for (const [flags, description] of [
1173
+ ], false);
1174
+ addHiddenOptions(planCommand, [
727
1175
  ["--blocked_by <value>", "Alias for --blocked-by"],
728
1176
  ["--depends_on <value>", "Alias for --depends-on"]
729
- ]) {
730
- addHiddenOption(planCommand, flags, description, true);
731
- }
732
- planCommand.action(async (subcommand, id, stepRef, reorderToken, options, command) => {
733
- const globalOptions = getGlobalOptions(command);
734
- const startedAt = Date.now();
735
- const { runPlan, PLAN_SUBCOMMANDS } = await import("./plan-RKZHQVXR.js");
736
- const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
737
- if (!normalizedSubcommand) {
738
- throw new PmCliError(`pm plan requires a subcommand. Allowed: ${PLAN_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
739
- code: "missing_required_argument",
740
- examples: [
741
- 'pm plan create --title "Refactor lock retry"',
742
- "pm plan show pm-a1b2 --depth standard",
743
- 'pm plan add-step pm-a1b2 --step-title "Read lock.ts"'
744
- ]
745
- });
746
- }
747
- if (!PLAN_SUBCOMMANDS.includes(normalizedSubcommand)) {
748
- const didYouMean = normalizedSubcommand === "list" || normalizedSubcommand === "ls" ? ["pm list --type Plan", "pm list-all --type Plan"] : void 0;
749
- throw new PmCliError(`Unknown pm plan subcommand "${subcommand}". Allowed: ${PLAN_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, didYouMean ? { code: "unknown_subcommand", examples: didYouMean } : void 0);
750
- }
751
- const planOptions = { ...options };
752
- const aliasPairs = [
753
- ["blocked_by", "blockedBy"],
754
- ["resume_context", "resumeContext"],
755
- ["from_search", "fromSearch"],
756
- // pm-6mit: "step" is no longer folded into stepTitle here — it is a
757
- // first-class repeatable option normalized inside runPlan (create
758
- // accumulates ordered steps; other subcommands accept a single value
759
- // as a stepTitle alias).
760
- ["step_title", "stepTitle"],
761
- ["step_body", "stepBody"],
762
- ["step_owner", "stepOwner"],
763
- ["step_status", "stepStatus"],
764
- ["step_evidence", "stepEvidence"],
765
- ["step_blocked_reason", "stepBlockedReason"],
766
- ["step_replacement", "stepReplacement"],
767
- ["depends_on", "dependsOn"],
768
- ["link_kind", "linkKind"],
769
- ["link_note", "linkNote"],
770
- ["promote_to_item_dep", "promoteToItemDep"],
771
- ["allow_multiple_active", "allowMultipleActive"],
772
- ["decision_text", "decisionText"],
773
- ["decision_rationale", "decisionRationale"],
774
- ["decision_evidence", "decisionEvidence"],
775
- ["discovery_text", "discoveryText"],
776
- ["validation_text", "validationText"],
777
- ["validation_command", "validationCommand"],
778
- ["validation_expected", "validationExpected"],
779
- ["materialize_type", "materializeType"],
780
- ["materialize_parent", "materializeParent"],
781
- ["materialize_tags", "materializeTags"]
782
- ];
783
- for (const [snake, camel] of aliasPairs) {
784
- if (planOptions[snake] !== void 0 && planOptions[camel] === void 0) {
785
- planOptions[camel] = planOptions[snake];
786
- }
787
- }
788
- let reorderTo;
789
- if (normalizedSubcommand === "reorder-step" && typeof reorderToken === "string") {
790
- const parsed = Number.parseInt(reorderToken, 10);
791
- if (!Number.isFinite(parsed)) {
792
- throw new PmCliError(`reorder-step requires an integer new order, got "${reorderToken}"`, EXIT_CODE.USAGE);
793
- }
794
- reorderTo = parsed;
795
- }
796
- let planId = id;
797
- if (normalizedSubcommand === "create" && typeof id === "string" && id.length > 0 && planOptions.title === void 0) {
798
- planOptions.title = id;
799
- planId = void 0;
800
- }
801
- const result = await runPlan({
802
- subcommand: normalizedSubcommand,
803
- id: planId,
804
- stepRef,
805
- reorderTo,
806
- options: planOptions,
807
- global: globalOptions
808
- });
809
- await invalidateSearchCachesForMutation(globalOptions, result);
810
- printResult(result, globalOptions);
811
- if (globalOptions.profile) {
812
- printError(`profile:command=plan took_ms=${Date.now() - startedAt}`);
813
- }
814
- });
1177
+ ], true);
1178
+ planCommand.action(runPlanAction);
815
1179
  void planCommand;
816
1180
  program.command("history-redact").argument("<id>", "Item id").option("--literal <value>", "Literal string to redact (repeatable)", collect).option("--regex <value>", "Regex pattern to redact (repeatable; accepts /pattern/flags or raw pattern)", collect).option("--replacement <value>", 'Replacement string (default: "[redacted]")').option("--dry-run", "Preview redaction impact without writing item/history files").option("--author <value>", "Mutation author").option("--message <value>", "Audit history message for the redaction marker entry").option("--force", "Force ownership/lock override").description("Redact sensitive literals/patterns from an item history stream and recompute hashes.").action(async (id, options, command) => {
817
1181
  const globalOptions = getGlobalOptions(command);
818
1182
  const startedAt = Date.now();
819
- const { runHistoryRedact } = await import("./history-redact-O3NBCNWC.js");
1183
+ const { runHistoryRedact } = await import("./history-redact-IRL7WJ3E.js");
820
1184
  const literal = Array.isArray(options.literal) ? options.literal : void 0;
821
1185
  const regex = Array.isArray(options.regex) ? options.regex : void 0;
822
1186
  const result = await runHistoryRedact(id, {
@@ -839,7 +1203,7 @@ function registerMutationCommands(program) {
839
1203
  program.command("history-repair").argument("[id]", "Item id (omit with --all)").option("--all", "Scan every stream for drift and repair each drifted stream in one audited pass").option("--dry-run", "Preview the re-anchor impact without writing the history file").option("--author <value>", "Mutation author").option("--message <value>", "Audit history message for the repair marker entry").option("--force", "Force ownership/lock override").description("Re-anchor a drifted item history chain (recompute hashes, reconcile with the on-disk item) and record an audit marker. Use --all to repair every drifted stream.").action(async (id, options, command) => {
840
1204
  const globalOptions = getGlobalOptions(command);
841
1205
  const startedAt = Date.now();
842
- const { runHistoryRepair, runHistoryRepairAll, assertHistoryRepairTarget } = await import("./history-repair-XA3LC4GA.js");
1206
+ const { runHistoryRepair, runHistoryRepairAll, assertHistoryRepairTarget } = await import("./history-repair-4WVBVHFR.js");
843
1207
  const all = options.all === true;
844
1208
  assertHistoryRepairTarget(id, all);
845
1209
  const repairOptions = {
@@ -862,357 +1226,20 @@ function registerMutationCommands(program) {
862
1226
  printError(`profile:command=history-repair took_ms=${Date.now() - startedAt}`);
863
1227
  }
864
1228
  });
865
- program.command("history-compact").argument("[id]", "Item id (omit when using a bulk selector)").option("--before <value>", "Compact entries strictly before this version number or ISO timestamp (single-id mode only)").option("--ids <value>", "Bulk: compact an explicit comma-separated list of item ids").option("--all-over <n>", "Bulk: compact every stream with more than N entries").option("--closed", "Bulk: compact only closed (terminal) items' streams").option("--all-streams", "Bulk: compact every history stream regardless of lifecycle state").option("--min-entries <n>", "Bulk: skip streams with at most N entries (already compact; default 3)").option("--dry-run", "Preview compaction impact without writing the history file").option("--author <value>", "Mutation author").option("--message <value>", "Audit history message for the compaction marker entry").option("--force", "Force ownership/lock override").description("Compact item history streams into a synthetic baseline plus retained tail entries. Pass an item id for one stream, or a bulk selector (--ids/--all-over/--closed/--all-streams) to compact many.").action(async (id, options, command) => {
866
- const globalOptions = getGlobalOptions(command);
867
- const startedAt = Date.now();
868
- const { runHistoryCompact, runHistoryCompactBulk, assertHistoryCompactTarget } = await import("./history-compact-HR7BB4LR.js");
869
- const parseNonNegativeIntFlag = (raw, flag) => {
870
- if (typeof raw !== "string") {
871
- return void 0;
872
- }
873
- if (!/^\d+$/.test(raw.trim())) {
874
- throw new PmCliError(`history-compact ${flag} must be a non-negative integer.`, EXIT_CODE.USAGE);
875
- }
876
- return Number.parseInt(raw, 10);
877
- };
878
- const ids = typeof options.ids === "string" ? splitCommaList(options.ids) : void 0;
879
- const allOver = parseNonNegativeIntFlag(options.allOver, "--all-over");
880
- const minEntries = parseNonNegativeIntFlag(options.minEntries, "--min-entries");
881
- if (options.closed === true && options.allStreams === true) {
882
- throw new PmCliError("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.", EXIT_CODE.USAGE);
883
- }
884
- const scope = options.closed === true ? "closed" : options.allStreams === true ? "all-streams" : void 0;
885
- const isBulk = ids !== void 0 || allOver !== void 0 || scope !== void 0;
886
- if (isBulk && typeof options.before === "string") {
887
- throw new PmCliError("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).", EXIT_CODE.USAGE);
888
- }
889
- assertHistoryCompactTarget(id, { ids, allOver, scope });
890
- if (id === void 0) {
891
- const result = await runHistoryCompactBulk({
892
- ids,
893
- scope,
894
- allOver,
895
- minEntries,
896
- dryRun: options.dryRun === true,
897
- author: typeof options.author === "string" ? options.author : void 0,
898
- message: typeof options.message === "string" ? options.message : void 0,
899
- force: Boolean(options.force)
900
- }, globalOptions);
901
- printResult(result, globalOptions);
902
- if (result.totals.items_errored > 0) {
903
- process.exitCode = EXIT_CODE.GENERIC_FAILURE;
904
- }
905
- } else {
906
- const result = await runHistoryCompact(id, {
907
- before: typeof options.before === "string" ? options.before : void 0,
908
- dryRun: options.dryRun === true,
909
- author: typeof options.author === "string" ? options.author : void 0,
910
- message: typeof options.message === "string" ? options.message : void 0,
911
- force: Boolean(options.force)
912
- }, globalOptions);
913
- printResult(result, globalOptions);
914
- }
915
- if (globalOptions.profile) {
916
- printError(`profile:command=history-compact took_ms=${Date.now() - startedAt}`);
917
- }
918
- });
1229
+ program.command("history-compact").argument("[id]", "Item id (omit when using a bulk selector)").option("--before <value>", "Compact entries strictly before this version number or ISO timestamp (single-id mode only)").option("--ids <value>", "Bulk: compact an explicit comma-separated list of item ids").option("--all-over <n>", "Bulk: compact every stream with more than N entries").option("--closed", "Bulk: compact only closed (terminal) items' streams").option("--all-streams", "Bulk: compact every history stream regardless of lifecycle state").option("--min-entries <n>", "Bulk: skip streams with at most N entries (already compact; default 3)").option("--dry-run", "Preview compaction impact without writing the history file").option("--author <value>", "Mutation author").option("--message <value>", "Audit history message for the compaction marker entry").option("--force", "Force ownership/lock override").description("Compact item history streams into a synthetic baseline plus retained tail entries. Pass an item id for one stream, or a bulk selector (--ids/--all-over/--closed/--all-streams) to compact many.").action(runHistoryCompactAction);
919
1230
  const schemaCommand = program.command("schema").argument("[subcommand]", "Schema subcommand: list, show, show-status, add-type, remove-type, add-status, remove-status, or a custom item type name shorthand").argument("[name]", "Item type name (add-type/remove-type/show) or status id (show-status/add-status/remove-status)").option("--description <text>", "Human description for the custom item type, status, or field").option("--default-status <status>", "Default status hint recorded for the custom item type").option("--folder <dir>", "Storage folder for items of this custom type").option("--alias <name>", "Alias for the custom type, status, or field flag (repeatable, csv-friendly)", collect).option("--role <value>", "Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel", collect).option("--order <n>", "Display/sort order for a custom status").option("--type <type>", "Value type for a custom field (add-field): string, number, boolean, string_array").option("--commands <list>", "Commands a custom field is wired onto (add-field; repeatable, comma-friendly): create, update, update_many, list, search, calendar, context", collect).option("--cli-flag <flag>", "Override the auto-derived CLI flag for a custom field (add-field)").option("--required", "Mark a custom field as always required (add-field)").option("--required-on-create", "Mark a custom field as required at create time (add-field)").option("--no-allow-unset", "Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>", "Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)", collect).option("--infer", "Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>", "Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply", "Register inferred types (add-type --infer); without it the command previews only").option("--author <value>", "Mutation author").option("--force", "Force ownership/lock override").description("Inspect and manage config-driven runtime schema (types, statuses, fields, presets).");
920
1231
  addHiddenOption(schemaCommand, "--default_status <status>", "Alias for --default-status", false);
921
- schemaCommand.action(async (subcommand, name, options, command) => {
922
- const globalOptions = getGlobalOptions(command);
923
- const startedAt = Date.now();
924
- const schemaModule = await import("./schema-73HR2OJW.js");
925
- const { SCHEMA_SUBCOMMANDS } = schemaModule;
926
- let normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
927
- let typeName = name;
928
- if (!normalizedSubcommand) {
929
- throw new PmCliError(`pm schema requires a subcommand. Allowed: ${SCHEMA_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
930
- code: "missing_required_argument",
931
- examples: [
932
- "pm schema list",
933
- "pm schema show Task",
934
- "pm schema show-status open",
935
- 'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',
936
- "pm schema remove-type Spike",
937
- "pm schema add-status review --role active --alias in_review",
938
- "pm schema remove-status review",
939
- "pm schema add-field severity_level --type string --commands create,update",
940
- "pm schema list-fields",
941
- "pm schema apply-preset agile",
942
- "pm schema add-type --infer --min-count 10"
943
- ]
944
- });
945
- }
946
- const aliases = (
947
- /* c8 ignore next -- --alias is registered with commander `collect`, so it is always an array here; the string arm is a defensive guard for non-CLI (programmatic) callers */
948
- typeof options.alias === "string" ? [options.alias] : Array.isArray(options.alias) ? options.alias : void 0
949
- );
950
- const roles = (
951
- /* c8 ignore next -- --role is registered with commander `collect`, so it is always an array here; the string arm is a defensive guard for non-CLI (programmatic) callers */
952
- typeof options.role === "string" ? [options.role] : Array.isArray(options.role) ? options.role : void 0
953
- );
954
- const defaultStatus = typeof options.defaultStatus === "string" ? options.defaultStatus : typeof options.default_status === "string" ? options.default_status : void 0;
955
- const order = parseSchemaOrderOption(options.order);
956
- const splitCollectedCommaList = (raw) => {
957
- if (!Array.isArray(raw)) {
958
- return void 0;
959
- }
960
- return raw.flatMap((value) => value.split(",")).map((value) => value.trim()).filter((value) => value.length > 0);
961
- };
962
- const commands = splitCollectedCommaList(options.commands);
963
- const requiredTypes = splitCollectedCommaList(options.requiredTypes);
964
- const minCount = parseSchemaOrderOption(options.minCount);
965
- if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand) && typeName === void 0 && !looksLikeSchemaSubcommandTypo(normalizedSubcommand)) {
966
- typeName = subcommand;
967
- normalizedSubcommand = "add-type";
968
- }
969
- if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand)) {
970
- throw new PmCliError(`Unknown pm schema subcommand "${subcommand}". Allowed: ${SCHEMA_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, { code: "unknown_subcommand" });
971
- }
972
- const author = typeof options.author === "string" ? options.author : void 0;
973
- const force = Boolean(options.force);
974
- const description = typeof options.description === "string" ? options.description : void 0;
975
- const result = await dispatchSchemaSubcommand(schemaModule, {
976
- normalizedSubcommand,
977
- typeName,
978
- options,
979
- aliases,
980
- roles,
981
- commands,
982
- requiredTypes,
983
- defaultStatus,
984
- order,
985
- minCount,
986
- author,
987
- force,
988
- description,
989
- globalOptions
990
- });
991
- if (globalOptions.json === true || globalOptions.defaultOutputFormat === "json") {
992
- printResult(result, globalOptions);
993
- } else if (!globalOptions.quiet) {
994
- renderSchemaResultHuman(schemaModule, result);
995
- }
996
- if (globalOptions.profile) {
997
- printError(`profile:command=schema took_ms=${Date.now() - startedAt}`);
998
- }
999
- });
1232
+ schemaCommand.action(runSchemaAction);
1000
1233
  const profileCommand = program.command("profile").argument("[subcommand]", "Profile subcommand: list, show, apply, or lint").argument("[name]", "Profile name for show/apply/lint: agile, ops, or research").option("--dry-run", "Preview the apply diff without writing any files (apply)").option("--author <value>", "Mutation author").option("--force", "Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.");
1001
- profileCommand.action(async (subcommand, name, options, command) => {
1002
- const globalOptions = getGlobalOptions(command);
1003
- const startedAt = Date.now();
1004
- const profileModule = await import("./profile-QLER5ENE.js");
1005
- const { PROFILE_SUBCOMMANDS } = profileModule;
1006
- const normalizedSubcommand = (subcommand ?? "").trim().toLowerCase();
1007
- if (!normalizedSubcommand) {
1008
- throw new PmCliError(`pm profile requires a subcommand. Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, {
1009
- code: "missing_required_argument",
1010
- examples: ["pm profile list", "pm profile show agile", "pm profile apply agile --dry-run", "pm profile lint agile"]
1011
- });
1012
- }
1013
- if (!PROFILE_SUBCOMMANDS.includes(normalizedSubcommand)) {
1014
- throw new PmCliError(`Unknown pm profile subcommand "${subcommand}". Allowed: ${PROFILE_SUBCOMMANDS.join(", ")}`, EXIT_CODE.USAGE, { code: "unknown_subcommand" });
1015
- }
1016
- const result = await dispatchProfileSubcommand(profileModule, normalizedSubcommand, name, options, globalOptions);
1017
- if (globalOptions.json === true || globalOptions.defaultOutputFormat === "json") {
1018
- printResult(result, globalOptions);
1019
- } else if (!globalOptions.quiet) {
1020
- renderProfileResultHuman(profileModule, result);
1021
- }
1022
- if (result.action === "lint" && !result.ok) {
1023
- process.exitCode = EXIT_CODE.GENERIC_FAILURE;
1024
- }
1025
- if (globalOptions.profile) {
1026
- printError(`profile:command=profile took_ms=${Date.now() - startedAt}`);
1027
- }
1028
- });
1029
- program.command("comments").argument("<id>", "Item id").argument("[text]", "Optional comment text shorthand (equivalent to --add)").option("--add <text>", "Add one comment entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)").option("--stdin", "Read comment text from stdin (supports multiline markdown)").option("--file <path>", "Read comment text from file (supports multiline markdown)").option("--edit <index>", "Replace the comment at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveIntOption("--edit")).option("--delete <index>", "Delete the comment at 1-based <index>", parsePositiveIntOption("--delete")).option("--limit <n>", "Return only latest n comments").option("--author [value]", "Comment author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>", "History message").option("--allow-audit-comment", "Allow non-owner append-only comment audits (add/edit/delete) without requiring --force").option("--force", "Force ownership override").description("List, add, edit, or delete comments for an item.").action(async (id, text, options, command) => {
1030
- const globalOptions = getGlobalOptions(command);
1031
- const startedAt = Date.now();
1032
- const editIndex = typeof options.edit === "number" ? options.edit : void 0;
1033
- const deleteIndex = typeof options.delete === "number" ? options.delete : void 0;
1034
- const addFromOption = typeof options.add === "string" ? options.add : void 0;
1035
- const addFromPositional = typeof text === "string" ? text : void 0;
1036
- const readFromStdin = options.stdin === true;
1037
- const readFromFile = typeof options.file === "string" ? options.file : void 0;
1038
- const sourceCount = Number(addFromOption !== void 0) + Number(addFromPositional !== void 0) + Number(readFromStdin) + Number(readFromFile !== void 0);
1039
- if (sourceCount > 1) {
1040
- if (addFromOption !== void 0 && addFromPositional !== void 0 && !readFromStdin && readFromFile === void 0) {
1041
- throw new PmCliError("Specify comment text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
1042
- }
1043
- throw new PmCliError("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file", EXIT_CODE.USAGE);
1044
- }
1045
- const add = addFromOption ?? addFromPositional;
1046
- const { runComments } = await import("./comments-QCKR2YY2.js");
1047
- const result = await runComments(id, {
1048
- add,
1049
- stdin: readFromStdin,
1050
- file: readFromFile,
1051
- edit: editIndex,
1052
- delete: deleteIndex,
1053
- limit: typeof options.limit === "string" ? options.limit : void 0,
1054
- author: typeof options.author === "string" ? options.author : void 0,
1055
- message: typeof options.message === "string" ? options.message : void 0,
1056
- allowAuditComment: Boolean(options.allowAuditComment),
1057
- force: Boolean(options.force)
1058
- }, globalOptions);
1059
- const isMutation = typeof add === "string" || readFromStdin || readFromFile !== void 0 || editIndex !== void 0 || deleteIndex !== void 0;
1060
- if (isMutation) {
1061
- await invalidateSearchCachesForMutation(globalOptions, result);
1062
- }
1063
- printResult(result, globalOptions);
1064
- if (globalOptions.profile) {
1065
- printError(`profile:command=comments took_ms=${Date.now() - startedAt}`);
1066
- }
1067
- });
1068
- program.command("notes").argument("<id>", "Item id").argument("[text]", "Optional note text shorthand (equivalent to --add; use - for stdin)").option("--add <text>", "Add one note entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)").option("--limit <n>", "Return only latest n notes").option("--author [value]", "Note author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>", "History message").option("--allow-audit-note", "Allow non-owner append-only note audits without requiring --force").option("--allow-audit-comment", "Backward-compatible alias for --allow-audit-note").option("--force", "Force ownership override").description("List or add notes for an item.").action(async (id, text, options, command) => {
1069
- const globalOptions = getGlobalOptions(command);
1070
- const startedAt = Date.now();
1071
- const addFromOption = typeof options.add === "string" ? options.add : void 0;
1072
- const addFromPositional = typeof text === "string" ? text : void 0;
1073
- if (addFromOption !== void 0 && addFromPositional !== void 0) {
1074
- throw new PmCliError("Specify note text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
1075
- }
1076
- const add = addFromOption ?? addFromPositional;
1077
- const { runNotes } = await import("./notes-6KTGO2OJ.js");
1078
- const result = await runNotes(id, {
1079
- add,
1080
- limit: typeof options.limit === "string" ? options.limit : void 0,
1081
- author: typeof options.author === "string" ? options.author : void 0,
1082
- message: typeof options.message === "string" ? options.message : void 0,
1083
- allowAuditComment: Boolean(options.allowAuditNote || options.allowAuditComment),
1084
- force: Boolean(options.force)
1085
- }, globalOptions);
1086
- if (typeof add === "string") {
1087
- await invalidateSearchCachesForMutation(globalOptions, result);
1088
- }
1089
- printResult(result, globalOptions);
1090
- if (globalOptions.profile) {
1091
- printError(`profile:command=notes took_ms=${Date.now() - startedAt}`);
1092
- }
1093
- });
1094
- program.command("learnings").argument("<id>", "Item id").argument("[text]", "Optional learning text shorthand (equivalent to --add; use - for stdin)").option("--add <text>", "Add one learning entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)").option("--limit <n>", "Return only latest n learnings").option("--author [value]", "Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>", "History message").option("--allow-audit-learning", "Allow non-owner append-only learning audits without requiring --force").option("--allow-audit-comment", "Backward-compatible alias for --allow-audit-learning").option("--force", "Force ownership override").description("List or add learnings for an item.").action(async (id, text, options, command) => {
1095
- const globalOptions = getGlobalOptions(command);
1096
- const startedAt = Date.now();
1097
- const addFromOption = typeof options.add === "string" ? options.add : void 0;
1098
- const addFromPositional = typeof text === "string" ? text : void 0;
1099
- if (addFromOption !== void 0 && addFromPositional !== void 0) {
1100
- throw new PmCliError("Specify learning text either as positional [text] or with --add, not both", EXIT_CODE.USAGE);
1101
- }
1102
- const add = addFromOption ?? addFromPositional;
1103
- const { runLearnings } = await import("./learnings-LPKCSJX7.js");
1104
- const result = await runLearnings(id, {
1105
- add,
1106
- limit: typeof options.limit === "string" ? options.limit : void 0,
1107
- author: typeof options.author === "string" ? options.author : void 0,
1108
- message: typeof options.message === "string" ? options.message : void 0,
1109
- allowAuditComment: Boolean(options.allowAuditLearning || options.allowAuditComment),
1110
- force: Boolean(options.force)
1111
- }, globalOptions);
1112
- if (typeof add === "string") {
1113
- await invalidateSearchCachesForMutation(globalOptions, result);
1114
- }
1115
- printResult(result, globalOptions);
1116
- if (globalOptions.profile) {
1117
- printError(`profile:command=learnings took_ms=${Date.now() - startedAt}`);
1118
- }
1119
- });
1234
+ profileCommand.action(runProfileAction);
1235
+ program.command("comments").argument("<id>", "Item id").argument("[text]", "Optional comment text shorthand (equivalent to --add)").option("--add <text>", "Add one comment entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)").option("--stdin", "Read comment text from stdin (supports multiline markdown)").option("--file <path>", "Read comment text from file (supports multiline markdown)").option("--edit <index>", "Replace the comment at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveIntOption("--edit")).option("--delete <index>", "Delete the comment at 1-based <index>", parsePositiveIntOption("--delete")).option("--limit <n>", "Return only latest n comments").option("--author [value]", "Comment author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>", "History message").option("--allow-audit-comment", "Allow non-owner append-only comment audits (add/edit/delete) without requiring --force").option("--force", "Force ownership override").description("List, add, edit, or delete comments for an item.").action(runCommentsAction);
1236
+ program.command("notes").argument("<id>", "Item id").argument("[text]", "Optional note text shorthand (equivalent to --add; use - for stdin)").option("--add <text>", "Add one note entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)").option("--limit <n>", "Return only latest n notes").option("--author [value]", "Note author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>", "History message").option("--allow-audit-note", "Allow non-owner append-only note audits without requiring --force").option("--allow-audit-comment", "Backward-compatible alias for --allow-audit-note").option("--force", "Force ownership override").description("List or add notes for an item.").action(runNotesAction);
1237
+ program.command("learnings").argument("<id>", "Item id").argument("[text]", "Optional learning text shorthand (equivalent to --add; use - for stdin)").option("--add <text>", "Add one learning entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)").option("--limit <n>", "Return only latest n learnings").option("--author [value]", "Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>", "History message").option("--allow-audit-learning", "Allow non-owner append-only learning audits without requiring --force").option("--allow-audit-comment", "Backward-compatible alias for --allow-audit-learning").option("--force", "Force ownership override").description("List or add learnings for an item.").action(runLearningsAction);
1120
1238
  const filesCommand = program.command("files").description("Manage files linked to an item.");
1121
- filesCommand.argument("<id>", "Item id").option("--add <value>", "Add linked file entry (CSV/markdown pairs or - for stdin)", collect).option("--add-glob <value>", "Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)", collect).option("--remove <value>", "Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message", collect).option("--migrate <value>", "Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)", collect).option("--note <value>", "Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list", "List linked files without mutating").option("--append-stable", "Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths", "Validate linked file paths for existence and file shape").option("--audit", "Audit linked file usage across all items for this item's linked paths").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").action(async (id, options, command) => {
1122
- const globalOptions = getGlobalOptions(command);
1123
- const startedAt = Date.now();
1124
- const addValues = Array.isArray(options.add) ? options.add : [];
1125
- const addGlobValues = Array.isArray(options.addGlob) ? options.addGlob : [];
1126
- const removeValues = Array.isArray(options.remove) ? options.remove : [];
1127
- const migrateValues = Array.isArray(options.migrate) ? options.migrate : [];
1128
- const { runFiles } = await import("./files-NQHEXUZD.js");
1129
- const result = await runFiles(id, {
1130
- add: addValues,
1131
- addGlob: addGlobValues,
1132
- remove: removeValues,
1133
- migrate: migrateValues,
1134
- note: typeof options.note === "string" ? options.note : void 0,
1135
- list: Boolean(options.list),
1136
- appendStable: Boolean(options.appendStable),
1137
- validatePaths: Boolean(options.validatePaths),
1138
- audit: Boolean(options.audit),
1139
- author: typeof options.author === "string" ? options.author : void 0,
1140
- message: typeof options.message === "string" ? options.message : void 0,
1141
- force: Boolean(options.force)
1142
- }, globalOptions);
1143
- if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1144
- await invalidateSearchCachesForMutation(globalOptions, result);
1145
- }
1146
- printResult(result, globalOptions);
1147
- if (globalOptions.profile) {
1148
- printError(`profile:command=files took_ms=${Date.now() - startedAt}`);
1149
- }
1150
- });
1151
- filesCommand.command("discover").argument("<id>", "Item id").option("--apply", "Add discovered missing files to the item").option("--note <value>", "Note to attach to discovered file links").option("--append-stable", "Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(async (id, options, command) => {
1152
- const globalOptions = getGlobalOptions(command);
1153
- const startedAt = Date.now();
1154
- const mergedOptions = { ...command.optsWithGlobals(), ...options };
1155
- const { runFilesDiscover } = await import("./files-NQHEXUZD.js");
1156
- const result = await runFilesDiscover(id, {
1157
- apply: Boolean(mergedOptions.apply),
1158
- note: typeof mergedOptions.note === "string" ? mergedOptions.note : void 0,
1159
- appendStable: Boolean(mergedOptions.appendStable),
1160
- author: typeof mergedOptions.author === "string" ? mergedOptions.author : void 0,
1161
- message: typeof mergedOptions.message === "string" ? mergedOptions.message : void 0,
1162
- force: Boolean(mergedOptions.force)
1163
- }, globalOptions);
1164
- if (result.changed) {
1165
- await invalidateSearchCachesForMutation(globalOptions, result);
1166
- }
1167
- printResult(result, globalOptions);
1168
- if (globalOptions.profile) {
1169
- printError(`profile:command=files.discover took_ms=${Date.now() - startedAt}`);
1170
- }
1171
- });
1172
- program.command("docs").argument("<id>", "Item id").option("--add <value>", "Add linked doc entry (CSV/markdown pairs or - for stdin)", collect).option("--add-glob <value>", "Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)", collect).option("--remove <value>", "Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message", collect).option("--migrate <value>", "Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)", collect).option("--note <value>", "Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list", "List linked docs without mutating").option("--validate-paths", "Validate linked doc paths for existence and file shape").option("--audit", "Audit linked doc usage across all items for this item's linked paths").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").description("Manage docs linked to an item.").action(async (id, options, command) => {
1173
- const globalOptions = getGlobalOptions(command);
1174
- const startedAt = Date.now();
1175
- const addValues = Array.isArray(options.add) ? options.add : [];
1176
- const addGlobValues = Array.isArray(options.addGlob) ? options.addGlob : [];
1177
- const removeValues = Array.isArray(options.remove) ? options.remove : [];
1178
- const migrateValues = Array.isArray(options.migrate) ? options.migrate : [];
1179
- const { runDocs } = await import("./docs-GYZNVS26.js");
1180
- const result = await runDocs(id, {
1181
- add: addValues,
1182
- addGlob: addGlobValues,
1183
- remove: removeValues,
1184
- migrate: migrateValues,
1185
- note: typeof options.note === "string" ? options.note : void 0,
1186
- list: Boolean(options.list),
1187
- validatePaths: Boolean(options.validatePaths),
1188
- audit: Boolean(options.audit),
1189
- author: typeof options.author === "string" ? options.author : void 0,
1190
- message: typeof options.message === "string" ? options.message : void 0,
1191
- force: Boolean(options.force)
1192
- }, globalOptions);
1193
- if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {
1194
- await invalidateSearchCachesForMutation(globalOptions, result);
1195
- }
1196
- printResult(result, globalOptions);
1197
- if (globalOptions.profile) {
1198
- printError(`profile:command=docs took_ms=${Date.now() - startedAt}`);
1199
- }
1200
- });
1201
- program.command("deps").argument("<id>", "Item id").option("--format <value>", "Output format (tree or graph)", "tree").option("--max-depth <value>", "Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>", "Collapse mode (none or repeated)", "none").option("--summary", "Return counts only without full tree/graph payload").description("Show dependency relationships for an item.").action(async (id, options, command) => {
1202
- const globalOptions = getGlobalOptions(command);
1203
- const startedAt = Date.now();
1204
- const { runDeps } = await import("./deps-4UDFJRUA.js");
1205
- const result = await runDeps(id, {
1206
- format: options.format,
1207
- maxDepth: typeof options.maxDepth === "string" ? options.maxDepth : void 0,
1208
- collapse: options.collapse,
1209
- summary: options.summary === true
1210
- }, globalOptions);
1211
- printResult(result, globalOptions);
1212
- if (globalOptions.profile) {
1213
- printError(`profile:command=deps took_ms=${Date.now() - startedAt}`);
1214
- }
1215
- });
1239
+ filesCommand.argument("<id>", "Item id").option("--add <value>", "Add linked file entry (CSV/markdown pairs or - for stdin)", collect).option("--add-glob <value>", "Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)", collect).option("--remove <value>", "Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message", collect).option("--migrate <value>", "Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)", collect).option("--note <value>", "Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list", "List linked files without mutating").option("--append-stable", "Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths", "Validate linked file paths for existence and file shape").option("--audit", "Audit linked file usage across all items for this item's linked paths").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").action(runFilesAction);
1240
+ filesCommand.command("discover").argument("<id>", "Item id").option("--apply", "Add discovered missing files to the item").option("--note <value>", "Note to attach to discovered file links").option("--append-stable", "Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(runFilesDiscoverAction);
1241
+ program.command("docs").argument("<id>", "Item id").option("--add <value>", "Add linked doc entry (CSV/markdown pairs or - for stdin)", collect).option("--add-glob <value>", "Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)", collect).option("--remove <value>", "Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message", collect).option("--migrate <value>", "Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)", collect).option("--note <value>", "Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list", "List linked docs without mutating").option("--validate-paths", "Validate linked doc paths for existence and file shape").option("--audit", "Audit linked doc usage across all items for this item's linked paths").option("--author <value>", "Mutation author").option("--message <value>", "History message").option("--force", "Force ownership override").description("Manage docs linked to an item.").action(runDocsAction);
1242
+ program.command("deps").argument("<id>", "Item id").option("--format <value>", "Output format (tree or graph)", "tree").option("--max-depth <value>", "Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>", "Collapse mode (none or repeated)", "none").option("--summary", "Return counts only without full tree/graph payload").description("Show dependency relationships for an item.").action(runDepsAction);
1216
1243
  }
1217
1244
  export {
1218
1245
  looksLikeSchemaSubcommandTypo,
@@ -1221,6 +1248,6 @@ export {
1221
1248
  registerCommanderOptionContracts,
1222
1249
  registerMutationCommands
1223
1250
  };
1224
- //# sourceMappingURL=register-mutation-ENNDUAZG.js.map
1251
+ //# sourceMappingURL=register-mutation-SJWMVIJ2.js.map
1225
1252
 
1226
- //# debugId=83d6617e-974e-5c3a-904a-d8671268dbd1
1253
+ //# debugId=919c1fe0-eaf0-51d1-9788-48d73b423eb3