@unbrained/pm-cli 2026.7.7 → 2026.7.9

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 (428) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -0
  3. package/dist/cli/commands/close.js +5 -2
  4. package/dist/cli/commands/close.js.map +1 -1
  5. package/dist/cli/commands/completion.js +16 -2
  6. package/dist/cli/commands/completion.js.map +1 -1
  7. package/dist/cli/commands/context.d.ts +1 -0
  8. package/dist/cli/commands/context.js +4 -4
  9. package/dist/cli/commands/context.js.map +1 -1
  10. package/dist/cli/commands/contracts.d.ts +11 -0
  11. package/dist/cli/commands/contracts.js +112 -15
  12. package/dist/cli/commands/contracts.js.map +1 -1
  13. package/dist/cli/commands/create.js +4 -2
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/extension.d.ts +23 -19
  16. package/dist/cli/commands/extension.js +167 -57
  17. package/dist/cli/commands/extension.js.map +1 -1
  18. package/dist/cli/commands/list.d.ts +4 -0
  19. package/dist/cli/commands/list.js +32 -3
  20. package/dist/cli/commands/list.js.map +1 -1
  21. package/dist/cli/commands/search.js +3 -3
  22. package/dist/cli/commands/search.js.map +1 -1
  23. package/dist/cli/commands/update.d.ts +32 -1
  24. package/dist/cli/commands/update.js +19 -2
  25. package/dist/cli/commands/update.js.map +1 -1
  26. package/dist/cli/help-content.js +28 -2
  27. package/dist/cli/help-content.js.map +1 -1
  28. package/dist/cli/register-list-query.js +5 -2
  29. package/dist/cli/register-list-query.js.map +1 -1
  30. package/dist/cli/register-operations.js +4 -2
  31. package/dist/cli/register-operations.js.map +1 -1
  32. package/dist/cli/register-setup.js +8 -2
  33. package/dist/cli/register-setup.js.map +1 -1
  34. package/dist/cli/registration-helpers.js +4 -2
  35. package/dist/cli/registration-helpers.js.map +1 -1
  36. package/dist/cli-bundle/chunks/append-CDPAYYSB.js +11 -0
  37. package/dist/cli-bundle/chunks/{append-PVCTBVJG.js → append-RSPHC423.js} +5 -5
  38. package/dist/cli-bundle/chunks/{chunk-6G6O3OPQ.js → chunk-26MFLA7K.js} +7 -7
  39. package/dist/cli-bundle/chunks/{chunk-LCFJ7XAM.js → chunk-2BVD4ZD2.js} +267 -232
  40. package/dist/cli-bundle/chunks/chunk-2BVD4ZD2.js.map +7 -0
  41. package/dist/cli-bundle/chunks/{chunk-7ML7JONU.js → chunk-2FKIIQMJ.js} +14 -14
  42. package/dist/cli-bundle/chunks/chunk-2FKIIQMJ.js.map +1 -0
  43. package/dist/cli-bundle/chunks/{chunk-H2SMKL2N.js → chunk-3FUXM574.js} +4 -4
  44. package/dist/cli-bundle/chunks/{chunk-DR2V5OIV.js → chunk-3SHDAKMF.js} +3 -3
  45. package/dist/cli-bundle/chunks/{chunk-MRFWUSVA.js → chunk-3UXIMY62.js} +3 -3
  46. package/dist/cli-bundle/chunks/{chunk-WCWVEXGA.js → chunk-3V5C7PUH.js} +2 -2
  47. package/dist/cli-bundle/chunks/{chunk-43YSKY75.js → chunk-3YJDIJIE.js} +3 -3
  48. package/dist/cli-bundle/chunks/{chunk-HX6QXV5P.js → chunk-4I7KS5ES.js} +2 -2
  49. package/dist/cli-bundle/chunks/{chunk-XHCVAZGM.js → chunk-4OCWJ2AP.js} +7 -7
  50. package/dist/cli-bundle/chunks/{chunk-C5ACVMOI.js → chunk-5RJ4LFD3.js} +34 -7
  51. package/dist/cli-bundle/chunks/chunk-5RJ4LFD3.js.map +7 -0
  52. package/dist/cli-bundle/chunks/{chunk-3TYOW6RR.js → chunk-5STY7NVM.js} +4 -4
  53. package/dist/cli-bundle/chunks/{chunk-7VQ3JJN5.js → chunk-5VAZHYVQ.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-4IQKDKGE.js → chunk-5ZMZF53A.js} +7 -7
  55. package/dist/cli-bundle/chunks/{chunk-6LCJRGPD.js → chunk-63PZJCKO.js} +10 -7
  56. package/dist/cli-bundle/chunks/chunk-63PZJCKO.js.map +1 -0
  57. package/dist/cli-bundle/chunks/{chunk-MCEUKJKW.js → chunk-6FU5BVRB.js} +4 -4
  58. package/dist/cli-bundle/chunks/{chunk-AJUON7E6.js → chunk-6RR4XM5H.js} +3 -3
  59. package/dist/cli-bundle/chunks/{chunk-TEISGNSH.js → chunk-6TD5QGIB.js} +4 -4
  60. package/dist/cli-bundle/chunks/{chunk-565WYS5W.js → chunk-6WCXSC5V.js} +5 -5
  61. package/dist/cli-bundle/chunks/{chunk-NWWL22C7.js → chunk-6ZKDMEVT.js} +3 -3
  62. package/dist/cli-bundle/chunks/{chunk-VLEA2UTQ.js → chunk-7QKSLAHB.js} +2 -2
  63. package/dist/cli-bundle/chunks/{chunk-S6VC2A2K.js → chunk-7TBUV7XS.js} +4 -4
  64. package/dist/cli-bundle/chunks/{chunk-YPMZMKN7.js → chunk-7UCBLJDF.js} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-4MZOKTI2.js → chunk-AEOFBBWO.js} +3 -3
  66. package/dist/cli-bundle/chunks/{chunk-QFBSP3NI.js → chunk-ASSVI7FP.js} +12 -10
  67. package/dist/cli-bundle/chunks/{chunk-QFBSP3NI.js.map → chunk-ASSVI7FP.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-ZO7CLOY2.js → chunk-BFNFTHWQ.js} +3 -3
  69. package/dist/cli-bundle/chunks/{chunk-YNCFP5AR.js → chunk-BPJ5NYSJ.js} +2 -2
  70. package/dist/cli-bundle/chunks/{chunk-J2VGADNG.js → chunk-BPYVKTZE.js} +122 -27
  71. package/dist/cli-bundle/chunks/chunk-BPYVKTZE.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-P3MJJW7P.js → chunk-C3YU3TXX.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-SY75LYXR.js → chunk-C6XSTACC.js} +3 -3
  74. package/dist/cli-bundle/chunks/{chunk-S547WBYG.js → chunk-CEX2DQXZ.js} +600 -96
  75. package/dist/cli-bundle/chunks/chunk-CEX2DQXZ.js.map +7 -0
  76. package/dist/cli-bundle/chunks/{chunk-2TILG6F2.js → chunk-CGDUIPJL.js} +3 -3
  77. package/dist/cli-bundle/chunks/{chunk-LZQU6XJG.js → chunk-CHSXGTWF.js} +23 -9
  78. package/dist/cli-bundle/chunks/{chunk-LZQU6XJG.js.map → chunk-CHSXGTWF.js.map} +2 -2
  79. package/dist/cli-bundle/chunks/{chunk-J7BOLHAV.js → chunk-CXH7EMSB.js} +3 -3
  80. package/dist/cli-bundle/chunks/{chunk-W5HXHC7C.js → chunk-D6J5673C.js} +4 -4
  81. package/dist/cli-bundle/chunks/{chunk-XZWL7VNE.js → chunk-DBV5A7FT.js} +9 -7
  82. package/dist/cli-bundle/chunks/chunk-DBV5A7FT.js.map +1 -0
  83. package/dist/cli-bundle/chunks/{chunk-ARKHKYYS.js → chunk-DQLP22K2.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-YPD7SQ5P.js → chunk-EEJKHF7M.js} +5 -5
  85. package/dist/cli-bundle/chunks/{chunk-EDO7VXSO.js → chunk-EP2CKDS7.js} +2 -2
  86. package/dist/cli-bundle/chunks/{chunk-SIM5JDON.js → chunk-F5DDGY6R.js} +3 -3
  87. package/dist/cli-bundle/chunks/{chunk-I74FMIWA.js → chunk-FFB3WITE.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-43UQN754.js → chunk-FJR2S7S4.js} +7 -7
  89. package/dist/cli-bundle/chunks/{chunk-CJQM7O7R.js → chunk-FOJEBRDD.js} +5 -5
  90. package/dist/cli-bundle/chunks/{chunk-E3YQFSFE.js → chunk-GLMJLBLR.js} +3 -3
  91. package/dist/cli-bundle/chunks/{chunk-KTGJ2CBU.js → chunk-GO2X6ZRB.js} +3 -3
  92. package/dist/cli-bundle/chunks/{chunk-DDDWVPID.js → chunk-GSQVQINP.js} +4 -4
  93. package/dist/cli-bundle/chunks/{chunk-EVEPHNXJ.js → chunk-GZ365M6E.js} +4 -4
  94. package/dist/cli-bundle/chunks/{chunk-VGO73OCK.js → chunk-HZZ3AC27.js} +3 -3
  95. package/dist/cli-bundle/chunks/{chunk-7Y5N34HX.js → chunk-IINCZYM3.js} +3 -3
  96. package/dist/cli-bundle/chunks/{chunk-GLS6VMWI.js → chunk-INOWVPUD.js} +5 -5
  97. package/dist/cli-bundle/chunks/{chunk-PDXJXEZJ.js → chunk-J6AD3GWC.js} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-52NS7JDP.js → chunk-JH5XDDYS.js} +5 -5
  99. package/dist/cli-bundle/chunks/{chunk-GPIDUMMN.js → chunk-JYVPLGOW.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-XC3X7BQR.js → chunk-K2OKKYSO.js} +11 -9
  101. package/dist/cli-bundle/chunks/{chunk-XC3X7BQR.js.map → chunk-K2OKKYSO.js.map} +2 -2
  102. package/dist/cli-bundle/chunks/{chunk-YCVWWIKY.js → chunk-K4NMHZR3.js} +111 -24
  103. package/dist/cli-bundle/chunks/chunk-K4NMHZR3.js.map +7 -0
  104. package/dist/cli-bundle/chunks/{chunk-EIUBK2LT.js → chunk-K52C6YPA.js} +5 -5
  105. package/dist/cli-bundle/chunks/{chunk-IDIBF4E2.js → chunk-KAJNWMBE.js} +8 -8
  106. package/dist/cli-bundle/chunks/{chunk-2LEJGRQ7.js → chunk-KFL3XHMA.js} +2 -2
  107. package/dist/cli-bundle/chunks/{chunk-XS2TMNXR.js → chunk-LD2NBQ5T.js} +3 -3
  108. package/dist/cli-bundle/chunks/{chunk-II7R6KD4.js → chunk-LG4N6YOK.js} +5 -5
  109. package/dist/cli-bundle/chunks/{chunk-M62RO3XK.js → chunk-LHDHS4Z6.js} +5 -5
  110. package/dist/cli-bundle/chunks/{chunk-YTD5GICJ.js → chunk-MBLHA6LR.js} +4 -4
  111. package/dist/cli-bundle/chunks/{chunk-F6MT7KKE.js → chunk-MCH6IKK7.js} +3 -3
  112. package/dist/cli-bundle/chunks/{chunk-7PNQA24K.js → chunk-MCZK7LY6.js} +24 -10
  113. package/dist/cli-bundle/chunks/{chunk-7PNQA24K.js.map → chunk-MCZK7LY6.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/{chunk-UO7XAZK6.js → chunk-MFLLULHU.js} +267 -232
  115. package/dist/cli-bundle/chunks/chunk-MFLLULHU.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{chunk-FILL6BB2.js → chunk-N4S7BV43.js} +14 -14
  117. package/dist/cli-bundle/chunks/chunk-N4S7BV43.js.map +7 -0
  118. package/dist/cli-bundle/chunks/{chunk-2APXX4TZ.js → chunk-NBJCIAVV.js} +108 -21
  119. package/dist/cli-bundle/chunks/chunk-NBJCIAVV.js.map +1 -0
  120. package/dist/cli-bundle/chunks/{chunk-Y7KYVCZM.js → chunk-NGBWEYNY.js} +5 -5
  121. package/dist/cli-bundle/chunks/{chunk-RB3KLPAH.js → chunk-NRMDT4OV.js} +4 -4
  122. package/dist/cli-bundle/chunks/{chunk-TZLYO4PP.js → chunk-NRYZ4QLH.js} +121 -26
  123. package/dist/cli-bundle/chunks/chunk-NRYZ4QLH.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-F6YC2A6X.js → chunk-NSPSJWGL.js} +9 -6
  125. package/dist/cli-bundle/chunks/chunk-NSPSJWGL.js.map +7 -0
  126. package/dist/cli-bundle/chunks/{chunk-GH73UOSJ.js → chunk-NTOOEVJ4.js} +2 -2
  127. package/dist/cli-bundle/chunks/{chunk-6XTSYPPO.js → chunk-ONADVBMD.js} +8 -6
  128. package/dist/cli-bundle/chunks/chunk-ONADVBMD.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-Y5IKRUEM.js → chunk-P5SUMCU5.js} +167 -65
  130. package/dist/cli-bundle/chunks/chunk-P5SUMCU5.js.map +1 -0
  131. package/dist/cli-bundle/chunks/{chunk-EMXPI36L.js → chunk-PAWPLIWW.js} +5 -5
  132. package/dist/cli-bundle/chunks/{chunk-AGAVEDIE.js → chunk-PCBZ2VJD.js} +4 -4
  133. package/dist/cli-bundle/chunks/{chunk-MHNMCDWR.js → chunk-PPY3GXFK.js} +600 -96
  134. package/dist/cli-bundle/chunks/chunk-PPY3GXFK.js.map +1 -0
  135. package/dist/cli-bundle/chunks/{chunk-3X542TEY.js → chunk-Q3CFSOQZ.js} +4 -4
  136. package/dist/cli-bundle/chunks/{chunk-4BKDAEDF.js → chunk-QJZM5WO5.js} +3 -3
  137. package/dist/cli-bundle/chunks/{chunk-HHEWQXPD.js → chunk-QLEH6FTQ.js} +4 -4
  138. package/dist/cli-bundle/chunks/{chunk-D2DCTFTL.js → chunk-QYZMZD4L.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-6UQCNWFV.js → chunk-RFHLRMLQ.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-Q64AYQYW.js → chunk-RL24NAUX.js} +4 -4
  141. package/dist/cli-bundle/chunks/{chunk-QDABF2RB.js → chunk-S7J3GEHL.js} +10 -10
  142. package/dist/cli-bundle/chunks/{chunk-5FIQ4EX3.js → chunk-SCJPFQQT.js} +3 -3
  143. package/dist/cli-bundle/chunks/{chunk-42LXP4VO.js → chunk-SIQGG335.js} +7 -7
  144. package/dist/cli-bundle/chunks/{chunk-RY7PTTUB.js → chunk-TI7QSUFK.js} +35 -8
  145. package/dist/cli-bundle/chunks/chunk-TI7QSUFK.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-43SIHQND.js → chunk-TKWTJGD6.js} +5 -5
  147. package/dist/cli-bundle/chunks/{chunk-EOUVR7JN.js → chunk-U72GF3I2.js} +3 -3
  148. package/dist/cli-bundle/chunks/{chunk-FN6SB4HU.js → chunk-UEATYUZW.js} +2 -2
  149. package/dist/cli-bundle/chunks/{chunk-V5ZWKJNY.js → chunk-UFNFHCAC.js} +2 -2
  150. package/dist/cli-bundle/chunks/{chunk-XBX5CBRQ.js → chunk-UH6VFRV6.js} +3 -3
  151. package/dist/cli-bundle/chunks/{chunk-GTM5HQL4.js → chunk-UIHDZS6X.js} +7 -7
  152. package/dist/cli-bundle/chunks/{chunk-TGUK6XN6.js → chunk-UURYLDDC.js} +5 -5
  153. package/dist/cli-bundle/chunks/{chunk-S5BNGFN5.js → chunk-VCGHRLJU.js} +10 -10
  154. package/dist/cli-bundle/chunks/{chunk-3G6UMXT3.js → chunk-W2VFNVSJ.js} +3 -3
  155. package/dist/cli-bundle/chunks/{chunk-ZNEG2UDO.js → chunk-WDNPNW22.js} +7 -7
  156. package/dist/cli-bundle/chunks/{chunk-DG6BSXZ7.js → chunk-WVEMZZCR.js} +3 -3
  157. package/dist/cli-bundle/chunks/{chunk-TNC6MZUD.js → chunk-XXN2B2MJ.js} +4 -4
  158. package/dist/cli-bundle/chunks/{chunk-YH5NBDFA.js → chunk-Y2736PT5.js} +8 -8
  159. package/dist/cli-bundle/chunks/{chunk-X47MKQXU.js → chunk-YHKXNGLA.js} +166 -64
  160. package/dist/cli-bundle/chunks/chunk-YHKXNGLA.js.map +7 -0
  161. package/dist/cli-bundle/chunks/{chunk-XXIYUTLK.js → chunk-YPE5MFPJ.js} +4 -4
  162. package/dist/cli-bundle/chunks/{chunk-XPMXPR7K.js → chunk-YSRXFGNV.js} +3 -3
  163. package/dist/cli-bundle/chunks/{chunk-N6ZHDLUY.js → chunk-YUMNZS3X.js} +3 -3
  164. package/dist/cli-bundle/chunks/{chunk-TEKZOS7M.js → chunk-Z2JQH2MG.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-E3LWJUGF.js → chunk-Z6RLSNUX.js} +3 -3
  166. package/dist/cli-bundle/chunks/close-5WY6QO5F.js +12 -0
  167. package/dist/cli-bundle/chunks/{close-3YYQ5OG2.js → close-TKTFRL7N.js} +5 -5
  168. package/dist/cli-bundle/chunks/{close-many-D366FTIG.js → close-many-HEPL66EG.js} +13 -13
  169. package/dist/cli-bundle/chunks/close-many-U2KLQ3NL.js +22 -0
  170. package/dist/cli-bundle/chunks/{comments-54XDJNFE.js → comments-PLFK5ZKK.js} +7 -7
  171. package/dist/cli-bundle/chunks/comments-ZNOD5PTV.js +13 -0
  172. package/dist/cli-bundle/chunks/copy-F7BUFY4J.js +9 -0
  173. package/dist/cli-bundle/chunks/{copy-44RT5GDW.js → copy-VH3L4MN2.js} +4 -4
  174. package/dist/cli-bundle/chunks/create-KCQM6UYM.js +25 -0
  175. package/dist/cli-bundle/chunks/{create-4GWJWPXG.js → create-LD4SEUD6.js} +9 -9
  176. package/dist/cli-bundle/chunks/delete-6KQHZYIP.js +10 -0
  177. package/dist/cli-bundle/chunks/{delete-YQ2VPXNF.js → delete-ZNXUNCZR.js} +4 -4
  178. package/dist/cli-bundle/chunks/{deps-FMANWFRP.js → deps-CVDY7FFK.js} +4 -4
  179. package/dist/cli-bundle/chunks/{deps-BU5EBJDU.js → deps-SZXQHV73.js} +4 -4
  180. package/dist/cli-bundle/chunks/{docs-OQBSJNIA.js → docs-DR74ITCD.js} +6 -6
  181. package/dist/cli-bundle/chunks/docs-WCVYY6I7.js +14 -0
  182. package/dist/cli-bundle/chunks/{files-72HZEBOE.js → files-H5YCA74Z.js} +6 -6
  183. package/dist/cli-bundle/chunks/{files-HTSB2KJG.js → files-QEFQ2M3H.js} +6 -6
  184. package/dist/cli-bundle/chunks/{focus-FOG4ALC2.js → focus-55TRYSNA.js} +5 -5
  185. package/dist/cli-bundle/chunks/focus-N2QGNS5D.js +10 -0
  186. package/dist/cli-bundle/chunks/history-compact-GWQ4UOEI.js +21 -0
  187. package/dist/cli-bundle/chunks/{history-compact-M6IFAMBP.js → history-compact-JJZ4EFL3.js} +9 -9
  188. package/dist/cli-bundle/chunks/history-redact-4GJOLXCM.js +17 -0
  189. package/dist/cli-bundle/chunks/{history-redact-NQX3OGZP.js → history-redact-TPPUT3A5.js} +7 -7
  190. package/dist/cli-bundle/chunks/history-repair-HVCVCGUF.js +19 -0
  191. package/dist/cli-bundle/chunks/{history-repair-NHOJG7WO.js → history-repair-J7PIZ6ZP.js} +9 -9
  192. package/dist/cli-bundle/chunks/{learnings-T63JGKKN.js → learnings-KB6BT4NR.js} +7 -7
  193. package/dist/cli-bundle/chunks/learnings-YYY3U2Y7.js +13 -0
  194. package/dist/cli-bundle/chunks/notes-BGG7VL72.js +13 -0
  195. package/dist/cli-bundle/chunks/{notes-U7L6HQQ2.js → notes-ZTHXVOKM.js} +7 -7
  196. package/dist/cli-bundle/chunks/plan-B42KBMX7.js +24 -0
  197. package/dist/cli-bundle/chunks/{plan-TN537L24.js → plan-LUR7C24X.js} +10 -10
  198. package/dist/cli-bundle/chunks/{profile-TIGLAKJ7.js → profile-5F75MO5O.js} +9 -9
  199. package/dist/cli-bundle/chunks/{profile-MHAMXMHQ.js → profile-JRDMDGT5.js} +9 -9
  200. package/dist/cli-bundle/chunks/{register-list-query-ZCRABAPN.js → register-list-query-GZYRZLQZ.js} +17 -16
  201. package/dist/cli-bundle/chunks/register-list-query-GZYRZLQZ.js.map +1 -0
  202. package/dist/cli-bundle/chunks/{register-list-query-OHXD7G5N.js → register-list-query-W2W7RQJJ.js} +16 -15
  203. package/dist/cli-bundle/chunks/register-list-query-W2W7RQJJ.js.map +7 -0
  204. package/dist/cli-bundle/chunks/{register-mutation-XX4H56PE.js → register-mutation-5UDT3WL3.js} +29 -29
  205. package/dist/cli-bundle/chunks/{register-mutation-P3G4XP6Q.js → register-mutation-7DMOYDPC.js} +29 -29
  206. package/dist/cli-bundle/chunks/{register-operations-V6VKTG54.js → register-operations-NW43IUPE.js} +29 -28
  207. package/dist/cli-bundle/chunks/register-operations-NW43IUPE.js.map +7 -0
  208. package/dist/cli-bundle/chunks/{register-operations-V6PIYEDU.js → register-operations-Y4E32W4D.js} +30 -29
  209. package/dist/cli-bundle/chunks/register-operations-Y4E32W4D.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{register-setup-6YVUSQYD.js → register-setup-3GVJ7XPE.js} +21 -19
  211. package/dist/cli-bundle/chunks/register-setup-3GVJ7XPE.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{register-setup-6RVAWT6W.js → register-setup-MPTTS52V.js} +20 -18
  213. package/dist/cli-bundle/chunks/register-setup-MPTTS52V.js.map +7 -0
  214. package/dist/cli-bundle/chunks/{restore-HC3YSWF7.js → restore-BTBEZ5CK.js} +7 -7
  215. package/dist/cli-bundle/chunks/restore-EX4UUZL6.js +15 -0
  216. package/dist/cli-bundle/chunks/{schema-DAGSYO6E.js → schema-DGSTYYQB.js} +6 -6
  217. package/dist/cli-bundle/chunks/{schema-UBXJCQAC.js → schema-HAIBEE24.js} +6 -6
  218. package/dist/cli-bundle/chunks/update-76CRUMC7.js +21 -0
  219. package/dist/cli-bundle/chunks/{update-LKD64AFP.js → update-ZMYVXM77.js} +12 -12
  220. package/dist/cli-bundle/chunks/update-many-QYQRGNPU.js +31 -0
  221. package/dist/cli-bundle/chunks/update-many-U4CEQWI4.js +35 -0
  222. package/dist/cli-bundle/main.js +39 -13
  223. package/dist/cli-bundle/main.js.map +2 -2
  224. package/dist/cli-bundle/sdk-runtime.js +149 -53
  225. package/dist/cli-bundle/sdk-testing.js +6 -6
  226. package/dist/cli-bundle/sdk.js +153 -57
  227. package/dist/cli-bundle/sdk.js.map +3 -3
  228. package/dist/core/extensions/extension-types.d.ts +1 -0
  229. package/dist/core/extensions/extension-types.js +2 -2
  230. package/dist/core/extensions/extension-types.js.map +1 -1
  231. package/dist/core/extensions/loader.js +268 -231
  232. package/dist/core/extensions/loader.js.map +1 -1
  233. package/dist/sdk/cli-contracts/commander-types.js +3 -3
  234. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  235. package/dist/sdk/cli-contracts/flag-contracts.js +10 -3
  236. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  237. package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -5
  238. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  239. package/dist/sdk/cli-contracts/tool-parameter-tables.js +20 -4
  240. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  241. package/dist/sdk/cli-contracts/tool-schema.d.ts +4 -0
  242. package/dist/sdk/cli-contracts/tool-schema.js +71 -12
  243. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  244. package/dist/sdk/index.d.ts +1 -1
  245. package/dist/sdk/index.js +3 -3
  246. package/dist/sdk/index.js.map +1 -1
  247. package/dist/sdk/runtime.d.ts +471 -25
  248. package/dist/sdk/runtime.js +611 -25
  249. package/dist/sdk/runtime.js.map +1 -1
  250. package/docs/AGENT_GUIDE.md +3 -0
  251. package/docs/COMMANDS.md +10 -1
  252. package/docs/EXTENSIONS.md +7 -20
  253. package/docs/RELEASING.md +6 -0
  254. package/docs/SDK.md +67 -0
  255. package/package.json +2 -1
  256. package/dist/cli-bundle/chunks/append-F7WPGIQL.js +0 -11
  257. package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +0 -1
  258. package/dist/cli-bundle/chunks/chunk-6LCJRGPD.js.map +0 -1
  259. package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +0 -7
  260. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +0 -1
  261. package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +0 -7
  262. package/dist/cli-bundle/chunks/chunk-F6YC2A6X.js.map +0 -7
  263. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +0 -7
  264. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +0 -1
  265. package/dist/cli-bundle/chunks/chunk-LCFJ7XAM.js.map +0 -7
  266. package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +0 -1
  267. package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +0 -1
  268. package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +0 -7
  269. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +0 -7
  270. package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +0 -1
  271. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +0 -7
  272. package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +0 -1
  273. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +0 -1
  274. package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +0 -7
  275. package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +0 -12
  276. package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +0 -22
  277. package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +0 -13
  278. package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +0 -9
  279. package/dist/cli-bundle/chunks/create-AZXCUYKP.js +0 -25
  280. package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +0 -10
  281. package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +0 -14
  282. package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +0 -10
  283. package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +0 -21
  284. package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +0 -17
  285. package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +0 -19
  286. package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +0 -13
  287. package/dist/cli-bundle/chunks/notes-73WE2UV2.js +0 -13
  288. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +0 -24
  289. package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +0 -7
  290. package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +0 -1
  291. package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +0 -1
  292. package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +0 -7
  293. package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +0 -7
  294. package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +0 -1
  295. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +0 -15
  296. package/dist/cli-bundle/chunks/update-CJGG5WMV.js +0 -21
  297. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +0 -31
  298. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +0 -35
  299. /package/dist/cli-bundle/chunks/{append-F7WPGIQL.js.map → append-CDPAYYSB.js.map} +0 -0
  300. /package/dist/cli-bundle/chunks/{append-PVCTBVJG.js.map → append-RSPHC423.js.map} +0 -0
  301. /package/dist/cli-bundle/chunks/{chunk-6G6O3OPQ.js.map → chunk-26MFLA7K.js.map} +0 -0
  302. /package/dist/cli-bundle/chunks/{chunk-H2SMKL2N.js.map → chunk-3FUXM574.js.map} +0 -0
  303. /package/dist/cli-bundle/chunks/{chunk-DR2V5OIV.js.map → chunk-3SHDAKMF.js.map} +0 -0
  304. /package/dist/cli-bundle/chunks/{chunk-MRFWUSVA.js.map → chunk-3UXIMY62.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{chunk-WCWVEXGA.js.map → chunk-3V5C7PUH.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{chunk-43YSKY75.js.map → chunk-3YJDIJIE.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-HX6QXV5P.js.map → chunk-4I7KS5ES.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-XHCVAZGM.js.map → chunk-4OCWJ2AP.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-3TYOW6RR.js.map → chunk-5STY7NVM.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-7VQ3JJN5.js.map → chunk-5VAZHYVQ.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-4IQKDKGE.js.map → chunk-5ZMZF53A.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-MCEUKJKW.js.map → chunk-6FU5BVRB.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-AJUON7E6.js.map → chunk-6RR4XM5H.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-TEISGNSH.js.map → chunk-6TD5QGIB.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-565WYS5W.js.map → chunk-6WCXSC5V.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-NWWL22C7.js.map → chunk-6ZKDMEVT.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-VLEA2UTQ.js.map → chunk-7QKSLAHB.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-S6VC2A2K.js.map → chunk-7TBUV7XS.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-YPMZMKN7.js.map → chunk-7UCBLJDF.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-4MZOKTI2.js.map → chunk-AEOFBBWO.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-ZO7CLOY2.js.map → chunk-BFNFTHWQ.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-YNCFP5AR.js.map → chunk-BPJ5NYSJ.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-P3MJJW7P.js.map → chunk-C3YU3TXX.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-SY75LYXR.js.map → chunk-C6XSTACC.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-2TILG6F2.js.map → chunk-CGDUIPJL.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-J7BOLHAV.js.map → chunk-CXH7EMSB.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-W5HXHC7C.js.map → chunk-D6J5673C.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-ARKHKYYS.js.map → chunk-DQLP22K2.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-YPD7SQ5P.js.map → chunk-EEJKHF7M.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-EDO7VXSO.js.map → chunk-EP2CKDS7.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-SIM5JDON.js.map → chunk-F5DDGY6R.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-I74FMIWA.js.map → chunk-FFB3WITE.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-43UQN754.js.map → chunk-FJR2S7S4.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-CJQM7O7R.js.map → chunk-FOJEBRDD.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-E3YQFSFE.js.map → chunk-GLMJLBLR.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-KTGJ2CBU.js.map → chunk-GO2X6ZRB.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-DDDWVPID.js.map → chunk-GSQVQINP.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-EVEPHNXJ.js.map → chunk-GZ365M6E.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-VGO73OCK.js.map → chunk-HZZ3AC27.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-7Y5N34HX.js.map → chunk-IINCZYM3.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-GLS6VMWI.js.map → chunk-INOWVPUD.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-PDXJXEZJ.js.map → chunk-J6AD3GWC.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-52NS7JDP.js.map → chunk-JH5XDDYS.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-GPIDUMMN.js.map → chunk-JYVPLGOW.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-EIUBK2LT.js.map → chunk-K52C6YPA.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-IDIBF4E2.js.map → chunk-KAJNWMBE.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-2LEJGRQ7.js.map → chunk-KFL3XHMA.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-XS2TMNXR.js.map → chunk-LD2NBQ5T.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-II7R6KD4.js.map → chunk-LG4N6YOK.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-M62RO3XK.js.map → chunk-LHDHS4Z6.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-YTD5GICJ.js.map → chunk-MBLHA6LR.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-F6MT7KKE.js.map → chunk-MCH6IKK7.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-Y7KYVCZM.js.map → chunk-NGBWEYNY.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-RB3KLPAH.js.map → chunk-NRMDT4OV.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-GH73UOSJ.js.map → chunk-NTOOEVJ4.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-EMXPI36L.js.map → chunk-PAWPLIWW.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-AGAVEDIE.js.map → chunk-PCBZ2VJD.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-3X542TEY.js.map → chunk-Q3CFSOQZ.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-4BKDAEDF.js.map → chunk-QJZM5WO5.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-HHEWQXPD.js.map → chunk-QLEH6FTQ.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-D2DCTFTL.js.map → chunk-QYZMZD4L.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-6UQCNWFV.js.map → chunk-RFHLRMLQ.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-Q64AYQYW.js.map → chunk-RL24NAUX.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{chunk-QDABF2RB.js.map → chunk-S7J3GEHL.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{chunk-5FIQ4EX3.js.map → chunk-SCJPFQQT.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{chunk-42LXP4VO.js.map → chunk-SIQGG335.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{chunk-43SIHQND.js.map → chunk-TKWTJGD6.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{chunk-EOUVR7JN.js.map → chunk-U72GF3I2.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{chunk-FN6SB4HU.js.map → chunk-UEATYUZW.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{chunk-V5ZWKJNY.js.map → chunk-UFNFHCAC.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{chunk-XBX5CBRQ.js.map → chunk-UH6VFRV6.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{chunk-GTM5HQL4.js.map → chunk-UIHDZS6X.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{chunk-TGUK6XN6.js.map → chunk-UURYLDDC.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{chunk-S5BNGFN5.js.map → chunk-VCGHRLJU.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{chunk-3G6UMXT3.js.map → chunk-W2VFNVSJ.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{chunk-ZNEG2UDO.js.map → chunk-WDNPNW22.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{chunk-DG6BSXZ7.js.map → chunk-WVEMZZCR.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{chunk-TNC6MZUD.js.map → chunk-XXN2B2MJ.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{chunk-YH5NBDFA.js.map → chunk-Y2736PT5.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{chunk-XXIYUTLK.js.map → chunk-YPE5MFPJ.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{chunk-XPMXPR7K.js.map → chunk-YSRXFGNV.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{chunk-N6ZHDLUY.js.map → chunk-YUMNZS3X.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{chunk-TEKZOS7M.js.map → chunk-Z2JQH2MG.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{chunk-E3LWJUGF.js.map → chunk-Z6RLSNUX.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{close-Z3Q4U7TS.js.map → close-5WY6QO5F.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{close-3YYQ5OG2.js.map → close-TKTFRL7N.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{close-many-D366FTIG.js.map → close-many-HEPL66EG.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{close-many-3L2RXH3M.js.map → close-many-U2KLQ3NL.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{comments-54XDJNFE.js.map → comments-PLFK5ZKK.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{comments-HGHC2PN6.js.map → comments-ZNOD5PTV.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{copy-UGMUGHZA.js.map → copy-F7BUFY4J.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{copy-44RT5GDW.js.map → copy-VH3L4MN2.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{create-AZXCUYKP.js.map → create-KCQM6UYM.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{create-4GWJWPXG.js.map → create-LD4SEUD6.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{delete-Y6SXIQ4X.js.map → delete-6KQHZYIP.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{delete-YQ2VPXNF.js.map → delete-ZNXUNCZR.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{deps-FMANWFRP.js.map → deps-CVDY7FFK.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{deps-BU5EBJDU.js.map → deps-SZXQHV73.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{docs-OQBSJNIA.js.map → docs-DR74ITCD.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{docs-VNPBZXEL.js.map → docs-WCVYY6I7.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{files-72HZEBOE.js.map → files-H5YCA74Z.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{files-HTSB2KJG.js.map → files-QEFQ2M3H.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{focus-FOG4ALC2.js.map → focus-55TRYSNA.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{focus-SUTMKXGX.js.map → focus-N2QGNS5D.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-compact-NEXRPP2O.js.map → history-compact-GWQ4UOEI.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{history-compact-M6IFAMBP.js.map → history-compact-JJZ4EFL3.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{history-redact-WQJBZ3PX.js.map → history-redact-4GJOLXCM.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{history-redact-NQX3OGZP.js.map → history-redact-TPPUT3A5.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{history-repair-CBHMHAJO.js.map → history-repair-HVCVCGUF.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{history-repair-NHOJG7WO.js.map → history-repair-J7PIZ6ZP.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{learnings-T63JGKKN.js.map → learnings-KB6BT4NR.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{learnings-M64NTSOR.js.map → learnings-YYY3U2Y7.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{notes-73WE2UV2.js.map → notes-BGG7VL72.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{notes-U7L6HQQ2.js.map → notes-ZTHXVOKM.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{plan-OSCNYFGC.js.map → plan-B42KBMX7.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{plan-TN537L24.js.map → plan-LUR7C24X.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{profile-TIGLAKJ7.js.map → profile-5F75MO5O.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{profile-MHAMXMHQ.js.map → profile-JRDMDGT5.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{register-mutation-XX4H56PE.js.map → register-mutation-5UDT3WL3.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{register-mutation-P3G4XP6Q.js.map → register-mutation-7DMOYDPC.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{restore-HC3YSWF7.js.map → restore-BTBEZ5CK.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{restore-LFAMMRYZ.js.map → restore-EX4UUZL6.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{schema-DAGSYO6E.js.map → schema-DGSTYYQB.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{schema-UBXJCQAC.js.map → schema-HAIBEE24.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{update-CJGG5WMV.js.map → update-76CRUMC7.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{update-LKD64AFP.js.map → update-ZMYVXM77.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{update-many-G4SM7BHC.js.map → update-many-QYQRGNPU.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{update-many-VLIV3D7R.js.map → update-many-U4CEQWI4.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../core/item/priority.ts","../../../../../../../../core/item/type-synonyms.ts","../../../../../../../../cli/commands/metadata-normalizers.ts","../../../../../../../../cli/commands/legacy-none-tokens.ts","../../../../../../../../cli/commands/lifecycle-transitions.ts","../../../../../../../../cli/commands/linked-test-entry.ts","../../../../../../../../cli/commands/linked-test-parsers.ts","../../../../../../../../cli/commands/shared-unset-fields.ts","../../../../../../../../cli/commands/recurrence-parsers.ts","../../../../../../../../cli/commands/event-validation-messages.ts","../../../../../../../../cli/commands/repeatable-metadata-parsers.ts","../../../../../../../../cli/commands/create.ts"],"sourcesContent":["/**\n * @module core/item/priority\n *\n * Defines item parsing, formatting, and lifecycle helpers for Priority.\n */\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\n/**\n * Restricts priority values accepted by command, SDK, and storage contracts.\n */\nexport type Priority = 0 | 1 | 2 | 3 | 4;\n\n/**\n * Canonical mapping from named priority levels to numeric values. Agents and\n * humans frequently write words (\"high\") instead of numbers, so both create and\n * update accept either form. This single map is the source of truth so the two\n * commands cannot drift apart.\n */\nexport const PRIORITY_NAME_TO_VALUE: Readonly<Record<string, Priority>> = {\n critical: 0,\n high: 1,\n medium: 2,\n low: 3,\n minimal: 4,\n};\n\nconst PRIORITY_NAME_LIST = Object.keys(PRIORITY_NAME_TO_VALUE);\n\n/**\n * Human-readable description of every accepted priority form. Reused in error\n * messages so the wording stays consistent across commands.\n */\nexport const PRIORITY_ACCEPTED_FORMS_HINT =\n \"numbers 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal) or names \" +\n `(${PRIORITY_NAME_LIST.join(\", \")}), case-insensitive`;\n\nfunction priorityUsageError(raw: string): PmCliError {\n return new PmCliError(\n `Invalid priority \"${raw}\". Accepted values: ${PRIORITY_ACCEPTED_FORMS_HINT}.`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Resolve a raw `--priority` option value to a numeric 0..4 priority.\n *\n * Accepts:\n * - numeric strings 0,1,2,3,4 (unchanged from prior behavior)\n * - named levels (critical/high/medium/low/minimal), case-insensitive\n * - native numbers 0..4 (arrives via MCP tool calls that JSON-encode priority as a number)\n *\n * Throws a USAGE error listing BOTH accepted forms for anything else.\n */\nexport function resolvePriority(raw: string | number): Priority {\n if (typeof raw === \"number\") {\n if (Number.isInteger(raw) && raw >= 0 && raw <= 4) {\n return raw as Priority;\n }\n throw priorityUsageError(String(raw));\n }\n if (typeof raw !== \"string\") {\n throw priorityUsageError(String(raw));\n }\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw priorityUsageError(raw);\n }\n\n const normalizedName = trimmed.toLowerCase();\n if (Object.prototype.hasOwnProperty.call(PRIORITY_NAME_TO_VALUE, normalizedName)) {\n return PRIORITY_NAME_TO_VALUE[normalizedName as keyof typeof PRIORITY_NAME_TO_VALUE];\n }\n\n // Numeric form: only exact integers 0..4 are valid. Number() would accept\n // forms like \"1.0\" or \" 2 \", but we already trimmed and require an integer\n // match so the contract stays tight.\n if (/^[0-4]$/.test(trimmed)) {\n return Number(trimmed) as Priority;\n }\n\n throw priorityUsageError(raw);\n}\n","/**\n * Common type synonyms agents type that are not item types themselves. Telemetry\n * shows real users repeatedly run e.g. `pm create Bug \"...\"` and `pm create Change\n * \"...\"` and hit a hard \"invalid type\" error. Rather than block, `create` maps an\n * unregistered type through this table to its closest canonical built-in type (and\n * prints a note). The mapping is only a FALLBACK: it applies after the real type\n * registry fails to resolve the name, and the canonical target is itself resolved\n * through the live registry — so a project that defines its own `Bug` type keeps it,\n * and a project that has removed `Issue` will simply fall through to the normal error.\n *\n * Keys are compared case-insensitively after trimming. Values are canonical built-in\n * type names (resolved through the registry, never written verbatim).\n */\nexport const TYPE_SYNONYMS: Readonly<Record<string, string>> = {\n bug: \"Issue\",\n bugfix: \"Issue\",\n defect: \"Issue\",\n incident: \"Issue\",\n enhancement: \"Feature\",\n story: \"Feature\",\n userstory: \"Feature\",\n \"user-story\": \"Feature\",\n \"user story\": \"Feature\",\n change: \"Chore\",\n ticket: \"Task\",\n todo: \"Task\",\n};\n\n/**\n * Map a free-form type token to its canonical built-in type synonym, or `undefined`\n * when there is no synonym. The caller must still confirm the canonical target exists\n * in the active type registry before using it.\n */\nexport function resolveTypeSynonym(rawType: string | undefined): string | undefined {\n if (rawType === undefined) {\n return undefined;\n }\n return TYPE_SYNONYMS[rawType.trim().toLowerCase()];\n}\n","/**\n * @module cli/commands/metadata-normalizers\n *\n * Implements the pm metadata normalizers command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { CONFIDENCE_TEXT_VALUES } from \"../../types/index.js\";\n\n/**\n * Implements normalize risk input for the public runtime surface of this module.\n */\nexport function normalizeRiskInput(value: string): string {\n const trimmed = value.trim();\n return trimmed.toLowerCase() === \"med\" ? \"medium\" : trimmed;\n}\n\n/**\n * Implements normalize severity input for the public runtime surface of this module.\n */\nexport function normalizeSeverityInput(value: string): string {\n const trimmed = value.trim();\n return trimmed.toLowerCase() === \"med\" ? \"medium\" : trimmed;\n}\n\n/**\n * Implements parse confidence input for the public runtime surface of this module.\n */\nexport function parseConfidenceInput(value: string): number | \"low\" | \"medium\" | \"high\" {\n const trimmed = value.trim().toLowerCase();\n if (trimmed === \"med\") {\n return \"medium\";\n }\n if (CONFIDENCE_TEXT_VALUES.includes(trimmed as (typeof CONFIDENCE_TEXT_VALUES)[number])) {\n return trimmed as (typeof CONFIDENCE_TEXT_VALUES)[number];\n }\n const parsed = parseOptionalNumber(value, \"confidence\");\n if (!Number.isInteger(parsed) || parsed < 0 || parsed > 100) {\n throw new PmCliError(\"Confidence must be an integer 0..100 or one of low|med|medium|high\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements parse regression input for the public runtime surface of this module.\n */\nexport function parseRegressionInput(value: string): boolean {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n throw new PmCliError(\"Regression must be one of true|false|1|0\", EXIT_CODE.USAGE);\n}\n","/**\n * @module cli/commands/legacy-none-tokens\n *\n * Implements the pm legacy none tokens command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n/**\n * Shared legacy \"none\"/\"null\" sentinel handling for the create and update\n * commands. These tokens used to mean \"clear this field\"; they are now\n * rejected in favour of explicit --unset / --clear-* flags.\n *\n * Extracted verbatim from create.ts and update.ts (pm-why9) — behaviour and\n * error strings are identical to the previous per-command copies.\n */\nconst LEGACY_NONE_TOKENS = new Set([\"none\", \"null\"]);\n\n/**\n * Describes a repeatable option whose legacy none/null token maps to a clear flag.\n */\nexport interface LegacyNoneCollectionNormalizer<TOptions extends Record<string, unknown>> {\n optionKey: keyof TOptions;\n clearFlagKey: keyof TOptions;\n valueFlag: string;\n clearFlag: string;\n disableFlagKey?: keyof TOptions;\n}\n\n/**\n * Implements check whether legacy none token for the public runtime surface of this module.\n */\nexport function isLegacyNoneToken(value: string | undefined): boolean {\n if (value === undefined) {\n return false;\n }\n return LEGACY_NONE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/**\n * Implements assert no legacy none token for the public runtime surface of this module.\n */\nexport function assertNoLegacyNoneToken(value: string | undefined, flag: string, replacementHint?: string): void {\n if (!isLegacyNoneToken(value)) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(`${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(), EXIT_CODE.USAGE);\n}\n\n/**\n * Implements assert no legacy none tokens for the public runtime surface of this module.\n */\nexport function assertNoLegacyNoneTokens(values: string[] | undefined, flag: string, replacementHint?: string): void {\n if (!values || values.length === 0) {\n return;\n }\n const hasLegacyToken = values.some((value) => isLegacyNoneToken(value));\n if (!hasLegacyToken) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(`${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(), EXIT_CODE.USAGE);\n}\n\n/**\n * Convert collection-level legacy none/null tokens into their explicit clear flags.\n */\nexport function applyLegacyNoneCollectionNormalizers<TOptions extends Record<string, unknown>>(\n normalized: TOptions,\n definitions: ReadonlyArray<LegacyNoneCollectionNormalizer<TOptions>>,\n): TOptions {\n for (const definition of definitions) {\n const candidate = normalized[definition.optionKey];\n if (!Array.isArray(candidate) || candidate.length === 0) {\n continue;\n }\n if (!candidate.every((entry): entry is string => typeof entry === \"string\")) {\n throw new PmCliError(`${definition.valueFlag} entries must be strings.`, EXIT_CODE.USAGE);\n }\n const entries = candidate;\n const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));\n if (!hasLegacy) {\n continue;\n }\n const concreteEntries = entries.filter((entry) => !isLegacyNoneToken(entry));\n if (concreteEntries.length > 0) {\n throw new PmCliError(\n `Cannot mix legacy clear token \"none\"/\"null\" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`,\n EXIT_CODE.USAGE,\n );\n }\n normalized[definition.optionKey] = undefined as TOptions[keyof TOptions];\n normalized[definition.clearFlagKey] = true as TOptions[keyof TOptions];\n if (definition.disableFlagKey) {\n normalized[definition.disableFlagKey] = false as TOptions[keyof TOptions];\n }\n }\n return normalized;\n}\n","/**\n * @module cli/commands/lifecycle-transitions\n *\n * Implements the pm lifecycle transitions command surface and its agent-facing runtime behavior.\n */\nimport {\n normalizeStatusInputWithRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\n\n/**\n * GH-216: a contextual next-step hint that nudges agents toward the\n * underutilized `in_progress` lifecycle state instead of jumping straight from\n * `open` to `closed`. The suggestion is intentionally non-binding (no governance\n * enforcement) and only surfaces when a richer transition genuinely exists.\n */\nexport interface LifecycleTransitionSuggestion {\n /** Ready-to-run command that advances the item to the suggested status. */\n command: string;\n /** The status the suggested command moves the item to. */\n to_status: string;\n}\n\n/**\n * Item types whose lifecycle does not follow the\n * `open -> in_progress -> closed` work path. Scheduling/reference types are\n * tracked or scheduled rather than \"worked\", so a `start-task` nudge would be\n * noise. Compared case-insensitively against the resolved item type.\n */\nconst NON_WORKABLE_TYPES = new Set([\n \"event\",\n \"meeting\",\n \"reminder\",\n \"milestone\",\n \"decision\",\n \"adr\",\n]);\n\n/**\n * Suggest the next lifecycle transition for a freshly created (or open) item.\n *\n * Returns a `pm start-task` hint when the item is a workable type currently in\n * the workspace open status AND the workflow defines a distinct `in_progress`\n * status to advance to. Returns `undefined` (no hint) otherwise — including for\n * scheduling types and workflows that collapse `in_progress` into `open` — so\n * the suggestion never fabricates a transition the workflow cannot perform.\n */\nexport function suggestNextLifecycleTransition(\n id: string,\n type: string,\n status: string,\n statusRegistry: RuntimeStatusRegistry,\n): LifecycleTransitionSuggestion | undefined {\n if (NON_WORKABLE_TYPES.has(type.trim().toLowerCase())) {\n return undefined;\n }\n if (status !== statusRegistry.open_status) {\n return undefined;\n }\n const inProgress = normalizeStatusInputWithRegistry(\"in_progress\", statusRegistry);\n if (inProgress === undefined || inProgress === statusRegistry.open_status) {\n return undefined;\n }\n return { command: `pm start-task ${id}`, to_status: inProgress };\n}\n","/**\n * @module cli/commands/linked-test-entry\n *\n * Implements the pm linked test entry command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n// Keys accepted inside a structured linked-test entry. `cmd` is an alias for\n// `command`; everything else maps 1:1 to a LinkedTest field.\nexport const STRUCTURED_LINKED_TEST_KEYS = [\n \"command\",\n \"cmd\",\n \"path\",\n \"scope\",\n \"timeout\",\n \"timeout_seconds\",\n \"pm_context_mode\",\n \"env_set\",\n \"env_clear\",\n \"shared_host_safe\",\n \"assert_stdout_contains\",\n \"assert_stdout_regex\",\n \"assert_stderr_contains\",\n \"assert_stderr_regex\",\n \"assert_stdout_min_lines\",\n \"assert_json_field_equals\",\n \"assert_json_field_gte\",\n \"note\",\n] as const;\n\nconst STRUCTURED_LINKED_TEST_KEY_SET = new Set<string>(STRUCTURED_LINKED_TEST_KEYS);\nconst STRUCTURED_LINKED_TEST_KEY_PATTERN = STRUCTURED_LINKED_TEST_KEYS.map((key) =>\n key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"),\n).join(\"|\");\nconst STRUCTURED_LINKED_TEST_ENTRY_PATTERN = new RegExp(\n `^(?:[-*+]\\\\s+)?(?:${STRUCTURED_LINKED_TEST_KEY_PATTERN})\\\\s*[:=]`,\n \"i\",\n);\n\n/**\n * Implements looks like structured linked test entry for the public runtime surface of this module.\n */\nexport function looksLikeStructuredLinkedTestEntry(raw: string): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n return STRUCTURED_LINKED_TEST_ENTRY_PATTERN.test(raw);\n}\n\n/**\n * Implements normalize structured linked test entry for the public runtime surface of this module.\n */\nexport function normalizeStructuredLinkedTestEntry(\n kv: Record<string, string>,\n optionName: \"--add\" | \"--test\",\n): Record<string, string> {\n const normalizedKv: Record<string, string> = {};\n const unknownKeys: string[] = [];\n for (const [key, value] of Object.entries(kv)) {\n const normalizedKey = key.toLowerCase();\n if (!STRUCTURED_LINKED_TEST_KEY_SET.has(normalizedKey)) {\n unknownKeys.push(key);\n continue;\n }\n normalizedKv[normalizedKey] = value;\n }\n if (unknownKeys.length > 0) {\n throw new PmCliError(\n `${optionName} does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n if (normalizedKv.cmd !== undefined) {\n if (normalizedKv.command !== undefined && normalizedKv.command.trim() !== normalizedKv.cmd.trim()) {\n throw new PmCliError(`${optionName} command and cmd must match when both are provided`, EXIT_CODE.USAGE);\n }\n const { cmd, ...rest } = normalizedKv;\n return { ...rest, command: rest.command ?? cmd };\n }\n return normalizedKv;\n}\n","/**\n * @module cli/commands/linked-test-parsers\n *\n * Implements the pm linked test parsers command surface and its agent-facing runtime behavior.\n */\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { STRUCTURED_LINKED_TEST_KEYS } from \"./linked-test-entry.js\";\nimport { SCOPE_VALUES } from \"../../types/index.js\";\nimport type { LinkedTest, LinkScope } from \"../../types/index.js\";\n\n/**\n * Shared linked-test field parsers used by the `create` and `test` commands.\n *\n * Extracted verbatim from create.ts and test.ts (pm-why9). The two copies were\n * byte-identical apart from their empty-input guard: create called these with\n * raw (untrimmed) values and used `if (!normalized)`; test called them with\n * pre-`.trim()`-ed values and used `if (!raw || raw.trim().length === 0)`.\n *\n * Both reduce to the same observable behaviour when the guard is the plain\n * falsy check used here: create's call sites still pass untrimmed values\n * (behaviour preserved exactly), and test's call sites pre-trim so a\n * whitespace-only value collapses to \"\" and is rejected by `!raw` exactly as\n * before. Error strings and parsing semantics are identical to both originals.\n */\n\nexport const LINKED_TEST_PROTECTED_ENV_KEYS = new Set([\"PM_PATH\", \"PM_GLOBAL_PATH\", \"FORCE_COLOR\"]);\nexport const LINKED_TEST_ENV_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\nexport const LINKED_TEST_PM_CONTEXT_MODE_VALUES = [\"schema\", \"tracker\", \"auto\"] as const;\n/**\n * Restricts linked test pm context mode values accepted by command, SDK, and storage contracts.\n */\nexport type LinkedTestPmContextMode = (typeof LINKED_TEST_PM_CONTEXT_MODE_VALUES)[number];\n\n/**\n * Implements parse linked test env set for the public runtime surface of this module.\n */\nexport function parseLinkedTestEnvSet(raw: string | undefined, optionName: string): Record<string, string> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(`${optionName} env_set must include at least one KEY=VALUE assignment`, EXIT_CODE.USAGE);\n }\n const envSet: Record<string, string> = {};\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} env_set entries must use KEY=VALUE and be separated by semicolons. Example: env_set=PORT=0;PLAYWRIGHT_BASE_URL=http://127.0.0.1:4173`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const value = assignment.slice(separatorIndex + 1);\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw new PmCliError(`${optionName} env_set key \"${key}\" is invalid`, EXIT_CODE.USAGE);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw new PmCliError(`${optionName} env_set key \"${key}\" is reserved for sandbox safety`, EXIT_CODE.USAGE);\n }\n envSet[key] = value;\n }\n /* c8 ignore start -- envSet always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(envSet).length > 0 ? envSet : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Implements parse linked test env clear for the public runtime surface of this module.\n */\nexport function parseLinkedTestEnvClear(raw: string | undefined, optionName: string): string[] | undefined {\n if (!raw) {\n return undefined;\n }\n const keys = splitCommaList(raw, { separators: /[;,\\n]/ });\n if (keys.length === 0) {\n throw new PmCliError(`${optionName} env_clear must include at least one environment variable name`, EXIT_CODE.USAGE);\n }\n for (const key of keys) {\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw new PmCliError(`${optionName} env_clear key \"${key}\" is invalid`, EXIT_CODE.USAGE);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw new PmCliError(`${optionName} env_clear key \"${key}\" is reserved for sandbox safety`, EXIT_CODE.USAGE);\n }\n }\n return keys;\n}\n\n/**\n * Implements parse linked test boolean for the public runtime surface of this module.\n */\nexport function parseLinkedTestBoolean(raw: string | undefined, optionName: string, fieldLabel: string): boolean | undefined {\n if (!raw) {\n return undefined;\n }\n const value = raw.trim().toLowerCase();\n if (value === \"true\" || value === \"1\" || value === \"yes\") {\n return true;\n }\n if (value === \"false\" || value === \"0\" || value === \"no\") {\n return false;\n }\n throw new PmCliError(`${optionName} ${fieldLabel} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\n/**\n * Implements parse linked test context mode for the public runtime surface of this module.\n */\nexport function parseLinkedTestContextMode(\n raw: string | undefined,\n optionName: string,\n): LinkedTest[\"pm_context_mode\"] | undefined {\n if (!raw) {\n return undefined;\n }\n const value = raw.trim().toLowerCase();\n if ((LINKED_TEST_PM_CONTEXT_MODE_VALUES as readonly string[]).includes(value)) {\n return value as LinkedTest[\"pm_context_mode\"];\n }\n throw new PmCliError(\n `${optionName} pm_context_mode must be one of: ${LINKED_TEST_PM_CONTEXT_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Implements parse linked test string list for the public runtime surface of this module.\n */\nexport function parseLinkedTestStringList(raw: string | undefined): string[] | undefined {\n if (!raw) {\n return undefined;\n }\n const values = splitCommaList(raw, { separators: /[;\\n]/ });\n return values.length > 0 ? values : undefined;\n}\n\n/**\n * Implements parse linked test regex list for the public runtime surface of this module.\n */\nexport function parseLinkedTestRegexList(raw: string | undefined, optionName: string, fieldLabel: string): string[] | undefined {\n const values = parseLinkedTestStringList(raw);\n if (!values || values.length === 0) {\n return undefined;\n }\n for (const pattern of values) {\n try {\n // Validate regex syntax early so malformed assertions fail at parse time.\n // User-provided, per-item patterns only run during local CLI validation.\n new RegExp(pattern, \"m\");\n } catch (error: unknown) {\n throw new PmCliError(\n /* c8 ignore next -- RegExp only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `${optionName} ${fieldLabel} includes invalid regex \"${pattern}\": ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return values;\n}\n\n/**\n * Implements parse linked test min lines for the public runtime surface of this module.\n */\nexport function parseLinkedTestMinLines(raw: string | undefined, optionName: string): number | undefined {\n if (!raw) {\n return undefined;\n }\n const parsed = parseOptionalNumber(raw, \"assert_stdout_min_lines\");\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw new PmCliError(`${optionName} assert_stdout_min_lines must be an integer >= 0`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements parse linked test assertion equals map for the public runtime surface of this module.\n */\nexport function parseLinkedTestAssertionEqualsMap(raw: string | undefined, optionName: string): Record<string, string> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_equals must include at least one path=value assignment`, EXIT_CODE.USAGE);\n }\n const values: Record<string, string> = {};\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_equals entries must use path=value and be separated by semicolons`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const value = assignment.slice(separatorIndex + 1).trim();\n if (key.length === 0 || value.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_equals entries must include non-empty path and value`, EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n /* c8 ignore start -- values always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(values).length > 0 ? values : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Implements parse linked test assertion gte map for the public runtime surface of this module.\n */\nexport function parseLinkedTestAssertionGteMap(raw: string | undefined, optionName: string): Record<string, number> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_gte must include at least one path=value assignment`, EXIT_CODE.USAGE);\n }\n const values: Record<string, number> = {};\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_gte entries must use path=value and be separated by semicolons`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const valueRaw = assignment.slice(separatorIndex + 1).trim();\n if (key.length === 0 || valueRaw.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_gte entries must include non-empty path and value`, EXIT_CODE.USAGE);\n }\n const value = Number.parseFloat(valueRaw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(`${optionName} assert_json_field_gte value for \"${key}\" must be numeric`, EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n /* c8 ignore start -- values always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(values).length > 0 ? values : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Strict JSON linked-test entry parsing for `pm test --add-json` (pm-vcr2).\n *\n * Accepts a JSON object or array of objects whose keys match the structured\n * linked-test fields. Unlike `--add` CSV parsing, command strings are stored\n * verbatim: commas, nested quotes, `--` separators, and shell variables like\n * `$tmp` survive byte-identically.\n */\n\nconst LINKED_TEST_JSON_KEY_SET = new Set<string>(STRUCTURED_LINKED_TEST_KEYS);\n\ntype JsonRecord = Record<string, unknown>;\n\nfunction isPlainObject(value: unknown): value is JsonRecord {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction normalizeJsonEntryKeys(entry: JsonRecord, fail: (message: string) => PmCliError): JsonRecord {\n const normalized: JsonRecord = {};\n const unknownKeys: string[] = [];\n for (const [key, value] of Object.entries(entry)) {\n const normalizedKey = key.toLowerCase();\n if (!LINKED_TEST_JSON_KEY_SET.has(normalizedKey)) {\n unknownKeys.push(key);\n continue;\n }\n if (Object.hasOwn(normalized, normalizedKey)) {\n throw fail(`provides key \"${key}\" more than once after case normalization`);\n }\n normalized[normalizedKey] = value;\n }\n if (unknownKeys.length > 0) {\n throw fail(\n `does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys.map((key) => `\"${key}\"`).join(\", \")}. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`,\n );\n }\n return normalized;\n}\n\nfunction readJsonEntryString(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): string | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== \"string\") {\n throw fail(`field \"${key}\" must be a JSON string`);\n }\n return value;\n}\n\nfunction readJsonEntryStringList(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): string[] | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n const list = typeof value === \"string\" ? [value] : value;\n if (!Array.isArray(list) || list.some((item) => typeof item !== \"string\")) {\n throw fail(`field \"${key}\" must be a string or an array of strings`);\n }\n const values = (list as string[]).filter((item) => item.length > 0);\n return values.length > 0 ? values : undefined;\n}\n\nfunction readJsonEntryRegexList(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): string[] | undefined {\n const values = readJsonEntryStringList(entry, key, fail);\n if (!values) {\n return undefined;\n }\n for (const pattern of values) {\n try {\n new RegExp(pattern, \"m\");\n } catch (error: unknown) {\n throw fail(\n /* c8 ignore next -- RegExp only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `field \"${key}\" includes invalid regex \"${pattern}\": ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n return values;\n}\n\nfunction readJsonEntryNumber(value: unknown, key: string, fail: (message: string) => PmCliError): number {\n const parsed =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\" && value.trim().length > 0\n ? Number(value.trim())\n : Number.NaN;\n if (typeof value === \"boolean\" || !Number.isFinite(parsed)) {\n throw fail(`field \"${key}\" must be a finite number (or numeric string)`);\n }\n return parsed;\n}\n\nfunction readJsonEntryTimeoutSeconds(entry: JsonRecord, fail: (message: string) => PmCliError): number | undefined {\n const timeoutSecondsRaw = entry.timeout_seconds;\n const timeoutAliasRaw = entry.timeout;\n if (timeoutSecondsRaw === undefined && timeoutAliasRaw === undefined) {\n return undefined;\n }\n const timeoutSeconds = timeoutSecondsRaw === undefined ? undefined : readJsonEntryNumber(timeoutSecondsRaw, \"timeout_seconds\", fail);\n const timeoutAlias = timeoutAliasRaw === undefined ? undefined : readJsonEntryNumber(timeoutAliasRaw, \"timeout\", fail);\n if (timeoutSeconds !== undefined && timeoutAlias !== undefined && timeoutSeconds !== timeoutAlias) {\n throw fail(\"timeout and timeout_seconds must match when both are provided\");\n }\n const timeout = timeoutSeconds ?? (timeoutAlias as number);\n if (!Number.isInteger(timeout) || timeout <= 0) {\n throw fail(\"timeout_seconds must be a positive integer\");\n }\n return timeout;\n}\n\nfunction readJsonEntryScope(entry: JsonRecord, fail: (message: string) => PmCliError): LinkScope {\n const value = readJsonEntryString(entry, \"scope\", fail);\n if (value === undefined) {\n return \"project\";\n }\n if (!(SCOPE_VALUES as readonly string[]).includes(value)) {\n throw fail(`field \"scope\" must be one of: ${SCOPE_VALUES.join(\", \")}`);\n }\n return value as LinkScope;\n}\n\nfunction readJsonEntryEnvSet(entry: JsonRecord, fail: (message: string) => PmCliError): Record<string, string> | undefined {\n if (!Object.hasOwn(entry, \"env_set\")) {\n return undefined;\n }\n const value = entry.env_set;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail('field \"env_set\" must be a JSON object mapping environment names to string values');\n }\n const envSet: Record<string, string> = {};\n for (const [key, entryValue] of Object.entries(value)) {\n if (typeof entryValue !== \"string\") {\n throw fail(`field \"env_set\" value for \"${key}\" must be a string`);\n }\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw fail(`field \"env_set\" key \"${key}\" is invalid`);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw fail(`field \"env_set\" key \"${key}\" is reserved for sandbox safety`);\n }\n envSet[key] = entryValue;\n }\n return Object.keys(envSet).length > 0 ? envSet : undefined;\n}\n\nfunction readJsonEntryEnvClear(entry: JsonRecord, fail: (message: string) => PmCliError): string[] | undefined {\n const keys = readJsonEntryStringList(entry, \"env_clear\", fail);\n if (!keys) {\n return undefined;\n }\n for (const key of keys) {\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw fail(`field \"env_clear\" key \"${key}\" is invalid`);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw fail(`field \"env_clear\" key \"${key}\" is reserved for sandbox safety`);\n }\n }\n return keys;\n}\n\nfunction readJsonEntryBoolean(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): boolean | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== \"boolean\") {\n throw fail(`field \"${key}\" must be a JSON boolean (true or false)`);\n }\n return value;\n}\n\nfunction readJsonEntryMinLines(entry: JsonRecord, fail: (message: string) => PmCliError): number | undefined {\n if (!Object.hasOwn(entry, \"assert_stdout_min_lines\")) {\n return undefined;\n }\n const value = entry.assert_stdout_min_lines;\n if (value === undefined) {\n return undefined;\n }\n const parsed = readJsonEntryNumber(value, \"assert_stdout_min_lines\", fail);\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw fail('field \"assert_stdout_min_lines\" must be an integer >= 0');\n }\n return parsed;\n}\n\nfunction readJsonEntryEqualsMap(entry: JsonRecord, fail: (message: string) => PmCliError): Record<string, string> | undefined {\n if (!Object.hasOwn(entry, \"assert_json_field_equals\")) {\n return undefined;\n }\n const value = entry.assert_json_field_equals;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail('field \"assert_json_field_equals\" must be a JSON object mapping field paths to expected values');\n }\n const values: Record<string, string> = {};\n for (const [key, entryValue] of Object.entries(value)) {\n if (key.trim().length === 0) {\n throw fail('field \"assert_json_field_equals\" keys must be non-empty field paths');\n }\n if (typeof entryValue !== \"string\" && typeof entryValue !== \"number\" && typeof entryValue !== \"boolean\") {\n throw fail(`field \"assert_json_field_equals\" value for \"${key}\" must be a string, number, or boolean`);\n }\n values[key] = String(entryValue);\n }\n return Object.keys(values).length > 0 ? values : undefined;\n}\n\nfunction readJsonEntryGteMap(entry: JsonRecord, fail: (message: string) => PmCliError): Record<string, number> | undefined {\n if (!Object.hasOwn(entry, \"assert_json_field_gte\")) {\n return undefined;\n }\n const value = entry.assert_json_field_gte;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail('field \"assert_json_field_gte\" must be a JSON object mapping field paths to numeric minimums');\n }\n const values: Record<string, number> = {};\n for (const [key, entryValue] of Object.entries(value)) {\n if (key.trim().length === 0) {\n throw fail('field \"assert_json_field_gte\" keys must be non-empty field paths');\n }\n values[key] = readJsonEntryNumber(entryValue, `assert_json_field_gte.${key}`, fail);\n }\n return Object.keys(values).length > 0 ? values : undefined;\n}\n\nfunction parseLinkedTestJsonEntry(rawEntry: unknown, label: string, optionName: string): LinkedTest {\n const fail = (message: string): PmCliError => new PmCliError(`${optionName} ${label} ${message}`, EXIT_CODE.USAGE);\n if (!isPlainObject(rawEntry)) {\n throw fail(`must be a JSON object with linked-test fields. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`);\n }\n const entry = normalizeJsonEntryKeys(rawEntry, fail);\n const commandValue = readJsonEntryString(entry, \"command\", fail);\n const cmdAlias = readJsonEntryString(entry, \"cmd\", fail);\n if (commandValue !== undefined && cmdAlias !== undefined && commandValue !== cmdAlias) {\n throw fail(\"command and cmd must match when both are provided\");\n }\n const command = commandValue ?? cmdAlias;\n if (command === undefined || command.trim().length === 0) {\n throw fail('requires a non-empty \"command\" string');\n }\n const pathValue = readJsonEntryString(entry, \"path\", fail);\n const pmContextModeValue = readJsonEntryString(entry, \"pm_context_mode\", fail);\n if (pmContextModeValue !== undefined && !(LINKED_TEST_PM_CONTEXT_MODE_VALUES as readonly string[]).includes(pmContextModeValue)) {\n throw fail(`field \"pm_context_mode\" must be one of: ${LINKED_TEST_PM_CONTEXT_MODE_VALUES.join(\", \")}`);\n }\n const noteValue = readJsonEntryString(entry, \"note\", fail);\n return {\n command,\n path: pathValue !== undefined && pathValue.length > 0 ? pathValue : undefined,\n scope: readJsonEntryScope(entry, fail),\n timeout_seconds: readJsonEntryTimeoutSeconds(entry, fail),\n pm_context_mode: pmContextModeValue as LinkedTest[\"pm_context_mode\"],\n env_set: readJsonEntryEnvSet(entry, fail),\n env_clear: readJsonEntryEnvClear(entry, fail),\n shared_host_safe: readJsonEntryBoolean(entry, \"shared_host_safe\", fail),\n assert_stdout_contains: readJsonEntryStringList(entry, \"assert_stdout_contains\", fail),\n assert_stdout_regex: readJsonEntryRegexList(entry, \"assert_stdout_regex\", fail),\n assert_stderr_contains: readJsonEntryStringList(entry, \"assert_stderr_contains\", fail),\n assert_stderr_regex: readJsonEntryRegexList(entry, \"assert_stderr_regex\", fail),\n assert_stdout_min_lines: readJsonEntryMinLines(entry, fail),\n assert_json_field_equals: readJsonEntryEqualsMap(entry, fail),\n assert_json_field_gte: readJsonEntryGteMap(entry, fail),\n note: noteValue !== undefined && noteValue.trim().length > 0 ? noteValue.trim() : undefined,\n };\n}\n\n/**\n * Implements parse linked test json entries for the public runtime surface of this module.\n */\nexport function parseLinkedTestJsonEntries(raw: string, optionName: string): LinkedTest[] {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n `${optionName} requires a JSON object or array of objects describing linked-test entries`,\n EXIT_CODE.USAGE,\n );\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n /* c8 ignore next -- JSON.parse only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `${optionName} value is not valid JSON: ${error instanceof Error ? error.message : String(error)}. Provide a JSON object or array of objects, e.g. '{\"command\":\"node scripts/check.js --flag value, with commas\",\"timeout_seconds\":120}'.`,\n EXIT_CODE.USAGE,\n );\n }\n const entries = Array.isArray(parsed) ? parsed : [parsed];\n if (entries.length === 0) {\n throw new PmCliError(`${optionName} array must include at least one linked-test entry object`, EXIT_CODE.USAGE);\n }\n return entries.map((entry, index) =>\n parseLinkedTestJsonEntry(entry, entries.length > 1 ? `entry ${index + 1}` : \"entry\", optionName),\n );\n}\n\nexport const _testOnlyLinkedTestParsers = {\n parseLinkedTestJsonEntry,\n};\n","/**\n * @module cli/commands/shared-unset-fields\n *\n * Single-sources unset-field metadata shared by create and update command handlers.\n */\nimport type { RuntimeFieldCommand, RuntimeFieldRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { isLegacyNoneToken } from \"./legacy-none-tokens.js\";\n\n/**\n * Describes one command option that can be removed from item front matter through `--unset`.\n */\nexport interface CommandUnsetFieldDefinition {\n canonical: string;\n aliases: readonly string[];\n optionKey: string;\n frontMatterKey: string;\n}\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"tags\", aliases: [\"tags\"], optionKey: \"tags\", frontMatterKey: \"tags\" },\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"deadline\", aliases: [\"deadline\"], optionKey: \"deadline\", frontMatterKey: \"deadline\" },\n {\n canonical: \"estimate\",\n aliases: [\"estimate\", \"estimated_minutes\", \"estimated-minutes\"],\n optionKey: \"estimatedMinutes\",\n frontMatterKey: \"estimated_minutes\",\n },\n {\n canonical: \"acceptance-criteria\",\n aliases: [\"acceptance_criteria\", \"acceptance-criteria\", \"ac\"],\n optionKey: \"acceptanceCriteria\",\n frontMatterKey: \"acceptance_criteria\",\n },\n {\n canonical: \"definition-of-ready\",\n aliases: [\"definition_of_ready\", \"definition-of-ready\"],\n optionKey: \"definitionOfReady\",\n frontMatterKey: \"definition_of_ready\",\n },\n { canonical: \"order\", aliases: [\"order\", \"rank\"], optionKey: \"order\", frontMatterKey: \"order\" },\n { canonical: \"goal\", aliases: [\"goal\"], optionKey: \"goal\", frontMatterKey: \"goal\" },\n { canonical: \"objective\", aliases: [\"objective\"], optionKey: \"objective\", frontMatterKey: \"objective\" },\n { canonical: \"value\", aliases: [\"value\"], optionKey: \"value\", frontMatterKey: \"value\" },\n { canonical: \"impact\", aliases: [\"impact\"], optionKey: \"impact\", frontMatterKey: \"impact\" },\n { canonical: \"outcome\", aliases: [\"outcome\"], optionKey: \"outcome\", frontMatterKey: \"outcome\" },\n { canonical: \"why-now\", aliases: [\"why_now\", \"why-now\"], optionKey: \"whyNow\", frontMatterKey: \"why_now\" },\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON,\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR,\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"assignee\", aliases: [\"assignee\"], optionKey: \"assignee\", frontMatterKey: \"assignee\" },\n { canonical: \"parent\", aliases: [\"parent\"], optionKey: \"parent\", frontMatterKey: \"parent\" },\n { canonical: \"reviewer\", aliases: [\"reviewer\"], optionKey: \"reviewer\", frontMatterKey: \"reviewer\" },\n { canonical: \"risk\", aliases: [\"risk\"], optionKey: \"risk\", frontMatterKey: \"risk\" },\n { canonical: \"confidence\", aliases: [\"confidence\"], optionKey: \"confidence\", frontMatterKey: \"confidence\" },\n { canonical: \"sprint\", aliases: [\"sprint\"], optionKey: \"sprint\", frontMatterKey: \"sprint\" },\n { canonical: \"release\", aliases: [\"release\"], optionKey: \"release\", frontMatterKey: \"release\" },\n {\n canonical: \"blocked-by\",\n aliases: [\"blocked_by\", \"blocked-by\"],\n optionKey: \"blockedBy\",\n frontMatterKey: \"blocked_by\",\n },\n {\n canonical: \"blocked-reason\",\n aliases: [\"blocked_reason\", \"blocked-reason\"],\n optionKey: \"blockedReason\",\n frontMatterKey: \"blocked_reason\",\n },\n {\n canonical: \"unblock-note\",\n aliases: [\"unblock_note\", \"unblock-note\"],\n optionKey: \"unblockNote\",\n frontMatterKey: \"unblock_note\",\n },\n { canonical: \"reporter\", aliases: [\"reporter\"], optionKey: \"reporter\", frontMatterKey: \"reporter\" },\n { canonical: \"severity\", aliases: [\"severity\"], optionKey: \"severity\", frontMatterKey: \"severity\" },\n {\n canonical: \"environment\",\n aliases: [\"environment\"],\n optionKey: \"environment\",\n frontMatterKey: \"environment\",\n },\n {\n canonical: \"repro-steps\",\n aliases: [\"repro_steps\", \"repro-steps\"],\n optionKey: \"reproSteps\",\n frontMatterKey: \"repro_steps\",\n },\n {\n canonical: \"resolution\",\n aliases: [\"resolution\"],\n optionKey: \"resolution\",\n frontMatterKey: \"resolution\",\n },\n {\n canonical: \"expected-result\",\n aliases: [\"expected_result\", \"expected-result\"],\n optionKey: \"expectedResult\",\n frontMatterKey: \"expected_result\",\n },\n {\n canonical: \"actual-result\",\n aliases: [\"actual_result\", \"actual-result\"],\n optionKey: \"actualResult\",\n frontMatterKey: \"actual_result\",\n },\n {\n canonical: \"affected-version\",\n aliases: [\"affected_version\", \"affected-version\"],\n optionKey: \"affectedVersion\",\n frontMatterKey: \"affected_version\",\n },\n {\n canonical: \"fixed-version\",\n aliases: [\"fixed_version\", \"fixed-version\"],\n optionKey: \"fixedVersion\",\n frontMatterKey: \"fixed_version\",\n },\n { canonical: \"component\", aliases: [\"component\"], optionKey: \"component\", frontMatterKey: \"component\" },\n { canonical: \"regression\", aliases: [\"regression\"], optionKey: \"regression\", frontMatterKey: \"regression\" },\n {\n canonical: \"customer-impact\",\n aliases: [\"customer_impact\", \"customer-impact\"],\n optionKey: \"customerImpact\",\n frontMatterKey: \"customer_impact\",\n },\n] as const;\n\n/**\n * Result of matching a runtime schema field against a command `--unset` token.\n */\nexport interface RuntimeUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\n/**\n * Result of parsing command-level `--unset` tokens into metadata and option-key sets.\n */\nexport interface ParsedCommandUnsetTargets {\n frontMatterKeys: Set<string>;\n optionKeys: Set<string>;\n}\n\n/**\n * Resolve one normalized `--unset` token to a front-matter/option pair.\n */\nexport type CommandUnsetTargetResolver = (trimmedToken: string) => RuntimeUnsetFieldDefinition | undefined;\n\n/**\n * Parse and validate common command `--unset` tokens while preserving command-specific field resolution.\n */\nexport function parseCommandUnsetTargets(options: {\n readonly raw: readonly string[] | undefined;\n readonly resolveDefinition: CommandUnsetTargetResolver;\n readonly supportedFields: string;\n}): ParsedCommandUnsetTargets {\n const frontMatterKeys = new Set<string>();\n const optionKeys = new Set<string>();\n if (!options.raw || options.raw.length === 0) {\n return { frontMatterKeys, optionKeys };\n }\n\n for (const entry of options.raw) {\n const trimmed = entry.trim().toLowerCase();\n if (!trimmed) {\n throw new PmCliError(\"--unset values must not be empty\", EXIT_CODE.USAGE);\n }\n if (isLegacyNoneToken(trimmed)) {\n throw new PmCliError(\n '--unset no longer accepts \"none\" or \"null\". Specify concrete field names such as --unset deadline',\n EXIT_CODE.USAGE,\n );\n }\n const definition = options.resolveDefinition(trimmed);\n if (!definition) {\n throw new PmCliError(`Unsupported --unset field \"${entry}\". Supported fields: ${options.supportedFields}`, EXIT_CODE.USAGE);\n }\n frontMatterKeys.add(definition.frontMatterKey);\n optionKeys.add(definition.optionKey);\n }\n\n return { frontMatterKeys, optionKeys };\n}\n\n/**\n * Resolve a runtime-schema field definition from a command `--unset` token.\n */\nexport function resolveRuntimeUnsetFieldDefinition(\n token: string,\n command: RuntimeFieldCommand,\n runtimeFieldRegistry: RuntimeFieldRegistry | undefined,\n): RuntimeUnsetFieldDefinition | undefined {\n const normalizedToken = token.trim().toLowerCase();\n if (!runtimeFieldRegistry) {\n return undefined;\n }\n const definitions = runtimeFieldRegistry.command_to_fields?.get(command) ?? [];\n for (const definition of definitions) {\n if (definition.allow_unset === false) {\n continue;\n }\n const candidates = new Set<string>();\n if (typeof definition.key === \"string\" && definition.key.length > 0) {\n candidates.add(definition.key.toLowerCase());\n }\n if (typeof definition.metadata_key === \"string\" && definition.metadata_key.length > 0) {\n candidates.add(definition.metadata_key.toLowerCase());\n }\n if (typeof definition.cli_flag === \"string\" && definition.cli_flag.length > 0) {\n candidates.add(definition.cli_flag.replaceAll(\"-\", \"_\").toLowerCase());\n candidates.add(definition.cli_flag.toLowerCase());\n }\n if (Array.isArray(definition.cli_aliases)) {\n for (const alias of definition.cli_aliases) {\n if (typeof alias !== \"string\" || alias.length === 0) {\n continue;\n }\n candidates.add(alias.replaceAll(\"-\", \"_\").toLowerCase());\n candidates.add(alias.toLowerCase());\n }\n }\n if (!candidates.has(normalizedToken)) {\n continue;\n }\n return {\n optionKey: definition.key,\n frontMatterKey: definition.metadata_key,\n };\n }\n return undefined;\n}\n","/**\n * @module cli/commands/recurrence-parsers\n *\n * Implements the pm recurrence parsers command surface and its agent-facing runtime behavior.\n */\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport {\n RECURRENCE_FREQUENCY_VALUES,\n RECURRENCE_WEEKDAY_VALUES,\n weekdayOrderIndex,\n} from \"../../types/index.js\";\nimport type { RecurrenceRule } from \"../../types/index.js\";\n\n/**\n * Shared calendar recurrence/event parsing helpers used by the `create` and\n * `update` commands. Extracted verbatim from create.ts and update.ts (pm-why9).\n *\n * `parseEventBoolean`, `parseDelimitedList`, and `ensureEnumValue` were\n * byte-identical between the two commands (update spelled `ensureEnumValue` as\n * `ensureEnum`).\n *\n * `parseRecurrenceRule` was identical apart from the recur_interval/recur_count\n * \"provided\" guard: create used `intervalRaw !== undefined` (an empty\n * `recur_interval=` is parsed and rejected), while update used the truthy\n * `intervalRaw ?` (an empty value is skipped). That distinction is preserved\n * via the `emptyNumericGuard` option so both call sites keep their exact\n * behaviour, including error strings.\n */\n\nexport function parseEventBoolean(value: string, flag: string): boolean {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(`${flag} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\n/**\n * Implements parse delimited list for the public runtime surface of this module.\n */\nexport function parseDelimitedList(raw: string | undefined): string[] {\n if (!raw) {\n return [];\n }\n return raw\n .split(\"|\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n}\n\n/**\n * Implements ensure enum value for the public runtime surface of this module.\n */\nexport function ensureEnumValue<T extends string>(value: string, allowed: readonly T[], label: string): T {\n if (!allowed.includes(value as T)) {\n throw new PmCliError(`Invalid ${label} value \"${value}\". Allowed: ${allowed.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return value as T;\n}\n\n/**\n * `\"defined\"` parses `recur_interval=`/`recur_count=` (empty values), matching\n * the historical `create` behaviour. `\"truthy\"` skips empty values, matching\n * the historical `update` behaviour.\n */\nexport type RecurrenceEmptyNumericGuard = \"defined\" | \"truthy\";\n\n/**\n * Authoritative list of the CSV/markdown recurrence keys this parser reads.\n * Co-located with {@link parseRecurrenceRule} so adding a recurrence field\n * updates the reads AND the strict unknown-key allow-list in one place — the\n * `--event` validator (repeatable-metadata-parsers EVENT_KEYS) spreads this, so\n * a new recur key can never be silently rejected (GH-258). Keep in sync with\n * the `kv.recur_*` reads below.\n */\nexport const RECURRENCE_CSV_KEYS = [\n \"recur_freq\",\n \"recur_interval\",\n \"recur_count\",\n \"recur_until\",\n \"recur_by_weekday\",\n \"recur_by_month_day\",\n \"recur_exdates\",\n] as const;\n\nfunction numericRecurrenceValueProvided(raw: string | undefined, guard: RecurrenceEmptyNumericGuard): boolean {\n return guard === \"defined\" ? raw !== undefined : Boolean(raw);\n}\n\nfunction parsePositiveRecurrenceInteger(raw: string | undefined, label: string, guard: RecurrenceEmptyNumericGuard): number | undefined {\n if (!numericRecurrenceValueProvided(raw, guard)) {\n return undefined;\n }\n const parsed = parseOptionalNumber(raw as string, `event ${label}`);\n if (!Number.isInteger(parsed) || parsed < 1) {\n throw new PmCliError(`--event ${label} must be an integer >= 1`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseRecurrenceUntil(untilRaw: string | undefined, startAt: string, nowValue: Date): string | undefined {\n const until = untilRaw ? resolveIsoOrRelative(untilRaw, nowValue, \"event.recur_until\") : undefined;\n if (until && until < startAt) {\n throw new PmCliError(\"--event recur_until must be at or after start\", EXIT_CODE.USAGE);\n }\n return until;\n}\n\nfunction parseRecurrenceWeekdays(raw: string | undefined): Array<(typeof RECURRENCE_WEEKDAY_VALUES)[number]> {\n return Array.from(\n new Set(\n parseDelimitedList(raw).map((value) => ensureEnumValue(value.toLowerCase(), RECURRENCE_WEEKDAY_VALUES, \"event weekday\")),\n ),\n ).sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right));\n}\n\nfunction parseRecurrenceMonthDays(raw: string | undefined): number[] {\n return Array.from(\n new Set(\n parseDelimitedList(raw).map((value) => {\n const day = parseOptionalNumber(value, \"event recur_by_month_day\");\n if (!Number.isInteger(day) || day < 1 || day > 31) {\n throw new PmCliError(\"--event recur_by_month_day values must be integers 1..31\", EXIT_CODE.USAGE);\n }\n return day;\n }),\n ),\n ).sort((left, right) => left - right);\n}\n\nfunction parseRecurrenceExdates(raw: string | undefined, nowValue: Date): string[] {\n return Array.from(\n new Set(parseDelimitedList(raw).map((value) => resolveIsoOrRelative(value, nowValue, \"event.recur_exdates\"))),\n ).sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Implements parse recurrence rule for the public runtime surface of this module.\n */\nexport function parseRecurrenceRule(\n kv: Record<string, string>,\n startAt: string,\n nowValue: Date,\n emptyNumericGuard: RecurrenceEmptyNumericGuard,\n): RecurrenceRule | undefined {\n const freqRaw = kv.recur_freq?.trim();\n const intervalRaw = kv.recur_interval?.trim();\n const countRaw = kv.recur_count?.trim();\n const untilRaw = kv.recur_until?.trim();\n const byWeekdayRaw = kv.recur_by_weekday?.trim();\n const byMonthDayRaw = kv.recur_by_month_day?.trim();\n const exdatesRaw = kv.recur_exdates?.trim();\n\n const recurrenceInputsProvided = [freqRaw, intervalRaw, countRaw, untilRaw, byWeekdayRaw, byMonthDayRaw, exdatesRaw].some(\n (value) => value !== undefined,\n );\n if (!recurrenceInputsProvided) {\n return undefined;\n }\n if (!freqRaw) {\n throw new PmCliError(\"--event recurrence fields require recur_freq=<daily|weekly|monthly|yearly>\", EXIT_CODE.USAGE);\n }\n\n const freq = ensureEnumValue(freqRaw.toLowerCase(), RECURRENCE_FREQUENCY_VALUES, \"event recurrence frequency\");\n const interval = parsePositiveRecurrenceInteger(intervalRaw, \"recur_interval\", emptyNumericGuard);\n const count = parsePositiveRecurrenceInteger(countRaw, \"recur_count\", emptyNumericGuard);\n const until = parseRecurrenceUntil(untilRaw, startAt, nowValue);\n const byWeekday = parseRecurrenceWeekdays(byWeekdayRaw);\n const byMonthDay = parseRecurrenceMonthDays(byMonthDayRaw);\n const exdates = parseRecurrenceExdates(exdatesRaw, nowValue);\n\n return {\n freq,\n interval,\n count,\n until,\n by_weekday: byWeekday.length > 0 ? byWeekday : undefined,\n by_month_day: byMonthDay.length > 0 ? byMonthDay : undefined,\n exdates: exdates.length > 0 ? exdates : undefined,\n };\n}\n","/**\n * @module cli/commands/event-validation-messages\n *\n * Implements the pm event validation messages command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\n\nexport const EVENT_END_AFTER_START_MESSAGE =\n \"--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.\";\n\nexport const EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE =\n \"--event end and duration are mutually exclusive; provide only one (use duration=<relative> like duration=2h, duration=30min, or duration=PT30M, or set an explicit end).\";\n\nconst MINUTE_DURATION = /^([+-]?)(\\d+)(min|mins|minute|minutes)$/i;\nconst ISO_8601_TIME_DURATION = /^([+-]?)[Pp][Tt](?:(\\d+)[Hh])?(?:(\\d+)[Mm])?(?:(\\d+)[Ss])?$/;\nconst MILLIS_PER_SECOND = 1000;\nconst MILLIS_PER_MINUTE = 60 * MILLIS_PER_SECOND;\nconst MILLIS_PER_HOUR = 60 * MILLIS_PER_MINUTE;\n\nfunction toIsoTimestampOrThrow(timestampMs: number, durationRaw: string): string {\n const resolved = new Date(timestampMs);\n if (!Number.isFinite(resolved.getTime())) {\n throw new PmCliError(\n `Invalid event.duration value \"${durationRaw}\". Duration is out of supported timestamp range.`,\n EXIT_CODE.USAGE,\n );\n }\n return resolved.toISOString();\n}\n\nfunction resolveDurationAgainstStart(startAt: string, durationRaw: string): string {\n const start = new Date(startAt);\n const trimmedDuration = durationRaw.trim();\n\n const minuteDuration = MINUTE_DURATION.exec(trimmedDuration);\n if (minuteDuration) {\n const sign = minuteDuration[1] === \"-\" ? -1 : 1;\n const amount = Number.parseInt(minuteDuration[2], 10) * sign;\n return toIsoTimestampOrThrow(start.getTime() + amount * MILLIS_PER_MINUTE, trimmedDuration);\n }\n\n const isoDuration = ISO_8601_TIME_DURATION.exec(trimmedDuration);\n if (isoDuration) {\n const [, signToken, hoursToken, minutesToken, secondsToken] = isoDuration;\n const hasComponent = hoursToken || minutesToken || secondsToken;\n if (hasComponent) {\n const sign = signToken === \"-\" ? -1 : 1;\n const hours = Number.parseInt(hoursToken ?? \"0\", 10);\n const minutes = Number.parseInt(minutesToken ?? \"0\", 10);\n const seconds = Number.parseInt(secondsToken ?? \"0\", 10);\n const totalMillis = hours * MILLIS_PER_HOUR + minutes * MILLIS_PER_MINUTE + seconds * MILLIS_PER_SECOND;\n return toIsoTimestampOrThrow(start.getTime() + sign * totalMillis, trimmedDuration);\n }\n }\n\n const normalizedDuration =\n trimmedDuration.startsWith(\"+\") || trimmedDuration.startsWith(\"-\") ? trimmedDuration : `+${trimmedDuration}`;\n return resolveIsoOrRelative(normalizedDuration, start, \"event.duration\");\n}\n\n// Shared by `pm create` (parseEvents) and `pm update` (parseEventEntries) so the\n// two parallel parse sites cannot drift. Resolves the event end timestamp from\n// either an explicit `end` or a relative `duration` (mutually exclusive).\n// Equal start/end (including a zero-length duration) collapses to an instant\n// event (end dropped); an end earlier than start is rejected.\n/**\n * Implements resolve event end at for the public runtime surface of this module.\n */\nexport function resolveEventEndAt(\n startAt: string,\n endRaw: string | undefined,\n durationRaw: string | undefined,\n referenceDate: Date,\n): string | undefined {\n if (endRaw && durationRaw) {\n throw new PmCliError(EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE, EXIT_CODE.USAGE);\n }\n if (durationRaw) {\n // Resolve duration with startAt as the reference so duration=2h means startAt + 2h.\n // Keep global relative token semantics unchanged (`m` stays months) while\n // allowing explicit sub-hour forms (`30min`, `PT30M`) for event durations.\n const endAt = resolveDurationAgainstStart(startAt, durationRaw);\n if (endAt < startAt) {\n throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);\n }\n // A zero-length duration is an instant event, mirroring explicit equal start/end.\n if (endAt === startAt) {\n return undefined;\n }\n return endAt;\n }\n if (!endRaw) {\n return undefined;\n }\n const endAt = resolveIsoOrRelative(endRaw, referenceDate, \"event.end\");\n if (endAt < startAt) {\n throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);\n }\n // Equal start/end collapses to an instant event (drop end) instead of being rejected.\n if (endAt === startAt) {\n return undefined;\n }\n return endAt;\n}\n","/**\n * @module cli/commands/repeatable-metadata-parsers\n *\n * Implements the pm repeatable metadata parsers command surface and its agent-facing runtime behavior.\n */\nimport { assertNoUnknownCsvKeys, parseCsvKv } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport type { CalendarEvent, Reminder } from \"../../types/index.js\";\nimport { resolveEventEndAt } from \"./event-validation-messages.js\";\nimport {\n parseEventBoolean,\n parseRecurrenceRule,\n RECURRENCE_CSV_KEYS,\n type RecurrenceEmptyNumericGuard,\n} from \"./recurrence-parsers.js\";\n\n/** Allowed CSV/markdown keys for `--reminder` (GH-258). */\nconst REMINDER_KEYS = [\"at\", \"date\", \"text\", \"title\"] as const;\n/**\n * Allowed CSV/markdown keys for `--event` (GH-258). Recurrence keys are spread\n * from the authoritative RECURRENCE_CSV_KEYS next to parseRecurrenceRule so the\n * allow-list can never drift from what the recurrence parser actually reads.\n */\nconst EVENT_KEYS = [\n \"start\",\n \"date\",\n \"end\",\n \"duration\",\n \"title\",\n \"description\",\n \"location\",\n \"timezone\",\n \"all_day\",\n ...RECURRENCE_CSV_KEYS,\n] as const;\n/** Allowed CSV/markdown keys for the `--type-option` structured form (GH-258). */\nconst TYPE_OPTION_KEYS = [\"key\", \"value\"] as const;\n\ntype EmptyValueGuard = \"defined\" | \"truthy\";\ntype ReminderValueMode = \"raw\" | \"trimmed\";\n\ninterface ParseReminderEntriesOptions {\n valueMode: ReminderValueMode;\n}\n\ninterface ParseEventEntriesOptions {\n allDayEmptyGuard: EmptyValueGuard;\n recurrenceEmptyNumericGuard: RecurrenceEmptyNumericGuard;\n}\n\nfunction optionalString(value: string | undefined, mode: ReminderValueMode): string | undefined {\n return mode === \"trimmed\" ? value?.trim() : value;\n}\n\nfunction isProvided(value: string | undefined, guard: EmptyValueGuard): boolean {\n return guard === \"defined\" ? value !== undefined : Boolean(value);\n}\n\n/**\n * Implements parse reminder entries for the public runtime surface of this module.\n */\nexport function parseReminderEntries(raw: string[], nowValue: Date, options: ParseReminderEntriesOptions): Reminder[] {\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--reminder\");\n assertNoUnknownCsvKeys(kv, \"--reminder\", REMINDER_KEYS);\n const atRaw = optionalString(kv.at ?? kv.date, options.valueMode);\n const textRaw = optionalString(kv.text ?? kv.title, options.valueMode);\n if (!atRaw || !textRaw) {\n throw new PmCliError(\"--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>\", EXIT_CODE.USAGE);\n }\n const text = textRaw.trim();\n if (!text) {\n throw new PmCliError(\"--reminder text must not be empty\", EXIT_CODE.USAGE);\n }\n return {\n at: resolveIsoOrRelative(atRaw, nowValue, \"reminder.at\"),\n text,\n };\n });\n}\n\n/**\n * Implements parse event entries for the public runtime surface of this module.\n */\nexport function parseEventEntries(raw: string[], nowValue: Date, options: ParseEventEntriesOptions): CalendarEvent[] {\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--event\");\n assertNoUnknownCsvKeys(kv, \"--event\", EVENT_KEYS);\n const startRaw = (kv.start ?? kv.date)?.trim();\n if (!startRaw) {\n throw new PmCliError(\"--event requires start=<iso|relative> or date=<iso|relative>\", EXIT_CODE.USAGE);\n }\n const startAt = resolveIsoOrRelative(startRaw, nowValue, \"event.start\");\n const endRaw = kv.end?.trim();\n const durationRaw = kv.duration?.trim();\n const endAt = resolveEventEndAt(startAt, endRaw, durationRaw, nowValue);\n\n const titleRaw = kv.title;\n const descriptionRaw = kv.description;\n const locationRaw = kv.location;\n const timezoneRaw = kv.timezone;\n\n const title = titleRaw?.trim();\n const description = descriptionRaw?.trim();\n const location = locationRaw?.trim();\n const timezone = timezoneRaw?.trim();\n const optionalTextFields = [\n [\"title\", titleRaw, title],\n [\"description\", descriptionRaw, description],\n [\"location\", locationRaw, location],\n [\"timezone\", timezoneRaw, timezone],\n ] as const;\n for (const [fieldLabel, rawValue, trimmedValue] of optionalTextFields) {\n if (rawValue !== undefined && !trimmedValue) {\n throw new PmCliError(`--event ${fieldLabel} must not be empty`, EXIT_CODE.USAGE);\n }\n }\n\n const allDayRaw = kv.all_day?.trim();\n const recurrence = parseRecurrenceRule(kv, startAt, nowValue, options.recurrenceEmptyNumericGuard);\n const allDay = isProvided(allDayRaw, options.allDayEmptyGuard)\n ? parseEventBoolean(allDayRaw as string, \"--event all_day\")\n : undefined;\n\n return {\n start_at: startAt,\n end_at: endAt,\n title,\n description,\n location,\n all_day: allDay,\n timezone,\n recurrence,\n };\n });\n}\n\n/**\n * Implements parse type option entries for the public runtime surface of this module.\n */\nexport function parseTypeOptionEntries(raw: string[]): Record<string, string> {\n const values: Record<string, string> = {};\n for (const entry of raw) {\n const trimmedEntry = entry.trim();\n if (trimmedEntry.length === 0) {\n throw new PmCliError(\"--type-option values must not be empty\", EXIT_CODE.USAGE);\n }\n let key: string | undefined;\n let value: string | undefined;\n const prefersStructuredKv =\n trimmedEntry.includes(\",\") ||\n trimmedEntry.includes(\"\\n\") ||\n trimmedEntry.startsWith(\"```\") ||\n /^(?:[-*+]\\s+)?(?:key|value)\\s*[:=]/i.test(trimmedEntry);\n if (prefersStructuredKv) {\n const kv = parseCsvKv(trimmedEntry, \"--type-option\");\n assertNoUnknownCsvKeys(kv, \"--type-option\", TYPE_OPTION_KEYS);\n key = kv.key?.trim();\n value = kv.value?.trim();\n } else {\n const equalsIndex = trimmedEntry.indexOf(\"=\");\n const colonIndex = trimmedEntry.indexOf(\":\");\n let separatorIndex = equalsIndex;\n if (equalsIndex <= 0 && colonIndex > 0) {\n separatorIndex = colonIndex;\n }\n if (separatorIndex <= 0 || separatorIndex === trimmedEntry.length - 1) {\n throw new PmCliError(\n \"--type-option requires key=value or key=<name>,value=<value> entries\",\n EXIT_CODE.USAGE,\n );\n }\n key = trimmedEntry.slice(0, separatorIndex).trim();\n value = trimmedEntry.slice(separatorIndex + 1).trim();\n }\n if (!key || !value) {\n throw new PmCliError(\"--type-option requires key and value\", EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n return Object.fromEntries(Object.entries(values).sort((left, right) => left[0].localeCompare(right[0])));\n}\n","/**\n * @module cli/commands/create\n *\n * Implements the pm create command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId, normalizeItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport {\n assertParentReferenceIsNotSelf,\n isPlaceholderReferenceToken,\n normalizeParentReferenceValue,\n validateMissingParentReference,\n} from \"../../core/item/parent-reference-policy.js\";\nimport { validateSprintOrReleaseValue } from \"../../core/item/sprint-release-format.js\";\nimport {\n assertNoUnknownCsvKeys,\n createStdinTokenResolver,\n looksLikeGenericKeyValueEntry,\n mergeAdditiveTags,\n parseCsvKv,\n parseOptionalNumber,\n parseTags,\n} from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { getFocusedItem } from \"../../core/session/session-state.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { CREATE_DIRECT_CLOSE_REASON_DEFAULT } from \"../../core/shared/constants.js\";\nimport {\n canonicalizeCommandOptionKey,\n commandOptionFlagLabel,\n type ItemTypeRegistry,\n resolveItemTypeRegistry,\n resolveCommandOptionPolicyState,\n type ResolvedItemTypeDefinition,\n resolveTypeDefinition,\n resolveTypeName,\n validateTypeOptions,\n} from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { printError } from \"../../core/output/output.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport { resolveTypeSynonym } from \"../../core/item/type-synonyms.js\";\nimport { collectRuntimeCreateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport {\n type RuntimeFieldRegistry,\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveCommandHandler,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport {\n collectRegisteredItemFieldNames,\n applyRegisteredItemFieldDefaultsAndValidation,\n parseRegisteredItemFieldAssignments,\n} from \"../../core/extensions/item-fields.js\";\nimport { locateItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport {\n normalizeRiskInput,\n normalizeSeverityInput,\n parseConfidenceInput,\n parseRegressionInput,\n} from \"./metadata-normalizers.js\";\nimport {\n applyLegacyNoneCollectionNormalizers,\n assertNoLegacyNoneToken,\n assertNoLegacyNoneTokens,\n isLegacyNoneToken,\n type LegacyNoneCollectionNormalizer,\n} from \"./legacy-none-tokens.js\";\nimport {\n suggestNextLifecycleTransition,\n type LifecycleTransitionSuggestion,\n} from \"./lifecycle-transitions.js\";\nimport {\n parseLinkedTestAssertionEqualsMap,\n parseLinkedTestAssertionGteMap,\n parseLinkedTestBoolean,\n parseLinkedTestContextMode,\n parseLinkedTestEnvClear,\n parseLinkedTestEnvSet,\n parseLinkedTestMinLines,\n parseLinkedTestRegexList,\n parseLinkedTestStringList,\n} from \"./linked-test-parsers.js\";\nimport { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry } from \"./linked-test-entry.js\";\nimport {\n COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,\n parseCommandUnsetTargets,\n resolveRuntimeUnsetFieldDefinition,\n type CommandUnsetFieldDefinition,\n} from \"./shared-unset-fields.js\";\nimport type {\n MutationMetadataCommandOptions,\n SharedLinkedResourceClearOptions,\n SharedLinkedResourceOptions,\n} from \"./mutation-command-options.js\";\nimport { ensureEnumValue } from \"./recurrence-parsers.js\";\nimport {\n parseEventEntries,\n parseReminderEntries,\n parseTypeOptionEntries,\n} from \"./repeatable-metadata-parsers.js\";\nimport type {\n CalendarEvent,\n Comment,\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n Reminder,\n} from \"../../types/index.js\";\nimport {\n DEPENDENCY_KIND_VALUES,\n ISSUE_SEVERITY_VALUES,\n RISK_VALUES,\n SCOPE_VALUES,\n} from \"../../types/index.js\";\n\n/**\n * Documents the create command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CreateCommandOptions\n extends MutationMetadataCommandOptions,\n SharedLinkedResourceOptions,\n SharedLinkedResourceClearOptions {\n title?: string;\n description?: string;\n type?: string;\n status?: string;\n priority?: string;\n tags?: string;\n addTags?: string[];\n body?: string;\n allowMissingParent?: boolean;\n template?: string;\n createMode?: string;\n schedulePreset?: string;\n [key: string]: unknown;\n}\n\n/**\n * Documents the create result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CreateResult {\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n // GH-161: set to \"focus\" when the item's parent was inherited from the\n // session focused item (`pm focus <id>`) rather than an explicit --parent.\n parent_source?: \"focus\";\n // GH-216: optional non-binding nudge toward the next lifecycle transition\n // (e.g. `pm start-task <id>`), present only when a richer transition exists.\n next_transition?: LifecycleTransitionSuggestion;\n}\n\ntype CreateMode = \"strict\" | \"progressive\";\nconst CREATE_MODE_VALUES = [\"strict\", \"progressive\"] as const;\ntype ScheduleCreatePreset = \"lightweight\";\nconst SCHEDULE_CREATE_PRESET_VALUES = [\"lightweight\"] as const;\nconst SCHEDULE_CREATE_PRESET_TYPES = new Set([\"Reminder\", \"Meeting\", \"Event\"]);\nconst LOG_SEED_ALLOWED_KEYS = new Set([\"author\", \"created_at\", \"text\"]);\n\ninterface CreateUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\nconst CREATE_UNSET_FIELD_DEFINITIONS: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,\n { canonical: \"author\", aliases: [\"author\"], optionKey: \"author\", frontMatterKey: \"author\" },\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n];\n\nconst CREATE_UNSET_ALIAS_MAP: Map<string, CreateUnsetFieldDefinition> = (() => {\n const map = new Map<string, CreateUnsetFieldDefinition>();\n for (const definition of CREATE_UNSET_FIELD_DEFINITIONS) {\n for (const alias of definition.aliases) {\n map.set(alias, {\n optionKey: definition.optionKey,\n frontMatterKey: definition.frontMatterKey,\n });\n }\n }\n return map;\n})();\n\nconst CREATE_OPTION_KEY_TO_UNSET_CANONICAL = new Map<string, string>(\n CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => [definition.optionKey, definition.canonical]),\n);\n\nconst CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS = CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => definition.canonical)\n .sort((left, right) => left.localeCompare(right))\n .join(\", \");\n\nfunction buildInvalidLogSeedKeysMessage(\n optionName: \"--comment\" | \"--note\" | \"--learning\",\n unsupportedKeys: string[],\n): string {\n const sortedUnsupported = [...unsupportedKeys].sort((left, right) => left.localeCompare(right));\n const keyLabel = sortedUnsupported.length === 1 ? \"key\" : \"keys\";\n return (\n `${optionName} supports only author, created_at, and text seed fields. ` +\n `Found unsupported ${keyLabel}: ${sortedUnsupported.join(\", \")}. ` +\n `If text contains comma-separated key:value-like fragments, wrap text in quotes ` +\n '(for example text=\"first,scope:project\"), use markdown-style key/value input, ' +\n `or pass ${optionName} - with piped stdin.`\n );\n}\n\nfunction parseStatusValue(value: string, statusRegistry: RuntimeStatusRegistry): ItemStatus {\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(`Invalid status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\n/**\n * Resolve the create-time status when `--status` is omitted: a config-driven\n * per-type `default_status` (from `pm schema add-type --default-status`) wins,\n * then the workflow open status. An unknown configured value degrades to the\n * open status rather than blocking the create (never-block-the-agent).\n */\nfunction resolveCreateDefaultStatus(\n typeDefinition: ResolvedItemTypeDefinition,\n statusRegistry: RuntimeStatusRegistry,\n): ItemStatus {\n const configured = typeDefinition.default_status;\n if (configured !== undefined) {\n const normalized = normalizeStatusInput(configured, statusRegistry);\n if (normalized) {\n return normalized;\n }\n }\n return statusRegistry.open_status;\n}\n\nfunction parseCreatedAt(value: string | undefined, currentIso: string): string {\n if (!value || value.trim() === \"\" || value.trim().toLowerCase() === \"now\") {\n return currentIso;\n }\n const parsed = Date.parse(value);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`Invalid created_at timestamp \"${value}\"`, EXIT_CODE.USAGE);\n }\n return new Date(parsed).toISOString();\n}\n\nconst CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS: ReadonlyArray<LegacyNoneCollectionNormalizer<CreateCommandOptions>> = [\n { optionKey: \"dep\", clearFlagKey: \"clearDeps\", valueFlag: \"--dep\", clearFlag: \"--clear-deps\" },\n { optionKey: \"comment\", clearFlagKey: \"clearComments\", valueFlag: \"--comment\", clearFlag: \"--clear-comments\" },\n { optionKey: \"note\", clearFlagKey: \"clearNotes\", valueFlag: \"--note\", clearFlag: \"--clear-notes\" },\n { optionKey: \"learning\", clearFlagKey: \"clearLearnings\", valueFlag: \"--learning\", clearFlag: \"--clear-learnings\" },\n { optionKey: \"file\", clearFlagKey: \"clearFiles\", valueFlag: \"--file\", clearFlag: \"--clear-files\" },\n { optionKey: \"test\", clearFlagKey: \"clearTests\", valueFlag: \"--test\", clearFlag: \"--clear-tests\" },\n { optionKey: \"doc\", clearFlagKey: \"clearDocs\", valueFlag: \"--doc\", clearFlag: \"--clear-docs\" },\n { optionKey: \"reminder\", clearFlagKey: \"clearReminders\", valueFlag: \"--reminder\", clearFlag: \"--clear-reminders\" },\n { optionKey: \"event\", clearFlagKey: \"clearEvents\", valueFlag: \"--event\", clearFlag: \"--clear-events\" },\n { optionKey: \"typeOption\", clearFlagKey: \"clearTypeOptions\", valueFlag: \"--type-option\", clearFlag: \"--clear-type-options\" },\n];\n\nfunction normalizeLegacyNoneCreateOptions(options: CreateCommandOptions): CreateCommandOptions {\n const normalized: CreateCommandOptions = {\n ...options,\n unset: options.unset ? [...options.unset] : undefined,\n };\n /* c8 ignore start -- unset dedupe helper branch permutations are covered by legacy option compatibility suites. */\n const appendUnsetTarget = (value: string): void => {\n const current = normalized.unset ? [...normalized.unset] : [];\n if (!current.includes(value)) {\n current.push(value);\n }\n normalized.unset = current;\n };\n /* c8 ignore stop */\n\n if (isLegacyNoneToken(normalized.template)) {\n normalized.template = undefined;\n }\n\n const scalarOptionKeys = new Set<string>([...CREATE_OPTION_KEY_TO_UNSET_CANONICAL.keys(), \"rank\"]);\n for (const optionKey of scalarOptionKeys) {\n const candidate = normalized[optionKey];\n if (typeof candidate !== \"string\" || !isLegacyNoneToken(candidate)) {\n continue;\n }\n /* c8 ignore start -- rank alias canonicalization is exercised in legacy-option compatibility tests. */\n const canonicalUnset = optionKey === \"rank\" ? \"order\" : (CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey);\n appendUnsetTarget(canonicalUnset);\n normalized[optionKey] = undefined;\n /* c8 ignore stop */\n }\n\n return applyLegacyNoneCollectionNormalizers(normalized, CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS);\n}\n\nfunction parseOptionalString(value: string | undefined): string | undefined {\n if (value === undefined) return undefined;\n return value;\n}\n\nfunction parseCreateUnsetTargets(\n raw: string[] | undefined,\n runtimeFieldRegistry?: RuntimeFieldRegistry,\n): { frontMatterKeys: Set<string>; optionKeys: Set<string> } {\n return parseCommandUnsetTargets({\n raw,\n supportedFields: CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS,\n resolveDefinition: (trimmed) =>\n CREATE_UNSET_ALIAS_MAP.get(trimmed) ?? resolveRuntimeUnsetFieldDefinition(trimmed, \"create\", runtimeFieldRegistry),\n });\n}\n\n/** Allowed CSV/markdown keys for the create `--dep` seed (GH-258). */\nconst DEP_SEED_KEYS = [\"id\", \"kind\", \"type\", \"author\", \"created_at\"] as const;\n/** Allowed CSV/markdown keys for create `--file`/`--doc` seeds (GH-258). */\nconst LINKED_ARTIFACT_SEED_KEYS = [\"path\", \"scope\", \"note\"] as const;\n\nfunction parseDependencies(\n raw: string[] | undefined,\n nowValue: string,\n prefix: string,\n): { values: Dependency[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--dep\", \"Use --clear-deps to clear dependencies.\");\n const values: Dependency[] = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, DEP_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--dep\") : { id: trimmedEntry, kind: \"related\" };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--dep\", DEP_SEED_KEYS);\n }\n const id = parseOptionalString(kv.id);\n const kind = normalizeDependencyKindInput(parseOptionalString(kv.kind ?? kv.type));\n if (!id || !kind) {\n throw new PmCliError(\"--dep requires id and kind, or a bare item id to create a related dependency\", EXIT_CODE.USAGE);\n }\n if (id.trim().toLowerCase() === \"undefined\") {\n throw new PmCliError(\n `--dep id must not use placeholder token \"${id}\". Use --clear-deps to clear dependencies.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n id: normalizeItemId(id, prefix),\n kind: ensureEnumValue(kind, DEPENDENCY_KIND_VALUES, \"dependency kind\"),\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author),\n };\n });\n return { values, explicitEmpty: false };\n}\n\nconst DEPENDENCY_KIND_INPUT_ALIASES: Readonly<Record<string, string>> = {\n \"blocked-by\": \"blocked_by\",\n depends_on: \"blocked_by\",\n \"depends-on\": \"blocked_by\",\n};\n\nfunction normalizeDependencyKindInput(raw: string | undefined): string | undefined {\n if (typeof raw !== \"string\") {\n return raw;\n }\n const alias = DEPENDENCY_KIND_INPUT_ALIASES[raw.toLowerCase()];\n return alias ?? raw;\n}\n\nfunction looksLikeStructuredEntry(raw: string, keys: readonly string[]): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n const keyPattern = keys.map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\");\n if (new RegExp(`^(?:[-*+]\\\\s+)?(?:${keyPattern})\\\\s*[:=]`, \"i\").test(raw)) {\n return true;\n }\n // A first-key typo (e.g. `bogus=v,id=pm-2`) must still be parsed so the unknown\n // key is rejected rather than swallowed as a bare id/path value (GH-258).\n return looksLikeGenericKeyValueEntry(raw);\n}\n\n/**\n * Implements parse log seed for the public runtime surface of this module.\n */\nexport function parseLogSeed(\n optionName: \"--comment\" | \"--note\" | \"--learning\",\n raw: string[] | undefined,\n nowValue: string,\n fallbackAuthor: string,\n): { values: LogNote[] | Comment[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n const clearHint =\n optionName === \"--comment\"\n ? \"Use --clear-comments to clear comments.\"\n : optionName === \"--note\"\n ? \"Use --clear-notes to clear notes.\"\n : \"Use --clear-learnings to clear learnings.\";\n assertNoLegacyNoneTokens(raw, optionName, clearHint);\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const buildPlainTextCommentSeed = (): Comment => {\n /* c8 ignore start -- empty plaintext fallback is guarded by option parsing before create execution. */\n if (trimmedEntry.length === 0) {\n throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);\n }\n /* c8 ignore stop */\n return {\n created_at: nowValue,\n author: fallbackAuthor,\n text: trimmedEntry,\n };\n };\n let kv: Record<string, string>;\n try {\n kv = parseCsvKv(entry, optionName);\n } catch (error: unknown) {\n /* c8 ignore start -- optionName is type-narrowed to --comment/--note/--learning, so this branch is always true and the rethrow is unreachable. */\n if (optionName === \"--comment\" || optionName === \"--note\" || optionName === \"--learning\") {\n return buildPlainTextCommentSeed();\n }\n throw error;\n /* c8 ignore stop */\n }\n const unsupportedKeys = Object.keys(kv).filter((key) => !LOG_SEED_ALLOWED_KEYS.has(key));\n if (unsupportedKeys.length > 0) {\n return {\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author) ?? fallbackAuthor,\n text: trimmedEntry,\n };\n }\n const text = kv.text ?? \"\";\n if (text === \"\") {\n throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);\n }\n return {\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author) ?? fallbackAuthor,\n text,\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse files for the public runtime surface of this module.\n */\nexport function parseFiles(raw: string[] | undefined): { values: LinkedFile[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--file\", \"Use --clear-files to clear linked files.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, LINKED_ARTIFACT_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--file\") : { path: trimmedEntry };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--file\", LINKED_ARTIFACT_SEED_KEYS);\n }\n if (!kv.path) {\n throw new PmCliError(\"--file requires path=<value> or a bare file path\", EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"file scope\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse tests for the public runtime surface of this module.\n */\nexport function parseTests(raw: string[] | undefined): { values: LinkedTest[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--test\", \"Use --clear-tests to clear linked tests.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const kv = looksLikeStructuredLinkedTestEntry(trimmedEntry)\n ? normalizeStructuredLinkedTestEntry(parseCsvKv(entry, \"--test\"), \"--test\")\n : { command: trimmedEntry };\n const command = parseOptionalString(kv.command);\n const filePath = parseOptionalString(kv.path);\n if (!command) {\n throw new PmCliError(\"--test requires command=<value> or a bare command (path=<value> is optional metadata)\", EXIT_CODE.USAGE);\n }\n const timeoutSecondsRaw = parseOptionalString(kv.timeout_seconds);\n const timeoutAliasRaw = parseOptionalString(kv.timeout);\n if (timeoutSecondsRaw && timeoutAliasRaw && timeoutSecondsRaw !== timeoutAliasRaw) {\n throw new PmCliError(\"--test timeout and timeout_seconds must match when both are provided\", EXIT_CODE.USAGE);\n }\n const timeoutRaw = timeoutSecondsRaw ?? timeoutAliasRaw;\n return {\n command,\n path: filePath,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"test scope\"),\n timeout_seconds: timeoutRaw ? parseOptionalNumber(timeoutRaw, \"timeout_seconds\") : undefined,\n pm_context_mode: parseLinkedTestContextMode(kv.pm_context_mode, \"--test\"),\n env_set: parseLinkedTestEnvSet(kv.env_set, \"--test\"),\n env_clear: parseLinkedTestEnvClear(kv.env_clear, \"--test\"),\n shared_host_safe: parseLinkedTestBoolean(kv.shared_host_safe, \"--test\", \"shared_host_safe\"),\n assert_stdout_contains: parseLinkedTestStringList(kv.assert_stdout_contains),\n assert_stdout_regex: parseLinkedTestRegexList(kv.assert_stdout_regex, \"--test\", \"assert_stdout_regex\"),\n assert_stderr_contains: parseLinkedTestStringList(kv.assert_stderr_contains),\n assert_stderr_regex: parseLinkedTestRegexList(kv.assert_stderr_regex, \"--test\", \"assert_stderr_regex\"),\n assert_stdout_min_lines: parseLinkedTestMinLines(kv.assert_stdout_min_lines, \"--test\"),\n assert_json_field_equals: parseLinkedTestAssertionEqualsMap(kv.assert_json_field_equals, \"--test\"),\n assert_json_field_gte: parseLinkedTestAssertionGteMap(kv.assert_json_field_gte, \"--test\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse docs for the public runtime surface of this module.\n */\nexport function parseDocs(raw: string[] | undefined): { values: LinkedDoc[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--doc\", \"Use --clear-docs to clear linked docs.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, LINKED_ARTIFACT_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--doc\") : { path: trimmedEntry };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--doc\", LINKED_ARTIFACT_SEED_KEYS);\n }\n if (!kv.path) {\n throw new PmCliError(\"--doc requires path=<value> or a bare doc path\", EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"doc scope\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\nfunction parseReminders(raw: string[] | undefined, nowValue: string): { values: Reminder[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--reminder\", \"Use --clear-reminders to clear reminders.\");\n return {\n values: parseReminderEntries(raw, new Date(nowValue), { valueMode: \"raw\" }),\n explicitEmpty: false,\n };\n}\n\nfunction parseEvents(raw: string[] | undefined, nowValue: string): { values: CalendarEvent[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--event\", \"Use --clear-events to clear linked events.\");\n return {\n values: parseEventEntries(raw, new Date(nowValue), {\n allDayEmptyGuard: \"defined\",\n recurrenceEmptyNumericGuard: \"defined\",\n }),\n explicitEmpty: false,\n };\n}\n\nfunction buildChangedFields(\n frontMatter: ItemMetadata,\n body: string,\n explicitUnsets: string[],\n additionalFrontMatterKeys: readonly string[] = [],\n): string[] {\n const changed = [\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...additionalFrontMatterKeys.filter((key) => (frontMatter as unknown as Record<string, unknown>)[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ...explicitUnsets.map((key) => `unset:${key}`),\n ];\n return Array.from(new Set(changed));\n}\n\nfunction buildHistoryMessage(baseMessage: string | undefined, explicitUnsets: string[]): string | undefined {\n const trimmed = baseMessage ?? \"\";\n if (explicitUnsets.length === 0) {\n return trimmed;\n }\n const suffix = `explicit_unset=${explicitUnsets.join(\",\")}`;\n return trimmed ? `${trimmed} | ${suffix}` : suffix;\n}\n\nfunction normalizeCreatePolicyOptionKey(raw: string, typeName: string, sourceLabel: string): string {\n const canonical = canonicalizeCommandOptionKey(\"create\", raw);\n if (!canonical) {\n throw new PmCliError(\n `Unsupported ${sourceLabel} entry \"${raw}\" for type \"${typeName}\"`,\n EXIT_CODE.CONFLICT,\n );\n }\n return canonical;\n}\n\ninterface CreateOptionValueLookup {\n scalarValues: Record<string, unknown>;\n repeatableValues: Record<string, unknown>;\n addTags: string[] | undefined;\n}\n\nfunction buildCreateOptionValueLookup(options: CreateCommandOptions): CreateOptionValueLookup {\n return {\n scalarValues: {\n title: options.title,\n description: options.description,\n type: options.type,\n status: options.status,\n priority: options.priority,\n tags: options.tags,\n body: options.body,\n deadline: options.deadline,\n estimatedMinutes: options.estimatedMinutes,\n acceptanceCriteria: options.acceptanceCriteria,\n definitionOfReady: options.definitionOfReady,\n order: options.order ?? options.rank,\n goal: options.goal,\n objective: options.objective,\n value: options.value,\n impact: options.impact,\n outcome: options.outcome,\n whyNow: options.whyNow,\n author: options.author,\n message: options.message,\n assignee: options.assignee,\n parent: options.parent,\n reviewer: options.reviewer,\n risk: options.risk,\n confidence: options.confidence,\n sprint: options.sprint,\n release: options.release,\n blockedBy: options.blockedBy,\n blockedReason: options.blockedReason,\n unblockNote: options.unblockNote,\n reporter: options.reporter,\n severity: options.severity,\n environment: options.environment,\n reproSteps: options.reproSteps,\n resolution: options.resolution,\n expectedResult: options.expectedResult,\n actualResult: options.actualResult,\n affectedVersion: options.affectedVersion,\n fixedVersion: options.fixedVersion,\n component: options.component,\n regression: options.regression,\n customerImpact: options.customerImpact,\n },\n repeatableValues: {\n dep: options.dep,\n comment: options.comment,\n note: options.note,\n learning: options.learning,\n file: options.file,\n test: options.test,\n doc: options.doc,\n reminder: options.reminder,\n event: options.event,\n typeOption: options.typeOption,\n field: options.field,\n },\n addTags: options.addTags,\n };\n}\n\nfunction hasCreateOptionValue(lookup: CreateOptionValueLookup, optionKey: string): boolean {\n // `--add-tags` mutates the same `tags` field as `--tags`, so it must count\n // toward the `tags` command_option_policy (both the disabled guard and the\n // required check) — otherwise `--add-tags` would bypass a rule disabling\n // tags, or fail to satisfy a rule requiring them even though the created\n // item ends up tagged.\n if (optionKey === \"tags\") {\n return lookup.scalarValues.tags !== undefined || (Array.isArray(lookup.addTags) && lookup.addTags.length > 0);\n }\n if (Object.prototype.hasOwnProperty.call(lookup.scalarValues, optionKey)) {\n return lookup.scalarValues[optionKey] !== undefined;\n }\n /* c8 ignore start -- policy probes only pass canonical CREATE_COMMAND_OPTION_KEYS, all of which exist in scalarValues/repeatableValues, so the in-repeatableValues false arm and trailing return are unreachable. */\n if (Object.prototype.hasOwnProperty.call(lookup.repeatableValues, optionKey)) {\n const value = lookup.repeatableValues[optionKey];\n return Array.isArray(value) && value.length > 0;\n }\n return false;\n /* c8 ignore stop */\n}\n\nfunction buildRequiredCreateOptions(\n typeDefinition: ResolvedItemTypeDefinition,\n createMode: CreateMode,\n): Set<string> {\n const requiredOptions = new Set<string>([\"title\", \"type\"]);\n if (createMode !== \"strict\") {\n return requiredOptions;\n }\n for (const field of typeDefinition.required_create_fields) {\n requiredOptions.add(normalizeCreatePolicyOptionKey(field, typeDefinition.name, \"required_create_fields\"));\n }\n for (const field of typeDefinition.required_create_repeatables) {\n requiredOptions.add(normalizeCreatePolicyOptionKey(field, typeDefinition.name, \"required_create_repeatables\"));\n }\n return requiredOptions;\n}\n\nfunction assertNoDisabledCreateOptions(\n disabledOptions: readonly string[],\n lookup: CreateOptionValueLookup,\n clearOptionKeys: Set<string>,\n typeName: string,\n): void {\n for (const option of disabledOptions) {\n if (!hasCreateOptionValue(lookup, option) && !clearOptionKeys.has(option)) {\n continue;\n }\n throw new PmCliError(\n `Option ${commandOptionFlagLabel(\"create\", option)} is disabled for type \"${typeName}\" by command_option_policies`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction assertNoStrictRequiredOptionClears(\n requiredOptions: readonly string[],\n createMode: CreateMode,\n clearOptionKeys: Set<string>,\n): void {\n if (createMode !== \"strict\") {\n return;\n }\n const strictRequiredClears = requiredOptions.filter((required) => clearOptionKeys.has(required));\n if (strictRequiredClears.length === 0) {\n return;\n }\n /* c8 ignore next -- deterministic ordering fallback only matters when required clear list contains locale ties. */\n const requiredFlags = [...new Set(strictRequiredClears.map((required) => commandOptionFlagLabel(\"create\", required)))].sort(\n (left, right) => left.localeCompare(right),\n );\n /* c8 ignore next -- strict clear conflict envelope is covered by policy integration scenarios. */\n throw new PmCliError(\n `Strict create mode requires concrete values for ${requiredFlags.join(\", \")}; --unset/--clear-* directives cannot satisfy required options`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseTypeOptions(raw: string[] | undefined): { values: Record<string, string> | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) {\n return { values: undefined, explicitEmpty: false };\n }\n assertNoLegacyNoneTokens(raw, \"--type-option\", \"Use --clear-type-options to clear existing type options.\");\n return {\n values: parseTypeOptionEntries(raw),\n explicitEmpty: false,\n };\n}\n\nasync function resolveCreateStdinInputs(options: CreateCommandOptions): Promise<CreateCommandOptions> {\n const stdinResolver = createStdinTokenResolver();\n return {\n ...options,\n body: await stdinResolver.resolveValue(options.body, \"--body\"),\n dep: await stdinResolver.resolveList(options.dep, \"--dep\"),\n comment: await stdinResolver.resolveList(options.comment, \"--comment\"),\n note: await stdinResolver.resolveList(options.note, \"--note\"),\n learning: await stdinResolver.resolveList(options.learning, \"--learning\"),\n file: await stdinResolver.resolveList(options.file, \"--file\"),\n test: await stdinResolver.resolveList(options.test, \"--test\"),\n doc: await stdinResolver.resolveList(options.doc, \"--doc\"),\n reminder: await stdinResolver.resolveList(options.reminder, \"--reminder\"),\n event: await stdinResolver.resolveList(options.event, \"--event\"),\n typeOption: await stdinResolver.resolveList(options.typeOption, \"--type-option\"),\n field: await stdinResolver.resolveList(options.field, \"--field\"),\n };\n}\n\nfunction resolveCreateMode(createMode: string | undefined, defaultMode: CreateMode): CreateMode {\n if (createMode === undefined) {\n return defaultMode;\n }\n const normalized = createMode.trim().toLowerCase();\n if (normalized.length === 0) {\n return defaultMode;\n }\n if (normalized === \"strict\" || normalized === \"progressive\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --create-mode value \"${createMode}\". Allowed: ${CREATE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveScheduleCreatePreset(raw: string | undefined): ScheduleCreatePreset | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0) {\n throw new PmCliError(\"--schedule-preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"lightweight\" || normalized === \"lite\" || normalized === \"schedule-lite\") {\n return \"lightweight\";\n }\n throw new PmCliError(\n `Invalid --schedule-preset value \"${raw}\". Allowed: ${SCHEDULE_CREATE_PRESET_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveEffectiveCreateMode(\n createMode: string | undefined,\n schedulePreset: ScheduleCreatePreset | undefined,\n defaultMode: CreateMode,\n): CreateMode {\n const resolvedMode = resolveCreateMode(createMode, defaultMode);\n if (schedulePreset === undefined) {\n return resolvedMode;\n }\n const createModeWasExplicit = typeof createMode === \"string\" && createMode.trim().length > 0;\n if (createModeWasExplicit && resolvedMode === \"strict\") {\n throw new PmCliError(\n \"--schedule-preset lightweight cannot be combined with --create-mode strict. Use --create-mode progressive or omit --create-mode.\",\n EXIT_CODE.USAGE,\n );\n }\n return \"progressive\";\n}\n\nfunction requireCreateOptionByType(\n typeDefinition: ResolvedItemTypeDefinition,\n options: CreateCommandOptions,\n createMode: CreateMode,\n clearOptionKeys: Set<string>,\n): string[] {\n const typeName = typeDefinition.name;\n const optionLookup = buildCreateOptionValueLookup(options);\n const baseRequiredOptions = buildRequiredCreateOptions(typeDefinition, createMode);\n\n const policyState = resolveCommandOptionPolicyState(typeDefinition, \"create\", baseRequiredOptions);\n if (policyState.errors.length > 0) {\n throw new PmCliError(policyState.errors.join(\"; \"), EXIT_CODE.CONFLICT);\n }\n\n assertNoDisabledCreateOptions(policyState.disabled, optionLookup, clearOptionKeys, typeName);\n assertNoStrictRequiredOptionClears(policyState.required, createMode, clearOptionKeys);\n\n // A configured per-type default_status satisfies a required `status` policy:\n // when --status is omitted, runCreate resolves to that default (or degrades to\n // the workflow open status), so blocking the agent for a \"missing --status\"\n // would contradict the config-driven default. Scoped to status so an explicit\n // status-required policy on a type WITHOUT a default still holds. Only the\n // required check is relaxed; the disabled check above keeps using hasOptionValue.\n const satisfiesRequiredOption = (optionKey: string): boolean => {\n if (optionKey === \"status\" && typeDefinition.default_status !== undefined) {\n return true;\n }\n return hasCreateOptionValue(optionLookup, optionKey);\n };\n const missingRequiredOptions = policyState.required.filter((required) => !satisfiesRequiredOption(required));\n return [...new Set(missingRequiredOptions.map((required) => commandOptionFlagLabel(\"create\", required)))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\nconst MISSING_REQUIRED_TYPE_OPTION_PATTERN = /^Missing required type option \"([^\"]+)\" for type \"([^\"]+)\"$/;\n\nfunction collectMissingRequiredTypeOptionKeys(errors: string[], typeName: string): string[] {\n const missingKeys: string[] = [];\n for (const error of errors) {\n const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);\n if (!match) {\n continue;\n }\n if (match[2] !== typeName) {\n continue;\n }\n missingKeys.push(match[1]);\n }\n return [...new Set(missingKeys)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction filterNonMissingTypeOptionErrors(errors: string[], typeName: string): string[] {\n return errors.filter((error) => {\n const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);\n return !match || match[2] !== typeName;\n });\n}\n\nfunction assertNoInvalidTypeOptions(\n errors: string[],\n type: string,\n typeDefinition: ResolvedItemTypeDefinition,\n statusRegistry: RuntimeStatusRegistry,\n): void {\n const nonMissingTypeOptionErrors = filterNonMissingTypeOptionErrors(errors, type);\n if (nonMissingTypeOptionErrors.length === 0) {\n return;\n }\n const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, [], [], statusRegistry.open_status);\n throw new PmCliError(nonMissingTypeOptionErrors.join(\"; \"), EXIT_CODE.USAGE, {\n code: \"invalid_argument_value\",\n required: `Provide valid --type-option key/value pairs for type \"${type}\".`,\n examples: [nextValidExample],\n nextSteps: [`Run \"pm create --help --type ${type}\" to review allowed type-option keys and values.`],\n });\n}\n\nfunction typeOptionExampleValue(typeDefinition: ResolvedItemTypeDefinition, key: string): string {\n const optionDefinition = typeDefinition.options.find((option) => option.key === key);\n const firstAllowed = optionDefinition?.values[0];\n if (typeof firstAllowed === \"string\" && firstAllowed.trim().length > 0) {\n return firstAllowed;\n }\n return \"<value>\";\n}\n\nfunction createExampleTokensForFlag(flag: string, typeName: string, openStatus: string): string[] {\n switch (flag) {\n case \"--title\":\n return [\"--title\", `\"${typeName} example title\"`];\n case \"--description\":\n return [\"--description\", `\"${typeName} example description\"`];\n case \"--type\":\n return [\"--type\", typeName];\n case \"--status\":\n return [\"--status\", openStatus];\n case \"--priority\":\n return [\"--priority\", \"1\"];\n case \"--message\":\n return [\"--message\", `\"Create ${typeName} item\"`];\n case \"--dep\":\n return [\"--dep\", \"\\\"id=pm-xxxx,kind=related,author=maintainer,created_at=now\\\"\"];\n case \"--comment\":\n return [\"--comment\", \"\\\"author=maintainer,created_at=now,text=Implementation context\\\"\"];\n case \"--note\":\n return [\"--note\", \"\\\"author=maintainer,created_at=now,text=Design note\\\"\"];\n case \"--learning\":\n return [\"--learning\", \"\\\"author=maintainer,created_at=now,text=Durable lesson\\\"\"];\n case \"--file\":\n return [\"--file\", \"\\\"path=src/example.ts,note=implementation file\\\"\"];\n case \"--test\":\n return [\"--test\", \"\\\"command=node scripts/run-tests.mjs test,timeout_seconds=240\\\"\"];\n case \"--doc\":\n return [\"--doc\", \"\\\"path=README.md,note=reference doc\\\"\"];\n default:\n return [flag, \"\\\"<value>\\\"\"];\n }\n}\n\nfunction buildTypeSpecificCreateExample(\n typeDefinition: ResolvedItemTypeDefinition,\n missingCreateFlags: string[],\n missingTypeOptionKeys: string[],\n openStatus: string,\n): string {\n const tokens = [\"pm\", \"create\", \"--title\", `\"${typeDefinition.name} example title\"`, \"--description\", `\"${typeDefinition.name} example description\"`, \"--type\", typeDefinition.name];\n const optionalRecommendationFlags = [\"--status\", \"--priority\", \"--message\"];\n const orderedFlags = [...new Set([...optionalRecommendationFlags, ...missingCreateFlags])];\n const includedFlags = new Set<string>([\"--title\", \"--description\", \"--type\"]);\n for (const flag of orderedFlags) {\n if (includedFlags.has(flag)) {\n continue;\n }\n tokens.push(...createExampleTokensForFlag(flag, typeDefinition.name, openStatus));\n includedFlags.add(flag);\n }\n for (const key of missingTypeOptionKeys) {\n const value = typeOptionExampleValue(typeDefinition, key);\n tokens.push(\"--type-option\", `${key}=${value}`);\n }\n return tokens.join(\" \");\n}\n\nfunction requireStringOption(value: string | undefined, flag: string): string {\n if (value === undefined) {\n if (flag === \"--title\") {\n throw new PmCliError(\n '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.',\n EXIT_CODE.USAGE,\n );\n }\n throw new PmCliError(`Missing required option ${flag}`, EXIT_CODE.USAGE);\n }\n return value;\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = parseOptionalString(explicitAuthor) ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed || \"unknown\";\n}\n\nfunction ensurePriority(rawPriority: string | number): 0 | 1 | 2 | 3 | 4 {\n return resolvePriority(rawPriority);\n}\n\nfunction mergeCreateOptionsWithTemplate(\n templateOptions: Record<string, string | string[]>,\n explicitOptions: CreateCommandOptions,\n): CreateCommandOptions {\n const merged: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(templateOptions)) {\n merged[key] = Array.isArray(value) ? [...value] : value;\n }\n for (const [key, value] of Object.entries(explicitOptions)) {\n if (value !== undefined) {\n merged[key] = Array.isArray(value) ? [...value] : value;\n }\n }\n return merged as CreateCommandOptions;\n}\n\nfunction normalizeExtensionCommandPath(command: string): string {\n return command\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nfunction hasTemplatesShowHandler(): boolean {\n const registrations = getActiveExtensionRegistrations();\n if (!registrations) {\n return false;\n }\n return registrations.commands.some((entry) => {\n return entry.action === \"templates-show\" || normalizeExtensionCommandPath(entry.command) === \"templates show\";\n });\n}\n\nfunction readTemplateOptionsFromRuntimeResult(result: unknown, templateName: string): Record<string, string | string[]> {\n if (typeof result !== \"object\" || result === null || !(\"options\" in result)) {\n throw new PmCliError(\n `Templates package returned invalid payload for template \"${templateName}\". Expected an options object.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const options = (result as { options?: unknown }).options;\n if (typeof options !== \"object\" || options === null || Array.isArray(options)) {\n throw new PmCliError(\n `Templates package returned invalid options for template \"${templateName}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const normalized: Record<string, string | string[]> = {};\n for (const [key, value] of Object.entries(options as Record<string, unknown>)) {\n if (typeof value === \"string\") {\n normalized[key] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n normalized[key] = [...value];\n continue;\n }\n throw new PmCliError(\n `Templates package returned unsupported option value for \"${key}\" in template \"${templateName}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return normalized;\n}\n\nasync function loadCreateTemplateOptionsFromRuntime(\n templateName: string,\n global: GlobalOptions,\n pmRoot: string,\n): Promise<Record<string, string | string[]>> {\n if (!hasTemplatesShowHandler()) {\n throw new PmCliError(\n `--template requires the templates package. Install it first (for example: pm install templates --project).`,\n EXIT_CODE.USAGE,\n );\n }\n const handlerResult = await runActiveCommandHandler({\n command: \"templates show\",\n args: [templateName],\n options: {},\n global,\n pm_root: pmRoot,\n });\n if (!handlerResult.handled) {\n const warningSuffix = handlerResult.warnings.length > 0 ? ` (${handlerResult.warnings.join(\", \")})` : \"\";\n throw new PmCliError(\n `Unable to resolve template \"${templateName}\" via templates package. Run \"pm templates show ${templateName}\" for details.${warningSuffix}`,\n EXIT_CODE.USAGE,\n );\n }\n /* c8 ignore next -- template runtime success path is covered by package-level integration tests. */\n return readTemplateOptionsFromRuntimeResult(handlerResult.result, templateName);\n}\n\nfunction ensureInitHasRun(pmRoot: string): Promise<void> {\n return pathExists(getSettingsPath(pmRoot)).then((exists) => {\n /* c8 ignore next -- init guard failures are covered by top-level create command tests. */\n if (!exists) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n });\n}\n\n/**\n * Resolve an optional string front-matter field for {@link runCreate}: yields\n * `undefined` when the field is being cleared via `--unset <key>` or was never\n * supplied, otherwise the (identity-parsed) raw value. Collapses the pervasive\n * `unset ? undefined : raw === undefined ? undefined : parseOptionalString(raw)`\n * triple-ternary each optional scalar field repeated inline, keeping `runCreate`\n * under the complexity ceiling without changing any resolved value.\n */\nfunction resolveUnsettableOptionalString(\n unsetKeys: ReadonlySet<string>,\n frontMatterKey: string,\n raw: string | undefined,\n): string | undefined {\n return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : parseOptionalString(raw);\n}\n\n/**\n * Resolve an optional field that maps its raw string through `transform` once\n * present: yields `undefined` when the field is being cleared via `--unset` or\n * was never supplied, otherwise `transform(raw)`. The non-string return type is\n * inferred from `transform`, so this serves numeric, ISO-date, and enum fields\n * alike while keeping the unset/absent guard in one place.\n */\nfunction resolveUnsettableTransformed<Value>(\n unsetKeys: ReadonlySet<string>,\n frontMatterKey: string,\n raw: string | undefined,\n transform: (value: string) => Value,\n): Value | undefined {\n return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : transform(raw);\n}\n\n/** Calendar-relevant item types whose entries are invisible on `pm calendar` without a schedule. */\nconst CALENDAR_RELEVANT_CREATE_TYPES = new Set([\"milestone\", \"meeting\", \"reminder\", \"event\"]);\n\n/**\n * Whether a calendar-relevant item would be invisible on `pm calendar`: a\n * Milestone/Meeting/Reminder/Event created with no deadline AND no reminders AND\n * no events never surfaces there. Shared by the structured create warning and the\n * post-write stderr hint so both stay in lockstep.\n */\nfunction createItemLacksSchedule(\n type: string,\n deadline: string | undefined,\n reminders: readonly unknown[] | undefined,\n events: readonly unknown[] | undefined,\n): boolean {\n const hasDeadline = deadline !== undefined;\n const hasReminders = reminders !== undefined && reminders.length > 0;\n const hasEvents = events !== undefined && events.length > 0;\n return CALENDAR_RELEVANT_CREATE_TYPES.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents;\n}\n\n/**\n * Build the never-blocking schedule-visibility warnings for a new item: an\n * `event_without_schedule` token for Event-type items with no attached events,\n * and a `calendar_item_without_schedule` token (with an actionable hint) for any\n * calendar-relevant type that would be invisible on `pm calendar`. The structured\n * prefixes are stable for automation/telemetry (pm-2cgu / GH-174).\n */\nfunction collectCreateScheduleWarnings(\n type: string,\n id: string,\n deadline: string | undefined,\n reminders: readonly unknown[] | undefined,\n events: readonly unknown[] | undefined,\n): string[] {\n const warnings: string[] = [];\n if (type.toLowerCase() === \"event\" && (events === undefined || events.length === 0)) {\n warnings.push(`event_without_schedule:${id}:no_time_set`);\n }\n if (createItemLacksSchedule(type, deadline, reminders, events)) {\n warnings.push(\n `calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event (hint: set --deadline <ISO> or --reminder \"<when>\", or link an Event via --event \"start=<ISO>,end=<ISO>\"; otherwise this item never appears on pm calendar)`,\n );\n }\n return warnings;\n}\n\n/**\n * Resolve the effective parent for a new item, inheriting the session-focused\n * item (set via `pm focus <id>`) only when no explicit `--parent` was supplied\n * and parent is not being unset (GH-161 / pm-72xf). An explicit `--parent`\n * (including `--parent \"\"`) always overrides focus; the inherited value flows\n * through the same locate/validate path as an explicit parent.\n */\nasync function inheritFocusedParent(\n parent: string | undefined,\n resolvedOptions: CreateCommandOptions,\n unsetKeys: ReadonlySet<string>,\n pmRoot: string,\n): Promise<{ parent: string | undefined; parentSource: \"focus\" | undefined }> {\n if (parent !== undefined || unsetKeys.has(\"parent\") || resolvedOptions.parent !== undefined) {\n return { parent, parentSource: undefined };\n }\n const focused = await getFocusedItem(pmRoot);\n if (focused === undefined) {\n return { parent, parentSource: undefined };\n }\n return { parent: focused, parentSource: \"focus\" };\n}\n\n/**\n * Normalize and locate a new item's parent reference, returning the normalized\n * value plus any never-blocking missing-parent warnings the configured\n * `parent_reference` policy produces when the target does not resolve.\n */\nasync function validateCreateParentReference(\n pmRoot: string,\n settings: PmSettings,\n typeRegistry: ItemTypeRegistry,\n itemId: string,\n parent: string,\n policy: Parameters<typeof validateMissingParentReference>[1],\n): Promise<{ parent: string; warnings: string[] }> {\n const normalized = normalizeParentReferenceValue(parent);\n assertParentReferenceIsNotSelf(itemId, normalized, settings.id_prefix);\n const parentLocated = await locateItem(pmRoot, normalized, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (parentLocated) {\n return { parent: normalized, warnings: [] };\n }\n const normalizedParentId = normalizeItemId(normalized, settings.id_prefix);\n return { parent: normalized, warnings: validateMissingParentReference(normalizedParentId, policy).warnings };\n}\n\nasync function resolveCreateParentWithWarnings(params: {\n itemId: string;\n parent: string | undefined;\n pmRoot: string;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n policy: Parameters<typeof validateMissingParentReference>[1];\n}): Promise<{ parent: string | undefined; warnings: string[] }> {\n if (params.parent === undefined) {\n return { parent: undefined, warnings: [] };\n }\n const parentValidation = await validateCreateParentReference(\n params.pmRoot,\n params.settings,\n params.typeRegistry,\n params.itemId,\n params.parent,\n params.policy,\n );\n return parentValidation;\n}\n\nasync function resolveCreateItemId(params: {\n pmRoot: string;\n settings: PmSettings;\n explicitId: unknown;\n}): Promise<string> {\n if (params.explicitId === undefined) {\n return generateItemId(params.pmRoot, params.settings.id_prefix);\n }\n if (typeof params.explicitId !== \"string\") {\n throw new PmCliError(\"--id must be a string\", EXIT_CODE.USAGE);\n }\n const trimmedId = params.explicitId.trim();\n if (trimmedId.length === 0 || isPlaceholderReferenceToken(trimmedId)) {\n throw new PmCliError(\"--id must not be empty or use a placeholder token\", EXIT_CODE.USAGE);\n }\n const normalizedId = normalizeItemId(trimmedId, params.settings.id_prefix);\n if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(normalizedId)) {\n throw new PmCliError(\"--id must contain only letters, numbers, and dashes after normalization\", EXIT_CODE.USAGE);\n }\n return normalizedId;\n}\n\n/**\n * Resolve a sprint or release field: `undefined` when cleared/absent, otherwise\n * the format-validated value plus any never-blocking format warnings from the\n * configured `sprint_release_format` policy.\n */\nfunction resolveCreateSprintOrRelease(\n unsetKeys: ReadonlySet<string>,\n frontMatterKey: string,\n raw: string | undefined,\n field: Parameters<typeof validateSprintOrReleaseValue>[0],\n policy: Parameters<typeof validateSprintOrReleaseValue>[2],\n): { value: string | undefined; warnings: string[] } {\n const resolved = resolveUnsettableOptionalString(unsetKeys, frontMatterKey, raw);\n if (resolved === undefined) {\n return { value: undefined, warnings: [] };\n }\n const validation = validateSprintOrReleaseValue(field, resolved, policy);\n return { value: validation.value, warnings: validation.warnings };\n}\n\n/**\n * Apply the `--blocked-by` convenience: when the target locates, add a\n * `blocked_by` dependency (if not already present) and, unless `--status` was\n * given explicitly, move the new item into the blocked status. Returns the\n * (possibly augmented) dependency list and the (possibly rerouted) status; a\n * `blockedBy` that is absent or does not locate leaves both unchanged.\n */\nasync function resolveCreateBlockedByDependency(params: {\n pmRoot: string;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n statusRegistry: RuntimeStatusRegistry;\n blockedBy: string | undefined;\n dependencyValues: Dependency[] | undefined;\n status: ItemStatus;\n statusExplicit: boolean;\n nowValue: string;\n author: string;\n}): Promise<{ dependencyValues: Dependency[] | undefined; status: ItemStatus }> {\n const { pmRoot, settings, typeRegistry, statusRegistry, blockedBy, status, statusExplicit, nowValue, author } = params;\n let dependencyValues = params.dependencyValues;\n if (blockedBy === undefined) {\n return { dependencyValues, status };\n }\n const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);\n const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!blockedByLocated) {\n return { dependencyValues, status };\n }\n const hasBlockedByDependency = (dependencyValues ?? []).some(\n (dependency) => dependency.id === blockedByLocated.id && dependency.kind === \"blocked_by\",\n );\n if (!hasBlockedByDependency) {\n dependencyValues = [\n ...(dependencyValues ?? []),\n { id: blockedByLocated.id, kind: \"blocked_by\", created_at: nowValue, author },\n ];\n }\n if (statusExplicit) {\n return { dependencyValues, status };\n }\n const blockedStatus = statusRegistry.blocked_statuses.has(\"blocked\")\n ? \"blocked\"\n : [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;\n return { dependencyValues, status: blockedStatus };\n}\n\n/**\n * Apply the governance default-type fallback when `pm create` was invoked with no\n * `--type`: honor `governance.create_default_type` when it resolves in the active\n * registry, else fall back to the built-in `Task`. Suppressed under explicit\n * `--create-mode strict`, where the strict required-option contract must surface\n * the missing_required_option envelope instead. Mutates `resolvedOptions.type`.\n */\nfunction applyCreateDefaultType(\n resolvedOptions: CreateCommandOptions,\n settings: PmSettings,\n typeRegistry: ItemTypeRegistry,\n): void {\n // Default-type fallback is suppressed under explicit --create-mode strict, where the strict\n // required-option contract takes precedence and surfaces the missing_required_option envelope.\n /* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */\n const explicitStrictMode =\n typeof resolvedOptions.createMode === \"string\" && resolvedOptions.createMode.trim().toLowerCase() === \"strict\";\n if (explicitStrictMode) {\n return;\n }\n /* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */\n const defaultType = settings.governance.create_default_type?.trim();\n if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {\n resolvedOptions.type = defaultType;\n return;\n }\n /* c8 ignore start -- \"Task\" is a built-in type present in every default registry; reaching this arm requires a custom schema that removed Task with no create_default_type configured. */\n if (resolveTypeName(\"Task\", typeRegistry)) {\n resolvedOptions.type = \"Task\";\n }\n /* c8 ignore stop */\n}\n\n/**\n * Resolve the target item type and creation mode for `pm create`: merge any\n * `--template` options, apply the governance default-type fallback, map a\n * near-miss `--type` to its canonical synonym (never blocking), and derive the\n * schedule preset and effective create mode. Returns the (possibly\n * template-merged) options alongside the resolved type definition, canonical\n * type name, schedule preset, and create mode.\n */\nasync function resolveCreateTypeSelection(\n options: CreateCommandOptions,\n global: GlobalOptions,\n pmRoot: string,\n settings: PmSettings,\n typeRegistry: ItemTypeRegistry,\n): Promise<{\n resolvedOptions: CreateCommandOptions;\n typeDefinition: ResolvedItemTypeDefinition;\n type: string;\n schedulePreset: ReturnType<typeof resolveScheduleCreatePreset>;\n createMode: ReturnType<typeof resolveEffectiveCreateMode>;\n}> {\n let resolvedOptions = options;\n if (resolvedOptions.template !== undefined) {\n const templateName = resolvedOptions.template.trim();\n if (templateName.length === 0) {\n throw new PmCliError(\"--template must not be empty. Omit --template to disable template usage.\", EXIT_CODE.USAGE);\n }\n /* c8 ignore next -- template merge path is exercised in templates package integration tests. */\n const templateOptions = await loadCreateTemplateOptionsFromRuntime(templateName, global, pmRoot);\n resolvedOptions = normalizeLegacyNoneCreateOptions(mergeCreateOptionsWithTemplate(templateOptions, resolvedOptions));\n }\n if (resolvedOptions.type === undefined) {\n applyCreateDefaultType(resolvedOptions, settings, typeRegistry);\n }\n /* c8 ignore start -- missing/invalid type fallback guards are exercised by create command integration suites. */\n if (resolvedOptions.type === undefined) {\n throw new PmCliError(\"Missing required option --type <value>\", EXIT_CODE.USAGE);\n }\n let resolvedTypeName = resolveTypeName(resolvedOptions.type, typeRegistry);\n if (!resolvedTypeName) {\n // Never block on a near-miss type: map a known synonym (e.g. Bug -> Issue,\n // Change -> Chore) to its canonical built-in type when that type exists in the\n // active registry, and tell the agent how to make it a distinct custom type.\n const synonymCanonical = resolveTypeSynonym(resolvedOptions.type);\n const synonymResolved = synonymCanonical ? resolveTypeName(synonymCanonical, typeRegistry) : undefined;\n if (synonymResolved) {\n printError(\n `[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.`,\n );\n resolvedOptions.type = synonymResolved;\n resolvedTypeName = synonymResolved;\n } else {\n throw new PmCliError(\n buildInvalidTypeError(resolvedOptions.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n }\n /* c8 ignore stop */\n const typeDefinition = resolveTypeDefinition(resolvedTypeName, typeRegistry);\n /* c8 ignore start -- resolvedTypeName came from resolveTypeName succeeding, so resolveTypeDefinition always returns a definition here. */\n if (!typeDefinition) {\n throw new PmCliError(`Invalid type value \"${resolvedOptions.type}\"`, EXIT_CODE.USAGE);\n }\n /* c8 ignore stop */\n const type = typeDefinition.name;\n const schedulePreset = resolveScheduleCreatePreset(resolvedOptions.schedulePreset);\n /* c8 ignore next -- schedule preset/type compatibility conflicts are validated in scheduler integration tests. */\n if (schedulePreset !== undefined && !SCHEDULE_CREATE_PRESET_TYPES.has(type)) {\n throw new PmCliError(\n `--schedule-preset ${schedulePreset} is only supported for Reminder, Meeting, or Event types`,\n EXIT_CODE.USAGE,\n );\n }\n const createMode = resolveEffectiveCreateMode(resolvedOptions.createMode, schedulePreset, settings.governance.create_mode_default);\n return { resolvedOptions, typeDefinition, type, schedulePreset, createMode };\n}\n\n/**\n * Seed the explicit-unset and clear-option key sets from the parsed `--unset`\n * targets, then fold in each enabled `--clear-<collection>` flag: it marks the\n * collection's front-matter key as explicitly unset and its option key as\n * cleared, and rejects combining a clear flag with its own value flag. Returns\n * the augmented sets used downstream for required-flag relaxation and history\n * messaging.\n */\nfunction collectCreateClearTargets(\n resolvedOptions: CreateCommandOptions,\n unsetTargets: { frontMatterKeys: Set<string>; optionKeys: Set<string> },\n): { explicitUnsets: Set<string>; clearOptionKeys: Set<string> } {\n const explicitUnsets = new Set<string>(unsetTargets.frontMatterKeys);\n const clearOptionKeys = new Set<string>(unsetTargets.optionKeys);\n const clearCollectionDefinitions: ReadonlyArray<{\n enabled: boolean | undefined;\n optionKey: string;\n clearFlag: string;\n valueFlag: string;\n values: string[] | undefined;\n frontMatterKey: string;\n }> = [\n { enabled: resolvedOptions.clearDeps, optionKey: \"dep\", clearFlag: \"--clear-deps\", valueFlag: \"--dep\", values: resolvedOptions.dep, frontMatterKey: \"dependencies\" },\n { enabled: resolvedOptions.clearComments, optionKey: \"comment\", clearFlag: \"--clear-comments\", valueFlag: \"--comment\", values: resolvedOptions.comment, frontMatterKey: \"comments\" },\n { enabled: resolvedOptions.clearNotes, optionKey: \"note\", clearFlag: \"--clear-notes\", valueFlag: \"--note\", values: resolvedOptions.note, frontMatterKey: \"notes\" },\n { enabled: resolvedOptions.clearLearnings, optionKey: \"learning\", clearFlag: \"--clear-learnings\", valueFlag: \"--learning\", values: resolvedOptions.learning, frontMatterKey: \"learnings\" },\n { enabled: resolvedOptions.clearFiles, optionKey: \"file\", clearFlag: \"--clear-files\", valueFlag: \"--file\", values: resolvedOptions.file, frontMatterKey: \"files\" },\n { enabled: resolvedOptions.clearTests, optionKey: \"test\", clearFlag: \"--clear-tests\", valueFlag: \"--test\", values: resolvedOptions.test, frontMatterKey: \"tests\" },\n { enabled: resolvedOptions.clearDocs, optionKey: \"doc\", clearFlag: \"--clear-docs\", valueFlag: \"--doc\", values: resolvedOptions.doc, frontMatterKey: \"docs\" },\n { enabled: resolvedOptions.clearReminders, optionKey: \"reminder\", clearFlag: \"--clear-reminders\", valueFlag: \"--reminder\", values: resolvedOptions.reminder, frontMatterKey: \"reminders\" },\n { enabled: resolvedOptions.clearEvents, optionKey: \"event\", clearFlag: \"--clear-events\", valueFlag: \"--event\", values: resolvedOptions.event, frontMatterKey: \"events\" },\n { enabled: resolvedOptions.clearTypeOptions, optionKey: \"typeOption\", clearFlag: \"--clear-type-options\", valueFlag: \"--type-option\", values: resolvedOptions.typeOption, frontMatterKey: \"type_options\" },\n ];\n for (const definition of clearCollectionDefinitions) {\n if (!definition.enabled) {\n continue;\n }\n /* c8 ignore next -- clear+value conflict paths are covered by command-surface parser tests. */\n if (definition.values && definition.values.length > 0) {\n throw new PmCliError(`Cannot combine ${definition.clearFlag} with ${definition.valueFlag}`, EXIT_CODE.USAGE);\n }\n explicitUnsets.add(definition.frontMatterKey);\n clearOptionKeys.add(definition.optionKey);\n }\n return { explicitUnsets, clearOptionKeys };\n}\n\n/**\n * Reject combining `--unset <field>` with the same field's scalar value flag\n * (for example `--unset goal --goal ...`) — the single-value analog of the\n * collection clear/value conflict enforced by {@link collectCreateClearTargets}.\n */\nfunction assertNoCreateScalarUnsetConflicts(\n resolvedOptions: CreateCommandOptions,\n unsetTargets: { optionKeys: Set<string> },\n): void {\n const scalarOptionPresence: Record<string, boolean> = {\n tags: resolvedOptions.tags !== undefined,\n deadline: resolvedOptions.deadline !== undefined,\n estimatedMinutes: resolvedOptions.estimatedMinutes !== undefined,\n acceptanceCriteria: resolvedOptions.acceptanceCriteria !== undefined,\n /* c8 ignore next -- definitionOfReady option presence is covered by legacy migration tests. */\n definitionOfReady: resolvedOptions.definitionOfReady !== undefined,\n order: resolvedOptions.order !== undefined || resolvedOptions.rank !== undefined,\n goal: resolvedOptions.goal !== undefined,\n objective: resolvedOptions.objective !== undefined,\n value: resolvedOptions.value !== undefined,\n impact: resolvedOptions.impact !== undefined,\n outcome: resolvedOptions.outcome !== undefined,\n whyNow: resolvedOptions.whyNow !== undefined,\n author: resolvedOptions.author !== undefined,\n assignee: resolvedOptions.assignee !== undefined,\n parent: resolvedOptions.parent !== undefined,\n reviewer: resolvedOptions.reviewer !== undefined,\n risk: resolvedOptions.risk !== undefined,\n confidence: resolvedOptions.confidence !== undefined,\n sprint: resolvedOptions.sprint !== undefined,\n release: resolvedOptions.release !== undefined,\n blockedBy: resolvedOptions.blockedBy !== undefined,\n blockedReason: resolvedOptions.blockedReason !== undefined,\n unblockNote: resolvedOptions.unblockNote !== undefined,\n reporter: resolvedOptions.reporter !== undefined,\n severity: resolvedOptions.severity !== undefined,\n environment: resolvedOptions.environment !== undefined,\n reproSteps: resolvedOptions.reproSteps !== undefined,\n resolution: resolvedOptions.resolution !== undefined,\n expectedResult: resolvedOptions.expectedResult !== undefined,\n actualResult: resolvedOptions.actualResult !== undefined,\n affectedVersion: resolvedOptions.affectedVersion !== undefined,\n fixedVersion: resolvedOptions.fixedVersion !== undefined,\n component: resolvedOptions.component !== undefined,\n regression: resolvedOptions.regression !== undefined,\n customerImpact: resolvedOptions.customerImpact !== undefined,\n };\n /* c8 ignore next -- scalar unset conflict checks are covered by update/create argument contract tests. */\n for (const [optionKey, hasValue] of Object.entries(scalarOptionPresence)) {\n if (!hasValue || !unsetTargets.optionKeys.has(optionKey)) {\n continue;\n }\n /* c8 ignore start -- every scalarOptionPresence key is in CREATE_OPTION_KEY_TO_UNSET_CANONICAL, so the `?? optionKey` fallback is unreachable. */\n const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey;\n /* c8 ignore stop */\n throw new PmCliError(\n `Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel(\"create\", optionKey)}`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/**\n * Reject the legacy literal `none`/`null` sentinel on any create scalar option,\n * pointing the author at the modern `--unset <field>` clear syntax (surfacing the\n * canonical unset key in the hint when the option maps to one).\n */\nfunction assertNoLegacyCreateScalarTokens(resolvedOptions: CreateCommandOptions): void {\n const assertNoLegacyScalarToken = (value: string | undefined, optionKey: string): void => {\n const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);\n const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : undefined;\n assertNoLegacyNoneToken(value, commandOptionFlagLabel(\"create\", optionKey), hint);\n };\n assertNoLegacyScalarToken(resolvedOptions.tags, \"tags\");\n assertNoLegacyScalarToken(resolvedOptions.deadline, \"deadline\");\n assertNoLegacyScalarToken(resolvedOptions.estimatedMinutes, \"estimatedMinutes\");\n assertNoLegacyScalarToken(resolvedOptions.acceptanceCriteria, \"acceptanceCriteria\");\n /* c8 ignore next -- legacy none-token guard for definitionOfReady is covered in compatibility test suites. */\n assertNoLegacyScalarToken(resolvedOptions.definitionOfReady, \"definitionOfReady\");\n assertNoLegacyScalarToken(resolvedOptions.order ?? resolvedOptions.rank, \"order\");\n assertNoLegacyScalarToken(resolvedOptions.goal, \"goal\");\n assertNoLegacyScalarToken(resolvedOptions.objective, \"objective\");\n assertNoLegacyScalarToken(resolvedOptions.value, \"value\");\n assertNoLegacyScalarToken(resolvedOptions.impact, \"impact\");\n assertNoLegacyScalarToken(resolvedOptions.outcome, \"outcome\");\n assertNoLegacyScalarToken(resolvedOptions.whyNow, \"whyNow\");\n assertNoLegacyScalarToken(resolvedOptions.author, \"author\");\n assertNoLegacyScalarToken(resolvedOptions.assignee, \"assignee\");\n assertNoLegacyScalarToken(resolvedOptions.parent, \"parent\");\n assertNoLegacyScalarToken(resolvedOptions.reviewer, \"reviewer\");\n assertNoLegacyScalarToken(resolvedOptions.risk, \"risk\");\n assertNoLegacyScalarToken(resolvedOptions.confidence, \"confidence\");\n assertNoLegacyScalarToken(resolvedOptions.sprint, \"sprint\");\n assertNoLegacyScalarToken(resolvedOptions.release, \"release\");\n assertNoLegacyScalarToken(resolvedOptions.blockedBy, \"blockedBy\");\n assertNoLegacyScalarToken(resolvedOptions.blockedReason, \"blockedReason\");\n assertNoLegacyScalarToken(resolvedOptions.unblockNote, \"unblockNote\");\n assertNoLegacyScalarToken(resolvedOptions.reporter, \"reporter\");\n assertNoLegacyScalarToken(resolvedOptions.severity, \"severity\");\n assertNoLegacyScalarToken(resolvedOptions.environment, \"environment\");\n assertNoLegacyScalarToken(resolvedOptions.reproSteps, \"reproSteps\");\n assertNoLegacyScalarToken(resolvedOptions.resolution, \"resolution\");\n assertNoLegacyScalarToken(resolvedOptions.expectedResult, \"expectedResult\");\n assertNoLegacyScalarToken(resolvedOptions.actualResult, \"actualResult\");\n assertNoLegacyScalarToken(resolvedOptions.affectedVersion, \"affectedVersion\");\n assertNoLegacyScalarToken(resolvedOptions.fixedVersion, \"fixedVersion\");\n assertNoLegacyScalarToken(resolvedOptions.component, \"component\");\n assertNoLegacyScalarToken(resolvedOptions.regression, \"regression\");\n assertNoLegacyScalarToken(resolvedOptions.customerImpact, \"customerImpact\");\n}\n\n/**\n * Reject combining `--unset <field>` with an extension-registered or\n * runtime-schema field's value flag. These custom fields are validated\n * separately from the built-in scalar options but honor the same clear/value\n * mutual exclusion.\n */\nfunction assertNoCreateFieldUnsetConflicts(\n registeredItemFieldValues: Record<string, unknown>,\n runtimeCreateFieldValues: { values?: Record<string, unknown> },\n unsetTargets: { frontMatterKeys: Set<string> },\n): void {\n for (const fieldKey of Object.keys(registeredItemFieldValues)) {\n if (!unsetTargets.frontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);\n }\n /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */\n for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {\n /* c8 ignore stop */\n if (!unsetTargets.frontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with its value flag`, EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Throw the aggregated `missing_required_option` error when a type's required\n * create options and/or required type-option keys were not all supplied in one\n * invocation. Builds a type-aware valid example and staged-onboarding next steps\n * (a strict-mode invocation also carries a compact recovery envelope). A no-op\n * when nothing is missing.\n */\nfunction assertNoMissingRequiredCreateOptions(params: {\n combinedMissingFlags: string[];\n typeDefinition: ResolvedItemTypeDefinition;\n missingRequiredCreateFlags: string[];\n missingRequiredTypeOptionKeys: string[];\n openStatus: string;\n type: string;\n createMode: ReturnType<typeof resolveEffectiveCreateMode>;\n}): void {\n const { combinedMissingFlags, typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus, type, createMode } = params;\n if (combinedMissingFlags.length === 0) {\n return;\n }\n const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus);\n const nextSteps = [`Run \"pm create --help --type ${type}\" for type-aware required option guidance.`];\n if (combinedMissingFlags.includes(\"--title\")) {\n nextSteps.push('Title can also be passed as the first positional argument (example: pm create \"Your title\" --type ' + type + \").\");\n }\n if (createMode === \"strict\") {\n nextSteps.push('For staged onboarding, retry with \"--create-mode progressive\".');\n if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {\n nextSteps.push('For minimal scheduling inputs, try \"--schedule-preset lightweight\".');\n }\n }\n const errorMessage =\n combinedMissingFlags.length === 1\n ? `Missing required option ${combinedMissingFlags[0]} for type \"${type}\"`\n : `Missing required options ${combinedMissingFlags.join(\", \")} for type \"${type}\"`;\n throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {\n code: \"missing_required_option\",\n required: `Provide all required create options and type options for type \"${type}\" in one invocation.`,\n examples: [nextValidExample],\n nextSteps,\n recovery:\n createMode === \"strict\"\n ? {\n recovery_mode: \"compact\",\n missing_required_fields: combinedMissingFlags,\n suggested_flags: [\"--create-mode progressive\", ...combinedMissingFlags],\n }\n : undefined,\n });\n}\n\n/**\n * Resolve the new item's tags: an empty list when `--unset tags` clears the\n * field (rejecting a contradictory `--add-tags`), otherwise the parsed `--tags`\n * merged with any additive `--add-tags`.\n */\nfunction resolveCreateTags(unsetKeys: ReadonlySet<string>, resolvedOptions: CreateCommandOptions): string[] {\n if (unsetKeys.has(\"tags\") && Array.isArray(resolvedOptions.addTags) && resolvedOptions.addTags.length > 0) {\n throw new PmCliError(\"Cannot combine --unset tags with --add-tags\", EXIT_CODE.USAGE);\n }\n const baseTags = unsetKeys.has(\"tags\") ? [] : resolvedOptions.tags !== undefined ? parseTags(resolvedOptions.tags) : [];\n return mergeAdditiveTags(baseTags, resolvedOptions.addTags);\n}\n\n/**\n * Resolve the new item's integer `order`: `undefined` when cleared/absent, else\n * the parsed value. Rejects mismatched `--order`/`--rank` and non-integer values.\n */\nfunction resolveCreateOrder(unsetKeys: ReadonlySet<string>, resolvedOptions: CreateCommandOptions): number | undefined {\n if (resolvedOptions.order !== undefined && resolvedOptions.rank !== undefined && resolvedOptions.order !== resolvedOptions.rank) {\n throw new PmCliError(\"--order and --rank must match when both are provided\", EXIT_CODE.USAGE);\n }\n const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;\n const order = resolveUnsettableTransformed(unsetKeys, \"order\", orderRaw, (raw) => parseOptionalNumber(raw, \"order\"));\n if (order !== undefined && !Number.isInteger(order)) {\n throw new PmCliError(\"Order must be an integer\", EXIT_CODE.USAGE);\n }\n return order;\n}\n\n/**\n * Resolve the close reason for an item created directly in the close status\n * (GH-249): honor `governance.require_close_reason` like `pm close`, deriving it\n * from `--message` > `--resolution` and falling back to a stable placeholder,\n * warning `close_reason_defaulted` when neither was supplied. Returns `undefined`\n * (and no warnings) when the item is not being created closed or the policy is\n * off.\n */\nfunction resolveCreateCloseReason(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n settings: PmSettings,\n resolvedOptions: CreateCommandOptions,\n resolution: string | undefined,\n): { closeReason: string | undefined; warnings: string[] } {\n if (status !== statusRegistry.close_status || !settings.governance.require_close_reason) {\n return { closeReason: undefined, warnings: [] };\n }\n const messageText = typeof resolvedOptions.message === \"string\" ? resolvedOptions.message.trim() : \"\";\n const resolutionText = typeof resolution === \"string\" ? resolution.trim() : \"\";\n const closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;\n const warnings = messageText.length === 0 && resolutionText.length === 0 ? [\"close_reason_defaulted\"] : [];\n return { closeReason, warnings };\n}\n\n/**\n * Commit a freshly built item under its per-id lock: write the serialized\n * document, append the create history entry (rolling back the item file if the\n * history append throws), run the item + history `onWrite` hooks, and record the\n * after-command affected item. Returns the collected hook warnings; the lock is\n * always released.\n */\nasync function writeCreatedItem(params: {\n pmRoot: string;\n type: string;\n id: string;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n author: string;\n extensionFieldNames: ReturnType<typeof collectRegisteredItemFieldNames>;\n afterDocument: ItemDocument;\n beforeDocument: ItemDocument;\n historyMessage: string | undefined;\n changedFields: ReturnType<typeof buildChangedFields>;\n nowValue: string;\n}): Promise<string[]> {\n const { pmRoot, type, id, settings, typeRegistry, author, extensionFieldNames, afterDocument, beforeDocument, historyMessage, changedFields, nowValue } = params;\n const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, id);\n const lockRelease = await acquireLock(\n pmRoot,\n id,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n );\n let hookWarnings: string[] = [];\n try {\n const existing = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (existing) {\n throw new PmCliError(`Item \"${id}\" already exists`, EXIT_CODE.CONFLICT);\n }\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(afterDocument, { format: settings.item_format, schema: settings.schema, extensionFieldNames }),\n );\n try {\n const entry = createHistoryEntry({ nowIso: nowValue, author, op: \"create\", before: beforeDocument, after: afterDocument, message: historyMessage });\n await appendHistoryEntry(historyPath, entry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: afterDocument.metadata.id,\n item_type: afterDocument.metadata.type,\n before: beforeDocument,\n after: afterDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: afterDocument.metadata.id,\n item_type: afterDocument.metadata.type,\n before: beforeDocument,\n after: afterDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: afterDocument.metadata.id,\n op: \"create\",\n item_type: afterDocument.metadata.type,\n status: afterDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n return hookWarnings;\n}\n\n/**\n * Implements run create for the public runtime surface of this module.\n */\nexport async function runCreate(options: CreateCommandOptions, global: GlobalOptions): Promise<CreateResult> {\n let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitHasRun(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const typeSelection = await resolveCreateTypeSelection(resolvedOptions, global, pmRoot, settings, typeRegistry);\n resolvedOptions = typeSelection.resolvedOptions;\n const { typeDefinition, type, createMode } = typeSelection;\n const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);\n const { explicitUnsets, clearOptionKeys } = collectCreateClearTargets(resolvedOptions, unsetTargets);\n assertNoCreateScalarUnsetConflicts(resolvedOptions, unsetTargets);\n assertNoLegacyCreateScalarTokens(resolvedOptions);\n\n const missingRequiredCreateFlags = requireCreateOptionByType(typeDefinition, resolvedOptions, createMode, clearOptionKeys);\n const nowValue = nowIso();\n const author = selectAuthor(resolvedOptions.author, settings.author_default);\n\n const dependencies = parseDependencies(resolvedOptions.dep, nowValue, settings.id_prefix);\n const comments = parseLogSeed(\"--comment\", resolvedOptions.comment, nowValue, author);\n const notes = parseLogSeed(\"--note\", resolvedOptions.note, nowValue, author);\n const learnings = parseLogSeed(\"--learning\", resolvedOptions.learning, nowValue, author);\n const files = parseFiles(resolvedOptions.file);\n const tests = parseTests(resolvedOptions.test);\n const docs = parseDocs(resolvedOptions.doc);\n const reminders = parseReminders(resolvedOptions.reminder, nowValue);\n const events = parseEvents(resolvedOptions.event, nowValue);\n const typeOptions = parseTypeOptions(resolvedOptions.typeOption);\n const validatedTypeOptions = validateTypeOptions(type, typeOptions.values, typeRegistry);\n const extensionRegistrations = getActiveExtensionRegistrations();\n const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);\n const registeredItemFieldValues = parseRegisteredItemFieldAssignments(resolvedOptions.field, extensionRegistrations);\n const runtimeCreateFieldValues = collectRuntimeCreateFieldValues(\n resolvedOptions as Record<string, unknown>,\n runtimeFieldRegistry,\n type,\n );\n assertNoCreateFieldUnsetConflicts(registeredItemFieldValues, runtimeCreateFieldValues, unsetTargets);\n const missingRequiredTypeOptionKeys = collectMissingRequiredTypeOptionKeys(validatedTypeOptions.errors, type);\n const missingRequiredTypeOptionFlags = missingRequiredTypeOptionKeys.map((key) => `--type-option ${key}=<value>`);\n const combinedMissingFlags = [\n ...new Set([\n ...missingRequiredCreateFlags,\n ...missingRequiredTypeOptionFlags,\n /* c8 ignore next -- runtime-required flag aggregation is covered in runtime schema create tests. */\n ...runtimeCreateFieldValues.missing_required_flags,\n ]),\n ].sort((left, right) => left.localeCompare(right));\n assertNoMissingRequiredCreateOptions({\n combinedMissingFlags,\n typeDefinition,\n missingRequiredCreateFlags,\n missingRequiredTypeOptionKeys,\n openStatus: statusRegistry.open_status,\n type,\n createMode,\n });\n assertNoInvalidTypeOptions(validatedTypeOptions.errors, type, typeDefinition, statusRegistry);\n\n const id = await resolveCreateItemId({\n pmRoot,\n settings,\n explicitId: resolvedOptions.id,\n });\n let status =\n resolvedOptions.status !== undefined\n ? parseStatusValue(resolvedOptions.status, statusRegistry)\n : resolveCreateDefaultStatus(typeDefinition, statusRegistry);\n const priority = resolvedOptions.priority !== undefined ? ensurePriority(resolvedOptions.priority) : 2;\n const unsetKeys = unsetTargets.frontMatterKeys;\n const tags = resolveCreateTags(unsetKeys, resolvedOptions);\n const deadline = resolveUnsettableTransformed(unsetKeys, \"deadline\", resolvedOptions.deadline, (raw) =>\n resolveIsoOrRelative(raw, new Date(nowValue), \"deadline\"),\n );\n const estimatedMinutes = resolveUnsettableTransformed(unsetKeys, \"estimated_minutes\", resolvedOptions.estimatedMinutes, (raw) =>\n parseOptionalNumber(raw, \"estimated-minutes\"),\n );\n const acceptanceCriteria = resolveUnsettableOptionalString(unsetKeys, \"acceptance_criteria\", resolvedOptions.acceptanceCriteria);\n const definitionOfReady = resolveUnsettableOptionalString(unsetKeys, \"definition_of_ready\", resolvedOptions.definitionOfReady);\n const order = resolveCreateOrder(unsetKeys, resolvedOptions);\n const goal = resolveUnsettableOptionalString(unsetKeys, \"goal\", resolvedOptions.goal);\n const objective = resolveUnsettableOptionalString(unsetKeys, \"objective\", resolvedOptions.objective);\n const value = resolveUnsettableOptionalString(unsetKeys, \"value\", resolvedOptions.value);\n const impact = resolveUnsettableOptionalString(unsetKeys, \"impact\", resolvedOptions.impact);\n const outcome = resolveUnsettableOptionalString(unsetKeys, \"outcome\", resolvedOptions.outcome);\n const whyNow = resolveUnsettableOptionalString(unsetKeys, \"why_now\", resolvedOptions.whyNow);\n const assignee = resolveUnsettableOptionalString(unsetKeys, \"assignee\", resolvedOptions.assignee);\n const authorValue = unsetKeys.has(\"author\") ? undefined : parseOptionalString(resolvedOptions.author) ?? author;\n // GH-161 (pm-72xf): inherit the session-focused parent when no explicit\n // --parent was supplied and parent is not being unset; an explicit --parent\n // (including `--parent \"\"`) overrides focus. The inherited value flows through\n // the same locate/validate path below as an explicit parent.\n const initialParent = resolveUnsettableOptionalString(unsetKeys, \"parent\", resolvedOptions.parent);\n const inheritedParent = await inheritFocusedParent(initialParent, resolvedOptions, unsetKeys, pmRoot);\n let parent = inheritedParent.parent;\n const parentSource = inheritedParent.parentSource;\n const reviewer = resolveUnsettableOptionalString(unsetKeys, \"reviewer\", resolvedOptions.reviewer);\n const risk = resolveUnsettableTransformed(unsetKeys, \"risk\", resolvedOptions.risk, (raw) =>\n ensureEnumValue(normalizeRiskInput(raw), RISK_VALUES, \"risk\"),\n );\n const confidence = resolveUnsettableTransformed(unsetKeys, \"confidence\", resolvedOptions.confidence, (raw) => parseConfidenceInput(raw));\n const parentReferencePolicy =\n resolvedOptions.allowMissingParent === true && settings.validation.parent_reference === \"strict_error\"\n ? \"warn\"\n : settings.validation.parent_reference;\n const sprintReleasePolicy = settings.validation.sprint_release_format;\n const validationWarnings: string[] = collectCreateScheduleWarnings(type, id, deadline, reminders.values, events.values);\n const parentValidation = await resolveCreateParentWithWarnings({\n itemId: id,\n parent,\n pmRoot,\n settings,\n typeRegistry,\n policy: parentReferencePolicy,\n });\n parent = parentValidation.parent;\n validationWarnings.push(...parentValidation.warnings);\n const sprintResolved = resolveCreateSprintOrRelease(unsetKeys, \"sprint\", resolvedOptions.sprint, \"sprint\", sprintReleasePolicy);\n const sprint = sprintResolved.value;\n validationWarnings.push(...sprintResolved.warnings);\n const releaseResolved = resolveCreateSprintOrRelease(unsetKeys, \"release\", resolvedOptions.release, \"release\", sprintReleasePolicy);\n const release = releaseResolved.value;\n validationWarnings.push(...releaseResolved.warnings);\n const blockedBy = resolveUnsettableOptionalString(unsetKeys, \"blocked_by\", resolvedOptions.blockedBy);\n const blockedByResolution = await resolveCreateBlockedByDependency({\n pmRoot,\n settings,\n typeRegistry,\n statusRegistry,\n blockedBy,\n dependencyValues: dependencies.values,\n status,\n statusExplicit: resolvedOptions.status !== undefined,\n nowValue,\n author,\n });\n const dependencyValues = blockedByResolution.dependencyValues;\n status = blockedByResolution.status;\n const blockedReason = resolveUnsettableOptionalString(unsetKeys, \"blocked_reason\", resolvedOptions.blockedReason);\n const unblockNote = resolveUnsettableOptionalString(unsetKeys, \"unblock_note\", resolvedOptions.unblockNote);\n const reporter = resolveUnsettableOptionalString(unsetKeys, \"reporter\", resolvedOptions.reporter);\n const severity = resolveUnsettableTransformed(unsetKeys, \"severity\", resolvedOptions.severity, (raw) =>\n ensureEnumValue(normalizeSeverityInput(raw), ISSUE_SEVERITY_VALUES, \"severity\"),\n );\n const environment = resolveUnsettableOptionalString(unsetKeys, \"environment\", resolvedOptions.environment);\n const reproSteps = resolveUnsettableOptionalString(unsetKeys, \"repro_steps\", resolvedOptions.reproSteps);\n const resolution = resolveUnsettableOptionalString(unsetKeys, \"resolution\", resolvedOptions.resolution);\n const expectedResult = resolveUnsettableOptionalString(unsetKeys, \"expected_result\", resolvedOptions.expectedResult);\n const actualResult = resolveUnsettableOptionalString(unsetKeys, \"actual_result\", resolvedOptions.actualResult);\n const affectedVersion = resolveUnsettableOptionalString(unsetKeys, \"affected_version\", resolvedOptions.affectedVersion);\n const fixedVersion = resolveUnsettableOptionalString(unsetKeys, \"fixed_version\", resolvedOptions.fixedVersion);\n const component = resolveUnsettableOptionalString(unsetKeys, \"component\", resolvedOptions.component);\n const regression = resolveUnsettableTransformed(unsetKeys, \"regression\", resolvedOptions.regression, (raw) => parseRegressionInput(raw));\n const customerImpact = resolveUnsettableOptionalString(unsetKeys, \"customer_impact\", resolvedOptions.customerImpact);\n const title = requireStringOption(resolvedOptions.title, \"--title\");\n const description = resolvedOptions.description ?? \"\";\n const body = resolvedOptions.body ?? \"\";\n\n // GH-249: creating an item directly in the close status must honor\n // governance.require_close_reason, just like `pm close` (errors when missing)\n // and `pm update --status closed` (defaults + warns).\n const closeReasonResolution = resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution);\n const closeReason = closeReasonResolution.closeReason;\n validationWarnings.push(...closeReasonResolution.warnings);\n\n const frontMatter: ItemMetadata = normalizeFrontMatter({\n id,\n title,\n description,\n type,\n type_options: validatedTypeOptions.normalized,\n status,\n close_reason: closeReason,\n priority,\n tags,\n created_at: nowValue,\n updated_at: nowValue,\n deadline,\n assignee,\n author: authorValue,\n estimated_minutes: estimatedMinutes,\n acceptance_criteria: acceptanceCriteria,\n definition_of_ready: definitionOfReady,\n order,\n goal,\n objective,\n value,\n impact,\n outcome,\n why_now: whyNow,\n parent,\n reviewer,\n risk,\n confidence,\n sprint,\n release,\n blocked_by: blockedBy,\n blocked_reason: blockedReason,\n unblock_note: unblockNote,\n reporter,\n severity,\n environment,\n repro_steps: reproSteps,\n resolution,\n expected_result: expectedResult,\n actual_result: actualResult,\n affected_version: affectedVersion,\n fixed_version: fixedVersion,\n component,\n regression,\n customer_impact: customerImpact,\n dependencies: dependencyValues,\n comments: comments.values as Comment[] | undefined,\n notes: notes.values as LogNote[] | undefined,\n learnings: learnings.values as LogNote[] | undefined,\n files: files.values,\n tests: tests.values,\n docs: docs.values,\n reminders: reminders.values,\n events: events.values,\n ...registeredItemFieldValues,\n ...runtimeCreateFieldValues.values,\n });\n try {\n applyRegisteredItemFieldDefaultsAndValidation(\n frontMatter as unknown as Record<string, unknown>,\n extensionRegistrations,\n );\n } catch (error: unknown) {\n /* c8 ignore start -- applyRegisteredItemFieldDefaultsAndValidation only throws Error instances, so the non-Error message fallback is unreachable. */\n throw new PmCliError(error instanceof Error ? error.message : \"Invalid extension item field values\", EXIT_CODE.USAGE);\n /* c8 ignore stop */\n }\n\n const afterDocument: ItemDocument = canonicalDocument(\n {\n metadata: frontMatter,\n body,\n },\n { schema: settings.schema, extensionFieldNames },\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n const explicitUnsetKeys = [...explicitUnsets].sort((left, right) => left.localeCompare(right));\n const historyMessage = buildHistoryMessage(resolvedOptions.message, explicitUnsetKeys);\n const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys, [\n ...Object.keys(registeredItemFieldValues),\n /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */\n ...Object.keys(runtimeCreateFieldValues.values ?? {}),\n /* c8 ignore stop */\n ]);\n const hookWarnings = await writeCreatedItem({\n pmRoot,\n type,\n id,\n settings,\n typeRegistry,\n author,\n extensionFieldNames,\n afterDocument,\n beforeDocument,\n historyMessage,\n changedFields,\n nowValue,\n });\n\n const outputItem = structuredClone(frontMatter);\n\n // GH-216: nudge agents toward the underutilized in_progress state instead of\n // jumping open -> closed. Only surfaces for workable types created in the open\n // status when the workflow defines a distinct in_progress status to move to.\n const nextTransition = suggestNextLifecycleTransition(id, type, status, statusRegistry);\n\n // After the create has committed (so the ID is real and shows up in the suggestion),\n // emit a single non-blocking stderr hint when the new item would be invisible on `pm\n // calendar`. The structured `calendar_item_without_schedule:*` warning above is what\n // automation reads; this stderr line is the human/agent-facing version with a\n // copy-pasteable `pm update` recipe.\n if (createItemLacksSchedule(type, deadline, reminders.values, events.values)) {\n printError(\n `[pm] warning: ${type} '${id}' has no deadline/reminder/event — it will not appear on the calendar. Add one via 'pm update ${id} --deadline <ISO>' or 'pm update ${id} --event \"start=<ISO>,end=<ISO>\"'.`,\n );\n }\n\n return {\n item: outputItem,\n changed_fields: changedFields,\n warnings: [...validationWarnings, ...hookWarnings],\n ...(parentSource !== undefined ? { parent_source: parentSource } : {}),\n ...(nextTransition !== undefined ? { next_transition: nextTransition } : {}),\n };\n}\n\nexport const _testOnlyCreateCommand = {\n buildHistoryMessage,\n buildInvalidLogSeedKeysMessage,\n buildTypeSpecificCreateExample,\n collectMissingRequiredTypeOptionKeys,\n createExampleTokensForFlag,\n filterNonMissingTypeOptionErrors,\n hasTemplatesShowHandler,\n hasCreateOptionValue,\n loadCreateTemplateOptionsFromRuntime,\n looksLikeStructuredEntry,\n mergeCreateOptionsWithTemplate,\n normalizeCreatePolicyOptionKey,\n normalizeDependencyKindInput,\n normalizeExtensionCommandPath,\n parseCreateUnsetTargets,\n requireStringOption,\n readTemplateOptionsFromRuntimeResult,\n resolveRuntimeCreateUnsetDefinition: (token: string, registry: RuntimeFieldRegistry | undefined) =>\n resolveRuntimeUnsetFieldDefinition(token, \"create\", registry),\n typeOptionExampleValue,\n};\n"],"names":["endAt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAM,yBAA6D;EACxE,UAAU;EACV,MAAM;EACN,QAAQ;EACR,KAAK;EACL,SAAS;;AAGX,IAAM,qBAAqB,OAAO,KAAK,sBAAsB;AAMtD,IAAM,+BACX,2EACI,mBAAmB,KAAK,IAAI,CAAC;AAEnC,SAAS,mBAAmB,KAAW;AACrC,SAAO,IAAI,WACT,qBAAqB,GAAG,uBAAuB,4BAA4B,KAC3E,UAAU,KAAK;AAEnB;AAYM,SAAU,gBAAgB,KAAoB;AAClD,MAAI,OAAO,QAAQ,UAAU;AAC3B,QAAI,OAAO,UAAU,GAAG,KAAK,OA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AyB,UAAU,CAAA,CAAE;;GAErD;AACD,QAAM,eAAe,MAAM,iBAAiB;IAC1C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;AAED,QAAM,aAAa,gBAAgB,WAAW;AAK9C,QAAM,iBAAiB,+BAA+B,IAAI,MAAM,QAAQ,cAAc;AAOtF,MAAI,wBAAwB,MAAM,UAAU,UAAU,QAAQ,OAAO,MAAM,GAAG;AAC5E,eACE,iBAAiB,IAAI,KAAK,EAAE,sGAAiG,EAAE,oCAAoC,EAAE,oCAAoC;EAE7M;AAEA,SAAO;IACL,MAAM;IACN,gBAAgB;IAChB,UAAU,CAAC,GAAG,oBAAoB,GAAG,YAAY;IACjD,GAAI,iBAAiB,SAAY,EAAE,eAAe,aAAY,IAAK,CAAA;IACnE,GAAI,mBAAmB,SAAY,EAAE,iBAAiB,eAAc,IAAK,CAAA;;AAE7E;AAEO,IAAM,yBAAyB;EACpC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qCAAqC,CAAC,OAAe,aACnD,mCAAmC,OAAO,UAAU,QAAQ;EAC9D","debugId":"59bf43ec-201a-5ebc-b1f7-9e467826b815"}
1
+ {"version":3,"sources":["../../../../../../../../core/item/priority.ts","../../../../../../../../core/item/type-synonyms.ts","../../../../../../../../cli/commands/metadata-normalizers.ts","../../../../../../../../cli/commands/legacy-none-tokens.ts","../../../../../../../../cli/commands/lifecycle-transitions.ts","../../../../../../../../cli/commands/linked-test-entry.ts","../../../../../../../../cli/commands/linked-test-parsers.ts","../../../../../../../../cli/commands/shared-unset-fields.ts","../../../../../../../../cli/commands/recurrence-parsers.ts","../../../../../../../../cli/commands/event-validation-messages.ts","../../../../../../../../cli/commands/repeatable-metadata-parsers.ts","../../../../../../../../cli/commands/create.ts"],"sourcesContent":["/**\n * @module core/item/priority\n *\n * Defines item parsing, formatting, and lifecycle helpers for Priority.\n */\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\n/**\n * Restricts priority values accepted by command, SDK, and storage contracts.\n */\nexport type Priority = 0 | 1 | 2 | 3 | 4;\n\n/**\n * Canonical mapping from named priority levels to numeric values. Agents and\n * humans frequently write words (\"high\") instead of numbers, so both create and\n * update accept either form. This single map is the source of truth so the two\n * commands cannot drift apart.\n */\nexport const PRIORITY_NAME_TO_VALUE: Readonly<Record<string, Priority>> = {\n critical: 0,\n high: 1,\n medium: 2,\n low: 3,\n minimal: 4,\n};\n\nconst PRIORITY_NAME_LIST = Object.keys(PRIORITY_NAME_TO_VALUE);\n\n/**\n * Human-readable description of every accepted priority form. Reused in error\n * messages so the wording stays consistent across commands.\n */\nexport const PRIORITY_ACCEPTED_FORMS_HINT =\n \"numbers 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal) or names \" +\n `(${PRIORITY_NAME_LIST.join(\", \")}), case-insensitive`;\n\nfunction priorityUsageError(raw: string): PmCliError {\n return new PmCliError(\n `Invalid priority \"${raw}\". Accepted values: ${PRIORITY_ACCEPTED_FORMS_HINT}.`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Resolve a raw `--priority` option value to a numeric 0..4 priority.\n *\n * Accepts:\n * - numeric strings 0,1,2,3,4 (unchanged from prior behavior)\n * - named levels (critical/high/medium/low/minimal), case-insensitive\n * - native numbers 0..4 (arrives via MCP tool calls that JSON-encode priority as a number)\n *\n * Throws a USAGE error listing BOTH accepted forms for anything else.\n */\nexport function resolvePriority(raw: string | number): Priority {\n if (typeof raw === \"number\") {\n if (Number.isInteger(raw) && raw >= 0 && raw <= 4) {\n return raw as Priority;\n }\n throw priorityUsageError(String(raw));\n }\n if (typeof raw !== \"string\") {\n throw priorityUsageError(String(raw));\n }\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw priorityUsageError(raw);\n }\n\n const normalizedName = trimmed.toLowerCase();\n if (Object.prototype.hasOwnProperty.call(PRIORITY_NAME_TO_VALUE, normalizedName)) {\n return PRIORITY_NAME_TO_VALUE[normalizedName as keyof typeof PRIORITY_NAME_TO_VALUE];\n }\n\n // Numeric form: only exact integers 0..4 are valid. Number() would accept\n // forms like \"1.0\" or \" 2 \", but we already trimmed and require an integer\n // match so the contract stays tight.\n if (/^[0-4]$/.test(trimmed)) {\n return Number(trimmed) as Priority;\n }\n\n throw priorityUsageError(raw);\n}\n","/**\n * Common type synonyms agents type that are not item types themselves. Telemetry\n * shows real users repeatedly run e.g. `pm create Bug \"...\"` and `pm create Change\n * \"...\"` and hit a hard \"invalid type\" error. Rather than block, `create` maps an\n * unregistered type through this table to its closest canonical built-in type (and\n * prints a note). The mapping is only a FALLBACK: it applies after the real type\n * registry fails to resolve the name, and the canonical target is itself resolved\n * through the live registry — so a project that defines its own `Bug` type keeps it,\n * and a project that has removed `Issue` will simply fall through to the normal error.\n *\n * Keys are compared case-insensitively after trimming. Values are canonical built-in\n * type names (resolved through the registry, never written verbatim).\n */\nexport const TYPE_SYNONYMS: Readonly<Record<string, string>> = {\n bug: \"Issue\",\n bugfix: \"Issue\",\n defect: \"Issue\",\n incident: \"Issue\",\n enhancement: \"Feature\",\n story: \"Feature\",\n userstory: \"Feature\",\n \"user-story\": \"Feature\",\n \"user story\": \"Feature\",\n change: \"Chore\",\n ticket: \"Task\",\n todo: \"Task\",\n};\n\n/**\n * Map a free-form type token to its canonical built-in type synonym, or `undefined`\n * when there is no synonym. The caller must still confirm the canonical target exists\n * in the active type registry before using it.\n */\nexport function resolveTypeSynonym(rawType: string | undefined): string | undefined {\n if (rawType === undefined) {\n return undefined;\n }\n return TYPE_SYNONYMS[rawType.trim().toLowerCase()];\n}\n","/**\n * @module cli/commands/metadata-normalizers\n *\n * Implements the pm metadata normalizers command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { CONFIDENCE_TEXT_VALUES } from \"../../types/index.js\";\n\n/**\n * Implements normalize risk input for the public runtime surface of this module.\n */\nexport function normalizeRiskInput(value: string): string {\n const trimmed = value.trim();\n return trimmed.toLowerCase() === \"med\" ? \"medium\" : trimmed;\n}\n\n/**\n * Implements normalize severity input for the public runtime surface of this module.\n */\nexport function normalizeSeverityInput(value: string): string {\n const trimmed = value.trim();\n return trimmed.toLowerCase() === \"med\" ? \"medium\" : trimmed;\n}\n\n/**\n * Implements parse confidence input for the public runtime surface of this module.\n */\nexport function parseConfidenceInput(value: string): number | \"low\" | \"medium\" | \"high\" {\n const trimmed = value.trim().toLowerCase();\n if (trimmed === \"med\") {\n return \"medium\";\n }\n if (CONFIDENCE_TEXT_VALUES.includes(trimmed as (typeof CONFIDENCE_TEXT_VALUES)[number])) {\n return trimmed as (typeof CONFIDENCE_TEXT_VALUES)[number];\n }\n const parsed = parseOptionalNumber(value, \"confidence\");\n if (!Number.isInteger(parsed) || parsed < 0 || parsed > 100) {\n throw new PmCliError(\"Confidence must be an integer 0..100 or one of low|med|medium|high\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements parse regression input for the public runtime surface of this module.\n */\nexport function parseRegressionInput(value: string): boolean {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n throw new PmCliError(\"Regression must be one of true|false|1|0\", EXIT_CODE.USAGE);\n}\n","/**\n * @module cli/commands/legacy-none-tokens\n *\n * Implements the pm legacy none tokens command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n/**\n * Shared legacy \"none\"/\"null\" sentinel handling for the create and update\n * commands. These tokens used to mean \"clear this field\"; they are now\n * rejected in favour of explicit --unset / --clear-* flags.\n *\n * Extracted verbatim from create.ts and update.ts (pm-why9) — behaviour and\n * error strings are identical to the previous per-command copies.\n */\nconst LEGACY_NONE_TOKENS = new Set([\"none\", \"null\"]);\n\n/**\n * Describes a repeatable option whose legacy none/null token maps to a clear flag.\n */\nexport interface LegacyNoneCollectionNormalizer<TOptions extends Record<string, unknown>> {\n optionKey: keyof TOptions;\n clearFlagKey: keyof TOptions;\n valueFlag: string;\n clearFlag: string;\n disableFlagKey?: keyof TOptions;\n}\n\n/**\n * Implements check whether legacy none token for the public runtime surface of this module.\n */\nexport function isLegacyNoneToken(value: string | undefined): boolean {\n if (value === undefined) {\n return false;\n }\n return LEGACY_NONE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/**\n * Implements assert no legacy none token for the public runtime surface of this module.\n */\nexport function assertNoLegacyNoneToken(value: string | undefined, flag: string, replacementHint?: string): void {\n if (!isLegacyNoneToken(value)) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(`${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(), EXIT_CODE.USAGE);\n}\n\n/**\n * Implements assert no legacy none tokens for the public runtime surface of this module.\n */\nexport function assertNoLegacyNoneTokens(values: string[] | undefined, flag: string, replacementHint?: string): void {\n if (!values || values.length === 0) {\n return;\n }\n const hasLegacyToken = values.some((value) => isLegacyNoneToken(value));\n if (!hasLegacyToken) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(`${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(), EXIT_CODE.USAGE);\n}\n\n/**\n * Convert collection-level legacy none/null tokens into their explicit clear flags.\n */\nexport function applyLegacyNoneCollectionNormalizers<TOptions extends Record<string, unknown>>(\n normalized: TOptions,\n definitions: ReadonlyArray<LegacyNoneCollectionNormalizer<TOptions>>,\n): TOptions {\n for (const definition of definitions) {\n const candidate = normalized[definition.optionKey];\n if (!Array.isArray(candidate) || candidate.length === 0) {\n continue;\n }\n if (!candidate.every((entry): entry is string => typeof entry === \"string\")) {\n throw new PmCliError(`${definition.valueFlag} entries must be strings.`, EXIT_CODE.USAGE);\n }\n const entries = candidate;\n const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));\n if (!hasLegacy) {\n continue;\n }\n const concreteEntries = entries.filter((entry) => !isLegacyNoneToken(entry));\n if (concreteEntries.length > 0) {\n throw new PmCliError(\n `Cannot mix legacy clear token \"none\"/\"null\" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`,\n EXIT_CODE.USAGE,\n );\n }\n normalized[definition.optionKey] = undefined as TOptions[keyof TOptions];\n normalized[definition.clearFlagKey] = true as TOptions[keyof TOptions];\n if (definition.disableFlagKey) {\n normalized[definition.disableFlagKey] = false as TOptions[keyof TOptions];\n }\n }\n return normalized;\n}\n","/**\n * @module cli/commands/lifecycle-transitions\n *\n * Implements the pm lifecycle transitions command surface and its agent-facing runtime behavior.\n */\nimport {\n normalizeStatusInputWithRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\n\n/**\n * GH-216: a contextual next-step hint that nudges agents toward the\n * underutilized `in_progress` lifecycle state instead of jumping straight from\n * `open` to `closed`. The suggestion is intentionally non-binding (no governance\n * enforcement) and only surfaces when a richer transition genuinely exists.\n */\nexport interface LifecycleTransitionSuggestion {\n /** Ready-to-run command that advances the item to the suggested status. */\n command: string;\n /** The status the suggested command moves the item to. */\n to_status: string;\n}\n\n/**\n * Item types whose lifecycle does not follow the\n * `open -> in_progress -> closed` work path. Scheduling/reference types are\n * tracked or scheduled rather than \"worked\", so a `start-task` nudge would be\n * noise. Compared case-insensitively against the resolved item type.\n */\nconst NON_WORKABLE_TYPES = new Set([\n \"event\",\n \"meeting\",\n \"reminder\",\n \"milestone\",\n \"decision\",\n \"adr\",\n]);\n\n/**\n * Suggest the next lifecycle transition for a freshly created (or open) item.\n *\n * Returns a `pm start-task` hint when the item is a workable type currently in\n * the workspace open status AND the workflow defines a distinct `in_progress`\n * status to advance to. Returns `undefined` (no hint) otherwise — including for\n * scheduling types and workflows that collapse `in_progress` into `open` — so\n * the suggestion never fabricates a transition the workflow cannot perform.\n */\nexport function suggestNextLifecycleTransition(\n id: string,\n type: string,\n status: string,\n statusRegistry: RuntimeStatusRegistry,\n): LifecycleTransitionSuggestion | undefined {\n if (NON_WORKABLE_TYPES.has(type.trim().toLowerCase())) {\n return undefined;\n }\n if (status !== statusRegistry.open_status) {\n return undefined;\n }\n const inProgress = normalizeStatusInputWithRegistry(\"in_progress\", statusRegistry);\n if (inProgress === undefined || inProgress === statusRegistry.open_status) {\n return undefined;\n }\n return { command: `pm start-task ${id}`, to_status: inProgress };\n}\n","/**\n * @module cli/commands/linked-test-entry\n *\n * Implements the pm linked test entry command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n// Keys accepted inside a structured linked-test entry. `cmd` is an alias for\n// `command`; everything else maps 1:1 to a LinkedTest field.\nexport const STRUCTURED_LINKED_TEST_KEYS = [\n \"command\",\n \"cmd\",\n \"path\",\n \"scope\",\n \"timeout\",\n \"timeout_seconds\",\n \"pm_context_mode\",\n \"env_set\",\n \"env_clear\",\n \"shared_host_safe\",\n \"assert_stdout_contains\",\n \"assert_stdout_regex\",\n \"assert_stderr_contains\",\n \"assert_stderr_regex\",\n \"assert_stdout_min_lines\",\n \"assert_json_field_equals\",\n \"assert_json_field_gte\",\n \"note\",\n] as const;\n\nconst STRUCTURED_LINKED_TEST_KEY_SET = new Set<string>(STRUCTURED_LINKED_TEST_KEYS);\nconst STRUCTURED_LINKED_TEST_KEY_PATTERN = STRUCTURED_LINKED_TEST_KEYS.map((key) =>\n key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"),\n).join(\"|\");\nconst STRUCTURED_LINKED_TEST_ENTRY_PATTERN = new RegExp(\n `^(?:[-*+]\\\\s+)?(?:${STRUCTURED_LINKED_TEST_KEY_PATTERN})\\\\s*[:=]`,\n \"i\",\n);\n\n/**\n * Implements looks like structured linked test entry for the public runtime surface of this module.\n */\nexport function looksLikeStructuredLinkedTestEntry(raw: string): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n return STRUCTURED_LINKED_TEST_ENTRY_PATTERN.test(raw);\n}\n\n/**\n * Implements normalize structured linked test entry for the public runtime surface of this module.\n */\nexport function normalizeStructuredLinkedTestEntry(\n kv: Record<string, string>,\n optionName: \"--add\" | \"--test\",\n): Record<string, string> {\n const normalizedKv: Record<string, string> = {};\n const unknownKeys: string[] = [];\n for (const [key, value] of Object.entries(kv)) {\n const normalizedKey = key.toLowerCase();\n if (!STRUCTURED_LINKED_TEST_KEY_SET.has(normalizedKey)) {\n unknownKeys.push(key);\n continue;\n }\n normalizedKv[normalizedKey] = value;\n }\n if (unknownKeys.length > 0) {\n throw new PmCliError(\n `${optionName} does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n if (normalizedKv.cmd !== undefined) {\n if (normalizedKv.command !== undefined && normalizedKv.command.trim() !== normalizedKv.cmd.trim()) {\n throw new PmCliError(`${optionName} command and cmd must match when both are provided`, EXIT_CODE.USAGE);\n }\n const { cmd, ...rest } = normalizedKv;\n return { ...rest, command: rest.command ?? cmd };\n }\n return normalizedKv;\n}\n","/**\n * @module cli/commands/linked-test-parsers\n *\n * Implements the pm linked test parsers command surface and its agent-facing runtime behavior.\n */\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { STRUCTURED_LINKED_TEST_KEYS } from \"./linked-test-entry.js\";\nimport { SCOPE_VALUES } from \"../../types/index.js\";\nimport type { LinkedTest, LinkScope } from \"../../types/index.js\";\n\n/**\n * Shared linked-test field parsers used by the `create` and `test` commands.\n *\n * Extracted verbatim from create.ts and test.ts (pm-why9). The two copies were\n * byte-identical apart from their empty-input guard: create called these with\n * raw (untrimmed) values and used `if (!normalized)`; test called them with\n * pre-`.trim()`-ed values and used `if (!raw || raw.trim().length === 0)`.\n *\n * Both reduce to the same observable behaviour when the guard is the plain\n * falsy check used here: create's call sites still pass untrimmed values\n * (behaviour preserved exactly), and test's call sites pre-trim so a\n * whitespace-only value collapses to \"\" and is rejected by `!raw` exactly as\n * before. Error strings and parsing semantics are identical to both originals.\n */\n\nexport const LINKED_TEST_PROTECTED_ENV_KEYS = new Set([\"PM_PATH\", \"PM_GLOBAL_PATH\", \"FORCE_COLOR\"]);\nexport const LINKED_TEST_ENV_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\nexport const LINKED_TEST_PM_CONTEXT_MODE_VALUES = [\"schema\", \"tracker\", \"auto\"] as const;\n/**\n * Restricts linked test pm context mode values accepted by command, SDK, and storage contracts.\n */\nexport type LinkedTestPmContextMode = (typeof LINKED_TEST_PM_CONTEXT_MODE_VALUES)[number];\n\n/**\n * Implements parse linked test env set for the public runtime surface of this module.\n */\nexport function parseLinkedTestEnvSet(raw: string | undefined, optionName: string): Record<string, string> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(`${optionName} env_set must include at least one KEY=VALUE assignment`, EXIT_CODE.USAGE);\n }\n const envSet: Record<string, string> = {};\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} env_set entries must use KEY=VALUE and be separated by semicolons. Example: env_set=PORT=0;PLAYWRIGHT_BASE_URL=http://127.0.0.1:4173`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const value = assignment.slice(separatorIndex + 1);\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw new PmCliError(`${optionName} env_set key \"${key}\" is invalid`, EXIT_CODE.USAGE);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw new PmCliError(`${optionName} env_set key \"${key}\" is reserved for sandbox safety`, EXIT_CODE.USAGE);\n }\n envSet[key] = value;\n }\n /* c8 ignore start -- envSet always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(envSet).length > 0 ? envSet : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Implements parse linked test env clear for the public runtime surface of this module.\n */\nexport function parseLinkedTestEnvClear(raw: string | undefined, optionName: string): string[] | undefined {\n if (!raw) {\n return undefined;\n }\n const keys = splitCommaList(raw, { separators: /[;,\\n]/ });\n if (keys.length === 0) {\n throw new PmCliError(`${optionName} env_clear must include at least one environment variable name`, EXIT_CODE.USAGE);\n }\n for (const key of keys) {\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw new PmCliError(`${optionName} env_clear key \"${key}\" is invalid`, EXIT_CODE.USAGE);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw new PmCliError(`${optionName} env_clear key \"${key}\" is reserved for sandbox safety`, EXIT_CODE.USAGE);\n }\n }\n return keys;\n}\n\n/**\n * Implements parse linked test boolean for the public runtime surface of this module.\n */\nexport function parseLinkedTestBoolean(raw: string | undefined, optionName: string, fieldLabel: string): boolean | undefined {\n if (!raw) {\n return undefined;\n }\n const value = raw.trim().toLowerCase();\n if (value === \"true\" || value === \"1\" || value === \"yes\") {\n return true;\n }\n if (value === \"false\" || value === \"0\" || value === \"no\") {\n return false;\n }\n throw new PmCliError(`${optionName} ${fieldLabel} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\n/**\n * Implements parse linked test context mode for the public runtime surface of this module.\n */\nexport function parseLinkedTestContextMode(\n raw: string | undefined,\n optionName: string,\n): LinkedTest[\"pm_context_mode\"] | undefined {\n if (!raw) {\n return undefined;\n }\n const value = raw.trim().toLowerCase();\n if ((LINKED_TEST_PM_CONTEXT_MODE_VALUES as readonly string[]).includes(value)) {\n return value as LinkedTest[\"pm_context_mode\"];\n }\n throw new PmCliError(\n `${optionName} pm_context_mode must be one of: ${LINKED_TEST_PM_CONTEXT_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Implements parse linked test string list for the public runtime surface of this module.\n */\nexport function parseLinkedTestStringList(raw: string | undefined): string[] | undefined {\n if (!raw) {\n return undefined;\n }\n const values = splitCommaList(raw, { separators: /[;\\n]/ });\n return values.length > 0 ? values : undefined;\n}\n\n/**\n * Implements parse linked test regex list for the public runtime surface of this module.\n */\nexport function parseLinkedTestRegexList(raw: string | undefined, optionName: string, fieldLabel: string): string[] | undefined {\n const values = parseLinkedTestStringList(raw);\n if (!values || values.length === 0) {\n return undefined;\n }\n for (const pattern of values) {\n try {\n // Validate regex syntax early so malformed assertions fail at parse time.\n // User-provided, per-item patterns only run during local CLI validation.\n new RegExp(pattern, \"m\");\n } catch (error: unknown) {\n throw new PmCliError(\n /* c8 ignore next -- RegExp only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `${optionName} ${fieldLabel} includes invalid regex \"${pattern}\": ${error instanceof Error ? error.message : String(error)}`,\n EXIT_CODE.USAGE,\n );\n }\n }\n return values;\n}\n\n/**\n * Implements parse linked test min lines for the public runtime surface of this module.\n */\nexport function parseLinkedTestMinLines(raw: string | undefined, optionName: string): number | undefined {\n if (!raw) {\n return undefined;\n }\n const parsed = parseOptionalNumber(raw, \"assert_stdout_min_lines\");\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw new PmCliError(`${optionName} assert_stdout_min_lines must be an integer >= 0`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements parse linked test assertion equals map for the public runtime surface of this module.\n */\nexport function parseLinkedTestAssertionEqualsMap(raw: string | undefined, optionName: string): Record<string, string> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_equals must include at least one path=value assignment`, EXIT_CODE.USAGE);\n }\n const values: Record<string, string> = {};\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_equals entries must use path=value and be separated by semicolons`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const value = assignment.slice(separatorIndex + 1).trim();\n if (key.length === 0 || value.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_equals entries must include non-empty path and value`, EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n /* c8 ignore start -- values always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(values).length > 0 ? values : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Implements parse linked test assertion gte map for the public runtime surface of this module.\n */\nexport function parseLinkedTestAssertionGteMap(raw: string | undefined, optionName: string): Record<string, number> | undefined {\n if (!raw) {\n return undefined;\n }\n const assignments = raw\n .split(/[;\\n]/)\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0);\n if (assignments.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_gte must include at least one path=value assignment`, EXIT_CODE.USAGE);\n }\n const values: Record<string, number> = {};\n for (const assignment of assignments) {\n const separatorIndex = assignment.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `${optionName} assert_json_field_gte entries must use path=value and be separated by semicolons`,\n EXIT_CODE.USAGE,\n );\n }\n const key = assignment.slice(0, separatorIndex).trim();\n const valueRaw = assignment.slice(separatorIndex + 1).trim();\n if (key.length === 0 || valueRaw.length === 0) {\n throw new PmCliError(`${optionName} assert_json_field_gte entries must include non-empty path and value`, EXIT_CODE.USAGE);\n }\n const value = Number.parseFloat(valueRaw);\n if (!Number.isFinite(value)) {\n throw new PmCliError(`${optionName} assert_json_field_gte value for \"${key}\" must be numeric`, EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n /* c8 ignore start -- values always has >=1 key here (assignments is non-empty and each adds one); the undefined branch is defensive. */\n return Object.keys(values).length > 0 ? values : undefined;\n /* c8 ignore stop */\n}\n\n/**\n * Strict JSON linked-test entry parsing for `pm test --add-json` (pm-vcr2).\n *\n * Accepts a JSON object or array of objects whose keys match the structured\n * linked-test fields. Unlike `--add` CSV parsing, command strings are stored\n * verbatim: commas, nested quotes, `--` separators, and shell variables like\n * `$tmp` survive byte-identically.\n */\n\nconst LINKED_TEST_JSON_KEY_SET = new Set<string>(STRUCTURED_LINKED_TEST_KEYS);\n\ntype JsonRecord = Record<string, unknown>;\n\nfunction isPlainObject(value: unknown): value is JsonRecord {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction normalizeJsonEntryKeys(entry: JsonRecord, fail: (message: string) => PmCliError): JsonRecord {\n const normalized: JsonRecord = {};\n const unknownKeys: string[] = [];\n for (const [key, value] of Object.entries(entry)) {\n const normalizedKey = key.toLowerCase();\n if (!LINKED_TEST_JSON_KEY_SET.has(normalizedKey)) {\n unknownKeys.push(key);\n continue;\n }\n if (Object.hasOwn(normalized, normalizedKey)) {\n throw fail(`provides key \"${key}\" more than once after case normalization`);\n }\n normalized[normalizedKey] = value;\n }\n if (unknownKeys.length > 0) {\n throw fail(\n `does not recognize key${unknownKeys.length > 1 ? \"s\" : \"\"} ${unknownKeys.map((key) => `\"${key}\"`).join(\", \")}. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`,\n );\n }\n return normalized;\n}\n\nfunction readJsonEntryString(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): string | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== \"string\") {\n throw fail(`field \"${key}\" must be a JSON string`);\n }\n return value;\n}\n\nfunction readJsonEntryStringList(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): string[] | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n const list = typeof value === \"string\" ? [value] : value;\n if (!Array.isArray(list) || list.some((item) => typeof item !== \"string\")) {\n throw fail(`field \"${key}\" must be a string or an array of strings`);\n }\n const values = (list as string[]).filter((item) => item.length > 0);\n return values.length > 0 ? values : undefined;\n}\n\nfunction readJsonEntryRegexList(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): string[] | undefined {\n const values = readJsonEntryStringList(entry, key, fail);\n if (!values) {\n return undefined;\n }\n for (const pattern of values) {\n try {\n new RegExp(pattern, \"m\");\n } catch (error: unknown) {\n throw fail(\n /* c8 ignore next -- RegExp only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `field \"${key}\" includes invalid regex \"${pattern}\": ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n return values;\n}\n\nfunction readJsonEntryNumber(value: unknown, key: string, fail: (message: string) => PmCliError): number {\n const parsed =\n typeof value === \"number\"\n ? value\n : typeof value === \"string\" && value.trim().length > 0\n ? Number(value.trim())\n : Number.NaN;\n if (typeof value === \"boolean\" || !Number.isFinite(parsed)) {\n throw fail(`field \"${key}\" must be a finite number (or numeric string)`);\n }\n return parsed;\n}\n\nfunction readJsonEntryTimeoutSeconds(entry: JsonRecord, fail: (message: string) => PmCliError): number | undefined {\n const timeoutSecondsRaw = entry.timeout_seconds;\n const timeoutAliasRaw = entry.timeout;\n if (timeoutSecondsRaw === undefined && timeoutAliasRaw === undefined) {\n return undefined;\n }\n const timeoutSeconds = timeoutSecondsRaw === undefined ? undefined : readJsonEntryNumber(timeoutSecondsRaw, \"timeout_seconds\", fail);\n const timeoutAlias = timeoutAliasRaw === undefined ? undefined : readJsonEntryNumber(timeoutAliasRaw, \"timeout\", fail);\n if (timeoutSeconds !== undefined && timeoutAlias !== undefined && timeoutSeconds !== timeoutAlias) {\n throw fail(\"timeout and timeout_seconds must match when both are provided\");\n }\n const timeout = timeoutSeconds ?? (timeoutAlias as number);\n if (!Number.isInteger(timeout) || timeout <= 0) {\n throw fail(\"timeout_seconds must be a positive integer\");\n }\n return timeout;\n}\n\nfunction readJsonEntryScope(entry: JsonRecord, fail: (message: string) => PmCliError): LinkScope {\n const value = readJsonEntryString(entry, \"scope\", fail);\n if (value === undefined) {\n return \"project\";\n }\n if (!(SCOPE_VALUES as readonly string[]).includes(value)) {\n throw fail(`field \"scope\" must be one of: ${SCOPE_VALUES.join(\", \")}`);\n }\n return value as LinkScope;\n}\n\nfunction readJsonEntryEnvSet(entry: JsonRecord, fail: (message: string) => PmCliError): Record<string, string> | undefined {\n if (!Object.hasOwn(entry, \"env_set\")) {\n return undefined;\n }\n const value = entry.env_set;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail('field \"env_set\" must be a JSON object mapping environment names to string values');\n }\n const envSet: Record<string, string> = {};\n for (const [key, entryValue] of Object.entries(value)) {\n if (typeof entryValue !== \"string\") {\n throw fail(`field \"env_set\" value for \"${key}\" must be a string`);\n }\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw fail(`field \"env_set\" key \"${key}\" is invalid`);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw fail(`field \"env_set\" key \"${key}\" is reserved for sandbox safety`);\n }\n envSet[key] = entryValue;\n }\n return Object.keys(envSet).length > 0 ? envSet : undefined;\n}\n\nfunction readJsonEntryEnvClear(entry: JsonRecord, fail: (message: string) => PmCliError): string[] | undefined {\n const keys = readJsonEntryStringList(entry, \"env_clear\", fail);\n if (!keys) {\n return undefined;\n }\n for (const key of keys) {\n if (!LINKED_TEST_ENV_NAME_PATTERN.test(key)) {\n throw fail(`field \"env_clear\" key \"${key}\" is invalid`);\n }\n if (LINKED_TEST_PROTECTED_ENV_KEYS.has(key.toUpperCase())) {\n throw fail(`field \"env_clear\" key \"${key}\" is reserved for sandbox safety`);\n }\n }\n return keys;\n}\n\nfunction readJsonEntryBoolean(entry: JsonRecord, key: string, fail: (message: string) => PmCliError): boolean | undefined {\n if (!Object.hasOwn(entry, key)) {\n return undefined;\n }\n const value = entry[key];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== \"boolean\") {\n throw fail(`field \"${key}\" must be a JSON boolean (true or false)`);\n }\n return value;\n}\n\nfunction readJsonEntryMinLines(entry: JsonRecord, fail: (message: string) => PmCliError): number | undefined {\n if (!Object.hasOwn(entry, \"assert_stdout_min_lines\")) {\n return undefined;\n }\n const value = entry.assert_stdout_min_lines;\n if (value === undefined) {\n return undefined;\n }\n const parsed = readJsonEntryNumber(value, \"assert_stdout_min_lines\", fail);\n if (!Number.isInteger(parsed) || parsed < 0) {\n throw fail('field \"assert_stdout_min_lines\" must be an integer >= 0');\n }\n return parsed;\n}\n\nfunction readJsonEntryEqualsMap(entry: JsonRecord, fail: (message: string) => PmCliError): Record<string, string> | undefined {\n if (!Object.hasOwn(entry, \"assert_json_field_equals\")) {\n return undefined;\n }\n const value = entry.assert_json_field_equals;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail('field \"assert_json_field_equals\" must be a JSON object mapping field paths to expected values');\n }\n const values: Record<string, string> = {};\n for (const [key, entryValue] of Object.entries(value)) {\n if (key.trim().length === 0) {\n throw fail('field \"assert_json_field_equals\" keys must be non-empty field paths');\n }\n if (typeof entryValue !== \"string\" && typeof entryValue !== \"number\" && typeof entryValue !== \"boolean\") {\n throw fail(`field \"assert_json_field_equals\" value for \"${key}\" must be a string, number, or boolean`);\n }\n values[key] = String(entryValue);\n }\n return Object.keys(values).length > 0 ? values : undefined;\n}\n\nfunction readJsonEntryGteMap(entry: JsonRecord, fail: (message: string) => PmCliError): Record<string, number> | undefined {\n if (!Object.hasOwn(entry, \"assert_json_field_gte\")) {\n return undefined;\n }\n const value = entry.assert_json_field_gte;\n if (value === undefined) {\n return undefined;\n }\n if (!isPlainObject(value)) {\n throw fail('field \"assert_json_field_gte\" must be a JSON object mapping field paths to numeric minimums');\n }\n const values: Record<string, number> = {};\n for (const [key, entryValue] of Object.entries(value)) {\n if (key.trim().length === 0) {\n throw fail('field \"assert_json_field_gte\" keys must be non-empty field paths');\n }\n values[key] = readJsonEntryNumber(entryValue, `assert_json_field_gte.${key}`, fail);\n }\n return Object.keys(values).length > 0 ? values : undefined;\n}\n\nfunction parseLinkedTestJsonEntry(rawEntry: unknown, label: string, optionName: string): LinkedTest {\n const fail = (message: string): PmCliError => new PmCliError(`${optionName} ${label} ${message}`, EXIT_CODE.USAGE);\n if (!isPlainObject(rawEntry)) {\n throw fail(`must be a JSON object with linked-test fields. Allowed keys: ${STRUCTURED_LINKED_TEST_KEYS.join(\", \")}.`);\n }\n const entry = normalizeJsonEntryKeys(rawEntry, fail);\n const commandValue = readJsonEntryString(entry, \"command\", fail);\n const cmdAlias = readJsonEntryString(entry, \"cmd\", fail);\n if (commandValue !== undefined && cmdAlias !== undefined && commandValue !== cmdAlias) {\n throw fail(\"command and cmd must match when both are provided\");\n }\n const command = commandValue ?? cmdAlias;\n if (command === undefined || command.trim().length === 0) {\n throw fail('requires a non-empty \"command\" string');\n }\n const pathValue = readJsonEntryString(entry, \"path\", fail);\n const pmContextModeValue = readJsonEntryString(entry, \"pm_context_mode\", fail);\n if (pmContextModeValue !== undefined && !(LINKED_TEST_PM_CONTEXT_MODE_VALUES as readonly string[]).includes(pmContextModeValue)) {\n throw fail(`field \"pm_context_mode\" must be one of: ${LINKED_TEST_PM_CONTEXT_MODE_VALUES.join(\", \")}`);\n }\n const noteValue = readJsonEntryString(entry, \"note\", fail);\n return {\n command,\n path: pathValue !== undefined && pathValue.length > 0 ? pathValue : undefined,\n scope: readJsonEntryScope(entry, fail),\n timeout_seconds: readJsonEntryTimeoutSeconds(entry, fail),\n pm_context_mode: pmContextModeValue as LinkedTest[\"pm_context_mode\"],\n env_set: readJsonEntryEnvSet(entry, fail),\n env_clear: readJsonEntryEnvClear(entry, fail),\n shared_host_safe: readJsonEntryBoolean(entry, \"shared_host_safe\", fail),\n assert_stdout_contains: readJsonEntryStringList(entry, \"assert_stdout_contains\", fail),\n assert_stdout_regex: readJsonEntryRegexList(entry, \"assert_stdout_regex\", fail),\n assert_stderr_contains: readJsonEntryStringList(entry, \"assert_stderr_contains\", fail),\n assert_stderr_regex: readJsonEntryRegexList(entry, \"assert_stderr_regex\", fail),\n assert_stdout_min_lines: readJsonEntryMinLines(entry, fail),\n assert_json_field_equals: readJsonEntryEqualsMap(entry, fail),\n assert_json_field_gte: readJsonEntryGteMap(entry, fail),\n note: noteValue !== undefined && noteValue.trim().length > 0 ? noteValue.trim() : undefined,\n };\n}\n\n/**\n * Implements parse linked test json entries for the public runtime surface of this module.\n */\nexport function parseLinkedTestJsonEntries(raw: string, optionName: string): LinkedTest[] {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n `${optionName} requires a JSON object or array of objects describing linked-test entries`,\n EXIT_CODE.USAGE,\n );\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(trimmed) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n /* c8 ignore next -- JSON.parse only throws SyntaxError (an Error); String(error) fallback is defensive. */\n `${optionName} value is not valid JSON: ${error instanceof Error ? error.message : String(error)}. Provide a JSON object or array of objects, e.g. '{\"command\":\"node scripts/check.js --flag value, with commas\",\"timeout_seconds\":120}'.`,\n EXIT_CODE.USAGE,\n );\n }\n const entries = Array.isArray(parsed) ? parsed : [parsed];\n if (entries.length === 0) {\n throw new PmCliError(`${optionName} array must include at least one linked-test entry object`, EXIT_CODE.USAGE);\n }\n return entries.map((entry, index) =>\n parseLinkedTestJsonEntry(entry, entries.length > 1 ? `entry ${index + 1}` : \"entry\", optionName),\n );\n}\n\nexport const _testOnlyLinkedTestParsers = {\n parseLinkedTestJsonEntry,\n};\n","/**\n * @module cli/commands/shared-unset-fields\n *\n * Single-sources unset-field metadata shared by create and update command handlers.\n */\nimport type { RuntimeFieldCommand, RuntimeFieldRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { isLegacyNoneToken } from \"./legacy-none-tokens.js\";\n\n/**\n * Describes one command option that can be removed from item front matter through `--unset`.\n */\nexport interface CommandUnsetFieldDefinition {\n canonical: string;\n aliases: readonly string[];\n optionKey: string;\n frontMatterKey: string;\n}\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"tags\", aliases: [\"tags\"], optionKey: \"tags\", frontMatterKey: \"tags\" },\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"deadline\", aliases: [\"deadline\"], optionKey: \"deadline\", frontMatterKey: \"deadline\" },\n {\n canonical: \"estimate\",\n aliases: [\"estimate\", \"estimated_minutes\", \"estimated-minutes\"],\n optionKey: \"estimatedMinutes\",\n frontMatterKey: \"estimated_minutes\",\n },\n {\n canonical: \"acceptance-criteria\",\n aliases: [\"acceptance_criteria\", \"acceptance-criteria\", \"ac\"],\n optionKey: \"acceptanceCriteria\",\n frontMatterKey: \"acceptance_criteria\",\n },\n {\n canonical: \"definition-of-ready\",\n aliases: [\"definition_of_ready\", \"definition-of-ready\"],\n optionKey: \"definitionOfReady\",\n frontMatterKey: \"definition_of_ready\",\n },\n { canonical: \"order\", aliases: [\"order\", \"rank\"], optionKey: \"order\", frontMatterKey: \"order\" },\n { canonical: \"goal\", aliases: [\"goal\"], optionKey: \"goal\", frontMatterKey: \"goal\" },\n { canonical: \"objective\", aliases: [\"objective\"], optionKey: \"objective\", frontMatterKey: \"objective\" },\n { canonical: \"value\", aliases: [\"value\"], optionKey: \"value\", frontMatterKey: \"value\" },\n { canonical: \"impact\", aliases: [\"impact\"], optionKey: \"impact\", frontMatterKey: \"impact\" },\n { canonical: \"outcome\", aliases: [\"outcome\"], optionKey: \"outcome\", frontMatterKey: \"outcome\" },\n { canonical: \"why-now\", aliases: [\"why_now\", \"why-now\"], optionKey: \"whyNow\", frontMatterKey: \"why_now\" },\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON,\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR,\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"assignee\", aliases: [\"assignee\"], optionKey: \"assignee\", frontMatterKey: \"assignee\" },\n { canonical: \"parent\", aliases: [\"parent\"], optionKey: \"parent\", frontMatterKey: \"parent\" },\n { canonical: \"reviewer\", aliases: [\"reviewer\"], optionKey: \"reviewer\", frontMatterKey: \"reviewer\" },\n { canonical: \"risk\", aliases: [\"risk\"], optionKey: \"risk\", frontMatterKey: \"risk\" },\n { canonical: \"confidence\", aliases: [\"confidence\"], optionKey: \"confidence\", frontMatterKey: \"confidence\" },\n { canonical: \"sprint\", aliases: [\"sprint\"], optionKey: \"sprint\", frontMatterKey: \"sprint\" },\n { canonical: \"release\", aliases: [\"release\"], optionKey: \"release\", frontMatterKey: \"release\" },\n {\n canonical: \"blocked-by\",\n aliases: [\"blocked_by\", \"blocked-by\"],\n optionKey: \"blockedBy\",\n frontMatterKey: \"blocked_by\",\n },\n {\n canonical: \"blocked-reason\",\n aliases: [\"blocked_reason\", \"blocked-reason\"],\n optionKey: \"blockedReason\",\n frontMatterKey: \"blocked_reason\",\n },\n {\n canonical: \"unblock-note\",\n aliases: [\"unblock_note\", \"unblock-note\"],\n optionKey: \"unblockNote\",\n frontMatterKey: \"unblock_note\",\n },\n { canonical: \"reporter\", aliases: [\"reporter\"], optionKey: \"reporter\", frontMatterKey: \"reporter\" },\n { canonical: \"severity\", aliases: [\"severity\"], optionKey: \"severity\", frontMatterKey: \"severity\" },\n {\n canonical: \"environment\",\n aliases: [\"environment\"],\n optionKey: \"environment\",\n frontMatterKey: \"environment\",\n },\n {\n canonical: \"repro-steps\",\n aliases: [\"repro_steps\", \"repro-steps\"],\n optionKey: \"reproSteps\",\n frontMatterKey: \"repro_steps\",\n },\n {\n canonical: \"resolution\",\n aliases: [\"resolution\"],\n optionKey: \"resolution\",\n frontMatterKey: \"resolution\",\n },\n {\n canonical: \"expected-result\",\n aliases: [\"expected_result\", \"expected-result\"],\n optionKey: \"expectedResult\",\n frontMatterKey: \"expected_result\",\n },\n {\n canonical: \"actual-result\",\n aliases: [\"actual_result\", \"actual-result\"],\n optionKey: \"actualResult\",\n frontMatterKey: \"actual_result\",\n },\n {\n canonical: \"affected-version\",\n aliases: [\"affected_version\", \"affected-version\"],\n optionKey: \"affectedVersion\",\n frontMatterKey: \"affected_version\",\n },\n {\n canonical: \"fixed-version\",\n aliases: [\"fixed_version\", \"fixed-version\"],\n optionKey: \"fixedVersion\",\n frontMatterKey: \"fixed_version\",\n },\n { canonical: \"component\", aliases: [\"component\"], optionKey: \"component\", frontMatterKey: \"component\" },\n { canonical: \"regression\", aliases: [\"regression\"], optionKey: \"regression\", frontMatterKey: \"regression\" },\n {\n canonical: \"customer-impact\",\n aliases: [\"customer_impact\", \"customer-impact\"],\n optionKey: \"customerImpact\",\n frontMatterKey: \"customer_impact\",\n },\n] as const;\n\n/**\n * Result of matching a runtime schema field against a command `--unset` token.\n */\nexport interface RuntimeUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\n/**\n * Result of parsing command-level `--unset` tokens into metadata and option-key sets.\n */\nexport interface ParsedCommandUnsetTargets {\n frontMatterKeys: Set<string>;\n optionKeys: Set<string>;\n}\n\n/**\n * Resolve one normalized `--unset` token to a front-matter/option pair.\n */\nexport type CommandUnsetTargetResolver = (trimmedToken: string) => RuntimeUnsetFieldDefinition | undefined;\n\n/**\n * Parse and validate common command `--unset` tokens while preserving command-specific field resolution.\n */\nexport function parseCommandUnsetTargets(options: {\n readonly raw: readonly string[] | undefined;\n readonly resolveDefinition: CommandUnsetTargetResolver;\n readonly supportedFields: string;\n}): ParsedCommandUnsetTargets {\n const frontMatterKeys = new Set<string>();\n const optionKeys = new Set<string>();\n if (!options.raw || options.raw.length === 0) {\n return { frontMatterKeys, optionKeys };\n }\n\n for (const entry of options.raw) {\n const trimmed = entry.trim().toLowerCase();\n if (!trimmed) {\n throw new PmCliError(\"--unset values must not be empty\", EXIT_CODE.USAGE);\n }\n if (isLegacyNoneToken(trimmed)) {\n throw new PmCliError(\n '--unset no longer accepts \"none\" or \"null\". Specify concrete field names such as --unset deadline',\n EXIT_CODE.USAGE,\n );\n }\n const definition = options.resolveDefinition(trimmed);\n if (!definition) {\n throw new PmCliError(`Unsupported --unset field \"${entry}\". Supported fields: ${options.supportedFields}`, EXIT_CODE.USAGE);\n }\n frontMatterKeys.add(definition.frontMatterKey);\n optionKeys.add(definition.optionKey);\n }\n\n return { frontMatterKeys, optionKeys };\n}\n\n/**\n * Resolve a runtime-schema field definition from a command `--unset` token.\n */\nexport function resolveRuntimeUnsetFieldDefinition(\n token: string,\n command: RuntimeFieldCommand,\n runtimeFieldRegistry: RuntimeFieldRegistry | undefined,\n): RuntimeUnsetFieldDefinition | undefined {\n const normalizedToken = token.trim().toLowerCase();\n if (!runtimeFieldRegistry) {\n return undefined;\n }\n const definitions = runtimeFieldRegistry.command_to_fields?.get(command) ?? [];\n for (const definition of definitions) {\n if (definition.allow_unset === false) {\n continue;\n }\n const candidates = new Set<string>();\n if (typeof definition.key === \"string\" && definition.key.length > 0) {\n candidates.add(definition.key.toLowerCase());\n }\n if (typeof definition.metadata_key === \"string\" && definition.metadata_key.length > 0) {\n candidates.add(definition.metadata_key.toLowerCase());\n }\n if (typeof definition.cli_flag === \"string\" && definition.cli_flag.length > 0) {\n candidates.add(definition.cli_flag.replaceAll(\"-\", \"_\").toLowerCase());\n candidates.add(definition.cli_flag.toLowerCase());\n }\n if (Array.isArray(definition.cli_aliases)) {\n for (const alias of definition.cli_aliases) {\n if (typeof alias !== \"string\" || alias.length === 0) {\n continue;\n }\n candidates.add(alias.replaceAll(\"-\", \"_\").toLowerCase());\n candidates.add(alias.toLowerCase());\n }\n }\n if (!candidates.has(normalizedToken)) {\n continue;\n }\n return {\n optionKey: definition.key,\n frontMatterKey: definition.metadata_key,\n };\n }\n return undefined;\n}\n","/**\n * @module cli/commands/recurrence-parsers\n *\n * Implements the pm recurrence parsers command surface and its agent-facing runtime behavior.\n */\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport {\n RECURRENCE_FREQUENCY_VALUES,\n RECURRENCE_WEEKDAY_VALUES,\n weekdayOrderIndex,\n} from \"../../types/index.js\";\nimport type { RecurrenceRule } from \"../../types/index.js\";\n\n/**\n * Shared calendar recurrence/event parsing helpers used by the `create` and\n * `update` commands. Extracted verbatim from create.ts and update.ts (pm-why9).\n *\n * `parseEventBoolean`, `parseDelimitedList`, and `ensureEnumValue` were\n * byte-identical between the two commands (update spelled `ensureEnumValue` as\n * `ensureEnum`).\n *\n * `parseRecurrenceRule` was identical apart from the recur_interval/recur_count\n * \"provided\" guard: create used `intervalRaw !== undefined` (an empty\n * `recur_interval=` is parsed and rejected), while update used the truthy\n * `intervalRaw ?` (an empty value is skipped). That distinction is preserved\n * via the `emptyNumericGuard` option so both call sites keep their exact\n * behaviour, including error strings.\n */\n\nexport function parseEventBoolean(value: string, flag: string): boolean {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(`${flag} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\n/**\n * Implements parse delimited list for the public runtime surface of this module.\n */\nexport function parseDelimitedList(raw: string | undefined): string[] {\n if (!raw) {\n return [];\n }\n return raw\n .split(\"|\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n}\n\n/**\n * Implements ensure enum value for the public runtime surface of this module.\n */\nexport function ensureEnumValue<T extends string>(value: string, allowed: readonly T[], label: string): T {\n if (!allowed.includes(value as T)) {\n throw new PmCliError(`Invalid ${label} value \"${value}\". Allowed: ${allowed.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return value as T;\n}\n\n/**\n * `\"defined\"` parses `recur_interval=`/`recur_count=` (empty values), matching\n * the historical `create` behaviour. `\"truthy\"` skips empty values, matching\n * the historical `update` behaviour.\n */\nexport type RecurrenceEmptyNumericGuard = \"defined\" | \"truthy\";\n\n/**\n * Authoritative list of the CSV/markdown recurrence keys this parser reads.\n * Co-located with {@link parseRecurrenceRule} so adding a recurrence field\n * updates the reads AND the strict unknown-key allow-list in one place — the\n * `--event` validator (repeatable-metadata-parsers EVENT_KEYS) spreads this, so\n * a new recur key can never be silently rejected (GH-258). Keep in sync with\n * the `kv.recur_*` reads below.\n */\nexport const RECURRENCE_CSV_KEYS = [\n \"recur_freq\",\n \"recur_interval\",\n \"recur_count\",\n \"recur_until\",\n \"recur_by_weekday\",\n \"recur_by_month_day\",\n \"recur_exdates\",\n] as const;\n\nfunction numericRecurrenceValueProvided(raw: string | undefined, guard: RecurrenceEmptyNumericGuard): boolean {\n return guard === \"defined\" ? raw !== undefined : Boolean(raw);\n}\n\nfunction parsePositiveRecurrenceInteger(raw: string | undefined, label: string, guard: RecurrenceEmptyNumericGuard): number | undefined {\n if (!numericRecurrenceValueProvided(raw, guard)) {\n return undefined;\n }\n const parsed = parseOptionalNumber(raw as string, `event ${label}`);\n if (!Number.isInteger(parsed) || parsed < 1) {\n throw new PmCliError(`--event ${label} must be an integer >= 1`, EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\nfunction parseRecurrenceUntil(untilRaw: string | undefined, startAt: string, nowValue: Date): string | undefined {\n const until = untilRaw ? resolveIsoOrRelative(untilRaw, nowValue, \"event.recur_until\") : undefined;\n if (until && until < startAt) {\n throw new PmCliError(\"--event recur_until must be at or after start\", EXIT_CODE.USAGE);\n }\n return until;\n}\n\nfunction parseRecurrenceWeekdays(raw: string | undefined): Array<(typeof RECURRENCE_WEEKDAY_VALUES)[number]> {\n return Array.from(\n new Set(\n parseDelimitedList(raw).map((value) => ensureEnumValue(value.toLowerCase(), RECURRENCE_WEEKDAY_VALUES, \"event weekday\")),\n ),\n ).sort((left, right) => weekdayOrderIndex(left) - weekdayOrderIndex(right));\n}\n\nfunction parseRecurrenceMonthDays(raw: string | undefined): number[] {\n return Array.from(\n new Set(\n parseDelimitedList(raw).map((value) => {\n const day = parseOptionalNumber(value, \"event recur_by_month_day\");\n if (!Number.isInteger(day) || day < 1 || day > 31) {\n throw new PmCliError(\"--event recur_by_month_day values must be integers 1..31\", EXIT_CODE.USAGE);\n }\n return day;\n }),\n ),\n ).sort((left, right) => left - right);\n}\n\nfunction parseRecurrenceExdates(raw: string | undefined, nowValue: Date): string[] {\n return Array.from(\n new Set(parseDelimitedList(raw).map((value) => resolveIsoOrRelative(value, nowValue, \"event.recur_exdates\"))),\n ).sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Implements parse recurrence rule for the public runtime surface of this module.\n */\nexport function parseRecurrenceRule(\n kv: Record<string, string>,\n startAt: string,\n nowValue: Date,\n emptyNumericGuard: RecurrenceEmptyNumericGuard,\n): RecurrenceRule | undefined {\n const freqRaw = kv.recur_freq?.trim();\n const intervalRaw = kv.recur_interval?.trim();\n const countRaw = kv.recur_count?.trim();\n const untilRaw = kv.recur_until?.trim();\n const byWeekdayRaw = kv.recur_by_weekday?.trim();\n const byMonthDayRaw = kv.recur_by_month_day?.trim();\n const exdatesRaw = kv.recur_exdates?.trim();\n\n const recurrenceInputsProvided = [freqRaw, intervalRaw, countRaw, untilRaw, byWeekdayRaw, byMonthDayRaw, exdatesRaw].some(\n (value) => value !== undefined,\n );\n if (!recurrenceInputsProvided) {\n return undefined;\n }\n if (!freqRaw) {\n throw new PmCliError(\"--event recurrence fields require recur_freq=<daily|weekly|monthly|yearly>\", EXIT_CODE.USAGE);\n }\n\n const freq = ensureEnumValue(freqRaw.toLowerCase(), RECURRENCE_FREQUENCY_VALUES, \"event recurrence frequency\");\n const interval = parsePositiveRecurrenceInteger(intervalRaw, \"recur_interval\", emptyNumericGuard);\n const count = parsePositiveRecurrenceInteger(countRaw, \"recur_count\", emptyNumericGuard);\n const until = parseRecurrenceUntil(untilRaw, startAt, nowValue);\n const byWeekday = parseRecurrenceWeekdays(byWeekdayRaw);\n const byMonthDay = parseRecurrenceMonthDays(byMonthDayRaw);\n const exdates = parseRecurrenceExdates(exdatesRaw, nowValue);\n\n return {\n freq,\n interval,\n count,\n until,\n by_weekday: byWeekday.length > 0 ? byWeekday : undefined,\n by_month_day: byMonthDay.length > 0 ? byMonthDay : undefined,\n exdates: exdates.length > 0 ? exdates : undefined,\n };\n}\n","/**\n * @module cli/commands/event-validation-messages\n *\n * Implements the pm event validation messages command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\n\nexport const EVENT_END_AFTER_START_MESSAGE =\n \"--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.\";\n\nexport const EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE =\n \"--event end and duration are mutually exclusive; provide only one (use duration=<relative> like duration=2h, duration=30min, or duration=PT30M, or set an explicit end).\";\n\nconst MINUTE_DURATION = /^([+-]?)(\\d+)(min|mins|minute|minutes)$/i;\nconst ISO_8601_TIME_DURATION = /^([+-]?)[Pp][Tt](?:(\\d+)[Hh])?(?:(\\d+)[Mm])?(?:(\\d+)[Ss])?$/;\nconst MILLIS_PER_SECOND = 1000;\nconst MILLIS_PER_MINUTE = 60 * MILLIS_PER_SECOND;\nconst MILLIS_PER_HOUR = 60 * MILLIS_PER_MINUTE;\n\nfunction toIsoTimestampOrThrow(timestampMs: number, durationRaw: string): string {\n const resolved = new Date(timestampMs);\n if (!Number.isFinite(resolved.getTime())) {\n throw new PmCliError(\n `Invalid event.duration value \"${durationRaw}\". Duration is out of supported timestamp range.`,\n EXIT_CODE.USAGE,\n );\n }\n return resolved.toISOString();\n}\n\nfunction resolveDurationAgainstStart(startAt: string, durationRaw: string): string {\n const start = new Date(startAt);\n const trimmedDuration = durationRaw.trim();\n\n const minuteDuration = MINUTE_DURATION.exec(trimmedDuration);\n if (minuteDuration) {\n const sign = minuteDuration[1] === \"-\" ? -1 : 1;\n const amount = Number.parseInt(minuteDuration[2], 10) * sign;\n return toIsoTimestampOrThrow(start.getTime() + amount * MILLIS_PER_MINUTE, trimmedDuration);\n }\n\n const isoDuration = ISO_8601_TIME_DURATION.exec(trimmedDuration);\n if (isoDuration) {\n const [, signToken, hoursToken, minutesToken, secondsToken] = isoDuration;\n const hasComponent = hoursToken || minutesToken || secondsToken;\n if (hasComponent) {\n const sign = signToken === \"-\" ? -1 : 1;\n const hours = Number.parseInt(hoursToken ?? \"0\", 10);\n const minutes = Number.parseInt(minutesToken ?? \"0\", 10);\n const seconds = Number.parseInt(secondsToken ?? \"0\", 10);\n const totalMillis = hours * MILLIS_PER_HOUR + minutes * MILLIS_PER_MINUTE + seconds * MILLIS_PER_SECOND;\n return toIsoTimestampOrThrow(start.getTime() + sign * totalMillis, trimmedDuration);\n }\n }\n\n const normalizedDuration =\n trimmedDuration.startsWith(\"+\") || trimmedDuration.startsWith(\"-\") ? trimmedDuration : `+${trimmedDuration}`;\n return resolveIsoOrRelative(normalizedDuration, start, \"event.duration\");\n}\n\n// Shared by `pm create` (parseEvents) and `pm update` (parseEventEntries) so the\n// two parallel parse sites cannot drift. Resolves the event end timestamp from\n// either an explicit `end` or a relative `duration` (mutually exclusive).\n// Equal start/end (including a zero-length duration) collapses to an instant\n// event (end dropped); an end earlier than start is rejected.\n/**\n * Implements resolve event end at for the public runtime surface of this module.\n */\nexport function resolveEventEndAt(\n startAt: string,\n endRaw: string | undefined,\n durationRaw: string | undefined,\n referenceDate: Date,\n): string | undefined {\n if (endRaw && durationRaw) {\n throw new PmCliError(EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE, EXIT_CODE.USAGE);\n }\n if (durationRaw) {\n // Resolve duration with startAt as the reference so duration=2h means startAt + 2h.\n // Keep global relative token semantics unchanged (`m` stays months) while\n // allowing explicit sub-hour forms (`30min`, `PT30M`) for event durations.\n const endAt = resolveDurationAgainstStart(startAt, durationRaw);\n if (endAt < startAt) {\n throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);\n }\n // A zero-length duration is an instant event, mirroring explicit equal start/end.\n if (endAt === startAt) {\n return undefined;\n }\n return endAt;\n }\n if (!endRaw) {\n return undefined;\n }\n const endAt = resolveIsoOrRelative(endRaw, referenceDate, \"event.end\");\n if (endAt < startAt) {\n throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);\n }\n // Equal start/end collapses to an instant event (drop end) instead of being rejected.\n if (endAt === startAt) {\n return undefined;\n }\n return endAt;\n}\n","/**\n * @module cli/commands/repeatable-metadata-parsers\n *\n * Implements the pm repeatable metadata parsers command surface and its agent-facing runtime behavior.\n */\nimport { assertNoUnknownCsvKeys, parseCsvKv } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport type { CalendarEvent, Reminder } from \"../../types/index.js\";\nimport { resolveEventEndAt } from \"./event-validation-messages.js\";\nimport {\n parseEventBoolean,\n parseRecurrenceRule,\n RECURRENCE_CSV_KEYS,\n type RecurrenceEmptyNumericGuard,\n} from \"./recurrence-parsers.js\";\n\n/** Allowed CSV/markdown keys for `--reminder` (GH-258). */\nconst REMINDER_KEYS = [\"at\", \"date\", \"text\", \"title\"] as const;\n/**\n * Allowed CSV/markdown keys for `--event` (GH-258). Recurrence keys are spread\n * from the authoritative RECURRENCE_CSV_KEYS next to parseRecurrenceRule so the\n * allow-list can never drift from what the recurrence parser actually reads.\n */\nconst EVENT_KEYS = [\n \"start\",\n \"date\",\n \"end\",\n \"duration\",\n \"title\",\n \"description\",\n \"location\",\n \"timezone\",\n \"all_day\",\n ...RECURRENCE_CSV_KEYS,\n] as const;\n/** Allowed CSV/markdown keys for the `--type-option` structured form (GH-258). */\nconst TYPE_OPTION_KEYS = [\"key\", \"value\"] as const;\n\ntype EmptyValueGuard = \"defined\" | \"truthy\";\ntype ReminderValueMode = \"raw\" | \"trimmed\";\n\ninterface ParseReminderEntriesOptions {\n valueMode: ReminderValueMode;\n}\n\ninterface ParseEventEntriesOptions {\n allDayEmptyGuard: EmptyValueGuard;\n recurrenceEmptyNumericGuard: RecurrenceEmptyNumericGuard;\n}\n\nfunction optionalString(value: string | undefined, mode: ReminderValueMode): string | undefined {\n return mode === \"trimmed\" ? value?.trim() : value;\n}\n\nfunction isProvided(value: string | undefined, guard: EmptyValueGuard): boolean {\n return guard === \"defined\" ? value !== undefined : Boolean(value);\n}\n\n/**\n * Implements parse reminder entries for the public runtime surface of this module.\n */\nexport function parseReminderEntries(raw: string[], nowValue: Date, options: ParseReminderEntriesOptions): Reminder[] {\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--reminder\");\n assertNoUnknownCsvKeys(kv, \"--reminder\", REMINDER_KEYS);\n const atRaw = optionalString(kv.at ?? kv.date, options.valueMode);\n const textRaw = optionalString(kv.text ?? kv.title, options.valueMode);\n if (!atRaw || !textRaw) {\n throw new PmCliError(\"--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>\", EXIT_CODE.USAGE);\n }\n const text = textRaw.trim();\n if (!text) {\n throw new PmCliError(\"--reminder text must not be empty\", EXIT_CODE.USAGE);\n }\n return {\n at: resolveIsoOrRelative(atRaw, nowValue, \"reminder.at\"),\n text,\n };\n });\n}\n\n/**\n * Implements parse event entries for the public runtime surface of this module.\n */\nexport function parseEventEntries(raw: string[], nowValue: Date, options: ParseEventEntriesOptions): CalendarEvent[] {\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--event\");\n assertNoUnknownCsvKeys(kv, \"--event\", EVENT_KEYS);\n const startRaw = (kv.start ?? kv.date)?.trim();\n if (!startRaw) {\n throw new PmCliError(\"--event requires start=<iso|relative> or date=<iso|relative>\", EXIT_CODE.USAGE);\n }\n const startAt = resolveIsoOrRelative(startRaw, nowValue, \"event.start\");\n const endRaw = kv.end?.trim();\n const durationRaw = kv.duration?.trim();\n const endAt = resolveEventEndAt(startAt, endRaw, durationRaw, nowValue);\n\n const titleRaw = kv.title;\n const descriptionRaw = kv.description;\n const locationRaw = kv.location;\n const timezoneRaw = kv.timezone;\n\n const title = titleRaw?.trim();\n const description = descriptionRaw?.trim();\n const location = locationRaw?.trim();\n const timezone = timezoneRaw?.trim();\n const optionalTextFields = [\n [\"title\", titleRaw, title],\n [\"description\", descriptionRaw, description],\n [\"location\", locationRaw, location],\n [\"timezone\", timezoneRaw, timezone],\n ] as const;\n for (const [fieldLabel, rawValue, trimmedValue] of optionalTextFields) {\n if (rawValue !== undefined && !trimmedValue) {\n throw new PmCliError(`--event ${fieldLabel} must not be empty`, EXIT_CODE.USAGE);\n }\n }\n\n const allDayRaw = kv.all_day?.trim();\n const recurrence = parseRecurrenceRule(kv, startAt, nowValue, options.recurrenceEmptyNumericGuard);\n const allDay = isProvided(allDayRaw, options.allDayEmptyGuard)\n ? parseEventBoolean(allDayRaw as string, \"--event all_day\")\n : undefined;\n\n return {\n start_at: startAt,\n end_at: endAt,\n title,\n description,\n location,\n all_day: allDay,\n timezone,\n recurrence,\n };\n });\n}\n\n/**\n * Implements parse type option entries for the public runtime surface of this module.\n */\nexport function parseTypeOptionEntries(raw: string[]): Record<string, string> {\n const values: Record<string, string> = {};\n for (const entry of raw) {\n const trimmedEntry = entry.trim();\n if (trimmedEntry.length === 0) {\n throw new PmCliError(\"--type-option values must not be empty\", EXIT_CODE.USAGE);\n }\n let key: string | undefined;\n let value: string | undefined;\n const prefersStructuredKv =\n trimmedEntry.includes(\",\") ||\n trimmedEntry.includes(\"\\n\") ||\n trimmedEntry.startsWith(\"```\") ||\n /^(?:[-*+]\\s+)?(?:key|value)\\s*[:=]/i.test(trimmedEntry);\n if (prefersStructuredKv) {\n const kv = parseCsvKv(trimmedEntry, \"--type-option\");\n assertNoUnknownCsvKeys(kv, \"--type-option\", TYPE_OPTION_KEYS);\n key = kv.key?.trim();\n value = kv.value?.trim();\n } else {\n const equalsIndex = trimmedEntry.indexOf(\"=\");\n const colonIndex = trimmedEntry.indexOf(\":\");\n let separatorIndex = equalsIndex;\n if (equalsIndex <= 0 && colonIndex > 0) {\n separatorIndex = colonIndex;\n }\n if (separatorIndex <= 0 || separatorIndex === trimmedEntry.length - 1) {\n throw new PmCliError(\n \"--type-option requires key=value or key=<name>,value=<value> entries\",\n EXIT_CODE.USAGE,\n );\n }\n key = trimmedEntry.slice(0, separatorIndex).trim();\n value = trimmedEntry.slice(separatorIndex + 1).trim();\n }\n if (!key || !value) {\n throw new PmCliError(\"--type-option requires key and value\", EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n return Object.fromEntries(Object.entries(values).sort((left, right) => left[0].localeCompare(right[0])));\n}\n","/**\n * @module cli/commands/create\n *\n * Implements the pm create command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId, normalizeItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport {\n assertParentReferenceIsNotSelf,\n isPlaceholderReferenceToken,\n normalizeParentReferenceValue,\n validateMissingParentReference,\n} from \"../../core/item/parent-reference-policy.js\";\nimport { validateSprintOrReleaseValue } from \"../../core/item/sprint-release-format.js\";\nimport {\n assertNoUnknownCsvKeys,\n createStdinTokenResolver,\n looksLikeGenericKeyValueEntry,\n mergeAdditiveTags,\n parseCsvKv,\n parseOptionalNumber,\n parseTags,\n} from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { getFocusedItem } from \"../../core/session/session-state.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { CREATE_DIRECT_CLOSE_REASON_DEFAULT } from \"../../core/shared/constants.js\";\nimport {\n canonicalizeCommandOptionKey,\n commandOptionFlagLabel,\n type ItemTypeRegistry,\n resolveItemTypeRegistry,\n resolveCommandOptionPolicyState,\n type ResolvedItemTypeDefinition,\n resolveTypeDefinition,\n resolveTypeName,\n validateTypeOptions,\n} from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { printError } from \"../../core/output/output.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport { resolveTypeSynonym } from \"../../core/item/type-synonyms.js\";\nimport { collectRuntimeCreateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport {\n type RuntimeFieldRegistry,\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveCommandHandler,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport {\n collectRegisteredItemFieldNames,\n applyRegisteredItemFieldDefaultsAndValidation,\n parseRegisteredItemFieldAssignments,\n} from \"../../core/extensions/item-fields.js\";\nimport { locateItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport {\n normalizeRiskInput,\n normalizeSeverityInput,\n parseConfidenceInput,\n parseRegressionInput,\n} from \"./metadata-normalizers.js\";\nimport {\n applyLegacyNoneCollectionNormalizers,\n assertNoLegacyNoneToken,\n assertNoLegacyNoneTokens,\n isLegacyNoneToken,\n type LegacyNoneCollectionNormalizer,\n} from \"./legacy-none-tokens.js\";\nimport {\n suggestNextLifecycleTransition,\n type LifecycleTransitionSuggestion,\n} from \"./lifecycle-transitions.js\";\nimport {\n parseLinkedTestAssertionEqualsMap,\n parseLinkedTestAssertionGteMap,\n parseLinkedTestBoolean,\n parseLinkedTestContextMode,\n parseLinkedTestEnvClear,\n parseLinkedTestEnvSet,\n parseLinkedTestMinLines,\n parseLinkedTestRegexList,\n parseLinkedTestStringList,\n} from \"./linked-test-parsers.js\";\nimport { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry } from \"./linked-test-entry.js\";\nimport {\n COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,\n parseCommandUnsetTargets,\n resolveRuntimeUnsetFieldDefinition,\n type CommandUnsetFieldDefinition,\n} from \"./shared-unset-fields.js\";\nimport type {\n MutationMetadataCommandOptions,\n SharedLinkedResourceClearOptions,\n SharedLinkedResourceOptions,\n} from \"./mutation-command-options.js\";\nimport { ensureEnumValue } from \"./recurrence-parsers.js\";\nimport {\n parseEventEntries,\n parseReminderEntries,\n parseTypeOptionEntries,\n} from \"./repeatable-metadata-parsers.js\";\nimport type {\n CalendarEvent,\n Comment,\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n Reminder,\n} from \"../../types/index.js\";\nimport {\n DEPENDENCY_KIND_VALUES,\n ISSUE_SEVERITY_VALUES,\n RISK_VALUES,\n SCOPE_VALUES,\n} from \"../../types/index.js\";\n\n/**\n * Documents the create command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CreateCommandOptions\n extends MutationMetadataCommandOptions,\n SharedLinkedResourceOptions,\n SharedLinkedResourceClearOptions {\n title?: string;\n description?: string;\n type?: string;\n status?: string;\n priority?: string;\n tags?: string;\n addTags?: string[];\n body?: string;\n allowMissingParent?: boolean;\n template?: string;\n createMode?: string;\n schedulePreset?: string;\n [key: string]: unknown;\n}\n\n/**\n * Documents the create result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CreateResult {\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n // GH-161: set to \"focus\" when the item's parent was inherited from the\n // session focused item (`pm focus <id>`) rather than an explicit --parent.\n parent_source?: \"focus\";\n // GH-216: optional non-binding nudge toward the next lifecycle transition\n // (e.g. `pm start-task <id>`), present only when a richer transition exists.\n next_transition?: LifecycleTransitionSuggestion;\n}\n\ntype CreateMode = \"strict\" | \"progressive\";\nconst CREATE_MODE_VALUES = [\"strict\", \"progressive\"] as const;\ntype ScheduleCreatePreset = \"lightweight\";\nconst SCHEDULE_CREATE_PRESET_VALUES = [\"lightweight\"] as const;\nconst SCHEDULE_CREATE_PRESET_TYPES = new Set([\"Reminder\", \"Meeting\", \"Event\"]);\nconst LOG_SEED_ALLOWED_KEYS = new Set([\"author\", \"created_at\", \"text\"]);\n\ninterface CreateUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\nconst CREATE_UNSET_FIELD_DEFINITIONS: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,\n { canonical: \"author\", aliases: [\"author\"], optionKey: \"author\", frontMatterKey: \"author\" },\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n];\n\nconst CREATE_UNSET_ALIAS_MAP: Map<string, CreateUnsetFieldDefinition> = (() => {\n const map = new Map<string, CreateUnsetFieldDefinition>();\n for (const definition of CREATE_UNSET_FIELD_DEFINITIONS) {\n for (const alias of definition.aliases) {\n map.set(alias, {\n optionKey: definition.optionKey,\n frontMatterKey: definition.frontMatterKey,\n });\n }\n }\n return map;\n})();\n\nconst CREATE_OPTION_KEY_TO_UNSET_CANONICAL = new Map<string, string>(\n CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => [definition.optionKey, definition.canonical]),\n);\n\nconst CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS = CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => definition.canonical)\n .sort((left, right) => left.localeCompare(right))\n .join(\", \");\n\nfunction buildInvalidLogSeedKeysMessage(\n optionName: \"--comment\" | \"--note\" | \"--learning\",\n unsupportedKeys: string[],\n): string {\n const sortedUnsupported = [...unsupportedKeys].sort((left, right) => left.localeCompare(right));\n const keyLabel = sortedUnsupported.length === 1 ? \"key\" : \"keys\";\n return (\n `${optionName} supports only author, created_at, and text seed fields. ` +\n `Found unsupported ${keyLabel}: ${sortedUnsupported.join(\", \")}. ` +\n `If text contains comma-separated key:value-like fragments, wrap text in quotes ` +\n '(for example text=\"first,scope:project\"), use markdown-style key/value input, ' +\n `or pass ${optionName} - with piped stdin.`\n );\n}\n\nfunction parseStatusValue(value: string, statusRegistry: RuntimeStatusRegistry): ItemStatus {\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(`Invalid status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\n/**\n * Resolve the create-time status when `--status` is omitted: a config-driven\n * per-type `default_status` (from `pm schema add-type --default-status`) wins,\n * then the workflow open status. An unknown configured value degrades to the\n * open status rather than blocking the create (never-block-the-agent).\n */\nfunction resolveCreateDefaultStatus(\n typeDefinition: ResolvedItemTypeDefinition,\n statusRegistry: RuntimeStatusRegistry,\n): ItemStatus {\n const configured = typeDefinition.default_status;\n if (configured !== undefined) {\n const normalized = normalizeStatusInput(configured, statusRegistry);\n if (normalized) {\n return normalized;\n }\n }\n return statusRegistry.open_status;\n}\n\nfunction parseCreatedAt(value: string | undefined, currentIso: string): string {\n if (!value || value.trim() === \"\" || value.trim().toLowerCase() === \"now\") {\n return currentIso;\n }\n const parsed = Date.parse(value);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`Invalid created_at timestamp \"${value}\"`, EXIT_CODE.USAGE);\n }\n return new Date(parsed).toISOString();\n}\n\nconst CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS: ReadonlyArray<LegacyNoneCollectionNormalizer<CreateCommandOptions>> = [\n { optionKey: \"dep\", clearFlagKey: \"clearDeps\", valueFlag: \"--dep\", clearFlag: \"--clear-deps\" },\n { optionKey: \"comment\", clearFlagKey: \"clearComments\", valueFlag: \"--comment\", clearFlag: \"--clear-comments\" },\n { optionKey: \"note\", clearFlagKey: \"clearNotes\", valueFlag: \"--note\", clearFlag: \"--clear-notes\" },\n { optionKey: \"learning\", clearFlagKey: \"clearLearnings\", valueFlag: \"--learning\", clearFlag: \"--clear-learnings\" },\n { optionKey: \"file\", clearFlagKey: \"clearFiles\", valueFlag: \"--file\", clearFlag: \"--clear-files\" },\n { optionKey: \"test\", clearFlagKey: \"clearTests\", valueFlag: \"--test\", clearFlag: \"--clear-tests\" },\n { optionKey: \"doc\", clearFlagKey: \"clearDocs\", valueFlag: \"--doc\", clearFlag: \"--clear-docs\" },\n { optionKey: \"reminder\", clearFlagKey: \"clearReminders\", valueFlag: \"--reminder\", clearFlag: \"--clear-reminders\" },\n { optionKey: \"event\", clearFlagKey: \"clearEvents\", valueFlag: \"--event\", clearFlag: \"--clear-events\" },\n { optionKey: \"typeOption\", clearFlagKey: \"clearTypeOptions\", valueFlag: \"--type-option\", clearFlag: \"--clear-type-options\" },\n];\n\nfunction normalizeLegacyNoneCreateOptions(options: CreateCommandOptions): CreateCommandOptions {\n const normalized: CreateCommandOptions = {\n ...options,\n unset: options.unset ? [...options.unset] : undefined,\n };\n /* c8 ignore start -- unset dedupe helper branch permutations are covered by legacy option compatibility suites. */\n const appendUnsetTarget = (value: string): void => {\n const current = normalized.unset ? [...normalized.unset] : [];\n if (!current.includes(value)) {\n current.push(value);\n }\n normalized.unset = current;\n };\n /* c8 ignore stop */\n\n if (isLegacyNoneToken(normalized.template)) {\n normalized.template = undefined;\n }\n\n const scalarOptionKeys = new Set<string>([...CREATE_OPTION_KEY_TO_UNSET_CANONICAL.keys(), \"rank\"]);\n for (const optionKey of scalarOptionKeys) {\n const candidate = normalized[optionKey];\n if (typeof candidate !== \"string\" || !isLegacyNoneToken(candidate)) {\n continue;\n }\n /* c8 ignore start -- rank alias canonicalization is exercised in legacy-option compatibility tests. */\n const canonicalUnset = optionKey === \"rank\" ? \"order\" : (CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey);\n appendUnsetTarget(canonicalUnset);\n normalized[optionKey] = undefined;\n /* c8 ignore stop */\n }\n\n return applyLegacyNoneCollectionNormalizers(normalized, CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS);\n}\n\nfunction parseOptionalString(value: string | undefined): string | undefined {\n if (value === undefined) return undefined;\n return value;\n}\n\nfunction parseCreateUnsetTargets(\n raw: string[] | undefined,\n runtimeFieldRegistry?: RuntimeFieldRegistry,\n): { frontMatterKeys: Set<string>; optionKeys: Set<string> } {\n return parseCommandUnsetTargets({\n raw,\n supportedFields: CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS,\n resolveDefinition: (trimmed) =>\n CREATE_UNSET_ALIAS_MAP.get(trimmed) ?? resolveRuntimeUnsetFieldDefinition(trimmed, \"create\", runtimeFieldRegistry),\n });\n}\n\n/** Allowed CSV/markdown keys for the create `--dep` seed (GH-258). */\nconst DEP_SEED_KEYS = [\"id\", \"kind\", \"type\", \"author\", \"created_at\"] as const;\n/** Allowed CSV/markdown keys for create `--file`/`--doc` seeds (GH-258). */\nconst LINKED_ARTIFACT_SEED_KEYS = [\"path\", \"scope\", \"note\"] as const;\n\nfunction parseDependencies(\n raw: string[] | undefined,\n nowValue: string,\n prefix: string,\n): { values: Dependency[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--dep\", \"Use --clear-deps to clear dependencies.\");\n const values: Dependency[] = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, DEP_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--dep\") : { id: trimmedEntry, kind: \"related\" };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--dep\", DEP_SEED_KEYS);\n }\n const id = parseOptionalString(kv.id);\n const kind = normalizeDependencyKindInput(parseOptionalString(kv.kind ?? kv.type));\n if (!id || !kind) {\n throw new PmCliError(\"--dep requires id and kind, or a bare item id to create a related dependency\", EXIT_CODE.USAGE);\n }\n if (id.trim().toLowerCase() === \"undefined\") {\n throw new PmCliError(\n `--dep id must not use placeholder token \"${id}\". Use --clear-deps to clear dependencies.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n id: normalizeItemId(id, prefix),\n kind: ensureEnumValue(kind, DEPENDENCY_KIND_VALUES, \"dependency kind\"),\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author),\n };\n });\n return { values, explicitEmpty: false };\n}\n\nconst DEPENDENCY_KIND_INPUT_ALIASES: Readonly<Record<string, string>> = {\n \"blocked-by\": \"blocked_by\",\n depends_on: \"blocked_by\",\n \"depends-on\": \"blocked_by\",\n};\n\nfunction normalizeDependencyKindInput(raw: string | undefined): string | undefined {\n if (typeof raw !== \"string\") {\n return raw;\n }\n const alias = DEPENDENCY_KIND_INPUT_ALIASES[raw.toLowerCase()];\n return alias ?? raw;\n}\n\nfunction looksLikeStructuredEntry(raw: string, keys: readonly string[]): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n const keyPattern = keys.map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\");\n if (new RegExp(`^(?:[-*+]\\\\s+)?(?:${keyPattern})\\\\s*[:=]`, \"i\").test(raw)) {\n return true;\n }\n // A first-key typo (e.g. `bogus=v,id=pm-2`) must still be parsed so the unknown\n // key is rejected rather than swallowed as a bare id/path value (GH-258).\n return looksLikeGenericKeyValueEntry(raw);\n}\n\n/**\n * Implements parse log seed for the public runtime surface of this module.\n */\nexport function parseLogSeed(\n optionName: \"--comment\" | \"--note\" | \"--learning\",\n raw: string[] | undefined,\n nowValue: string,\n fallbackAuthor: string,\n): { values: LogNote[] | Comment[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n const clearHint =\n optionName === \"--comment\"\n ? \"Use --clear-comments to clear comments.\"\n : optionName === \"--note\"\n ? \"Use --clear-notes to clear notes.\"\n : \"Use --clear-learnings to clear learnings.\";\n assertNoLegacyNoneTokens(raw, optionName, clearHint);\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const buildPlainTextCommentSeed = (): Comment => {\n /* c8 ignore start -- empty plaintext fallback is guarded by option parsing before create execution. */\n if (trimmedEntry.length === 0) {\n throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);\n }\n /* c8 ignore stop */\n return {\n created_at: nowValue,\n author: fallbackAuthor,\n text: trimmedEntry,\n };\n };\n let kv: Record<string, string>;\n try {\n kv = parseCsvKv(entry, optionName);\n } catch (error: unknown) {\n /* c8 ignore start -- optionName is type-narrowed to --comment/--note/--learning, so this branch is always true and the rethrow is unreachable. */\n if (optionName === \"--comment\" || optionName === \"--note\" || optionName === \"--learning\") {\n return buildPlainTextCommentSeed();\n }\n throw error;\n /* c8 ignore stop */\n }\n const unsupportedKeys = Object.keys(kv).filter((key) => !LOG_SEED_ALLOWED_KEYS.has(key));\n if (unsupportedKeys.length > 0) {\n return {\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author) ?? fallbackAuthor,\n text: trimmedEntry,\n };\n }\n const text = kv.text ?? \"\";\n if (text === \"\") {\n throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);\n }\n return {\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author) ?? fallbackAuthor,\n text,\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse files for the public runtime surface of this module.\n */\nexport function parseFiles(raw: string[] | undefined): { values: LinkedFile[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--file\", \"Use --clear-files to clear linked files.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, LINKED_ARTIFACT_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--file\") : { path: trimmedEntry };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--file\", LINKED_ARTIFACT_SEED_KEYS);\n }\n if (!kv.path) {\n throw new PmCliError(\"--file requires path=<value> or a bare file path\", EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"file scope\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse tests for the public runtime surface of this module.\n */\nexport function parseTests(raw: string[] | undefined): { values: LinkedTest[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--test\", \"Use --clear-tests to clear linked tests.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const kv = looksLikeStructuredLinkedTestEntry(trimmedEntry)\n ? normalizeStructuredLinkedTestEntry(parseCsvKv(entry, \"--test\"), \"--test\")\n : { command: trimmedEntry };\n const command = parseOptionalString(kv.command);\n const filePath = parseOptionalString(kv.path);\n if (!command) {\n throw new PmCliError(\"--test requires command=<value> or a bare command (path=<value> is optional metadata)\", EXIT_CODE.USAGE);\n }\n const timeoutSecondsRaw = parseOptionalString(kv.timeout_seconds);\n const timeoutAliasRaw = parseOptionalString(kv.timeout);\n if (timeoutSecondsRaw && timeoutAliasRaw && timeoutSecondsRaw !== timeoutAliasRaw) {\n throw new PmCliError(\"--test timeout and timeout_seconds must match when both are provided\", EXIT_CODE.USAGE);\n }\n const timeoutRaw = timeoutSecondsRaw ?? timeoutAliasRaw;\n return {\n command,\n path: filePath,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"test scope\"),\n timeout_seconds: timeoutRaw ? parseOptionalNumber(timeoutRaw, \"timeout_seconds\") : undefined,\n pm_context_mode: parseLinkedTestContextMode(kv.pm_context_mode, \"--test\"),\n env_set: parseLinkedTestEnvSet(kv.env_set, \"--test\"),\n env_clear: parseLinkedTestEnvClear(kv.env_clear, \"--test\"),\n shared_host_safe: parseLinkedTestBoolean(kv.shared_host_safe, \"--test\", \"shared_host_safe\"),\n assert_stdout_contains: parseLinkedTestStringList(kv.assert_stdout_contains),\n assert_stdout_regex: parseLinkedTestRegexList(kv.assert_stdout_regex, \"--test\", \"assert_stdout_regex\"),\n assert_stderr_contains: parseLinkedTestStringList(kv.assert_stderr_contains),\n assert_stderr_regex: parseLinkedTestRegexList(kv.assert_stderr_regex, \"--test\", \"assert_stderr_regex\"),\n assert_stdout_min_lines: parseLinkedTestMinLines(kv.assert_stdout_min_lines, \"--test\"),\n assert_json_field_equals: parseLinkedTestAssertionEqualsMap(kv.assert_json_field_equals, \"--test\"),\n assert_json_field_gte: parseLinkedTestAssertionGteMap(kv.assert_json_field_gte, \"--test\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse docs for the public runtime surface of this module.\n */\nexport function parseDocs(raw: string[] | undefined): { values: LinkedDoc[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--doc\", \"Use --clear-docs to clear linked docs.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, LINKED_ARTIFACT_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--doc\") : { path: trimmedEntry };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--doc\", LINKED_ARTIFACT_SEED_KEYS);\n }\n if (!kv.path) {\n throw new PmCliError(\"--doc requires path=<value> or a bare doc path\", EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"doc scope\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\nfunction parseReminders(raw: string[] | undefined, nowValue: string): { values: Reminder[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--reminder\", \"Use --clear-reminders to clear reminders.\");\n return {\n values: parseReminderEntries(raw, new Date(nowValue), { valueMode: \"raw\" }),\n explicitEmpty: false,\n };\n}\n\nfunction parseEvents(raw: string[] | undefined, nowValue: string): { values: CalendarEvent[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--event\", \"Use --clear-events to clear linked events.\");\n return {\n values: parseEventEntries(raw, new Date(nowValue), {\n allDayEmptyGuard: \"defined\",\n recurrenceEmptyNumericGuard: \"defined\",\n }),\n explicitEmpty: false,\n };\n}\n\nfunction buildChangedFields(\n frontMatter: ItemMetadata,\n body: string,\n explicitUnsets: string[],\n additionalFrontMatterKeys: readonly string[] = [],\n): string[] {\n const changed = [\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...additionalFrontMatterKeys.filter((key) => (frontMatter as unknown as Record<string, unknown>)[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ...explicitUnsets.map((key) => `unset:${key}`),\n ];\n return Array.from(new Set(changed));\n}\n\nfunction buildHistoryMessage(baseMessage: string | undefined, explicitUnsets: string[]): string | undefined {\n const trimmed = baseMessage ?? \"\";\n if (explicitUnsets.length === 0) {\n return trimmed;\n }\n const suffix = `explicit_unset=${explicitUnsets.join(\",\")}`;\n return trimmed ? `${trimmed} | ${suffix}` : suffix;\n}\n\nfunction normalizeCreatePolicyOptionKey(raw: string, typeName: string, sourceLabel: string): string {\n const canonical = canonicalizeCommandOptionKey(\"create\", raw);\n if (!canonical) {\n throw new PmCliError(\n `Unsupported ${sourceLabel} entry \"${raw}\" for type \"${typeName}\"`,\n EXIT_CODE.CONFLICT,\n );\n }\n return canonical;\n}\n\ninterface CreateOptionValueLookup {\n scalarValues: Record<string, unknown>;\n repeatableValues: Record<string, unknown>;\n addTags: string[] | undefined;\n}\n\nfunction buildCreateOptionValueLookup(options: CreateCommandOptions): CreateOptionValueLookup {\n return {\n scalarValues: {\n title: options.title,\n description: options.description,\n type: options.type,\n status: options.status,\n priority: options.priority,\n tags: options.tags,\n body: options.body,\n deadline: options.deadline,\n estimatedMinutes: options.estimatedMinutes,\n acceptanceCriteria: options.acceptanceCriteria,\n definitionOfReady: options.definitionOfReady,\n order: options.order ?? options.rank,\n goal: options.goal,\n objective: options.objective,\n value: options.value,\n impact: options.impact,\n outcome: options.outcome,\n whyNow: options.whyNow,\n author: options.author,\n message: options.message,\n assignee: options.assignee,\n parent: options.parent,\n reviewer: options.reviewer,\n risk: options.risk,\n confidence: options.confidence,\n sprint: options.sprint,\n release: options.release,\n blockedBy: options.blockedBy,\n blockedReason: options.blockedReason,\n unblockNote: options.unblockNote,\n reporter: options.reporter,\n severity: options.severity,\n environment: options.environment,\n reproSteps: options.reproSteps,\n resolution: options.resolution,\n expectedResult: options.expectedResult,\n actualResult: options.actualResult,\n affectedVersion: options.affectedVersion,\n fixedVersion: options.fixedVersion,\n component: options.component,\n regression: options.regression,\n customerImpact: options.customerImpact,\n },\n repeatableValues: {\n dep: options.dep,\n comment: options.comment,\n note: options.note,\n learning: options.learning,\n file: options.file,\n test: options.test,\n doc: options.doc,\n reminder: options.reminder,\n event: options.event,\n typeOption: options.typeOption,\n field: options.field,\n },\n addTags: options.addTags,\n };\n}\n\nfunction hasCreateOptionValue(lookup: CreateOptionValueLookup, optionKey: string): boolean {\n // `--add-tags` mutates the same `tags` field as `--tags`, so it must count\n // toward the `tags` command_option_policy (both the disabled guard and the\n // required check) — otherwise `--add-tags` would bypass a rule disabling\n // tags, or fail to satisfy a rule requiring them even though the created\n // item ends up tagged.\n if (optionKey === \"tags\") {\n return lookup.scalarValues.tags !== undefined || (Array.isArray(lookup.addTags) && lookup.addTags.length > 0);\n }\n if (Object.prototype.hasOwnProperty.call(lookup.scalarValues, optionKey)) {\n return lookup.scalarValues[optionKey] !== undefined;\n }\n /* c8 ignore start -- policy probes only pass canonical CREATE_COMMAND_OPTION_KEYS, all of which exist in scalarValues/repeatableValues, so the in-repeatableValues false arm and trailing return are unreachable. */\n if (Object.prototype.hasOwnProperty.call(lookup.repeatableValues, optionKey)) {\n const value = lookup.repeatableValues[optionKey];\n return Array.isArray(value) && value.length > 0;\n }\n return false;\n /* c8 ignore stop */\n}\n\nfunction buildRequiredCreateOptions(\n typeDefinition: ResolvedItemTypeDefinition,\n createMode: CreateMode,\n): Set<string> {\n const requiredOptions = new Set<string>([\"title\", \"type\"]);\n if (createMode !== \"strict\") {\n return requiredOptions;\n }\n for (const field of typeDefinition.required_create_fields) {\n requiredOptions.add(normalizeCreatePolicyOptionKey(field, typeDefinition.name, \"required_create_fields\"));\n }\n for (const field of typeDefinition.required_create_repeatables) {\n requiredOptions.add(normalizeCreatePolicyOptionKey(field, typeDefinition.name, \"required_create_repeatables\"));\n }\n return requiredOptions;\n}\n\nfunction assertNoDisabledCreateOptions(\n disabledOptions: readonly string[],\n lookup: CreateOptionValueLookup,\n clearOptionKeys: Set<string>,\n typeName: string,\n): void {\n for (const option of disabledOptions) {\n if (!hasCreateOptionValue(lookup, option) && !clearOptionKeys.has(option)) {\n continue;\n }\n throw new PmCliError(\n `Option ${commandOptionFlagLabel(\"create\", option)} is disabled for type \"${typeName}\" by command_option_policies`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction assertNoStrictRequiredOptionClears(\n requiredOptions: readonly string[],\n createMode: CreateMode,\n clearOptionKeys: Set<string>,\n): void {\n if (createMode !== \"strict\") {\n return;\n }\n const strictRequiredClears = requiredOptions.filter((required) => clearOptionKeys.has(required));\n if (strictRequiredClears.length === 0) {\n return;\n }\n /* c8 ignore next -- deterministic ordering fallback only matters when required clear list contains locale ties. */\n const requiredFlags = [...new Set(strictRequiredClears.map((required) => commandOptionFlagLabel(\"create\", required)))].sort(\n (left, right) => left.localeCompare(right),\n );\n /* c8 ignore next -- strict clear conflict envelope is covered by policy integration scenarios. */\n throw new PmCliError(\n `Strict create mode requires concrete values for ${requiredFlags.join(\", \")}; --unset/--clear-* directives cannot satisfy required options`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseTypeOptions(raw: string[] | undefined): { values: Record<string, string> | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) {\n return { values: undefined, explicitEmpty: false };\n }\n assertNoLegacyNoneTokens(raw, \"--type-option\", \"Use --clear-type-options to clear existing type options.\");\n return {\n values: parseTypeOptionEntries(raw),\n explicitEmpty: false,\n };\n}\n\nasync function resolveCreateStdinInputs(options: CreateCommandOptions): Promise<CreateCommandOptions> {\n const stdinResolver = createStdinTokenResolver();\n return {\n ...options,\n body: await stdinResolver.resolveValue(options.body, \"--body\"),\n dep: await stdinResolver.resolveList(options.dep, \"--dep\"),\n comment: await stdinResolver.resolveList(options.comment, \"--comment\"),\n note: await stdinResolver.resolveList(options.note, \"--note\"),\n learning: await stdinResolver.resolveList(options.learning, \"--learning\"),\n file: await stdinResolver.resolveList(options.file, \"--file\"),\n test: await stdinResolver.resolveList(options.test, \"--test\"),\n doc: await stdinResolver.resolveList(options.doc, \"--doc\"),\n reminder: await stdinResolver.resolveList(options.reminder, \"--reminder\"),\n event: await stdinResolver.resolveList(options.event, \"--event\"),\n typeOption: await stdinResolver.resolveList(options.typeOption, \"--type-option\"),\n field: await stdinResolver.resolveList(options.field, \"--field\"),\n };\n}\n\nfunction resolveCreateMode(createMode: string | undefined, defaultMode: CreateMode): CreateMode {\n if (createMode === undefined) {\n return defaultMode;\n }\n const normalized = createMode.trim().toLowerCase();\n if (normalized.length === 0) {\n return defaultMode;\n }\n if (normalized === \"strict\" || normalized === \"progressive\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --create-mode value \"${createMode}\". Allowed: ${CREATE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveScheduleCreatePreset(raw: string | undefined): ScheduleCreatePreset | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0) {\n throw new PmCliError(\"--schedule-preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"lightweight\" || normalized === \"lite\" || normalized === \"schedule-lite\") {\n return \"lightweight\";\n }\n throw new PmCliError(\n `Invalid --schedule-preset value \"${raw}\". Allowed: ${SCHEDULE_CREATE_PRESET_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveEffectiveCreateMode(\n createMode: string | undefined,\n schedulePreset: ScheduleCreatePreset | undefined,\n defaultMode: CreateMode,\n): CreateMode {\n const resolvedMode = resolveCreateMode(createMode, defaultMode);\n if (schedulePreset === undefined) {\n return resolvedMode;\n }\n const createModeWasExplicit = typeof createMode === \"string\" && createMode.trim().length > 0;\n if (createModeWasExplicit && resolvedMode === \"strict\") {\n throw new PmCliError(\n \"--schedule-preset lightweight cannot be combined with --create-mode strict. Use --create-mode progressive or omit --create-mode.\",\n EXIT_CODE.USAGE,\n );\n }\n return \"progressive\";\n}\n\nfunction requireCreateOptionByType(\n typeDefinition: ResolvedItemTypeDefinition,\n options: CreateCommandOptions,\n createMode: CreateMode,\n clearOptionKeys: Set<string>,\n): string[] {\n const typeName = typeDefinition.name;\n const optionLookup = buildCreateOptionValueLookup(options);\n const baseRequiredOptions = buildRequiredCreateOptions(typeDefinition, createMode);\n\n const policyState = resolveCommandOptionPolicyState(typeDefinition, \"create\", baseRequiredOptions);\n if (policyState.errors.length > 0) {\n throw new PmCliError(policyState.errors.join(\"; \"), EXIT_CODE.CONFLICT);\n }\n\n assertNoDisabledCreateOptions(policyState.disabled, optionLookup, clearOptionKeys, typeName);\n assertNoStrictRequiredOptionClears(policyState.required, createMode, clearOptionKeys);\n\n // A configured per-type default_status satisfies a required `status` policy:\n // when --status is omitted, runCreate resolves to that default (or degrades to\n // the workflow open status), so blocking the agent for a \"missing --status\"\n // would contradict the config-driven default. Scoped to status so an explicit\n // status-required policy on a type WITHOUT a default still holds. Only the\n // required check is relaxed; the disabled check above keeps using hasOptionValue.\n const satisfiesRequiredOption = (optionKey: string): boolean => {\n if (optionKey === \"status\" && typeDefinition.default_status !== undefined) {\n return true;\n }\n return hasCreateOptionValue(optionLookup, optionKey);\n };\n const missingRequiredOptions = policyState.required.filter((required) => !satisfiesRequiredOption(required));\n return [...new Set(missingRequiredOptions.map((required) => commandOptionFlagLabel(\"create\", required)))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\nconst MISSING_REQUIRED_TYPE_OPTION_PATTERN = /^Missing required type option \"([^\"]+)\" for type \"([^\"]+)\"$/;\n\nfunction collectMissingRequiredTypeOptionKeys(errors: string[], typeName: string): string[] {\n const missingKeys: string[] = [];\n for (const error of errors) {\n const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);\n if (!match) {\n continue;\n }\n if (match[2] !== typeName) {\n continue;\n }\n missingKeys.push(match[1]);\n }\n return [...new Set(missingKeys)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction filterNonMissingTypeOptionErrors(errors: string[], typeName: string): string[] {\n return errors.filter((error) => {\n const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);\n return !match || match[2] !== typeName;\n });\n}\n\nfunction assertNoInvalidTypeOptions(\n errors: string[],\n type: string,\n typeDefinition: ResolvedItemTypeDefinition,\n statusRegistry: RuntimeStatusRegistry,\n): void {\n const nonMissingTypeOptionErrors = filterNonMissingTypeOptionErrors(errors, type);\n if (nonMissingTypeOptionErrors.length === 0) {\n return;\n }\n const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, [], [], statusRegistry.open_status);\n throw new PmCliError(nonMissingTypeOptionErrors.join(\"; \"), EXIT_CODE.USAGE, {\n code: \"invalid_argument_value\",\n required: `Provide valid --type-option key/value pairs for type \"${type}\".`,\n examples: [nextValidExample],\n nextSteps: [`Run \"pm create --help --type ${type}\" to review allowed type-option keys and values.`],\n });\n}\n\nfunction typeOptionExampleValue(typeDefinition: ResolvedItemTypeDefinition, key: string): string {\n const optionDefinition = typeDefinition.options.find((option) => option.key === key);\n const firstAllowed = optionDefinition?.values[0];\n if (typeof firstAllowed === \"string\" && firstAllowed.trim().length > 0) {\n return firstAllowed;\n }\n return \"<value>\";\n}\n\nfunction createExampleTokensForFlag(flag: string, typeName: string, openStatus: string): string[] {\n switch (flag) {\n case \"--title\":\n return [\"--title\", `\"${typeName} example title\"`];\n case \"--description\":\n return [\"--description\", `\"${typeName} example description\"`];\n case \"--type\":\n return [\"--type\", typeName];\n case \"--status\":\n return [\"--status\", openStatus];\n case \"--priority\":\n return [\"--priority\", \"1\"];\n case \"--message\":\n return [\"--message\", `\"Create ${typeName} item\"`];\n case \"--dep\":\n return [\"--dep\", \"\\\"id=pm-xxxx,kind=related,author=maintainer,created_at=now\\\"\"];\n case \"--comment\":\n return [\"--comment\", \"\\\"author=maintainer,created_at=now,text=Implementation context\\\"\"];\n case \"--note\":\n return [\"--note\", \"\\\"author=maintainer,created_at=now,text=Design note\\\"\"];\n case \"--learning\":\n return [\"--learning\", \"\\\"author=maintainer,created_at=now,text=Durable lesson\\\"\"];\n case \"--file\":\n return [\"--file\", \"\\\"path=src/example.ts,note=implementation file\\\"\"];\n case \"--test\":\n return [\"--test\", \"\\\"command=node scripts/run-tests.mjs test,timeout_seconds=240\\\"\"];\n case \"--doc\":\n return [\"--doc\", \"\\\"path=README.md,note=reference doc\\\"\"];\n default:\n return [flag, \"\\\"<value>\\\"\"];\n }\n}\n\nfunction buildTypeSpecificCreateExample(\n typeDefinition: ResolvedItemTypeDefinition,\n missingCreateFlags: string[],\n missingTypeOptionKeys: string[],\n openStatus: string,\n): string {\n const tokens = [\"pm\", \"create\", \"--title\", `\"${typeDefinition.name} example title\"`, \"--description\", `\"${typeDefinition.name} example description\"`, \"--type\", typeDefinition.name];\n const optionalRecommendationFlags = [\"--status\", \"--priority\", \"--message\"];\n const orderedFlags = [...new Set([...optionalRecommendationFlags, ...missingCreateFlags])];\n const includedFlags = new Set<string>([\"--title\", \"--description\", \"--type\"]);\n for (const flag of orderedFlags) {\n if (includedFlags.has(flag)) {\n continue;\n }\n tokens.push(...createExampleTokensForFlag(flag, typeDefinition.name, openStatus));\n includedFlags.add(flag);\n }\n for (const key of missingTypeOptionKeys) {\n const value = typeOptionExampleValue(typeDefinition, key);\n tokens.push(\"--type-option\", `${key}=${value}`);\n }\n return tokens.join(\" \");\n}\n\nfunction requireStringOption(value: string | undefined, flag: string): string {\n if (value === undefined) {\n if (flag === \"--title\") {\n throw new PmCliError(\n '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.',\n EXIT_CODE.USAGE,\n );\n }\n throw new PmCliError(`Missing required option ${flag}`, EXIT_CODE.USAGE);\n }\n return value;\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = parseOptionalString(explicitAuthor) ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed || \"unknown\";\n}\n\nfunction ensurePriority(rawPriority: string | number): 0 | 1 | 2 | 3 | 4 {\n return resolvePriority(rawPriority);\n}\n\nfunction mergeCreateOptionsWithTemplate(\n templateOptions: Record<string, string | string[]>,\n explicitOptions: CreateCommandOptions,\n): CreateCommandOptions {\n const merged: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(templateOptions)) {\n merged[key] = Array.isArray(value) ? [...value] : value;\n }\n for (const [key, value] of Object.entries(explicitOptions)) {\n if (value !== undefined) {\n merged[key] = Array.isArray(value) ? [...value] : value;\n }\n }\n return merged as CreateCommandOptions;\n}\n\nfunction normalizeExtensionCommandPath(command: string): string {\n return command\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nfunction hasTemplatesShowHandler(): boolean {\n const registrations = getActiveExtensionRegistrations();\n if (!registrations) {\n return false;\n }\n return registrations.commands.some((entry) => {\n return entry.action === \"templates-show\" || normalizeExtensionCommandPath(entry.command) === \"templates show\";\n });\n}\n\nfunction readTemplateOptionsFromRuntimeResult(result: unknown, templateName: string): Record<string, string | string[]> {\n if (typeof result !== \"object\" || result === null || !(\"options\" in result)) {\n throw new PmCliError(\n `Templates package returned invalid payload for template \"${templateName}\". Expected an options object.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const options = (result as { options?: unknown }).options;\n if (typeof options !== \"object\" || options === null || Array.isArray(options)) {\n throw new PmCliError(\n `Templates package returned invalid options for template \"${templateName}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const normalized: Record<string, string | string[]> = {};\n for (const [key, value] of Object.entries(options as Record<string, unknown>)) {\n if (typeof value === \"string\") {\n normalized[key] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n normalized[key] = [...value];\n continue;\n }\n throw new PmCliError(\n `Templates package returned unsupported option value for \"${key}\" in template \"${templateName}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return normalized;\n}\n\nasync function loadCreateTemplateOptionsFromRuntime(\n templateName: string,\n global: GlobalOptions,\n pmRoot: string,\n): Promise<Record<string, string | string[]>> {\n if (!hasTemplatesShowHandler()) {\n throw new PmCliError(\n `--template requires the templates package. Install it first (for example: pm install templates --project).`,\n EXIT_CODE.USAGE,\n );\n }\n const handlerResult = await runActiveCommandHandler({\n command: \"templates show\",\n args: [templateName],\n options: {},\n global,\n pm_root: pmRoot,\n });\n if (!handlerResult.handled) {\n const warningSuffix = handlerResult.warnings.length > 0 ? ` (${handlerResult.warnings.join(\", \")})` : \"\";\n throw new PmCliError(\n `Unable to resolve template \"${templateName}\" via templates package. Run \"pm templates show ${templateName}\" for details.${warningSuffix}`,\n EXIT_CODE.USAGE,\n );\n }\n /* c8 ignore next -- template runtime success path is covered by package-level integration tests. */\n return readTemplateOptionsFromRuntimeResult(handlerResult.result, templateName);\n}\n\nfunction ensureInitHasRun(pmRoot: string): Promise<void> {\n return pathExists(getSettingsPath(pmRoot)).then((exists) => {\n /* c8 ignore next -- init guard failures are covered by top-level create command tests. */\n if (!exists) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n });\n}\n\n/**\n * Resolve an optional string front-matter field for {@link runCreate}: yields\n * `undefined` when the field is being cleared via `--unset <key>` or was never\n * supplied, otherwise the (identity-parsed) raw value. Collapses the pervasive\n * `unset ? undefined : raw === undefined ? undefined : parseOptionalString(raw)`\n * triple-ternary each optional scalar field repeated inline, keeping `runCreate`\n * under the complexity ceiling without changing any resolved value.\n */\nfunction resolveUnsettableOptionalString(\n unsetKeys: ReadonlySet<string>,\n frontMatterKey: string,\n raw: string | undefined,\n): string | undefined {\n return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : parseOptionalString(raw);\n}\n\n/**\n * Resolve an optional field that maps its raw string through `transform` once\n * present: yields `undefined` when the field is being cleared via `--unset` or\n * was never supplied, otherwise `transform(raw)`. The non-string return type is\n * inferred from `transform`, so this serves numeric, ISO-date, and enum fields\n * alike while keeping the unset/absent guard in one place.\n */\nfunction resolveUnsettableTransformed<Value>(\n unsetKeys: ReadonlySet<string>,\n frontMatterKey: string,\n raw: string | undefined,\n transform: (value: string) => Value,\n): Value | undefined {\n return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : transform(raw);\n}\n\n/** Calendar-relevant item types whose entries are invisible on `pm calendar` without a schedule. */\nconst CALENDAR_RELEVANT_CREATE_TYPES = new Set([\"milestone\", \"meeting\", \"reminder\", \"event\"]);\n\n/**\n * Whether a calendar-relevant item would be invisible on `pm calendar`: a\n * Milestone/Meeting/Reminder/Event created with no deadline AND no reminders AND\n * no events never surfaces there. Shared by the structured create warning and the\n * post-write stderr hint so both stay in lockstep.\n */\nfunction createItemLacksSchedule(\n type: string,\n deadline: string | undefined,\n reminders: readonly unknown[] | undefined,\n events: readonly unknown[] | undefined,\n): boolean {\n const hasDeadline = deadline !== undefined;\n const hasReminders = reminders !== undefined && reminders.length > 0;\n const hasEvents = events !== undefined && events.length > 0;\n return CALENDAR_RELEVANT_CREATE_TYPES.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents;\n}\n\n/**\n * Build the never-blocking schedule-visibility warnings for a new item: an\n * `event_without_schedule` token for Event-type items with no attached events,\n * and a `calendar_item_without_schedule` token (with an actionable hint) for any\n * calendar-relevant type that would be invisible on `pm calendar`. The structured\n * prefixes are stable for automation/telemetry (pm-2cgu / GH-174).\n */\nfunction collectCreateScheduleWarnings(\n type: string,\n id: string,\n deadline: string | undefined,\n reminders: readonly unknown[] | undefined,\n events: readonly unknown[] | undefined,\n): string[] {\n const warnings: string[] = [];\n if (type.toLowerCase() === \"event\" && (events === undefined || events.length === 0)) {\n warnings.push(`event_without_schedule:${id}:no_time_set`);\n }\n if (createItemLacksSchedule(type, deadline, reminders, events)) {\n warnings.push(\n `calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event (hint: set --deadline <ISO> or --reminder \"<when>\", or link an Event via --event \"start=<ISO>,end=<ISO>\"; otherwise this item never appears on pm calendar)`,\n );\n }\n return warnings;\n}\n\n/**\n * Resolve the effective parent for a new item, inheriting the session-focused\n * item (set via `pm focus <id>`) only when no explicit `--parent` was supplied\n * and parent is not being unset (GH-161 / pm-72xf). An explicit `--parent`\n * (including `--parent \"\"`) always overrides focus; the inherited value flows\n * through the same locate/validate path as an explicit parent.\n */\nasync function inheritFocusedParent(\n parent: string | undefined,\n resolvedOptions: CreateCommandOptions,\n unsetKeys: ReadonlySet<string>,\n pmRoot: string,\n): Promise<{ parent: string | undefined; parentSource: \"focus\" | undefined }> {\n if (parent !== undefined || unsetKeys.has(\"parent\") || resolvedOptions.parent !== undefined) {\n return { parent, parentSource: undefined };\n }\n const focused = await getFocusedItem(pmRoot);\n if (focused === undefined) {\n return { parent, parentSource: undefined };\n }\n return { parent: focused, parentSource: \"focus\" };\n}\n\n/**\n * Normalize and locate a new item's parent reference, returning the normalized\n * value plus any never-blocking missing-parent warnings the configured\n * `parent_reference` policy produces when the target does not resolve.\n */\nasync function validateCreateParentReference(\n pmRoot: string,\n settings: PmSettings,\n typeRegistry: ItemTypeRegistry,\n itemId: string,\n parent: string,\n policy: Parameters<typeof validateMissingParentReference>[1],\n): Promise<{ parent: string; warnings: string[] }> {\n const normalized = normalizeParentReferenceValue(parent);\n assertParentReferenceIsNotSelf(itemId, normalized, settings.id_prefix);\n const parentLocated = await locateItem(pmRoot, normalized, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (parentLocated) {\n return { parent: normalized, warnings: [] };\n }\n const normalizedParentId = normalizeItemId(normalized, settings.id_prefix);\n return { parent: normalized, warnings: validateMissingParentReference(normalizedParentId, policy).warnings };\n}\n\nasync function resolveCreateParentWithWarnings(params: {\n itemId: string;\n parent: string | undefined;\n pmRoot: string;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n policy: Parameters<typeof validateMissingParentReference>[1];\n}): Promise<{ parent: string | undefined; warnings: string[] }> {\n if (params.parent === undefined) {\n return { parent: undefined, warnings: [] };\n }\n const parentValidation = await validateCreateParentReference(\n params.pmRoot,\n params.settings,\n params.typeRegistry,\n params.itemId,\n params.parent,\n params.policy,\n );\n return parentValidation;\n}\n\nasync function resolveCreateItemId(params: {\n pmRoot: string;\n settings: PmSettings;\n explicitId: unknown;\n}): Promise<string> {\n if (params.explicitId === undefined) {\n return generateItemId(params.pmRoot, params.settings.id_prefix);\n }\n if (typeof params.explicitId !== \"string\") {\n throw new PmCliError(\"--id must be a string\", EXIT_CODE.USAGE);\n }\n const trimmedId = params.explicitId.trim();\n if (trimmedId.length === 0 || isPlaceholderReferenceToken(trimmedId)) {\n throw new PmCliError(\"--id must not be empty or use a placeholder token\", EXIT_CODE.USAGE);\n }\n const normalizedId = normalizeItemId(trimmedId, params.settings.id_prefix);\n if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(normalizedId)) {\n throw new PmCliError(\"--id must contain only letters, numbers, and dashes after normalization\", EXIT_CODE.USAGE);\n }\n return normalizedId;\n}\n\n/**\n * Resolve a sprint or release field: `undefined` when cleared/absent, otherwise\n * the format-validated value plus any never-blocking format warnings from the\n * configured `sprint_release_format` policy.\n */\nfunction resolveCreateSprintOrRelease(\n unsetKeys: ReadonlySet<string>,\n frontMatterKey: string,\n raw: string | undefined,\n field: Parameters<typeof validateSprintOrReleaseValue>[0],\n policy: Parameters<typeof validateSprintOrReleaseValue>[2],\n): { value: string | undefined; warnings: string[] } {\n const resolved = resolveUnsettableOptionalString(unsetKeys, frontMatterKey, raw);\n if (resolved === undefined) {\n return { value: undefined, warnings: [] };\n }\n const validation = validateSprintOrReleaseValue(field, resolved, policy);\n return { value: validation.value, warnings: validation.warnings };\n}\n\n/**\n * Apply the `--blocked-by` convenience: when the target locates, add a\n * `blocked_by` dependency (if not already present) and, unless `--status` was\n * given explicitly, move the new item into the blocked status. Returns the\n * (possibly augmented) dependency list and the (possibly rerouted) status; a\n * `blockedBy` that is absent or does not locate leaves both unchanged.\n */\nasync function resolveCreateBlockedByDependency(params: {\n pmRoot: string;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n statusRegistry: RuntimeStatusRegistry;\n blockedBy: string | undefined;\n dependencyValues: Dependency[] | undefined;\n status: ItemStatus;\n statusExplicit: boolean;\n nowValue: string;\n author: string;\n}): Promise<{ dependencyValues: Dependency[] | undefined; status: ItemStatus }> {\n const { pmRoot, settings, typeRegistry, statusRegistry, blockedBy, status, statusExplicit, nowValue, author } = params;\n let dependencyValues = params.dependencyValues;\n if (blockedBy === undefined) {\n return { dependencyValues, status };\n }\n const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);\n const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!blockedByLocated) {\n return { dependencyValues, status };\n }\n const hasBlockedByDependency = (dependencyValues ?? []).some(\n (dependency) => dependency.id === blockedByLocated.id && dependency.kind === \"blocked_by\",\n );\n if (!hasBlockedByDependency) {\n dependencyValues = [\n ...(dependencyValues ?? []),\n { id: blockedByLocated.id, kind: \"blocked_by\", created_at: nowValue, author },\n ];\n }\n if (statusExplicit) {\n return { dependencyValues, status };\n }\n const blockedStatus = statusRegistry.blocked_statuses.has(\"blocked\")\n ? \"blocked\"\n : [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;\n return { dependencyValues, status: blockedStatus };\n}\n\n/**\n * Apply the governance default-type fallback when `pm create` was invoked with no\n * `--type`: honor `governance.create_default_type` when it resolves in the active\n * registry, else fall back to the built-in `Task`. Suppressed under explicit\n * `--create-mode strict`, where the strict required-option contract must surface\n * the missing_required_option envelope instead. Mutates `resolvedOptions.type`.\n */\nfunction applyCreateDefaultType(\n resolvedOptions: CreateCommandOptions,\n settings: PmSettings,\n typeRegistry: ItemTypeRegistry,\n): void {\n // Default-type fallback is suppressed under explicit --create-mode strict, where the strict\n // required-option contract takes precedence and surfaces the missing_required_option envelope.\n /* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */\n const explicitStrictMode =\n typeof resolvedOptions.createMode === \"string\" && resolvedOptions.createMode.trim().toLowerCase() === \"strict\";\n if (explicitStrictMode) {\n return;\n }\n /* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */\n const defaultType = settings.governance.create_default_type?.trim();\n if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {\n resolvedOptions.type = defaultType;\n return;\n }\n /* c8 ignore start -- \"Task\" is a built-in type present in every default registry; reaching this arm requires a custom schema that removed Task with no create_default_type configured. */\n if (resolveTypeName(\"Task\", typeRegistry)) {\n resolvedOptions.type = \"Task\";\n }\n /* c8 ignore stop */\n}\n\n/**\n * Resolve the target item type and creation mode for `pm create`: merge any\n * `--template` options, apply the governance default-type fallback, map a\n * near-miss `--type` to its canonical synonym (never blocking), and derive the\n * schedule preset and effective create mode. Returns the (possibly\n * template-merged) options alongside the resolved type definition, canonical\n * type name, schedule preset, and create mode.\n */\nasync function resolveCreateTypeSelection(\n options: CreateCommandOptions,\n global: GlobalOptions,\n pmRoot: string,\n settings: PmSettings,\n typeRegistry: ItemTypeRegistry,\n): Promise<{\n resolvedOptions: CreateCommandOptions;\n typeDefinition: ResolvedItemTypeDefinition;\n type: string;\n schedulePreset: ReturnType<typeof resolveScheduleCreatePreset>;\n createMode: ReturnType<typeof resolveEffectiveCreateMode>;\n}> {\n let resolvedOptions = options;\n if (resolvedOptions.template !== undefined) {\n const templateName = resolvedOptions.template.trim();\n if (templateName.length === 0) {\n throw new PmCliError(\"--template must not be empty. Omit --template to disable template usage.\", EXIT_CODE.USAGE);\n }\n /* c8 ignore next -- template merge path is exercised in templates package integration tests. */\n const templateOptions = await loadCreateTemplateOptionsFromRuntime(templateName, global, pmRoot);\n resolvedOptions = normalizeLegacyNoneCreateOptions(mergeCreateOptionsWithTemplate(templateOptions, resolvedOptions));\n }\n if (resolvedOptions.type === undefined) {\n applyCreateDefaultType(resolvedOptions, settings, typeRegistry);\n }\n /* c8 ignore start -- missing/invalid type fallback guards are exercised by create command integration suites. */\n if (resolvedOptions.type === undefined) {\n throw new PmCliError(\"Missing required option --type <value>\", EXIT_CODE.USAGE);\n }\n let resolvedTypeName = resolveTypeName(resolvedOptions.type, typeRegistry);\n if (!resolvedTypeName) {\n // Never block on a near-miss type: map a known synonym (e.g. Bug -> Issue,\n // Change -> Chore) to its canonical built-in type when that type exists in the\n // active registry, and tell the agent how to make it a distinct custom type.\n const synonymCanonical = resolveTypeSynonym(resolvedOptions.type);\n const synonymResolved = synonymCanonical ? resolveTypeName(synonymCanonical, typeRegistry) : undefined;\n if (synonymResolved) {\n printError(\n `[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.`,\n );\n resolvedOptions.type = synonymResolved;\n resolvedTypeName = synonymResolved;\n } else {\n throw new PmCliError(\n buildInvalidTypeError(resolvedOptions.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n }\n /* c8 ignore stop */\n const typeDefinition = resolveTypeDefinition(resolvedTypeName, typeRegistry);\n /* c8 ignore start -- resolvedTypeName came from resolveTypeName succeeding, so resolveTypeDefinition always returns a definition here. */\n if (!typeDefinition) {\n throw new PmCliError(`Invalid type value \"${resolvedOptions.type}\"`, EXIT_CODE.USAGE);\n }\n /* c8 ignore stop */\n const type = typeDefinition.name;\n const schedulePreset = resolveScheduleCreatePreset(resolvedOptions.schedulePreset);\n /* c8 ignore next -- schedule preset/type compatibility conflicts are validated in scheduler integration tests. */\n if (schedulePreset !== undefined && !SCHEDULE_CREATE_PRESET_TYPES.has(type)) {\n throw new PmCliError(\n `--schedule-preset ${schedulePreset} is only supported for Reminder, Meeting, or Event types`,\n EXIT_CODE.USAGE,\n );\n }\n const createMode = resolveEffectiveCreateMode(resolvedOptions.createMode, schedulePreset, settings.governance.create_mode_default);\n return { resolvedOptions, typeDefinition, type, schedulePreset, createMode };\n}\n\n/**\n * Seed the explicit-unset and clear-option key sets from the parsed `--unset`\n * targets, then fold in each enabled `--clear-<collection>` flag: it marks the\n * collection's front-matter key as explicitly unset and its option key as\n * cleared, and rejects combining a clear flag with its own value flag. Returns\n * the augmented sets used downstream for required-flag relaxation and history\n * messaging.\n */\nfunction collectCreateClearTargets(\n resolvedOptions: CreateCommandOptions,\n unsetTargets: { frontMatterKeys: Set<string>; optionKeys: Set<string> },\n): { explicitUnsets: Set<string>; clearOptionKeys: Set<string> } {\n const explicitUnsets = new Set<string>(unsetTargets.frontMatterKeys);\n const clearOptionKeys = new Set<string>(unsetTargets.optionKeys);\n const clearCollectionDefinitions: ReadonlyArray<{\n enabled: boolean | undefined;\n optionKey: string;\n clearFlag: string;\n valueFlag: string;\n values: string[] | undefined;\n frontMatterKey: string;\n }> = [\n { enabled: resolvedOptions.clearDeps, optionKey: \"dep\", clearFlag: \"--clear-deps\", valueFlag: \"--dep\", values: resolvedOptions.dep, frontMatterKey: \"dependencies\" },\n { enabled: resolvedOptions.clearComments, optionKey: \"comment\", clearFlag: \"--clear-comments\", valueFlag: \"--comment\", values: resolvedOptions.comment, frontMatterKey: \"comments\" },\n { enabled: resolvedOptions.clearNotes, optionKey: \"note\", clearFlag: \"--clear-notes\", valueFlag: \"--note\", values: resolvedOptions.note, frontMatterKey: \"notes\" },\n { enabled: resolvedOptions.clearLearnings, optionKey: \"learning\", clearFlag: \"--clear-learnings\", valueFlag: \"--learning\", values: resolvedOptions.learning, frontMatterKey: \"learnings\" },\n { enabled: resolvedOptions.clearFiles, optionKey: \"file\", clearFlag: \"--clear-files\", valueFlag: \"--file\", values: resolvedOptions.file, frontMatterKey: \"files\" },\n { enabled: resolvedOptions.clearTests, optionKey: \"test\", clearFlag: \"--clear-tests\", valueFlag: \"--test\", values: resolvedOptions.test, frontMatterKey: \"tests\" },\n { enabled: resolvedOptions.clearDocs, optionKey: \"doc\", clearFlag: \"--clear-docs\", valueFlag: \"--doc\", values: resolvedOptions.doc, frontMatterKey: \"docs\" },\n { enabled: resolvedOptions.clearReminders, optionKey: \"reminder\", clearFlag: \"--clear-reminders\", valueFlag: \"--reminder\", values: resolvedOptions.reminder, frontMatterKey: \"reminders\" },\n { enabled: resolvedOptions.clearEvents, optionKey: \"event\", clearFlag: \"--clear-events\", valueFlag: \"--event\", values: resolvedOptions.event, frontMatterKey: \"events\" },\n { enabled: resolvedOptions.clearTypeOptions, optionKey: \"typeOption\", clearFlag: \"--clear-type-options\", valueFlag: \"--type-option\", values: resolvedOptions.typeOption, frontMatterKey: \"type_options\" },\n ];\n for (const definition of clearCollectionDefinitions) {\n if (!definition.enabled) {\n continue;\n }\n /* c8 ignore next -- clear+value conflict paths are covered by command-surface parser tests. */\n if (definition.values && definition.values.length > 0) {\n throw new PmCliError(`Cannot combine ${definition.clearFlag} with ${definition.valueFlag}`, EXIT_CODE.USAGE);\n }\n explicitUnsets.add(definition.frontMatterKey);\n clearOptionKeys.add(definition.optionKey);\n }\n return { explicitUnsets, clearOptionKeys };\n}\n\n/**\n * Reject combining `--unset <field>` with the same field's scalar value flag\n * (for example `--unset goal --goal ...`) — the single-value analog of the\n * collection clear/value conflict enforced by {@link collectCreateClearTargets}.\n */\nfunction assertNoCreateScalarUnsetConflicts(\n resolvedOptions: CreateCommandOptions,\n unsetTargets: { optionKeys: Set<string> },\n): void {\n const scalarOptionPresence: Record<string, boolean> = {\n tags: resolvedOptions.tags !== undefined,\n deadline: resolvedOptions.deadline !== undefined,\n estimatedMinutes: resolvedOptions.estimatedMinutes !== undefined,\n acceptanceCriteria: resolvedOptions.acceptanceCriteria !== undefined,\n /* c8 ignore next -- definitionOfReady option presence is covered by legacy migration tests. */\n definitionOfReady: resolvedOptions.definitionOfReady !== undefined,\n order: resolvedOptions.order !== undefined || resolvedOptions.rank !== undefined,\n goal: resolvedOptions.goal !== undefined,\n objective: resolvedOptions.objective !== undefined,\n value: resolvedOptions.value !== undefined,\n impact: resolvedOptions.impact !== undefined,\n outcome: resolvedOptions.outcome !== undefined,\n whyNow: resolvedOptions.whyNow !== undefined,\n author: resolvedOptions.author !== undefined,\n assignee: resolvedOptions.assignee !== undefined,\n parent: resolvedOptions.parent !== undefined,\n reviewer: resolvedOptions.reviewer !== undefined,\n risk: resolvedOptions.risk !== undefined,\n confidence: resolvedOptions.confidence !== undefined,\n sprint: resolvedOptions.sprint !== undefined,\n release: resolvedOptions.release !== undefined,\n blockedBy: resolvedOptions.blockedBy !== undefined,\n blockedReason: resolvedOptions.blockedReason !== undefined,\n unblockNote: resolvedOptions.unblockNote !== undefined,\n reporter: resolvedOptions.reporter !== undefined,\n severity: resolvedOptions.severity !== undefined,\n environment: resolvedOptions.environment !== undefined,\n reproSteps: resolvedOptions.reproSteps !== undefined,\n resolution: resolvedOptions.resolution !== undefined,\n expectedResult: resolvedOptions.expectedResult !== undefined,\n actualResult: resolvedOptions.actualResult !== undefined,\n affectedVersion: resolvedOptions.affectedVersion !== undefined,\n fixedVersion: resolvedOptions.fixedVersion !== undefined,\n component: resolvedOptions.component !== undefined,\n regression: resolvedOptions.regression !== undefined,\n customerImpact: resolvedOptions.customerImpact !== undefined,\n };\n /* c8 ignore next -- scalar unset conflict checks are covered by update/create argument contract tests. */\n for (const [optionKey, hasValue] of Object.entries(scalarOptionPresence)) {\n if (!hasValue || !unsetTargets.optionKeys.has(optionKey)) {\n continue;\n }\n /* c8 ignore start -- every scalarOptionPresence key is in CREATE_OPTION_KEY_TO_UNSET_CANONICAL, so the `?? optionKey` fallback is unreachable. */\n const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey;\n /* c8 ignore stop */\n throw new PmCliError(\n `Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel(\"create\", optionKey)}`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\n/**\n * Reject the legacy literal `none`/`null` sentinel on any create scalar option,\n * pointing the author at the modern `--unset <field>` clear syntax (surfacing the\n * canonical unset key in the hint when the option maps to one).\n */\nfunction assertNoLegacyCreateScalarTokens(resolvedOptions: CreateCommandOptions): void {\n const assertNoLegacyScalarToken = (value: string | undefined, optionKey: string): void => {\n const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);\n const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : undefined;\n assertNoLegacyNoneToken(value, commandOptionFlagLabel(\"create\", optionKey), hint);\n };\n assertNoLegacyScalarToken(resolvedOptions.tags, \"tags\");\n assertNoLegacyScalarToken(resolvedOptions.deadline, \"deadline\");\n assertNoLegacyScalarToken(resolvedOptions.estimatedMinutes, \"estimatedMinutes\");\n assertNoLegacyScalarToken(resolvedOptions.acceptanceCriteria, \"acceptanceCriteria\");\n /* c8 ignore next -- legacy none-token guard for definitionOfReady is covered in compatibility test suites. */\n assertNoLegacyScalarToken(resolvedOptions.definitionOfReady, \"definitionOfReady\");\n assertNoLegacyScalarToken(resolvedOptions.order ?? resolvedOptions.rank, \"order\");\n assertNoLegacyScalarToken(resolvedOptions.goal, \"goal\");\n assertNoLegacyScalarToken(resolvedOptions.objective, \"objective\");\n assertNoLegacyScalarToken(resolvedOptions.value, \"value\");\n assertNoLegacyScalarToken(resolvedOptions.impact, \"impact\");\n assertNoLegacyScalarToken(resolvedOptions.outcome, \"outcome\");\n assertNoLegacyScalarToken(resolvedOptions.whyNow, \"whyNow\");\n assertNoLegacyScalarToken(resolvedOptions.author, \"author\");\n assertNoLegacyScalarToken(resolvedOptions.assignee, \"assignee\");\n assertNoLegacyScalarToken(resolvedOptions.parent, \"parent\");\n assertNoLegacyScalarToken(resolvedOptions.reviewer, \"reviewer\");\n assertNoLegacyScalarToken(resolvedOptions.risk, \"risk\");\n assertNoLegacyScalarToken(resolvedOptions.confidence, \"confidence\");\n assertNoLegacyScalarToken(resolvedOptions.sprint, \"sprint\");\n assertNoLegacyScalarToken(resolvedOptions.release, \"release\");\n assertNoLegacyScalarToken(resolvedOptions.blockedBy, \"blockedBy\");\n assertNoLegacyScalarToken(resolvedOptions.blockedReason, \"blockedReason\");\n assertNoLegacyScalarToken(resolvedOptions.unblockNote, \"unblockNote\");\n assertNoLegacyScalarToken(resolvedOptions.reporter, \"reporter\");\n assertNoLegacyScalarToken(resolvedOptions.severity, \"severity\");\n assertNoLegacyScalarToken(resolvedOptions.environment, \"environment\");\n assertNoLegacyScalarToken(resolvedOptions.reproSteps, \"reproSteps\");\n assertNoLegacyScalarToken(resolvedOptions.resolution, \"resolution\");\n assertNoLegacyScalarToken(resolvedOptions.expectedResult, \"expectedResult\");\n assertNoLegacyScalarToken(resolvedOptions.actualResult, \"actualResult\");\n assertNoLegacyScalarToken(resolvedOptions.affectedVersion, \"affectedVersion\");\n assertNoLegacyScalarToken(resolvedOptions.fixedVersion, \"fixedVersion\");\n assertNoLegacyScalarToken(resolvedOptions.component, \"component\");\n assertNoLegacyScalarToken(resolvedOptions.regression, \"regression\");\n assertNoLegacyScalarToken(resolvedOptions.customerImpact, \"customerImpact\");\n}\n\n/**\n * Reject combining `--unset <field>` with an extension-registered or\n * runtime-schema field's value flag. These custom fields are validated\n * separately from the built-in scalar options but honor the same clear/value\n * mutual exclusion.\n */\nfunction assertNoCreateFieldUnsetConflicts(\n registeredItemFieldValues: Record<string, unknown>,\n runtimeCreateFieldValues: { values?: Record<string, unknown> },\n unsetTargets: { frontMatterKeys: Set<string> },\n): void {\n for (const fieldKey of Object.keys(registeredItemFieldValues)) {\n if (!unsetTargets.frontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);\n }\n /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */\n for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {\n /* c8 ignore stop */\n if (!unsetTargets.frontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with its value flag`, EXIT_CODE.USAGE);\n }\n}\n\n/**\n * Throw the aggregated `missing_required_option` error when a type's required\n * create options and/or required type-option keys were not all supplied in one\n * invocation. Builds a type-aware valid example and staged-onboarding next steps\n * (a strict-mode invocation also carries a compact recovery envelope). A no-op\n * when nothing is missing.\n */\nfunction assertNoMissingRequiredCreateOptions(params: {\n combinedMissingFlags: string[];\n typeDefinition: ResolvedItemTypeDefinition;\n missingRequiredCreateFlags: string[];\n missingRequiredTypeOptionKeys: string[];\n openStatus: string;\n type: string;\n createMode: ReturnType<typeof resolveEffectiveCreateMode>;\n}): void {\n const { combinedMissingFlags, typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus, type, createMode } = params;\n if (combinedMissingFlags.length === 0) {\n return;\n }\n const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus);\n const nextSteps = [`Run \"pm create --help --type ${type}\" for type-aware required option guidance.`];\n if (combinedMissingFlags.includes(\"--title\")) {\n nextSteps.push('Title can also be passed as the first positional argument (example: pm create \"Your title\" --type ' + type + \").\");\n }\n if (createMode === \"strict\") {\n nextSteps.push('For staged onboarding, retry with \"--create-mode progressive\".');\n if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {\n nextSteps.push('For minimal scheduling inputs, try \"--schedule-preset lightweight\".');\n }\n }\n const errorMessage =\n combinedMissingFlags.length === 1\n ? `Missing required option ${combinedMissingFlags[0]} for type \"${type}\"`\n : `Missing required options ${combinedMissingFlags.join(\", \")} for type \"${type}\"`;\n throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {\n code: \"missing_required_option\",\n required: `Provide all required create options and type options for type \"${type}\" in one invocation.`,\n examples: [nextValidExample],\n nextSteps,\n recovery:\n createMode === \"strict\"\n ? {\n recovery_mode: \"compact\",\n missing_required_fields: combinedMissingFlags,\n suggested_flags: [\"--create-mode progressive\", ...combinedMissingFlags],\n }\n : undefined,\n });\n}\n\n/**\n * Resolve the new item's tags: an empty list when `--unset tags` clears the\n * field (rejecting a contradictory `--add-tags`), otherwise the parsed `--tags`\n * merged with any additive `--add-tags`.\n */\nfunction resolveCreateTags(unsetKeys: ReadonlySet<string>, resolvedOptions: CreateCommandOptions): string[] {\n if (unsetKeys.has(\"tags\") && Array.isArray(resolvedOptions.addTags) && resolvedOptions.addTags.length > 0) {\n throw new PmCliError(\"Cannot combine --unset tags with --add-tags\", EXIT_CODE.USAGE);\n }\n const baseTags = unsetKeys.has(\"tags\") ? [] : resolvedOptions.tags !== undefined ? parseTags(resolvedOptions.tags) : [];\n return mergeAdditiveTags(baseTags, resolvedOptions.addTags);\n}\n\n/**\n * Resolve the new item's integer `order`: `undefined` when cleared/absent, else\n * the parsed value. Rejects mismatched `--order`/`--rank` and non-integer values.\n */\nfunction resolveCreateOrder(unsetKeys: ReadonlySet<string>, resolvedOptions: CreateCommandOptions): number | undefined {\n if (resolvedOptions.order !== undefined && resolvedOptions.rank !== undefined && resolvedOptions.order !== resolvedOptions.rank) {\n throw new PmCliError(\"--order and --rank must match when both are provided\", EXIT_CODE.USAGE);\n }\n const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;\n const order = resolveUnsettableTransformed(unsetKeys, \"order\", orderRaw, (raw) => parseOptionalNumber(raw, \"order\"));\n if (order !== undefined && !Number.isInteger(order)) {\n throw new PmCliError(\"Order must be an integer\", EXIT_CODE.USAGE);\n }\n return order;\n}\n\n/**\n * Resolve the close reason for an item created directly in the close status\n * (GH-249): honor `governance.require_close_reason` like `pm close`, deriving it\n * from `--message` > `--resolution` and falling back to a stable placeholder,\n * warning `close_reason_defaulted` when neither was supplied. Returns `undefined`\n * (and no warnings) when the item is not being created closed or the policy is\n * off.\n */\nfunction resolveCreateCloseReason(\n status: ItemStatus,\n statusRegistry: RuntimeStatusRegistry,\n settings: PmSettings,\n resolvedOptions: CreateCommandOptions,\n resolution: string | undefined,\n): { closeReason: string | undefined; warnings: string[] } {\n if (status !== statusRegistry.close_status || !settings.governance.require_close_reason) {\n return { closeReason: undefined, warnings: [] };\n }\n const messageText = typeof resolvedOptions.message === \"string\" ? resolvedOptions.message.trim() : \"\";\n const resolutionText = typeof resolution === \"string\" ? resolution.trim() : \"\";\n const closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;\n const warnings = messageText.length === 0 && resolutionText.length === 0 ? [\"close_reason_defaulted\"] : [];\n return { closeReason, warnings };\n}\n\n/**\n * Commit a freshly built item under its per-id lock: write the serialized\n * document, append the create history entry (rolling back the item file if the\n * history append throws), run the item + history `onWrite` hooks, and record the\n * after-command affected item. Returns the collected hook warnings; the lock is\n * always released.\n */\nasync function writeCreatedItem(params: {\n pmRoot: string;\n type: string;\n id: string;\n settings: PmSettings;\n typeRegistry: ItemTypeRegistry;\n author: string;\n extensionFieldNames: ReturnType<typeof collectRegisteredItemFieldNames>;\n afterDocument: ItemDocument;\n beforeDocument: ItemDocument;\n historyMessage: string | undefined;\n changedFields: ReturnType<typeof buildChangedFields>;\n nowValue: string;\n}): Promise<string[]> {\n const { pmRoot, type, id, settings, typeRegistry, author, extensionFieldNames, afterDocument, beforeDocument, historyMessage, changedFields, nowValue } = params;\n const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, id);\n const lockRelease = await acquireLock(\n pmRoot,\n id,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n );\n let hookWarnings: string[] = [];\n try {\n const existing = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (existing) {\n throw new PmCliError(`Item \"${id}\" already exists`, EXIT_CODE.CONFLICT);\n }\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(afterDocument, { format: settings.item_format, schema: settings.schema, extensionFieldNames }),\n );\n try {\n const entry = createHistoryEntry({ nowIso: nowValue, author, op: \"create\", before: beforeDocument, after: afterDocument, message: historyMessage });\n await appendHistoryEntry(historyPath, entry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: afterDocument.metadata.id,\n item_type: afterDocument.metadata.type,\n before: beforeDocument,\n after: afterDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: afterDocument.metadata.id,\n item_type: afterDocument.metadata.type,\n before: beforeDocument,\n after: afterDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: afterDocument.metadata.id,\n op: \"create\",\n item_type: afterDocument.metadata.type,\n status: afterDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n return hookWarnings;\n}\n\n/**\n * Implements run create for the public runtime surface of this module.\n */\nexport async function runCreate(options: CreateCommandOptions, global: GlobalOptions): Promise<CreateResult> {\n let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitHasRun(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const typeSelection = await resolveCreateTypeSelection(resolvedOptions, global, pmRoot, settings, typeRegistry);\n resolvedOptions = typeSelection.resolvedOptions;\n const { typeDefinition, type, createMode } = typeSelection;\n const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);\n const { explicitUnsets, clearOptionKeys } = collectCreateClearTargets(resolvedOptions, unsetTargets);\n assertNoCreateScalarUnsetConflicts(resolvedOptions, unsetTargets);\n assertNoLegacyCreateScalarTokens(resolvedOptions);\n\n const missingRequiredCreateFlags = requireCreateOptionByType(typeDefinition, resolvedOptions, createMode, clearOptionKeys);\n const nowValue = nowIso();\n const author = selectAuthor(resolvedOptions.author, settings.author_default);\n\n const dependencies = parseDependencies(resolvedOptions.dep, nowValue, settings.id_prefix);\n const comments = parseLogSeed(\"--comment\", resolvedOptions.comment, nowValue, author);\n const notes = parseLogSeed(\"--note\", resolvedOptions.note, nowValue, author);\n const learnings = parseLogSeed(\"--learning\", resolvedOptions.learning, nowValue, author);\n const files = parseFiles(resolvedOptions.file);\n const tests = parseTests(resolvedOptions.test);\n const docs = parseDocs(resolvedOptions.doc);\n const reminders = parseReminders(resolvedOptions.reminder, nowValue);\n const events = parseEvents(resolvedOptions.event, nowValue);\n const typeOptions = parseTypeOptions(resolvedOptions.typeOption);\n const validatedTypeOptions = validateTypeOptions(type, typeOptions.values, typeRegistry);\n const extensionRegistrations = getActiveExtensionRegistrations();\n const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);\n const registeredItemFieldValues = parseRegisteredItemFieldAssignments(resolvedOptions.field, extensionRegistrations);\n const runtimeCreateFieldValues = collectRuntimeCreateFieldValues(\n resolvedOptions as Record<string, unknown>,\n runtimeFieldRegistry,\n type,\n );\n assertNoCreateFieldUnsetConflicts(registeredItemFieldValues, runtimeCreateFieldValues, unsetTargets);\n const missingRequiredTypeOptionKeys = collectMissingRequiredTypeOptionKeys(validatedTypeOptions.errors, type);\n const missingRequiredTypeOptionFlags = missingRequiredTypeOptionKeys.map((key) => `--type-option ${key}=<value>`);\n const combinedMissingFlags = [\n ...new Set([\n ...missingRequiredCreateFlags,\n ...missingRequiredTypeOptionFlags,\n /* c8 ignore next -- runtime-required flag aggregation is covered in runtime schema create tests. */\n ...runtimeCreateFieldValues.missing_required_flags,\n ]),\n ].sort((left, right) => left.localeCompare(right));\n assertNoMissingRequiredCreateOptions({\n combinedMissingFlags,\n typeDefinition,\n missingRequiredCreateFlags,\n missingRequiredTypeOptionKeys,\n openStatus: statusRegistry.open_status,\n type,\n createMode,\n });\n assertNoInvalidTypeOptions(validatedTypeOptions.errors, type, typeDefinition, statusRegistry);\n\n const id = await resolveCreateItemId({\n pmRoot,\n settings,\n explicitId: resolvedOptions.id,\n });\n let status =\n resolvedOptions.status !== undefined\n ? parseStatusValue(resolvedOptions.status, statusRegistry)\n : resolveCreateDefaultStatus(typeDefinition, statusRegistry);\n const priority = resolvedOptions.priority !== undefined ? ensurePriority(resolvedOptions.priority) : 2;\n const unsetKeys = unsetTargets.frontMatterKeys;\n const tags = resolveCreateTags(unsetKeys, resolvedOptions);\n const deadline = resolveUnsettableTransformed(unsetKeys, \"deadline\", resolvedOptions.deadline, (raw) =>\n resolveIsoOrRelative(raw, new Date(nowValue), \"deadline\"),\n );\n const estimatedMinutes = resolveUnsettableTransformed(unsetKeys, \"estimated_minutes\", resolvedOptions.estimatedMinutes, (raw) =>\n parseOptionalNumber(raw, \"estimated-minutes\"),\n );\n const acceptanceCriteria = resolveUnsettableOptionalString(unsetKeys, \"acceptance_criteria\", resolvedOptions.acceptanceCriteria);\n const definitionOfReady = resolveUnsettableOptionalString(unsetKeys, \"definition_of_ready\", resolvedOptions.definitionOfReady);\n const order = resolveCreateOrder(unsetKeys, resolvedOptions);\n const goal = resolveUnsettableOptionalString(unsetKeys, \"goal\", resolvedOptions.goal);\n const objective = resolveUnsettableOptionalString(unsetKeys, \"objective\", resolvedOptions.objective);\n const value = resolveUnsettableOptionalString(unsetKeys, \"value\", resolvedOptions.value);\n const impact = resolveUnsettableOptionalString(unsetKeys, \"impact\", resolvedOptions.impact);\n const outcome = resolveUnsettableOptionalString(unsetKeys, \"outcome\", resolvedOptions.outcome);\n const whyNow = resolveUnsettableOptionalString(unsetKeys, \"why_now\", resolvedOptions.whyNow);\n const assignee = resolveUnsettableOptionalString(unsetKeys, \"assignee\", resolvedOptions.assignee);\n const authorValue = unsetKeys.has(\"author\") ? undefined : parseOptionalString(resolvedOptions.author) ?? author;\n // GH-161 (pm-72xf): inherit the session-focused parent when no explicit\n // --parent was supplied and parent is not being unset; an explicit --parent\n // (including `--parent \"\"`) overrides focus. The inherited value flows through\n // the same locate/validate path below as an explicit parent.\n const initialParent = resolveUnsettableOptionalString(unsetKeys, \"parent\", resolvedOptions.parent);\n const inheritedParent = await inheritFocusedParent(initialParent, resolvedOptions, unsetKeys, pmRoot);\n let parent = inheritedParent.parent;\n const parentSource = inheritedParent.parentSource;\n const reviewer = resolveUnsettableOptionalString(unsetKeys, \"reviewer\", resolvedOptions.reviewer);\n const risk = resolveUnsettableTransformed(unsetKeys, \"risk\", resolvedOptions.risk, (raw) =>\n ensureEnumValue(normalizeRiskInput(raw), RISK_VALUES, \"risk\"),\n );\n const confidence = resolveUnsettableTransformed(unsetKeys, \"confidence\", resolvedOptions.confidence, (raw) => parseConfidenceInput(raw));\n const parentReferencePolicy =\n resolvedOptions.allowMissingParent === true && settings.validation.parent_reference === \"strict_error\"\n ? \"warn\"\n : settings.validation.parent_reference;\n const sprintReleasePolicy = settings.validation.sprint_release_format;\n const validationWarnings: string[] = collectCreateScheduleWarnings(type, id, deadline, reminders.values, events.values);\n const parentValidation = await resolveCreateParentWithWarnings({\n itemId: id,\n parent,\n pmRoot,\n settings,\n typeRegistry,\n policy: parentReferencePolicy,\n });\n parent = parentValidation.parent;\n validationWarnings.push(...parentValidation.warnings);\n const sprintResolved = resolveCreateSprintOrRelease(unsetKeys, \"sprint\", resolvedOptions.sprint, \"sprint\", sprintReleasePolicy);\n const sprint = sprintResolved.value;\n validationWarnings.push(...sprintResolved.warnings);\n const releaseResolved = resolveCreateSprintOrRelease(unsetKeys, \"release\", resolvedOptions.release, \"release\", sprintReleasePolicy);\n const release = releaseResolved.value;\n validationWarnings.push(...releaseResolved.warnings);\n const blockedBy = resolveUnsettableOptionalString(unsetKeys, \"blocked_by\", resolvedOptions.blockedBy);\n const blockedByResolution = await resolveCreateBlockedByDependency({\n pmRoot,\n settings,\n typeRegistry,\n statusRegistry,\n blockedBy,\n dependencyValues: dependencies.values,\n status,\n statusExplicit: resolvedOptions.status !== undefined,\n nowValue,\n author,\n });\n const dependencyValues = blockedByResolution.dependencyValues;\n status = blockedByResolution.status;\n const blockedReason = resolveUnsettableOptionalString(unsetKeys, \"blocked_reason\", resolvedOptions.blockedReason);\n const unblockNote = resolveUnsettableOptionalString(unsetKeys, \"unblock_note\", resolvedOptions.unblockNote);\n const reporter = resolveUnsettableOptionalString(unsetKeys, \"reporter\", resolvedOptions.reporter);\n const severity = resolveUnsettableTransformed(unsetKeys, \"severity\", resolvedOptions.severity, (raw) =>\n ensureEnumValue(normalizeSeverityInput(raw), ISSUE_SEVERITY_VALUES, \"severity\"),\n );\n const environment = resolveUnsettableOptionalString(unsetKeys, \"environment\", resolvedOptions.environment);\n const reproSteps = resolveUnsettableOptionalString(unsetKeys, \"repro_steps\", resolvedOptions.reproSteps);\n const resolution = resolveUnsettableOptionalString(unsetKeys, \"resolution\", resolvedOptions.resolution);\n const expectedResult = resolveUnsettableOptionalString(unsetKeys, \"expected_result\", resolvedOptions.expectedResult);\n const actualResult = resolveUnsettableOptionalString(unsetKeys, \"actual_result\", resolvedOptions.actualResult);\n const affectedVersion = resolveUnsettableOptionalString(unsetKeys, \"affected_version\", resolvedOptions.affectedVersion);\n const fixedVersion = resolveUnsettableOptionalString(unsetKeys, \"fixed_version\", resolvedOptions.fixedVersion);\n const component = resolveUnsettableOptionalString(unsetKeys, \"component\", resolvedOptions.component);\n const regression = resolveUnsettableTransformed(unsetKeys, \"regression\", resolvedOptions.regression, (raw) => parseRegressionInput(raw));\n const customerImpact = resolveUnsettableOptionalString(unsetKeys, \"customer_impact\", resolvedOptions.customerImpact);\n const title = requireStringOption(resolvedOptions.title, \"--title\");\n const description = resolvedOptions.description ?? \"\";\n const body = resolvedOptions.body ?? \"\";\n\n // GH-249: creating an item directly in the close status must honor\n // governance.require_close_reason, just like `pm close` (errors when missing)\n // and `pm update --status closed` (defaults + warns).\n const closeReasonResolution = resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution);\n const closeReason = closeReasonResolution.closeReason;\n const closedAt = status === statusRegistry.close_status ? nowValue : undefined;\n validationWarnings.push(...closeReasonResolution.warnings);\n\n const frontMatter: ItemMetadata = normalizeFrontMatter({\n id,\n title,\n description,\n type,\n type_options: validatedTypeOptions.normalized,\n status,\n closed_at: closedAt,\n close_reason: closeReason,\n priority,\n tags,\n created_at: nowValue,\n updated_at: nowValue,\n deadline,\n assignee,\n author: authorValue,\n estimated_minutes: estimatedMinutes,\n acceptance_criteria: acceptanceCriteria,\n definition_of_ready: definitionOfReady,\n order,\n goal,\n objective,\n value,\n impact,\n outcome,\n why_now: whyNow,\n parent,\n reviewer,\n risk,\n confidence,\n sprint,\n release,\n blocked_by: blockedBy,\n blocked_reason: blockedReason,\n unblock_note: unblockNote,\n reporter,\n severity,\n environment,\n repro_steps: reproSteps,\n resolution,\n expected_result: expectedResult,\n actual_result: actualResult,\n affected_version: affectedVersion,\n fixed_version: fixedVersion,\n component,\n regression,\n customer_impact: customerImpact,\n dependencies: dependencyValues,\n comments: comments.values as Comment[] | undefined,\n notes: notes.values as LogNote[] | undefined,\n learnings: learnings.values as LogNote[] | undefined,\n files: files.values,\n tests: tests.values,\n docs: docs.values,\n reminders: reminders.values,\n events: events.values,\n ...registeredItemFieldValues,\n ...runtimeCreateFieldValues.values,\n });\n try {\n applyRegisteredItemFieldDefaultsAndValidation(\n frontMatter as unknown as Record<string, unknown>,\n extensionRegistrations,\n );\n } catch (error: unknown) {\n /* c8 ignore start -- applyRegisteredItemFieldDefaultsAndValidation only throws Error instances, so the non-Error message fallback is unreachable. */\n throw new PmCliError(error instanceof Error ? error.message : \"Invalid extension item field values\", EXIT_CODE.USAGE);\n /* c8 ignore stop */\n }\n\n const afterDocument: ItemDocument = canonicalDocument(\n {\n metadata: frontMatter,\n body,\n },\n { schema: settings.schema, extensionFieldNames },\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n const explicitUnsetKeys = [...explicitUnsets].sort((left, right) => left.localeCompare(right));\n const historyMessage = buildHistoryMessage(resolvedOptions.message, explicitUnsetKeys);\n const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys, [\n ...Object.keys(registeredItemFieldValues),\n /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */\n ...Object.keys(runtimeCreateFieldValues.values ?? {}),\n /* c8 ignore stop */\n ]);\n const hookWarnings = await writeCreatedItem({\n pmRoot,\n type,\n id,\n settings,\n typeRegistry,\n author,\n extensionFieldNames,\n afterDocument,\n beforeDocument,\n historyMessage,\n changedFields,\n nowValue,\n });\n\n const outputItem = structuredClone(frontMatter);\n\n // GH-216: nudge agents toward the underutilized in_progress state instead of\n // jumping open -> closed. Only surfaces for workable types created in the open\n // status when the workflow defines a distinct in_progress status to move to.\n const nextTransition = suggestNextLifecycleTransition(id, type, status, statusRegistry);\n\n // After the create has committed (so the ID is real and shows up in the suggestion),\n // emit a single non-blocking stderr hint when the new item would be invisible on `pm\n // calendar`. The structured `calendar_item_without_schedule:*` warning above is what\n // automation reads; this stderr line is the human/agent-facing version with a\n // copy-pasteable `pm update` recipe.\n if (createItemLacksSchedule(type, deadline, reminders.values, events.values)) {\n printError(\n `[pm] warning: ${type} '${id}' has no deadline/reminder/event — it will not appear on the calendar. Add one via 'pm update ${id} --deadline <ISO>' or 'pm update ${id} --event \"start=<ISO>,end=<ISO>\"'.`,\n );\n }\n\n return {\n item: outputItem,\n changed_fields: changedFields,\n warnings: [...validationWarnings, ...hookWarnings],\n ...(parentSource !== undefined ? { parent_source: parentSource } : {}),\n ...(nextTransition !== undefined ? { next_transition: nextTransition } : {}),\n };\n}\n\nexport const _testOnlyCreateCommand = {\n buildHistoryMessage,\n buildInvalidLogSeedKeysMessage,\n buildTypeSpecificCreateExample,\n collectMissingRequiredTypeOptionKeys,\n createExampleTokensForFlag,\n filterNonMissingTypeOptionErrors,\n hasTemplatesShowHandler,\n hasCreateOptionValue,\n loadCreateTemplateOptionsFromRuntime,\n looksLikeStructuredEntry,\n mergeCreateOptionsWithTemplate,\n normalizeCreatePolicyOptionKey,\n normalizeDependencyKindInput,\n normalizeExtensionCommandPath,\n parseCreateUnsetTargets,\n requireStringOption,\n readTemplateOptionsFromRuntimeResult,\n resolveRuntimeCreateUnsetDefinition: (token: string, registry: RuntimeFieldRegistry | undefined) =>\n resolveRuntimeUnsetFieldDefinition(token, \"create\", registry),\n typeOptionExampleValue,\n};\n"],"names":["endAt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAM,yBAA6D;EACxE,UAAU;EACV,MAAM;EACN,QAAQ;EACR,KAAK;EACL,SAAS;;AAGX,IAAM,qBAAqB,OAAO,KAAK,sBAAsB;AAMtD,IAAM,+BACX,2EACI,mBAAmB,KAAK,IAAI,CAAC;AAEnC,SAAS,mBAAmB,KAAW;AACrC,SAAO,IAAI,WACT,qBAAqB,GAAG,uBAAuB,4BAA4B,KAC3E,UAAU,KAAK;AAEnB;AAYM,SAAU,gBAAgB,KAAoB;AAClD,MAAI,OAAO,QAAQ,UAAU;AAC3B,QAAI,OAAO,UAAU,GAAG,KAAK,OAAO,KAAK,OAAO,GA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