@unbrained/pm-cli 2026.6.16 → 2026.6.17

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 (439) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cli/commands/completion.js +96 -10
  3. package/dist/cli/commands/completion.js.map +1 -1
  4. package/dist/cli/commands/create.d.ts +2 -0
  5. package/dist/cli/commands/create.js +34 -13
  6. package/dist/cli/commands/create.js.map +1 -1
  7. package/dist/cli/commands/index.d.ts +3 -1
  8. package/dist/cli/commands/index.js +5 -3
  9. package/dist/cli/commands/index.js.map +1 -1
  10. package/dist/cli/commands/init.d.ts +2 -1
  11. package/dist/cli/commands/init.js +14 -61
  12. package/dist/cli/commands/init.js.map +1 -1
  13. package/dist/cli/commands/lifecycle-transitions.d.ts +23 -0
  14. package/dist/cli/commands/lifecycle-transitions.js +41 -0
  15. package/dist/cli/commands/lifecycle-transitions.js.map +1 -0
  16. package/dist/cli/commands/linked-artifacts.d.ts +5 -0
  17. package/dist/cli/commands/linked-artifacts.js +18 -4
  18. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  19. package/dist/cli/commands/recurrence-parsers.d.ts +9 -0
  20. package/dist/cli/commands/recurrence-parsers.js +19 -2
  21. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  22. package/dist/cli/commands/repeatable-metadata-parsers.js +28 -4
  23. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
  24. package/dist/cli/commands/scheduling-shortcuts.d.ts +43 -0
  25. package/dist/cli/commands/scheduling-shortcuts.js +87 -0
  26. package/dist/cli/commands/scheduling-shortcuts.js.map +1 -0
  27. package/dist/cli/commands/schema.d.ts +134 -2
  28. package/dist/cli/commands/schema.js +482 -3
  29. package/dist/cli/commands/schema.js.map +1 -1
  30. package/dist/cli/commands/update.js +19 -5
  31. package/dist/cli/commands/update.js.map +1 -1
  32. package/dist/cli/help-content.js +26 -2
  33. package/dist/cli/help-content.js.map +1 -1
  34. package/dist/cli/main.d.ts +19 -0
  35. package/dist/cli/main.js +40 -2
  36. package/dist/cli/main.js.map +1 -1
  37. package/dist/cli/register-mutation.js +168 -62
  38. package/dist/cli/register-mutation.js.map +1 -1
  39. package/dist/cli/register-operations.js +103 -2
  40. package/dist/cli/register-operations.js.map +1 -1
  41. package/dist/cli-bundle/chunks/activity-PZYSZA26.js +18 -0
  42. package/dist/cli-bundle/chunks/{activity-MJGTX4LO.js → activity-SFM4THAU.js} +11 -11
  43. package/dist/cli-bundle/chunks/{aggregate-OUGCDFNC.js → aggregate-Y5ADDKBM.js} +10 -10
  44. package/dist/cli-bundle/chunks/{aggregate-MH3GROKB.js → aggregate-YTAUQLRW.js} +10 -10
  45. package/dist/cli-bundle/chunks/{append-VCRUG2W6.js → append-4M7OVV7M.js} +8 -8
  46. package/dist/cli-bundle/chunks/{append-2Q4BPUBW.js → append-HSPK4L4V.js} +8 -8
  47. package/dist/cli-bundle/chunks/{chunk-F2GC6L3N.js → chunk-26BM6YLO.js} +3 -3
  48. package/dist/cli-bundle/chunks/{chunk-ILHLIA47.js → chunk-2C6FU3D3.js} +3 -3
  49. package/dist/cli-bundle/chunks/{chunk-B5Q7XC4K.js → chunk-2OPYLXDO.js} +4 -4
  50. package/dist/cli-bundle/chunks/{chunk-CBMETQ2U.js → chunk-2S46FKLB.js} +5 -5
  51. package/dist/cli-bundle/chunks/{chunk-MJZUZ2QE.js → chunk-2TMKMTEI.js} +3 -3
  52. package/dist/cli-bundle/chunks/{chunk-M23HXJL3.js → chunk-2VH7DFSJ.js} +2 -2
  53. package/dist/cli-bundle/chunks/{chunk-BJWTFOZM.js → chunk-3ENF4NO4.js} +8 -8
  54. package/dist/cli-bundle/chunks/{chunk-7EILPFMA.js → chunk-3GR2HTYY.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-764O7EUA.js → chunk-3R3FYCBV.js} +3 -3
  56. package/dist/cli-bundle/chunks/{chunk-G3CEIXTV.js → chunk-3UKJX3RP.js} +27 -15
  57. package/dist/cli-bundle/chunks/chunk-3UKJX3RP.js.map +7 -0
  58. package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js +83 -0
  59. package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js.map +1 -0
  60. package/dist/cli-bundle/chunks/{chunk-4VLB4JH2.js → chunk-5FDYWOJT.js} +4 -3
  61. package/dist/cli-bundle/chunks/{chunk-WZCQVABQ.js → chunk-5XGWFUW2.js} +2 -2
  62. package/dist/cli-bundle/chunks/{chunk-667XI4UJ.js → chunk-6BD77FGL.js} +8 -8
  63. package/dist/cli-bundle/chunks/{chunk-KZYVTOG5.js → chunk-6HF6CIY2.js} +9 -9
  64. package/dist/cli-bundle/chunks/{chunk-XLNNCKTN.js → chunk-6PBPD4MN.js} +8 -8
  65. package/dist/cli-bundle/chunks/{chunk-Z3MUNQRV.js → chunk-6VFUEGOA.js} +4 -3
  66. package/dist/cli-bundle/chunks/{chunk-HDIDUME4.js → chunk-AAOXSPAE.js} +19 -67
  67. package/dist/cli-bundle/chunks/chunk-AAOXSPAE.js.map +1 -0
  68. package/dist/cli-bundle/chunks/{chunk-O46LTCXQ.js → chunk-AJCQ5GT6.js} +4 -4
  69. package/dist/cli-bundle/chunks/{chunk-7ZGKNHUL.js → chunk-ALTGYHN3.js} +2 -2
  70. package/dist/cli-bundle/chunks/{chunk-PZD7WPUC.js → chunk-AOJQL33L.js} +28 -16
  71. package/dist/cli-bundle/chunks/chunk-AOJQL33L.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-SY4PZWIZ.js → chunk-AXLDUGXA.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-YGRPBFMA.js → chunk-BITCVGHT.js} +2 -2
  74. package/dist/cli-bundle/chunks/{chunk-UUKORJSN.js → chunk-CGQTFWYI.js} +4 -4
  75. package/dist/cli-bundle/chunks/{chunk-LV5FFQ7M.js → chunk-CHM2VFVL.js} +3 -1
  76. package/dist/cli-bundle/chunks/{chunk-7AGIXLNK.js → chunk-COVLE33A.js} +3 -3
  77. package/dist/cli-bundle/chunks/{chunk-SY4GKIWT.js → chunk-DDNBWH4W.js} +91 -20
  78. package/dist/cli-bundle/chunks/chunk-DDNBWH4W.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-2JEGCDYT.js → chunk-F5MSD5HE.js} +2 -2
  80. package/dist/cli-bundle/chunks/{chunk-NIQHNDBZ.js → chunk-FAXB6F6R.js} +7 -7
  81. package/dist/cli-bundle/chunks/{chunk-7K2MXFMX.js → chunk-FPDK5BZQ.js} +15 -14
  82. package/dist/cli-bundle/chunks/chunk-FPDK5BZQ.js.map +1 -0
  83. package/dist/cli-bundle/chunks/{chunk-3XOXWOGA.js → chunk-FPY2TOFI.js} +125 -9
  84. package/dist/cli-bundle/chunks/chunk-FPY2TOFI.js.map +1 -0
  85. package/dist/cli-bundle/chunks/{chunk-TIRZIQRP.js → chunk-G2MOUCTU.js} +5 -5
  86. package/dist/cli-bundle/chunks/{chunk-F7WSO5UX.js → chunk-G57RHEGP.js} +33 -4
  87. package/dist/cli-bundle/chunks/chunk-G57RHEGP.js.map +1 -0
  88. package/dist/cli-bundle/chunks/{chunk-GAVE4MYM.js → chunk-IROHIK2T.js} +3 -3
  89. package/dist/cli-bundle/chunks/{chunk-ZJRDVYZI.js → chunk-JZHL4E3Q.js} +4 -4
  90. package/dist/cli-bundle/chunks/{chunk-4KBK4BA3.js → chunk-KA22USXD.js} +14 -13
  91. package/dist/cli-bundle/chunks/chunk-KA22USXD.js.map +7 -0
  92. package/dist/cli-bundle/chunks/{chunk-KQ3LAMDO.js → chunk-KBC4O7SY.js} +18 -66
  93. package/dist/cli-bundle/chunks/chunk-KBC4O7SY.js.map +7 -0
  94. package/dist/cli-bundle/chunks/{chunk-UBMCSJXX.js → chunk-KCAGIH6K.js} +3 -3
  95. package/dist/cli-bundle/chunks/{chunk-656HPQPO.js → chunk-KO3VM5GS.js} +9 -9
  96. package/dist/cli-bundle/chunks/{chunk-OY3P2I6B.js → chunk-LNH5Q32E.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-GQ4JKNMV.js → chunk-LORM3M2I.js} +3 -3
  98. package/dist/cli-bundle/chunks/{chunk-OCTQJP42.js → chunk-M4AVU7VC.js} +7 -7
  99. package/dist/cli-bundle/chunks/{chunk-3WAULYOY.js → chunk-MIBX6ZRN.js} +3 -3
  100. package/dist/cli-bundle/chunks/{chunk-FXNT5LPX.js → chunk-MMF2E3FM.js} +7 -7
  101. package/dist/cli-bundle/chunks/{chunk-AERT7KT3.js → chunk-MORZOR7W.js} +21 -8
  102. package/dist/cli-bundle/chunks/chunk-MORZOR7W.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-IMQG4VR3.js → chunk-MUTUZ2HD.js} +9 -9
  104. package/dist/cli-bundle/chunks/{chunk-7L5VOUYP.js → chunk-OGXEBTX3.js} +32 -3
  105. package/dist/cli-bundle/chunks/{chunk-7L5VOUYP.js.map → chunk-OGXEBTX3.js.map} +2 -2
  106. package/dist/cli-bundle/chunks/{chunk-NCIBNERT.js → chunk-OOIH6J5T.js} +2 -2
  107. package/dist/cli-bundle/chunks/{chunk-II7OGE3V.js → chunk-OSBJPPX3.js} +5 -5
  108. package/dist/cli-bundle/chunks/{chunk-HPELHUTG.js → chunk-PJS3WDO2.js} +5 -5
  109. package/dist/cli-bundle/chunks/{chunk-6NQXMGYU.js → chunk-QGPE2H6Z.js} +5 -5
  110. package/dist/cli-bundle/chunks/{chunk-ASM4DVRW.js → chunk-QVTFFLR2.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-FTAZLAR7.js → chunk-QW2F6ARZ.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-A576QZDL.js → chunk-QXC3LWB7.js} +3 -3
  113. package/dist/cli-bundle/chunks/{chunk-6BV7ENQL.js → chunk-QXMXRPX5.js} +2 -2
  114. package/dist/cli-bundle/chunks/{chunk-SPYPC5CB.js → chunk-R4AKUPKI.js} +2 -2
  115. package/dist/cli-bundle/chunks/{chunk-UAR2VNCK.js → chunk-RASR23HV.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-YXTLI4XP.js → chunk-SCDCNGCV.js} +7 -7
  117. package/dist/cli-bundle/chunks/{chunk-2IUJBMKS.js → chunk-SCS5PVAA.js} +8 -8
  118. package/dist/cli-bundle/chunks/{chunk-KTVETP66.js → chunk-SJCMTOEU.js} +3 -1
  119. package/dist/cli-bundle/chunks/{chunk-L6FJPOT4.js → chunk-SO2ES46D.js} +8 -8
  120. package/dist/cli-bundle/chunks/{chunk-GYMG7AG6.js → chunk-TBV33CB4.js} +3 -3
  121. package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js +86 -0
  122. package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js.map +7 -0
  123. package/dist/cli-bundle/chunks/{chunk-OLTYNVJR.js → chunk-TWBDDVIF.js} +20 -7
  124. package/dist/cli-bundle/chunks/chunk-TWBDDVIF.js.map +7 -0
  125. package/dist/cli-bundle/chunks/{chunk-XNOY7TCB.js → chunk-UGUJ2UOR.js} +9 -9
  126. package/dist/cli-bundle/chunks/{chunk-E6J2PEK6.js → chunk-UN6P3IJ4.js} +3 -3
  127. package/dist/cli-bundle/chunks/{chunk-ZONXMSVB.js → chunk-V2GYOMEX.js} +2 -2
  128. package/dist/cli-bundle/chunks/{chunk-T5VU7ROQ.js → chunk-VF3KQGNY.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-RKKIH2ZQ.js → chunk-VHG6LUKR.js} +4 -4
  130. package/dist/cli-bundle/chunks/{chunk-H6EH6ENJ.js → chunk-VXHMQDXA.js} +126 -10
  131. package/dist/cli-bundle/chunks/chunk-VXHMQDXA.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-G2YVUY7I.js → chunk-VXRFAE7W.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-Q5RLUCP3.js → chunk-WQRL4COW.js} +8 -8
  134. package/dist/cli-bundle/chunks/{chunk-IQVB3YDD.js → chunk-XESAPVZ4.js} +99 -21
  135. package/dist/cli-bundle/chunks/chunk-XESAPVZ4.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TUB3DZAZ.js → chunk-YLAW3FZN.js} +5 -5
  137. package/dist/cli-bundle/chunks/{claim-NEO7AGWH.js → claim-WGAWJCPY.js} +10 -10
  138. package/dist/cli-bundle/chunks/{claim-4APLUXJW.js → claim-ZI6P4LMU.js} +10 -10
  139. package/dist/cli-bundle/chunks/close-I7PRQ5G7.js +13 -0
  140. package/dist/cli-bundle/chunks/{close-3QABBNGU.js → close-JMVVSIQE.js} +8 -8
  141. package/dist/cli-bundle/chunks/{close-many-MIZLTYGL.js → close-many-IKPJXVOZ.js} +15 -15
  142. package/dist/cli-bundle/chunks/{close-many-Q7Y5AHQI.js → close-many-TXABDCSJ.js} +15 -15
  143. package/dist/cli-bundle/chunks/{comments-DAIQPOMU.js → comments-RLWR2S7W.js} +10 -10
  144. package/dist/cli-bundle/chunks/{comments-IWFSVM4P.js → comments-YAMXKHUX.js} +10 -10
  145. package/dist/cli-bundle/chunks/{config-PXTMAYV3.js → config-7ICYC2WU.js} +47 -9
  146. package/dist/cli-bundle/chunks/config-7ICYC2WU.js.map +7 -0
  147. package/dist/cli-bundle/chunks/{config-IOJELD6O.js → config-NGWN3EXC.js} +48 -10
  148. package/dist/cli-bundle/chunks/config-NGWN3EXC.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{context-QHJSCJW4.js → context-K6QAHN5H.js} +13 -13
  150. package/dist/cli-bundle/chunks/{context-XZS2VFKU.js → context-VGXOOAH2.js} +13 -13
  151. package/dist/cli-bundle/chunks/{contracts-B7U4OJTV.js → contracts-KJGY2AQA.js} +51 -11
  152. package/dist/cli-bundle/chunks/contracts-KJGY2AQA.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{contracts-NSBVLXQ3.js → contracts-KMA6OJY7.js} +50 -10
  154. package/dist/cli-bundle/chunks/{contracts-B7U4OJTV.js.map → contracts-KMA6OJY7.js.map} +7 -1
  155. package/dist/cli-bundle/chunks/{copy-Q64T5FD4.js → copy-Q2PPU4AY.js} +7 -7
  156. package/dist/cli-bundle/chunks/{copy-SG34LCMU.js → copy-SC6UF3PI.js} +7 -7
  157. package/dist/cli-bundle/chunks/{create-IPAX2SNL.js → create-76FE7JVF.js} +14 -14
  158. package/dist/cli-bundle/chunks/create-RTRFW6RE.js +30 -0
  159. package/dist/cli-bundle/chunks/{delete-VH3L7DZ6.js → delete-T6DJSUJI.js} +7 -7
  160. package/dist/cli-bundle/chunks/{delete-TLXR7LJ2.js → delete-XFUX533E.js} +7 -7
  161. package/dist/cli-bundle/chunks/{deps-J3HBBLDB.js → deps-5GWMMS6D.js} +7 -7
  162. package/dist/cli-bundle/chunks/{deps-XV6JJ6IN.js → deps-MCCU633S.js} +7 -7
  163. package/dist/cli-bundle/chunks/{docs-GWDEB7JH.js → docs-HE3HCQ4S.js} +9 -9
  164. package/dist/cli-bundle/chunks/{docs-RCLNSKID.js → docs-SXMOABHR.js} +9 -9
  165. package/dist/cli-bundle/chunks/{extension-7KO2NX2A.js → extension-E23K4QRR.js} +5 -5
  166. package/dist/cli-bundle/chunks/{extension-5RN65LHT.js → extension-PMD3XMLN.js} +5 -5
  167. package/dist/cli-bundle/chunks/{files-3TCQHUHA.js → files-2RSWGPEU.js} +9 -9
  168. package/dist/cli-bundle/chunks/{files-5FDUPSEA.js → files-ZWFJFWBK.js} +9 -9
  169. package/dist/cli-bundle/chunks/{focus-HQXBYPKM.js → focus-KTTB3P3F.js} +8 -8
  170. package/dist/cli-bundle/chunks/{focus-7AQMNRSU.js → focus-ZMDP4FEL.js} +8 -8
  171. package/dist/cli-bundle/chunks/{gc-5B6ABL3Z.js → gc-BXIAKLAH.js} +3 -3
  172. package/dist/cli-bundle/chunks/{gc-2FGKYRJ4.js → gc-C7K6JNUO.js} +3 -3
  173. package/dist/cli-bundle/chunks/{get-FUMVOJQD.js → get-AZQLC4NO.js} +11 -11
  174. package/dist/cli-bundle/chunks/{get-H5BZTW4A.js → get-I65HTAWO.js} +11 -11
  175. package/dist/cli-bundle/chunks/{health-JSVOR6B4.js → health-3MFFPQVZ.js} +13 -13
  176. package/dist/cli-bundle/chunks/{health-LE2ZQGSM.js → health-MYZEOCLI.js} +13 -13
  177. package/dist/cli-bundle/chunks/{history-QO4JVJJP.js → history-73Z6OBFZ.js} +10 -10
  178. package/dist/cli-bundle/chunks/history-BIPHVUMF.js +20 -0
  179. package/dist/cli-bundle/chunks/{history-compact-ID74DOUI.js → history-compact-24VQ63A3.js} +11 -11
  180. package/dist/cli-bundle/chunks/{history-compact-SDFRPZ4V.js → history-compact-UIAR2OI4.js} +11 -11
  181. package/dist/cli-bundle/chunks/{history-redact-Z4P5MM3G.js → history-redact-7YCXEWJD.js} +11 -11
  182. package/dist/cli-bundle/chunks/history-redact-WZZ6GZ2Z.js +21 -0
  183. package/dist/cli-bundle/chunks/{history-repair-CKE7GLZR.js → history-repair-4NOFFG2W.js} +12 -12
  184. package/dist/cli-bundle/chunks/{history-repair-ANHEYWKF.js → history-repair-GQN2X4TR.js} +12 -12
  185. package/dist/cli-bundle/chunks/init-K34V4PZR.js +20 -0
  186. package/dist/cli-bundle/chunks/{init-K6MSMB37.js → init-TDEDNVMM.js} +10 -9
  187. package/dist/cli-bundle/chunks/{learnings-VIS3NOQV.js → learnings-TV2CTGJ3.js} +10 -10
  188. package/dist/cli-bundle/chunks/{learnings-YYNB64GN.js → learnings-U67FTXPB.js} +10 -10
  189. package/dist/cli-bundle/chunks/{list-UHMA3N2K.js → list-MSHYOCFU.js} +10 -10
  190. package/dist/cli-bundle/chunks/{list-7UE44A2R.js → list-VV57WGUD.js} +10 -10
  191. package/dist/cli-bundle/chunks/{notes-IN3UMA7W.js → notes-EUANWWKD.js} +10 -10
  192. package/dist/cli-bundle/chunks/{notes-2HRMV67I.js → notes-GYVNDAL4.js} +10 -10
  193. package/dist/cli-bundle/chunks/{plan-PAWCCAPW.js → plan-4LF4AV63.js} +14 -14
  194. package/dist/cli-bundle/chunks/{plan-I3SVH7FV.js → plan-W27O6DBS.js} +14 -14
  195. package/dist/cli-bundle/chunks/{register-list-query-OTIK4DVA.js → register-list-query-BXLEHJ7L.js} +18 -18
  196. package/dist/cli-bundle/chunks/{register-list-query-N7Z7RTDM.js → register-list-query-C2MS3BVQ.js} +18 -18
  197. package/dist/cli-bundle/chunks/{register-mutation-UFZK6Q57.js → register-mutation-6UCOEQ6L.js} +179 -74
  198. package/dist/cli-bundle/chunks/register-mutation-6UCOEQ6L.js.map +7 -0
  199. package/dist/cli-bundle/chunks/{register-mutation-XFORLS6D.js → register-mutation-HE73PREP.js} +180 -75
  200. package/dist/cli-bundle/chunks/register-mutation-HE73PREP.js.map +1 -0
  201. package/dist/cli-bundle/chunks/{register-operations-6ZCLKRBG.js → register-operations-L6C32FDA.js} +89 -31
  202. package/dist/cli-bundle/chunks/{register-operations-6ZCLKRBG.js.map → register-operations-L6C32FDA.js.map} +2 -2
  203. package/dist/cli-bundle/chunks/{register-operations-ITE7JTH3.js → register-operations-QQEHEX4P.js} +90 -32
  204. package/dist/cli-bundle/chunks/{register-operations-ITE7JTH3.js.map → register-operations-QQEHEX4P.js.map} +1 -1
  205. package/dist/cli-bundle/chunks/{register-setup-7RKGE4BQ.js → register-setup-A7N4PNT3.js} +15 -15
  206. package/dist/cli-bundle/chunks/{register-setup-7UKEFKT6.js → register-setup-WHG3NBP6.js} +15 -15
  207. package/dist/cli-bundle/chunks/{restore-NNVPBBVJ.js → restore-TSWSULYY.js} +11 -11
  208. package/dist/cli-bundle/chunks/restore-XQXICL3V.js +19 -0
  209. package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js +91 -0
  210. package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js.map +7 -0
  211. package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js +88 -0
  212. package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js.map +1 -0
  213. package/dist/cli-bundle/chunks/{schema-3YKCQ3VO.js → schema-7U7JUYGK.js} +779 -10
  214. package/dist/cli-bundle/chunks/schema-7U7JUYGK.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{schema-3HCLXCFX.js → schema-TSBYSEMW.js} +792 -9
  216. package/dist/cli-bundle/chunks/schema-TSBYSEMW.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{search-NQ42NC6A.js → search-OXLSQKHP.js} +11 -11
  218. package/dist/cli-bundle/chunks/{search-V7PZ2ICH.js → search-T3TOFLOQ.js} +11 -11
  219. package/dist/cli-bundle/chunks/{stats-7KD4PJC5.js → stats-5CLG22YZ.js} +8 -8
  220. package/dist/cli-bundle/chunks/{stats-GRHO6RFB.js → stats-XEMUXS42.js} +8 -8
  221. package/dist/cli-bundle/chunks/{telemetry-TRRYZXWT.js → telemetry-23OPBBZT.js} +4 -4
  222. package/dist/cli-bundle/chunks/{telemetry-H5GLXNG5.js → telemetry-I3D7XZ55.js} +4 -4
  223. package/dist/cli-bundle/chunks/{test-6CZNIIGA.js → test-AROS3LIV.js} +15 -14
  224. package/dist/cli-bundle/chunks/{test-7GVQ3VMN.js → test-CECIMKOA.js} +15 -14
  225. package/dist/cli-bundle/chunks/{test-all-ODVADHV6.js → test-all-4DEQPIXH.js} +17 -16
  226. package/dist/cli-bundle/chunks/{test-all-ODVADHV6.js.map → test-all-4DEQPIXH.js.map} +1 -1
  227. package/dist/cli-bundle/chunks/{test-all-3LF2OZD2.js → test-all-6RO6X3SM.js} +15 -14
  228. package/dist/cli-bundle/chunks/{test-all-3LF2OZD2.js.map → test-all-6RO6X3SM.js.map} +1 -1
  229. package/dist/cli-bundle/chunks/{test-runs-LYT6ZTNQ.js → test-runs-AAXVFWKH.js} +5 -5
  230. package/dist/cli-bundle/chunks/{test-runs-RVP6VWN7.js → test-runs-LYBQSYRC.js} +5 -5
  231. package/dist/cli-bundle/chunks/update-MIWEJC76.js +24 -0
  232. package/dist/cli-bundle/chunks/update-P7I5YSRB.js +28 -0
  233. package/dist/cli-bundle/chunks/{update-many-XSEQJ24X.js → update-many-5B4HLVBK.js} +23 -23
  234. package/dist/cli-bundle/chunks/{update-many-FCU6RKTO.js → update-many-G2QOVZSB.js} +23 -23
  235. package/dist/cli-bundle/chunks/{upgrade-FOB5LHO5.js → upgrade-GFIDL62L.js} +5 -5
  236. package/dist/cli-bundle/chunks/{upgrade-A6TL3INC.js → upgrade-QUQYL7D3.js} +5 -5
  237. package/dist/cli-bundle/chunks/{validate-EHL3MI2V.js → validate-ADDZBMM3.js} +20 -19
  238. package/dist/cli-bundle/chunks/{validate-EHL3MI2V.js.map → validate-ADDZBMM3.js.map} +1 -1
  239. package/dist/cli-bundle/chunks/{validate-7BLDG3AT.js → validate-MAS3H6ZP.js} +22 -21
  240. package/dist/cli-bundle/chunks/{validate-7BLDG3AT.js.map → validate-MAS3H6ZP.js.map} +1 -1
  241. package/dist/cli-bundle/main.js +61 -19
  242. package/dist/cli-bundle/main.js.map +2 -2
  243. package/dist/core/config/nested-settings.js +40 -2
  244. package/dist/core/config/nested-settings.js.map +1 -1
  245. package/dist/core/item/parse.d.ts +32 -0
  246. package/dist/core/item/parse.js +61 -2
  247. package/dist/core/item/parse.js.map +1 -1
  248. package/dist/core/schema/fields-file.d.ts +94 -0
  249. package/dist/core/schema/fields-file.js +317 -0
  250. package/dist/core/schema/fields-file.js.map +1 -0
  251. package/dist/core/schema/type-inference.d.ts +34 -0
  252. package/dist/core/schema/type-inference.js +97 -0
  253. package/dist/core/schema/type-inference.js.map +1 -0
  254. package/dist/core/schema/type-presets.d.ts +30 -0
  255. package/dist/core/schema/type-presets.js +96 -0
  256. package/dist/core/schema/type-presets.js.map +1 -0
  257. package/dist/core/store/front-matter-cache.d.ts +13 -0
  258. package/dist/core/store/front-matter-cache.js +21 -11
  259. package/dist/core/store/front-matter-cache.js.map +1 -1
  260. package/dist/mcp/server.js +51 -4
  261. package/dist/mcp/server.js.map +1 -1
  262. package/dist/mcp/tool-definitions.js +49 -8
  263. package/dist/mcp/tool-definitions.js.map +1 -1
  264. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  265. package/dist/sdk/cli-contracts/enum-contracts.js +5 -2
  266. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  267. package/dist/sdk/cli-contracts/tool-parameter-tables.js +46 -5
  268. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  269. package/dist/sdk/cli-contracts.d.ts +3 -0
  270. package/dist/sdk/cli-contracts.js +76 -3
  271. package/dist/sdk/cli-contracts.js.map +1 -1
  272. package/docs/COMMANDS.md +35 -3
  273. package/docs/CONFIGURATION.md +83 -0
  274. package/package.json +1 -1
  275. package/dist/cli-bundle/chunks/activity-5P2KQCTH.js +0 -18
  276. package/dist/cli-bundle/chunks/chunk-3XOXWOGA.js.map +0 -1
  277. package/dist/cli-bundle/chunks/chunk-4KBK4BA3.js.map +0 -7
  278. package/dist/cli-bundle/chunks/chunk-7K2MXFMX.js.map +0 -1
  279. package/dist/cli-bundle/chunks/chunk-AERT7KT3.js.map +0 -1
  280. package/dist/cli-bundle/chunks/chunk-F7WSO5UX.js.map +0 -1
  281. package/dist/cli-bundle/chunks/chunk-G3CEIXTV.js.map +0 -7
  282. package/dist/cli-bundle/chunks/chunk-H6EH6ENJ.js.map +0 -7
  283. package/dist/cli-bundle/chunks/chunk-HDIDUME4.js.map +0 -1
  284. package/dist/cli-bundle/chunks/chunk-IQVB3YDD.js.map +0 -7
  285. package/dist/cli-bundle/chunks/chunk-KQ3LAMDO.js.map +0 -7
  286. package/dist/cli-bundle/chunks/chunk-OLTYNVJR.js.map +0 -7
  287. package/dist/cli-bundle/chunks/chunk-PZD7WPUC.js.map +0 -1
  288. package/dist/cli-bundle/chunks/chunk-SY4GKIWT.js.map +0 -1
  289. package/dist/cli-bundle/chunks/close-ILMZR3D7.js +0 -13
  290. package/dist/cli-bundle/chunks/config-IOJELD6O.js.map +0 -1
  291. package/dist/cli-bundle/chunks/config-PXTMAYV3.js.map +0 -7
  292. package/dist/cli-bundle/chunks/contracts-NSBVLXQ3.js.map +0 -7
  293. package/dist/cli-bundle/chunks/create-F5HZX2S4.js +0 -30
  294. package/dist/cli-bundle/chunks/history-SSXGGTVZ.js +0 -20
  295. package/dist/cli-bundle/chunks/history-redact-VBH44Y7F.js +0 -21
  296. package/dist/cli-bundle/chunks/init-7FBQO77A.js +0 -19
  297. package/dist/cli-bundle/chunks/register-mutation-UFZK6Q57.js.map +0 -7
  298. package/dist/cli-bundle/chunks/register-mutation-XFORLS6D.js.map +0 -1
  299. package/dist/cli-bundle/chunks/restore-XXXLQ2XC.js +0 -19
  300. package/dist/cli-bundle/chunks/schema-3HCLXCFX.js.map +0 -7
  301. package/dist/cli-bundle/chunks/schema-3YKCQ3VO.js.map +0 -1
  302. package/dist/cli-bundle/chunks/update-MPGM6SBE.js +0 -28
  303. package/dist/cli-bundle/chunks/update-UN75XW3C.js +0 -24
  304. /package/dist/cli-bundle/chunks/{activity-5P2KQCTH.js.map → activity-PZYSZA26.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{activity-MJGTX4LO.js.map → activity-SFM4THAU.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{aggregate-OUGCDFNC.js.map → aggregate-Y5ADDKBM.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{aggregate-MH3GROKB.js.map → aggregate-YTAUQLRW.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{append-VCRUG2W6.js.map → append-4M7OVV7M.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{append-2Q4BPUBW.js.map → append-HSPK4L4V.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-F2GC6L3N.js.map → chunk-26BM6YLO.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-ILHLIA47.js.map → chunk-2C6FU3D3.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-B5Q7XC4K.js.map → chunk-2OPYLXDO.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-CBMETQ2U.js.map → chunk-2S46FKLB.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-MJZUZ2QE.js.map → chunk-2TMKMTEI.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-M23HXJL3.js.map → chunk-2VH7DFSJ.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-BJWTFOZM.js.map → chunk-3ENF4NO4.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-7EILPFMA.js.map → chunk-3GR2HTYY.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-764O7EUA.js.map → chunk-3R3FYCBV.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-4VLB4JH2.js.map → chunk-5FDYWOJT.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-WZCQVABQ.js.map → chunk-5XGWFUW2.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-667XI4UJ.js.map → chunk-6BD77FGL.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-KZYVTOG5.js.map → chunk-6HF6CIY2.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-XLNNCKTN.js.map → chunk-6PBPD4MN.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-Z3MUNQRV.js.map → chunk-6VFUEGOA.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-O46LTCXQ.js.map → chunk-AJCQ5GT6.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-7ZGKNHUL.js.map → chunk-ALTGYHN3.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-SY4PZWIZ.js.map → chunk-AXLDUGXA.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-YGRPBFMA.js.map → chunk-BITCVGHT.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-UUKORJSN.js.map → chunk-CGQTFWYI.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-LV5FFQ7M.js.map → chunk-CHM2VFVL.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-7AGIXLNK.js.map → chunk-COVLE33A.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-2JEGCDYT.js.map → chunk-F5MSD5HE.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-NIQHNDBZ.js.map → chunk-FAXB6F6R.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-TIRZIQRP.js.map → chunk-G2MOUCTU.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-GAVE4MYM.js.map → chunk-IROHIK2T.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-ZJRDVYZI.js.map → chunk-JZHL4E3Q.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-UBMCSJXX.js.map → chunk-KCAGIH6K.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-656HPQPO.js.map → chunk-KO3VM5GS.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-OY3P2I6B.js.map → chunk-LNH5Q32E.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-GQ4JKNMV.js.map → chunk-LORM3M2I.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-OCTQJP42.js.map → chunk-M4AVU7VC.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-3WAULYOY.js.map → chunk-MIBX6ZRN.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-FXNT5LPX.js.map → chunk-MMF2E3FM.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-IMQG4VR3.js.map → chunk-MUTUZ2HD.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-NCIBNERT.js.map → chunk-OOIH6J5T.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-II7OGE3V.js.map → chunk-OSBJPPX3.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-HPELHUTG.js.map → chunk-PJS3WDO2.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-6NQXMGYU.js.map → chunk-QGPE2H6Z.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-ASM4DVRW.js.map → chunk-QVTFFLR2.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-FTAZLAR7.js.map → chunk-QW2F6ARZ.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-A576QZDL.js.map → chunk-QXC3LWB7.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-6BV7ENQL.js.map → chunk-QXMXRPX5.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-SPYPC5CB.js.map → chunk-R4AKUPKI.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-UAR2VNCK.js.map → chunk-RASR23HV.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-YXTLI4XP.js.map → chunk-SCDCNGCV.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-2IUJBMKS.js.map → chunk-SCS5PVAA.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-KTVETP66.js.map → chunk-SJCMTOEU.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-L6FJPOT4.js.map → chunk-SO2ES46D.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-GYMG7AG6.js.map → chunk-TBV33CB4.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-XNOY7TCB.js.map → chunk-UGUJ2UOR.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-E6J2PEK6.js.map → chunk-UN6P3IJ4.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-ZONXMSVB.js.map → chunk-V2GYOMEX.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-T5VU7ROQ.js.map → chunk-VF3KQGNY.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-RKKIH2ZQ.js.map → chunk-VHG6LUKR.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-G2YVUY7I.js.map → chunk-VXRFAE7W.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-Q5RLUCP3.js.map → chunk-WQRL4COW.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-TUB3DZAZ.js.map → chunk-YLAW3FZN.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{claim-NEO7AGWH.js.map → claim-WGAWJCPY.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{claim-4APLUXJW.js.map → claim-ZI6P4LMU.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{close-ILMZR3D7.js.map → close-I7PRQ5G7.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{close-3QABBNGU.js.map → close-JMVVSIQE.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{close-many-MIZLTYGL.js.map → close-many-IKPJXVOZ.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{close-many-Q7Y5AHQI.js.map → close-many-TXABDCSJ.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{comments-DAIQPOMU.js.map → comments-RLWR2S7W.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{comments-IWFSVM4P.js.map → comments-YAMXKHUX.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{context-QHJSCJW4.js.map → context-K6QAHN5H.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{context-XZS2VFKU.js.map → context-VGXOOAH2.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{copy-Q64T5FD4.js.map → copy-Q2PPU4AY.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{copy-SG34LCMU.js.map → copy-SC6UF3PI.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{create-IPAX2SNL.js.map → create-76FE7JVF.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{create-F5HZX2S4.js.map → create-RTRFW6RE.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{delete-VH3L7DZ6.js.map → delete-T6DJSUJI.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{delete-TLXR7LJ2.js.map → delete-XFUX533E.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{deps-J3HBBLDB.js.map → deps-5GWMMS6D.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{deps-XV6JJ6IN.js.map → deps-MCCU633S.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{docs-GWDEB7JH.js.map → docs-HE3HCQ4S.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{docs-RCLNSKID.js.map → docs-SXMOABHR.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{extension-7KO2NX2A.js.map → extension-E23K4QRR.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{extension-5RN65LHT.js.map → extension-PMD3XMLN.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{files-3TCQHUHA.js.map → files-2RSWGPEU.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{files-5FDUPSEA.js.map → files-ZWFJFWBK.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{focus-HQXBYPKM.js.map → focus-KTTB3P3F.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{focus-7AQMNRSU.js.map → focus-ZMDP4FEL.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{gc-5B6ABL3Z.js.map → gc-BXIAKLAH.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{gc-2FGKYRJ4.js.map → gc-C7K6JNUO.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{get-FUMVOJQD.js.map → get-AZQLC4NO.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{get-H5BZTW4A.js.map → get-I65HTAWO.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{health-JSVOR6B4.js.map → health-3MFFPQVZ.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{health-LE2ZQGSM.js.map → health-MYZEOCLI.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{history-QO4JVJJP.js.map → history-73Z6OBFZ.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{history-SSXGGTVZ.js.map → history-BIPHVUMF.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{history-compact-ID74DOUI.js.map → history-compact-24VQ63A3.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{history-compact-SDFRPZ4V.js.map → history-compact-UIAR2OI4.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{history-redact-Z4P5MM3G.js.map → history-redact-7YCXEWJD.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-redact-VBH44Y7F.js.map → history-redact-WZZ6GZ2Z.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{history-repair-CKE7GLZR.js.map → history-repair-4NOFFG2W.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{history-repair-ANHEYWKF.js.map → history-repair-GQN2X4TR.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{init-7FBQO77A.js.map → init-K34V4PZR.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{init-K6MSMB37.js.map → init-TDEDNVMM.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{learnings-VIS3NOQV.js.map → learnings-TV2CTGJ3.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{learnings-YYNB64GN.js.map → learnings-U67FTXPB.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{list-UHMA3N2K.js.map → list-MSHYOCFU.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{list-7UE44A2R.js.map → list-VV57WGUD.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{notes-IN3UMA7W.js.map → notes-EUANWWKD.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{notes-2HRMV67I.js.map → notes-GYVNDAL4.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{plan-PAWCCAPW.js.map → plan-4LF4AV63.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{plan-I3SVH7FV.js.map → plan-W27O6DBS.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{register-list-query-OTIK4DVA.js.map → register-list-query-BXLEHJ7L.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{register-list-query-N7Z7RTDM.js.map → register-list-query-C2MS3BVQ.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{register-setup-7RKGE4BQ.js.map → register-setup-A7N4PNT3.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{register-setup-7UKEFKT6.js.map → register-setup-WHG3NBP6.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{restore-NNVPBBVJ.js.map → restore-TSWSULYY.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{restore-XXXLQ2XC.js.map → restore-XQXICL3V.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{search-NQ42NC6A.js.map → search-OXLSQKHP.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{search-V7PZ2ICH.js.map → search-T3TOFLOQ.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{stats-7KD4PJC5.js.map → stats-5CLG22YZ.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{stats-GRHO6RFB.js.map → stats-XEMUXS42.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{telemetry-TRRYZXWT.js.map → telemetry-23OPBBZT.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{telemetry-H5GLXNG5.js.map → telemetry-I3D7XZ55.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{test-6CZNIIGA.js.map → test-AROS3LIV.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{test-7GVQ3VMN.js.map → test-CECIMKOA.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{test-runs-LYT6ZTNQ.js.map → test-runs-AAXVFWKH.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{test-runs-RVP6VWN7.js.map → test-runs-LYBQSYRC.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{update-UN75XW3C.js.map → update-MIWEJC76.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{update-MPGM6SBE.js.map → update-P7I5YSRB.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{update-many-XSEQJ24X.js.map → update-many-5B4HLVBK.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{update-many-FCU6RKTO.js.map → update-many-G2QOVZSB.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{upgrade-FOB5LHO5.js.map → upgrade-GFIDL62L.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{upgrade-A6TL3INC.js.map → upgrade-QUQYL7D3.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/register-mutation.ts","../../../../../../../../core/io/body-file.ts","../../../../../../../../core/shared/option-alias-visibility.ts"],"sourcesContent":["import { Option, type Command } from \"commander\";\nimport { resolveBodyFileContent } from \"../core/io/body-file.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport { isPureSnakeCaseAlias } from \"../core/shared/option-alias-visibility.js\";\nimport {\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n type CommanderOptionRegistrationContract,\n} from \"../sdk/cli-contracts.js\";\nimport { BUILTIN_ITEM_TYPE_VALUES } from \"../types/index.js\";\n\n// Lowercase set of built-in type names (\"epic\", \"feature\", ...) used by the\n// `pm create` positional guard (pm-edge #1, 2026-05-28): if the single\n// positional exactly matches a known type AND no --title was given, we throw\n// instead of silently creating a Task titled with the type name.\nconst BUILTIN_TYPE_NAME_LOOKUP = new Set<string>(BUILTIN_ITEM_TYPE_VALUES.map((value) => value.toLowerCase()));\nimport {\n collect,\n extractUpdateManyMutationOptionSource,\n formatHookWarnings,\n getGlobalOptions,\n invalidateSearchCachesForMutation,\n normalizeCreateOptions,\n normalizeUpdateOptions,\n printError,\n printResult,\n writeStdout,\n} from \"./registration-helpers.js\";\n\n\n\n/**\n * Register a flag and hide it from `--help` text while keeping it fully\n * functional as a parse-time alias. The option still appears in\n * `command.options`, so the JSON help payload and shell completion (which read\n * from the contracts/commander option list, not the rendered text) are\n * unchanged — only commander's text `--help` omits it.\n */\nfunction addHiddenOption(command: Command, flags: string, description: string, repeatable: boolean): void {\n const option = new Option(flags, description).hideHelp();\n if (repeatable) {\n option.argParser(collect);\n }\n command.addOption(option);\n}\n\n/**\n * Parse the `--order` value for `pm schema add-status`. Accepts a value that is\n * already a number or a numeric string; throws a usage error when the flag was\n * supplied but does not parse to a finite integer (rather than silently dropping\n * it). Returns `undefined` only when the flag was genuinely not provided.\n */\nexport function parseSchemaOrderOption(raw: unknown): number | undefined {\n if (raw === undefined || raw === null) {\n return undefined;\n }\n if (typeof raw === \"number\") {\n if (!Number.isInteger(raw)) {\n throw new PmCliError(\"--order must be a finite integer.\", EXIT_CODE.USAGE);\n }\n return raw;\n }\n if (typeof raw === \"string\") {\n if (raw.trim().length === 0) {\n return undefined;\n }\n const parsed = Number(raw);\n if (!Number.isInteger(parsed)) {\n throw new PmCliError(\"--order must be a finite integer.\", EXIT_CODE.USAGE);\n }\n return parsed;\n }\n throw new PmCliError(\"--order must be a finite integer.\", EXIT_CODE.USAGE);\n}\n\n/**\n * Build a commander argParser that coerces a flag value into a positive\n * (1-based) integer, throwing a usage error when the supplied value is not a\n * whole number >= 1. Used by `pm comments --edit/--delete <index>` so an\n * invalid index fails fast with a clear message instead of silently coercing.\n */\nexport function parsePositiveIntOption(flag: string): (value: string) => number {\n return (value: string): number => {\n const parsed = Number(value);\n if (!Number.isInteger(parsed) || parsed < 1) {\n throw new PmCliError(`${flag} must be a positive integer (1-based index).`, EXIT_CODE.USAGE);\n }\n return parsed;\n };\n}\n\n// Bulk content-field selection filters (GH-242) shared by update-many and\n// close-many. Each pair mirrors the list-family presence/absence flags but uses\n// the `--filter-` prefix so they live in the bulk-selection namespace. The\n// governance-missing filters (GH-236) reuse the same `--filter-<gov>-missing`\n// spelling as the list family.\nfunction registerBulkContentAndGovernanceFilters(command: Command, action: string): void {\n command\n .option(\"--filter-has-notes\", `Select only items that have notes before ${action}`)\n .option(\"--filter-no-notes\", `Select only items that have no notes before ${action}`)\n .option(\"--filter-has-learnings\", `Select only items that have learnings before ${action}`)\n .option(\"--filter-no-learnings\", `Select only items that have no learnings before ${action}`)\n .option(\"--filter-has-files\", `Select only items that have linked files before ${action}`)\n .option(\"--filter-no-files\", `Select only items that have no linked files before ${action}`)\n .option(\"--filter-has-docs\", `Select only items that have linked docs before ${action}`)\n .option(\"--filter-no-docs\", `Select only items that have no linked docs before ${action}`)\n .option(\"--filter-has-tests\", `Select only items that have linked tests before ${action}`)\n .option(\"--filter-no-tests\", `Select only items that have no linked tests before ${action}`)\n .option(\"--filter-has-comments\", `Select only items that have comments before ${action}`)\n .option(\"--filter-no-comments\", `Select only items that have no comments before ${action}`)\n .option(\"--filter-has-deps\", `Select only items that have dependencies before ${action}`)\n .option(\"--filter-no-deps\", `Select only items that have no dependencies before ${action}`)\n .option(\"--filter-has-body\", `Select only items that have a non-empty body before ${action}`)\n .option(\"--filter-empty-body\", `Select only items with an empty body before ${action}`)\n .option(\"--filter-has-linked-command\", `Select only items whose linked tests carry a runnable command before ${action}`)\n .option(\"--filter-no-linked-command\", `Select only items whose linked tests carry no runnable command before ${action}`)\n .option(\"--filter-reviewer-missing\", `Select only items missing reviewer before ${action}`)\n .option(\"--filter-risk-missing\", `Select only items missing risk before ${action}`)\n .option(\"--filter-confidence-missing\", `Select only items missing confidence before ${action}`)\n .option(\"--filter-sprint-missing\", `Select only items missing sprint before ${action}`)\n .option(\"--filter-release-missing\", `Select only items missing release before ${action}`);\n}\n\n// Map the bulk content/governance `--filter-*` commander options into the\n// ListOptions content/governance fields runList consumes. Shared by update-many\n// and close-many.\n// [hasCommanderKey, noCommanderKey, --filter-has flag, --filter-no flag]\nconst BULK_CONTENT_FILTER_CONFLICTS: ReadonlyArray<readonly [string, string, string, string]> = [\n [\"filterHasNotes\", \"filterNoNotes\", \"--filter-has-notes\", \"--filter-no-notes\"],\n [\"filterHasLearnings\", \"filterNoLearnings\", \"--filter-has-learnings\", \"--filter-no-learnings\"],\n [\"filterHasFiles\", \"filterNoFiles\", \"--filter-has-files\", \"--filter-no-files\"],\n [\"filterHasDocs\", \"filterNoDocs\", \"--filter-has-docs\", \"--filter-no-docs\"],\n [\"filterHasTests\", \"filterNoTests\", \"--filter-has-tests\", \"--filter-no-tests\"],\n [\"filterHasComments\", \"filterNoComments\", \"--filter-has-comments\", \"--filter-no-comments\"],\n [\"filterHasDeps\", \"filterNoDeps\", \"--filter-has-deps\", \"--filter-no-deps\"],\n [\"filterHasBody\", \"filterEmptyBody\", \"--filter-has-body\", \"--filter-empty-body\"],\n [\"filterHasLinkedCommand\", \"filterNoLinkedCommand\", \"--filter-has-linked-command\", \"--filter-no-linked-command\"],\n];\n\nfunction mapBulkContentAndGovernanceFilters(options: Record<string, unknown>): Record<string, unknown> {\n const presence = (key: string): true | undefined => (options[key] === true ? true : undefined);\n // Catch a both-present-and-absent bulk request here so the error names the\n // bulk --filter-* flags the user actually typed, rather than the downstream\n // list-level --has-/--no- flags resolveContentFieldFilters would report.\n for (const [hasKey, noKey, hasFlag, noFlag] of BULK_CONTENT_FILTER_CONFLICTS) {\n if (options[hasKey] === true && options[noKey] === true) {\n throw new PmCliError(`Cannot combine ${hasFlag} with ${noFlag} for the same field.`, EXIT_CODE.USAGE);\n }\n }\n return {\n filterReviewerMissing: presence(\"filterReviewerMissing\"),\n filterRiskMissing: presence(\"filterRiskMissing\"),\n filterConfidenceMissing: presence(\"filterConfidenceMissing\"),\n filterSprintMissing: presence(\"filterSprintMissing\"),\n filterReleaseMissing: presence(\"filterReleaseMissing\"),\n hasNotes: presence(\"filterHasNotes\"),\n hasLearnings: presence(\"filterHasLearnings\"),\n hasFiles: presence(\"filterHasFiles\"),\n hasDocs: presence(\"filterHasDocs\"),\n hasTests: presence(\"filterHasTests\"),\n hasComments: presence(\"filterHasComments\"),\n hasDeps: presence(\"filterHasDeps\"),\n hasBody: presence(\"filterHasBody\"),\n hasLinkedCommand: presence(\"filterHasLinkedCommand\"),\n noNotes: presence(\"filterNoNotes\"),\n noLearnings: presence(\"filterNoLearnings\"),\n noFiles: presence(\"filterNoFiles\"),\n noDocs: presence(\"filterNoDocs\"),\n noTests: presence(\"filterNoTests\"),\n noComments: presence(\"filterNoComments\"),\n noDeps: presence(\"filterNoDeps\"),\n emptyBody: presence(\"filterEmptyBody\"),\n noLinkedCommand: presence(\"filterNoLinkedCommand\"),\n };\n}\n\nexport function registerCommanderOptionContracts(command: Command, contracts: CommanderOptionRegistrationContract[]): void {\n for (const contract of contracts) {\n if (contract.required) {\n command.requiredOption(contract.option, contract.description);\n } else if (contract.repeatable) {\n command.option(contract.option, contract.description, collect);\n } else {\n command.option(contract.option, contract.description);\n }\n for (const aliasContract of contract.aliasOptions ?? []) {\n // Hide pure snake_case underscore-duplicate aliases (e.g. --create_mode\n // for --create-mode) from --help, but keep semantically-distinct aliases\n // (e.g. --ac for --acceptance-criteria) visible.\n if (isPureSnakeCaseAlias(contract.option, aliasContract.option)) {\n addHiddenOption(command, aliasContract.option, aliasContract.description, contract.repeatable === true);\n } else if (contract.repeatable) {\n command.option(aliasContract.option, aliasContract.description, collect);\n } else {\n command.option(aliasContract.option, aliasContract.description);\n }\n }\n }\n}\n\n/**\n * Map raw `update-many --filter-*` commander options into the ListOptions shape\n * runList consumes. Extracted from registerMutationCommands so its many\n * string/boolean coercions do not inflate that function's cyclomatic complexity.\n */\nfunction buildUpdateManyListOptions(options: Record<string, unknown>): Record<string, unknown> {\n const readString = (key: string): string | undefined =>\n typeof options[key] === \"string\" ? (options[key] as string) : undefined;\n return {\n type: readString(\"filterType\"),\n tag: readString(\"filterTag\"),\n priority: readString(\"filterPriority\"),\n deadlineBefore: readString(\"filterDeadlineBefore\"),\n deadlineAfter: readString(\"filterDeadlineAfter\"),\n updatedAfter: readString(\"filterUpdatedAfter\"),\n updatedBefore: readString(\"filterUpdatedBefore\"),\n createdAfter: readString(\"filterCreatedAfter\"),\n createdBefore: readString(\"filterCreatedBefore\"),\n ids: readString(\"ids\"),\n assignee: readString(\"filterAssignee\"),\n assigneeFilter: readString(\"filterAssigneeFilter\") ?? readString(\"filterAssignee_filter\"),\n parent: readString(\"filterParent\"),\n sprint: readString(\"filterSprint\"),\n release: readString(\"filterRelease\"),\n filterAcMissing: options.filterAcMissing === true ? true : undefined,\n filterEstimatesMissing:\n options.filterEstimatesMissing === true || options.filterEstimateMissing === true ? true : undefined,\n filterResolutionMissing: options.filterResolutionMissing === true ? true : undefined,\n filterMetadataMissing: options.filterMetadataMissing === true ? true : undefined,\n ...mapBulkContentAndGovernanceFilters(options),\n limit: readString(\"limit\"),\n offset: readString(\"offset\"),\n includeBody: true,\n };\n}\n\nexport function registerMutationCommands(program: Command): void {\n const createCommand = program\n .command(\"create\")\n .argument(\"[typeOrTitle]\", \"Item title, or item type when a title follows (e.g. `pm create task \\\"Fix bug\\\"`)\")\n .argument(\"[title]\", \"Item title when the first argument is an item type\")\n .description(\"Create a new project management item.\");\n registerCommanderOptionContracts(createCommand, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);\n createCommand\n .option(\"--body-file <path>\", \"Load the item markdown body from a file (mutually exclusive with --body)\")\n .option(\"--clear-deps\", \"Clear dependency entries\")\n .option(\"--clear-comments\", \"Clear comments\")\n .option(\"--clear-notes\", \"Clear notes\")\n .option(\"--clear-learnings\", \"Clear learnings\")\n .option(\"--clear-files\", \"Clear linked files\")\n .option(\"--clear-tests\", \"Clear linked tests\")\n .option(\"--clear-docs\", \"Clear linked docs\")\n .option(\"--clear-reminders\", \"Clear reminders\")\n .option(\"--clear-events\", \"Clear events\")\n .option(\"--clear-type-options\", \"Clear type options\")\n .action(async (\n typeOrTitle: string | undefined,\n secondTitle: string | undefined,\n options: Record<string, unknown>,\n command,\n ) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n // Support both `pm create \"<title>\"` and the natural subcommand-style\n // `pm create <type> \"<title>\"` so agents are never blocked by argument\n // count. When two positionals are given, the first is the item type.\n let positionalType: string | undefined;\n let positionalTitle: string | undefined;\n if (typeof secondTitle === \"string\" && secondTitle.length > 0) {\n positionalType = typeOrTitle;\n positionalTitle = secondTitle;\n } else if (typeof typeOrTitle === \"string\" && typeOrTitle.length > 0) {\n // Honor `pm create <type> --title ...` by treating the lone positional as\n // type when an explicit --title is already present.\n const explicitTitleProvided = typeof options.title === \"string\" && options.title.trim().length > 0;\n if (explicitTitleProvided && options.type === undefined) {\n positionalType = typeOrTitle;\n } else {\n positionalTitle = typeOrTitle;\n }\n }\n // pm-edge #1 (2026-05-28): when the sole positional matches a known\n // item type AND no --title was supplied, refuse early instead of\n // silently creating a Task titled with the type name (e.g. `pm create\n // Epic` would previously produce a Task literally titled \"Epic\"). The\n // guard fires only for the ambiguous single-positional case so the\n // documented `pm create <type> <title>` flow stays a never-block.\n if (\n positionalType === undefined &&\n typeof positionalTitle === \"string\" &&\n positionalTitle.length > 0 &&\n options.title === undefined &&\n options.type === undefined &&\n BUILTIN_TYPE_NAME_LOOKUP.has(positionalTitle.trim().toLowerCase())\n ) {\n const matchedType = positionalTitle.trim();\n throw new PmCliError(\n `pm create needs a title — \"${matchedType}\" looks like an item type, not a title. Use either: pm create ${matchedType} \"<title>\" or pm create \"<title>\" --type ${matchedType}.`,\n EXIT_CODE.USAGE,\n {\n code: \"create_positional_type_without_title\",\n why: \"Without this guard the single positional is used as the title and the type defaults to Task — so the command would silently create a Task literally titled \\\"\" + matchedType + \"\\\".\",\n examples: [\n `pm create ${matchedType} \"Wire up SSO for the agent harness\"`,\n `pm create \"Wire up SSO for the agent harness\" --type ${matchedType}`,\n ],\n nextSteps: [\n `Re-run with both type and title: pm create ${matchedType} \"<title>\"`,\n ],\n },\n );\n }\n if (typeof positionalType === \"string\" && positionalType.length > 0 && options.type === undefined) {\n options.type = positionalType;\n }\n if (typeof positionalTitle === \"string\" && positionalTitle.length > 0 && options.title === undefined) {\n options.title = positionalTitle;\n }\n // GH-214: resolve --body-file into the existing body field before\n // normalization so the rest of create is unchanged. CLI-only input alias.\n if (typeof options.bodyFile === \"string\") {\n options.body = await resolveBodyFileContent(\n options.bodyFile,\n options.body !== undefined ? String(options.body) : undefined,\n );\n delete options.bodyFile;\n }\n const normalized = normalizeCreateOptions(options, { requireType: false });\n const { runCreate } = await import(\"./commands/create.js\");\n const result = await runCreate(normalized, globalOptions);\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=create took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"copy\")\n .argument(\"<id>\", \"Source item id\")\n .option(\"--title <value>\", \"Optional title override for the copied item\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .description(\"Copy an item into a new item id while resetting lifecycle fields.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runCopy } = await import(\"./commands/copy.js\");\n const result = await runCopy(\n id,\n {\n title: typeof options.title === \"string\" ? options.title : undefined,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n },\n globalOptions,\n );\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=copy took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"focus\")\n .argument(\"[id]\", \"Item id to focus (omit to show current focus)\")\n .option(\"--clear\", \"Clear the focused item\")\n .description(\"Set/clear/show the session focused item that new items default --parent to.\")\n .action(async (id: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runFocus } = await import(\"./commands/focus.js\");\n const result = await runFocus(\n id,\n { clear: options.clear === true },\n globalOptions,\n );\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=focus took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const updateCommand = program\n .command(\"update\")\n .argument(\"<id>\", \"Item id\")\n .description(\"Update item fields and metadata.\");\n registerCommanderOptionContracts(updateCommand, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);\n updateCommand\n .option(\"--body-file <path>\", \"Load the item markdown body from a file (mutually exclusive with --body)\")\n .option(\"--replace-deps\", \"Atomically replace dependency entries with the provided --dep values\")\n .option(\"--replace-tests\", \"Atomically replace linked test entries with the provided --test values\")\n .option(\"--clear-deps\", \"Clear dependency entries\")\n .option(\"--clear-comments\", \"Clear comments\")\n .option(\"--clear-notes\", \"Clear notes\")\n .option(\"--clear-learnings\", \"Clear learnings\")\n .option(\"--clear-files\", \"Clear linked files\")\n .option(\"--clear-tests\", \"Clear linked tests\")\n .option(\"--clear-docs\", \"Clear linked docs\")\n .option(\"--clear-reminders\", \"Clear reminders\")\n .option(\"--clear-events\", \"Clear events\")\n .option(\"--clear-type-options\", \"Clear type options\")\n .option(\"--allow-audit-update\", \"Allow non-owner metadata-only audit updates without requiring --force\")\n .option(\"--allow-audit-dep-update\", \"Allow non-owner append-only dependency updates without requiring --force\")\n .option(\"--force\", \"Force ownership override\");\n addHiddenOption(updateCommand, \"--allow_audit_update\", \"Alias for --allow-audit-update\", false);\n addHiddenOption(updateCommand, \"--allow_audit_dep_update\", \"Alias for --allow-audit-dep-update\", false);\n updateCommand\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n // GH-214: resolve --body-file into the existing body field before\n // normalization so the rest of update is unchanged. CLI-only input alias.\n if (typeof options.bodyFile === \"string\") {\n options.body = await resolveBodyFileContent(\n options.bodyFile,\n options.body !== undefined ? String(options.body) : undefined,\n );\n delete options.bodyFile;\n }\n const { runUpdate } = await import(\"./commands/update.js\");\n const result = await runUpdate(id, normalizeUpdateOptions(options), globalOptions);\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=update took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const updateManyCommand = program\n .command(\"update-many\")\n .description(\"Bulk-update matched items with dry-run plans and rollback checkpoints.\")\n .option(\"--filter-status <value>\", \"Filter by status before applying updates\")\n .option(\"--filter-type <value>\", \"Filter by item type before applying updates\")\n .option(\"--filter-tag <value>\", \"Filter by tag before applying updates\")\n .option(\"--filter-priority <value>\", \"Filter by priority before applying updates\")\n .option(\"--filter-deadline-before <value>\", \"Filter by deadline upper bound before applying updates\")\n .option(\"--filter-deadline-after <value>\", \"Filter by deadline lower bound before applying updates\")\n .option(\"--filter-updated-after <value>\", \"Filter by updated_at lower bound before applying updates (ISO/relative)\")\n .option(\"--filter-updated-before <value>\", \"Filter by updated_at upper bound before applying updates (ISO/relative)\")\n .option(\"--filter-created-after <value>\", \"Filter by created_at lower bound before applying updates (ISO/relative)\")\n .option(\"--filter-created-before <value>\", \"Filter by created_at upper bound before applying updates (ISO/relative)\")\n .option(\"--filter-assignee <value>\", \"Filter by assignee before applying updates\")\n .option(\"--filter-assignee-filter <value>\", \"Filter assignee presence: assigned|unassigned before applying updates\")\n .option(\"--filter-parent <value>\", \"Filter by parent item ID before applying updates\")\n .option(\"--filter-sprint <value>\", \"Filter by sprint before applying updates\")\n .option(\"--filter-release <value>\", \"Filter by release before applying updates\")\n .option(\"--filter-ac-missing\", \"Select only items missing acceptance_criteria (bulk backfill)\")\n .option(\"--filter-estimates-missing\", \"Select only items missing estimated_minutes (bulk backfill)\")\n .option(\"--filter-resolution-missing\", \"Select only terminal items missing resolution (bulk backfill)\")\n .option(\"--filter-metadata-missing\", \"Select only items missing any tracked metadata (AC, estimate, or resolution)\");\n registerBulkContentAndGovernanceFilters(updateManyCommand, \"applying updates\");\n updateManyCommand\n .option(\"--ids <value>\", \"Restrict to an explicit comma-separated ID allowlist (intersected with other filters)\")\n .option(\"--limit <n>\", \"Limit matched item count before apply/preview\")\n .option(\"--offset <n>\", \"Skip first n matched rows before apply/preview\")\n .option(\"--dry-run\", \"Preview per-item diffs and checkpoint intent without mutating\")\n .option(\"--rollback <value>\", \"Rollback a prior update-many checkpoint ID\")\n .option(\"--no-checkpoint\", \"Disable checkpoint creation during apply mode\")\n .option(\"--title, -t <value>\", \"Set title\")\n .option(\"--description, -d <value>\", \"Set description\")\n .option(\"--body, -b <value>\", \"Set body (allow empty string)\")\n .option(\"--status, -s <value>\", \"Set status (use close command for closed)\")\n .option(\"--priority, -p <value>\", \"Set priority\")\n .option(\"--type <value>\", \"Set type\")\n .option(\"--tags <value>\", \"Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.\")\n .option(\"--add-tags <value>\", \"Add tags additively without replacing existing (repeatable; CSV accepted)\", collect)\n .option(\"--remove-tags <value>\", \"Remove tags from the existing list (repeatable; CSV accepted)\", collect)\n .option(\"--deadline <value>\", \"Set deadline (ISO/date string or relative)\")\n .option(\"--estimate, --estimated-minutes <value>\", \"Set estimated minutes\")\n .option(\"--acceptance-criteria <value>\", \"Set acceptance criteria\")\n .option(\"--ac <value>\", \"Alias for --acceptance-criteria\")\n .option(\"--definition-of-ready <value>\", \"Set definition of ready\")\n .option(\"--order <value>\", \"Set planning order/rank integer\")\n .option(\"--rank <value>\", \"Alias for --order\")\n .option(\"--goal <value>\", \"Set goal identifier\")\n .option(\"--objective <value>\", \"Set objective identifier\")\n .option(\"--value <value>\", \"Set business value summary\")\n .option(\"--impact <value>\", \"Set business impact summary\")\n .option(\"--outcome <value>\", \"Set expected outcome summary\")\n .option(\"--why-now <value>\", \"Set why-now rationale\")\n .option(\"--assignee <value>\", \"Set assignee\")\n .option(\"--parent <value>\", \"Set parent item ID\")\n .option(\"--reviewer <value>\", \"Set reviewer\")\n .option(\"--risk <value>\", \"Set risk level\")\n .option(\"--confidence <value>\", \"Set confidence level\")\n .option(\"--sprint <value>\", \"Set sprint identifier\")\n .option(\"--release <value>\", \"Set release identifier\")\n .option(\"--blocked-by <value>\", \"Set blocked-by item ID or reason\")\n .option(\"--blocked-reason <value>\", \"Set blocked reason\")\n .option(\"--unblock-note <value>\", \"Set unblock rationale note\")\n .option(\"--reporter <value>\", \"Set issue reporter\")\n .option(\"--severity <value>\", \"Set issue severity\")\n .option(\"--environment <value>\", \"Set issue environment context\")\n .option(\"--repro-steps <value>\", \"Set issue reproduction steps\")\n .option(\"--resolution <value>\", \"Set issue resolution summary\")\n .option(\"--expected-result <value>\", \"Set issue expected behavior\")\n .option(\"--expected <value>\", \"Short alias for --expected-result\")\n .option(\"--actual-result <value>\", \"Set issue observed behavior\")\n .option(\"--actual <value>\", \"Short alias for --actual-result\")\n .option(\"--affected-version <value>\", \"Set affected version identifier\")\n .option(\"--fixed-version <value>\", \"Set fixed version identifier\")\n .option(\"--component <value>\", \"Set issue component ownership\")\n .option(\"--regression <value>\", \"Set regression marker: true|false|1|0\")\n .option(\"--customer-impact <value>\", \"Set customer impact summary\")\n .option(\"--dep <value>\", \"Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>\", collect)\n .option(\"--dep-remove <value>\", \"Remove dependency entries by id/kind/author/timestamp signature\", collect)\n .option(\"--replace-deps\", \"Atomically replace dependency entries with provided --dep values\")\n .option(\"--replace-tests\", \"Atomically replace linked tests with provided --test values\")\n .option(\"--comment <value>\", \"Add comment seed author=<value>,created_at=<iso|now>,text=<value>\", collect)\n .option(\"--note <value>\", \"Add note seed author=<value>,created_at=<iso|now>,text=<value>\", collect)\n .option(\"--learning <value>\", \"Add learning seed author=<value>,created_at=<iso|now>,text=<value>\", collect)\n .option(\"--file <value>\", \"Add linked file path=<value>,scope=<project|global>,note=<text>\", collect)\n .option(\"--test <value>\", \"Add linked test command=<value>,path=<value>,scope=<project|global>\", collect)\n .option(\"--doc <value>\", \"Add linked doc path=<value>,scope=<project|global>,note=<text>\", collect)\n .option(\"--reminder <value>\", \"Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>\", collect)\n .option(\"--event <value>\", \"Add event entry start=<iso|relative>,end=<iso|relative>,recur_*\", collect)\n .option(\"--type-option <value>\", \"Set type options key=value (repeatable)\", collect)\n .option(\"--unset <field>\", \"Clear scalar metadata field by name (repeatable)\", collect)\n .option(\"--clear-deps\", \"Clear dependency entries\")\n .option(\"--clear-comments\", \"Clear comments\")\n .option(\"--clear-notes\", \"Clear notes\")\n .option(\"--clear-learnings\", \"Clear learnings\")\n .option(\"--clear-files\", \"Clear linked files\")\n .option(\"--clear-tests\", \"Clear linked tests\")\n .option(\"--clear-docs\", \"Clear linked docs\")\n .option(\"--clear-reminders\", \"Clear reminders\")\n .option(\"--clear-events\", \"Clear events\")\n .option(\"--clear-type-options\", \"Clear type options\")\n .option(\"--allow-audit-update\", \"Allow non-owner metadata-only audit updates without requiring --force\")\n .option(\"--allow-audit-dep-update\", \"Allow non-owner append-only dependency updates without requiring --force\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"Mutation message\")\n .option(\"--force\", \"Force ownership override\");\n // Hidden pure snake_case underscore-duplicate aliases (kept parse-functional,\n // omitted from --help to save agent context).\n for (const [flags, description] of [\n [\"--filter-assignee_filter <value>\", \"Alias for --filter-assignee-filter\"],\n [\"--estimated_minutes <value>\", \"Alias for --estimated-minutes\"],\n [\"--acceptance_criteria <value>\", \"Alias for --acceptance-criteria\"],\n [\"--definition_of_ready <value>\", \"Alias for --definition-of-ready\"],\n [\"--why_now <value>\", \"Alias for --why-now\"],\n [\"--blocked_by <value>\", \"Alias for --blocked-by\"],\n [\"--blocked_reason <value>\", \"Alias for --blocked-reason\"],\n [\"--unblock_note <value>\", \"Alias for --unblock-note\"],\n [\"--repro_steps <value>\", \"Alias for --repro-steps\"],\n [\"--expected_result <value>\", \"Alias for --expected-result\"],\n [\"--actual_result <value>\", \"Alias for --actual-result\"],\n [\"--affected_version <value>\", \"Alias for --affected-version\"],\n [\"--fixed_version <value>\", \"Alias for --fixed-version\"],\n [\"--customer_impact <value>\", \"Alias for --customer-impact\"],\n [\"--allow_audit_update\", \"Alias for --allow-audit-update\"],\n [\"--allow_audit_dep_update\", \"Alias for --allow-audit-dep-update\"],\n [\"--filter-estimate-missing\", \"Alias for --filter-estimates-missing\"],\n ] as const) {\n addHiddenOption(updateManyCommand, flags, description, false);\n }\n for (const [flags, description] of [\n [\"--dep_remove <value>\", \"Alias for --dep-remove\"],\n [\"--type_option <value>\", \"Alias for --type-option\"],\n [\"--add_tags <value>\", \"Alias for --add-tags\"],\n [\"--remove_tags <value>\", \"Alias for --remove-tags\"],\n ] as const) {\n addHiddenOption(updateManyCommand, flags, description, true);\n }\n updateManyCommand\n .action(async (options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runUpdateMany } = await import(\"./commands/update-many.js\");\n const result = await runUpdateMany(\n {\n status: typeof options.filterStatus === \"string\" ? options.filterStatus : undefined,\n list: buildUpdateManyListOptions(options),\n update: normalizeUpdateOptions(extractUpdateManyMutationOptionSource(options)),\n dryRun: options.dryRun === true ? true : undefined,\n rollback: typeof options.rollback === \"string\" ? options.rollback : undefined,\n checkpoint: options.checkpoint === false ? false : undefined,\n },\n globalOptions,\n );\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=update-many took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const closeCommand = program\n .command(\"close\")\n .argument(\"<id>\", \"Item id\")\n .argument(\"[text]\", \"Close reason text (alias: --reason)\")\n .option(\"-r, --reason <value>\", \"Close reason text (alias for positional <text>)\")\n .option(\"--close-reason <value>\", \"Close reason text (alias for positional <text>)\")\n .option(\"-d, --duplicate-of <id>\", \"Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"-m, --message <value>\", \"History message\")\n .option(\"--validate-close [mode]\", 'Validate closure metadata before close: \"off\", \"warn\", or \"strict\" (default: settings governance preset)')\n .option(\"--resolution <value>\", \"Set the closure resolution summary inline (same field --validate-close strict checks; previously required a prior pm update)\")\n .option(\"--expected-result <value>\", \"Set the expected-result note inline (closure validation field)\")\n .option(\"--expected <value>\", \"Short alias for --expected-result\")\n .option(\"--actual-result <value>\", \"Set the actual-result note inline (closure validation field)\")\n .option(\"--actual <value>\", \"Short alias for --actual-result\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"Close an item. Close reason requirement follows governance.require_close_reason.\");\n // pm-fl0c #11 (2026-05-28): expose snake_case aliases alongside the canonical\n // kebab-case so agents using --expected_result/--actual_result do not get an\n // Unknown option error; the rendered help stays clean (aliases hidden).\n addHiddenOption(closeCommand, \"--expected_result <value>\", \"Alias for --expected-result\", false);\n addHiddenOption(closeCommand, \"--actual_result <value>\", \"Alias for --actual-result\", false);\n closeCommand\n .action(async (id: string, text: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runClose } = await import(\"./commands/close.js\");\n const reasonFromOption =\n (typeof options.reason === \"string\" && options.reason.trim().length > 0 && options.reason) ||\n (typeof options.closeReason === \"string\" && options.closeReason.trim().length > 0 && options.closeReason) ||\n undefined;\n const resolvedText = typeof text === \"string\" && text.length > 0 ? text : reasonFromOption;\n const pickInlineString = (...candidates: unknown[]): string | undefined => {\n for (const candidate of candidates) {\n if (typeof candidate === \"string\") {\n return candidate;\n }\n }\n return undefined;\n };\n const result = await runClose(\n id,\n resolvedText,\n {\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n validateClose:\n options.validateClose === true\n ? \"warn\"\n : typeof options.validateClose === \"string\"\n ? options.validateClose\n : undefined,\n force: Boolean(options.force),\n duplicateOf: typeof options.duplicateOf === \"string\" ? options.duplicateOf : undefined,\n resolution: typeof options.resolution === \"string\" ? options.resolution : undefined,\n expectedResult: pickInlineString(options.expectedResult, options.expected_result, options.expected),\n actualResult: pickInlineString(options.actualResult, options.actual_result, options.actual),\n },\n globalOptions,\n );\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=close took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const closeManyCommand = program\n .command(\"close-many\")\n .description(\"Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).\")\n .option(\"--filter-status <value>\", \"Filter by status before closing\")\n .option(\"--filter-type <value>\", \"Filter by item type before closing\")\n .option(\"--filter-tag <value>\", \"Filter by tag before closing\")\n .option(\"--filter-priority <value>\", \"Filter by priority before closing\")\n .option(\"--filter-deadline-before <value>\", \"Filter by deadline upper bound before closing\")\n .option(\"--filter-deadline-after <value>\", \"Filter by deadline lower bound before closing\")\n .option(\"--filter-updated-after <value>\", \"Filter by updated_at lower bound before closing (ISO/relative)\")\n .option(\"--filter-updated-before <value>\", \"Filter by updated_at upper bound before closing (ISO/relative)\")\n .option(\"--filter-created-after <value>\", \"Filter by created_at lower bound before closing (ISO/relative)\")\n .option(\"--filter-created-before <value>\", \"Filter by created_at upper bound before closing (ISO/relative)\")\n .option(\"--filter-assignee <value>\", \"Filter by assignee before closing\")\n .option(\"--filter-assignee-filter <value>\", \"Filter assignee presence: assigned|unassigned before closing\")\n .option(\"--filter-parent <value>\", \"Filter by parent item ID before closing\")\n .option(\"--filter-sprint <value>\", \"Filter by sprint before closing\")\n .option(\"--filter-release <value>\", \"Filter by release before closing\");\n registerBulkContentAndGovernanceFilters(closeManyCommand, \"closing\");\n closeManyCommand\n .option(\"--ids <value>\", \"Restrict to an explicit comma-separated ID allowlist (intersected with other filters)\")\n .option(\"--limit <n>\", \"Limit matched item count before apply/preview\")\n .option(\"--offset <n>\", \"Skip first n matched rows before apply/preview\")\n .option(\"--reason <value>\", \"Shared close reason applied to matched items (required when governance.require_close_reason is enabled)\")\n .option(\"--resolution <value>\", \"Shared closure resolution applied to every matched item (closure-validation field)\")\n .option(\"--expected-result <value>\", \"Shared expected-result note (closure-validation field)\")\n .option(\"--expected <value>\", \"Short alias for --expected-result\")\n .option(\"--actual-result <value>\", \"Shared actual-result note (closure-validation field)\")\n .option(\"--actual <value>\", \"Short alias for --actual-result\")\n .option(\"--validate-close [mode]\", 'Validate closure metadata per item: \"off\", \"warn\", or \"strict\" (default: settings governance preset)')\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--force\", \"Re-close already-terminal matches and override ownership\")\n .option(\"--dry-run\", \"Preview matched items + per-item skip/active-child plan without mutating\")\n .option(\"--rollback <value>\", \"Rollback a prior close-many checkpoint ID\")\n .option(\"--no-checkpoint\", \"Disable checkpoint creation during apply mode\");\n addHiddenOption(closeManyCommand, \"--filter-assignee_filter <value>\", \"Alias for --filter-assignee-filter\", false);\n addHiddenOption(closeManyCommand, \"--expected_result <value>\", \"Alias for --expected-result\", false);\n addHiddenOption(closeManyCommand, \"--actual_result <value>\", \"Alias for --actual-result\", false);\n closeManyCommand.action(async (options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const pickString = (...candidates: unknown[]): string | undefined => {\n for (const candidate of candidates) {\n if (typeof candidate === \"string\") {\n return candidate;\n }\n }\n return undefined;\n };\n const { runCloseMany } = await import(\"./commands/close-many.js\");\n const result = await runCloseMany(\n {\n status: typeof options.filterStatus === \"string\" ? options.filterStatus : undefined,\n list: {\n type: typeof options.filterType === \"string\" ? options.filterType : undefined,\n tag: typeof options.filterTag === \"string\" ? options.filterTag : undefined,\n priority: typeof options.filterPriority === \"string\" ? options.filterPriority : undefined,\n deadlineBefore: typeof options.filterDeadlineBefore === \"string\" ? options.filterDeadlineBefore : undefined,\n deadlineAfter: typeof options.filterDeadlineAfter === \"string\" ? options.filterDeadlineAfter : undefined,\n updatedAfter: typeof options.filterUpdatedAfter === \"string\" ? options.filterUpdatedAfter : undefined,\n updatedBefore: typeof options.filterUpdatedBefore === \"string\" ? options.filterUpdatedBefore : undefined,\n createdAfter: typeof options.filterCreatedAfter === \"string\" ? options.filterCreatedAfter : undefined,\n createdBefore: typeof options.filterCreatedBefore === \"string\" ? options.filterCreatedBefore : undefined,\n ids: typeof options.ids === \"string\" ? options.ids : undefined,\n assignee: typeof options.filterAssignee === \"string\" ? options.filterAssignee : undefined,\n assigneeFilter: pickString(options.filterAssigneeFilter, options.filterAssignee_filter),\n parent: typeof options.filterParent === \"string\" ? options.filterParent : undefined,\n sprint: typeof options.filterSprint === \"string\" ? options.filterSprint : undefined,\n release: typeof options.filterRelease === \"string\" ? options.filterRelease : undefined,\n ...mapBulkContentAndGovernanceFilters(options),\n limit: typeof options.limit === \"string\" ? options.limit : undefined,\n offset: typeof options.offset === \"string\" ? options.offset : undefined,\n },\n reason: typeof options.reason === \"string\" ? options.reason : undefined,\n resolution: typeof options.resolution === \"string\" ? options.resolution : undefined,\n expectedResult: pickString(options.expectedResult, options.expected_result, options.expected),\n actualResult: pickString(options.actualResult, options.actual_result, options.actual),\n validateClose:\n options.validateClose === true\n ? \"warn\"\n : typeof options.validateClose === \"string\"\n ? options.validateClose\n : undefined,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n dryRun: options.dryRun === true ? true : undefined,\n rollback: typeof options.rollback === \"string\" ? options.rollback : undefined,\n checkpoint: options.checkpoint === false ? false : undefined,\n },\n globalOptions,\n );\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=close-many took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"delete\")\n .argument(\"<id>\", \"Item id\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--force\", \"Force ownership override\")\n .option(\"--dry-run\", \"Preview the item file that would be deleted without mutating\")\n .description(\"Delete an item and record the change in history.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runDelete } = await import(\"./commands/delete.js\");\n const result = await runDelete(id, {\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n dryRun: options.dryRun === true,\n }, globalOptions);\n if (result.dry_run !== true) {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=delete took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"append\")\n .argument(\"<id>\", \"Item id\")\n .argument(\"[text]\", \"Optional body text shorthand (equivalent to --body; use - for stdin)\")\n .option(\"--body <value>\", \"Text to append to body (or - for stdin)\")\n .option(\"--text <value>\", \"Alias for --body\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"Mutation message\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"Append text to an item's body.\")\n .action(async (id: string, text: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const bodyFromOption = typeof options.body === \"string\" ? options.body : undefined;\n const bodyFromAlias = typeof options.text === \"string\" ? options.text : undefined;\n const bodyFromPositional = typeof text === \"string\" ? text : undefined;\n const bodySourceCount = [bodyFromOption, bodyFromAlias, bodyFromPositional].filter((value) => value !== undefined).length;\n if (bodySourceCount > 1) {\n throw new PmCliError(\"Specify append text with exactly one source: positional [text], --body, or --text\", EXIT_CODE.USAGE);\n }\n const resolvedBody = bodyFromOption ?? bodyFromAlias ?? bodyFromPositional;\n if (resolvedBody === undefined) {\n throw new PmCliError(\n \"Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).\",\n EXIT_CODE.USAGE,\n );\n }\n const { runAppend } = await import(\"./commands/append.js\");\n const result = await runAppend(id, {\n body: resolvedBody,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n }, globalOptions);\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=append took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"restore\")\n .argument(\"<id>\", \"Item id\")\n .argument(\"<target>\", \"Restore target timestamp or version number\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--force\", \"Force ownership/lock override\")\n .description(\"Restore an item to an earlier timestamp or version.\")\n .action(async (id: string, target: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runRestore } = await import(\"./commands/restore.js\");\n const result = await runRestore(id, target, {\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n }, globalOptions);\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=restore took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const planCommand = program\n .command(\"plan\")\n .description(\"Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.\")\n .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\")\n .argument(\"[id]\", \"Plan id (required for non-create subcommands); for create this may be the positional title\")\n .argument(\"[stepRef]\", \"Step reference: stable id (plan-step-001) or order integer\")\n .argument(\"[reorderTo]\", \"New order integer for reorder-step\")\n .option(\"--title <value>\", \"Plan title\")\n .option(\"--description <value>\", \"Plan description\")\n .option(\"--scope <value>\", \"Short scope statement of the target change or investigation\")\n .option(\"--parent <value>\", \"Parent pm item id\")\n .option(\"--related <value>\", \"Related pm item ids (repeatable, csv-friendly)\", collect)\n .option(\"--blocks <value>\", \"Pm item ids this plan blocks (repeatable, csv-friendly)\", collect)\n .option(\"--blocked-by <value>\", \"Pm item ids that block this plan (repeatable, csv-friendly)\", collect)\n .option(\"--harness <value>\", \"Plan harness provenance: codex|claude-code|cursor|generic\")\n .option(\"--mode <value>\", \"Plan mode: draft|research|review|approved|executing|paused|completed|superseded\")\n .option(\"--resume-context <value>\", \"Compact context summary for a future stateless agent\")\n .option(\"--tags <value>\", \"Comma-separated tags\")\n .option(\"--priority <value>\", \"Priority 0-4\")\n .option(\"--body <value>\", \"Plan item body\")\n .option(\"--claim\", \"Claim the plan on create for the author\")\n .option(\"--from-search <value>\", \"Record the search query that led to plan creation\")\n .option(\"--step-title <value>\", \"Step title for add-step / update-step\")\n // pm-6mit: --step is a Commander collect repeatable so `pm plan create\n // --step A --step B` seeds ordered steps (previously a single-value alias\n // for --step-title where the last value silently won). It must NOT be\n // list:true in contracts — the bootstrap coalescer would comma-join values\n // and corrupt titles containing commas.\n .option(\"--step <value>\", \"Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)\", collect)\n .option(\"--step-body <value>\", \"Step body text\")\n .option(\"--step-owner <value>\", \"Step owner\")\n .option(\"--step-status <value>\", \"Step status: pending|in_progress|completed|blocked|skipped|superseded\")\n .option(\"--step-evidence <value>\", \"Step evidence text (used by update-step/complete-step)\")\n .option(\"--step-blocked-reason <value>\", \"Step blocked reason (required when blocking)\")\n .option(\"--step-replacement <value>\", \"Replacement reference for a superseded step\")\n .option(\"--depends-on <value>\", \"Pm item ids the step depends on (repeatable, csv-friendly)\", collect)\n .option(\"--link <value>\", \"Pm item id to link (repeatable, csv-friendly)\", collect)\n .option(\"--link-kind <value>\", \"Link kind: related|blocks|blocked_by|depends_on|discovered_from|implements|verifies|supersedes\")\n .option(\"--link-note <value>\", \"Optional note for the link\")\n .option(\"--promote-to-item-dep\", \"Also add the linked id as a top-level item dependency when linking\")\n .option(\"--allow-multiple-active\", \"Allow multiple steps to be in_progress at once\")\n .option(\"--file <value>\", \"Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)\", collect)\n .option(\"--test <value>\", \"Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)\", collect)\n .option(\"--doc <value>\", \"Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)\", collect)\n .option(\"--decision-text <value>\", \"Decision log entry text\")\n .option(\"--decision <value>\", \"Alias for --decision-text\")\n .option(\"--decision-rationale <value>\", \"Decision log entry rationale\")\n .option(\"--decision-evidence <value>\", \"Decision log entry evidence\")\n .option(\"--discovery-text <value>\", \"Discovery log entry text\")\n .option(\"--discovery <value>\", \"Alias for --discovery-text\")\n .option(\"--validation-text <value>\", \"Validation log entry text\")\n .option(\"--validation <value>\", \"Alias for --validation-text\")\n .option(\"--validation-command <value>\", \"Validation log entry command\")\n .option(\"--validation-expected <value>\", \"Validation log entry expected outcome\")\n .option(\"--depth <value>\", \"Show depth: brief|standard|deep (default: brief)\")\n .option(\"--fields <value>\", \"Comma-separated field projection for show output\")\n .option(\"--steps <value>\", \"Comma-separated step ids/orders for materialize\")\n .option(\"--materialize-type <value>\", \"Item type for materialized steps (default: Task)\")\n .option(\"--materialize-parent <value>\", \"Parent item id for materialized children (default: the plan)\")\n .option(\"--materialize-tags <value>\", \"Comma-separated tags for materialized children\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"Mutation message\")\n .option(\"--force\", \"Force ownership override\");\n // Hidden pure snake_case underscore-duplicate aliases (kept parse-functional,\n // omitted from --help to save agent context).\n for (const [flags, description] of [\n [\"--resume_context <value>\", \"Alias for --resume-context\"],\n [\"--from_search <value>\", \"Alias for --from-search\"],\n [\"--step_title <value>\", \"Alias for --step-title\"],\n [\"--step_body <value>\", \"Alias for --step-body\"],\n [\"--step_owner <value>\", \"Alias for --step-owner\"],\n [\"--step_status <value>\", \"Alias for --step-status\"],\n [\"--step_evidence <value>\", \"Alias for --step-evidence\"],\n [\"--step_blocked_reason <value>\", \"Alias for --step-blocked-reason\"],\n [\"--step_replacement <value>\", \"Alias for --step-replacement\"],\n [\"--link_kind <value>\", \"Alias for --link-kind\"],\n [\"--link_note <value>\", \"Alias for --link-note\"],\n [\"--promote_to_item_dep\", \"Alias for --promote-to-item-dep\"],\n [\"--allow_multiple_active\", \"Alias for --allow-multiple-active\"],\n [\"--decision_text <value>\", \"Alias for --decision-text\"],\n [\"--decision_rationale <value>\", \"Alias for --decision-rationale\"],\n [\"--decision_evidence <value>\", \"Alias for --decision-evidence\"],\n [\"--discovery_text <value>\", \"Alias for --discovery-text\"],\n [\"--validation_text <value>\", \"Alias for --validation-text\"],\n [\"--validation_command <value>\", \"Alias for --validation-command\"],\n [\"--validation_expected <value>\", \"Alias for --validation-expected\"],\n [\"--materialize_type <value>\", \"Alias for --materialize-type\"],\n [\"--materialize_parent <value>\", \"Alias for --materialize-parent\"],\n [\"--materialize_tags <value>\", \"Alias for --materialize-tags\"],\n ] as const) {\n addHiddenOption(planCommand, flags, description, false);\n }\n for (const [flags, description] of [\n [\"--blocked_by <value>\", \"Alias for --blocked-by\"],\n [\"--depends_on <value>\", \"Alias for --depends-on\"],\n ] as const) {\n addHiddenOption(planCommand, flags, description, true);\n }\n planCommand\n .action(async (subcommand: string | undefined, id: string | undefined, stepRef: string | undefined, reorderToken: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runPlan, PLAN_SUBCOMMANDS } = await import(\"./commands/plan.js\");\n const normalizedSubcommand = (subcommand ?? \"\").trim().toLowerCase();\n if (!normalizedSubcommand) {\n throw new PmCliError(\n `pm plan requires a subcommand. Allowed: ${PLAN_SUBCOMMANDS.join(\", \")}`,\n EXIT_CODE.USAGE,\n {\n code: \"missing_required_argument\",\n examples: [\n 'pm plan create --title \"Refactor lock retry\"',\n \"pm plan show pm-a1b2 --depth standard\",\n 'pm plan add-step pm-a1b2 --step-title \"Read lock.ts\"',\n ],\n },\n );\n }\n if (!PLAN_SUBCOMMANDS.includes(normalizedSubcommand as typeof PLAN_SUBCOMMANDS[number])) {\n const didYouMean =\n normalizedSubcommand === \"list\" || normalizedSubcommand === \"ls\"\n ? ['pm list --type Plan', 'pm list-all --type Plan']\n : undefined;\n throw new PmCliError(\n `Unknown pm plan subcommand \"${subcommand}\". Allowed: ${PLAN_SUBCOMMANDS.join(\", \")}`,\n EXIT_CODE.USAGE,\n didYouMean ? { code: \"unknown_subcommand\", examples: didYouMean } : undefined,\n );\n }\n const planOptions: Record<string, unknown> = { ...options };\n // Normalize alternate-snake/camel aliases that Commander parses as different keys.\n const aliasPairs: Array<[string, string]> = [\n [\"blocked_by\", \"blockedBy\"],\n [\"resume_context\", \"resumeContext\"],\n [\"from_search\", \"fromSearch\"],\n // pm-6mit: \"step\" is no longer folded into stepTitle here — it is a\n // first-class repeatable option normalized inside runPlan (create\n // accumulates ordered steps; other subcommands accept a single value\n // as a stepTitle alias).\n [\"step_title\", \"stepTitle\"],\n [\"step_body\", \"stepBody\"],\n [\"step_owner\", \"stepOwner\"],\n [\"step_status\", \"stepStatus\"],\n [\"step_evidence\", \"stepEvidence\"],\n [\"step_blocked_reason\", \"stepBlockedReason\"],\n [\"step_replacement\", \"stepReplacement\"],\n [\"depends_on\", \"dependsOn\"],\n [\"link_kind\", \"linkKind\"],\n [\"link_note\", \"linkNote\"],\n [\"promote_to_item_dep\", \"promoteToItemDep\"],\n [\"allow_multiple_active\", \"allowMultipleActive\"],\n [\"decision_text\", \"decisionText\"],\n [\"decision_rationale\", \"decisionRationale\"],\n [\"decision_evidence\", \"decisionEvidence\"],\n [\"discovery_text\", \"discoveryText\"],\n [\"validation_text\", \"validationText\"],\n [\"validation_command\", \"validationCommand\"],\n [\"validation_expected\", \"validationExpected\"],\n [\"materialize_type\", \"materializeType\"],\n [\"materialize_parent\", \"materializeParent\"],\n [\"materialize_tags\", \"materializeTags\"],\n ];\n for (const [snake, camel] of aliasPairs) {\n if (planOptions[snake] !== undefined && planOptions[camel] === undefined) {\n planOptions[camel] = planOptions[snake];\n }\n }\n let reorderTo: number | undefined;\n if (normalizedSubcommand === \"reorder-step\" && typeof reorderToken === \"string\") {\n const parsed = Number.parseInt(reorderToken, 10);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`reorder-step requires an integer new order, got \"${reorderToken}\"`, EXIT_CODE.USAGE);\n }\n reorderTo = parsed;\n }\n // Allow positional title for `pm plan create \"Title\"` (mirrors pm create UX).\n // Plan create never takes an id positional; the second token is the title.\n let planId = id;\n if (normalizedSubcommand === \"create\" && typeof id === \"string\" && id.length > 0 && planOptions.title === undefined) {\n planOptions.title = id;\n planId = undefined;\n }\n const result = await runPlan({\n subcommand: normalizedSubcommand as typeof PLAN_SUBCOMMANDS[number],\n id: planId,\n stepRef,\n reorderTo,\n options: planOptions as Record<string, never>,\n global: globalOptions,\n });\n await invalidateSearchCachesForMutation(globalOptions, result);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=plan took_ms=${Date.now() - startedAt}`);\n }\n });\n void planCommand;\n\n program\n .command(\"history-redact\")\n .argument(\"<id>\", \"Item id\")\n .option(\"--literal <value>\", \"Literal string to redact (repeatable)\", collect)\n .option(\"--regex <value>\", \"Regex pattern to redact (repeatable; accepts /pattern/flags or raw pattern)\", collect)\n .option(\"--replacement <value>\", 'Replacement string (default: \"[redacted]\")')\n .option(\"--dry-run\", \"Preview redaction impact without writing item/history files\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"Audit history message for the redaction marker entry\")\n .option(\"--force\", \"Force ownership/lock override\")\n .description(\"Redact sensitive literals/patterns from an item history stream and recompute hashes.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runHistoryRedact } = await import(\"./commands/history-redact.js\");\n const literal = Array.isArray(options.literal) ? (options.literal as string[]) : undefined;\n const regex = Array.isArray(options.regex) ? (options.regex as string[]) : undefined;\n const result = await runHistoryRedact(\n id,\n {\n literal,\n regex,\n replacement: typeof options.replacement === \"string\" ? options.replacement : undefined,\n dryRun: options.dryRun === true,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n },\n globalOptions,\n );\n if (result.changed && !result.dry_run) {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=history-redact took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"history-repair\")\n .argument(\"[id]\", \"Item id (omit with --all)\")\n .option(\"--all\", \"Scan every stream for drift and repair each drifted stream in one audited pass\")\n .option(\"--dry-run\", \"Preview the re-anchor impact without writing the history file\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"Audit history message for the repair marker entry\")\n .option(\"--force\", \"Force ownership/lock override\")\n .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.\")\n .action(async (id: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runHistoryRepair, runHistoryRepairAll, assertHistoryRepairTarget } = await import(\n \"./commands/history-repair.js\"\n );\n const all = options.all === true;\n assertHistoryRepairTarget(id, all);\n const repairOptions = {\n dryRun: options.dryRun === true,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n };\n // history-repair only re-anchors the audit stream; item content is untouched,\n // so search caches do not need invalidation.\n if (all) {\n const result = await runHistoryRepairAll(repairOptions, globalOptions);\n printResult(result, globalOptions);\n if (result.totals.failed > 0) {\n // Per-stream failures are collected (one bad stream never aborts the\n // pass) but must still fail the command for gating callers.\n process.exitCode = EXIT_CODE.GENERIC_FAILURE;\n }\n } else {\n const result = await runHistoryRepair(id as string, repairOptions, globalOptions);\n printResult(result, globalOptions);\n }\n if (globalOptions.profile) {\n printError(`profile:command=history-repair took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"history-compact\")\n .argument(\"<id>\", \"Item id\")\n .option(\"--before <value>\", \"Compact entries strictly before this version number or ISO timestamp\")\n .option(\"--dry-run\", \"Preview compaction impact without writing the history file\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"Audit history message for the compaction marker entry\")\n .option(\"--force\", \"Force ownership/lock override\")\n .description(\"Compact an item history stream into a synthetic baseline plus retained tail entries.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runHistoryCompact } = await import(\"./commands/history-compact.js\");\n const result = await runHistoryCompact(\n id,\n {\n before: typeof options.before === \"string\" ? options.before : undefined,\n dryRun: options.dryRun === true,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n },\n globalOptions,\n );\n // history-compact only rewrites the history stream; item content is untouched.\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=history-compact took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const schemaCommand = program\n .command(\"schema\")\n .argument(\n \"[subcommand]\",\n \"Schema subcommand: list, show, show-status, add-type, remove-type, add-status, remove-status, or a custom item type name shorthand\",\n )\n .argument(\"[name]\", \"Item type name (add-type/remove-type/show) or status id (show-status/add-status/remove-status)\")\n .option(\"--description <text>\", \"Human description for the custom item type or status\")\n .option(\"--default-status <status>\", \"Default status hint recorded for the custom item type\")\n .option(\"--folder <dir>\", \"Storage folder for items of this custom type\")\n .option(\"--alias <name>\", \"Alias for the custom type or status (repeatable, csv-friendly)\", collect)\n .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)\n .option(\"--order <n>\", \"Display/sort order for a custom status\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--force\", \"Force ownership/lock override\")\n .description(\"Inspect and manage config-driven runtime schema.\");\n // Hidden pure snake_case underscore-duplicate alias.\n addHiddenOption(schemaCommand, \"--default_status <status>\", \"Alias for --default-status\", false);\n schemaCommand\n .action(async (\n subcommand: string | undefined,\n name: string | undefined,\n options: Record<string, unknown>,\n command,\n ) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const {\n runSchemaAddType,\n runSchemaRemoveType,\n runSchemaAddStatus,\n runSchemaRemoveStatus,\n runSchemaList,\n runSchemaShow,\n runSchemaShowStatus,\n formatSchemaAddTypeHuman,\n formatSchemaRemoveTypeHuman,\n formatSchemaAddStatusHuman,\n formatSchemaRemoveStatusHuman,\n formatSchemaListHuman,\n formatSchemaShowHuman,\n formatSchemaShowStatusHuman,\n SCHEMA_SUBCOMMANDS,\n } = await import(\"./commands/schema.js\");\n let normalizedSubcommand = (subcommand ?? \"\").trim().toLowerCase();\n let typeName = name;\n if (!normalizedSubcommand) {\n throw new PmCliError(\n `pm schema requires a subcommand. Allowed: ${SCHEMA_SUBCOMMANDS.join(\", \")}`,\n EXIT_CODE.USAGE,\n {\n code: \"missing_required_argument\",\n examples: [\n \"pm schema list\",\n \"pm schema show Task\",\n \"pm schema show-status open\",\n 'pm schema add-type Spike --description \"Time-boxed investigation\" --default-status open',\n \"pm schema remove-type Spike\",\n \"pm schema add-status review --role active --alias in_review\",\n \"pm schema remove-status review\",\n ],\n },\n );\n }\n const aliases =\n /* 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 */\n typeof options.alias === \"string\"\n ? [options.alias]\n : Array.isArray(options.alias)\n ? (options.alias as string[])\n : undefined;\n const roles =\n /* 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 */\n typeof options.role === \"string\"\n ? [options.role]\n : Array.isArray(options.role)\n ? (options.role as string[])\n : undefined;\n const defaultStatus =\n typeof options.defaultStatus === \"string\"\n ? options.defaultStatus\n : typeof options.default_status === \"string\"\n ? (options.default_status as string)\n : undefined;\n const order = parseSchemaOrderOption(options.order);\n if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand as typeof SCHEMA_SUBCOMMANDS[number]) && typeName === undefined) {\n typeName = subcommand;\n normalizedSubcommand = \"add-type\";\n }\n if (!SCHEMA_SUBCOMMANDS.includes(normalizedSubcommand as typeof SCHEMA_SUBCOMMANDS[number])) {\n throw new PmCliError(\n `Unknown pm schema subcommand \"${subcommand}\". Allowed: ${SCHEMA_SUBCOMMANDS.join(\", \")}`,\n EXIT_CODE.USAGE,\n { code: \"unknown_subcommand\" },\n );\n }\n const author = typeof options.author === \"string\" ? options.author : undefined;\n const force = Boolean(options.force);\n const result =\n normalizedSubcommand === \"list\"\n ? await runSchemaList(globalOptions)\n : normalizedSubcommand === \"show\"\n ? await runSchemaShow(typeName, globalOptions)\n : normalizedSubcommand === \"show-status\"\n ? await runSchemaShowStatus(typeName, globalOptions)\n : normalizedSubcommand === \"remove-type\"\n ? await runSchemaRemoveType(typeName, { author, force }, globalOptions)\n : normalizedSubcommand === \"add-status\"\n ? await runSchemaAddStatus(\n typeName,\n {\n role: roles,\n alias: aliases,\n description: typeof options.description === \"string\" ? options.description : undefined,\n order,\n author,\n force,\n },\n globalOptions,\n )\n : normalizedSubcommand === \"remove-status\"\n ? await runSchemaRemoveStatus(typeName, { author, force }, globalOptions)\n : await runSchemaAddType(\n typeName,\n {\n description: typeof options.description === \"string\" ? options.description : undefined,\n defaultStatus,\n folder: typeof options.folder === \"string\" ? options.folder : undefined,\n alias: aliases,\n author,\n force,\n },\n globalOptions,\n );\n // Schema inspection and type registration do not touch item content, so search caches stay valid.\n if (globalOptions.json === true || globalOptions.defaultOutputFormat === \"json\") {\n printResult(result, globalOptions);\n } else if (!globalOptions.quiet) {\n if (result.action === \"list\") {\n writeStdout(`${formatSchemaListHuman(result)}\\n`);\n } else if (result.action === \"show\") {\n writeStdout(`${formatSchemaShowHuman(result)}\\n`);\n } else if (result.action === \"show-status\") {\n writeStdout(`${formatSchemaShowStatusHuman(result)}\\n`);\n } else if (result.action === \"remove-type\") {\n writeStdout(`${formatSchemaRemoveTypeHuman(result)}\\n`);\n } else if (result.action === \"add-status\") {\n writeStdout(`${formatSchemaAddStatusHuman(result)}\\n`);\n } else if (result.action === \"remove-status\") {\n writeStdout(`${formatSchemaRemoveStatusHuman(result)}\\n`);\n } else {\n writeStdout(`${formatSchemaAddTypeHuman(result)}\\n`);\n }\n // Surface extension on-write hook diagnostics so policy/enforcement\n // warnings are visible without forcing --json.\n if (\n result.action !== \"list\" &&\n result.action !== \"show\" &&\n result.action !== \"show-status\" &&\n result.warnings.length > 0\n ) {\n printError(`schema ${result.action} warnings: ${formatHookWarnings(result.warnings)}`);\n }\n }\n if (globalOptions.profile) {\n printError(`profile:command=schema took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"comments\")\n .argument(\"<id>\", \"Item id\")\n .argument(\"[text]\", \"Optional comment text shorthand (equivalent to --add)\")\n .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)\")\n .option(\"--stdin\", \"Read comment text from stdin (supports multiline markdown)\")\n .option(\"--file <path>\", \"Read comment text from file (supports multiline markdown)\")\n .option(\"--edit <index>\", \"Replace the comment at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)\", parsePositiveIntOption(\"--edit\"))\n .option(\"--delete <index>\", \"Delete the comment at 1-based <index>\", parsePositiveIntOption(\"--delete\"))\n .option(\"--limit <n>\", \"Return only latest n comments\")\n .option(\"--author [value]\", \"Comment author (optional; falls back to PM_AUTHOR/settings)\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--allow-audit-comment\", \"Allow non-owner append-only comment audits (add/edit/delete) without requiring --force\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"List, add, edit, or delete comments for an item.\")\n .action(async (id: string, text: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const editIndex = typeof options.edit === \"number\" ? options.edit : undefined;\n const deleteIndex = typeof options.delete === \"number\" ? options.delete : undefined;\n const addFromOption = typeof options.add === \"string\" ? options.add : undefined;\n const addFromPositional = typeof text === \"string\" ? text : undefined;\n const readFromStdin = options.stdin === true;\n const readFromFile = typeof options.file === \"string\" ? options.file : undefined;\n const sourceCount =\n Number(addFromOption !== undefined) +\n Number(addFromPositional !== undefined) +\n Number(readFromStdin) +\n Number(readFromFile !== undefined);\n if (sourceCount > 1) {\n if (addFromOption !== undefined && addFromPositional !== undefined && !readFromStdin && readFromFile === undefined) {\n throw new PmCliError(\"Specify comment text either as positional [text] or with --add, not both\", EXIT_CODE.USAGE);\n }\n throw new PmCliError(\n \"Specify comment text with exactly one source: positional [text], --add, --stdin, or --file\",\n EXIT_CODE.USAGE,\n );\n }\n const add = addFromOption ?? addFromPositional;\n const { runComments } = await import(\"./commands/comments.js\");\n const result = await runComments(id, {\n add,\n stdin: readFromStdin,\n file: readFromFile,\n edit: editIndex,\n delete: deleteIndex,\n limit: typeof options.limit === \"string\" ? options.limit : undefined,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n allowAuditComment: Boolean(options.allowAuditComment),\n force: Boolean(options.force),\n }, globalOptions);\n const isMutation =\n typeof add === \"string\" || readFromStdin || readFromFile !== undefined || editIndex !== undefined || deleteIndex !== undefined;\n if (isMutation) {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=comments took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"notes\")\n .argument(\"<id>\", \"Item id\")\n .argument(\"[text]\", \"Optional note text shorthand (equivalent to --add; use - for stdin)\")\n .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)\")\n .option(\"--limit <n>\", \"Return only latest n notes\")\n .option(\"--author [value]\", \"Note author (optional; falls back to PM_AUTHOR/settings)\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--allow-audit-note\", \"Allow non-owner append-only note audits without requiring --force\")\n .option(\"--allow-audit-comment\", \"Backward-compatible alias for --allow-audit-note\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"List or add notes for an item.\")\n .action(async (id: string, text: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const addFromOption = typeof options.add === \"string\" ? options.add : undefined;\n const addFromPositional = typeof text === \"string\" ? text : undefined;\n if (addFromOption !== undefined && addFromPositional !== undefined) {\n throw new PmCliError(\"Specify note text either as positional [text] or with --add, not both\", EXIT_CODE.USAGE);\n }\n const add = addFromOption ?? addFromPositional;\n const { runNotes } = await import(\"./commands/notes.js\");\n const result = await runNotes(id, {\n add,\n limit: typeof options.limit === \"string\" ? options.limit : undefined,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n allowAuditComment: Boolean(options.allowAuditNote || options.allowAuditComment),\n force: Boolean(options.force),\n }, globalOptions);\n if (typeof add === \"string\") {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=notes took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"learnings\")\n .argument(\"<id>\", \"Item id\")\n .argument(\"[text]\", \"Optional learning text shorthand (equivalent to --add; use - for stdin)\")\n .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)\")\n .option(\"--limit <n>\", \"Return only latest n learnings\")\n .option(\"--author [value]\", \"Learning author (optional; falls back to PM_AUTHOR/settings)\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--allow-audit-learning\", \"Allow non-owner append-only learning audits without requiring --force\")\n .option(\"--allow-audit-comment\", \"Backward-compatible alias for --allow-audit-learning\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"List or add learnings for an item.\")\n .action(async (id: string, text: string | undefined, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const addFromOption = typeof options.add === \"string\" ? options.add : undefined;\n const addFromPositional = typeof text === \"string\" ? text : undefined;\n if (addFromOption !== undefined && addFromPositional !== undefined) {\n throw new PmCliError(\"Specify learning text either as positional [text] or with --add, not both\", EXIT_CODE.USAGE);\n }\n const add = addFromOption ?? addFromPositional;\n const { runLearnings } = await import(\"./commands/learnings.js\");\n const result = await runLearnings(id, {\n add,\n limit: typeof options.limit === \"string\" ? options.limit : undefined,\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n allowAuditComment: Boolean(options.allowAuditLearning || options.allowAuditComment),\n force: Boolean(options.force),\n }, globalOptions);\n if (typeof add === \"string\") {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=learnings took_ms=${Date.now() - startedAt}`);\n }\n });\n\n const filesCommand = program\n .command(\"files\")\n .description(\"Manage files linked to an item.\");\n\n filesCommand\n .argument(\"<id>\", \"Item id\")\n .option(\"--add <value>\", \"Add linked file entry (CSV/markdown pairs or - for stdin)\", collect)\n .option(\"--add-glob <value>\", \"Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)\", collect)\n .option(\"--remove <value>\", \"Remove linked file by path (path=<value>, path:<value>, plain path, or - for stdin)\", collect)\n .option(\"--migrate <value>\", \"Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)\", collect)\n .option(\"--note <value>\", \"Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)\")\n .option(\"--list\", \"List linked files without mutating\")\n .option(\"--append-stable\", \"Preserve existing linked-file order and append new links without full-array resorting\")\n .option(\"--validate-paths\", \"Validate linked file paths for existence and file shape\")\n .option(\"--audit\", \"Audit linked file usage across all items for this item's linked paths\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--force\", \"Force ownership override\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const addValues = Array.isArray(options.add) ? (options.add as string[]) : [];\n const addGlobValues = Array.isArray(options.addGlob) ? (options.addGlob as string[]) : [];\n const removeValues = Array.isArray(options.remove) ? (options.remove as string[]) : [];\n const migrateValues = Array.isArray(options.migrate) ? (options.migrate as string[]) : [];\n const { runFiles } = await import(\"./commands/files.js\");\n const result = await runFiles(id, {\n add: addValues,\n addGlob: addGlobValues,\n remove: removeValues,\n migrate: migrateValues,\n note: typeof options.note === \"string\" ? options.note : undefined,\n list: Boolean(options.list),\n appendStable: Boolean(options.appendStable),\n validatePaths: Boolean(options.validatePaths),\n audit: Boolean(options.audit),\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n }, globalOptions);\n if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=files took_ms=${Date.now() - startedAt}`);\n }\n });\n\n filesCommand\n .command(\"discover\")\n .argument(\"<id>\", \"Item id\")\n .option(\"--apply\", \"Add discovered missing files to the item\")\n .option(\"--note <value>\", \"Note to attach to discovered file links\")\n .option(\"--append-stable\", \"Preserve existing linked-file order and append discovered links without full-array resorting\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"Discover existing file paths referenced in item text and optionally link missing files.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n // Flags also declared on the parent files command (--note/--append-stable/\n // --author/--message/--force) are consumed by the parent during parse, so\n // merge ancestor opts back in (own options win) instead of reading opts() alone.\n const mergedOptions: Record<string, unknown> = { ...command.optsWithGlobals(), ...options };\n const { runFilesDiscover } = await import(\"./commands/files.js\");\n const result = await runFilesDiscover(id, {\n apply: Boolean(mergedOptions.apply),\n note: typeof mergedOptions.note === \"string\" ? mergedOptions.note : undefined,\n appendStable: Boolean(mergedOptions.appendStable),\n author: typeof mergedOptions.author === \"string\" ? mergedOptions.author : undefined,\n message: typeof mergedOptions.message === \"string\" ? mergedOptions.message : undefined,\n force: Boolean(mergedOptions.force),\n }, globalOptions);\n if (result.changed) {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=files.discover took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"docs\")\n .argument(\"<id>\", \"Item id\")\n .option(\"--add <value>\", \"Add linked doc entry (CSV/markdown pairs or - for stdin)\", collect)\n .option(\"--add-glob <value>\", \"Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)\", collect)\n .option(\"--remove <value>\", \"Remove linked doc by path (path=<value>, path:<value>, plain path, or - for stdin)\", collect)\n .option(\"--migrate <value>\", \"Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)\", collect)\n .option(\"--note <value>\", \"Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)\")\n .option(\"--list\", \"List linked docs without mutating\")\n .option(\"--validate-paths\", \"Validate linked doc paths for existence and file shape\")\n .option(\"--audit\", \"Audit linked doc usage across all items for this item's linked paths\")\n .option(\"--author <value>\", \"Mutation author\")\n .option(\"--message <value>\", \"History message\")\n .option(\"--force\", \"Force ownership override\")\n .description(\"Manage docs linked to an item.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const addValues = Array.isArray(options.add) ? (options.add as string[]) : [];\n const addGlobValues = Array.isArray(options.addGlob) ? (options.addGlob as string[]) : [];\n const removeValues = Array.isArray(options.remove) ? (options.remove as string[]) : [];\n const migrateValues = Array.isArray(options.migrate) ? (options.migrate as string[]) : [];\n const { runDocs } = await import(\"./commands/docs.js\");\n const result = await runDocs(id, {\n add: addValues,\n addGlob: addGlobValues,\n remove: removeValues,\n migrate: migrateValues,\n note: typeof options.note === \"string\" ? options.note : undefined,\n list: Boolean(options.list),\n validatePaths: Boolean(options.validatePaths),\n audit: Boolean(options.audit),\n author: typeof options.author === \"string\" ? options.author : undefined,\n message: typeof options.message === \"string\" ? options.message : undefined,\n force: Boolean(options.force),\n }, globalOptions);\n if (addValues.length > 0 || addGlobValues.length > 0 || removeValues.length > 0 || migrateValues.length > 0) {\n await invalidateSearchCachesForMutation(globalOptions, result);\n }\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=docs took_ms=${Date.now() - startedAt}`);\n }\n });\n\n program\n .command(\"deps\")\n .argument(\"<id>\", \"Item id\")\n .option(\"--format <value>\", \"Output format (tree or graph)\", \"tree\")\n .option(\"--max-depth <value>\", \"Maximum dependency traversal depth (0 keeps only the root)\")\n .option(\"--collapse <value>\", \"Collapse mode (none or repeated)\", \"none\")\n .option(\"--summary\", \"Return counts only without full tree/graph payload\")\n .description(\"Show dependency relationships for an item.\")\n .action(async (id: string, options: Record<string, unknown>, command) => {\n const globalOptions = getGlobalOptions(command);\n const startedAt = Date.now();\n const { runDeps } = await import(\"./commands/deps.js\");\n // --format and --collapse carry commander defaults (\"tree\"/\"none\"), so\n // they are always strings by the time the action runs; --maxDepth has no\n // default and may be unset. Use `as string` rather than String(...) so an\n // omitted option stays undefined instead of becoming the literal \"undefined\".\n const result = await runDeps(id, {\n format: options.format as string,\n maxDepth: typeof options.maxDepth === \"string\" ? options.maxDepth : undefined,\n collapse: options.collapse as string,\n summary: options.summary === true,\n }, globalOptions);\n printResult(result, globalOptions);\n if (globalOptions.profile) {\n printError(`profile:command=deps took_ms=${Date.now() - startedAt}`);\n }\n });\n}\n","import { readFile } from \"node:fs/promises\";\n\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\n/**\n * GH-214: shared resolver for the `--body-file <path>` input convenience on\n * `pm create` and `pm update`. It loads a long markdown body from a file so\n * agents do not have to escape multi-paragraph content (code blocks, tables)\n * into a single inline `--body` string or issue a second `pm append` call.\n *\n * This is a CLI-only input alias that maps onto the existing `body` field, so\n * it deliberately does NOT flow through the MCP/contract field surface (a file\n * path is meaningless over MCP, mirroring `pm history --diff`). The file read is\n * injectable so the pure resolution logic stays fully unit-coverable without\n * touching disk.\n */\nexport type BodyFileReader = (path: string) => Promise<string>;\n\nconst defaultBodyFileReader: BodyFileReader = (path) => readFile(path, \"utf8\");\n\nexport async function resolveBodyFileContent(\n bodyFile: string,\n inlineBody: string | undefined,\n readFileImpl: BodyFileReader = defaultBodyFileReader,\n): Promise<string> {\n // Mutual exclusion: --body and --body-file both define the body, so accepting\n // both silently would hide which one wins. Fail with an actionable message.\n if (inlineBody !== undefined) {\n throw new PmCliError(\n \"--body and --body-file are mutually exclusive; provide the body inline with --body or from a file with --body-file, not both.\",\n EXIT_CODE.USAGE,\n {\n code: \"body_file_conflicts_with_body\",\n required: \"Choose exactly one body source.\",\n why: \"Both --body and --body-file set the item body; allowing both would make the effective body ambiguous.\",\n nextSteps: [\"Re-run with only --body <text> or only --body-file <path>.\"],\n },\n );\n }\n const path = bodyFile.trim();\n if (path.length === 0) {\n throw new PmCliError(\"--body-file requires a file path.\", EXIT_CODE.USAGE, {\n code: \"body_file_missing_path\",\n required: \"Pass a readable file path: --body-file <path>.\",\n why: \"An empty --body-file value has no file to read the body from.\",\n });\n }\n try {\n return await readFileImpl(path);\n } catch (error: unknown) {\n // Preserve the underlying errno (ENOENT/EACCES/EISDIR/...) so the failure\n // is debuggable, and tailor the directory case (a real footgun: pointing\n // --body-file at a folder) to an exact message instead of a generic one.\n const errno = (error as NodeJS.ErrnoException | undefined)?.code;\n const isDirectory = errno === \"EISDIR\";\n const detail = errno ? ` (${errno})` : \"\";\n throw new PmCliError(\n isDirectory\n ? `--body-file \"${path}\" is a directory, not a file. Point it at a readable file.`\n : `--body-file could not read \"${path}\"${detail}. Check that the file exists and is readable.`,\n EXIT_CODE.NOT_FOUND,\n {\n code: \"body_file_unreadable\",\n required: \"Point --body-file at an existing, readable file.\",\n why: `The body content is loaded from the file at the supplied path, so an unreadable path cannot produce a body${errno ? ` (underlying error: ${errno})` : \"\"}.`,\n nextSteps: [`Verify the path: ls -l \"${path}\"`, \"Or pass the body inline with --body <text>.\"],\n },\n );\n }\n}\n","/**\n * Helpers for deciding whether a CLI option alias is a pure snake_case\n * underscore-duplicate of an existing kebab-case flag.\n *\n * Mutation commands historically register every `--foo-bar` flag together with\n * a `--foo_bar` alias so agents are never blocked by a snake/kebab mismatch.\n * Those underscore duplicates roughly double the option list of every\n * `--help` and waste agent context. We keep them functional as parse-time\n * aliases but hide them from the rendered `--help` text.\n *\n * The rule is intentionally narrow: an alias is hidden ONLY when its long flag\n * is exactly the underscore form of an existing kebab flag (for example\n * `--create_mode` is the `-`→`_` form of `--create-mode`). Semantically-distinct\n * aliases (for example `--fail-on-warn` for `--strict-exit`, `--local` for\n * `--project`, `--ac` for `--acceptance-criteria`) are NOT snake duplicates and\n * stay visible.\n */\n\n/**\n * Extract every long flag (for example `--create-mode`) from a commander flag\n * spec that may include short aliases and a value placeholder. A spec can list\n * more than one long flag, for example `\"--estimate, --estimated-minutes\n * <value>\"` → `[\"--estimate\", \"--estimated-minutes\"]`.\n */\nexport function extractLongFlags(flagSpec: string): string[] {\n return flagSpec\n .split(/[\\s,|]+/)\n .map((token) => token.trim())\n .filter((token) => token.startsWith(\"--\"));\n}\n\n/**\n * Extract the first long flag from a commander flag spec, or null when none is\n * present.\n */\nexport function extractLongFlag(flagSpec: string): string | null {\n return extractLongFlags(flagSpec)[0] ?? null;\n}\n\n/**\n * Returns true when `aliasFlagSpec` differs from `canonicalFlagSpec` ONLY by\n * substituting one or more interior hyphens with underscores — i.e. it is a\n * pure snake_case underscore-duplicate of the canonical kebab flag.\n *\n * Examples that match (alias hidden):\n * --create-mode <- --create_mode\n * --filter-assignee-filter <- --filter-assignee_filter\n *\n * Examples that do NOT match (alias stays visible):\n * --acceptance-criteria <- --ac (different identifier)\n * --order <- --rank (different identifier)\n * --strict-exit <- --fail-on-warn (semantically distinct)\n */\nexport function isPureSnakeCaseAlias(canonicalFlagSpec: string, aliasFlagSpec: string): boolean {\n const aliasLong = extractLongFlag(aliasFlagSpec);\n if (aliasLong === null) {\n return false;\n }\n const normalize = (long: string): string => long.slice(2).replaceAll(\"-\", \"_\");\n // The canonical spec may declare multiple long flags (e.g.\n // \"--estimate, --estimated-minutes <value>\"); the alias is hidden when it is\n // the underscore form of ANY of them.\n return extractLongFlags(canonicalFlagSpec).some((canonicalLong) => {\n if (!canonicalLong.slice(2).includes(\"-\")) {\n // No interior hyphen to convert, so there is no kebab form to snake-duplicate.\n return false;\n }\n if (aliasLong === canonicalLong) {\n // Identical flags are not aliases of one another.\n return false;\n }\n // Reachable from the canonical purely by hyphen→underscore substitution.\n return normalize(aliasLong) === normalize(canonicalLong);\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAA4B;;;ACArC,SAAS,gBAAgB;AAmBzB,IAAM,wBAAwC,CAAC,SAAS,SAAS,MAAM,MAAM;AAE7E,eAAsB,uBACpB,UACA,YACA,eAA+B,uBAAqB;AAIpD,MAAI,eAAe,QAAW;AAC5B,UAAM,IAAI,WACR,iIACA,UAAU,OACV;MACE,MAAM;MACN,UAAU;MACV,KAAK;MACL,WAAW,CAAC,4DAA4D;KACzE;EAEL;AACA,QAAM,OAAO,SAAS,KAAI;AAC1B,MAAI,KAAK,WAAW,GAAG;AACrB,UAAM,IAAI,WAAW,qCAAqC,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.js";
5
- import "./chunk-O7IWB35H.js";
6
- import "./chunk-2IUJBMKS.js";
7
- import "./chunk-ZJRDVYZI.js";
8
- import "./chunk-7AGIXLNK.js";
9
- import "./chunk-4KBK4BA3.js";
10
- import "./chunk-WZCQVABQ.js";
11
- import "./chunk-GYMG7AG6.js";
12
- import "./chunk-6BV7ENQL.js";
13
- import "./chunk-OY3P2I6B.js";
14
- import "./chunk-LV5FFQ7M.js";
15
- export {
16
- _testOnlyRestoreCommand,
17
- runRestore
18
- };
19
- //# sourceMappingURL=restore-XXXLQ2XC.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../core/schema/status-defs-file.ts", "../../../../../../../../cli/commands/schema.ts"],
4
- "sourcesContent": ["import { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type { RuntimeStatusDefinition, RuntimeStatusRole } from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\n\nexport type { RuntimeStatusDefinition, RuntimeStatusRole } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * The 5 lifecycle status ids that ship as built-in defaults and may never be\n * removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS:\n * open/in_progress/blocked/closed/canceled). `draft` is also a default but the\n * acceptance criteria enumerate the 5 terminal/active ids explicitly, so the\n * guard derives the full set from the canonical defaults to stay in sync.\n */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) => normalizeStatusToken(definition.id)).filter(\n (id) => id.length > 0,\n ),\n);\n\n/**\n * The shape persisted at `.agents/pm/schema/statuses.json`.\n */\nexport interface StatusDefsFile {\n statuses: RuntimeStatusDefinition[];\n}\n\nexport interface RawAddStatusInput {\n id: string | undefined;\n roles?: string[];\n aliases?: string[];\n description?: string;\n order?: number;\n}\n\nexport interface NormalizedAddStatusInput {\n id: string;\n /**\n * Normalized roles, or `undefined` when the raw input did not supply a roles\n * field at all. `undefined` means \"leave existing roles untouched\" on upsert;\n * an explicit empty array means \"clear roles\". This distinction is what keeps\n * `add-status review --description x` from wiping a previously-set role.\n */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n description?: string;\n order?: number;\n}\n\nexport interface UpsertStatusDefResult {\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\nexport interface RemoveStatusDefResult {\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/**\n * Normalizes a status token using the same rules as runtime-schema.ts: lowercase\n * and collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeStatusToken(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(raw: RawAddStatusInput): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role = typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined ? undefined : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order) ? Math.trunc(raw.order) : undefined;\n return {\n id,\n roles,\n aliases,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/**\n * Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile.\n * Accepts the canonical `{ statuses: [...] }` shape, a bare array of\n * definitions, or a `{ definitions: [...] }` form, and tolerates a\n * missing/invalid file by returning an empty statuses list.\n */\nexport function parseStatusDefsFile(raw: string | null | undefined): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/**\n * Serializes the status definitions file with a trailing newline (matches the\n * rest of the schema scaffold files written by pm).\n */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a status definition into the parsed file. Matching is by\n * normalized id. When a definition already exists, fields supplied in `input`\n * override the previous values (roles/aliases replace when a non-empty array is\n * given, clear when an explicit empty array is given, and are left UNTOUCHED\n * when the field is `undefined` — i.e. the add-status flag was omitted);\n * description/order override when provided. Fields not addressed by add-status\n * flags are preserved untouched, so `add-status <id> --description x` keeps any\n * previously-set roles/aliases.\n */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing = existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...(existing ?? {}),\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/**\n * Removes a status definition from the parsed file by id (normalized). Throws a\n * plain Error when `id` is empty or matches a reserved built-in default status\n * (those are never stored in the file and must never be deletable). Returns\n * `removed: false` when no matching definition exists so the CLI layer can treat\n * the call as an idempotent no-op.\n */\nexport function removeStatusDef(file: StatusDefsFile, id: string | undefined): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/**\n * Throws when the new status id or any explicitly-supplied alias collides with a\n * DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized\n * token to its owning status id (the runtime status registry's alias_to_id map,\n * which stores ids and aliases in one namespace). Re-adding the same status\n * (matching id) is allowed — only cross-status collisions throw. This prevents a\n * custom status from shadowing a built-in lifecycle token (for example\n * `add-status review --alias open`, or a custom id `cancelled` that aliases the\n * built-in `canceled`), which would make `pm update --status open` resolve to the\n * wrong status. The CLI layer maps the thrown Error to a USAGE exit code.\n */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n", "import { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n assertAliasesAvailable,\n assertTypeFolderAvailable,\n buildInvalidTypeHint,\n escapeForDoubleQuotes,\n normalizeAddTypeInput,\n parseItemTypesFile,\n removeItemType,\n serializeItemTypesFile,\n upsertItemType,\n type ItemTypeDefinition,\n} from \"../../core/schema/item-types-file.js\";\nimport {\n assertStatusTokensAvailable,\n BUILTIN_STATUS_IDS,\n normalizeAddStatusInput,\n normalizeStatusToken,\n parseStatusDefsFile,\n removeStatusDef,\n serializeStatusDefsFile,\n upsertStatusDef,\n type RuntimeStatusDefinition,\n} from \"../../core/schema/status-defs-file.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n resolveRuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { resolveItemTypeRegistry, type ResolvedItemTypeDefinition } from \"../../core/item/type-registry.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport type { PmSettings } from \"../../types/index.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, resolveGovernanceKnobs } from \"../../core/store/settings.js\";\n\nexport const SCHEMA_SUBCOMMANDS = [\n \"add-type\",\n \"remove-type\",\n \"add-status\",\n \"remove-status\",\n \"list\",\n \"show\",\n \"show-status\",\n] as const;\nexport type SchemaSubcommand = (typeof SCHEMA_SUBCOMMANDS)[number];\n\nconst SCHEMA_TYPES_LOCK_ID = \"schema-types\";\nconst SCHEMA_STATUSES_LOCK_ID = \"schema-statuses\";\n\nexport interface SchemaAddTypeCommandOptions {\n description?: string;\n defaultStatus?: string;\n folder?: string;\n alias?: string[];\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaRemoveTypeCommandOptions {\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaAddStatusCommandOptions {\n role?: string[];\n alias?: string[];\n description?: string;\n order?: number;\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaRemoveStatusCommandOptions {\n author?: string;\n force?: boolean;\n}\n\nexport interface SchemaAddTypeResult {\n action: \"add-type\";\n registered: boolean;\n replaced: boolean;\n type: ItemTypeDefinition;\n file: {\n path: string;\n definitions: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaRemoveTypeResult {\n action: \"remove-type\";\n removed: boolean;\n type?: ItemTypeDefinition;\n file: {\n path: string;\n definitions: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaAddStatusResult {\n action: \"add-status\";\n registered: boolean;\n replaced: boolean;\n status: RuntimeStatusDefinition;\n file: {\n path: string;\n statuses: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaRemoveStatusResult {\n action: \"remove-status\";\n removed: boolean;\n status?: RuntimeStatusDefinition;\n file: {\n path: string;\n statuses: number;\n };\n warnings: string[];\n generated_at: string;\n}\n\nexport interface SchemaTypeSummary {\n name: string;\n folder: string;\n aliases: string[];\n default_status?: string;\n description?: string;\n}\n\nexport interface SchemaStatusSummary {\n id: string;\n source: \"builtin\" | \"custom\";\n roles: string[];\n aliases: string[];\n description?: string;\n order?: number;\n}\n\nexport interface SchemaTypeDefinitionResult extends SchemaTypeSummary {\n source: \"builtin\" | \"custom\" | \"extension\";\n extension?: {\n layer: string;\n name: string;\n };\n required_create_fields: string[];\n required_create_repeatables: string[];\n options: ResolvedItemTypeDefinition[\"options\"];\n command_option_policies: ResolvedItemTypeDefinition[\"command_option_policies\"];\n}\n\nexport interface SchemaListResult {\n action: \"list\";\n builtin: SchemaTypeSummary[];\n custom: SchemaTypeSummary[];\n extension: SchemaTypeSummary[];\n counts: {\n builtin: number;\n custom: number;\n extension: number;\n total: number;\n };\n statuses: {\n builtin: SchemaStatusSummary[];\n custom: SchemaStatusSummary[];\n counts: {\n builtin: number;\n custom: number;\n total: number;\n };\n };\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport interface SchemaShowResult {\n action: \"show\";\n type: SchemaTypeDefinitionResult;\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport interface SchemaShowStatusResult {\n action: \"show-status\";\n status: SchemaStatusSummary;\n file: {\n path: string;\n };\n generated_at: string;\n}\n\nexport type SchemaInspectResult = SchemaListResult | SchemaShowResult | SchemaShowStatusResult;\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\n/* c8 ignore start -- schema command mutation/inspection branches are covered by broader schema integration workflows. */\nexport async function runSchemaAddType(\n name: string | undefined,\n options: SchemaAddTypeCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaAddTypeResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n let normalized;\n try {\n normalized = normalizeAddTypeInput({\n name,\n description: options.description,\n defaultStatus: options.defaultStatus,\n folder: options.folder,\n aliases: options.alias,\n });\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_TYPES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let upsert;\n try {\n const previousRaw = await readFileIfExists(typesPath);\n let parsed;\n try {\n parsed = parseItemTypesFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n assertAliasesAvailable(normalized, parsed);\n // GH-248: reject distinct type names that would slug to the same storage\n // folder (e.g. \"Spike\"/\"Spikes\") so item files never silently share a\n // directory. Same-named upserts (recase/idempotent re-runs) are exempt.\n // reservedFolders covers built-in + extension + settings-resolved custom\n // folders so a slug like \"Tasks\" can't collide with the built-in Task.\n const reservedFolders = new Map<string, string>();\n const resolvedRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n for (const [typeName, folder] of Object.entries(resolvedRegistry.type_to_folder)) {\n const folderKey = folder.trim().toLowerCase();\n if (folderKey.length > 0 && !reservedFolders.has(folderKey)) {\n reservedFolders.set(folderKey, typeName);\n }\n }\n assertTypeFolderAvailable(normalized, parsed, reservedFolders);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n upsert = upsertItemType(parsed, normalized);\n // GH-248: an upsert that only differs in case from the existing canonical\n // name silently renames the stored type (e.g. registering \"spike\" over\n // \"Spike\"). Surface it as a non-blocking warning so the operator knows the\n // existing definition was replaced rather than a new type created.\n if (upsert.replaced && upsert.previousName !== undefined && upsert.previousName !== upsert.definition.name) {\n warnings.push(`type_recased:${upsert.previousName}->${upsert.definition.name}`);\n }\n // writeFileAtomic writes to a temp file then renames, so a failure leaves the\n // existing types.json untouched; no manual rollback is needed.\n await writeFileAtomic(typesPath, serializeItemTypesFile(upsert.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"schema:add-type\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"add-type\",\n registered: true,\n replaced: upsert.replaced,\n type: upsert.definition,\n file: {\n path: typesPath,\n definitions: upsert.file.definitions.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nasync function ensureInitialized(pmRoot: string): Promise<void> {\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n}\n\n/**\n * Counts items whose resolved type matches `typeName` (case-insensitive). Uses\n * the lightest existing read path (listAllFrontMatterLight skips the heavy\n * collections cache). All items are counted — not just open ones — so the\n * advisory warning surfaces every item the removed definition would orphan;\n * the count is non-blocking. The caller passes its already-loaded `settings`\n * so we never re-read settings.json from disk here.\n */\nasync function countItemsUsingType(\n pmRoot: string,\n settings: PmSettings,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n typeName: string,\n): Promise<number> {\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const lowerName = typeName.trim().toLowerCase();\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);\n return items.filter((item) => typeof item.type === \"string\" && item.type.toLowerCase() === lowerName).length;\n}\n\n/**\n * Counts items currently set to the status whose id/aliases resolve to\n * `statusId`. Uses listAllFrontMatterLight (the lightest read path). All items\n * are counted regardless of lifecycle phase; the count is advisory only. The\n * caller passes its already-loaded `settings` so we never re-read from disk.\n */\nasync function countItemsUsingStatus(\n pmRoot: string,\n settings: PmSettings,\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n statusId: string,\n): Promise<number> {\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const statusRegistry = resolveRuntimeStatusRegistry(schema);\n const normalizedId = normalizeStatusToken(statusId);\n const items = await listAllFrontMatterLight(pmRoot, settings.item_format, registry.type_to_folder, [], schema);\n return items.filter((item) => {\n const itemStatus = typeof item.status === \"string\" ? item.status : \"\";\n const resolved = statusRegistry.alias_to_id.get(normalizeStatusToken(itemStatus)) ?? normalizeStatusToken(itemStatus);\n return resolved === normalizedId;\n }).length;\n}\n\n/**\n * Returns the workflow role-slot names (open_status, close_status, ...) that\n * currently point at `statusId` (normalized). Used to warn before removing a\n * status that a workflow default still references.\n */\nfunction workflowSlotsReferencing(\n workflow: {\n draft_status?: string;\n open_status?: string;\n in_progress_status?: string;\n blocked_status?: string;\n close_status?: string;\n canceled_status?: string;\n },\n statusId: string,\n): string[] {\n const slots: Array<[string, string | undefined]> = [\n [\"draft_status\", workflow.draft_status],\n [\"open_status\", workflow.open_status],\n [\"in_progress_status\", workflow.in_progress_status],\n [\"blocked_status\", workflow.blocked_status],\n [\"close_status\", workflow.close_status],\n [\"canceled_status\", workflow.canceled_status],\n ];\n return slots\n .filter(([, value]) => value !== undefined && normalizeStatusToken(value) === statusId)\n .map(([slot]) => slot);\n}\n\nexport async function runSchemaRemoveType(\n name: string | undefined,\n options: SchemaRemoveTypeCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaRemoveTypeResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_TYPES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let removal;\n try {\n const previousRaw = await readFileIfExists(typesPath);\n let parsed;\n try {\n parsed = parseItemTypesFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n removal = removeItemType(parsed, name);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n if (removal.removed) {\n // Only emit the advisory orphan-count warning once a removable custom\n // definition was actually removed; a no-op/unknown removal would otherwise\n // surface a misleading items_using_type:* warning. The count is\n // non-blocking and reuses the already-loaded settings (no disk re-read).\n const removedName = (removal.definition?.name ?? name ?? \"\").trim();\n if (removedName.length > 0) {\n const usingType = await countItemsUsingType(pmRoot, settings, schema, removedName);\n if (usingType > 0) {\n warnings.push(`items_using_type:${usingType}`);\n }\n }\n // writeFileAtomic writes to a temp file then renames, so a failure leaves\n // the existing types.json untouched; no manual rollback is needed.\n await writeFileAtomic(typesPath, serializeItemTypesFile(removal.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: typesPath,\n scope: \"project\",\n op: \"schema:remove-type\",\n })),\n );\n }\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"remove-type\",\n removed: removal.removed,\n ...(removal.definition ? { type: removal.definition } : {}),\n file: {\n path: typesPath,\n definitions: removal.file.definitions.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nfunction statusesPathFor(pmRoot: string, schema: ReturnType<typeof normalizeRuntimeSchemaSettings>): string {\n return filePathForSchemaSection(pmRoot, schema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses);\n}\n\nexport async function runSchemaAddStatus(\n id: string | undefined,\n options: SchemaAddStatusCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaAddStatusResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n let normalized;\n try {\n normalized = normalizeAddStatusInput({\n id,\n roles: options.role,\n aliases: options.alias,\n description: options.description,\n order: options.order,\n });\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const statusesPath = statusesPathFor(pmRoot, schema);\n const statusRegistry = resolveRuntimeStatusRegistry(schema);\n\n // Reject id/alias collisions with a DIFFERENT existing status so a custom\n // status can never shadow a built-in lifecycle token (e.g. --alias open).\n try {\n assertStatusTokensAvailable(normalized, statusRegistry.alias_to_id);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n\n // Seed the upsert from the resolved (settings-or-file) definition so omitting\n // --role/--alias preserves metadata defined in settings.schema.statuses, not\n // only what is already in statuses.json.\n const resolvedExisting = statusRegistry.by_id.get(normalized.id);\n const baseDefinition: RuntimeStatusDefinition | undefined = resolvedExisting\n ? {\n id: resolvedExisting.id,\n ...(Array.isArray(resolvedExisting.roles) && resolvedExisting.roles.length > 0\n ? { roles: [...resolvedExisting.roles] }\n : {}),\n ...(Array.isArray(resolvedExisting.aliases) && resolvedExisting.aliases.length > 0\n ? { aliases: [...resolvedExisting.aliases] }\n : {}),\n ...(resolvedExisting.description ? { description: resolvedExisting.description } : {}),\n ...(typeof resolvedExisting.order === \"number\" ? { order: resolvedExisting.order } : {}),\n }\n : undefined;\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_STATUSES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let upsert;\n try {\n const previousRaw = await readFileIfExists(statusesPath);\n let parsed;\n try {\n parsed = parseStatusDefsFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n // Re-check collisions against the CURRENT file under the lock: the pre-lock\n // check used the registry loaded before acquiring schema-statuses, so a\n // concurrent add-status could have written a colliding id/alias in between.\n // The lock serializes writes; this serializes the collision decision too.\n const fileAliasToId = new Map<string, string>();\n for (const definition of parsed.statuses) {\n const defId = normalizeStatusToken(definition.id);\n if (defId.length === 0) {\n continue;\n }\n fileAliasToId.set(defId, defId);\n for (const alias of Array.isArray(definition.aliases) ? definition.aliases : []) {\n const aliasToken = normalizeStatusToken(alias);\n if (aliasToken.length > 0 && !fileAliasToId.has(aliasToken)) {\n fileAliasToId.set(aliasToken, defId);\n }\n }\n }\n try {\n assertStatusTokensAvailable(normalized, fileAliasToId);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n upsert = upsertStatusDef(parsed, normalized, baseDefinition);\n // writeFileAtomic writes to a temp file then renames, so a failure leaves\n // the existing statuses.json untouched; no manual rollback is needed.\n await writeFileAtomic(statusesPath, serializeStatusDefsFile(upsert.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: statusesPath,\n scope: \"project\",\n op: \"schema:add-status\",\n })),\n );\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"add-status\",\n registered: true,\n replaced: upsert.replaced,\n status: upsert.definition,\n file: {\n path: statusesPath,\n statuses: upsert.file.statuses.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaRemoveStatus(\n id: string | undefined,\n options: SchemaRemoveStatusCommandOptions,\n global: GlobalOptions,\n): Promise<SchemaRemoveStatusResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitialized(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const statusesPath = statusesPathFor(pmRoot, schema);\n\n const warnings: string[] = [];\n const author = toAuthor(options.author, settings.author_default);\n const governance = resolveGovernanceKnobs(settings);\n\n const releaseLock = await acquireLock(\n pmRoot,\n SCHEMA_STATUSES_LOCK_ID,\n settings.locks.ttl_seconds,\n author,\n Boolean(options.force),\n governance.force_required_for_stale_lock,\n );\n let removal;\n try {\n const previousRaw = await readFileIfExists(statusesPath);\n let parsed;\n try {\n parsed = parseStatusDefsFile(previousRaw);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.GENERIC_FAILURE);\n }\n try {\n removal = removeStatusDef(parsed, id);\n } catch (error) {\n throw new PmCliError(error instanceof Error ? error.message : String(error), EXIT_CODE.USAGE);\n }\n if (removal.removed) {\n // Only emit the advisory orphan-count warning once a removable custom\n // status was actually removed; a no-op/unknown removal would otherwise\n // surface a misleading items_using_status:* warning. The count reuses the\n // already-loaded settings (no disk re-read) and is non-blocking.\n const removedId = normalizeStatusToken(removal.definition?.id ?? id);\n if (removedId.length > 0 && !BUILTIN_STATUS_IDS.has(removedId)) {\n const usingStatus = await countItemsUsingStatus(pmRoot, settings, schema, removedId);\n if (usingStatus > 0) {\n warnings.push(`items_using_status:${usingStatus}`);\n }\n // Removing a status that a workflow default still points at would leave\n // pm close / default pm create resolving to an unregistered status. Warn\n // (non-blocking, consistent with remove-type) so the operator re-points\n // the workflow slot via schema/workflows.json or pm config.\n const referencingSlots = workflowSlotsReferencing(schema.workflow, removedId);\n if (referencingSlots.length > 0) {\n warnings.push(`status_referenced_by_workflow:${referencingSlots.join(\",\")}`);\n }\n }\n await writeFileAtomic(statusesPath, serializeStatusDefsFile(removal.file));\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: statusesPath,\n scope: \"project\",\n op: \"schema:remove-status\",\n })),\n );\n }\n } finally {\n await releaseLock();\n }\n\n return {\n action: \"remove-status\",\n removed: removal.removed,\n ...(removal.definition ? { status: removal.definition } : {}),\n file: {\n path: statusesPath,\n statuses: removal.file.statuses.length,\n },\n warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),\n generated_at: nowIso(),\n };\n}\n\nfunction toSchemaTypeSummary(definition: ResolvedItemTypeDefinition): SchemaTypeSummary {\n return {\n name: definition.name,\n folder: definition.folder,\n aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],\n ...(definition.default_status ? { default_status: definition.default_status } : {}),\n ...(definition.description ? { description: definition.description } : {}),\n };\n}\n\nfunction toSchemaTypeDefinition(\n definition: ResolvedItemTypeDefinition,\n source: SchemaTypeDefinitionResult[\"source\"],\n extensionProvenance?: SchemaTypeDefinitionResult[\"extension\"],\n): SchemaTypeDefinitionResult {\n return {\n ...toSchemaTypeSummary(definition),\n source,\n ...(extensionProvenance ? { extension: extensionProvenance } : {}),\n required_create_fields: [...definition.required_create_fields],\n required_create_repeatables: [...definition.required_create_repeatables],\n options: structuredClone(definition.options),\n command_option_policies: structuredClone(definition.command_option_policies),\n };\n}\n\nfunction toSchemaStatusSummary(definition: RuntimeStatusDefinition): SchemaStatusSummary {\n return {\n id: definition.id,\n source: BUILTIN_STATUS_IDS.has(definition.id) ? \"builtin\" : \"custom\",\n roles: Array.isArray(definition.roles) ? [...definition.roles] : [],\n aliases: Array.isArray(definition.aliases) ? [...definition.aliases] : [],\n ...(definition.description ? { description: definition.description } : {}),\n ...(typeof definition.order === \"number\" ? { order: definition.order } : {}),\n };\n}\n\nfunction classifyTypeSource(\n name: string,\n customNames: Set<string>,\n extensionNames: Set<string>,\n): SchemaTypeDefinitionResult[\"source\"] {\n const lowerName = name.toLowerCase();\n if (extensionNames.has(lowerName)) {\n return \"extension\";\n }\n if (customNames.has(lowerName)) {\n return \"custom\";\n }\n return \"builtin\";\n}\n\nfunction collectExtensionTypeProvenance(): Map<string, SchemaTypeDefinitionResult[\"extension\"]> {\n const provenance = new Map<string, SchemaTypeDefinitionResult[\"extension\"]>();\n const registrations = getActiveExtensionRegistrations();\n for (const registration of registrations?.item_types ?? []) {\n const rawTypes = (registration as { types?: unknown[] }).types;\n if (!Array.isArray(rawTypes)) {\n continue;\n }\n for (const rawType of rawTypes) {\n if (typeof rawType !== \"object\" || rawType === null || Array.isArray(rawType)) {\n continue;\n }\n const name = (rawType as { name?: unknown }).name;\n if (typeof name === \"string\" && name.trim().length > 0) {\n provenance.set(name.trim().toLowerCase(), {\n layer: registration.layer,\n name: registration.name,\n });\n }\n }\n }\n return provenance;\n}\n\nfunction buildSchemaStatusSummaries(\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>,\n): { builtin: SchemaStatusSummary[]; custom: SchemaStatusSummary[] } {\n const registry = resolveRuntimeStatusRegistry(schema);\n const builtin: SchemaStatusSummary[] = [];\n const custom: SchemaStatusSummary[] = [];\n for (const definition of registry.definitions) {\n const summary = toSchemaStatusSummary(definition);\n if (summary.source === \"builtin\") {\n builtin.push(summary);\n } else {\n custom.push(summary);\n }\n }\n return { builtin, custom };\n}\n\nasync function loadSchemaInspectionContext(global: GlobalOptions): Promise<{\n typesPath: string;\n statusesPath: string;\n byType: Record<string, ResolvedItemTypeDefinition>;\n customNames: Set<string>;\n extensionProvenance: Map<string, SchemaTypeDefinitionResult[\"extension\"]>;\n schema: ReturnType<typeof normalizeRuntimeSchemaSettings>;\n}> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const statusesPath = statusesPathFor(pmRoot, schema);\n const registry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const extensionProvenance = collectExtensionTypeProvenance();\n const customNames = new Set(\n (settings.item_types?.definitions ?? [])\n .map((definition) => definition.name.trim().toLowerCase())\n .filter((name) => name.length > 0 && !extensionProvenance.has(name)),\n );\n return {\n typesPath,\n statusesPath,\n byType: registry.by_type,\n customNames,\n extensionProvenance,\n schema,\n };\n}\n\nexport async function runSchemaList(global: GlobalOptions): Promise<SchemaListResult> {\n const context = await loadSchemaInspectionContext(global);\n const builtin: SchemaTypeSummary[] = [];\n const custom: SchemaTypeSummary[] = [];\n const extension: SchemaTypeSummary[] = [];\n for (const definition of Object.values(context.byType).sort((left, right) => left.name.localeCompare(right.name))) {\n const source = classifyTypeSource(definition.name, context.customNames, new Set(context.extensionProvenance.keys()));\n const summary = toSchemaTypeSummary(definition);\n if (source === \"extension\") {\n extension.push(summary);\n } else if (source === \"custom\") {\n custom.push(summary);\n } else {\n builtin.push(summary);\n }\n }\n const statusSummaries = buildSchemaStatusSummaries(context.schema);\n return {\n action: \"list\",\n builtin,\n custom,\n extension,\n counts: {\n builtin: builtin.length,\n custom: custom.length,\n extension: extension.length,\n total: builtin.length + custom.length + extension.length,\n },\n statuses: {\n builtin: statusSummaries.builtin,\n custom: statusSummaries.custom,\n counts: {\n builtin: statusSummaries.builtin.length,\n custom: statusSummaries.custom.length,\n total: statusSummaries.builtin.length + statusSummaries.custom.length,\n },\n },\n file: {\n path: context.typesPath,\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaShow(name: string | undefined, global: GlobalOptions): Promise<SchemaShowResult> {\n const typeName = (name ?? \"\").trim();\n if (typeName.length === 0) {\n throw new PmCliError(\"Type name must not be empty.\", EXIT_CODE.USAGE);\n }\n const context = await loadSchemaInspectionContext(global);\n const match = Object.values(context.byType).find(\n (definition) =>\n definition.name.toLowerCase() === typeName.toLowerCase() ||\n definition.aliases.some((alias) => alias.toLowerCase() === typeName.toLowerCase()),\n );\n if (!match) {\n throw new PmCliError(\n `Unknown item type \"${typeName}\". Run pm schema list to inspect registered types, or pm schema add-type \"${escapeForDoubleQuotes(typeName)}\" to register it.`,\n EXIT_CODE.NOT_FOUND,\n { code: \"unknown_item_type\" },\n );\n }\n return {\n action: \"show\",\n type: toSchemaTypeDefinition(\n match,\n classifyTypeSource(match.name, context.customNames, new Set(context.extensionProvenance.keys())),\n context.extensionProvenance.get(match.name.toLowerCase()),\n ),\n file: {\n path: context.typesPath,\n },\n generated_at: nowIso(),\n };\n}\n\nexport async function runSchemaShowStatus(\n id: string | undefined,\n global: GlobalOptions,\n): Promise<SchemaShowStatusResult> {\n const statusToken = normalizeStatusToken(id);\n if (statusToken.length === 0) {\n throw new PmCliError(\"Status id must not be empty.\", EXIT_CODE.USAGE);\n }\n const context = await loadSchemaInspectionContext(global);\n const statusRegistry = resolveRuntimeStatusRegistry(context.schema);\n const resolvedId = statusRegistry.alias_to_id.get(statusToken) ?? statusToken;\n const match = statusRegistry.by_id.get(resolvedId);\n if (!match) {\n throw new PmCliError(\n `Unknown status \"${id}\". Run pm schema list to inspect registered statuses, or pm schema add-status \"${escapeForDoubleQuotes(\n id ?? \"\",\n )}\" to register it.`,\n EXIT_CODE.NOT_FOUND,\n { code: \"unknown_status\" },\n );\n }\n return {\n action: \"show-status\",\n status: toSchemaStatusSummary(match),\n file: {\n path: context.statusesPath,\n },\n generated_at: nowIso(),\n };\n}\n\nexport function formatSchemaAddTypeHuman(result: SchemaAddTypeResult): string {\n const verb = result.replaced ? \"Updated\" : \"Registered\";\n const aliasSuffix =\n result.type.aliases && result.type.aliases.length > 0 ? ` (aliases: ${result.type.aliases.join(\", \")})` : \"\";\n return `${verb} custom item type \"${result.type.name}\"${aliasSuffix} in ${result.file.path}. Run: pm create \"${escapeForDoubleQuotes(result.type.name)}\" \"<title>\"`;\n}\n\nexport function formatSchemaRemoveTypeHuman(result: SchemaRemoveTypeResult): string {\n if (!result.removed) {\n return `No custom item type matched; nothing removed from ${result.file.path}.`;\n }\n const name = result.type?.name ?? \"(unknown)\";\n return `Removed custom item type \"${name}\" from ${result.file.path}.`;\n}\n\nexport function formatSchemaAddStatusHuman(result: SchemaAddStatusResult): string {\n const verb = result.replaced ? \"Updated\" : \"Registered\";\n const roleSuffix =\n result.status.roles && result.status.roles.length > 0 ? ` (roles: ${result.status.roles.join(\", \")})` : \"\";\n const aliasSuffix =\n result.status.aliases && result.status.aliases.length > 0 ? ` (aliases: ${result.status.aliases.join(\", \")})` : \"\";\n return `${verb} status \"${result.status.id}\"${roleSuffix}${aliasSuffix} in ${result.file.path}.`;\n}\n\nexport function formatSchemaRemoveStatusHuman(result: SchemaRemoveStatusResult): string {\n if (!result.removed) {\n return `No custom status matched; nothing removed from ${result.file.path}.`;\n }\n const id = result.status?.id ?? \"(unknown)\";\n return `Removed custom status \"${id}\" from ${result.file.path}.`;\n}\n\nexport function formatSchemaListHuman(result: SchemaListResult): string {\n const lines = [\n `Schema types: ${result.counts.total} total (${result.counts.builtin} builtin, ${result.counts.custom} custom, ${result.counts.extension} extension)`,\n ];\n for (const [label, entries] of [\n [\"builtin\", result.builtin],\n [\"custom\", result.custom],\n [\"extension\", result.extension],\n ] as const) {\n if (entries.length === 0) {\n continue;\n }\n lines.push(`${label}: ${entries.map((entry) => entry.name).join(\", \")}`);\n }\n lines.push(\n `statuses: ${result.statuses.counts.total} total (${result.statuses.counts.builtin} builtin, ${result.statuses.counts.custom} custom)`,\n );\n for (const [label, entries] of [\n [\"builtin statuses\", result.statuses.builtin],\n [\"custom statuses\", result.statuses.custom],\n ] as const) {\n if (entries.length === 0) {\n continue;\n }\n lines.push(`${label}: ${entries.map((entry) => entry.id).join(\", \")}`);\n }\n lines.push(`Inspect one: pm schema show <Type>`);\n lines.push(`Inspect one status: pm schema show-status <status>`);\n return lines.join(\"\\n\");\n}\n\nexport function formatSchemaShowHuman(result: SchemaShowResult): string {\n const parts = [\n `type: ${result.type.name}`,\n `source: ${result.type.source}`,\n `folder: ${result.type.folder}`,\n ];\n if (result.type.default_status) {\n parts.push(`default_status: ${result.type.default_status}`);\n }\n if (result.type.aliases.length > 0) {\n parts.push(`aliases: ${result.type.aliases.join(\", \")}`);\n }\n if (result.type.description) {\n parts.push(`description: ${result.type.description}`);\n }\n if (result.type.options.length > 0) {\n parts.push(`options: ${result.type.options.map((option) => option.key).join(\", \")}`);\n }\n return parts.join(\"\\n\");\n}\n\nexport function formatSchemaShowStatusHuman(result: SchemaShowStatusResult): string {\n const parts = [\n `status: ${result.status.id}`,\n `source: ${result.status.source}`,\n ];\n if (result.status.roles.length > 0) {\n parts.push(`roles: ${result.status.roles.join(\", \")}`);\n }\n if (result.status.aliases.length > 0) {\n parts.push(`aliases: ${result.status.aliases.join(\", \")}`);\n }\n if (result.status.description) {\n parts.push(`description: ${result.status.description}`);\n }\n if (typeof result.status.order === \"number\") {\n parts.push(`order: ${result.status.order}`);\n }\n return parts.join(\"\\n\");\n}\n\n/* c8 ignore stop */\n\n/**\n * Re-export so register-mutation can surface the hint in usage examples\n * without importing the core module directly.\n */\nexport { buildInvalidTypeHint };\n\nexport const _testOnlySchemaCommand = {\n toAuthor,\n workflowSlotsReferencing,\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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