@unbrained/pm-cli 2026.5.31 → 2026.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (586) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/dist/cli/argv-utils.js +7 -3
  3. package/dist/cli/argv-utils.js.map +1 -1
  4. package/dist/cli/bootstrap-args.d.ts +1 -0
  5. package/dist/cli/bootstrap-args.js +23 -3
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commands/calendar.js +17 -3
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/close-many.d.ts +63 -0
  10. package/dist/cli/commands/close-many.js +302 -0
  11. package/dist/cli/commands/close-many.js.map +1 -0
  12. package/dist/cli/commands/completion.d.ts +1 -0
  13. package/dist/cli/commands/completion.js +241 -27
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +4 -4
  16. package/dist/cli/commands/config.js +115 -3
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/contracts.js +191 -162
  19. package/dist/cli/commands/contracts.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +1 -0
  21. package/dist/cli/commands/create.js +77 -114
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/extension/doctor.d.ts +12 -0
  24. package/dist/cli/commands/extension/doctor.js +97 -2
  25. package/dist/cli/commands/extension/doctor.js.map +1 -1
  26. package/dist/cli/commands/extension/scaffold.js +49 -48
  27. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  28. package/dist/cli/commands/extension.js +51 -23
  29. package/dist/cli/commands/extension.js.map +1 -1
  30. package/dist/cli/commands/get.js +7 -7
  31. package/dist/cli/commands/get.js.map +1 -1
  32. package/dist/cli/commands/health.js +38 -3
  33. package/dist/cli/commands/health.js.map +1 -1
  34. package/dist/cli/commands/index.d.ts +2 -1
  35. package/dist/cli/commands/index.js +4 -3
  36. package/dist/cli/commands/index.js.map +1 -1
  37. package/dist/cli/commands/init.d.ts +10 -0
  38. package/dist/cli/commands/init.js +107 -4
  39. package/dist/cli/commands/init.js.map +1 -1
  40. package/dist/cli/commands/list.d.ts +5 -0
  41. package/dist/cli/commands/list.js +58 -26
  42. package/dist/cli/commands/list.js.map +1 -1
  43. package/dist/cli/commands/reindex.js +163 -47
  44. package/dist/cli/commands/reindex.js.map +1 -1
  45. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  46. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  47. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  48. package/dist/cli/commands/restore.js +25 -4
  49. package/dist/cli/commands/restore.js.map +1 -1
  50. package/dist/cli/commands/schema.d.ts +122 -1
  51. package/dist/cli/commands/schema.js +536 -6
  52. package/dist/cli/commands/schema.js.map +1 -1
  53. package/dist/cli/commands/search.d.ts +1 -0
  54. package/dist/cli/commands/search.js +18 -4
  55. package/dist/cli/commands/search.js.map +1 -1
  56. package/dist/cli/commands/test.js +4 -3
  57. package/dist/cli/commands/test.js.map +1 -1
  58. package/dist/cli/commands/update-many.js +69 -140
  59. package/dist/cli/commands/update-many.js.map +1 -1
  60. package/dist/cli/commands/update.d.ts +2 -0
  61. package/dist/cli/commands/update.js +138 -119
  62. package/dist/cli/commands/update.js.map +1 -1
  63. package/dist/cli/commands/validate.d.ts +1 -0
  64. package/dist/cli/commands/validate.js +63 -33
  65. package/dist/cli/commands/validate.js.map +1 -1
  66. package/dist/cli/error-guidance.js +26 -3
  67. package/dist/cli/error-guidance.js.map +1 -1
  68. package/dist/cli/help-content.js +82 -3
  69. package/dist/cli/help-content.js.map +1 -1
  70. package/dist/cli/main.js +377 -23
  71. package/dist/cli/main.js.map +1 -1
  72. package/dist/cli/register-list-query.js +9 -3
  73. package/dist/cli/register-list-query.js.map +1 -1
  74. package/dist/cli/register-mutation.js +200 -28
  75. package/dist/cli/register-mutation.js.map +1 -1
  76. package/dist/cli/register-operations.js +4 -2
  77. package/dist/cli/register-operations.js.map +1 -1
  78. package/dist/cli/register-setup.js +4 -2
  79. package/dist/cli/register-setup.js.map +1 -1
  80. package/dist/cli/registration-helpers.js +31 -4
  81. package/dist/cli/registration-helpers.js.map +1 -1
  82. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
  83. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
  84. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
  85. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
  86. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-OOAGKWRG.js} +11 -11
  88. package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-5JE3YGXU.js} +8 -9
  89. package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-5JE3YGXU.js.map} +1 -1
  90. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
  91. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
  92. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
  93. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
  94. package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3OH4DAEB.js} +119 -6
  95. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
  96. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
  97. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
  98. package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-4PJQSECJ.js} +6 -4
  99. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
  100. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
  101. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
  102. package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-5IRA6IYD.js} +175 -54
  103. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
  104. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
  105. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
  106. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
  107. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
  108. package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
  109. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
  110. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
  111. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
  113. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-ATBVS6WW.js} +5 -5
  115. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
  116. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
  117. package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-B3N4TKNL.js} +12 -11
  118. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-BNL6S7QH.js} +3 -3
  120. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
  121. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-CJDQB2ED.js} +2 -2
  123. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
  124. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
  125. package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-D3WUNETC.js} +5 -5
  126. package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-D5X7N6FI.js} +210 -132
  127. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-DFIZGAI5.js} +10 -12
  129. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-DFIZGAI5.js.map} +1 -1
  130. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
  131. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
  132. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
  133. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
  135. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
  136. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
  137. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-GCAVRLGE.js} +37 -16
  139. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
  141. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
  142. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
  143. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
  144. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
  145. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-HPH6X4ZZ.js} +26 -15
  147. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-HZOS2UG5.js} +18 -6
  149. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
  150. package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
  151. package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
  153. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
  154. package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-JB4RGL4V.js} +7 -7
  155. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
  156. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-K47WAYQV.js} +3 -3
  158. package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-KA24HME7.js} +2 -2
  159. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
  160. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
  162. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
  163. package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-KK6YPGH3.js} +22 -3
  164. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
  165. package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-LDJK7SHN.js} +7 -7
  166. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  167. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  168. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
  169. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-N5YF3VFN.js} +54 -32
  171. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
  172. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
  173. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
  174. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
  175. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
  176. package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-OIQIXTNB.js} +164 -53
  177. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
  178. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
  179. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-OUF3ARDX.js} +251 -251
  181. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-RANZIID5.js} +2 -2
  183. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
  184. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
  185. package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-S3CV7JGJ.js} +4 -4
  186. package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-SRVKTWPR.js} +748 -196
  187. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
  188. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
  189. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
  191. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
  192. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
  193. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
  194. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
  195. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
  196. package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-TK633IVD.js} +35 -8
  197. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
  198. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
  199. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
  200. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
  201. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
  202. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
  203. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
  204. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
  205. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
  206. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
  207. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
  208. package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-WIKR7KFL.js} +8 -8
  209. package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XG7RJYHV.js} +484 -49
  210. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
  211. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  212. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  213. package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js → chunk-XX5LRINW.js} +2 -2
  214. package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-Y2AKE2HS.js} +3 -3
  215. package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-ZQ4F6EC4.js} +301 -24
  216. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
  217. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
  218. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-AZLP7YFO.js} +10 -11
  220. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-AZLP7YFO.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
  222. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
  223. package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
  224. package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
  225. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
  226. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
  227. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
  228. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
  229. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
  230. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-AGBNSJJH.js} +10 -11
  231. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-AGBNSJJH.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
  233. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
  234. package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-5ON3ADRH.js} +121 -10
  235. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
  236. package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
  237. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-E6U3DWVM.js} +32 -19
  239. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-E6U3DWVM.js.map} +2 -2
  240. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
  241. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-CXSFM45B.js} +194 -162
  243. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
  244. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
  245. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
  246. package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
  247. package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
  248. package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
  249. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-RONNH4F4.js} +7 -8
  250. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-RONNH4F4.js.map} +1 -1
  251. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
  252. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
  253. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
  254. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-WII3O4HB.js} +7 -8
  256. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-WII3O4HB.js.map} +1 -1
  257. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-JMVCFNHH.js} +9 -10
  258. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-JMVCFNHH.js.map} +1 -1
  259. package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
  260. package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
  261. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
  262. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-G6UXSM5S.js} +4 -5
  264. package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
  265. package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
  266. package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-MXYS5W4M.js} +9 -10
  267. package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-MXYS5W4M.js.map} +1 -1
  268. package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
  269. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
  270. package/dist/cli-bundle/chunks/{gc-JWNF66EC.js → gc-QNBRJG6H.js} +3 -3
  271. package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-CINFEUIY.js} +16 -17
  272. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
  273. package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
  274. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
  275. package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
  276. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
  277. package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-IT5DBPRJ.js} +43 -15
  278. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
  279. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
  280. package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
  281. package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
  282. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
  283. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
  284. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
  285. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-KC5ZOJRZ.js} +12 -14
  286. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-KC5ZOJRZ.js.map} +1 -1
  287. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
  288. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
  289. package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
  290. package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
  291. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
  292. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-A3CLB5CO.js} +10 -11
  293. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-A3CLB5CO.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
  295. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
  296. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
  297. package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
  298. package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
  299. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-42LIC3UE.js} +10 -11
  300. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-42LIC3UE.js.map} +1 -1
  301. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
  302. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
  303. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-HDQXEUKD.js} +13 -14
  304. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-HDQXEUKD.js.map} +1 -1
  305. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
  306. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
  307. package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-AG3XKXWL.js} +22 -24
  308. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
  309. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
  310. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
  311. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
  312. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
  313. package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-RSMT6DPK.js} +154 -43
  314. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
  315. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
  316. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
  317. package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-Q54JQZUN.js} +33 -34
  318. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
  319. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
  320. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
  321. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-YJKIQRKA.js} +18 -19
  322. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-YJKIQRKA.js.map} +2 -2
  323. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
  324. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
  325. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
  326. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
  327. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
  328. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
  329. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
  330. package/dist/cli-bundle/chunks/{search-HENBL456.js → search-5A3BMFA7.js} +25 -16
  331. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
  332. package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
  333. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
  334. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
  335. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js → stats-Y2CBTZSL.js} +7 -8
  337. package/dist/cli-bundle/chunks/{stats-N6H3YP2F.js.map → stats-Y2CBTZSL.js.map} +1 -1
  338. package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
  339. package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
  340. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
  341. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-EEMKNTGU.js} +13 -14
  342. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-EEMKNTGU.js.map} +1 -1
  343. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
  344. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
  345. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
  346. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
  347. package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-L2M7WKH7.js} +5 -5
  348. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
  349. package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
  350. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
  351. package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-322CCH2L.js} +78 -146
  352. package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
  353. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
  354. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
  355. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-2U727SAM.js} +5 -7
  356. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-2U727SAM.js.map} +1 -1
  357. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
  358. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
  359. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
  360. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
  361. package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-ZFVWPEEN.js} +61 -48
  362. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
  363. package/dist/cli-bundle/main.js +490 -52
  364. package/dist/cli-bundle/main.js.map +2 -2
  365. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  366. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  367. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  368. package/dist/core/config/positional-value.js +4 -2
  369. package/dist/core/config/positional-value.js.map +1 -1
  370. package/dist/core/diagnostics/remediation.d.ts +73 -0
  371. package/dist/core/diagnostics/remediation.js +328 -0
  372. package/dist/core/diagnostics/remediation.js.map +1 -0
  373. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  374. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  375. package/dist/core/extensions/extension-types.d.ts +60 -4
  376. package/dist/core/extensions/extension-types.js +2 -2
  377. package/dist/core/extensions/extension-types.js.map +1 -1
  378. package/dist/core/extensions/index.d.ts +5 -1
  379. package/dist/core/extensions/index.js +61 -2
  380. package/dist/core/extensions/index.js.map +1 -1
  381. package/dist/core/extensions/item-fields.d.ts +5 -1
  382. package/dist/core/extensions/item-fields.js +126 -4
  383. package/dist/core/extensions/item-fields.js.map +1 -1
  384. package/dist/core/extensions/loader.js +283 -8
  385. package/dist/core/extensions/loader.js.map +1 -1
  386. package/dist/core/item/item-format.d.ts +3 -2
  387. package/dist/core/item/item-format.js +15 -10
  388. package/dist/core/item/item-format.js.map +1 -1
  389. package/dist/core/item/status-filter.d.ts +29 -0
  390. package/dist/core/item/status-filter.js +97 -0
  391. package/dist/core/item/status-filter.js.map +1 -0
  392. package/dist/core/item/type-registry.js +4 -2
  393. package/dist/core/item/type-registry.js.map +1 -1
  394. package/dist/core/output/output.js +17 -5
  395. package/dist/core/output/output.js.map +1 -1
  396. package/dist/core/schema/item-types-file.d.ts +15 -0
  397. package/dist/core/schema/item-types-file.js +27 -2
  398. package/dist/core/schema/item-types-file.js.map +1 -1
  399. package/dist/core/schema/runtime-field-filters.js +4 -3
  400. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  401. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  402. package/dist/core/schema/runtime-field-values.js +10 -4
  403. package/dist/core/schema/runtime-field-values.js.map +1 -1
  404. package/dist/core/schema/runtime-schema.js +75 -2
  405. package/dist/core/schema/runtime-schema.js.map +1 -1
  406. package/dist/core/schema/status-defs-file.d.ts +113 -0
  407. package/dist/core/schema/status-defs-file.js +260 -0
  408. package/dist/core/schema/status-defs-file.js.map +1 -0
  409. package/dist/core/schema/type-workflows.d.ts +64 -0
  410. package/dist/core/schema/type-workflows.js +98 -0
  411. package/dist/core/schema/type-workflows.js.map +1 -0
  412. package/dist/core/search/cache.d.ts +3 -1
  413. package/dist/core/search/cache.js +104 -28
  414. package/dist/core/search/cache.js.map +1 -1
  415. package/dist/core/search/http-client.d.ts +2 -2
  416. package/dist/core/search/http-client.js +2 -2
  417. package/dist/core/search/http-client.js.map +1 -1
  418. package/dist/core/search/vector-stores.d.ts +1 -0
  419. package/dist/core/search/vector-stores.js +64 -14
  420. package/dist/core/search/vector-stores.js.map +1 -1
  421. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  422. package/dist/core/search/vectorization-metadata.js +65 -0
  423. package/dist/core/search/vectorization-metadata.js.map +1 -0
  424. package/dist/core/shared/serialization.d.ts +1 -0
  425. package/dist/core/shared/serialization.js +86 -2
  426. package/dist/core/shared/serialization.js.map +1 -1
  427. package/dist/core/store/front-matter-cache.js +14 -5
  428. package/dist/core/store/front-matter-cache.js.map +1 -1
  429. package/dist/core/store/item-store.d.ts +2 -0
  430. package/dist/core/store/item-store.js +61 -6
  431. package/dist/core/store/item-store.js.map +1 -1
  432. package/dist/core/store/settings-validator.js +18 -2
  433. package/dist/core/store/settings-validator.js.map +1 -1
  434. package/dist/core/store/settings.js +40 -5
  435. package/dist/core/store/settings.js.map +1 -1
  436. package/dist/core/telemetry/consent.js +3 -3
  437. package/dist/core/telemetry/consent.js.map +1 -1
  438. package/dist/core/telemetry/observability.js +4 -3
  439. package/dist/core/telemetry/observability.js.map +1 -1
  440. package/dist/mcp/server.js +221 -12
  441. package/dist/mcp/server.js.map +1 -1
  442. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  443. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  444. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  445. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  446. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  447. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  448. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  449. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  450. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  451. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  452. package/dist/sdk/cli-contracts/tool-parameter-tables.js +35 -6
  453. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  454. package/dist/sdk/cli-contracts.d.ts +19 -1
  455. package/dist/sdk/cli-contracts.js +187 -15
  456. package/dist/sdk/cli-contracts.js.map +1 -1
  457. package/dist/sdk/errors.d.ts +22 -0
  458. package/dist/sdk/errors.js +46 -0
  459. package/dist/sdk/errors.js.map +1 -0
  460. package/dist/sdk/index.d.ts +2 -1
  461. package/dist/sdk/index.js +3 -2
  462. package/dist/sdk/index.js.map +1 -1
  463. package/dist/sdk/package-import-adapters.js +14 -3
  464. package/dist/sdk/package-import-adapters.js.map +1 -1
  465. package/dist/sdk/runtime.d.ts +1 -0
  466. package/dist/sdk/runtime.js +3 -2
  467. package/dist/sdk/runtime.js.map +1 -1
  468. package/dist/sdk/testing.d.ts +77 -0
  469. package/dist/sdk/testing.js +239 -0
  470. package/dist/sdk/testing.js.map +1 -0
  471. package/dist/types.d.ts +19 -0
  472. package/dist/types.js +3 -2
  473. package/dist/types.js.map +1 -1
  474. package/docs/AGENT_GUIDE.md +21 -2
  475. package/docs/COMMANDS.md +85 -5
  476. package/docs/CONFIGURATION.md +49 -2
  477. package/docs/EXTENSIONS.md +118 -6
  478. package/docs/QUICKSTART.md +2 -0
  479. package/docs/RELEASING.md +2 -2
  480. package/docs/SDK.md +273 -1
  481. package/docs/TESTING.md +17 -0
  482. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  483. package/docs/examples/starter-extension/index.js +9 -1
  484. package/docs/examples/starter-extension/manifest.json +1 -0
  485. package/package.json +12 -6
  486. package/packages/pm-beads/extensions/beads/index.js +2 -4
  487. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  488. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  489. package/packages/pm-calendar/README.md +6 -0
  490. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  491. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  492. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  493. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  494. package/packages/pm-guide-shell/README.md +4 -0
  495. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  496. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  497. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  498. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  499. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  500. package/packages/pm-lifecycle-hooks/README.md +29 -0
  501. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  502. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  503. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  504. package/packages/pm-lifecycle-hooks/package.json +52 -0
  505. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  506. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  507. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  508. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  509. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  510. package/packages/pm-todos/extensions/todos/index.js +3 -7
  511. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  512. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  513. package/scripts/bundle-cli.mjs +121 -17
  514. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
  515. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
  516. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
  517. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
  518. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
  519. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
  520. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
  521. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
  522. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
  523. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
  524. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
  525. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
  526. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
  527. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
  528. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
  529. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
  530. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
  531. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
  532. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
  533. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
  534. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
  535. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
  536. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
  537. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
  538. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
  539. package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
  540. package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
  541. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
  542. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
  543. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
  544. package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
  545. package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
  546. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
  547. package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
  548. package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
  549. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
  550. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
  551. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
  552. package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
  553. package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
  554. package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
  555. package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
  556. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
  557. package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
  558. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
  559. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
  560. /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-P5BUMWP3.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-OOAGKWRG.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-ATBVS6WW.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-BNL6S7QH.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-CJDQB2ED.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-D3WUNETC.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-JB4RGL4V.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-K47WAYQV.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-KA24HME7.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-LDJK7SHN.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-RANZIID5.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-S3CV7JGJ.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js.map → chunk-WIKR7KFL.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-XX5LRINW.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-Y2AKE2HS.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-RMHQ3KWH.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-ATONSAZW.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-G6UXSM5S.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{gc-JWNF66EC.js.map → gc-QNBRJG6H.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-6FC4H6HI.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-XKYEZDBL.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-KHX3FEEM.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-53LZ2AEO.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-JL5QIH7H.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-RJ4ZF35X.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-L2M7WKH7.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-PYLVHMRD.js.map} +0 -0
