@unbrained/pm-cli 2026.5.31 → 2026.6.5

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 (586) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/dist/cli/argv-utils.js +7 -3
  3. package/dist/cli/argv-utils.js.map +1 -1
  4. package/dist/cli/bootstrap-args.d.ts +1 -0
  5. package/dist/cli/bootstrap-args.js +23 -3
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +17 -3
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close-many.d.ts +63 -0
  10. package/dist/cli/commands/close-many.js +302 -0
  11. package/dist/cli/commands/close-many.js.map +1 -0
  12. package/dist/cli/commands/completion.d.ts +1 -0
  13. package/dist/cli/commands/completion.js +241 -27
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +4 -4
  16. package/dist/cli/commands/config.js +115 -3
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/contracts.js +191 -162
  19. package/dist/cli/commands/contracts.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +1 -0
  21. package/dist/cli/commands/create.js +77 -114
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/extension/doctor.d.ts +12 -0
  24. package/dist/cli/commands/extension/doctor.js +97 -2
  25. package/dist/cli/commands/extension/doctor.js.map +1 -1
  26. package/dist/cli/commands/extension/scaffold.js +49 -48
  27. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  28. package/dist/cli/commands/extension.js +51 -23
  29. package/dist/cli/commands/extension.js.map +1 -1
  30. package/dist/cli/commands/get.js +7 -7
  31. package/dist/cli/commands/get.js.map +1 -1
  32. package/dist/cli/commands/health.js +38 -3
  33. package/dist/cli/commands/health.js.map +1 -1
  34. package/dist/cli/commands/index.d.ts +2 -1
  35. package/dist/cli/commands/index.js +4 -3
  36. package/dist/cli/commands/index.js.map +1 -1
  37. package/dist/cli/commands/init.d.ts +10 -0
  38. package/dist/cli/commands/init.js +107 -4
  39. package/dist/cli/commands/init.js.map +1 -1
  40. package/dist/cli/commands/list.d.ts +5 -0
  41. package/dist/cli/commands/list.js +58 -26
  42. package/dist/cli/commands/list.js.map +1 -1
  43. package/dist/cli/commands/reindex.js +163 -47
  44. package/dist/cli/commands/reindex.js.map +1 -1
  45. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  46. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  47. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  48. package/dist/cli/commands/restore.js +25 -4
  49. package/dist/cli/commands/restore.js.map +1 -1
  50. package/dist/cli/commands/schema.d.ts +122 -1
  51. package/dist/cli/commands/schema.js +536 -6
  52. package/dist/cli/commands/schema.js.map +1 -1
  53. package/dist/cli/commands/search.d.ts +1 -0
  54. package/dist/cli/commands/search.js +18 -4
  55. package/dist/cli/commands/search.js.map +1 -1
  56. package/dist/cli/commands/test.js +4 -3
  57. package/dist/cli/commands/test.js.map +1 -1
  58. package/dist/cli/commands/update-many.js +69 -140
  59. package/dist/cli/commands/update-many.js.map +1 -1
  60. package/dist/cli/commands/update.d.ts +2 -0
  61. package/dist/cli/commands/update.js +138 -119
  62. package/dist/cli/commands/update.js.map +1 -1
  63. package/dist/cli/commands/validate.d.ts +1 -0
  64. package/dist/cli/commands/validate.js +63 -33
  65. package/dist/cli/commands/validate.js.map +1 -1
  66. package/dist/cli/error-guidance.js +26 -3
  67. package/dist/cli/error-guidance.js.map +1 -1
  68. package/dist/cli/help-content.js +82 -3
  69. package/dist/cli/help-content.js.map +1 -1
  70. package/dist/cli/main.js +377 -23
  71. package/dist/cli/main.js.map +1 -1
  72. package/dist/cli/register-list-query.js +9 -3
  73. package/dist/cli/register-list-query.js.map +1 -1
  74. package/dist/cli/register-mutation.js +200 -28
  75. package/dist/cli/register-mutation.js.map +1 -1
  76. package/dist/cli/register-operations.js +4 -2
  77. package/dist/cli/register-operations.js.map +1 -1
  78. package/dist/cli/register-setup.js +4 -2
  79. package/dist/cli/register-setup.js.map +1 -1
  80. package/dist/cli/registration-helpers.js +31 -4
  81. package/dist/cli/registration-helpers.js.map +1 -1
  82. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
  83. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
  84. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
  85. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
  86. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-OOAGKWRG.js} +11 -11
  88. package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-5JE3YGXU.js} +8 -9
  89. package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-5JE3YGXU.js.map} +1 -1
  90. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
  91. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
  92. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
  93. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
  94. package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3OH4DAEB.js} +119 -6
  95. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
  96. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
  97. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
  98. package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-4PJQSECJ.js} +6 -4
  99. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
  100. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
  101. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
  102. package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-5IRA6IYD.js} +175 -54
  103. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
  104. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
  105. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
  106. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
  107. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
  108. package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
  109. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
  110. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
  111. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
  113. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-ATBVS6WW.js} +5 -5
  115. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
  116. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-B3N4TKNL.js} +12 -11
  118. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-BNL6S7QH.js} +3 -3
  120. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
  121. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-CJDQB2ED.js} +2 -2
  123. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
  124. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
  125. package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-D3WUNETC.js} +5 -5
  126. package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-D5X7N6FI.js} +210 -132
  127. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-DFIZGAI5.js} +10 -12
  129. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-DFIZGAI5.js.map} +1 -1
  130. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
  131. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
  132. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
  133. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
  135. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
  136. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
  137. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-GCAVRLGE.js} +37 -16
  139. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
  141. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
  142. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
  143. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
  144. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
  145. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-HPH6X4ZZ.js} +26 -15
  147. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-HZOS2UG5.js} +18 -6
  149. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
  150. package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
  151. package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
  153. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
  154. package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-JB4RGL4V.js} +7 -7
  155. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
  156. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-K47WAYQV.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-KA24HME7.js} +2 -2
  159. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
  160. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
  162. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
  163. package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-KK6YPGH3.js} +22 -3
  164. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
  165. package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-LDJK7SHN.js} +7 -7
  166. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  167. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  168. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
  169. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-N5YF3VFN.js} +54 -32
  171. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
  172. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
  173. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
  174. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
  175. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
  176. package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-OIQIXTNB.js} +164 -53
  177. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
  178. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
  179. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-OUF3ARDX.js} +251 -251
  181. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-RANZIID5.js} +2 -2
  183. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
  184. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
  185. package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-S3CV7JGJ.js} +4 -4
  186. package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-SRVKTWPR.js} +748 -196
  187. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
  188. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
  189. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
  191. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
  192. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
  193. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
  194. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
  195. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-TK633IVD.js} +35 -8
  197. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
  198. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
  199. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
  200. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
  201. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
  202. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
  203. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
  204. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
  205. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
  206. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
  207. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
  208. package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-WIKR7KFL.js} +8 -8
  209. package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XG7RJYHV.js} +484 -49
  210. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
  211. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  212. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  213. package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-XX5LRINW.js} +2 -2
  214. package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-Y2AKE2HS.js} +3 -3
  215. package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-ZQ4F6EC4.js} +301 -24
  216. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
  217. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
  218. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-AZLP7YFO.js} +10 -11
  220. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-AZLP7YFO.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
  222. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
  223. package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
  224. package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
  225. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
  226. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
  227. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
  228. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
  229. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
  230. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-AGBNSJJH.js} +10 -11
  231. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-AGBNSJJH.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
  233. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-5ON3ADRH.js} +121 -10
  235. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
  236. package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
  237. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-E6U3DWVM.js} +32 -19
  239. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-E6U3DWVM.js.map} +2 -2
  240. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
  241. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-CXSFM45B.js} +194 -162
  243. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
  244. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
  245. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
  246. package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
  247. package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
  248. package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-RONNH4F4.js} +7 -8
  250. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-RONNH4F4.js.map} +1 -1
  251. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
  252. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
  253. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
  254. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-WII3O4HB.js} +7 -8
  256. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-WII3O4HB.js.map} +1 -1
  257. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-JMVCFNHH.js} +9 -10
  258. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-JMVCFNHH.js.map} +1 -1
  259. package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
  260. package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
  261. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
  262. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-G6UXSM5S.js} +4 -5
  264. package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
  265. package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-MXYS5W4M.js} +9 -10
  267. package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-MXYS5W4M.js.map} +1 -1
  268. package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
  269. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
  270. package/dist/cli-bundle/chunks/{gc-JWNF66EC.js → gc-QNBRJG6H.js} +3 -3
  271. package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-CINFEUIY.js} +16 -17
  272. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
  273. package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
  274. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
  275. package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
  276. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-IT5DBPRJ.js} +43 -15
  278. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
  279. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
  280. package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
  281. package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
  282. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
  283. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
  284. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
  285. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-KC5ZOJRZ.js} +12 -14
  286. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-KC5ZOJRZ.js.map} +1 -1
  287. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
  288. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
  289. package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
  290. package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
  291. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
  292. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-A3CLB5CO.js} +10 -11
  293. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-A3CLB5CO.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
  295. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
  296. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
  297. package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
  298. package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
  299. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-42LIC3UE.js} +10 -11
  300. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-42LIC3UE.js.map} +1 -1
  301. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
  302. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
  303. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-HDQXEUKD.js} +13 -14
  304. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-HDQXEUKD.js.map} +1 -1
  305. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
  306. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
  307. package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-AG3XKXWL.js} +22 -24
  308. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
  309. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
  310. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
  311. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
  312. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
  313. package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-RSMT6DPK.js} +154 -43
  314. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
  315. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
  316. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
  317. package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-Q54JQZUN.js} +33 -34
  318. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
  319. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
  320. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-YJKIQRKA.js} +18 -19
  322. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-YJKIQRKA.js.map} +2 -2
  323. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
  324. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
  325. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
  326. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
  327. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
  328. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
  329. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
  330. package/dist/cli-bundle/chunks/{search-HENBL456.js → search-5A3BMFA7.js} +25 -16
  331. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
  332. package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
  333. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
  334. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
  335. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js → stats-Y2CBTZSL.js} +7 -8
  337. package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js.map → stats-Y2CBTZSL.js.map} +1 -1
  338. package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
  339. package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
  340. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
  341. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-EEMKNTGU.js} +13 -14
  342. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-EEMKNTGU.js.map} +1 -1
  343. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
  344. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
  345. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
  346. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
  347. package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-L2M7WKH7.js} +5 -5
  348. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
  349. package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
  350. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
  351. package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-322CCH2L.js} +78 -146
  352. package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
  353. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
  354. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
  355. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-2U727SAM.js} +5 -7
  356. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-2U727SAM.js.map} +1 -1
  357. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
  358. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
  359. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
  360. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
  361. package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-ZFVWPEEN.js} +61 -48
  362. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
  363. package/dist/cli-bundle/main.js +490 -52
  364. package/dist/cli-bundle/main.js.map +2 -2
  365. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  366. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  367. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  368. package/dist/core/config/positional-value.js +4 -2
  369. package/dist/core/config/positional-value.js.map +1 -1
  370. package/dist/core/diagnostics/remediation.d.ts +73 -0
  371. package/dist/core/diagnostics/remediation.js +328 -0
  372. package/dist/core/diagnostics/remediation.js.map +1 -0
  373. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  374. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  375. package/dist/core/extensions/extension-types.d.ts +60 -4
  376. package/dist/core/extensions/extension-types.js +2 -2
  377. package/dist/core/extensions/extension-types.js.map +1 -1
  378. package/dist/core/extensions/index.d.ts +5 -1
  379. package/dist/core/extensions/index.js +61 -2
  380. package/dist/core/extensions/index.js.map +1 -1
  381. package/dist/core/extensions/item-fields.d.ts +5 -1
  382. package/dist/core/extensions/item-fields.js +126 -4
  383. package/dist/core/extensions/item-fields.js.map +1 -1
  384. package/dist/core/extensions/loader.js +283 -8
  385. package/dist/core/extensions/loader.js.map +1 -1
  386. package/dist/core/item/item-format.d.ts +3 -2
  387. package/dist/core/item/item-format.js +15 -10
  388. package/dist/core/item/item-format.js.map +1 -1
  389. package/dist/core/item/status-filter.d.ts +29 -0
  390. package/dist/core/item/status-filter.js +97 -0
  391. package/dist/core/item/status-filter.js.map +1 -0
  392. package/dist/core/item/type-registry.js +4 -2
  393. package/dist/core/item/type-registry.js.map +1 -1
  394. package/dist/core/output/output.js +17 -5
  395. package/dist/core/output/output.js.map +1 -1
  396. package/dist/core/schema/item-types-file.d.ts +15 -0
  397. package/dist/core/schema/item-types-file.js +27 -2
  398. package/dist/core/schema/item-types-file.js.map +1 -1
  399. package/dist/core/schema/runtime-field-filters.js +4 -3
  400. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  401. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  402. package/dist/core/schema/runtime-field-values.js +10 -4
  403. package/dist/core/schema/runtime-field-values.js.map +1 -1
  404. package/dist/core/schema/runtime-schema.js +75 -2
  405. package/dist/core/schema/runtime-schema.js.map +1 -1
  406. package/dist/core/schema/status-defs-file.d.ts +113 -0
  407. package/dist/core/schema/status-defs-file.js +260 -0
  408. package/dist/core/schema/status-defs-file.js.map +1 -0
  409. package/dist/core/schema/type-workflows.d.ts +64 -0
  410. package/dist/core/schema/type-workflows.js +98 -0
  411. package/dist/core/schema/type-workflows.js.map +1 -0
  412. package/dist/core/search/cache.d.ts +3 -1
  413. package/dist/core/search/cache.js +104 -28
  414. package/dist/core/search/cache.js.map +1 -1
  415. package/dist/core/search/http-client.d.ts +2 -2
  416. package/dist/core/search/http-client.js +2 -2
  417. package/dist/core/search/http-client.js.map +1 -1
  418. package/dist/core/search/vector-stores.d.ts +1 -0
  419. package/dist/core/search/vector-stores.js +64 -14
  420. package/dist/core/search/vector-stores.js.map +1 -1
  421. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  422. package/dist/core/search/vectorization-metadata.js +65 -0
  423. package/dist/core/search/vectorization-metadata.js.map +1 -0
  424. package/dist/core/shared/serialization.d.ts +1 -0
  425. package/dist/core/shared/serialization.js +86 -2
  426. package/dist/core/shared/serialization.js.map +1 -1
  427. package/dist/core/store/front-matter-cache.js +14 -5
  428. package/dist/core/store/front-matter-cache.js.map +1 -1
  429. package/dist/core/store/item-store.d.ts +2 -0
  430. package/dist/core/store/item-store.js +61 -6
  431. package/dist/core/store/item-store.js.map +1 -1
  432. package/dist/core/store/settings-validator.js +18 -2
  433. package/dist/core/store/settings-validator.js.map +1 -1
  434. package/dist/core/store/settings.js +40 -5
  435. package/dist/core/store/settings.js.map +1 -1
  436. package/dist/core/telemetry/consent.js +3 -3
  437. package/dist/core/telemetry/consent.js.map +1 -1
  438. package/dist/core/telemetry/observability.js +4 -3
  439. package/dist/core/telemetry/observability.js.map +1 -1
  440. package/dist/mcp/server.js +221 -12
  441. package/dist/mcp/server.js.map +1 -1
  442. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  443. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  444. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  445. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  446. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  447. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  448. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  449. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  450. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  451. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  452. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -6
  453. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  454. package/dist/sdk/cli-contracts.d.ts +19 -1
  455. package/dist/sdk/cli-contracts.js +187 -15
  456. package/dist/sdk/cli-contracts.js.map +1 -1
  457. package/dist/sdk/errors.d.ts +22 -0
  458. package/dist/sdk/errors.js +46 -0
  459. package/dist/sdk/errors.js.map +1 -0
  460. package/dist/sdk/index.d.ts +2 -1
  461. package/dist/sdk/index.js +3 -2
  462. package/dist/sdk/index.js.map +1 -1
  463. package/dist/sdk/package-import-adapters.js +14 -3
  464. package/dist/sdk/package-import-adapters.js.map +1 -1
  465. package/dist/sdk/runtime.d.ts +1 -0
  466. package/dist/sdk/runtime.js +3 -2
  467. package/dist/sdk/runtime.js.map +1 -1
  468. package/dist/sdk/testing.d.ts +77 -0
  469. package/dist/sdk/testing.js +239 -0
  470. package/dist/sdk/testing.js.map +1 -0
  471. package/dist/types.d.ts +19 -0
  472. package/dist/types.js +3 -2
  473. package/dist/types.js.map +1 -1
  474. package/docs/AGENT_GUIDE.md +21 -2
  475. package/docs/COMMANDS.md +85 -5
  476. package/docs/CONFIGURATION.md +49 -2
  477. package/docs/EXTENSIONS.md +118 -6
  478. package/docs/QUICKSTART.md +2 -0
  479. package/docs/RELEASING.md +2 -2
  480. package/docs/SDK.md +273 -1
  481. package/docs/TESTING.md +17 -0
  482. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  483. package/docs/examples/starter-extension/index.js +9 -1
  484. package/docs/examples/starter-extension/manifest.json +1 -0
  485. package/package.json +12 -6
  486. package/packages/pm-beads/extensions/beads/index.js +2 -4
  487. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  488. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  489. package/packages/pm-calendar/README.md +6 -0
  490. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  491. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  492. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  493. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  494. package/packages/pm-guide-shell/README.md +4 -0
  495. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  496. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  497. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  498. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  499. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  500. package/packages/pm-lifecycle-hooks/README.md +29 -0
  501. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  502. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  503. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  504. package/packages/pm-lifecycle-hooks/package.json +52 -0
  505. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  506. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  507. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  508. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  509. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  510. package/packages/pm-todos/extensions/todos/index.js +3 -7
  511. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  512. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  513. package/scripts/bundle-cli.mjs +121 -17
  514. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
  515. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
  516. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
  517. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
  518. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
  519. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
  520. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
  521. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
  522. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
  523. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
  524. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
  525. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
  526. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
  527. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
  528. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
  529. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
  530. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
  531. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
  532. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
  533. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
  534. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
  535. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
  536. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
  537. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
  538. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
  539. package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
  540. package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
  541. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
  542. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
  543. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
  544. package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
  545. package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
  546. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
  547. package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
  548. package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
  549. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
  550. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
  551. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
  552. package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
  553. package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
  554. package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
  555. package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
  556. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
  557. package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
  558. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
  559. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
  560. /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-P5BUMWP3.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-OOAGKWRG.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-ATBVS6WW.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-BNL6S7QH.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-CJDQB2ED.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-D3WUNETC.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-JB4RGL4V.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-K47WAYQV.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-KA24HME7.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-LDJK7SHN.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-RANZIID5.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-S3CV7JGJ.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js.map → chunk-WIKR7KFL.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-XX5LRINW.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-Y2AKE2HS.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-RMHQ3KWH.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-ATONSAZW.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-G6UXSM5S.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{gc-JWNF66EC.js.map → gc-QNBRJG6H.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-6FC4H6HI.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-XKYEZDBL.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-KHX3FEEM.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-53LZ2AEO.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-JL5QIH7H.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-RJ4ZF35X.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-L2M7WKH7.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-PYLVHMRD.js.map} +0 -0
