@unbrained/pm-cli 2026.5.30 → 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 (578) hide show
  1. package/CHANGELOG.md +152 -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 +96 -10
  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 +109 -116
  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/install-sources.d.ts +2 -0
  27. package/dist/cli/commands/extension/install-sources.js +11 -4
  28. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  29. package/dist/cli/commands/extension/scaffold.js +49 -48
  30. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  31. package/dist/cli/commands/extension.js +51 -23
  32. package/dist/cli/commands/extension.js.map +1 -1
  33. package/dist/cli/commands/get.js +7 -7
  34. package/dist/cli/commands/get.js.map +1 -1
  35. package/dist/cli/commands/health.js +38 -3
  36. package/dist/cli/commands/health.js.map +1 -1
  37. package/dist/cli/commands/index.d.ts +2 -1
  38. package/dist/cli/commands/index.js +4 -3
  39. package/dist/cli/commands/index.js.map +1 -1
  40. package/dist/cli/commands/init.d.ts +10 -0
  41. package/dist/cli/commands/init.js +107 -4
  42. package/dist/cli/commands/init.js.map +1 -1
  43. package/dist/cli/commands/list.d.ts +5 -0
  44. package/dist/cli/commands/list.js +58 -26
  45. package/dist/cli/commands/list.js.map +1 -1
  46. package/dist/cli/commands/reindex.js +164 -48
  47. package/dist/cli/commands/reindex.js.map +1 -1
  48. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  49. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  50. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  51. package/dist/cli/commands/restore.js +25 -4
  52. package/dist/cli/commands/restore.js.map +1 -1
  53. package/dist/cli/commands/schema.d.ts +122 -1
  54. package/dist/cli/commands/schema.js +536 -6
  55. package/dist/cli/commands/schema.js.map +1 -1
  56. package/dist/cli/commands/search.d.ts +18 -0
  57. package/dist/cli/commands/search.js +56 -12
  58. package/dist/cli/commands/search.js.map +1 -1
  59. package/dist/cli/commands/test.js +4 -3
  60. package/dist/cli/commands/test.js.map +1 -1
  61. package/dist/cli/commands/update-many.js +69 -140
  62. package/dist/cli/commands/update-many.js.map +1 -1
  63. package/dist/cli/commands/update.d.ts +2 -0
  64. package/dist/cli/commands/update.js +138 -119
  65. package/dist/cli/commands/update.js.map +1 -1
  66. package/dist/cli/commands/validate.d.ts +1 -0
  67. package/dist/cli/commands/validate.js +63 -33
  68. package/dist/cli/commands/validate.js.map +1 -1
  69. package/dist/cli/error-guidance.js +26 -3
  70. package/dist/cli/error-guidance.js.map +1 -1
  71. package/dist/cli/help-content.js +82 -3
  72. package/dist/cli/help-content.js.map +1 -1
  73. package/dist/cli/main.js +377 -23
  74. package/dist/cli/main.js.map +1 -1
  75. package/dist/cli/register-list-query.js +16 -12
  76. package/dist/cli/register-list-query.js.map +1 -1
  77. package/dist/cli/register-mutation.js +217 -47
  78. package/dist/cli/register-mutation.js.map +1 -1
  79. package/dist/cli/register-operations.js +34 -25
  80. package/dist/cli/register-operations.js.map +1 -1
  81. package/dist/cli/register-setup.js +8 -8
  82. package/dist/cli/register-setup.js.map +1 -1
  83. package/dist/cli/registration-helpers.js +35 -5
  84. package/dist/cli/registration-helpers.js.map +1 -1
  85. package/dist/cli/search-refresh.d.ts +2 -0
  86. package/dist/cli/search-refresh.js +13 -0
  87. package/dist/cli/search-refresh.js.map +1 -0
  88. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js +20 -0
  89. package/dist/cli-bundle/chunks/activity-3RWRRNOW.js.map +1 -0
  90. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js +16 -0
  91. package/dist/cli-bundle/chunks/activity-P5BUMWP3.js.map +7 -0
  92. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js +206 -0
  93. package/dist/cli-bundle/chunks/aggregate-J35K7WZB.js.map +1 -0
  94. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js +209 -0
  95. package/dist/cli-bundle/chunks/aggregate-OOAGKWRG.js.map +7 -0
  96. package/dist/cli-bundle/chunks/append-5JE3YGXU.js +72 -0
  97. package/dist/cli-bundle/chunks/append-5JE3YGXU.js.map +7 -0
  98. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js +69 -0
  99. package/dist/cli-bundle/chunks/append-PNN6UIBZ.js.map +1 -0
  100. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js +218 -0
  101. package/dist/cli-bundle/chunks/chunk-26KTVXJW.js.map +1 -0
  102. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js +27 -0
  103. package/dist/cli-bundle/chunks/chunk-3HUE7XOF.js.map +7 -0
  104. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js +761 -0
  105. package/dist/cli-bundle/chunks/chunk-3OH4DAEB.js.map +7 -0
  106. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js +5553 -0
  107. package/dist/cli-bundle/chunks/chunk-4LTBNUYT.js.map +1 -0
  108. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js +634 -0
  109. package/dist/cli-bundle/chunks/chunk-4PJQSECJ.js.map +7 -0
  110. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js +1832 -0
  111. package/dist/cli-bundle/chunks/chunk-4QCR4QW3.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js +1891 -0
  113. package/dist/cli-bundle/chunks/chunk-5IRA6IYD.js.map +7 -0
  114. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js +412 -0
  115. package/dist/cli-bundle/chunks/chunk-5KB4X7YY.js.map +1 -0
  116. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js +182 -0
  117. package/dist/cli-bundle/chunks/chunk-5PAOPUZX.js.map +1 -0
  118. package/dist/cli-bundle/chunks/chunk-7K24QB23.js +698 -0
  119. package/dist/cli-bundle/chunks/chunk-7K24QB23.js.map +1 -0
  120. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js +380 -0
  121. package/dist/cli-bundle/chunks/chunk-A6PEXMYN.js.map +1 -0
  122. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js +230 -0
  123. package/dist/cli-bundle/chunks/chunk-ASQM3IF5.js.map +1 -0
  124. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js +185 -0
  125. package/dist/cli-bundle/chunks/chunk-ATBVS6WW.js.map +7 -0
  126. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js +332 -0
  127. package/dist/cli-bundle/chunks/chunk-AXXKLVTW.js.map +1 -0
  128. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js +1681 -0
  129. package/dist/cli-bundle/chunks/chunk-B3N4TKNL.js.map +7 -0
  130. package/dist/cli-bundle/chunks/{chunk-PB2YU2E3.js → chunk-BNL6S7QH.js} +28 -70
  131. package/dist/cli-bundle/chunks/chunk-BNL6S7QH.js.map +7 -0
  132. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js +154 -0
  133. package/dist/cli-bundle/chunks/chunk-CCUFLH4J.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js +341 -0
  135. package/dist/cli-bundle/chunks/chunk-CJDQB2ED.js.map +7 -0
  136. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js +1340 -0
  137. package/dist/cli-bundle/chunks/chunk-CWT53EYT.js.map +1 -0
  138. package/dist/cli-bundle/chunks/chunk-D3WUNETC.js +349 -0
  139. package/dist/cli-bundle/chunks/chunk-D3WUNETC.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js +1714 -0
  141. package/dist/cli-bundle/chunks/chunk-D5X7N6FI.js.map +7 -0
  142. package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js +550 -0
  143. package/dist/cli-bundle/chunks/chunk-DFIZGAI5.js.map +7 -0
  144. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js +1704 -0
  145. package/dist/cli-bundle/chunks/chunk-DFUSXJDE.js.map +1 -0
  146. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +56 -0
  147. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +7 -0
  148. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js +2988 -0
  149. package/dist/cli-bundle/chunks/chunk-EHXPIKKP.js.map +1 -0
  150. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js +128 -0
  151. package/dist/cli-bundle/chunks/chunk-FVXM3GKS.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js +454 -0
  153. package/dist/cli-bundle/chunks/chunk-G5BACLYH.js.map +1 -0
  154. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js +383 -0
  155. package/dist/cli-bundle/chunks/chunk-GCAVRLGE.js.map +7 -0
  156. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js +57 -0
  157. package/dist/cli-bundle/chunks/chunk-GFWHHMVV.js.map +1 -0
  158. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js +3860 -0
  159. package/dist/cli-bundle/chunks/chunk-GNHVV4SY.js.map +1 -0
  160. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js +346 -0
  161. package/dist/cli-bundle/chunks/chunk-GPGAYASV.js.map +1 -0
  162. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js +1356 -0
  163. package/dist/cli-bundle/chunks/chunk-HPH6X4ZZ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js +342 -0
  165. package/dist/cli-bundle/chunks/chunk-HZOS2UG5.js.map +7 -0
  166. package/dist/cli-bundle/chunks/chunk-IUV734HF.js +17 -0
  167. package/dist/cli-bundle/chunks/chunk-IUV734HF.js.map +1 -0
  168. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js +15 -0
  169. package/dist/cli-bundle/chunks/chunk-J27KIHTG.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js +185 -0
  171. package/dist/cli-bundle/chunks/chunk-JB4RGL4V.js.map +7 -0
  172. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js +130 -0
  173. package/dist/cli-bundle/chunks/chunk-JQI2HE55.js.map +1 -0
  174. package/dist/cli-bundle/chunks/chunk-K47WAYQV.js +60 -0
  175. package/dist/cli-bundle/chunks/chunk-K47WAYQV.js.map +7 -0
  176. package/dist/cli-bundle/chunks/chunk-KA24HME7.js +79 -0
  177. package/dist/cli-bundle/chunks/chunk-KA24HME7.js.map +7 -0
  178. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js +1325 -0
  179. package/dist/cli-bundle/chunks/chunk-KBG47ZOY.js.map +1 -0
  180. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js +242 -0
  181. package/dist/cli-bundle/chunks/chunk-KCMIYKTA.js.map +1 -0
  182. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js +221 -0
  183. package/dist/cli-bundle/chunks/chunk-KK6YPGH3.js.map +7 -0
  184. package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js +157 -0
  185. package/dist/cli-bundle/chunks/chunk-LDJK7SHN.js.map +7 -0
  186. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  187. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  188. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js +80 -0
  189. package/dist/cli-bundle/chunks/chunk-MISYRLEP.js.map +1 -0
  190. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js +457 -0
  191. package/dist/cli-bundle/chunks/chunk-N5YF3VFN.js.map +7 -0
  192. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js +173 -0
  193. package/dist/cli-bundle/chunks/chunk-NQP3ECKF.js.map +1 -0
  194. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js +338 -0
  195. package/dist/cli-bundle/chunks/chunk-O5IBJE6S.js.map +1 -0
  196. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js +18 -0
  197. package/dist/cli-bundle/chunks/chunk-O7IWB35H.js.map +7 -0
  198. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js +3040 -0
  199. package/dist/cli-bundle/chunks/chunk-OIQIXTNB.js.map +7 -0
  200. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js +751 -0
  201. package/dist/cli-bundle/chunks/chunk-ORTLYVA4.js.map +1 -0
  202. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js +1861 -0
  203. package/dist/cli-bundle/chunks/chunk-OUF3ARDX.js.map +7 -0
  204. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js +20 -0
  205. package/dist/cli-bundle/chunks/chunk-QAJBIGRA.js.map +7 -0
  206. package/dist/cli-bundle/chunks/chunk-RANZIID5.js +176 -0
  207. package/dist/cli-bundle/chunks/chunk-RANZIID5.js.map +7 -0
  208. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js +140 -0
  209. package/dist/cli-bundle/chunks/chunk-RQAWLSUU.js.map +7 -0
  210. package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js +233 -0
  211. package/dist/cli-bundle/chunks/chunk-S3CV7JGJ.js.map +7 -0
  212. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js +5705 -0
  213. package/dist/cli-bundle/chunks/chunk-SRVKTWPR.js.map +7 -0
  214. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js +76 -0
  215. package/dist/cli-bundle/chunks/chunk-SSFMJCPF.js.map +1 -0
  216. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js +631 -0
  217. package/dist/cli-bundle/chunks/chunk-SZQCER6S.js.map +1 -0
  218. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js +540 -0
  219. package/dist/cli-bundle/chunks/chunk-T2ORWB6D.js.map +1 -0
  220. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js +422 -0
  221. package/dist/cli-bundle/chunks/chunk-TBQVUNVH.js.map +7 -0
  222. package/dist/cli-bundle/chunks/{chunk-RJONRNXN.js → chunk-TK633IVD.js} +51 -32
  223. package/dist/cli-bundle/chunks/chunk-TK633IVD.js.map +7 -0
  224. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js +131 -0
  225. package/dist/cli-bundle/chunks/chunk-TQ3ZK6VD.js.map +7 -0
  226. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js +119 -0
  227. package/dist/cli-bundle/chunks/chunk-UFCG3SWR.js.map +1 -0
  228. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js +1664 -0
  229. package/dist/cli-bundle/chunks/chunk-UOVLWB47.js.map +1 -0
  230. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js +186 -0
  231. package/dist/cli-bundle/chunks/chunk-V3JQ4IPL.js.map +1 -0
  232. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js +182 -0
  233. package/dist/cli-bundle/chunks/chunk-VGO2T3TY.js.map +1 -0
  234. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js +189 -0
  235. package/dist/cli-bundle/chunks/chunk-WIKR7KFL.js.map +7 -0
  236. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js +1385 -0
  237. package/dist/cli-bundle/chunks/chunk-XG7RJYHV.js.map +7 -0
  238. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  239. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  240. package/dist/cli-bundle/chunks/chunk-XX5LRINW.js +90 -0
  241. package/dist/cli-bundle/chunks/chunk-XX5LRINW.js.map +7 -0
  242. package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js +252 -0
  243. package/dist/cli-bundle/chunks/chunk-Y2AKE2HS.js.map +7 -0
  244. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js +3898 -0
  245. package/dist/cli-bundle/chunks/chunk-ZQ4F6EC4.js.map +7 -0
  246. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js +1809 -0
  247. package/dist/cli-bundle/chunks/chunk-ZRVSMOMR.js.map +1 -0
  248. package/dist/cli-bundle/chunks/claim-AZLP7YFO.js +132 -0
  249. package/dist/cli-bundle/chunks/claim-AZLP7YFO.js.map +7 -0
  250. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js +129 -0
  251. package/dist/cli-bundle/chunks/claim-ZFA7HKU4.js.map +1 -0
  252. package/dist/cli-bundle/chunks/close-65DFYAVS.js +17 -0
  253. package/dist/cli-bundle/chunks/close-65DFYAVS.js.map +1 -0
  254. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js +13 -0
  255. package/dist/cli-bundle/chunks/close-RMHQ3KWH.js.map +7 -0
  256. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js +311 -0
  257. package/dist/cli-bundle/chunks/close-many-AKPZNSGI.js.map +1 -0
  258. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js +314 -0
  259. package/dist/cli-bundle/chunks/close-many-UKZSQGM7.js.map +7 -0
  260. package/dist/cli-bundle/chunks/comments-AGBNSJJH.js +103 -0
  261. package/dist/cli-bundle/chunks/comments-AGBNSJJH.js.map +7 -0
  262. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js +100 -0
  263. package/dist/cli-bundle/chunks/comments-CJWXQI7X.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-5ON3ADRH.js +1688 -0
  265. package/dist/cli-bundle/chunks/config-5ON3ADRH.js.map +7 -0
  266. package/dist/cli-bundle/chunks/config-DDPYIA6J.js +1671 -0
  267. package/dist/cli-bundle/chunks/config-DDPYIA6J.js.map +1 -0
  268. package/dist/cli-bundle/chunks/context-E6U3DWVM.js +1471 -0
  269. package/dist/cli-bundle/chunks/context-E6U3DWVM.js.map +7 -0
  270. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js +1461 -0
  271. package/dist/cli-bundle/chunks/context-ZOJEN5VT.js.map +1 -0
  272. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js +1277 -0
  273. package/dist/cli-bundle/chunks/contracts-CXSFM45B.js.map +7 -0
  274. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js +1274 -0
  275. package/dist/cli-bundle/chunks/contracts-LCSX5R53.js.map +1 -0
  276. package/dist/cli-bundle/chunks/create-ATONSAZW.js +27 -0
  277. package/dist/cli-bundle/chunks/create-ATONSAZW.js.map +7 -0
  278. package/dist/cli-bundle/chunks/create-WYFKN2U4.js +31 -0
  279. package/dist/cli-bundle/chunks/create-WYFKN2U4.js.map +1 -0
  280. package/dist/cli-bundle/chunks/delete-RONNH4F4.js +58 -0
  281. package/dist/cli-bundle/chunks/delete-RONNH4F4.js.map +7 -0
  282. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js +55 -0
  283. package/dist/cli-bundle/chunks/delete-ZXWC56WO.js.map +1 -0
  284. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js +225 -0
  285. package/dist/cli-bundle/chunks/deps-EHXIFOZR.js.map +1 -0
  286. package/dist/cli-bundle/chunks/deps-WII3O4HB.js +228 -0
  287. package/dist/cli-bundle/chunks/deps-WII3O4HB.js.map +7 -0
  288. package/dist/cli-bundle/chunks/docs-JMVCFNHH.js +34 -0
  289. package/dist/cli-bundle/chunks/docs-JMVCFNHH.js.map +7 -0
  290. package/dist/cli-bundle/chunks/docs-PDREIMLS.js +31 -0
  291. package/dist/cli-bundle/chunks/docs-PDREIMLS.js.map +1 -0
  292. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js +28 -0
  293. package/dist/cli-bundle/chunks/extension-B4ROVWJD.js.map +1 -0
  294. package/dist/cli-bundle/chunks/extension-G6UXSM5S.js +24 -0
  295. package/dist/cli-bundle/chunks/extension-G6UXSM5S.js.map +7 -0
  296. package/dist/cli-bundle/chunks/files-2PN7UM2D.js +282 -0
  297. package/dist/cli-bundle/chunks/files-2PN7UM2D.js.map +1 -0
  298. package/dist/cli-bundle/chunks/files-MXYS5W4M.js +285 -0
  299. package/dist/cli-bundle/chunks/files-MXYS5W4M.js.map +7 -0
  300. package/dist/cli-bundle/chunks/gc-GT552UJH.js +178 -0
  301. package/dist/cli-bundle/chunks/gc-GT552UJH.js.map +1 -0
  302. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js +181 -0
  303. package/dist/cli-bundle/chunks/gc-QNBRJG6H.js.map +7 -0
  304. package/dist/cli-bundle/chunks/get-CINFEUIY.js +197 -0
  305. package/dist/cli-bundle/chunks/get-CINFEUIY.js.map +7 -0
  306. package/dist/cli-bundle/chunks/get-WXMLRG7M.js +194 -0
  307. package/dist/cli-bundle/chunks/get-WXMLRG7M.js.map +1 -0
  308. package/dist/cli-bundle/chunks/health-5VPOJQ53.js +1258 -0
  309. package/dist/cli-bundle/chunks/health-5VPOJQ53.js.map +1 -0
  310. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js +1261 -0
  311. package/dist/cli-bundle/chunks/health-IT5DBPRJ.js.map +7 -0
  312. package/dist/cli-bundle/chunks/history-6FC4H6HI.js +20 -0
  313. package/dist/cli-bundle/chunks/history-6FC4H6HI.js.map +7 -0
  314. package/dist/cli-bundle/chunks/history-FLZIP7PM.js +24 -0
  315. package/dist/cli-bundle/chunks/history-FLZIP7PM.js.map +1 -0
  316. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js +23 -0
  317. package/dist/cli-bundle/chunks/history-redact-SSZBAD76.js.map +1 -0
  318. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js +19 -0
  319. package/dist/cli-bundle/chunks/history-redact-XKYEZDBL.js.map +7 -0
  320. package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js +196 -0
  321. package/dist/cli-bundle/chunks/history-repair-KC5ZOJRZ.js.map +7 -0
  322. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js +193 -0
  323. package/dist/cli-bundle/chunks/history-repair-X7CO5JJZ.js.map +1 -0
  324. package/dist/cli-bundle/chunks/init-6MRFVOLH.js +20 -0
  325. package/dist/cli-bundle/chunks/init-6MRFVOLH.js.map +1 -0
  326. package/dist/cli-bundle/chunks/init-KHX3FEEM.js +16 -0
  327. package/dist/cli-bundle/chunks/init-KHX3FEEM.js.map +7 -0
  328. package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js +47 -0
  329. package/dist/cli-bundle/chunks/learnings-A3CLB5CO.js.map +7 -0
  330. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js +44 -0
  331. package/dist/cli-bundle/chunks/learnings-DCX55BNX.js.map +1 -0
  332. package/dist/cli-bundle/chunks/list-53LZ2AEO.js +20 -0
  333. package/dist/cli-bundle/chunks/list-53LZ2AEO.js.map +7 -0
  334. package/dist/cli-bundle/chunks/list-DBRECOG4.js +24 -0
  335. package/dist/cli-bundle/chunks/list-DBRECOG4.js.map +1 -0
  336. package/dist/cli-bundle/chunks/notes-42LIC3UE.js +47 -0
  337. package/dist/cli-bundle/chunks/notes-42LIC3UE.js.map +7 -0
  338. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js +44 -0
  339. package/dist/cli-bundle/chunks/notes-P5O3VMQ3.js.map +1 -0
  340. package/dist/cli-bundle/chunks/plan-HDQXEUKD.js +1174 -0
  341. package/dist/cli-bundle/chunks/plan-HDQXEUKD.js.map +7 -0
  342. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js +1171 -0
  343. package/dist/cli-bundle/chunks/plan-IGTE3WOJ.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-list-query-EIVQ5FMR.js → register-list-query-AG3XKXWL.js} +25 -18
  345. package/dist/cli-bundle/chunks/register-list-query-AG3XKXWL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js +227 -0
  347. package/dist/cli-bundle/chunks/register-list-query-EMNSIUO4.js.map +1 -0
  348. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js +813 -0
  349. package/dist/cli-bundle/chunks/register-mutation-M3YS6XDO.js.map +1 -0
  350. package/dist/cli-bundle/chunks/{register-mutation-RSZNPSGI.js → register-mutation-RSMT6DPK.js} +160 -39
  351. package/dist/cli-bundle/chunks/register-mutation-RSMT6DPK.js.map +7 -0
  352. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js +370 -0
  353. package/dist/cli-bundle/chunks/register-operations-KYUOOOOD.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{register-operations-APUSYDMR.js → register-operations-Q54JQZUN.js} +50 -32
  355. package/dist/cli-bundle/chunks/register-operations-Q54JQZUN.js.map +7 -0
  356. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js +242 -0
  357. package/dist/cli-bundle/chunks/register-setup-DI6P7X75.js.map +1 -0
  358. package/dist/cli-bundle/chunks/{register-setup-OZOKSMPJ.js → register-setup-YJKIQRKA.js} +21 -13
  359. package/dist/cli-bundle/chunks/register-setup-YJKIQRKA.js.map +7 -0
  360. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js +21 -0
  361. package/dist/cli-bundle/chunks/restore-2XVTBLKQ.js.map +1 -0
  362. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js +17 -0
  363. package/dist/cli-bundle/chunks/restore-JL5QIH7H.js.map +7 -0
  364. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js +770 -0
  365. package/dist/cli-bundle/chunks/schema-LVXZWFGY.js.map +1 -0
  366. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js +780 -0
  367. package/dist/cli-bundle/chunks/schema-V6BX65Q2.js.map +7 -0
  368. package/dist/cli-bundle/chunks/search-5A3BMFA7.js +1144 -0
  369. package/dist/cli-bundle/chunks/search-5A3BMFA7.js.map +7 -0
  370. package/dist/cli-bundle/chunks/search-C7NPB7G7.js +1127 -0
  371. package/dist/cli-bundle/chunks/search-C7NPB7G7.js.map +1 -0
  372. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js +120 -0
  373. package/dist/cli-bundle/chunks/stats-FNLYVXTB.js.map +1 -0
  374. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js +123 -0
  375. package/dist/cli-bundle/chunks/stats-Y2CBTZSL.js.map +7 -0
  376. package/dist/cli-bundle/chunks/test-OFYONO3C.js +35 -0
  377. package/dist/cli-bundle/chunks/test-OFYONO3C.js.map +1 -0
  378. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js +31 -0
  379. package/dist/cli-bundle/chunks/test-RJ4ZF35X.js.map +7 -0
  380. package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js +331 -0
  381. package/dist/cli-bundle/chunks/test-all-EEMKNTGU.js.map +7 -0
  382. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js +328 -0
  383. package/dist/cli-bundle/chunks/test-all-OJE6CIO7.js.map +1 -0
  384. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js +929 -0
  385. package/dist/cli-bundle/chunks/test-runs-IPOPFOAF.js.map +1 -0
  386. package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js +939 -0
  387. package/dist/cli-bundle/chunks/test-runs-L2M7WKH7.js.map +7 -0
  388. package/dist/cli-bundle/chunks/update-6YEHPVXH.js +25 -0
  389. package/dist/cli-bundle/chunks/update-6YEHPVXH.js.map +1 -0
  390. package/dist/cli-bundle/chunks/update-PYLVHMRD.js +21 -0
  391. package/dist/cli-bundle/chunks/update-PYLVHMRD.js.map +7 -0
  392. package/dist/cli-bundle/chunks/update-many-322CCH2L.js +608 -0
  393. package/dist/cli-bundle/chunks/update-many-322CCH2L.js.map +7 -0
  394. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js +605 -0
  395. package/dist/cli-bundle/chunks/update-many-DYWGW57M.js.map +1 -0
  396. package/dist/cli-bundle/chunks/upgrade-2U727SAM.js +269 -0
  397. package/dist/cli-bundle/chunks/upgrade-2U727SAM.js.map +7 -0
  398. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js +266 -0
  399. package/dist/cli-bundle/chunks/upgrade-3W3RVSNM.js.map +1 -0
  400. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js +1120 -0
  401. package/dist/cli-bundle/chunks/validate-GZ24NYHO.js.map +1 -0
  402. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js +1123 -0
  403. package/dist/cli-bundle/chunks/validate-ZFVWPEEN.js.map +7 -0
  404. package/dist/cli-bundle/main.js +615 -121
  405. package/dist/cli-bundle/main.js.map +4 -4
  406. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  407. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  408. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  409. package/dist/core/config/positional-value.js +4 -2
  410. package/dist/core/config/positional-value.js.map +1 -1
  411. package/dist/core/diagnostics/remediation.d.ts +73 -0
  412. package/dist/core/diagnostics/remediation.js +328 -0
  413. package/dist/core/diagnostics/remediation.js.map +1 -0
  414. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  415. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  416. package/dist/core/extensions/extension-types.d.ts +60 -4
  417. package/dist/core/extensions/extension-types.js +2 -2
  418. package/dist/core/extensions/extension-types.js.map +1 -1
  419. package/dist/core/extensions/index.d.ts +5 -1
  420. package/dist/core/extensions/index.js +61 -2
  421. package/dist/core/extensions/index.js.map +1 -1
  422. package/dist/core/extensions/item-fields.d.ts +5 -1
  423. package/dist/core/extensions/item-fields.js +126 -4
  424. package/dist/core/extensions/item-fields.js.map +1 -1
  425. package/dist/core/extensions/loader.js +283 -8
  426. package/dist/core/extensions/loader.js.map +1 -1
  427. package/dist/core/item/item-format.d.ts +3 -2
  428. package/dist/core/item/item-format.js +15 -10
  429. package/dist/core/item/item-format.js.map +1 -1
  430. package/dist/core/item/item-type-definition.js +6 -2
  431. package/dist/core/item/item-type-definition.js.map +1 -1
  432. package/dist/core/item/status-filter.d.ts +29 -0
  433. package/dist/core/item/status-filter.js +97 -0
  434. package/dist/core/item/status-filter.js.map +1 -0
  435. package/dist/core/item/type-registry.d.ts +4 -0
  436. package/dist/core/item/type-registry.js +12 -2
  437. package/dist/core/item/type-registry.js.map +1 -1
  438. package/dist/core/output/output.js +17 -5
  439. package/dist/core/output/output.js.map +1 -1
  440. package/dist/core/schema/item-types-file.d.ts +15 -0
  441. package/dist/core/schema/item-types-file.js +27 -2
  442. package/dist/core/schema/item-types-file.js.map +1 -1
  443. package/dist/core/schema/runtime-field-filters.js +4 -3
  444. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  445. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  446. package/dist/core/schema/runtime-field-values.js +10 -4
  447. package/dist/core/schema/runtime-field-values.js.map +1 -1
  448. package/dist/core/schema/runtime-schema.js +75 -2
  449. package/dist/core/schema/runtime-schema.js.map +1 -1
  450. package/dist/core/schema/status-defs-file.d.ts +113 -0
  451. package/dist/core/schema/status-defs-file.js +260 -0
  452. package/dist/core/schema/status-defs-file.js.map +1 -0
  453. package/dist/core/schema/type-workflows.d.ts +64 -0
  454. package/dist/core/schema/type-workflows.js +98 -0
  455. package/dist/core/schema/type-workflows.js.map +1 -0
  456. package/dist/core/search/background-refresh.d.ts +53 -0
  457. package/dist/core/search/background-refresh.js +286 -0
  458. package/dist/core/search/background-refresh.js.map +1 -0
  459. package/dist/core/search/cache.d.ts +23 -2
  460. package/dist/core/search/cache.js +135 -30
  461. package/dist/core/search/cache.js.map +1 -1
  462. package/dist/core/search/http-client.d.ts +2 -2
  463. package/dist/core/search/http-client.js +2 -2
  464. package/dist/core/search/http-client.js.map +1 -1
  465. package/dist/core/search/vector-stores.d.ts +1 -0
  466. package/dist/core/search/vector-stores.js +69 -15
  467. package/dist/core/search/vector-stores.js.map +1 -1
  468. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  469. package/dist/core/search/vectorization-metadata.js +65 -0
  470. package/dist/core/search/vectorization-metadata.js.map +1 -0
  471. package/dist/core/shared/constants.d.ts +2 -2
  472. package/dist/core/shared/constants.js +2 -3
  473. package/dist/core/shared/constants.js.map +1 -1
  474. package/dist/core/shared/serialization.d.ts +1 -0
  475. package/dist/core/shared/serialization.js +86 -2
  476. package/dist/core/shared/serialization.js.map +1 -1
  477. package/dist/core/store/front-matter-cache.js +14 -5
  478. package/dist/core/store/front-matter-cache.js.map +1 -1
  479. package/dist/core/store/item-format-migration.js +25 -15
  480. package/dist/core/store/item-format-migration.js.map +1 -1
  481. package/dist/core/store/item-store.d.ts +2 -0
  482. package/dist/core/store/item-store.js +61 -6
  483. package/dist/core/store/item-store.js.map +1 -1
  484. package/dist/core/store/settings-validator.js +22 -2
  485. package/dist/core/store/settings-validator.js.map +1 -1
  486. package/dist/core/store/settings.js +40 -5
  487. package/dist/core/store/settings.js.map +1 -1
  488. package/dist/core/telemetry/consent.js +3 -3
  489. package/dist/core/telemetry/consent.js.map +1 -1
  490. package/dist/core/telemetry/observability.js +4 -3
  491. package/dist/core/telemetry/observability.js.map +1 -1
  492. package/dist/core/telemetry/runtime.d.ts +10 -0
  493. package/dist/core/telemetry/runtime.js +86 -2
  494. package/dist/core/telemetry/runtime.js.map +1 -1
  495. package/dist/mcp/server.js +221 -12
  496. package/dist/mcp/server.js.map +1 -1
  497. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  498. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  499. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  500. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  501. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  502. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  503. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  504. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  505. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  506. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  507. package/dist/sdk/cli-contracts/tool-parameter-tables.js +37 -8
  508. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  509. package/dist/sdk/cli-contracts.d.ts +19 -1
  510. package/dist/sdk/cli-contracts.js +211 -18
  511. package/dist/sdk/cli-contracts.js.map +1 -1
  512. package/dist/sdk/errors.d.ts +22 -0
  513. package/dist/sdk/errors.js +46 -0
  514. package/dist/sdk/errors.js.map +1 -0
  515. package/dist/sdk/index.d.ts +2 -1
  516. package/dist/sdk/index.js +3 -2
  517. package/dist/sdk/index.js.map +1 -1
  518. package/dist/sdk/package-import-adapters.js +14 -3
  519. package/dist/sdk/package-import-adapters.js.map +1 -1
  520. package/dist/sdk/runtime.d.ts +1 -0
  521. package/dist/sdk/runtime.js +3 -2
  522. package/dist/sdk/runtime.js.map +1 -1
  523. package/dist/sdk/testing.d.ts +77 -0
  524. package/dist/sdk/testing.js +239 -0
  525. package/dist/sdk/testing.js.map +1 -0
  526. package/dist/types.d.ts +26 -1
  527. package/dist/types.js +3 -2
  528. package/dist/types.js.map +1 -1
  529. package/docs/AGENT_GUIDE.md +21 -2
  530. package/docs/COMMANDS.md +85 -5
  531. package/docs/CONFIGURATION.md +49 -2
  532. package/docs/EXTENSIONS.md +118 -6
  533. package/docs/QUICKSTART.md +2 -0
  534. package/docs/RELEASING.md +3 -3
  535. package/docs/SDK.md +273 -1
  536. package/docs/TESTING.md +17 -0
  537. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  538. package/docs/examples/starter-extension/index.js +9 -1
  539. package/docs/examples/starter-extension/manifest.json +1 -0
  540. package/package.json +12 -7
  541. package/packages/pm-beads/extensions/beads/index.js +2 -4
  542. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  543. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  544. package/packages/pm-calendar/README.md +6 -0
  545. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  546. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  547. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  548. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  549. package/packages/pm-guide-shell/README.md +4 -0
  550. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  551. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  552. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  553. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  554. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  555. package/packages/pm-lifecycle-hooks/README.md +29 -0
  556. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  557. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  558. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  559. package/packages/pm-lifecycle-hooks/package.json +52 -0
  560. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  561. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  562. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  563. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  564. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  565. package/packages/pm-todos/extensions/todos/index.js +3 -7
  566. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  567. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  568. package/scripts/bundle-cli.mjs +121 -17
  569. package/dist/cli-bundle/chunks/chunk-PB2YU2E3.js.map +0 -7
  570. package/dist/cli-bundle/chunks/chunk-RJONRNXN.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js +0 -13864
  572. package/dist/cli-bundle/chunks/chunk-SW5BMMCU.js.map +0 -7
  573. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js +0 -24225
  574. package/dist/cli-bundle/chunks/commands-XJ4TJ5UN.js.map +0 -7
  575. package/dist/cli-bundle/chunks/register-list-query-EIVQ5FMR.js.map +0 -7
  576. package/dist/cli-bundle/chunks/register-mutation-RSZNPSGI.js.map +0 -7
  577. package/dist/cli-bundle/chunks/register-operations-APUSYDMR.js.map +0 -7
  578. package/dist/cli-bundle/chunks/register-setup-OZOKSMPJ.js.map +0 -7
