@unbrained/pm-cli 2026.7.1 → 2026.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (625) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +25 -0
  3. package/CONTRIBUTING.md +2 -2
  4. package/README.md +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +110 -86
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/activity.js +79 -57
  9. package/dist/cli/commands/activity.js.map +1 -1
  10. package/dist/cli/commands/aggregate.js +102 -79
  11. package/dist/cli/commands/aggregate.js.map +1 -1
  12. package/dist/cli/commands/calendar.js +278 -243
  13. package/dist/cli/commands/calendar.js.map +1 -1
  14. package/dist/cli/commands/close-many.js +176 -114
  15. package/dist/cli/commands/close-many.js.map +1 -1
  16. package/dist/cli/commands/close.js +157 -129
  17. package/dist/cli/commands/close.js.map +1 -1
  18. package/dist/cli/commands/comments-audit.js +50 -42
  19. package/dist/cli/commands/comments-audit.js.map +1 -1
  20. package/dist/cli/commands/config.d.ts +2 -0
  21. package/dist/cli/commands/config.js +443 -879
  22. package/dist/cli/commands/config.js.map +1 -1
  23. package/dist/cli/commands/context.js +365 -287
  24. package/dist/cli/commands/context.js.map +1 -1
  25. package/dist/cli/commands/contracts.js +352 -238
  26. package/dist/cli/commands/contracts.js.map +1 -1
  27. package/dist/cli/commands/create.js +32 -17
  28. package/dist/cli/commands/create.js.map +1 -1
  29. package/dist/cli/commands/dedupe-audit.js +46 -39
  30. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  31. package/dist/cli/commands/dedupe-merge.js +88 -69
  32. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +56 -67
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/shared.js +21 -15
  36. package/dist/cli/commands/extension/shared.js.map +1 -1
  37. package/dist/cli/commands/get.js +114 -81
  38. package/dist/cli/commands/get.js.map +1 -1
  39. package/dist/cli/commands/health.d.ts +17 -0
  40. package/dist/cli/commands/health.js +545 -417
  41. package/dist/cli/commands/health.js.map +1 -1
  42. package/dist/cli/commands/history-compact.js +209 -140
  43. package/dist/cli/commands/history-compact.js.map +1 -1
  44. package/dist/cli/commands/history-redact.js +162 -119
  45. package/dist/cli/commands/history-redact.js.map +1 -1
  46. package/dist/cli/commands/history-repair.js +120 -85
  47. package/dist/cli/commands/history-repair.js.map +1 -1
  48. package/dist/cli/commands/init-agent-guidance.js +32 -19
  49. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  50. package/dist/cli/commands/init.d.ts +8 -2
  51. package/dist/cli/commands/init.js +263 -162
  52. package/dist/cli/commands/init.js.map +1 -1
  53. package/dist/cli/commands/list.js +152 -102
  54. package/dist/cli/commands/list.js.map +1 -1
  55. package/dist/cli/commands/next.js +60 -40
  56. package/dist/cli/commands/next.js.map +1 -1
  57. package/dist/cli/commands/plan.js +373 -298
  58. package/dist/cli/commands/plan.js.map +1 -1
  59. package/dist/cli/commands/profile.js +23 -15
  60. package/dist/cli/commands/profile.js.map +1 -1
  61. package/dist/cli/commands/recurrence-parsers.js +43 -25
  62. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  63. package/dist/cli/commands/reindex.d.ts +21 -5
  64. package/dist/cli/commands/reindex.js +345 -205
  65. package/dist/cli/commands/reindex.js.map +1 -1
  66. package/dist/cli/commands/restore.d.ts +8 -7
  67. package/dist/cli/commands/restore.js +105 -69
  68. package/dist/cli/commands/restore.js.map +1 -1
  69. package/dist/cli/commands/schema.js +33 -30
  70. package/dist/cli/commands/schema.js.map +1 -1
  71. package/dist/cli/commands/search.d.ts +10 -2
  72. package/dist/cli/commands/search.js +503 -470
  73. package/dist/cli/commands/search.js.map +1 -1
  74. package/dist/cli/commands/telemetry.js +98 -87
  75. package/dist/cli/commands/telemetry.js.map +1 -1
  76. package/dist/cli/commands/test-all.js +237 -168
  77. package/dist/cli/commands/test-all.js.map +1 -1
  78. package/dist/cli/commands/test.d.ts +6 -5
  79. package/dist/cli/commands/test.js +424 -344
  80. package/dist/cli/commands/test.js.map +1 -1
  81. package/dist/cli/commands/update-many.js +57 -42
  82. package/dist/cli/commands/update-many.js.map +1 -1
  83. package/dist/cli/commands/update.d.ts +1 -1
  84. package/dist/cli/commands/update.js +738 -671
  85. package/dist/cli/commands/update.js.map +1 -1
  86. package/dist/cli/commands/validate.d.ts +20 -1
  87. package/dist/cli/commands/validate.js +478 -343
  88. package/dist/cli/commands/validate.js.map +1 -1
  89. package/dist/cli/error-guidance.js +406 -361
  90. package/dist/cli/error-guidance.js.map +1 -1
  91. package/dist/cli/extension-command-help.js +27 -19
  92. package/dist/cli/extension-command-help.js.map +1 -1
  93. package/dist/cli/help-json-payload.js +57 -49
  94. package/dist/cli/help-json-payload.js.map +1 -1
  95. package/dist/cli/main.d.ts +47 -0
  96. package/dist/cli/main.js +474 -371
  97. package/dist/cli/main.js.map +1 -1
  98. package/dist/cli/migration-gates.js +22 -45
  99. package/dist/cli/migration-gates.js.map +1 -1
  100. package/dist/cli/register-list-query.js +299 -310
  101. package/dist/cli/register-list-query.js.map +1 -1
  102. package/dist/cli/register-mutation.js +763 -779
  103. package/dist/cli/register-mutation.js.map +1 -1
  104. package/dist/cli/register-operations.js +386 -362
  105. package/dist/cli/register-operations.js.map +1 -1
  106. package/dist/cli/register-setup.js +120 -101
  107. package/dist/cli/register-setup.js.map +1 -1
  108. package/dist/cli/registration-helpers.d.ts +4 -0
  109. package/dist/cli/registration-helpers.js +45 -56
  110. package/dist/cli/registration-helpers.js.map +1 -1
  111. package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
  112. package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
  113. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
  114. package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
  115. package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
  116. package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
  118. package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
  119. package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
  120. package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
  121. package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
  123. package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
  126. package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
  127. package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
  128. package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
  131. package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
  132. package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
  133. package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
  134. package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
  136. package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
  137. package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
  139. package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
  140. package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
  141. package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
  142. package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
  144. package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  146. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  147. package/dist/cli-bundle/chunks/{chunk-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
  148. package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
  149. package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
  150. package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
  151. package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
  152. package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
  154. package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
  156. package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
  158. package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
  159. package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
  162. package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
  164. package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
  166. package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
  168. package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
  169. package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
  170. package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
  172. package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
  173. package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
  175. package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
  177. package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
  179. package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
  180. package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
  182. package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
  184. package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
  186. package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
  187. package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
  188. package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
  190. package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
  191. package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
  192. package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
  193. package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
  194. package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
  196. package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
  198. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
  199. package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
  200. package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
  202. package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
  204. package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
  206. package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
  208. package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
  209. package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
  210. package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
  211. package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
  212. package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
  213. package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
  214. package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
  216. package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
  218. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
  219. package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
  220. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
  221. package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
  222. package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
  223. package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
  225. package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
  226. package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
  227. package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
  228. package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
  229. package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
  230. package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
  231. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
  232. package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
  233. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
  234. package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
  235. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
  236. package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
  237. package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
  238. package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
  239. package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
  240. package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
  241. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  242. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  243. package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
  244. package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
  246. package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
  247. package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
  248. package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
  249. package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
  250. package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
  251. package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
  252. package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
  254. package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
  256. package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
  257. package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
  258. package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
  259. package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
  260. package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
  262. package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
  263. package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
  264. package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
  265. package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
  266. package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
  267. package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
  268. package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
  269. package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
  270. package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
  271. package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
  272. package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
  273. package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
  274. package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
  275. package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
  276. package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
  277. package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
  278. package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
  279. package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
  280. package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
  281. package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
  282. package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
  283. package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
  284. package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
  285. package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
  286. package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
  287. package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
  288. package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
  289. package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
  290. package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
  291. package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
  292. package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
  294. package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
  295. package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
  296. package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
  297. package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
  298. package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
  299. package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
  300. package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
  301. package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
  302. package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
  303. package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
  304. package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
  306. package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
  307. package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
  308. package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
  309. package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
  310. package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
  311. package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
  312. package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
  313. package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
  314. package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
  315. package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
  316. package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
  317. package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
  318. package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
  319. package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
  320. package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
  322. package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
  323. package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
  324. package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
  325. package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
  326. package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
  327. package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
  328. package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
  329. package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
  330. package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
  331. package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
  332. package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
  333. package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
  334. package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
  335. package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
  336. package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
  337. package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
  338. package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
  339. package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
  340. package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
  341. package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
  342. package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
  343. package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
  344. package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
  345. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
  346. package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
  347. package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
  348. package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
  349. package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
  350. package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
  351. package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
  352. package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
  353. package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
  354. package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
  355. package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
  356. package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
  357. package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
  358. package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
  359. package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
  360. package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
  361. package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
  362. package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
  363. package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
  364. package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
  365. package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
  366. package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
  367. package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
  368. package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
  369. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
  370. package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
  371. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
  372. package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
  373. package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
  374. package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
  375. package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
  376. package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
  377. package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
  378. package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
  379. package/dist/cli-bundle/main.js +1107 -916
  380. package/dist/cli-bundle/main.js.map +3 -3
  381. package/dist/core/config/nested-settings.js +89 -67
  382. package/dist/core/config/nested-settings.js.map +1 -1
  383. package/dist/core/governance/metadata-coverage.js +20 -28
  384. package/dist/core/governance/metadata-coverage.js.map +1 -1
  385. package/dist/core/history/drift-scan.js +93 -81
  386. package/dist/core/history/drift-scan.js.map +1 -1
  387. package/dist/core/item/item-type-definition.js +14 -14
  388. package/dist/core/item/item-type-definition.js.map +1 -1
  389. package/dist/core/item/type-registry.js +114 -99
  390. package/dist/core/item/type-registry.js.map +1 -1
  391. package/dist/core/output/mutation-projection.js +42 -26
  392. package/dist/core/output/mutation-projection.js.map +1 -1
  393. package/dist/core/schema/runtime-schema.js +97 -80
  394. package/dist/core/schema/runtime-schema.js.map +1 -1
  395. package/dist/core/schema/status-defs-file.js +26 -3
  396. package/dist/core/schema/status-defs-file.js.map +1 -1
  397. package/dist/core/search/corpus.js +25 -19
  398. package/dist/core/search/corpus.js.map +1 -1
  399. package/dist/core/search/semantic-defaults.js +64 -37
  400. package/dist/core/search/semantic-defaults.js.map +1 -1
  401. package/dist/core/search/vector-stores.js +32 -17
  402. package/dist/core/search/vector-stores.js.map +1 -1
  403. package/dist/core/sentry/helpers.js +31 -28
  404. package/dist/core/sentry/helpers.js.map +1 -1
  405. package/dist/core/sentry/instrument.js +54 -43
  406. package/dist/core/sentry/instrument.js.map +1 -1
  407. package/dist/core/shared/memo.d.ts +12 -0
  408. package/dist/core/shared/memo.js +25 -0
  409. package/dist/core/shared/memo.js.map +1 -0
  410. package/dist/core/shared/serialization.js +24 -14
  411. package/dist/core/shared/serialization.js.map +1 -1
  412. package/dist/core/shared/time.js +26 -4
  413. package/dist/core/shared/time.js.map +1 -1
  414. package/dist/core/store/front-matter-cache.d.ts +5 -0
  415. package/dist/core/store/front-matter-cache.js +316 -171
  416. package/dist/core/store/front-matter-cache.js.map +1 -1
  417. package/dist/core/store/item-store.js +33 -26
  418. package/dist/core/store/item-store.js.map +1 -1
  419. package/dist/core/store/settings.js +247 -203
  420. package/dist/core/store/settings.js.map +1 -1
  421. package/dist/core/test/background-runs.js +189 -160
  422. package/dist/core/test/background-runs.js.map +1 -1
  423. package/dist/sdk/cli-contracts/flag-contracts.js +71 -99
  424. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  425. package/dist/sdk/compose.js +51 -42
  426. package/dist/sdk/compose.js.map +1 -1
  427. package/docs/AGENT_GUIDE.md +2 -2
  428. package/docs/ARCHITECTURE.md +2 -2
  429. package/docs/COMMANDS.md +8 -4
  430. package/docs/CONFIGURATION.md +1 -1
  431. package/docs/EXTENSIONS.md +12 -12
  432. package/docs/ONBOARDING.md +4 -2
  433. package/docs/README.md +2 -0
  434. package/docs/examples/starter-extension/README.md +11 -10
  435. package/marketplace.json +3 -3
  436. package/package.json +2 -2
  437. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  438. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  439. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  440. package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
  441. package/plugins/pm-claude/README.md +6 -3
  442. package/plugins/pm-claude/commands/pm-init.md +1 -1
  443. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
  444. package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
  445. package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
  447. package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
  464. package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
  469. package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
  470. package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
  478. package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
  479. package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
  481. package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
  483. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
  484. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
  485. package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
  486. package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
  487. package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
  488. package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
  489. package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
  490. package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
  491. package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
  492. package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
  493. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
  494. package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
  495. package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
  496. package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
  497. package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
  498. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
  499. package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
  500. package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
  501. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
  502. package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
  503. package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
  504. package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
  505. package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
  506. package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
  507. package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
  508. package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
  509. package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
  510. package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
  511. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
  512. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
  513. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
  514. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
  515. package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
  516. package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
  517. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
  518. package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
  522. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
  523. package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
  524. package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
  525. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
  526. package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
  527. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
  528. package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
  529. package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
  531. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
  532. package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
  533. package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
  534. /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
@@ -4,7 +4,7 @@
4
4
  * Implements the pm config command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0be07fdd-a74d-5d01-a1b7-bd26e021bf20")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a420e612-3d4b-5ebd-864e-a1a4bec5e45d")}catch(e){}}();