@@ -0,0 +1,1809 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="67af10d9-cb2f-5b7f-9238-a7eae5edeb4d")}catch(e){}}();
3
+ import {
4
+ looksLikeStructuredLinkedTestEntry,
5
+ normalizeStructuredLinkedTestEntry,
6
+ parseLinkedTestAssertionEqualsMap,
7
+ parseLinkedTestAssertionGteMap,
8
+ parseLinkedTestBoolean,
9
+ parseLinkedTestContextMode,
10
+ parseLinkedTestEnvClear,
11
+ parseLinkedTestEnvSet,
12
+ parseLinkedTestMinLines,
13
+ parseLinkedTestRegexList,
14
+ parseLinkedTestStringList
15
+ } from "./chunk-KCMIYKTA.js";
16
+ import {
17
+ createStdinTokenResolver,
18
+ mergeAdditiveTags,
19
+ parseCsvKv,
20
+ parseOptionalNumber,
21
+ parseTags
22
+ } from "./chunk-O5IBJE6S.js";
23
+ import {
24
+ normalizeParentReferenceValue,
25
+ validateMissingParentReference,
26
+ validateSprintOrReleaseValue
27
+ } from "./chunk-MISYRLEP.js";
28
+ import {
29
+ buildInvalidTypeError
30
+ } from "./chunk-26KTVXJW.js";
31
+ import {
32
+ printError
33
+ } from "./chunk-AXXKLVTW.js";
34
+ import {
35
+ acquireLock,
36
+ appendHistoryEntry,
37
+ applyRegisteredItemFieldDefaultsAndValidation,
38
+ collectRegisteredItemFieldNames,
39
+ createHistoryEntry,
40
+ locateItem,
41
+ parseRegisteredItemFieldAssignments
42
+ } from "./chunk-CWT53EYT.js";
43
+ import {
44
+ generateItemId,
45
+ normalizeItemId
46
+ } from "./chunk-SSFMJCPF.js";
47
+ import {
48
+ canonicalDocument,
49
+ collectRuntimeCreateFieldValues,
50
+ normalizeFrontMatter,
51
+ normalizeStatusInput,
52
+ serializeItemDocument
53
+ } from "./chunk-KBG47ZOY.js";
54
+ import {
55
+ canonicalizeCommandOptionKey,
56
+ commandOptionFlagLabel,
57
+ resolveCommandOptionPolicyState,
58
+ resolveItemTypeRegistry,
59
+ resolveTypeDefinition,
60
+ resolveTypeName,
61
+ validateTypeOptions
62
+ } from "./chunk-SZQCER6S.js";
63
+ import {
64
+ nowIso,
65
+ resolveIsoOrRelative
66
+ } from "./chunk-NQP3ECKF.js";
67
+ import {
68
+ CONFIDENCE_TEXT_VALUES,
69
+ DEPENDENCY_KIND_VALUES,
70
+ EXIT_CODE,
71
+ FRONT_MATTER_KEY_ORDER,
72
+ ISSUE_SEVERITY_VALUES,
73
+ PmCliError,
74
+ RECURRENCE_FREQUENCY_VALUES,
75
+ RECURRENCE_WEEKDAY_VALUES,
76
+ RISK_VALUES,
77
+ SCOPE_VALUES,
78
+ getActiveExtensionRegistrations,
79
+ getHistoryPath,
80
+ getItemPath,
81
+ getSettingsPath,
82
+ pathExists,
83
+ projectAfterCommandItemSnapshot,
84
+ readSettings,
85
+ recordAfterCommandAffectedItem,
86
+ removeFileIfExists,
87
+ resolvePmRoot,
88
+ resolveRuntimeFieldRegistry,
89
+ resolveRuntimeStatusRegistry,
90
+ runActiveCommandHandler,
91
+ runActiveOnWriteHooks,
92
+ weekdayOrderIndex,
93
+ writeFileAtomic
94
+ } from "./chunk-4LTBNUYT.js";
95
+
96
+ // dist/core/item/priority.js
97
+ var PRIORITY_NAME_TO_VALUE = {
98
+ critical: 0,
99
+ high: 1,
100
+ medium: 2,
101
+ low: 3,
102
+ minimal: 4
103
+ };
104
+ var PRIORITY_NAME_LIST = Object.keys(PRIORITY_NAME_TO_VALUE);
105
+ var PRIORITY_ACCEPTED_FORMS_HINT = `numbers 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal) or names (${PRIORITY_NAME_LIST.join(", ")}), case-insensitive`;
106
+ function priorityUsageError(raw) {
107
+ return new PmCliError(`Invalid priority "${raw}". Accepted values: ${PRIORITY_ACCEPTED_FORMS_HINT}.`, EXIT_CODE.USAGE);
108
+ }
109
+ function resolvePriority(raw) {
110
+ if (typeof raw === "number") {
111
+ if (Number.isInteger(raw) && raw >= 0 && raw <= 4) {
112
+ return raw;
113
+ }
114
+ throw priorityUsageError(String(raw));
115
+ }
116
+ if (typeof raw !== "string") {
117
+ throw priorityUsageError(String(raw));
118
+ }
119
+ const trimmed = raw.trim();
120
+ if (trimmed.length === 0) {
121
+ throw priorityUsageError(raw);
122
+ }
123
+ const normalizedName = trimmed.toLowerCase();
124
+ if (Object.prototype.hasOwnProperty.call(PRIORITY_NAME_TO_VALUE, normalizedName)) {
125
+ return PRIORITY_NAME_TO_VALUE[normalizedName];
126
+ }
127
+ if (/^[0-4]$/.test(trimmed)) {
128
+ return Number(trimmed);
129
+ }
130
+ throw priorityUsageError(raw);
131
+ }
132
+
133
+ // dist/core/item/type-synonyms.js
134
+ var TYPE_SYNONYMS = {
135
+ bug: "Issue",
136
+ bugfix: "Issue",
137
+ defect: "Issue",
138
+ incident: "Issue",
139
+ enhancement: "Feature",
140
+ story: "Feature",
141
+ userstory: "Feature",
142
+ "user-story": "Feature",
143
+ "user story": "Feature",
144
+ change: "Chore",
145
+ ticket: "Task",
146
+ todo: "Task"
147
+ };
148
+ function resolveTypeSynonym(rawType) {
149
+ if (rawType === void 0) {
150
+ return void 0;
151
+ }
152
+ return TYPE_SYNONYMS[rawType.trim().toLowerCase()];
153
+ }
154
+
155
+ // dist/cli/commands/metadata-normalizers.js
156
+ function normalizeRiskInput(value) {
157
+ const trimmed = value.trim();
158
+ return trimmed.toLowerCase() === "med" ? "medium" : trimmed;
159
+ }
160
+ function normalizeSeverityInput(value) {
161
+ const trimmed = value.trim();
162
+ return trimmed.toLowerCase() === "med" ? "medium" : trimmed;
163
+ }
164
+ function parseConfidenceInput(value) {
165
+ const trimmed = value.trim().toLowerCase();
166
+ if (trimmed === "med") {
167
+ return "medium";
168
+ }
169
+ if (CONFIDENCE_TEXT_VALUES.includes(trimmed)) {
170
+ return trimmed;
171
+ }
172
+ const parsed = parseOptionalNumber(value, "confidence");
173
+ if (!Number.isInteger(parsed) || parsed < 0 || parsed > 100) {
174
+ throw new PmCliError("Confidence must be an integer 0..100 or one of low|med|medium|high", EXIT_CODE.USAGE);
175
+ }
176
+ return parsed;
177
+ }
178
+ function parseRegressionInput(value) {
179
+ const normalized = value.trim().toLowerCase();
180
+ if (normalized === "true" || normalized === "1") {
181
+ return true;
182
+ }
183
+ if (normalized === "false" || normalized === "0") {
184
+ return false;
185
+ }
186
+ throw new PmCliError("Regression must be one of true|false|1|0", EXIT_CODE.USAGE);
187
+ }
188
+
189
+ // dist/cli/commands/legacy-none-tokens.js
190
+ var LEGACY_NONE_TOKENS = /* @__PURE__ */ new Set(["none", "null"]);
191
+ function isLegacyNoneToken(value) {
192
+ if (value === void 0) {
193
+ return false;
194
+ }
195
+ return LEGACY_NONE_TOKENS.has(value.trim().toLowerCase());
196
+ }
197
+ function assertNoLegacyNoneToken(value, flag, replacementHint) {
198
+ if (!isLegacyNoneToken(value)) {
199
+ return;
200
+ }
201
+ const suffix = replacementHint ? ` ${replacementHint}` : "";
202
+ throw new PmCliError(`${flag} no longer accepts "none" or "null".${suffix}`.trim(), EXIT_CODE.USAGE);
203
+ }
204
+ function assertNoLegacyNoneTokens(values, flag, replacementHint) {
205
+ if (!values || values.length === 0) {
206
+ return;
207
+ }
208
+ const hasLegacyToken = values.some((value) => isLegacyNoneToken(value));
209
+ if (!hasLegacyToken) {
210
+ return;
211
+ }
212
+ const suffix = replacementHint ? ` ${replacementHint}` : "";
213
+ throw new PmCliError(`${flag} no longer accepts "none" or "null".${suffix}`.trim(), EXIT_CODE.USAGE);
214
+ }
215
+
216
+ // dist/cli/commands/recurrence-parsers.js
217
+ function parseEventBoolean(value, flag) {
218
+ const normalized = value.trim().toLowerCase();
219
+ if (normalized === "true" || normalized === "1" || normalized === "yes") {
220
+ return true;
221
+ }
222
+ if (normalized === "false" || normalized === "0" || normalized === "no") {
223
+ return false;
224
+ }
225
+ throw new PmCliError(`${flag} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);
226
+ }
227
+ function parseDelimitedList(raw) {
228
+ if (!raw) {
229
+ return [];
230
+ }
231
+ return raw.split("|").map((value) => value.trim()).filter((value) => value.length > 0);
232
+ }
233
+ function ensureEnumValue(value, allowed, label) {
234
+ if (!allowed.includes(value)) {
235
+ throw new PmCliError(`Invalid ${label} value "${value}". Allowed: ${allowed.join(", ")}`, EXIT_CODE.USAGE);
236
+ }
237
+ return value;
238
+ }
239
+ function parseRecurrenceRule(kv, startAt, nowValue, emptyNumericGuard) {
240
+ const freqRaw = kv.recur_freq?.trim();
241
+ const intervalRaw = kv.recur_interval?.trim();
242
+ const countRaw = kv.recur_count?.trim();
243
+ const untilRaw = kv.recur_until?.trim();
244
+ const byWeekdayRaw = kv.recur_by_weekday?.trim();
245
+ const byMonthDayRaw = kv.recur_by_month_day?.trim();
246
+ const exdatesRaw = kv.recur_exdates?.trim();
247
+ const recurrenceInputsProvided = [freqRaw, intervalRaw, countRaw, untilRaw, byWeekdayRaw, byMonthDayRaw, exdatesRaw].some((value) => value !== void 0);
248
+ if (!recurrenceInputsProvided) {
249
+ return void 0;
250
+ }
251
+ if (!freqRaw) {
252
+ throw new PmCliError("--event recurrence fields require recur_freq=<daily|weekly|monthly|yearly>", EXIT_CODE.USAGE);
253
+ }
254
+ const numericProvided = (raw) => emptyNumericGuard === "defined" ? raw !== void 0 : Boolean(raw);
255
+ const freq = ensureEnumValue(freqRaw.toLowerCase(), RECURRENCE_FREQUENCY_VALUES, "event recurrence frequency");
256
+ const interval = numericProvided(intervalRaw) ? parseOptionalNumber(intervalRaw, "event recur_interval") : void 0;
257
+ if (interval !== void 0 && (!Number.isInteger(interval) || interval < 1)) {
258
+ throw new PmCliError("--event recur_interval must be an integer >= 1", EXIT_CODE.USAGE);
259
+ }
260
+ const count = numericProvided(countRaw) ? parseOptionalNumber(countRaw, "event recur_count") : void 0;
261
+ if (count !== void 0 && (!Number.isInteger(count) || count < 1)) {
262
+ throw new PmCliError("--event recur_count must be an integer >= 1", EXIT_CODE.USAGE);
263
+ }
264
+ const until = untilRaw ? resolveIsoOrRelative(untilRaw, nowValue, "event.recur_until") : void 0;
265
+ if (until && until < startAt) {
266
+ throw new PmCliError("--event recur_until must be at or after start", EXIT_CODE.USAGE);
267
+ }
268
+ const byWeekday = Array.from(new Set(parseDelimitedList(byWeekdayRaw).map((value) => ensureEnumValue(value.toLowerCase(), RECURRENCE_WEEKDAY_VALUES, "event weekday")))).sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right));
269
+ const byMonthDay = Array.from(new Set(parseDelimitedList(byMonthDayRaw).map((value) => {
270
+ const day = parseOptionalNumber(value, "event recur_by_month_day");
271
+ if (!Number.isInteger(day) || day < 1 || day > 31) {
272
+ throw new PmCliError("--event recur_by_month_day values must be integers 1..31", EXIT_CODE.USAGE);
273
+ }
274
+ return day;
275
+ }))).sort((left, right) => left - right);
276
+ const exdates = Array.from(new Set(parseDelimitedList(exdatesRaw).map((value) => resolveIsoOrRelative(value, nowValue, "event.recur_exdates")))).sort((left, right) => left.localeCompare(right));
277
+ return {
278
+ freq,
279
+ interval,
280
+ count,
281
+ until,
282
+ by_weekday: byWeekday.length > 0 ? byWeekday : void 0,
283
+ by_month_day: byMonthDay.length > 0 ? byMonthDay : void 0,
284
+ exdates: exdates.length > 0 ? exdates : void 0
285
+ };
286
+ }
287
+
288
+ // dist/cli/commands/event-validation-messages.js
289
+ var EVENT_END_AFTER_START_MESSAGE = "--event end must be strictly after start. Equal start/end timestamps are treated as an instant event (end is dropped); an end earlier than start is rejected. Omit end for an instant event or set end later than start.";
290
+ var EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE = "--event end and duration are mutually exclusive; provide only one (use duration=<relative> like duration=2h, or set an explicit end).";
291
+ function resolveEventEndAt(startAt, endRaw, durationRaw, referenceDate) {
292
+ if (endRaw && durationRaw) {
293
+ throw new PmCliError(EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE, EXIT_CODE.USAGE);
294
+ }
295
+ if (durationRaw) {
296
+ const normalizedDuration = durationRaw.startsWith("+") ? durationRaw : `+${durationRaw}`;
297
+ const endAt2 = resolveIsoOrRelative(normalizedDuration, new Date(startAt), "event.duration");
298
+ if (endAt2 < startAt) {
299
+ throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);
300
+ }
301
+ if (endAt2 === startAt) {
302
+ return void 0;
303
+ }
304
+ return endAt2;
305
+ }
306
+ if (!endRaw) {
307
+ return void 0;
308
+ }
309
+ const endAt = resolveIsoOrRelative(endRaw, referenceDate, "event.end");
310
+ if (endAt < startAt) {
311
+ throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);
312
+ }
313
+ if (endAt === startAt) {
314
+ return void 0;
315
+ }
316
+ return endAt;
317
+ }
318
+
319
+ // dist/cli/commands/repeatable-metadata-parsers.js
320
+ function optionalString(value, mode) {
321
+ return mode === "trimmed" ? value?.trim() : value;
322
+ }
323
+ function isProvided(value, guard) {
324
+ return guard === "defined" ? value !== void 0 : Boolean(value);
325
+ }
326
+ function parseReminderEntries(raw, nowValue, options) {
327
+ return raw.map((entry) => {
328
+ const kv = parseCsvKv(entry, "--reminder");
329
+ const atRaw = optionalString(kv.at ?? kv.date, options.valueMode);
330
+ const textRaw = optionalString(kv.text ?? kv.title, options.valueMode);
331
+ if (!atRaw || !textRaw) {
332
+ throw new PmCliError("--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>", EXIT_CODE.USAGE);
333
+ }
334
+ const text = textRaw.trim();
335
+ if (!text) {
336
+ throw new PmCliError("--reminder text must not be empty", EXIT_CODE.USAGE);
337
+ }
338
+ return {
339
+ at: resolveIsoOrRelative(atRaw, nowValue, "reminder.at"),
340
+ text
341
+ };
342
+ });
343
+ }
344
+ function parseEventEntries(raw, nowValue, options) {
345
+ return raw.map((entry) => {
346
+ const kv = parseCsvKv(entry, "--event");
347
+ const startRaw = (kv.start ?? kv.date)?.trim();
348
+ if (!startRaw) {
349
+ throw new PmCliError("--event requires start=<iso|relative> or date=<iso|relative>", EXIT_CODE.USAGE);
350
+ }
351
+ const startAt = resolveIsoOrRelative(startRaw, nowValue, "event.start");
352
+ const endRaw = kv.end?.trim();
353
+ const durationRaw = kv.duration?.trim();
354
+ const endAt = resolveEventEndAt(startAt, endRaw, durationRaw, nowValue);
355
+ const titleRaw = kv.title;
356
+ const descriptionRaw = kv.description;
357
+ const locationRaw = kv.location;
358
+ const timezoneRaw = kv.timezone;
359
+ const title = titleRaw?.trim();
360
+ const description = descriptionRaw?.trim();
361
+ const location = locationRaw?.trim();
362
+ const timezone = timezoneRaw?.trim();
363
+ if (titleRaw !== void 0 && !title) {
364
+ throw new PmCliError("--event title must not be empty", EXIT_CODE.USAGE);
365
+ }
366
+ if (descriptionRaw !== void 0 && !description) {
367
+ throw new PmCliError("--event description must not be empty", EXIT_CODE.USAGE);
368
+ }
369
+ if (locationRaw !== void 0 && !location) {
370
+ throw new PmCliError("--event location must not be empty", EXIT_CODE.USAGE);
371
+ }
372
+ if (timezoneRaw !== void 0 && !timezone) {
373
+ throw new PmCliError("--event timezone must not be empty", EXIT_CODE.USAGE);
374
+ }
375
+ const allDayRaw = kv.all_day?.trim();
376
+ const recurrence = parseRecurrenceRule(kv, startAt, nowValue, options.recurrenceEmptyNumericGuard);
377
+ const allDay = isProvided(allDayRaw, options.allDayEmptyGuard) ? parseEventBoolean(allDayRaw, "--event all_day") : void 0;
378
+ return {
379
+ start_at: startAt,
380
+ end_at: endAt,
381
+ title,
382
+ description,
383
+ location,
384
+ all_day: allDay,
385
+ timezone,
386
+ recurrence
387
+ };
388
+ });
389
+ }
390
+ function parseTypeOptionEntries(raw) {
391
+ const values = {};
392
+ for (const entry of raw) {
393
+ const trimmedEntry = entry.trim();
394
+ if (trimmedEntry.length === 0) {
395
+ throw new PmCliError("--type-option values must not be empty", EXIT_CODE.USAGE);
396
+ }
397
+ let key;
398
+ let value;
399
+ const prefersStructuredKv = trimmedEntry.includes(",") || trimmedEntry.includes("\n") || trimmedEntry.startsWith("```") || /^(?:[-*+]\s+)?(?:key|value)\s*[:=]/i.test(trimmedEntry);
400
+ if (prefersStructuredKv) {
401
+ const kv = parseCsvKv(trimmedEntry, "--type-option");
402
+ key = kv.key?.trim();
403
+ value = kv.value?.trim();
404
+ } else {
405
+ const equalsIndex = trimmedEntry.indexOf("=");
406
+ const colonIndex = trimmedEntry.indexOf(":");
407
+ let separatorIndex = equalsIndex;
408
+ if (equalsIndex <= 0 && colonIndex > 0) {
409
+ separatorIndex = colonIndex;
410
+ }
411
+ if (separatorIndex <= 0 || separatorIndex === trimmedEntry.length - 1) {
412
+ throw new PmCliError("--type-option requires key=value or key=<name>,value=<value> entries", EXIT_CODE.USAGE);
413
+ }
414
+ key = trimmedEntry.slice(0, separatorIndex).trim();
415
+ value = trimmedEntry.slice(separatorIndex + 1).trim();
416
+ }
417
+ if (!key || !value) {
418
+ throw new PmCliError("--type-option requires key and value", EXIT_CODE.USAGE);
419
+ }
420
+ values[key] = value;
421
+ }
422
+ return Object.fromEntries(Object.entries(values).sort((left, right) => left[0].localeCompare(right[0])));
423
+ }
424
+
425
+ // dist/cli/commands/create.js
426
+ var CREATE_MODE_VALUES = ["strict", "progressive"];
427
+ var SCHEDULE_CREATE_PRESET_VALUES = ["lightweight"];
428
+ var SCHEDULE_CREATE_PRESET_TYPES = /* @__PURE__ */ new Set(["Reminder", "Meeting", "Event"]);
429
+ var LOG_SEED_ALLOWED_KEYS = /* @__PURE__ */ new Set(["author", "created_at", "text"]);
430
+ var CREATE_UNSET_FIELD_DEFINITIONS = [
431
+ { canonical: "tags", aliases: ["tags"], optionKey: "tags", frontMatterKey: "tags" },
432
+ { canonical: "deadline", aliases: ["deadline"], optionKey: "deadline", frontMatterKey: "deadline" },
433
+ {
434
+ canonical: "estimate",
435
+ aliases: ["estimate", "estimated_minutes", "estimated-minutes"],
436
+ optionKey: "estimatedMinutes",
437
+ frontMatterKey: "estimated_minutes"
438
+ },
439
+ {
440
+ canonical: "acceptance-criteria",
441
+ aliases: ["acceptance_criteria", "acceptance-criteria", "ac"],
442
+ optionKey: "acceptanceCriteria",
443
+ frontMatterKey: "acceptance_criteria"
444
+ },
445
+ {
446
+ canonical: "definition-of-ready",
447
+ aliases: ["definition_of_ready", "definition-of-ready"],
448
+ optionKey: "definitionOfReady",
449
+ frontMatterKey: "definition_of_ready"
450
+ },
451
+ { canonical: "order", aliases: ["order", "rank"], optionKey: "order", frontMatterKey: "order" },
452
+ { canonical: "goal", aliases: ["goal"], optionKey: "goal", frontMatterKey: "goal" },
453
+ { canonical: "objective", aliases: ["objective"], optionKey: "objective", frontMatterKey: "objective" },
454
+ { canonical: "value", aliases: ["value"], optionKey: "value", frontMatterKey: "value" },
455
+ { canonical: "impact", aliases: ["impact"], optionKey: "impact", frontMatterKey: "impact" },
456
+ { canonical: "outcome", aliases: ["outcome"], optionKey: "outcome", frontMatterKey: "outcome" },
457
+ { canonical: "why-now", aliases: ["why_now", "why-now"], optionKey: "whyNow", frontMatterKey: "why_now" },
458
+ { canonical: "author", aliases: ["author"], optionKey: "author", frontMatterKey: "author" },
459
+ { canonical: "assignee", aliases: ["assignee"], optionKey: "assignee", frontMatterKey: "assignee" },
460
+ { canonical: "parent", aliases: ["parent"], optionKey: "parent", frontMatterKey: "parent" },
461
+ { canonical: "reviewer", aliases: ["reviewer"], optionKey: "reviewer", frontMatterKey: "reviewer" },
462
+ { canonical: "risk", aliases: ["risk"], optionKey: "risk", frontMatterKey: "risk" },
463
+ { canonical: "confidence", aliases: ["confidence"], optionKey: "confidence", frontMatterKey: "confidence" },
464
+ { canonical: "sprint", aliases: ["sprint"], optionKey: "sprint", frontMatterKey: "sprint" },
465
+ { canonical: "release", aliases: ["release"], optionKey: "release", frontMatterKey: "release" },
466
+ {
467
+ canonical: "blocked-by",
468
+ aliases: ["blocked_by", "blocked-by"],
469
+ optionKey: "blockedBy",
470
+ frontMatterKey: "blocked_by"
471
+ },
472
+ {
473
+ canonical: "blocked-reason",
474
+ aliases: ["blocked_reason", "blocked-reason"],
475
+ optionKey: "blockedReason",
476
+ frontMatterKey: "blocked_reason"
477
+ },
478
+ {
479
+ canonical: "unblock-note",
480
+ aliases: ["unblock_note", "unblock-note"],
481
+ optionKey: "unblockNote",
482
+ frontMatterKey: "unblock_note"
483
+ },
484
+ { canonical: "reporter", aliases: ["reporter"], optionKey: "reporter", frontMatterKey: "reporter" },
485
+ { canonical: "severity", aliases: ["severity"], optionKey: "severity", frontMatterKey: "severity" },
486
+ {
487
+ canonical: "environment",
488
+ aliases: ["environment"],
489
+ optionKey: "environment",
490
+ frontMatterKey: "environment"
491
+ },
492
+ {
493
+ canonical: "repro-steps",
494
+ aliases: ["repro_steps", "repro-steps"],
495
+ optionKey: "reproSteps",
496
+ frontMatterKey: "repro_steps"
497
+ },
498
+ {
499
+ canonical: "resolution",
500
+ aliases: ["resolution"],
501
+ optionKey: "resolution",
502
+ frontMatterKey: "resolution"
503
+ },
504
+ {
505
+ canonical: "expected-result",
506
+ aliases: ["expected_result", "expected-result"],
507
+ optionKey: "expectedResult",
508
+ frontMatterKey: "expected_result"
509
+ },
510
+ {
511
+ canonical: "actual-result",
512
+ aliases: ["actual_result", "actual-result"],
513
+ optionKey: "actualResult",
514
+ frontMatterKey: "actual_result"
515
+ },
516
+ {
517
+ canonical: "affected-version",
518
+ aliases: ["affected_version", "affected-version"],
519
+ optionKey: "affectedVersion",
520
+ frontMatterKey: "affected_version"
521
+ },
522
+ {
523
+ canonical: "fixed-version",
524
+ aliases: ["fixed_version", "fixed-version"],
525
+ optionKey: "fixedVersion",
526
+ frontMatterKey: "fixed_version"
527
+ },
528
+ { canonical: "component", aliases: ["component"], optionKey: "component", frontMatterKey: "component" },
529
+ { canonical: "regression", aliases: ["regression"], optionKey: "regression", frontMatterKey: "regression" },
530
+ {
531
+ canonical: "customer-impact",
532
+ aliases: ["customer_impact", "customer-impact"],
533
+ optionKey: "customerImpact",
534
+ frontMatterKey: "customer_impact"
535
+ }
536
+ ];
537
+ var CREATE_UNSET_ALIAS_MAP = (() => {
538
+ const map = /* @__PURE__ */ new Map();
539
+ for (const definition of CREATE_UNSET_FIELD_DEFINITIONS) {
540
+ for (const alias of definition.aliases) {
541
+ map.set(alias, {
542
+ optionKey: definition.optionKey,
543
+ frontMatterKey: definition.frontMatterKey
544
+ });
545
+ }
546
+ }
547
+ return map;
548
+ })();
549
+ var CREATE_OPTION_KEY_TO_UNSET_CANONICAL = new Map(CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => [definition.optionKey, definition.canonical]));
550
+ var CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS = CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => definition.canonical).sort((left, right) => left.localeCompare(right)).join(", ");
551
+ function parseStatusValue(value, statusRegistry) {
552
+ const normalized = normalizeStatusInput(value, statusRegistry);
553
+ if (!normalized) {
554
+ const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);
555
+ throw new PmCliError(`Invalid status value "${value}". Allowed: ${allowedStatuses.join(", ")}`, EXIT_CODE.USAGE);
556
+ }
557
+ return normalized;
558
+ }
559
+ function resolveCreateDefaultStatus(typeDefinition, statusRegistry) {
560
+ const configured = typeDefinition.default_status;
561
+ if (configured !== void 0) {
562
+ const normalized = normalizeStatusInput(configured, statusRegistry);
563
+ if (normalized) {
564
+ return normalized;
565
+ }
566
+ }
567
+ return statusRegistry.open_status;
568
+ }
569
+ function parseCreatedAt(value, currentIso) {
570
+ if (!value || value.trim() === "" || value.trim().toLowerCase() === "now") {
571
+ return currentIso;
572
+ }
573
+ const parsed = Date.parse(value);
574
+ if (!Number.isFinite(parsed)) {
575
+ throw new PmCliError(`Invalid created_at timestamp "${value}"`, EXIT_CODE.USAGE);
576
+ }
577
+ return new Date(parsed).toISOString();
578
+ }
579
+ var CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS = [
580
+ { optionKey: "dep", clearFlagKey: "clearDeps", valueFlag: "--dep", clearFlag: "--clear-deps" },
581
+ { optionKey: "comment", clearFlagKey: "clearComments", valueFlag: "--comment", clearFlag: "--clear-comments" },
582
+ { optionKey: "note", clearFlagKey: "clearNotes", valueFlag: "--note", clearFlag: "--clear-notes" },
583
+ { optionKey: "learning", clearFlagKey: "clearLearnings", valueFlag: "--learning", clearFlag: "--clear-learnings" },
584
+ { optionKey: "file", clearFlagKey: "clearFiles", valueFlag: "--file", clearFlag: "--clear-files" },
585
+ { optionKey: "test", clearFlagKey: "clearTests", valueFlag: "--test", clearFlag: "--clear-tests" },
586
+ { optionKey: "doc", clearFlagKey: "clearDocs", valueFlag: "--doc", clearFlag: "--clear-docs" },
587
+ { optionKey: "reminder", clearFlagKey: "clearReminders", valueFlag: "--reminder", clearFlag: "--clear-reminders" },
588
+ { optionKey: "event", clearFlagKey: "clearEvents", valueFlag: "--event", clearFlag: "--clear-events" },
589
+ { optionKey: "typeOption", clearFlagKey: "clearTypeOptions", valueFlag: "--type-option", clearFlag: "--clear-type-options" }
590
+ ];
591
+ function normalizeLegacyNoneCreateOptions(options) {
592
+ const normalized = {
593
+ ...options,
594
+ unset: options.unset ? [...options.unset] : void 0
595
+ };
596
+ const appendUnsetTarget = (value) => {
597
+ const current = normalized.unset ? [...normalized.unset] : [];
598
+ if (!current.includes(value)) {
599
+ current.push(value);
600
+ }
601
+ normalized.unset = current;
602
+ };
603
+ if (isLegacyNoneToken(normalized.template)) {
604
+ normalized.template = void 0;
605
+ }
606
+ const scalarOptionKeys = /* @__PURE__ */ new Set([...CREATE_OPTION_KEY_TO_UNSET_CANONICAL.keys(), "rank"]);
607
+ for (const optionKey of scalarOptionKeys) {
608
+ const candidate = normalized[optionKey];
609
+ if (typeof candidate !== "string" || !isLegacyNoneToken(candidate)) {
610
+ continue;
611
+ }
612
+ const canonicalUnset = optionKey === "rank" ? "order" : CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey;
613
+ appendUnsetTarget(canonicalUnset);
614
+ normalized[optionKey] = void 0;
615
+ }
616
+ for (const definition of CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS) {
617
+ const entries = normalized[definition.optionKey];
618
+ if (!Array.isArray(entries) || entries.length === 0) {
619
+ continue;
620
+ }
621
+ const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));
622
+ if (!hasLegacy) {
623
+ continue;
624
+ }
625
+ const concreteEntries = entries.filter((entry) => !isLegacyNoneToken(entry));
626
+ if (concreteEntries.length > 0) {
627
+ throw new PmCliError(`Cannot mix legacy clear token "none"/"null" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`, EXIT_CODE.USAGE);
628
+ }
629
+ normalized[definition.optionKey] = void 0;
630
+ normalized[definition.clearFlagKey] = true;
631
+ }
632
+ return normalized;
633
+ }
634
+ function parseOptionalString(value) {
635
+ if (value === void 0)
636
+ return void 0;
637
+ return value;
638
+ }
639
+ function resolveRuntimeCreateUnsetDefinition(token, runtimeFieldRegistry) {
640
+ if (!runtimeFieldRegistry) {
641
+ return void 0;
642
+ }
643
+ for (const definition of runtimeFieldRegistry.definitions) {
644
+ if (definition.allow_unset === false) {
645
+ continue;
646
+ }
647
+ const candidates = /* @__PURE__ */ new Set([
648
+ definition.key,
649
+ definition.metadata_key,
650
+ definition.cli_flag.replaceAll("-", "_"),
651
+ definition.cli_flag,
652
+ ...definition.cli_aliases.map((alias) => alias.replaceAll("-", "_")),
653
+ ...definition.cli_aliases
654
+ ]);
655
+ if (!candidates.has(token)) {
656
+ continue;
657
+ }
658
+ return {
659
+ optionKey: definition.key,
660
+ frontMatterKey: definition.metadata_key
661
+ };
662
+ }
663
+ return void 0;
664
+ }
665
+ function parseCreateUnsetTargets(raw, runtimeFieldRegistry) {
666
+ const frontMatterKeys = /* @__PURE__ */ new Set();
667
+ const optionKeys = /* @__PURE__ */ new Set();
668
+ if (!raw || raw.length === 0) {
669
+ return { frontMatterKeys, optionKeys };
670
+ }
671
+ for (const entry of raw) {
672
+ const trimmed = entry.trim().toLowerCase();
673
+ if (!trimmed) {
674
+ throw new PmCliError("--unset values must not be empty", EXIT_CODE.USAGE);
675
+ }
676
+ if (isLegacyNoneToken(trimmed)) {
677
+ throw new PmCliError('--unset no longer accepts "none" or "null". Specify concrete field names such as --unset deadline', EXIT_CODE.USAGE);
678
+ }
679
+ const definition = CREATE_UNSET_ALIAS_MAP.get(trimmed) ?? resolveRuntimeCreateUnsetDefinition(trimmed, runtimeFieldRegistry);
680
+ if (!definition) {
681
+ throw new PmCliError(`Unsupported --unset field "${entry}". Supported fields: ${CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS}`, EXIT_CODE.USAGE);
682
+ }
683
+ frontMatterKeys.add(definition.frontMatterKey);
684
+ optionKeys.add(definition.optionKey);
685
+ }
686
+ return { frontMatterKeys, optionKeys };
687
+ }
688
+ function parseDependencies(raw, nowValue, prefix) {
689
+ if (!raw || raw.length === 0)
690
+ return { values: void 0, explicitEmpty: false };
691
+ assertNoLegacyNoneTokens(raw, "--dep", "Use --clear-deps to clear dependencies.");
692
+ const values = raw.map((entry) => {
693
+ const trimmedEntry = entry.trim();
694
+ const kv = looksLikeStructuredEntry(trimmedEntry, ["id", "kind", "type", "author", "created_at"]) ? parseCsvKv(entry, "--dep") : { id: trimmedEntry, kind: "related" };
695
+ const id = parseOptionalString(kv.id);
696
+ const kind = normalizeDependencyKindInput(parseOptionalString(kv.kind ?? kv.type));
697
+ if (!id || !kind) {
698
+ throw new PmCliError("--dep requires id and kind, or a bare item id to create a related dependency", EXIT_CODE.USAGE);
699
+ }
700
+ if (id.trim().toLowerCase() === "undefined") {
701
+ throw new PmCliError(`--dep id must not use placeholder token "${id}". Use --clear-deps to clear dependencies.`, EXIT_CODE.USAGE);
702
+ }
703
+ return {
704
+ id: normalizeItemId(id, prefix),
705
+ kind: ensureEnumValue(kind, DEPENDENCY_KIND_VALUES, "dependency kind"),
706
+ created_at: parseCreatedAt(kv.created_at, nowValue),
707
+ author: parseOptionalString(kv.author)
708
+ };
709
+ });
710
+ return { values, explicitEmpty: false };
711
+ }
712
+ var DEPENDENCY_KIND_INPUT_ALIASES = {
713
+ "blocked-by": "blocked_by",
714
+ depends_on: "blocked_by",
715
+ "depends-on": "blocked_by"
716
+ };
717
+ function normalizeDependencyKindInput(raw) {
718
+ if (typeof raw !== "string") {
719
+ return raw;
720
+ }
721
+ const alias = DEPENDENCY_KIND_INPUT_ALIASES[raw.toLowerCase()];
722
+ return alias ?? raw;
723
+ }
724
+ function looksLikeStructuredEntry(raw, keys) {
725
+ if (raw.startsWith("```") || raw.includes("\n")) {
726
+ return true;
727
+ }
728
+ const keyPattern = keys.map((key) => key.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
729
+ return new RegExp(`^(?:[-*+]\\s+)?(?:${keyPattern})\\s*[:=]`, "i").test(raw);
730
+ }
731
+ function parseLogSeed(optionName, raw, nowValue, fallbackAuthor) {
732
+ if (!raw || raw.length === 0)
733
+ return { values: void 0, explicitEmpty: false };
734
+ const clearHint = optionName === "--comment" ? "Use --clear-comments to clear comments." : optionName === "--note" ? "Use --clear-notes to clear notes." : "Use --clear-learnings to clear learnings.";
735
+ assertNoLegacyNoneTokens(raw, optionName, clearHint);
736
+ const values = raw.map((entry) => {
737
+ const trimmedEntry = entry.trim();
738
+ const buildPlainTextCommentSeed = () => {
739
+ if (trimmedEntry.length === 0) {
740
+ throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);
741
+ }
742
+ return {
743
+ created_at: nowValue,
744
+ author: fallbackAuthor,
745
+ text: trimmedEntry
746
+ };
747
+ };
748
+ let kv;
749
+ try {
750
+ kv = parseCsvKv(entry, optionName);
751
+ } catch (error) {
752
+ if (optionName === "--comment" || optionName === "--note" || optionName === "--learning") {
753
+ return buildPlainTextCommentSeed();
754
+ }
755
+ throw error;
756
+ }
757
+ const unsupportedKeys = Object.keys(kv).filter((key) => !LOG_SEED_ALLOWED_KEYS.has(key));
758
+ if (unsupportedKeys.length > 0) {
759
+ return {
760
+ created_at: parseCreatedAt(kv.created_at, nowValue),
761
+ author: parseOptionalString(kv.author) ?? fallbackAuthor,
762
+ text: trimmedEntry
763
+ };
764
+ }
765
+ const text = kv.text ?? "";
766
+ if (text === "") {
767
+ throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);
768
+ }
769
+ return {
770
+ created_at: parseCreatedAt(kv.created_at, nowValue),
771
+ author: parseOptionalString(kv.author) ?? fallbackAuthor,
772
+ text
773
+ };
774
+ });
775
+ return { values, explicitEmpty: false };
776
+ }
777
+ function parseFiles(raw) {
778
+ if (!raw || raw.length === 0)
779
+ return { values: void 0, explicitEmpty: false };
780
+ assertNoLegacyNoneTokens(raw, "--file", "Use --clear-files to clear linked files.");
781
+ const values = raw.map((entry) => {
782
+ const trimmedEntry = entry.trim();
783
+ const kv = looksLikeStructuredEntry(trimmedEntry, ["path", "scope", "note"]) ? parseCsvKv(entry, "--file") : { path: trimmedEntry };
784
+ if (!kv.path) {
785
+ throw new PmCliError("--file requires path=<value> or a bare file path", EXIT_CODE.USAGE);
786
+ }
787
+ return {
788
+ path: kv.path,
789
+ scope: ensureEnumValue(kv.scope ?? "project", SCOPE_VALUES, "file scope"),
790
+ note: parseOptionalString(kv.note)
791
+ };
792
+ });
793
+ return { values, explicitEmpty: false };
794
+ }
795
+ function parseTests(raw) {
796
+ if (!raw || raw.length === 0)
797
+ return { values: void 0, explicitEmpty: false };
798
+ assertNoLegacyNoneTokens(raw, "--test", "Use --clear-tests to clear linked tests.");
799
+ const values = raw.map((entry) => {
800
+ const trimmedEntry = entry.trim();
801
+ const kv = looksLikeStructuredLinkedTestEntry(trimmedEntry) ? normalizeStructuredLinkedTestEntry(parseCsvKv(entry, "--test"), "--test") : { command: trimmedEntry };
802
+ const command = parseOptionalString(kv.command);
803
+ const filePath = parseOptionalString(kv.path);
804
+ if (!command) {
805
+ throw new PmCliError("--test requires command=<value> or a bare command (path=<value> is optional metadata)", EXIT_CODE.USAGE);
806
+ }
807
+ const timeoutSecondsRaw = parseOptionalString(kv.timeout_seconds);
808
+ const timeoutAliasRaw = parseOptionalString(kv.timeout);
809
+ if (timeoutSecondsRaw && timeoutAliasRaw && timeoutSecondsRaw !== timeoutAliasRaw) {
810
+ throw new PmCliError("--test timeout and timeout_seconds must match when both are provided", EXIT_CODE.USAGE);
811
+ }
812
+ const timeoutRaw = timeoutSecondsRaw ?? timeoutAliasRaw;
813
+ return {
814
+ command,
815
+ path: filePath,
816
+ scope: ensureEnumValue(kv.scope ?? "project", SCOPE_VALUES, "test scope"),
817
+ timeout_seconds: timeoutRaw ? parseOptionalNumber(timeoutRaw, "timeout_seconds") : void 0,
818
+ pm_context_mode: parseLinkedTestContextMode(kv.pm_context_mode, "--test"),
819
+ env_set: parseLinkedTestEnvSet(kv.env_set, "--test"),
820
+ env_clear: parseLinkedTestEnvClear(kv.env_clear, "--test"),
821
+ shared_host_safe: parseLinkedTestBoolean(kv.shared_host_safe, "--test", "shared_host_safe"),
822
+ assert_stdout_contains: parseLinkedTestStringList(kv.assert_stdout_contains),
823
+ assert_stdout_regex: parseLinkedTestRegexList(kv.assert_stdout_regex, "--test", "assert_stdout_regex"),
824
+ assert_stderr_contains: parseLinkedTestStringList(kv.assert_stderr_contains),
825
+ assert_stderr_regex: parseLinkedTestRegexList(kv.assert_stderr_regex, "--test", "assert_stderr_regex"),
826
+ assert_stdout_min_lines: parseLinkedTestMinLines(kv.assert_stdout_min_lines, "--test"),
827
+ assert_json_field_equals: parseLinkedTestAssertionEqualsMap(kv.assert_json_field_equals, "--test"),
828
+ assert_json_field_gte: parseLinkedTestAssertionGteMap(kv.assert_json_field_gte, "--test"),
829
+ note: parseOptionalString(kv.note)
830
+ };
831
+ });
832
+ return { values, explicitEmpty: false };
833
+ }
834
+ function parseDocs(raw) {
835
+ if (!raw || raw.length === 0)
836
+ return { values: void 0, explicitEmpty: false };
837
+ assertNoLegacyNoneTokens(raw, "--doc", "Use --clear-docs to clear linked docs.");
838
+ const values = raw.map((entry) => {
839
+ const trimmedEntry = entry.trim();
840
+ const kv = looksLikeStructuredEntry(trimmedEntry, ["path", "scope", "note"]) ? parseCsvKv(entry, "--doc") : { path: trimmedEntry };
841
+ if (!kv.path) {
842
+ throw new PmCliError("--doc requires path=<value> or a bare doc path", EXIT_CODE.USAGE);
843
+ }
844
+ return {
845
+ path: kv.path,
846
+ scope: ensureEnumValue(kv.scope ?? "project", SCOPE_VALUES, "doc scope"),
847
+ note: parseOptionalString(kv.note)
848
+ };
849
+ });
850
+ return { values, explicitEmpty: false };
851
+ }
852
+ function parseReminders(raw, nowValue) {
853
+ if (!raw || raw.length === 0)
854
+ return { values: void 0, explicitEmpty: false };
855
+ assertNoLegacyNoneTokens(raw, "--reminder", "Use --clear-reminders to clear reminders.");
856
+ return {
857
+ values: parseReminderEntries(raw, new Date(nowValue), { valueMode: "raw" }),
858
+ explicitEmpty: false
859
+ };
860
+ }
861
+ function parseEvents(raw, nowValue) {
862
+ if (!raw || raw.length === 0)
863
+ return { values: void 0, explicitEmpty: false };
864
+ assertNoLegacyNoneTokens(raw, "--event", "Use --clear-events to clear linked events.");
865
+ return {
866
+ values: parseEventEntries(raw, new Date(nowValue), {
867
+ allDayEmptyGuard: "defined",
868
+ recurrenceEmptyNumericGuard: "defined"
869
+ }),
870
+ explicitEmpty: false
871
+ };
872
+ }
873
+ function buildChangedFields(frontMatter, body, explicitUnsets, additionalFrontMatterKeys = []) {
874
+ const changed = [
875
+ ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== void 0),
876
+ ...additionalFrontMatterKeys.filter((key) => frontMatter[key] !== void 0),
877
+ ...body.length > 0 ? ["body"] : [],
878
+ ...explicitUnsets.map((key) => `unset:${key}`)
879
+ ];
880
+ return Array.from(new Set(changed));
881
+ }
882
+ function buildHistoryMessage(baseMessage, explicitUnsets) {
883
+ const trimmed = baseMessage ?? "";
884
+ if (explicitUnsets.length === 0) {
885
+ return trimmed;
886
+ }
887
+ const suffix = `explicit_unset=${explicitUnsets.join(",")}`;
888
+ return trimmed ? `${trimmed} | ${suffix}` : suffix;
889
+ }
890
+ function normalizeCreatePolicyOptionKey(raw, typeName, sourceLabel) {
891
+ const canonical = canonicalizeCommandOptionKey("create", raw);
892
+ if (!canonical) {
893
+ throw new PmCliError(`Unsupported ${sourceLabel} entry "${raw}" for type "${typeName}"`, EXIT_CODE.CONFLICT);
894
+ }
895
+ return canonical;
896
+ }
897
+ function parseTypeOptions(raw) {
898
+ if (!raw || raw.length === 0) {
899
+ return { values: void 0, explicitEmpty: false };
900
+ }
901
+ assertNoLegacyNoneTokens(raw, "--type-option", "Use --clear-type-options to clear existing type options.");
902
+ return {
903
+ values: parseTypeOptionEntries(raw),
904
+ explicitEmpty: false
905
+ };
906
+ }
907
+ async function resolveCreateStdinInputs(options) {
908
+ const stdinResolver = createStdinTokenResolver();
909
+ return {
910
+ ...options,
911
+ body: await stdinResolver.resolveValue(options.body, "--body"),
912
+ dep: await stdinResolver.resolveList(options.dep, "--dep"),
913
+ comment: await stdinResolver.resolveList(options.comment, "--comment"),
914
+ note: await stdinResolver.resolveList(options.note, "--note"),
915
+ learning: await stdinResolver.resolveList(options.learning, "--learning"),
916
+ file: await stdinResolver.resolveList(options.file, "--file"),
917
+ test: await stdinResolver.resolveList(options.test, "--test"),
918
+ doc: await stdinResolver.resolveList(options.doc, "--doc"),
919
+ reminder: await stdinResolver.resolveList(options.reminder, "--reminder"),
920
+ event: await stdinResolver.resolveList(options.event, "--event"),
921
+ typeOption: await stdinResolver.resolveList(options.typeOption, "--type-option"),
922
+ field: await stdinResolver.resolveList(options.field, "--field")
923
+ };
924
+ }
925
+ function resolveCreateMode(createMode, defaultMode) {
926
+ if (createMode === void 0) {
927
+ return defaultMode;
928
+ }
929
+ const normalized = createMode.trim().toLowerCase();
930
+ if (normalized.length === 0) {
931
+ return defaultMode;
932
+ }
933
+ if (normalized === "strict" || normalized === "progressive") {
934
+ return normalized;
935
+ }
936
+ throw new PmCliError(`Invalid --create-mode value "${createMode}". Allowed: ${CREATE_MODE_VALUES.join(", ")}`, EXIT_CODE.USAGE);
937
+ }
938
+ function resolveScheduleCreatePreset(raw) {
939
+ if (raw === void 0) {
940
+ return void 0;
941
+ }
942
+ const normalized = raw.trim().toLowerCase();
943
+ if (normalized.length === 0) {
944
+ throw new PmCliError("--schedule-preset must not be empty", EXIT_CODE.USAGE);
945
+ }
946
+ if (normalized === "lightweight" || normalized === "lite" || normalized === "schedule-lite") {
947
+ return "lightweight";
948
+ }
949
+ throw new PmCliError(`Invalid --schedule-preset value "${raw}". Allowed: ${SCHEDULE_CREATE_PRESET_VALUES.join(", ")}`, EXIT_CODE.USAGE);
950
+ }
951
+ function resolveEffectiveCreateMode(createMode, schedulePreset, defaultMode) {
952
+ const resolvedMode = resolveCreateMode(createMode, defaultMode);
953
+ if (schedulePreset === void 0) {
954
+ return resolvedMode;
955
+ }
956
+ const createModeWasExplicit = typeof createMode === "string" && createMode.trim().length > 0;
957
+ if (createModeWasExplicit && resolvedMode === "strict") {
958
+ throw new PmCliError("--schedule-preset lightweight cannot be combined with --create-mode strict. Use --create-mode progressive or omit --create-mode.", EXIT_CODE.USAGE);
959
+ }
960
+ return "progressive";
961
+ }
962
+ function requireCreateOptionByType(typeDefinition, options, createMode, clearOptionKeys) {
963
+ const typeName = typeDefinition.name;
964
+ const scalarValues = {
965
+ title: options.title,
966
+ description: options.description,
967
+ type: options.type,
968
+ status: options.status,
969
+ priority: options.priority,
970
+ tags: options.tags,
971
+ body: options.body,
972
+ deadline: options.deadline,
973
+ estimatedMinutes: options.estimatedMinutes,
974
+ acceptanceCriteria: options.acceptanceCriteria,
975
+ definitionOfReady: options.definitionOfReady,
976
+ order: options.order ?? options.rank,
977
+ goal: options.goal,
978
+ objective: options.objective,
979
+ value: options.value,
980
+ impact: options.impact,
981
+ outcome: options.outcome,
982
+ whyNow: options.whyNow,
983
+ author: options.author,
984
+ message: options.message,
985
+ assignee: options.assignee,
986
+ parent: options.parent,
987
+ reviewer: options.reviewer,
988
+ risk: options.risk,
989
+ confidence: options.confidence,
990
+ sprint: options.sprint,
991
+ release: options.release,
992
+ blockedBy: options.blockedBy,
993
+ blockedReason: options.blockedReason,
994
+ unblockNote: options.unblockNote,
995
+ reporter: options.reporter,
996
+ severity: options.severity,
997
+ environment: options.environment,
998
+ reproSteps: options.reproSteps,
999
+ resolution: options.resolution,
1000
+ expectedResult: options.expectedResult,
1001
+ actualResult: options.actualResult,
1002
+ affectedVersion: options.affectedVersion,
1003
+ fixedVersion: options.fixedVersion,
1004
+ component: options.component,
1005
+ regression: options.regression,
1006
+ customerImpact: options.customerImpact
1007
+ };
1008
+ const repeatableValues = {
1009
+ dep: options.dep,
1010
+ comment: options.comment,
1011
+ note: options.note,
1012
+ learning: options.learning,
1013
+ file: options.file,
1014
+ test: options.test,
1015
+ doc: options.doc,
1016
+ reminder: options.reminder,
1017
+ event: options.event,
1018
+ typeOption: options.typeOption,
1019
+ field: options.field
1020
+ };
1021
+ const hasOptionValue = (optionKey) => {
1022
+ if (optionKey === "tags") {
1023
+ return scalarValues.tags !== void 0 || Array.isArray(options.addTags) && options.addTags.length > 0;
1024
+ }
1025
+ if (optionKey in scalarValues) {
1026
+ return scalarValues[optionKey] !== void 0;
1027
+ }
1028
+ if (optionKey in repeatableValues) {
1029
+ const value = repeatableValues[optionKey];
1030
+ return Array.isArray(value) && value.length > 0;
1031
+ }
1032
+ return false;
1033
+ };
1034
+ const hasOptionMutation = (optionKey) => hasOptionValue(optionKey) || clearOptionKeys.has(optionKey);
1035
+ const baseRequiredOptions = /* @__PURE__ */ new Set(["title", "type"]);
1036
+ if (createMode === "strict") {
1037
+ for (const field of typeDefinition.required_create_fields) {
1038
+ baseRequiredOptions.add(normalizeCreatePolicyOptionKey(field, typeName, "required_create_fields"));
1039
+ }
1040
+ for (const field of typeDefinition.required_create_repeatables) {
1041
+ baseRequiredOptions.add(normalizeCreatePolicyOptionKey(field, typeName, "required_create_repeatables"));
1042
+ }
1043
+ }
1044
+ const policyState = resolveCommandOptionPolicyState(typeDefinition, "create", baseRequiredOptions);
1045
+ if (policyState.errors.length > 0) {
1046
+ throw new PmCliError(policyState.errors.join("; "), EXIT_CODE.CONFLICT);
1047
+ }
1048
+ for (const option of policyState.disabled) {
1049
+ if (hasOptionMutation(option)) {
1050
+ throw new PmCliError(`Option ${commandOptionFlagLabel("create", option)} is disabled for type "${typeName}" by command_option_policies`, EXIT_CODE.USAGE);
1051
+ }
1052
+ }
1053
+ if (createMode === "strict") {
1054
+ const strictRequiredClears = policyState.required.filter((required) => clearOptionKeys.has(required));
1055
+ if (strictRequiredClears.length > 0) {
1056
+ const requiredFlags = [...new Set(strictRequiredClears.map((required) => commandOptionFlagLabel("create", required)))].sort((left, right) => left.localeCompare(right));
1057
+ throw new PmCliError(`Strict create mode requires concrete values for ${requiredFlags.join(", ")}; --unset/--clear-* directives cannot satisfy required options`, EXIT_CODE.USAGE);
1058
+ }
1059
+ }
1060
+ const satisfiesRequiredOption = (optionKey) => {
1061
+ if (optionKey === "status" && typeDefinition.default_status !== void 0) {
1062
+ return true;
1063
+ }
1064
+ return hasOptionValue(optionKey);
1065
+ };
1066
+ const missingRequiredOptions = policyState.required.filter((required) => !satisfiesRequiredOption(required));
1067
+ return [...new Set(missingRequiredOptions.map((required) => commandOptionFlagLabel("create", required)))].sort((left, right) => left.localeCompare(right));
1068
+ }
1069
+ var MISSING_REQUIRED_TYPE_OPTION_PATTERN = /^Missing required type option "([^"]+)" for type "([^"]+)"$/;
1070
+ function collectMissingRequiredTypeOptionKeys(errors, typeName) {
1071
+ const missingKeys = [];
1072
+ for (const error of errors) {
1073
+ const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);
1074
+ if (!match) {
1075
+ continue;
1076
+ }
1077
+ if (match[2] !== typeName) {
1078
+ continue;
1079
+ }
1080
+ missingKeys.push(match[1]);
1081
+ }
1082
+ return [...new Set(missingKeys)].sort((left, right) => left.localeCompare(right));
1083
+ }
1084
+ function filterNonMissingTypeOptionErrors(errors, typeName) {
1085
+ return errors.filter((error) => {
1086
+ const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);
1087
+ return !match || match[2] !== typeName;
1088
+ });
1089
+ }
1090
+ function typeOptionExampleValue(typeDefinition, key) {
1091
+ const optionDefinition = typeDefinition.options.find((option) => option.key === key);
1092
+ const firstAllowed = optionDefinition?.values[0];
1093
+ if (typeof firstAllowed === "string" && firstAllowed.trim().length > 0) {
1094
+ return firstAllowed;
1095
+ }
1096
+ return "<value>";
1097
+ }
1098
+ function createExampleTokensForFlag(flag, typeName, openStatus) {
1099
+ switch (flag) {
1100
+ case "--title":
1101
+ return ["--title", `"${typeName} example title"`];
1102
+ case "--description":
1103
+ return ["--description", `"${typeName} example description"`];
1104
+ case "--type":
1105
+ return ["--type", typeName];
1106
+ case "--status":
1107
+ return ["--status", openStatus];
1108
+ case "--priority":
1109
+ return ["--priority", "1"];
1110
+ case "--message":
1111
+ return ["--message", `"Create ${typeName} item"`];
1112
+ case "--dep":
1113
+ return ["--dep", '"id=pm-xxxx,kind=related,author=maintainer,created_at=now"'];
1114
+ case "--comment":
1115
+ return ["--comment", '"author=maintainer,created_at=now,text=Implementation context"'];
1116
+ case "--note":
1117
+ return ["--note", '"author=maintainer,created_at=now,text=Design note"'];
1118
+ case "--learning":
1119
+ return ["--learning", '"author=maintainer,created_at=now,text=Durable lesson"'];
1120
+ case "--file":
1121
+ return ["--file", '"path=src/example.ts,note=implementation file"'];
1122
+ case "--test":
1123
+ return ["--test", '"command=node scripts/run-tests.mjs test,timeout_seconds=240"'];
1124
+ case "--doc":
1125
+ return ["--doc", '"path=README.md,note=reference doc"'];
1126
+ default:
1127
+ return [flag, '"<value>"'];
1128
+ }
1129
+ }
1130
+ function buildTypeSpecificCreateExample(typeDefinition, missingCreateFlags, missingTypeOptionKeys, openStatus) {
1131
+ const tokens = ["pm", "create", "--title", `"${typeDefinition.name} example title"`, "--description", `"${typeDefinition.name} example description"`, "--type", typeDefinition.name];
1132
+ const optionalRecommendationFlags = ["--status", "--priority", "--message"];
1133
+ const orderedFlags = [.../* @__PURE__ */ new Set([...optionalRecommendationFlags, ...missingCreateFlags])];
1134
+ const includedFlags = /* @__PURE__ */ new Set(["--title", "--description", "--type"]);
1135
+ for (const flag of orderedFlags) {
1136
+ if (includedFlags.has(flag)) {
1137
+ continue;
1138
+ }
1139
+ tokens.push(...createExampleTokensForFlag(flag, typeDefinition.name, openStatus));
1140
+ includedFlags.add(flag);
1141
+ }
1142
+ for (const key of missingTypeOptionKeys) {
1143
+ const value = typeOptionExampleValue(typeDefinition, key);
1144
+ tokens.push("--type-option", `${key}=${value}`);
1145
+ }
1146
+ return tokens.join(" ");
1147
+ }
1148
+ function requireStringOption(value, flag) {
1149
+ if (value === void 0) {
1150
+ if (flag === "--title") {
1151
+ throw new PmCliError('Missing required option --title. Why required: every item needs a human-readable title for lookup, search, and reporting. Retry: pass the title as the first positional argument (example: pm create "Fix login bug" --type Issue) or with --title.', EXIT_CODE.USAGE);
1152
+ }
1153
+ throw new PmCliError(`Missing required option ${flag}`, EXIT_CODE.USAGE);
1154
+ }
1155
+ return value;
1156
+ }
1157
+ function selectAuthor(explicitAuthor, settingsAuthor) {
1158
+ const candidate = parseOptionalString(explicitAuthor) ?? process.env.PM_AUTHOR ?? settingsAuthor;
1159
+ const trimmed = candidate.trim();
1160
+ return trimmed || "unknown";
1161
+ }
1162
+ function ensurePriority(rawPriority) {
1163
+ return resolvePriority(rawPriority);
1164
+ }
1165
+ function mergeCreateOptionsWithTemplate(templateOptions, explicitOptions) {
1166
+ const merged = {};
1167
+ for (const [key, value] of Object.entries(templateOptions)) {
1168
+ merged[key] = Array.isArray(value) ? [...value] : value;
1169
+ }
1170
+ for (const [key, value] of Object.entries(explicitOptions)) {
1171
+ if (value !== void 0) {
1172
+ merged[key] = Array.isArray(value) ? [...value] : value;
1173
+ }
1174
+ }
1175
+ return merged;
1176
+ }
1177
+ function normalizeExtensionCommandPath(command) {
1178
+ return command.trim().toLowerCase().split(/\s+/).filter((part) => part.length > 0).join(" ");
1179
+ }
1180
+ function hasTemplatesShowHandler() {
1181
+ const registrations = getActiveExtensionRegistrations();
1182
+ if (!registrations) {
1183
+ return false;
1184
+ }
1185
+ return registrations.commands.some((entry) => {
1186
+ return entry.action === "templates-show" || normalizeExtensionCommandPath(entry.command) === "templates show";
1187
+ });
1188
+ }
1189
+ function readTemplateOptionsFromRuntimeResult(result, templateName) {
1190
+ if (typeof result !== "object" || result === null || !("options" in result)) {
1191
+ throw new PmCliError(`Templates package returned invalid payload for template "${templateName}". Expected an options object.`, EXIT_CODE.GENERIC_FAILURE);
1192
+ }
1193
+ const options = result.options;
1194
+ if (typeof options !== "object" || options === null || Array.isArray(options)) {
1195
+ throw new PmCliError(`Templates package returned invalid options for template "${templateName}".`, EXIT_CODE.GENERIC_FAILURE);
1196
+ }
1197
+ const normalized = {};
1198
+ for (const [key, value] of Object.entries(options)) {
1199
+ if (typeof value === "string") {
1200
+ normalized[key] = value;
1201
+ continue;
1202
+ }
1203
+ if (Array.isArray(value) && value.every((entry) => typeof entry === "string")) {
1204
+ normalized[key] = [...value];
1205
+ continue;
1206
+ }
1207
+ throw new PmCliError(`Templates package returned unsupported option value for "${key}" in template "${templateName}".`, EXIT_CODE.GENERIC_FAILURE);
1208
+ }
1209
+ return normalized;
1210
+ }
1211
+ async function loadCreateTemplateOptionsFromRuntime(templateName, global, pmRoot) {
1212
+ if (!hasTemplatesShowHandler()) {
1213
+ throw new PmCliError(`--template requires the templates package. Install it first (for example: pm install templates --project).`, EXIT_CODE.USAGE);
1214
+ }
1215
+ const handlerResult = await runActiveCommandHandler({
1216
+ command: "templates show",
1217
+ args: [templateName],
1218
+ options: {},
1219
+ global,
1220
+ pm_root: pmRoot
1221
+ });
1222
+ if (!handlerResult.handled) {
1223
+ const warningSuffix = handlerResult.warnings.length > 0 ? ` (${handlerResult.warnings.join(", ")})` : "";
1224
+ throw new PmCliError(`Unable to resolve template "${templateName}" via templates package. Run "pm templates show ${templateName}" for details.${warningSuffix}`, EXIT_CODE.USAGE);
1225
+ }
1226
+ return readTemplateOptionsFromRuntimeResult(handlerResult.result, templateName);
1227
+ }
1228
+ function ensureInitHasRun(pmRoot) {
1229
+ return pathExists(getSettingsPath(pmRoot)).then((exists) => {
1230
+ if (!exists) {
1231
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
1232
+ }
1233
+ });
1234
+ }
1235
+ async function runCreate(options, global) {
1236
+ let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));
1237
+ const pmRoot = resolvePmRoot(process.cwd(), global.path);
1238
+ await ensureInitHasRun(pmRoot);
1239
+ const settings = await readSettings(pmRoot);
1240
+ const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1241
+ const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
1242
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1243
+ if (resolvedOptions.template !== void 0) {
1244
+ const templateName = resolvedOptions.template.trim();
1245
+ if (templateName.length === 0) {
1246
+ throw new PmCliError("--template must not be empty. Omit --template to disable template usage.", EXIT_CODE.USAGE);
1247
+ }
1248
+ const templateOptions = await loadCreateTemplateOptionsFromRuntime(templateName, global, pmRoot);
1249
+ resolvedOptions = normalizeLegacyNoneCreateOptions(mergeCreateOptionsWithTemplate(templateOptions, resolvedOptions));
1250
+ }
1251
+ if (resolvedOptions.type === void 0) {
1252
+ const explicitStrictMode = typeof resolvedOptions.createMode === "string" && resolvedOptions.createMode.trim().toLowerCase() === "strict";
1253
+ if (!explicitStrictMode) {
1254
+ const defaultType = settings.governance.create_default_type?.trim();
1255
+ if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {
1256
+ resolvedOptions.type = defaultType;
1257
+ } else if (resolveTypeName("Task", typeRegistry)) {
1258
+ resolvedOptions.type = "Task";
1259
+ }
1260
+ }
1261
+ }
1262
+ if (resolvedOptions.type === void 0) {
1263
+ throw new PmCliError("Missing required option --type <value>", EXIT_CODE.USAGE);
1264
+ }
1265
+ let resolvedTypeName = resolveTypeName(resolvedOptions.type, typeRegistry);
1266
+ if (!resolvedTypeName) {
1267
+ const synonymCanonical = resolveTypeSynonym(resolvedOptions.type);
1268
+ const synonymResolved = synonymCanonical ? resolveTypeName(synonymCanonical, typeRegistry) : void 0;
1269
+ if (synonymResolved) {
1270
+ printError(`[pm] note: type '${resolvedOptions.type.trim()}' is not defined; using closest match '${synonymResolved}'. Run 'pm schema add-type "${resolvedOptions.type.trim()}"' to track it as a distinct type.`);
1271
+ resolvedOptions.type = synonymResolved;
1272
+ resolvedTypeName = synonymResolved;
1273
+ } else {
1274
+ throw new PmCliError(buildInvalidTypeError(resolvedOptions.type, typeRegistry.types), EXIT_CODE.USAGE);
1275
+ }
1276
+ }
1277
+ const typeDefinition = resolveTypeDefinition(resolvedTypeName, typeRegistry);
1278
+ if (!typeDefinition) {
1279
+ throw new PmCliError(`Invalid type value "${resolvedOptions.type}"`, EXIT_CODE.USAGE);
1280
+ }
1281
+ const type = typeDefinition.name;
1282
+ const schedulePreset = resolveScheduleCreatePreset(resolvedOptions.schedulePreset);
1283
+ if (schedulePreset !== void 0 && !SCHEDULE_CREATE_PRESET_TYPES.has(type)) {
1284
+ throw new PmCliError(`--schedule-preset ${schedulePreset} is only supported for Reminder, Meeting, or Event types`, EXIT_CODE.USAGE);
1285
+ }
1286
+ const createMode = resolveEffectiveCreateMode(resolvedOptions.createMode, schedulePreset, settings.governance.create_mode_default);
1287
+ const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);
1288
+ const explicitUnsets = new Set(unsetTargets.frontMatterKeys);
1289
+ const clearOptionKeys = new Set(unsetTargets.optionKeys);
1290
+ const clearCollectionDefinitions = [
1291
+ {
1292
+ enabled: resolvedOptions.clearDeps,
1293
+ optionKey: "dep",
1294
+ clearFlag: "--clear-deps",
1295
+ valueFlag: "--dep",
1296
+ values: resolvedOptions.dep,
1297
+ frontMatterKey: "dependencies"
1298
+ },
1299
+ {
1300
+ enabled: resolvedOptions.clearComments,
1301
+ optionKey: "comment",
1302
+ clearFlag: "--clear-comments",
1303
+ valueFlag: "--comment",
1304
+ values: resolvedOptions.comment,
1305
+ frontMatterKey: "comments"
1306
+ },
1307
+ {
1308
+ enabled: resolvedOptions.clearNotes,
1309
+ optionKey: "note",
1310
+ clearFlag: "--clear-notes",
1311
+ valueFlag: "--note",
1312
+ values: resolvedOptions.note,
1313
+ frontMatterKey: "notes"
1314
+ },
1315
+ {
1316
+ enabled: resolvedOptions.clearLearnings,
1317
+ optionKey: "learning",
1318
+ clearFlag: "--clear-learnings",
1319
+ valueFlag: "--learning",
1320
+ values: resolvedOptions.learning,
1321
+ frontMatterKey: "learnings"
1322
+ },
1323
+ {
1324
+ enabled: resolvedOptions.clearFiles,
1325
+ optionKey: "file",
1326
+ clearFlag: "--clear-files",
1327
+ valueFlag: "--file",
1328
+ values: resolvedOptions.file,
1329
+ frontMatterKey: "files"
1330
+ },
1331
+ {
1332
+ enabled: resolvedOptions.clearTests,
1333
+ optionKey: "test",
1334
+ clearFlag: "--clear-tests",
1335
+ valueFlag: "--test",
1336
+ values: resolvedOptions.test,
1337
+ frontMatterKey: "tests"
1338
+ },
1339
+ {
1340
+ enabled: resolvedOptions.clearDocs,
1341
+ optionKey: "doc",
1342
+ clearFlag: "--clear-docs",
1343
+ valueFlag: "--doc",
1344
+ values: resolvedOptions.doc,
1345
+ frontMatterKey: "docs"
1346
+ },
1347
+ {
1348
+ enabled: resolvedOptions.clearReminders,
1349
+ optionKey: "reminder",
1350
+ clearFlag: "--clear-reminders",
1351
+ valueFlag: "--reminder",
1352
+ values: resolvedOptions.reminder,
1353
+ frontMatterKey: "reminders"
1354
+ },
1355
+ {
1356
+ enabled: resolvedOptions.clearEvents,
1357
+ optionKey: "event",
1358
+ clearFlag: "--clear-events",
1359
+ valueFlag: "--event",
1360
+ values: resolvedOptions.event,
1361
+ frontMatterKey: "events"
1362
+ },
1363
+ {
1364
+ enabled: resolvedOptions.clearTypeOptions,
1365
+ optionKey: "typeOption",
1366
+ clearFlag: "--clear-type-options",
1367
+ valueFlag: "--type-option",
1368
+ values: resolvedOptions.typeOption,
1369
+ frontMatterKey: "type_options"
1370
+ }
1371
+ ];
1372
+ for (const definition of clearCollectionDefinitions) {
1373
+ if (!definition.enabled) {
1374
+ continue;
1375
+ }
1376
+ if (definition.values && definition.values.length > 0) {
1377
+ throw new PmCliError(`Cannot combine ${definition.clearFlag} with ${definition.valueFlag}`, EXIT_CODE.USAGE);
1378
+ }
1379
+ explicitUnsets.add(definition.frontMatterKey);
1380
+ clearOptionKeys.add(definition.optionKey);
1381
+ }
1382
+ const scalarOptionPresence = {
1383
+ tags: resolvedOptions.tags !== void 0,
1384
+ deadline: resolvedOptions.deadline !== void 0,
1385
+ estimatedMinutes: resolvedOptions.estimatedMinutes !== void 0,
1386
+ acceptanceCriteria: resolvedOptions.acceptanceCriteria !== void 0,
1387
+ definitionOfReady: resolvedOptions.definitionOfReady !== void 0,
1388
+ order: resolvedOptions.order !== void 0 || resolvedOptions.rank !== void 0,
1389
+ goal: resolvedOptions.goal !== void 0,
1390
+ objective: resolvedOptions.objective !== void 0,
1391
+ value: resolvedOptions.value !== void 0,
1392
+ impact: resolvedOptions.impact !== void 0,
1393
+ outcome: resolvedOptions.outcome !== void 0,
1394
+ whyNow: resolvedOptions.whyNow !== void 0,
1395
+ author: resolvedOptions.author !== void 0,
1396
+ assignee: resolvedOptions.assignee !== void 0,
1397
+ parent: resolvedOptions.parent !== void 0,
1398
+ reviewer: resolvedOptions.reviewer !== void 0,
1399
+ risk: resolvedOptions.risk !== void 0,
1400
+ confidence: resolvedOptions.confidence !== void 0,
1401
+ sprint: resolvedOptions.sprint !== void 0,
1402
+ release: resolvedOptions.release !== void 0,
1403
+ blockedBy: resolvedOptions.blockedBy !== void 0,
1404
+ blockedReason: resolvedOptions.blockedReason !== void 0,
1405
+ unblockNote: resolvedOptions.unblockNote !== void 0,
1406
+ reporter: resolvedOptions.reporter !== void 0,
1407
+ severity: resolvedOptions.severity !== void 0,
1408
+ environment: resolvedOptions.environment !== void 0,
1409
+ reproSteps: resolvedOptions.reproSteps !== void 0,
1410
+ resolution: resolvedOptions.resolution !== void 0,
1411
+ expectedResult: resolvedOptions.expectedResult !== void 0,
1412
+ actualResult: resolvedOptions.actualResult !== void 0,
1413
+ affectedVersion: resolvedOptions.affectedVersion !== void 0,
1414
+ fixedVersion: resolvedOptions.fixedVersion !== void 0,
1415
+ component: resolvedOptions.component !== void 0,
1416
+ regression: resolvedOptions.regression !== void 0,
1417
+ customerImpact: resolvedOptions.customerImpact !== void 0
1418
+ };
1419
+ for (const [optionKey, hasValue] of Object.entries(scalarOptionPresence)) {
1420
+ if (!hasValue || !unsetTargets.optionKeys.has(optionKey)) {
1421
+ continue;
1422
+ }
1423
+ const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey;
1424
+ throw new PmCliError(`Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel("create", optionKey)}`, EXIT_CODE.USAGE);
1425
+ }
1426
+ const assertNoLegacyScalarToken = (value2, optionKey) => {
1427
+ const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);
1428
+ const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : void 0;
1429
+ assertNoLegacyNoneToken(value2, commandOptionFlagLabel("create", optionKey), hint);
1430
+ };
1431
+ assertNoLegacyScalarToken(resolvedOptions.tags, "tags");
1432
+ assertNoLegacyScalarToken(resolvedOptions.deadline, "deadline");
1433
+ assertNoLegacyScalarToken(resolvedOptions.estimatedMinutes, "estimatedMinutes");
1434
+ assertNoLegacyScalarToken(resolvedOptions.acceptanceCriteria, "acceptanceCriteria");
1435
+ assertNoLegacyScalarToken(resolvedOptions.definitionOfReady, "definitionOfReady");
1436
+ assertNoLegacyScalarToken(resolvedOptions.order ?? resolvedOptions.rank, "order");
1437
+ assertNoLegacyScalarToken(resolvedOptions.goal, "goal");
1438
+ assertNoLegacyScalarToken(resolvedOptions.objective, "objective");
1439
+ assertNoLegacyScalarToken(resolvedOptions.value, "value");
1440
+ assertNoLegacyScalarToken(resolvedOptions.impact, "impact");
1441
+ assertNoLegacyScalarToken(resolvedOptions.outcome, "outcome");
1442
+ assertNoLegacyScalarToken(resolvedOptions.whyNow, "whyNow");
1443
+ assertNoLegacyScalarToken(resolvedOptions.author, "author");
1444
+ assertNoLegacyScalarToken(resolvedOptions.assignee, "assignee");
1445
+ assertNoLegacyScalarToken(resolvedOptions.parent, "parent");
1446
+ assertNoLegacyScalarToken(resolvedOptions.reviewer, "reviewer");
1447
+ assertNoLegacyScalarToken(resolvedOptions.risk, "risk");
1448
+ assertNoLegacyScalarToken(resolvedOptions.confidence, "confidence");
1449
+ assertNoLegacyScalarToken(resolvedOptions.sprint, "sprint");
1450
+ assertNoLegacyScalarToken(resolvedOptions.release, "release");
1451
+ assertNoLegacyScalarToken(resolvedOptions.blockedBy, "blockedBy");
1452
+ assertNoLegacyScalarToken(resolvedOptions.blockedReason, "blockedReason");
1453
+ assertNoLegacyScalarToken(resolvedOptions.unblockNote, "unblockNote");
1454
+ assertNoLegacyScalarToken(resolvedOptions.reporter, "reporter");
1455
+ assertNoLegacyScalarToken(resolvedOptions.severity, "severity");
1456
+ assertNoLegacyScalarToken(resolvedOptions.environment, "environment");
1457
+ assertNoLegacyScalarToken(resolvedOptions.reproSteps, "reproSteps");
1458
+ assertNoLegacyScalarToken(resolvedOptions.resolution, "resolution");
1459
+ assertNoLegacyScalarToken(resolvedOptions.expectedResult, "expectedResult");
1460
+ assertNoLegacyScalarToken(resolvedOptions.actualResult, "actualResult");
1461
+ assertNoLegacyScalarToken(resolvedOptions.affectedVersion, "affectedVersion");
1462
+ assertNoLegacyScalarToken(resolvedOptions.fixedVersion, "fixedVersion");
1463
+ assertNoLegacyScalarToken(resolvedOptions.component, "component");
1464
+ assertNoLegacyScalarToken(resolvedOptions.regression, "regression");
1465
+ assertNoLegacyScalarToken(resolvedOptions.customerImpact, "customerImpact");
1466
+ const missingRequiredCreateFlags = requireCreateOptionByType(typeDefinition, resolvedOptions, createMode, clearOptionKeys);
1467
+ const nowValue = nowIso();
1468
+ const author = selectAuthor(resolvedOptions.author, settings.author_default);
1469
+ const dependencies = parseDependencies(resolvedOptions.dep, nowValue, settings.id_prefix);
1470
+ const comments = parseLogSeed("--comment", resolvedOptions.comment, nowValue, author);
1471
+ const notes = parseLogSeed("--note", resolvedOptions.note, nowValue, author);
1472
+ const learnings = parseLogSeed("--learning", resolvedOptions.learning, nowValue, author);
1473
+ const files = parseFiles(resolvedOptions.file);
1474
+ const tests = parseTests(resolvedOptions.test);
1475
+ const docs = parseDocs(resolvedOptions.doc);
1476
+ const reminders = parseReminders(resolvedOptions.reminder, nowValue);
1477
+ const events = parseEvents(resolvedOptions.event, nowValue);
1478
+ const typeOptions = parseTypeOptions(resolvedOptions.typeOption);
1479
+ const validatedTypeOptions = validateTypeOptions(type, typeOptions.values, typeRegistry);
1480
+ const extensionRegistrations = getActiveExtensionRegistrations();
1481
+ const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);
1482
+ const registeredItemFieldValues = parseRegisteredItemFieldAssignments(resolvedOptions.field, extensionRegistrations);
1483
+ for (const fieldKey of Object.keys(registeredItemFieldValues)) {
1484
+ if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
1485
+ continue;
1486
+ }
1487
+ throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);
1488
+ }
1489
+ const runtimeCreateFieldValues = collectRuntimeCreateFieldValues(resolvedOptions, runtimeFieldRegistry, type);
1490
+ for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {
1491
+ if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
1492
+ continue;
1493
+ }
1494
+ throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with its value flag`, EXIT_CODE.USAGE);
1495
+ }
1496
+ const missingRequiredTypeOptionKeys = collectMissingRequiredTypeOptionKeys(validatedTypeOptions.errors, type);
1497
+ const missingRequiredTypeOptionFlags = missingRequiredTypeOptionKeys.map((key) => `--type-option ${key}=<value>`);
1498
+ const combinedMissingFlags = [
1499
+ .../* @__PURE__ */ new Set([
1500
+ ...missingRequiredCreateFlags,
1501
+ ...missingRequiredTypeOptionFlags,
1502
+ ...runtimeCreateFieldValues.missing_required_flags
1503
+ ])
1504
+ ].sort((left, right) => left.localeCompare(right));
1505
+ if (combinedMissingFlags.length > 0) {
1506
+ const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, statusRegistry.open_status);
1507
+ const nextSteps = [`Run "pm create --help --type ${type}" for type-aware required option guidance.`];
1508
+ if (combinedMissingFlags.includes("--title")) {
1509
+ nextSteps.push('Title can also be passed as the first positional argument (example: pm create "Your title" --type ' + type + ").");
1510
+ }
1511
+ if (createMode === "strict") {
1512
+ nextSteps.push('For staged onboarding, retry with "--create-mode progressive".');
1513
+ if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {
1514
+ nextSteps.push('For minimal scheduling inputs, try "--schedule-preset lightweight".');
1515
+ }
1516
+ }
1517
+ const errorMessage = combinedMissingFlags.length === 1 ? `Missing required option ${combinedMissingFlags[0]} for type "${type}"` : `Missing required options ${combinedMissingFlags.join(", ")} for type "${type}"`;
1518
+ throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {
1519
+ code: "missing_required_option",
1520
+ required: `Provide all required create options and type options for type "${type}" in one invocation.`,
1521
+ examples: [nextValidExample],
1522
+ nextSteps
1523
+ });
1524
+ }
1525
+ const nonMissingTypeOptionErrors = filterNonMissingTypeOptionErrors(validatedTypeOptions.errors, type);
1526
+ if (nonMissingTypeOptionErrors.length > 0) {
1527
+ const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, [], [], statusRegistry.open_status);
1528
+ throw new PmCliError(nonMissingTypeOptionErrors.join("; "), EXIT_CODE.USAGE, {
1529
+ code: "invalid_argument_value",
1530
+ required: `Provide valid --type-option key/value pairs for type "${type}".`,
1531
+ examples: [nextValidExample],
1532
+ nextSteps: [`Run "pm create --help --type ${type}" to review allowed type-option keys and values.`]
1533
+ });
1534
+ }
1535
+ const id = await generateItemId(pmRoot, settings.id_prefix);
1536
+ let status = resolvedOptions.status !== void 0 ? parseStatusValue(resolvedOptions.status, statusRegistry) : resolveCreateDefaultStatus(typeDefinition, statusRegistry);
1537
+ const priority = resolvedOptions.priority !== void 0 ? ensurePriority(resolvedOptions.priority) : 2;
1538
+ if (unsetTargets.frontMatterKeys.has("tags") && Array.isArray(resolvedOptions.addTags) && resolvedOptions.addTags.length > 0) {
1539
+ throw new PmCliError("Cannot combine --unset tags with --add-tags", EXIT_CODE.USAGE);
1540
+ }
1541
+ const baseTags = unsetTargets.frontMatterKeys.has("tags") ? [] : resolvedOptions.tags !== void 0 ? parseTags(resolvedOptions.tags) : [];
1542
+ const tags = mergeAdditiveTags(baseTags, resolvedOptions.addTags);
1543
+ const deadline = unsetTargets.frontMatterKeys.has("deadline") ? void 0 : resolvedOptions.deadline === void 0 ? void 0 : resolveIsoOrRelative(resolvedOptions.deadline, new Date(nowValue), "deadline");
1544
+ const estimatedMinutes = unsetTargets.frontMatterKeys.has("estimated_minutes") ? void 0 : resolvedOptions.estimatedMinutes === void 0 ? void 0 : parseOptionalNumber(resolvedOptions.estimatedMinutes, "estimated-minutes");
1545
+ const acceptanceCriteria = unsetTargets.frontMatterKeys.has("acceptance_criteria") ? void 0 : resolvedOptions.acceptanceCriteria === void 0 ? void 0 : resolvedOptions.acceptanceCriteria;
1546
+ const definitionOfReady = unsetTargets.frontMatterKeys.has("definition_of_ready") || resolvedOptions.definitionOfReady === void 0 ? void 0 : parseOptionalString(resolvedOptions.definitionOfReady);
1547
+ if (resolvedOptions.order !== void 0 && resolvedOptions.rank !== void 0 && resolvedOptions.order !== resolvedOptions.rank) {
1548
+ throw new PmCliError("--order and --rank must match when both are provided", EXIT_CODE.USAGE);
1549
+ }
1550
+ const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;
1551
+ const order = unsetTargets.frontMatterKeys.has("order") || orderRaw === void 0 ? void 0 : parseOptionalNumber(orderRaw, "order");
1552
+ if (order !== void 0 && !Number.isInteger(order)) {
1553
+ throw new PmCliError("Order must be an integer", EXIT_CODE.USAGE);
1554
+ }
1555
+ const goal = unsetTargets.frontMatterKeys.has("goal") || resolvedOptions.goal === void 0 ? void 0 : parseOptionalString(resolvedOptions.goal);
1556
+ const objective = unsetTargets.frontMatterKeys.has("objective") || resolvedOptions.objective === void 0 ? void 0 : parseOptionalString(resolvedOptions.objective);
1557
+ const value = unsetTargets.frontMatterKeys.has("value") || resolvedOptions.value === void 0 ? void 0 : parseOptionalString(resolvedOptions.value);
1558
+ const impact = unsetTargets.frontMatterKeys.has("impact") || resolvedOptions.impact === void 0 ? void 0 : parseOptionalString(resolvedOptions.impact);
1559
+ const outcome = unsetTargets.frontMatterKeys.has("outcome") || resolvedOptions.outcome === void 0 ? void 0 : parseOptionalString(resolvedOptions.outcome);
1560
+ const whyNow = unsetTargets.frontMatterKeys.has("why_now") || resolvedOptions.whyNow === void 0 ? void 0 : parseOptionalString(resolvedOptions.whyNow);
1561
+ const assignee = unsetTargets.frontMatterKeys.has("assignee") || resolvedOptions.assignee === void 0 ? void 0 : parseOptionalString(resolvedOptions.assignee);
1562
+ const authorValue = unsetTargets.frontMatterKeys.has("author") ? void 0 : parseOptionalString(resolvedOptions.author) ?? author;
1563
+ let parent = unsetTargets.frontMatterKeys.has("parent") || resolvedOptions.parent === void 0 ? void 0 : parseOptionalString(resolvedOptions.parent);
1564
+ const reviewer = unsetTargets.frontMatterKeys.has("reviewer") || resolvedOptions.reviewer === void 0 ? void 0 : parseOptionalString(resolvedOptions.reviewer);
1565
+ const riskRaw = unsetTargets.frontMatterKeys.has("risk") || resolvedOptions.risk === void 0 ? void 0 : parseOptionalString(resolvedOptions.risk);
1566
+ const risk = riskRaw !== void 0 ? ensureEnumValue(normalizeRiskInput(riskRaw), RISK_VALUES, "risk") : void 0;
1567
+ const confidenceRaw = unsetTargets.frontMatterKeys.has("confidence") || resolvedOptions.confidence === void 0 ? void 0 : parseOptionalString(resolvedOptions.confidence);
1568
+ const confidence = confidenceRaw !== void 0 ? parseConfidenceInput(confidenceRaw) : void 0;
1569
+ const parentReferencePolicy = settings.validation.parent_reference;
1570
+ const sprintReleasePolicy = settings.validation.sprint_release_format;
1571
+ const validationWarnings = [];
1572
+ if (type.toLowerCase() === "event" && (events.values === void 0 || events.values.length === 0)) {
1573
+ validationWarnings.push(`event_without_schedule:${id}:no_time_set`);
1574
+ }
1575
+ const calendarRelevantTypes = /* @__PURE__ */ new Set(["milestone", "meeting", "reminder", "event"]);
1576
+ const hasDeadline = deadline !== void 0;
1577
+ const hasReminders = reminders.values !== void 0 && reminders.values.length > 0;
1578
+ const hasEvents = events.values !== void 0 && events.values.length > 0;
1579
+ if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {
1580
+ validationWarnings.push(`calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event`);
1581
+ }
1582
+ if (parent !== void 0) {
1583
+ parent = normalizeParentReferenceValue(parent);
1584
+ const parentLocated = await locateItem(pmRoot, parent, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
1585
+ if (!parentLocated) {
1586
+ const normalizedParentId = normalizeItemId(parent, settings.id_prefix);
1587
+ validationWarnings.push(...validateMissingParentReference(normalizedParentId, parentReferencePolicy).warnings);
1588
+ }
1589
+ }
1590
+ let sprint = unsetTargets.frontMatterKeys.has("sprint") || resolvedOptions.sprint === void 0 ? void 0 : parseOptionalString(resolvedOptions.sprint);
1591
+ if (sprint !== void 0) {
1592
+ const sprintValidation = validateSprintOrReleaseValue("sprint", sprint, sprintReleasePolicy);
1593
+ sprint = sprintValidation.value;
1594
+ validationWarnings.push(...sprintValidation.warnings);
1595
+ }
1596
+ let release = unsetTargets.frontMatterKeys.has("release") || resolvedOptions.release === void 0 ? void 0 : parseOptionalString(resolvedOptions.release);
1597
+ if (release !== void 0) {
1598
+ const releaseValidation = validateSprintOrReleaseValue("release", release, sprintReleasePolicy);
1599
+ release = releaseValidation.value;
1600
+ validationWarnings.push(...releaseValidation.warnings);
1601
+ }
1602
+ const blockedBy = unsetTargets.frontMatterKeys.has("blocked_by") || resolvedOptions.blockedBy === void 0 ? void 0 : parseOptionalString(resolvedOptions.blockedBy);
1603
+ let dependencyValues = dependencies.values;
1604
+ if (blockedBy !== void 0) {
1605
+ const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);
1606
+ const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
1607
+ if (blockedByLocated) {
1608
+ const hasBlockedByDependency = (dependencyValues ?? []).some((dependency) => dependency.id === blockedByLocated.id && dependency.kind === "blocked_by");
1609
+ if (!hasBlockedByDependency) {
1610
+ dependencyValues = [
1611
+ ...dependencyValues ?? [],
1612
+ {
1613
+ id: blockedByLocated.id,
1614
+ kind: "blocked_by",
1615
+ created_at: nowValue,
1616
+ author
1617
+ }
1618
+ ];
1619
+ }
1620
+ if (resolvedOptions.status === void 0) {
1621
+ status = statusRegistry.blocked_statuses.has("blocked") ? "blocked" : [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;
1622
+ }
1623
+ }
1624
+ }
1625
+ const blockedReason = unsetTargets.frontMatterKeys.has("blocked_reason") || resolvedOptions.blockedReason === void 0 ? void 0 : parseOptionalString(resolvedOptions.blockedReason);
1626
+ const unblockNote = unsetTargets.frontMatterKeys.has("unblock_note") || resolvedOptions.unblockNote === void 0 ? void 0 : parseOptionalString(resolvedOptions.unblockNote);
1627
+ const reporter = unsetTargets.frontMatterKeys.has("reporter") || resolvedOptions.reporter === void 0 ? void 0 : parseOptionalString(resolvedOptions.reporter);
1628
+ const severityRaw = unsetTargets.frontMatterKeys.has("severity") || resolvedOptions.severity === void 0 ? void 0 : parseOptionalString(resolvedOptions.severity);
1629
+ const severity = severityRaw !== void 0 ? ensureEnumValue(normalizeSeverityInput(severityRaw), ISSUE_SEVERITY_VALUES, "severity") : void 0;
1630
+ const environment = unsetTargets.frontMatterKeys.has("environment") || resolvedOptions.environment === void 0 ? void 0 : parseOptionalString(resolvedOptions.environment);
1631
+ const reproSteps = unsetTargets.frontMatterKeys.has("repro_steps") || resolvedOptions.reproSteps === void 0 ? void 0 : parseOptionalString(resolvedOptions.reproSteps);
1632
+ const resolution = unsetTargets.frontMatterKeys.has("resolution") || resolvedOptions.resolution === void 0 ? void 0 : parseOptionalString(resolvedOptions.resolution);
1633
+ const expectedResult = unsetTargets.frontMatterKeys.has("expected_result") || resolvedOptions.expectedResult === void 0 ? void 0 : parseOptionalString(resolvedOptions.expectedResult);
1634
+ const actualResult = unsetTargets.frontMatterKeys.has("actual_result") || resolvedOptions.actualResult === void 0 ? void 0 : parseOptionalString(resolvedOptions.actualResult);
1635
+ const affectedVersion = unsetTargets.frontMatterKeys.has("affected_version") || resolvedOptions.affectedVersion === void 0 ? void 0 : parseOptionalString(resolvedOptions.affectedVersion);
1636
+ const fixedVersion = unsetTargets.frontMatterKeys.has("fixed_version") || resolvedOptions.fixedVersion === void 0 ? void 0 : parseOptionalString(resolvedOptions.fixedVersion);
1637
+ const component = unsetTargets.frontMatterKeys.has("component") || resolvedOptions.component === void 0 ? void 0 : parseOptionalString(resolvedOptions.component);
1638
+ const regressionRaw = unsetTargets.frontMatterKeys.has("regression") || resolvedOptions.regression === void 0 ? void 0 : parseOptionalString(resolvedOptions.regression);
1639
+ const regression = regressionRaw !== void 0 ? parseRegressionInput(regressionRaw) : void 0;
1640
+ const customerImpact = unsetTargets.frontMatterKeys.has("customer_impact") || resolvedOptions.customerImpact === void 0 ? void 0 : parseOptionalString(resolvedOptions.customerImpact);
1641
+ const title = requireStringOption(resolvedOptions.title, "--title");
1642
+ const description = resolvedOptions.description ?? "";
1643
+ const body = resolvedOptions.body ?? "";
1644
+ const frontMatter = normalizeFrontMatter({
1645
+ id,
1646
+ title,
1647
+ description,
1648
+ type,
1649
+ type_options: validatedTypeOptions.normalized,
1650
+ status,
1651
+ priority,
1652
+ tags,
1653
+ created_at: nowValue,
1654
+ updated_at: nowValue,
1655
+ deadline,
1656
+ assignee,
1657
+ author: authorValue,
1658
+ estimated_minutes: estimatedMinutes,
1659
+ acceptance_criteria: acceptanceCriteria,
1660
+ definition_of_ready: definitionOfReady,
1661
+ order,
1662
+ goal,
1663
+ objective,
1664
+ value,
1665
+ impact,
1666
+ outcome,
1667
+ why_now: whyNow,
1668
+ parent,
1669
+ reviewer,
1670
+ risk,
1671
+ confidence,
1672
+ sprint,
1673
+ release,
1674
+ blocked_by: blockedBy,
1675
+ blocked_reason: blockedReason,
1676
+ unblock_note: unblockNote,
1677
+ reporter,
1678
+ severity,
1679
+ environment,
1680
+ repro_steps: reproSteps,
1681
+ resolution,
1682
+ expected_result: expectedResult,
1683
+ actual_result: actualResult,
1684
+ affected_version: affectedVersion,
1685
+ fixed_version: fixedVersion,
1686
+ component,
1687
+ regression,
1688
+ customer_impact: customerImpact,
1689
+ dependencies: dependencyValues,
1690
+ comments: comments.values,
1691
+ notes: notes.values,
1692
+ learnings: learnings.values,
1693
+ files: files.values,
1694
+ tests: tests.values,
1695
+ docs: docs.values,
1696
+ reminders: reminders.values,
1697
+ events: events.values,
1698
+ ...registeredItemFieldValues,
1699
+ ...runtimeCreateFieldValues.values ?? {}
1700
+ });
1701
+ try {
1702
+ applyRegisteredItemFieldDefaultsAndValidation(frontMatter, extensionRegistrations);
1703
+ } catch (error) {
1704
+ throw new PmCliError(error instanceof Error ? error.message : "Invalid extension item field values", EXIT_CODE.USAGE);
1705
+ }
1706
+ const afterDocument = canonicalDocument({
1707
+ metadata: frontMatter,
1708
+ body
1709
+ }, { schema: settings.schema, extensionFieldNames });
1710
+ const beforeDocument = {
1711
+ metadata: {},
1712
+ body: ""
1713
+ };
1714
+ const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
1715
+ const historyPath = getHistoryPath(pmRoot, id);
1716
+ const lockRelease = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
1717
+ const explicitUnsetKeys = [...explicitUnsets].sort((left, right) => left.localeCompare(right));
1718
+ const historyMessage = buildHistoryMessage(resolvedOptions.message, explicitUnsetKeys);
1719
+ const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys, [
1720
+ ...Object.keys(registeredItemFieldValues),
1721
+ ...Object.keys(runtimeCreateFieldValues.values ?? {})
1722
+ ]);
1723
+ let hookWarnings = [];
1724
+ try {
1725
+ await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, {
1726
+ format: settings.item_format,
1727
+ schema: settings.schema,
1728
+ extensionFieldNames
1729
+ }));
1730
+ try {
1731
+ const entry = createHistoryEntry({
1732
+ nowIso: nowValue,
1733
+ author,
1734
+ op: "create",
1735
+ before: beforeDocument,
1736
+ after: afterDocument,
1737
+ message: historyMessage
1738
+ });
1739
+ await appendHistoryEntry(historyPath, entry);
1740
+ } catch (error) {
1741
+ await removeFileIfExists(itemPath);
1742
+ throw error;
1743
+ }
1744
+ hookWarnings = [
1745
+ ...await runActiveOnWriteHooks({
1746
+ path: itemPath,
1747
+ scope: "project",
1748
+ op: "create",
1749
+ item_id: afterDocument.metadata.id,
1750
+ item_type: afterDocument.metadata.type,
1751
+ before: beforeDocument,
1752
+ after: afterDocument,
1753
+ changed_fields: changedFields
1754
+ }),
1755
+ ...await runActiveOnWriteHooks({
1756
+ path: historyPath,
1757
+ scope: "project",
1758
+ op: "create:history",
1759
+ item_id: afterDocument.metadata.id,
1760
+ item_type: afterDocument.metadata.type,
1761
+ before: beforeDocument,
1762
+ after: afterDocument,
1763
+ changed_fields: changedFields
1764
+ })
1765
+ ];
1766
+ recordAfterCommandAffectedItem({
1767
+ id: afterDocument.metadata.id,
1768
+ op: "create",
1769
+ item_type: afterDocument.metadata.type,
1770
+ status: afterDocument.metadata.status,
1771
+ current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),
1772
+ changed_fields: changedFields
1773
+ });
1774
+ } finally {
1775
+ await lockRelease();
1776
+ }
1777
+ const outputItem = structuredClone(frontMatter);
1778
+ if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {
1779
+ printError(`[pm] warning: ${type} '${id}' has no deadline/reminder/event \u2014 it will not appear on the calendar. Add one via 'pm update ${id} --deadline <ISO>' or 'pm update ${id} --event "start=<ISO>,end=<ISO>"'.`);
1780
+ }
1781
+ return {
1782
+ item: outputItem,
1783
+ changed_fields: changedFields,
1784
+ warnings: [...validationWarnings, ...hookWarnings]
1785
+ };
1786
+ }
1787
+
1788
+ export {
1789
+ resolvePriority,
1790
+ normalizeRiskInput,
1791
+ normalizeSeverityInput,
1792
+ parseConfidenceInput,
1793
+ parseRegressionInput,
1794
+ isLegacyNoneToken,
1795
+ assertNoLegacyNoneToken,
1796
+ assertNoLegacyNoneTokens,
1797
+ ensureEnumValue,
1798
+ parseReminderEntries,
1799
+ parseEventEntries,
1800
+ parseTypeOptionEntries,
1801
+ parseLogSeed,
1802
+ parseFiles,
1803
+ parseTests,
1804
+ parseDocs,
1805
+ runCreate
1806
+ };
1807
+ //# sourceMappingURL=chunk-ZRVSMOMR.js.map
1808
+
1809
+ //# debugId=67af10d9-cb2f-5b7f-9238-a7eae5edeb4d