@@ -0,0 +1,44 @@
1
+ export interface MutationCheckpointItem {
2
+ id: string;
3
+ target_updated_at: string;
4
+ }
5
+ export interface LoadedMutationCheckpoint {
6
+ /** The full on-disk record so callers can read their command-specific fields. */
7
+ record: Record<string, unknown>;
8
+ /** Validated item list (id + target_updated_at). */
9
+ items: MutationCheckpointItem[];
10
+ /** Absolute path the checkpoint was read from. */
11
+ path: string;
12
+ id: string;
13
+ created_at: string;
14
+ author: string;
15
+ }
16
+ export interface CheckpointRollbackRow {
17
+ id: string;
18
+ status: "restored" | "failed";
19
+ changed_fields?: string[];
20
+ warnings?: string[];
21
+ error?: string;
22
+ }
23
+ export interface CheckpointRollbackResult {
24
+ rows: CheckpointRollbackRow[];
25
+ restored_ids: string[];
26
+ failed_count: number;
27
+ }
28
+ /** Restore a single item to its captured pre-mutation timestamp. */
29
+ export type CheckpointRestoreFn = (id: string, targetUpdatedAt: string) => Promise<{
30
+ changed_fields?: string[];
31
+ warnings?: string[];
32
+ }>;
33
+ export declare function normalizeCheckpointId(raw: string): string;
34
+ export declare function createCheckpointId(prefix: string, nowValue: string): string;
35
+ export declare function checkpointDirectoryPath(pmRoot: string, subdir: string): string;
36
+ export declare function checkpointFilePath(pmRoot: string, subdir: string, checkpointId: string): string;
37
+ export declare function writeMutationCheckpoint(pmRoot: string, subdir: string, checkpointId: string, payload: unknown): Promise<string>;
38
+ export declare function loadMutationCheckpoint(pmRoot: string, subdir: string, rawCheckpointId: string, schemaVersion: number): Promise<LoadedMutationCheckpoint>;
39
+ /**
40
+ * Restore every checkpointed item to its captured pre-mutation timestamp,
41
+ * collecting per-item rows. A single item's failure is recorded and does not
42
+ * abort the remaining restores.
43
+ */
44
+ export declare function restoreCheckpointItems(items: MutationCheckpointItem[], restore: CheckpointRestoreFn): Promise<CheckpointRollbackResult>;
@@ -0,0 +1,119 @@
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]="703d6134-bb1d-5d13-8150-c611bbdf82d2")}catch(e){}}();
3
+ import { mkdir, readFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { pathExists, writeFileAtomic } from "../fs/fs-utils.js";
6
+ import { EXIT_CODE } from "../shared/constants.js";
7
+ import { PmCliError } from "../shared/errors.js";
8
+ import { toErrorMessage } from "../shared/primitives.js";
9
+ import { nowIso } from "../shared/time.js";
10
+ export function normalizeCheckpointId(raw) {
11
+ const trimmed = raw.trim();
12
+ if (!trimmed) {
13
+ throw new PmCliError("--rollback requires a non-empty checkpoint ID", EXIT_CODE.USAGE);
14
+ }
15
+ if (!/^[a-zA-Z0-9._-]+$/.test(trimmed)) {
16
+ throw new PmCliError("--rollback checkpoint ID must match [a-zA-Z0-9._-]+", EXIT_CODE.USAGE);
17
+ }
18
+ return trimmed;
19
+ }
20
+ export function createCheckpointId(prefix, nowValue) {
21
+ const compactTimestamp = nowValue.replace(/[-:.TZ]/g, "").slice(0, 14);
22
+ const randomSuffix = Math.random().toString(36).slice(2, 8);
23
+ return `${prefix}-${compactTimestamp}-${randomSuffix}`;
24
+ }
25
+ export function checkpointDirectoryPath(pmRoot, subdir) {
26
+ return path.join(pmRoot, "checkpoints", subdir);
27
+ }
28
+ export function checkpointFilePath(pmRoot, subdir, checkpointId) {
29
+ return path.join(checkpointDirectoryPath(pmRoot, subdir), `${checkpointId}.json`);
30
+ }
31
+ export async function writeMutationCheckpoint(pmRoot, subdir, checkpointId, payload) {
32
+ const checkpointDir = checkpointDirectoryPath(pmRoot, subdir);
33
+ await mkdir(checkpointDir, { recursive: true });
34
+ const filePath = checkpointFilePath(pmRoot, subdir, checkpointId);
35
+ await writeFileAtomic(filePath, `${JSON.stringify(payload, null, 2)}\n`);
36
+ return filePath;
37
+ }
38
+ function parseCheckpointItems(record, checkpointId) {
39
+ if (!Array.isArray(record.items)) {
40
+ throw new PmCliError(`Checkpoint ${checkpointId} is missing items`, EXIT_CODE.GENERIC_FAILURE);
41
+ }
42
+ return record.items.map((entry) => {
43
+ if (!entry || typeof entry !== "object") {
44
+ throw new PmCliError(`Checkpoint ${checkpointId} contains an invalid item entry`, EXIT_CODE.GENERIC_FAILURE);
45
+ }
46
+ const row = entry;
47
+ if (typeof row.id !== "string" || row.id.trim().length === 0) {
48
+ throw new PmCliError(`Checkpoint ${checkpointId} contains an item entry without ID`, EXIT_CODE.GENERIC_FAILURE);
49
+ }
50
+ if (typeof row.target_updated_at !== "string" || row.target_updated_at.trim().length === 0) {
51
+ throw new PmCliError(`Checkpoint ${checkpointId} contains an item entry without target_updated_at`, EXIT_CODE.GENERIC_FAILURE);
52
+ }
53
+ return { id: row.id.trim(), target_updated_at: row.target_updated_at.trim() };
54
+ });
55
+ }
56
+ export async function loadMutationCheckpoint(pmRoot, subdir, rawCheckpointId, schemaVersion) {
57
+ const normalizedId = normalizeCheckpointId(rawCheckpointId);
58
+ const filePath = checkpointFilePath(pmRoot, subdir, normalizedId);
59
+ if (!(await pathExists(filePath))) {
60
+ throw new PmCliError(`Checkpoint ${normalizedId} not found`, EXIT_CODE.NOT_FOUND);
61
+ }
62
+ const raw = await readFile(filePath, "utf8");
63
+ let parsed;
64
+ try {
65
+ parsed = JSON.parse(raw);
66
+ }
67
+ catch (error) {
68
+ throw new PmCliError(`Checkpoint ${normalizedId} contains invalid JSON: ${toErrorMessage(error)}`, EXIT_CODE.GENERIC_FAILURE);
69
+ }
70
+ if (!parsed || typeof parsed !== "object") {
71
+ throw new PmCliError(`Checkpoint ${normalizedId} is invalid`, EXIT_CODE.GENERIC_FAILURE);
72
+ }
73
+ const record = parsed;
74
+ if (record.schema_version !== schemaVersion) {
75
+ throw new PmCliError(`Checkpoint ${normalizedId} has unsupported schema version`, EXIT_CODE.GENERIC_FAILURE);
76
+ }
77
+ const items = parseCheckpointItems(record, normalizedId);
78
+ return {
79
+ record,
80
+ items,
81
+ path: filePath,
82
+ id: typeof record.id === "string" ? record.id : normalizedId,
83
+ // Defensive recovery for malformed checkpoint metadata; normal writes
84
+ // always include these fields, so fallbacks keep rollback inspectable.
85
+ created_at: typeof record.created_at === "string" ? record.created_at : nowIso(),
86
+ author: typeof record.author === "string" ? record.author : "unknown",
87
+ };
88
+ }
89
+ /**
90
+ * Restore every checkpointed item to its captured pre-mutation timestamp,
91
+ * collecting per-item rows. A single item's failure is recorded and does not
92
+ * abort the remaining restores.
93
+ */
94
+ export async function restoreCheckpointItems(items, restore) {
95
+ const rows = [];
96
+ const restoredIds = [];
97
+ for (const entry of items) {
98
+ try {
99
+ const restored = await restore(entry.id, entry.target_updated_at);
100
+ rows.push({
101
+ id: entry.id,
102
+ status: "restored",
103
+ changed_fields: restored.changed_fields,
104
+ warnings: restored.warnings,
105
+ });
106
+ restoredIds.push(entry.id);
107
+ }
108
+ catch (error) {
109
+ rows.push({ id: entry.id, status: "failed", error: toErrorMessage(error) });
110
+ }
111
+ }
112
+ return {
113
+ rows,
114
+ restored_ids: restoredIds,
115
+ failed_count: rows.filter((row) => row.status === "failed").length,
116
+ };
117
+ }
118
+ //# sourceMappingURL=mutation-checkpoint.js.map
119
+ //# debugId=703d6134-bb1d-5d13-8150-c611bbdf82d2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-checkpoint.js","sources":["core/checkpoint/mutation-checkpoint.ts"],"sourceRoot":"/","sourcesContent":["import { mkdir, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\nimport { toErrorMessage } from \"../shared/primitives.js\";\nimport { nowIso } from \"../shared/time.js\";\n\n// Shared checkpoint + rollback machinery for bulk-mutation commands\n// (`update-many`, `close-many`). Each command owns its own checkpoint payload\n// shape (the extra fields it records) but reuses the common id/path/validation\n// helpers and the restore loop so the durable rollback contract — capture each\n// matched item's pre-mutation updated_at, then restore-to-timestamp on\n// rollback — stays identical across commands and is not duplicated.\n\nexport interface MutationCheckpointItem {\n id: string;\n target_updated_at: string;\n}\n\nexport interface LoadedMutationCheckpoint {\n /** The full on-disk record so callers can read their command-specific fields. */\n record: Record<string, unknown>;\n /** Validated item list (id + target_updated_at). */\n items: MutationCheckpointItem[];\n /** Absolute path the checkpoint was read from. */\n path: string;\n id: string;\n created_at: string;\n author: string;\n}\n\nexport interface CheckpointRollbackRow {\n id: string;\n status: \"restored\" | \"failed\";\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\nexport interface CheckpointRollbackResult {\n rows: CheckpointRollbackRow[];\n restored_ids: string[];\n failed_count: number;\n}\n\n/** Restore a single item to its captured pre-mutation timestamp. */\nexport type CheckpointRestoreFn = (\n id: string,\n targetUpdatedAt: string,\n) => Promise<{ changed_fields?: string[]; warnings?: string[] }>;\n\nexport function normalizeCheckpointId(raw: string): string {\n const trimmed = raw.trim();\n if (!trimmed) {\n throw new PmCliError(\"--rollback requires a non-empty checkpoint ID\", EXIT_CODE.USAGE);\n }\n if (!/^[a-zA-Z0-9._-]+$/.test(trimmed)) {\n throw new PmCliError(\"--rollback checkpoint ID must match [a-zA-Z0-9._-]+\", EXIT_CODE.USAGE);\n }\n return trimmed;\n}\n\nexport function createCheckpointId(prefix: string, nowValue: string): string {\n const compactTimestamp = nowValue.replace(/[-:.TZ]/g, \"\").slice(0, 14);\n const randomSuffix = Math.random().toString(36).slice(2, 8);\n return `${prefix}-${compactTimestamp}-${randomSuffix}`;\n}\n\nexport function checkpointDirectoryPath(pmRoot: string, subdir: string): string {\n return path.join(pmRoot, \"checkpoints\", subdir);\n}\n\nexport function checkpointFilePath(pmRoot: string, subdir: string, checkpointId: string): string {\n return path.join(checkpointDirectoryPath(pmRoot, subdir), `${checkpointId}.json`);\n}\n\nexport async function writeMutationCheckpoint(\n pmRoot: string,\n subdir: string,\n checkpointId: string,\n payload: unknown,\n): Promise<string> {\n const checkpointDir = checkpointDirectoryPath(pmRoot, subdir);\n await mkdir(checkpointDir, { recursive: true });\n const filePath = checkpointFilePath(pmRoot, subdir, checkpointId);\n await writeFileAtomic(filePath, `${JSON.stringify(payload, null, 2)}\\n`);\n return filePath;\n}\n\nfunction parseCheckpointItems(record: Record<string, unknown>, checkpointId: string): MutationCheckpointItem[] {\n if (!Array.isArray(record.items)) {\n throw new PmCliError(`Checkpoint ${checkpointId} is missing items`, EXIT_CODE.GENERIC_FAILURE);\n }\n return record.items.map((entry) => {\n if (!entry || typeof entry !== \"object\") {\n throw new PmCliError(`Checkpoint ${checkpointId} contains an invalid item entry`, EXIT_CODE.GENERIC_FAILURE);\n }\n const row = entry as Record<string, unknown>;\n if (typeof row.id !== \"string\" || row.id.trim().length === 0) {\n throw new PmCliError(`Checkpoint ${checkpointId} contains an item entry without ID`, EXIT_CODE.GENERIC_FAILURE);\n }\n if (typeof row.target_updated_at !== \"string\" || row.target_updated_at.trim().length === 0) {\n throw new PmCliError(\n `Checkpoint ${checkpointId} contains an item entry without target_updated_at`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return { id: row.id.trim(), target_updated_at: row.target_updated_at.trim() };\n });\n}\n\nexport async function loadMutationCheckpoint(\n pmRoot: string,\n subdir: string,\n rawCheckpointId: string,\n schemaVersion: number,\n): Promise<LoadedMutationCheckpoint> {\n const normalizedId = normalizeCheckpointId(rawCheckpointId);\n const filePath = checkpointFilePath(pmRoot, subdir, normalizedId);\n if (!(await pathExists(filePath))) {\n throw new PmCliError(`Checkpoint ${normalizedId} not found`, EXIT_CODE.NOT_FOUND);\n }\n const raw = await readFile(filePath, \"utf8\");\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch (error: unknown) {\n throw new PmCliError(\n `Checkpoint ${normalizedId} contains invalid JSON: ${toErrorMessage(error)}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (!parsed || typeof parsed !== \"object\") {\n throw new PmCliError(`Checkpoint ${normalizedId} is invalid`, EXIT_CODE.GENERIC_FAILURE);\n }\n const record = parsed as Record<string, unknown>;\n if (record.schema_version !== schemaVersion) {\n throw new PmCliError(`Checkpoint ${normalizedId} has unsupported schema version`, EXIT_CODE.GENERIC_FAILURE);\n }\n const items = parseCheckpointItems(record, normalizedId);\n return {\n record,\n items,\n path: filePath,\n id: typeof record.id === \"string\" ? record.id : normalizedId,\n // Defensive recovery for malformed checkpoint metadata; normal writes\n // always include these fields, so fallbacks keep rollback inspectable.\n created_at: typeof record.created_at === \"string\" ? record.created_at : nowIso(),\n author: typeof record.author === \"string\" ? record.author : \"unknown\",\n };\n}\n\n/**\n * Restore every checkpointed item to its captured pre-mutation timestamp,\n * collecting per-item rows. A single item's failure is recorded and does not\n * abort the remaining restores.\n */\nexport async function restoreCheckpointItems(\n items: MutationCheckpointItem[],\n restore: CheckpointRestoreFn,\n): Promise<CheckpointRollbackResult> {\n const rows: CheckpointRollbackRow[] = [];\n const restoredIds: string[] = [];\n for (const entry of items) {\n try {\n const restored = await restore(entry.id, entry.target_updated_at);\n rows.push({\n id: entry.id,\n status: \"restored\",\n changed_fields: restored.changed_fields,\n warnings: restored.warnings,\n });\n restoredIds.push(entry.id);\n } catch (error: unknown) {\n rows.push({ id: entry.id, status: \"failed\", error: toErrorMessage(error) });\n }\n }\n return {\n rows,\n restored_ids: restoredIds,\n failed_count: rows.filter((row) => row.status === \"failed\").length,\n };\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA8C3C,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,UAAU,CAAC,+CAA+C,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACzF,CAAC;IACD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,UAAU,CAAC,qDAAqD,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/F,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,QAAgB;IACjE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE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!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2395fa10-67f6-5cde-969a-336588fccb3e")}catch(e){}}();
13
+ !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]="fd40ea7d-d52d-54b7-ab73-89bebc4a762e")}catch(e){}}();
14
14
  const FORMAT_KEYS = new Set(["item_format"]);
