@unbrained/pm-cli 2026.5.31 → 2026.6.6

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 (638) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/CONTRIBUTING.md +1 -0
  3. package/README.md +12 -4
  4. package/dist/cli/argv-utils.js +7 -3
  5. package/dist/cli/argv-utils.js.map +1 -1
  6. package/dist/cli/bootstrap-args.d.ts +1 -0
  7. package/dist/cli/bootstrap-args.js +23 -3
  8. package/dist/cli/bootstrap-args.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +17 -3
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/close-many.d.ts +63 -0
  12. package/dist/cli/commands/close-many.js +302 -0
  13. package/dist/cli/commands/close-many.js.map +1 -0
  14. package/dist/cli/commands/completion.d.ts +1 -0
  15. package/dist/cli/commands/completion.js +260 -32
  16. package/dist/cli/commands/completion.js.map +1 -1
  17. package/dist/cli/commands/config.d.ts +4 -4
  18. package/dist/cli/commands/config.js +115 -3
  19. package/dist/cli/commands/config.js.map +1 -1
  20. package/dist/cli/commands/contracts.js +193 -162
  21. package/dist/cli/commands/contracts.js.map +1 -1
  22. package/dist/cli/commands/create.d.ts +1 -0
  23. package/dist/cli/commands/create.js +77 -114
  24. package/dist/cli/commands/create.js.map +1 -1
  25. package/dist/cli/commands/extension/doctor.d.ts +12 -0
  26. package/dist/cli/commands/extension/doctor.js +97 -2
  27. package/dist/cli/commands/extension/doctor.js.map +1 -1
  28. package/dist/cli/commands/extension/scaffold.js +49 -48
  29. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  30. package/dist/cli/commands/extension.js +51 -23
  31. package/dist/cli/commands/extension.js.map +1 -1
  32. package/dist/cli/commands/gc.d.ts +8 -1
  33. package/dist/cli/commands/gc.js +26 -3
  34. package/dist/cli/commands/gc.js.map +1 -1
  35. package/dist/cli/commands/get.js +7 -7
  36. package/dist/cli/commands/get.js.map +1 -1
  37. package/dist/cli/commands/health.js +51 -3
  38. package/dist/cli/commands/health.js.map +1 -1
  39. package/dist/cli/commands/history.d.ts +4 -1
  40. package/dist/cli/commands/history.js +12 -24
  41. package/dist/cli/commands/history.js.map +1 -1
  42. package/dist/cli/commands/index.d.ts +3 -1
  43. package/dist/cli/commands/index.js +5 -3
  44. package/dist/cli/commands/index.js.map +1 -1
  45. package/dist/cli/commands/init.d.ts +10 -0
  46. package/dist/cli/commands/init.js +107 -4
  47. package/dist/cli/commands/init.js.map +1 -1
  48. package/dist/cli/commands/list.d.ts +5 -0
  49. package/dist/cli/commands/list.js +58 -26
  50. package/dist/cli/commands/list.js.map +1 -1
  51. package/dist/cli/commands/reindex.js +163 -47
  52. package/dist/cli/commands/reindex.js.map +1 -1
  53. package/dist/cli/commands/repeatable-metadata-parsers.d.ts +15 -0
  54. package/dist/cli/commands/repeatable-metadata-parsers.js +120 -0
  55. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -0
  56. package/dist/cli/commands/restore.js +25 -4
  57. package/dist/cli/commands/restore.js.map +1 -1
  58. package/dist/cli/commands/schema.d.ts +122 -1
  59. package/dist/cli/commands/schema.js +536 -6
  60. package/dist/cli/commands/schema.js.map +1 -1
  61. package/dist/cli/commands/search.d.ts +1 -0
  62. package/dist/cli/commands/search.js +18 -4
  63. package/dist/cli/commands/search.js.map +1 -1
  64. package/dist/cli/commands/stats.d.ts +8 -1
  65. package/dist/cli/commands/stats.js +18 -17
  66. package/dist/cli/commands/stats.js.map +1 -1
  67. package/dist/cli/commands/telemetry.d.ts +8 -0
  68. package/dist/cli/commands/telemetry.js +253 -0
  69. package/dist/cli/commands/telemetry.js.map +1 -0
  70. package/dist/cli/commands/test.js +4 -3
  71. package/dist/cli/commands/test.js.map +1 -1
  72. package/dist/cli/commands/update-many.js +69 -140
  73. package/dist/cli/commands/update-many.js.map +1 -1
  74. package/dist/cli/commands/update.d.ts +2 -0
  75. package/dist/cli/commands/update.js +138 -119
  76. package/dist/cli/commands/update.js.map +1 -1
  77. package/dist/cli/commands/validate.d.ts +1 -0
  78. package/dist/cli/commands/validate.js +63 -33
  79. package/dist/cli/commands/validate.js.map +1 -1
  80. package/dist/cli/error-guidance.js +26 -3
  81. package/dist/cli/error-guidance.js.map +1 -1
  82. package/dist/cli/help-content.js +91 -3
  83. package/dist/cli/help-content.js.map +1 -1
  84. package/dist/cli/main.js +377 -23
  85. package/dist/cli/main.js.map +1 -1
  86. package/dist/cli/register-list-query.js +14 -5
  87. package/dist/cli/register-list-query.js.map +1 -1
  88. package/dist/cli/register-mutation.js +200 -28
  89. package/dist/cli/register-mutation.js.map +1 -1
  90. package/dist/cli/register-operations.js +31 -6
  91. package/dist/cli/register-operations.js.map +1 -1
  92. package/dist/cli/register-setup.js +4 -2
  93. package/dist/cli/register-setup.js.map +1 -1
  94. package/dist/cli/registration-helpers.js +31 -4
  95. package/dist/cli/registration-helpers.js.map +1 -1
  96. package/dist/cli-bundle/chunks/activity-CVXTCHYY.js +16 -0
  97. package/dist/cli-bundle/chunks/activity-JM6DTDND.js +20 -0
  98. package/dist/cli-bundle/chunks/activity-JM6DTDND.js.map +1 -0
  99. package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js +206 -0
  100. package/dist/cli-bundle/chunks/aggregate-GI7WSZPH.js.map +1 -0
  101. package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js → aggregate-VNAHUNNF.js} +11 -11
  102. package/dist/cli-bundle/chunks/{append-JD2DETU7.js → append-7H5N64R2.js} +8 -9
  103. package/dist/cli-bundle/chunks/{append-JD2DETU7.js.map → append-7H5N64R2.js.map} +1 -1
  104. package/dist/cli-bundle/chunks/append-WMKRXKCE.js +69 -0
  105. package/dist/cli-bundle/chunks/append-WMKRXKCE.js.map +1 -0
  106. package/dist/cli-bundle/chunks/{chunk-3M73P3G6.js → chunk-23YFZ3IG.js} +210 -132
  107. package/dist/cli-bundle/chunks/chunk-23YFZ3IG.js.map +7 -0
  108. package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js +128 -0
  109. package/dist/cli-bundle/chunks/chunk-2HVRUSQA.js.map +1 -0
  110. package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js +266 -0
  111. package/dist/cli-bundle/chunks/chunk-2RSPZI5H.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js +631 -0
  113. package/dist/cli-bundle/chunks/chunk-2VBQ6ZXS.js.map +1 -0
  114. package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js +380 -0
  115. package/dist/cli-bundle/chunks/chunk-2VVCGBNV.js.map +1 -0
  116. package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js +1664 -0
  117. package/dist/cli-bundle/chunks/chunk-3BWOVLTH.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-6HT2F4TK.js → chunk-3FI4SEFT.js} +175 -54
  119. package/dist/cli-bundle/chunks/chunk-3FI4SEFT.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-JULRTHJQ.js → chunk-3LB74A67.js} +119 -6
  121. package/dist/cli-bundle/chunks/chunk-3LB74A67.js.map +7 -0
  122. package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js +57 -0
  123. package/dist/cli-bundle/chunks/chunk-3VAM3NNM.js.map +1 -0
  124. package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js +1832 -0
  125. package/dist/cli-bundle/chunks/chunk-4LL6TK5B.js.map +1 -0
  126. package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js +422 -0
  127. package/dist/cli-bundle/chunks/chunk-52MAOQ6J.js.map +7 -0
  128. package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js +412 -0
  129. package/dist/cli-bundle/chunks/chunk-5FDATVEZ.js.map +1 -0
  130. package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js +5622 -0
  131. package/dist/cli-bundle/chunks/chunk-5SFCOO6B.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-U7FMKRXH.js → chunk-6ER6DXH5.js} +37 -16
  133. package/dist/cli-bundle/chunks/chunk-6ER6DXH5.js.map +7 -0
  134. package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js +218 -0
  135. package/dist/cli-bundle/chunks/chunk-6P6GGMOG.js.map +1 -0
  136. package/dist/cli-bundle/chunks/chunk-77GFDHGF.js +80 -0
  137. package/dist/cli-bundle/chunks/chunk-77GFDHGF.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-MD7K4JYF.js → chunk-AO442XLN.js} +26 -15
  139. package/dist/cli-bundle/chunks/chunk-AO442XLN.js.map +7 -0
  140. package/dist/cli-bundle/chunks/chunk-AY43SBIN.js +751 -0
  141. package/dist/cli-bundle/chunks/chunk-AY43SBIN.js.map +1 -0
  142. package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js → chunk-BQHUILZS.js} +5 -5
  143. package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js +242 -0
  144. package/dist/cli-bundle/chunks/chunk-E5FJNAZA.js.map +1 -0
  145. package/dist/cli-bundle/chunks/{chunk-OGZEG5TT.js → chunk-ECCMVXGM.js} +164 -53
  146. package/dist/cli-bundle/chunks/chunk-ECCMVXGM.js.map +7 -0
  147. package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js +182 -0
  148. package/dist/cli-bundle/chunks/chunk-FRAUKRU2.js.map +1 -0
  149. package/dist/cli-bundle/chunks/chunk-GCOQW437.js +130 -0
  150. package/dist/cli-bundle/chunks/chunk-GCOQW437.js.map +1 -0
  151. package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js +1340 -0
  152. package/dist/cli-bundle/chunks/chunk-GGYWB3Y2.js.map +1 -0
  153. package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js → chunk-GU2ZJ2VV.js} +5 -5
  154. package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js +231 -0
  155. package/dist/cli-bundle/chunks/chunk-GXSUPCBV.js.map +1 -0
  156. package/dist/cli-bundle/chunks/chunk-HZGUAH22.js +76 -0
  157. package/dist/cli-bundle/chunks/chunk-HZGUAH22.js.map +1 -0
  158. package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js +346 -0
  159. package/dist/cli-bundle/chunks/chunk-I2HSTRJF.js.map +1 -0
  160. package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js +140 -0
  161. package/dist/cli-bundle/chunks/chunk-I6BNFU5X.js.map +7 -0
  162. package/dist/cli-bundle/chunks/{chunk-JTWRXG4B.js → chunk-IJGCZSIQ.js} +251 -251
  163. package/dist/cli-bundle/chunks/chunk-IJGCZSIQ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js +1491 -0
  165. package/dist/cli-bundle/chunks/chunk-IOR7LGF4.js.map +1 -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-AKOOMO3T.js → chunk-KAG77BY3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js → chunk-KJ33AOCY.js} +3 -3
  172. package/dist/cli-bundle/chunks/{chunk-WDPXDQFG.js → chunk-KJE2FOS4.js} +6 -4
  173. package/dist/cli-bundle/chunks/chunk-KJE2FOS4.js.map +7 -0
  174. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js +3883 -0
  175. package/dist/cli-bundle/chunks/chunk-KWU6HG75.js.map +1 -0
  176. package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js +1325 -0
  177. package/dist/cli-bundle/chunks/chunk-LB3RUL2N.js.map +1 -0
  178. package/dist/cli-bundle/chunks/{chunk-5HSEP75M.js → chunk-LCM63IXU.js} +18 -6
  179. package/dist/cli-bundle/chunks/chunk-LCM63IXU.js.map +7 -0
  180. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js +24 -0
  181. package/dist/cli-bundle/chunks/chunk-LXYVKYMQ.js.map +1 -0
  182. package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js +182 -0
  183. package/dist/cli-bundle/chunks/chunk-ME2YH6FN.js.map +1 -0
  184. package/dist/cli-bundle/chunks/chunk-MITFDD35.js +1809 -0
  185. package/dist/cli-bundle/chunks/chunk-MITFDD35.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js → chunk-N7ACFE26.js} +3 -3
  187. package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js +332 -0
  188. package/dist/cli-bundle/chunks/chunk-NUZ5HKR4.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-7Y53ZJIQ.js → chunk-OVQCEJPG.js} +22 -3
  190. package/dist/cli-bundle/chunks/chunk-OVQCEJPG.js.map +7 -0
  191. package/dist/cli-bundle/chunks/{chunk-PXUAZUUY.js → chunk-OZ7NSQHL.js} +12 -11
  192. package/dist/cli-bundle/chunks/chunk-OZ7NSQHL.js.map +7 -0
  193. package/dist/cli-bundle/chunks/{chunk-P53TN6IA.js → chunk-PDDFYW4X.js} +35 -8
  194. package/dist/cli-bundle/chunks/chunk-PDDFYW4X.js.map +7 -0
  195. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js → chunk-PIU6RSL3.js} +10 -12
  196. package/dist/cli-bundle/chunks/{chunk-6YCV7WSL.js.map → chunk-PIU6RSL3.js.map} +1 -1
  197. package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js +338 -0
  198. package/dist/cli-bundle/chunks/chunk-PO3GSVFV.js.map +1 -0
  199. package/dist/cli-bundle/chunks/{chunk-LRBOHPUE.js → chunk-PRJCELV4.js} +108 -21
  200. package/dist/cli-bundle/chunks/chunk-PRJCELV4.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-GN7IJPCD.js → chunk-PROOHX4K.js} +332 -32
  202. package/dist/cli-bundle/chunks/chunk-PROOHX4K.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-FQE6XZDB.js → chunk-Q7SPNHLW.js} +54 -32
  204. package/dist/cli-bundle/chunks/chunk-Q7SPNHLW.js.map +7 -0
  205. package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js → chunk-QO7EBBOM.js} +2 -2
  206. package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js → chunk-R6UFP2GE.js} +7 -7
  207. package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js +154 -0
  208. package/dist/cli-bundle/chunks/chunk-RWPSOIEE.js.map +1 -0
  209. package/dist/cli-bundle/chunks/chunk-RZN6VURO.js +119 -0
  210. package/dist/cli-bundle/chunks/chunk-RZN6VURO.js.map +1 -0
  211. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js +1501 -0
  212. package/dist/cli-bundle/chunks/chunk-SKJWX3QB.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js → chunk-T3LC5LKB.js} +2 -2
  214. package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js +173 -0
  215. package/dist/cli-bundle/chunks/chunk-TCD3R2PF.js.map +1 -0
  216. package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js +2988 -0
  217. package/dist/cli-bundle/chunks/chunk-TPH5XEVD.js.map +1 -0
  218. package/dist/cli-bundle/chunks/{chunk-LSXGH6NE.js → chunk-U5SXYXSY.js} +821 -200
  219. package/dist/cli-bundle/chunks/chunk-U5SXYXSY.js.map +7 -0
  220. package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js +540 -0
  221. package/dist/cli-bundle/chunks/chunk-UBOPJT3S.js.map +1 -0
  222. package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js → chunk-UM2GBHS4.js} +5 -4
  223. package/dist/cli-bundle/chunks/chunk-W7XABV4H.js +454 -0
  224. package/dist/cli-bundle/chunks/chunk-W7XABV4H.js.map +1 -0
  225. package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js → chunk-WKY2IBOQ.js} +3 -3
  226. package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js +698 -0
  227. package/dist/cli-bundle/chunks/chunk-WOPXVEZP.js.map +1 -0
  228. package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js +1704 -0
  229. package/dist/cli-bundle/chunks/chunk-WSMOSYRD.js.map +1 -0
  230. package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js → chunk-XLTD2HN3.js} +2 -2
  231. package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js +131 -0
  232. package/dist/cli-bundle/chunks/chunk-XSJCLN2R.js.map +7 -0
  233. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +53 -0
  234. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +1 -0
  235. package/dist/cli-bundle/chunks/{chunk-BUPWJ3IJ.js → chunk-XTGLRY2Y.js} +484 -49
  236. package/dist/cli-bundle/chunks/chunk-XTGLRY2Y.js.map +7 -0
  237. package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js → chunk-YL2DJGYS.js} +7 -7
  238. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js → claim-4DBF6RVG.js} +10 -11
  239. package/dist/cli-bundle/chunks/{claim-EE4TKKCV.js.map → claim-4DBF6RVG.js.map} +1 -1
  240. package/dist/cli-bundle/chunks/claim-X2P4IB7J.js +129 -0
  241. package/dist/cli-bundle/chunks/claim-X2P4IB7J.js.map +1 -0
  242. package/dist/cli-bundle/chunks/close-3HDWDA3L.js +13 -0
  243. package/dist/cli-bundle/chunks/close-PTYFA45H.js +17 -0
  244. package/dist/cli-bundle/chunks/close-PTYFA45H.js.map +1 -0
  245. package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js +314 -0
  246. package/dist/cli-bundle/chunks/close-many-7CGIDPTJ.js.map +7 -0
  247. package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js +311 -0
  248. package/dist/cli-bundle/chunks/close-many-ERFO6LHR.js.map +1 -0
  249. package/dist/cli-bundle/chunks/comments-OONGABK5.js +100 -0
  250. package/dist/cli-bundle/chunks/comments-OONGABK5.js.map +1 -0
  251. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js → comments-QKBYCWKD.js} +10 -11
  252. package/dist/cli-bundle/chunks/{comments-AAKJQ6LW.js.map → comments-QKBYCWKD.js.map} +1 -1
  253. package/dist/cli-bundle/chunks/config-6FXCQKIF.js +1671 -0
  254. package/dist/cli-bundle/chunks/config-6FXCQKIF.js.map +1 -0
  255. package/dist/cli-bundle/chunks/{config-V3FZOKLI.js → config-U4RZ4CQB.js} +121 -10
  256. package/dist/cli-bundle/chunks/config-U4RZ4CQB.js.map +7 -0
  257. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js → context-FYYJGFWS.js} +32 -19
  258. package/dist/cli-bundle/chunks/{context-RZ5QPNJB.js.map → context-FYYJGFWS.js.map} +2 -2
  259. package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js +1461 -0
  260. package/dist/cli-bundle/chunks/context-YMJ3Z2HQ.js.map +1 -0
  261. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js +1278 -0
  262. package/dist/cli-bundle/chunks/contracts-QDB6OMLQ.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{contracts-YLMH33VU.js → contracts-RFSPGVVJ.js} +198 -162
  264. package/dist/cli-bundle/chunks/contracts-RFSPGVVJ.js.map +7 -0
  265. package/dist/cli-bundle/chunks/create-I5L4EYYZ.js +31 -0
  266. package/dist/cli-bundle/chunks/create-I5L4EYYZ.js.map +1 -0
  267. package/dist/cli-bundle/chunks/create-JTZNCTQC.js +27 -0
  268. package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js +55 -0
  269. package/dist/cli-bundle/chunks/delete-7HPGI4GZ.js.map +1 -0
  270. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js → delete-VXUPH5RS.js} +7 -8
  271. package/dist/cli-bundle/chunks/{delete-RHCTEORS.js.map → delete-VXUPH5RS.js.map} +1 -1
  272. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js → deps-JSRRWC3Z.js} +7 -8
  273. package/dist/cli-bundle/chunks/{deps-MZYCMLAO.js.map → deps-JSRRWC3Z.js.map} +1 -1
  274. package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js +225 -0
  275. package/dist/cli-bundle/chunks/deps-SCZIFK2Z.js.map +1 -0
  276. package/dist/cli-bundle/chunks/docs-GJK6K4VP.js +31 -0
  277. package/dist/cli-bundle/chunks/docs-GJK6K4VP.js.map +1 -0
  278. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js → docs-WW4N3MBM.js} +9 -10
  279. package/dist/cli-bundle/chunks/{docs-FXXUCZYU.js.map → docs-WW4N3MBM.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js → extension-J7IBMFTD.js} +4 -5
  281. package/dist/cli-bundle/chunks/extension-VDY2U33M.js +28 -0
  282. package/dist/cli-bundle/chunks/extension-VDY2U33M.js.map +1 -0
  283. package/dist/cli-bundle/chunks/files-ISZJGILQ.js +282 -0
  284. package/dist/cli-bundle/chunks/files-ISZJGILQ.js.map +1 -0
  285. package/dist/cli-bundle/chunks/{files-WVOX67PE.js → files-WKOD326U.js} +9 -10
  286. package/dist/cli-bundle/chunks/{files-WVOX67PE.js.map → files-WKOD326U.js.map} +1 -1
  287. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js +362 -0
  288. package/dist/cli-bundle/chunks/gc-JDVJ6OQ2.js.map +1 -0
  289. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js +372 -0
  290. package/dist/cli-bundle/chunks/gc-ULPVWMTN.js.map +7 -0
  291. package/dist/cli-bundle/chunks/get-RV37HT3G.js +194 -0
  292. package/dist/cli-bundle/chunks/get-RV37HT3G.js.map +1 -0
  293. package/dist/cli-bundle/chunks/{get-LTK3HOCQ.js → get-WXU6WI5P.js} +16 -17
  294. package/dist/cli-bundle/chunks/get-WXU6WI5P.js.map +7 -0
  295. package/dist/cli-bundle/chunks/{health-TCWL55KM.js → health-6L6EH4WR.js} +57 -16
  296. package/dist/cli-bundle/chunks/health-6L6EH4WR.js.map +7 -0
  297. package/dist/cli-bundle/chunks/health-LOI2HHKB.js +1271 -0
  298. package/dist/cli-bundle/chunks/health-LOI2HHKB.js.map +1 -0
  299. package/dist/cli-bundle/chunks/history-2BA3T5AE.js +20 -0
  300. package/dist/cli-bundle/chunks/history-PKN67D5O.js +24 -0
  301. package/dist/cli-bundle/chunks/history-PKN67D5O.js.map +1 -0
  302. package/dist/cli-bundle/chunks/history-redact-JBZNXHGR.js +19 -0
  303. package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js +23 -0
  304. package/dist/cli-bundle/chunks/history-redact-V4FOJGS7.js.map +1 -0
  305. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js → history-repair-HIBCBIKK.js} +12 -14
  306. package/dist/cli-bundle/chunks/{history-repair-ZWSTDRH2.js.map → history-repair-HIBCBIKK.js.map} +1 -1
  307. package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js +193 -0
  308. package/dist/cli-bundle/chunks/history-repair-SDMHR7JT.js.map +1 -0
  309. package/dist/cli-bundle/chunks/init-HIVSNX3O.js +16 -0
  310. package/dist/cli-bundle/chunks/init-P56QYWJF.js +20 -0
  311. package/dist/cli-bundle/chunks/init-P56QYWJF.js.map +1 -0
  312. package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js +44 -0
  313. package/dist/cli-bundle/chunks/learnings-GDFRG5J7.js.map +1 -0
  314. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js → learnings-MIXSESLK.js} +10 -11
  315. package/dist/cli-bundle/chunks/{learnings-NXTWE3FR.js.map → learnings-MIXSESLK.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/list-FGOWQMSM.js +24 -0
  317. package/dist/cli-bundle/chunks/list-FGOWQMSM.js.map +1 -0
  318. package/dist/cli-bundle/chunks/list-MUSQNMTD.js +20 -0
  319. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js → notes-4XVSH2AZ.js} +10 -11
  320. package/dist/cli-bundle/chunks/{notes-DFS5ZGOO.js.map → notes-4XVSH2AZ.js.map} +1 -1
  321. package/dist/cli-bundle/chunks/notes-5UK3GEH2.js +44 -0
  322. package/dist/cli-bundle/chunks/notes-5UK3GEH2.js.map +1 -0
  323. package/dist/cli-bundle/chunks/plan-DUMBV3QB.js +1171 -0
  324. package/dist/cli-bundle/chunks/plan-DUMBV3QB.js.map +1 -0
  325. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js → plan-SLMODHWX.js} +13 -14
  326. package/dist/cli-bundle/chunks/{plan-67AB2PLM.js.map → plan-SLMODHWX.js.map} +1 -1
  327. package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js +229 -0
  328. package/dist/cli-bundle/chunks/register-list-query-POCFZ5JW.js.map +1 -0
  329. package/dist/cli-bundle/chunks/{register-list-query-UP3VRUFS.js → register-list-query-WST76HSQ.js} +26 -26
  330. package/dist/cli-bundle/chunks/register-list-query-WST76HSQ.js.map +7 -0
  331. package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js +813 -0
  332. package/dist/cli-bundle/chunks/register-mutation-N5GSUZJV.js.map +1 -0
  333. package/dist/cli-bundle/chunks/{register-mutation-YWSBF545.js → register-mutation-OA675SOU.js} +154 -43
  334. package/dist/cli-bundle/chunks/register-mutation-OA675SOU.js.map +7 -0
  335. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js +383 -0
  336. package/dist/cli-bundle/chunks/register-operations-GNHBE5I3.js.map +1 -0
  337. package/dist/cli-bundle/chunks/{register-operations-3BDTGSDH.js → register-operations-N3PMHXH5.js} +49 -37
  338. package/dist/cli-bundle/chunks/register-operations-N3PMHXH5.js.map +7 -0
  339. package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js +242 -0
  340. package/dist/cli-bundle/chunks/register-setup-JIMPKJKV.js.map +1 -0
  341. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js → register-setup-ZHJI2DI3.js} +18 -19
  342. package/dist/cli-bundle/chunks/{register-setup-V56GDRUS.js.map → register-setup-ZHJI2DI3.js.map} +2 -2
  343. package/dist/cli-bundle/chunks/restore-D4RGNX33.js +17 -0
  344. package/dist/cli-bundle/chunks/restore-PBL6T5TW.js +21 -0
  345. package/dist/cli-bundle/chunks/restore-PBL6T5TW.js.map +1 -0
  346. package/dist/cli-bundle/chunks/schema-2NOO6NGB.js +780 -0
  347. package/dist/cli-bundle/chunks/schema-2NOO6NGB.js.map +7 -0
  348. package/dist/cli-bundle/chunks/schema-EBI4NLUO.js +770 -0
  349. package/dist/cli-bundle/chunks/schema-EBI4NLUO.js.map +1 -0
  350. package/dist/cli-bundle/chunks/search-JPUQTVCY.js +1127 -0
  351. package/dist/cli-bundle/chunks/search-JPUQTVCY.js.map +1 -0
  352. package/dist/cli-bundle/chunks/{search-HENBL456.js → search-OA6JX27A.js} +25 -16
  353. package/dist/cli-bundle/chunks/search-OA6JX27A.js.map +7 -0
  354. package/dist/cli-bundle/chunks/stats-CV54BAWY.js +202 -0
  355. package/dist/cli-bundle/chunks/stats-CV54BAWY.js.map +1 -0
  356. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js +212 -0
  357. package/dist/cli-bundle/chunks/stats-XYB6KTFG.js.map +7 -0
  358. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js +251 -0
  359. package/dist/cli-bundle/chunks/telemetry-LMJ7PFUO.js.map +7 -0
  360. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js +248 -0
  361. package/dist/cli-bundle/chunks/telemetry-NCMEPJNR.js.map +1 -0
  362. package/dist/cli-bundle/chunks/test-MXX3E5JL.js +31 -0
  363. package/dist/cli-bundle/chunks/test-WBROAJIE.js +35 -0
  364. package/dist/cli-bundle/chunks/test-WBROAJIE.js.map +1 -0
  365. package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js +328 -0
  366. package/dist/cli-bundle/chunks/test-all-N6NSRDTV.js.map +1 -0
  367. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js → test-all-NTOZ7C3M.js} +13 -14
  368. package/dist/cli-bundle/chunks/{test-all-G2AZOHXI.js.map → test-all-NTOZ7C3M.js.map} +1 -1
  369. package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js +929 -0
  370. package/dist/cli-bundle/chunks/test-runs-V6A7LPWZ.js.map +1 -0
  371. package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js → test-runs-WMVTQU3Y.js} +5 -5
  372. package/dist/cli-bundle/chunks/update-OSV3NAQB.js +25 -0
  373. package/dist/cli-bundle/chunks/update-OSV3NAQB.js.map +1 -0
  374. package/dist/cli-bundle/chunks/update-YRXSUGYQ.js +21 -0
  375. package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js +605 -0
  376. package/dist/cli-bundle/chunks/update-many-EM6OXYGO.js.map +1 -0
  377. package/dist/cli-bundle/chunks/{update-many-46HRSP2Q.js → update-many-KGGEYABR.js} +78 -146
  378. package/dist/cli-bundle/chunks/update-many-KGGEYABR.js.map +7 -0
  379. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js → upgrade-BLI7XBAJ.js} +5 -7
  380. package/dist/cli-bundle/chunks/{upgrade-H5HHM5UV.js.map → upgrade-BLI7XBAJ.js.map} +1 -1
  381. package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js +266 -0
  382. package/dist/cli-bundle/chunks/upgrade-LXPOQKFV.js.map +1 -0
  383. package/dist/cli-bundle/chunks/{validate-TMCVKIGZ.js → validate-AGOAUOVW.js} +61 -48
  384. package/dist/cli-bundle/chunks/validate-AGOAUOVW.js.map +7 -0
  385. package/dist/cli-bundle/chunks/validate-L5J6A7YO.js +1120 -0
  386. package/dist/cli-bundle/chunks/validate-L5J6A7YO.js.map +1 -0
  387. package/dist/cli-bundle/main.js +534 -1505
  388. package/dist/cli-bundle/main.js.map +4 -4
  389. package/dist/core/checkpoint/mutation-checkpoint.d.ts +44 -0
  390. package/dist/core/checkpoint/mutation-checkpoint.js +119 -0
  391. package/dist/core/checkpoint/mutation-checkpoint.js.map +1 -0
  392. package/dist/core/config/positional-value.js +4 -2
  393. package/dist/core/config/positional-value.js.map +1 -1
  394. package/dist/core/diagnostics/remediation.d.ts +73 -0
  395. package/dist/core/diagnostics/remediation.js +328 -0
  396. package/dist/core/diagnostics/remediation.js.map +1 -0
  397. package/dist/core/extensions/extension-hook-runtime.js +9 -2
  398. package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
  399. package/dist/core/extensions/extension-types.d.ts +60 -4
  400. package/dist/core/extensions/extension-types.js +2 -2
  401. package/dist/core/extensions/extension-types.js.map +1 -1
  402. package/dist/core/extensions/index.d.ts +5 -1
  403. package/dist/core/extensions/index.js +61 -2
  404. package/dist/core/extensions/index.js.map +1 -1
  405. package/dist/core/extensions/item-fields.d.ts +5 -1
  406. package/dist/core/extensions/item-fields.js +126 -4
  407. package/dist/core/extensions/item-fields.js.map +1 -1
  408. package/dist/core/extensions/loader.js +283 -8
  409. package/dist/core/extensions/loader.js.map +1 -1
  410. package/dist/core/history/history-diff.d.ts +47 -0
  411. package/dist/core/history/history-diff.js +152 -0
  412. package/dist/core/history/history-diff.js.map +1 -0
  413. package/dist/core/history/history-storage-stats.d.ts +31 -0
  414. package/dist/core/history/history-storage-stats.js +101 -0
  415. package/dist/core/history/history-storage-stats.js.map +1 -0
  416. package/dist/core/item/item-format.d.ts +3 -2
  417. package/dist/core/item/item-format.js +15 -10
  418. package/dist/core/item/item-format.js.map +1 -1
  419. package/dist/core/item/status-filter.d.ts +29 -0
  420. package/dist/core/item/status-filter.js +97 -0
  421. package/dist/core/item/status-filter.js.map +1 -0
  422. package/dist/core/item/type-registry.js +4 -2
  423. package/dist/core/item/type-registry.js.map +1 -1
  424. package/dist/core/lock/lock-gc.d.ts +46 -0
  425. package/dist/core/lock/lock-gc.js +194 -0
  426. package/dist/core/lock/lock-gc.js.map +1 -0
  427. package/dist/core/output/output.js +17 -5
  428. package/dist/core/output/output.js.map +1 -1
  429. package/dist/core/schema/item-types-file.d.ts +15 -0
  430. package/dist/core/schema/item-types-file.js +27 -2
  431. package/dist/core/schema/item-types-file.js.map +1 -1
  432. package/dist/core/schema/runtime-field-filters.js +4 -3
  433. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  434. package/dist/core/schema/runtime-field-values.d.ts +1 -1
  435. package/dist/core/schema/runtime-field-values.js +10 -4
  436. package/dist/core/schema/runtime-field-values.js.map +1 -1
  437. package/dist/core/schema/runtime-schema.js +75 -2
  438. package/dist/core/schema/runtime-schema.js.map +1 -1
  439. package/dist/core/schema/status-defs-file.d.ts +113 -0
  440. package/dist/core/schema/status-defs-file.js +260 -0
  441. package/dist/core/schema/status-defs-file.js.map +1 -0
  442. package/dist/core/schema/type-workflows.d.ts +64 -0
  443. package/dist/core/schema/type-workflows.js +98 -0
  444. package/dist/core/schema/type-workflows.js.map +1 -0
  445. package/dist/core/search/cache.d.ts +3 -1
  446. package/dist/core/search/cache.js +104 -28
  447. package/dist/core/search/cache.js.map +1 -1
  448. package/dist/core/search/http-client.d.ts +2 -2
  449. package/dist/core/search/http-client.js +2 -2
  450. package/dist/core/search/http-client.js.map +1 -1
  451. package/dist/core/search/vector-stores.d.ts +1 -0
  452. package/dist/core/search/vector-stores.js +64 -14
  453. package/dist/core/search/vector-stores.js.map +1 -1
  454. package/dist/core/search/vectorization-metadata.d.ts +13 -0
  455. package/dist/core/search/vectorization-metadata.js +65 -0
  456. package/dist/core/search/vectorization-metadata.js.map +1 -0
  457. package/dist/core/shared/serial-queue.d.ts +12 -0
  458. package/dist/core/shared/serial-queue.js +43 -0
  459. package/dist/core/shared/serial-queue.js.map +1 -0
  460. package/dist/core/shared/serialization.d.ts +1 -0
  461. package/dist/core/shared/serialization.js +86 -2
  462. package/dist/core/shared/serialization.js.map +1 -1
  463. package/dist/core/store/front-matter-cache.js +14 -5
  464. package/dist/core/store/front-matter-cache.js.map +1 -1
  465. package/dist/core/store/item-store.d.ts +2 -0
  466. package/dist/core/store/item-store.js +61 -6
  467. package/dist/core/store/item-store.js.map +1 -1
  468. package/dist/core/store/settings-validator.js +18 -2
  469. package/dist/core/store/settings-validator.js.map +1 -1
  470. package/dist/core/store/settings.d.ts +19 -1
  471. package/dist/core/store/settings.js +130 -10
  472. package/dist/core/store/settings.js.map +1 -1
  473. package/dist/core/telemetry/consent.js +3 -3
  474. package/dist/core/telemetry/consent.js.map +1 -1
  475. package/dist/core/telemetry/observability.js +5 -4
  476. package/dist/core/telemetry/observability.js.map +1 -1
  477. package/dist/core/telemetry/runtime.js +16 -4
  478. package/dist/core/telemetry/runtime.js.map +1 -1
  479. package/dist/mcp/server.d.ts +1 -0
  480. package/dist/mcp/server.js +372 -45
  481. package/dist/mcp/server.js.map +1 -1
  482. package/dist/sdk/cli-contracts/commander-mutation-options.js +16 -2
  483. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  484. package/dist/sdk/cli-contracts/commander-types.js +7 -2
  485. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  486. package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
  487. package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
  488. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  489. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -0
  490. package/dist/sdk/cli-contracts/tool-option-contracts.js +53 -3
  491. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  492. package/dist/sdk/cli-contracts/tool-parameter-tables.js +42 -10
  493. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  494. package/dist/sdk/cli-contracts.d.ts +42 -1
  495. package/dist/sdk/cli-contracts.js +225 -19
  496. package/dist/sdk/cli-contracts.js.map +1 -1
  497. package/dist/sdk/errors.d.ts +22 -0
  498. package/dist/sdk/errors.js +46 -0
  499. package/dist/sdk/errors.js.map +1 -0
  500. package/dist/sdk/index.d.ts +2 -1
  501. package/dist/sdk/index.js +3 -2
  502. package/dist/sdk/index.js.map +1 -1
  503. package/dist/sdk/package-import-adapters.js +14 -3
  504. package/dist/sdk/package-import-adapters.js.map +1 -1
  505. package/dist/sdk/runtime.d.ts +1 -0
  506. package/dist/sdk/runtime.js +3 -2
  507. package/dist/sdk/runtime.js.map +1 -1
  508. package/dist/sdk/testing.d.ts +77 -0
  509. package/dist/sdk/testing.js +239 -0
  510. package/dist/sdk/testing.js.map +1 -0
  511. package/dist/types.d.ts +19 -0
  512. package/dist/types.js +3 -2
  513. package/dist/types.js.map +1 -1
  514. package/docs/AGENT_GUIDE.md +22 -3
  515. package/docs/ARCHITECTURE.md +11 -1
  516. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  517. package/docs/COMMANDS.md +118 -7
  518. package/docs/CONFIGURATION.md +57 -2
  519. package/docs/EXTENSIONS.md +125 -6
  520. package/docs/EXTENSION_AUTHOR_CONTRACTS.md +73 -0
  521. package/docs/ONBOARDING.md +165 -0
  522. package/docs/QUICKSTART.md +3 -1
  523. package/docs/README.md +12 -4
  524. package/docs/RELEASING.md +38 -3
  525. package/docs/SDK.md +273 -1
  526. package/docs/TESTING.md +36 -1
  527. package/docs/examples/policy-restricted-extension/manifest.json +1 -0
  528. package/docs/examples/starter-extension/index.js +9 -1
  529. package/docs/examples/starter-extension/manifest.json +1 -0
  530. package/package.json +16 -7
  531. package/packages/pm-beads/extensions/beads/index.js +2 -4
  532. package/packages/pm-beads/extensions/beads/index.ts +43 -33
  533. package/packages/pm-beads/extensions/beads/manifest.json +12 -1
  534. package/packages/pm-calendar/README.md +6 -0
  535. package/packages/pm-calendar/extensions/calendar/index.js +6 -1
  536. package/packages/pm-calendar/extensions/calendar/index.ts +6 -1
  537. package/packages/pm-calendar/extensions/calendar/manifest.json +6 -1
  538. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +6 -1
  539. package/packages/pm-guide-shell/README.md +4 -0
  540. package/packages/pm-guide-shell/extensions/guide-shell/index.js +22 -0
  541. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +22 -0
  542. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +6 -1
  543. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +74 -3
  544. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +84 -4
  545. package/packages/pm-lifecycle-hooks/README.md +29 -0
  546. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +18 -0
  547. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +20 -0
  548. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +9 -0
  549. package/packages/pm-lifecycle-hooks/package.json +52 -0
  550. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +13 -1
  551. package/packages/pm-search-advanced/extensions/search-advanced/index.js +69 -1
  552. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +91 -2
  553. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +13 -1
  554. package/packages/pm-templates/extensions/templates/manifest.json +6 -1
  555. package/packages/pm-todos/extensions/todos/index.js +3 -7
  556. package/packages/pm-todos/extensions/todos/index.ts +55 -42
  557. package/packages/pm-todos/extensions/todos/manifest.json +13 -1
  558. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  559. package/plugins/pm-claude/README.md +7 -4
  560. package/plugins/pm-claude/agents/pm-coordinator.md +1 -1
  561. package/plugins/pm-claude/commands/pm-init.md +1 -1
  562. package/scripts/bundle-cli.mjs +121 -17
  563. package/dist/cli-bundle/chunks/activity-OWYSUZOY.js +0 -17
  564. package/dist/cli-bundle/chunks/chunk-3M73P3G6.js.map +0 -7
  565. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js +0 -189
  566. package/dist/cli-bundle/chunks/chunk-4AEZR5EJ.js.map +0 -7
  567. package/dist/cli-bundle/chunks/chunk-5HSEP75M.js.map +0 -7
  568. package/dist/cli-bundle/chunks/chunk-6HT2F4TK.js.map +0 -7
  569. package/dist/cli-bundle/chunks/chunk-7Y53ZJIQ.js.map +0 -7
  570. package/dist/cli-bundle/chunks/chunk-BUPWJ3IJ.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js +0 -47
  572. package/dist/cli-bundle/chunks/chunk-EGUGFSNX.js.map +0 -7
  573. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js +0 -56
  574. package/dist/cli-bundle/chunks/chunk-FM26RGSU.js.map +0 -7
  575. package/dist/cli-bundle/chunks/chunk-FQE6XZDB.js.map +0 -7
  576. package/dist/cli-bundle/chunks/chunk-GN7IJPCD.js.map +0 -7
  577. package/dist/cli-bundle/chunks/chunk-JTWRXG4B.js.map +0 -7
  578. package/dist/cli-bundle/chunks/chunk-JULRTHJQ.js.map +0 -7
  579. package/dist/cli-bundle/chunks/chunk-LRBOHPUE.js.map +0 -7
  580. package/dist/cli-bundle/chunks/chunk-LSXGH6NE.js.map +0 -7
  581. package/dist/cli-bundle/chunks/chunk-MD7K4JYF.js.map +0 -7
  582. package/dist/cli-bundle/chunks/chunk-OGZEG5TT.js.map +0 -7
  583. package/dist/cli-bundle/chunks/chunk-P53TN6IA.js.map +0 -7
  584. package/dist/cli-bundle/chunks/chunk-PXUAZUUY.js.map +0 -7
  585. package/dist/cli-bundle/chunks/chunk-U7FMKRXH.js.map +0 -7
  586. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js +0 -141
  587. package/dist/cli-bundle/chunks/chunk-VGICHR7D.js.map +0 -7
  588. package/dist/cli-bundle/chunks/chunk-WDPXDQFG.js.map +0 -7
  589. package/dist/cli-bundle/chunks/close-XY4CSAYF.js +0 -14
  590. package/dist/cli-bundle/chunks/config-V3FZOKLI.js.map +0 -7
  591. package/dist/cli-bundle/chunks/contracts-YLMH33VU.js.map +0 -7
  592. package/dist/cli-bundle/chunks/create-PZVHRIZQ.js +0 -28
  593. package/dist/cli-bundle/chunks/gc-JWNF66EC.js +0 -181
  594. package/dist/cli-bundle/chunks/gc-JWNF66EC.js.map +0 -7
  595. package/dist/cli-bundle/chunks/get-LTK3HOCQ.js.map +0 -7
  596. package/dist/cli-bundle/chunks/health-TCWL55KM.js.map +0 -7
  597. package/dist/cli-bundle/chunks/history-A2JUDXUE.js +0 -21
  598. package/dist/cli-bundle/chunks/history-redact-ED6RFCPL.js +0 -20
  599. package/dist/cli-bundle/chunks/init-M2WUB4YH.js +0 -16
  600. package/dist/cli-bundle/chunks/list-OGWQPC26.js +0 -20
  601. package/dist/cli-bundle/chunks/register-list-query-UP3VRUFS.js.map +0 -7
  602. package/dist/cli-bundle/chunks/register-mutation-YWSBF545.js.map +0 -7
  603. package/dist/cli-bundle/chunks/register-operations-3BDTGSDH.js.map +0 -7
  604. package/dist/cli-bundle/chunks/restore-MB2ISME7.js +0 -18
  605. package/dist/cli-bundle/chunks/schema-Q622KC46.js +0 -119
  606. package/dist/cli-bundle/chunks/schema-Q622KC46.js.map +0 -7
  607. package/dist/cli-bundle/chunks/search-HENBL456.js.map +0 -7
  608. package/dist/cli-bundle/chunks/stats-N6H3YP2F.js +0 -124
  609. package/dist/cli-bundle/chunks/stats-N6H3YP2F.js.map +0 -7
  610. package/dist/cli-bundle/chunks/test-VNBDRJ4Z.js +0 -32
  611. package/dist/cli-bundle/chunks/update-H6SCWNMA.js +0 -22
  612. package/dist/cli-bundle/chunks/update-many-46HRSP2Q.js.map +0 -7
  613. package/dist/cli-bundle/chunks/validate-TMCVKIGZ.js.map +0 -7
  614. /package/dist/cli-bundle/chunks/{activity-OWYSUZOY.js.map → activity-CVXTCHYY.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{aggregate-ADUOSFRO.js.map → aggregate-VNAHUNNF.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-D7AOMPRH.js.map → chunk-BQHUILZS.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-G57E5D7T.js.map → chunk-GU2ZJ2VV.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-AKOOMO3T.js.map → chunk-KAG77BY3.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{chunk-KBQY3YG5.js.map → chunk-KJ33AOCY.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-WJ2NAC37.js.map → chunk-N7ACFE26.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-PVNQLCIS.js.map → chunk-QO7EBBOM.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-A7E7PUVX.js.map → chunk-R6UFP2GE.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-CEFIVZPG.js.map → chunk-T3LC5LKB.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-JFWUHHS2.js.map → chunk-UM2GBHS4.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{chunk-SEXQN4KL.js.map → chunk-WKY2IBOQ.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{chunk-NGN7UV5K.js.map → chunk-XLTD2HN3.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{chunk-L2FXEKDB.js.map → chunk-YL2DJGYS.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{close-XY4CSAYF.js.map → close-3HDWDA3L.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{create-PZVHRIZQ.js.map → create-JTZNCTQC.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{extension-B4WL7BQU.js.map → extension-J7IBMFTD.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{history-A2JUDXUE.js.map → history-2BA3T5AE.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{history-redact-ED6RFCPL.js.map → history-redact-JBZNXHGR.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{init-M2WUB4YH.js.map → init-HIVSNX3O.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{list-OGWQPC26.js.map → list-MUSQNMTD.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{restore-MB2ISME7.js.map → restore-D4RGNX33.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{test-VNBDRJ4Z.js.map → test-MXX3E5JL.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{test-runs-GX5HTPSF.js.map → test-runs-WMVTQU3Y.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{update-H6SCWNMA.js.map → update-YRXSUGYQ.js.map} +0 -0
@@ -78,11 +78,54 @@ function isPathWithinDirectory(directory, targetPath) {
78
78
  return !relative.startsWith("..") && !path2.isAbsolute(relative);
79
79
  }
80
80
 
81
+ // dist/core/packages/root.js
82
+ import fs2 from "node:fs";
83
+ import path3 from "node:path";
84
+ import { fileURLToPath } from "node:url";
85
+ !(function() {
86
+ try {
87
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
88
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "20b7827b-6f96-518c-8df3-b699d41dec88");
89
+ } catch (e2) {
90
+ }
91
+ })();
92
+ var PM_CLI_PACKAGE_NAME = "@unbrained/pm-cli";
93
+ function packageJsonNamesPmCli(packageJsonPath) {
94
+ try {
95
+ const parsed = JSON.parse(fs2.readFileSync(packageJsonPath, "utf8"));
96
+ return parsed.name === PM_CLI_PACKAGE_NAME;
97
+ } catch {
98
+ return false;
99
+ }
100
+ }
101
+ function findPmPackageRootFromPath(startPath) {
102
+ let current = fs2.existsSync(startPath) && fs2.statSync(startPath).isDirectory() ? path3.resolve(startPath) : path3.dirname(path3.resolve(startPath));
103
+ while (true) {
104
+ const packageJsonPath = path3.join(current, "package.json");
105
+ if (fs2.existsSync(packageJsonPath) && packageJsonNamesPmCli(packageJsonPath)) {
106
+ return current;
107
+ }
108
+ const parent = path3.dirname(current);
109
+ if (parent === current) {
110
+ return void 0;
111
+ }
112
+ current = parent;
113
+ }
114
+ }
115
+ function resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments = []) {
116
+ const modulePath = fileURLToPath(metaUrl);
117
+ const discovered = findPmPackageRootFromPath(modulePath);
118
+ if (discovered) {
119
+ return discovered;
120
+ }
121
+ return path3.resolve(path3.dirname(modulePath), ...fallbackRelativeSegments);
122
+ }
123
+
81
124
  // dist/core/extensions/extension-types.js
82
125
  !(function() {
83
126
  try {
84
127
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
85
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "75f1bede-2849-550d-8e31-0492def7d786");
128
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "80b2d723-e806-55be-a67f-bdb9fa8ad3ed");
86
129
  } catch (e2) {
87
130
  }
88
131
  })();
@@ -541,7 +584,7 @@ function resolveTelemetryErrorCategory(errorCode) {
541
584
  // dist/core/store/paths.js
542
585
  import { statSync } from "node:fs";
543
586
  import os from "node:os";
544
- import path3 from "node:path";
587
+ import path4 from "node:path";
545
588
  !(function() {
546
589
  try {
547
590
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
@@ -567,14 +610,14 @@ function pathExists2(pathValue) {
567
610
  }
568
611
  }
569
612
  function discoverPmRootFromAncestors(cwd) {
570
- let current = path3.resolve(cwd);
613
+ let current = path4.resolve(cwd);
571
614
  while (true) {
572
- const candidateRoot = path3.join(current, PM_DIRNAME);
573
- const candidateSettingsPath = path3.join(candidateRoot, SETTINGS_FILENAME);
615
+ const candidateRoot = path4.join(current, PM_DIRNAME);
616
+ const candidateSettingsPath = path4.join(candidateRoot, SETTINGS_FILENAME);
574
617
  if (pathExists2(candidateSettingsPath)) {
575
618
  return candidateRoot;
576
619
  }
577
- const parent = path3.dirname(current);
620
+ const parent = path4.dirname(current);
578
621
  if (parent === current) {
579
622
  return void 0;
580
623
  }
@@ -585,22 +628,22 @@ function resolvePmRoot(cwd, cliPath) {
585
628
  const envPath = process.env.PM_PATH;
586
629
  const explicitPath = cliPath?.trim() || envPath?.trim();
587
630
  if (explicitPath) {
588
- return path3.resolve(cwd, explicitPath);
631
+ return path4.resolve(cwd, explicitPath);
589
632
  }
590
633
  const discoveredRoot = discoverPmRootFromAncestors(cwd);
591
634
  if (discoveredRoot) {
592
635
  return discoveredRoot;
593
636
  }
594
637
  const selected = PM_DIRNAME;
595
- return path3.resolve(cwd, selected);
638
+ return path4.resolve(cwd, selected);
596
639
  }
597
640
  function resolveGlobalPmRoot(cwd) {
598
641
  const envPath = process.env.PM_GLOBAL_PATH?.trim();
599
- const selected = envPath && envPath.length > 0 ? envPath : path3.join(os.homedir(), ".pm-cli");
600
- return path3.resolve(cwd, selected);
642
+ const selected = envPath && envPath.length > 0 ? envPath : path4.join(os.homedir(), ".pm-cli");
643
+ return path4.resolve(cwd, selected);
601
644
  }
602
645
  function getSettingsPath(pmRoot) {
603
- return path3.join(pmRoot, SETTINGS_FILENAME);
646
+ return path4.join(pmRoot, SETTINGS_FILENAME);
604
647
  }
605
648
  function deriveDefaultTypeFolder(type) {
606
649
  const normalized = type.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
@@ -611,50 +654,50 @@ function deriveDefaultTypeFolder(type) {
611
654
  }
612
655
  function getTypeDirPath(pmRoot, type, typeToFolder = TYPE_TO_FOLDER) {
613
656
  const folder = typeToFolder[type] ?? deriveDefaultTypeFolder(type);
614
- return path3.join(pmRoot, folder);
657
+ return path4.join(pmRoot, folder);
615
658
  }
616
659
  function getItemPath(pmRoot, type, id, itemFormat = "toon", typeToFolder = TYPE_TO_FOLDER) {
617
- return path3.join(getTypeDirPath(pmRoot, type, typeToFolder), `${id}${ITEM_FILE_EXTENSION_BY_FORMAT[itemFormat]}`);
660
+ return path4.join(getTypeDirPath(pmRoot, type, typeToFolder), `${id}${ITEM_FILE_EXTENSION_BY_FORMAT[itemFormat]}`);
618
661
  }
619
662
  function getItemFormatFromPath(itemPath) {
620
- const extension = path3.extname(itemPath).toLowerCase();
663
+ const extension = path4.extname(itemPath).toLowerCase();
621
664
  return ITEM_FORMAT_BY_EXTENSION[extension] ?? null;
622
665
  }
623
666
  function getHistoryPath(pmRoot, id) {
624
- return path3.join(pmRoot, "history", `${id}.jsonl`);
667
+ return path4.join(pmRoot, "history", `${id}.jsonl`);
625
668
  }
626
669
  function getLockPath(pmRoot, id) {
627
- return path3.join(pmRoot, "locks", `${id}.lock`);
670
+ return path4.join(pmRoot, "locks", `${id}.lock`);
628
671
  }
629
672
  function getRuntimePath(pmRoot) {
630
- return path3.join(pmRoot, "runtime");
673
+ return path4.join(pmRoot, "runtime");
631
674
  }
632
675
  function getTestRunsPath(pmRoot) {
633
- return path3.join(getRuntimePath(pmRoot), "test-runs");
676
+ return path4.join(getRuntimePath(pmRoot), "test-runs");
634
677
  }
635
678
  function getTestRunsRecordsPath(pmRoot) {
636
- return path3.join(getTestRunsPath(pmRoot), "runs");
679
+ return path4.join(getTestRunsPath(pmRoot), "runs");
637
680
  }
638
681
  function getTestRunRecordPath(pmRoot, runId) {
639
- return path3.join(getTestRunsRecordsPath(pmRoot), `${runId}.json`);
682
+ return path4.join(getTestRunsRecordsPath(pmRoot), `${runId}.json`);
640
683
  }
641
684
  function getTestRunsStdoutPath(pmRoot) {
642
- return path3.join(getTestRunsPath(pmRoot), "stdout");
685
+ return path4.join(getTestRunsPath(pmRoot), "stdout");
643
686
  }
644
687
  function getTestRunsStderrPath(pmRoot) {
645
- return path3.join(getTestRunsPath(pmRoot), "stderr");
688
+ return path4.join(getTestRunsPath(pmRoot), "stderr");
646
689
  }
647
690
  function getTestRunStdoutPath(pmRoot, runId) {
648
- return path3.join(getTestRunsStdoutPath(pmRoot), `${runId}.log`);
691
+ return path4.join(getTestRunsStdoutPath(pmRoot), `${runId}.log`);
649
692
  }
650
693
  function getTestRunStderrPath(pmRoot, runId) {
651
- return path3.join(getTestRunsStderrPath(pmRoot), `${runId}.log`);
694
+ return path4.join(getTestRunsStderrPath(pmRoot), `${runId}.log`);
652
695
  }
653
696
  function getTestRunsResultsPath(pmRoot) {
654
- return path3.join(getTestRunsPath(pmRoot), "results");
697
+ return path4.join(getTestRunsPath(pmRoot), "results");
655
698
  }
656
699
  function getTestRunResultPath(pmRoot, runId) {
657
- return path3.join(getTestRunsResultsPath(pmRoot), `${runId}.json`);
700
+ return path4.join(getTestRunsResultsPath(pmRoot), `${runId}.json`);
658
701
  }
659
702
 
660
703
  // dist/core/shared/primitives.js
@@ -858,6 +901,63 @@ function parseLegacyExtensionCapabilityAliasWarning(warning) {
858
901
  return parsed;
859
902
  }
860
903
 
904
+ // dist/core/extensions/extension-registries.js
905
+ !(function() {
906
+ try {
907
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
908
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8789ac45-d04d-5d1b-984a-cf5159fc01ba");
909
+ } catch (e2) {
910
+ }
911
+ })();
912
+ function createEmptyExtensionHookRegistry() {
913
+ return {
914
+ beforeCommand: [],
915
+ afterCommand: [],
916
+ onWrite: [],
917
+ onRead: [],
918
+ onIndex: []
919
+ };
920
+ }
921
+ function createEmptyExtensionCommandRegistry() {
922
+ return {
923
+ overrides: [],
924
+ handlers: []
925
+ };
926
+ }
927
+ function createEmptyExtensionParserRegistry() {
928
+ return {
929
+ overrides: []
930
+ };
931
+ }
932
+ function createEmptyExtensionPreflightRegistry() {
933
+ return {
934
+ overrides: []
935
+ };
936
+ }
937
+ function createEmptyExtensionServiceRegistry() {
938
+ return {
939
+ overrides: []
940
+ };
941
+ }
942
+ function createEmptyExtensionRendererRegistry() {
943
+ return {
944
+ overrides: []
945
+ };
946
+ }
947
+ function createEmptyExtensionRegistrationRegistry() {
948
+ return {
949
+ commands: [],
950
+ flags: [],
951
+ item_fields: [],
952
+ item_types: [],
953
+ migrations: [],
954
+ importers: [],
955
+ exporters: [],
956
+ search_providers: [],
957
+ vector_store_adapters: []
958
+ };
959
+ }
960
+
861
961
  // dist/core/extensions/extension-runtime-helpers.js
862
962
  !(function() {
863
963
  try {
@@ -891,7 +991,7 @@ function cloneContextSnapshot(value) {
891
991
  !(function() {
892
992
  try {
893
993
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
894
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "015da859-473a-5b98-b534-a4edbfae0dd7");
994
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0911739b-401c-5c7a-9073-c44e67d1bc39");
895
995
  } catch (e2) {
896
996
  }
897
997
  })();
@@ -1255,6 +1355,13 @@ function runRendererOverride(renderers, context) {
1255
1355
  pm_root: rendererPmRoot,
1256
1356
  result: cloneContextSnapshot(context.result)
1257
1357
  });
1358
+ if (rendered === null || rendered === void 0) {
1359
+ return {
1360
+ overridden: false,
1361
+ rendered: null,
1362
+ warnings: []
1363
+ };
1364
+ }
1258
1365
  if (typeof rendered !== "string") {
1259
1366
  return {
1260
1367
  overridden: false,
@@ -1277,8 +1384,8 @@ function runRendererOverride(renderers, context) {
1277
1384
  }
1278
1385
 
1279
1386
  // dist/core/extensions/loader.js
1280
- import fs2 from "node:fs/promises";
1281
- import path4 from "node:path";
1387
+ import fs3 from "node:fs/promises";
1388
+ import path5 from "node:path";
1282
1389
  import { pathToFileURL } from "node:url";
1283
1390
 
1284
1391
  // dist/core/extensions/extension-policy.js
@@ -1750,78 +1857,53 @@ function evaluateExtensionPolicyForRegistration(policy, extension, surface, meth
1750
1857
  };
1751
1858
  }
1752
1859
 
1753
- // dist/core/extensions/extension-registries.js
1754
- !(function() {
1755
- try {
1756
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1757
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8789ac45-d04d-5d1b-984a-cf5159fc01ba");
1758
- } catch (e2) {
1759
- }
1760
- })();
1761
- function createEmptyExtensionHookRegistry() {
1762
- return {
1763
- beforeCommand: [],
1764
- afterCommand: [],
1765
- onWrite: [],
1766
- onRead: [],
1767
- onIndex: []
1768
- };
1769
- }
1770
- function createEmptyExtensionCommandRegistry() {
1771
- return {
1772
- overrides: [],
1773
- handlers: []
1774
- };
1775
- }
1776
- function createEmptyExtensionParserRegistry() {
1777
- return {
1778
- overrides: []
1779
- };
1780
- }
1781
- function createEmptyExtensionPreflightRegistry() {
1782
- return {
1783
- overrides: []
1784
- };
1785
- }
1786
- function createEmptyExtensionServiceRegistry() {
1787
- return {
1788
- overrides: []
1789
- };
1790
- }
1791
- function createEmptyExtensionRendererRegistry() {
1792
- return {
1793
- overrides: []
1794
- };
1795
- }
1796
- function createEmptyExtensionRegistrationRegistry() {
1797
- return {
1798
- commands: [],
1799
- flags: [],
1800
- item_fields: [],
1801
- item_types: [],
1802
- migrations: [],
1803
- importers: [],
1804
- exporters: [],
1805
- search_providers: [],
1806
- vector_store_adapters: []
1807
- };
1808
- }
1809
-
1810
1860
  // dist/core/extensions/loader.js
1811
1861
  !(function() {
1812
1862
  try {
1813
1863
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1814
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "4fba8687-0797-5479-afc8-12f1a2e5a954");
1864
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c1d2f70f-a61e-585b-bfee-5401b41545f8");
1815
1865
  } catch (e2) {
1816
1866
  }
1817
1867
  })();
1818
1868
  var DEFAULT_EXTENSION_PRIORITY = 100;
1869
+ var currentPmCliVersionPromise = null;
1819
1870
  var DEFAULT_EXTENSION_POLICY = Object.freeze(createDefaultExtensionGovernancePolicy());
1820
1871
  var extensionReloadEpoch = 0;
1821
1872
  function nextExtensionReloadToken(seed = Date.now()) {
1822
1873
  extensionReloadEpoch += 1;
1823
1874
  return `${extensionReloadEpoch}-${seed}`;
1824
1875
  }
1876
+ function parseOptionalManifestString(candidate, field) {
1877
+ const value = candidate[field];
1878
+ if (value === void 0 || value === null) {
1879
+ return void 0;
1880
+ }
1881
+ if (typeof value !== "string" || value.trim().length === 0) {
1882
+ return null;
1883
+ }
1884
+ return value.trim();
1885
+ }
1886
+ function parseManifestEngines(value) {
1887
+ if (value === void 0 || value === null) {
1888
+ return void 0;
1889
+ }
1890
+ const enginesRecord = asRecordLoose(value);
1891
+ if (!enginesRecord) {
1892
+ return null;
1893
+ }
1894
+ const engines = {};
1895
+ for (const key of Object.keys(enginesRecord).sort((left, right) => left.localeCompare(right))) {
1896
+ if (key.trim().length === 0) {
1897
+ return null;
1898
+ }
1899
+ const engineValue = enginesRecord[key];
1900
+ if (typeof engineValue !== "string" || engineValue.trim().length === 0) {
1901
+ return null;
1902
+ }
1903
+ engines[key.trim()] = engineValue.trim();
1904
+ }
1905
+ return Object.keys(engines).length > 0 ? engines : void 0;
1906
+ }
1825
1907
  function parseManifest(raw) {
1826
1908
  if (typeof raw !== "object" || raw === null) {
1827
1909
  return null;
@@ -1850,6 +1932,18 @@ function parseManifest(raw) {
1850
1932
  }
1851
1933
  manifestVersion = candidate.manifest_version;
1852
1934
  }
1935
+ const pmMinVersion = parseOptionalManifestString(candidate, "pm_min_version");
1936
+ if (pmMinVersion === null) {
1937
+ return null;
1938
+ }
1939
+ const pmMaxVersion = parseOptionalManifestString(candidate, "pm_max_version");
1940
+ if (pmMaxVersion === null) {
1941
+ return null;
1942
+ }
1943
+ const engines = parseManifestEngines(candidate.engines);
1944
+ if (engines === null) {
1945
+ return null;
1946
+ }
1853
1947
  let trusted;
1854
1948
  if ("trusted" in candidate && candidate.trusted !== void 0 && candidate.trusted !== null) {
1855
1949
  if (typeof candidate.trusted !== "boolean") {
@@ -1931,16 +2025,41 @@ function parseManifest(raw) {
1931
2025
  capabilities = normalizedCapabilities.capabilities;
1932
2026
  legacyCapabilityAliases = normalizedCapabilities.legacy_aliases;
1933
2027
  }
2028
+ let activation;
2029
+ if ("activation" in candidate && candidate.activation !== void 0 && candidate.activation !== null) {
2030
+ const activationRecord = asRecordLoose(candidate.activation);
2031
+ if (!activationRecord) {
2032
+ return null;
2033
+ }
2034
+ const rawCommands = activationRecord.commands;
2035
+ if (rawCommands !== void 0 && rawCommands !== null) {
2036
+ if (!Array.isArray(rawCommands) || rawCommands.some((value) => typeof value !== "string")) {
2037
+ return null;
2038
+ }
2039
+ const commands = [
2040
+ ...new Set(rawCommands.map((value) => normalizeCommandName(value)).filter((value) => value.length > 0))
2041
+ ].sort((left, right) => left.localeCompare(right));
2042
+ if (commands.length > 0) {
2043
+ activation = {
2044
+ commands
2045
+ };
2046
+ }
2047
+ }
2048
+ }
1934
2049
  return {
1935
2050
  name: candidate.name.trim(),
1936
2051
  version: candidate.version.trim(),
1937
2052
  entry: candidate.entry.trim(),
1938
2053
  priority,
1939
2054
  manifest_version: manifestVersion,
2055
+ pm_min_version: pmMinVersion,
2056
+ pm_max_version: pmMaxVersion,
2057
+ engines,
1940
2058
  trusted,
1941
2059
  provenance,
1942
2060
  sandbox_profile: sandboxProfile,
1943
2061
  permissions,
2062
+ activation,
1944
2063
  capabilities,
1945
2064
  legacy_capability_aliases: legacyCapabilityAliases.length > 0 ? legacyCapabilityAliases : void 0
1946
2065
  };
@@ -1955,18 +2074,18 @@ function shouldEnable(name, enabled, disabled) {
1955
2074
  return enabled.has(name);
1956
2075
  }
1957
2076
  async function isCanonicalPathWithinDirectory(directory, targetPath) {
1958
- const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs2.realpath(directory), fs2.realpath(targetPath)]);
2077
+ const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs3.realpath(directory), fs3.realpath(targetPath)]);
1959
2078
  return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);
1960
2079
  }
1961
2080
  function resolveExtensionRoots(pmRoot, cwd = process.cwd()) {
1962
2081
  return {
1963
- global: path4.join(resolveGlobalPmRoot(cwd), "extensions"),
1964
- project: path4.join(pmRoot, "extensions")
2082
+ global: path5.join(resolveGlobalPmRoot(cwd), "extensions"),
2083
+ project: path5.join(pmRoot, "extensions")
1965
2084
  };
1966
2085
  }
1967
2086
  async function listExtensionDirectories(extensionsRoot) {
1968
2087
  try {
1969
- const entries = await fs2.readdir(extensionsRoot, { withFileTypes: true });
2088
+ const entries = await fs3.readdir(extensionsRoot, { withFileTypes: true });
1970
2089
  return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort((a, b) => a.localeCompare(b));
1971
2090
  } catch {
1972
2091
  return [];
@@ -1983,11 +2102,17 @@ function summarizeCandidate(candidate) {
1983
2102
  priority: candidate.manifest.priority,
1984
2103
  entry_path: candidate.entry_path,
1985
2104
  manifest_version: candidate.manifest.manifest_version,
2105
+ pm_min_version: candidate.manifest.pm_min_version,
2106
+ pm_max_version: candidate.manifest.pm_max_version,
2107
+ engines: candidate.manifest.engines,
1986
2108
  trusted: candidate.manifest.trusted,
1987
2109
  provenance: candidate.manifest.provenance,
1988
2110
  sandbox_profile: candidate.manifest.sandbox_profile,
1989
2111
  permissions: candidate.manifest.permissions,
1990
- capabilities: [...candidate.manifest.capabilities]
2112
+ capabilities: [...candidate.manifest.capabilities],
2113
+ activation: candidate.manifest.activation ? {
2114
+ commands: [...candidate.manifest.activation.commands ?? []]
2115
+ } : void 0
1991
2116
  };
1992
2117
  }
1993
2118
  function sortCandidates(candidates) {
@@ -2030,8 +2155,8 @@ async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled) {
2030
2155
  return { diagnostics, warnings, candidates };
2031
2156
  }
2032
2157
  async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled) {
2033
- const extensionDir = path4.join(extensionsRoot, directory);
2034
- const manifestPath = path4.join(extensionDir, "manifest.json");
2158
+ const extensionDir = path5.join(extensionsRoot, directory);
2159
+ const manifestPath = path5.join(extensionDir, "manifest.json");
2035
2160
  if (!await pathExists(manifestPath)) {
2036
2161
  return {
2037
2162
  diagnostic: {
@@ -2052,7 +2177,7 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
2052
2177
  }
2053
2178
  let manifest = null;
2054
2179
  try {
2055
- const parsed = JSON.parse(await fs2.readFile(manifestPath, "utf8"));
2180
+ const parsed = JSON.parse(await fs3.readFile(manifestPath, "utf8"));
2056
2181
  manifest = parseManifest(parsed);
2057
2182
  } catch {
2058
2183
  manifest = null;
@@ -2075,7 +2200,7 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
2075
2200
  candidate: null
2076
2201
  };
2077
2202
  }
2078
- const entryPath = path4.resolve(extensionDir, manifest.entry);
2203
+ const entryPath = path5.resolve(extensionDir, manifest.entry);
2079
2204
  const entryWithinDirectoryByPath = isPathWithinDirectory(extensionDir, entryPath);
2080
2205
  const entryExists = entryWithinDirectoryByPath ? await pathExists(entryPath) : false;
2081
2206
  const entryWithinDirectory = entryWithinDirectoryByPath && entryExists ? await isCanonicalPathWithinDirectory(extensionDir, entryPath) : entryWithinDirectoryByPath;
@@ -2092,6 +2217,15 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
2092
2217
  } else if (!entryExists) {
2093
2218
  extensionWarnings.push(`extension_entry_missing:${layer}:${manifest.name}`);
2094
2219
  }
2220
+ const pmVersionCompatibility = await evaluatePmMinVersionCompatibility(layer, manifest);
2221
+ if (pmVersionCompatibility.warning) {
2222
+ extensionWarnings.push(pmVersionCompatibility.warning);
2223
+ }
2224
+ const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest);
2225
+ if (pmMaxVersionCompatibility.warning) {
2226
+ extensionWarnings.push(pmMaxVersionCompatibility.warning);
2227
+ }
2228
+ const extensionReady = entryWithinDirectory && entryExists && pmVersionCompatibility.allowed && pmMaxVersionCompatibility.allowed;
2095
2229
  return {
2096
2230
  diagnostic: {
2097
2231
  layer,
@@ -2103,10 +2237,10 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
2103
2237
  priority: manifest.priority,
2104
2238
  entry_path: entryPath,
2105
2239
  enabled: enabledForLoad,
2106
- status: entryWithinDirectory && entryExists ? "ok" : "warn"
2240
+ status: extensionReady ? "ok" : "warn"
2107
2241
  },
2108
2242
  warnings: extensionWarnings,
2109
- candidate: entryWithinDirectory && entryExists && enabledForLoad ? {
2243
+ candidate: extensionReady && enabledForLoad ? {
2110
2244
  layer,
2111
2245
  directory,
2112
2246
  manifest_path: manifestPath,
@@ -2188,9 +2322,120 @@ function formatUnknownError(error) {
2188
2322
  }
2189
2323
  return String(error);
2190
2324
  }
2325
+ function parseComparableVersion(value) {
2326
+ const normalized = value.trim().replace(/^>=\s*/, "").replace(/^v/i, "");
2327
+ const release = normalized.split(/[+-]/, 1)[0] ?? "";
2328
+ if (!/^\d+(?:[.-]\d+)*$/.test(release)) {
2329
+ return null;
2330
+ }
2331
+ return release.split(/[.-]/).map((part) => Number(part));
2332
+ }
2333
+ function compareComparableVersions(currentVersion, minimumVersion) {
2334
+ const currentParts = parseComparableVersion(currentVersion);
2335
+ const minimumParts = parseComparableVersion(minimumVersion);
2336
+ if (!currentParts || !minimumParts) {
2337
+ return null;
2338
+ }
2339
+ const width = Math.max(currentParts.length, minimumParts.length);
2340
+ for (let index = 0; index < width; index += 1) {
2341
+ const current = currentParts[index] ?? 0;
2342
+ const minimum = minimumParts[index] ?? 0;
2343
+ if (current > minimum) {
2344
+ return 1;
2345
+ }
2346
+ if (current < minimum) {
2347
+ return -1;
2348
+ }
2349
+ }
2350
+ return 0;
2351
+ }
2352
+ async function readCurrentPmCliVersion() {
2353
+ try {
2354
+ const packageRoot = resolvePmPackageRootFromModule(import.meta.url, ["../../.."]);
2355
+ const raw = await fs3.readFile(path5.join(packageRoot, "package.json"), "utf8");
2356
+ const parsed = JSON.parse(raw);
2357
+ return typeof parsed.version === "string" && parsed.version.trim().length > 0 ? parsed.version.trim() : null;
2358
+ } catch {
2359
+ return null;
2360
+ }
2361
+ }
2362
+ function resolveCurrentPmCliVersion() {
2363
+ currentPmCliVersionPromise ??= readCurrentPmCliVersion();
2364
+ return currentPmCliVersionPromise;
2365
+ }
2366
+ async function evaluatePmMinVersionCompatibility(layer, manifest) {
2367
+ if (typeof manifest.pm_min_version !== "string" || manifest.pm_min_version.trim().length === 0) {
2368
+ return { allowed: true };
2369
+ }
2370
+ if (!parseComparableVersion(manifest.pm_min_version)) {
2371
+ return {
2372
+ allowed: false,
2373
+ warning: `extension_pm_min_version_invalid:${layer}:${manifest.name}:required=${manifest.pm_min_version}`
2374
+ };
2375
+ }
2376
+ const currentVersion = await resolveCurrentPmCliVersion();
2377
+ if (!currentVersion) {
2378
+ return {
2379
+ allowed: true,
2380
+ warning: `extension_pm_min_version_unchecked:${layer}:${manifest.name}:required=${manifest.pm_min_version}:current=unknown`
2381
+ };
2382
+ }
2383
+ const comparison = compareComparableVersions(currentVersion, manifest.pm_min_version);
2384
+ if (comparison === null) {
2385
+ return {
2386
+ allowed: true,
2387
+ warning: `extension_pm_min_version_unchecked:${layer}:${manifest.name}:required=${manifest.pm_min_version}:current=${currentVersion}`
2388
+ };
2389
+ }
2390
+ if (comparison < 0) {
2391
+ return {
2392
+ allowed: false,
2393
+ warning: `extension_pm_min_version_unmet:${layer}:${manifest.name}:required=${manifest.pm_min_version}:current=${currentVersion}`
2394
+ };
2395
+ }
2396
+ return { allowed: true };
2397
+ }
2398
+ async function evaluatePmMaxVersionCompatibility(layer, manifest) {
2399
+ if (typeof manifest.pm_max_version !== "string" || manifest.pm_max_version.trim().length === 0) {
2400
+ return { allowed: true };
2401
+ }
2402
+ if (/^[<>=~^]/.test(manifest.pm_max_version.trim())) {
2403
+ return {
2404
+ allowed: false,
2405
+ warning: `extension_pm_max_version_invalid:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}`
2406
+ };
2407
+ }
2408
+ if (!parseComparableVersion(manifest.pm_max_version)) {
2409
+ return {
2410
+ allowed: false,
2411
+ warning: `extension_pm_max_version_invalid:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}`
2412
+ };
2413
+ }
2414
+ const currentVersion = await resolveCurrentPmCliVersion();
2415
+ if (!currentVersion) {
2416
+ return {
2417
+ allowed: true,
2418
+ warning: `extension_pm_max_version_unchecked:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}:current=unknown`
2419
+ };
2420
+ }
2421
+ const comparison = compareComparableVersions(currentVersion, manifest.pm_max_version);
2422
+ if (comparison === null) {
2423
+ return {
2424
+ allowed: true,
2425
+ warning: `extension_pm_max_version_unchecked:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}:current=${currentVersion}`
2426
+ };
2427
+ }
2428
+ if (comparison > 0) {
2429
+ return {
2430
+ allowed: false,
2431
+ warning: `extension_pm_max_version_exceeded:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}:current=${currentVersion}`
2432
+ };
2433
+ }
2434
+ return { allowed: true };
2435
+ }
2191
2436
  async function fingerprintPath(pathToInspect) {
2192
2437
  try {
2193
- const stats = await fs2.stat(pathToInspect);
2438
+ const stats = await fs3.stat(pathToInspect);
2194
2439
  return `${Math.trunc(stats.mtimeMs)}-${stats.size}`;
2195
2440
  } catch {
2196
2441
  return "missing";
@@ -2599,7 +2844,15 @@ function assertExtensionCapability(extension, capability, method) {
2599
2844
  return;
2600
2845
  }
2601
2846
  if (!declared.has(capability)) {
2602
- throw new TypeError(`${method} requires capability '${capability}' in extension manifest capabilities`);
2847
+ throw createRegistrationValidationError(`${method} requires capability '${capability}' in extension manifest capabilities`, {
2848
+ method,
2849
+ registration_index: -1,
2850
+ capability,
2851
+ missing_capability: capability,
2852
+ expected_schema: `"capabilities": [..., "${capability}"]`,
2853
+ received: extension.capabilities ?? [],
2854
+ hint: `Add "${capability}" to ${extension.name} manifest capabilities, or remove the ${method} registration call.`
2855
+ });
2603
2856
  }
2604
2857
  }
2605
2858
  function createExtensionApi(extension, hooks, commands, parsers, preflight, services, renderers, registrations, activationWarnings, policy) {
@@ -2854,7 +3107,52 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
2854
3107
  definition: normalizeRegistrationRecord("registerMigration definition", definition)
2855
3108
  }, runtimeDefinition));
2856
3109
  };
2857
- const registerImporter = (name, importer) => {
3110
+ const applyImportExportCommandMetadata = (method, commandPath, options) => {
3111
+ if (options === void 0) {
3112
+ return;
3113
+ }
3114
+ if (typeof options !== "object" || options === null || Array.isArray(options)) {
3115
+ throw new TypeError(`${method} options must be an object when provided`);
3116
+ }
3117
+ assertOptionalStringField(`${method} options.action`, options.action);
3118
+ assertOptionalStringField(`${method} options.description`, options.description);
3119
+ assertOptionalStringField(`${method} options.intent`, options.intent);
3120
+ const action = resolveCommandDefinitionAction(commandPath, options.action);
3121
+ const examples = normalizeOptionalStringArrayField(`${method} options.examples`, options.examples);
3122
+ const failureHints = normalizeOptionalStringArrayField(`${method} options.failure_hints`, options.failure_hints);
3123
+ const argumentsDefinition = normalizeCommandDefinitionArguments(options.arguments);
3124
+ if (options.flags !== void 0) {
3125
+ assertExtensionCapability(extension, "schema", `${method} options.flags`);
3126
+ if (allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
3127
+ validateFlagDefinitions(options.flags);
3128
+ registrations.flags.push({
3129
+ layer: extension.layer,
3130
+ name: extension.name,
3131
+ target_command: commandPath,
3132
+ flags: normalizeRegistrationRecordList(`${method} options.flags`, options.flags)
3133
+ });
3134
+ }
3135
+ }
3136
+ const registration = {
3137
+ layer: extension.layer,
3138
+ name: extension.name,
3139
+ command: commandPath,
3140
+ action,
3141
+ examples,
3142
+ failure_hints: failureHints,
3143
+ arguments: argumentsDefinition
3144
+ };
3145
+ const description = options.description?.trim();
3146
+ if (description) {
3147
+ registration.description = description;
3148
+ }
3149
+ const intent = options.intent?.trim();
3150
+ if (intent) {
3151
+ registration.intent = intent;
3152
+ }
3153
+ registrations.commands.push(registration);
3154
+ };
3155
+ const registerImporter = (name, importer, options) => {
2858
3156
  assertExtensionCapability(extension, "importers", "registerImporter");
2859
3157
  if (!allowRegistration("importers.importer", "registerImporter", "importers")) {
2860
3158
  return;
@@ -2862,6 +3160,7 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
2862
3160
  const normalizedName = normalizeRegistrationName(assertNonEmptyString("registerImporter name", name));
2863
3161
  assertFunctionHandler("registerImporter importer", importer);
2864
3162
  const commandPath = toRegistrationCommandPath(normalizedName, "import");
3163
+ applyImportExportCommandMetadata("registerImporter", commandPath, options);
2865
3164
  registrations.importers.push({
2866
3165
  layer: extension.layer,
2867
3166
  name: extension.name,
@@ -2882,7 +3181,7 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
2882
3181
  })
2883
3182
  });
2884
3183
  };
2885
- const registerExporter = (name, exporter) => {
3184
+ const registerExporter = (name, exporter, options) => {
2886
3185
  assertExtensionCapability(extension, "importers", "registerExporter");
2887
3186
  if (!allowRegistration("importers.exporter", "registerExporter", "importers")) {
2888
3187
  return;
@@ -2890,6 +3189,7 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
2890
3189
  const normalizedName = normalizeRegistrationName(assertNonEmptyString("registerExporter name", name));
2891
3190
  assertFunctionHandler("registerExporter exporter", exporter);
2892
3191
  const commandPath = toRegistrationCommandPath(normalizedName, "export");
3192
+ applyImportExportCommandMetadata("registerExporter", commandPath, options);
2893
3193
  registrations.exporters.push({
2894
3194
  layer: extension.layer,
2895
3195
  name: extension.name,
@@ -3059,7 +3359,13 @@ function collectCommandCollisionWarnings(commands) {
3059
3359
  const handlerCommands = new Set(commands.handlers.map((entry) => entry.command));
3060
3360
  const overlapCommands = [...new Set(commands.overrides.map((entry) => entry.command))].filter((command) => handlerCommands.has(command)).sort((left, right) => left.localeCompare(right));
3061
3361
  for (const command of overlapCommands) {
3062
- warnings.push(`extension_command_override_handler_overlap:${command}`);
3362
+ const handlers = commands.handlers.filter((entry) => entry.command === command);
3363
+ const overrides = commands.overrides.filter((entry) => entry.command === command);
3364
+ for (const override of overrides) {
3365
+ for (const handler of handlers) {
3366
+ warnings.push(`extension_command_override_handler_overlap:${command}:${override.layer}:${override.name}:${handler.layer}:${handler.name}`);
3367
+ }
3368
+ }
3063
3369
  }
3064
3370
  return warnings;
3065
3371
  }
@@ -3205,7 +3511,7 @@ async function activateExtensions(loadResult) {
3205
3511
  !(function() {
3206
3512
  try {
3207
3513
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3208
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c826b268-5db1-567e-9a13-807ac5c092ff");
3514
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "81371981-f155-5140-ac02-37d83a4a4f81");
3209
3515
  } catch (e2) {
3210
3516
  }
3211
3517
  })();
@@ -3218,6 +3524,20 @@ var activeExtensionRenderers = null;
3218
3524
  var activeExtensionRegistrations = null;
3219
3525
  var activeCommandContext = null;
3220
3526
  var activeCommandResult = void 0;
3527
+ var activeAfterCommandAffectedItems = [];
3528
+ var AFTER_COMMAND_SNAPSHOT_OMITTED_FIELDS = /* @__PURE__ */ new Set([
3529
+ "body",
3530
+ "comments",
3531
+ "dependencies",
3532
+ "docs",
3533
+ "events",
3534
+ "files",
3535
+ "learnings",
3536
+ "notes",
3537
+ "reminders",
3538
+ "test_runs",
3539
+ "tests"
3540
+ ]);
3221
3541
  function setActiveExtensionHooks(hooks) {
3222
3542
  activeExtensionHooks = hooks;
3223
3543
  }
@@ -3251,6 +3571,47 @@ function setActiveCommandResult(result) {
3251
3571
  function getActiveCommandResult() {
3252
3572
  return activeCommandResult;
3253
3573
  }
3574
+ function recordAfterCommandAffectedItem(item) {
3575
+ if (!item || (activeExtensionHooks?.afterCommand?.length ?? 0) === 0) {
3576
+ return;
3577
+ }
3578
+ activeAfterCommandAffectedItems.push(item);
3579
+ }
3580
+ function projectAfterCommandItemSnapshot(metadata, changedFields) {
3581
+ if (!metadata || !metadata.id) {
3582
+ return {};
3583
+ }
3584
+ const snapshot = {
3585
+ id: metadata.id,
3586
+ type: metadata.type,
3587
+ status: metadata.status
3588
+ };
3589
+ if (!Array.isArray(changedFields)) {
3590
+ return snapshot;
3591
+ }
3592
+ const source = metadata;
3593
+ for (const field of changedFields) {
3594
+ if (typeof field !== "string") {
3595
+ continue;
3596
+ }
3597
+ const actualField = field.startsWith("unset:") ? field.slice("unset:".length) : field;
3598
+ if (actualField === "id" || actualField === "type" || actualField === "status" || AFTER_COMMAND_SNAPSHOT_OMITTED_FIELDS.has(actualField)) {
3599
+ continue;
3600
+ }
3601
+ if (Object.hasOwn(source, actualField) && source[actualField] !== void 0) {
3602
+ snapshot[actualField] = source[actualField];
3603
+ }
3604
+ }
3605
+ return snapshot;
3606
+ }
3607
+ function consumeAfterCommandAffectedItems() {
3608
+ if (activeAfterCommandAffectedItems.length === 0) {
3609
+ return void 0;
3610
+ }
3611
+ const affected = activeAfterCommandAffectedItems;
3612
+ activeAfterCommandAffectedItems = [];
3613
+ return affected;
3614
+ }
3254
3615
  function clearActiveExtensionHooks() {
3255
3616
  activeExtensionHooks = null;
3256
3617
  activeExtensionCommands = null;
@@ -3261,6 +3622,7 @@ function clearActiveExtensionHooks() {
3261
3622
  activeExtensionRegistrations = null;
3262
3623
  activeCommandContext = null;
3263
3624
  activeCommandResult = void 0;
3625
+ activeAfterCommandAffectedItems = [];
3264
3626
  }
3265
3627
  async function runActiveOnWriteHooks(context) {
3266
3628
  if (!activeExtensionHooks) {
@@ -3397,7 +3759,7 @@ function runActiveServiceOverrideSync(service, payload) {
3397
3759
  !(function() {
3398
3760
  try {
3399
3761
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3400
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d9b0e8e1-faef-5e56-a8a2-fd71d00a97ae");
3762
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "dd045bd8-53d3-51f9-8e24-1905c0ed6413");
3401
3763
  } catch (e2) {
3402
3764
  }
3403
3765
  })();
@@ -3513,11 +3875,11 @@ var CONTEXT_SECTION_VALUES = [
3513
3875
  })();
3514
3876
 
3515
3877
  // dist/core/schema/runtime-schema.js
3516
- import path5 from "node:path";
3878
+ import path6 from "node:path";
3517
3879
  !(function() {
3518
3880
  try {
3519
3881
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3520
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f8b9437a-034b-5c44-917c-72eb805b32ac");
3882
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "11167959-e632-5d72-a6d1-103f6a7d50ef");
3521
3883
  } catch (e2) {
3522
3884
  }
3523
3885
  })();
@@ -3592,6 +3954,50 @@ function normalizeRuntimeWorkflow(workflow) {
3592
3954
  canceled_status: normalizeStatusId(workflow?.canceled_status)
3593
3955
  };
3594
3956
  }
3957
+ function normalizeTypeWorkflowDefinitions(workflows) {
3958
+ if (!Array.isArray(workflows) || workflows.length === 0) {
3959
+ return void 0;
3960
+ }
3961
+ const byTypeKey = /* @__PURE__ */ new Map();
3962
+ for (const entry of workflows) {
3963
+ const rawType = typeof entry?.type === "string" ? entry.type.trim() : "";
3964
+ if (rawType.length === 0) {
3965
+ continue;
3966
+ }
3967
+ if (!Array.isArray(entry?.allowed_transitions)) {
3968
+ continue;
3969
+ }
3970
+ const typeKey = rawType.toLowerCase();
3971
+ const pairs = entry.allowed_transitions;
3972
+ const record = byTypeKey.get(typeKey) ?? { type: rawType, pairs: [], denyAll: false };
3973
+ if (pairs.length === 0) {
3974
+ record.denyAll = true;
3975
+ }
3976
+ for (const pair of pairs) {
3977
+ if (!Array.isArray(pair) || pair.length !== 2) {
3978
+ continue;
3979
+ }
3980
+ const from = normalizeStatusToken(pair[0]);
3981
+ const to = normalizeStatusToken(pair[1]);
3982
+ if (from.length === 0 || to.length === 0) {
3983
+ continue;
3984
+ }
3985
+ if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
3986
+ continue;
3987
+ }
3988
+ record.pairs.push([from, to]);
3989
+ }
3990
+ byTypeKey.set(typeKey, record);
3991
+ }
3992
+ const normalized = [];
3993
+ for (const record of byTypeKey.values()) {
3994
+ if (record.pairs.length > 0 || record.denyAll) {
3995
+ normalized.push({ type: record.type, allowed_transitions: record.pairs });
3996
+ }
3997
+ }
3998
+ normalized.sort((left, right) => left.type.localeCompare(right.type));
3999
+ return normalized.length > 0 ? normalized : void 0;
4000
+ }
3595
4001
  function normalizeRuntimeFieldDefinition(definition) {
3596
4002
  const key = normalizeStatusToken(definition.key ?? "");
3597
4003
  if (!key) {
@@ -3691,6 +4097,7 @@ function normalizeRuntimeSchemaSettings(schema) {
3691
4097
  ...DEFAULT_RUNTIME_WORKFLOW,
3692
4098
  ...normalizeRuntimeWorkflow(schema?.workflow)
3693
4099
  },
4100
+ type_workflows: normalizeTypeWorkflowDefinitions(schema?.type_workflows),
3694
4101
  unknown_field_policy: unknownFieldPolicy
3695
4102
  };
3696
4103
  }
@@ -3790,12 +4197,22 @@ function readWorkflowFromSchemaFile(parsed) {
3790
4197
  }
3791
4198
  return record;
3792
4199
  }
4200
+ function readTypeWorkflowsFromSchemaFile(parsed) {
4201
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
4202
+ return void 0;
4203
+ }
4204
+ const record = parsed;
4205
+ if (Array.isArray(record.type_workflows)) {
4206
+ return record.type_workflows;
4207
+ }
4208
+ return void 0;
4209
+ }
3793
4210
  function filePathForSchemaSection(pmRoot, configuredPath, fallbackPath) {
3794
4211
  const normalized = configuredPath?.trim() || fallbackPath;
3795
- if (path5.isAbsolute(normalized)) {
4212
+ if (path6.isAbsolute(normalized)) {
3796
4213
  return normalized;
3797
4214
  }
3798
- return path5.join(pmRoot, normalized);
4215
+ return path6.join(pmRoot, normalized);
3799
4216
  }
3800
4217
  async function ensureRuntimeSchemaFileScaffold(pmRoot, schema) {
3801
4218
  const normalizedSchema = normalizeRuntimeSchemaSettings(schema);
@@ -3843,6 +4260,7 @@ async function loadRuntimeSchemaFromOptionalFiles(pmRoot, schema) {
3843
4260
  let loadedStatuses;
3844
4261
  let loadedFields;
3845
4262
  let loadedWorkflow;
4263
+ let loadedTypeWorkflows;
3846
4264
  const readAndParse = async (targetPath, warningKey) => {
3847
4265
  const raw = await readFileIfExists(targetPath);
3848
4266
  if (raw === null) {
@@ -3877,6 +4295,7 @@ async function loadRuntimeSchemaFromOptionalFiles(pmRoot, schema) {
3877
4295
  if (loadedWorkflow === void 0) {
3878
4296
  warnings.push("runtime_schema_workflows_invalid_shape");
3879
4297
  }
4298
+ loadedTypeWorkflows = readTypeWorkflowsFromSchemaFile(parsedWorkflow);
3880
4299
  }
3881
4300
  const mergedSchema = normalizeRuntimeSchemaSettings({
3882
4301
  ...normalizedSchema,
@@ -3885,7 +4304,8 @@ async function loadRuntimeSchemaFromOptionalFiles(pmRoot, schema) {
3885
4304
  workflow: {
3886
4305
  ...normalizedSchema.workflow,
3887
4306
  ...loadedWorkflow ?? {}
3888
- }
4307
+ },
4308
+ type_workflows: [...normalizedSchema.type_workflows ?? [], ...loadedTypeWorkflows ?? []]
3889
4309
  });
3890
4310
  return {
3891
4311
  schema: mergedSchema,
@@ -4046,11 +4466,171 @@ var PmCliError = class extends Error {
4046
4466
  }
4047
4467
  };
4048
4468
 
4469
+ // dist/core/shared/serialization.js
4470
+ import crypto2 from "node:crypto";
4471
+ !(function() {
4472
+ try {
4473
+ var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
4474
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "559577ae-1fd4-5045-8165-b89edb52bb21");
4475
+ } catch (e2) {
4476
+ }
4477
+ })();
4478
+ function sortObjectKeys(value) {
4479
+ if (value === null)
4480
+ return null;
4481
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
4482
+ return value;
4483
+ }
4484
+ if (typeof value === "bigint") {
4485
+ return value.toString();
4486
+ }
4487
+ if (value === void 0) {
4488
+ return "undefined";
4489
+ }
4490
+ if (typeof value === "symbol") {
4491
+ return value.toString();
4492
+ }
4493
+ if (typeof value === "function") {
4494
+ return `[function:${value.name || "anonymous"}]`;
4495
+ }
4496
+ if (Array.isArray(value)) {
4497
+ return value.map((entry) => sortObjectKeys(entry));
4498
+ }
4499
+ if (value instanceof Date) {
4500
+ return value.toISOString();
4501
+ }
4502
+ const maybeJson = value;
4503
+ if (typeof maybeJson.toJSON === "function") {
4504
+ const normalized = maybeJson.toJSON();
4505
+ if (normalized !== value) {
4506
+ return sortObjectKeys(normalized);
4507
+ }
4508
+ }
4509
+ const obj = value;
4510
+ const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));
4511
+ const result = {};
4512
+ for (const key of sortedKeys) {
4513
+ const nested = obj[key];
4514
+ if (nested === void 0) {
4515
+ continue;
4516
+ }
4517
+ result[key] = sortObjectKeys(nested);
4518
+ }
4519
+ return result;
4520
+ }
4521
+ function stableStringify(value) {
4522
+ return JSON.stringify(sortObjectKeys(value));
4523
+ }
4524
+ function stableValueEquals(left, right) {
4525
+ if (Object.is(left, right)) {
4526
+ return true;
4527
+ }
4528
+ if (left === null || right === null || typeof left !== "object" || typeof right !== "object") {
4529
+ return false;
4530
+ }
4531
+ if (left instanceof RegExp || right instanceof RegExp) {
4532
+ return left instanceof RegExp && right instanceof RegExp && left.toString() === right.toString();
4533
+ }
4534
+ if (left instanceof Date || right instanceof Date) {
4535
+ return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
4536
+ }
4537
+ if (left instanceof Set || right instanceof Set) {
4538
+ if (!(left instanceof Set && right instanceof Set) || left.size !== right.size) {
4539
+ return false;
4540
+ }
4541
+ const rightValues = [...right];
4542
+ const matched = /* @__PURE__ */ new Set();
4543
+ for (const leftValue of left) {
4544
+ let found = false;
4545
+ for (let index = 0; index < rightValues.length; index += 1) {
4546
+ if (matched.has(index)) {
4547
+ continue;
4548
+ }
4549
+ if (stableValueEquals(leftValue, rightValues[index])) {
4550
+ matched.add(index);
4551
+ found = true;
4552
+ break;
4553
+ }
4554
+ }
4555
+ if (!found) {
4556
+ return false;
4557
+ }
4558
+ }
4559
+ return true;
4560
+ }
4561
+ if (left instanceof Map || right instanceof Map) {
4562
+ if (!(left instanceof Map && right instanceof Map) || left.size !== right.size) {
4563
+ return false;
4564
+ }
4565
+ const rightEntries = [...right.entries()];
4566
+ const matched = /* @__PURE__ */ new Set();
4567
+ for (const [leftKey, leftValue] of left.entries()) {
4568
+ let found = false;
4569
+ for (let index = 0; index < rightEntries.length; index += 1) {
4570
+ if (matched.has(index)) {
4571
+ continue;
4572
+ }
4573
+ const [rightKey, rightValue] = rightEntries[index];
4574
+ if (stableValueEquals(leftKey, rightKey) && stableValueEquals(leftValue, rightValue)) {
4575
+ matched.add(index);
4576
+ found = true;
4577
+ break;
4578
+ }
4579
+ }
4580
+ if (!found) {
4581
+ return false;
4582
+ }
4583
+ }
4584
+ return true;
4585
+ }
4586
+ if (Array.isArray(left) || Array.isArray(right)) {
4587
+ if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {
4588
+ return false;
4589
+ }
4590
+ return left.every((value, index) => stableValueEquals(value, right[index]));
4591
+ }
4592
+ const leftKeys = Object.keys(left).sort((a, b) => a.localeCompare(b));
4593
+ const rightKeys = Object.keys(right).sort((a, b) => a.localeCompare(b));
4594
+ if (leftKeys.length !== rightKeys.length) {
4595
+ return false;
4596
+ }
4597
+ for (let index = 0; index < leftKeys.length; index += 1) {
4598
+ const leftKey = leftKeys[index];
4599
+ if (leftKey !== rightKeys[index]) {
4600
+ return false;
4601
+ }
4602
+ if (!stableValueEquals(left[leftKey], right[leftKey])) {
4603
+ return false;
4604
+ }
4605
+ }
4606
+ return true;
4607
+ }
4608
+ function sha256Hex(value) {
4609
+ return crypto2.createHash("sha256").update(value, "utf8").digest("hex");
4610
+ }
4611
+ function orderObject(value, keyOrder) {
4612
+ const ordered = {};
4613
+ for (const key of keyOrder) {
4614
+ const entry = value[key];
4615
+ if (entry !== void 0) {
4616
+ ordered[key] = entry;
4617
+ }
4618
+ }
4619
+ const unknownKeys = Object.keys(value).filter((key) => !keyOrder.includes(key)).sort((a, b) => a.localeCompare(b));
4620
+ for (const key of unknownKeys) {
4621
+ const entry = value[key];
4622
+ if (entry !== void 0) {
4623
+ ordered[key] = entry;
4624
+ }
4625
+ }
4626
+ return ordered;
4627
+ }
4628
+
4049
4629
  // dist/core/store/settings-validator.js
4050
4630
  !(function() {
4051
4631
  try {
4052
4632
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
4053
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d7f0c9f9-7990-5b8a-a9f8-7dc98d976ecf");
4633
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "8b425415-1e39-5f2d-b23b-db8b2f0ba1c9");
4054
4634
  } catch (e2) {
4055
4635
  }
4056
4636
  })();
@@ -4161,6 +4741,20 @@ var runtimeFieldDefinition = vObject({
4161
4741
  required_types: vOptional(vArray(vString)),
4162
4742
  allow_unset: vOptional(vBoolean)
4163
4743
  });
4744
+ var statusTransitionPair = (input) => {
4745
+ if (!Array.isArray(input) || input.length !== 2) {
4746
+ return FAIL;
4747
+ }
4748
+ const [from, to] = input;
4749
+ if (typeof from !== "string" || typeof to !== "string") {
4750
+ return FAIL;
4751
+ }
4752
+ return { ok: true, value: [from, to] };
4753
+ };
4754
+ var typeWorkflowDefinition = vObject({
4755
+ type: vString,
4756
+ allowed_transitions: vArray(statusTransitionPair)
4757
+ });
4164
4758
  var runtimeSchemaSettings = vOptional(vObject({
4165
4759
  version: vOptional(vNumber({ int: true })),
4166
4760
  files: vOptional(vObject({
@@ -4179,6 +4773,7 @@ var runtimeSchemaSettings = vOptional(vObject({
4179
4773
  close_status: vOptional(vString),
4180
4774
  canceled_status: vOptional(vString)
4181
4775
  })),
4776
+ type_workflows: vOptional(vArray(typeWorkflowDefinition)),
4182
4777
  unknown_field_policy: vOptional(vLiteral(...RUNTIME_UNKNOWN_FIELD_POLICY_VALUES))
4183
4778
  }));
4184
4779
  var governanceSettings = vOptional(vObject({
@@ -4189,7 +4784,8 @@ var governanceSettings = vOptional(vObject({
4189
4784
  parent_reference: vOptional(vLiteral("warn", "strict_error")),
4190
4785
  metadata_profile: vOptional(vLiteral("core", "strict", "custom")),
4191
4786
  force_required_for_stale_lock: vOptional(vBoolean),
4192
- create_default_type: vOptional(vString)
4787
+ create_default_type: vOptional(vString),
4788
+ workflow_enforcement: vOptional(vLiteral("off", "warn", "strict"))
4193
4789
  }));
4194
4790
  var extensionPolicyOverride = vObject({
4195
4791
  name: vString,
@@ -4315,82 +4911,6 @@ function validateSettings(raw) {
4315
4911
  return { success: true, data: result.value };
4316
4912
  }
4317
4913
 
4318
- // dist/core/shared/serialization.js
4319
- import crypto2 from "node:crypto";
4320
- !(function() {
4321
- try {
4322
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
4323
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "9077bf31-377c-5b65-9e68-dd85503b2a0a");
4324
- } catch (e2) {
4325
- }
4326
- })();
4327
- function sortObjectKeys(value) {
4328
- if (value === null)
4329
- return null;
4330
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
4331
- return value;
4332
- }
4333
- if (typeof value === "bigint") {
4334
- return value.toString();
4335
- }
4336
- if (value === void 0) {
4337
- return "undefined";
4338
- }
4339
- if (typeof value === "symbol") {
4340
- return value.toString();
4341
- }
4342
- if (typeof value === "function") {
4343
- return `[function:${value.name || "anonymous"}]`;
4344
- }
4345
- if (Array.isArray(value)) {
4346
- return value.map((entry) => sortObjectKeys(entry));
4347
- }
4348
- if (value instanceof Date) {
4349
- return value.toISOString();
4350
- }
4351
- const maybeJson = value;
4352
- if (typeof maybeJson.toJSON === "function") {
4353
- const normalized = maybeJson.toJSON();
4354
- if (normalized !== value) {
4355
- return sortObjectKeys(normalized);
4356
- }
4357
- }
4358
- const obj = value;
4359
- const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));
4360
- const result = {};
4361
- for (const key of sortedKeys) {
4362
- const nested = obj[key];
4363
- if (nested === void 0) {
4364
- continue;
4365
- }
4366
- result[key] = sortObjectKeys(nested);
4367
- }
4368
- return result;
4369
- }
4370
- function stableStringify(value) {
4371
- return JSON.stringify(sortObjectKeys(value));
4372
- }
4373
- function sha256Hex(value) {
4374
- return crypto2.createHash("sha256").update(value, "utf8").digest("hex");
4375
- }
4376
- function orderObject(value, keyOrder) {
4377
- const ordered = {};
4378
- for (const key of keyOrder) {
4379
- const entry = value[key];
4380
- if (entry !== void 0) {
4381
- ordered[key] = entry;
4382
- }
4383
- }
4384
- const unknownKeys = Object.keys(value).filter((key) => !keyOrder.includes(key)).sort((a, b) => a.localeCompare(b));
4385
- for (const key of unknownKeys) {
4386
- const entry = value[key];
4387
- if (entry !== void 0) {
4388
- ordered[key] = entry;
4389
- }
4390
- }
4391
- return ordered;
4392
- }
4393
-
4394
4914
  // dist/core/item/item-type-definition.js
4395
4915
  !(function() {
4396
4916
  try {
@@ -4483,11 +5003,12 @@ function normalizeItemTypeDefinition(definition, options = {}) {
4483
5003
  !(function() {
4484
5004
  try {
4485
5005
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
4486
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2f269589-996e-551b-85ef-14bd6eb8aebe");
5006
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "bb310f96-79d3-5bd1-a4aa-b8a8ac741afb");
4487
5007
  } catch (e2) {
4488
5008
  }
4489
5009
  })();
4490
5010
  var SETTINGS_WRITE_OP = "settings:write";
5011
+ var SETTINGS_PERSIST_SOURCE_SYMBOL = /* @__PURE__ */ Symbol("pm.settings.persist_source");
4491
5012
  function resolveGovernanceKnobsFromPreset(preset) {
4492
5013
  return structuredClone(GOVERNANCE_PRESET_DEFAULTS[preset]);
4493
5014
  }
@@ -4497,9 +5018,19 @@ function normalizeGovernancePreset(value) {
4497
5018
  }
4498
5019
  return SETTINGS_DEFAULTS.governance.preset;
4499
5020
  }
5021
+ function withGovernanceExtras(base, governance) {
5022
+ const createDefaultType = typeof governance.create_default_type === "string" ? governance.create_default_type.trim() : void 0;
5023
+ if (createDefaultType && createDefaultType.length > 0) {
5024
+ base.create_default_type = createDefaultType;
5025
+ }
5026
+ if (governance.workflow_enforcement === "off" || governance.workflow_enforcement === "warn" || governance.workflow_enforcement === "strict") {
5027
+ base.workflow_enforcement = governance.workflow_enforcement;
5028
+ }
5029
+ return base;
5030
+ }
4500
5031
  function normalizeGovernanceForPersist(governance) {
4501
5032
  if (governance.preset === "custom") {
4502
- return {
5033
+ return withGovernanceExtras({
4503
5034
  preset: "custom",
4504
5035
  ownership_enforcement: governance.ownership_enforcement,
4505
5036
  create_mode_default: governance.create_mode_default,
@@ -4507,15 +5038,23 @@ function normalizeGovernanceForPersist(governance) {
4507
5038
  parent_reference: governance.parent_reference,
4508
5039
  metadata_profile: governance.metadata_profile,
4509
5040
  force_required_for_stale_lock: governance.force_required_for_stale_lock
4510
- };
5041
+ }, governance);
4511
5042
  }
4512
- return {
5043
+ return withGovernanceExtras({
4513
5044
  preset: governance.preset
5045
+ }, governance);
5046
+ }
5047
+ function resolveGovernanceExtras(rawGovernance) {
5048
+ const createDefaultType = typeof rawGovernance.create_default_type === "string" ? rawGovernance.create_default_type.trim() : void 0;
5049
+ return {
5050
+ create_default_type: createDefaultType && createDefaultType.length > 0 ? createDefaultType : void 0,
5051
+ workflow_enforcement: rawGovernance.workflow_enforcement === "off" || rawGovernance.workflow_enforcement === "warn" || rawGovernance.workflow_enforcement === "strict" ? rawGovernance.workflow_enforcement : void 0
4514
5052
  };
4515
5053
  }
4516
5054
  function resolveGovernanceKnobs(settings) {
4517
5055
  const rawGovernance = settings.governance ?? {};
4518
5056
  const preset = normalizeGovernancePreset(rawGovernance.preset);
5057
+ const extras = resolveGovernanceExtras(rawGovernance);
4519
5058
  if (preset === "custom") {
4520
5059
  const baseline = resolveGovernanceKnobsFromPreset("default");
4521
5060
  return {
@@ -4525,12 +5064,14 @@ function resolveGovernanceKnobs(settings) {
4525
5064
  close_validation_default: rawGovernance.close_validation_default ?? baseline.close_validation_default,
4526
5065
  parent_reference: rawGovernance.parent_reference ?? baseline.parent_reference,
4527
5066
  metadata_profile: rawGovernance.metadata_profile ?? baseline.metadata_profile,
4528
- force_required_for_stale_lock: rawGovernance.force_required_for_stale_lock ?? baseline.force_required_for_stale_lock
5067
+ force_required_for_stale_lock: rawGovernance.force_required_for_stale_lock ?? baseline.force_required_for_stale_lock,
5068
+ ...extras
4529
5069
  };
4530
5070
  }
4531
5071
  return {
4532
5072
  preset,
4533
- ...resolveGovernanceKnobsFromPreset(preset)
5073
+ ...resolveGovernanceKnobsFromPreset(preset),
5074
+ ...extras
4534
5075
  };
4535
5076
  }
4536
5077
  function cloneDefaults() {
@@ -4542,6 +5083,64 @@ function normalizeSearchMutationRefreshPolicy(value) {
4542
5083
  }
4543
5084
  return SETTINGS_DEFAULTS.search.mutation_refresh_policy;
4544
5085
  }
5086
+ function buildSettingsPersistSourceSnapshot(parsedSettings, runtimeSettings) {
5087
+ const sourceSchema = parsedSettings.schema;
5088
+ const sourceStatuses = Array.isArray(sourceSchema?.statuses) ? sourceSchema?.statuses : void 0;
5089
+ const sourceFields = Array.isArray(sourceSchema?.fields) ? sourceSchema?.fields : void 0;
5090
+ const sourceTypeWorkflows = Array.isArray(sourceSchema?.type_workflows) ? sourceSchema?.type_workflows : void 0;
5091
+ return {
5092
+ has_source_item_type_definitions: Array.isArray(parsedSettings.item_types?.definitions),
5093
+ source_item_type_definitions: normalizeItemTypeDefinitions(parsedSettings.item_types?.definitions),
5094
+ has_source_schema_statuses: sourceStatuses !== void 0,
5095
+ source_schema_statuses: sourceStatuses ? structuredClone(sourceStatuses) : [],
5096
+ has_source_schema_fields: sourceFields !== void 0,
5097
+ source_schema_fields: sourceFields ? structuredClone(sourceFields) : [],
5098
+ has_source_schema_type_workflows: sourceTypeWorkflows !== void 0,
5099
+ source_schema_type_workflows: sourceTypeWorkflows ? structuredClone(sourceTypeWorkflows) : [],
5100
+ runtime_item_type_definitions: normalizeItemTypeDefinitions(runtimeSettings.item_types?.definitions),
5101
+ runtime_schema_statuses: structuredClone(runtimeSettings.schema.statuses),
5102
+ runtime_schema_fields: structuredClone(runtimeSettings.schema.fields),
5103
+ runtime_schema_type_workflows: structuredClone(runtimeSettings.schema.type_workflows ?? [])
5104
+ };
5105
+ }
5106
+ function attachSettingsPersistSourceSnapshot(settings, source) {
5107
+ Object.defineProperty(settings, SETTINGS_PERSIST_SOURCE_SYMBOL, {
5108
+ value: source,
5109
+ writable: true,
5110
+ configurable: true,
5111
+ enumerable: false
5112
+ });
5113
+ }
5114
+ function getSettingsPersistSourceSnapshot(settings) {
5115
+ const candidate = settings[SETTINGS_PERSIST_SOURCE_SYMBOL];
5116
+ if (!candidate || typeof candidate !== "object") {
5117
+ return void 0;
5118
+ }
5119
+ return candidate;
5120
+ }
5121
+ function resolvePersistedFileBackedSchemaSections(settings, source) {
5122
+ const normalizedSchema = normalizeRuntimeSchemaSettings(settings.schema);
5123
+ const currentItemTypeDefinitions = normalizeItemTypeDefinitions(settings.item_types?.definitions);
5124
+ if (!source) {
5125
+ return {
5126
+ item_type_definitions: currentItemTypeDefinitions,
5127
+ schema_statuses: normalizedSchema.statuses,
5128
+ schema_fields: normalizedSchema.fields,
5129
+ schema_type_workflows: normalizedSchema.type_workflows
5130
+ };
5131
+ }
5132
+ const currentTypeWorkflows = normalizedSchema.type_workflows ?? [];
5133
+ const itemTypeDefinitionsUnchanged = stableValueEquals(currentItemTypeDefinitions, source.runtime_item_type_definitions);
5134
+ const schemaStatusesUnchanged = stableValueEquals(normalizedSchema.statuses, source.runtime_schema_statuses);
5135
+ const schemaFieldsUnchanged = stableValueEquals(normalizedSchema.fields, source.runtime_schema_fields);
5136
+ const schemaTypeWorkflowsUnchanged = stableValueEquals(currentTypeWorkflows, source.runtime_schema_type_workflows);
5137
+ return {
5138
+ item_type_definitions: itemTypeDefinitionsUnchanged ? source.has_source_item_type_definitions ? normalizeItemTypeDefinitions(source.source_item_type_definitions) : [] : currentItemTypeDefinitions,
5139
+ schema_statuses: schemaStatusesUnchanged ? source.has_source_schema_statuses ? structuredClone(source.source_schema_statuses) : [] : normalizedSchema.statuses,
5140
+ schema_fields: schemaFieldsUnchanged ? source.has_source_schema_fields ? structuredClone(source.source_schema_fields) : [] : normalizedSchema.fields,
5141
+ schema_type_workflows: schemaTypeWorkflowsUnchanged ? source.has_source_schema_type_workflows ? structuredClone(source.source_schema_type_workflows) : void 0 : normalizedSchema.type_workflows
5142
+ };
5143
+ }
4545
5144
  function buildFallbackSettingsReadResult(warning) {
4546
5145
  return {
4547
5146
  settings: cloneDefaults(),
@@ -4787,8 +5386,10 @@ function mergeSettings(settings) {
4787
5386
  }
4788
5387
  };
4789
5388
  }
4790
- function serializeSettings(settings) {
5389
+ function serializeSettings(settings, options = {}) {
4791
5390
  const governance = resolveGovernanceKnobs(settings);
5391
+ const normalizedSchema = normalizeRuntimeSchemaSettings(settings.schema);
5392
+ const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(settings, options.persist_source);
4792
5393
  const normalizedSettings = {
4793
5394
  ...settings,
4794
5395
  item_format: "toon",
@@ -4805,9 +5406,14 @@ function serializeSettings(settings) {
4805
5406
  governance,
4806
5407
  agent_guidance: normalizeAgentGuidanceSettings(settings.agent_guidance),
4807
5408
  item_types: {
4808
- definitions: normalizeItemTypeDefinitions(settings.item_types?.definitions)
5409
+ definitions: persistedFileBackedSections.item_type_definitions
5410
+ },
5411
+ schema: {
5412
+ ...normalizedSchema,
5413
+ statuses: persistedFileBackedSections.schema_statuses,
5414
+ fields: persistedFileBackedSections.schema_fields,
5415
+ type_workflows: persistedFileBackedSections.schema_type_workflows
4809
5416
  },
4810
- schema: normalizeRuntimeSchemaSettings(settings.schema),
4811
5417
  search: {
4812
5418
  ...SETTINGS_DEFAULTS.search,
4813
5419
  ...settings.search,
@@ -4873,7 +5479,9 @@ function serializeSettings(settings) {
4873
5479
  "close_validation_default",
4874
5480
  "parent_reference",
4875
5481
  "metadata_profile",
4876
- "force_required_for_stale_lock"
5482
+ "force_required_for_stale_lock",
5483
+ "create_default_type",
5484
+ "workflow_enforcement"
4877
5485
  ]);
4878
5486
  ordered.workflow = orderObject(ordered.workflow, ["definition_of_done"]);
4879
5487
  ordered.testing = orderObject(ordered.testing, ["record_results_to_items"]);
@@ -4899,6 +5507,7 @@ function serializeSettings(settings) {
4899
5507
  "statuses",
4900
5508
  "fields",
4901
5509
  "workflow",
5510
+ "type_workflows",
4902
5511
  "unknown_field_policy"
4903
5512
  ]);
4904
5513
  ordered.schema.files = orderObject(ordered.schema.files ?? {}, ["types", "statuses", "fields", "workflows"]);
@@ -5002,6 +5611,7 @@ async function readSettingsWithMetadata(pmRoot) {
5002
5611
  },
5003
5612
  schema: loadedSchemaSections.schema
5004
5613
  };
5614
+ attachSettingsPersistSourceSnapshot(settings, buildSettingsPersistSourceSnapshot(validated.data, settings));
5005
5615
  return {
5006
5616
  settings,
5007
5617
  metadata: {
@@ -5022,7 +5632,9 @@ async function readSettings(pmRoot) {
5022
5632
  }
5023
5633
  async function writeSettings(pmRoot, settings, op = SETTINGS_WRITE_OP) {
5024
5634
  const settingsPath = getSettingsPath(pmRoot);
5025
- await writeFileAtomic(settingsPath, serializeSettings(settings));
5635
+ await writeFileAtomic(settingsPath, serializeSettings(settings, {
5636
+ persist_source: getSettingsPersistSourceSnapshot(settings)
5637
+ }));
5026
5638
  await runActiveOnWriteHooks({
5027
5639
  path: settingsPath,
5028
5640
  scope: "project",
@@ -5038,6 +5650,7 @@ export {
5038
5650
  appendLineAtomic,
5039
5651
  removeFileIfExists,
5040
5652
  isPathWithinDirectory,
5653
+ resolvePmPackageRootFromModule,
5041
5654
  KNOWN_EXTENSION_CAPABILITIES,
5042
5655
  EXTENSION_CAPABILITY_CONTRACT,
5043
5656
  KNOWN_EXTENSION_POLICY_MODES,
@@ -5083,10 +5696,12 @@ export {
5083
5696
  asRecordOrNull,
5084
5697
  parseUnknownExtensionCapabilityWarning,
5085
5698
  parseLegacyExtensionCapabilityAliasWarning,
5699
+ createEmptyExtensionRegistrationRegistry,
5086
5700
  runBeforeCommandHooks,
5087
5701
  runAfterCommandHooks,
5088
5702
  nextExtensionReloadToken,
5089
5703
  resolveExtensionRoots,
5704
+ discoverExtensions,
5090
5705
  loadExtensions,
5091
5706
  activateExtensions,
5092
5707
  setActiveExtensionHooks,
@@ -5100,6 +5715,9 @@ export {
5100
5715
  setActiveCommandContext,
5101
5716
  setActiveCommandResult,
5102
5717
  getActiveCommandResult,
5718
+ recordAfterCommandAffectedItem,
5719
+ projectAfterCommandItemSnapshot,
5720
+ consumeAfterCommandAffectedItems,
5103
5721
  clearActiveExtensionHooks,
5104
5722
  runActiveOnWriteHooks,
5105
5723
  runActiveOnReadHooks,
@@ -5115,6 +5733,7 @@ export {
5115
5733
  BUILTIN_ITEM_TYPE_VALUES,
5116
5734
  ITEM_TYPE_VALUES,
5117
5735
  STATUS_VALUES,
5736
+ RUNTIME_STATUS_ROLE_VALUES,
5118
5737
  DEPENDENCY_KIND_VALUES,
5119
5738
  SCOPE_VALUES,
5120
5739
  RISK_VALUES,
@@ -5133,6 +5752,7 @@ export {
5133
5752
  strictPolicyCommand,
5134
5753
  normalizeItemTypeDefinition,
5135
5754
  DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
5755
+ DEFAULT_RUNTIME_STATUS_DEFINITIONS,
5136
5756
  normalizeRuntimeSchemaSettings,
5137
5757
  filePathForSchemaSection,
5138
5758
  ensureRuntimeSchemaFileScaffold,
@@ -5143,6 +5763,7 @@ export {
5143
5763
  statusIsTerminal,
5144
5764
  PmCliError,
5145
5765
  stableStringify,
5766
+ stableValueEquals,
5146
5767
  sha256Hex,
5147
5768
  orderObject,
5148
5769
  resolveGovernanceKnobs,
@@ -5150,4 +5771,4 @@ export {
5150
5771
  readSettings,
5151
5772
  writeSettings
5152
5773
  };
5153
- //# sourceMappingURL=chunk-LSXGH6NE.js.map
5774
+ //# sourceMappingURL=chunk-U5SXYXSY.js.map