@unbrained/pm-cli 2026.6.9 → 2026.6.10

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 (506) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/cli/bootstrap-args.js +4 -2
  3. package/dist/cli/bootstrap-args.js.map +1 -1
  4. package/dist/cli/commands/aggregate.d.ts +7 -0
  5. package/dist/cli/commands/aggregate.js +53 -12
  6. package/dist/cli/commands/aggregate.js.map +1 -1
  7. package/dist/cli/commands/close.d.ts +1 -0
  8. package/dist/cli/commands/close.js +106 -3
  9. package/dist/cli/commands/close.js.map +1 -1
  10. package/dist/cli/commands/completion.js +20 -7
  11. package/dist/cli/commands/completion.js.map +1 -1
  12. package/dist/cli/commands/context.d.ts +9 -0
  13. package/dist/cli/commands/context.js +149 -20
  14. package/dist/cli/commands/context.js.map +1 -1
  15. package/dist/cli/commands/create.d.ts +1 -0
  16. package/dist/cli/commands/create.js +5 -3
  17. package/dist/cli/commands/create.js.map +1 -1
  18. package/dist/cli/commands/extension.js +4 -2
  19. package/dist/cli/commands/extension.js.map +1 -1
  20. package/dist/cli/commands/health.js +44 -6
  21. package/dist/cli/commands/health.js.map +1 -1
  22. package/dist/cli/commands/history.js +6 -5
  23. package/dist/cli/commands/history.js.map +1 -1
  24. package/dist/cli/commands/linked-test-parsers.d.ts +1 -0
  25. package/dist/cli/commands/linked-test-parsers.js +289 -2
  26. package/dist/cli/commands/linked-test-parsers.js.map +1 -1
  27. package/dist/cli/commands/reindex.d.ts +1 -0
  28. package/dist/cli/commands/reindex.js +33 -4
  29. package/dist/cli/commands/reindex.js.map +1 -1
  30. package/dist/cli/commands/test.d.ts +6 -0
  31. package/dist/cli/commands/test.js +46 -5
  32. package/dist/cli/commands/test.js.map +1 -1
  33. package/dist/cli/extension-command-help.d.ts +1 -0
  34. package/dist/cli/extension-command-help.js +42 -2
  35. package/dist/cli/extension-command-help.js.map +1 -1
  36. package/dist/cli/extension-command-options.d.ts +2 -0
  37. package/dist/cli/extension-command-options.js +51 -2
  38. package/dist/cli/extension-command-options.js.map +1 -1
  39. package/dist/cli/main.js +26 -26
  40. package/dist/cli/main.js.map +1 -1
  41. package/dist/cli/register-list-query.js +3 -2
  42. package/dist/cli/register-list-query.js.map +1 -1
  43. package/dist/cli/register-mutation.js +4 -2
  44. package/dist/cli/register-mutation.js.map +1 -1
  45. package/dist/cli/register-operations.js +15 -6
  46. package/dist/cli/register-operations.js.map +1 -1
  47. package/dist/cli/registration-helpers.js +9 -2
  48. package/dist/cli/registration-helpers.js.map +1 -1
  49. package/dist/cli-bundle/chunks/activity-5QLX6DHN.js +16 -0
  50. package/dist/cli-bundle/chunks/{activity-RUJATACW.js → activity-W6TS5F2L.js} +11 -11
  51. package/dist/cli-bundle/chunks/{aggregate-IQ27NFBI.js → aggregate-NNJLKGEK.js} +64 -23
  52. package/dist/cli-bundle/chunks/aggregate-NNJLKGEK.js.map +7 -0
  53. package/dist/cli-bundle/chunks/{aggregate-TT7OCHHT.js → aggregate-UK2WJ4Z3.js} +65 -24
  54. package/dist/cli-bundle/chunks/aggregate-UK2WJ4Z3.js.map +1 -0
  55. package/dist/cli-bundle/chunks/{append-CWQZBUWV.js → append-7BS36Z2L.js} +8 -8
  56. package/dist/cli-bundle/chunks/{append-E7AJ5RTR.js → append-DHGTLUZW.js} +8 -8
  57. package/dist/cli-bundle/chunks/{chunk-FHUI7AXS.js → chunk-2MKBPWMK.js} +3 -3
  58. package/dist/cli-bundle/chunks/{chunk-42IULX44.js → chunk-344GDQTH.js} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-5MMLINZB.js → chunk-3VTWCBXL.js} +3 -3
  60. package/dist/cli-bundle/chunks/{chunk-NUGAWYEN.js → chunk-4CYHWHZU.js} +2 -2
  61. package/dist/cli-bundle/chunks/{chunk-T7NWFVOA.js → chunk-4H2NDEGJ.js} +7 -7
  62. package/dist/cli-bundle/chunks/{chunk-FKH7K6YP.js → chunk-5HH6QRH5.js} +9 -9
  63. package/dist/cli-bundle/chunks/{chunk-OPYA2HIU.js → chunk-5OMABP7I.js} +7 -7
  64. package/dist/cli-bundle/chunks/{chunk-RKCJ2JMA.js → chunk-6ADVKPVV.js} +7 -7
  65. package/dist/cli-bundle/chunks/{chunk-EFRHTZO4.js → chunk-6KQS23TX.js} +8 -8
  66. package/dist/cli-bundle/chunks/{chunk-YX5LAKFJ.js → chunk-6N46IM44.js} +2 -2
  67. package/dist/cli-bundle/chunks/{chunk-WQZCEEQN.js → chunk-6OSG3EMX.js} +157 -12
  68. package/dist/cli-bundle/chunks/chunk-6OSG3EMX.js.map +1 -0
  69. package/dist/cli-bundle/chunks/{chunk-CAXUGAAF.js → chunk-73PSHEMT.js} +8 -8
  70. package/dist/cli-bundle/chunks/{chunk-RE2JQJZJ.js → chunk-7DUVDW7C.js} +3 -3
  71. package/dist/cli-bundle/chunks/{chunk-U3Z4OCZC.js → chunk-7GYMMDDW.js} +2 -2
  72. package/dist/cli-bundle/chunks/{chunk-SAUXUI6U.js → chunk-7TW64BS5.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-T7B5VAKD.js → chunk-A6XVYNQJ.js} +13 -6
  74. package/dist/cli-bundle/chunks/chunk-A6XVYNQJ.js.map +7 -0
  75. package/dist/cli-bundle/chunks/{chunk-E7LOIIFP.js → chunk-ANVZCNL5.js} +3 -3
  76. package/dist/cli-bundle/chunks/{chunk-NJRZIJ4N.js → chunk-BE5G7HEL.js} +14 -8
  77. package/dist/cli-bundle/chunks/chunk-BE5G7HEL.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{chunk-RLVI7KDW.js → chunk-CMEHZD6G.js} +163 -11
  79. package/dist/cli-bundle/chunks/chunk-CMEHZD6G.js.map +7 -0
  80. package/dist/cli-bundle/chunks/{chunk-D5D7VKIC.js → chunk-CTW7QAHM.js} +6 -5
  81. package/dist/cli-bundle/chunks/chunk-CTW7QAHM.js.map +1 -0
  82. package/dist/cli-bundle/chunks/{chunk-KTVXLI54.js → chunk-D6JZBUZ6.js} +7 -7
  83. package/dist/cli-bundle/chunks/{chunk-I26E6XA7.js → chunk-DEYNERFX.js} +8 -6
  84. package/dist/cli-bundle/chunks/chunk-DEYNERFX.js.map +1 -0
  85. package/dist/cli-bundle/chunks/{chunk-YI6W2DBN.js → chunk-DMDEC4QP.js} +6 -6
  86. package/dist/cli-bundle/chunks/{chunk-AM2AXVFS.js → chunk-DTRIVUTN.js} +5 -5
  87. package/dist/cli-bundle/chunks/{chunk-I4FGL3K2.js → chunk-EAQLLID6.js} +16 -6
  88. package/dist/cli-bundle/chunks/chunk-EAQLLID6.js.map +1 -0
  89. package/dist/cli-bundle/chunks/{chunk-JEGFLKSI.js → chunk-EIS32UA4.js} +2 -2
  90. package/dist/cli-bundle/chunks/chunk-F2PVV7IX.js +528 -0
  91. package/dist/cli-bundle/chunks/chunk-F2PVV7IX.js.map +7 -0
  92. package/dist/cli-bundle/chunks/{chunk-4LRVXVJK.js → chunk-GF5XIBUH.js} +70 -9
  93. package/dist/cli-bundle/chunks/chunk-GF5XIBUH.js.map +7 -0
  94. package/dist/cli-bundle/chunks/{chunk-PUSOAQCR.js → chunk-GP6SHEAI.js} +5 -5
  95. package/dist/cli-bundle/chunks/{chunk-I3UILOUU.js → chunk-GRHPU6EM.js} +2 -2
  96. package/dist/cli-bundle/chunks/{chunk-WCWIDJII.js → chunk-I2FM2SMO.js} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-ANKG2JKL.js → chunk-IEQ3N7WP.js} +12 -5
  98. package/dist/cli-bundle/chunks/chunk-IEQ3N7WP.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{chunk-JN3BT7UY.js → chunk-K45NAJV2.js} +9 -9
  100. package/dist/cli-bundle/chunks/{chunk-23WNCJBA.js → chunk-K7SXBA75.js} +2 -2
  101. package/dist/cli-bundle/chunks/{chunk-FJNJEWU4.js → chunk-KHBRV5JU.js} +14 -12
  102. package/dist/cli-bundle/chunks/chunk-KHBRV5JU.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-7YTWXGE3.js → chunk-KMMUDSSB.js} +112 -7
  104. package/dist/cli-bundle/chunks/chunk-KMMUDSSB.js.map +1 -0
  105. package/dist/cli-bundle/chunks/{chunk-JVMAOD54.js → chunk-KRZQGRVL.js} +14 -7
  106. package/dist/cli-bundle/chunks/chunk-KRZQGRVL.js.map +1 -0
  107. package/dist/cli-bundle/chunks/{chunk-BACSNVWE.js → chunk-LUJQJR7G.js} +71 -69
  108. package/dist/cli-bundle/chunks/{chunk-BACSNVWE.js.map → chunk-LUJQJR7G.js.map} +1 -1
  109. package/dist/cli-bundle/chunks/{chunk-P2NVFE4L.js → chunk-LYL32FT6.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-AVGOVJGV.js → chunk-MF6KSSMF.js} +9 -9
  111. package/dist/cli-bundle/chunks/{chunk-AVGOVJGV.js.map → chunk-MF6KSSMF.js.map} +1 -1
  112. package/dist/cli-bundle/chunks/{chunk-ZPXDD6RQ.js → chunk-O64EYNHF.js} +6 -6
  113. package/dist/cli-bundle/chunks/{chunk-C72IQIBT.js → chunk-OQGJSCZZ.js} +301 -30
  114. package/dist/cli-bundle/chunks/chunk-OQGJSCZZ.js.map +7 -0
  115. package/dist/cli-bundle/chunks/{chunk-44JP4PYY.js → chunk-OROMGSBP.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-LU54Z4QI.js → chunk-OSGWBWLK.js} +76 -74
  117. package/dist/cli-bundle/chunks/{chunk-LU54Z4QI.js.map → chunk-OSGWBWLK.js.map} +3 -3
  118. package/dist/cli-bundle/chunks/{chunk-OT6XAMO5.js → chunk-OVNSQHDG.js} +7 -5
  119. package/dist/cli-bundle/chunks/{chunk-OT6XAMO5.js.map → chunk-OVNSQHDG.js.map} +2 -2
  120. package/dist/cli-bundle/chunks/{chunk-PW7C262O.js → chunk-PYULT32I.js} +2 -2
  121. package/dist/cli-bundle/chunks/{chunk-NHRZSYAA.js → chunk-Q6PSD5DZ.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-A5342JVL.js → chunk-QGIWURY3.js} +12 -12
  123. package/dist/cli-bundle/chunks/{chunk-GPOSGWCN.js → chunk-QJ2OIEOC.js} +68 -7
  124. package/dist/cli-bundle/chunks/chunk-QJ2OIEOC.js.map +1 -0
  125. package/dist/cli-bundle/chunks/{chunk-5ATRWEZO.js → chunk-SNASEDXB.js} +3 -3
  126. package/dist/cli-bundle/chunks/{chunk-KDX6VC3P.js → chunk-T6QLB34N.js} +3 -3
  127. package/dist/cli-bundle/chunks/{chunk-6IGTNFE3.js → chunk-TALBUVWF.js} +2 -2
  128. package/dist/cli-bundle/chunks/{chunk-VDVVOLR6.js → chunk-TV6FZGVK.js} +3 -3
  129. package/dist/cli-bundle/chunks/{chunk-H37YPWLM.js → chunk-TXWMLDMG.js} +13 -7
  130. package/dist/cli-bundle/chunks/chunk-TXWMLDMG.js.map +7 -0
  131. package/dist/cli-bundle/chunks/{chunk-TLD3UYGY.js → chunk-TZLGCTA5.js} +5 -4
  132. package/dist/cli-bundle/chunks/chunk-TZLGCTA5.js.map +7 -0
  133. package/dist/cli-bundle/chunks/{chunk-7CR4GAYN.js → chunk-UDWUDUJI.js} +2 -2
  134. package/dist/cli-bundle/chunks/{chunk-YSANBZAE.js → chunk-UMWF6ZAS.js} +12 -5
  135. package/dist/cli-bundle/chunks/chunk-UMWF6ZAS.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-F2REA7VW.js → chunk-UNH3KSHG.js} +3 -3
  137. package/dist/cli-bundle/chunks/{chunk-4TJWRPIH.js → chunk-UY26RIBR.js} +2 -2
  138. package/dist/cli-bundle/chunks/{chunk-MNXJ6YDO.js → chunk-VSS3CSTF.js} +9 -9
  139. package/dist/cli-bundle/chunks/{chunk-EQ6N6IDR.js → chunk-WBU257Z4.js} +13 -11
  140. package/dist/cli-bundle/chunks/chunk-WBU257Z4.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-5JF76OJF.js → chunk-WNMRICXH.js} +289 -25
  142. package/dist/cli-bundle/chunks/chunk-WNMRICXH.js.map +1 -0
  143. package/dist/cli-bundle/chunks/chunk-WSWOQP3Z.js +518 -0
  144. package/dist/cli-bundle/chunks/chunk-WSWOQP3Z.js.map +1 -0
  145. package/dist/cli-bundle/chunks/{chunk-ENCVPOID.js → chunk-WWEFBBVF.js} +12 -12
  146. package/dist/cli-bundle/chunks/{chunk-XEOO6K5J.js → chunk-X3IPJU2O.js} +9 -9
  147. package/dist/cli-bundle/chunks/{chunk-RMTI5R76.js → chunk-X5YC5DZM.js} +111 -6
  148. package/dist/cli-bundle/chunks/chunk-X5YC5DZM.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-3RHE76G6.js → chunk-XH6RA5A5.js} +15 -15
  150. package/dist/cli-bundle/chunks/chunk-XH6RA5A5.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-LF2VNLEZ.js → chunk-XRE4CTNP.js} +8 -8
  152. package/dist/cli-bundle/chunks/{chunk-LF2VNLEZ.js.map → chunk-XRE4CTNP.js.map} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-SD6H3RLA.js → chunk-XSCGU4WT.js} +15 -5
  154. package/dist/cli-bundle/chunks/{chunk-SD6H3RLA.js.map → chunk-XSCGU4WT.js.map} +2 -2
  155. package/dist/cli-bundle/chunks/{chunk-BIRVSIM2.js → chunk-ZH7C7ZVX.js} +14 -14
  156. package/dist/cli-bundle/chunks/chunk-ZH7C7ZVX.js.map +7 -0
  157. package/dist/cli-bundle/chunks/{claim-UXFGCF3P.js → claim-3TY5LE54.js} +10 -10
  158. package/dist/cli-bundle/chunks/{claim-RV6WYUF7.js → claim-LM4YY6QQ.js} +10 -10
  159. package/dist/cli-bundle/chunks/{close-O4JK2JKD.js → close-CSD4LEMT.js} +8 -8
  160. package/dist/cli-bundle/chunks/close-SIQCDOBR.js +13 -0
  161. package/dist/cli-bundle/chunks/{close-many-EQO4TPIE.js → close-many-B5SHDX6W.js} +15 -15
  162. package/dist/cli-bundle/chunks/{close-many-SRDBV3SI.js → close-many-WRXB5KVY.js} +15 -15
  163. package/dist/cli-bundle/chunks/{comments-OMB7YE27.js → comments-A5ALOYTG.js} +10 -10
  164. package/dist/cli-bundle/chunks/{comments-TTZUIB2O.js → comments-BDDEK3VW.js} +10 -10
  165. package/dist/cli-bundle/chunks/{config-5VPR42A6.js → config-W2NHDNQT.js} +8 -8
  166. package/dist/cli-bundle/chunks/{config-NNLXVGVC.js → config-YUYBMJOW.js} +8 -8
  167. package/dist/cli-bundle/chunks/{context-4QK6GRXO.js → context-LRJ74NSU.js} +146 -33
  168. package/dist/cli-bundle/chunks/{context-4QK6GRXO.js.map → context-LRJ74NSU.js.map} +2 -2
  169. package/dist/cli-bundle/chunks/{context-4N7GYTVQ.js → context-R2QLOJCK.js} +147 -34
  170. package/dist/cli-bundle/chunks/context-R2QLOJCK.js.map +1 -0
  171. package/dist/cli-bundle/chunks/{contracts-AOBNEBVT.js → contracts-47X7RYUF.js} +4 -4
  172. package/dist/cli-bundle/chunks/{contracts-DXCWXOSP.js → contracts-HJHR4NCD.js} +4 -4
  173. package/dist/cli-bundle/chunks/{copy-XSYEQTLA.js → copy-B7HFOWFB.js} +7 -7
  174. package/dist/cli-bundle/chunks/{copy-5NM3SVJA.js → copy-P4UVYZ7M.js} +7 -7
  175. package/dist/cli-bundle/chunks/{create-FCCAATQV.js → create-5ERJF64D.js} +13 -13
  176. package/dist/cli-bundle/chunks/create-TXNRPS4K.js +27 -0
  177. package/dist/cli-bundle/chunks/{delete-5JFP6OG7.js → delete-LX3LGBCH.js} +7 -7
  178. package/dist/cli-bundle/chunks/{delete-PQXJQXQ7.js → delete-S3WVK6LP.js} +7 -7
  179. package/dist/cli-bundle/chunks/{deps-XXKBOQUA.js → deps-GWSNH7OZ.js} +7 -7
  180. package/dist/cli-bundle/chunks/{deps-S5322EOQ.js → deps-YSM4LZQD.js} +7 -7
  181. package/dist/cli-bundle/chunks/{docs-DZRPAW5S.js → docs-7RYFBHQD.js} +9 -9
  182. package/dist/cli-bundle/chunks/{docs-C7CCVWAJ.js → docs-TG6JMVMY.js} +9 -9
  183. package/dist/cli-bundle/chunks/{extension-CSHP6FZX.js → extension-R3LUKMX7.js} +5 -5
  184. package/dist/cli-bundle/chunks/{extension-XNNVUVAY.js → extension-VNMRKIHI.js} +5 -5
  185. package/dist/cli-bundle/chunks/{files-OBWYYPKM.js → files-KAKU57OT.js} +9 -9
  186. package/dist/cli-bundle/chunks/{files-UPCNKEIZ.js → files-QB3EYPMO.js} +9 -9
  187. package/dist/cli-bundle/chunks/{gc-KXK6KBRN.js → gc-B747VM4M.js} +3 -3
  188. package/dist/cli-bundle/chunks/{gc-FA2ONELT.js → gc-KNUPLPSW.js} +3 -3
  189. package/dist/cli-bundle/chunks/{get-PNTSONGB.js → get-GMGLIQ5I.js} +11 -11
  190. package/dist/cli-bundle/chunks/{get-FLHYTOBA.js → get-SBL6NHYQ.js} +11 -11
  191. package/dist/cli-bundle/chunks/{health-CS5RNTJX.js → health-IG43Z4KL.js} +47 -19
  192. package/dist/cli-bundle/chunks/health-IG43Z4KL.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{health-KCRVYIYY.js → health-WWZJ5KJS.js} +46 -18
  194. package/dist/cli-bundle/chunks/health-WWZJ5KJS.js.map +7 -0
  195. package/dist/cli-bundle/chunks/history-6UKSZTRT.js +20 -0
  196. package/dist/cli-bundle/chunks/{history-COQTPBEU.js → history-XCWRXBXC.js} +10 -10
  197. package/dist/cli-bundle/chunks/{history-compact-66PSRYL3.js → history-compact-IDH7E7VN.js} +11 -11
  198. package/dist/cli-bundle/chunks/{history-compact-PVS2A3FS.js → history-compact-KICKUCR7.js} +11 -11
  199. package/dist/cli-bundle/chunks/history-redact-HKYBTK6X.js +19 -0
  200. package/dist/cli-bundle/chunks/{history-redact-DCXAWGTF.js → history-redact-JJWH3QWK.js} +11 -11
  201. package/dist/cli-bundle/chunks/{history-repair-TA3NRIFO.js → history-repair-7HWBZKXN.js} +11 -11
  202. package/dist/cli-bundle/chunks/{history-repair-SEQDFTGW.js → history-repair-N5HXKJOI.js} +11 -11
  203. package/dist/cli-bundle/chunks/init-27JLDUO2.js +17 -0
  204. package/dist/cli-bundle/chunks/{init-IQJE3EKJ.js → init-OQA3TWIS.js} +9 -9
  205. package/dist/cli-bundle/chunks/{learnings-XC6EMW5E.js → learnings-L7VQUSVI.js} +10 -10
  206. package/dist/cli-bundle/chunks/{learnings-RJPGH2ME.js → learnings-Z4GAIZQ5.js} +10 -10
  207. package/dist/cli-bundle/chunks/list-6U3CJVXS.js +19 -0
  208. package/dist/cli-bundle/chunks/{list-NJV6WBT4.js → list-W5ROBC5U.js} +10 -10
  209. package/dist/cli-bundle/chunks/{notes-2KWHADK3.js → notes-JJDOEDFK.js} +10 -10
  210. package/dist/cli-bundle/chunks/{notes-FNCDMZW2.js → notes-SDCK7BEN.js} +10 -10
  211. package/dist/cli-bundle/chunks/{plan-MQO5JTSV.js → plan-H5HYHMBB.js} +13 -13
  212. package/dist/cli-bundle/chunks/{plan-CYK2P5PD.js → plan-W2B5RYR3.js} +13 -13
  213. package/dist/cli-bundle/chunks/{register-list-query-IO3RR5K6.js → register-list-query-QGRFMDWA.js} +20 -20
  214. package/dist/cli-bundle/chunks/register-list-query-QGRFMDWA.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{register-list-query-6RA24SIZ.js → register-list-query-V4S23735.js} +21 -21
  216. package/dist/cli-bundle/chunks/register-list-query-V4S23735.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{register-mutation-VV2SC2KL.js → register-mutation-I57PLUHA.js} +36 -35
  218. package/dist/cli-bundle/chunks/register-mutation-I57PLUHA.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{register-mutation-KVFUXCAZ.js → register-mutation-ZPZNJXSA.js} +35 -34
  220. package/dist/cli-bundle/chunks/register-mutation-ZPZNJXSA.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{register-operations-DFNVRSJ5.js → register-operations-KAMLXAF5.js} +42 -37
  222. package/dist/cli-bundle/chunks/register-operations-KAMLXAF5.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{register-operations-TAUUTRJ4.js → register-operations-YEN4YEZ2.js} +41 -36
  224. package/dist/cli-bundle/chunks/register-operations-YEN4YEZ2.js.map +7 -0
  225. package/dist/cli-bundle/chunks/{register-setup-GAQZZRUA.js → register-setup-BZ3TNE3G.js} +15 -15
  226. package/dist/cli-bundle/chunks/{register-setup-X2R5CFDV.js → register-setup-WLFL3OUF.js} +15 -15
  227. package/dist/cli-bundle/chunks/restore-GNI2W5CN.js +17 -0
  228. package/dist/cli-bundle/chunks/{restore-E3GZKRRK.js → restore-RGFSPG4K.js} +11 -11
  229. package/dist/cli-bundle/chunks/{schema-3CPFLDAY.js → schema-CCDU3RLC.js} +8 -8
  230. package/dist/cli-bundle/chunks/{schema-7EHBPNXM.js → schema-KZASL323.js} +8 -8
  231. package/dist/cli-bundle/chunks/{search-OBZVYJJ2.js → search-7KSOLI2E.js} +10 -10
  232. package/dist/cli-bundle/chunks/{search-2T3NCCUR.js → search-DTL7CO22.js} +10 -10
  233. package/dist/cli-bundle/chunks/{stats-ULGQACF7.js → stats-IOXQMGI6.js} +7 -7
  234. package/dist/cli-bundle/chunks/{stats-6LVK4JER.js → stats-QNV7B2CE.js} +7 -7
  235. package/dist/cli-bundle/chunks/{telemetry-6G27FLCP.js → telemetry-IV5C6JOM.js} +4 -4
  236. package/dist/cli-bundle/chunks/{telemetry-HHKRTMZA.js → telemetry-NHR5RFXT.js} +4 -4
  237. package/dist/cli-bundle/chunks/test-4Z37CXW4.js +32 -0
  238. package/dist/cli-bundle/chunks/{test-2PP4YBV6.js → test-PIL2CEEB.js} +14 -14
  239. package/dist/cli-bundle/chunks/{test-all-NETGVNM6.js → test-all-GRLYHBNP.js} +14 -14
  240. package/dist/cli-bundle/chunks/{test-all-6Z272JRI.js → test-all-MFN4MYCV.js} +14 -14
  241. package/dist/cli-bundle/chunks/{test-runs-CRPQVMMG.js → test-runs-7LRFWWCA.js} +5 -5
  242. package/dist/cli-bundle/chunks/{test-runs-M24WA6TI.js → test-runs-7WCSC3TY.js} +5 -5
  243. package/dist/cli-bundle/chunks/update-I4G34LKJ.js +21 -0
  244. package/dist/cli-bundle/chunks/update-VI5DBZ3G.js +25 -0
  245. package/dist/cli-bundle/chunks/{update-many-JSRF5EH5.js → update-many-LOTAYUTN.js} +22 -22
  246. package/dist/cli-bundle/chunks/{update-many-Y3HOL7WA.js → update-many-UYMTVF42.js} +22 -22
  247. package/dist/cli-bundle/chunks/{upgrade-ECB6GH3M.js → upgrade-LT2MLLPS.js} +5 -5
  248. package/dist/cli-bundle/chunks/{upgrade-5RTQVKKE.js → upgrade-ZZSC7CLV.js} +5 -5
  249. package/dist/cli-bundle/chunks/{validate-J6Q444SD.js → validate-3XRORNMP.js} +16 -16
  250. package/dist/cli-bundle/chunks/{validate-MCNMAXVA.js → validate-IQIQSKUX.js} +16 -16
  251. package/dist/cli-bundle/main.js +132 -44
  252. package/dist/cli-bundle/main.js.map +2 -2
  253. package/dist/core/diagnostics/remediation.js +12 -2
  254. package/dist/core/diagnostics/remediation.js.map +1 -1
  255. package/dist/core/extensions/extension-policy.d.ts +14 -1
  256. package/dist/core/extensions/extension-policy.js +38 -3
  257. package/dist/core/extensions/extension-policy.js.map +1 -1
  258. package/dist/core/extensions/extension-types.d.ts +40 -1
  259. package/dist/core/extensions/extension-types.js +28 -2
  260. package/dist/core/extensions/extension-types.js.map +1 -1
  261. package/dist/core/extensions/loader.d.ts +6 -4
  262. package/dist/core/extensions/loader.js +67 -14
  263. package/dist/core/extensions/loader.js.map +1 -1
  264. package/dist/core/history/replay.d.ts +1 -1
  265. package/dist/core/history/replay.js +13 -4
  266. package/dist/core/history/replay.js.map +1 -1
  267. package/dist/core/output/mutation-projection.d.ts +2 -0
  268. package/dist/core/output/mutation-projection.js +9 -2
  269. package/dist/core/output/mutation-projection.js.map +1 -1
  270. package/dist/core/output/output.d.ts +2 -0
  271. package/dist/core/output/output.js +7 -3
  272. package/dist/core/output/output.js.map +1 -1
  273. package/dist/core/shared/command-types.d.ts +1 -0
  274. package/dist/core/shared/command-types.js +2 -2
  275. package/dist/core/shared/command-types.js.map +1 -1
  276. package/dist/core/shared/constants.js +7 -4
  277. package/dist/core/shared/constants.js.map +1 -1
  278. package/dist/core/store/item-store.d.ts +1 -1
  279. package/dist/core/store/item-store.js +3 -3
  280. package/dist/core/store/item-store.js.map +1 -1
  281. package/dist/core/store/settings-read-cache.d.ts +15 -0
  282. package/dist/core/store/settings-read-cache.js +72 -0
  283. package/dist/core/store/settings-read-cache.js.map +1 -0
  284. package/dist/core/store/settings-validator.d.ts +4 -1
  285. package/dist/core/store/settings-validator.js +14 -2
  286. package/dist/core/store/settings-validator.js.map +1 -1
  287. package/dist/core/store/settings.js +166 -16
  288. package/dist/core/store/settings.js.map +1 -1
  289. package/dist/core/telemetry/runtime.d.ts +1 -0
  290. package/dist/core/telemetry/runtime.js +3 -3
  291. package/dist/core/telemetry/runtime.js.map +1 -1
  292. package/dist/core/test/run-selectors.d.ts +27 -0
  293. package/dist/core/test/run-selectors.js +110 -0
  294. package/dist/core/test/run-selectors.js.map +1 -0
  295. package/dist/mcp/server.js +50 -11
  296. package/dist/mcp/server.js.map +1 -1
  297. package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -2
  298. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  299. package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
  300. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  301. package/dist/sdk/cli-contracts/tool-parameter-tables.js +29 -2
  302. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  303. package/dist/sdk/cli-contracts.js +37 -5
  304. package/dist/sdk/cli-contracts.js.map +1 -1
  305. package/dist/sdk/index.d.ts +1 -1
  306. package/dist/sdk/index.js +2 -2
  307. package/dist/sdk/index.js.map +1 -1
  308. package/dist/sdk/runtime.d.ts +6 -0
  309. package/dist/sdk/runtime.js +51 -3
  310. package/dist/sdk/runtime.js.map +1 -1
  311. package/dist/types.d.ts +4 -1
  312. package/dist/types.js +4 -2
  313. package/dist/types.js.map +1 -1
  314. package/docs/AGENT_GUIDE.md +7 -1
  315. package/docs/ARCHITECTURE.md +7 -0
  316. package/docs/COMMANDS.md +37 -3
  317. package/docs/CONFIGURATION.md +1 -1
  318. package/docs/EXTENSIONS.md +55 -53
  319. package/docs/SDK.md +8 -2
  320. package/docs/TESTING.md +60 -0
  321. package/docs/schemas/extension-manifest.schema.json +120 -0
  322. package/package.json +2 -2
  323. package/packages/pm-beads/extensions/beads/manifest.json +10 -0
  324. package/packages/pm-calendar/extensions/calendar/manifest.json +10 -0
  325. package/packages/pm-command-kit/README.md +72 -0
  326. package/packages/pm-command-kit/extensions/command-kit/index.js +181 -0
  327. package/packages/pm-command-kit/extensions/command-kit/index.ts +176 -0
  328. package/packages/pm-command-kit/extensions/command-kit/manifest.json +22 -0
  329. package/packages/pm-command-kit/package.json +53 -0
  330. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +10 -0
  331. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +10 -0
  332. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +10 -0
  333. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +10 -0
  334. package/packages/pm-search-advanced/extensions/search-advanced/index.js +6 -0
  335. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +6 -0
  336. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +10 -0
  337. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +1 -0
  338. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +1 -0
  339. package/packages/pm-templates/extensions/templates/manifest.json +10 -0
  340. package/packages/pm-todos/extensions/todos/manifest.json +10 -0
  341. package/dist/cli-bundle/chunks/activity-HF3VJYKH.js +0 -16
  342. package/dist/cli-bundle/chunks/aggregate-IQ27NFBI.js.map +0 -7
  343. package/dist/cli-bundle/chunks/aggregate-TT7OCHHT.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-3RHE76G6.js.map +0 -1
  345. package/dist/cli-bundle/chunks/chunk-4LRVXVJK.js.map +0 -7
  346. package/dist/cli-bundle/chunks/chunk-5JF76OJF.js.map +0 -1
  347. package/dist/cli-bundle/chunks/chunk-7YTWXGE3.js.map +0 -1
  348. package/dist/cli-bundle/chunks/chunk-ANKG2JKL.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-BIRVSIM2.js.map +0 -7
  350. package/dist/cli-bundle/chunks/chunk-C72IQIBT.js.map +0 -7
  351. package/dist/cli-bundle/chunks/chunk-D5D7VKIC.js.map +0 -1
  352. package/dist/cli-bundle/chunks/chunk-EQ6N6IDR.js.map +0 -7
  353. package/dist/cli-bundle/chunks/chunk-FJNJEWU4.js.map +0 -1
  354. package/dist/cli-bundle/chunks/chunk-GPOSGWCN.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-H37YPWLM.js.map +0 -7
  356. package/dist/cli-bundle/chunks/chunk-I26E6XA7.js.map +0 -1
  357. package/dist/cli-bundle/chunks/chunk-I4FGL3K2.js.map +0 -1
  358. package/dist/cli-bundle/chunks/chunk-JVMAOD54.js.map +0 -1
  359. package/dist/cli-bundle/chunks/chunk-LU2HE272.js +0 -242
  360. package/dist/cli-bundle/chunks/chunk-LU2HE272.js.map +0 -1
  361. package/dist/cli-bundle/chunks/chunk-NJRZIJ4N.js.map +0 -1
  362. package/dist/cli-bundle/chunks/chunk-O4L7Z6LB.js +0 -252
  363. package/dist/cli-bundle/chunks/chunk-O4L7Z6LB.js.map +0 -7
  364. package/dist/cli-bundle/chunks/chunk-RLVI7KDW.js.map +0 -7
  365. package/dist/cli-bundle/chunks/chunk-RMTI5R76.js.map +0 -7
  366. package/dist/cli-bundle/chunks/chunk-T7B5VAKD.js.map +0 -7
  367. package/dist/cli-bundle/chunks/chunk-TLD3UYGY.js.map +0 -7
  368. package/dist/cli-bundle/chunks/chunk-WQZCEEQN.js.map +0 -1
  369. package/dist/cli-bundle/chunks/chunk-YSANBZAE.js.map +0 -7
  370. package/dist/cli-bundle/chunks/close-JTTGW7TS.js +0 -13
  371. package/dist/cli-bundle/chunks/context-4N7GYTVQ.js.map +0 -1
  372. package/dist/cli-bundle/chunks/create-JAPLFDGJ.js +0 -27
  373. package/dist/cli-bundle/chunks/health-CS5RNTJX.js.map +0 -1
  374. package/dist/cli-bundle/chunks/health-KCRVYIYY.js.map +0 -7
  375. package/dist/cli-bundle/chunks/history-6624XISO.js +0 -20
  376. package/dist/cli-bundle/chunks/history-redact-ZRQTI7NB.js +0 -19
  377. package/dist/cli-bundle/chunks/init-ZVE2HMKK.js +0 -17
  378. package/dist/cli-bundle/chunks/list-OO5P472O.js +0 -19
  379. package/dist/cli-bundle/chunks/register-list-query-6RA24SIZ.js.map +0 -1
  380. package/dist/cli-bundle/chunks/register-list-query-IO3RR5K6.js.map +0 -7
  381. package/dist/cli-bundle/chunks/register-mutation-KVFUXCAZ.js.map +0 -7
  382. package/dist/cli-bundle/chunks/register-mutation-VV2SC2KL.js.map +0 -1
  383. package/dist/cli-bundle/chunks/register-operations-DFNVRSJ5.js.map +0 -1
  384. package/dist/cli-bundle/chunks/register-operations-TAUUTRJ4.js.map +0 -7
  385. package/dist/cli-bundle/chunks/restore-F4ALFV4D.js +0 -17
  386. package/dist/cli-bundle/chunks/test-PPOLRIBA.js +0 -32
  387. package/dist/cli-bundle/chunks/update-MCPCPMHV.js +0 -25
  388. package/dist/cli-bundle/chunks/update-O7TBOUVQ.js +0 -21
  389. /package/dist/cli-bundle/chunks/{activity-HF3VJYKH.js.map → activity-5QLX6DHN.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{activity-RUJATACW.js.map → activity-W6TS5F2L.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{append-CWQZBUWV.js.map → append-7BS36Z2L.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{append-E7AJ5RTR.js.map → append-DHGTLUZW.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-FHUI7AXS.js.map → chunk-2MKBPWMK.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-42IULX44.js.map → chunk-344GDQTH.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-5MMLINZB.js.map → chunk-3VTWCBXL.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-NUGAWYEN.js.map → chunk-4CYHWHZU.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-T7NWFVOA.js.map → chunk-4H2NDEGJ.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-FKH7K6YP.js.map → chunk-5HH6QRH5.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-OPYA2HIU.js.map → chunk-5OMABP7I.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-RKCJ2JMA.js.map → chunk-6ADVKPVV.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-EFRHTZO4.js.map → chunk-6KQS23TX.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-YX5LAKFJ.js.map → chunk-6N46IM44.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-CAXUGAAF.js.map → chunk-73PSHEMT.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-RE2JQJZJ.js.map → chunk-7DUVDW7C.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-U3Z4OCZC.js.map → chunk-7GYMMDDW.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-SAUXUI6U.js.map → chunk-7TW64BS5.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-E7LOIIFP.js.map → chunk-ANVZCNL5.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-KTVXLI54.js.map → chunk-D6JZBUZ6.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-YI6W2DBN.js.map → chunk-DMDEC4QP.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-AM2AXVFS.js.map → chunk-DTRIVUTN.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-JEGFLKSI.js.map → chunk-EIS32UA4.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-PUSOAQCR.js.map → chunk-GP6SHEAI.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-I3UILOUU.js.map → chunk-GRHPU6EM.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-WCWIDJII.js.map → chunk-I2FM2SMO.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-JN3BT7UY.js.map → chunk-K45NAJV2.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-23WNCJBA.js.map → chunk-K7SXBA75.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-P2NVFE4L.js.map → chunk-LYL32FT6.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-ZPXDD6RQ.js.map → chunk-O64EYNHF.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-44JP4PYY.js.map → chunk-OROMGSBP.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-PW7C262O.js.map → chunk-PYULT32I.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-NHRZSYAA.js.map → chunk-Q6PSD5DZ.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-A5342JVL.js.map → chunk-QGIWURY3.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-5ATRWEZO.js.map → chunk-SNASEDXB.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-KDX6VC3P.js.map → chunk-T6QLB34N.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-6IGTNFE3.js.map → chunk-TALBUVWF.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-VDVVOLR6.js.map → chunk-TV6FZGVK.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-7CR4GAYN.js.map → chunk-UDWUDUJI.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-F2REA7VW.js.map → chunk-UNH3KSHG.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-4TJWRPIH.js.map → chunk-UY26RIBR.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-MNXJ6YDO.js.map → chunk-VSS3CSTF.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-ENCVPOID.js.map → chunk-WWEFBBVF.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-XEOO6K5J.js.map → chunk-X3IPJU2O.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{claim-UXFGCF3P.js.map → claim-3TY5LE54.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{claim-RV6WYUF7.js.map → claim-LM4YY6QQ.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{close-O4JK2JKD.js.map → close-CSD4LEMT.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{close-JTTGW7TS.js.map → close-SIQCDOBR.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{close-many-EQO4TPIE.js.map → close-many-B5SHDX6W.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{close-many-SRDBV3SI.js.map → close-many-WRXB5KVY.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{comments-OMB7YE27.js.map → comments-A5ALOYTG.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{comments-TTZUIB2O.js.map → comments-BDDEK3VW.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{config-5VPR42A6.js.map → config-W2NHDNQT.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{config-NNLXVGVC.js.map → config-YUYBMJOW.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{contracts-AOBNEBVT.js.map → contracts-47X7RYUF.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{contracts-DXCWXOSP.js.map → contracts-HJHR4NCD.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{copy-XSYEQTLA.js.map → copy-B7HFOWFB.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{copy-5NM3SVJA.js.map → copy-P4UVYZ7M.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{create-FCCAATQV.js.map → create-5ERJF64D.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{create-JAPLFDGJ.js.map → create-TXNRPS4K.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{delete-5JFP6OG7.js.map → delete-LX3LGBCH.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{delete-PQXJQXQ7.js.map → delete-S3WVK6LP.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{deps-XXKBOQUA.js.map → deps-GWSNH7OZ.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{deps-S5322EOQ.js.map → deps-YSM4LZQD.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{docs-DZRPAW5S.js.map → docs-7RYFBHQD.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{docs-C7CCVWAJ.js.map → docs-TG6JMVMY.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{extension-CSHP6FZX.js.map → extension-R3LUKMX7.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{extension-XNNVUVAY.js.map → extension-VNMRKIHI.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{files-OBWYYPKM.js.map → files-KAKU57OT.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{files-UPCNKEIZ.js.map → files-QB3EYPMO.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{gc-KXK6KBRN.js.map → gc-B747VM4M.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{gc-FA2ONELT.js.map → gc-KNUPLPSW.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{get-PNTSONGB.js.map → get-GMGLIQ5I.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{get-FLHYTOBA.js.map → get-SBL6NHYQ.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{history-6624XISO.js.map → history-6UKSZTRT.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{history-COQTPBEU.js.map → history-XCWRXBXC.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{history-compact-66PSRYL3.js.map → history-compact-IDH7E7VN.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{history-compact-PVS2A3FS.js.map → history-compact-KICKUCR7.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{history-redact-ZRQTI7NB.js.map → history-redact-HKYBTK6X.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{history-redact-DCXAWGTF.js.map → history-redact-JJWH3QWK.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{history-repair-TA3NRIFO.js.map → history-repair-7HWBZKXN.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{history-repair-SEQDFTGW.js.map → history-repair-N5HXKJOI.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{init-ZVE2HMKK.js.map → init-27JLDUO2.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{init-IQJE3EKJ.js.map → init-OQA3TWIS.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{learnings-XC6EMW5E.js.map → learnings-L7VQUSVI.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{learnings-RJPGH2ME.js.map → learnings-Z4GAIZQ5.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{list-OO5P472O.js.map → list-6U3CJVXS.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{list-NJV6WBT4.js.map → list-W5ROBC5U.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{notes-2KWHADK3.js.map → notes-JJDOEDFK.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{notes-FNCDMZW2.js.map → notes-SDCK7BEN.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{plan-MQO5JTSV.js.map → plan-H5HYHMBB.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{plan-CYK2P5PD.js.map → plan-W2B5RYR3.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{register-setup-GAQZZRUA.js.map → register-setup-BZ3TNE3G.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{register-setup-X2R5CFDV.js.map → register-setup-WLFL3OUF.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{restore-F4ALFV4D.js.map → restore-GNI2W5CN.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{restore-E3GZKRRK.js.map → restore-RGFSPG4K.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{schema-3CPFLDAY.js.map → schema-CCDU3RLC.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{schema-7EHBPNXM.js.map → schema-KZASL323.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{search-OBZVYJJ2.js.map → search-7KSOLI2E.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{search-2T3NCCUR.js.map → search-DTL7CO22.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{stats-ULGQACF7.js.map → stats-IOXQMGI6.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{stats-6LVK4JER.js.map → stats-QNV7B2CE.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{telemetry-6G27FLCP.js.map → telemetry-IV5C6JOM.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{telemetry-HHKRTMZA.js.map → telemetry-NHR5RFXT.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{test-PPOLRIBA.js.map → test-4Z37CXW4.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{test-2PP4YBV6.js.map → test-PIL2CEEB.js.map} +0 -0
  495. /package/dist/cli-bundle/chunks/{test-all-NETGVNM6.js.map → test-all-GRLYHBNP.js.map} +0 -0
  496. /package/dist/cli-bundle/chunks/{test-all-6Z272JRI.js.map → test-all-MFN4MYCV.js.map} +0 -0
  497. /package/dist/cli-bundle/chunks/{test-runs-CRPQVMMG.js.map → test-runs-7LRFWWCA.js.map} +0 -0
  498. /package/dist/cli-bundle/chunks/{test-runs-M24WA6TI.js.map → test-runs-7WCSC3TY.js.map} +0 -0
  499. /package/dist/cli-bundle/chunks/{update-O7TBOUVQ.js.map → update-I4G34LKJ.js.map} +0 -0
  500. /package/dist/cli-bundle/chunks/{update-MCPCPMHV.js.map → update-VI5DBZ3G.js.map} +0 -0
  501. /package/dist/cli-bundle/chunks/{update-many-JSRF5EH5.js.map → update-many-LOTAYUTN.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{update-many-Y3HOL7WA.js.map → update-many-UYMTVF42.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{upgrade-ECB6GH3M.js.map → upgrade-LT2MLLPS.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{upgrade-5RTQVKKE.js.map → upgrade-ZZSC7CLV.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{validate-J6Q444SD.js.map → validate-3XRORNMP.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{validate-MCNMAXVA.js.map → validate-IQIQSKUX.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="46e39061-1b71-5927-a798-045c766d91c5")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="96f92147-d769-57ff-a0e3-387c90152c9e")}catch(e){}}();
3
3
  export const KNOWN_EXTENSION_CAPABILITIES = [
4
4
  "commands",
5
5
  "renderers",
@@ -24,6 +24,7 @@ export const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({
24
24
  export const KNOWN_EXTENSION_POLICY_MODES = ["off", "warn", "enforce"];
25
25
  export const KNOWN_EXTENSION_TRUST_MODES = ["off", "warn", "enforce"];
26
26
  export const KNOWN_EXTENSION_SANDBOX_PROFILES = ["none", "restricted", "strict"];
27
+ export const KNOWN_PM_MAX_VERSION_EXCEEDED_MODES = ["block", "warn"];
27
28
  export const KNOWN_EXTENSION_POLICY_SURFACES = [
28
29
  "commands.override",
29
30
  "commands.handler",
@@ -77,5 +78,30 @@ export function createDefaultExtensionGovernancePolicy() {
77
78
  extension_overrides: [],
78
79
  };
79
80
  }
81
+ /**
82
+ * Author-facing `manifest.json` fields recognized by the extension loader, plus
83
+ * `$schema` (tolerated for inline IDE validation against
84
+ * `docs/schemas/extension-manifest.schema.json`). `legacy_capability_aliases`
85
+ * is loader-derived, never authored, so it is intentionally absent. A
86
+ * governance test keeps the published JSON Schema's `properties` in sync with
87
+ * this list.
88
+ */
89
+ export const KNOWN_EXTENSION_MANIFEST_FIELDS = Object.freeze([
90
+ "$schema",
91
+ "name",
92
+ "version",
93
+ "entry",
94
+ "priority",
95
+ "manifest_version",
96
+ "pm_min_version",
97
+ "pm_max_version",
98
+ "engines",
99
+ "trusted",
100
+ "provenance",
101
+ "sandbox_profile",
102
+ "permissions",
103
+ "capabilities",
104
+ "activation",
105
+ ]);
80
106
  //# sourceMappingURL=extension-types.js.map
81
- //# debugId=46e39061-1b71-5927-a798-045c766d91c5
107
+ //# debugId=96f92147-d769-57ff-a0e3-387c90152c9e
@@ -1 +1 @@
1
- {"version":3,"file":"extension-types.js","sources":["core/extensions/extension-types.ts"],"sourceRoot":"/","sourcesContent":["import type {\n ExtensionPolicyOverrideSettings,\n ExtensionPolicySettings,\n ItemDocument,\n ItemFrontMatter,\n ItemStatus,\n PmSettings,\n} from \"../../types/index.js\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\n\nexport const KNOWN_EXTENSION_CAPABILITIES = [\n \"commands\",\n \"renderers\",\n \"hooks\",\n \"schema\",\n \"importers\",\n \"search\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\nexport type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];\nexport const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;\nexport const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<Record<string, ExtensionCapability>> = Object.freeze({\n migration: \"schema\",\n validation: \"schema\",\n});\nexport const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({\n version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n capabilities: [...KNOWN_EXTENSION_CAPABILITIES],\n legacy_aliases: { ...EXTENSION_CAPABILITY_LEGACY_ALIASES },\n});\n\nexport const KNOWN_EXTENSION_POLICY_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionPolicyMode = (typeof KNOWN_EXTENSION_POLICY_MODES)[number];\nexport const KNOWN_EXTENSION_TRUST_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionTrustMode = (typeof KNOWN_EXTENSION_TRUST_MODES)[number];\nexport const KNOWN_EXTENSION_SANDBOX_PROFILES = [\"none\", \"restricted\", \"strict\"] as const;\nexport type ExtensionSandboxProfile = (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];\n\nexport const KNOWN_EXTENSION_POLICY_SURFACES = [\n \"commands.override\",\n \"commands.handler\",\n \"hooks.beforecommand\",\n \"hooks.aftercommand\",\n \"hooks.onwrite\",\n \"hooks.onread\",\n \"hooks.onindex\",\n \"schema.flags\",\n \"schema.itemfields\",\n \"schema.itemtypes\",\n \"schema.migrations\",\n \"parser.override\",\n \"preflight.override\",\n \"services.override\",\n \"renderers.override\",\n \"importers.importer\",\n \"importers.exporter\",\n \"search.provider\",\n \"search.vectorstore\",\n] as const;\nexport type ExtensionPolicySurface = (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];\n\nexport const KNOWN_EXTENSION_SERVICE_NAMES = [\n \"output_format\",\n \"error_format\",\n \"help_format\",\n \"lock_acquire\",\n \"lock_release\",\n \"history_append\",\n \"item_store_write\",\n \"item_store_delete\",\n] as const;\nexport type ExtensionServiceName = (typeof KNOWN_EXTENSION_SERVICE_NAMES)[number];\n\nexport interface ExtensionProvenanceMetadata {\n source?: string;\n signature?: string;\n attestation?: string;\n verified?: boolean;\n}\n\nexport interface ExtensionRuntimePermissionDeclaration {\n fs_read?: boolean;\n fs_write?: boolean;\n network?: boolean;\n env_read?: boolean;\n env_write?: boolean;\n process_spawn?: boolean;\n}\n\nexport interface ExtensionActivationMetadata {\n commands?: string[];\n}\n\nexport type ExtensionPolicyOverride = ExtensionPolicyOverrideSettings;\nexport type ExtensionGovernancePolicy = ExtensionPolicySettings;\n\nexport interface ExtensionManifestEngines {\n pm?: string;\n node?: string;\n [engine: string]: string | undefined;\n}\n\nexport function createDefaultExtensionGovernancePolicy(): ExtensionGovernancePolicy {\n return {\n mode: \"off\",\n trust_mode: \"off\",\n require_provenance: false,\n trusted_extensions: [],\n default_sandbox_profile: \"none\",\n allowed_extensions: [],\n blocked_extensions: [],\n allowed_capabilities: [],\n blocked_capabilities: [],\n allowed_surfaces: [],\n blocked_surfaces: [],\n allowed_commands: [],\n blocked_commands: [],\n allowed_actions: [],\n blocked_actions: [],\n allowed_services: [],\n blocked_services: [],\n extension_overrides: [],\n };\n}\n\nexport type ExtensionLayer = \"global\" | \"project\";\nexport type ExtensionStatus = \"ok\" | \"warn\";\n\nexport interface ExtensionManifest {\n name: string;\n version: string;\n entry: string;\n priority: number;\n capabilities: string[];\n manifest_version?: number;\n pm_min_version?: string;\n pm_max_version?: string;\n engines?: ExtensionManifestEngines;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n activation?: ExtensionActivationMetadata;\n legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];\n}\n\nexport interface ExtensionDiagnostic {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string | null;\n version: string | null;\n entry: string | null;\n priority: number | null;\n entry_path: string | null;\n enabled: boolean | null;\n status: ExtensionStatus;\n}\n\nexport interface EffectiveExtension {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string;\n source_package?: string;\n version: string;\n entry: string;\n priority: number;\n entry_path: string;\n manifest_version?: number;\n pm_min_version?: string;\n pm_max_version?: string;\n engines?: ExtensionManifestEngines;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n capabilities?: string[];\n activation?: ExtensionActivationMetadata;\n}\n\nexport interface ExtensionDiscoveryResult {\n disabled_by_flag: boolean;\n roots: {\n global: string;\n project: string;\n };\n configured_enabled: string[];\n configured_disabled: string[];\n discovered: ExtensionDiagnostic[];\n effective: EffectiveExtension[];\n warnings: string[];\n policy: ExtensionGovernancePolicy;\n}\n\nexport interface LoadedExtension extends EffectiveExtension {\n module: unknown;\n}\n\nexport interface FailedExtensionLoad {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n}\n\nexport interface ExtensionLoadResult extends ExtensionDiscoveryResult {\n loaded: LoadedExtension[];\n failed: FailedExtensionLoad[];\n}\n\nexport interface BeforeCommandHookContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n}\n\nexport interface AfterCommandHookContext extends BeforeCommandHookContext {\n ok: boolean;\n error?: string;\n result?: unknown;\n affected?: AfterCommandAffectedItem[];\n}\n\nexport interface AfterCommandAffectedItem {\n id: string;\n op?: string;\n item_type?: string;\n previous_status?: ItemStatus;\n status?: ItemStatus;\n previous?: Partial<ItemFrontMatter>;\n current?: Partial<ItemFrontMatter>;\n changed_fields?: string[];\n}\n\nexport interface OnWriteHookContext {\n path: string;\n scope: \"project\" | \"global\";\n op: string;\n item_id?: string;\n item_type?: string;\n before?: ItemDocument;\n after?: ItemDocument;\n changed_fields?: string[];\n}\n\nexport interface OnReadHookContext {\n path: string;\n scope: \"project\" | \"global\";\n}\n\nexport interface OnIndexHookContext {\n mode: string;\n total_items?: number;\n}\n\nexport type BeforeCommandHook = (context: BeforeCommandHookContext) => Promise<void> | void;\nexport type AfterCommandHook = (context: AfterCommandHookContext) => Promise<void> | void;\nexport type OnWriteHook = (context: OnWriteHookContext) => Promise<void> | void;\nexport type OnReadHook = (context: OnReadHookContext) => Promise<void> | void;\nexport type OnIndexHook = (context: OnIndexHookContext) => Promise<void> | void;\nexport type OutputRendererFormat = \"toon\" | \"json\";\nexport type CommandOverride = (context: CommandOverrideContext) => unknown;\nexport type RendererOverride = (context: RendererOverrideContext) => string | null | undefined;\nexport type CommandHandler = (context: CommandHandlerContext) => unknown;\nexport type ParserOverride = (context: ParserOverrideContext) => ParserOverrideDelta | Promise<ParserOverrideDelta>;\nexport type PreflightOverride = (context: PreflightOverrideContext) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;\nexport type ServiceOverride = (context: ServiceOverrideContext) => unknown;\n\nexport interface RegisteredExtensionHook<THook> {\n layer: ExtensionLayer;\n name: string;\n run: THook;\n}\n\nexport interface ExtensionHookRegistry {\n beforeCommand: Array<RegisteredExtensionHook<BeforeCommandHook>>;\n afterCommand: Array<RegisteredExtensionHook<AfterCommandHook>>;\n onWrite: Array<RegisteredExtensionHook<OnWriteHook>>;\n onRead: Array<RegisteredExtensionHook<OnReadHook>>;\n onIndex: Array<RegisteredExtensionHook<OnIndexHook>>;\n}\n\nexport interface CommandOverrideContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n result: unknown;\n}\n\nexport interface RendererOverrideContext {\n format: OutputRendererFormat;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n result: unknown;\n}\n\nexport interface CommandHandlerContext {\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport interface ParserOverrideContext extends CommandHandlerContext {}\n\nexport interface ParserOverrideDelta {\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n}\n\nexport interface PreflightOverrideContext extends CommandHandlerContext {\n decision: PreflightRuntimeDecision;\n}\n\nexport interface PreflightRuntimeDecision {\n enforce_item_format_gate: boolean;\n run_preflight_item_format_sync: boolean;\n run_extension_migrations: boolean;\n enforce_mandatory_migration_gate: boolean;\n}\n\nexport interface PreflightOverrideDelta extends ParserOverrideDelta {\n enforce_item_format_gate?: boolean;\n run_preflight_item_format_sync?: boolean;\n run_extension_migrations?: boolean;\n enforce_mandatory_migration_gate?: boolean;\n}\n\nexport interface ServiceOverrideContext {\n service: ExtensionServiceName;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n payload: unknown;\n}\n\nexport interface ExtensionCommandArgumentDefinition {\n name: string;\n required?: boolean;\n variadic?: boolean;\n description?: string;\n}\n\nexport interface CommandDefinition {\n name: string;\n run?: CommandHandler;\n /**\n * @deprecated Use `run` instead. This alias remains for backward compatibility.\n */\n handler?: CommandHandler;\n action?: string;\n description?: string;\n intent?: string;\n examples?: string[];\n failure_hints?: string[];\n arguments?: ExtensionCommandArgumentDefinition[];\n flags?: FlagDefinition[];\n}\n\n/**\n * Optional command-definition metadata for first-class importer/exporter\n * registration.\n *\n * `registerImporter`/`registerExporter` always create a `<name> import` /\n * `<name> export` command path. By default that path only has a handler. When\n * these options are supplied, the auto-created command also gains a full command\n * definition (description, flags, intent, examples, failure hints, positional\n * arguments) — surfaced in help and runtime contracts exactly like\n * `registerCommand`. The registration `name` and `run` handler are implicit, so\n * they are not part of this options object.\n */\nexport interface ImportExportRegistrationOptions {\n action?: string;\n description?: string;\n intent?: string;\n examples?: string[];\n failure_hints?: string[];\n arguments?: ExtensionCommandArgumentDefinition[];\n flags?: FlagDefinition[];\n}\n\nexport type FlagValueType = \"string\" | \"number\" | \"boolean\";\n\nexport interface FlagDefinition {\n long?: string;\n short?: string;\n value_name?: string;\n description?: string;\n required?: boolean;\n enabled?: boolean;\n visible?: boolean;\n /**\n * Canonical flag value type. Prefer this field; it is the one runtime\n * contracts and help output read first.\n */\n value_type?: FlagValueType;\n /**\n * @deprecated Use `value_type`. Retained for backward compatibility: when\n * both are present `value_type` wins, and `type` resolves only when\n * `value_type` is absent (`value_type ?? type`).\n */\n type?: FlagValueType;\n /**\n * When true, a repeated comma-list flag accumulates values across repeats\n * — parity with core list flags such as `--tags` — instead of the last\n * value winning. Mirrors the core `CliFlagContract.list` field so\n * extension-registered list flags coalesce through the same bootstrap path.\n */\n list?: boolean;\n /**\n * Default value applied when the flag is omitted. Surfaced to runtime\n * contracts and help output. A `list` flag may default to an array of scalars\n * (e.g. `[\"a\", \"b\"]`); the array is flattened/coerced like any list value.\n */\n default?: string | number | boolean | Array<string | number | boolean>;\n [key: string]: unknown;\n}\n\nexport interface SchemaFieldDefinition {\n name: string;\n type: string;\n optional?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeCommandOptionPolicyDefinition {\n command: string;\n option: string;\n enabled?: boolean;\n required?: boolean;\n visible?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeOptionDefinition {\n key: string;\n values?: string[];\n required?: boolean;\n aliases?: string[];\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeDefinition {\n name: string;\n folder?: string;\n aliases?: string[];\n required_create_fields?: string[];\n required_create_repeatables?: string[];\n command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];\n options?: SchemaItemTypeOptionDefinition[];\n [key: string]: unknown;\n}\n\nexport interface SchemaMigrationRunContext {\n id: string;\n command: \"migration\";\n layer: ExtensionLayer;\n extension: string;\n pm_root: string;\n status: string;\n}\n\nexport type SchemaMigrationRunner = (context: SchemaMigrationRunContext) => unknown | Promise<unknown>;\n\nexport interface SchemaMigrationDefinition {\n id?: string;\n description?: string;\n status?: string;\n mandatory?: boolean;\n run?: SchemaMigrationRunner;\n [key: string]: unknown;\n}\n\nexport interface ImportExportContext {\n registration: string;\n action: \"import\" | \"export\";\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport type Importer = (context: ImportExportContext) => unknown | Promise<unknown>;\nexport type Exporter = (context: ImportExportContext) => unknown | Promise<unknown>;\n\nexport type ExtensionSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\nexport interface SearchProviderQueryContext {\n query: string;\n mode: ExtensionSearchMode;\n tokens: string[];\n options: Record<string, unknown>;\n settings: PmSettings;\n documents: ItemDocument[];\n [key: string]: unknown;\n}\n\nexport interface SearchProviderHit {\n id: string;\n score: number;\n matched_fields?: string[];\n [key: string]: unknown;\n}\n\nexport type SearchProviderQueryResult = SearchProviderHit[] | { hits?: SearchProviderHit[] };\n\nexport interface SearchProviderQueryExpansionContext {\n query: string;\n mode: Exclude<ExtensionSearchMode, \"keyword\">;\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport type SearchProviderQueryExpansionResult = string[] | { queries?: string[] };\n\nexport interface SearchProviderRerankCandidate {\n id: string;\n text: string;\n score: number;\n}\n\nexport interface SearchProviderRerankHit {\n id: string;\n score: number;\n}\n\nexport type SearchProviderRerankResult = SearchProviderRerankHit[] | { hits?: SearchProviderRerankHit[] };\n\nexport interface SearchProviderRerankContext {\n query: string;\n mode: \"hybrid\";\n model: string;\n top_k: number;\n settings: PmSettings;\n candidates: SearchProviderRerankCandidate[];\n [key: string]: unknown;\n}\n\nexport interface SearchProviderEmbedBatchContext {\n inputs: string[];\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderEmbedContext {\n input: string;\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderDefinition {\n name: string;\n query?: (context: SearchProviderQueryContext) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;\n queryExpansion?: (\n context: SearchProviderQueryExpansionContext,\n ) => SearchProviderQueryExpansionResult | Promise<SearchProviderQueryExpansionResult>;\n query_expansion?: (\n context: SearchProviderQueryExpansionContext,\n ) => SearchProviderQueryExpansionResult | Promise<SearchProviderQueryExpansionResult>;\n rerank?: (context: SearchProviderRerankContext) => SearchProviderRerankResult | Promise<SearchProviderRerankResult>;\n embedBatch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed_batch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryHit {\n id: string;\n score: number;\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryContext {\n vector: number[];\n limit: number;\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertPoint {\n id: string;\n vector: number[];\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertContext {\n points: VectorStoreUpsertPoint[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreDeleteContext {\n ids: string[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreAdapterDefinition {\n name: string;\n query?: (context: VectorStoreQueryContext) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;\n upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;\n delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;\n [key: string]: unknown;\n}\n\nexport interface RegisteredExtensionCommandOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandOverride;\n}\n\nexport interface RegisteredExtensionCommandHandler {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandHandler;\n}\n\nexport interface RegisteredExtensionParserOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: ParserOverride;\n}\n\nexport interface RegisteredExtensionPreflightOverride {\n layer: ExtensionLayer;\n name: string;\n run: PreflightOverride;\n}\n\nexport interface RegisteredExtensionServiceOverride {\n layer: ExtensionLayer;\n name: string;\n service: ExtensionServiceName;\n run: ServiceOverride;\n}\n\nexport interface RegisteredExtensionRendererOverride {\n layer: ExtensionLayer;\n name: string;\n format: OutputRendererFormat;\n run: RendererOverride;\n}\n\nexport interface ExtensionCommandRegistry {\n overrides: RegisteredExtensionCommandOverride[];\n handlers: RegisteredExtensionCommandHandler[];\n}\n\nexport interface ExtensionParserRegistry {\n overrides: RegisteredExtensionParserOverride[];\n}\n\nexport interface ExtensionPreflightRegistry {\n overrides: RegisteredExtensionPreflightOverride[];\n}\n\nexport interface ExtensionServiceRegistry {\n overrides: RegisteredExtensionServiceOverride[];\n}\n\nexport interface ExtensionRendererRegistry {\n overrides: RegisteredExtensionRendererOverride[];\n}\n\nexport interface RegisteredExtensionFlagDefinitions {\n layer: ExtensionLayer;\n name: string;\n target_command: string;\n flags: FlagDefinition[];\n}\n\nexport interface RegisteredExtensionCommandDefinition {\n layer: ExtensionLayer;\n name: string;\n source_package?: string;\n command: string;\n action: string;\n description?: string;\n intent?: string;\n examples: string[];\n failure_hints: string[];\n arguments: ExtensionCommandArgumentDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaFieldDefinitions {\n layer: ExtensionLayer;\n name: string;\n fields: SchemaFieldDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaItemTypeDefinitions {\n layer: ExtensionLayer;\n name: string;\n types: SchemaItemTypeDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaMigrationDefinition {\n layer: ExtensionLayer;\n name: string;\n definition: SchemaMigrationDefinition;\n runtime_definition: SchemaMigrationDefinition;\n}\n\nexport interface RegisteredExtensionImporter {\n layer: ExtensionLayer;\n name: string;\n importer: string;\n}\n\nexport interface RegisteredExtensionExporter {\n layer: ExtensionLayer;\n name: string;\n exporter: string;\n}\n\nexport interface RegisteredExtensionSearchProvider {\n layer: ExtensionLayer;\n name: string;\n definition: SearchProviderDefinition;\n runtime_definition: SearchProviderDefinition;\n}\n\nexport interface RegisteredExtensionVectorStoreAdapter {\n layer: ExtensionLayer;\n name: string;\n definition: VectorStoreAdapterDefinition;\n runtime_definition: VectorStoreAdapterDefinition;\n}\n\nexport interface ExtensionRegistrationRegistry {\n commands: RegisteredExtensionCommandDefinition[];\n flags: RegisteredExtensionFlagDefinitions[];\n item_fields: RegisteredExtensionSchemaFieldDefinitions[];\n item_types: RegisteredExtensionSchemaItemTypeDefinitions[];\n migrations: RegisteredExtensionSchemaMigrationDefinition[];\n importers: RegisteredExtensionImporter[];\n exporters: RegisteredExtensionExporter[];\n search_providers: RegisteredExtensionSearchProvider[];\n vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];\n}\n\nexport interface ExtensionRegistrationCounts {\n commands: number;\n flags: number;\n item_fields: number;\n item_types: number;\n migrations: number;\n importers: number;\n exporters: number;\n search_providers: number;\n vector_store_adapters: number;\n}\n\n/**\n * Read-only identity an extension's `activate(api)` receives about itself, so\n * authors can emit self-identifying logs, gate on their own version, and build\n * better error messages without re-reading the on-disk manifest or duplicating\n * metadata in-module. Exposed as `api.extension`.\n */\nexport interface ExtensionSelfIdentity {\n readonly name: string;\n readonly layer: ExtensionLayer;\n readonly version: string;\n readonly capabilities: readonly ExtensionCapability[];\n readonly pm_min_version?: string;\n readonly pm_max_version?: string;\n readonly source_package?: string;\n}\n\nexport interface ExtensionApi {\n /** Read-only identity of the extension this `api` was created for. */\n readonly extension: ExtensionSelfIdentity;\n registerCommand(command: string, override: CommandOverride): void;\n registerCommand(definition: CommandDefinition): void;\n registerParser(command: string, override: ParserOverride): void;\n registerPreflight(override: PreflightOverride): void;\n registerService(service: ExtensionServiceName, override: ServiceOverride): void;\n registerFlags(targetCommand: string, flags: FlagDefinition[]): void;\n registerItemFields(fields: SchemaFieldDefinition[]): void;\n registerItemTypes(types: SchemaItemTypeDefinition[]): void;\n registerMigration(definition: SchemaMigrationDefinition): void;\n registerRenderer(format: OutputRendererFormat, renderer: RendererOverride): void;\n registerImporter(name: string, importer: Importer, options?: ImportExportRegistrationOptions): void;\n registerExporter(name: string, exporter: Exporter, options?: ImportExportRegistrationOptions): void;\n registerSearchProvider(provider: SearchProviderDefinition): void;\n registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;\n hooks: {\n beforeCommand(hook: BeforeCommandHook): void;\n afterCommand(hook: AfterCommandHook): void;\n onWrite(hook: OnWriteHook): void;\n onRead(hook: OnReadHook): void;\n onIndex(hook: OnIndexHook): void;\n };\n}\n\nexport interface FailedExtensionActivation {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n trace?: ExtensionActivationFailureTrace;\n}\n\nexport interface ExtensionActivationFailureTrace {\n method: string;\n /** `-1` means the failure happened before a numbered registration was accepted. */\n registration_index: number;\n command?: string;\n capability?: ExtensionCapability;\n missing_capability?: ExtensionCapability;\n expected_schema: string;\n received?: unknown;\n hint?: string;\n}\n\nexport interface ExtensionActivationResult {\n hooks: ExtensionHookRegistry;\n commands: ExtensionCommandRegistry;\n parsers: ExtensionParserRegistry;\n preflight: ExtensionPreflightRegistry;\n services: ExtensionServiceRegistry;\n renderers: ExtensionRendererRegistry;\n registrations: ExtensionRegistrationRegistry;\n failed: FailedExtensionActivation[];\n warnings: string[];\n hook_counts: {\n before_command: number;\n after_command: number;\n on_write: number;\n on_read: number;\n on_index: number;\n };\n command_override_count: number;\n command_handler_count: number;\n parser_override_count: number;\n preflight_override_count: number;\n service_override_count: number;\n renderer_override_count: number;\n registration_counts: ExtensionRegistrationCounts;\n}\n\nexport interface ExtensionCandidate {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n source_package?: string;\n}\n\nexport interface ExtensionLayerScanResult {\n diagnostics: ExtensionDiagnostic[];\n warnings: string[];\n candidates: ExtensionCandidate[];\n}\n\nexport interface ScannedExtensionDirectory {\n diagnostic: ExtensionDiagnostic;\n warnings: string[];\n candidate: ExtensionCandidate | null;\n}\n\nexport interface LegacyExtensionCapabilityAliasMapping {\n alias: string;\n target: ExtensionCapability;\n}\n\nexport interface DiscoverExtensionsOptions {\n pmRoot: string;\n settings: PmSettings;\n cwd?: string;\n noExtensions?: boolean;\n reload_token?: string;\n cache_bust?: boolean;\n}\n\nexport interface ActivatableExtension {\n activate: (api: ExtensionApi) => void | Promise<void>;\n /**\n * Optional teardown lifecycle hook, analogous to VS Code's `deactivate`\n * export. Invoked when the host tears the extension down — on long-running\n * MCP-server reload between requests, or via the `deactivateExtensions`\n * primitive — so an extension can close connections, clear timers, and\n * release buffers it opened during `activate`.\n */\n deactivate?: () => void | Promise<void>;\n}\n\nexport interface ExtensionDeactivationFailure {\n layer: ExtensionLayer;\n name: string;\n error: string;\n}\n\nexport interface ExtensionDeactivationResult {\n /** Count of loaded extensions whose `deactivate` hook ran without throwing. */\n deactivated: number;\n warnings: string[];\n failed: ExtensionDeactivationFailure[];\n}\n\nexport interface ServiceOverrideResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandOverrideResult {\n overridden: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandHandlerResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n /**\n * Human-readable, single-line, length-bounded message describing why an\n * extension command handler failed. Surfaced to the user/CI so the real cause\n * (e.g. \"Changelog is out of date: CHANGELOG.md\") is visible instead of only\n * the opaque `extension_command_handler_failed` warning code.\n */\n errorMessage?: string;\n}\n\nexport interface ParserOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n warnings: string[];\n}\n\nexport interface PreflightOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n decision: PreflightRuntimeDecision;\n warnings: string[];\n}\n\nexport interface RendererOverrideResult {\n overridden: boolean;\n rendered: string | null;\n warnings: string[];\n}\n\nexport interface UnknownExtensionCapabilityWarningDetails {\n layer: ExtensionLayer;\n name: string;\n capability: string;\n allowed_capabilities: string[];\n capability_contract_version: number;\n suggested_capability?: string;\n suggestion_source?: \"legacy_alias\" | \"nearest_match\";\n legacy_alias_target?: string;\n}\n"],"names":[],"mappings":";;AAUA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU;IACV,WAAW;IACX,OAAO;IACP,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,mCAAmC,GAAkD,MAAM,CAAC,MAAM,CAAC;IAC9G,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,qCAAqC;IAC9C,YAAY,EAAE,CAAC,GAAG,4BAA4B,CAAC;IAC/C,cAAc,EAAE,EAAE,GAAG,mCAAmC,EAAE;CAC3D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAE/E,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAG1F,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,cAAc;IACd,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;CACZ,CAAC;AAGX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,eAAe;IACf,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;CACX,CAAC;AAgCX,MAAM,UAAU,sCAAsC;IACpD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,kBAAkB,EAAE,EAAE;QACtB,uBAAuB,EAAE,MAAM;QAC/B,kBAAkB,EAAE,EAAE;QACtB,kBAAkB,EAAE,EAAE;QACtB,oBAAoB,EAAE,EAAE;QACxB,oBAAoB,EAAE,EAAE;QACxB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,mBAAmB,EAAE,EAAE;KACxB,CAAC;AACJ,CAAC","debugId":"46e39061-1b71-5927-a798-045c766d91c5"}
1
+ {"version":3,"file":"extension-types.js","sources":["core/extensions/extension-types.ts"],"sourceRoot":"/","sourcesContent":["import type {\n ExtensionPolicyOverrideSettings,\n ExtensionPolicySettings,\n ItemDocument,\n ItemFrontMatter,\n ItemStatus,\n PmSettings,\n} from \"../../types/index.js\";\nimport type { GlobalOptions } from \"../shared/command-types.js\";\n\nexport const KNOWN_EXTENSION_CAPABILITIES = [\n \"commands\",\n \"renderers\",\n \"hooks\",\n \"schema\",\n \"importers\",\n \"search\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\nexport type ExtensionCapability = (typeof KNOWN_EXTENSION_CAPABILITIES)[number];\nexport const EXTENSION_CAPABILITY_CONTRACT_VERSION = 2;\nexport const EXTENSION_CAPABILITY_LEGACY_ALIASES: Readonly<Record<string, ExtensionCapability>> = Object.freeze({\n migration: \"schema\",\n validation: \"schema\",\n});\nexport const EXTENSION_CAPABILITY_CONTRACT = Object.freeze({\n version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n capabilities: [...KNOWN_EXTENSION_CAPABILITIES],\n legacy_aliases: { ...EXTENSION_CAPABILITY_LEGACY_ALIASES },\n});\n\nexport const KNOWN_EXTENSION_POLICY_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionPolicyMode = (typeof KNOWN_EXTENSION_POLICY_MODES)[number];\nexport const KNOWN_EXTENSION_TRUST_MODES = [\"off\", \"warn\", \"enforce\"] as const;\nexport type ExtensionTrustMode = (typeof KNOWN_EXTENSION_TRUST_MODES)[number];\nexport const KNOWN_EXTENSION_SANDBOX_PROFILES = [\"none\", \"restricted\", \"strict\"] as const;\nexport type ExtensionSandboxProfile = (typeof KNOWN_EXTENSION_SANDBOX_PROFILES)[number];\n\nexport const KNOWN_PM_MAX_VERSION_EXCEEDED_MODES = [\"block\", \"warn\"] as const;\n/** How a `pm_max_version` violation is handled for an extension layer. */\nexport type PmMaxVersionExceededMode = (typeof KNOWN_PM_MAX_VERSION_EXCEEDED_MODES)[number];\n/** Optional per-layer override map for `extensions.policy.pm_max_version_exceeded_mode`. */\nexport interface PmMaxVersionExceededModeByLayer {\n global?: PmMaxVersionExceededMode;\n project?: PmMaxVersionExceededMode;\n}\n/**\n * Settings value for `extensions.policy.pm_max_version_exceeded_mode`: either a\n * single mode applied to both layers, or a per-layer override map. Unset (and\n * any unset layer key) defaults to `\"block\"`.\n */\nexport type PmMaxVersionExceededModeSetting = PmMaxVersionExceededMode | PmMaxVersionExceededModeByLayer;\n\nexport const KNOWN_EXTENSION_POLICY_SURFACES = [\n \"commands.override\",\n \"commands.handler\",\n \"hooks.beforecommand\",\n \"hooks.aftercommand\",\n \"hooks.onwrite\",\n \"hooks.onread\",\n \"hooks.onindex\",\n \"schema.flags\",\n \"schema.itemfields\",\n \"schema.itemtypes\",\n \"schema.migrations\",\n \"parser.override\",\n \"preflight.override\",\n \"services.override\",\n \"renderers.override\",\n \"importers.importer\",\n \"importers.exporter\",\n \"search.provider\",\n \"search.vectorstore\",\n] as const;\nexport type ExtensionPolicySurface = (typeof KNOWN_EXTENSION_POLICY_SURFACES)[number];\n\nexport const KNOWN_EXTENSION_SERVICE_NAMES = [\n \"output_format\",\n \"error_format\",\n \"help_format\",\n \"lock_acquire\",\n \"lock_release\",\n \"history_append\",\n \"item_store_write\",\n \"item_store_delete\",\n] as const;\nexport type ExtensionServiceName = (typeof KNOWN_EXTENSION_SERVICE_NAMES)[number];\n\nexport interface ExtensionProvenanceMetadata {\n source?: string;\n signature?: string;\n attestation?: string;\n verified?: boolean;\n}\n\nexport interface ExtensionRuntimePermissionDeclaration {\n fs_read?: boolean;\n fs_write?: boolean;\n network?: boolean;\n env_read?: boolean;\n env_write?: boolean;\n process_spawn?: boolean;\n}\n\nexport interface ExtensionActivationMetadata {\n commands?: string[];\n}\n\nexport type ExtensionPolicyOverride = ExtensionPolicyOverrideSettings;\n/**\n * Extension governance policy as read from / serialized to settings. Extends the\n * stored settings shape with `pm_max_version_exceeded_mode` (pm-k5e8), which\n * relaxes the default-BLOCK on `pm_max_version` violations to warn-only —\n * globally or per extension layer.\n */\nexport type ExtensionGovernancePolicy = ExtensionPolicySettings & {\n pm_max_version_exceeded_mode?: PmMaxVersionExceededModeSetting;\n};\n\nexport interface ExtensionManifestEngines {\n pm?: string;\n node?: string;\n [engine: string]: string | undefined;\n}\n\nexport function createDefaultExtensionGovernancePolicy(): ExtensionGovernancePolicy {\n return {\n mode: \"off\",\n trust_mode: \"off\",\n require_provenance: false,\n trusted_extensions: [],\n default_sandbox_profile: \"none\",\n allowed_extensions: [],\n blocked_extensions: [],\n allowed_capabilities: [],\n blocked_capabilities: [],\n allowed_surfaces: [],\n blocked_surfaces: [],\n allowed_commands: [],\n blocked_commands: [],\n allowed_actions: [],\n blocked_actions: [],\n allowed_services: [],\n blocked_services: [],\n extension_overrides: [],\n };\n}\n\nexport type ExtensionLayer = \"global\" | \"project\";\nexport type ExtensionStatus = \"ok\" | \"warn\";\n\nexport interface ExtensionManifest {\n name: string;\n version: string;\n entry: string;\n priority: number;\n capabilities: string[];\n manifest_version?: number;\n pm_min_version?: string;\n pm_max_version?: string;\n engines?: ExtensionManifestEngines;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n activation?: ExtensionActivationMetadata;\n legacy_capability_aliases?: LegacyExtensionCapabilityAliasMapping[];\n}\n\n/**\n * Author-facing `manifest.json` fields recognized by the extension loader, plus\n * `$schema` (tolerated for inline IDE validation against\n * `docs/schemas/extension-manifest.schema.json`). `legacy_capability_aliases`\n * is loader-derived, never authored, so it is intentionally absent. A\n * governance test keeps the published JSON Schema's `properties` in sync with\n * this list.\n */\nexport const KNOWN_EXTENSION_MANIFEST_FIELDS = Object.freeze([\n \"$schema\",\n \"name\",\n \"version\",\n \"entry\",\n \"priority\",\n \"manifest_version\",\n \"pm_min_version\",\n \"pm_max_version\",\n \"engines\",\n \"trusted\",\n \"provenance\",\n \"sandbox_profile\",\n \"permissions\",\n \"capabilities\",\n \"activation\",\n] as const) satisfies readonly (Exclude<keyof ExtensionManifest, \"legacy_capability_aliases\"> | \"$schema\")[];\n\nexport interface ExtensionDiagnostic {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string | null;\n version: string | null;\n entry: string | null;\n priority: number | null;\n entry_path: string | null;\n enabled: boolean | null;\n status: ExtensionStatus;\n}\n\nexport interface EffectiveExtension {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n name: string;\n source_package?: string;\n version: string;\n entry: string;\n priority: number;\n entry_path: string;\n manifest_version?: number;\n pm_min_version?: string;\n pm_max_version?: string;\n engines?: ExtensionManifestEngines;\n trusted?: boolean;\n provenance?: ExtensionProvenanceMetadata;\n sandbox_profile?: ExtensionSandboxProfile;\n permissions?: ExtensionRuntimePermissionDeclaration;\n capabilities?: string[];\n activation?: ExtensionActivationMetadata;\n}\n\nexport interface ExtensionDiscoveryResult {\n disabled_by_flag: boolean;\n roots: {\n global: string;\n project: string;\n };\n configured_enabled: string[];\n configured_disabled: string[];\n discovered: ExtensionDiagnostic[];\n effective: EffectiveExtension[];\n warnings: string[];\n policy: ExtensionGovernancePolicy;\n}\n\nexport interface LoadedExtension extends EffectiveExtension {\n module: unknown;\n}\n\nexport interface FailedExtensionLoad {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n}\n\nexport interface ExtensionLoadResult extends ExtensionDiscoveryResult {\n loaded: LoadedExtension[];\n failed: FailedExtensionLoad[];\n}\n\nexport interface BeforeCommandHookContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n}\n\nexport interface AfterCommandHookContext extends BeforeCommandHookContext {\n ok: boolean;\n error?: string;\n result?: unknown;\n affected?: AfterCommandAffectedItem[];\n}\n\nexport interface AfterCommandAffectedItem {\n id: string;\n op?: string;\n item_type?: string;\n previous_status?: ItemStatus;\n status?: ItemStatus;\n previous?: Partial<ItemFrontMatter>;\n current?: Partial<ItemFrontMatter>;\n changed_fields?: string[];\n}\n\nexport interface OnWriteHookContext {\n path: string;\n scope: \"project\" | \"global\";\n op: string;\n item_id?: string;\n item_type?: string;\n before?: ItemDocument;\n after?: ItemDocument;\n changed_fields?: string[];\n}\n\nexport interface OnReadHookContext {\n path: string;\n scope: \"project\" | \"global\";\n}\n\nexport interface OnIndexHookContext {\n mode: string;\n total_items?: number;\n}\n\nexport type BeforeCommandHook = (context: BeforeCommandHookContext) => Promise<void> | void;\nexport type AfterCommandHook = (context: AfterCommandHookContext) => Promise<void> | void;\nexport type OnWriteHook = (context: OnWriteHookContext) => Promise<void> | void;\nexport type OnReadHook = (context: OnReadHookContext) => Promise<void> | void;\nexport type OnIndexHook = (context: OnIndexHookContext) => Promise<void> | void;\nexport type OutputRendererFormat = \"toon\" | \"json\";\nexport type CommandOverride = (context: CommandOverrideContext) => unknown;\nexport type RendererOverride = (context: RendererOverrideContext) => string | null | undefined;\nexport type CommandHandler = (context: CommandHandlerContext) => unknown;\nexport type ParserOverride = (context: ParserOverrideContext) => ParserOverrideDelta | Promise<ParserOverrideDelta>;\nexport type PreflightOverride = (context: PreflightOverrideContext) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;\nexport type ServiceOverride = (context: ServiceOverrideContext) => unknown;\n\nexport interface RegisteredExtensionHook<THook> {\n layer: ExtensionLayer;\n name: string;\n run: THook;\n}\n\nexport interface ExtensionHookRegistry {\n beforeCommand: Array<RegisteredExtensionHook<BeforeCommandHook>>;\n afterCommand: Array<RegisteredExtensionHook<AfterCommandHook>>;\n onWrite: Array<RegisteredExtensionHook<OnWriteHook>>;\n onRead: Array<RegisteredExtensionHook<OnReadHook>>;\n onIndex: Array<RegisteredExtensionHook<OnIndexHook>>;\n}\n\nexport interface CommandOverrideContext {\n command: string;\n args: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root: string;\n result: unknown;\n}\n\nexport interface RendererOverrideContext {\n format: OutputRendererFormat;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n result: unknown;\n}\n\nexport interface CommandHandlerContext {\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport interface ParserOverrideContext extends CommandHandlerContext {}\n\nexport interface ParserOverrideDelta {\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n}\n\nexport interface PreflightOverrideContext extends CommandHandlerContext {\n decision: PreflightRuntimeDecision;\n}\n\nexport interface PreflightRuntimeDecision {\n enforce_item_format_gate: boolean;\n run_preflight_item_format_sync: boolean;\n run_extension_migrations: boolean;\n enforce_mandatory_migration_gate: boolean;\n}\n\nexport interface PreflightOverrideDelta extends ParserOverrideDelta {\n enforce_item_format_gate?: boolean;\n run_preflight_item_format_sync?: boolean;\n run_extension_migrations?: boolean;\n enforce_mandatory_migration_gate?: boolean;\n}\n\nexport interface ServiceOverrideContext {\n service: ExtensionServiceName;\n command?: string;\n args?: string[];\n options?: Record<string, unknown>;\n global?: GlobalOptions;\n pm_root?: string;\n payload: unknown;\n}\n\nexport interface ExtensionCommandArgumentDefinition {\n name: string;\n required?: boolean;\n variadic?: boolean;\n description?: string;\n}\n\nexport interface CommandDefinition {\n name: string;\n run?: CommandHandler;\n /**\n * @deprecated Use `run` instead. This alias remains for backward compatibility.\n */\n handler?: CommandHandler;\n action?: string;\n description?: string;\n intent?: string;\n examples?: string[];\n failure_hints?: string[];\n arguments?: ExtensionCommandArgumentDefinition[];\n flags?: FlagDefinition[];\n}\n\n/**\n * Optional command-definition metadata for first-class importer/exporter\n * registration.\n *\n * `registerImporter`/`registerExporter` always create a `<name> import` /\n * `<name> export` command path. By default that path only has a handler. When\n * these options are supplied, the auto-created command also gains a full command\n * definition (description, flags, intent, examples, failure hints, positional\n * arguments) — surfaced in help and runtime contracts exactly like\n * `registerCommand`. The registration `name` and `run` handler are implicit, so\n * they are not part of this options object.\n */\nexport interface ImportExportRegistrationOptions {\n action?: string;\n description?: string;\n intent?: string;\n examples?: string[];\n failure_hints?: string[];\n arguments?: ExtensionCommandArgumentDefinition[];\n flags?: FlagDefinition[];\n}\n\nexport type FlagValueType = \"string\" | \"number\" | \"boolean\";\n\nexport interface FlagDefinition {\n long?: string;\n short?: string;\n value_name?: string;\n description?: string;\n required?: boolean;\n enabled?: boolean;\n visible?: boolean;\n /**\n * Canonical flag value type. Prefer this field; it is the one runtime\n * contracts and help output read first.\n */\n value_type?: FlagValueType;\n /**\n * @deprecated Use `value_type`. Retained for backward compatibility: when\n * both are present `value_type` wins, and `type` resolves only when\n * `value_type` is absent (`value_type ?? type`).\n */\n type?: FlagValueType;\n /**\n * When true, a repeated comma-list flag accumulates values across repeats\n * — parity with core list flags such as `--tags` — instead of the last\n * value winning. Mirrors the core `CliFlagContract.list` field so\n * extension-registered list flags coalesce through the same bootstrap path.\n */\n list?: boolean;\n /**\n * Default value applied when the flag is omitted. Surfaced to runtime\n * contracts and help output. A `list` flag may default to an array of scalars\n * (e.g. `[\"a\", \"b\"]`); the array is flattened/coerced like any list value.\n */\n default?: string | number | boolean | Array<string | number | boolean>;\n [key: string]: unknown;\n}\n\nexport interface SchemaFieldDefinition {\n name: string;\n type: string;\n optional?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeCommandOptionPolicyDefinition {\n command: string;\n option: string;\n enabled?: boolean;\n required?: boolean;\n visible?: boolean;\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeOptionDefinition {\n key: string;\n values?: string[];\n required?: boolean;\n aliases?: string[];\n [key: string]: unknown;\n}\n\nexport interface SchemaItemTypeDefinition {\n name: string;\n folder?: string;\n aliases?: string[];\n required_create_fields?: string[];\n required_create_repeatables?: string[];\n command_option_policies?: SchemaItemTypeCommandOptionPolicyDefinition[];\n options?: SchemaItemTypeOptionDefinition[];\n [key: string]: unknown;\n}\n\nexport interface SchemaMigrationRunContext {\n id: string;\n command: \"migration\";\n layer: ExtensionLayer;\n extension: string;\n pm_root: string;\n status: string;\n}\n\nexport type SchemaMigrationRunner = (context: SchemaMigrationRunContext) => unknown | Promise<unknown>;\n\nexport interface SchemaMigrationDefinition {\n id?: string;\n description?: string;\n status?: string;\n mandatory?: boolean;\n run?: SchemaMigrationRunner;\n [key: string]: unknown;\n}\n\nexport interface ImportExportContext {\n registration: string;\n action: \"import\" | \"export\";\n command: string;\n args: string[];\n options: Record<string, unknown>;\n global: GlobalOptions;\n pm_root: string;\n}\n\nexport type Importer = (context: ImportExportContext) => unknown | Promise<unknown>;\nexport type Exporter = (context: ImportExportContext) => unknown | Promise<unknown>;\n\nexport type ExtensionSearchMode = \"keyword\" | \"semantic\" | \"hybrid\";\n\nexport interface SearchProviderQueryContext {\n query: string;\n mode: ExtensionSearchMode;\n tokens: string[];\n options: Record<string, unknown>;\n settings: PmSettings;\n documents: ItemDocument[];\n [key: string]: unknown;\n}\n\nexport interface SearchProviderHit {\n id: string;\n score: number;\n matched_fields?: string[];\n [key: string]: unknown;\n}\n\nexport type SearchProviderQueryResult = SearchProviderHit[] | { hits?: SearchProviderHit[] };\n\nexport interface SearchProviderQueryExpansionContext {\n query: string;\n mode: Exclude<ExtensionSearchMode, \"keyword\">;\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport type SearchProviderQueryExpansionResult = string[] | { queries?: string[] };\n\nexport interface SearchProviderRerankCandidate {\n id: string;\n text: string;\n score: number;\n}\n\nexport interface SearchProviderRerankHit {\n id: string;\n score: number;\n}\n\nexport type SearchProviderRerankResult = SearchProviderRerankHit[] | { hits?: SearchProviderRerankHit[] };\n\nexport interface SearchProviderRerankContext {\n query: string;\n mode: \"hybrid\";\n model: string;\n top_k: number;\n settings: PmSettings;\n candidates: SearchProviderRerankCandidate[];\n [key: string]: unknown;\n}\n\nexport interface SearchProviderEmbedBatchContext {\n inputs: string[];\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderEmbedContext {\n input: string;\n settings: PmSettings;\n model: string;\n [key: string]: unknown;\n}\n\nexport interface SearchProviderDefinition {\n name: string;\n query?: (context: SearchProviderQueryContext) => SearchProviderQueryResult | Promise<SearchProviderQueryResult>;\n queryExpansion?: (\n context: SearchProviderQueryExpansionContext,\n ) => SearchProviderQueryExpansionResult | Promise<SearchProviderQueryExpansionResult>;\n query_expansion?: (\n context: SearchProviderQueryExpansionContext,\n ) => SearchProviderQueryExpansionResult | Promise<SearchProviderQueryExpansionResult>;\n rerank?: (context: SearchProviderRerankContext) => SearchProviderRerankResult | Promise<SearchProviderRerankResult>;\n embedBatch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed_batch?: (context: SearchProviderEmbedBatchContext) => number[][] | Promise<number[][]>;\n embed?: (context: SearchProviderEmbedContext) => number[] | Promise<number[]>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryHit {\n id: string;\n score: number;\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreQueryContext {\n vector: number[];\n limit: number;\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertPoint {\n id: string;\n vector: number[];\n payload?: Record<string, unknown>;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreUpsertContext {\n points: VectorStoreUpsertPoint[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreDeleteContext {\n ids: string[];\n settings: PmSettings;\n [key: string]: unknown;\n}\n\nexport interface VectorStoreAdapterDefinition {\n name: string;\n query?: (context: VectorStoreQueryContext) => VectorStoreQueryHit[] | Promise<VectorStoreQueryHit[]>;\n upsert?: (context: VectorStoreUpsertContext) => unknown | Promise<unknown>;\n delete?: (context: VectorStoreDeleteContext) => unknown | Promise<unknown>;\n [key: string]: unknown;\n}\n\nexport interface RegisteredExtensionCommandOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandOverride;\n}\n\nexport interface RegisteredExtensionCommandHandler {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: CommandHandler;\n}\n\nexport interface RegisteredExtensionParserOverride {\n layer: ExtensionLayer;\n name: string;\n command: string;\n run: ParserOverride;\n}\n\nexport interface RegisteredExtensionPreflightOverride {\n layer: ExtensionLayer;\n name: string;\n run: PreflightOverride;\n}\n\nexport interface RegisteredExtensionServiceOverride {\n layer: ExtensionLayer;\n name: string;\n service: ExtensionServiceName;\n run: ServiceOverride;\n}\n\nexport interface RegisteredExtensionRendererOverride {\n layer: ExtensionLayer;\n name: string;\n format: OutputRendererFormat;\n run: RendererOverride;\n}\n\nexport interface ExtensionCommandRegistry {\n overrides: RegisteredExtensionCommandOverride[];\n handlers: RegisteredExtensionCommandHandler[];\n}\n\nexport interface ExtensionParserRegistry {\n overrides: RegisteredExtensionParserOverride[];\n}\n\nexport interface ExtensionPreflightRegistry {\n overrides: RegisteredExtensionPreflightOverride[];\n}\n\nexport interface ExtensionServiceRegistry {\n overrides: RegisteredExtensionServiceOverride[];\n}\n\nexport interface ExtensionRendererRegistry {\n overrides: RegisteredExtensionRendererOverride[];\n}\n\nexport interface RegisteredExtensionFlagDefinitions {\n layer: ExtensionLayer;\n name: string;\n target_command: string;\n flags: FlagDefinition[];\n}\n\nexport interface RegisteredExtensionCommandDefinition {\n layer: ExtensionLayer;\n name: string;\n source_package?: string;\n command: string;\n action: string;\n description?: string;\n intent?: string;\n examples: string[];\n failure_hints: string[];\n arguments: ExtensionCommandArgumentDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaFieldDefinitions {\n layer: ExtensionLayer;\n name: string;\n fields: SchemaFieldDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaItemTypeDefinitions {\n layer: ExtensionLayer;\n name: string;\n types: SchemaItemTypeDefinition[];\n}\n\nexport interface RegisteredExtensionSchemaMigrationDefinition {\n layer: ExtensionLayer;\n name: string;\n definition: SchemaMigrationDefinition;\n runtime_definition: SchemaMigrationDefinition;\n}\n\nexport interface RegisteredExtensionImporter {\n layer: ExtensionLayer;\n name: string;\n importer: string;\n}\n\nexport interface RegisteredExtensionExporter {\n layer: ExtensionLayer;\n name: string;\n exporter: string;\n}\n\nexport interface RegisteredExtensionSearchProvider {\n layer: ExtensionLayer;\n name: string;\n definition: SearchProviderDefinition;\n runtime_definition: SearchProviderDefinition;\n}\n\nexport interface RegisteredExtensionVectorStoreAdapter {\n layer: ExtensionLayer;\n name: string;\n definition: VectorStoreAdapterDefinition;\n runtime_definition: VectorStoreAdapterDefinition;\n}\n\nexport interface ExtensionRegistrationRegistry {\n commands: RegisteredExtensionCommandDefinition[];\n flags: RegisteredExtensionFlagDefinitions[];\n item_fields: RegisteredExtensionSchemaFieldDefinitions[];\n item_types: RegisteredExtensionSchemaItemTypeDefinitions[];\n migrations: RegisteredExtensionSchemaMigrationDefinition[];\n importers: RegisteredExtensionImporter[];\n exporters: RegisteredExtensionExporter[];\n search_providers: RegisteredExtensionSearchProvider[];\n vector_store_adapters: RegisteredExtensionVectorStoreAdapter[];\n}\n\nexport interface ExtensionRegistrationCounts {\n commands: number;\n flags: number;\n item_fields: number;\n item_types: number;\n migrations: number;\n importers: number;\n exporters: number;\n search_providers: number;\n vector_store_adapters: number;\n}\n\n/**\n * Read-only identity an extension's `activate(api)` receives about itself, so\n * authors can emit self-identifying logs, gate on their own version, and build\n * better error messages without re-reading the on-disk manifest or duplicating\n * metadata in-module. Exposed as `api.extension`.\n */\nexport interface ExtensionSelfIdentity {\n readonly name: string;\n readonly layer: ExtensionLayer;\n readonly version: string;\n readonly capabilities: readonly ExtensionCapability[];\n readonly pm_min_version?: string;\n readonly pm_max_version?: string;\n readonly source_package?: string;\n}\n\nexport interface ExtensionApi {\n /** Read-only identity of the extension this `api` was created for. */\n readonly extension: ExtensionSelfIdentity;\n registerCommand(command: string, override: CommandOverride): void;\n registerCommand(definition: CommandDefinition): void;\n registerParser(command: string, override: ParserOverride): void;\n registerPreflight(override: PreflightOverride): void;\n registerService(service: ExtensionServiceName, override: ServiceOverride): void;\n registerFlags(targetCommand: string, flags: FlagDefinition[]): void;\n registerItemFields(fields: SchemaFieldDefinition[]): void;\n registerItemTypes(types: SchemaItemTypeDefinition[]): void;\n registerMigration(definition: SchemaMigrationDefinition): void;\n registerRenderer(format: OutputRendererFormat, renderer: RendererOverride): void;\n registerImporter(name: string, importer: Importer, options?: ImportExportRegistrationOptions): void;\n registerExporter(name: string, exporter: Exporter, options?: ImportExportRegistrationOptions): void;\n registerSearchProvider(provider: SearchProviderDefinition): void;\n registerVectorStoreAdapter(adapter: VectorStoreAdapterDefinition): void;\n hooks: {\n beforeCommand(hook: BeforeCommandHook): void;\n afterCommand(hook: AfterCommandHook): void;\n onWrite(hook: OnWriteHook): void;\n onRead(hook: OnReadHook): void;\n onIndex(hook: OnIndexHook): void;\n };\n}\n\nexport interface FailedExtensionActivation {\n layer: ExtensionLayer;\n name: string;\n entry_path: string;\n error: string;\n trace?: ExtensionActivationFailureTrace;\n}\n\nexport interface ExtensionActivationFailureTrace {\n method: string;\n /** `-1` means the failure happened before a numbered registration was accepted. */\n registration_index: number;\n command?: string;\n capability?: ExtensionCapability;\n missing_capability?: ExtensionCapability;\n expected_schema: string;\n received?: unknown;\n hint?: string;\n}\n\nexport interface ExtensionActivationResult {\n hooks: ExtensionHookRegistry;\n commands: ExtensionCommandRegistry;\n parsers: ExtensionParserRegistry;\n preflight: ExtensionPreflightRegistry;\n services: ExtensionServiceRegistry;\n renderers: ExtensionRendererRegistry;\n registrations: ExtensionRegistrationRegistry;\n failed: FailedExtensionActivation[];\n warnings: string[];\n hook_counts: {\n before_command: number;\n after_command: number;\n on_write: number;\n on_read: number;\n on_index: number;\n };\n command_override_count: number;\n command_handler_count: number;\n parser_override_count: number;\n preflight_override_count: number;\n service_override_count: number;\n renderer_override_count: number;\n registration_counts: ExtensionRegistrationCounts;\n}\n\nexport interface ExtensionCandidate {\n layer: ExtensionLayer;\n directory: string;\n manifest_path: string;\n entry_path: string;\n manifest: ExtensionManifest;\n source_package?: string;\n}\n\nexport interface ExtensionLayerScanResult {\n diagnostics: ExtensionDiagnostic[];\n warnings: string[];\n candidates: ExtensionCandidate[];\n}\n\nexport interface ScannedExtensionDirectory {\n diagnostic: ExtensionDiagnostic;\n warnings: string[];\n candidate: ExtensionCandidate | null;\n}\n\nexport interface LegacyExtensionCapabilityAliasMapping {\n alias: string;\n target: ExtensionCapability;\n}\n\nexport interface DiscoverExtensionsOptions {\n pmRoot: string;\n settings: PmSettings;\n cwd?: string;\n noExtensions?: boolean;\n reload_token?: string;\n cache_bust?: boolean;\n}\n\nexport interface ActivatableExtension {\n activate: (api: ExtensionApi) => void | Promise<void>;\n /**\n * Optional teardown lifecycle hook, analogous to VS Code's `deactivate`\n * export. Invoked when the host tears the extension down — on long-running\n * MCP-server reload between requests, or via the `deactivateExtensions`\n * primitive — so an extension can close connections, clear timers, and\n * release buffers it opened during `activate`.\n */\n deactivate?: () => void | Promise<void>;\n}\n\nexport interface ExtensionDeactivationFailure {\n layer: ExtensionLayer;\n name: string;\n error: string;\n}\n\nexport interface ExtensionDeactivationOptions {\n /**\n * Maximum time to wait for each extension's `deactivate` hook. Defaults to\n * 5000ms so a hanging teardown cannot block host shutdown or reload. Set to\n * 0 or Infinity only when the host intentionally wants to wait indefinitely.\n */\n deactivate_timeout_ms?: number;\n}\n\nexport interface ExtensionDeactivationResult {\n /** Count of loaded extensions whose `deactivate` hook ran without throwing. */\n deactivated: number;\n warnings: string[];\n failed: ExtensionDeactivationFailure[];\n}\n\nexport interface ServiceOverrideResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandOverrideResult {\n overridden: boolean;\n result: unknown;\n warnings: string[];\n}\n\nexport interface CommandHandlerResult {\n handled: boolean;\n result: unknown;\n warnings: string[];\n /**\n * Human-readable, single-line, length-bounded message describing why an\n * extension command handler failed. Surfaced to the user/CI so the real cause\n * (e.g. \"Changelog is out of date: CHANGELOG.md\") is visible instead of only\n * the opaque `extension_command_handler_failed` warning code.\n */\n errorMessage?: string;\n}\n\nexport interface ParserOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n warnings: string[];\n}\n\nexport interface PreflightOverrideResult {\n overridden: boolean;\n context: CommandHandlerContext;\n decision: PreflightRuntimeDecision;\n warnings: string[];\n}\n\nexport interface RendererOverrideResult {\n overridden: boolean;\n rendered: string | null;\n warnings: string[];\n}\n\nexport interface UnknownExtensionCapabilityWarningDetails {\n layer: ExtensionLayer;\n name: string;\n capability: string;\n allowed_capabilities: string[];\n capability_contract_version: number;\n suggested_capability?: string;\n suggestion_source?: \"legacy_alias\" | \"nearest_match\";\n legacy_alias_target?: string;\n}\n"],"names":[],"mappings":";;AAUA,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,UAAU;IACV,WAAW;IACX,OAAO;IACP,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,mCAAmC,GAAkD,MAAM,CAAC,MAAM,CAAC;IAC9G,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;CACrB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;IACzD,OAAO,EAAE,qCAAqC;IAC9C,YAAY,EAAE,CAAC,GAAG,4BAA4B,CAAC;IAC/C,cAAc,EAAE,EAAE,GAAG,mCAAmC,EAAE;CAC3D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAE/E,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAG1F,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAU,CAAC;AAe9E,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,eAAe;IACf,cAAc;IACd,eAAe;IACf,cAAc;IACd,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;IACnB,iBAAiB;IACjB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;CACZ,CAAC;AAGX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,eAAe;IACf,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;CACX,CAAC;AAwCX,MAAM,UAAU,sCAAsC;IACpD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;QACzB,kBAAkB,EAAE,EAAE;QACtB,uBAAuB,EAAE,MAAM;QAC/B,kBAAkB,EAAE,EAAE;QACtB,kBAAkB,EAAE,EAAE;QACtB,oBAAoB,EAAE,EAAE;QACxB,oBAAoB,EAAE,EAAE;QACxB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,mBAAmB,EAAE,EAAE;KACxB,CAAC;AACJ,CAAC;AAuBD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3D,SAAS;IACT,MAAM;IACN,SAAS;IACT,OAAO;IACP,UAAU;IACV,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,SAAS;IACT,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,YAAY;CACJ,CAAkG,CAAC","debugId":"96f92147-d769-57ff-a0e3-387c90152c9e"}
@@ -1,7 +1,7 @@
1
1
  export { parseUnknownExtensionCapabilityWarning, parseLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
2
2
  export { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
3
3
  export { runBeforeCommandHooks, runAfterCommandHooks, runOnWriteHooks, runOnReadHooks, runOnIndexHooks, runCommandHandler, runParserOverride, runPreflightOverride, runServiceOverrideSync, runServiceOverride, runCommandOverride, runRendererOverride, } from "./extension-hook-runtime.js";
4
- import { type ExtensionDeactivationResult, type ExtensionDiscoveryResult, type ExtensionLoadResult, type ExtensionActivationResult, type DiscoverExtensionsOptions } from "./extension-types.js";
4
+ import { type ExtensionDeactivationOptions, type ExtensionDeactivationResult, type ExtensionDiscoveryResult, type ExtensionLoadResult, type ExtensionActivationResult, type DiscoverExtensionsOptions } from "./extension-types.js";
5
5
  export * from "./extension-types.js";
6
6
  export declare function nextExtensionReloadToken(seed?: number): string;
7
7
  export declare function resolveExtensionRoots(pmRoot: string, cwd?: string): {
@@ -19,8 +19,10 @@ export declare function loadExtensions(options: DiscoverExtensionsOptions): Prom
19
19
  *
20
20
  * Pass the `activationResult` to skip extensions whose `activate` failed — they
21
21
  * never fully initialized, so (VS Code-style) their `deactivate` must not run.
22
- * Teardowns run concurrently so one slow hook cannot serialize the rest; the
23
- * returned warnings/failures preserve loaded order.
22
+ * Teardowns run concurrently and each hook has a bounded timeout by default, so
23
+ * one slow or hanging hook cannot serialize the rest or block the host
24
+ * indefinitely unless the host explicitly disables the timeout; the returned
25
+ * warnings/failures preserve loaded order.
24
26
  */
25
- export declare function deactivateExtensions(loadResult: ExtensionLoadResult, activationResult?: Pick<ExtensionActivationResult, "failed">): Promise<ExtensionDeactivationResult>;
27
+ export declare function deactivateExtensions(loadResult: ExtensionLoadResult, activationResult?: Pick<ExtensionActivationResult, "failed">, options?: ExtensionDeactivationOptions): Promise<ExtensionDeactivationResult>;
26
28
  export declare function activateExtensions(loadResult: ExtensionLoadResult): Promise<ExtensionActivationResult>;
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e5c4c469-142a-5854-82ca-a920130d2104")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="19026387-34f8-5e8e-b936-4fc13489f244")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { pathToFileURL } from "node:url";
@@ -352,14 +352,14 @@ function buildEffectiveExtensions(globalCandidates, projectCandidates) {
352
352
  }
353
353
  return effective;
354
354
  }
355
- async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled) {
355
+ async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled, pmMaxVersionExceededMode) {
356
356
  const diagnostics = [];
357
357
  const warnings = [];
358
358
  const candidates = [];
359
359
  const directories = await listExtensionDirectories(extensionsRoot);
360
360
  const managedSourcePackages = await readManagedExtensionSourcePackages(extensionsRoot);
361
361
  for (const directory of directories) {
362
- const scanned = await scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages);
362
+ const scanned = await scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode);
363
363
  diagnostics.push(scanned.diagnostic);
364
364
  warnings.push(...scanned.warnings);
365
365
  if (scanned.candidate) {
@@ -368,7 +368,7 @@ async function scanExtensionLayer(layer, extensionsRoot, enabled, disabled) {
368
368
  }
369
369
  return { diagnostics, warnings, candidates };
370
370
  }
371
- async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages) {
371
+ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled, disabled, managedSourcePackages, pmMaxVersionExceededMode) {
372
372
  const extensionDir = path.join(extensionsRoot, directory);
373
373
  const manifestPath = path.join(extensionDir, "manifest.json");
374
374
  if (!(await pathExists(manifestPath))) {
@@ -439,7 +439,7 @@ async function scanExtensionDirectory(layer, extensionsRoot, directory, enabled,
439
439
  if (pmVersionCompatibility.warning) {
440
440
  extensionWarnings.push(pmVersionCompatibility.warning);
441
441
  }
442
- const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest);
442
+ const pmMaxVersionCompatibility = await evaluatePmMaxVersionCompatibility(layer, manifest, pmMaxVersionExceededMode);
443
443
  if (pmMaxVersionCompatibility.warning) {
444
444
  extensionWarnings.push(pmMaxVersionCompatibility.warning);
445
445
  }
@@ -494,8 +494,8 @@ export async function discoverExtensions(options) {
494
494
  }
495
495
  const enabled = new Set(configured_enabled);
496
496
  const disabled = new Set(configured_disabled);
497
- const globalScan = await scanExtensionLayer("global", roots.global, enabled, disabled);
498
- const projectScan = await scanExtensionLayer("project", roots.project, enabled, disabled);
497
+ const globalScan = await scanExtensionLayer("global", roots.global, enabled, disabled, policy.pmMaxVersionExceededMode.global);
498
+ const projectScan = await scanExtensionLayer("project", roots.project, enabled, disabled, policy.pmMaxVersionExceededMode.project);
499
499
  const policyWarnings = [...policy.warnings];
500
500
  const effectiveCandidates = buildEffectiveExtensions(globalScan.candidates, projectScan.candidates);
501
501
  const effective = [];
@@ -623,7 +623,7 @@ async function evaluatePmMinVersionCompatibility(layer, manifest) {
623
623
  }
624
624
  return { allowed: true };
625
625
  }
626
- async function evaluatePmMaxVersionCompatibility(layer, manifest) {
626
+ async function evaluatePmMaxVersionCompatibility(layer, manifest, exceededMode) {
627
627
  if (typeof manifest.pm_max_version !== "string" || manifest.pm_max_version.trim().length === 0) {
628
628
  return { allowed: true };
629
629
  }
@@ -656,8 +656,16 @@ async function evaluatePmMaxVersionCompatibility(layer, manifest) {
656
656
  warning: `extension_pm_max_version_unchecked:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}:current=${currentVersion}`,
657
657
  };
658
658
  }
659
- // follow-up: pm-4gw6 recommends a future settings toggle to relax this default-BLOCK to warn-only per layer.
660
659
  if (comparison > 0) {
660
+ // pm-k5e8: `extensions.policy.pm_max_version_exceeded_mode` (default "block",
661
+ // per-layer overridable) relaxes this to warn-only so operators can keep
662
+ // pinned extensions loading during a CLI upgrade window.
663
+ if (exceededMode === "warn") {
664
+ return {
665
+ allowed: true,
666
+ warning: `extension_pm_max_version_exceeded_warn:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}:current=${currentVersion}`,
667
+ };
668
+ }
661
669
  return {
662
670
  allowed: false,
663
671
  warning: `extension_pm_max_version_exceeded:${layer}:${manifest.name}:allowed=${manifest.pm_max_version}:current=${currentVersion}`,
@@ -729,6 +737,8 @@ export async function loadExtensions(options) {
729
737
  failed,
730
738
  };
731
739
  }
740
+ const DEFAULT_EXTENSION_DEACTIVATE_TIMEOUT_MS = 5_000;
741
+ const MAX_EXTENSION_DEACTIVATE_TIMEOUT_MS = 2_147_483_647;
732
742
  function toActivatableExtension(source) {
733
743
  // Bind to `source` so a module/default-export authored with methods (or a class
734
744
  // instance) keeps its `this` across both lifecycle calls — `activate` is a
@@ -767,10 +777,13 @@ function resolveActivatableExtension(module) {
767
777
  *
768
778
  * Pass the `activationResult` to skip extensions whose `activate` failed — they
769
779
  * never fully initialized, so (VS Code-style) their `deactivate` must not run.
770
- * Teardowns run concurrently so one slow hook cannot serialize the rest; the
771
- * returned warnings/failures preserve loaded order.
780
+ * Teardowns run concurrently and each hook has a bounded timeout by default, so
781
+ * one slow or hanging hook cannot serialize the rest or block the host
782
+ * indefinitely unless the host explicitly disables the timeout; the returned
783
+ * warnings/failures preserve loaded order.
772
784
  */
773
- export async function deactivateExtensions(loadResult, activationResult) {
785
+ export async function deactivateExtensions(loadResult, activationResult, options = {}) {
786
+ const timeoutMs = normalizeExtensionDeactivateTimeout(options?.deactivate_timeout_ms);
774
787
  const failedActivationKeys = new Set((activationResult?.failed ?? []).map((entry) => `${entry.layer}:${entry.name}`));
775
788
  const targets = [];
776
789
  for (const extension of loadResult.loaded) {
@@ -785,7 +798,7 @@ export async function deactivateExtensions(loadResult, activationResult) {
785
798
  }
786
799
  const outcomes = await Promise.all(targets.map(async ({ extension, deactivate }) => {
787
800
  try {
788
- await deactivate();
801
+ await runExtensionDeactivateWithTimeout(deactivate, timeoutMs);
789
802
  return { ok: true };
790
803
  }
791
804
  catch (error) {
@@ -805,6 +818,46 @@ export async function deactivateExtensions(loadResult, activationResult) {
805
818
  }
806
819
  return { deactivated, warnings, failed };
807
820
  }
821
+ function normalizeExtensionDeactivateTimeout(rawTimeout) {
822
+ if (typeof rawTimeout !== "number" || rawTimeout < 0) {
823
+ return DEFAULT_EXTENSION_DEACTIVATE_TIMEOUT_MS;
824
+ }
825
+ if (rawTimeout === 0 || rawTimeout === Infinity) {
826
+ return 0;
827
+ }
828
+ if (!Number.isFinite(rawTimeout)) {
829
+ return DEFAULT_EXTENSION_DEACTIVATE_TIMEOUT_MS;
830
+ }
831
+ return Math.min(MAX_EXTENSION_DEACTIVATE_TIMEOUT_MS, Math.max(1, Math.floor(rawTimeout)));
832
+ }
833
+ async function runExtensionDeactivateWithTimeout(deactivate, timeoutMs) {
834
+ if (timeoutMs === 0) {
835
+ await deactivate();
836
+ return;
837
+ }
838
+ let timeoutHandle;
839
+ try {
840
+ // A timed-out deactivate promise may still finish later; JavaScript promises
841
+ // are not cancellable, so the host only stops waiting and consumes any late
842
+ // rejection from the hook.
843
+ const deactivatePromise = Promise.resolve().then(() => deactivate());
844
+ deactivatePromise.catch(() => { });
845
+ await Promise.race([
846
+ deactivatePromise,
847
+ new Promise((_, reject) => {
848
+ timeoutHandle = setTimeout(() => {
849
+ reject(new Error(`extension deactivate timed out after ${timeoutMs}ms`));
850
+ }, timeoutMs);
851
+ timeoutHandle.unref?.();
852
+ }),
853
+ ]);
854
+ }
855
+ finally {
856
+ if (timeoutHandle) {
857
+ clearTimeout(timeoutHandle);
858
+ }
859
+ }
860
+ }
808
861
  function isOutputRendererFormat(value) {
809
862
  return value === "toon" || value === "json";
810
863
  }
@@ -1900,4 +1953,4 @@ export async function activateExtensions(loadResult) {
1900
1953
  };
1901
1954
  }
1902
1955
  //# sourceMappingURL=loader.js.map
1903
- //# debugId=e5c4c469-142a-5854-82ca-a920130d2104
1956
+ //# debugId=19026387-34f8-5e8e-b936-4fc13489f244