8
8
  import { pathExists } from "../../core/fs/fs-utils.js";
9
9
  import { resolveConfigPositionalValue } from "../../core/config/positional-value.js";
10
10
  import { NESTED_SETTING_DESCRIPTORS, parseNestedSettingValue, readNestedSettingValue, resolveNestedSettingDescriptor, writeNestedSettingValue, } from "../../core/config/nested-settings.js";
@@ -124,6 +124,7 @@ const CONFIG_KEY_ALIASES = {
124
124
  // hint so agents see ~21 keys instead of all ~45 kebab+snake variants; snake_case
125
125
  // forms stay fully accepted as input via CONFIG_KEY_VALUES/normalizeKey.
126
126
  const CANONICAL_CONFIG_KEYS = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => CONFIG_KEY_ALIASES[candidate][0]);
127
+ const CONFIG_KEY_BY_ALIAS = Object.fromEntries(Object.keys(CONFIG_KEY_ALIASES).flatMap((key) => CONFIG_KEY_ALIASES[key].map((alias) => [alias, key])));
127
128
  const CONFIG_KEY_SUMMARIES = {
128
129
  definition_of_done: "Definition of Done criteria list.",
129
130
  item_format: "Default item file format.",
@@ -156,8 +157,38 @@ const LIFECYCLE_PATTERN_CONFIG_KEYS = [
156
157
  "lifecycle_closure_like_resolution_patterns",
157
158
  "lifecycle_closure_like_actual_result_patterns",
158
159
  ];
160
+ const CRITERIA_CONFIG_KEYS = new Set([
161
+ "metadata_required_fields",
162
+ ...LIFECYCLE_PATTERN_CONFIG_KEYS,
163
+ ]);
164
+ const TRACKING_CONFIG_KEYS = new Set([
165
+ "test_result_tracking",
166
+ "telemetry_tracking",
167
+ ]);
168
+ const GOVERNANCE_BOOLEAN_CONFIG_KEYS = new Set([
169
+ "governance_require_close_reason",
170
+ "governance_force_required_for_stale_lock",
171
+ ]);
172
+ const GOVERNANCE_POLICY_CONFIG_KEYS = new Set([
173
+ "governance_ownership_enforcement",
174
+ "governance_create_mode_default",
175
+ "governance_close_validation_default",
176
+ ]);
177
+ const GOVERNANCE_VALIDATION_CONFIG_KEYS = new Set([
178
+ "governance_parent_reference_policy",
179
+ "governance_metadata_validation_profile",
180
+ "governance_workflow_enforcement",
181
+ ]);
182
+ const GOVERNANCE_PRESET_OR_TYPE_CONFIG_KEYS = new Set([
183
+ "governance_preset",
184
+ "governance_create_default_type",
185
+ ]);
186
+ const isCriteriaValueConfigKey = (key) => CRITERIA_CONFIG_KEYS.has(key);
187
+ const isGovernancePolicyConfigKey = (key) => GOVERNANCE_POLICY_CONFIG_KEYS.has(key);
188
+ const isGovernanceValidationConfigKey = (key) => GOVERNANCE_VALIDATION_CONFIG_KEYS.has(key);
189
+ const isGovernancePresetOrTypeConfigKey = (key) => GOVERNANCE_PRESET_OR_TYPE_CONFIG_KEYS.has(key);
159
190
  function isCriteriaConfigKey(key) {
160
- return key === "definition_of_done" || key === "metadata_required_fields" || LIFECYCLE_PATTERN_CONFIG_KEYS.includes(key);
191
+ return key === "definition_of_done" || isCriteriaValueConfigKey(key);
161
192
  }
162
193
  function normalizeScope(value) {
163
194
  if (CONFIG_SCOPE_VALUES.includes(value)) {
@@ -172,83 +203,9 @@ function normalizeAction(value) {
172
203
  throw new PmCliError(`Invalid config action "${value}". Allowed: get, set, list, export`, EXIT_CODE.USAGE);
173
204
  }
174
205
  function normalizeKey(value) {
175
- if (CONFIG_KEY_VALUES.includes(value)) {
176
- if (value === "item-format" || value === "item_format") {
177
- return "item_format";
178
- }
179
- if (value === "history-missing-stream-policy" || value === "history_missing_stream_policy") {
180
- return "history_missing_stream_policy";
181
- }
182
- if (value === "sprint-release-format-policy" || value === "sprint_release_format_policy") {
183
- return "sprint_release_format_policy";
184
- }
185
- if (value === "parent-reference-policy" || value === "parent_reference_policy") {
186
- return "parent_reference_policy";
187
- }
188
- if (value === "metadata-validation-profile" || value === "metadata_validation_profile") {
189
- return "metadata_validation_profile";
190
- }
191
- if (value === "metadata-required-fields" || value === "metadata_required_fields") {
192
- return "metadata_required_fields";
193
- }
194
- if (value === "lifecycle-stale-blocker-reason-patterns" ||
195
- value === "lifecycle_stale_blocker_reason_patterns") {
196
- return "lifecycle_stale_blocker_reason_patterns";
197
- }
198
- if (value === "lifecycle-closure-like-blocked-reason-patterns" ||
199
- value === "lifecycle_closure_like_blocked_reason_patterns") {
200
- return "lifecycle_closure_like_blocked_reason_patterns";
201
- }
202
- if (value === "lifecycle-closure-like-resolution-patterns" ||
203
- value === "lifecycle_closure_like_resolution_patterns") {
204
- return "lifecycle_closure_like_resolution_patterns";
205
- }
206
- if (value === "lifecycle-closure-like-actual-result-patterns" ||
207
- value === "lifecycle_closure_like_actual_result_patterns") {
208
- return "lifecycle_closure_like_actual_result_patterns";
209
- }
210
- if (value === "governance-preset" || value === "governance_preset") {
211
- return "governance_preset";
212
- }
213
- if (value === "governance-ownership-enforcement" || value === "governance_ownership_enforcement") {
214
- return "governance_ownership_enforcement";
215
- }
216
- if (value === "governance-create-mode-default" || value === "governance_create_mode_default") {
217
- return "governance_create_mode_default";
218
- }
219
- if (value === "governance-close-validation-default" || value === "governance_close_validation_default") {
220
- return "governance_close_validation_default";
221
- }
222
- if (value === "governance-require-close-reason" || value === "governance_require_close_reason") {
223
- return "governance_require_close_reason";
224
- }
225
- if (value === "governance-create-default-type" || value === "governance_create_default_type") {
226
- return "governance_create_default_type";
227
- }
228
- if (value === "governance-workflow-enforcement" || value === "governance_workflow_enforcement") {
229
- return "governance_workflow_enforcement";
230
- }
231
- if (value === "governance-parent-reference-policy" || value === "governance_parent_reference_policy") {
232
- return "governance_parent_reference_policy";
233
- }
234
- if (value === "governance-metadata-validation-profile" ||
235
- value === "governance_metadata_validation_profile") {
236
- return "governance_metadata_validation_profile";
237
- }
238
- if (value === "governance-force-required-for-stale-lock" ||
239
- value === "governance_force_required_for_stale_lock") {
240
- return "governance_force_required_for_stale_lock";
241
- }
242
- if (value === "test-result-tracking" || value === "test_result_tracking") {
243
- return "test_result_tracking";
244
- }
245
- if (value === "telemetry-tracking" || value === "telemetry_tracking") {
246
- return "telemetry_tracking";
247
- }
248
- if (value === "context") {
249
- return "context";
250
- }
251
- return "definition_of_done";
206
+ const key = CONFIG_KEY_BY_ALIAS[value];
207
+ if (key) {
208
+ return key;
252
209
  }
253
210
  const nestedKeys = NESTED_SETTING_DESCRIPTORS.map((descriptor) => descriptor.key).join(", ");
254
211
  throw new PmCliError(`Invalid config key "${value}". Supported: ${CANONICAL_CONFIG_KEYS.join(", ")} (underscore variants also accepted). Nested leaf settings: ${nestedKeys}.`, EXIT_CODE.USAGE);
@@ -479,82 +436,47 @@ function assertConfigKeyDefined(key) {
479
436
  throw new PmCliError("Config action requires <key>", EXIT_CODE.USAGE);
480
437
  }
481
438
  }
439
+ const CONFIG_VALUE_READERS = {
440
+ definition_of_done: (settings) => [...settings.workflow.definition_of_done],
441
+ item_format: (settings) => settings.item_format,
442
+ history_missing_stream_policy: (settings) => settings.history.missing_stream,
443
+ sprint_release_format_policy: (settings) => settings.validation.sprint_release_format,
444
+ parent_reference_policy: (settings) => settings.validation.parent_reference,
445
+ metadata_validation_profile: (settings) => settings.validation.metadata_profile,
446
+ metadata_required_fields: (settings) => [...settings.validation.metadata_required_fields],
447
+ lifecycle_stale_blocker_reason_patterns: (settings) => [
448
+ ...settings.validation.lifecycle_stale_blocker_reason_patterns,
449
+ ],
450
+ lifecycle_closure_like_blocked_reason_patterns: (settings) => [
451
+ ...settings.validation.lifecycle_closure_like_blocked_reason_patterns,
452
+ ],
453
+ lifecycle_closure_like_resolution_patterns: (settings) => [
454
+ ...settings.validation.lifecycle_closure_like_resolution_patterns,
455
+ ],
456
+ lifecycle_closure_like_actual_result_patterns: (settings) => [
457
+ ...settings.validation.lifecycle_closure_like_actual_result_patterns,
458
+ ],
459
+ governance_preset: (settings) => settings.governance.preset,
460
+ governance_ownership_enforcement: (settings) => settings.governance.ownership_enforcement,
461
+ governance_create_mode_default: (settings) => settings.governance.create_mode_default,
462
+ governance_close_validation_default: (settings) => settings.governance.close_validation_default,
463
+ governance_require_close_reason: (settings) => settings.governance.require_close_reason ? "enabled" : "disabled",
464
+ governance_create_default_type: (settings) => settings.governance.create_default_type ?? "",
465
+ governance_workflow_enforcement: (settings) => settings.governance.workflow_enforcement ?? "off",
466
+ governance_parent_reference_policy: (settings) => settings.governance.parent_reference,
467
+ governance_metadata_validation_profile: (settings) => settings.governance.metadata_profile,
468
+ governance_force_required_for_stale_lock: (settings) => settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
469
+ test_result_tracking: (settings) => settings.testing.record_results_to_items ? "enabled" : "disabled",
470
+ telemetry_tracking: (settings) => settings.telemetry.enabled ? "enabled" : "disabled",
471
+ context: (settings) => ({
472
+ default_depth: settings.context.default_depth,
473
+ activity_limit: settings.context.activity_limit,
474
+ stale_threshold_days: settings.context.stale_threshold_days,
475
+ sections: { ...settings.context.sections },
476
+ }),
477
+ };
482
478
  function readConfigValue(settings, key) {
483
- if (key === "item_format") {
484
- return settings.item_format;
485
- }
486
- if (key === "history_missing_stream_policy") {
487
- return settings.history.missing_stream;
488
- }
489
- if (key === "sprint_release_format_policy") {
490
- return settings.validation.sprint_release_format;
491
- }
492
- if (key === "parent_reference_policy") {
493
- return settings.validation.parent_reference;
494
- }
495
- if (key === "metadata_validation_profile") {
496
- return settings.validation.metadata_profile;
497
- }
498
- if (key === "metadata_required_fields") {
499
- return [...settings.validation.metadata_required_fields];
500
- }
501
- if (key === "lifecycle_stale_blocker_reason_patterns") {
502
- return [...settings.validation.lifecycle_stale_blocker_reason_patterns];
503
- }
504
- if (key === "lifecycle_closure_like_blocked_reason_patterns") {
505
- return [...settings.validation.lifecycle_closure_like_blocked_reason_patterns];
506
- }
507
- if (key === "lifecycle_closure_like_resolution_patterns") {
508
- return [...settings.validation.lifecycle_closure_like_resolution_patterns];
509
- }
510
- if (key === "lifecycle_closure_like_actual_result_patterns") {
511
- return [...settings.validation.lifecycle_closure_like_actual_result_patterns];
512
- }
513
- if (key === "governance_preset") {
514
- return settings.governance.preset;
515
- }
516
- if (key === "governance_ownership_enforcement") {
517
- return settings.governance.ownership_enforcement;
518
- }
519
- if (key === "governance_create_mode_default") {
520
- return settings.governance.create_mode_default;
521
- }
522
- if (key === "governance_close_validation_default") {
523
- return settings.governance.close_validation_default;
524
- }
525
- if (key === "governance_require_close_reason") {
526
- return settings.governance.require_close_reason ? "enabled" : "disabled";
527
- }
528
- if (key === "governance_create_default_type") {
529
- return settings.governance.create_default_type ?? "";
530
- }
531
- if (key === "governance_workflow_enforcement") {
532
- return settings.governance.workflow_enforcement ?? "off";
533
- }
534
- if (key === "governance_parent_reference_policy") {
535
- return settings.governance.parent_reference;
536
- }
537
- if (key === "governance_metadata_validation_profile") {
538
- return settings.governance.metadata_profile;
539
- }
540
- if (key === "governance_force_required_for_stale_lock") {
541
- return settings.governance.force_required_for_stale_lock ? "enabled" : "disabled";
542
- }
543
- if (key === "test_result_tracking") {
544
- return settings.testing.record_results_to_items ? "enabled" : "disabled";
545
- }
546
- if (key === "telemetry_tracking") {
547
- return settings.telemetry.enabled ? "enabled" : "disabled";
548
- }
549
- if (key === "context") {
550
- return {
551
- default_depth: settings.context.default_depth,
552
- activity_limit: settings.context.activity_limit,
553
- stale_threshold_days: settings.context.stale_threshold_days,
554
- sections: { ...settings.context.sections },
555
- };
556
- }
557
- return [...settings.workflow.definition_of_done];
479
+ return CONFIG_VALUE_READERS[key](settings);
558
480
  }
559
481
  function withWarnings(result, warnings) {
560
482
  if (warnings.length === 0) {
@@ -653,6 +575,12 @@ async function applyContextConfig(settings, options, target, scope, warnings) {
653
575
  changed,
654
576
  }, warnings);
655
577
  }
578
+ function applyNestedSettingPositionalValue(keyValue, valueValue, options) {
579
+ if (options.value !== undefined && options.value !== valueValue) {
580
+ throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --value "${options.value}". Pass only one.`, EXIT_CODE.USAGE);
581
+ }
582
+ return { ...options, value: valueValue };
583
+ }
656
584
  /**
657
585
  * Route an intuitive `pm config set <key> <value>` positional value onto the typed
658
586
  * flag it belongs to (--format/--policy/--criterion), applying enabled/disabled
@@ -671,12 +599,7 @@ function applyPositionalValue(action, keyValue, normalizedKey, nestedSetting, va
671
599
  throw new PmCliError('Config action "set" requires <key> before a positional <value>.', EXIT_CODE.USAGE);
672
600
  }
673
601
  if (nestedSetting) {
674
- if (options.value !== undefined && valueValue !== undefined && options.value !== valueValue) {
675
- throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --value "${options.value}". Pass only one.`, EXIT_CODE.USAGE);
676
- }
677
- // valueValue is guaranteed defined here (the valueValue === undefined early return
678
- // above preserves a pre-existing --value), so this never overwrites --value.
679
- return { ...options, value: valueValue };
602
+ return applyNestedSettingPositionalValue(keyValue, valueValue, options);
680
603
  }
681
604
  assertConfigKeyDefined(normalizedKey);
682
605
  const routed = resolveConfigPositionalValue(normalizedKey, valueValue);
@@ -706,770 +629,411 @@ function applyPositionalValue(action, keyValue, normalizedKey, nestedSetting, va
706
629
  }
707
630
  return { ...options, policy: routed.value };
708
631
  }
709
- /**
710
- * Implements run config for the public runtime surface of this module.
711
- */
712
- export async function runConfig(scopeValue, actionValue, keyValue, options, global, valueValue) {
713
- const scope = normalizeScope(scopeValue);
714
- const action = normalizeAction(actionValue);
715
- // Nested leaf settings (search/provider/vector-store) are detected before
716
- // normalizeKey so they bypass the ConfigKey union without breaking the
717
- // existing key-not-found error path for actually-unknown keys.
718
- const nestedSetting = (action === "get" || action === "set") ? resolveNestedSettingDescriptor(keyValue) : undefined;
719
- const key = nestedSetting ? undefined : normalizeKeyForAction(action, keyValue);
720
- options = applyPositionalValue(action, keyValue, key, nestedSetting, valueValue, options);
721
- const target = await resolveSettingsTarget(scope, global);
722
- const { settings, metadata, warnings: settingsReadWarnings } = await readSettingsWithMetadata(target.pmRoot);
723
- const warnings = normalizeWarnings(settingsReadWarnings);
724
- if (nestedSetting) {
725
- if (action === "get") {
726
- const currentValue = readNestedSettingValue(settings, nestedSetting);
727
- return withWarnings({
728
- scope,
729
- key: nestedSetting.key,
730
- nested_setting: {
731
- key: nestedSetting.key,
732
- path: nestedSetting.path,
733
- kind: nestedSetting.kind,
734
- value: currentValue,
735
- },
736
- settings_path: target.settingsPath,
737
- changed: false,
738
- }, warnings);
739
- }
740
- // action === "set"
741
- const rawValue = options.value;
742
- if (typeof rawValue !== "string") {
743
- throw new PmCliError(`Config set ${nestedSetting.key} requires a value. Pass it positionally (\`pm config ${scope} set ${nestedSetting.key} <value>\`) or via --value.`, EXIT_CODE.USAGE);
744
- }
745
- const parsed = parseNestedSettingValue(nestedSetting, rawValue);
746
- if (!parsed.ok) {
747
- throw new PmCliError(parsed.error.message, EXIT_CODE.USAGE);
748
- }
749
- const changed = writeNestedSettingValue(settings, nestedSetting, parsed.parsed.value);
750
- if (changed) {
751
- await writeSettings(target.pmRoot, settings, `config:set:${nestedSetting.path}`);
752
- }
632
+ function buildConfigListResult(context) {
633
+ const keys = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => ({
634
+ key: candidate,
635
+ aliases: CONFIG_KEY_ALIASES[candidate],
636
+ value_kind: candidate === "context"
637
+ ? "object"
638
+ : isCriteriaConfigKey(candidate) ? "string_array" : "enum",
639
+ set_flags: candidate === "context"
640
+ ? ["--default-depth", "--activity-limit", "--stale-threshold-days", "--section-<name>"]
641
+ : isCriteriaConfigKey(candidate) ? ["--criterion", "--clear-criteria"] : candidate === "item_format" ? ["--format"] : ["--policy"],
642
+ summary: CONFIG_KEY_SUMMARIES[candidate],
643
+ value: readConfigValue(context.settings, candidate),
644
+ }));
645
+ const nestedSettings = NESTED_SETTING_DESCRIPTORS.map((descriptor) => ({
646
+ key: descriptor.key,
647
+ path: descriptor.path,
648
+ kind: descriptor.kind,
649
+ value: readNestedSettingValue(context.settings, descriptor),
650
+ }));
651
+ return withWarnings({
652
+ scope: context.scope,
653
+ keys,
654
+ nested_settings: nestedSettings,
655
+ count: keys.length,
656
+ settings_path: context.target.settingsPath,
657
+ changed: false,
658
+ }, context.warnings);
659
+ }
660
+ function buildConfigExportResult(context) {
661
+ const values = Object.fromEntries(Object.keys(CONFIG_KEY_ALIASES).map((key) => [key, readConfigValue(context.settings, key)]));
662
+ return withWarnings({
663
+ scope: context.scope,
664
+ values,
665
+ settings_path: context.target.settingsPath,
666
+ changed: false,
667
+ }, context.warnings);
668
+ }
669
+ function buildConfigGetResult(context, key) {
670
+ const value = readConfigValue(context.settings, key);
671
+ const base = {
672
+ scope: context.scope,
673
+ key,
674
+ settings_path: context.target.settingsPath,
675
+ changed: false,
676
+ };
677
+ if (key === "item_format") {
753
678
  return withWarnings({
754
- scope,
679
+ ...base,
680
+ format: context.settings.item_format,
681
+ has_explicit_item_format: context.metadata.has_explicit_item_format,
682
+ }, context.warnings);
683
+ }
684
+ if (key === "context") {
685
+ return withWarnings({ ...base, context_settings: value }, context.warnings);
686
+ }
687
+ if (Array.isArray(value)) {
688
+ return withWarnings({ ...base, criteria: value }, context.warnings);
689
+ }
690
+ return withWarnings({ ...base, policy: value }, context.warnings);
691
+ }
692
+ async function buildNestedSettingResult(context, action, nestedSetting, options) {
693
+ if (action === "get") {
694
+ const currentValue = readNestedSettingValue(context.settings, nestedSetting);
695
+ return withWarnings({
696
+ scope: context.scope,
755
697
  key: nestedSetting.key,
756
698
  nested_setting: {
757
699
  key: nestedSetting.key,
758
700
  path: nestedSetting.path,
759
701
  kind: nestedSetting.kind,
760
- value: parsed.parsed.value,
702
+ value: currentValue,
761
703
  },
762
- settings_path: target.settingsPath,
763
- changed,
764
- }, warnings);
765
- }
766
- if (action === "list") {
767
- const keys = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => ({
768
- key: candidate,
769
- aliases: CONFIG_KEY_ALIASES[candidate],
770
- value_kind: candidate === "context"
771
- ? "object"
772
- : isCriteriaConfigKey(candidate) ? "string_array" : "enum",
773
- set_flags: candidate === "context"
774
- ? ["--default-depth", "--activity-limit", "--stale-threshold-days", "--section-<name>"]
775
- : isCriteriaConfigKey(candidate) ? ["--criterion", "--clear-criteria"] : candidate === "item_format" ? ["--format"] : ["--policy"],
776
- summary: CONFIG_KEY_SUMMARIES[candidate],
777
- value: readConfigValue(settings, candidate),
778
- }));
779
- const nestedSettings = NESTED_SETTING_DESCRIPTORS.map((descriptor) => ({
780
- key: descriptor.key,
781
- path: descriptor.path,
782
- kind: descriptor.kind,
783
- value: readNestedSettingValue(settings, descriptor),
784
- }));
785
- return withWarnings({
786
- scope,
787
- keys,
788
- nested_settings: nestedSettings,
789
- count: keys.length,
790
- settings_path: target.settingsPath,
704
+ settings_path: context.target.settingsPath,
791
705
  changed: false,
792
- }, warnings);
706
+ }, context.warnings);
793
707
  }
794
- if (action === "export") {
795
- const values = {
796
- definition_of_done: readConfigValue(settings, "definition_of_done"),
797
- item_format: readConfigValue(settings, "item_format"),
798
- history_missing_stream_policy: readConfigValue(settings, "history_missing_stream_policy"),
799
- sprint_release_format_policy: readConfigValue(settings, "sprint_release_format_policy"),
800
- parent_reference_policy: readConfigValue(settings, "parent_reference_policy"),
801
- metadata_validation_profile: readConfigValue(settings, "metadata_validation_profile"),
802
- metadata_required_fields: readConfigValue(settings, "metadata_required_fields"),
803
- lifecycle_stale_blocker_reason_patterns: readConfigValue(settings, "lifecycle_stale_blocker_reason_patterns"),
804
- lifecycle_closure_like_blocked_reason_patterns: readConfigValue(settings, "lifecycle_closure_like_blocked_reason_patterns"),
805
- lifecycle_closure_like_resolution_patterns: readConfigValue(settings, "lifecycle_closure_like_resolution_patterns"),
806
- lifecycle_closure_like_actual_result_patterns: readConfigValue(settings, "lifecycle_closure_like_actual_result_patterns"),
807
- governance_preset: readConfigValue(settings, "governance_preset"),
808
- governance_ownership_enforcement: readConfigValue(settings, "governance_ownership_enforcement"),
809
- governance_create_mode_default: readConfigValue(settings, "governance_create_mode_default"),
810
- governance_close_validation_default: readConfigValue(settings, "governance_close_validation_default"),
811
- governance_require_close_reason: readConfigValue(settings, "governance_require_close_reason"),
812
- governance_create_default_type: readConfigValue(settings, "governance_create_default_type"),
813
- governance_workflow_enforcement: readConfigValue(settings, "governance_workflow_enforcement"),
814
- governance_parent_reference_policy: readConfigValue(settings, "governance_parent_reference_policy"),
815
- governance_metadata_validation_profile: readConfigValue(settings, "governance_metadata_validation_profile"),
816
- governance_force_required_for_stale_lock: readConfigValue(settings, "governance_force_required_for_stale_lock"),
817
- test_result_tracking: readConfigValue(settings, "test_result_tracking"),
818
- telemetry_tracking: readConfigValue(settings, "telemetry_tracking"),
819
- context: readConfigValue(settings, "context"),
820
- };
821
- return withWarnings({
822
- scope,
823
- values,
824
- settings_path: target.settingsPath,
825
- changed: false,
826
- }, warnings);
708
+ const rawValue = options.value;
709
+ if (typeof rawValue !== "string") {
710
+ throw new PmCliError(`Config set ${nestedSetting.key} requires a value. Pass it positionally (\`pm config ${context.scope} set ${nestedSetting.key} <value>\`) or via --value.`, EXIT_CODE.USAGE);
827
711
  }
828
- // For get/set (non-nested) `normalizeKeyForAction` already guaranteed a key above,
829
- // so `key` is defined here. list/export return before reaching these branches.
830
- if (action === "get") {
831
- assertConfigKeyDefined(key);
832
- if (key === "item_format") {
833
- return withWarnings({
834
- scope,
835
- key,
836
- format: settings.item_format,
837
- has_explicit_item_format: metadata.has_explicit_item_format,
838
- settings_path: target.settingsPath,
839
- changed: false,
840
- }, warnings);
841
- }
842
- if (key === "history_missing_stream_policy") {
843
- return withWarnings({
844
- scope,
845
- key,
846
- policy: settings.history.missing_stream,
847
- settings_path: target.settingsPath,
848
- changed: false,
849
- }, warnings);
850
- }
851
- if (key === "sprint_release_format_policy") {
852
- return withWarnings({
853
- scope,
854
- key,
855
- policy: settings.validation.sprint_release_format,
856
- settings_path: target.settingsPath,
857
- changed: false,
858
- }, warnings);
859
- }
860
- if (key === "parent_reference_policy") {
861
- return withWarnings({
862
- scope,
863
- key,
864
- policy: settings.validation.parent_reference,
865
- settings_path: target.settingsPath,
866
- changed: false,
867
- }, warnings);
868
- }
869
- if (key === "metadata_validation_profile") {
870
- return withWarnings({
871
- scope,
872
- key,
873
- policy: settings.validation.metadata_profile,
874
- settings_path: target.settingsPath,
875
- changed: false,
876
- }, warnings);
877
- }
878
- if (key === "metadata_required_fields") {
879
- return withWarnings({
880
- scope,
881
- key,
882
- criteria: [...settings.validation.metadata_required_fields],
883
- settings_path: target.settingsPath,
884
- changed: false,
885
- }, warnings);
886
- }
887
- if (key === "lifecycle_stale_blocker_reason_patterns") {
888
- return withWarnings({
889
- scope,
890
- key,
891
- criteria: [...settings.validation.lifecycle_stale_blocker_reason_patterns],
892
- settings_path: target.settingsPath,
893
- changed: false,
894
- }, warnings);
895
- }
896
- if (key === "lifecycle_closure_like_blocked_reason_patterns") {
897
- return withWarnings({
898
- scope,
899
- key,
900
- criteria: [...settings.validation.lifecycle_closure_like_blocked_reason_patterns],
901
- settings_path: target.settingsPath,
902
- changed: false,
903
- }, warnings);
904
- }
905
- if (key === "lifecycle_closure_like_resolution_patterns") {
906
- return withWarnings({
907
- scope,
908
- key,
909
- criteria: [...settings.validation.lifecycle_closure_like_resolution_patterns],
910
- settings_path: target.settingsPath,
911
- changed: false,
912
- }, warnings);
913
- }
914
- if (key === "lifecycle_closure_like_actual_result_patterns") {
915
- return withWarnings({
916
- scope,
917
- key,
918
- criteria: [...settings.validation.lifecycle_closure_like_actual_result_patterns],
919
- settings_path: target.settingsPath,
920
- changed: false,
921
- }, warnings);
922
- }
923
- if (key === "governance_preset") {
924
- return withWarnings({
925
- scope,
926
- key,
927
- policy: settings.governance.preset,
928
- settings_path: target.settingsPath,
929
- changed: false,
930
- }, warnings);
931
- }
932
- if (key === "governance_ownership_enforcement") {
933
- return withWarnings({
934
- scope,
935
- key,
936
- policy: settings.governance.ownership_enforcement,
937
- settings_path: target.settingsPath,
938
- changed: false,
939
- }, warnings);
940
- }
941
- if (key === "governance_create_mode_default") {
942
- return withWarnings({
943
- scope,
944
- key,
945
- policy: settings.governance.create_mode_default,
946
- settings_path: target.settingsPath,
947
- changed: false,
948
- }, warnings);
949
- }
950
- if (key === "governance_close_validation_default") {
951
- return withWarnings({
952
- scope,
953
- key,
954
- policy: settings.governance.close_validation_default,
955
- settings_path: target.settingsPath,
956
- changed: false,
957
- }, warnings);
958
- }
959
- if (key === "governance_require_close_reason") {
960
- return withWarnings({
961
- scope,
962
- key,
963
- policy: settings.governance.require_close_reason ? "enabled" : "disabled",
964
- settings_path: target.settingsPath,
965
- changed: false,
966
- }, warnings);
967
- }
968
- if (key === "governance_create_default_type") {
969
- return withWarnings({
970
- scope,
971
- key,
972
- policy: settings.governance.create_default_type ?? "",
973
- settings_path: target.settingsPath,
974
- changed: false,
975
- }, warnings);
976
- }
977
- if (key === "governance_workflow_enforcement") {
978
- return withWarnings({
979
- scope,
980
- key,
981
- policy: settings.governance.workflow_enforcement ?? "off",
982
- settings_path: target.settingsPath,
983
- changed: false,
984
- }, warnings);
985
- }
986
- if (key === "governance_parent_reference_policy") {
987
- return withWarnings({
988
- scope,
989
- key,
990
- policy: settings.governance.parent_reference,
991
- settings_path: target.settingsPath,
992
- changed: false,
993
- }, warnings);
994
- }
995
- if (key === "governance_metadata_validation_profile") {
996
- return withWarnings({
997
- scope,
998
- key,
999
- policy: settings.governance.metadata_profile,
1000
- settings_path: target.settingsPath,
1001
- changed: false,
1002
- }, warnings);
1003
- }
1004
- if (key === "governance_force_required_for_stale_lock") {
1005
- return withWarnings({
1006
- scope,
1007
- key,
1008
- policy: settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
1009
- settings_path: target.settingsPath,
1010
- changed: false,
1011
- }, warnings);
1012
- }
1013
- if (key === "test_result_tracking") {
1014
- return withWarnings({
1015
- scope,
1016
- key,
1017
- policy: settings.testing.record_results_to_items ? "enabled" : "disabled",
1018
- settings_path: target.settingsPath,
1019
- changed: false,
1020
- }, warnings);
1021
- }
1022
- if (key === "telemetry_tracking") {
1023
- return withWarnings({
1024
- scope,
1025
- key,
1026
- policy: settings.telemetry.enabled ? "enabled" : "disabled",
1027
- settings_path: target.settingsPath,
1028
- changed: false,
1029
- }, warnings);
1030
- }
1031
- if (key === "context") {
1032
- return withWarnings({
1033
- scope,
1034
- key,
1035
- context_settings: {
1036
- default_depth: settings.context.default_depth,
1037
- activity_limit: settings.context.activity_limit,
1038
- stale_threshold_days: settings.context.stale_threshold_days,
1039
- sections: { ...settings.context.sections },
1040
- },
1041
- settings_path: target.settingsPath,
1042
- changed: false,
1043
- }, warnings);
1044
- }
1045
- return withWarnings({
1046
- scope,
1047
- key,
1048
- criteria: [...settings.workflow.definition_of_done],
1049
- settings_path: target.settingsPath,
1050
- changed: false,
1051
- }, warnings);
712
+ const parsed = parseNestedSettingValue(nestedSetting, rawValue);
713
+ if (!parsed.ok) {
714
+ throw new PmCliError(parsed.error.message, EXIT_CODE.USAGE);
1052
715
  }
1053
- assertConfigKeyDefined(key);
1054
- if (options.clearCriteria === true && !isCriteriaConfigKey(key)) {
1055
- throw new PmCliError("--clear-criteria is only supported with config set criteria-list keys", EXIT_CODE.USAGE);
716
+ const changed = writeNestedSettingValue(context.settings, nestedSetting, parsed.parsed.value);
717
+ if (changed) {
718
+ await writeSettings(context.target.pmRoot, context.settings, `config:set:${nestedSetting.path}`);
1056
719
  }
1057
- if (key === "item_format") {
1058
- const nextFormat = normalizeItemFormat(options.format);
1059
- const changed = settings.item_format !== nextFormat || !metadata.has_explicit_item_format;
1060
- let migration = undefined;
1061
- if (changed) {
1062
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1063
- const migrated = await migrateItemFilesToFormat(target.pmRoot, nextFormat, "config:set:item_format:migrate", typeRegistry.type_to_folder, settings.schema);
1064
- migration = {
1065
- target_format: migrated.target_format,
1066
- scanned: migrated.scanned,
1067
- migrated: migrated.migrated,
1068
- removed: migrated.removed,
1069
- warnings: migrated.warnings,
1070
- };
1071
- settings.item_format = nextFormat;
1072
- await writeSettings(target.pmRoot, settings, "config:set:item_format");
1073
- }
1074
- return withWarnings({
1075
- scope,
1076
- key,
1077
- format: settings.item_format,
1078
- has_explicit_item_format: true,
1079
- migration,
1080
- settings_path: target.settingsPath,
1081
- changed,
1082
- }, warnings);
720
+ return withWarnings({
721
+ scope: context.scope,
722
+ key: nestedSetting.key,
723
+ nested_setting: {
724
+ key: nestedSetting.key,
725
+ path: nestedSetting.path,
726
+ kind: nestedSetting.kind,
727
+ value: parsed.parsed.value,
728
+ },
729
+ settings_path: context.target.settingsPath,
730
+ changed,
731
+ }, context.warnings);
732
+ }
733
+ async function writeConfigSettingsIfChanged(context, changed, reason) {
734
+ if (changed) {
735
+ await writeSettings(context.target.pmRoot, context.settings, reason);
1083
736
  }
737
+ }
738
+ function hasGovernanceValidationMirrorChange(governanceValue, validationValue, nextPolicy) {
739
+ return governanceValue !== nextPolicy || validationValue !== nextPolicy;
740
+ }
741
+ function buildPolicyResult(context, key, policy, changed) {
742
+ return withWarnings({
743
+ scope: context.scope,
744
+ key,
745
+ policy,
746
+ settings_path: context.target.settingsPath,
747
+ changed,
748
+ }, context.warnings);
749
+ }
750
+ function buildCriteriaResult(context, key, criteria, changed) {
751
+ return withWarnings({
752
+ scope: context.scope,
753
+ key,
754
+ criteria,
755
+ settings_path: context.target.settingsPath,
756
+ changed,
757
+ }, context.warnings);
758
+ }
759
+ async function setItemFormatConfig(context, options) {
760
+ const nextFormat = normalizeItemFormat(options.format);
761
+ const changed = context.settings.item_format !== nextFormat || !context.metadata.has_explicit_item_format;
762
+ let migration = undefined;
763
+ if (changed) {
764
+ const typeRegistry = resolveItemTypeRegistry(context.settings, getActiveExtensionRegistrations());
765
+ const migrated = await migrateItemFilesToFormat(context.target.pmRoot, nextFormat, "config:set:item_format:migrate", typeRegistry.type_to_folder, context.settings.schema);
766
+ migration = {
767
+ target_format: migrated.target_format,
768
+ scanned: migrated.scanned,
769
+ migrated: migrated.migrated,
770
+ removed: migrated.removed,
771
+ warnings: migrated.warnings,
772
+ };
773
+ context.settings.item_format = nextFormat;
774
+ await writeSettings(context.target.pmRoot, context.settings, "config:set:item_format");
775
+ }
776
+ return withWarnings({
777
+ scope: context.scope,
778
+ key: "item_format",
779
+ format: context.settings.item_format,
780
+ has_explicit_item_format: true,
781
+ migration,
782
+ settings_path: context.target.settingsPath,
783
+ changed,
784
+ }, context.warnings);
785
+ }
786
+ async function setValidationConfig(context, key, options) {
1084
787
  if (key === "history_missing_stream_policy") {
1085
788
  const nextPolicy = normalizeHistoryMissingStreamPolicy(options.policy);
1086
- const changed = settings.history.missing_stream !== nextPolicy;
1087
- settings.history.missing_stream = nextPolicy;
1088
- if (changed) {
1089
- await writeSettings(target.pmRoot, settings, "config:set:history_missing_stream_policy");
1090
- }
1091
- return withWarnings({
1092
- scope,
1093
- key,
1094
- policy: settings.history.missing_stream,
1095
- settings_path: target.settingsPath,
1096
- changed,
1097
- }, warnings);
789
+ const changed = context.settings.history.missing_stream !== nextPolicy;
790
+ context.settings.history.missing_stream = nextPolicy;
791
+ await writeConfigSettingsIfChanged(context, changed, "config:set:history_missing_stream_policy");
792
+ return buildPolicyResult(context, key, context.settings.history.missing_stream, changed);
1098
793
  }
1099
794
  if (key === "sprint_release_format_policy") {
1100
795
  const nextPolicy = normalizeSprintReleaseFormatPolicy(options.policy);
1101
- const changed = settings.validation.sprint_release_format !== nextPolicy;
1102
- settings.validation.sprint_release_format = nextPolicy;
1103
- if (changed) {
1104
- await writeSettings(target.pmRoot, settings, "config:set:sprint_release_format_policy");
1105
- }
1106
- return withWarnings({
1107
- scope,
1108
- key,
1109
- policy: settings.validation.sprint_release_format,
1110
- settings_path: target.settingsPath,
1111
- changed,
1112
- }, warnings);
796
+ const changed = context.settings.validation.sprint_release_format !== nextPolicy;
797
+ context.settings.validation.sprint_release_format = nextPolicy;
798
+ await writeConfigSettingsIfChanged(context, changed, "config:set:sprint_release_format_policy");
799
+ return buildPolicyResult(context, key, context.settings.validation.sprint_release_format, changed);
1113
800
  }
1114
801
  if (key === "parent_reference_policy") {
1115
802
  const nextPolicy = normalizeParentReferencePolicy(options.policy);
1116
- const changed = settings.validation.parent_reference !== nextPolicy ||
1117
- settings.governance.preset !== "custom" ||
1118
- settings.governance.parent_reference !== nextPolicy;
1119
- settings.validation.parent_reference = nextPolicy;
1120
- settings.governance.preset = "custom";
1121
- settings.governance.parent_reference = nextPolicy;
1122
- if (changed) {
1123
- await writeSettings(target.pmRoot, settings, "config:set:parent_reference_policy");
1124
- }
1125
- return withWarnings({
1126
- scope,
1127
- key,
1128
- policy: settings.validation.parent_reference,
1129
- settings_path: target.settingsPath,
1130
- changed,
1131
- }, warnings);
1132
- }
1133
- if (key === "metadata_validation_profile") {
1134
- const nextPolicy = normalizeValidateMetadataProfile(options.policy);
1135
- const changed = settings.validation.metadata_profile !== nextPolicy ||
1136
- settings.governance.preset !== "custom" ||
1137
- settings.governance.metadata_profile !== nextPolicy;
1138
- settings.validation.metadata_profile = nextPolicy;
1139
- settings.governance.preset = "custom";
1140
- settings.governance.metadata_profile = nextPolicy;
1141
- if (changed) {
1142
- await writeSettings(target.pmRoot, settings, "config:set:metadata_validation_profile");
1143
- }
1144
- return withWarnings({
1145
- scope,
1146
- key,
1147
- policy: settings.validation.metadata_profile,
1148
- settings_path: target.settingsPath,
1149
- changed,
1150
- }, warnings);
1151
- }
803
+ const changed = context.settings.validation.parent_reference !== nextPolicy ||
804
+ context.settings.governance.preset !== "custom" ||
805
+ context.settings.governance.parent_reference !== nextPolicy;
806
+ context.settings.validation.parent_reference = nextPolicy;
807
+ context.settings.governance.preset = "custom";
808
+ context.settings.governance.parent_reference = nextPolicy;
809
+ await writeConfigSettingsIfChanged(context, changed, "config:set:parent_reference_policy");
810
+ return buildPolicyResult(context, key, context.settings.validation.parent_reference, changed);
811
+ }
812
+ const nextPolicy = normalizeValidateMetadataProfile(options.policy);
813
+ const changed = context.settings.validation.metadata_profile !== nextPolicy ||
814
+ context.settings.governance.preset !== "custom" ||
815
+ context.settings.governance.metadata_profile !== nextPolicy;
816
+ context.settings.validation.metadata_profile = nextPolicy;
817
+ context.settings.governance.preset = "custom";
818
+ context.settings.governance.metadata_profile = nextPolicy;
819
+ await writeConfigSettingsIfChanged(context, changed, "config:set:metadata_validation_profile");
820
+ return buildPolicyResult(context, key, context.settings.validation.metadata_profile, changed);
821
+ }
822
+ async function setCriteriaConfig(context, key, options) {
1152
823
  if (key === "metadata_required_fields") {
1153
824
  const nextCriteria = normalizeMetadataRequiredFields(options.criterion, options.clearCriteria);
1154
- const changed = nextCriteria.length !== settings.validation.metadata_required_fields.length ||
1155
- nextCriteria.some((value, index) => value !== settings.validation.metadata_required_fields[index]);
1156
- settings.validation.metadata_required_fields = nextCriteria;
1157
- if (changed) {
1158
- await writeSettings(target.pmRoot, settings, "config:set:metadata_required_fields");
1159
- }
1160
- return withWarnings({
1161
- scope,
1162
- key,
1163
- criteria: [...settings.validation.metadata_required_fields],
1164
- settings_path: target.settingsPath,
1165
- changed,
1166
- }, warnings);
1167
- }
1168
- if (key === "lifecycle_stale_blocker_reason_patterns") {
1169
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1170
- const changed = nextCriteria.length !== settings.validation.lifecycle_stale_blocker_reason_patterns.length ||
1171
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_stale_blocker_reason_patterns[index]);
1172
- settings.validation.lifecycle_stale_blocker_reason_patterns = nextCriteria;
1173
- if (changed) {
1174
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_stale_blocker_reason_patterns");
1175
- }
1176
- return withWarnings({
1177
- scope,
1178
- key,
1179
- criteria: [...settings.validation.lifecycle_stale_blocker_reason_patterns],
1180
- settings_path: target.settingsPath,
1181
- changed,
1182
- }, warnings);
1183
- }
1184
- if (key === "lifecycle_closure_like_blocked_reason_patterns") {
1185
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1186
- const changed = nextCriteria.length !== settings.validation.lifecycle_closure_like_blocked_reason_patterns.length ||
1187
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_closure_like_blocked_reason_patterns[index]);
1188
- settings.validation.lifecycle_closure_like_blocked_reason_patterns = nextCriteria;
1189
- if (changed) {
1190
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_blocked_reason_patterns");
1191
- }
1192
- return withWarnings({
1193
- scope,
1194
- key,
1195
- criteria: [...settings.validation.lifecycle_closure_like_blocked_reason_patterns],
1196
- settings_path: target.settingsPath,
1197
- changed,
1198
- }, warnings);
1199
- }
1200
- if (key === "lifecycle_closure_like_resolution_patterns") {
1201
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1202
- const changed = nextCriteria.length !== settings.validation.lifecycle_closure_like_resolution_patterns.length ||
1203
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_closure_like_resolution_patterns[index]);
1204
- settings.validation.lifecycle_closure_like_resolution_patterns = nextCriteria;
1205
- if (changed) {
1206
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_resolution_patterns");
1207
- }
1208
- return withWarnings({
1209
- scope,
1210
- key,
1211
- criteria: [...settings.validation.lifecycle_closure_like_resolution_patterns],
1212
- settings_path: target.settingsPath,
1213
- changed,
1214
- }, warnings);
1215
- }
1216
- if (key === "lifecycle_closure_like_actual_result_patterns") {
1217
- const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1218
- const changed = nextCriteria.length !== settings.validation.lifecycle_closure_like_actual_result_patterns.length ||
1219
- nextCriteria.some((value, index) => value !== settings.validation.lifecycle_closure_like_actual_result_patterns[index]);
1220
- settings.validation.lifecycle_closure_like_actual_result_patterns = nextCriteria;
1221
- if (changed) {
1222
- await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_actual_result_patterns");
1223
- }
1224
- return withWarnings({
1225
- scope,
1226
- key,
1227
- criteria: [...settings.validation.lifecycle_closure_like_actual_result_patterns],
1228
- settings_path: target.settingsPath,
1229
- changed,
1230
- }, warnings);
1231
- }
825
+ const changed = nextCriteria.length !== context.settings.validation.metadata_required_fields.length ||
826
+ nextCriteria.some((value, index) => value !== context.settings.validation.metadata_required_fields[index]);
827
+ context.settings.validation.metadata_required_fields = nextCriteria;
828
+ await writeConfigSettingsIfChanged(context, changed, "config:set:metadata_required_fields");
829
+ return buildCriteriaResult(context, key, [...context.settings.validation.metadata_required_fields], changed);
830
+ }
831
+ const lifecycleTargets = {
832
+ lifecycle_stale_blocker_reason_patterns: context.settings.validation.lifecycle_stale_blocker_reason_patterns,
833
+ lifecycle_closure_like_blocked_reason_patterns: context.settings.validation.lifecycle_closure_like_blocked_reason_patterns,
834
+ lifecycle_closure_like_resolution_patterns: context.settings.validation.lifecycle_closure_like_resolution_patterns,
835
+ lifecycle_closure_like_actual_result_patterns: context.settings.validation.lifecycle_closure_like_actual_result_patterns,
836
+ };
837
+ const currentCriteria = lifecycleTargets[key];
838
+ const nextCriteria = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
839
+ const changed = nextCriteria.length !== currentCriteria.length ||
840
+ nextCriteria.some((value, index) => value !== currentCriteria[index]);
841
+ currentCriteria.splice(0, currentCriteria.length, ...nextCriteria);
842
+ await writeConfigSettingsIfChanged(context, changed, `config:set:${key}`);
843
+ return buildCriteriaResult(context, key, [...currentCriteria], changed);
844
+ }
845
+ async function setGovernancePresetOrTypeConfig(context, key, options) {
1232
846
  if (key === "governance_preset") {
1233
847
  const nextPolicy = normalizeGovernancePreset(options.policy);
1234
- const changed = settings.governance.preset !== nextPolicy;
1235
- settings.governance.preset = nextPolicy;
1236
- if (changed) {
1237
- await writeSettings(target.pmRoot, settings, "config:set:governance_preset");
1238
- }
1239
- return withWarnings({
1240
- scope,
1241
- key,
1242
- policy: settings.governance.preset,
1243
- settings_path: target.settingsPath,
1244
- changed,
1245
- }, warnings);
1246
- }
848
+ const changed = context.settings.governance.preset !== nextPolicy;
849
+ context.settings.governance.preset = nextPolicy;
850
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_preset");
851
+ return buildPolicyResult(context, key, context.settings.governance.preset, changed);
852
+ }
853
+ const policyProvided = typeof options.policy === "string";
854
+ const rawType = policyProvided ? options.policy.trim() : "";
855
+ if (policyProvided && rawType.length === 0) {
856
+ const changed = context.settings.governance.create_default_type !== undefined;
857
+ delete context.settings.governance.create_default_type;
858
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_create_default_type");
859
+ return buildPolicyResult(context, key, context.settings.governance.create_default_type ?? "", changed);
860
+ }
861
+ if (rawType.length === 0) {
862
+ throw new PmCliError('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)', EXIT_CODE.USAGE);
863
+ }
864
+ const typeRegistry = resolveItemTypeRegistry(context.settings, getActiveExtensionRegistrations());
865
+ const resolvedType = resolveTypeName(rawType, typeRegistry);
866
+ if (!resolvedType) {
867
+ throw new PmCliError(buildInvalidTypeError(rawType, typeRegistry.types, resolveItemTypesFilePath(context.target.pmRoot, context.settings.schema)), EXIT_CODE.USAGE);
868
+ }
869
+ const changed = context.settings.governance.create_default_type !== resolvedType;
870
+ context.settings.governance.create_default_type = resolvedType;
871
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_create_default_type");
872
+ return buildPolicyResult(context, key, context.settings.governance.create_default_type, changed);
873
+ }
874
+ async function setGovernancePolicyConfig(context, key, options) {
1247
875
  if (key === "governance_ownership_enforcement") {
1248
876
  const nextPolicy = normalizeGovernanceOwnershipEnforcement(options.policy);
1249
- const changed = settings.governance.preset !== "custom" || settings.governance.ownership_enforcement !== nextPolicy;
1250
- settings.governance.preset = "custom";
1251
- settings.governance.ownership_enforcement = nextPolicy;
1252
- if (changed) {
1253
- await writeSettings(target.pmRoot, settings, "config:set:governance_ownership_enforcement");
1254
- }
1255
- return withWarnings({
1256
- scope,
1257
- key,
1258
- policy: settings.governance.ownership_enforcement,
1259
- settings_path: target.settingsPath,
1260
- changed,
1261
- }, warnings);
877
+ const changed = context.settings.governance.preset !== "custom" ||
878
+ context.settings.governance.ownership_enforcement !== nextPolicy;
879
+ context.settings.governance.preset = "custom";
880
+ context.settings.governance.ownership_enforcement = nextPolicy;
881
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_ownership_enforcement");
882
+ return buildPolicyResult(context, key, context.settings.governance.ownership_enforcement, changed);
1262
883
  }
1263
884
  if (key === "governance_create_mode_default") {
1264
885
  const nextPolicy = normalizeGovernanceCreateModeDefault(options.policy);
1265
- const changed = settings.governance.preset !== "custom" || settings.governance.create_mode_default !== nextPolicy;
1266
- settings.governance.preset = "custom";
1267
- settings.governance.create_mode_default = nextPolicy;
1268
- if (changed) {
1269
- await writeSettings(target.pmRoot, settings, "config:set:governance_create_mode_default");
1270
- }
1271
- return withWarnings({
1272
- scope,
1273
- key,
1274
- policy: settings.governance.create_mode_default,
1275
- settings_path: target.settingsPath,
1276
- changed,
1277
- }, warnings);
1278
- }
1279
- if (key === "governance_close_validation_default") {
1280
- const nextPolicy = normalizeGovernanceCloseValidationDefault(options.policy);
1281
- const changed = settings.governance.preset !== "custom" || settings.governance.close_validation_default !== nextPolicy;
1282
- settings.governance.preset = "custom";
1283
- settings.governance.close_validation_default = nextPolicy;
1284
- if (changed) {
1285
- await writeSettings(target.pmRoot, settings, "config:set:governance_close_validation_default");
1286
- }
1287
- return withWarnings({
1288
- scope,
1289
- key,
1290
- policy: settings.governance.close_validation_default,
1291
- settings_path: target.settingsPath,
1292
- changed,
1293
- }, warnings);
1294
- }
1295
- if (key === "governance_require_close_reason") {
1296
- const nextPolicy = normalizeGovernanceRequireCloseReasonPolicy(options.policy);
1297
- const nextEnabled = nextPolicy === "enabled";
1298
- const changed = settings.governance.require_close_reason !== nextEnabled;
1299
- settings.governance.require_close_reason = nextEnabled;
1300
- if (changed) {
1301
- await writeSettings(target.pmRoot, settings, "config:set:governance_require_close_reason");
1302
- }
1303
- return withWarnings({
1304
- scope,
1305
- key,
1306
- policy: settings.governance.require_close_reason ? "enabled" : "disabled",
1307
- settings_path: target.settingsPath,
1308
- changed,
1309
- }, warnings);
1310
- }
1311
- if (key === "governance_create_default_type") {
1312
- const policyProvided = typeof options.policy === "string";
1313
- const rawType = policyProvided ? options.policy.trim() : "";
1314
- // An explicit empty value clears the setting back to "unset" (matching how
1315
- // get/export expose unset as ""). Without this clear path there is no CLI
1316
- // route back from a set value to the governance default.
1317
- if (policyProvided && rawType.length === 0) {
1318
- const changed = settings.governance.create_default_type !== undefined;
1319
- delete settings.governance.create_default_type;
1320
- if (changed) {
1321
- await writeSettings(target.pmRoot, settings, "config:set:governance_create_default_type");
1322
- }
1323
- return withWarnings({
1324
- scope,
1325
- key,
1326
- policy: settings.governance.create_default_type ?? "",
1327
- settings_path: target.settingsPath,
1328
- changed,
1329
- }, warnings);
1330
- }
1331
- if (rawType.length === 0) {
1332
- throw new PmCliError('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)', EXIT_CODE.USAGE);
1333
- }
1334
- // create_default_type is preset-orthogonal: it tunes `pm create` and is
1335
- // carried through writes regardless of preset, so we do NOT force preset=custom.
1336
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1337
- const resolvedType = resolveTypeName(rawType, typeRegistry);
1338
- if (!resolvedType) {
1339
- throw new PmCliError(buildInvalidTypeError(rawType, typeRegistry.types, resolveItemTypesFilePath(target.pmRoot, settings.schema)), EXIT_CODE.USAGE);
1340
- }
1341
- const changed = settings.governance.create_default_type !== resolvedType;
1342
- settings.governance.create_default_type = resolvedType;
1343
- if (changed) {
1344
- await writeSettings(target.pmRoot, settings, "config:set:governance_create_default_type");
1345
- }
1346
- return withWarnings({
1347
- scope,
1348
- key,
1349
- policy: settings.governance.create_default_type,
1350
- settings_path: target.settingsPath,
1351
- changed,
1352
- }, warnings);
1353
- }
1354
- if (key === "governance_workflow_enforcement") {
1355
- const nextPolicy = normalizeGovernanceWorkflowEnforcement(options.policy);
1356
- // workflow_enforcement is preset-orthogonal (see create_default_type above).
1357
- const changed = (settings.governance.workflow_enforcement ?? "off") !== nextPolicy;
1358
- settings.governance.workflow_enforcement = nextPolicy;
1359
- if (changed) {
1360
- await writeSettings(target.pmRoot, settings, "config:set:governance_workflow_enforcement");
1361
- }
1362
- return withWarnings({
1363
- scope,
1364
- key,
1365
- policy: settings.governance.workflow_enforcement,
1366
- settings_path: target.settingsPath,
1367
- changed,
1368
- }, warnings);
1369
- }
886
+ const changed = context.settings.governance.preset !== "custom" ||
887
+ context.settings.governance.create_mode_default !== nextPolicy;
888
+ context.settings.governance.preset = "custom";
889
+ context.settings.governance.create_mode_default = nextPolicy;
890
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_create_mode_default");
891
+ return buildPolicyResult(context, key, context.settings.governance.create_mode_default, changed);
892
+ }
893
+ const nextPolicy = normalizeGovernanceCloseValidationDefault(options.policy);
894
+ const changed = context.settings.governance.preset !== "custom" ||
895
+ context.settings.governance.close_validation_default !== nextPolicy;
896
+ context.settings.governance.preset = "custom";
897
+ context.settings.governance.close_validation_default = nextPolicy;
898
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_close_validation_default");
899
+ return buildPolicyResult(context, key, context.settings.governance.close_validation_default, changed);
900
+ }
901
+ async function setGovernanceValidationConfig(context, key, options) {
1370
902
  if (key === "governance_parent_reference_policy") {
1371
903
  const nextPolicy = normalizeParentReferencePolicy(options.policy);
1372
- const changed = settings.governance.preset !== "custom" || settings.governance.parent_reference !== nextPolicy;
1373
- settings.governance.preset = "custom";
1374
- settings.governance.parent_reference = nextPolicy;
1375
- settings.validation.parent_reference = nextPolicy;
1376
- if (changed) {
1377
- await writeSettings(target.pmRoot, settings, "config:set:governance_parent_reference_policy");
1378
- }
1379
- return withWarnings({
1380
- scope,
1381
- key,
1382
- policy: settings.governance.parent_reference,
1383
- settings_path: target.settingsPath,
1384
- changed,
1385
- }, warnings);
904
+ const changed = context.settings.governance.preset !== "custom" ||
905
+ hasGovernanceValidationMirrorChange(context.settings.governance.parent_reference, context.settings.validation.parent_reference, nextPolicy);
906
+ context.settings.governance.preset = "custom";
907
+ context.settings.governance.parent_reference = nextPolicy;
908
+ context.settings.validation.parent_reference = nextPolicy;
909
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_parent_reference_policy");
910
+ return buildPolicyResult(context, key, context.settings.governance.parent_reference, changed);
1386
911
  }
1387
912
  if (key === "governance_metadata_validation_profile") {
1388
913
  const nextPolicy = normalizeValidateMetadataProfile(options.policy);
1389
- const changed = settings.governance.preset !== "custom" || settings.governance.metadata_profile !== nextPolicy;
1390
- settings.governance.preset = "custom";
1391
- settings.governance.metadata_profile = nextPolicy;
1392
- settings.validation.metadata_profile = nextPolicy;
1393
- if (changed) {
1394
- await writeSettings(target.pmRoot, settings, "config:set:governance_metadata_validation_profile");
1395
- }
1396
- return withWarnings({
1397
- scope,
1398
- key,
1399
- policy: settings.governance.metadata_profile,
1400
- settings_path: target.settingsPath,
1401
- changed,
1402
- }, warnings);
1403
- }
1404
- if (key === "governance_force_required_for_stale_lock") {
1405
- const nextPolicy = normalizeGovernanceForceRequiredForStaleLockPolicy(options.policy);
914
+ const changed = context.settings.governance.preset !== "custom" ||
915
+ hasGovernanceValidationMirrorChange(context.settings.governance.metadata_profile, context.settings.validation.metadata_profile, nextPolicy);
916
+ context.settings.governance.preset = "custom";
917
+ context.settings.governance.metadata_profile = nextPolicy;
918
+ context.settings.validation.metadata_profile = nextPolicy;
919
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_metadata_validation_profile");
920
+ return buildPolicyResult(context, key, context.settings.governance.metadata_profile, changed);
921
+ }
922
+ const nextPolicy = normalizeGovernanceWorkflowEnforcement(options.policy);
923
+ const changed = (context.settings.governance.workflow_enforcement ?? "off") !== nextPolicy;
924
+ context.settings.governance.workflow_enforcement = nextPolicy;
925
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_workflow_enforcement");
926
+ return buildPolicyResult(context, key, context.settings.governance.workflow_enforcement, changed);
927
+ }
928
+ async function setGovernanceBooleanConfig(context, key, options) {
929
+ if (key === "governance_require_close_reason") {
930
+ const nextPolicy = normalizeGovernanceRequireCloseReasonPolicy(options.policy);
1406
931
  const nextEnabled = nextPolicy === "enabled";
1407
- const changed = settings.governance.preset !== "custom" || settings.governance.force_required_for_stale_lock !== nextEnabled;
1408
- settings.governance.preset = "custom";
1409
- settings.governance.force_required_for_stale_lock = nextEnabled;
1410
- if (changed) {
1411
- await writeSettings(target.pmRoot, settings, "config:set:governance_force_required_for_stale_lock");
1412
- }
1413
- return withWarnings({
1414
- scope,
1415
- key,
1416
- policy: settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
1417
- settings_path: target.settingsPath,
1418
- changed,
1419
- }, warnings);
1420
- }
932
+ const changed = context.settings.governance.require_close_reason !== nextEnabled;
933
+ context.settings.governance.require_close_reason = nextEnabled;
934
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_require_close_reason");
935
+ return buildPolicyResult(context, key, context.settings.governance.require_close_reason ? "enabled" : "disabled", changed);
936
+ }
937
+ const nextPolicy = normalizeGovernanceForceRequiredForStaleLockPolicy(options.policy);
938
+ const nextEnabled = nextPolicy === "enabled";
939
+ const changed = context.settings.governance.preset !== "custom" ||
940
+ context.settings.governance.force_required_for_stale_lock !== nextEnabled;
941
+ context.settings.governance.preset = "custom";
942
+ context.settings.governance.force_required_for_stale_lock = nextEnabled;
943
+ await writeConfigSettingsIfChanged(context, changed, "config:set:governance_force_required_for_stale_lock");
944
+ return buildPolicyResult(context, key, context.settings.governance.force_required_for_stale_lock ? "enabled" : "disabled", changed);
945
+ }
946
+ async function setTrackingConfig(context, key, options) {
1421
947
  if (key === "test_result_tracking") {
1422
948
  const nextPolicy = normalizeTestResultTrackingPolicy(options.policy);
1423
949
  const nextEnabled = nextPolicy === "enabled";
1424
- const changed = settings.testing.record_results_to_items !== nextEnabled;
1425
- settings.testing.record_results_to_items = nextEnabled;
1426
- if (changed) {
1427
- await writeSettings(target.pmRoot, settings, "config:set:test_result_tracking");
1428
- }
1429
- return withWarnings({
1430
- scope,
1431
- key,
1432
- policy: settings.testing.record_results_to_items ? "enabled" : "disabled",
1433
- settings_path: target.settingsPath,
1434
- changed,
1435
- }, warnings);
1436
- }
1437
- if (key === "telemetry_tracking") {
1438
- const nextPolicy = normalizeTelemetryTrackingPolicy(options.policy);
1439
- const nextEnabled = nextPolicy === "enabled";
1440
- const changed = settings.telemetry.enabled !== nextEnabled || !settings.telemetry.first_run_prompt_completed;
1441
- settings.telemetry.enabled = nextEnabled;
1442
- settings.telemetry.first_run_prompt_completed = true;
1443
- if (changed) {
1444
- await writeSettings(target.pmRoot, settings, "config:set:telemetry_tracking");
1445
- }
1446
- return withWarnings({
1447
- scope,
1448
- key,
1449
- policy: settings.telemetry.enabled ? "enabled" : "disabled",
1450
- settings_path: target.settingsPath,
1451
- changed,
1452
- }, warnings);
950
+ const changed = context.settings.testing.record_results_to_items !== nextEnabled;
951
+ context.settings.testing.record_results_to_items = nextEnabled;
952
+ await writeConfigSettingsIfChanged(context, changed, "config:set:test_result_tracking");
953
+ return buildPolicyResult(context, key, context.settings.testing.record_results_to_items ? "enabled" : "disabled", changed);
954
+ }
955
+ const nextPolicy = normalizeTelemetryTrackingPolicy(options.policy);
956
+ const nextEnabled = nextPolicy === "enabled";
957
+ const changed = context.settings.telemetry.enabled !== nextEnabled ||
958
+ !context.settings.telemetry.first_run_prompt_completed;
959
+ context.settings.telemetry.enabled = nextEnabled;
960
+ context.settings.telemetry.first_run_prompt_completed = true;
961
+ await writeConfigSettingsIfChanged(context, changed, "config:set:telemetry_tracking");
962
+ return buildPolicyResult(context, key, context.settings.telemetry.enabled ? "enabled" : "disabled", changed);
963
+ }
964
+ async function setDefinitionOfDoneConfig(context, key, options) {
965
+ const nextCriteria = normalizeCriteria(options.criterion, options.clearCriteria);
966
+ const changed = nextCriteria.length !== context.settings.workflow.definition_of_done.length ||
967
+ nextCriteria.some((value, index) => value !== context.settings.workflow.definition_of_done[index]);
968
+ context.settings.workflow.definition_of_done = nextCriteria;
969
+ await writeConfigSettingsIfChanged(context, changed, "config:set:definition_of_done");
970
+ return buildCriteriaResult(context, key, [...context.settings.workflow.definition_of_done], changed);
971
+ }
972
+ async function setConfigValue(context, key, options) {
973
+ if (options.clearCriteria === true && !isCriteriaConfigKey(key)) {
974
+ throw new PmCliError("--clear-criteria is only supported with config set criteria-list keys", EXIT_CODE.USAGE);
975
+ }
976
+ if (key === "item_format") {
977
+ return setItemFormatConfig(context, options);
1453
978
  }
1454
979
  if (key === "context") {
1455
- return applyContextConfig(settings, options, target, scope, warnings);
980
+ return applyContextConfig(context.settings, options, context.target, context.scope, context.warnings);
1456
981
  }
1457
- const nextCriteria = normalizeCriteria(options.criterion, options.clearCriteria);
1458
- const changed = nextCriteria.length !== settings.workflow.definition_of_done.length ||
1459
- nextCriteria.some((value, index) => value !== settings.workflow.definition_of_done[index]);
1460
- settings.workflow.definition_of_done = nextCriteria;
1461
- if (changed) {
1462
- await writeSettings(target.pmRoot, settings, "config:set:definition_of_done");
982
+ if (key === "definition_of_done") {
983
+ return setDefinitionOfDoneConfig(context, key, options);
1463
984
  }
1464
- return withWarnings({
985
+ if (isCriteriaValueConfigKey(key)) {
986
+ return setCriteriaConfig(context, key, options);
987
+ }
988
+ if (TRACKING_CONFIG_KEYS.has(key)) {
989
+ return setTrackingConfig(context, key, options);
990
+ }
991
+ if (GOVERNANCE_BOOLEAN_CONFIG_KEYS.has(key)) {
992
+ return setGovernanceBooleanConfig(context, key, options);
993
+ }
994
+ if (isGovernancePolicyConfigKey(key)) {
995
+ return setGovernancePolicyConfig(context, key, options);
996
+ }
997
+ if (isGovernanceValidationConfigKey(key)) {
998
+ return setGovernanceValidationConfig(context, key, options);
999
+ }
1000
+ if (isGovernancePresetOrTypeConfigKey(key)) {
1001
+ return setGovernancePresetOrTypeConfig(context, key, options);
1002
+ }
1003
+ return setValidationConfig(context, key, options);
1004
+ }
1005
+ /**
1006
+ * Implements run config for the public runtime surface of this module.
1007
+ */
1008
+ export async function runConfig(scopeValue, actionValue, keyValue, options, global, valueValue) {
1009
+ const scope = normalizeScope(scopeValue);
1010
+ const action = normalizeAction(actionValue);
1011
+ const nestedSetting = (action === "get" || action === "set") ? resolveNestedSettingDescriptor(keyValue) : undefined;
1012
+ const key = nestedSetting ? undefined : normalizeKeyForAction(action, keyValue);
1013
+ const routedOptions = applyPositionalValue(action, keyValue, key, nestedSetting, valueValue, options);
1014
+ const target = await resolveSettingsTarget(scope, global);
1015
+ const { settings, metadata, warnings: settingsReadWarnings } = await readSettingsWithMetadata(target.pmRoot);
1016
+ const context = {
1465
1017
  scope,
1466
- key,
1467
- criteria: [...settings.workflow.definition_of_done],
1468
- settings_path: target.settingsPath,
1469
- changed,
1470
- }, warnings);
1018
+ target,
1019
+ settings,
1020
+ metadata,
1021
+ warnings: normalizeWarnings(settingsReadWarnings),
1022
+ };
1023
+ if (nestedSetting) {
1024
+ return buildNestedSettingResult(context, action, nestedSetting, routedOptions);
1025
+ }
1026
+ if (action === "list") {
1027
+ return buildConfigListResult(context);
1028
+ }
1029
+ if (action === "export") {
1030
+ return buildConfigExportResult(context);
1031
+ }
1032
+ assertConfigKeyDefined(key);
1033
+ return action === "get" ? buildConfigGetResult(context, key) : setConfigValue(context, key, routedOptions);
1471
1034
  }
1472
1035
  export const _testOnlyConfigCommand = {
1036
+ hasGovernanceValidationMirrorChange,
1473
1037
  applyPositionalValue,
1474
1038
  normalizeAction,
1475
1039
  normalizeCriteria,
@@ -1492,4 +1056,4 @@ export const _testOnlyConfigCommand = {
1492
1056
  normalizeWarnings,
1493
1057
  };
1494
1058
  //# sourceMappingURL=config.js.map
1495
- //# debugId=0be07fdd-a74d-5d01-a1b7-bd26e021bf20
1059
+ //# debugId=a420e612-3d4b-5ebd-864e-a1a4bec5e45d