@unbrained/pm-cli 2026.7.4 → 2026.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (601) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +1 -5
  3. package/dist/cli/commands/calendar.d.ts +3 -2
  4. package/dist/cli/commands/calendar.js +4 -4
  5. package/dist/cli/commands/calendar.js.map +1 -1
  6. package/dist/cli/commands/claim.js +17 -3
  7. package/dist/cli/commands/claim.js.map +1 -1
  8. package/dist/cli/commands/close.js +34 -16
  9. package/dist/cli/commands/close.js.map +1 -1
  10. package/dist/cli/commands/copy.js +3 -3
  11. package/dist/cli/commands/copy.js.map +1 -1
  12. package/dist/cli/commands/create.d.ts +7 -0
  13. package/dist/cli/commands/create.js +156 -110
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/extension/bundled-catalog.d.ts +6 -0
  16. package/dist/cli/commands/extension/bundled-catalog.js +15 -2
  17. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  18. package/dist/cli/commands/extension/describe.d.ts +6 -3
  19. package/dist/cli/commands/extension/describe.js +21 -9
  20. package/dist/cli/commands/extension/describe.js.map +1 -1
  21. package/dist/cli/commands/extension/doctor.d.ts +0 -4
  22. package/dist/cli/commands/extension/doctor.js +3 -3
  23. package/dist/cli/commands/extension/doctor.js.map +1 -1
  24. package/dist/cli/commands/extension/scaffold.js +7 -2
  25. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  26. package/dist/cli/commands/extension/shared.d.ts +2 -7
  27. package/dist/cli/commands/extension/shared.js +4 -10
  28. package/dist/cli/commands/extension/shared.js.map +1 -1
  29. package/dist/cli/commands/extension.js +33 -8
  30. package/dist/cli/commands/extension.js.map +1 -1
  31. package/dist/cli/commands/profile.js +3 -3
  32. package/dist/cli/commands/profile.js.map +1 -1
  33. package/dist/cli/commands/reindex.js +3 -3
  34. package/dist/cli/commands/reindex.js.map +1 -1
  35. package/dist/cli/commands/restore.js +3 -3
  36. package/dist/cli/commands/restore.js.map +1 -1
  37. package/dist/cli/commands/schema.js +10 -10
  38. package/dist/cli/commands/schema.js.map +1 -1
  39. package/dist/cli/commands/update.js +5 -3
  40. package/dist/cli/commands/update.js.map +1 -1
  41. package/dist/cli/error-guidance.js +107 -7
  42. package/dist/cli/error-guidance.js.map +1 -1
  43. package/dist/cli/main.d.ts +6 -2
  44. package/dist/cli/main.js +33 -12
  45. package/dist/cli/main.js.map +1 -1
  46. package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +18 -0
  47. package/dist/cli-bundle/chunks/{activity-OENQCYZD.js → activity-YKAKZTZ4.js} +11 -9
  48. package/dist/cli-bundle/chunks/{aggregate-EC4LWS3U.js → aggregate-EQX2RGB7.js} +16 -13
  49. package/dist/cli-bundle/chunks/{aggregate-EC4LWS3U.js.map → aggregate-EQX2RGB7.js.map} +1 -1
  50. package/dist/cli-bundle/chunks/{aggregate-RCB3QJJE.js → aggregate-PEGZGJXD.js} +18 -15
  51. package/dist/cli-bundle/chunks/{aggregate-RCB3QJJE.js.map → aggregate-PEGZGJXD.js.map} +1 -1
  52. package/dist/cli-bundle/chunks/{append-XLEKVVWB.js → append-CZGUZ45Q.js} +11 -8
  53. package/dist/cli-bundle/chunks/{append-XLEKVVWB.js.map → append-CZGUZ45Q.js.map} +1 -1
  54. package/dist/cli-bundle/chunks/{append-ADBOI3A6.js → append-NSQBCXZJ.js} +13 -10
  55. package/dist/cli-bundle/chunks/{append-ADBOI3A6.js.map → append-NSQBCXZJ.js.map} +1 -1
  56. package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js +1413 -0
  57. package/dist/cli-bundle/chunks/chunk-3JZNEQBA.js.map +1 -0
  58. package/dist/cli-bundle/chunks/{chunk-2LRMWMZ6.js → chunk-3PL6LEKP.js} +16 -14
  59. package/dist/cli-bundle/chunks/{chunk-2LRMWMZ6.js.map → chunk-3PL6LEKP.js.map} +1 -1
  60. package/dist/cli-bundle/chunks/{chunk-CN4OAA2G.js → chunk-3U3VEWK6.js} +277 -119
  61. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +7 -0
  62. package/dist/cli-bundle/chunks/{chunk-EB4BBEZD.js → chunk-3Y4OESPP.js} +14 -12
  63. package/dist/cli-bundle/chunks/{chunk-EB4BBEZD.js.map → chunk-3Y4OESPP.js.map} +1 -1
  64. package/dist/cli-bundle/chunks/{chunk-NHDR3UCW.js → chunk-4LRVSBO6.js} +14 -12
  65. package/dist/cli-bundle/chunks/{chunk-NHDR3UCW.js.map → chunk-4LRVSBO6.js.map} +1 -1
  66. package/dist/cli-bundle/chunks/{chunk-6YB7HG2J.js → chunk-4OFLJHX6.js} +7 -5
  67. package/dist/cli-bundle/chunks/{chunk-6YB7HG2J.js.map → chunk-4OFLJHX6.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-SBNT6SLO.js → chunk-4QQ6PM7M.js} +45 -557
  69. package/dist/cli-bundle/chunks/chunk-4QQ6PM7M.js.map +7 -0
  70. package/dist/cli-bundle/chunks/{chunk-M34MVAOP.js → chunk-53BTLLAF.js} +16 -200
  71. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-UYLA5ROU.js → chunk-57C2RLW5.js} +277 -112
  73. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +1 -0
  74. package/dist/cli-bundle/chunks/{chunk-R7EMP4JG.js → chunk-5B3X4Y22.js} +52 -63
  75. package/dist/cli-bundle/chunks/{chunk-R7EMP4JG.js.map → chunk-5B3X4Y22.js.map} +3 -3
  76. package/dist/cli-bundle/chunks/{chunk-XBIYI23P.js → chunk-5J2XPTAD.js} +10 -8
  77. package/dist/cli-bundle/chunks/{chunk-XBIYI23P.js.map → chunk-5J2XPTAD.js.map} +1 -1
  78. package/dist/cli-bundle/chunks/{chunk-4SHME4VR.js → chunk-5JE6SMYS.js} +2 -2
  79. package/dist/cli-bundle/chunks/{chunk-4KPQQ42D.js → chunk-5JZ7APJU.js} +18 -16
  80. package/dist/cli-bundle/chunks/{chunk-4KPQQ42D.js.map → chunk-5JZ7APJU.js.map} +1 -1
  81. package/dist/cli-bundle/chunks/{chunk-BDDYM4LH.js → chunk-5VVUKE3U.js} +424 -2228
  82. package/dist/cli-bundle/chunks/chunk-5VVUKE3U.js.map +7 -0
  83. package/dist/cli-bundle/chunks/{chunk-QFXFKYNQ.js → chunk-75U6M5ZD.js} +16 -14
  84. package/dist/cli-bundle/chunks/{chunk-QFXFKYNQ.js.map → chunk-75U6M5ZD.js.map} +1 -1
  85. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +23 -0
  86. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +7 -0
  87. package/dist/cli-bundle/chunks/{chunk-A222YWOQ.js → chunk-7EQNAZX2.js} +14 -12
  88. package/dist/cli-bundle/chunks/{chunk-A222YWOQ.js.map → chunk-7EQNAZX2.js.map} +1 -1
  89. package/dist/cli-bundle/chunks/{chunk-Z4DGFQDH.js → chunk-7LQKVMPA.js} +14 -4
  90. package/dist/cli-bundle/chunks/chunk-7LQKVMPA.js.map +1 -0
  91. package/dist/cli-bundle/chunks/{chunk-EH23N5FX.js → chunk-7MDXZAZS.js} +29 -7
  92. package/dist/cli-bundle/chunks/chunk-7MDXZAZS.js.map +1 -0
  93. package/dist/cli-bundle/chunks/{chunk-XQCWTSLO.js → chunk-7QH7DHUB.js} +74 -8
  94. package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +1 -0
  95. package/dist/cli-bundle/chunks/{chunk-3C5T3ZEO.js → chunk-7WYXBPYQ.js} +7 -5
  96. package/dist/cli-bundle/chunks/{chunk-3C5T3ZEO.js.map → chunk-7WYXBPYQ.js.map} +1 -1
  97. package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js +150 -0
  98. package/dist/cli-bundle/chunks/chunk-AAEQMOC6.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{chunk-CQISNF3Z.js → chunk-ABRA3BHY.js} +18 -16
  100. package/dist/cli-bundle/chunks/{chunk-CQISNF3Z.js.map → chunk-ABRA3BHY.js.map} +2 -2
  101. package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js +47 -0
  102. package/dist/cli-bundle/chunks/chunk-B5KXLBSJ.js.map +7 -0
  103. package/dist/cli-bundle/chunks/{chunk-Y2VSCQ77.js → chunk-BFVHCAOO.js} +9 -7
  104. package/dist/cli-bundle/chunks/{chunk-Y2VSCQ77.js.map → chunk-BFVHCAOO.js.map} +1 -1
  105. package/dist/cli-bundle/chunks/{chunk-7ITQSEBL.js → chunk-BVEUCSH2.js} +6 -4
  106. package/dist/cli-bundle/chunks/{chunk-7ITQSEBL.js.map → chunk-BVEUCSH2.js.map} +1 -1
  107. package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js +160 -0
  108. package/dist/cli-bundle/chunks/chunk-C3PMDWGX.js.map +7 -0
  109. package/dist/cli-bundle/chunks/{chunk-HL742IBM.js → chunk-D3UCE7RW.js} +7 -5
  110. package/dist/cli-bundle/chunks/{chunk-HL742IBM.js.map → chunk-D3UCE7RW.js.map} +1 -1
  111. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +275 -0
  112. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +7 -0
  113. package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js +634 -0
  114. package/dist/cli-bundle/chunks/chunk-DLQ4ZTCU.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-MZG6I2Q2.js → chunk-DRBV5UC2.js} +8 -23
  116. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-DEIDJQZK.js → chunk-E2FUG6GD.js} +15 -220
  118. package/dist/cli-bundle/chunks/{chunk-DEIDJQZK.js.map → chunk-E2FUG6GD.js.map} +3 -3
  119. package/dist/cli-bundle/chunks/{chunk-3MLQZI3H.js → chunk-EEY54JMF.js} +5 -3
  120. package/dist/cli-bundle/chunks/{chunk-3MLQZI3H.js.map → chunk-EEY54JMF.js.map} +1 -1
  121. package/dist/cli-bundle/chunks/{chunk-CQFZRLXQ.js → chunk-EZFKWSC7.js} +94 -16
  122. package/dist/cli-bundle/chunks/{chunk-CQFZRLXQ.js.map → chunk-EZFKWSC7.js.map} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-4PJYRA3V.js → chunk-FDBARR33.js} +17 -15
  124. package/dist/cli-bundle/chunks/{chunk-4PJYRA3V.js.map → chunk-FDBARR33.js.map} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-NGDK3KEZ.js → chunk-FGQKEDE4.js} +36 -12
  126. package/dist/cli-bundle/chunks/chunk-FGQKEDE4.js.map +7 -0
  127. package/dist/cli-bundle/chunks/{chunk-FMWQRMHS.js → chunk-FJRKQREY.js} +10 -18
  128. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +1 -0
  129. package/dist/cli-bundle/chunks/{chunk-6QY2NA2M.js → chunk-FUM6UMY4.js} +10 -11
  130. package/dist/cli-bundle/chunks/{chunk-6QY2NA2M.js.map → chunk-FUM6UMY4.js.map} +1 -1
  131. package/dist/cli-bundle/chunks/{chunk-UGDONITK.js → chunk-GIWXVMZ3.js} +140 -334
  132. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +7 -0
  133. package/dist/cli-bundle/chunks/{chunk-OTSP6UEX.js → chunk-HBYZDSK5.js} +19 -17
  134. package/dist/cli-bundle/chunks/{chunk-OTSP6UEX.js.map → chunk-HBYZDSK5.js.map} +1 -1
  135. package/dist/cli-bundle/chunks/{chunk-D2LDM35X.js → chunk-HJE4JTKQ.js} +6 -4
  136. package/dist/cli-bundle/chunks/{chunk-D2LDM35X.js.map → chunk-HJE4JTKQ.js.map} +1 -1
  137. package/dist/cli-bundle/chunks/{chunk-AOP2EMK3.js → chunk-HK72NWAD.js} +89 -18
  138. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-2ONH3WG6.js → chunk-IJ6CO3JV.js} +18 -16
  140. package/dist/cli-bundle/chunks/{chunk-2ONH3WG6.js.map → chunk-IJ6CO3JV.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-J4KNRDI3.js → chunk-JFCVQXZX.js} +139 -326
  142. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +1 -0
  143. package/dist/cli-bundle/chunks/{chunk-V655JQ5J.js → chunk-JLA7EVYV.js} +12 -10
  144. package/dist/cli-bundle/chunks/{chunk-V655JQ5J.js.map → chunk-JLA7EVYV.js.map} +1 -1
  145. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +76 -0
  146. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-WBWRQS32.js → chunk-K3AGVXSF.js} +37 -13
  148. package/dist/cli-bundle/chunks/chunk-K3AGVXSF.js.map +1 -0
  149. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +79 -0
  150. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +7 -0
  151. package/dist/cli-bundle/chunks/chunk-KGHH652T.js +44 -0
  152. package/dist/cli-bundle/chunks/chunk-KGHH652T.js.map +1 -0
  153. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +915 -0
  154. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +1 -0
  155. package/dist/cli-bundle/chunks/{chunk-JZJJEJBR.js → chunk-KLG4ZULO.js} +12 -10
  156. package/dist/cli-bundle/chunks/{chunk-JZJJEJBR.js.map → chunk-KLG4ZULO.js.map} +1 -1
  157. package/dist/cli-bundle/chunks/{chunk-KKHIQOTN.js → chunk-LEKT4K7I.js} +74 -8
  158. package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +7 -0
  159. package/dist/cli-bundle/chunks/{contracts-CVBINC7C.js → chunk-MNZ7DRNC.js} +13 -10
  160. package/dist/cli-bundle/chunks/{contracts-CVBINC7C.js.map → chunk-MNZ7DRNC.js.map} +1 -1
  161. package/dist/cli-bundle/chunks/{chunk-2VK677OA.js → chunk-MTTXDAK4.js} +176 -125
  162. package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{chunk-Q2266G4S.js → chunk-MZ7VNEVY.js} +8 -6
  164. package/dist/cli-bundle/chunks/{chunk-Q2266G4S.js.map → chunk-MZ7VNEVY.js.map} +1 -1
  165. package/dist/cli-bundle/chunks/{chunk-4EVY7CQN.js → chunk-N6DNM2FA.js} +2 -2
  166. package/dist/cli-bundle/chunks/{test-runs-5SLLV3XU.js → chunk-N7X4WP6L.js} +11 -8
  167. package/dist/cli-bundle/chunks/{test-runs-5SLLV3XU.js.map → chunk-N7X4WP6L.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-AZMPKLIA.js → chunk-NBFCNJ7Q.js} +177 -126
  169. package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-YZR7UMZ6.js → chunk-NER3KUUS.js} +2 -2
  171. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +20 -0
  172. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +1 -0
  173. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +918 -0
  174. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-DJ5S2LDY.js → chunk-OESSOFJ4.js} +14 -12
  176. package/dist/cli-bundle/chunks/{chunk-DJ5S2LDY.js.map → chunk-OESSOFJ4.js.map} +1 -1
  177. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +238 -0
  178. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-TUV7SIWZ.js → chunk-OWTIRHX4.js} +28 -6
  180. package/dist/cli-bundle/chunks/chunk-OWTIRHX4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-PV5JS7MP.js → chunk-P3VRG72Q.js} +10 -8
  182. package/dist/cli-bundle/chunks/{chunk-PV5JS7MP.js.map → chunk-P3VRG72Q.js.map} +1 -1
  183. package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js +1423 -0
  184. package/dist/cli-bundle/chunks/chunk-P5TFTLWW.js.map +7 -0
  185. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +1977 -0
  186. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +7 -0
  187. package/dist/cli-bundle/chunks/{chunk-WTXDLBSZ.js → chunk-PDXT6Q55.js} +2 -2
  188. package/dist/cli-bundle/chunks/{chunk-YZWXMDNH.js → chunk-PJ3A56YF.js} +46 -537
  189. package/dist/cli-bundle/chunks/chunk-PJ3A56YF.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{test-runs-L3WKLO67.js → chunk-PPAJG4GB.js} +13 -10
  191. package/dist/cli-bundle/chunks/{test-runs-L3WKLO67.js.map → chunk-PPAJG4GB.js.map} +1 -1
  192. package/dist/cli-bundle/chunks/{chunk-LLQLLAKU.js → chunk-PPE4YUQM.js} +1670 -1573
  193. package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +1 -0
  194. package/dist/cli-bundle/chunks/{chunk-TO4KCIOT.js → chunk-QHZO65XW.js} +8 -6
  195. package/dist/cli-bundle/chunks/{chunk-TO4KCIOT.js.map → chunk-QHZO65XW.js.map} +1 -1
  196. package/dist/cli-bundle/chunks/{chunk-4OXNQHKQ.js → chunk-R3ZBLGTC.js} +9 -10
  197. package/dist/cli-bundle/chunks/{chunk-4OXNQHKQ.js.map → chunk-R3ZBLGTC.js.map} +2 -2
  198. package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js +624 -0
  199. package/dist/cli-bundle/chunks/chunk-RCT3YJOK.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{chunk-724VLYDJ.js → chunk-RX3HQSYG.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-PUVPC5DL.js → chunk-S4APD35C.js} +4 -4
  202. package/dist/cli-bundle/chunks/{chunk-T5RTYLZJ.js → chunk-S5AYOUT5.js} +8 -6
  203. package/dist/cli-bundle/chunks/{chunk-T5RTYLZJ.js.map → chunk-S5AYOUT5.js.map} +1 -1
  204. package/dist/cli-bundle/chunks/{chunk-75VMARGO.js → chunk-STPSZ2XY.js} +19 -744
  205. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +1 -0
  206. package/dist/cli-bundle/chunks/{chunk-A2W3XKAD.js → chunk-T35XLYZF.js} +2 -2
  207. package/dist/cli-bundle/chunks/{chunk-N2LOJUBB.js → chunk-T3ABIMGW.js} +5 -3
  208. package/dist/cli-bundle/chunks/{chunk-N2LOJUBB.js.map → chunk-T3ABIMGW.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{chunk-FDNJMYZB.js → chunk-T3F4DF23.js} +16 -14
  210. package/dist/cli-bundle/chunks/{chunk-FDNJMYZB.js.map → chunk-T3F4DF23.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +272 -0
  212. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +1 -0
  213. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js +5354 -0
  214. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-XFO2NJY6.js → chunk-TSPKZRRW.js} +33 -28
  216. package/dist/cli-bundle/chunks/chunk-TSPKZRRW.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-ZZWMJVW2.js → chunk-TT42JUMF.js} +4 -4
  218. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +165 -0
  219. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +1 -0
  220. package/dist/cli-bundle/chunks/{chunk-7745CXNI.js → chunk-UI5BJ6DO.js} +1231 -1134
  221. package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +7 -0
  222. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +1932 -0
  223. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +1 -0
  224. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +175 -0
  225. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-B4O5S7I3.js → chunk-VUHVWI4C.js} +13 -3
  227. package/dist/cli-bundle/chunks/chunk-VUHVWI4C.js.map +7 -0
  228. package/dist/cli-bundle/chunks/{contracts-NLCDIZAT.js → chunk-VZIYHZDX.js} +11 -8
  229. package/dist/cli-bundle/chunks/{contracts-NLCDIZAT.js.map → chunk-VZIYHZDX.js.map} +1 -1
  230. package/dist/cli-bundle/chunks/{chunk-TGYDJEJH.js → chunk-WISPVC2E.js} +9 -7
  231. package/dist/cli-bundle/chunks/{chunk-TGYDJEJH.js.map → chunk-WISPVC2E.js.map} +1 -1
  232. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js +5434 -0
  233. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-MTB4PRA3.js → chunk-XQCG2JGW.js} +17 -749
  235. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +7 -0
  236. package/dist/cli-bundle/chunks/chunk-Y76TWC45.js +550 -0
  237. package/dist/cli-bundle/chunks/chunk-Y76TWC45.js.map +7 -0
  238. package/dist/cli-bundle/chunks/{chunk-SL2ANJSV.js → chunk-YD5FML7K.js} +418 -2173
  239. package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +1 -0
  240. package/dist/cli-bundle/chunks/{chunk-NHKXOMZ5.js → chunk-YFIE7YK6.js} +7 -5
  241. package/dist/cli-bundle/chunks/{chunk-NHKXOMZ5.js.map → chunk-YFIE7YK6.js.map} +1 -1
  242. package/dist/cli-bundle/chunks/{chunk-5FYY76HR.js → chunk-YMABYTNG.js} +32 -27
  243. package/dist/cli-bundle/chunks/chunk-YMABYTNG.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-W5X3AHJN.js → chunk-YOF5VPKM.js} +2 -2
  245. package/dist/cli-bundle/chunks/{chunk-M6PR5BC6.js → chunk-YPPVU5GX.js} +11 -9
  246. package/dist/cli-bundle/chunks/{chunk-M6PR5BC6.js.map → chunk-YPPVU5GX.js.map} +1 -1
  247. package/dist/cli-bundle/chunks/{chunk-ZIEGTQCY.js → chunk-YQMMMONE.js} +6 -4
  248. package/dist/cli-bundle/chunks/{chunk-ZIEGTQCY.js.map → chunk-YQMMMONE.js.map} +1 -1
  249. package/dist/cli-bundle/chunks/{chunk-4IW7STMB.js → chunk-YSAH5FY5.js} +16 -14
  250. package/dist/cli-bundle/chunks/{chunk-4IW7STMB.js.map → chunk-YSAH5FY5.js.map} +1 -1
  251. package/dist/cli-bundle/chunks/{chunk-JYLFF7GJ.js → chunk-YZIR4R3U.js} +16 -14
  252. package/dist/cli-bundle/chunks/{chunk-JYLFF7GJ.js.map → chunk-YZIR4R3U.js.map} +1 -1
  253. package/dist/cli-bundle/chunks/{chunk-7G5SUU6F.js → chunk-Z2CRRZYF.js} +14 -12
  254. package/dist/cli-bundle/chunks/{chunk-7G5SUU6F.js.map → chunk-Z2CRRZYF.js.map} +1 -1
  255. package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js +533 -0
  256. package/dist/cli-bundle/chunks/chunk-ZAHXPXVY.js.map +1 -0
  257. package/dist/cli-bundle/chunks/{chunk-WOOB7PV7.js → chunk-ZCJAA3JK.js} +8 -6
  258. package/dist/cli-bundle/chunks/{chunk-WOOB7PV7.js.map → chunk-ZCJAA3JK.js.map} +1 -1
  259. package/dist/cli-bundle/chunks/{chunk-WSDIALO4.js → chunk-ZD34OFFQ.js} +5 -3
  260. package/dist/cli-bundle/chunks/{chunk-WSDIALO4.js.map → chunk-ZD34OFFQ.js.map} +1 -1
  261. package/dist/cli-bundle/chunks/{chunk-Q3XVLRCJ.js → chunk-ZJB3UV5U.js} +54 -58
  262. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{chunk-MZ4NH46V.js → chunk-ZMD35NYG.js} +2 -2
  264. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +241 -0
  265. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{claim-D6L33A5Y.js → claim-4DROPSIS.js} +30 -13
  267. package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +1 -0
  268. package/dist/cli-bundle/chunks/{claim-YAFUTPVK.js → claim-VX54TV5U.js} +29 -12
  269. package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{close-TGYXG7TV.js → close-3YRR3XY6.js} +9 -7
  271. package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +16 -0
  272. package/dist/cli-bundle/chunks/{close-many-SNA6LNZH.js → close-many-AP4MWU36.js} +21 -18
  273. package/dist/cli-bundle/chunks/{close-many-SNA6LNZH.js.map → close-many-AP4MWU36.js.map} +1 -1
  274. package/dist/cli-bundle/chunks/{close-many-4QSWKCRU.js → close-many-OMZIGZB4.js} +19 -16
  275. package/dist/cli-bundle/chunks/{close-many-4QSWKCRU.js.map → close-many-OMZIGZB4.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{comments-QC6ARR5X.js → comments-MIW5MZOX.js} +12 -9
  277. package/dist/cli-bundle/chunks/{comments-QC6ARR5X.js.map → comments-MIW5MZOX.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{comments-ZHVYGUVC.js → comments-SAG5LSKL.js} +14 -11
  279. package/dist/cli-bundle/chunks/{comments-ZHVYGUVC.js.map → comments-SAG5LSKL.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{config-O6W2EU2G.js → config-DJJKZB5R.js} +20 -17
  281. package/dist/cli-bundle/chunks/{config-O6W2EU2G.js.map → config-DJJKZB5R.js.map} +1 -1
  282. package/dist/cli-bundle/chunks/{config-XQRFJXJP.js → config-V57QD47V.js} +22 -19
  283. package/dist/cli-bundle/chunks/{config-XQRFJXJP.js.map → config-V57QD47V.js.map} +1 -1
  284. package/dist/cli-bundle/chunks/{context-IHE3IXN5.js → context-4OQGIPSO.js} +15 -12
  285. package/dist/cli-bundle/chunks/{context-WSYWBEUL.js → context-WLA6IAWE.js} +15 -12
  286. package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +12 -0
  287. package/dist/cli-bundle/chunks/contracts-OJEXMKVW.js +16 -0
  288. package/dist/cli-bundle/chunks/{copy-7MUQC44A.js → copy-LEE6P6EM.js} +17 -14
  289. package/dist/cli-bundle/chunks/{copy-7MUQC44A.js.map → copy-LEE6P6EM.js.map} +2 -2
  290. package/dist/cli-bundle/chunks/{copy-ANWXDJVC.js → copy-OTJOWFL6.js} +18 -15
  291. package/dist/cli-bundle/chunks/{copy-ANWXDJVC.js.map → copy-OTJOWFL6.js.map} +1 -1
  292. package/dist/cli-bundle/chunks/create-WKOZKPQR.js +30 -0
  293. package/dist/cli-bundle/chunks/{create-JIA2IFCO.js → create-XWWQFQ6S.js} +14 -12
  294. package/dist/cli-bundle/chunks/{delete-5OLYWQIC.js → delete-62JQTYT4.js} +10 -7
  295. package/dist/cli-bundle/chunks/{delete-5OLYWQIC.js.map → delete-62JQTYT4.js.map} +1 -1
  296. package/dist/cli-bundle/chunks/{delete-INHKCIRN.js → delete-HQKGRNRZ.js} +12 -9
  297. package/dist/cli-bundle/chunks/{delete-INHKCIRN.js.map → delete-HQKGRNRZ.js.map} +1 -1
  298. package/dist/cli-bundle/chunks/{deps-IYEID3QX.js → deps-55FTG6Z5.js} +12 -9
  299. package/dist/cli-bundle/chunks/{deps-IYEID3QX.js.map → deps-55FTG6Z5.js.map} +1 -1
  300. package/dist/cli-bundle/chunks/{deps-CCSWGZW7.js → deps-L2FPIAD3.js} +10 -7
  301. package/dist/cli-bundle/chunks/{deps-CCSWGZW7.js.map → deps-L2FPIAD3.js.map} +1 -1
  302. package/dist/cli-bundle/chunks/{docs-PKO7OEIM.js → docs-6CRCSVKK.js} +11 -9
  303. package/dist/cli-bundle/chunks/{docs-PKO7OEIM.js.map → docs-6CRCSVKK.js.map} +1 -1
  304. package/dist/cli-bundle/chunks/{docs-3XZK22WF.js → docs-S6UTOTO5.js} +9 -7
  305. package/dist/cli-bundle/chunks/{docs-3XZK22WF.js.map → docs-S6UTOTO5.js.map} +1 -1
  306. package/dist/cli-bundle/chunks/{eval-5XYP6NMY.js → eval-N6UHFWVO.js} +15 -11
  307. package/dist/cli-bundle/chunks/{eval-5XYP6NMY.js.map → eval-N6UHFWVO.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{eval-O4WGQYDI.js → eval-PHOTWYHI.js} +17 -13
  309. package/dist/cli-bundle/chunks/{eval-O4WGQYDI.js.map → eval-PHOTWYHI.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{extension-T7JNTAAA.js → extension-NBAH62ML.js} +17 -11
  311. package/dist/cli-bundle/chunks/{extension-PVGRRZZG.js → extension-ZF6ZZPOU.js} +17 -11
  312. package/dist/cli-bundle/chunks/{files-W7HH5EOD.js → files-6P57MRKL.js} +12 -9
  313. package/dist/cli-bundle/chunks/{files-W7HH5EOD.js.map → files-6P57MRKL.js.map} +1 -1
  314. package/dist/cli-bundle/chunks/{files-7IU56S6R.js → files-JPU3FNJ7.js} +14 -11
  315. package/dist/cli-bundle/chunks/{files-7IU56S6R.js.map → files-JPU3FNJ7.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/{focus-6FA5KYRY.js → focus-LFZ6IDBR.js} +15 -11
  317. package/dist/cli-bundle/chunks/{focus-6FA5KYRY.js.map → focus-LFZ6IDBR.js.map} +1 -1
  318. package/dist/cli-bundle/chunks/{focus-CQ63JFDG.js → focus-WNMYCVYA.js} +13 -9
  319. package/dist/cli-bundle/chunks/{focus-CQ63JFDG.js.map → focus-WNMYCVYA.js.map} +1 -1
  320. package/dist/cli-bundle/chunks/{gc-3BG67KTO.js → gc-AETFKZ44.js} +10 -7
  321. package/dist/cli-bundle/chunks/{gc-3BG67KTO.js.map → gc-AETFKZ44.js.map} +1 -1
  322. package/dist/cli-bundle/chunks/{gc-PEZYGNVB.js → gc-RLBP4QVN.js} +12 -9
  323. package/dist/cli-bundle/chunks/{gc-PEZYGNVB.js.map → gc-RLBP4QVN.js.map} +1 -1
  324. package/dist/cli-bundle/chunks/{get-J6CSJ4SX.js → get-NH2MPBCI.js} +18 -15
  325. package/dist/cli-bundle/chunks/{get-J6CSJ4SX.js.map → get-NH2MPBCI.js.map} +1 -1
  326. package/dist/cli-bundle/chunks/{get-KJTKGNEQ.js → get-P4ZQXCPZ.js} +16 -13
  327. package/dist/cli-bundle/chunks/{get-KJTKGNEQ.js.map → get-P4ZQXCPZ.js.map} +1 -1
  328. package/dist/cli-bundle/chunks/{health-32UQICEL.js → health-3GVPMQBL.js} +36 -29
  329. package/dist/cli-bundle/chunks/{health-32UQICEL.js.map → health-3GVPMQBL.js.map} +1 -1
  330. package/dist/cli-bundle/chunks/{health-ZUZG5ULV.js → health-DNTM72GJ.js} +34 -27
  331. package/dist/cli-bundle/chunks/{health-ZUZG5ULV.js.map → health-DNTM72GJ.js.map} +1 -1
  332. package/dist/cli-bundle/chunks/history-RYKLC72X.js +20 -0
  333. package/dist/cli-bundle/chunks/{history-W6QVR6FA.js → history-SGPYRAFT.js} +10 -8
  334. package/dist/cli-bundle/chunks/{history-compact-JQ6ZGYSJ.js → history-compact-3F6VELO7.js} +18 -15
  335. package/dist/cli-bundle/chunks/{history-compact-JQ6ZGYSJ.js.map → history-compact-3F6VELO7.js.map} +1 -1
  336. package/dist/cli-bundle/chunks/{history-compact-F355EGL4.js → history-compact-656Y2TN4.js} +20 -17
  337. package/dist/cli-bundle/chunks/{history-compact-F355EGL4.js.map → history-compact-656Y2TN4.js.map} +1 -1
  338. package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +21 -0
  339. package/dist/cli-bundle/chunks/{history-redact-TUWOUYX5.js → history-redact-54ICFKXM.js} +11 -9
  340. package/dist/cli-bundle/chunks/{history-repair-ZKS3LKPV.js → history-repair-4N6SDVHK.js} +17 -14
  341. package/dist/cli-bundle/chunks/{history-repair-ZKS3LKPV.js.map → history-repair-4N6SDVHK.js.map} +1 -1
  342. package/dist/cli-bundle/chunks/{history-repair-MPCAIKYE.js → history-repair-EVTO6LIH.js} +19 -16
  343. package/dist/cli-bundle/chunks/{history-repair-MPCAIKYE.js.map → history-repair-EVTO6LIH.js.map} +1 -1
  344. package/dist/cli-bundle/chunks/init-RPIPQUNV.js +32 -0
  345. package/dist/cli-bundle/chunks/init-SKQAESQS.js +28 -0
  346. package/dist/cli-bundle/chunks/{learnings-EYC3OKS2.js → learnings-2HTPZNGZ.js} +10 -8
  347. package/dist/cli-bundle/chunks/{learnings-EYC3OKS2.js.map → learnings-2HTPZNGZ.js.map} +1 -1
  348. package/dist/cli-bundle/chunks/{learnings-HKJJUVTA.js → learnings-YBIHY3D6.js} +12 -10
  349. package/dist/cli-bundle/chunks/{learnings-HKJJUVTA.js.map → learnings-YBIHY3D6.js.map} +1 -1
  350. package/dist/cli-bundle/chunks/{list-KN3TL5Y5.js → list-64LHZ3HM.js} +10 -8
  351. package/dist/cli-bundle/chunks/{list-HFD5737R.js → list-7LXBTEKI.js} +10 -8
  352. package/dist/cli-bundle/chunks/{next-DQUMFAHG.js → next-7ODPAQ4U.js} +22 -18
  353. package/dist/cli-bundle/chunks/{next-DQUMFAHG.js.map → next-7ODPAQ4U.js.map} +1 -1
  354. package/dist/cli-bundle/chunks/{next-JUEYC5HE.js → next-ODJUM4ZM.js} +24 -20
  355. package/dist/cli-bundle/chunks/{next-JUEYC5HE.js.map → next-ODJUM4ZM.js.map} +1 -1
  356. package/dist/cli-bundle/chunks/{notes-ZG6RLZXB.js → notes-72YXN5JX.js} +10 -8
  357. package/dist/cli-bundle/chunks/{notes-ZG6RLZXB.js.map → notes-72YXN5JX.js.map} +1 -1
  358. package/dist/cli-bundle/chunks/{notes-XATYT43P.js → notes-NJ7IQJX4.js} +12 -10
  359. package/dist/cli-bundle/chunks/{notes-XATYT43P.js.map → notes-NJ7IQJX4.js.map} +1 -1
  360. package/dist/cli-bundle/chunks/{plan-DVVLX7LK.js → plan-R4NDQ27E.js} +18 -15
  361. package/dist/cli-bundle/chunks/{plan-DVVLX7LK.js.map → plan-R4NDQ27E.js.map} +1 -1
  362. package/dist/cli-bundle/chunks/{plan-5NWQL2DH.js → plan-XWY5T67S.js} +20 -17
  363. package/dist/cli-bundle/chunks/{plan-5NWQL2DH.js.map → plan-XWY5T67S.js.map} +1 -1
  364. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +397 -0
  365. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +1 -0
  366. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +400 -0
  367. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +7 -0
  368. package/dist/cli-bundle/chunks/{register-list-query-WRS6ACUW.js → register-list-query-5H66WFYF.js} +22 -19
  369. package/dist/cli-bundle/chunks/{register-list-query-WRS6ACUW.js.map → register-list-query-5H66WFYF.js.map} +1 -1
  370. package/dist/cli-bundle/chunks/{register-list-query-PNRAHNIQ.js → register-list-query-FB3FNDLZ.js} +24 -21
  371. package/dist/cli-bundle/chunks/{register-list-query-PNRAHNIQ.js.map → register-list-query-FB3FNDLZ.js.map} +1 -1
  372. package/dist/cli-bundle/chunks/{register-mutation-K2MNRWGI.js → register-mutation-UJO23C7R.js} +42 -39
  373. package/dist/cli-bundle/chunks/{register-mutation-K2MNRWGI.js.map → register-mutation-UJO23C7R.js.map} +1 -1
  374. package/dist/cli-bundle/chunks/{register-mutation-ET6E4VLE.js → register-mutation-Z2ETYHKS.js} +40 -37
  375. package/dist/cli-bundle/chunks/{register-mutation-ET6E4VLE.js.map → register-mutation-Z2ETYHKS.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{register-operations-6DQRUTIX.js → register-operations-A3XAM5J7.js} +39 -36
  377. package/dist/cli-bundle/chunks/{register-operations-6DQRUTIX.js.map → register-operations-A3XAM5J7.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{register-operations-73UDWMVB.js → register-operations-SG7HBSUP.js} +37 -34
  379. package/dist/cli-bundle/chunks/{register-operations-73UDWMVB.js.map → register-operations-SG7HBSUP.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{register-setup-LYYCMQFV.js → register-setup-I45OGJUV.js} +25 -19
  381. package/dist/cli-bundle/chunks/{register-setup-LYYCMQFV.js.map → register-setup-I45OGJUV.js.map} +1 -1
  382. package/dist/cli-bundle/chunks/{register-setup-FXZJ2CEJ.js → register-setup-K6U3NVY5.js} +23 -17
  383. package/dist/cli-bundle/chunks/{register-setup-FXZJ2CEJ.js.map → register-setup-K6U3NVY5.js.map} +1 -1
  384. package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +19 -0
  385. package/dist/cli-bundle/chunks/{restore-R6YJHQK3.js → restore-YJ2ET6AT.js} +11 -9
  386. package/dist/cli-bundle/chunks/{scheduling-shortcuts-OGODPUBL.js → scheduling-shortcuts-SSC4MYWQ.js} +14 -12
  387. package/dist/cli-bundle/chunks/{scheduling-shortcuts-OGODPUBL.js.map → scheduling-shortcuts-SSC4MYWQ.js.map} +1 -1
  388. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LE4S7OI7.js → scheduling-shortcuts-ULRG7MNP.js} +16 -14
  389. package/dist/cli-bundle/chunks/{scheduling-shortcuts-LE4S7OI7.js.map → scheduling-shortcuts-ULRG7MNP.js.map} +1 -1
  390. package/dist/cli-bundle/chunks/{schema-ICCD3HOP.js → schema-2PUXCZ25.js} +10 -7
  391. package/dist/cli-bundle/chunks/{schema-RHH23PQX.js → schema-Y6DXXK2F.js} +10 -7
  392. package/dist/cli-bundle/chunks/{search-Z2VGP2Q5.js → search-3S72CTD6.js} +13 -10
  393. package/dist/cli-bundle/chunks/{search-HDDKOPFE.js → search-WNUNBQXO.js} +13 -10
  394. package/dist/cli-bundle/chunks/{stats-ETFP37MB.js → stats-IJYTRQGV.js} +13 -10
  395. package/dist/cli-bundle/chunks/{stats-ETFP37MB.js.map → stats-IJYTRQGV.js.map} +1 -1
  396. package/dist/cli-bundle/chunks/{stats-DHMRXHOB.js → stats-L2D5Y2O5.js} +15 -12
  397. package/dist/cli-bundle/chunks/{stats-DHMRXHOB.js.map → stats-L2D5Y2O5.js.map} +1 -1
  398. package/dist/cli-bundle/chunks/{telemetry-ZRBM22QD.js → telemetry-L2CVOKVN.js} +11 -8
  399. package/dist/cli-bundle/chunks/{telemetry-ZRBM22QD.js.map → telemetry-L2CVOKVN.js.map} +1 -1
  400. package/dist/cli-bundle/chunks/{telemetry-NUZNKDCP.js → telemetry-QBYWQA76.js} +13 -10
  401. package/dist/cli-bundle/chunks/{telemetry-NUZNKDCP.js.map → telemetry-QBYWQA76.js.map} +1 -1
  402. package/dist/cli-bundle/chunks/{test-XNKTIP4Y.js → test-DQ2QFJ7W.js} +21 -15
  403. package/dist/cli-bundle/chunks/test-W7QBLVJS.js +41 -0
  404. package/dist/cli-bundle/chunks/{test-all-APCBSXQI.js → test-all-636NTRTT.js} +26 -19
  405. package/dist/cli-bundle/chunks/{test-all-APCBSXQI.js.map → test-all-636NTRTT.js.map} +1 -1
  406. package/dist/cli-bundle/chunks/{test-all-KIK3OYBY.js → test-all-DWYK3RG6.js} +24 -17
  407. package/dist/cli-bundle/chunks/{test-all-KIK3OYBY.js.map → test-all-DWYK3RG6.js.map} +1 -1
  408. package/dist/cli-bundle/chunks/test-runs-245OINZR.js +28 -0
  409. package/dist/cli-bundle/chunks/test-runs-245OINZR.js.map +1 -0
  410. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +24 -0
  411. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js.map +7 -0
  412. package/dist/cli-bundle/chunks/update-SFLZPJXX.js +30 -0
  413. package/dist/cli-bundle/chunks/update-SFLZPJXX.js.map +1 -0
  414. package/dist/cli-bundle/chunks/update-SJZ6S77U.js +26 -0
  415. package/dist/cli-bundle/chunks/update-SJZ6S77U.js.map +7 -0
  416. package/dist/cli-bundle/chunks/{update-many-XGTJ7QIU.js → update-many-DC7X3EWM.js} +32 -29
  417. package/dist/cli-bundle/chunks/{update-many-XGTJ7QIU.js.map → update-many-DC7X3EWM.js.map} +1 -1
  418. package/dist/cli-bundle/chunks/{update-many-GFCQG6ZQ.js → update-many-SLLAMHT7.js} +34 -31
  419. package/dist/cli-bundle/chunks/{update-many-GFCQG6ZQ.js.map → update-many-SLLAMHT7.js.map} +1 -1
  420. package/dist/cli-bundle/chunks/{upgrade-KJ3JGELR.js → upgrade-HFFXLZJA.js} +19 -12
  421. package/dist/cli-bundle/chunks/{upgrade-KJ3JGELR.js.map → upgrade-HFFXLZJA.js.map} +1 -1
  422. package/dist/cli-bundle/chunks/{upgrade-RBRQ7PQU.js → upgrade-UYQKM7RF.js} +21 -14
  423. package/dist/cli-bundle/chunks/{upgrade-RBRQ7PQU.js.map → upgrade-UYQKM7RF.js.map} +1 -1
  424. package/dist/cli-bundle/chunks/{validate-EW6TGC7R.js → validate-PA4FDTOV.js} +34 -27
  425. package/dist/cli-bundle/chunks/{validate-EW6TGC7R.js.map → validate-PA4FDTOV.js.map} +2 -2
  426. package/dist/cli-bundle/chunks/{validate-T6PR5WAL.js → validate-Z7L75YEJ.js} +35 -28
  427. package/dist/cli-bundle/chunks/{validate-T6PR5WAL.js.map → validate-Z7L75YEJ.js.map} +1 -1
  428. package/dist/cli-bundle/main.js +173 -57
  429. package/dist/cli-bundle/main.js.map +2 -2
  430. package/dist/cli-bundle/sdk-runtime.js +247 -0
  431. package/dist/cli-bundle/sdk-runtime.js.map +7 -0
  432. package/dist/cli-bundle/sdk-testing.js +101 -0
  433. package/dist/cli-bundle/sdk-testing.js.map +7 -0
  434. package/dist/cli-bundle/sdk.js +787 -0
  435. package/dist/cli-bundle/sdk.js.map +7 -0
  436. package/dist/core/config/nested-settings.d.ts +4 -3
  437. package/dist/core/config/nested-settings.js +17 -6
  438. package/dist/core/config/nested-settings.js.map +1 -1
  439. package/dist/core/extensions/activation-summary.d.ts +6 -0
  440. package/dist/core/extensions/activation-summary.js +10 -4
  441. package/dist/core/extensions/activation-summary.js.map +1 -1
  442. package/dist/core/extensions/capability-usage.d.ts +6 -0
  443. package/dist/core/extensions/capability-usage.js +10 -4
  444. package/dist/core/extensions/capability-usage.js.map +1 -1
  445. package/dist/core/extensions/extension-types.d.ts +5 -0
  446. package/dist/core/extensions/extension-types.js +2 -2
  447. package/dist/core/extensions/extension-types.js.map +1 -1
  448. package/dist/core/extensions/loader.d.ts +3 -0
  449. package/dist/core/extensions/loader.js +11 -19
  450. package/dist/core/extensions/loader.js.map +1 -1
  451. package/dist/core/history/history-rewrite.js +3 -3
  452. package/dist/core/history/history-rewrite.js.map +1 -1
  453. package/dist/core/item/parent-reference-policy.d.ts +9 -1
  454. package/dist/core/item/parent-reference-policy.js +28 -4
  455. package/dist/core/item/parent-reference-policy.js.map +1 -1
  456. package/dist/core/lock/lock.d.ts +28 -1
  457. package/dist/core/lock/lock.js +254 -20
  458. package/dist/core/lock/lock.js.map +1 -1
  459. package/dist/core/search/background-refresh.js +7 -19
  460. package/dist/core/search/background-refresh.js.map +1 -1
  461. package/dist/core/search/http-client.d.ts +0 -1
  462. package/dist/core/search/http-client.js +3 -3
  463. package/dist/core/search/http-client.js.map +1 -1
  464. package/dist/core/shared/constants.js +3 -2
  465. package/dist/core/shared/constants.js.map +1 -1
  466. package/dist/core/shared/errors.d.ts +1 -0
  467. package/dist/core/shared/errors.js +2 -2
  468. package/dist/core/shared/errors.js.map +1 -1
  469. package/dist/core/shared/primitives.d.ts +12 -0
  470. package/dist/core/shared/primitives.js +29 -2
  471. package/dist/core/shared/primitives.js.map +1 -1
  472. package/dist/core/store/item-store.js +3 -3
  473. package/dist/core/store/item-store.js.map +1 -1
  474. package/dist/core/store/settings-validator.d.ts +1 -0
  475. package/dist/core/store/settings-validator.js +6 -3
  476. package/dist/core/store/settings-validator.js.map +1 -1
  477. package/dist/core/store/settings.js +3 -3
  478. package/dist/core/store/settings.js.map +1 -1
  479. package/dist/core/validate/fix-planning.d.ts +0 -2
  480. package/dist/core/validate/fix-planning.js +3 -3
  481. package/dist/core/validate/fix-planning.js.map +1 -1
  482. package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -2
  483. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  484. package/dist/sdk/cli-contracts/flag-contracts.js +3 -2
  485. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  486. package/dist/sdk/errors.d.ts +21 -2
  487. package/dist/sdk/errors.js +8 -2
  488. package/dist/sdk/errors.js.map +1 -1
  489. package/dist/sdk/package-import-adapters.js +3 -3
  490. package/dist/sdk/package-import-adapters.js.map +1 -1
  491. package/dist/sdk/testing.js +41 -19
  492. package/dist/sdk/testing.js.map +1 -1
  493. package/dist/types.d.ts +6 -0
  494. package/dist/types.js +2 -2
  495. package/dist/types.js.map +1 -1
  496. package/docs/ARCHITECTURE.md +27 -0
  497. package/docs/CONFIGURATION.md +3 -0
  498. package/docs/README.md +1 -0
  499. package/docs/SDK_PRIMITIVE_INVENTORY.md +55 -0
  500. package/docs/TESTING.md +5 -1
  501. package/docs/examples/ci/github-actions-pm-extension-gate.yml +5 -5
  502. package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +1 -1
  503. package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +1 -1
  504. package/package.json +11 -24
  505. package/packages/pm-beads/extensions/beads/package.json +3 -0
  506. package/packages/pm-beads/extensions/beads/runtime-loader.ts +24 -2
  507. package/packages/pm-calendar/extensions/calendar/package.json +3 -0
  508. package/packages/pm-command-kit/extensions/command-kit/package.json +3 -0
  509. package/packages/pm-governance-audit/extensions/governance-audit/package.json +3 -0
  510. package/packages/pm-guide-shell/extensions/guide-shell/package.json +3 -0
  511. package/packages/pm-kanban/extensions/kanban/package.json +3 -0
  512. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/package.json +3 -0
  513. package/packages/pm-search-advanced/extensions/search-advanced/package.json +3 -0
  514. package/packages/pm-templates/extensions/templates/package.json +3 -0
  515. package/packages/pm-todos/extensions/todos/package.json +3 -0
  516. package/packages/pm-todos/extensions/todos/runtime-loader.ts +21 -3
  517. package/scripts/bundle-cli.mjs +12 -2
  518. package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +0 -16
  519. package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +0 -7
  520. package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +0 -7
  521. package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +0 -1
  522. package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +0 -7
  523. package/dist/cli-bundle/chunks/chunk-AOP2EMK3.js.map +0 -1
  524. package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +0 -1
  525. package/dist/cli-bundle/chunks/chunk-B4O5S7I3.js.map +0 -7
  526. package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +0 -7
  527. package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +0 -7
  528. package/dist/cli-bundle/chunks/chunk-EH23N5FX.js.map +0 -1
  529. package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +0 -1
  530. package/dist/cli-bundle/chunks/chunk-J4KNRDI3.js.map +0 -1
  531. package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +0 -7
  532. package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +0 -1
  533. package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +0 -1
  534. package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +0 -7
  535. package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +0 -7
  536. package/dist/cli-bundle/chunks/chunk-NGDK3KEZ.js.map +0 -7
  537. package/dist/cli-bundle/chunks/chunk-Q3XVLRCJ.js.map +0 -1
  538. package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +0 -7
  539. package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +0 -1
  540. package/dist/cli-bundle/chunks/chunk-TUV7SIWZ.js.map +0 -7
  541. package/dist/cli-bundle/chunks/chunk-UGDONITK.js.map +0 -7
  542. package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +0 -1
  543. package/dist/cli-bundle/chunks/chunk-WBWRQS32.js.map +0 -1
  544. package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +0 -1
  545. package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +0 -1
  546. package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +0 -1
  547. package/dist/cli-bundle/chunks/chunk-Z4DGFQDH.js.map +0 -1
  548. package/dist/cli-bundle/chunks/claim-D6L33A5Y.js.map +0 -1
  549. package/dist/cli-bundle/chunks/claim-YAFUTPVK.js.map +0 -7
  550. package/dist/cli-bundle/chunks/close-KLDLHAOP.js +0 -14
  551. package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +0 -28
  552. package/dist/cli-bundle/chunks/history-IOH6FKG7.js +0 -18
  553. package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +0 -19
  554. package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +0 -22
  555. package/dist/cli-bundle/chunks/init-MAA6UMNQ.js +0 -26
  556. package/dist/cli-bundle/chunks/profile-54DZ4CLB.js +0 -1205
  557. package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +0 -1
  558. package/dist/cli-bundle/chunks/profile-PLIQVEOY.js +0 -1243
  559. package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +0 -7
  560. package/dist/cli-bundle/chunks/restore-L27TMMCF.js +0 -17
  561. package/dist/cli-bundle/chunks/test-H36PM746.js +0 -35
  562. package/dist/cli-bundle/chunks/update-RQKI3AMW.js +0 -24
  563. package/dist/cli-bundle/chunks/update-ZM7NJWHY.js +0 -28
  564. /package/dist/cli-bundle/chunks/{activity-IDS5GSYG.js.map → activity-4XQIDNM5.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{activity-OENQCYZD.js.map → activity-YKAKZTZ4.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-4SHME4VR.js.map → chunk-5JE6SMYS.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-4EVY7CQN.js.map → chunk-N6DNM2FA.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-YZR7UMZ6.js.map → chunk-NER3KUUS.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-WTXDLBSZ.js.map → chunk-PDXT6Q55.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-724VLYDJ.js.map → chunk-RX3HQSYG.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-PUVPC5DL.js.map → chunk-S4APD35C.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-A2W3XKAD.js.map → chunk-T35XLYZF.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{chunk-ZZWMJVW2.js.map → chunk-TT42JUMF.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{chunk-W5X3AHJN.js.map → chunk-YOF5VPKM.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{chunk-MZ4NH46V.js.map → chunk-ZMD35NYG.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-TGYXG7TV.js.map → close-3YRR3XY6.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{close-KLDLHAOP.js.map → close-OB2Y4QP5.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{context-IHE3IXN5.js.map → context-4OQGIPSO.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-WSYWBEUL.js.map → context-WLA6IAWE.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{create-AJ6HUR5W.js.map → contracts-HXJLKCRI.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{create-JIA2IFCO.js.map → contracts-OJEXMKVW.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{extension-T7JNTAAA.js.map → create-WKOZKPQR.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{extension-PVGRRZZG.js.map → create-XWWQFQ6S.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{history-IOH6FKG7.js.map → extension-NBAH62ML.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{history-W6QVR6FA.js.map → extension-ZF6ZZPOU.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{history-redact-VVDOARNO.js.map → history-RYKLC72X.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{history-redact-TUWOUYX5.js.map → history-SGPYRAFT.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{init-CZLEEE6Q.js.map → history-redact-4H3FCKF3.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{init-MAA6UMNQ.js.map → history-redact-54ICFKXM.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{list-HFD5737R.js.map → init-RPIPQUNV.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{list-KN3TL5Y5.js.map → init-SKQAESQS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{restore-L27TMMCF.js.map → list-64LHZ3HM.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{restore-R6YJHQK3.js.map → list-7LXBTEKI.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{schema-ICCD3HOP.js.map → restore-PXOFL6AM.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{schema-RHH23PQX.js.map → restore-YJ2ET6AT.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{search-HDDKOPFE.js.map → schema-2PUXCZ25.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{search-Z2VGP2Q5.js.map → schema-Y6DXXK2F.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{test-XNKTIP4Y.js.map → search-3S72CTD6.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{test-H36PM746.js.map → search-WNUNBQXO.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{update-ZM7NJWHY.js.map → test-DQ2QFJ7W.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{update-RQKI3AMW.js.map → test-W7QBLVJS.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  // dist/core/fs/fs-utils.js
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="59f1e772-921a-51db-980b-56d08f636039")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b82b3892-108d-51df-a033-47913481d9b1")}catch(e){}}();
4
4
  import * as fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import crypto from "node:crypto";
@@ -153,6 +153,16 @@ function resolvePmCliVersion(metaUrl, fallbackRelativeSegments = []) {
153
153
  return void 0;
154
154
  }
155
155
  }
156
+ function resolveConfiguredPmPackageRoot(env = process.env, envName = "PM_CLI_PACKAGE_ROOT", metaUrl, fallbackRelativeSegments = []) {
157
+ const envRoot = env[envName];
158
+ if (typeof envRoot === "string" && envRoot.trim().length > 0) {
159
+ return path3.resolve(envRoot.trim());
160
+ }
161
+ if (metaUrl) {
162
+ return resolvePmPackageRootFromModule(metaUrl, fallbackRelativeSegments);
163
+ }
164
+ return process.cwd();
165
+ }
156
166
 
157
167
  // dist/core/extensions/extension-types.js
158
168
  var KNOWN_EXTENSION_CAPABILITIES = [
@@ -431,7 +441,8 @@ var SETTINGS_DEFAULTS = {
431
441
  author_default: "",
432
442
  item_format: "toon",
433
443
  locks: {
434
- ttl_seconds: 1800
444
+ ttl_seconds: 1800,
445
+ wait_ms: 3e3
435
446
  },
436
447
  checkpoints: {
437
448
  retention_days: 14
@@ -1592,6 +1603,23 @@ function asRecordLoose(value) {
1592
1603
  }
1593
1604
  return value;
1594
1605
  }
1606
+ function asPropertyRecord(value) {
1607
+ if (typeof value !== "object" && typeof value !== "function" || value === null) {
1608
+ return null;
1609
+ }
1610
+ return value;
1611
+ }
1612
+ function resolveActivatablePropertyRecord(value) {
1613
+ const moduleRecord = asPropertyRecord(value);
1614
+ if (!moduleRecord) {
1615
+ return null;
1616
+ }
1617
+ if (typeof moduleRecord.activate === "function") {
1618
+ return moduleRecord;
1619
+ }
1620
+ const defaultExport = asPropertyRecord(moduleRecord.default);
1621
+ return typeof defaultExport?.activate === "function" ? defaultExport : null;
1622
+ }
1595
1623
 
1596
1624
  // dist/core/shared/levenshtein.js
1597
1625
  function levenshteinDistanceWithinLimit(left, right, limit) {
@@ -1638,6 +1666,132 @@ function levenshteinDistanceWithinLimit(left, right, limit) {
1638
1666
  return result <= limit ? result : null;
1639
1667
  }
1640
1668
 
1669
+ // dist/core/extensions/extension-capability-aliases.js
1670
+ function normalizeNames(values) {
1671
+ return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) => a.localeCompare(b));
1672
+ }
1673
+ function isKnownExtensionCapability(value) {
1674
+ return KNOWN_EXTENSION_CAPABILITIES.includes(value);
1675
+ }
1676
+ function normalizeKnownExtensionCapability(value) {
1677
+ const normalized = value.trim().toLowerCase();
1678
+ return isKnownExtensionCapability(normalized) ? normalized : null;
1679
+ }
1680
+ function collectUnknownExtensionCapabilities(capabilities) {
1681
+ return capabilities.filter((capability) => !isKnownExtensionCapability(capability));
1682
+ }
1683
+ function resolveLegacyExtensionCapabilityAlias(capability) {
1684
+ const normalized = capability.trim().toLowerCase();
1685
+ if (normalized.length === 0) {
1686
+ return null;
1687
+ }
1688
+ return EXTENSION_CAPABILITY_LEGACY_ALIASES[normalized] ?? null;
1689
+ }
1690
+ function normalizeManifestCapabilities(rawCapabilities) {
1691
+ const normalizedCapabilities = normalizeNames([...rawCapabilities].map((value) => value.toLowerCase()));
1692
+ const remappedCapabilities = [];
1693
+ const legacyAliases = [];
1694
+ for (const capability of normalizedCapabilities) {
1695
+ const legacyAliasTarget = resolveLegacyExtensionCapabilityAlias(capability);
1696
+ if (legacyAliasTarget) {
1697
+ remappedCapabilities.push(legacyAliasTarget);
1698
+ legacyAliases.push({
1699
+ alias: capability,
1700
+ target: legacyAliasTarget
1701
+ });
1702
+ continue;
1703
+ }
1704
+ remappedCapabilities.push(capability);
1705
+ }
1706
+ const dedupedLegacyAliases = [...new Map(legacyAliases.map((entry) => [`${entry.alias}>${entry.target}`, entry])).values()].sort((left, right) => left.alias.localeCompare(right.alias));
1707
+ return {
1708
+ capabilities: normalizeNames(remappedCapabilities),
1709
+ legacy_aliases: dedupedLegacyAliases
1710
+ };
1711
+ }
1712
+ function suggestKnownExtensionCapability(capability) {
1713
+ const normalized = capability.trim().toLowerCase();
1714
+ if (normalized.length === 0) {
1715
+ return null;
1716
+ }
1717
+ const legacyAlias = resolveLegacyExtensionCapabilityAlias(normalized);
1718
+ if (legacyAlias) {
1719
+ return legacyAlias;
1720
+ }
1721
+ const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));
1722
+ let bestMatch = null;
1723
+ let bestDistance = Number.POSITIVE_INFINITY;
1724
+ for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {
1725
+ const distance = levenshteinDistanceWithinLimit(normalized, candidate, maxDistance);
1726
+ if (distance !== null && distance < bestDistance) {
1727
+ bestDistance = distance;
1728
+ bestMatch = candidate;
1729
+ }
1730
+ }
1731
+ return bestMatch;
1732
+ }
1733
+ function formatUnknownExtensionCapabilityWarning(layer, name, capability) {
1734
+ const allowed = KNOWN_EXTENSION_CAPABILITIES.join(",");
1735
+ const suggested = suggestKnownExtensionCapability(capability) ?? "none";
1736
+ return `extension_capability_unknown:${layer}:${name}:${capability}:allowed=${allowed}:suggested=${suggested}`;
1737
+ }
1738
+ function formatLegacyExtensionCapabilityAliasWarning(layer, name, aliases) {
1739
+ const aliasesToken = aliases.map((entry) => `${entry.alias}>${entry.target}`).join(",");
1740
+ return `extension_capability_legacy_alias:${layer}:${name}:aliases=${aliasesToken}`;
1741
+ }
1742
+ function parseUnknownExtensionCapabilityWarning(warning) {
1743
+ const match = /^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(warning.trim());
1744
+ if (!match) {
1745
+ return null;
1746
+ }
1747
+ const [, layerRaw, name, capability, allowedRaw, suggestedRaw] = match;
1748
+ const layer = layerRaw;
1749
+ const allowed_capabilities = allowedRaw.split(",").map((value) => value.trim()).filter((value) => value.length > 0);
1750
+ const legacyAlias = resolveLegacyExtensionCapabilityAlias(capability);
1751
+ const suggestedFromWarning = suggestedRaw === "none" ? void 0 : suggestedRaw;
1752
+ const suggested_capability = suggestedFromWarning ?? legacyAlias ?? void 0;
1753
+ const suggestion_source = suggested_capability ? legacyAlias === suggested_capability ? "legacy_alias" : "nearest_match" : void 0;
1754
+ return {
1755
+ layer,
1756
+ name,
1757
+ capability,
1758
+ allowed_capabilities,
1759
+ capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,
1760
+ suggested_capability,
1761
+ suggestion_source,
1762
+ legacy_alias_target: legacyAlias ?? void 0
1763
+ };
1764
+ }
1765
+ function parseLegacyExtensionCapabilityAliasWarning(warning) {
1766
+ const match = /^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(warning.trim());
1767
+ if (!match) {
1768
+ return [];
1769
+ }
1770
+ const [, layerRaw, name, aliasesRaw] = match;
1771
+ const layer = layerRaw;
1772
+ const allowedCapabilities = [...KNOWN_EXTENSION_CAPABILITIES];
1773
+ const parsed = [];
1774
+ for (const token of aliasesRaw.split(",")) {
1775
+ const [rawAlias, rawTarget] = token.split(">");
1776
+ const alias = rawAlias?.trim();
1777
+ const target = rawTarget?.trim().toLowerCase();
1778
+ if (!alias || !target || !isKnownExtensionCapability(target)) {
1779
+ continue;
1780
+ }
1781
+ parsed.push({
1782
+ layer,
1783
+ name,
1784
+ capability: alias,
1785
+ allowed_capabilities: allowedCapabilities,
1786
+ capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,
1787
+ suggested_capability: target,
1788
+ suggestion_source: "legacy_alias",
1789
+ legacy_alias_target: target
1790
+ });
1791
+ }
1792
+ return parsed;
1793
+ }
1794
+
1641
1795
  // dist/core/extensions/extension-registries.js
1642
1796
  function createEmptyExtensionHookRegistry() {
1643
1797
  return {
@@ -2269,205 +2423,79 @@ function evaluatePmMaxVersionBound(required, currentVersion, exceededMode) {
2269
2423
  return { kind: "pm_max_version", status: "ok", allowed: true, required: declared, current: currentVersion };
2270
2424
  }
2271
2425
 
2272
- // dist/core/extensions/extension-capability-aliases.js
2273
- function normalizeNames(values) {
2274
- return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) => a.localeCompare(b));
2426
+ // dist/core/extensions/extension-policy.js
2427
+ function normalizePolicyName(value) {
2428
+ if (typeof value !== "string") {
2429
+ return "";
2430
+ }
2431
+ return value.trim().toLowerCase();
2275
2432
  }
2276
- function isKnownExtensionCapability(value) {
2277
- return KNOWN_EXTENSION_CAPABILITIES.includes(value);
2433
+ function normalizePolicyStringSet(values) {
2434
+ return new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0));
2278
2435
  }
2279
- function normalizeKnownExtensionCapability(value) {
2436
+ function normalizePolicySurfaceToken(value) {
2280
2437
  const normalized = value.trim().toLowerCase();
2281
- return isKnownExtensionCapability(normalized) ? normalized : null;
2438
+ if (normalized.length === 0) {
2439
+ return "";
2440
+ }
2441
+ const segments = normalized.split(/[.:/]/).map((segment) => segment.replace(/[\s_-]+/g, "")).filter((segment) => segment.length > 0);
2442
+ if (segments.length === 0) {
2443
+ return "";
2444
+ }
2445
+ if (segments.length === 1) {
2446
+ return segments[0];
2447
+ }
2448
+ return `${segments[0]}.${segments.slice(1).join("")}`;
2282
2449
  }
2283
- function collectUnknownExtensionCapabilities(capabilities) {
2284
- return capabilities.filter((capability) => !isKnownExtensionCapability(capability));
2450
+ function normalizePolicySurfaceSet(values) {
2451
+ return new Set((values ?? []).map((value) => normalizePolicySurfaceToken(value)).filter((value) => value.length > 0));
2285
2452
  }
2286
- function resolveLegacyExtensionCapabilityAlias(capability) {
2287
- const normalized = capability.trim().toLowerCase();
2288
- if (normalized.length === 0) {
2289
- return null;
2453
+ function normalizePolicyMode(value) {
2454
+ const normalized = normalizePolicyName(value);
2455
+ if (KNOWN_EXTENSION_POLICY_MODES.includes(normalized)) {
2456
+ return normalized;
2290
2457
  }
2291
- return EXTENSION_CAPABILITY_LEGACY_ALIASES[normalized] ?? null;
2458
+ return "off";
2292
2459
  }
2293
- function normalizeManifestCapabilities(rawCapabilities) {
2294
- const normalizedCapabilities = normalizeNames([...rawCapabilities].map((value) => value.toLowerCase()));
2295
- const remappedCapabilities = [];
2296
- const legacyAliases = [];
2297
- for (const capability of normalizedCapabilities) {
2298
- const legacyAliasTarget = resolveLegacyExtensionCapabilityAlias(capability);
2299
- if (legacyAliasTarget) {
2300
- remappedCapabilities.push(legacyAliasTarget);
2301
- legacyAliases.push({
2302
- alias: capability,
2303
- target: legacyAliasTarget
2304
- });
2305
- continue;
2306
- }
2307
- remappedCapabilities.push(capability);
2460
+ function normalizePolicyTrustMode(value) {
2461
+ const normalized = normalizePolicyName(value);
2462
+ if (KNOWN_EXTENSION_TRUST_MODES.includes(normalized)) {
2463
+ return normalized;
2308
2464
  }
2309
- const dedupedLegacyAliases = [...new Map(legacyAliases.map((entry) => [`${entry.alias}>${entry.target}`, entry])).values()].sort((left, right) => left.alias.localeCompare(right.alias));
2310
- return {
2311
- capabilities: normalizeNames(remappedCapabilities),
2312
- legacy_aliases: dedupedLegacyAliases
2313
- };
2465
+ return "off";
2314
2466
  }
2315
- function suggestKnownExtensionCapability(capability) {
2316
- const normalized = capability.trim().toLowerCase();
2317
- if (normalized.length === 0) {
2318
- return null;
2467
+ function normalizePolicySandboxProfile(value) {
2468
+ const normalized = normalizePolicyName(value);
2469
+ if (KNOWN_EXTENSION_SANDBOX_PROFILES.includes(normalized)) {
2470
+ return normalized;
2319
2471
  }
2320
- const legacyAlias = resolveLegacyExtensionCapabilityAlias(normalized);
2321
- if (legacyAlias) {
2322
- return legacyAlias;
2472
+ return "none";
2473
+ }
2474
+ function normalizePmMaxVersionExceededModeValue(value) {
2475
+ if (typeof value !== "string") {
2476
+ return void 0;
2323
2477
  }
2324
- const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));
2325
- let bestMatch = null;
2326
- let bestDistance = Number.POSITIVE_INFINITY;
2327
- for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {
2328
- const distance = levenshteinDistanceWithinLimit(normalized, candidate, maxDistance);
2329
- if (distance !== null && distance < bestDistance) {
2330
- bestDistance = distance;
2331
- bestMatch = candidate;
2332
- }
2478
+ const normalized = value.trim().toLowerCase();
2479
+ return KNOWN_PM_MAX_VERSION_EXCEEDED_MODES.includes(normalized) ? normalized : void 0;
2480
+ }
2481
+ function normalizePmMaxVersionExceededMode(value) {
2482
+ if (typeof value === "string") {
2483
+ const mode = normalizePmMaxVersionExceededModeValue(value) ?? "block";
2484
+ return { global: mode, project: mode };
2333
2485
  }
2334
- return bestMatch;
2486
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
2487
+ return {
2488
+ global: normalizePmMaxVersionExceededModeValue(value.global) ?? "block",
2489
+ project: normalizePmMaxVersionExceededModeValue(value.project) ?? "block"
2490
+ };
2491
+ }
2492
+ return { global: "block", project: "block" };
2335
2493
  }
2336
- function formatUnknownExtensionCapabilityWarning(layer, name, capability) {
2337
- const allowed = KNOWN_EXTENSION_CAPABILITIES.join(",");
2338
- const suggested = suggestKnownExtensionCapability(capability) ?? "none";
2339
- return `extension_capability_unknown:${layer}:${name}:${capability}:allowed=${allowed}:suggested=${suggested}`;
2494
+ function serializePmMaxVersionExceededMode(mode) {
2495
+ return mode.global === mode.project ? mode.global : { global: mode.global, project: mode.project };
2340
2496
  }
2341
- function formatLegacyExtensionCapabilityAliasWarning(layer, name, aliases) {
2342
- const aliasesToken = aliases.map((entry) => `${entry.alias}>${entry.target}`).join(",");
2343
- return `extension_capability_legacy_alias:${layer}:${name}:aliases=${aliasesToken}`;
2344
- }
2345
- function parseUnknownExtensionCapabilityWarning(warning) {
2346
- const match = /^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(warning.trim());
2347
- if (!match) {
2348
- return null;
2349
- }
2350
- const [, layerRaw, name, capability, allowedRaw, suggestedRaw] = match;
2351
- const layer = layerRaw;
2352
- const allowed_capabilities = allowedRaw.split(",").map((value) => value.trim()).filter((value) => value.length > 0);
2353
- const legacyAlias = resolveLegacyExtensionCapabilityAlias(capability);
2354
- const suggestedFromWarning = suggestedRaw === "none" ? void 0 : suggestedRaw;
2355
- const suggested_capability = suggestedFromWarning ?? legacyAlias ?? void 0;
2356
- const suggestion_source = suggested_capability ? legacyAlias === suggested_capability ? "legacy_alias" : "nearest_match" : void 0;
2357
- return {
2358
- layer,
2359
- name,
2360
- capability,
2361
- allowed_capabilities,
2362
- capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,
2363
- suggested_capability,
2364
- suggestion_source,
2365
- legacy_alias_target: legacyAlias ?? void 0
2366
- };
2367
- }
2368
- function parseLegacyExtensionCapabilityAliasWarning(warning) {
2369
- const match = /^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(warning.trim());
2370
- if (!match) {
2371
- return [];
2372
- }
2373
- const [, layerRaw, name, aliasesRaw] = match;
2374
- const layer = layerRaw;
2375
- const allowedCapabilities = [...KNOWN_EXTENSION_CAPABILITIES];
2376
- const parsed = [];
2377
- for (const token of aliasesRaw.split(",")) {
2378
- const [rawAlias, rawTarget] = token.split(">");
2379
- const alias = rawAlias?.trim();
2380
- const target = rawTarget?.trim().toLowerCase();
2381
- if (!alias || !target || !isKnownExtensionCapability(target)) {
2382
- continue;
2383
- }
2384
- parsed.push({
2385
- layer,
2386
- name,
2387
- capability: alias,
2388
- allowed_capabilities: allowedCapabilities,
2389
- capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,
2390
- suggested_capability: target,
2391
- suggestion_source: "legacy_alias",
2392
- legacy_alias_target: target
2393
- });
2394
- }
2395
- return parsed;
2396
- }
2397
-
2398
- // dist/core/extensions/extension-policy.js
2399
- function normalizePolicyName(value) {
2400
- if (typeof value !== "string") {
2401
- return "";
2402
- }
2403
- return value.trim().toLowerCase();
2404
- }
2405
- function normalizePolicyStringSet(values) {
2406
- return new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0));
2407
- }
2408
- function normalizePolicySurfaceToken(value) {
2409
- const normalized = value.trim().toLowerCase();
2410
- if (normalized.length === 0) {
2411
- return "";
2412
- }
2413
- const segments = normalized.split(/[.:/]/).map((segment) => segment.replace(/[\s_-]+/g, "")).filter((segment) => segment.length > 0);
2414
- if (segments.length === 0) {
2415
- return "";
2416
- }
2417
- if (segments.length === 1) {
2418
- return segments[0];
2419
- }
2420
- return `${segments[0]}.${segments.slice(1).join("")}`;
2421
- }
2422
- function normalizePolicySurfaceSet(values) {
2423
- return new Set((values ?? []).map((value) => normalizePolicySurfaceToken(value)).filter((value) => value.length > 0));
2424
- }
2425
- function normalizePolicyMode(value) {
2426
- const normalized = normalizePolicyName(value);
2427
- if (KNOWN_EXTENSION_POLICY_MODES.includes(normalized)) {
2428
- return normalized;
2429
- }
2430
- return "off";
2431
- }
2432
- function normalizePolicyTrustMode(value) {
2433
- const normalized = normalizePolicyName(value);
2434
- if (KNOWN_EXTENSION_TRUST_MODES.includes(normalized)) {
2435
- return normalized;
2436
- }
2437
- return "off";
2438
- }
2439
- function normalizePolicySandboxProfile(value) {
2440
- const normalized = normalizePolicyName(value);
2441
- if (KNOWN_EXTENSION_SANDBOX_PROFILES.includes(normalized)) {
2442
- return normalized;
2443
- }
2444
- return "none";
2445
- }
2446
- function normalizePmMaxVersionExceededModeValue(value) {
2447
- if (typeof value !== "string") {
2448
- return void 0;
2449
- }
2450
- const normalized = value.trim().toLowerCase();
2451
- return KNOWN_PM_MAX_VERSION_EXCEEDED_MODES.includes(normalized) ? normalized : void 0;
2452
- }
2453
- function normalizePmMaxVersionExceededMode(value) {
2454
- if (typeof value === "string") {
2455
- const mode = normalizePmMaxVersionExceededModeValue(value) ?? "block";
2456
- return { global: mode, project: mode };
2457
- }
2458
- if (typeof value === "object" && value !== null && !Array.isArray(value)) {
2459
- return {
2460
- global: normalizePmMaxVersionExceededModeValue(value.global) ?? "block",
2461
- project: normalizePmMaxVersionExceededModeValue(value.project) ?? "block"
2462
- };
2463
- }
2464
- return { global: "block", project: "block" };
2465
- }
2466
- function serializePmMaxVersionExceededMode(mode) {
2467
- return mode.global === mode.project ? mode.global : { global: mode.global, project: mode.project };
2468
- }
2469
- function toSortedList(values) {
2470
- return [...new Set(values)].sort((left, right) => left.localeCompare(right));
2497
+ function toSortedList(values) {
2498
+ return [...new Set(values)].sort((left, right) => left.localeCompare(right));
2471
2499
  }
2472
2500
  function buildExtensionPolicyOverride(rawOverride) {
2473
2501
  const name = normalizePolicyName(rawOverride.name);
@@ -3230,14 +3258,14 @@ function buildEffectiveExtensions(globalCandidates, projectCandidates) {
3230
3258
  }
3231
3259
  return effective;
3232
3260
  }
3233
- async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled, pmMaxVersionExceededMode2) {
3261
+ async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled, pmMaxVersionExceededMode) {
3234
3262
  const diagnostics = [];
3235
3263
  const warnings = [];
3236
3264
  const candidates = [];
3237
3265
  const directories = await listExtensionDirectories(extensionsRoot);
3238
3266
  const managedSourcePackages = await readManagedExtensionSourcePackages(extensionsRoot);
3239
3267
  for (const directory of directories) {
3240
- const scanned = await scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode2);
3268
+ const scanned = await scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode);
3241
3269
  diagnostics.push(scanned.diagnostic);
3242
3270
  warnings.push(...scanned.warnings);
3243
3271
  if (scanned.candidate) {
@@ -3285,13 +3313,13 @@ function collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory,
3285
3313
  }
3286
3314
  return extensionWarnings;
3287
3315
  }
3288
- async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode2) {
3316
+ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode) {
3289
3317
  const extensionDir = path5.join(extensionsRoot, directory);
3290
3318
  const manifestPath = path5.join(extensionDir, "manifest.json");
3291
3319
  if (!await pathExists(manifestPath)) {
3292
3320
  return buildUnavailableExtensionScan(layer, directory, manifestPath, `extension_manifest_missing:${layer}:${directory}`);
3293
3321
  }
3294
- let manifest = null;
3322
+ let manifest;
3295
3323
  try {
3296
3324
  const parsed = JSON.parse(await fs3.readFile(manifestPath, "utf8"));
3297
3325
  manifest = parseManifest(parsed);
@@ -3307,7 +3335,7 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
3307
3335
  const entryWithinDirectory = entryWithinDirectoryByPath && entryExists ? await isCanonicalPathWithinDirectory(extensionDir, entryPath) : entryWithinDirectoryByPath;
3308
3336
  const enabledForLoad = shouldEnable(manifest.name, enabled, disabled);
3309
3337
  const pmVersionCompatibility = await evaluatePmMinVersionCompatibility(layer, manifest);
3310
- const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest, pmMaxVersionExceededMode2);
3338
+ const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest, pmMaxVersionExceededMode);
3311
3339
  const extensionWarnings = collectScannedExtensionWarnings(layer, manifest, entryWithinDirectory, entryExists, pmVersionCompatibility, pmMaxVersionCompatibility);
3312
3340
  const extensionReady = entryWithinDirectory && entryExists && pmVersionCompatibility.allowed && pmMaxVersionCompatibility.allowed;
3313
3341
  const sourcePackage = managedSourcePackages.get(`directory:${directory}`) ?? managedSourcePackages.get(`name:${manifest.name}`);
@@ -3502,7 +3530,8 @@ async function loadExtensions(options) {
3502
3530
  failed
3503
3531
  };
3504
3532
  }
3505
- for (const extension of discovery.effective) {
3533
+ const extensionsToLoad = typeof options.extensionFilter === "function" ? discovery.effective.filter(options.extensionFilter) : discovery.effective;
3534
+ for (const extension of extensionsToLoad) {
3506
3535
  try {
3507
3536
  const importHref = await resolveExtensionImportHref(extension, options);
3508
3537
  const module = await import(importHref);
@@ -3527,6 +3556,8 @@ async function loadExtensions(options) {
3527
3556
  failed
3528
3557
  };
3529
3558
  }
3559
+ var DEFAULT_EXTENSION_DEACTIVATE_TIMEOUT_MS = 5e3;
3560
+ var MAX_EXTENSION_DEACTIVATE_TIMEOUT_MS = 2147483647;
3530
3561
  function toActivatableExtension(source) {
3531
3562
  const activate = source.activate;
3532
3563
  const activatable = {
@@ -3539,18 +3570,78 @@ function toActivatableExtension(source) {
3539
3570
  return activatable;
3540
3571
  }
3541
3572
  function resolveActivatableExtension(module) {
3542
- const moduleRecord = asRecordLoose(module);
3543
- if (!moduleRecord) {
3544
- return null;
3573
+ const activatableRecord = resolveActivatablePropertyRecord(module);
3574
+ return activatableRecord ? toActivatableExtension(activatableRecord) : null;
3575
+ }
3576
+ async function deactivateExtensions(loadResult, activationResult, options = {}) {
3577
+ const timeoutMs = normalizeExtensionDeactivateTimeout(options?.deactivate_timeout_ms);
3578
+ const failedActivationKeys = new Set((activationResult?.failed ?? []).map((entry) => `${entry.layer}:${entry.name}`));
3579
+ const targets = [];
3580
+ for (const extension of loadResult.loaded) {
3581
+ if (failedActivationKeys.has(`${extension.layer}:${extension.name}`)) {
3582
+ continue;
3583
+ }
3584
+ const activatable = resolveActivatableExtension(extension.module);
3585
+ if (!activatable || typeof activatable.deactivate !== "function") {
3586
+ continue;
3587
+ }
3588
+ targets.push({ extension, deactivate: activatable.deactivate });
3545
3589
  }
3546
- if (typeof moduleRecord.activate === "function") {
3547
- return toActivatableExtension(moduleRecord);
3590
+ const outcomes = await Promise.all(targets.map(async ({ extension, deactivate }) => {
3591
+ try {
3592
+ await runExtensionDeactivateWithTimeout(deactivate, timeoutMs);
3593
+ return { ok: true };
3594
+ } catch (error) {
3595
+ return { ok: false, layer: extension.layer, name: extension.name, error: formatUnknownError(error) };
3596
+ }
3597
+ }));
3598
+ const warnings = [];
3599
+ const failed = [];
3600
+ let deactivated = 0;
3601
+ for (const outcome of outcomes) {
3602
+ if (outcome.ok) {
3603
+ deactivated += 1;
3604
+ continue;
3605
+ }
3606
+ warnings.push(`extension_deactivate_failed:${outcome.layer}:${outcome.name}`);
3607
+ failed.push({ layer: outcome.layer, name: outcome.name, error: outcome.error });
3548
3608
  }
3549
- const defaultExport = asRecordLoose(moduleRecord.default);
3550
- if (defaultExport && typeof defaultExport.activate === "function") {
3551
- return toActivatableExtension(defaultExport);
3609
+ return { deactivated, warnings, failed };
3610
+ }
3611
+ function normalizeExtensionDeactivateTimeout(rawTimeout) {
3612
+ if (typeof rawTimeout !== "number" || rawTimeout < 0) {
3613
+ return DEFAULT_EXTENSION_DEACTIVATE_TIMEOUT_MS;
3614
+ }
3615
+ if (rawTimeout === 0 || rawTimeout === Infinity) {
3616
+ return 0;
3617
+ }
3618
+ if (!Number.isFinite(rawTimeout)) {
3619
+ return DEFAULT_EXTENSION_DEACTIVATE_TIMEOUT_MS;
3620
+ }
3621
+ return Math.min(MAX_EXTENSION_DEACTIVATE_TIMEOUT_MS, Math.max(1, Math.floor(rawTimeout)));
3622
+ }
3623
+ async function runExtensionDeactivateWithTimeout(deactivate, timeoutMs) {
3624
+ if (timeoutMs === 0) {
3625
+ await deactivate();
3626
+ return;
3627
+ }
3628
+ let timeoutHandle;
3629
+ try {
3630
+ const deactivatePromise = Promise.resolve().then(() => deactivate());
3631
+ deactivatePromise.catch(() => {
3632
+ });
3633
+ await Promise.race([
3634
+ deactivatePromise,
3635
+ new Promise((_, reject) => {
3636
+ timeoutHandle = setTimeout(() => {
3637
+ reject(new Error(`extension deactivate timed out after ${timeoutMs}ms`));
3638
+ }, timeoutMs);
3639
+ timeoutHandle.unref?.();
3640
+ })
3641
+ ]);
3642
+ } finally {
3643
+ clearTimeout(timeoutHandle);
3552
3644
  }
3553
- return null;
3554
3645
  }
3555
3646
  function isOutputRendererFormat(value) {
3556
3647
  return value === "toon" || value === "json";
@@ -4705,6 +4796,17 @@ async function activateExtensions(loadResult) {
4705
4796
  }
4706
4797
 
4707
4798
  // dist/core/extensions/capability-usage.js
4799
+ var EXTENSION_CAPABILITY_REGISTRATION_SURFACES = {
4800
+ commands: ["registerCommand", "command override", "command handler"],
4801
+ renderers: ["registerRenderer"],
4802
+ hooks: ["hooks.beforeCommand", "hooks.afterCommand", "hooks.onWrite", "hooks.onRead", "hooks.onIndex"],
4803
+ schema: ["registerFlags", "registerItemFields", "registerItemTypes", "registerMigration", "registerProfile"],
4804
+ importers: ["registerImporter", "registerExporter"],
4805
+ search: ["registerSearchProvider", "registerVectorStoreAdapter"],
4806
+ parser: ["registerParser"],
4807
+ preflight: ["registerPreflight"],
4808
+ services: ["registerService"]
4809
+ };
4708
4810
  var USAGE_KEY_SEPARATOR = ":";
4709
4811
  function usageKey(layer, name) {
4710
4812
  return `${layer}${USAGE_KEY_SEPARATOR}${normalizeExtensionName(name)}`;
@@ -4767,10 +4869,16 @@ function attributeCapabilityUsage(activation) {
4767
4869
  }
4768
4870
  function collectUsedExtensionCapabilities(activation, options = {}) {
4769
4871
  const usage = attributeCapabilityUsage(activation);
4770
- const filter = options.extensionName !== void 0 ? normalizeExtensionName(options.extensionName) : null;
4872
+ const filters = /* @__PURE__ */ new Set();
4873
+ if (options.extensionName !== void 0) {
4874
+ filters.add(normalizeExtensionName(options.extensionName));
4875
+ }
4876
+ for (const name of options.extensionNames ?? []) {
4877
+ filters.add(normalizeExtensionName(name));
4878
+ }
4771
4879
  const used = /* @__PURE__ */ new Set();
4772
4880
  for (const [key, capabilities] of usage) {
4773
- if (filter !== null && usageKeyName(key) !== filter) {
4881
+ if (filters.size > 0 && !filters.has(usageKeyName(key))) {
4774
4882
  continue;
4775
4883
  }
4776
4884
  for (const capability of capabilities) {
@@ -4795,333 +4903,92 @@ function reconcileExtensionCapabilityUsage(loaded, activation) {
4795
4903
  return reconciliations;
4796
4904
  }
4797
4905
 
4798
- // dist/core/extensions/index.js
4799
- var activeExtensionHooks = null;
4800
- var activeExtensionCommands = null;
4801
- var activeExtensionParsers = null;
4802
- var activeExtensionPreflight = null;
4803
- var activeExtensionServices = null;
4804
- var activeExtensionRenderers = null;
4805
- var activeExtensionRegistrations = null;
4806
- var activeCommandContext = null;
4807
- var activeCommandResult = void 0;
4808
- var activeAfterCommandAffectedItems = [];
4809
- var AFTER_COMMAND_SNAPSHOT_OMITTED_FIELDS = /* @__PURE__ */ new Set([
4810
- "body",
4811
- "comments",
4812
- "dependencies",
4813
- "docs",
4814
- "events",
4815
- "files",
4816
- "learnings",
4817
- "notes",
4818
- "reminders",
4819
- "test_runs",
4820
- "tests"
4821
- ]);
4822
- function setActiveExtensionHooks(hooks) {
4823
- activeExtensionHooks = hooks;
4824
- }
4825
- function setActiveExtensionCommands(commands) {
4826
- activeExtensionCommands = commands;
4827
- }
4828
- function setActiveExtensionParsers(parsers) {
4829
- activeExtensionParsers = parsers;
4906
+ // dist/core/schema/runtime-schema.js
4907
+ import path6 from "node:path";
4908
+ var DEFAULT_RUNTIME_SCHEMA_FILE_PATHS = Object.freeze({
4909
+ types: "schema/types.json",
4910
+ statuses: "schema/statuses.json",
4911
+ fields: "schema/fields.json",
4912
+ workflows: "schema/workflows.json"
4913
+ });
4914
+ var DEFAULT_RUNTIME_WORKFLOW = DEFAULT_WORKFLOW_DEFINITION;
4915
+ var DEFAULT_RUNTIME_STATUS_DEFINITIONS = DEFAULT_STATUS_DEFINITIONS;
4916
+ var DEFAULT_RUNTIME_FIELD_COMMANDS = ["create", "update"];
4917
+ var RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
4918
+ var RUNTIME_FIELD_TYPE_SET = new Set(RUNTIME_FIELD_TYPE_VALUES);
4919
+ var RUNTIME_FIELD_COMMAND_SET = new Set(RUNTIME_FIELD_COMMAND_VALUES);
4920
+ var RUNTIME_UNKNOWN_FIELD_POLICY_SET = new Set(RUNTIME_UNKNOWN_FIELD_POLICY_VALUES);
4921
+ function normalizeStringList(values) {
4922
+ const candidates = Array.isArray(values) ? values : [];
4923
+ return [...new Set(candidates.map((value) => typeof value === "string" ? value.trim() : "").filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
4830
4924
  }
4831
- function setActiveExtensionPreflight(preflight) {
4832
- activeExtensionPreflight = preflight;
4925
+ function normalizeStatusToken(value) {
4926
+ return typeof value === "string" ? value.trim().toLowerCase().replaceAll(/[\s-]+/g, "_") : "";
4833
4927
  }
4834
- function setActiveExtensionServices(services) {
4835
- activeExtensionServices = services;
4928
+ function normalizeStatusId(value) {
4929
+ if (typeof value !== "string" || value.length === 0) {
4930
+ return void 0;
4931
+ }
4932
+ const normalized = normalizeStatusToken(value);
4933
+ return normalized.length > 0 ? normalized : void 0;
4836
4934
  }
4837
- function setActiveExtensionRenderers(renderers) {
4838
- activeExtensionRenderers = renderers;
4935
+ function stripFlagPrefix(value) {
4936
+ return value.startsWith("--") ? value.slice(2) : value;
4839
4937
  }
4840
- function setActiveExtensionRegistrations(registrations) {
4841
- activeExtensionRegistrations = registrations;
4938
+ function normalizeCliToken(value) {
4939
+ return typeof value === "string" ? stripFlagPrefix(value.trim().toLowerCase().replaceAll(/[\s_]+/g, "-")) : "";
4842
4940
  }
4843
- function getActiveExtensionRegistrations() {
4844
- return activeExtensionRegistrations;
4941
+ function keyToDefaultCliFlag(value) {
4942
+ return value.replaceAll("_", "-");
4845
4943
  }
4846
- function setActiveCommandContext(context) {
4847
- activeCommandContext = context;
4944
+ function toCamelCase(input) {
4945
+ const segments = input.replaceAll(/[^A-Za-z0-9]+/g, " ").trim().split(/\s+/).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase());
4946
+ if (segments.length === 0) {
4947
+ return input;
4948
+ }
4949
+ const [first, ...rest] = segments;
4950
+ return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join("")}`;
4848
4951
  }
4849
- function setActiveCommandResult(result) {
4850
- activeCommandResult = result;
4952
+ function normalizeRuntimeStatusDefinition(definition, fallbackOrder) {
4953
+ const id = normalizeStatusId(definition.id);
4954
+ if (!id) {
4955
+ return null;
4956
+ }
4957
+ const aliases = normalizeStringList(definition.aliases).map((value) => normalizeStatusToken(value)).filter((value) => value !== id);
4958
+ const roles = normalizeStringList(definition.roles).filter((value) => RUNTIME_STATUS_ROLE_SET.has(value));
4959
+ const description = definition.description?.trim();
4960
+ const order = typeof definition.order === "number" && Number.isFinite(definition.order) ? definition.order : fallbackOrder;
4961
+ return {
4962
+ id,
4963
+ aliases,
4964
+ roles,
4965
+ description: description && description.length > 0 ? description : void 0,
4966
+ order
4967
+ };
4851
4968
  }
4852
- function getActiveCommandResult() {
4853
- return activeCommandResult;
4969
+ function normalizeRuntimeWorkflow(workflow) {
4970
+ return {
4971
+ draft_status: normalizeStatusId(workflow?.draft_status),
4972
+ open_status: normalizeStatusId(workflow?.open_status),
4973
+ in_progress_status: normalizeStatusId(workflow?.in_progress_status),
4974
+ blocked_status: normalizeStatusId(workflow?.blocked_status),
4975
+ close_status: normalizeStatusId(workflow?.close_status),
4976
+ canceled_status: normalizeStatusId(workflow?.canceled_status)
4977
+ };
4854
4978
  }
4855
- function recordAfterCommandAffectedItem(item) {
4856
- if (!item || (activeExtensionHooks?.afterCommand?.length ?? 0) === 0) {
4979
+ function appendTypeWorkflowPair(record, pair) {
4980
+ if (!Array.isArray(pair) || pair.length !== 2) {
4857
4981
  return;
4858
4982
  }
4859
- activeAfterCommandAffectedItems.push(item);
4860
- }
4861
- function projectAfterCommandItemSnapshot(metadata, changedFields) {
4862
- if (!metadata || !metadata.id) {
4863
- return {};
4864
- }
4865
- const snapshot = {
4866
- id: metadata.id,
4867
- type: metadata.type,
4868
- status: metadata.status
4869
- };
4870
- if (!Array.isArray(changedFields)) {
4871
- return snapshot;
4983
+ const from = normalizeStatusToken(pair[0]);
4984
+ const to = normalizeStatusToken(pair[1]);
4985
+ if (from.length === 0 || to.length === 0) {
4986
+ return;
4872
4987
  }
4873
- const source = metadata;
4874
- for (const field of changedFields) {
4875
- if (typeof field !== "string") {
4876
- continue;
4877
- }
4878
- const actualField = field.startsWith("unset:") ? field.slice("unset:".length) : field;
4879
- if (actualField === "id" || actualField === "type" || actualField === "status" || AFTER_COMMAND_SNAPSHOT_OMITTED_FIELDS.has(actualField)) {
4880
- continue;
4881
- }
4882
- if (Object.hasOwn(source, actualField) && source[actualField] !== void 0) {
4883
- snapshot[actualField] = source[actualField];
4884
- }
4988
+ if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
4989
+ return;
4885
4990
  }
4886
- return snapshot;
4887
- }
4888
- function consumeAfterCommandAffectedItems() {
4889
- if (activeAfterCommandAffectedItems.length === 0) {
4890
- return void 0;
4891
- }
4892
- const affected = activeAfterCommandAffectedItems;
4893
- activeAfterCommandAffectedItems = [];
4894
- return affected;
4895
- }
4896
- function clearActiveExtensionHooks() {
4897
- activeExtensionHooks = null;
4898
- activeExtensionCommands = null;
4899
- activeExtensionParsers = null;
4900
- activeExtensionPreflight = null;
4901
- activeExtensionServices = null;
4902
- activeExtensionRenderers = null;
4903
- activeExtensionRegistrations = null;
4904
- activeCommandContext = null;
4905
- activeCommandResult = void 0;
4906
- activeAfterCommandAffectedItems = [];
4907
- }
4908
- async function runActiveOnWriteHooks(context) {
4909
- if (!activeExtensionHooks) {
4910
- return [];
4911
- }
4912
- return runOnWriteHooks(activeExtensionHooks, context);
4913
- }
4914
- async function runActiveOnReadHooks(context) {
4915
- if (!activeExtensionHooks) {
4916
- return [];
4917
- }
4918
- return runOnReadHooks(activeExtensionHooks, context);
4919
- }
4920
- function hasActiveOnReadHooks() {
4921
- return (activeExtensionHooks?.onRead?.length ?? 0) > 0;
4922
- }
4923
- async function runActiveOnIndexHooks(context) {
4924
- if (!activeExtensionHooks) {
4925
- return [];
4926
- }
4927
- return runOnIndexHooks(activeExtensionHooks, context);
4928
- }
4929
- function runActiveCommandOverride(result) {
4930
- if (!activeExtensionCommands || !activeCommandContext) {
4931
- return {
4932
- overridden: false,
4933
- result,
4934
- warnings: []
4935
- };
4936
- }
4937
- return runCommandOverride(activeExtensionCommands, {
4938
- command: activeCommandContext.command,
4939
- args: [...activeCommandContext.args],
4940
- options: activeCommandContext.options ? { ...activeCommandContext.options } : {},
4941
- global: activeCommandContext.global ? { ...activeCommandContext.global } : void 0,
4942
- pm_root: activeCommandContext.pm_root,
4943
- result
4944
- });
4945
- }
4946
- async function runActiveCommandHandler(context) {
4947
- if (!activeExtensionCommands) {
4948
- return {
4949
- handled: false,
4950
- result: null,
4951
- warnings: []
4952
- };
4953
- }
4954
- return runCommandHandler(activeExtensionCommands, context);
4955
- }
4956
- async function runActiveParserOverride(context) {
4957
- if (!activeExtensionParsers) {
4958
- return {
4959
- overridden: false,
4960
- context: {
4961
- command: context.command,
4962
- args: [...context.args],
4963
- options: { ...context.options },
4964
- global: { ...context.global },
4965
- pm_root: context.pm_root
4966
- },
4967
- warnings: []
4968
- };
4969
- }
4970
- return runParserOverride(activeExtensionParsers, context);
4971
- }
4972
- async function runActivePreflightOverride(context) {
4973
- if (!activeExtensionPreflight) {
4974
- return {
4975
- overridden: false,
4976
- context: {
4977
- command: context.command,
4978
- args: [...context.args],
4979
- options: { ...context.options },
4980
- global: { ...context.global },
4981
- pm_root: context.pm_root
4982
- },
4983
- decision: { ...context.decision },
4984
- warnings: []
4985
- };
4986
- }
4987
- return runPreflightOverride(activeExtensionPreflight, context);
4988
- }
4989
- function runActiveRendererOverride(format, result) {
4990
- if (!activeExtensionRenderers) {
4991
- return {
4992
- overridden: false,
4993
- rendered: null,
4994
- warnings: []
4995
- };
4996
- }
4997
- return runRendererOverride(activeExtensionRenderers, {
4998
- format,
4999
- command: activeCommandContext?.command,
5000
- args: activeCommandContext ? [...activeCommandContext.args] : [],
5001
- options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},
5002
- global: activeCommandContext?.global ? { ...activeCommandContext.global } : void 0,
5003
- pm_root: activeCommandContext?.pm_root,
5004
- result
5005
- });
5006
- }
5007
- function buildServiceContext(service, payload) {
5008
- return {
5009
- service,
5010
- command: activeCommandContext?.command,
5011
- args: activeCommandContext ? [...activeCommandContext.args] : [],
5012
- options: activeCommandContext?.options ? { ...activeCommandContext.options } : {},
5013
- global: activeCommandContext?.global ? { ...activeCommandContext.global } : void 0,
5014
- pm_root: activeCommandContext?.pm_root,
5015
- payload
5016
- };
5017
- }
5018
- async function runActiveServiceOverride(service, payload) {
5019
- if (!activeExtensionServices) {
5020
- return {
5021
- handled: false,
5022
- result: payload,
5023
- warnings: []
5024
- };
5025
- }
5026
- return runServiceOverride(activeExtensionServices, buildServiceContext(service, payload));
5027
- }
5028
- function runActiveServiceOverrideSync(service, payload) {
5029
- if (!activeExtensionServices) {
5030
- return {
5031
- handled: false,
5032
- result: payload,
5033
- warnings: []
5034
- };
5035
- }
5036
- return runServiceOverrideSync(activeExtensionServices, buildServiceContext(service, payload));
5037
- }
5038
-
5039
- // dist/core/schema/runtime-schema.js
5040
- import path6 from "node:path";
5041
- var DEFAULT_RUNTIME_SCHEMA_FILE_PATHS = Object.freeze({
5042
- types: "schema/types.json",
5043
- statuses: "schema/statuses.json",
5044
- fields: "schema/fields.json",
5045
- workflows: "schema/workflows.json"
5046
- });
5047
- var DEFAULT_RUNTIME_WORKFLOW = DEFAULT_WORKFLOW_DEFINITION;
5048
- var DEFAULT_RUNTIME_STATUS_DEFINITIONS = DEFAULT_STATUS_DEFINITIONS;
5049
- var DEFAULT_RUNTIME_FIELD_COMMANDS = ["create", "update"];
5050
- var RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
5051
- var RUNTIME_FIELD_TYPE_SET = new Set(RUNTIME_FIELD_TYPE_VALUES);
5052
- var RUNTIME_FIELD_COMMAND_SET = new Set(RUNTIME_FIELD_COMMAND_VALUES);
5053
- var RUNTIME_UNKNOWN_FIELD_POLICY_SET = new Set(RUNTIME_UNKNOWN_FIELD_POLICY_VALUES);
5054
- function normalizeStringList(values) {
5055
- const candidates = Array.isArray(values) ? values : [];
5056
- return [...new Set(candidates.map((value) => typeof value === "string" ? value.trim() : "").filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
5057
- }
5058
- function normalizeStatusToken(value) {
5059
- return typeof value === "string" ? value.trim().toLowerCase().replaceAll(/[\s-]+/g, "_") : "";
5060
- }
5061
- function normalizeStatusId(value) {
5062
- if (typeof value !== "string" || value.length === 0) {
5063
- return void 0;
5064
- }
5065
- const normalized = normalizeStatusToken(value);
5066
- return normalized.length > 0 ? normalized : void 0;
5067
- }
5068
- function stripFlagPrefix(value) {
5069
- return value.startsWith("--") ? value.slice(2) : value;
5070
- }
5071
- function normalizeCliToken(value) {
5072
- return typeof value === "string" ? stripFlagPrefix(value.trim().toLowerCase().replaceAll(/[\s_]+/g, "-")) : "";
5073
- }
5074
- function keyToDefaultCliFlag(value) {
5075
- return value.replaceAll("_", "-");
5076
- }
5077
- function toCamelCase(input) {
5078
- const segments = input.replaceAll(/[^A-Za-z0-9]+/g, " ").trim().split(/\s+/).filter((segment) => segment.length > 0).map((segment) => segment.toLowerCase());
5079
- if (segments.length === 0) {
5080
- return input;
5081
- }
5082
- const [first, ...rest] = segments;
5083
- return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join("")}`;
5084
- }
5085
- function normalizeRuntimeStatusDefinition(definition, fallbackOrder) {
5086
- const id = normalizeStatusId(definition.id);
5087
- if (!id) {
5088
- return null;
5089
- }
5090
- const aliases = normalizeStringList(definition.aliases).map((value) => normalizeStatusToken(value)).filter((value) => value !== id);
5091
- const roles = normalizeStringList(definition.roles).filter((value) => RUNTIME_STATUS_ROLE_SET.has(value));
5092
- const description = definition.description?.trim();
5093
- const order = typeof definition.order === "number" && Number.isFinite(definition.order) ? definition.order : fallbackOrder;
5094
- return {
5095
- id,
5096
- aliases,
5097
- roles,
5098
- description: description && description.length > 0 ? description : void 0,
5099
- order
5100
- };
5101
- }
5102
- function normalizeRuntimeWorkflow(workflow) {
5103
- return {
5104
- draft_status: normalizeStatusId(workflow?.draft_status),
5105
- open_status: normalizeStatusId(workflow?.open_status),
5106
- in_progress_status: normalizeStatusId(workflow?.in_progress_status),
5107
- blocked_status: normalizeStatusId(workflow?.blocked_status),
5108
- close_status: normalizeStatusId(workflow?.close_status),
5109
- canceled_status: normalizeStatusId(workflow?.canceled_status)
5110
- };
5111
- }
5112
- function appendTypeWorkflowPair(record, pair) {
5113
- if (!Array.isArray(pair) || pair.length !== 2) {
5114
- return;
5115
- }
5116
- const from = normalizeStatusToken(pair[0]);
5117
- const to = normalizeStatusToken(pair[1]);
5118
- if (from.length === 0 || to.length === 0) {
5119
- return;
5120
- }
5121
- if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {
5122
- return;
5123
- }
5124
- record.pairs.push([from, to]);
4991
+ record.pairs.push([from, to]);
5125
4992
  }
5126
4993
  function normalizedTypeWorkflowEntry(entry) {
5127
4994
  const rawType = typeof entry?.type === "string" ? entry.type.trim() : "";
@@ -5614,1622 +5481,6 @@ function statusIsTerminal(status, registry) {
5614
5481
  return registry.terminal_statuses.has(normalized);
5615
5482
  }
5616
5483
 
5617
- // dist/core/shared/errors.js
5618
- var PmCliError = class extends Error {
5619
- exitCode;
5620
- context;
5621
- constructor(message, exitCode, context = {}) {
5622
- super(message);
5623
- this.name = "PmCliError";
5624
- this.exitCode = exitCode;
5625
- this.context = context;
5626
- }
5627
- };
5628
-
5629
- // dist/core/shared/serialization.js
5630
- import crypto2 from "node:crypto";
5631
- function sortScalarValue(value) {
5632
- if (value === null)
5633
- return null;
5634
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
5635
- return value;
5636
- }
5637
- if (typeof value === "bigint") {
5638
- return value.toString();
5639
- }
5640
- if (value === void 0) {
5641
- return "undefined";
5642
- }
5643
- if (typeof value === "symbol") {
5644
- return value.toString();
5645
- }
5646
- if (typeof value === "function") {
5647
- return `[function:${value.name || "anonymous"}]`;
5648
- }
5649
- return void 0;
5650
- }
5651
- function sortPlainObjectKeys(value) {
5652
- const sortedKeys = Object.keys(value).sort();
5653
- const result = {};
5654
- for (const key of sortedKeys) {
5655
- const nested = value[key];
5656
- if (nested === void 0) {
5657
- continue;
5658
- }
5659
- result[key] = sortObjectKeys(nested);
5660
- }
5661
- return result;
5662
- }
5663
- function sortObjectKeys(value) {
5664
- const scalarValue = sortScalarValue(value);
5665
- if (scalarValue !== void 0) {
5666
- return scalarValue;
5667
- }
5668
- if (Array.isArray(value)) {
5669
- return value.map((entry) => sortObjectKeys(entry));
5670
- }
5671
- if (value instanceof Date) {
5672
- return value.toISOString();
5673
- }
5674
- const maybeJson = value;
5675
- if (typeof maybeJson.toJSON === "function") {
5676
- const normalized = maybeJson.toJSON();
5677
- if (normalized !== value) {
5678
- return sortObjectKeys(normalized);
5679
- }
5680
- }
5681
- return sortPlainObjectKeys(value);
5682
- }
5683
- function stableStringify(value) {
5684
- return JSON.stringify(sortObjectKeys(value));
5685
- }
5686
- function hasUnmatchedEquivalent(leftValue, rightValues, matchedIndexes, equals) {
5687
- for (let index = 0; index < rightValues.length; index += 1) {
5688
- if (matchedIndexes.has(index)) {
5689
- continue;
5690
- }
5691
- if (equals(leftValue, rightValues[index])) {
5692
- matchedIndexes.add(index);
5693
- return true;
5694
- }
5695
- }
5696
- return false;
5697
- }
5698
- function compareRegExpValues(left, right) {
5699
- if (!(left instanceof RegExp || right instanceof RegExp)) {
5700
- return void 0;
5701
- }
5702
- return left instanceof RegExp && right instanceof RegExp && left.toString() === right.toString();
5703
- }
5704
- function compareDateValues(left, right) {
5705
- if (!(left instanceof Date || right instanceof Date)) {
5706
- return void 0;
5707
- }
5708
- return left instanceof Date && right instanceof Date && left.getTime() === right.getTime();
5709
- }
5710
- function compareSetValues(left, right) {
5711
- if (!(left instanceof Set || right instanceof Set)) {
5712
- return void 0;
5713
- }
5714
- if (!(left instanceof Set && right instanceof Set) || left.size !== right.size) {
5715
- return false;
5716
- }
5717
- const rightValues = [...right];
5718
- const matched = /* @__PURE__ */ new Set();
5719
- for (const leftValue of left) {
5720
- if (!hasUnmatchedEquivalent(leftValue, rightValues, matched, stableValueEquals)) {
5721
- return false;
5722
- }
5723
- }
5724
- return true;
5725
- }
5726
- function compareMapValues(left, right) {
5727
- if (!(left instanceof Map || right instanceof Map)) {
5728
- return void 0;
5729
- }
5730
- if (!(left instanceof Map && right instanceof Map) || left.size !== right.size) {
5731
- return false;
5732
- }
5733
- const rightEntries = [...right.entries()];
5734
- const matched = /* @__PURE__ */ new Set();
5735
- for (const [leftKey, leftValue] of left.entries()) {
5736
- const leftEntry = [leftKey, leftValue];
5737
- if (!hasUnmatchedEquivalent(leftEntry, rightEntries, matched, ([candidateKey, candidateValue], [rightKey, rightValue]) => stableValueEquals(candidateKey, rightKey) && stableValueEquals(candidateValue, rightValue))) {
5738
- return false;
5739
- }
5740
- }
5741
- return true;
5742
- }
5743
- function compareArrayValues(left, right) {
5744
- if (!(Array.isArray(left) || Array.isArray(right))) {
5745
- return void 0;
5746
- }
5747
- if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) {
5748
- return false;
5749
- }
5750
- return left.every((value, index) => stableValueEquals(value, right[index]));
5751
- }
5752
- function comparePlainObjectValues(left, right) {
5753
- const leftKeys = Object.keys(left).sort((a, b) => a.localeCompare(b));
5754
- const rightKeys = Object.keys(right).sort((a, b) => a.localeCompare(b));
5755
- if (leftKeys.length !== rightKeys.length) {
5756
- return false;
5757
- }
5758
- for (let index = 0; index < leftKeys.length; index += 1) {
5759
- const leftKey = leftKeys[index];
5760
- if (leftKey !== rightKeys[index]) {
5761
- return false;
5762
- }
5763
- if (!stableValueEquals(left[leftKey], right[leftKey])) {
5764
- return false;
5765
- }
5766
- }
5767
- return true;
5768
- }
5769
- var SPECIALIZED_STABLE_VALUE_COMPARISONS = [
5770
- compareRegExpValues,
5771
- compareDateValues,
5772
- compareSetValues,
5773
- compareMapValues,
5774
- compareArrayValues
5775
- ];
5776
- function stableValueEquals(left, right) {
5777
- if (Object.is(left, right)) {
5778
- return true;
5779
- }
5780
- if (left === null || right === null || typeof left !== "object" || typeof right !== "object") {
5781
- return false;
5782
- }
5783
- for (const compare of SPECIALIZED_STABLE_VALUE_COMPARISONS) {
5784
- const result = compare(left, right);
5785
- if (result !== void 0) {
5786
- return result;
5787
- }
5788
- }
5789
- return comparePlainObjectValues(left, right);
5790
- }
5791
- function sha256Hex(value) {
5792
- return crypto2.createHash("sha256").update(value, "utf8").digest("hex");
5793
- }
5794
- function orderObject(value, keyOrder) {
5795
- const ordered = {};
5796
- for (const key of keyOrder) {
5797
- const entry = value[key];
5798
- if (entry !== void 0) {
5799
- ordered[key] = entry;
5800
- }
5801
- }
5802
- const unknownKeys = Object.keys(value).filter((key) => !keyOrder.includes(key)).sort((a, b) => a.localeCompare(b));
5803
- for (const key of unknownKeys) {
5804
- const entry = value[key];
5805
- if (entry !== void 0) {
5806
- ordered[key] = entry;
5807
- }
5808
- }
5809
- return ordered;
5810
- }
5811
-
5812
- // dist/core/store/settings-validator.js
5813
- var FAIL = { ok: false };
5814
- var vString = (input) => typeof input === "string" ? { ok: true, value: input } : FAIL;
5815
- var vBoolean = (input) => typeof input === "boolean" ? { ok: true, value: input } : FAIL;
5816
- function vNumber(options = {}) {
5817
- return (input) => {
5818
- if (typeof input !== "number" || !Number.isFinite(input)) {
5819
- return FAIL;
5820
- }
5821
- if (options.int && (!Number.isInteger(input) || !Number.isSafeInteger(input))) {
5822
- return FAIL;
5823
- }
5824
- if (options.positive && input <= 0) {
5825
- return FAIL;
5826
- }
5827
- return { ok: true, value: input };
5828
- };
5829
- }
5830
- function vLiteral(...allowed) {
5831
- return (input) => typeof input === "string" && allowed.includes(input) ? { ok: true, value: input } : FAIL;
5832
- }
5833
- function vArray(item) {
5834
- return (input) => {
5835
- if (!Array.isArray(input)) {
5836
- return FAIL;
5837
- }
5838
- const value = [];
5839
- for (const element of input) {
5840
- const result = item(element);
5841
- if (!result.ok) {
5842
- return FAIL;
5843
- }
5844
- value.push(result.value);
5845
- }
5846
- return { ok: true, value };
5847
- };
5848
- }
5849
- function vOptional(inner) {
5850
- return (input) => input === void 0 ? { ok: true, value: void 0 } : inner(input);
5851
- }
5852
- function vRecordOf(valueCheck) {
5853
- return (input) => {
5854
- if (typeof input !== "object" || input === null || Array.isArray(input)) {
5855
- return FAIL;
5856
- }
5857
- const value = {};
5858
- for (const [key, raw] of Object.entries(input)) {
5859
- const result = valueCheck(raw);
5860
- if (!result.ok) {
5861
- return FAIL;
5862
- }
5863
- value[key] = result.value;
5864
- }
5865
- return { ok: true, value };
5866
- };
5867
- }
5868
- function vObject(shape) {
5869
- return (input) => {
5870
- if (typeof input !== "object" || input === null || Array.isArray(input)) {
5871
- return FAIL;
5872
- }
5873
- const record = input;
5874
- const value = {};
5875
- for (const [key, check] of Object.entries(shape)) {
5876
- const result = check(record[key]);
5877
- if (!result.ok) {
5878
- return FAIL;
5879
- }
5880
- if (result.value !== void 0) {
5881
- value[key] = result.value;
5882
- }
5883
- }
5884
- return { ok: true, value };
5885
- };
5886
- }
5887
- var itemTypeOption = vObject({
5888
- key: vString,
5889
- values: vArray(vString),
5890
- required: vOptional(vBoolean),
5891
- aliases: vOptional(vArray(vString)),
5892
- description: vOptional(vString)
5893
- });
5894
- var itemTypeCommandOptionPolicy = vObject({
5895
- command: vLiteral("create", "update"),
5896
- option: vString,
5897
- required: vOptional(vBoolean),
5898
- visible: vOptional(vBoolean),
5899
- enabled: vOptional(vBoolean)
5900
- });
5901
- var itemTypeDefinition = vObject({
5902
- name: vString,
5903
- description: vOptional(vString),
5904
- // Per-type create-time default status (config-driven); preserved so inline
5905
- // settings.item_types.definitions behave identically to schema/types.json.
5906
- default_status: vOptional(vString),
5907
- folder: vOptional(vString),
5908
- aliases: vOptional(vArray(vString)),
5909
- required_create_fields: vOptional(vArray(vString)),
5910
- required_create_repeatables: vOptional(vArray(vString)),
5911
- options: vOptional(vArray(itemTypeOption)),
5912
- command_option_policies: vOptional(vArray(itemTypeCommandOptionPolicy))
5913
- });
5914
- var runtimeStatusDefinition = vObject({
5915
- id: vString,
5916
- aliases: vOptional(vArray(vString)),
5917
- roles: vOptional(vArray(vLiteral(...RUNTIME_STATUS_ROLE_VALUES))),
5918
- description: vOptional(vString),
5919
- order: vOptional(vNumber())
5920
- });
5921
- var runtimeFieldDefinition = vObject({
5922
- key: vString,
5923
- metadata_key: vOptional(vString),
5924
- front_matter_key: vOptional(vString),
5925
- cli_flag: vOptional(vString),
5926
- cli_aliases: vOptional(vArray(vString)),
5927
- description: vOptional(vString),
5928
- type: vOptional(vLiteral(...RUNTIME_FIELD_TYPE_VALUES)),
5929
- commands: vOptional(vArray(vLiteral(...RUNTIME_FIELD_COMMAND_VALUES))),
5930
- repeatable: vOptional(vBoolean),
5931
- required: vOptional(vBoolean),
5932
- required_on_create: vOptional(vBoolean),
5933
- required_types: vOptional(vArray(vString)),
5934
- allow_unset: vOptional(vBoolean)
5935
- });
5936
- var statusTransitionPair = (input) => {
5937
- if (!Array.isArray(input) || input.length !== 2) {
5938
- return FAIL;
5939
- }
5940
- const [from, to] = input;
5941
- if (typeof from !== "string" || typeof to !== "string") {
5942
- return FAIL;
5943
- }
5944
- return { ok: true, value: [from, to] };
5945
- };
5946
- var typeWorkflowDefinition = vObject({
5947
- type: vString,
5948
- allowed_transitions: vArray(statusTransitionPair)
5949
- });
5950
- var runtimeSchemaSettings = vOptional(vObject({
5951
- version: vOptional(vNumber({ int: true })),
5952
- files: vOptional(vObject({
5953
- types: vOptional(vString),
5954
- statuses: vOptional(vString),
5955
- fields: vOptional(vString),
5956
- workflows: vOptional(vString)
5957
- })),
5958
- statuses: vOptional(vArray(runtimeStatusDefinition)),
5959
- fields: vOptional(vArray(runtimeFieldDefinition)),
5960
- workflow: vOptional(vObject({
5961
- draft_status: vOptional(vString),
5962
- open_status: vOptional(vString),
5963
- in_progress_status: vOptional(vString),
5964
- blocked_status: vOptional(vString),
5965
- close_status: vOptional(vString),
5966
- canceled_status: vOptional(vString)
5967
- })),
5968
- type_workflows: vOptional(vArray(typeWorkflowDefinition)),
5969
- unknown_field_policy: vOptional(vLiteral(...RUNTIME_UNKNOWN_FIELD_POLICY_VALUES))
5970
- }));
5971
- var governanceSettings = vOptional(vObject({
5972
- preset: vOptional(vLiteral(...GOVERNANCE_PRESET_VALUES)),
5973
- ownership_enforcement: vOptional(vLiteral("none", "warn", "strict")),
5974
- create_mode_default: vOptional(vLiteral("progressive", "strict")),
5975
- close_validation_default: vOptional(vLiteral("off", "warn", "strict")),
5976
- require_close_reason: vOptional(vBoolean),
5977
- parent_reference: vOptional(vLiteral("warn", "strict_error")),
5978
- metadata_profile: vOptional(vLiteral("core", "strict", "custom")),
5979
- force_required_for_stale_lock: vOptional(vBoolean),
5980
- create_default_type: vOptional(vString),
5981
- workflow_enforcement: vOptional(vLiteral("off", "warn", "strict"))
5982
- }));
5983
- var extensionPolicyOverride = vObject({
5984
- name: vString,
5985
- disabled: vOptional(vBoolean),
5986
- require_trusted: vOptional(vBoolean),
5987
- require_provenance: vOptional(vBoolean),
5988
- sandbox_profile: vOptional(vLiteral("none", "restricted", "strict")),
5989
- allowed_capabilities: vOptional(vArray(vString)),
5990
- blocked_capabilities: vOptional(vArray(vString)),
5991
- allowed_surfaces: vOptional(vArray(vString)),
5992
- blocked_surfaces: vOptional(vArray(vString)),
5993
- allowed_commands: vOptional(vArray(vString)),
5994
- blocked_commands: vOptional(vArray(vString)),
5995
- allowed_actions: vOptional(vArray(vString)),
5996
- blocked_actions: vOptional(vArray(vString)),
5997
- allowed_services: vOptional(vArray(vString)),
5998
- blocked_services: vOptional(vArray(vString))
5999
- });
6000
- var pmMaxVersionExceededModeLiteral = vLiteral("block", "warn");
6001
- var pmMaxVersionExceededMode = (input) => typeof input === "string" ? pmMaxVersionExceededModeLiteral(input) : vObject({
6002
- global: vOptional(pmMaxVersionExceededModeLiteral),
6003
- project: vOptional(pmMaxVersionExceededModeLiteral)
6004
- })(input);
6005
- var extensionPolicy = vOptional(vObject({
6006
- mode: vOptional(vLiteral("off", "warn", "enforce")),
6007
- trust_mode: vOptional(vLiteral("off", "warn", "enforce")),
6008
- pm_max_version_exceeded_mode: vOptional(pmMaxVersionExceededMode),
6009
- require_provenance: vOptional(vBoolean),
6010
- trusted_extensions: vOptional(vArray(vString)),
6011
- default_sandbox_profile: vOptional(vLiteral("none", "restricted", "strict")),
6012
- allowed_extensions: vOptional(vArray(vString)),
6013
- blocked_extensions: vOptional(vArray(vString)),
6014
- allowed_capabilities: vOptional(vArray(vString)),
6015
- blocked_capabilities: vOptional(vArray(vString)),
6016
- allowed_surfaces: vOptional(vArray(vString)),
6017
- blocked_surfaces: vOptional(vArray(vString)),
6018
- allowed_commands: vOptional(vArray(vString)),
6019
- blocked_commands: vOptional(vArray(vString)),
6020
- allowed_actions: vOptional(vArray(vString)),
6021
- blocked_actions: vOptional(vArray(vString)),
6022
- allowed_services: vOptional(vArray(vString)),
6023
- blocked_services: vOptional(vArray(vString)),
6024
- extension_overrides: vOptional(vArray(extensionPolicyOverride))
6025
- }));
6026
- var settingsCheck = vObject({
6027
- version: vNumber({ int: true }),
6028
- id_prefix: vString,
6029
- author_default: vString,
6030
- item_format: vOptional(vLiteral("toon", "json_markdown")),
6031
- locks: vObject({ ttl_seconds: vNumber({ int: true }) }),
6032
- checkpoints: vOptional(vObject({ retention_days: vOptional(vNumber({ int: true, positive: true })) })),
6033
- output: vObject({ default_format: vLiteral("toon", "json") }),
6034
- history: vOptional(vObject({
6035
- missing_stream: vLiteral("auto_create", "strict_error"),
6036
- compact_policy: vOptional(vObject({
6037
- enabled: vOptional(vBoolean),
6038
- max_entries: vOptional(vNumber({ int: true, positive: true })),
6039
- trigger: vOptional(vLiteral("health_warn", "auto"))
6040
- }))
6041
- })),
6042
- validation: vOptional(vObject({
6043
- sprint_release_format: vLiteral("warn", "strict_error"),
6044
- parent_reference: vOptional(vLiteral("warn", "strict_error")),
6045
- metadata_profile: vOptional(vLiteral("core", "strict", "custom")),
6046
- metadata_required_fields: vOptional(vArray(vString)),
6047
- lifecycle_stale_blocker_reason_patterns: vOptional(vArray(vString)),
6048
- lifecycle_closure_like_blocked_reason_patterns: vOptional(vArray(vString)),
6049
- lifecycle_closure_like_resolution_patterns: vOptional(vArray(vString)),
6050
- lifecycle_closure_like_actual_result_patterns: vOptional(vArray(vString)),
6051
- estimate_defaults_by_type: vOptional(vRecordOf(vNumber({ int: true, positive: true })))
6052
- })),
6053
- governance: governanceSettings,
6054
- workflow: vOptional(vObject({ definition_of_done: vArray(vString) })),
6055
- testing: vOptional(vObject({ record_results_to_items: vBoolean })),
6056
- telemetry: vOptional(vObject({
6057
- enabled: vBoolean,
6058
- first_run_prompt_completed: vOptional(vBoolean),
6059
- capture_level: vOptional(vLiteral("minimal", "redacted", "max")),
6060
- endpoint: vOptional(vString),
6061
- installation_id: vOptional(vString),
6062
- retention_days: vOptional(vNumber({ int: true, positive: true }))
6063
- })),
6064
- agent_guidance: vOptional(vObject({
6065
- prompt_completed: vOptional(vBoolean),
6066
- declined: vOptional(vBoolean),
6067
- declined_at: vOptional(vString),
6068
- template_version: vOptional(vNumber({ int: true, positive: true })),
6069
- last_checked_files: vOptional(vArray(vString))
6070
- })),
6071
- item_types: vOptional(vObject({ definitions: vArray(itemTypeDefinition) })),
6072
- schema: runtimeSchemaSettings,
6073
- context: vOptional(vObject({
6074
- default_depth: vOptional(vLiteral("brief", "standard", "deep")),
6075
- activity_limit: vOptional(vNumber({ int: true, positive: true })),
6076
- stale_threshold_days: vOptional(vNumber({ int: true, positive: true })),
6077
- sections: vOptional(vObject({
6078
- hierarchy: vOptional(vBoolean),
6079
- activity: vOptional(vBoolean),
6080
- progress: vOptional(vBoolean),
6081
- recently_created: vOptional(vBoolean),
6082
- unparented: vOptional(vBoolean),
6083
- blockers: vOptional(vBoolean),
6084
- files: vOptional(vBoolean),
6085
- workload: vOptional(vBoolean),
6086
- staleness: vOptional(vBoolean),
6087
- tests: vOptional(vBoolean)
6088
- }))
6089
- })),
6090
- extensions: vObject({
6091
- enabled: vArray(vString),
6092
- disabled: vArray(vString),
6093
- policy: extensionPolicy
6094
- }),
6095
- search: vObject({
6096
- score_threshold: vNumber(),
6097
- hybrid_semantic_weight: vOptional(vNumber()),
6098
- max_results: vNumber({ int: true }),
6099
- embedding_model: vString,
6100
- embedding_corpus_max_characters: vOptional(vNumber()),
6101
- embedding_batch_size: vNumber({ int: true }),
6102
- embedding_timeout_ms: vOptional(vNumber({ int: true })),
6103
- scanner_max_batch_retries: vNumber({ int: true }),
6104
- provider: vOptional(vString),
6105
- corpus_fields: vOptional(vArray(vString)),
6106
- mutation_refresh_policy: vOptional(vLiteral("cache_only", "semantic_configured", "semantic_auto")),
6107
- query_expansion: vOptional(vObject({
6108
- enabled: vOptional(vBoolean),
6109
- provider: vOptional(vString)
6110
- })),
6111
- rerank: vOptional(vObject({
6112
- enabled: vOptional(vBoolean),
6113
- model: vOptional(vString),
6114
- top_k: vOptional(vNumber({ int: true, positive: true }))
6115
- })),
6116
- // pm-75k9: offline BM25 tuning. Unlike `search.tuning` (intentionally
6117
- // stripped for legacy zod parity), bm25 is validated so it persists across
6118
- // writeSettings round-trips — these knobs must survive to take effect.
6119
- bm25: vOptional(vObject({
6120
- k1: vOptional(vNumber()),
6121
- b: vOptional(vNumber())
6122
- }))
6123
- }),
6124
- providers: vObject({
6125
- openai: vObject({ base_url: vString, api_key: vString, model: vString }),
6126
- ollama: vObject({ base_url: vString, model: vString })
6127
- }),
6128
- vector_store: vObject({
6129
- adapter: vOptional(vString),
6130
- collection_name: vOptional(vString),
6131
- qdrant: vObject({ url: vString, api_key: vString }),
6132
- lancedb: vObject({ path: vString })
6133
- })
6134
- });
6135
- function validateSettings(raw) {
6136
- const result = settingsCheck(raw);
6137
- if (!result.ok) {
6138
- return { success: false };
6139
- }
6140
- return { success: true, data: result.value };
6141
- }
6142
-
6143
- // dist/core/validate/estimate-defaults.js
6144
- var DEFAULT_ESTIMATE_MINUTES_BY_TYPE = {
6145
- Epic: 2880,
6146
- Feature: 480,
6147
- Story: 480,
6148
- Milestone: 2880,
6149
- Task: 120,
6150
- Issue: 60,
6151
- Bug: 60,
6152
- Chore: 30,
6153
- Decision: 15,
6154
- Plan: 120
6155
- };
6156
- var FALLBACK_ESTIMATE_MINUTES = 120;
6157
- function isHonoredMinutes(value) {
6158
- return typeof value === "number" && Number.isFinite(value) && value > 0;
6159
- }
6160
- function toLowercasedLookup(source) {
6161
- const lookup = /* @__PURE__ */ new Map();
6162
- for (const [key, value] of Object.entries(source)) {
6163
- lookup.set(key.toLowerCase(), value);
6164
- }
6165
- return lookup;
6166
- }
6167
- var BUILTIN_LOWERCASED_LOOKUP = toLowercasedLookup(DEFAULT_ESTIMATE_MINUTES_BY_TYPE);
6168
- var OVERRIDE_LOOKUP_CACHE = /* @__PURE__ */ new WeakMap();
6169
- function lowercasedOverrideLookup(overrides) {
6170
- const cached = OVERRIDE_LOOKUP_CACHE.get(overrides);
6171
- if (cached) {
6172
- return cached;
6173
- }
6174
- const lookup = toLowercasedLookup(overrides);
6175
- OVERRIDE_LOOKUP_CACHE.set(overrides, lookup);
6176
- return lookup;
6177
- }
6178
- function resolveEstimateDefaultMinutes(type, overrides) {
6179
- const key = (type ?? "").trim().toLowerCase();
6180
- if (key.length === 0) {
6181
- return FALLBACK_ESTIMATE_MINUTES;
6182
- }
6183
- if (overrides) {
6184
- const overrideValue = lowercasedOverrideLookup(overrides).get(key);
6185
- if (isHonoredMinutes(overrideValue)) {
6186
- return Math.floor(overrideValue);
6187
- }
6188
- }
6189
- const builtinValue = BUILTIN_LOWERCASED_LOOKUP.get(key);
6190
- if (isHonoredMinutes(builtinValue)) {
6191
- return Math.floor(builtinValue);
6192
- }
6193
- return FALLBACK_ESTIMATE_MINUTES;
6194
- }
6195
- function normalizeEstimateDefaultOverrides(raw) {
6196
- const normalized = {};
6197
- if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
6198
- return normalized;
6199
- }
6200
- for (const [rawKey, rawValue] of Object.entries(raw)) {
6201
- const key = rawKey.trim();
6202
- if (key.length === 0 || !isHonoredMinutes(rawValue)) {
6203
- continue;
6204
- }
6205
- normalized[key] = Math.floor(rawValue);
6206
- }
6207
- return normalized;
6208
- }
6209
-
6210
- // dist/core/store/settings-read-cache.js
6211
- import { stat } from "node:fs/promises";
6212
- var settingsReadCacheByRoot = /* @__PURE__ */ new Map();
6213
- function normalizeTrackedPaths(paths) {
6214
- return [...new Set(paths.map((pathValue) => pathValue.trim()).filter((pathValue) => pathValue.length > 0))].sort((left, right) => left.localeCompare(right));
6215
- }
6216
- async function readPathSignature(targetPath) {
6217
- try {
6218
- const targetStats = await stat(targetPath);
6219
- return {
6220
- path: targetPath,
6221
- mtime_ms: targetStats.mtimeMs,
6222
- size: targetStats.size
6223
- };
6224
- } catch {
6225
- return {
6226
- path: targetPath,
6227
- mtime_ms: null,
6228
- size: null
6229
- };
6230
- }
6231
- }
6232
- async function collectSettingsReadCacheSignatures(paths) {
6233
- const normalizedPaths = normalizeTrackedPaths(paths);
6234
- const signatures = await Promise.all(normalizedPaths.map((targetPath) => readPathSignature(targetPath)));
6235
- signatures.sort((left, right) => left.path.localeCompare(right.path));
6236
- return signatures;
6237
- }
6238
- function settingsReadCacheSignaturesEqual(left, right) {
6239
- if (left.length !== right.length) {
6240
- return false;
6241
- }
6242
- for (let index = 0; index < left.length; index += 1) {
6243
- const leftEntry = left[index];
6244
- const rightEntry = right[index];
6245
- if (leftEntry.path !== rightEntry.path || leftEntry.mtime_ms !== rightEntry.mtime_ms || leftEntry.size !== rightEntry.size) {
6246
- return false;
6247
- }
6248
- }
6249
- return true;
6250
- }
6251
- function getSettingsReadCacheEntry(pmRoot) {
6252
- return settingsReadCacheByRoot.get(pmRoot);
6253
- }
6254
- function setSettingsReadCacheEntry(pmRoot, entry) {
6255
- const normalizedTrackedPaths = normalizeTrackedPaths(entry.tracked_paths);
6256
- const normalizedSignatures = [...entry.signatures].map((signature) => ({
6257
- path: signature.path,
6258
- mtime_ms: signature.mtime_ms,
6259
- size: signature.size
6260
- })).sort((left, right) => left.path.localeCompare(right.path));
6261
- settingsReadCacheByRoot.set(pmRoot, {
6262
- tracked_paths: normalizedTrackedPaths,
6263
- signatures: normalizedSignatures,
6264
- value: entry.value
6265
- });
6266
- }
6267
- function clearSettingsReadCache(pmRoot) {
6268
- if (pmRoot) {
6269
- settingsReadCacheByRoot.delete(pmRoot);
6270
- return;
6271
- }
6272
- settingsReadCacheByRoot.clear();
6273
- }
6274
-
6275
- // dist/core/store/settings.js
6276
- var SETTINGS_WRITE_OP = "settings:write";
6277
- var SETTINGS_PERSIST_SOURCE_SYMBOL = /* @__PURE__ */ Symbol("pm.settings.persist_source");
6278
- var MAX_VECTOR_STORE_COLLECTION_NAME_LENGTH = 128;
6279
- function resolveGovernanceKnobsFromPreset(preset) {
6280
- return structuredClone(GOVERNANCE_PRESET_DEFAULTS[preset]);
6281
- }
6282
- function normalizeGovernancePreset(value) {
6283
- if (value === "minimal" || value === "default" || value === "strict" || value === "custom") {
6284
- return value;
6285
- }
6286
- return SETTINGS_DEFAULTS.governance.preset;
6287
- }
6288
- function withGovernanceExtras(base, governance) {
6289
- const createDefaultType = typeof governance.create_default_type === "string" ? governance.create_default_type.trim() : void 0;
6290
- if (createDefaultType && createDefaultType.length > 0) {
6291
- base.create_default_type = createDefaultType;
6292
- }
6293
- if (governance.workflow_enforcement === "off" || governance.workflow_enforcement === "warn" || governance.workflow_enforcement === "strict") {
6294
- base.workflow_enforcement = governance.workflow_enforcement;
6295
- }
6296
- if (governance.require_close_reason === false) {
6297
- base.require_close_reason = false;
6298
- }
6299
- return base;
6300
- }
6301
- function normalizeGovernanceForPersist(governance) {
6302
- if (governance.preset === "custom") {
6303
- return withGovernanceExtras({
6304
- preset: "custom",
6305
- ownership_enforcement: governance.ownership_enforcement,
6306
- create_mode_default: governance.create_mode_default,
6307
- close_validation_default: governance.close_validation_default,
6308
- parent_reference: governance.parent_reference,
6309
- metadata_profile: governance.metadata_profile,
6310
- force_required_for_stale_lock: governance.force_required_for_stale_lock
6311
- }, governance);
6312
- }
6313
- return withGovernanceExtras({
6314
- preset: governance.preset
6315
- }, governance);
6316
- }
6317
- function resolveGovernanceExtras(rawGovernance) {
6318
- const createDefaultType = typeof rawGovernance.create_default_type === "string" ? rawGovernance.create_default_type.trim() : void 0;
6319
- const extras = {};
6320
- if (createDefaultType && createDefaultType.length > 0) {
6321
- extras.create_default_type = createDefaultType;
6322
- }
6323
- if (rawGovernance.workflow_enforcement === "off" || rawGovernance.workflow_enforcement === "warn" || rawGovernance.workflow_enforcement === "strict") {
6324
- extras.workflow_enforcement = rawGovernance.workflow_enforcement;
6325
- }
6326
- if (typeof rawGovernance.require_close_reason === "boolean") {
6327
- extras.require_close_reason = rawGovernance.require_close_reason;
6328
- }
6329
- return extras;
6330
- }
6331
- function resolveGovernanceKnobs(settings) {
6332
- const rawGovernance = settings.governance ?? {};
6333
- const preset = normalizeGovernancePreset(rawGovernance.preset);
6334
- const extras = resolveGovernanceExtras(rawGovernance);
6335
- if (preset === "custom") {
6336
- const baseline2 = resolveGovernanceKnobsFromPreset("default");
6337
- const requireCloseReason2 = extras.require_close_reason ?? baseline2.require_close_reason;
6338
- return {
6339
- preset,
6340
- ownership_enforcement: rawGovernance.ownership_enforcement ?? baseline2.ownership_enforcement,
6341
- create_mode_default: rawGovernance.create_mode_default ?? baseline2.create_mode_default,
6342
- close_validation_default: rawGovernance.close_validation_default ?? baseline2.close_validation_default,
6343
- parent_reference: rawGovernance.parent_reference ?? baseline2.parent_reference,
6344
- metadata_profile: rawGovernance.metadata_profile ?? baseline2.metadata_profile,
6345
- force_required_for_stale_lock: rawGovernance.force_required_for_stale_lock ?? baseline2.force_required_for_stale_lock,
6346
- ...extras,
6347
- require_close_reason: requireCloseReason2
6348
- };
6349
- }
6350
- const baseline = resolveGovernanceKnobsFromPreset(preset);
6351
- const requireCloseReason = extras.require_close_reason ?? baseline.require_close_reason;
6352
- return {
6353
- preset,
6354
- ...baseline,
6355
- ...extras,
6356
- require_close_reason: requireCloseReason
6357
- };
6358
- }
6359
- function cloneDefaults() {
6360
- return structuredClone(SETTINGS_DEFAULTS);
6361
- }
6362
- function normalizeSearchMutationRefreshPolicy(value) {
6363
- if (value === "cache_only" || value === "semantic_configured" || value === "semantic_auto") {
6364
- return value;
6365
- }
6366
- return SETTINGS_DEFAULTS.search.mutation_refresh_policy;
6367
- }
6368
- function normalizeSearchQueryExpansionEnabled(value) {
6369
- if (typeof value === "boolean") {
6370
- return value;
6371
- }
6372
- return SETTINGS_DEFAULTS.search.query_expansion.enabled;
6373
- }
6374
- function normalizeSearchQueryExpansionProvider(value) {
6375
- if (typeof value !== "string") {
6376
- return SETTINGS_DEFAULTS.search.query_expansion.provider;
6377
- }
6378
- return value.trim();
6379
- }
6380
- function normalizeSearchRerankEnabled(value) {
6381
- if (typeof value === "boolean") {
6382
- return value;
6383
- }
6384
- return SETTINGS_DEFAULTS.search.rerank.enabled;
6385
- }
6386
- function normalizeSearchRerankModel(value) {
6387
- if (typeof value !== "string") {
6388
- return SETTINGS_DEFAULTS.search.rerank.model;
6389
- }
6390
- return value.trim();
6391
- }
6392
- function normalizeSearchRerankTopK(value) {
6393
- if (typeof value === "number" && Number.isFinite(value) && Number.isInteger(value) && value > 0) {
6394
- return value;
6395
- }
6396
- return SETTINGS_DEFAULTS.search.rerank.top_k;
6397
- }
6398
- function normalizeVectorStoreCollectionName(value) {
6399
- if (typeof value !== "string") {
6400
- return SETTINGS_DEFAULTS.vector_store.collection_name;
6401
- }
6402
- const sanitized = value.trim().replaceAll(/[^a-zA-Z0-9_-]/g, "_");
6403
- const truncated = sanitized.slice(0, MAX_VECTOR_STORE_COLLECTION_NAME_LENGTH);
6404
- return truncated.length > 0 ? truncated : SETTINGS_DEFAULTS.vector_store.collection_name;
6405
- }
6406
- function buildSettingsPersistSourceSnapshot(parsedSettings, runtimeSettings) {
6407
- const sourceSchema = parsedSettings.schema;
6408
- const sourceStatuses = Array.isArray(sourceSchema?.statuses) ? sourceSchema?.statuses : void 0;
6409
- const sourceFields = Array.isArray(sourceSchema?.fields) ? sourceSchema?.fields : void 0;
6410
- const sourceTypeWorkflows = Array.isArray(sourceSchema?.type_workflows) ? sourceSchema?.type_workflows : void 0;
6411
- return {
6412
- has_source_item_type_definitions: Array.isArray(parsedSettings.item_types?.definitions),
6413
- source_item_type_definitions: normalizeItemTypeDefinitions(parsedSettings.item_types?.definitions),
6414
- has_source_schema_statuses: sourceStatuses !== void 0,
6415
- source_schema_statuses: sourceStatuses ? structuredClone(sourceStatuses) : [],
6416
- has_source_schema_fields: sourceFields !== void 0,
6417
- source_schema_fields: sourceFields ? structuredClone(sourceFields) : [],
6418
- has_source_schema_type_workflows: sourceTypeWorkflows !== void 0,
6419
- source_schema_type_workflows: sourceTypeWorkflows ? structuredClone(sourceTypeWorkflows) : [],
6420
- runtime_item_type_definitions: normalizeItemTypeDefinitions(runtimeSettings.item_types?.definitions),
6421
- runtime_schema_statuses: structuredClone(runtimeSettings.schema.statuses),
6422
- runtime_schema_fields: structuredClone(runtimeSettings.schema.fields),
6423
- runtime_schema_type_workflows: structuredClone(runtimeSettings.schema.type_workflows ?? [])
6424
- };
6425
- }
6426
- function attachSettingsPersistSourceSnapshot(settings, source) {
6427
- Object.defineProperty(settings, SETTINGS_PERSIST_SOURCE_SYMBOL, {
6428
- value: source,
6429
- writable: true,
6430
- configurable: true,
6431
- enumerable: false
6432
- });
6433
- }
6434
- function getSettingsPersistSourceSnapshot(settings) {
6435
- const candidate = settings[SETTINGS_PERSIST_SOURCE_SYMBOL];
6436
- if (!candidate || typeof candidate !== "object") {
6437
- return void 0;
6438
- }
6439
- return candidate;
6440
- }
6441
- function cloneSettingsReadResult(result) {
6442
- const clonedSettings = structuredClone(result.settings);
6443
- const persistSource = getSettingsPersistSourceSnapshot(result.settings);
6444
- if (persistSource) {
6445
- attachSettingsPersistSourceSnapshot(clonedSettings, structuredClone(persistSource));
6446
- }
6447
- return {
6448
- settings: clonedSettings,
6449
- metadata: {
6450
- has_explicit_item_format: result.metadata.has_explicit_item_format
6451
- },
6452
- warnings: [...result.warnings]
6453
- };
6454
- }
6455
- function resolveSettingsReadTrackedPaths(pmRoot, schema, settingsPath) {
6456
- const normalizedSchema = normalizeRuntimeSchemaSettings(schema);
6457
- return [
6458
- settingsPath,
6459
- filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),
6460
- filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),
6461
- filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),
6462
- filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows)
6463
- ];
6464
- }
6465
- async function cacheSettingsReadResult(pmRoot, trackedPaths, result) {
6466
- const signatures = await collectSettingsReadCacheSignatures(trackedPaths);
6467
- setSettingsReadCacheEntry(pmRoot, {
6468
- tracked_paths: trackedPaths,
6469
- signatures,
6470
- value: cloneSettingsReadResult(result)
6471
- });
6472
- }
6473
- async function cacheSettingsReadResultSafe(pmRoot, trackedPaths, result) {
6474
- try {
6475
- await cacheSettingsReadResult(pmRoot, trackedPaths, result);
6476
- } catch {
6477
- clearSettingsReadCache(pmRoot);
6478
- }
6479
- }
6480
- function findSettingsReadCacheSignature(signatures, targetPath) {
6481
- return signatures.find((signature) => signature.path === targetPath);
6482
- }
6483
- function selectedSettingsReadCacheSignaturesEqual(before, after, targetPaths) {
6484
- for (const targetPath of targetPaths) {
6485
- const beforeSignature = findSettingsReadCacheSignature(before, targetPath);
6486
- const afterSignature = findSettingsReadCacheSignature(after, targetPath);
6487
- if (!beforeSignature || !afterSignature || !settingsReadCacheSignaturesEqual([beforeSignature], [afterSignature])) {
6488
- return false;
6489
- }
6490
- }
6491
- return true;
6492
- }
6493
- async function cacheSettingsReadResultIfStable(pmRoot, trackedPaths, result, stableSignatures, stablePaths) {
6494
- try {
6495
- const currentSignatures = await collectSettingsReadCacheSignatures(trackedPaths);
6496
- if (!selectedSettingsReadCacheSignaturesEqual(stableSignatures, currentSignatures, stablePaths)) {
6497
- clearSettingsReadCache(pmRoot);
6498
- return;
6499
- }
6500
- setSettingsReadCacheEntry(pmRoot, {
6501
- tracked_paths: trackedPaths,
6502
- signatures: currentSignatures,
6503
- value: cloneSettingsReadResult(result)
6504
- });
6505
- } catch {
6506
- clearSettingsReadCache(pmRoot);
6507
- }
6508
- }
6509
- function resolvePersistedFileBackedSchemaSections(settings, source) {
6510
- const normalizedSchema = normalizeRuntimeSchemaSettings(settings.schema);
6511
- const currentItemTypeDefinitions = normalizeItemTypeDefinitions(settings.item_types?.definitions);
6512
- if (!source) {
6513
- return {
6514
- item_type_definitions: currentItemTypeDefinitions,
6515
- schema_statuses: normalizedSchema.statuses,
6516
- schema_fields: normalizedSchema.fields,
6517
- schema_type_workflows: normalizedSchema.type_workflows
6518
- };
6519
- }
6520
- const currentTypeWorkflows = normalizedSchema.type_workflows ?? [];
6521
- const itemTypeDefinitionsUnchanged = stableValueEquals(currentItemTypeDefinitions, source.runtime_item_type_definitions);
6522
- const schemaStatusesUnchanged = stableValueEquals(normalizedSchema.statuses, source.runtime_schema_statuses);
6523
- const schemaFieldsUnchanged = stableValueEquals(normalizedSchema.fields, source.runtime_schema_fields);
6524
- const schemaTypeWorkflowsUnchanged = stableValueEquals(currentTypeWorkflows, source.runtime_schema_type_workflows);
6525
- return {
6526
- item_type_definitions: itemTypeDefinitionsUnchanged ? source.has_source_item_type_definitions ? normalizeItemTypeDefinitions(source.source_item_type_definitions) : [] : currentItemTypeDefinitions,
6527
- schema_statuses: schemaStatusesUnchanged ? source.has_source_schema_statuses ? structuredClone(source.source_schema_statuses) : [] : normalizedSchema.statuses,
6528
- schema_fields: schemaFieldsUnchanged ? source.has_source_schema_fields ? structuredClone(source.source_schema_fields) : [] : normalizedSchema.fields,
6529
- schema_type_workflows: schemaTypeWorkflowsUnchanged ? source.has_source_schema_type_workflows ? structuredClone(source.source_schema_type_workflows) : void 0 : normalizedSchema.type_workflows
6530
- };
6531
- }
6532
- function buildFallbackSettingsReadResult(warning) {
6533
- return {
6534
- settings: cloneDefaults(),
6535
- metadata: {
6536
- has_explicit_item_format: false
6537
- },
6538
- warnings: warning ? [warning] : []
6539
- };
6540
- }
6541
- function hasExplicitItemFormat(raw) {
6542
- if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
6543
- return false;
6544
- }
6545
- const itemFormat = raw.item_format;
6546
- return itemFormat === "toon" || itemFormat === "json_markdown";
6547
- }
6548
- function normalizeStringList2(values) {
6549
- return [...new Set((values ?? []).map((value) => value.trim()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
6550
- }
6551
- function normalizeAgentGuidanceSettings(value) {
6552
- const defaults = SETTINGS_DEFAULTS.agent_guidance;
6553
- const templateVersion = value?.template_version;
6554
- return {
6555
- prompt_completed: value?.prompt_completed === true,
6556
- declined: value?.declined === true,
6557
- declined_at: typeof value?.declined_at === "string" ? value.declined_at : defaults.declined_at,
6558
- template_version: typeof templateVersion === "number" && Number.isInteger(templateVersion) && templateVersion > 0 ? templateVersion : defaults.template_version,
6559
- last_checked_files: normalizeStringList2(value?.last_checked_files ?? defaults.last_checked_files)
6560
- };
6561
- }
6562
- function normalizeLowerStringList(values) {
6563
- return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
6564
- }
6565
- function normalizeExtensionPolicyMode(value) {
6566
- if (value === "off" || value === "warn" || value === "enforce") {
6567
- return value;
6568
- }
6569
- return SETTINGS_DEFAULTS.extensions.policy.mode;
6570
- }
6571
- function normalizeExtensionTrustMode(value) {
6572
- if (value === "off" || value === "warn" || value === "enforce") {
6573
- return value;
6574
- }
6575
- return SETTINGS_DEFAULTS.extensions.policy.trust_mode;
6576
- }
6577
- function normalizeExtensionSandboxProfile(value) {
6578
- if (value === "none" || value === "restricted" || value === "strict") {
6579
- return value;
6580
- }
6581
- return SETTINGS_DEFAULTS.extensions.policy.default_sandbox_profile;
6582
- }
6583
- function normalizeExtensionPolicyOverride(override) {
6584
- const name = override.name.trim().toLowerCase();
6585
- if (name.length === 0) {
6586
- return null;
6587
- }
6588
- const normalized = {
6589
- name
6590
- };
6591
- if (override.disabled === true) {
6592
- normalized.disabled = true;
6593
- }
6594
- if (override.require_trusted === true) {
6595
- normalized.require_trusted = true;
6596
- }
6597
- if (override.require_provenance === true) {
6598
- normalized.require_provenance = true;
6599
- }
6600
- if (override.sandbox_profile !== void 0) {
6601
- normalized.sandbox_profile = normalizeExtensionSandboxProfile(override.sandbox_profile);
6602
- }
6603
- const allowedCapabilities = normalizeLowerStringList(override.allowed_capabilities);
6604
- const blockedCapabilities = normalizeLowerStringList(override.blocked_capabilities);
6605
- const allowedSurfaces = normalizeLowerStringList(override.allowed_surfaces);
6606
- const blockedSurfaces = normalizeLowerStringList(override.blocked_surfaces);
6607
- const allowedCommands = normalizeLowerStringList(override.allowed_commands);
6608
- const blockedCommands = normalizeLowerStringList(override.blocked_commands);
6609
- const allowedActions = normalizeLowerStringList(override.allowed_actions);
6610
- const blockedActions = normalizeLowerStringList(override.blocked_actions);
6611
- const allowedServices = normalizeLowerStringList(override.allowed_services);
6612
- const blockedServices = normalizeLowerStringList(override.blocked_services);
6613
- if (allowedCapabilities.length > 0) {
6614
- normalized.allowed_capabilities = allowedCapabilities;
6615
- }
6616
- if (blockedCapabilities.length > 0) {
6617
- normalized.blocked_capabilities = blockedCapabilities;
6618
- }
6619
- if (allowedSurfaces.length > 0) {
6620
- normalized.allowed_surfaces = allowedSurfaces;
6621
- }
6622
- if (blockedSurfaces.length > 0) {
6623
- normalized.blocked_surfaces = blockedSurfaces;
6624
- }
6625
- if (allowedCommands.length > 0) {
6626
- normalized.allowed_commands = allowedCommands;
6627
- }
6628
- if (blockedCommands.length > 0) {
6629
- normalized.blocked_commands = blockedCommands;
6630
- }
6631
- if (allowedActions.length > 0) {
6632
- normalized.allowed_actions = allowedActions;
6633
- }
6634
- if (blockedActions.length > 0) {
6635
- normalized.blocked_actions = blockedActions;
6636
- }
6637
- if (allowedServices.length > 0) {
6638
- normalized.allowed_services = allowedServices;
6639
- }
6640
- if (blockedServices.length > 0) {
6641
- normalized.blocked_services = blockedServices;
6642
- }
6643
- return normalized;
6644
- }
6645
- function normalizeExtensionPolicyOverrides(overrides) {
6646
- const dedupedByName = /* @__PURE__ */ new Map();
6647
- for (const override of overrides ?? []) {
6648
- const normalized = normalizeExtensionPolicyOverride(override);
6649
- if (!normalized) {
6650
- continue;
6651
- }
6652
- dedupedByName.set(normalized.name, normalized);
6653
- }
6654
- return [...dedupedByName.values()].sort((left, right) => left.name.localeCompare(right.name));
6655
- }
6656
- function normalizePmMaxVersionExceededModeValue2(value) {
6657
- return value === "block" || value === "warn" ? value : void 0;
6658
- }
6659
- function normalizePmMaxVersionExceededModeSetting(value) {
6660
- if (typeof value === "string") {
6661
- return normalizePmMaxVersionExceededModeValue2(value);
6662
- }
6663
- if (typeof value === "object" && value !== null && !Array.isArray(value)) {
6664
- const global = normalizePmMaxVersionExceededModeValue2(value.global);
6665
- const project = normalizePmMaxVersionExceededModeValue2(value.project);
6666
- if (global === void 0 && project === void 0) {
6667
- return void 0;
6668
- }
6669
- return {
6670
- ...global !== void 0 ? { global } : {},
6671
- ...project !== void 0 ? { project } : {}
6672
- };
6673
- }
6674
- return void 0;
6675
- }
6676
- function normalizeExtensionPolicyList(policy, key) {
6677
- return normalizeLowerStringList(policy?.[key] ?? SETTINGS_DEFAULTS.extensions.policy[key]);
6678
- }
6679
- function normalizeExtensionPolicySettings(policy) {
6680
- const pmMaxVersionExceededMode2 = normalizePmMaxVersionExceededModeSetting(policy?.pm_max_version_exceeded_mode);
6681
- return {
6682
- mode: normalizeExtensionPolicyMode(policy?.mode),
6683
- trust_mode: normalizeExtensionTrustMode(policy?.trust_mode),
6684
- ...pmMaxVersionExceededMode2 !== void 0 ? { pm_max_version_exceeded_mode: pmMaxVersionExceededMode2 } : {},
6685
- require_provenance: policy?.require_provenance === true,
6686
- trusted_extensions: normalizeExtensionPolicyList(policy, "trusted_extensions"),
6687
- default_sandbox_profile: normalizeExtensionSandboxProfile(policy?.default_sandbox_profile),
6688
- allowed_extensions: normalizeExtensionPolicyList(policy, "allowed_extensions"),
6689
- blocked_extensions: normalizeExtensionPolicyList(policy, "blocked_extensions"),
6690
- allowed_capabilities: normalizeExtensionPolicyList(policy, "allowed_capabilities"),
6691
- blocked_capabilities: normalizeExtensionPolicyList(policy, "blocked_capabilities"),
6692
- allowed_surfaces: normalizeExtensionPolicyList(policy, "allowed_surfaces"),
6693
- blocked_surfaces: normalizeExtensionPolicyList(policy, "blocked_surfaces"),
6694
- allowed_commands: normalizeExtensionPolicyList(policy, "allowed_commands"),
6695
- blocked_commands: normalizeExtensionPolicyList(policy, "blocked_commands"),
6696
- allowed_actions: normalizeExtensionPolicyList(policy, "allowed_actions"),
6697
- blocked_actions: normalizeExtensionPolicyList(policy, "blocked_actions"),
6698
- allowed_services: normalizeExtensionPolicyList(policy, "allowed_services"),
6699
- blocked_services: normalizeExtensionPolicyList(policy, "blocked_services"),
6700
- extension_overrides: normalizeExtensionPolicyOverrides(policy?.extension_overrides ?? SETTINGS_DEFAULTS.extensions.policy.extension_overrides)
6701
- };
6702
- }
6703
- function normalizeValidationMetadataRequiredFields(values) {
6704
- const normalized = [...new Set((values ?? []).map((value) => value.trim().toLowerCase().replaceAll("-", "_")))].filter((value) => value.length > 0).sort((left, right) => left.localeCompare(right));
6705
- return normalized.filter((value) => [
6706
- "author",
6707
- "acceptance_criteria",
6708
- "estimated_minutes",
6709
- "close_reason",
6710
- "reviewer",
6711
- "risk",
6712
- "confidence",
6713
- "sprint",
6714
- "release"
6715
- ].includes(value));
6716
- }
6717
- function normalizeValidationPatternList(values) {
6718
- return [...new Set((values ?? []).map((value) => value.trim().toLowerCase()).filter((value) => value.length > 0))].sort((left, right) => left.localeCompare(right));
6719
- }
6720
- function valueOrDefault(value, fallback) {
6721
- return value === void 0 ? fallback : value;
6722
- }
6723
- function recordOrEmpty(value) {
6724
- return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
6725
- }
6726
- function arrayOrEmpty(value) {
6727
- return Array.isArray(value) ? value : [];
6728
- }
6729
- function buildValidationSettings(settings, defaults, governance) {
6730
- return {
6731
- ...defaults.validation,
6732
- ...settings.validation,
6733
- parent_reference: governance.parent_reference,
6734
- metadata_profile: governance.metadata_profile,
6735
- metadata_required_fields: normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),
6736
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns ?? defaults.validation.lifecycle_stale_blocker_reason_patterns),
6737
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? defaults.validation.lifecycle_closure_like_blocked_reason_patterns),
6738
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns ?? defaults.validation.lifecycle_closure_like_resolution_patterns),
6739
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns ?? defaults.validation.lifecycle_closure_like_actual_result_patterns),
6740
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)
6741
- };
6742
- }
6743
- function buildTelemetrySettings(settings, defaults) {
6744
- return {
6745
- enabled: settings.telemetry?.enabled ?? defaults.telemetry.enabled,
6746
- first_run_prompt_completed: settings.telemetry?.first_run_prompt_completed ?? defaults.telemetry.first_run_prompt_completed,
6747
- capture_level: settings.telemetry?.capture_level ?? defaults.telemetry.capture_level,
6748
- endpoint: settings.telemetry?.endpoint ?? defaults.telemetry.endpoint,
6749
- installation_id: settings.telemetry?.installation_id ?? defaults.telemetry.installation_id,
6750
- retention_days: settings.telemetry?.retention_days ?? defaults.telemetry.retention_days
6751
- };
6752
- }
6753
- function buildSearchSettings(settings, defaults) {
6754
- return {
6755
- ...defaults.search,
6756
- ...settings.search,
6757
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),
6758
- query_expansion: {
6759
- ...defaults.search.query_expansion,
6760
- ...settings.search?.query_expansion,
6761
- enabled: normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),
6762
- provider: normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)
6763
- },
6764
- rerank: {
6765
- ...defaults.search.rerank,
6766
- ...settings.search?.rerank,
6767
- enabled: normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),
6768
- model: normalizeSearchRerankModel(settings.search?.rerank?.model),
6769
- top_k: normalizeSearchRerankTopK(settings.search?.rerank?.top_k)
6770
- }
6771
- };
6772
- }
6773
- function buildVectorStoreSettings(settings, defaults) {
6774
- return {
6775
- adapter: settings.vector_store.adapter ?? defaults.vector_store.adapter,
6776
- collection_name: normalizeVectorStoreCollectionName(settings.vector_store.collection_name),
6777
- qdrant: { ...defaults.vector_store.qdrant, ...settings.vector_store.qdrant },
6778
- lancedb: { ...defaults.vector_store.lancedb, ...settings.vector_store.lancedb }
6779
- };
6780
- }
6781
- function normalizeSettingsItemFormat(settings, defaults) {
6782
- if (settings.item_format === "json_markdown") {
6783
- return "toon";
6784
- }
6785
- return settings.item_format ?? defaults.item_format;
6786
- }
6787
- function buildContextSettings(settings, defaults) {
6788
- return {
6789
- default_depth: settings.context?.default_depth ?? defaults.context.default_depth,
6790
- activity_limit: settings.context?.activity_limit ?? defaults.context.activity_limit,
6791
- stale_threshold_days: settings.context?.stale_threshold_days ?? defaults.context.stale_threshold_days,
6792
- sections: {
6793
- ...defaults.context.sections,
6794
- ...settings.context?.sections
6795
- }
6796
- };
6797
- }
6798
- function buildProviderSettings(settings, defaults) {
6799
- return {
6800
- openai: { ...defaults.providers.openai, ...settings.providers.openai },
6801
- ollama: { ...defaults.providers.ollama, ...settings.providers.ollama }
6802
- };
6803
- }
6804
- function normalizeItemTypeDefinitions(definitions) {
6805
- const normalized = (definitions ?? []).map((definition) => normalizeItemTypeDefinition(definition)).filter((definition) => definition !== null);
6806
- const dedupedByName = /* @__PURE__ */ new Map();
6807
- for (const definition of normalized) {
6808
- dedupedByName.set(definition.name.toLowerCase(), definition);
6809
- }
6810
- return [...dedupedByName.values()].sort((left, right) => left.name.localeCompare(right.name));
6811
- }
6812
- function mergeSettings(settings) {
6813
- const defaults = cloneDefaults();
6814
- const governance = resolveGovernanceKnobs({
6815
- governance: settings.governance ?? { preset: "default" }
6816
- });
6817
- return {
6818
- ...defaults,
6819
- ...settings,
6820
- item_format: normalizeSettingsItemFormat(settings, defaults),
6821
- locks: { ...defaults.locks, ...settings.locks },
6822
- checkpoints: { ...defaults.checkpoints, ...settings.checkpoints },
6823
- output: { ...defaults.output, ...settings.output },
6824
- history: {
6825
- ...defaults.history,
6826
- ...settings.history,
6827
- compact_policy: {
6828
- ...defaults.history.compact_policy,
6829
- ...settings.history?.compact_policy
6830
- }
6831
- },
6832
- validation: buildValidationSettings(settings, defaults, governance),
6833
- governance,
6834
- workflow: {
6835
- definition_of_done: [...settings.workflow?.definition_of_done ?? defaults.workflow.definition_of_done]
6836
- },
6837
- testing: {
6838
- record_results_to_items: settings.testing?.record_results_to_items ?? defaults.testing.record_results_to_items
6839
- },
6840
- telemetry: buildTelemetrySettings(settings, defaults),
6841
- agent_guidance: normalizeAgentGuidanceSettings(settings.agent_guidance ?? defaults.agent_guidance),
6842
- item_types: {
6843
- definitions: normalizeItemTypeDefinitions(settings.item_types?.definitions)
6844
- },
6845
- schema: normalizeRuntimeSchemaSettings(settings.schema ?? defaults.schema),
6846
- context: buildContextSettings(settings, defaults),
6847
- extensions: {
6848
- enabled: [...settings.extensions.enabled],
6849
- disabled: [...settings.extensions.disabled],
6850
- policy: normalizeExtensionPolicySettings(settings.extensions.policy ?? defaults.extensions.policy)
6851
- },
6852
- search: buildSearchSettings(settings, defaults),
6853
- providers: buildProviderSettings(settings, defaults),
6854
- vector_store: buildVectorStoreSettings(settings, defaults)
6855
- };
6856
- }
6857
- function orderSerializedSettingsSections(ordered) {
6858
- ordered.locks = orderObject(ordered.locks, ["ttl_seconds"]);
6859
- ordered.checkpoints = orderObject(ordered.checkpoints, ["retention_days"]);
6860
- ordered.output = orderObject(ordered.output, ["default_format"]);
6861
- ordered.history = orderObject(ordered.history, ["missing_stream", "compact_policy"]);
6862
- ordered.validation = orderObject(ordered.validation, [
6863
- "sprint_release_format",
6864
- "parent_reference",
6865
- "metadata_profile",
6866
- "metadata_required_fields",
6867
- "lifecycle_stale_blocker_reason_patterns",
6868
- "lifecycle_closure_like_blocked_reason_patterns",
6869
- "lifecycle_closure_like_resolution_patterns",
6870
- "lifecycle_closure_like_actual_result_patterns",
6871
- "estimate_defaults_by_type"
6872
- ]);
6873
- ordered.governance = orderObject(ordered.governance, [
6874
- "preset",
6875
- "ownership_enforcement",
6876
- "create_mode_default",
6877
- "close_validation_default",
6878
- "require_close_reason",
6879
- "parent_reference",
6880
- "metadata_profile",
6881
- "force_required_for_stale_lock",
6882
- "create_default_type",
6883
- "workflow_enforcement"
6884
- ]);
6885
- ordered.workflow = orderObject(ordered.workflow, ["definition_of_done"]);
6886
- ordered.testing = orderObject(ordered.testing, ["record_results_to_items"]);
6887
- ordered.telemetry = orderObject(ordered.telemetry, [
6888
- "enabled",
6889
- "first_run_prompt_completed",
6890
- "capture_level",
6891
- "endpoint",
6892
- "installation_id",
6893
- "retention_days"
6894
- ]);
6895
- ordered.agent_guidance = orderObject(ordered.agent_guidance, [
6896
- "prompt_completed",
6897
- "declined",
6898
- "declined_at",
6899
- "template_version",
6900
- "last_checked_files"
6901
- ]);
6902
- ordered.item_types = orderObject(ordered.item_types, ["definitions"]);
6903
- ordered.schema = orderObject(ordered.schema, [
6904
- "version",
6905
- "files",
6906
- "statuses",
6907
- "fields",
6908
- "workflow",
6909
- "type_workflows",
6910
- "unknown_field_policy"
6911
- ]);
6912
- ordered.schema.files = orderObject(recordOrEmpty(ordered.schema.files), ["types", "statuses", "fields", "workflows"]);
6913
- ordered.schema.workflow = orderObject(recordOrEmpty(ordered.schema.workflow), ["draft_status", "open_status", "in_progress_status", "blocked_status", "close_status", "canceled_status"]);
6914
- ordered.context = orderObject(ordered.context, [
6915
- "default_depth",
6916
- "activity_limit",
6917
- "stale_threshold_days",
6918
- "sections"
6919
- ]);
6920
- ordered.context.sections = orderObject(recordOrEmpty(ordered.context.sections), ["hierarchy", "activity", "progress", "blockers", "files", "workload", "staleness", "tests"]);
6921
- ordered.extensions = orderObject(ordered.extensions, ["enabled", "disabled", "policy"]);
6922
- ordered.extensions.policy = orderObject(recordOrEmpty(ordered.extensions.policy), [
6923
- "mode",
6924
- "trust_mode",
6925
- "pm_max_version_exceeded_mode",
6926
- "require_provenance",
6927
- "trusted_extensions",
6928
- "default_sandbox_profile",
6929
- "allowed_extensions",
6930
- "blocked_extensions",
6931
- "allowed_capabilities",
6932
- "blocked_capabilities",
6933
- "allowed_surfaces",
6934
- "blocked_surfaces",
6935
- "allowed_commands",
6936
- "blocked_commands",
6937
- "allowed_actions",
6938
- "blocked_actions",
6939
- "allowed_services",
6940
- "blocked_services",
6941
- "extension_overrides"
6942
- ]);
6943
- ordered.extensions.policy.extension_overrides = arrayOrEmpty(ordered.extensions.policy.extension_overrides).map((entry) => orderObject(recordOrEmpty(entry), [
6944
- "name",
6945
- "disabled",
6946
- "require_trusted",
6947
- "require_provenance",
6948
- "sandbox_profile",
6949
- "allowed_capabilities",
6950
- "blocked_capabilities",
6951
- "allowed_surfaces",
6952
- "blocked_surfaces",
6953
- "allowed_commands",
6954
- "blocked_commands",
6955
- "allowed_actions",
6956
- "blocked_actions",
6957
- "allowed_services",
6958
- "blocked_services"
6959
- ]));
6960
- ordered.search = orderObject(ordered.search, [
6961
- "score_threshold",
6962
- "hybrid_semantic_weight",
6963
- "max_results",
6964
- "embedding_model",
6965
- "embedding_corpus_max_characters",
6966
- "embedding_batch_size",
6967
- "embedding_timeout_ms",
6968
- "scanner_max_batch_retries",
6969
- "provider",
6970
- "mutation_refresh_policy",
6971
- "query_expansion",
6972
- "rerank"
6973
- ]);
6974
- ordered.search.query_expansion = orderObject(recordOrEmpty(ordered.search.query_expansion), ["enabled", "provider"]);
6975
- ordered.search.rerank = orderObject(recordOrEmpty(ordered.search.rerank), ["enabled", "model", "top_k"]);
6976
- ordered.providers = orderObject(ordered.providers, ["openai", "ollama"]);
6977
- ordered.providers.openai = orderObject(recordOrEmpty(ordered.providers.openai), ["base_url", "api_key", "model"]);
6978
- ordered.providers.ollama = orderObject(recordOrEmpty(ordered.providers.ollama), ["base_url", "model"]);
6979
- ordered.vector_store = orderObject(ordered.vector_store, [
6980
- "adapter",
6981
- "collection_name",
6982
- "qdrant",
6983
- "lancedb"
6984
- ]);
6985
- ordered.vector_store.qdrant = orderObject(recordOrEmpty(ordered.vector_store.qdrant), ["url", "api_key"]);
6986
- ordered.vector_store.lancedb = orderObject(recordOrEmpty(ordered.vector_store.lancedb), ["path"]);
6987
- }
6988
- function buildSerializeBaseSettings(settings) {
6989
- return {
6990
- ...settings,
6991
- locks: valueOrDefault(settings.locks, SETTINGS_DEFAULTS.locks),
6992
- checkpoints: valueOrDefault(settings.checkpoints, SETTINGS_DEFAULTS.checkpoints),
6993
- output: valueOrDefault(settings.output, SETTINGS_DEFAULTS.output),
6994
- history: valueOrDefault(settings.history, SETTINGS_DEFAULTS.history),
6995
- validation: valueOrDefault(settings.validation, SETTINGS_DEFAULTS.validation),
6996
- workflow: valueOrDefault(settings.workflow, SETTINGS_DEFAULTS.workflow),
6997
- testing: valueOrDefault(settings.testing, SETTINGS_DEFAULTS.testing),
6998
- telemetry: valueOrDefault(settings.telemetry, SETTINGS_DEFAULTS.telemetry),
6999
- agent_guidance: valueOrDefault(settings.agent_guidance, SETTINGS_DEFAULTS.agent_guidance),
7000
- item_types: valueOrDefault(settings.item_types, SETTINGS_DEFAULTS.item_types),
7001
- schema: valueOrDefault(settings.schema, SETTINGS_DEFAULTS.schema),
7002
- context: valueOrDefault(settings.context, SETTINGS_DEFAULTS.context),
7003
- extensions: valueOrDefault(settings.extensions, SETTINGS_DEFAULTS.extensions),
7004
- search: valueOrDefault(settings.search, SETTINGS_DEFAULTS.search),
7005
- providers: valueOrDefault(settings.providers, SETTINGS_DEFAULTS.providers),
7006
- vector_store: valueOrDefault(settings.vector_store, SETTINGS_DEFAULTS.vector_store)
7007
- };
7008
- }
7009
- function buildSerializedValidationSettings(baseSettings, governance) {
7010
- return {
7011
- ...baseSettings.validation,
7012
- parent_reference: governance.parent_reference,
7013
- metadata_profile: governance.metadata_profile,
7014
- metadata_required_fields: normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),
7015
- lifecycle_stale_blocker_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),
7016
- lifecycle_closure_like_blocked_reason_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),
7017
- lifecycle_closure_like_resolution_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),
7018
- lifecycle_closure_like_actual_result_patterns: normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns ?? SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),
7019
- estimate_defaults_by_type: normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)
7020
- };
7021
- }
7022
- function buildSerializedSearchSettings(baseSettings) {
7023
- return {
7024
- ...SETTINGS_DEFAULTS.search,
7025
- ...baseSettings.search,
7026
- mutation_refresh_policy: normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),
7027
- query_expansion: {
7028
- ...SETTINGS_DEFAULTS.search.query_expansion,
7029
- ...baseSettings.search?.query_expansion,
7030
- enabled: normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),
7031
- provider: normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)
7032
- },
7033
- rerank: {
7034
- ...SETTINGS_DEFAULTS.search.rerank,
7035
- ...baseSettings.search?.rerank,
7036
- enabled: normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),
7037
- model: normalizeSearchRerankModel(baseSettings.search?.rerank?.model),
7038
- top_k: normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)
7039
- }
7040
- };
7041
- }
7042
- function buildSerializedContextSettings(baseSettings) {
7043
- return {
7044
- default_depth: baseSettings.context?.default_depth ?? SETTINGS_DEFAULTS.context.default_depth,
7045
- activity_limit: baseSettings.context?.activity_limit ?? SETTINGS_DEFAULTS.context.activity_limit,
7046
- stale_threshold_days: baseSettings.context?.stale_threshold_days ?? SETTINGS_DEFAULTS.context.stale_threshold_days,
7047
- sections: {
7048
- ...SETTINGS_DEFAULTS.context.sections,
7049
- ...baseSettings.context?.sections
7050
- }
7051
- };
7052
- }
7053
- function buildSerializedVectorStoreSettings(baseSettings) {
7054
- return {
7055
- ...baseSettings.vector_store,
7056
- adapter: baseSettings.vector_store?.adapter ?? SETTINGS_DEFAULTS.vector_store.adapter,
7057
- collection_name: normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),
7058
- qdrant: { ...baseSettings.vector_store?.qdrant },
7059
- lancedb: { ...baseSettings.vector_store?.lancedb }
7060
- };
7061
- }
7062
- function buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections) {
7063
- return {
7064
- ...baseSettings,
7065
- item_format: "toon",
7066
- validation: buildSerializedValidationSettings(baseSettings, governance),
7067
- governance,
7068
- agent_guidance: normalizeAgentGuidanceSettings(baseSettings.agent_guidance),
7069
- item_types: {
7070
- definitions: persistedFileBackedSections.item_type_definitions
7071
- },
7072
- schema: {
7073
- ...normalizedSchema,
7074
- statuses: persistedFileBackedSections.schema_statuses,
7075
- fields: persistedFileBackedSections.schema_fields,
7076
- type_workflows: persistedFileBackedSections.schema_type_workflows
7077
- },
7078
- search: buildSerializedSearchSettings(baseSettings),
7079
- context: buildSerializedContextSettings(baseSettings),
7080
- extensions: {
7081
- enabled: normalizeStringList2(baseSettings.extensions?.enabled),
7082
- disabled: normalizeStringList2(baseSettings.extensions?.disabled),
7083
- policy: normalizeExtensionPolicySettings(baseSettings.extensions?.policy)
7084
- },
7085
- vector_store: buildSerializedVectorStoreSettings(baseSettings)
7086
- };
7087
- }
7088
- function serializeSettings(settings, options = {}) {
7089
- const baseSettings = buildSerializeBaseSettings(settings);
7090
- const governance = resolveGovernanceKnobs(baseSettings);
7091
- const normalizedSchema = normalizeRuntimeSchemaSettings(baseSettings.schema);
7092
- const persistedFileBackedSections = resolvePersistedFileBackedSchemaSections(baseSettings, options.persist_source);
7093
- const normalizedSettings = buildNormalizedSettingsForSerialization(baseSettings, governance, normalizedSchema, persistedFileBackedSections);
7094
- const ordered = orderObject({
7095
- ...normalizedSettings,
7096
- governance: normalizeGovernanceForPersist(governance)
7097
- }, [
7098
- "version",
7099
- "id_prefix",
7100
- "author_default",
7101
- "item_format",
7102
- "locks",
7103
- "checkpoints",
7104
- "output",
7105
- "history",
7106
- "validation",
7107
- "governance",
7108
- "workflow",
7109
- "testing",
7110
- "telemetry",
7111
- "agent_guidance",
7112
- "item_types",
7113
- "schema",
7114
- "context",
7115
- "extensions",
7116
- "search",
7117
- "providers",
7118
- "vector_store"
7119
- ]);
7120
- orderSerializedSettingsSections(ordered);
7121
- return `${JSON.stringify(ordered, null, 2)}
7122
- `;
7123
- }
7124
- async function readSettingsWithMetadata(pmRoot) {
7125
- const settingsPath = getSettingsPath(pmRoot);
7126
- let trackedPathsForFailure = [settingsPath];
7127
- await runActiveOnReadHooks({
7128
- path: settingsPath,
7129
- scope: "project"
7130
- });
7131
- const cachedResult = getSettingsReadCacheEntry(pmRoot);
7132
- if (cachedResult) {
7133
- const currentSignatures = await collectSettingsReadCacheSignatures(cachedResult.tracked_paths);
7134
- if (settingsReadCacheSignaturesEqual(currentSignatures, cachedResult.signatures)) {
7135
- return cloneSettingsReadResult(cachedResult.value);
7136
- }
7137
- }
7138
- const settingsOnlySignatures = await collectSettingsReadCacheSignatures([settingsPath]);
7139
- const raw = await readFileIfExists(settingsPath);
7140
- if (raw === null) {
7141
- const fallback = buildFallbackSettingsReadResult();
7142
- await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsOnlySignatures, [settingsPath]);
7143
- return fallback;
7144
- }
7145
- const settingsSignaturesAfterRead = await collectSettingsReadCacheSignatures([settingsPath]);
7146
- if (!settingsReadCacheSignaturesEqual(settingsOnlySignatures, settingsSignaturesAfterRead)) {
7147
- clearSettingsReadCache(pmRoot);
7148
- return readSettingsWithMetadata(pmRoot);
7149
- }
7150
- let parsed;
7151
- try {
7152
- parsed = JSON.parse(raw);
7153
- } catch {
7154
- const fallback = buildFallbackSettingsReadResult("settings_read_invalid_json");
7155
- await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsSignaturesAfterRead, [settingsPath]);
7156
- return fallback;
7157
- }
7158
- const validated = validateSettings(parsed);
7159
- if (!validated.success) {
7160
- const fallback = buildFallbackSettingsReadResult("settings_read_invalid_schema");
7161
- await cacheSettingsReadResultIfStable(pmRoot, [settingsPath], fallback, settingsSignaturesAfterRead, [settingsPath]);
7162
- return fallback;
7163
- }
7164
- try {
7165
- const mergedSettings = mergeSettings(validated.data);
7166
- const trackedPaths = resolveSettingsReadTrackedPaths(pmRoot, mergedSettings.schema, settingsPath);
7167
- trackedPathsForFailure = trackedPaths;
7168
- const signaturesBeforeSchemaLoad = await collectSettingsReadCacheSignatures(trackedPaths);
7169
- const schemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, mergedSettings.schema);
7170
- const loadedSchemaSections = await loadRuntimeSchemaFromOptionalFiles(pmRoot, mergedSettings.schema);
7171
- const signaturesAfterSchemaLoad = await collectSettingsReadCacheSignatures(trackedPaths);
7172
- const settings = {
7173
- ...mergedSettings,
7174
- item_types: {
7175
- definitions: normalizeItemTypeDefinitions([
7176
- ...mergedSettings.item_types.definitions,
7177
- ...arrayOrEmpty(loadedSchemaSections.type_definitions_from_file)
7178
- ])
7179
- },
7180
- schema: loadedSchemaSections.schema
7181
- };
7182
- attachSettingsPersistSourceSnapshot(settings, buildSettingsPersistSourceSnapshot(validated.data, settings));
7183
- const result = {
7184
- settings,
7185
- metadata: {
7186
- has_explicit_item_format: hasExplicitItemFormat(parsed)
7187
- },
7188
- warnings: [
7189
- ...validated.data.item_format === "json_markdown" ? ["settings_item_format_legacy_json_markdown_coerced_to_toon"] : [],
7190
- ...schemaScaffold.created_paths.map((createdPath) => `runtime_schema_bootstrap_created:${createdPath}`),
7191
- ...loadedSchemaSections.warnings
7192
- ]
7193
- };
7194
- if (schemaScaffold.created_paths.length === 0) {
7195
- if (!settingsReadCacheSignaturesEqual(signaturesBeforeSchemaLoad, signaturesAfterSchemaLoad)) {
7196
- clearSettingsReadCache(pmRoot);
7197
- } else {
7198
- setSettingsReadCacheEntry(pmRoot, {
7199
- tracked_paths: trackedPaths,
7200
- signatures: signaturesAfterSchemaLoad,
7201
- value: cloneSettingsReadResult(result)
7202
- });
7203
- }
7204
- } else {
7205
- clearSettingsReadCache(pmRoot);
7206
- }
7207
- return result;
7208
- } catch {
7209
- const fallback = buildFallbackSettingsReadResult("settings_read_merge_failed");
7210
- await cacheSettingsReadResultSafe(pmRoot, trackedPathsForFailure, fallback);
7211
- return fallback;
7212
- }
7213
- }
7214
- async function readSettings(pmRoot) {
7215
- return (await readSettingsWithMetadata(pmRoot)).settings;
7216
- }
7217
- async function writeSettings(pmRoot, settings, op = SETTINGS_WRITE_OP) {
7218
- const settingsPath = getSettingsPath(pmRoot);
7219
- await writeFileAtomic(settingsPath, serializeSettings(settings, {
7220
- persist_source: getSettingsPersistSourceSnapshot(settings)
7221
- }));
7222
- try {
7223
- await runActiveOnWriteHooks({
7224
- path: settingsPath,
7225
- scope: "project",
7226
- op
7227
- });
7228
- } finally {
7229
- clearSettingsReadCache(pmRoot);
7230
- }
7231
- }
7232
-
7233
5484
  export {
7234
5485
  ensureDir,
7235
5486
  pathExists,
@@ -7240,13 +5491,17 @@ export {
7240
5491
  isPathWithinDirectory,
7241
5492
  resolvePmPackageRootFromModule,
7242
5493
  resolvePmCliVersion,
5494
+ resolveConfiguredPmPackageRoot,
7243
5495
  KNOWN_EXTENSION_CAPABILITIES,
5496
+ EXTENSION_CAPABILITY_CONTRACT_VERSION,
5497
+ EXTENSION_CAPABILITY_LEGACY_ALIASES,
7244
5498
  EXTENSION_CAPABILITY_CONTRACT,
7245
5499
  KNOWN_EXTENSION_POLICY_MODES,
7246
5500
  KNOWN_EXTENSION_TRUST_MODES,
7247
5501
  KNOWN_EXTENSION_SANDBOX_PROFILES,
7248
5502
  KNOWN_EXTENSION_POLICY_SURFACES,
7249
5503
  KNOWN_EXTENSION_SERVICE_NAMES,
5504
+ createDefaultExtensionGovernancePolicy,
7250
5505
  PM_DIRNAME,
7251
5506
  CREATE_DIRECT_CLOSE_REASON_DEFAULT,
7252
5507
  PM_CORE_REQUIRED_SUBDIRS,
@@ -7262,15 +5517,18 @@ export {
7262
5517
  EXIT_CODE,
7263
5518
  resolveTelemetryErrorCategory,
7264
5519
  BUILTIN_ITEM_TYPE_VALUES,
5520
+ ITEM_TYPE_VALUES,
7265
5521
  STATUS_VALUES,
7266
5522
  RUNTIME_STATUS_ROLE_VALUES,
7267
5523
  RUNTIME_FIELD_TYPE_VALUES,
7268
5524
  RUNTIME_FIELD_COMMAND_VALUES,
5525
+ RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,
7269
5526
  DEPENDENCY_KIND_VALUES,
7270
5527
  SCOPE_VALUES,
7271
5528
  RISK_VALUES,
7272
5529
  ISSUE_SEVERITY_VALUES,
7273
5530
  CONFIDENCE_TEXT_VALUES,
5531
+ GOVERNANCE_PRESET_VALUES,
7274
5532
  RECURRENCE_FREQUENCY_VALUES,
7275
5533
  RECURRENCE_WEEKDAY_VALUES,
7276
5534
  weekdayOrderIndex,
@@ -7280,6 +5538,7 @@ export {
7280
5538
  PLAN_STEP_LINK_KIND_VALUES,
7281
5539
  CONTEXT_DEPTH_VALUES,
7282
5540
  CONTEXT_SECTION_VALUES,
5541
+ normalizeItemTypeDefinition,
7283
5542
  COMMON_MUTATION_COMMAND_OPTION_KEYS,
7284
5543
  canonicalizeCommandOptionKey,
7285
5544
  commandOptionFlagLabel,
@@ -7315,71 +5574,57 @@ export {
7315
5574
  coercePositiveInteger,
7316
5575
  coerceNumberInRange,
7317
5576
  asRecordOrNull,
5577
+ asPropertyRecord,
5578
+ resolveActivatablePropertyRecord,
7318
5579
  resolveFlagValueKind,
7319
5580
  flattenFlagListValue,
7320
5581
  levenshteinDistanceWithinLimit,
7321
5582
  normalizeItemFieldType,
5583
+ evaluatePmMinVersionBound,
5584
+ evaluatePmMaxVersionBound,
5585
+ normalizeKnownExtensionCapability,
5586
+ resolveLegacyExtensionCapabilityAlias,
7322
5587
  parseUnknownExtensionCapabilityWarning,
7323
5588
  parseLegacyExtensionCapabilityAliasWarning,
5589
+ normalizeCommandName,
7324
5590
  createEmptyExtensionRegistrationRegistry,
7325
5591
  runBeforeCommandHooks,
7326
5592
  runAfterCommandHooks,
5593
+ runOnWriteHooks,
5594
+ runOnReadHooks,
5595
+ runOnIndexHooks,
5596
+ runCommandHandler,
5597
+ runParserOverride,
5598
+ runPreflightOverride,
5599
+ runServiceOverrideSync,
5600
+ runServiceOverride,
5601
+ runCommandOverride,
5602
+ runRendererOverride,
5603
+ DEFAULT_EXTENSION_PRIORITY,
7327
5604
  nextExtensionReloadToken,
5605
+ isCanonicalPathWithinDirectory,
7328
5606
  resolveExtensionRoots,
7329
5607
  discoverExtensions,
7330
5608
  loadExtensions,
5609
+ deactivateExtensions,
7331
5610
  activateExtensions,
5611
+ EXTENSION_CAPABILITY_REGISTRATION_SURFACES,
7332
5612
  normalizeExtensionName,
7333
5613
  collectUsedExtensionCapabilities,
7334
5614
  reconcileExtensionCapabilityUsage,
7335
- setActiveExtensionHooks,
7336
- setActiveExtensionCommands,
7337
- setActiveExtensionParsers,
7338
- setActiveExtensionPreflight,
7339
- setActiveExtensionServices,
7340
- setActiveExtensionRenderers,
7341
- setActiveExtensionRegistrations,
7342
- getActiveExtensionRegistrations,
7343
- setActiveCommandContext,
7344
- setActiveCommandResult,
7345
- getActiveCommandResult,
7346
- recordAfterCommandAffectedItem,
7347
- projectAfterCommandItemSnapshot,
7348
- consumeAfterCommandAffectedItems,
7349
- clearActiveExtensionHooks,
7350
- runActiveOnWriteHooks,
7351
- runActiveOnReadHooks,
7352
- hasActiveOnReadHooks,
7353
- runActiveOnIndexHooks,
7354
- runActiveCommandOverride,
7355
- runActiveCommandHandler,
7356
- runActiveParserOverride,
7357
- runActivePreflightOverride,
7358
- runActiveRendererOverride,
7359
- runActiveServiceOverride,
7360
- runActiveServiceOverrideSync,
7361
5615
  DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
7362
5616
  DEFAULT_RUNTIME_STATUS_DEFINITIONS,
7363
5617
  normalizeRuntimeSchemaSettings,
7364
5618
  filePathForSchemaSection,
7365
5619
  resolveItemTypesFilePath,
7366
5620
  ensureRuntimeSchemaFileScaffold,
5621
+ loadRuntimeSchemaFromOptionalFiles,
7367
5622
  resolveRuntimeStatusRegistry,
7368
5623
  normalizeStatusInputWithRegistry,
7369
5624
  resolveRuntimeFieldRegistry,
7370
5625
  runtimeFieldOptionTarget,
7371
- statusIsTerminal,
7372
- PmCliError,
7373
- stableStringify,
7374
- stableValueEquals,
7375
- sha256Hex,
7376
- orderObject,
7377
- resolveEstimateDefaultMinutes,
7378
- resolveGovernanceKnobs,
7379
- readSettingsWithMetadata,
7380
- readSettings,
7381
- writeSettings
5626
+ statusIsTerminal
7382
5627
  };
7383
- //# sourceMappingURL=chunk-SL2ANJSV.js.map
5628
+ //# sourceMappingURL=chunk-YD5FML7K.js.map
7384
5629
 
7385
- //# debugId=59f1e772-921a-51db-980b-56d08f636039
5630
+ //# debugId=b82b3892-108d-51df-a033-47913481d9b1