15
15
  const CRITERIA_KEYS = new Set([
16
16
  "definition_of_done",
@@ -29,6 +29,8 @@ const POLICY_KEYS = new Set([
29
29
  "governance_ownership_enforcement",
30
30
  "governance_create_mode_default",
31
31
  "governance_close_validation_default",
32
+ "governance_create_default_type",
33
+ "governance_workflow_enforcement",
32
34
  "governance_parent_reference_policy",
33
35
  "governance_metadata_validation_profile",
34
36
  "governance_force_required_for_stale_lock",
@@ -106,4 +108,4 @@ export function resolveConfigPositionalValue(canonicalKeyOrAlias, value) {
106
108
  return { routable: true, flag: "policy", value: policyValue };
107
109
  }
108
110
  //# sourceMappingURL=positional-value.js.map
109
- //# debugId=2395fa10-67f6-5cde-969a-336588fccb3e
111
+ //# debugId=fd40ea7d-d52d-54b7-ab73-89bebc4a762e
@@ -1 +1 @@
1
- {"version":3,"file":"positional-value.js","sources":["core/config/positional-value.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Pure routing helper for the optional positional `value` argument of `pm config set`.\n *\n * `pm config set <key> <value>` is the intuitive form agents reach for, but config\n * VALUES are actually carried by typed flags (`--format`, `--policy`, `--criterion`).\n * This module maps a config key (kebab or snake form, canonical or alias) plus a raw\n * positional value onto the typed flag it should populate, applying enabled/disabled\n * synonyms (off/on/true/false) for boolean-style policy keys. The existing per-key\n * validators in config.ts still run on the routed value, so bad values keep their\n * good error messages.\n */\n\n/** The typed flag a positional value routes to. */\nexport type ConfigPositionalFlag = \"format\" | \"policy\" | \"criterion\";\n\n/** Successful routing of a positional value to a single-value typed flag. */\nexport interface ConfigPositionalScalarRouted {\n routable: true;\n flag: \"format\" | \"policy\";\n /** Normalized scalar value for single-value flags. */\n value: string;\n}\n\n/** Successful routing of a positional value to the criteria-list flag. */\nexport interface ConfigPositionalListRouted {\n routable: true;\n flag: \"criterion\";\n /** Criteria-list flag (`--criterion`) value, supplied as a values array. */\n values: string[];\n}\n\nexport type ConfigPositionalRouted = ConfigPositionalScalarRouted | ConfigPositionalListRouted;\n\n/** A key whose value cannot be carried by a single positional (e.g. `context`). */\nexport interface ConfigPositionalNotRoutable {\n routable: false;\n /** Human/agent-facing reason + the flags to use instead. */\n reason: string;\n}\n\nexport type ConfigPositionalResult = ConfigPositionalRouted | ConfigPositionalNotRoutable;\n\n/** Canonical snake-case config keys this helper understands. */\ntype CanonicalConfigKey =\n | \"definition_of_done\"\n | \"item_format\"\n | \"history_missing_stream_policy\"\n | \"sprint_release_format_policy\"\n | \"parent_reference_policy\"\n | \"metadata_validation_profile\"\n | \"metadata_required_fields\"\n | \"lifecycle_stale_blocker_reason_patterns\"\n | \"lifecycle_closure_like_blocked_reason_patterns\"\n | \"lifecycle_closure_like_resolution_patterns\"\n | \"lifecycle_closure_like_actual_result_patterns\"\n | \"governance_preset\"\n | \"governance_ownership_enforcement\"\n | \"governance_create_mode_default\"\n | \"governance_close_validation_default\"\n | \"governance_parent_reference_policy\"\n | \"governance_metadata_validation_profile\"\n | \"governance_force_required_for_stale_lock\"\n | \"test_result_tracking\"\n | \"telemetry_tracking\"\n | \"context\";\n\nconst FORMAT_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\"item_format\"]);\n\nconst CRITERIA_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\n \"definition_of_done\",\n \"metadata_required_fields\",\n \"lifecycle_stale_blocker_reason_patterns\",\n \"lifecycle_closure_like_blocked_reason_patterns\",\n \"lifecycle_closure_like_resolution_patterns\",\n \"lifecycle_closure_like_actual_result_patterns\",\n]);\n\nconst POLICY_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\n \"history_missing_stream_policy\",\n \"sprint_release_format_policy\",\n \"parent_reference_policy\",\n \"metadata_validation_profile\",\n \"governance_preset\",\n \"governance_ownership_enforcement\",\n \"governance_create_mode_default\",\n \"governance_close_validation_default\",\n \"governance_parent_reference_policy\",\n \"governance_metadata_validation_profile\",\n \"governance_force_required_for_stale_lock\",\n \"test_result_tracking\",\n \"telemetry_tracking\",\n]);\n\n/**\n * Policy keys whose only valid values are enabled/disabled. For these we accept the\n * intuitive synonyms off/on/true/false. Other policy keys pass through unchanged so\n * their own validators report the precise allowed set.\n */\nconst ENABLED_DISABLED_POLICY_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\n \"governance_force_required_for_stale_lock\",\n \"test_result_tracking\",\n \"telemetry_tracking\",\n]);\n\nconst ENABLED_DISABLED_SYNONYMS: Record<string, string> = {\n off: \"disabled\",\n on: \"enabled\",\n true: \"enabled\",\n false: \"disabled\",\n enabled: \"enabled\",\n disabled: \"disabled\",\n};\n\n/** Normalize any kebab/snake key form to the canonical snake key (or undefined). */\nfunction toCanonicalKey(keyOrAlias: string): CanonicalConfigKey | undefined {\n const normalized = keyOrAlias.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (\n FORMAT_KEYS.has(normalized as CanonicalConfigKey) ||\n CRITERIA_KEYS.has(normalized as CanonicalConfigKey) ||\n POLICY_KEYS.has(normalized as CanonicalConfigKey) ||\n normalized === \"context\"\n ) {\n return normalized as CanonicalConfigKey;\n }\n return undefined;\n}\n\n/**\n * Map an enabled/disabled-style value through its synonyms (case-insensitive). Values\n * that are not synonyms pass through unchanged so the downstream validator can reject\n * them with its own message.\n */\nfunction normalizeEnabledDisabled(value: string): string {\n const normalized = value.trim().toLowerCase();\n return ENABLED_DISABLED_SYNONYMS[normalized] ?? value;\n}\n\n/**\n * Resolve which typed flag a positional `pm config set <key> <value>` value should\n * populate, plus the normalized value.\n *\n * Returns `{ routable: false, reason }` for keys that require multiple/structured\n * flags (e.g. `context`). Unknown keys also return `routable: false` so the caller\n * can fall back to the existing invalid-key path.\n */\nexport function resolveConfigPositionalValue(\n canonicalKeyOrAlias: string,\n value: string,\n): ConfigPositionalResult {\n const key = toCanonicalKey(canonicalKeyOrAlias);\n if (key === undefined) {\n return {\n routable: false,\n reason: `Unknown config key \"${canonicalKeyOrAlias}\" cannot route a positional value.`,\n };\n }\n\n if (key === \"context\") {\n return {\n routable: false,\n reason:\n 'Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags.',\n };\n }\n\n if (FORMAT_KEYS.has(key)) {\n return { routable: true, flag: \"format\", value };\n }\n\n if (CRITERIA_KEYS.has(key)) {\n return { routable: true, flag: \"criterion\", values: [value] };\n }\n\n // policy key\n const policyValue = ENABLED_DISABLED_POLICY_KEYS.has(key) ? normalizeEnabledDisabled(value) : value;\n return { routable: true, flag: \"policy\", value: policyValue };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;;AAwDH,MAAM,WAAW,GAAoC,IAAI,GAAG,CAAqB,CAAC,aAAa,CAAC,CAAC,CAAC;AAElG,MAAM,aAAa,GAAoC,IAAI,GAAG,CAAqB;IACjF,oBAAoB;IACpB,0BAA0B;IAC1B,yCAAyC;IACzC,gDAAgD;IAChD,4CAA4C;IAC5C,+CAA+C;CAChD,CAAC,CAAC;AAEH,MAAM,WAAW,GAAoC,IAAI,GAAG,CAAqB;IAC/E,+BAA+B;IAC/B,8BAA8B;IAC9B,yBAAyB;IACzB,6BAA6B;IAC7B,mBAAmB;IACnB,kCAAkC;IAClC,gCAAgC;IAChC,qCAAqC;IACrC,oCAAoC;IACpC,wCAAwC;IACxC,0CAA0C;IAC1C,sBAAsB;IACtB,oBAAoB;CACrB,CA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;YACL,QAAQ,EAAE,KAAK;YACf,MAAM,EACJ,kJAAkJ;SACrJ,CAAC;IACJ,CAAC;IAED,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnD,CAAC;IAED,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAChE,CAAC;IAED,aAAa;IACb,MAAM,WAAW,GAAG,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACpG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChE,CAAC","debugId":"2395fa10-67f6-5cde-969a-336588fccb3e"}
1
+ {"version":3,"file":"positional-value.js","sources":["core/config/positional-value.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Pure routing helper for the optional positional `value` argument of `pm config set`.\n *\n * `pm config set <key> <value>` is the intuitive form agents reach for, but config\n * VALUES are actually carried by typed flags (`--format`, `--policy`, `--criterion`).\n * This module maps a config key (kebab or snake form, canonical or alias) plus a raw\n * positional value onto the typed flag it should populate, applying enabled/disabled\n * synonyms (off/on/true/false) for boolean-style policy keys. The existing per-key\n * validators in config.ts still run on the routed value, so bad values keep their\n * good error messages.\n */\n\n/** The typed flag a positional value routes to. */\nexport type ConfigPositionalFlag = \"format\" | \"policy\" | \"criterion\";\n\n/** Successful routing of a positional value to a single-value typed flag. */\nexport interface ConfigPositionalScalarRouted {\n routable: true;\n flag: \"format\" | \"policy\";\n /** Normalized scalar value for single-value flags. */\n value: string;\n}\n\n/** Successful routing of a positional value to the criteria-list flag. */\nexport interface ConfigPositionalListRouted {\n routable: true;\n flag: \"criterion\";\n /** Criteria-list flag (`--criterion`) value, supplied as a values array. */\n values: string[];\n}\n\nexport type ConfigPositionalRouted = ConfigPositionalScalarRouted | ConfigPositionalListRouted;\n\n/** A key whose value cannot be carried by a single positional (e.g. `context`). */\nexport interface ConfigPositionalNotRoutable {\n routable: false;\n /** Human/agent-facing reason + the flags to use instead. */\n reason: string;\n}\n\nexport type ConfigPositionalResult = ConfigPositionalRouted | ConfigPositionalNotRoutable;\n\n/** Canonical snake-case config keys this helper understands. */\ntype CanonicalConfigKey =\n | \"definition_of_done\"\n | \"item_format\"\n | \"history_missing_stream_policy\"\n | \"sprint_release_format_policy\"\n | \"parent_reference_policy\"\n | \"metadata_validation_profile\"\n | \"metadata_required_fields\"\n | \"lifecycle_stale_blocker_reason_patterns\"\n | \"lifecycle_closure_like_blocked_reason_patterns\"\n | \"lifecycle_closure_like_resolution_patterns\"\n | \"lifecycle_closure_like_actual_result_patterns\"\n | \"governance_preset\"\n | \"governance_ownership_enforcement\"\n | \"governance_create_mode_default\"\n | \"governance_close_validation_default\"\n | \"governance_create_default_type\"\n | \"governance_workflow_enforcement\"\n | \"governance_parent_reference_policy\"\n | \"governance_metadata_validation_profile\"\n | \"governance_force_required_for_stale_lock\"\n | \"test_result_tracking\"\n | \"telemetry_tracking\"\n | \"context\";\n\nconst FORMAT_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\"item_format\"]);\n\nconst CRITERIA_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\n \"definition_of_done\",\n \"metadata_required_fields\",\n \"lifecycle_stale_blocker_reason_patterns\",\n \"lifecycle_closure_like_blocked_reason_patterns\",\n \"lifecycle_closure_like_resolution_patterns\",\n \"lifecycle_closure_like_actual_result_patterns\",\n]);\n\nconst POLICY_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\n \"history_missing_stream_policy\",\n \"sprint_release_format_policy\",\n \"parent_reference_policy\",\n \"metadata_validation_profile\",\n \"governance_preset\",\n \"governance_ownership_enforcement\",\n \"governance_create_mode_default\",\n \"governance_close_validation_default\",\n \"governance_create_default_type\",\n \"governance_workflow_enforcement\",\n \"governance_parent_reference_policy\",\n \"governance_metadata_validation_profile\",\n \"governance_force_required_for_stale_lock\",\n \"test_result_tracking\",\n \"telemetry_tracking\",\n]);\n\n/**\n * Policy keys whose only valid values are enabled/disabled. For these we accept the\n * intuitive synonyms off/on/true/false. Other policy keys pass through unchanged so\n * their own validators report the precise allowed set.\n */\nconst ENABLED_DISABLED_POLICY_KEYS: ReadonlySet<CanonicalConfigKey> = new Set<CanonicalConfigKey>([\n \"governance_force_required_for_stale_lock\",\n \"test_result_tracking\",\n \"telemetry_tracking\",\n]);\n\nconst ENABLED_DISABLED_SYNONYMS: Record<string, string> = {\n off: \"disabled\",\n on: \"enabled\",\n true: \"enabled\",\n false: \"disabled\",\n enabled: \"enabled\",\n disabled: \"disabled\",\n};\n\n/** Normalize any kebab/snake key form to the canonical snake key (or undefined). */\nfunction toCanonicalKey(keyOrAlias: string): CanonicalConfigKey | undefined {\n const normalized = keyOrAlias.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (\n FORMAT_KEYS.has(normalized as CanonicalConfigKey) ||\n CRITERIA_KEYS.has(normalized as CanonicalConfigKey) ||\n POLICY_KEYS.has(normalized as CanonicalConfigKey) ||\n normalized === \"context\"\n ) {\n return normalized as CanonicalConfigKey;\n }\n return undefined;\n}\n\n/**\n * Map an enabled/disabled-style value through its synonyms (case-insensitive). Values\n * that are not synonyms pass through unchanged so the downstream validator can reject\n * them with its own message.\n */\nfunction normalizeEnabledDisabled(value: string): string {\n const normalized = value.trim().toLowerCase();\n return ENABLED_DISABLED_SYNONYMS[normalized] ?? value;\n}\n\n/**\n * Resolve which typed flag a positional `pm config set <key> <value>` value should\n * populate, plus the normalized value.\n *\n * Returns `{ routable: false, reason }` for keys that require multiple/structured\n * flags (e.g. `context`). Unknown keys also return `routable: false` so the caller\n * can fall back to the existing invalid-key path.\n */\nexport function resolveConfigPositionalValue(\n canonicalKeyOrAlias: string,\n value: string,\n): ConfigPositionalResult {\n const key = toCanonicalKey(canonicalKeyOrAlias);\n if (key === undefined) {\n return {\n routable: false,\n reason: `Unknown config key \"${canonicalKeyOrAlias}\" cannot route a positional value.`,\n };\n }\n\n if (key === \"context\") {\n return {\n routable: false,\n reason:\n 'Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags.',\n };\n }\n\n if (FORMAT_KEYS.has(key)) {\n return { routable: true, flag: \"format\", value };\n }\n\n if (CRITERIA_KEYS.has(key)) {\n return { routable: true, flag: \"criterion\", values: [value] };\n }\n\n // policy key\n const policyValue = ENABLED_DISABLED_POLICY_KEYS.has(key) ? normalizeEnabledDisabled(value) : value;\n return { routable: true, flag: \"policy\", value: policyValue };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;;;AA0DH,MAAM,WAAW,GAAoC,IAAI,GAAG,CAAqB,CAAC,aAAa,CAAC,CAAC,CAAC;AAElG,MAAM,aAAa,GAAoC,IAAI,GAAG,CAAqB;IACjF,oBAAoB;IACpB,0BAA0B;IAC1B,yCAAyC;IACzC,gDAAgD;IAChD,4CAA4C;IAC5C,+CAA+C;CAChD,CAAC,CAAC;AAEH,MAAM,WAAW,GAAoC,IAAI,GAAG,CAAqB;IAC/E,+BAA+B;IAC/B,8BAA8B;IAC9B,yBAAyB;IACzB,6BAA6B;IAC7B,mBAAmB;IACnB,kCAAkC;IAClC,gCAAgC;IAChC,qCAAqC;IACrC,gCAAgC;IAChC,iCAAiC;IACjC,oCAAoC;IACpC,wCAAwC;IACxC,0CAA0C;IAC1C,sBAAsB;IACtB,oBAAoB;CACrB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,4BAA4B,GAAoC,IAAI,GAAG,CAAqB;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CAAC;IAED,IAAI,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnD,CAAC;IAED,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAChE,CAAC;IAED,aAAa;IACb,MAAM,WAAW,GAAG,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACpG,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChE,CAAC","debugId":"fd40ea7d-d52d-54b7-ab73-89bebc4a762e"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Shared machine-executable remediation registry.
3
+ *
4
+ * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens
5
+ * (for example `history_drift_missing_stream:pm-abcd` or
6
+ * `validate_resolution_missing_fields:3`). Agents that gate on these commands
7
+ * previously had to hardcode the mapping from a warning code to the `pm` command
8
+ * that fixes it. This module is the single source of truth for that mapping so
9
+ * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`
10
+ * (per-check `fix_hints`) can both surface executable remediation without any
11
+ * duplicated, drift-prone lookup tables.
12
+ *
13
+ * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command
14
+ * an operator/agent should run to resolve findings with that code. Per-item
15
+ * findings use an `<id>` placeholder (callers that have the concrete id may
16
+ * substitute it); findings whose only fix is a manual file edit point at the
17
+ * most useful diagnostic/repair command and describe the manual step in
18
+ * {@link RemediationEntry.summary}.
19
+ */
20
+ export interface RemediationEntry {
21
+ /**
22
+ * Stable warning-code prefix this entry resolves. A warning matches when it
23
+ * equals this code or begins with `<code>:`. Registry codes are mutually
24
+ * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix
25
+ * of another — e.g. `settings:id_prefix_empty` is distinct from a bare
26
+ * `settings`, which is intentionally not registered), so `resolveRemediation`
27
+ * uses first-match with no ordering dependency.
28
+ */
29
+ readonly code: string;
30
+ /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */
31
+ readonly command: string;
32
+ /** One-line description of what the command does / which manual step it covers. */
33
+ readonly summary: string;
34
+ }
35
+ /**
36
+ * Registry of every non-extension `pm health` / `pm validate` warning code and
37
+ * its remediation. Extension findings keep their richer, contextual
38
+ * `details.triage.remediation` produced by the extension health triage and are
39
+ * intentionally excluded here (see pm-0hnu: "all non-extension checks").
40
+ */
41
+ export declare const REMEDIATION_REGISTRY: readonly RemediationEntry[];
42
+ /**
43
+ * Resolve the remediation entry for a warning token, or `undefined` when no
44
+ * entry is registered. A warning matches an entry when it equals the entry code
45
+ * or begins with `<code>:` (the colon boundary keeps sibling codes such as
46
+ * `validate_lifecycle_dependency_cycles` and
47
+ * `validate_lifecycle_dependency_cycles_error` disjoint).
48
+ *
49
+ * First match is intentional and correct: registry codes are mutually exclusive
50
+ * under the colon-boundary rule, so at most one entry can ever match a warning
51
+ * and order is irrelevant. That invariant is enforced by a test (see
52
+ * remediation-registry.spec.ts "keeps every registry code mutually exclusive"),
53
+ * which is why this stays a simple linear scan rather than a longest-prefix
54
+ * search — a longest-prefix tie-break is unreachable with disjoint codes.
55
+ *
56
+ * Accepts unknown input defensively (this is an exported helper SDK consumers
57
+ * may call from untyped JS): a non-string `warning` resolves to `undefined`.
58
+ */
59
+ export declare function resolveRemediation(warning: string): RemediationEntry | undefined;
60
+ /**
61
+ * Build a compact `remediation_map` (code -> command) for a set of warning
62
+ * tokens. First match wins per code; unknown codes are skipped. Used by
63
+ * `pm health --json` per-check details and as the source of deduped executable
64
+ * commands for `pm validate --fix-hints`.
65
+ */
66
+ export declare function buildRemediationMap(warnings: Iterable<string>): Record<string, string>;
67
+ /**
68
+ * Build a deduped, ordered list of executable remediation commands for a set of
69
+ * warning tokens (one command per distinct matched code). Used by
70
+ * `pm validate --fix-hints` for checks that do not already emit per-row
71
+ * remediation commands.
72
+ */
73
+ export declare function buildRemediationCommands(warnings: Iterable<string>): string[];