@@ -0,0 +1,1671 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="16a22327-ab5b-5ab9-a4ac-aa5984fb0050")}catch(e){}}();
3
+ import {
4
+ normalizeParentReferencePolicy,
5
+ normalizeSprintReleaseFormatPolicy
6
+ } from "./chunk-MISYRLEP.js";
7
+ import {
8
+ migrateItemFilesToFormat
9
+ } from "./chunk-UFCG3SWR.js";
10
+ import {
11
+ buildInvalidTypeError
12
+ } from "./chunk-26KTVXJW.js";
13
+ import "./chunk-KBG47ZOY.js";
14
+ import {
15
+ resolveItemTypeRegistry,
16
+ resolveTypeName
17
+ } from "./chunk-SZQCER6S.js";
18
+ import "./chunk-NQP3ECKF.js";
19
+ import {
20
+ CONTEXT_DEPTH_VALUES,
21
+ EXIT_CODE,
22
+ PmCliError,
23
+ getActiveExtensionRegistrations,
24
+ getSettingsPath,
25
+ pathExists,
26
+ readSettingsWithMetadata,
27
+ resolveGlobalPmRoot,
28
+ resolvePmRoot,
29
+ writeSettings
30
+ } from "./chunk-4LTBNUYT.js";
31
+
32
+ // dist/core/config/positional-value.js
33
+ var FORMAT_KEYS = /* @__PURE__ */ new Set(["item_format"]);
34
+ var CRITERIA_KEYS = /* @__PURE__ */ new Set([
35
+ "definition_of_done",
36
+ "metadata_required_fields",
37
+ "lifecycle_stale_blocker_reason_patterns",
38
+ "lifecycle_closure_like_blocked_reason_patterns",
39
+ "lifecycle_closure_like_resolution_patterns",
40
+ "lifecycle_closure_like_actual_result_patterns"
41
+ ]);
42
+ var POLICY_KEYS = /* @__PURE__ */ new Set([
43
+ "history_missing_stream_policy",
44
+ "sprint_release_format_policy",
45
+ "parent_reference_policy",
46
+ "metadata_validation_profile",
47
+ "governance_preset",
48
+ "governance_ownership_enforcement",
49
+ "governance_create_mode_default",
50
+ "governance_close_validation_default",
51
+ "governance_create_default_type",
52
+ "governance_workflow_enforcement",
53
+ "governance_parent_reference_policy",
54
+ "governance_metadata_validation_profile",
55
+ "governance_force_required_for_stale_lock",
56
+ "test_result_tracking",
57
+ "telemetry_tracking"
58
+ ]);
59
+ var ENABLED_DISABLED_POLICY_KEYS = /* @__PURE__ */ new Set([
60
+ "governance_force_required_for_stale_lock",
61
+ "test_result_tracking",
62
+ "telemetry_tracking"
63
+ ]);
64
+ var ENABLED_DISABLED_SYNONYMS = {
65
+ off: "disabled",
66
+ on: "enabled",
67
+ true: "enabled",
68
+ false: "disabled",
69
+ enabled: "enabled",
70
+ disabled: "disabled"
71
+ };
72
+ function toCanonicalKey(keyOrAlias) {
73
+ const normalized = keyOrAlias.trim().toLowerCase().replaceAll("-", "_");
74
+ if (FORMAT_KEYS.has(normalized) || CRITERIA_KEYS.has(normalized) || POLICY_KEYS.has(normalized) || normalized === "context") {
75
+ return normalized;
76
+ }
77
+ return void 0;
78
+ }
79
+ function normalizeEnabledDisabled(value) {
80
+ const normalized = value.trim().toLowerCase();
81
+ return ENABLED_DISABLED_SYNONYMS[normalized] ?? value;
82
+ }
83
+ function resolveConfigPositionalValue(canonicalKeyOrAlias, value) {
84
+ const key = toCanonicalKey(canonicalKeyOrAlias);
85
+ if (key === void 0) {
86
+ return {
87
+ routable: false,
88
+ reason: `Unknown config key "${canonicalKeyOrAlias}" cannot route a positional value.`
89
+ };
90
+ }
91
+ if (key === "context") {
92
+ return {
93
+ routable: false,
94
+ reason: "Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags."
95
+ };
96
+ }
97
+ if (FORMAT_KEYS.has(key)) {
98
+ return { routable: true, flag: "format", value };
99
+ }
100
+ if (CRITERIA_KEYS.has(key)) {
101
+ return { routable: true, flag: "criterion", values: [value] };
102
+ }
103
+ const policyValue = ENABLED_DISABLED_POLICY_KEYS.has(key) ? normalizeEnabledDisabled(value) : value;
104
+ return { routable: true, flag: "policy", value: policyValue };
105
+ }
106
+
107
+ // dist/core/config/nested-settings.js
108
+ var NESTED_SETTING_DESCRIPTORS = [
109
+ {
110
+ key: "search_provider",
111
+ path: "search.provider",
112
+ kind: "string",
113
+ summary: "Search embedding provider name (e.g. openai, ollama, or an extension provider)."
114
+ },
115
+ {
116
+ key: "search_mutation_refresh_policy",
117
+ path: "search.mutation_refresh_policy",
118
+ kind: "string",
119
+ choices: ["cache_only", "semantic_configured", "semantic_auto"],
120
+ summary: "Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."
121
+ },
122
+ {
123
+ key: "search_embedding_model",
124
+ path: "search.embedding_model",
125
+ kind: "string",
126
+ summary: "Default embedding model name (overrides provider-specific model when set)."
127
+ },
128
+ {
129
+ key: "search_embedding_batch_size",
130
+ path: "search.embedding_batch_size",
131
+ kind: "integer",
132
+ min: 1,
133
+ summary: "Number of items embedded per request batch."
134
+ },
135
+ {
136
+ key: "search_embedding_timeout_ms",
137
+ path: "search.embedding_timeout_ms",
138
+ kind: "integer",
139
+ min: 1,
140
+ summary: "Per-request embedding timeout in milliseconds."
141
+ },
142
+ {
143
+ key: "search_score_threshold",
144
+ path: "search.score_threshold",
145
+ kind: "number",
146
+ summary: "Minimum score for a hit to be returned (0 keeps all matches)."
147
+ },
148
+ {
149
+ key: "search_hybrid_semantic_weight",
150
+ path: "search.hybrid_semantic_weight",
151
+ kind: "ratio",
152
+ summary: "Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."
153
+ },
154
+ {
155
+ key: "search_max_results",
156
+ path: "search.max_results",
157
+ kind: "integer",
158
+ min: 1,
159
+ summary: "Default upper bound on search hits when --limit is not supplied."
160
+ },
161
+ {
162
+ key: "openai_base_url",
163
+ path: "providers.openai.base_url",
164
+ kind: "string",
165
+ summary: "OpenAI-compatible API base URL (LM Studio/vLLM also use this)."
166
+ },
167
+ {
168
+ key: "openai_api_key",
169
+ path: "providers.openai.api_key",
170
+ kind: "string",
171
+ summary: "OpenAI-compatible API key."
172
+ },
173
+ {
174
+ key: "openai_model",
175
+ path: "providers.openai.model",
176
+ kind: "string",
177
+ summary: "OpenAI-compatible embedding model name."
178
+ },
179
+ {
180
+ key: "ollama_base_url",
181
+ path: "providers.ollama.base_url",
182
+ kind: "string",
183
+ summary: "Ollama API base URL (typically http://localhost:11434)."
184
+ },
185
+ {
186
+ key: "ollama_model",
187
+ path: "providers.ollama.model",
188
+ kind: "string",
189
+ summary: "Ollama embedding model name (e.g. nomic-embed-text)."
190
+ },
191
+ {
192
+ key: "vector_store_adapter",
193
+ path: "vector_store.adapter",
194
+ kind: "string",
195
+ summary: "Vector store adapter name (lancedb, qdrant, or an extension adapter)."
196
+ },
197
+ {
198
+ key: "qdrant_url",
199
+ path: "vector_store.qdrant.url",
200
+ kind: "string",
201
+ summary: "Qdrant HTTP API URL."
202
+ },
203
+ {
204
+ key: "qdrant_api_key",
205
+ path: "vector_store.qdrant.api_key",
206
+ kind: "string",
207
+ summary: "Qdrant API key (empty if running unauthenticated)."
208
+ },
209
+ {
210
+ key: "lancedb_path",
211
+ path: "vector_store.lancedb.path",
212
+ kind: "string",
213
+ summary: "LanceDB storage path (relative to pm root or absolute)."
214
+ }
215
+ ];
216
+ var DESCRIPTOR_BY_KEY = new Map(NESTED_SETTING_DESCRIPTORS.map((descriptor) => [descriptor.key, descriptor]));
217
+ var NESTED_SETTING_KEYS = NESTED_SETTING_DESCRIPTORS.map((descriptor) => descriptor.key);
218
+ function resolveNestedSettingDescriptor(raw) {
219
+ if (typeof raw !== "string") {
220
+ return void 0;
221
+ }
222
+ const normalized = raw.trim().toLowerCase().replaceAll("-", "_");
223
+ if (normalized.length === 0) {
224
+ return void 0;
225
+ }
226
+ return DESCRIPTOR_BY_KEY.get(normalized);
227
+ }
228
+ function parseNestedSettingValue(descriptor, rawValue) {
229
+ if (typeof rawValue !== "string") {
230
+ return { ok: false, error: { message: `Config set ${descriptor.key} requires a string value` } };
231
+ }
232
+ const trimmed = rawValue.trim();
233
+ if (descriptor.kind === "string") {
234
+ if (descriptor.choices && !descriptor.choices.includes(trimmed)) {
235
+ return {
236
+ ok: false,
237
+ error: {
238
+ message: `Config set ${descriptor.key} must be one of ${descriptor.choices.join("|")}, got "${rawValue}"`
239
+ }
240
+ };
241
+ }
242
+ return { ok: true, parsed: { descriptor, value: trimmed } };
243
+ }
244
+ if (trimmed.length === 0) {
245
+ return {
246
+ ok: false,
247
+ error: { message: `Config set ${descriptor.key} requires a non-empty value` }
248
+ };
249
+ }
250
+ const parsed = Number(trimmed);
251
+ if (!Number.isFinite(parsed)) {
252
+ return {
253
+ ok: false,
254
+ error: { message: `Config set ${descriptor.key} requires a finite number, got "${rawValue}"` }
255
+ };
256
+ }
257
+ if (descriptor.kind === "integer") {
258
+ if (!Number.isInteger(parsed) || parsed < 0) {
259
+ return {
260
+ ok: false,
261
+ error: { message: `Config set ${descriptor.key} requires a non-negative integer, got "${rawValue}"` }
262
+ };
263
+ }
264
+ if (descriptor.min !== void 0 && parsed < descriptor.min) {
265
+ return {
266
+ ok: false,
267
+ error: {
268
+ message: `Config set ${descriptor.key} requires an integer >= ${descriptor.min}, got "${rawValue}" (the runtime silently ignores 0 here and falls back to the default)`
269
+ }
270
+ };
271
+ }
272
+ return { ok: true, parsed: { descriptor, value: parsed } };
273
+ }
274
+ if (descriptor.kind === "ratio") {
275
+ if (parsed < 0 || parsed > 1) {
276
+ return {
277
+ ok: false,
278
+ error: { message: `Config set ${descriptor.key} requires a number in [0, 1], got "${rawValue}"` }
279
+ };
280
+ }
281
+ return { ok: true, parsed: { descriptor, value: parsed } };
282
+ }
283
+ if (descriptor.min !== void 0 && parsed < descriptor.min) {
284
+ return {
285
+ ok: false,
286
+ error: { message: `Config set ${descriptor.key} requires a number >= ${descriptor.min}, got "${rawValue}"` }
287
+ };
288
+ }
289
+ return { ok: true, parsed: { descriptor, value: parsed } };
290
+ }
291
+ function readNestedSettingValue(settings, descriptor) {
292
+ const segments = descriptor.path.split(".");
293
+ let cursor = settings;
294
+ for (const segment of segments) {
295
+ if (typeof cursor !== "object" || cursor === null) {
296
+ return null;
297
+ }
298
+ cursor = cursor[segment];
299
+ }
300
+ if (typeof cursor === "string" || typeof cursor === "number") {
301
+ return cursor;
302
+ }
303
+ return null;
304
+ }
305
+ function writeNestedSettingValue(settings, descriptor, value) {
306
+ const segments = descriptor.path.split(".");
307
+ let cursor = settings;
308
+ for (let index = 0; index < segments.length - 1; index += 1) {
309
+ const segment = segments[index];
310
+ const existing = cursor[segment];
311
+ if (typeof existing !== "object" || existing === null || Array.isArray(existing)) {
312
+ const next = {};
313
+ cursor[segment] = next;
314
+ cursor = next;
315
+ } else {
316
+ cursor = existing;
317
+ }
318
+ }
319
+ const leafKey = segments[segments.length - 1];
320
+ const previous = cursor[leafKey];
321
+ if (previous === value) {
322
+ return false;
323
+ }
324
+ cursor[leafKey] = value;
325
+ return true;
326
+ }
327
+
328
+ // dist/cli/commands/config.js
329
+ var CONFIG_SCOPE_VALUES = ["project", "global"];
330
+ var CONFIG_KEY_VALUES = [
331
+ "definition-of-done",
332
+ "definition_of_done",
333
+ "item-format",
334
+ "item_format",
335
+ "history-missing-stream-policy",
336
+ "history_missing_stream_policy",
337
+ "sprint-release-format-policy",
338
+ "sprint_release_format_policy",
339
+ "parent-reference-policy",
340
+ "parent_reference_policy",
341
+ "metadata-validation-profile",
342
+ "metadata_validation_profile",
343
+ "metadata-required-fields",
344
+ "metadata_required_fields",
345
+ "lifecycle-stale-blocker-reason-patterns",
346
+ "lifecycle_stale_blocker_reason_patterns",
347
+ "lifecycle-closure-like-blocked-reason-patterns",
348
+ "lifecycle_closure_like_blocked_reason_patterns",
349
+ "lifecycle-closure-like-resolution-patterns",
350
+ "lifecycle_closure_like_resolution_patterns",
351
+ "lifecycle-closure-like-actual-result-patterns",
352
+ "lifecycle_closure_like_actual_result_patterns",
353
+ "governance-preset",
354
+ "governance_preset",
355
+ "governance-ownership-enforcement",
356
+ "governance_ownership_enforcement",
357
+ "governance-create-mode-default",
358
+ "governance_create_mode_default",
359
+ "governance-close-validation-default",
360
+ "governance_close_validation_default",
361
+ "governance-create-default-type",
362
+ "governance_create_default_type",
363
+ "governance-workflow-enforcement",
364
+ "governance_workflow_enforcement",
365
+ "governance-parent-reference-policy",
366
+ "governance_parent_reference_policy",
367
+ "governance-metadata-validation-profile",
368
+ "governance_metadata_validation_profile",
369
+ "governance-force-required-for-stale-lock",
370
+ "governance_force_required_for_stale_lock",
371
+ "test-result-tracking",
372
+ "test_result_tracking",
373
+ "telemetry-tracking",
374
+ "telemetry_tracking",
375
+ "context"
376
+ ];
377
+ var CONFIG_KEY_ALIASES = {
378
+ definition_of_done: ["definition-of-done", "definition_of_done"],
379
+ item_format: ["item-format", "item_format"],
380
+ history_missing_stream_policy: ["history-missing-stream-policy", "history_missing_stream_policy"],
381
+ sprint_release_format_policy: ["sprint-release-format-policy", "sprint_release_format_policy"],
382
+ parent_reference_policy: ["parent-reference-policy", "parent_reference_policy"],
383
+ metadata_validation_profile: ["metadata-validation-profile", "metadata_validation_profile"],
384
+ metadata_required_fields: ["metadata-required-fields", "metadata_required_fields"],
385
+ lifecycle_stale_blocker_reason_patterns: [
386
+ "lifecycle-stale-blocker-reason-patterns",
387
+ "lifecycle_stale_blocker_reason_patterns"
388
+ ],
389
+ lifecycle_closure_like_blocked_reason_patterns: [
390
+ "lifecycle-closure-like-blocked-reason-patterns",
391
+ "lifecycle_closure_like_blocked_reason_patterns"
392
+ ],
393
+ lifecycle_closure_like_resolution_patterns: [
394
+ "lifecycle-closure-like-resolution-patterns",
395
+ "lifecycle_closure_like_resolution_patterns"
396
+ ],
397
+ lifecycle_closure_like_actual_result_patterns: [
398
+ "lifecycle-closure-like-actual-result-patterns",
399
+ "lifecycle_closure_like_actual_result_patterns"
400
+ ],
401
+ governance_preset: ["governance-preset", "governance_preset"],
402
+ governance_ownership_enforcement: ["governance-ownership-enforcement", "governance_ownership_enforcement"],
403
+ governance_create_mode_default: ["governance-create-mode-default", "governance_create_mode_default"],
404
+ governance_close_validation_default: [
405
+ "governance-close-validation-default",
406
+ "governance_close_validation_default"
407
+ ],
408
+ governance_create_default_type: ["governance-create-default-type", "governance_create_default_type"],
409
+ governance_workflow_enforcement: ["governance-workflow-enforcement", "governance_workflow_enforcement"],
410
+ governance_parent_reference_policy: ["governance-parent-reference-policy", "governance_parent_reference_policy"],
411
+ governance_metadata_validation_profile: [
412
+ "governance-metadata-validation-profile",
413
+ "governance_metadata_validation_profile"
414
+ ],
415
+ governance_force_required_for_stale_lock: [
416
+ "governance-force-required-for-stale-lock",
417
+ "governance_force_required_for_stale_lock"
418
+ ],
419
+ test_result_tracking: ["test-result-tracking", "test_result_tracking"],
420
+ telemetry_tracking: ["telemetry-tracking", "telemetry_tracking"],
421
+ context: ["context"]
422
+ };
423
+ var CANONICAL_CONFIG_KEYS = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => CONFIG_KEY_ALIASES[candidate][0]);
424
+ var CONFIG_KEY_SUMMARIES = {
425
+ definition_of_done: "Definition of Done criteria list.",
426
+ item_format: "Default item file format.",
427
+ history_missing_stream_policy: "Missing history stream handling policy.",
428
+ sprint_release_format_policy: "Sprint/release format validation policy.",
429
+ parent_reference_policy: "Parent reference validation policy.",
430
+ metadata_validation_profile: "Validate metadata profile policy (core|strict|custom).",
431
+ metadata_required_fields: "Validate custom metadata required-fields list.",
432
+ lifecycle_stale_blocker_reason_patterns: "Validate lifecycle stale-blocker reason substring patterns (criteria list).",
433
+ lifecycle_closure_like_blocked_reason_patterns: "Validate lifecycle closure-like blocked_reason substring patterns (criteria list).",
434
+ lifecycle_closure_like_resolution_patterns: "Validate lifecycle closure-like resolution substring patterns (criteria list).",
435
+ lifecycle_closure_like_actual_result_patterns: "Validate lifecycle closure-like actual_result substring patterns (criteria list).",
436
+ governance_preset: "Governance preset policy (minimal|default|strict|custom).",
437
+ governance_ownership_enforcement: "Governance ownership enforcement policy (none|warn|strict).",
438
+ governance_create_mode_default: "Governance default create mode (progressive|strict).",
439
+ governance_close_validation_default: "Governance default close validation mode (off|warn|strict).",
440
+ governance_create_default_type: "Governance default item type for `pm create` when --type is omitted.",
441
+ governance_workflow_enforcement: "Governance per-type transition enforcement mode (off|warn|strict).",
442
+ governance_parent_reference_policy: "Governance parent reference policy (warn|strict_error).",
443
+ governance_metadata_validation_profile: "Governance metadata validation profile (core|strict|custom).",
444
+ governance_force_required_for_stale_lock: "Governance stale-lock force policy (enabled|disabled).",
445
+ test_result_tracking: "Item-level linked test result persistence policy.",
446
+ telemetry_tracking: "Telemetry usage reporting policy.",
447
+ context: "Context command settings (depth, section toggles, limits)."
448
+ };
449
+ var LIFECYCLE_PATTERN_CONFIG_KEYS = [
450
+ "lifecycle_stale_blocker_reason_patterns",
451
+ "lifecycle_closure_like_blocked_reason_patterns",
452
+ "lifecycle_closure_like_resolution_patterns",
453
+ "lifecycle_closure_like_actual_result_patterns"
454
+ ];
455
+ function isCriteriaConfigKey(key) {
456
+ return key === "definition_of_done" || key === "metadata_required_fields" || LIFECYCLE_PATTERN_CONFIG_KEYS.includes(key);
457
+ }
458
+ function normalizeScope(value) {
459
+ if (CONFIG_SCOPE_VALUES.includes(value)) {
460
+ return value;
461
+ }
462
+ throw new PmCliError(`Invalid config scope "${value}". Allowed: ${CONFIG_SCOPE_VALUES.join(", ")}`, EXIT_CODE.USAGE);
463
+ }
464
+ function normalizeAction(value) {
465
+ if (value === "get" || value === "set" || value === "list" || value === "export") {
466
+ return value;
467
+ }
468
+ throw new PmCliError(`Invalid config action "${value}". Allowed: get, set, list, export`, EXIT_CODE.USAGE);
469
+ }
470
+ function normalizeKey(value) {
471
+ if (CONFIG_KEY_VALUES.includes(value)) {
472
+ if (value === "item-format" || value === "item_format") {
473
+ return "item_format";
474
+ }
475
+ if (value === "history-missing-stream-policy" || value === "history_missing_stream_policy") {
476
+ return "history_missing_stream_policy";
477
+ }
478
+ if (value === "sprint-release-format-policy" || value === "sprint_release_format_policy") {
479
+ return "sprint_release_format_policy";
480
+ }
481
+ if (value === "parent-reference-policy" || value === "parent_reference_policy") {
482
+ return "parent_reference_policy";
483
+ }
484
+ if (value === "metadata-validation-profile" || value === "metadata_validation_profile") {
485
+ return "metadata_validation_profile";
486
+ }
487
+ if (value === "metadata-required-fields" || value === "metadata_required_fields") {
488
+ return "metadata_required_fields";
489
+ }
490
+ if (value === "lifecycle-stale-blocker-reason-patterns" || value === "lifecycle_stale_blocker_reason_patterns") {
491
+ return "lifecycle_stale_blocker_reason_patterns";
492
+ }
493
+ if (value === "lifecycle-closure-like-blocked-reason-patterns" || value === "lifecycle_closure_like_blocked_reason_patterns") {
494
+ return "lifecycle_closure_like_blocked_reason_patterns";
495
+ }
496
+ if (value === "lifecycle-closure-like-resolution-patterns" || value === "lifecycle_closure_like_resolution_patterns") {
497
+ return "lifecycle_closure_like_resolution_patterns";
498
+ }
499
+ if (value === "lifecycle-closure-like-actual-result-patterns" || value === "lifecycle_closure_like_actual_result_patterns") {
500
+ return "lifecycle_closure_like_actual_result_patterns";
501
+ }
502
+ if (value === "governance-preset" || value === "governance_preset") {
503
+ return "governance_preset";
504
+ }
505
+ if (value === "governance-ownership-enforcement" || value === "governance_ownership_enforcement") {
506
+ return "governance_ownership_enforcement";
507
+ }
508
+ if (value === "governance-create-mode-default" || value === "governance_create_mode_default") {
509
+ return "governance_create_mode_default";
510
+ }
511
+ if (value === "governance-close-validation-default" || value === "governance_close_validation_default") {
512
+ return "governance_close_validation_default";
513
+ }
514
+ if (value === "governance-create-default-type" || value === "governance_create_default_type") {
515
+ return "governance_create_default_type";
516
+ }
517
+ if (value === "governance-workflow-enforcement" || value === "governance_workflow_enforcement") {
518
+ return "governance_workflow_enforcement";
519
+ }
520
+ if (value === "governance-parent-reference-policy" || value === "governance_parent_reference_policy") {
521
+ return "governance_parent_reference_policy";
522
+ }
523
+ if (value === "governance-metadata-validation-profile" || value === "governance_metadata_validation_profile") {
524
+ return "governance_metadata_validation_profile";
525
+ }
526
+ if (value === "governance-force-required-for-stale-lock" || value === "governance_force_required_for_stale_lock") {
527
+ return "governance_force_required_for_stale_lock";
528
+ }
529
+ if (value === "test-result-tracking" || value === "test_result_tracking") {
530
+ return "test_result_tracking";
531
+ }
532
+ if (value === "telemetry-tracking" || value === "telemetry_tracking") {
533
+ return "telemetry_tracking";
534
+ }
535
+ if (value === "context") {
536
+ return "context";
537
+ }
538
+ return "definition_of_done";
539
+ }
540
+ const nestedKeys = NESTED_SETTING_DESCRIPTORS.map((descriptor) => descriptor.key).join(", ");
541
+ throw new PmCliError(`Invalid config key "${value}". Supported: ${CANONICAL_CONFIG_KEYS.join(", ")} (underscore variants also accepted). Nested leaf settings: ${nestedKeys}.`, EXIT_CODE.USAGE);
542
+ }
543
+ function normalizeCriteria(values, clearCriteria) {
544
+ const normalized = [...new Set((values ?? []).map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
545
+ if (clearCriteria) {
546
+ if (normalized.length > 0) {
547
+ throw new PmCliError("Config set definition-of-done cannot combine --clear-criteria with --criterion values", EXIT_CODE.USAGE);
548
+ }
549
+ return [];
550
+ }
551
+ if (normalized.length === 0) {
552
+ throw new PmCliError("Config set definition-of-done requires at least one non-empty --criterion value (or --clear-criteria to clear)", EXIT_CODE.USAGE);
553
+ }
554
+ return normalized;
555
+ }
556
+ function normalizeItemFormat(value) {
557
+ const normalized = value?.trim().toLowerCase();
558
+ if (normalized === "toon") {
559
+ return "toon";
560
+ }
561
+ if (normalized === "json_markdown") {
562
+ throw new PmCliError("Config set item-format no longer accepts json_markdown. Markdown item files are legacy read/migration input only.", EXIT_CODE.USAGE);
563
+ }
564
+ throw new PmCliError("Config set item-format requires --format toon", EXIT_CODE.USAGE);
565
+ }
566
+ function normalizeHistoryMissingStreamPolicy(value) {
567
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
568
+ if (normalized === "auto_create" || normalized === "strict_error") {
569
+ return normalized;
570
+ }
571
+ throw new PmCliError("Config set history-missing-stream-policy requires --policy with one of: auto_create, strict_error", EXIT_CODE.USAGE);
572
+ }
573
+ function normalizeTestResultTrackingPolicy(value) {
574
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
575
+ if (normalized === "enabled" || normalized === "disabled") {
576
+ return normalized;
577
+ }
578
+ throw new PmCliError("Config set test-result-tracking requires --policy with one of: enabled, disabled", EXIT_CODE.USAGE);
579
+ }
580
+ function normalizeTelemetryTrackingPolicy(value) {
581
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
582
+ if (normalized === "enabled" || normalized === "disabled") {
583
+ return normalized;
584
+ }
585
+ throw new PmCliError("Config set telemetry-tracking requires --policy with one of: enabled, disabled", EXIT_CODE.USAGE);
586
+ }
587
+ function normalizeValidateMetadataProfile(value) {
588
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
589
+ if (normalized === "core" || normalized === "strict" || normalized === "custom") {
590
+ return normalized;
591
+ }
592
+ throw new PmCliError("Config set metadata-validation-profile requires --policy with one of: core, strict, custom", EXIT_CODE.USAGE);
593
+ }
594
+ function normalizeGovernancePreset(value) {
595
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
596
+ if (normalized === "minimal" || normalized === "default" || normalized === "strict" || normalized === "custom") {
597
+ return normalized;
598
+ }
599
+ throw new PmCliError("Config set governance-preset requires --policy with one of: minimal, default, strict, custom", EXIT_CODE.USAGE);
600
+ }
601
+ function normalizeGovernanceOwnershipEnforcement(value) {
602
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
603
+ if (normalized === "none" || normalized === "warn" || normalized === "strict") {
604
+ return normalized;
605
+ }
606
+ throw new PmCliError("Config set governance-ownership-enforcement requires --policy with one of: none, warn, strict", EXIT_CODE.USAGE);
607
+ }
608
+ function normalizeGovernanceCreateModeDefault(value) {
609
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
610
+ if (normalized === "progressive" || normalized === "strict") {
611
+ return normalized;
612
+ }
613
+ throw new PmCliError("Config set governance-create-mode-default requires --policy with one of: progressive, strict", EXIT_CODE.USAGE);
614
+ }
615
+ function normalizeGovernanceCloseValidationDefault(value) {
616
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
617
+ if (normalized === "off" || normalized === "warn" || normalized === "strict") {
618
+ return normalized;
619
+ }
620
+ if (normalized === "none" || normalized === "disabled") {
621
+ return "off";
622
+ }
623
+ throw new PmCliError("Config set governance-close-validation-default requires --policy with one of: off, warn, strict", EXIT_CODE.USAGE);
624
+ }
625
+ function normalizeGovernanceWorkflowEnforcement(value) {
626
+ const normalized = typeof value === "string" ? value.trim().toLowerCase().replaceAll("-", "_") : void 0;
627
+ if (normalized === "off" || normalized === "warn" || normalized === "strict") {
628
+ return normalized;
629
+ }
630
+ if (normalized === "none" || normalized === "disabled") {
631
+ return "off";
632
+ }
633
+ throw new PmCliError("Config set governance-workflow-enforcement requires one of: off, warn, strict", EXIT_CODE.USAGE);
634
+ }
635
+ function normalizeGovernanceForceRequiredForStaleLockPolicy(value) {
636
+ const normalized = value?.trim().toLowerCase().replaceAll("-", "_");
637
+ if (normalized === "enabled" || normalized === "disabled") {
638
+ return normalized;
639
+ }
640
+ throw new PmCliError("Config set governance-force-required-for-stale-lock requires --policy with one of: enabled, disabled", EXIT_CODE.USAGE);
641
+ }
642
+ function normalizePolicyForConflict(key, value) {
643
+ switch (key) {
644
+ case "history_missing_stream_policy":
645
+ return normalizeHistoryMissingStreamPolicy(value);
646
+ case "sprint_release_format_policy":
647
+ return normalizeSprintReleaseFormatPolicy(value);
648
+ case "parent_reference_policy":
649
+ case "governance_parent_reference_policy":
650
+ return normalizeParentReferencePolicy(value);
651
+ case "metadata_validation_profile":
652
+ case "governance_metadata_validation_profile":
653
+ return normalizeValidateMetadataProfile(value);
654
+ case "governance_preset":
655
+ return normalizeGovernancePreset(value);
656
+ case "governance_ownership_enforcement":
657
+ return normalizeGovernanceOwnershipEnforcement(value);
658
+ case "governance_create_mode_default":
659
+ return normalizeGovernanceCreateModeDefault(value);
660
+ case "governance_close_validation_default":
661
+ return normalizeGovernanceCloseValidationDefault(value);
662
+ case "governance_workflow_enforcement":
663
+ return normalizeGovernanceWorkflowEnforcement(value);
664
+ case "governance_force_required_for_stale_lock":
665
+ return normalizeGovernanceForceRequiredForStaleLockPolicy(value);
666
+ case "test_result_tracking":
667
+ return normalizeTestResultTrackingPolicy(value);
668
+ case "telemetry_tracking":
669
+ return normalizeTelemetryTrackingPolicy(value);
670
+ default:
671
+ return value.trim().toLowerCase().replaceAll("-", "_");
672
+ }
673
+ }
674
+ var METADATA_REQUIRED_FIELD_ALIAS_MAP = {
675
+ author: "author",
676
+ acceptance_criteria: "acceptance_criteria",
677
+ "acceptance-criteria": "acceptance_criteria",
678
+ estimated_minutes: "estimated_minutes",
679
+ "estimated-minutes": "estimated_minutes",
680
+ estimate: "estimated_minutes",
681
+ close_reason: "close_reason",
682
+ "close-reason": "close_reason",
683
+ reviewer: "reviewer",
684
+ risk: "risk",
685
+ confidence: "confidence",
686
+ sprint: "sprint",
687
+ release: "release"
688
+ };
689
+ var METADATA_REQUIRED_FIELD_OPTIONS = [
690
+ "author",
691
+ "acceptance_criteria",
692
+ "estimated_minutes",
693
+ "close_reason",
694
+ "reviewer",
695
+ "risk",
696
+ "confidence",
697
+ "sprint",
698
+ "release"
699
+ ];
700
+ function normalizeMetadataRequiredFields(values, clearCriteria) {
701
+ const normalized = [...new Set((values ?? []).map((value) => value.trim()).filter((value) => value.length > 0))];
702
+ if (clearCriteria) {
703
+ if (normalized.length > 0) {
704
+ throw new PmCliError("Config set metadata-required-fields cannot combine --clear-criteria with --criterion values", EXIT_CODE.USAGE);
705
+ }
706
+ return [];
707
+ }
708
+ if (normalized.length === 0) {
709
+ throw new PmCliError("Config set metadata-required-fields requires at least one --criterion value (or --clear-criteria to clear)", EXIT_CODE.USAGE);
710
+ }
711
+ const lowered = normalized.map((value) => value.toLowerCase().replaceAll("-", "_"));
712
+ const unsupported = lowered.filter((value) => METADATA_REQUIRED_FIELD_ALIAS_MAP[value] === void 0);
713
+ if (unsupported.length > 0) {
714
+ throw new PmCliError(`Config set metadata-required-fields received unsupported values: ${unsupported.join(", ")}. Supported values: ${METADATA_REQUIRED_FIELD_OPTIONS.join(", ")}`, EXIT_CODE.USAGE);
715
+ }
716
+ return [...new Set(lowered.map((value) => METADATA_REQUIRED_FIELD_ALIAS_MAP[value]))].sort((left, right) => left.localeCompare(right));
717
+ }
718
+ function normalizeLifecyclePatternCriteria(key, values, clearCriteria) {
719
+ const normalized = [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
720
+ if (clearCriteria) {
721
+ if (normalized.length > 0) {
722
+ throw new PmCliError(`Config set ${CONFIG_KEY_ALIASES[key][0]} cannot combine --clear-criteria with --criterion values`, EXIT_CODE.USAGE);
723
+ }
724
+ return [];
725
+ }
726
+ if (normalized.length === 0) {
727
+ throw new PmCliError(`Config set ${CONFIG_KEY_ALIASES[key][0]} requires at least one --criterion value (or --clear-criteria to clear)`, EXIT_CODE.USAGE);
728
+ }
729
+ return normalized;
730
+ }
731
+ function normalizeWarnings(values) {
732
+ return [...new Set(values)].sort((left, right) => left.localeCompare(right));
733
+ }
734
+ function normalizeKeyForAction(action, value) {
735
+ if (action === "list" || action === "export") {
736
+ if (typeof value === "string" && value.trim().length > 0) {
737
+ throw new PmCliError(`Config action "${action}" does not accept <key>`, EXIT_CODE.USAGE);
738
+ }
739
+ return void 0;
740
+ }
741
+ if (typeof value !== "string" || value.trim().length === 0) {
742
+ throw new PmCliError(`Config action "${action}" requires <key>`, EXIT_CODE.USAGE);
743
+ }
744
+ return normalizeKey(value);
745
+ }
746
+ function readConfigValue(settings, key) {
747
+ if (key === "item_format") {
748
+ return settings.item_format;
749
+ }
750
+ if (key === "history_missing_stream_policy") {
751
+ return settings.history.missing_stream;
752
+ }
753
+ if (key === "sprint_release_format_policy") {
754
+ return settings.validation.sprint_release_format;
755
+ }
756
+ if (key === "parent_reference_policy") {
757
+ return settings.validation.parent_reference;
758
+ }
759
+ if (key === "metadata_validation_profile") {
760
+ return settings.validation.metadata_profile;
761
+ }
762
+ if (key === "metadata_required_fields") {
763
+ return [...settings.validation.metadata_required_fields];
764
+ }
765
+ if (key === "lifecycle_stale_blocker_reason_patterns") {
766
+ return [...settings.validation.lifecycle_stale_blocker_reason_patterns];
767
+ }
768
+ if (key === "lifecycle_closure_like_blocked_reason_patterns") {
769
+ return [...settings.validation.lifecycle_closure_like_blocked_reason_patterns];
770
+ }
771
+ if (key === "lifecycle_closure_like_resolution_patterns") {
772
+ return [...settings.validation.lifecycle_closure_like_resolution_patterns];
773
+ }
774
+ if (key === "lifecycle_closure_like_actual_result_patterns") {
775
+ return [...settings.validation.lifecycle_closure_like_actual_result_patterns];
776
+ }
777
+ if (key === "governance_preset") {
778
+ return settings.governance.preset;
779
+ }
780
+ if (key === "governance_ownership_enforcement") {
781
+ return settings.governance.ownership_enforcement;
782
+ }
783
+ if (key === "governance_create_mode_default") {
784
+ return settings.governance.create_mode_default;
785
+ }
786
+ if (key === "governance_close_validation_default") {
787
+ return settings.governance.close_validation_default;
788
+ }
789
+ if (key === "governance_create_default_type") {
790
+ return settings.governance.create_default_type ?? "";
791
+ }
792
+ if (key === "governance_workflow_enforcement") {
793
+ return settings.governance.workflow_enforcement ?? "off";
794
+ }
795
+ if (key === "governance_parent_reference_policy") {
796
+ return settings.governance.parent_reference;
797
+ }
798
+ if (key === "governance_metadata_validation_profile") {
799
+ return settings.governance.metadata_profile;
800
+ }
801
+ if (key === "governance_force_required_for_stale_lock") {
802
+ return settings.governance.force_required_for_stale_lock ? "enabled" : "disabled";
803
+ }
804
+ if (key === "test_result_tracking") {
805
+ return settings.testing.record_results_to_items ? "enabled" : "disabled";
806
+ }
807
+ if (key === "telemetry_tracking") {
808
+ return settings.telemetry.enabled ? "enabled" : "disabled";
809
+ }
810
+ if (key === "context") {
811
+ return {
812
+ default_depth: settings.context.default_depth,
813
+ activity_limit: settings.context.activity_limit,
814
+ stale_threshold_days: settings.context.stale_threshold_days,
815
+ sections: { ...settings.context.sections }
816
+ };
817
+ }
818
+ return [...settings.workflow.definition_of_done];
819
+ }
820
+ function withWarnings(result, warnings) {
821
+ if (warnings.length === 0) {
822
+ return result;
823
+ }
824
+ return {
825
+ ...result,
826
+ warnings
827
+ };
828
+ }
829
+ async function resolveSettingsTarget(scope, global) {
830
+ const cwd = process.cwd();
831
+ const pmRoot = scope === "project" ? resolvePmRoot(cwd, global.path) : resolveGlobalPmRoot(cwd);
832
+ const settingsPath = getSettingsPath(pmRoot);
833
+ if (scope === "project" && !await pathExists(settingsPath)) {
834
+ throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
835
+ }
836
+ return { pmRoot, settingsPath };
837
+ }
838
+ function parseSectionToggle(raw) {
839
+ if (raw === void 0)
840
+ return void 0;
841
+ const normalized = raw.trim().toLowerCase();
842
+ if (normalized === "true" || normalized === "enabled" || normalized === "on" || normalized === "1")
843
+ return true;
844
+ if (normalized === "false" || normalized === "disabled" || normalized === "off" || normalized === "0")
845
+ return false;
846
+ throw new PmCliError(`Context section toggle must be true|false|enabled|disabled, got "${raw}"`, EXIT_CODE.USAGE);
847
+ }
848
+ async function applyContextConfig(settings, options, target, scope, warnings) {
849
+ let changed = false;
850
+ const ctx = settings.context;
851
+ if (options.defaultDepth !== void 0) {
852
+ const normalized = options.defaultDepth.trim().toLowerCase();
853
+ if (!CONTEXT_DEPTH_VALUES.includes(normalized)) {
854
+ throw new PmCliError(`Context --default-depth must be one of ${CONTEXT_DEPTH_VALUES.join("|")}`, EXIT_CODE.USAGE);
855
+ }
856
+ if (ctx.default_depth !== normalized) {
857
+ ctx.default_depth = normalized;
858
+ changed = true;
859
+ }
860
+ }
861
+ if (options.activityLimit !== void 0) {
862
+ const parsed = parseInt(options.activityLimit.trim(), 10);
863
+ if (isNaN(parsed) || parsed <= 0) {
864
+ throw new PmCliError("Context --activity-limit must be a positive integer", EXIT_CODE.USAGE);
865
+ }
866
+ if (ctx.activity_limit !== parsed) {
867
+ ctx.activity_limit = parsed;
868
+ changed = true;
869
+ }
870
+ }
871
+ if (options.staleThresholdDays !== void 0) {
872
+ const parsed = parseInt(options.staleThresholdDays.trim(), 10);
873
+ if (isNaN(parsed) || parsed <= 0) {
874
+ throw new PmCliError("Context --stale-threshold-days must be a positive integer", EXIT_CODE.USAGE);
875
+ }
876
+ if (ctx.stale_threshold_days !== parsed) {
877
+ ctx.stale_threshold_days = parsed;
878
+ changed = true;
879
+ }
880
+ }
881
+ const sectionToggles = [
882
+ ["hierarchy", options.sectionHierarchy],
883
+ ["activity", options.sectionActivity],
884
+ ["progress", options.sectionProgress],
885
+ ["blockers", options.sectionBlockers],
886
+ ["files", options.sectionFiles],
887
+ ["workload", options.sectionWorkload],
888
+ ["staleness", options.sectionStaleness],
889
+ ["tests", options.sectionTests]
890
+ ];
891
+ for (const [sectionName, rawValue] of sectionToggles) {
892
+ const toggle = parseSectionToggle(rawValue);
893
+ if (toggle !== void 0) {
894
+ const key = sectionName;
895
+ if (ctx.sections[key] !== toggle) {
896
+ ctx.sections[key] = toggle;
897
+ changed = true;
898
+ }
899
+ }
900
+ }
901
+ if (changed) {
902
+ await writeSettings(target.pmRoot, settings, "config:set:context");
903
+ }
904
+ return withWarnings({
905
+ scope,
906
+ key: "context",
907
+ context_settings: {
908
+ default_depth: ctx.default_depth,
909
+ activity_limit: ctx.activity_limit,
910
+ stale_threshold_days: ctx.stale_threshold_days,
911
+ sections: { ...ctx.sections }
912
+ },
913
+ settings_path: target.settingsPath,
914
+ changed
915
+ }, warnings);
916
+ }
917
+ function applyPositionalValue(action, keyValue, normalizedKey, nestedSetting, valueValue, options) {
918
+ if (valueValue === void 0) {
919
+ return options;
920
+ }
921
+ if (action !== "set") {
922
+ throw new PmCliError(`Config action "${action}" does not accept a positional value. Only "set" takes <value>.`, EXIT_CODE.USAGE);
923
+ }
924
+ if (typeof keyValue !== "string" || keyValue.trim().length === 0) {
925
+ throw new PmCliError('Config action "set" requires <key> before a positional <value>.', EXIT_CODE.USAGE);
926
+ }
927
+ if (nestedSetting) {
928
+ if (options.value !== void 0 && valueValue !== void 0 && options.value !== valueValue) {
929
+ throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --value "${options.value}". Pass only one.`, EXIT_CODE.USAGE);
930
+ }
931
+ return { ...options, value: valueValue ?? options.value };
932
+ }
933
+ const routed = resolveConfigPositionalValue(normalizedKey ?? keyValue, valueValue);
934
+ if (!routed.routable) {
935
+ throw new PmCliError(routed.reason, EXIT_CODE.USAGE);
936
+ }
937
+ if (routed.flag === "criterion") {
938
+ if (options.criterion !== void 0 && options.criterion.length > 0) {
939
+ throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --criterion. Pass criteria via --criterion only when supplying more than one value.`, EXIT_CODE.USAGE);
940
+ }
941
+ return { ...options, criterion: routed.values };
942
+ }
943
+ if (routed.flag === "format") {
944
+ if (options.format !== void 0 && normalizeItemFormat(options.format) !== normalizeItemFormat(routed.value)) {
945
+ throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --format "${options.format}". Pass only one.`, EXIT_CODE.USAGE);
946
+ }
947
+ return { ...options, format: routed.value };
948
+ }
949
+ if (options.policy !== void 0 && normalizePolicyForConflict(normalizedKey, options.policy) !== normalizePolicyForConflict(normalizedKey, routed.value)) {
950
+ throw new PmCliError(`Config set ${keyValue} received both positional value "${valueValue}" and --policy "${options.policy}". Pass only one.`, EXIT_CODE.USAGE);
951
+ }
952
+ return { ...options, policy: routed.value };
953
+ }
954
+ async function runConfig(scopeValue, actionValue, keyValue, options, global, valueValue) {
955
+ const scope = normalizeScope(scopeValue);
956
+ const action = normalizeAction(actionValue);
957
+ const nestedSetting = action === "get" || action === "set" ? resolveNestedSettingDescriptor(keyValue) : void 0;
958
+ const key = nestedSetting ? void 0 : normalizeKeyForAction(action, keyValue);
959
+ options = applyPositionalValue(action, keyValue, key, nestedSetting, valueValue, options);
960
+ const target = await resolveSettingsTarget(scope, global);
961
+ const { settings, metadata, warnings: settingsReadWarnings } = await readSettingsWithMetadata(target.pmRoot);
962
+ const warnings = normalizeWarnings(settingsReadWarnings);
963
+ if (nestedSetting) {
964
+ if (action === "get") {
965
+ const currentValue = readNestedSettingValue(settings, nestedSetting);
966
+ return withWarnings({
967
+ scope,
968
+ key: nestedSetting.key,
969
+ nested_setting: {
970
+ key: nestedSetting.key,
971
+ path: nestedSetting.path,
972
+ kind: nestedSetting.kind,
973
+ value: currentValue
974
+ },
975
+ settings_path: target.settingsPath,
976
+ changed: false
977
+ }, warnings);
978
+ }
979
+ const rawValue = options.value;
980
+ if (typeof rawValue !== "string") {
981
+ 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);
982
+ }
983
+ const parsed = parseNestedSettingValue(nestedSetting, rawValue);
984
+ if (!parsed.ok) {
985
+ throw new PmCliError(parsed.error.message, EXIT_CODE.USAGE);
986
+ }
987
+ const changed2 = writeNestedSettingValue(settings, nestedSetting, parsed.parsed.value);
988
+ if (changed2) {
989
+ await writeSettings(target.pmRoot, settings, `config:set:${nestedSetting.path}`);
990
+ }
991
+ return withWarnings({
992
+ scope,
993
+ key: nestedSetting.key,
994
+ nested_setting: {
995
+ key: nestedSetting.key,
996
+ path: nestedSetting.path,
997
+ kind: nestedSetting.kind,
998
+ value: parsed.parsed.value
999
+ },
1000
+ settings_path: target.settingsPath,
1001
+ changed: changed2
1002
+ }, warnings);
1003
+ }
1004
+ if (action === "list") {
1005
+ const keys = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => ({
1006
+ key: candidate,
1007
+ aliases: CONFIG_KEY_ALIASES[candidate],
1008
+ value_kind: candidate === "context" ? "object" : isCriteriaConfigKey(candidate) ? "string_array" : "enum",
1009
+ set_flags: candidate === "context" ? ["--default-depth", "--activity-limit", "--stale-threshold-days", "--section-<name>"] : isCriteriaConfigKey(candidate) ? ["--criterion", "--clear-criteria"] : candidate === "item_format" ? ["--format"] : ["--policy"],
1010
+ summary: CONFIG_KEY_SUMMARIES[candidate],
1011
+ value: readConfigValue(settings, candidate)
1012
+ }));
1013
+ const nestedSettings = NESTED_SETTING_DESCRIPTORS.map((descriptor) => ({
1014
+ key: descriptor.key,
1015
+ path: descriptor.path,
1016
+ kind: descriptor.kind,
1017
+ value: readNestedSettingValue(settings, descriptor)
1018
+ }));
1019
+ return withWarnings({
1020
+ scope,
1021
+ keys,
1022
+ nested_settings: nestedSettings,
1023
+ count: keys.length,
1024
+ settings_path: target.settingsPath,
1025
+ changed: false
1026
+ }, warnings);
1027
+ }
1028
+ if (action === "export") {
1029
+ const values = {
1030
+ definition_of_done: readConfigValue(settings, "definition_of_done"),
1031
+ item_format: readConfigValue(settings, "item_format"),
1032
+ history_missing_stream_policy: readConfigValue(settings, "history_missing_stream_policy"),
1033
+ sprint_release_format_policy: readConfigValue(settings, "sprint_release_format_policy"),
1034
+ parent_reference_policy: readConfigValue(settings, "parent_reference_policy"),
1035
+ metadata_validation_profile: readConfigValue(settings, "metadata_validation_profile"),
1036
+ metadata_required_fields: readConfigValue(settings, "metadata_required_fields"),
1037
+ lifecycle_stale_blocker_reason_patterns: readConfigValue(settings, "lifecycle_stale_blocker_reason_patterns"),
1038
+ lifecycle_closure_like_blocked_reason_patterns: readConfigValue(settings, "lifecycle_closure_like_blocked_reason_patterns"),
1039
+ lifecycle_closure_like_resolution_patterns: readConfigValue(settings, "lifecycle_closure_like_resolution_patterns"),
1040
+ lifecycle_closure_like_actual_result_patterns: readConfigValue(settings, "lifecycle_closure_like_actual_result_patterns"),
1041
+ governance_preset: readConfigValue(settings, "governance_preset"),
1042
+ governance_ownership_enforcement: readConfigValue(settings, "governance_ownership_enforcement"),
1043
+ governance_create_mode_default: readConfigValue(settings, "governance_create_mode_default"),
1044
+ governance_close_validation_default: readConfigValue(settings, "governance_close_validation_default"),
1045
+ governance_create_default_type: readConfigValue(settings, "governance_create_default_type"),
1046
+ governance_workflow_enforcement: readConfigValue(settings, "governance_workflow_enforcement"),
1047
+ governance_parent_reference_policy: readConfigValue(settings, "governance_parent_reference_policy"),
1048
+ governance_metadata_validation_profile: readConfigValue(settings, "governance_metadata_validation_profile"),
1049
+ governance_force_required_for_stale_lock: readConfigValue(settings, "governance_force_required_for_stale_lock"),
1050
+ test_result_tracking: readConfigValue(settings, "test_result_tracking"),
1051
+ telemetry_tracking: readConfigValue(settings, "telemetry_tracking"),
1052
+ context: readConfigValue(settings, "context")
1053
+ };
1054
+ return withWarnings({
1055
+ scope,
1056
+ values,
1057
+ settings_path: target.settingsPath,
1058
+ changed: false
1059
+ }, warnings);
1060
+ }
1061
+ if (action === "get") {
1062
+ if (!key) {
1063
+ throw new PmCliError('Config action "get" requires <key>', EXIT_CODE.USAGE);
1064
+ }
1065
+ if (key === "item_format") {
1066
+ return withWarnings({
1067
+ scope,
1068
+ key,
1069
+ format: settings.item_format,
1070
+ has_explicit_item_format: metadata.has_explicit_item_format,
1071
+ settings_path: target.settingsPath,
1072
+ changed: false
1073
+ }, warnings);
1074
+ }
1075
+ if (key === "history_missing_stream_policy") {
1076
+ return withWarnings({
1077
+ scope,
1078
+ key,
1079
+ policy: settings.history.missing_stream,
1080
+ settings_path: target.settingsPath,
1081
+ changed: false
1082
+ }, warnings);
1083
+ }
1084
+ if (key === "sprint_release_format_policy") {
1085
+ return withWarnings({
1086
+ scope,
1087
+ key,
1088
+ policy: settings.validation.sprint_release_format,
1089
+ settings_path: target.settingsPath,
1090
+ changed: false
1091
+ }, warnings);
1092
+ }
1093
+ if (key === "parent_reference_policy") {
1094
+ return withWarnings({
1095
+ scope,
1096
+ key,
1097
+ policy: settings.validation.parent_reference,
1098
+ settings_path: target.settingsPath,
1099
+ changed: false
1100
+ }, warnings);
1101
+ }
1102
+ if (key === "metadata_validation_profile") {
1103
+ return withWarnings({
1104
+ scope,
1105
+ key,
1106
+ policy: settings.validation.metadata_profile,
1107
+ settings_path: target.settingsPath,
1108
+ changed: false
1109
+ }, warnings);
1110
+ }
1111
+ if (key === "metadata_required_fields") {
1112
+ return withWarnings({
1113
+ scope,
1114
+ key,
1115
+ criteria: [...settings.validation.metadata_required_fields],
1116
+ settings_path: target.settingsPath,
1117
+ changed: false
1118
+ }, warnings);
1119
+ }
1120
+ if (key === "lifecycle_stale_blocker_reason_patterns") {
1121
+ return withWarnings({
1122
+ scope,
1123
+ key,
1124
+ criteria: [...settings.validation.lifecycle_stale_blocker_reason_patterns],
1125
+ settings_path: target.settingsPath,
1126
+ changed: false
1127
+ }, warnings);
1128
+ }
1129
+ if (key === "lifecycle_closure_like_blocked_reason_patterns") {
1130
+ return withWarnings({
1131
+ scope,
1132
+ key,
1133
+ criteria: [...settings.validation.lifecycle_closure_like_blocked_reason_patterns],
1134
+ settings_path: target.settingsPath,
1135
+ changed: false
1136
+ }, warnings);
1137
+ }
1138
+ if (key === "lifecycle_closure_like_resolution_patterns") {
1139
+ return withWarnings({
1140
+ scope,
1141
+ key,
1142
+ criteria: [...settings.validation.lifecycle_closure_like_resolution_patterns],
1143
+ settings_path: target.settingsPath,
1144
+ changed: false
1145
+ }, warnings);
1146
+ }
1147
+ if (key === "lifecycle_closure_like_actual_result_patterns") {
1148
+ return withWarnings({
1149
+ scope,
1150
+ key,
1151
+ criteria: [...settings.validation.lifecycle_closure_like_actual_result_patterns],
1152
+ settings_path: target.settingsPath,
1153
+ changed: false
1154
+ }, warnings);
1155
+ }
1156
+ if (key === "governance_preset") {
1157
+ return withWarnings({
1158
+ scope,
1159
+ key,
1160
+ policy: settings.governance.preset,
1161
+ settings_path: target.settingsPath,
1162
+ changed: false
1163
+ }, warnings);
1164
+ }
1165
+ if (key === "governance_ownership_enforcement") {
1166
+ return withWarnings({
1167
+ scope,
1168
+ key,
1169
+ policy: settings.governance.ownership_enforcement,
1170
+ settings_path: target.settingsPath,
1171
+ changed: false
1172
+ }, warnings);
1173
+ }
1174
+ if (key === "governance_create_mode_default") {
1175
+ return withWarnings({
1176
+ scope,
1177
+ key,
1178
+ policy: settings.governance.create_mode_default,
1179
+ settings_path: target.settingsPath,
1180
+ changed: false
1181
+ }, warnings);
1182
+ }
1183
+ if (key === "governance_close_validation_default") {
1184
+ return withWarnings({
1185
+ scope,
1186
+ key,
1187
+ policy: settings.governance.close_validation_default,
1188
+ settings_path: target.settingsPath,
1189
+ changed: false
1190
+ }, warnings);
1191
+ }
1192
+ if (key === "governance_create_default_type") {
1193
+ return withWarnings({
1194
+ scope,
1195
+ key,
1196
+ policy: settings.governance.create_default_type ?? "",
1197
+ settings_path: target.settingsPath,
1198
+ changed: false
1199
+ }, warnings);
1200
+ }
1201
+ if (key === "governance_workflow_enforcement") {
1202
+ return withWarnings({
1203
+ scope,
1204
+ key,
1205
+ policy: settings.governance.workflow_enforcement ?? "off",
1206
+ settings_path: target.settingsPath,
1207
+ changed: false
1208
+ }, warnings);
1209
+ }
1210
+ if (key === "governance_parent_reference_policy") {
1211
+ return withWarnings({
1212
+ scope,
1213
+ key,
1214
+ policy: settings.governance.parent_reference,
1215
+ settings_path: target.settingsPath,
1216
+ changed: false
1217
+ }, warnings);
1218
+ }
1219
+ if (key === "governance_metadata_validation_profile") {
1220
+ return withWarnings({
1221
+ scope,
1222
+ key,
1223
+ policy: settings.governance.metadata_profile,
1224
+ settings_path: target.settingsPath,
1225
+ changed: false
1226
+ }, warnings);
1227
+ }
1228
+ if (key === "governance_force_required_for_stale_lock") {
1229
+ return withWarnings({
1230
+ scope,
1231
+ key,
1232
+ policy: settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
1233
+ settings_path: target.settingsPath,
1234
+ changed: false
1235
+ }, warnings);
1236
+ }
1237
+ if (key === "test_result_tracking") {
1238
+ return withWarnings({
1239
+ scope,
1240
+ key,
1241
+ policy: settings.testing.record_results_to_items ? "enabled" : "disabled",
1242
+ settings_path: target.settingsPath,
1243
+ changed: false
1244
+ }, warnings);
1245
+ }
1246
+ if (key === "telemetry_tracking") {
1247
+ return withWarnings({
1248
+ scope,
1249
+ key,
1250
+ policy: settings.telemetry.enabled ? "enabled" : "disabled",
1251
+ settings_path: target.settingsPath,
1252
+ changed: false
1253
+ }, warnings);
1254
+ }
1255
+ if (key === "context") {
1256
+ return withWarnings({
1257
+ scope,
1258
+ key,
1259
+ context_settings: {
1260
+ default_depth: settings.context.default_depth,
1261
+ activity_limit: settings.context.activity_limit,
1262
+ stale_threshold_days: settings.context.stale_threshold_days,
1263
+ sections: { ...settings.context.sections }
1264
+ },
1265
+ settings_path: target.settingsPath,
1266
+ changed: false
1267
+ }, warnings);
1268
+ }
1269
+ return withWarnings({
1270
+ scope,
1271
+ key,
1272
+ criteria: [...settings.workflow.definition_of_done],
1273
+ settings_path: target.settingsPath,
1274
+ changed: false
1275
+ }, warnings);
1276
+ }
1277
+ if (!key) {
1278
+ throw new PmCliError('Config action "set" requires <key>', EXIT_CODE.USAGE);
1279
+ }
1280
+ if (options.clearCriteria === true && !isCriteriaConfigKey(key)) {
1281
+ throw new PmCliError("--clear-criteria is only supported with config set criteria-list keys", EXIT_CODE.USAGE);
1282
+ }
1283
+ if (key === "item_format") {
1284
+ const nextFormat = normalizeItemFormat(options.format);
1285
+ const changed2 = settings.item_format !== nextFormat || !metadata.has_explicit_item_format;
1286
+ let migration = void 0;
1287
+ if (changed2) {
1288
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1289
+ const migrated = await migrateItemFilesToFormat(target.pmRoot, nextFormat, "config:set:item_format:migrate", typeRegistry.type_to_folder, settings.schema);
1290
+ migration = {
1291
+ target_format: migrated.target_format,
1292
+ scanned: migrated.scanned,
1293
+ migrated: migrated.migrated,
1294
+ removed: migrated.removed,
1295
+ warnings: migrated.warnings
1296
+ };
1297
+ settings.item_format = nextFormat;
1298
+ await writeSettings(target.pmRoot, settings, "config:set:item_format");
1299
+ }
1300
+ return withWarnings({
1301
+ scope,
1302
+ key,
1303
+ format: settings.item_format,
1304
+ has_explicit_item_format: true,
1305
+ migration,
1306
+ settings_path: target.settingsPath,
1307
+ changed: changed2
1308
+ }, warnings);
1309
+ }
1310
+ if (key === "history_missing_stream_policy") {
1311
+ const nextPolicy = normalizeHistoryMissingStreamPolicy(options.policy);
1312
+ const changed2 = settings.history.missing_stream !== nextPolicy;
1313
+ settings.history.missing_stream = nextPolicy;
1314
+ if (changed2) {
1315
+ await writeSettings(target.pmRoot, settings, "config:set:history_missing_stream_policy");
1316
+ }
1317
+ return withWarnings({
1318
+ scope,
1319
+ key,
1320
+ policy: settings.history.missing_stream,
1321
+ settings_path: target.settingsPath,
1322
+ changed: changed2
1323
+ }, warnings);
1324
+ }
1325
+ if (key === "sprint_release_format_policy") {
1326
+ const nextPolicy = normalizeSprintReleaseFormatPolicy(options.policy);
1327
+ const changed2 = settings.validation.sprint_release_format !== nextPolicy;
1328
+ settings.validation.sprint_release_format = nextPolicy;
1329
+ if (changed2) {
1330
+ await writeSettings(target.pmRoot, settings, "config:set:sprint_release_format_policy");
1331
+ }
1332
+ return withWarnings({
1333
+ scope,
1334
+ key,
1335
+ policy: settings.validation.sprint_release_format,
1336
+ settings_path: target.settingsPath,
1337
+ changed: changed2
1338
+ }, warnings);
1339
+ }
1340
+ if (key === "parent_reference_policy") {
1341
+ const nextPolicy = normalizeParentReferencePolicy(options.policy);
1342
+ const changed2 = settings.validation.parent_reference !== nextPolicy || settings.governance.preset !== "custom" || settings.governance.parent_reference !== nextPolicy;
1343
+ settings.validation.parent_reference = nextPolicy;
1344
+ settings.governance.preset = "custom";
1345
+ settings.governance.parent_reference = nextPolicy;
1346
+ if (changed2) {
1347
+ await writeSettings(target.pmRoot, settings, "config:set:parent_reference_policy");
1348
+ }
1349
+ return withWarnings({
1350
+ scope,
1351
+ key,
1352
+ policy: settings.validation.parent_reference,
1353
+ settings_path: target.settingsPath,
1354
+ changed: changed2
1355
+ }, warnings);
1356
+ }
1357
+ if (key === "metadata_validation_profile") {
1358
+ const nextPolicy = normalizeValidateMetadataProfile(options.policy);
1359
+ const changed2 = settings.validation.metadata_profile !== nextPolicy || settings.governance.preset !== "custom" || settings.governance.metadata_profile !== nextPolicy;
1360
+ settings.validation.metadata_profile = nextPolicy;
1361
+ settings.governance.preset = "custom";
1362
+ settings.governance.metadata_profile = nextPolicy;
1363
+ if (changed2) {
1364
+ await writeSettings(target.pmRoot, settings, "config:set:metadata_validation_profile");
1365
+ }
1366
+ return withWarnings({
1367
+ scope,
1368
+ key,
1369
+ policy: settings.validation.metadata_profile,
1370
+ settings_path: target.settingsPath,
1371
+ changed: changed2
1372
+ }, warnings);
1373
+ }
1374
+ if (key === "metadata_required_fields") {
1375
+ const nextCriteria2 = normalizeMetadataRequiredFields(options.criterion, options.clearCriteria);
1376
+ const changed2 = nextCriteria2.length !== settings.validation.metadata_required_fields.length || nextCriteria2.some((value, index) => value !== settings.validation.metadata_required_fields[index]);
1377
+ settings.validation.metadata_required_fields = nextCriteria2;
1378
+ if (changed2) {
1379
+ await writeSettings(target.pmRoot, settings, "config:set:metadata_required_fields");
1380
+ }
1381
+ return withWarnings({
1382
+ scope,
1383
+ key,
1384
+ criteria: [...settings.validation.metadata_required_fields],
1385
+ settings_path: target.settingsPath,
1386
+ changed: changed2
1387
+ }, warnings);
1388
+ }
1389
+ if (key === "lifecycle_stale_blocker_reason_patterns") {
1390
+ const nextCriteria2 = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1391
+ const changed2 = nextCriteria2.length !== settings.validation.lifecycle_stale_blocker_reason_patterns.length || nextCriteria2.some((value, index) => value !== settings.validation.lifecycle_stale_blocker_reason_patterns[index]);
1392
+ settings.validation.lifecycle_stale_blocker_reason_patterns = nextCriteria2;
1393
+ if (changed2) {
1394
+ await writeSettings(target.pmRoot, settings, "config:set:lifecycle_stale_blocker_reason_patterns");
1395
+ }
1396
+ return withWarnings({
1397
+ scope,
1398
+ key,
1399
+ criteria: [...settings.validation.lifecycle_stale_blocker_reason_patterns],
1400
+ settings_path: target.settingsPath,
1401
+ changed: changed2
1402
+ }, warnings);
1403
+ }
1404
+ if (key === "lifecycle_closure_like_blocked_reason_patterns") {
1405
+ const nextCriteria2 = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1406
+ const changed2 = nextCriteria2.length !== settings.validation.lifecycle_closure_like_blocked_reason_patterns.length || nextCriteria2.some((value, index) => value !== settings.validation.lifecycle_closure_like_blocked_reason_patterns[index]);
1407
+ settings.validation.lifecycle_closure_like_blocked_reason_patterns = nextCriteria2;
1408
+ if (changed2) {
1409
+ await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_blocked_reason_patterns");
1410
+ }
1411
+ return withWarnings({
1412
+ scope,
1413
+ key,
1414
+ criteria: [...settings.validation.lifecycle_closure_like_blocked_reason_patterns],
1415
+ settings_path: target.settingsPath,
1416
+ changed: changed2
1417
+ }, warnings);
1418
+ }
1419
+ if (key === "lifecycle_closure_like_resolution_patterns") {
1420
+ const nextCriteria2 = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1421
+ const changed2 = nextCriteria2.length !== settings.validation.lifecycle_closure_like_resolution_patterns.length || nextCriteria2.some((value, index) => value !== settings.validation.lifecycle_closure_like_resolution_patterns[index]);
1422
+ settings.validation.lifecycle_closure_like_resolution_patterns = nextCriteria2;
1423
+ if (changed2) {
1424
+ await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_resolution_patterns");
1425
+ }
1426
+ return withWarnings({
1427
+ scope,
1428
+ key,
1429
+ criteria: [...settings.validation.lifecycle_closure_like_resolution_patterns],
1430
+ settings_path: target.settingsPath,
1431
+ changed: changed2
1432
+ }, warnings);
1433
+ }
1434
+ if (key === "lifecycle_closure_like_actual_result_patterns") {
1435
+ const nextCriteria2 = normalizeLifecyclePatternCriteria(key, options.criterion, options.clearCriteria);
1436
+ const changed2 = nextCriteria2.length !== settings.validation.lifecycle_closure_like_actual_result_patterns.length || nextCriteria2.some((value, index) => value !== settings.validation.lifecycle_closure_like_actual_result_patterns[index]);
1437
+ settings.validation.lifecycle_closure_like_actual_result_patterns = nextCriteria2;
1438
+ if (changed2) {
1439
+ await writeSettings(target.pmRoot, settings, "config:set:lifecycle_closure_like_actual_result_patterns");
1440
+ }
1441
+ return withWarnings({
1442
+ scope,
1443
+ key,
1444
+ criteria: [...settings.validation.lifecycle_closure_like_actual_result_patterns],
1445
+ settings_path: target.settingsPath,
1446
+ changed: changed2
1447
+ }, warnings);
1448
+ }
1449
+ if (key === "governance_preset") {
1450
+ const nextPolicy = normalizeGovernancePreset(options.policy);
1451
+ const changed2 = settings.governance.preset !== nextPolicy;
1452
+ settings.governance.preset = nextPolicy;
1453
+ if (changed2) {
1454
+ await writeSettings(target.pmRoot, settings, "config:set:governance_preset");
1455
+ }
1456
+ return withWarnings({
1457
+ scope,
1458
+ key,
1459
+ policy: settings.governance.preset,
1460
+ settings_path: target.settingsPath,
1461
+ changed: changed2
1462
+ }, warnings);
1463
+ }
1464
+ if (key === "governance_ownership_enforcement") {
1465
+ const nextPolicy = normalizeGovernanceOwnershipEnforcement(options.policy);
1466
+ const changed2 = settings.governance.preset !== "custom" || settings.governance.ownership_enforcement !== nextPolicy;
1467
+ settings.governance.preset = "custom";
1468
+ settings.governance.ownership_enforcement = nextPolicy;
1469
+ if (changed2) {
1470
+ await writeSettings(target.pmRoot, settings, "config:set:governance_ownership_enforcement");
1471
+ }
1472
+ return withWarnings({
1473
+ scope,
1474
+ key,
1475
+ policy: settings.governance.ownership_enforcement,
1476
+ settings_path: target.settingsPath,
1477
+ changed: changed2
1478
+ }, warnings);
1479
+ }
1480
+ if (key === "governance_create_mode_default") {
1481
+ const nextPolicy = normalizeGovernanceCreateModeDefault(options.policy);
1482
+ const changed2 = settings.governance.preset !== "custom" || settings.governance.create_mode_default !== nextPolicy;
1483
+ settings.governance.preset = "custom";
1484
+ settings.governance.create_mode_default = nextPolicy;
1485
+ if (changed2) {
1486
+ await writeSettings(target.pmRoot, settings, "config:set:governance_create_mode_default");
1487
+ }
1488
+ return withWarnings({
1489
+ scope,
1490
+ key,
1491
+ policy: settings.governance.create_mode_default,
1492
+ settings_path: target.settingsPath,
1493
+ changed: changed2
1494
+ }, warnings);
1495
+ }
1496
+ if (key === "governance_close_validation_default") {
1497
+ const nextPolicy = normalizeGovernanceCloseValidationDefault(options.policy);
1498
+ const changed2 = settings.governance.preset !== "custom" || settings.governance.close_validation_default !== nextPolicy;
1499
+ settings.governance.preset = "custom";
1500
+ settings.governance.close_validation_default = nextPolicy;
1501
+ if (changed2) {
1502
+ await writeSettings(target.pmRoot, settings, "config:set:governance_close_validation_default");
1503
+ }
1504
+ return withWarnings({
1505
+ scope,
1506
+ key,
1507
+ policy: settings.governance.close_validation_default,
1508
+ settings_path: target.settingsPath,
1509
+ changed: changed2
1510
+ }, warnings);
1511
+ }
1512
+ if (key === "governance_create_default_type") {
1513
+ const policyProvided = typeof options.policy === "string";
1514
+ const rawType = policyProvided ? options.policy.trim() : "";
1515
+ if (policyProvided && rawType.length === 0) {
1516
+ const changed3 = settings.governance.create_default_type !== void 0;
1517
+ delete settings.governance.create_default_type;
1518
+ if (changed3) {
1519
+ await writeSettings(target.pmRoot, settings, "config:set:governance_create_default_type");
1520
+ }
1521
+ return withWarnings({
1522
+ scope,
1523
+ key,
1524
+ policy: settings.governance.create_default_type ?? "",
1525
+ settings_path: target.settingsPath,
1526
+ changed: changed3
1527
+ }, warnings);
1528
+ }
1529
+ if (rawType.length === 0) {
1530
+ throw new PmCliError('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)', EXIT_CODE.USAGE);
1531
+ }
1532
+ const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1533
+ const resolvedType = resolveTypeName(rawType, typeRegistry);
1534
+ if (!resolvedType) {
1535
+ throw new PmCliError(buildInvalidTypeError(rawType, typeRegistry.types), EXIT_CODE.USAGE);
1536
+ }
1537
+ const changed2 = settings.governance.create_default_type !== resolvedType;
1538
+ settings.governance.create_default_type = resolvedType;
1539
+ if (changed2) {
1540
+ await writeSettings(target.pmRoot, settings, "config:set:governance_create_default_type");
1541
+ }
1542
+ return withWarnings({
1543
+ scope,
1544
+ key,
1545
+ policy: settings.governance.create_default_type,
1546
+ settings_path: target.settingsPath,
1547
+ changed: changed2
1548
+ }, warnings);
1549
+ }
1550
+ if (key === "governance_workflow_enforcement") {
1551
+ const nextPolicy = normalizeGovernanceWorkflowEnforcement(options.policy);
1552
+ const changed2 = (settings.governance.workflow_enforcement ?? "off") !== nextPolicy;
1553
+ settings.governance.workflow_enforcement = nextPolicy;
1554
+ if (changed2) {
1555
+ await writeSettings(target.pmRoot, settings, "config:set:governance_workflow_enforcement");
1556
+ }
1557
+ return withWarnings({
1558
+ scope,
1559
+ key,
1560
+ policy: settings.governance.workflow_enforcement,
1561
+ settings_path: target.settingsPath,
1562
+ changed: changed2
1563
+ }, warnings);
1564
+ }
1565
+ if (key === "governance_parent_reference_policy") {
1566
+ const nextPolicy = normalizeParentReferencePolicy(options.policy);
1567
+ const changed2 = settings.governance.preset !== "custom" || settings.governance.parent_reference !== nextPolicy;
1568
+ settings.governance.preset = "custom";
1569
+ settings.governance.parent_reference = nextPolicy;
1570
+ settings.validation.parent_reference = nextPolicy;
1571
+ if (changed2) {
1572
+ await writeSettings(target.pmRoot, settings, "config:set:governance_parent_reference_policy");
1573
+ }
1574
+ return withWarnings({
1575
+ scope,
1576
+ key,
1577
+ policy: settings.governance.parent_reference,
1578
+ settings_path: target.settingsPath,
1579
+ changed: changed2
1580
+ }, warnings);
1581
+ }
1582
+ if (key === "governance_metadata_validation_profile") {
1583
+ const nextPolicy = normalizeValidateMetadataProfile(options.policy);
1584
+ const changed2 = settings.governance.preset !== "custom" || settings.governance.metadata_profile !== nextPolicy;
1585
+ settings.governance.preset = "custom";
1586
+ settings.governance.metadata_profile = nextPolicy;
1587
+ settings.validation.metadata_profile = nextPolicy;
1588
+ if (changed2) {
1589
+ await writeSettings(target.pmRoot, settings, "config:set:governance_metadata_validation_profile");
1590
+ }
1591
+ return withWarnings({
1592
+ scope,
1593
+ key,
1594
+ policy: settings.governance.metadata_profile,
1595
+ settings_path: target.settingsPath,
1596
+ changed: changed2
1597
+ }, warnings);
1598
+ }
1599
+ if (key === "governance_force_required_for_stale_lock") {
1600
+ const nextPolicy = normalizeGovernanceForceRequiredForStaleLockPolicy(options.policy);
1601
+ const nextEnabled = nextPolicy === "enabled";
1602
+ const changed2 = settings.governance.preset !== "custom" || settings.governance.force_required_for_stale_lock !== nextEnabled;
1603
+ settings.governance.preset = "custom";
1604
+ settings.governance.force_required_for_stale_lock = nextEnabled;
1605
+ if (changed2) {
1606
+ await writeSettings(target.pmRoot, settings, "config:set:governance_force_required_for_stale_lock");
1607
+ }
1608
+ return withWarnings({
1609
+ scope,
1610
+ key,
1611
+ policy: settings.governance.force_required_for_stale_lock ? "enabled" : "disabled",
1612
+ settings_path: target.settingsPath,
1613
+ changed: changed2
1614
+ }, warnings);
1615
+ }
1616
+ if (key === "test_result_tracking") {
1617
+ const nextPolicy = normalizeTestResultTrackingPolicy(options.policy);
1618
+ const nextEnabled = nextPolicy === "enabled";
1619
+ const changed2 = settings.testing.record_results_to_items !== nextEnabled;
1620
+ settings.testing.record_results_to_items = nextEnabled;
1621
+ if (changed2) {
1622
+ await writeSettings(target.pmRoot, settings, "config:set:test_result_tracking");
1623
+ }
1624
+ return withWarnings({
1625
+ scope,
1626
+ key,
1627
+ policy: settings.testing.record_results_to_items ? "enabled" : "disabled",
1628
+ settings_path: target.settingsPath,
1629
+ changed: changed2
1630
+ }, warnings);
1631
+ }
1632
+ if (key === "telemetry_tracking") {
1633
+ const nextPolicy = normalizeTelemetryTrackingPolicy(options.policy);
1634
+ const nextEnabled = nextPolicy === "enabled";
1635
+ const changed2 = settings.telemetry.enabled !== nextEnabled || !settings.telemetry.first_run_prompt_completed;
1636
+ settings.telemetry.enabled = nextEnabled;
1637
+ settings.telemetry.first_run_prompt_completed = true;
1638
+ if (changed2) {
1639
+ await writeSettings(target.pmRoot, settings, "config:set:telemetry_tracking");
1640
+ }
1641
+ return withWarnings({
1642
+ scope,
1643
+ key,
1644
+ policy: settings.telemetry.enabled ? "enabled" : "disabled",
1645
+ settings_path: target.settingsPath,
1646
+ changed: changed2
1647
+ }, warnings);
1648
+ }
1649
+ if (key === "context") {
1650
+ return applyContextConfig(settings, options, target, scope, warnings);
1651
+ }
1652
+ const nextCriteria = normalizeCriteria(options.criterion, options.clearCriteria);
1653
+ const changed = nextCriteria.length !== settings.workflow.definition_of_done.length || nextCriteria.some((value, index) => value !== settings.workflow.definition_of_done[index]);
1654
+ settings.workflow.definition_of_done = nextCriteria;
1655
+ if (changed) {
1656
+ await writeSettings(target.pmRoot, settings, "config:set:definition_of_done");
1657
+ }
1658
+ return withWarnings({
1659
+ scope,
1660
+ key,
1661
+ criteria: [...settings.workflow.definition_of_done],
1662
+ settings_path: target.settingsPath,
1663
+ changed
1664
+ }, warnings);
1665
+ }
1666
+ export {
1667
+ runConfig
1668
+ };
1669
+ //# sourceMappingURL=config-DDPYIA6J.js.map
1670
+
1671
+ //# debugId=16a22327-ab5b-5ab9-a4ac-aa5984fb0050