@unbrained/pm-cli 2026.6.30 → 2026.7.1

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 (452) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +20 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commands/calendar.js +63 -62
  6. package/dist/cli/commands/calendar.js.map +1 -1
  7. package/dist/cli/commands/create.js +483 -434
  8. package/dist/cli/commands/create.js.map +1 -1
  9. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  10. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  11. package/dist/cli/commands/extension/doctor.js +129 -78
  12. package/dist/cli/commands/extension/doctor.js.map +1 -1
  13. package/dist/cli/commands/extension/managed-state.js +101 -57
  14. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  15. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  16. package/dist/cli/commands/extension/scaffold.js +214 -186
  17. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  18. package/dist/cli/commands/extension.d.ts +6 -1
  19. package/dist/cli/commands/extension.js +1034 -902
  20. package/dist/cli/commands/extension.js.map +1 -1
  21. package/dist/cli/commands/list-filter-shared.js +55 -48
  22. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  23. package/dist/cli/commands/search.js +94 -68
  24. package/dist/cli/commands/search.js.map +1 -1
  25. package/dist/cli/commands/test.js +108 -122
  26. package/dist/cli/commands/test.js.map +1 -1
  27. package/dist/cli/commands/update.js +27 -77
  28. package/dist/cli/commands/update.js.map +1 -1
  29. package/dist/cli/extension-command-options.js +48 -21
  30. package/dist/cli/extension-command-options.js.map +1 -1
  31. package/dist/cli/registration-helpers.js +117 -122
  32. package/dist/cli/registration-helpers.js.map +1 -1
  33. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +16 -0
  34. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-DBLQVIP6.js} +9 -9
  35. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-JTEF4BP7.js} +9 -9
  36. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SDF7DUOD.js} +9 -9
  37. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-LOVPGVPT.js} +6 -6
  38. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-QCFJSDFL.js} +6 -6
  39. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-22WKIL3H.js} +6 -6
  40. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-2466X6E4.js} +6 -6
  41. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-27BXPBAY.js} +3 -3
  42. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-2D4HATP2.js} +5 -5
  43. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-3J6JRJ3I.js} +127 -125
  44. package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +7 -0
  45. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-3K2M5OYU.js} +4 -4
  46. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-3S2KT7NG.js} +7 -7
  47. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-3VGN2UWE.js} +2 -2
  48. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-3XZCOZ5J.js} +107 -117
  49. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +1 -0
  50. package/dist/cli-bundle/chunks/chunk-4A3BJ675.js +799 -0
  51. package/dist/cli-bundle/chunks/chunk-4A3BJ675.js.map +1 -0
  52. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  53. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  54. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-4DSGXSBL.js} +4 -4
  55. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-4DUVCVLZ.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-4XOIEKSD.js} +351 -330
  57. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +1 -0
  58. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-55SNVXRQ.js} +68 -69
  59. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +7 -0
  60. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-5CGRF3L5.js} +7 -7
  61. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-5QFDBI4F.js} +1105 -965
  62. package/dist/cli-bundle/chunks/chunk-5QFDBI4F.js.map +7 -0
  63. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-64HNBBFQ.js} +6 -6
  64. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-6AQZPVHQ.js} +198 -189
  65. package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js.map +1 -0
  66. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-7R4QEMZZ.js} +361 -322
  67. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +1 -0
  68. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-A7FPBAQS.js} +4 -4
  69. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-AVEE5EHK.js} +3 -3
  70. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-AXIDKKAT.js} +2 -2
  71. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-BDTISOSD.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-BHO33VBQ.js} +509 -363
  73. package/dist/cli-bundle/chunks/chunk-BHO33VBQ.js.map +7 -0
  74. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-BZCEN4JA.js} +98 -74
  75. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +7 -0
  76. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-CF7RL6FR.js} +7 -7
  77. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-CWFNTKQJ.js} +128 -126
  78. package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-DDPTYJIM.js} +2 -2
  80. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-EJUDVUYZ.js} +3 -3
  81. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-EVMTBV6V.js} +3 -3
  82. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-FFMQB7WR.js} +99 -75
  83. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +1 -0
  84. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-G7I7DEZA.js} +4 -4
  85. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-GJ326ZKX.js} +3 -3
  86. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-HPPFYYOV.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-HXTQJXWT.js} +150 -224
  88. package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +1 -0
  89. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-HYTGA6GI.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-HZZEHPRG.js} +2 -2
  91. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-IJYK2T43.js} +2 -2
  92. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-IPYBJWTE.js} +7 -7
  93. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-IZBR4NRW.js} +7 -7
  94. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-JLM7BHI7.js} +6 -6
  95. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-JMP4E6D7.js} +106 -116
  96. package/dist/cli-bundle/chunks/chunk-JMP4E6D7.js.map +7 -0
  97. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-JPECA746.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-JSU5P7VS.js} +4 -4
  99. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-JWXRETDF.js} +69 -70
  100. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +1 -0
  101. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-KNPEF7QG.js} +4 -4
  102. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-L5OEFZQG.js} +3 -3
  103. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-LB6TP6MC.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-MAUKX7JC.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-MDPEOIGN.js} +150 -224
  106. package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +7 -0
  107. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-N74UMG5H.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-NFDPYAIP.js} +2 -2
  109. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-NKZAN7BD.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-NOLPZMSV.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-NU2UEROZ.js} +1103 -963
  112. package/dist/cli-bundle/chunks/chunk-NU2UEROZ.js.map +1 -0
  113. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-NUHHPVVS.js} +36 -86
  114. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-NWMZWYYB.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-OGXLACHC.js} +6 -6
  117. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-OTUHB4HS.js} +4 -4
  118. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-QCWF6IYD.js} +510 -364
  119. package/dist/cli-bundle/chunks/chunk-QCWF6IYD.js.map +1 -0
  120. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-RGEMWD6Q.js} +5 -5
  121. package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js +809 -0
  122. package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js.map +7 -0
  123. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-RLDHZHQS.js} +7 -7
  124. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-RMMQ74TG.js} +5 -5
  125. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-RVUALSJF.js} +361 -322
  126. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +7 -0
  127. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-SDR5J34Q.js} +198 -189
  128. package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-SLMUGTK3.js} +4 -4
  130. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-TP5Q5ZD3.js} +5 -5
  131. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-UYUYDGIB.js} +4 -4
  132. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-UZIWVBE6.js} +2 -2
  133. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-V3NOKJF2.js} +6 -6
  134. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-VARHOHYV.js} +350 -329
  135. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-VICZWYGZ.js} +4 -4
  137. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  138. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-W4ULYO7Z.js} +6 -6
  140. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-WYDHYJPO.js} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-YITK2PJ6.js} +6 -6
  142. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-ZETXE4SE.js} +37 -87
  143. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +1 -0
  144. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-ZRP4VG5U.js} +2 -2
  145. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-EMQLYPRW.js} +8 -8
  146. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-T3GCKV7C.js} +8 -8
  147. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +14 -0
  148. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-TQYAAFJP.js} +7 -7
  149. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-BG5QQIDQ.js} +15 -15
  150. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-LDRVEQY2.js} +15 -15
  151. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-QCKR2YY2.js} +8 -8
  152. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-YUXJRZPQ.js} +8 -8
  153. package/dist/cli-bundle/chunks/{config-FIXJZEQK.js → config-DMSU64QO.js} +7 -7
  154. package/dist/cli-bundle/chunks/{config-X3ZVCUUG.js → config-QH2DICD6.js} +7 -7
  155. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-B6275WPX.js} +12 -12
  156. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-OCZ3FJ4Z.js} +12 -12
  157. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-HN7ABKLP.js} +3 -3
  158. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-W4FZVVD6.js} +3 -3
  159. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-BTJOSKKT.js} +5 -5
  160. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-DEM4DATS.js} +5 -5
  161. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +28 -0
  162. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-RLRJMRTM.js} +12 -12
  163. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-BHK7VB2Z.js} +5 -5
  164. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-LSVHAB4Y.js} +5 -5
  165. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-4UDFJRUA.js} +5 -5
  166. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-XHYXWEPT.js} +5 -5
  167. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-26S44RXU.js} +7 -7
  168. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-GYZNVS26.js} +7 -7
  169. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-PGRVIJQU.js} +10 -10
  170. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-UYF3ZPVO.js} +10 -10
  171. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-CPSLJQVE.js} +11 -10
  172. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-CXJ6RELI.js} +11 -10
  173. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-MBNICQFM.js} +7 -7
  174. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-NQHEXUZD.js} +7 -7
  175. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-DWYIG7GU.js} +6 -6
  176. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-XZW5423D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-7GQYOS2G.js} +3 -3
  178. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-LPVMKJQJ.js} +3 -3
  179. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-A7MAOHCU.js} +9 -9
  180. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-DSDEKJ3L.js} +9 -9
  181. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-3IPFLKXB.js} +17 -16
  182. package/dist/cli-bundle/chunks/{health-Q66C43GN.js.map → health-3IPFLKXB.js.map} +1 -1
  183. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-GZXGBZ36.js} +15 -14
  184. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js.map → health-GZXGBZ36.js.map} +1 -1
  185. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-NERDJNUB.js} +8 -8
  186. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +18 -0
  187. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-2WRZ2WK4.js} +10 -10
  188. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HR7BB4LR.js} +10 -10
  189. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +19 -0
  190. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-O3NBCNWC.js} +9 -9
  191. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-LCMOS45X.js} +10 -10
  192. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-XA3LC4GA.js} +10 -10
  193. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-64XDLQJB.js} +12 -11
  194. package/dist/cli-bundle/chunks/init-PAX32BJA.js +22 -0
  195. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-JR6MA5TI.js} +8 -8
  196. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-LPKCSJX7.js} +8 -8
  197. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-DNBJVO3E.js} +8 -8
  198. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-G5Y65VF6.js} +8 -8
  199. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-BCERKDUR.js} +13 -13
  200. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-FYTQF6HG.js} +13 -13
  201. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-2BMU3VVQ.js} +8 -8
  202. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-6KTGO2OJ.js} +8 -8
  203. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-4WXEQCTN.js} +12 -12
  204. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-RKZHQVXR.js} +12 -12
  205. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-4OMM32CD.js} +8 -8
  206. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-QLER5ENE.js} +8 -8
  207. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-7LV46VAU.js} +18 -18
  208. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-SNG5PGA4.js} +18 -18
  209. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-ENNDUAZG.js} +35 -35
  210. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KK7PHYYU.js} +35 -35
  211. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-C6OWLDSH.js} +30 -30
  212. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-HZ6XERQG.js} +30 -30
  213. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-P67EMBDJ.js} +15 -15
  214. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZKJ53RS7.js} +15 -15
  215. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4MHZFJ2E.js} +9 -9
  216. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +17 -0
  217. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-LB6DOLRL.js} +12 -12
  218. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-UTOYKLXQ.js} +12 -12
  219. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-73HR2OJW.js} +7 -7
  220. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-U6LJKSIR.js} +7 -7
  221. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-AXPXKZER.js} +10 -10
  222. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-KILGT37L.js} +10 -10
  223. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-PSYVVTNZ.js} +6 -6
  224. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-W5KNVJWQ.js} +6 -6
  225. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-BZUF6H7G.js} +4 -4
  226. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-GAHHQTOS.js} +4 -4
  227. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-ACD52Z3S.js} +15 -14
  228. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-PWDIZ255.js} +15 -14
  229. package/dist/cli-bundle/chunks/{test-all-XLPI4USF.js → test-all-L2MDDUCA.js} +17 -16
  230. package/dist/cli-bundle/chunks/{test-all-XLPI4USF.js.map → test-all-L2MDDUCA.js.map} +1 -1
  231. package/dist/cli-bundle/chunks/{test-all-PZTBLLQ6.js → test-all-RBZ6DLU2.js} +15 -14
  232. package/dist/cli-bundle/chunks/{test-all-PZTBLLQ6.js.map → test-all-RBZ6DLU2.js.map} +1 -1
  233. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-PLRAZEFW.js} +4 -4
  234. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-UXIXPDKU.js} +4 -4
  235. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +24 -0
  236. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-KFX2SIAC.js} +15 -15
  237. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-RNSBX2TA.js} +23 -23
  238. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-Z5GJS5LC.js} +23 -23
  239. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-BRL6KCOJ.js} +13 -12
  240. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-BRL6KCOJ.js.map} +1 -1
  241. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-HAK6JG2O.js} +11 -10
  242. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-HAK6JG2O.js.map} +1 -1
  243. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-MTUVL5VC.js} +20 -19
  244. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js.map → validate-MTUVL5VC.js.map} +1 -1
  245. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-X5W76YJL.js} +22 -21
  246. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js.map → validate-X5W76YJL.js.map} +1 -1
  247. package/dist/cli-bundle/main.js +55 -702
  248. package/dist/cli-bundle/main.js.map +4 -4
  249. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  250. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  251. package/dist/core/extensions/extension-policy.d.ts +18 -3
  252. package/dist/core/extensions/extension-policy.js +116 -106
  253. package/dist/core/extensions/extension-policy.js.map +1 -1
  254. package/dist/core/extensions/loader.js +310 -232
  255. package/dist/core/extensions/loader.js.map +1 -1
  256. package/dist/core/item/item-format.js +523 -410
  257. package/dist/core/item/item-format.js.map +1 -1
  258. package/dist/mcp/server.js +387 -367
  259. package/dist/mcp/server.js.map +1 -1
  260. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  261. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  262. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  263. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  264. package/dist/sdk/compose.d.ts +4 -1
  265. package/dist/sdk/compose.js +181 -115
  266. package/dist/sdk/compose.js.map +1 -1
  267. package/docs/RELEASING.md +2 -3
  268. package/package.json +1 -1
  269. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  270. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  271. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  272. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  273. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  274. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  275. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  276. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  277. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  278. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  279. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  280. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  281. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  282. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  283. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  284. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  285. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  286. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  287. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  288. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  289. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  290. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  291. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  292. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  293. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  294. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  295. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  296. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  297. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  298. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  299. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  300. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  301. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  302. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  303. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  304. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  305. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  306. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  307. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-AW6XVFH6.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-DBLQVIP6.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js.map → aggregate-JTEF4BP7.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SDF7DUOD.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-LOVPGVPT.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-QCFJSDFL.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-22WKIL3H.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-2466X6E4.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-27BXPBAY.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js.map → chunk-2D4HATP2.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-3K2M5OYU.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js.map → chunk-3S2KT7NG.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js.map → chunk-3VGN2UWE.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js.map → chunk-4DSGXSBL.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-4DUVCVLZ.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js.map → chunk-5CGRF3L5.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-64HNBBFQ.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-A7FPBAQS.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-AVEE5EHK.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-AXIDKKAT.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js.map → chunk-BDTISOSD.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js.map → chunk-CF7RL6FR.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-DDPTYJIM.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-EJUDVUYZ.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-EVMTBV6V.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-G7I7DEZA.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-GJ326ZKX.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-HPPFYYOV.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-HYTGA6GI.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-HZZEHPRG.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-IJYK2T43.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js.map → chunk-IPYBJWTE.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js.map → chunk-IZBR4NRW.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-JLM7BHI7.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-JPECA746.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js.map → chunk-JSU5P7VS.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js.map → chunk-KNPEF7QG.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-L5OEFZQG.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-LB6TP6MC.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-MAUKX7JC.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-N74UMG5H.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js.map → chunk-NFDPYAIP.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-NKZAN7BD.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-NOLPZMSV.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js.map → chunk-NWMZWYYB.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-OGXLACHC.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js.map → chunk-OTUHB4HS.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js.map → chunk-RGEMWD6Q.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js.map → chunk-RLDHZHQS.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js.map → chunk-RMMQ74TG.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-SLMUGTK3.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js.map → chunk-TP5Q5ZD3.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js.map → chunk-UYUYDGIB.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-UZIWVBE6.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-JTRKME24.js.map → chunk-V3NOKJF2.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-VICZWYGZ.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-W4ULYO7Z.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-WYDHYJPO.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js.map → chunk-YITK2PJ6.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-ZRP4VG5U.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-EMQLYPRW.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-T3GCKV7C.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-E6ZZGCJY.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-TQYAAFJP.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js.map → close-many-BG5QQIDQ.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js.map → close-many-LDRVEQY2.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-QCKR2YY2.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-YUXJRZPQ.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{config-FIXJZEQK.js.map → config-DMSU64QO.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{config-X3ZVCUUG.js.map → config-QH2DICD6.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-B6275WPX.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-OCZ3FJ4Z.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js.map → contracts-HN7ABKLP.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js.map → contracts-W4FZVVD6.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-BTJOSKKT.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-DEM4DATS.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-OH3BDGBB.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-RLRJMRTM.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-BHK7VB2Z.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-LSVHAB4Y.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-4UDFJRUA.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-XHYXWEPT.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-26S44RXU.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-GYZNVS26.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-PGRVIJQU.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-UYF3ZPVO.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-CPSLJQVE.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-CXJ6RELI.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-MBNICQFM.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-NQHEXUZD.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-DWYIG7GU.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-XZW5423D.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-7GQYOS2G.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-LPVMKJQJ.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{get-AWK324RS.js.map → get-A7MAOHCU.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{get-VYPIICPC.js.map → get-DSDEKJ3L.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-NERDJNUB.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-WSZHY3PN.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js.map → history-compact-2WRZ2WK4.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js.map → history-compact-HR7BB4LR.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-MP6CH7U5.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-O3NBCNWC.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js.map → history-repair-LCMOS45X.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js.map → history-repair-XA3LC4GA.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-64XDLQJB.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-PAX32BJA.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-JR6MA5TI.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-LPKCSJX7.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-DNBJVO3E.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-G5Y65VF6.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{next-66BJB4N2.js.map → next-BCERKDUR.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{next-N5MWJTBY.js.map → next-FYTQF6HG.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-2BMU3VVQ.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-6KTGO2OJ.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js.map → plan-4WXEQCTN.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js.map → plan-RKZHQVXR.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-4OMM32CD.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-QLER5ENE.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js.map → register-list-query-7LV46VAU.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js.map → register-list-query-SNG5PGA4.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js.map → register-mutation-ENNDUAZG.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js.map → register-mutation-KK7PHYYU.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js.map → register-operations-C6OWLDSH.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js.map → register-operations-HZ6XERQG.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js.map → register-setup-P67EMBDJ.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js.map → register-setup-ZKJ53RS7.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4MHZFJ2E.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-YALDGTQR.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-LB6DOLRL.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-UTOYKLXQ.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-73HR2OJW.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-U6LJKSIR.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-AXPXKZER.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-KILGT37L.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-PSYVVTNZ.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-W5KNVJWQ.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js.map → telemetry-BZUF6H7G.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js.map → telemetry-GAHHQTOS.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-ACD52Z3S.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-PWDIZ255.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js.map → test-runs-PLRAZEFW.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js.map → test-runs-UXIXPDKU.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-AMRSOIWP.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-KFX2SIAC.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-RNSBX2TA.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-Z5GJS5LC.js.map} +0 -0
@@ -4,7 +4,7 @@
4
4
  * Implements the pm create command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aa70c8da-5e95-5356-b118-cc0dcc4d1835")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="39253884-2bdf-54e5-9cf2-6ac279638287")}catch(e){}}();
8
8
  import { pathExists, removeFileIfExists, writeFileAtomic } from "../../core/fs/fs-utils.js";
9
9
  import { appendHistoryEntry, createHistoryEntry } from "../../core/history/history.js";
10
10
  import { generateItemId, normalizeItemId } from "../../core/item/id.js";
@@ -794,16 +794,171 @@ function ensureInitHasRun(pmRoot) {
794
794
  });
795
795
  }
796
796
  /**
797
- * Implements run create for the public runtime surface of this module.
797
+ * Resolve an optional string front-matter field for {@link runCreate}: yields
798
+ * `undefined` when the field is being cleared via `--unset <key>` or was never
799
+ * supplied, otherwise the (identity-parsed) raw value. Collapses the pervasive
800
+ * `unset ? undefined : raw === undefined ? undefined : parseOptionalString(raw)`
801
+ * triple-ternary each optional scalar field repeated inline, keeping `runCreate`
802
+ * under the complexity ceiling without changing any resolved value.
798
803
  */
799
- export async function runCreate(options, global) {
800
- let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));
801
- const pmRoot = resolvePmRoot(process.cwd(), global.path);
802
- await ensureInitHasRun(pmRoot);
803
- const settings = await readSettings(pmRoot);
804
- const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
805
- const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
806
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
804
+ function resolveUnsettableOptionalString(unsetKeys, frontMatterKey, raw) {
805
+ return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : parseOptionalString(raw);
806
+ }
807
+ /**
808
+ * Resolve an optional field that maps its raw string through `transform` once
809
+ * present: yields `undefined` when the field is being cleared via `--unset` or
810
+ * was never supplied, otherwise `transform(raw)`. The non-string return type is
811
+ * inferred from `transform`, so this serves numeric, ISO-date, and enum fields
812
+ * alike while keeping the unset/absent guard in one place.
813
+ */
814
+ function resolveUnsettableTransformed(unsetKeys, frontMatterKey, raw, transform) {
815
+ return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : transform(raw);
816
+ }
817
+ /** Calendar-relevant item types whose entries are invisible on `pm calendar` without a schedule. */
818
+ const CALENDAR_RELEVANT_CREATE_TYPES = new Set(["milestone", "meeting", "reminder", "event"]);
819
+ /**
820
+ * Whether a calendar-relevant item would be invisible on `pm calendar`: a
821
+ * Milestone/Meeting/Reminder/Event created with no deadline AND no reminders AND
822
+ * no events never surfaces there. Shared by the structured create warning and the
823
+ * post-write stderr hint so both stay in lockstep.
824
+ */
825
+ function createItemLacksSchedule(type, deadline, reminders, events) {
826
+ const hasDeadline = deadline !== undefined;
827
+ const hasReminders = reminders !== undefined && reminders.length > 0;
828
+ const hasEvents = events !== undefined && events.length > 0;
829
+ return CALENDAR_RELEVANT_CREATE_TYPES.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents;
830
+ }
831
+ /**
832
+ * Build the never-blocking schedule-visibility warnings for a new item: an
833
+ * `event_without_schedule` token for Event-type items with no attached events,
834
+ * and a `calendar_item_without_schedule` token (with an actionable hint) for any
835
+ * calendar-relevant type that would be invisible on `pm calendar`. The structured
836
+ * prefixes are stable for automation/telemetry (pm-2cgu / GH-174).
837
+ */
838
+ function collectCreateScheduleWarnings(type, id, deadline, reminders, events) {
839
+ const warnings = [];
840
+ if (type.toLowerCase() === "event" && (events === undefined || events.length === 0)) {
841
+ warnings.push(`event_without_schedule:${id}:no_time_set`);
842
+ }
843
+ if (createItemLacksSchedule(type, deadline, reminders, events)) {
844
+ warnings.push(`calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event (hint: set --deadline <ISO> or --reminder "<when>", or link an Event via --event "start=<ISO>,end=<ISO>"; otherwise this item never appears on pm calendar)`);
845
+ }
846
+ return warnings;
847
+ }
848
+ /**
849
+ * Resolve the effective parent for a new item, inheriting the session-focused
850
+ * item (set via `pm focus <id>`) only when no explicit `--parent` was supplied
851
+ * and parent is not being unset (GH-161 / pm-72xf). An explicit `--parent`
852
+ * (including `--parent ""`) always overrides focus; the inherited value flows
853
+ * through the same locate/validate path as an explicit parent.
854
+ */
855
+ async function inheritFocusedParent(parent, resolvedOptions, unsetKeys, pmRoot) {
856
+ if (parent !== undefined || unsetKeys.has("parent") || resolvedOptions.parent !== undefined) {
857
+ return { parent, parentSource: undefined };
858
+ }
859
+ const focused = await getFocusedItem(pmRoot);
860
+ if (focused === undefined) {
861
+ return { parent, parentSource: undefined };
862
+ }
863
+ return { parent: focused, parentSource: "focus" };
864
+ }
865
+ /**
866
+ * Normalize and locate a new item's parent reference, returning the normalized
867
+ * value plus any never-blocking missing-parent warnings the configured
868
+ * `parent_reference` policy produces when the target does not resolve.
869
+ */
870
+ async function validateCreateParentReference(pmRoot, settings, typeRegistry, parent, policy) {
871
+ const normalized = normalizeParentReferenceValue(parent);
872
+ const parentLocated = await locateItem(pmRoot, normalized, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
873
+ if (parentLocated) {
874
+ return { parent: normalized, warnings: [] };
875
+ }
876
+ const normalizedParentId = normalizeItemId(normalized, settings.id_prefix);
877
+ return { parent: normalized, warnings: validateMissingParentReference(normalizedParentId, policy).warnings };
878
+ }
879
+ /**
880
+ * Resolve a sprint or release field: `undefined` when cleared/absent, otherwise
881
+ * the format-validated value plus any never-blocking format warnings from the
882
+ * configured `sprint_release_format` policy.
883
+ */
884
+ function resolveCreateSprintOrRelease(unsetKeys, frontMatterKey, raw, field, policy) {
885
+ const resolved = resolveUnsettableOptionalString(unsetKeys, frontMatterKey, raw);
886
+ if (resolved === undefined) {
887
+ return { value: undefined, warnings: [] };
888
+ }
889
+ const validation = validateSprintOrReleaseValue(field, resolved, policy);
890
+ return { value: validation.value, warnings: validation.warnings };
891
+ }
892
+ /**
893
+ * Apply the `--blocked-by` convenience: when the target locates, add a
894
+ * `blocked_by` dependency (if not already present) and, unless `--status` was
895
+ * given explicitly, move the new item into the blocked status. Returns the
896
+ * (possibly augmented) dependency list and the (possibly rerouted) status; a
897
+ * `blockedBy` that is absent or does not locate leaves both unchanged.
898
+ */
899
+ async function resolveCreateBlockedByDependency(params) {
900
+ const { pmRoot, settings, typeRegistry, statusRegistry, blockedBy, status, statusExplicit, nowValue, author } = params;
901
+ let dependencyValues = params.dependencyValues;
902
+ if (blockedBy === undefined) {
903
+ return { dependencyValues, status };
904
+ }
905
+ const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);
906
+ const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
907
+ if (!blockedByLocated) {
908
+ return { dependencyValues, status };
909
+ }
910
+ const hasBlockedByDependency = (dependencyValues ?? []).some((dependency) => dependency.id === blockedByLocated.id && dependency.kind === "blocked_by");
911
+ if (!hasBlockedByDependency) {
912
+ dependencyValues = [
913
+ ...(dependencyValues ?? []),
914
+ { id: blockedByLocated.id, kind: "blocked_by", created_at: nowValue, author },
915
+ ];
916
+ }
917
+ if (statusExplicit) {
918
+ return { dependencyValues, status };
919
+ }
920
+ const blockedStatus = statusRegistry.blocked_statuses.has("blocked")
921
+ ? "blocked"
922
+ : [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;
923
+ return { dependencyValues, status: blockedStatus };
924
+ }
925
+ /**
926
+ * Apply the governance default-type fallback when `pm create` was invoked with no
927
+ * `--type`: honor `governance.create_default_type` when it resolves in the active
928
+ * registry, else fall back to the built-in `Task`. Suppressed under explicit
929
+ * `--create-mode strict`, where the strict required-option contract must surface
930
+ * the missing_required_option envelope instead. Mutates `resolvedOptions.type`.
931
+ */
932
+ function applyCreateDefaultType(resolvedOptions, settings, typeRegistry) {
933
+ // Default-type fallback is suppressed under explicit --create-mode strict, where the strict
934
+ // required-option contract takes precedence and surfaces the missing_required_option envelope.
935
+ /* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */
936
+ const explicitStrictMode = typeof resolvedOptions.createMode === "string" && resolvedOptions.createMode.trim().toLowerCase() === "strict";
937
+ if (explicitStrictMode) {
938
+ return;
939
+ }
940
+ /* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */
941
+ const defaultType = settings.governance.create_default_type?.trim();
942
+ if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {
943
+ resolvedOptions.type = defaultType;
944
+ return;
945
+ }
946
+ /* c8 ignore start -- "Task" is a built-in type present in every default registry; reaching this arm requires a custom schema that removed Task with no create_default_type configured. */
947
+ if (resolveTypeName("Task", typeRegistry)) {
948
+ resolvedOptions.type = "Task";
949
+ }
950
+ /* c8 ignore stop */
951
+ }
952
+ /**
953
+ * Resolve the target item type and creation mode for `pm create`: merge any
954
+ * `--template` options, apply the governance default-type fallback, map a
955
+ * near-miss `--type` to its canonical synonym (never blocking), and derive the
956
+ * schedule preset and effective create mode. Returns the (possibly
957
+ * template-merged) options alongside the resolved type definition, canonical
958
+ * type name, schedule preset, and create mode.
959
+ */
960
+ async function resolveCreateTypeSelection(options, global, pmRoot, settings, typeRegistry) {
961
+ let resolvedOptions = options;
807
962
  if (resolvedOptions.template !== undefined) {
808
963
  const templateName = resolvedOptions.template.trim();
809
964
  if (templateName.length === 0) {
@@ -814,25 +969,7 @@ export async function runCreate(options, global) {
814
969
  resolvedOptions = normalizeLegacyNoneCreateOptions(mergeCreateOptionsWithTemplate(templateOptions, resolvedOptions));
815
970
  }
816
971
  if (resolvedOptions.type === undefined) {
817
- // Default-type fallback is suppressed under explicit --create-mode strict, where the strict
818
- // required-option contract takes precedence and surfaces the missing_required_option envelope.
819
- /* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */
820
- const explicitStrictMode = typeof resolvedOptions.createMode === "string"
821
- && resolvedOptions.createMode.trim().toLowerCase() === "strict";
822
- if (!explicitStrictMode) {
823
- /* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */
824
- const defaultType = settings.governance.create_default_type?.trim();
825
- if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {
826
- resolvedOptions.type = defaultType;
827
- }
828
- else {
829
- /* c8 ignore start -- "Task" is a built-in type present in every default registry; reaching the false arm requires a custom schema that removed Task with no create_default_type configured. */
830
- if (resolveTypeName("Task", typeRegistry)) {
831
- resolvedOptions.type = "Task";
832
- }
833
- /* c8 ignore stop */
834
- }
835
- }
972
+ applyCreateDefaultType(resolvedOptions, settings, typeRegistry);
836
973
  }
837
974
  /* c8 ignore start -- missing/invalid type fallback guards are exercised by create command integration suites. */
838
975
  if (resolvedOptions.type === undefined) {
@@ -868,90 +1005,30 @@ export async function runCreate(options, global) {
868
1005
  throw new PmCliError(`--schedule-preset ${schedulePreset} is only supported for Reminder, Meeting, or Event types`, EXIT_CODE.USAGE);
869
1006
  }
870
1007
  const createMode = resolveEffectiveCreateMode(resolvedOptions.createMode, schedulePreset, settings.governance.create_mode_default);
871
- const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);
1008
+ return { resolvedOptions, typeDefinition, type, schedulePreset, createMode };
1009
+ }
1010
+ /**
1011
+ * Seed the explicit-unset and clear-option key sets from the parsed `--unset`
1012
+ * targets, then fold in each enabled `--clear-<collection>` flag: it marks the
1013
+ * collection's front-matter key as explicitly unset and its option key as
1014
+ * cleared, and rejects combining a clear flag with its own value flag. Returns
1015
+ * the augmented sets used downstream for required-flag relaxation and history
1016
+ * messaging.
1017
+ */
1018
+ function collectCreateClearTargets(resolvedOptions, unsetTargets) {
872
1019
  const explicitUnsets = new Set(unsetTargets.frontMatterKeys);
873
1020
  const clearOptionKeys = new Set(unsetTargets.optionKeys);
874
1021
  const clearCollectionDefinitions = [
875
- {
876
- enabled: resolvedOptions.clearDeps,
877
- optionKey: "dep",
878
- clearFlag: "--clear-deps",
879
- valueFlag: "--dep",
880
- values: resolvedOptions.dep,
881
- frontMatterKey: "dependencies",
882
- },
883
- {
884
- enabled: resolvedOptions.clearComments,
885
- optionKey: "comment",
886
- clearFlag: "--clear-comments",
887
- valueFlag: "--comment",
888
- values: resolvedOptions.comment,
889
- frontMatterKey: "comments",
890
- },
891
- {
892
- enabled: resolvedOptions.clearNotes,
893
- optionKey: "note",
894
- clearFlag: "--clear-notes",
895
- valueFlag: "--note",
896
- values: resolvedOptions.note,
897
- frontMatterKey: "notes",
898
- },
899
- {
900
- enabled: resolvedOptions.clearLearnings,
901
- optionKey: "learning",
902
- clearFlag: "--clear-learnings",
903
- valueFlag: "--learning",
904
- values: resolvedOptions.learning,
905
- frontMatterKey: "learnings",
906
- },
907
- {
908
- enabled: resolvedOptions.clearFiles,
909
- optionKey: "file",
910
- clearFlag: "--clear-files",
911
- valueFlag: "--file",
912
- values: resolvedOptions.file,
913
- frontMatterKey: "files",
914
- },
915
- {
916
- enabled: resolvedOptions.clearTests,
917
- optionKey: "test",
918
- clearFlag: "--clear-tests",
919
- valueFlag: "--test",
920
- values: resolvedOptions.test,
921
- frontMatterKey: "tests",
922
- },
923
- {
924
- enabled: resolvedOptions.clearDocs,
925
- optionKey: "doc",
926
- clearFlag: "--clear-docs",
927
- valueFlag: "--doc",
928
- values: resolvedOptions.doc,
929
- frontMatterKey: "docs",
930
- },
931
- {
932
- enabled: resolvedOptions.clearReminders,
933
- optionKey: "reminder",
934
- clearFlag: "--clear-reminders",
935
- valueFlag: "--reminder",
936
- values: resolvedOptions.reminder,
937
- frontMatterKey: "reminders",
938
- },
939
- {
940
- enabled: resolvedOptions.clearEvents,
941
- optionKey: "event",
942
- clearFlag: "--clear-events",
943
- valueFlag: "--event",
944
- values: resolvedOptions.event,
945
- frontMatterKey: "events",
946
- },
947
- {
948
- enabled: resolvedOptions.clearTypeOptions,
949
- optionKey: "typeOption",
950
- clearFlag: "--clear-type-options",
951
- valueFlag: "--type-option",
952
- values: resolvedOptions.typeOption,
953
- frontMatterKey: "type_options",
954
- },
1022
+ { enabled: resolvedOptions.clearDeps, optionKey: "dep", clearFlag: "--clear-deps", valueFlag: "--dep", values: resolvedOptions.dep, frontMatterKey: "dependencies" },
1023
+ { enabled: resolvedOptions.clearComments, optionKey: "comment", clearFlag: "--clear-comments", valueFlag: "--comment", values: resolvedOptions.comment, frontMatterKey: "comments" },
1024
+ { enabled: resolvedOptions.clearNotes, optionKey: "note", clearFlag: "--clear-notes", valueFlag: "--note", values: resolvedOptions.note, frontMatterKey: "notes" },
1025
+ { enabled: resolvedOptions.clearLearnings, optionKey: "learning", clearFlag: "--clear-learnings", valueFlag: "--learning", values: resolvedOptions.learning, frontMatterKey: "learnings" },
1026
+ { enabled: resolvedOptions.clearFiles, optionKey: "file", clearFlag: "--clear-files", valueFlag: "--file", values: resolvedOptions.file, frontMatterKey: "files" },
1027
+ { enabled: resolvedOptions.clearTests, optionKey: "test", clearFlag: "--clear-tests", valueFlag: "--test", values: resolvedOptions.test, frontMatterKey: "tests" },
1028
+ { enabled: resolvedOptions.clearDocs, optionKey: "doc", clearFlag: "--clear-docs", valueFlag: "--doc", values: resolvedOptions.doc, frontMatterKey: "docs" },
1029
+ { enabled: resolvedOptions.clearReminders, optionKey: "reminder", clearFlag: "--clear-reminders", valueFlag: "--reminder", values: resolvedOptions.reminder, frontMatterKey: "reminders" },
1030
+ { enabled: resolvedOptions.clearEvents, optionKey: "event", clearFlag: "--clear-events", valueFlag: "--event", values: resolvedOptions.event, frontMatterKey: "events" },
1031
+ { enabled: resolvedOptions.clearTypeOptions, optionKey: "typeOption", clearFlag: "--clear-type-options", valueFlag: "--type-option", values: resolvedOptions.typeOption, frontMatterKey: "type_options" },
955
1032
  ];
956
1033
  for (const definition of clearCollectionDefinitions) {
957
1034
  if (!definition.enabled) {
@@ -964,6 +1041,14 @@ export async function runCreate(options, global) {
964
1041
  explicitUnsets.add(definition.frontMatterKey);
965
1042
  clearOptionKeys.add(definition.optionKey);
966
1043
  }
1044
+ return { explicitUnsets, clearOptionKeys };
1045
+ }
1046
+ /**
1047
+ * Reject combining `--unset <field>` with the same field's scalar value flag
1048
+ * (for example `--unset goal --goal ...`) — the single-value analog of the
1049
+ * collection clear/value conflict enforced by {@link collectCreateClearTargets}.
1050
+ */
1051
+ function assertNoCreateScalarUnsetConflicts(resolvedOptions, unsetTargets) {
967
1052
  const scalarOptionPresence = {
968
1053
  tags: resolvedOptions.tags !== undefined,
969
1054
  deadline: resolvedOptions.deadline !== undefined,
@@ -1012,6 +1097,13 @@ export async function runCreate(options, global) {
1012
1097
  /* c8 ignore stop */
1013
1098
  throw new PmCliError(`Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel("create", optionKey)}`, EXIT_CODE.USAGE);
1014
1099
  }
1100
+ }
1101
+ /**
1102
+ * Reject the legacy literal `none`/`null` sentinel on any create scalar option,
1103
+ * pointing the author at the modern `--unset <field>` clear syntax (surfacing the
1104
+ * canonical unset key in the hint when the option maps to one).
1105
+ */
1106
+ function assertNoLegacyCreateScalarTokens(resolvedOptions) {
1015
1107
  const assertNoLegacyScalarToken = (value, optionKey) => {
1016
1108
  const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);
1017
1109
  const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : undefined;
@@ -1053,6 +1145,191 @@ export async function runCreate(options, global) {
1053
1145
  assertNoLegacyScalarToken(resolvedOptions.component, "component");
1054
1146
  assertNoLegacyScalarToken(resolvedOptions.regression, "regression");
1055
1147
  assertNoLegacyScalarToken(resolvedOptions.customerImpact, "customerImpact");
1148
+ }
1149
+ /**
1150
+ * Reject combining `--unset <field>` with an extension-registered or
1151
+ * runtime-schema field's value flag. These custom fields are validated
1152
+ * separately from the built-in scalar options but honor the same clear/value
1153
+ * mutual exclusion.
1154
+ */
1155
+ function assertNoCreateFieldUnsetConflicts(registeredItemFieldValues, runtimeCreateFieldValues, unsetTargets) {
1156
+ for (const fieldKey of Object.keys(registeredItemFieldValues)) {
1157
+ if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
1158
+ continue;
1159
+ }
1160
+ throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);
1161
+ }
1162
+ /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */
1163
+ for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {
1164
+ /* c8 ignore stop */
1165
+ if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
1166
+ continue;
1167
+ }
1168
+ throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with its value flag`, EXIT_CODE.USAGE);
1169
+ }
1170
+ }
1171
+ /**
1172
+ * Throw the aggregated `missing_required_option` error when a type's required
1173
+ * create options and/or required type-option keys were not all supplied in one
1174
+ * invocation. Builds a type-aware valid example and staged-onboarding next steps
1175
+ * (a strict-mode invocation also carries a compact recovery envelope). A no-op
1176
+ * when nothing is missing.
1177
+ */
1178
+ function assertNoMissingRequiredCreateOptions(params) {
1179
+ const { combinedMissingFlags, typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus, type, createMode } = params;
1180
+ if (combinedMissingFlags.length === 0) {
1181
+ return;
1182
+ }
1183
+ const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus);
1184
+ const nextSteps = [`Run "pm create --help --type ${type}" for type-aware required option guidance.`];
1185
+ if (combinedMissingFlags.includes("--title")) {
1186
+ nextSteps.push('Title can also be passed as the first positional argument (example: pm create "Your title" --type ' + type + ").");
1187
+ }
1188
+ if (createMode === "strict") {
1189
+ nextSteps.push('For staged onboarding, retry with "--create-mode progressive".');
1190
+ if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {
1191
+ nextSteps.push('For minimal scheduling inputs, try "--schedule-preset lightweight".');
1192
+ }
1193
+ }
1194
+ const errorMessage = combinedMissingFlags.length === 1
1195
+ ? `Missing required option ${combinedMissingFlags[0]} for type "${type}"`
1196
+ : `Missing required options ${combinedMissingFlags.join(", ")} for type "${type}"`;
1197
+ throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {
1198
+ code: "missing_required_option",
1199
+ required: `Provide all required create options and type options for type "${type}" in one invocation.`,
1200
+ examples: [nextValidExample],
1201
+ nextSteps,
1202
+ recovery: createMode === "strict"
1203
+ ? {
1204
+ recovery_mode: "compact",
1205
+ missing_required_fields: combinedMissingFlags,
1206
+ suggested_flags: ["--create-mode progressive", ...combinedMissingFlags],
1207
+ }
1208
+ : undefined,
1209
+ });
1210
+ }
1211
+ /**
1212
+ * Resolve the new item's tags: an empty list when `--unset tags` clears the
1213
+ * field (rejecting a contradictory `--add-tags`), otherwise the parsed `--tags`
1214
+ * merged with any additive `--add-tags`.
1215
+ */
1216
+ function resolveCreateTags(unsetKeys, resolvedOptions) {
1217
+ if (unsetKeys.has("tags") && Array.isArray(resolvedOptions.addTags) && resolvedOptions.addTags.length > 0) {
1218
+ throw new PmCliError("Cannot combine --unset tags with --add-tags", EXIT_CODE.USAGE);
1219
+ }
1220
+ const baseTags = unsetKeys.has("tags") ? [] : resolvedOptions.tags !== undefined ? parseTags(resolvedOptions.tags) : [];
1221
+ return mergeAdditiveTags(baseTags, resolvedOptions.addTags);
1222
+ }
1223
+ /**
1224
+ * Resolve the new item's integer `order`: `undefined` when cleared/absent, else
1225
+ * the parsed value. Rejects mismatched `--order`/`--rank` and non-integer values.
1226
+ */
1227
+ function resolveCreateOrder(unsetKeys, resolvedOptions) {
1228
+ if (resolvedOptions.order !== undefined && resolvedOptions.rank !== undefined && resolvedOptions.order !== resolvedOptions.rank) {
1229
+ throw new PmCliError("--order and --rank must match when both are provided", EXIT_CODE.USAGE);
1230
+ }
1231
+ const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;
1232
+ const order = resolveUnsettableTransformed(unsetKeys, "order", orderRaw, (raw) => parseOptionalNumber(raw, "order"));
1233
+ if (order !== undefined && !Number.isInteger(order)) {
1234
+ throw new PmCliError("Order must be an integer", EXIT_CODE.USAGE);
1235
+ }
1236
+ return order;
1237
+ }
1238
+ /**
1239
+ * Resolve the close reason for an item created directly in the close status
1240
+ * (GH-249): honor `governance.require_close_reason` like `pm close`, deriving it
1241
+ * from `--message` > `--resolution` and falling back to a stable placeholder,
1242
+ * warning `close_reason_defaulted` when neither was supplied. Returns `undefined`
1243
+ * (and no warnings) when the item is not being created closed or the policy is
1244
+ * off.
1245
+ */
1246
+ function resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution) {
1247
+ if (status !== statusRegistry.close_status || !settings.governance.require_close_reason) {
1248
+ return { closeReason: undefined, warnings: [] };
1249
+ }
1250
+ const messageText = typeof resolvedOptions.message === "string" ? resolvedOptions.message.trim() : "";
1251
+ const resolutionText = typeof resolution === "string" ? resolution.trim() : "";
1252
+ const closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;
1253
+ const warnings = messageText.length === 0 && resolutionText.length === 0 ? ["close_reason_defaulted"] : [];
1254
+ return { closeReason, warnings };
1255
+ }
1256
+ /**
1257
+ * Commit a freshly built item under its per-id lock: write the serialized
1258
+ * document, append the create history entry (rolling back the item file if the
1259
+ * history append throws), run the item + history `onWrite` hooks, and record the
1260
+ * after-command affected item. Returns the collected hook warnings; the lock is
1261
+ * always released.
1262
+ */
1263
+ async function writeCreatedItem(params) {
1264
+ const { pmRoot, type, id, settings, typeRegistry, author, extensionFieldNames, afterDocument, beforeDocument, historyMessage, changedFields, nowValue } = params;
1265
+ const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
1266
+ const historyPath = getHistoryPath(pmRoot, id);
1267
+ const lockRelease = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
1268
+ let hookWarnings = [];
1269
+ try {
1270
+ await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: settings.item_format, schema: settings.schema, extensionFieldNames }));
1271
+ try {
1272
+ const entry = createHistoryEntry({ nowIso: nowValue, author, op: "create", before: beforeDocument, after: afterDocument, message: historyMessage });
1273
+ await appendHistoryEntry(historyPath, entry);
1274
+ }
1275
+ catch (error) {
1276
+ await removeFileIfExists(itemPath);
1277
+ throw error;
1278
+ }
1279
+ hookWarnings = [
1280
+ ...(await runActiveOnWriteHooks({
1281
+ path: itemPath,
1282
+ scope: "project",
1283
+ op: "create",
1284
+ item_id: afterDocument.metadata.id,
1285
+ item_type: afterDocument.metadata.type,
1286
+ before: beforeDocument,
1287
+ after: afterDocument,
1288
+ changed_fields: changedFields,
1289
+ })),
1290
+ ...(await runActiveOnWriteHooks({
1291
+ path: historyPath,
1292
+ scope: "project",
1293
+ op: "create:history",
1294
+ item_id: afterDocument.metadata.id,
1295
+ item_type: afterDocument.metadata.type,
1296
+ before: beforeDocument,
1297
+ after: afterDocument,
1298
+ changed_fields: changedFields,
1299
+ })),
1300
+ ];
1301
+ recordAfterCommandAffectedItem({
1302
+ id: afterDocument.metadata.id,
1303
+ op: "create",
1304
+ item_type: afterDocument.metadata.type,
1305
+ status: afterDocument.metadata.status,
1306
+ current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),
1307
+ changed_fields: changedFields,
1308
+ });
1309
+ }
1310
+ finally {
1311
+ await lockRelease();
1312
+ }
1313
+ return hookWarnings;
1314
+ }
1315
+ /**
1316
+ * Implements run create for the public runtime surface of this module.
1317
+ */
1318
+ export async function runCreate(options, global) {
1319
+ let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));
1320
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
1321
+ await ensureInitHasRun(pmRoot);
1322
+ const settings = await readSettings(pmRoot);
1323
+ const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1324
+ const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
1325
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1326
+ const typeSelection = await resolveCreateTypeSelection(resolvedOptions, global, pmRoot, settings, typeRegistry);
1327
+ resolvedOptions = typeSelection.resolvedOptions;
1328
+ const { typeDefinition, type, createMode } = typeSelection;
1329
+ const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);
1330
+ const { explicitUnsets, clearOptionKeys } = collectCreateClearTargets(resolvedOptions, unsetTargets);
1331
+ assertNoCreateScalarUnsetConflicts(resolvedOptions, unsetTargets);
1332
+ assertNoLegacyCreateScalarTokens(resolvedOptions);
1056
1333
  const missingRequiredCreateFlags = requireCreateOptionByType(typeDefinition, resolvedOptions, createMode, clearOptionKeys);
1057
1334
  const nowValue = nowIso();
1058
1335
  const author = selectAuthor(resolvedOptions.author, settings.author_default);
@@ -1070,21 +1347,8 @@ export async function runCreate(options, global) {
1070
1347
  const extensionRegistrations = getActiveExtensionRegistrations();
1071
1348
  const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);
1072
1349
  const registeredItemFieldValues = parseRegisteredItemFieldAssignments(resolvedOptions.field, extensionRegistrations);
1073
- for (const fieldKey of Object.keys(registeredItemFieldValues)) {
1074
- if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
1075
- continue;
1076
- }
1077
- throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);
1078
- }
1079
1350
  const runtimeCreateFieldValues = collectRuntimeCreateFieldValues(resolvedOptions, runtimeFieldRegistry, type);
1080
- /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */
1081
- for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {
1082
- /* c8 ignore stop */
1083
- if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
1084
- continue;
1085
- }
1086
- throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with its value flag`, EXIT_CODE.USAGE);
1087
- }
1351
+ assertNoCreateFieldUnsetConflicts(registeredItemFieldValues, runtimeCreateFieldValues, unsetTargets);
1088
1352
  const missingRequiredTypeOptionKeys = collectMissingRequiredTypeOptionKeys(validatedTypeOptions.errors, type);
1089
1353
  const missingRequiredTypeOptionFlags = missingRequiredTypeOptionKeys.map((key) => `--type-option ${key}=<value>`);
1090
1354
  const combinedMissingFlags = [
@@ -1095,35 +1359,15 @@ export async function runCreate(options, global) {
1095
1359
  ...runtimeCreateFieldValues.missing_required_flags,
1096
1360
  ]),
1097
1361
  ].sort((left, right) => left.localeCompare(right));
1098
- if (combinedMissingFlags.length > 0) {
1099
- const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, statusRegistry.open_status);
1100
- const nextSteps = [`Run "pm create --help --type ${type}" for type-aware required option guidance.`];
1101
- if (combinedMissingFlags.includes("--title")) {
1102
- nextSteps.push('Title can also be passed as the first positional argument (example: pm create "Your title" --type ' + type + ').');
1103
- }
1104
- if (createMode === "strict") {
1105
- nextSteps.push('For staged onboarding, retry with "--create-mode progressive".');
1106
- if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {
1107
- nextSteps.push('For minimal scheduling inputs, try "--schedule-preset lightweight".');
1108
- }
1109
- }
1110
- const errorMessage = combinedMissingFlags.length === 1
1111
- ? `Missing required option ${combinedMissingFlags[0]} for type "${type}"`
1112
- : `Missing required options ${combinedMissingFlags.join(", ")} for type "${type}"`;
1113
- throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {
1114
- code: "missing_required_option",
1115
- required: `Provide all required create options and type options for type "${type}" in one invocation.`,
1116
- examples: [nextValidExample],
1117
- nextSteps,
1118
- recovery: createMode === "strict"
1119
- ? {
1120
- recovery_mode: "compact",
1121
- missing_required_fields: combinedMissingFlags,
1122
- suggested_flags: ["--create-mode progressive", ...combinedMissingFlags],
1123
- }
1124
- : undefined,
1125
- });
1126
- }
1362
+ assertNoMissingRequiredCreateOptions({
1363
+ combinedMissingFlags,
1364
+ typeDefinition,
1365
+ missingRequiredCreateFlags,
1366
+ missingRequiredTypeOptionKeys,
1367
+ openStatus: statusRegistry.open_status,
1368
+ type,
1369
+ createMode,
1370
+ });
1127
1371
  const nonMissingTypeOptionErrors = filterNonMissingTypeOptionErrors(validatedTypeOptions.errors, type);
1128
1372
  if (nonMissingTypeOptionErrors.length > 0) {
1129
1373
  const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, [], [], statusRegistry.open_status);
@@ -1139,236 +1383,86 @@ export async function runCreate(options, global) {
1139
1383
  ? parseStatusValue(resolvedOptions.status, statusRegistry)
1140
1384
  : resolveCreateDefaultStatus(typeDefinition, statusRegistry);
1141
1385
  const priority = resolvedOptions.priority !== undefined ? ensurePriority(resolvedOptions.priority) : 2;
1142
- // `--unset tags` clears the field; combining it with `--add-tags` is the same
1143
- // contradiction that `--unset tags --tags ...` already rejects, so reject it
1144
- // here rather than silently letting the additions win over the clear.
1145
- if (unsetTargets.frontMatterKeys.has("tags") &&
1146
- Array.isArray(resolvedOptions.addTags) &&
1147
- resolvedOptions.addTags.length > 0) {
1148
- throw new PmCliError("Cannot combine --unset tags with --add-tags", EXIT_CODE.USAGE);
1149
- }
1150
- const baseTags = unsetTargets.frontMatterKeys.has("tags")
1151
- ? []
1152
- : resolvedOptions.tags !== undefined
1153
- ? parseTags(resolvedOptions.tags)
1154
- : [];
1155
- const tags = mergeAdditiveTags(baseTags, resolvedOptions.addTags);
1156
- const deadline = unsetTargets.frontMatterKeys.has("deadline")
1157
- ? undefined
1158
- : resolvedOptions.deadline === undefined
1159
- ? undefined
1160
- : resolveIsoOrRelative(resolvedOptions.deadline, new Date(nowValue), "deadline");
1161
- const estimatedMinutes = unsetTargets.frontMatterKeys.has("estimated_minutes")
1162
- ? undefined
1163
- : resolvedOptions.estimatedMinutes === undefined
1164
- ? undefined
1165
- : parseOptionalNumber(resolvedOptions.estimatedMinutes, "estimated-minutes");
1166
- const acceptanceCriteria = unsetTargets.frontMatterKeys.has("acceptance_criteria")
1167
- ? undefined
1168
- : resolvedOptions.acceptanceCriteria === undefined
1169
- ? undefined
1170
- : resolvedOptions.acceptanceCriteria;
1171
- const definitionOfReady = unsetTargets.frontMatterKeys.has("definition_of_ready") || resolvedOptions.definitionOfReady === undefined
1172
- ? undefined
1173
- : parseOptionalString(resolvedOptions.definitionOfReady);
1174
- if (resolvedOptions.order !== undefined &&
1175
- resolvedOptions.rank !== undefined &&
1176
- resolvedOptions.order !== resolvedOptions.rank) {
1177
- throw new PmCliError("--order and --rank must match when both are provided", EXIT_CODE.USAGE);
1178
- }
1179
- const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;
1180
- const order = unsetTargets.frontMatterKeys.has("order") || orderRaw === undefined ? undefined : parseOptionalNumber(orderRaw, "order");
1181
- if (order !== undefined && !Number.isInteger(order)) {
1182
- throw new PmCliError("Order must be an integer", EXIT_CODE.USAGE);
1183
- }
1184
- const goal = unsetTargets.frontMatterKeys.has("goal") || resolvedOptions.goal === undefined ? undefined : parseOptionalString(resolvedOptions.goal);
1185
- const objective = unsetTargets.frontMatterKeys.has("objective") || resolvedOptions.objective === undefined
1186
- ? undefined
1187
- : parseOptionalString(resolvedOptions.objective);
1188
- const value = unsetTargets.frontMatterKeys.has("value") || resolvedOptions.value === undefined
1189
- ? undefined
1190
- : parseOptionalString(resolvedOptions.value);
1191
- const impact = unsetTargets.frontMatterKeys.has("impact") || resolvedOptions.impact === undefined
1192
- ? undefined
1193
- : parseOptionalString(resolvedOptions.impact);
1194
- const outcome = unsetTargets.frontMatterKeys.has("outcome") || resolvedOptions.outcome === undefined
1195
- ? undefined
1196
- : parseOptionalString(resolvedOptions.outcome);
1197
- const whyNow = unsetTargets.frontMatterKeys.has("why_now") || resolvedOptions.whyNow === undefined
1198
- ? undefined
1199
- : parseOptionalString(resolvedOptions.whyNow);
1200
- const assignee = unsetTargets.frontMatterKeys.has("assignee") || resolvedOptions.assignee === undefined
1201
- ? undefined
1202
- : parseOptionalString(resolvedOptions.assignee);
1203
- const authorValue = unsetTargets.frontMatterKeys.has("author")
1204
- ? undefined
1205
- : parseOptionalString(resolvedOptions.author) ?? author;
1206
- let parent = unsetTargets.frontMatterKeys.has("parent") || resolvedOptions.parent === undefined
1207
- ? undefined
1208
- : parseOptionalString(resolvedOptions.parent);
1209
- // GH-161 (pm-72xf): when no explicit --parent was given (and parent is not
1210
- // being unset), default the parent to the session "focused" item set via
1211
- // `pm focus <id>`. An explicit --parent (even `--parent ""` to unset)
1212
- // overrides focus. The inherited value flows through the same locateItem /
1213
- // validateMissingParentReference path below, so a stale focus produces the
1214
- // same clear missing-parent error/warning as an explicit stale --parent.
1215
- let parentSource;
1216
- if (parent === undefined &&
1217
- !unsetTargets.frontMatterKeys.has("parent") &&
1218
- resolvedOptions.parent === undefined) {
1219
- const focused = await getFocusedItem(pmRoot);
1220
- if (focused !== undefined) {
1221
- parent = focused;
1222
- parentSource = "focus";
1223
- }
1224
- }
1225
- const reviewer = unsetTargets.frontMatterKeys.has("reviewer") || resolvedOptions.reviewer === undefined
1226
- ? undefined
1227
- : parseOptionalString(resolvedOptions.reviewer);
1228
- const riskRaw = unsetTargets.frontMatterKeys.has("risk") || resolvedOptions.risk === undefined
1229
- ? undefined
1230
- : parseOptionalString(resolvedOptions.risk);
1231
- const risk = riskRaw !== undefined ? ensureEnumValue(normalizeRiskInput(riskRaw), RISK_VALUES, "risk") : undefined;
1232
- const confidenceRaw = unsetTargets.frontMatterKeys.has("confidence") || resolvedOptions.confidence === undefined
1233
- ? undefined
1234
- : parseOptionalString(resolvedOptions.confidence);
1235
- const confidence = confidenceRaw !== undefined ? parseConfidenceInput(confidenceRaw) : undefined;
1386
+ const unsetKeys = unsetTargets.frontMatterKeys;
1387
+ const tags = resolveCreateTags(unsetKeys, resolvedOptions);
1388
+ const deadline = resolveUnsettableTransformed(unsetKeys, "deadline", resolvedOptions.deadline, (raw) => resolveIsoOrRelative(raw, new Date(nowValue), "deadline"));
1389
+ const estimatedMinutes = resolveUnsettableTransformed(unsetKeys, "estimated_minutes", resolvedOptions.estimatedMinutes, (raw) => parseOptionalNumber(raw, "estimated-minutes"));
1390
+ const acceptanceCriteria = resolveUnsettableOptionalString(unsetKeys, "acceptance_criteria", resolvedOptions.acceptanceCriteria);
1391
+ const definitionOfReady = resolveUnsettableOptionalString(unsetKeys, "definition_of_ready", resolvedOptions.definitionOfReady);
1392
+ const order = resolveCreateOrder(unsetKeys, resolvedOptions);
1393
+ const goal = resolveUnsettableOptionalString(unsetKeys, "goal", resolvedOptions.goal);
1394
+ const objective = resolveUnsettableOptionalString(unsetKeys, "objective", resolvedOptions.objective);
1395
+ const value = resolveUnsettableOptionalString(unsetKeys, "value", resolvedOptions.value);
1396
+ const impact = resolveUnsettableOptionalString(unsetKeys, "impact", resolvedOptions.impact);
1397
+ const outcome = resolveUnsettableOptionalString(unsetKeys, "outcome", resolvedOptions.outcome);
1398
+ const whyNow = resolveUnsettableOptionalString(unsetKeys, "why_now", resolvedOptions.whyNow);
1399
+ const assignee = resolveUnsettableOptionalString(unsetKeys, "assignee", resolvedOptions.assignee);
1400
+ const authorValue = unsetKeys.has("author") ? undefined : parseOptionalString(resolvedOptions.author) ?? author;
1401
+ // GH-161 (pm-72xf): inherit the session-focused parent when no explicit
1402
+ // --parent was supplied and parent is not being unset; an explicit --parent
1403
+ // (including `--parent ""`) overrides focus. The inherited value flows through
1404
+ // the same locate/validate path below as an explicit parent.
1405
+ const initialParent = resolveUnsettableOptionalString(unsetKeys, "parent", resolvedOptions.parent);
1406
+ const inheritedParent = await inheritFocusedParent(initialParent, resolvedOptions, unsetKeys, pmRoot);
1407
+ let parent = inheritedParent.parent;
1408
+ const parentSource = inheritedParent.parentSource;
1409
+ const reviewer = resolveUnsettableOptionalString(unsetKeys, "reviewer", resolvedOptions.reviewer);
1410
+ const risk = resolveUnsettableTransformed(unsetKeys, "risk", resolvedOptions.risk, (raw) => ensureEnumValue(normalizeRiskInput(raw), RISK_VALUES, "risk"));
1411
+ const confidence = resolveUnsettableTransformed(unsetKeys, "confidence", resolvedOptions.confidence, (raw) => parseConfidenceInput(raw));
1236
1412
  const parentReferencePolicy = resolvedOptions.allowMissingParent === true && settings.validation.parent_reference === "strict_error"
1237
1413
  ? "warn"
1238
1414
  : settings.validation.parent_reference;
1239
1415
  const sprintReleasePolicy = settings.validation.sprint_release_format;
1240
- const validationWarnings = [];
1241
- // Event-type items with no attached schedule never surface on the calendar; warn (never block).
1242
- if (type.toLowerCase() === "event" && (events.values === undefined || events.values.length === 0)) {
1243
- validationWarnings.push(`event_without_schedule:${id}:no_time_set`);
1244
- }
1245
- // Calendar-relevant types (Milestone, Meeting, Reminder, Event) with NO deadline AND no
1246
- // reminders AND no events are invisible on `pm calendar`. Warn (never block) so the agent
1247
- // can attach a schedule via `pm update`.
1248
- const calendarRelevantTypes = new Set(["milestone", "meeting", "reminder", "event"]);
1249
- const hasDeadline = deadline !== undefined;
1250
- const hasReminders = reminders.values !== undefined && reminders.values.length > 0;
1251
- const hasEvents = events.values !== undefined && events.values.length > 0;
1252
- if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {
1253
- // Keep the structured `calendar_item_without_schedule:<id>:<code>` prefix
1254
- // stable (automation/telemetry match on it) and append the actionable hint
1255
- // after the token (pm-2cgu / GH-174).
1256
- validationWarnings.push(`calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event (hint: set --deadline <ISO> or --reminder "<when>", or link an Event via --event "start=<ISO>,end=<ISO>"; otherwise this item never appears on pm calendar)`);
1257
- }
1416
+ const validationWarnings = collectCreateScheduleWarnings(type, id, deadline, reminders.values, events.values);
1258
1417
  if (parent !== undefined) {
1259
- parent = normalizeParentReferenceValue(parent);
1260
- const parentLocated = await locateItem(pmRoot, parent, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
1261
- if (!parentLocated) {
1262
- const normalizedParentId = normalizeItemId(parent, settings.id_prefix);
1263
- validationWarnings.push(...validateMissingParentReference(normalizedParentId, parentReferencePolicy).warnings);
1264
- }
1265
- }
1266
- let sprint = unsetTargets.frontMatterKeys.has("sprint") || resolvedOptions.sprint === undefined
1267
- ? undefined
1268
- : parseOptionalString(resolvedOptions.sprint);
1269
- if (sprint !== undefined) {
1270
- const sprintValidation = validateSprintOrReleaseValue("sprint", sprint, sprintReleasePolicy);
1271
- sprint = sprintValidation.value;
1272
- validationWarnings.push(...sprintValidation.warnings);
1273
- }
1274
- let release = unsetTargets.frontMatterKeys.has("release") || resolvedOptions.release === undefined
1275
- ? undefined
1276
- : parseOptionalString(resolvedOptions.release);
1277
- if (release !== undefined) {
1278
- const releaseValidation = validateSprintOrReleaseValue("release", release, sprintReleasePolicy);
1279
- release = releaseValidation.value;
1280
- validationWarnings.push(...releaseValidation.warnings);
1281
- }
1282
- const blockedBy = unsetTargets.frontMatterKeys.has("blocked_by") || resolvedOptions.blockedBy === undefined
1283
- ? undefined
1284
- : parseOptionalString(resolvedOptions.blockedBy);
1285
- let dependencyValues = dependencies.values;
1286
- if (blockedBy !== undefined) {
1287
- const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);
1288
- const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
1289
- if (blockedByLocated) {
1290
- const hasBlockedByDependency = (dependencyValues ?? []).some((dependency) => dependency.id === blockedByLocated.id && dependency.kind === "blocked_by");
1291
- if (!hasBlockedByDependency) {
1292
- dependencyValues = [
1293
- ...(dependencyValues ?? []),
1294
- {
1295
- id: blockedByLocated.id,
1296
- kind: "blocked_by",
1297
- created_at: nowValue,
1298
- author,
1299
- },
1300
- ];
1301
- }
1302
- if (resolvedOptions.status === undefined) {
1303
- status = statusRegistry.blocked_statuses.has("blocked")
1304
- ? "blocked"
1305
- : [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;
1306
- }
1307
- }
1308
- }
1309
- const blockedReason = unsetTargets.frontMatterKeys.has("blocked_reason") || resolvedOptions.blockedReason === undefined
1310
- ? undefined
1311
- : parseOptionalString(resolvedOptions.blockedReason);
1312
- const unblockNote = unsetTargets.frontMatterKeys.has("unblock_note") || resolvedOptions.unblockNote === undefined
1313
- ? undefined
1314
- : parseOptionalString(resolvedOptions.unblockNote);
1315
- const reporter =
1316
- /* c8 ignore next -- reporter normalization branch is covered in issue-template integration tests. */
1317
- unsetTargets.frontMatterKeys.has("reporter") || resolvedOptions.reporter === undefined
1318
- ? undefined
1319
- : parseOptionalString(resolvedOptions.reporter);
1320
- const severityRaw = unsetTargets.frontMatterKeys.has("severity") || resolvedOptions.severity === undefined
1321
- ? undefined
1322
- : parseOptionalString(resolvedOptions.severity);
1323
- const severity = severityRaw !== undefined ? ensureEnumValue(normalizeSeverityInput(severityRaw), ISSUE_SEVERITY_VALUES, "severity") : undefined;
1324
- const environment = unsetTargets.frontMatterKeys.has("environment") || resolvedOptions.environment === undefined
1325
- ? undefined
1326
- : parseOptionalString(resolvedOptions.environment);
1327
- const reproSteps = unsetTargets.frontMatterKeys.has("repro_steps") || resolvedOptions.reproSteps === undefined
1328
- ? undefined
1329
- : parseOptionalString(resolvedOptions.reproSteps);
1330
- const resolution = unsetTargets.frontMatterKeys.has("resolution") || resolvedOptions.resolution === undefined
1331
- ? undefined
1332
- : parseOptionalString(resolvedOptions.resolution);
1333
- const expectedResult = unsetTargets.frontMatterKeys.has("expected_result") || resolvedOptions.expectedResult === undefined
1334
- ? undefined
1335
- : parseOptionalString(resolvedOptions.expectedResult);
1336
- const actualResult = unsetTargets.frontMatterKeys.has("actual_result") || resolvedOptions.actualResult === undefined
1337
- ? undefined
1338
- : parseOptionalString(resolvedOptions.actualResult);
1339
- const affectedVersion = unsetTargets.frontMatterKeys.has("affected_version") || resolvedOptions.affectedVersion === undefined
1340
- ? undefined
1341
- : parseOptionalString(resolvedOptions.affectedVersion);
1342
- const fixedVersion = unsetTargets.frontMatterKeys.has("fixed_version") || resolvedOptions.fixedVersion === undefined
1343
- ? undefined
1344
- : parseOptionalString(resolvedOptions.fixedVersion);
1345
- const component = unsetTargets.frontMatterKeys.has("component") || resolvedOptions.component === undefined
1346
- ? undefined
1347
- : parseOptionalString(resolvedOptions.component);
1348
- const regressionRaw = unsetTargets.frontMatterKeys.has("regression") || resolvedOptions.regression === undefined
1349
- ? undefined
1350
- : parseOptionalString(resolvedOptions.regression);
1351
- const regression = regressionRaw !== undefined ? parseRegressionInput(regressionRaw) : undefined;
1352
- const customerImpact = unsetTargets.frontMatterKeys.has("customer_impact") || resolvedOptions.customerImpact === undefined
1353
- ? undefined
1354
- : parseOptionalString(resolvedOptions.customerImpact);
1418
+ const parentValidation = await validateCreateParentReference(pmRoot, settings, typeRegistry, parent, parentReferencePolicy);
1419
+ parent = parentValidation.parent;
1420
+ validationWarnings.push(...parentValidation.warnings);
1421
+ }
1422
+ const sprintResolved = resolveCreateSprintOrRelease(unsetKeys, "sprint", resolvedOptions.sprint, "sprint", sprintReleasePolicy);
1423
+ const sprint = sprintResolved.value;
1424
+ validationWarnings.push(...sprintResolved.warnings);
1425
+ const releaseResolved = resolveCreateSprintOrRelease(unsetKeys, "release", resolvedOptions.release, "release", sprintReleasePolicy);
1426
+ const release = releaseResolved.value;
1427
+ validationWarnings.push(...releaseResolved.warnings);
1428
+ const blockedBy = resolveUnsettableOptionalString(unsetKeys, "blocked_by", resolvedOptions.blockedBy);
1429
+ const blockedByResolution = await resolveCreateBlockedByDependency({
1430
+ pmRoot,
1431
+ settings,
1432
+ typeRegistry,
1433
+ statusRegistry,
1434
+ blockedBy,
1435
+ dependencyValues: dependencies.values,
1436
+ status,
1437
+ statusExplicit: resolvedOptions.status !== undefined,
1438
+ nowValue,
1439
+ author,
1440
+ });
1441
+ const dependencyValues = blockedByResolution.dependencyValues;
1442
+ status = blockedByResolution.status;
1443
+ const blockedReason = resolveUnsettableOptionalString(unsetKeys, "blocked_reason", resolvedOptions.blockedReason);
1444
+ const unblockNote = resolveUnsettableOptionalString(unsetKeys, "unblock_note", resolvedOptions.unblockNote);
1445
+ const reporter = resolveUnsettableOptionalString(unsetKeys, "reporter", resolvedOptions.reporter);
1446
+ const severity = resolveUnsettableTransformed(unsetKeys, "severity", resolvedOptions.severity, (raw) => ensureEnumValue(normalizeSeverityInput(raw), ISSUE_SEVERITY_VALUES, "severity"));
1447
+ const environment = resolveUnsettableOptionalString(unsetKeys, "environment", resolvedOptions.environment);
1448
+ const reproSteps = resolveUnsettableOptionalString(unsetKeys, "repro_steps", resolvedOptions.reproSteps);
1449
+ const resolution = resolveUnsettableOptionalString(unsetKeys, "resolution", resolvedOptions.resolution);
1450
+ const expectedResult = resolveUnsettableOptionalString(unsetKeys, "expected_result", resolvedOptions.expectedResult);
1451
+ const actualResult = resolveUnsettableOptionalString(unsetKeys, "actual_result", resolvedOptions.actualResult);
1452
+ const affectedVersion = resolveUnsettableOptionalString(unsetKeys, "affected_version", resolvedOptions.affectedVersion);
1453
+ const fixedVersion = resolveUnsettableOptionalString(unsetKeys, "fixed_version", resolvedOptions.fixedVersion);
1454
+ const component = resolveUnsettableOptionalString(unsetKeys, "component", resolvedOptions.component);
1455
+ const regression = resolveUnsettableTransformed(unsetKeys, "regression", resolvedOptions.regression, (raw) => parseRegressionInput(raw));
1456
+ const customerImpact = resolveUnsettableOptionalString(unsetKeys, "customer_impact", resolvedOptions.customerImpact);
1355
1457
  const title = requireStringOption(resolvedOptions.title, "--title");
1356
1458
  const description = resolvedOptions.description ?? "";
1357
1459
  const body = resolvedOptions.body ?? "";
1358
1460
  // GH-249: creating an item directly in the close status must honor
1359
1461
  // governance.require_close_reason, just like `pm close` (errors when missing)
1360
- // and `pm update --status closed` (defaults + warns). Record a close_reason
1361
- // derived from --message > --resolution, else a stable placeholder, and warn
1362
- // when defaulted so the create path stops silently bypassing governance.
1363
- let closeReason;
1364
- if (status === statusRegistry.close_status && settings.governance.require_close_reason) {
1365
- const messageText = typeof resolvedOptions.message === "string" ? resolvedOptions.message.trim() : "";
1366
- const resolutionText = typeof resolution === "string" ? resolution.trim() : "";
1367
- closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;
1368
- if (messageText.length === 0 && resolutionText.length === 0) {
1369
- validationWarnings.push("close_reason_defaulted");
1370
- }
1371
- }
1462
+ // and `pm update --status closed` (defaults + warns).
1463
+ const closeReasonResolution = resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution);
1464
+ const closeReason = closeReasonResolution.closeReason;
1465
+ validationWarnings.push(...closeReasonResolution.warnings);
1372
1466
  const frontMatter = normalizeFrontMatter({
1373
1467
  id,
1374
1468
  title,
@@ -1443,9 +1537,6 @@ export async function runCreate(options, global) {
1443
1537
  metadata: {},
1444
1538
  body: "",
1445
1539
  };
1446
- const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
1447
- const historyPath = getHistoryPath(pmRoot, id);
1448
- const lockRelease = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
1449
1540
  const explicitUnsetKeys = [...explicitUnsets].sort((left, right) => left.localeCompare(right));
1450
1541
  const historyMessage = buildHistoryMessage(resolvedOptions.message, explicitUnsetKeys);
1451
1542
  const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys, [
@@ -1454,62 +1545,20 @@ export async function runCreate(options, global) {
1454
1545
  ...Object.keys(runtimeCreateFieldValues.values ?? {}),
1455
1546
  /* c8 ignore stop */
1456
1547
  ]);
1457
- let hookWarnings = [];
1458
- try {
1459
- await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, {
1460
- format: settings.item_format,
1461
- schema: settings.schema,
1462
- extensionFieldNames,
1463
- }));
1464
- try {
1465
- const entry = createHistoryEntry({
1466
- nowIso: nowValue,
1467
- author,
1468
- op: "create",
1469
- before: beforeDocument,
1470
- after: afterDocument,
1471
- message: historyMessage,
1472
- });
1473
- await appendHistoryEntry(historyPath, entry);
1474
- }
1475
- catch (error) {
1476
- await removeFileIfExists(itemPath);
1477
- throw error;
1478
- }
1479
- hookWarnings = [
1480
- ...(await runActiveOnWriteHooks({
1481
- path: itemPath,
1482
- scope: "project",
1483
- op: "create",
1484
- item_id: afterDocument.metadata.id,
1485
- item_type: afterDocument.metadata.type,
1486
- before: beforeDocument,
1487
- after: afterDocument,
1488
- changed_fields: changedFields,
1489
- })),
1490
- ...(await runActiveOnWriteHooks({
1491
- path: historyPath,
1492
- scope: "project",
1493
- op: "create:history",
1494
- item_id: afterDocument.metadata.id,
1495
- item_type: afterDocument.metadata.type,
1496
- before: beforeDocument,
1497
- after: afterDocument,
1498
- changed_fields: changedFields,
1499
- })),
1500
- ];
1501
- recordAfterCommandAffectedItem({
1502
- id: afterDocument.metadata.id,
1503
- op: "create",
1504
- item_type: afterDocument.metadata.type,
1505
- status: afterDocument.metadata.status,
1506
- current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),
1507
- changed_fields: changedFields,
1508
- });
1509
- }
1510
- finally {
1511
- await lockRelease();
1512
- }
1548
+ const hookWarnings = await writeCreatedItem({
1549
+ pmRoot,
1550
+ type,
1551
+ id,
1552
+ settings,
1553
+ typeRegistry,
1554
+ author,
1555
+ extensionFieldNames,
1556
+ afterDocument,
1557
+ beforeDocument,
1558
+ historyMessage,
1559
+ changedFields,
1560
+ nowValue,
1561
+ });
1513
1562
  const outputItem = structuredClone(frontMatter);
1514
1563
  // GH-216: nudge agents toward the underutilized in_progress state instead of
1515
1564
  // jumping open -> closed. Only surfaces for workable types created in the open
@@ -1520,7 +1569,7 @@ export async function runCreate(options, global) {
1520
1569
  // calendar`. The structured `calendar_item_without_schedule:*` warning above is what
1521
1570
  // automation reads; this stderr line is the human/agent-facing version with a
1522
1571
  // copy-pasteable `pm update` recipe.
1523
- if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {
1572
+ if (createItemLacksSchedule(type, deadline, reminders.values, events.values)) {
1524
1573
  printError(`[pm] warning: ${type} '${id}' has no deadline/reminder/event — it will not appear on the calendar. Add one via 'pm update ${id} --deadline <ISO>' or 'pm update ${id} --event "start=<ISO>,end=<ISO>"'.`);
1525
1574
  }
1526
1575
  return {
@@ -1552,4 +1601,4 @@ export const _testOnlyCreateCommand = {
1552
1601
  typeOptionExampleValue,
1553
1602
  };
1554
1603
  //# sourceMappingURL=create.js.map
1555
- //# debugId=aa70c8da-5e95-5356-b118-cc0dcc4d1835
1604
+ //# debugId=39253884-2bdf-54e5-9cf2-6ac279638287