@unbrained/pm-cli 2026.6.30 → 2026.7.2

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 (628) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +26 -0
  3. package/dist/cli/bootstrap-args.js +89 -79
  4. package/dist/cli/bootstrap-args.js.map +1 -1
  5. package/dist/cli/commander-usage.d.ts +2 -0
  6. package/dist/cli/commander-usage.js +58 -47
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/aggregate.js +102 -79
  9. package/dist/cli/commands/aggregate.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +339 -303
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/close-many.js +89 -68
  13. package/dist/cli/commands/close-many.js.map +1 -1
  14. package/dist/cli/commands/close.js +157 -129
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments-audit.js +50 -42
  17. package/dist/cli/commands/comments-audit.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +2 -0
  19. package/dist/cli/commands/config.js +443 -879
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.js +365 -287
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +352 -238
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +483 -434
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +46 -39
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/dedupe-merge.js +88 -69
  30. package/dist/cli/commands/dedupe-merge.js.map +1 -1
  31. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  32. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  33. package/dist/cli/commands/extension/doctor.js +129 -78
  34. package/dist/cli/commands/extension/doctor.js.map +1 -1
  35. package/dist/cli/commands/extension/managed-state.js +101 -57
  36. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  37. package/dist/cli/commands/extension/scaffold.d.ts +7 -0
  38. package/dist/cli/commands/extension/scaffold.js +214 -186
  39. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  40. package/dist/cli/commands/extension.d.ts +6 -1
  41. package/dist/cli/commands/extension.js +1034 -902
  42. package/dist/cli/commands/extension.js.map +1 -1
  43. package/dist/cli/commands/get.js +114 -81
  44. package/dist/cli/commands/get.js.map +1 -1
  45. package/dist/cli/commands/health.d.ts +17 -0
  46. package/dist/cli/commands/health.js +446 -307
  47. package/dist/cli/commands/health.js.map +1 -1
  48. package/dist/cli/commands/history-compact.js +209 -140
  49. package/dist/cli/commands/history-compact.js.map +1 -1
  50. package/dist/cli/commands/history-redact.js +162 -119
  51. package/dist/cli/commands/history-redact.js.map +1 -1
  52. package/dist/cli/commands/history-repair.js +120 -85
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/init.d.ts +8 -2
  55. package/dist/cli/commands/init.js +263 -162
  56. package/dist/cli/commands/init.js.map +1 -1
  57. package/dist/cli/commands/list-filter-shared.js +55 -48
  58. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  59. package/dist/cli/commands/list.js +152 -102
  60. package/dist/cli/commands/list.js.map +1 -1
  61. package/dist/cli/commands/next.js +49 -32
  62. package/dist/cli/commands/next.js.map +1 -1
  63. package/dist/cli/commands/plan.js +373 -298
  64. package/dist/cli/commands/plan.js.map +1 -1
  65. package/dist/cli/commands/recurrence-parsers.js +43 -25
  66. package/dist/cli/commands/recurrence-parsers.js.map +1 -1
  67. package/dist/cli/commands/reindex.d.ts +21 -5
  68. package/dist/cli/commands/reindex.js +345 -205
  69. package/dist/cli/commands/reindex.js.map +1 -1
  70. package/dist/cli/commands/restore.d.ts +8 -7
  71. package/dist/cli/commands/restore.js +105 -69
  72. package/dist/cli/commands/restore.js.map +1 -1
  73. package/dist/cli/commands/schema.js +33 -30
  74. package/dist/cli/commands/schema.js.map +1 -1
  75. package/dist/cli/commands/search.d.ts +10 -2
  76. package/dist/cli/commands/search.js +595 -536
  77. package/dist/cli/commands/search.js.map +1 -1
  78. package/dist/cli/commands/telemetry.js +98 -87
  79. package/dist/cli/commands/telemetry.js.map +1 -1
  80. package/dist/cli/commands/test-all.js +237 -168
  81. package/dist/cli/commands/test-all.js.map +1 -1
  82. package/dist/cli/commands/test.d.ts +6 -5
  83. package/dist/cli/commands/test.js +530 -464
  84. package/dist/cli/commands/test.js.map +1 -1
  85. package/dist/cli/commands/update-many.js +57 -42
  86. package/dist/cli/commands/update-many.js.map +1 -1
  87. package/dist/cli/commands/update.d.ts +1 -1
  88. package/dist/cli/commands/update.js +764 -747
  89. package/dist/cli/commands/update.js.map +1 -1
  90. package/dist/cli/commands/validate.d.ts +18 -1
  91. package/dist/cli/commands/validate.js +466 -343
  92. package/dist/cli/commands/validate.js.map +1 -1
  93. package/dist/cli/error-guidance.js +399 -357
  94. package/dist/cli/error-guidance.js.map +1 -1
  95. package/dist/cli/extension-command-options.js +48 -21
  96. package/dist/cli/extension-command-options.js.map +1 -1
  97. package/dist/cli/main.d.ts +47 -0
  98. package/dist/cli/main.js +428 -341
  99. package/dist/cli/main.js.map +1 -1
  100. package/dist/cli/migration-gates.js +22 -45
  101. package/dist/cli/migration-gates.js.map +1 -1
  102. package/dist/cli/register-list-query.js +94 -105
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +400 -416
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +86 -66
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +120 -101
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +117 -122
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
  113. package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
  114. package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
  115. package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
  116. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
  117. package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
  118. package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
  119. package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
  120. package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
  121. package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
  125. package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
  127. package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
  129. package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
  132. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  133. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
  135. package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
  137. package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
  138. package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
  139. package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
  140. package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
  142. package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
  143. package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
  144. package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
  145. package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
  146. package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
  147. package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
  148. package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
  149. package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
  150. package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
  152. package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
  153. package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
  154. package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
  156. package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
  157. package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
  158. package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
  160. package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
  162. package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
  163. package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
  164. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
  165. package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
  167. package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
  168. package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
  169. package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
  172. package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
  173. package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
  174. package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
  175. package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
  176. package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
  177. package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
  178. package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
  179. package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
  180. package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
  181. package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
  182. package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
  183. package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
  184. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
  185. package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
  186. package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
  187. package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
  188. package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
  189. package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
  192. package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
  193. package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
  195. package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
  196. package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
  199. package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
  200. package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
  202. package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
  203. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
  204. package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
  205. package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
  206. package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
  208. package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
  209. package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
  211. package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
  212. package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
  213. package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
  214. package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
  215. package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
  216. package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
  217. package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
  218. package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
  220. package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
  221. package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
  222. package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
  223. package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
  224. package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
  225. package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
  226. package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
  227. package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
  229. package/dist/cli-bundle/chunks/chunk-UWKEJMZU.js.map +7 -0
  230. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  231. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  232. package/dist/cli-bundle/chunks/{chunk-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
  233. package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
  234. package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
  235. package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
  236. package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
  237. package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
  238. package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
  239. package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
  240. package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
  241. package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
  243. package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
  244. package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
  245. package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
  246. package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
  248. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
  249. package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
  250. package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
  252. package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
  253. package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
  254. package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
  255. package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
  256. package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
  257. package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
  258. package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
  259. package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
  260. package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
  261. package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
  262. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
  263. package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
  264. package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
  265. package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
  267. package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
  268. package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
  269. package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
  271. package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
  273. package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
  274. package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
  275. package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
  276. package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
  277. package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
  278. package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
  279. package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
  280. package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
  281. package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
  282. package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
  283. package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
  284. package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
  285. package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
  286. package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
  287. package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
  288. package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
  289. package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
  290. package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
  291. package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
  292. package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
  293. package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
  294. package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
  295. package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
  296. package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
  297. package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
  298. package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
  299. package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
  300. package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
  301. package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
  302. package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
  303. package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
  304. package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
  305. package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
  306. package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
  307. package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
  308. package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
  309. package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
  310. package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
  311. package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
  312. package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
  313. package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
  314. package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
  315. package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
  316. package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
  317. package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
  318. package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
  319. package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
  321. package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
  322. package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
  323. package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
  324. package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
  325. package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
  326. package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
  327. package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
  328. package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
  329. package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
  330. package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
  331. package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
  332. package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
  333. package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
  334. package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
  335. package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
  336. package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
  337. package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
  338. package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
  339. package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
  340. package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
  341. package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
  342. package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
  343. package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
  344. package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
  345. package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
  346. package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
  347. package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
  348. package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
  349. package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
  350. package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
  351. package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
  352. package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
  353. package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
  354. package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
  355. package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
  356. package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
  357. package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
  358. package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
  359. package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
  360. package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
  361. package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
  362. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
  363. package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
  364. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
  365. package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
  366. package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
  367. package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
  369. package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
  370. package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
  371. package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
  372. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
  373. package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
  374. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
  375. package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
  377. package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
  379. package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
  380. package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
  381. package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
  383. package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
  384. package/dist/cli-bundle/main.js +986 -1500
  385. package/dist/cli-bundle/main.js.map +4 -4
  386. package/dist/core/config/nested-settings.js +89 -67
  387. package/dist/core/config/nested-settings.js.map +1 -1
  388. package/dist/core/extensions/activation-summary-markdown.js +23 -12
  389. package/dist/core/extensions/activation-summary-markdown.js.map +1 -1
  390. package/dist/core/extensions/extension-policy.d.ts +18 -3
  391. package/dist/core/extensions/extension-policy.js +116 -106
  392. package/dist/core/extensions/extension-policy.js.map +1 -1
  393. package/dist/core/extensions/loader.js +310 -232
  394. package/dist/core/extensions/loader.js.map +1 -1
  395. package/dist/core/governance/metadata-coverage.js +20 -28
  396. package/dist/core/governance/metadata-coverage.js.map +1 -1
  397. package/dist/core/history/drift-scan.js +93 -81
  398. package/dist/core/history/drift-scan.js.map +1 -1
  399. package/dist/core/item/item-format.js +523 -410
  400. package/dist/core/item/item-format.js.map +1 -1
  401. package/dist/core/item/item-type-definition.js +14 -14
  402. package/dist/core/item/item-type-definition.js.map +1 -1
  403. package/dist/core/item/type-registry.js +87 -82
  404. package/dist/core/item/type-registry.js.map +1 -1
  405. package/dist/core/output/mutation-projection.js +42 -26
  406. package/dist/core/output/mutation-projection.js.map +1 -1
  407. package/dist/core/schema/runtime-schema.js +34 -28
  408. package/dist/core/schema/runtime-schema.js.map +1 -1
  409. package/dist/core/search/semantic-defaults.js +64 -37
  410. package/dist/core/search/semantic-defaults.js.map +1 -1
  411. package/dist/core/search/vector-stores.js +32 -17
  412. package/dist/core/search/vector-stores.js.map +1 -1
  413. package/dist/core/sentry/helpers.js +31 -28
  414. package/dist/core/sentry/helpers.js.map +1 -1
  415. package/dist/core/sentry/instrument.js +54 -43
  416. package/dist/core/sentry/instrument.js.map +1 -1
  417. package/dist/core/store/front-matter-cache.js +239 -153
  418. package/dist/core/store/front-matter-cache.js.map +1 -1
  419. package/dist/core/store/item-store.js +33 -26
  420. package/dist/core/store/item-store.js.map +1 -1
  421. package/dist/core/store/settings.js +247 -203
  422. package/dist/core/store/settings.js.map +1 -1
  423. package/dist/core/test/background-runs.js +189 -160
  424. package/dist/core/test/background-runs.js.map +1 -1
  425. package/dist/mcp/server.js +387 -367
  426. package/dist/mcp/server.js.map +1 -1
  427. package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
  428. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  429. package/dist/sdk/cli-contracts/tool-schema.js +76 -45
  430. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  431. package/dist/sdk/compose.d.ts +4 -1
  432. package/dist/sdk/compose.js +181 -115
  433. package/dist/sdk/compose.js.map +1 -1
  434. package/docs/RELEASING.md +2 -3
  435. package/package.json +2 -2
  436. package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
  437. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
  438. package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
  439. package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
  440. package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
  443. package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
  444. package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
  446. package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
  451. package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
  456. package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
  458. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
  459. package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
  462. package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  465. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  466. package/dist/cli-bundle/chunks/chunk-IZQOJR2B.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
  468. package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
  470. package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
  471. package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
  472. package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
  475. package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
  476. package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
  477. package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
  480. package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
  481. package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
  482. package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
  483. package/dist/cli-bundle/chunks/chunk-VD3LKZFX.js.map +0 -1
  484. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  485. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  486. package/dist/cli-bundle/chunks/chunk-WTRUDJ3R.js.map +0 -1
  487. package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
  488. package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
  489. package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
  490. package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
  491. package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
  492. package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
  493. package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
  494. package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
  495. package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
  496. package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
  497. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
  498. package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
  499. package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
  500. package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
  501. package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
  502. package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
  503. package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
  504. package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
  505. package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
  506. package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
  507. package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
  508. package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
  509. package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
  510. package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
  512. package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
  513. package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
  514. package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
  515. package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
  516. package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
  517. package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
  518. package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
  519. package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
  520. package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
  521. package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
  522. package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
  523. package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
  524. package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
  525. package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
  526. package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
  527. package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
  529. package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
  530. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
  531. package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
  533. package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
  534. package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
  535. package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
  536. package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
  537. /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
@@ -3,21 +3,21 @@ import {
3
3
  } from "./chunk-5HIZDR5A.js";
4
4
  import {
5
5
  ensureTypeFolderScaffold
6
- } from "./chunk-NO6Y6FB2.js";
6
+ } from "./chunk-SPM2XLWI.js";
7
7
  import {
8
8
  buildExtensionDescribeResult,
9
9
  scaffoldExtensionProject
10
- } from "./chunk-IZQOJR2B.js";
10
+ } from "./chunk-GRRG3MCT.js";
11
11
  import {
12
12
  normalizeExtensionNameForMatch,
13
13
  normalizeManagedDirectoryName,
14
14
  normalizeStringList,
15
15
  parseExtensionManifest,
16
16
  validateExtensionDirectory
17
- } from "./chunk-F6VH3LFC.js";
17
+ } from "./chunk-BVZZN2LH.js";
18
18
  import {
19
19
  nowIso
20
- } from "./chunk-MLHX6DN5.js";
20
+ } from "./chunk-AIAIXG7I.js";
21
21
  import {
22
22
  EXIT_CODE,
23
23
  EXTENSION_CAPABILITY_CONTRACT,
@@ -38,7 +38,7 @@ import {
38
38
  resolvePmPackageRootFromModule,
39
39
  resolvePmRoot,
40
40
  writeSettings
41
- } from "./chunk-SNUK7H5J.js";
41
+ } from "./chunk-7NSPKJUS.js";
42
42
 
43
43
  // dist/cli/commands/extension.js
44
44
  import { execFile as execFile2 } from "node:child_process";
@@ -53,7 +53,7 @@ import path from "node:path";
53
53
  !(function() {
54
54
  try {
55
55
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
56
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2522dc0e-5909-57da-b8cb-ceb4eac20da2");
56
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0874e784-e274-5edd-8fbf-26d94a6c4a32");
57
57
  } catch (e2) {
58
58
  }
59
59
  })();
@@ -97,6 +97,63 @@ function managedExtensionSourcesEquivalent(left, right) {
97
97
  }
98
98
  return true;
99
99
  }
100
+ function optionalString(value) {
101
+ return typeof value === "string" ? value : void 0;
102
+ }
103
+ function hasRequiredManagedRecordFields(entry) {
104
+ return typeof entry.name === "string" && entry.name.trim().length > 0 && typeof entry.directory === "string" && entry.directory.trim().length > 0 && (entry.scope === "project" || entry.scope === "global") && typeof entry.manifest_version === "string" && typeof entry.manifest_entry === "string" && Array.isArray(entry.capabilities) && entry.capabilities.every((value) => typeof value === "string") && typeof entry.installed_at === "string" && typeof entry.updated_at === "string";
105
+ }
106
+ function normalizeManagedSource(raw) {
107
+ if (typeof raw !== "object" || raw === null) {
108
+ return null;
109
+ }
110
+ const source = raw;
111
+ if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
112
+ return null;
113
+ }
114
+ return {
115
+ kind: source.kind,
116
+ input: source.input,
117
+ location: source.location,
118
+ name: optionalString(source.name),
119
+ package: optionalString(source.package),
120
+ version: optionalString(source.version),
121
+ repository: optionalString(source.repository),
122
+ owner: optionalString(source.owner),
123
+ repo: optionalString(source.repo),
124
+ ref: optionalString(source.ref),
125
+ subpath: optionalString(source.subpath),
126
+ commit: optionalString(source.commit)
127
+ };
128
+ }
129
+ function normalizeManagedRecord(raw) {
130
+ if (typeof raw !== "object" || raw === null) {
131
+ return null;
132
+ }
133
+ const entry = raw;
134
+ if (!hasRequiredManagedRecordFields(entry)) {
135
+ return null;
136
+ }
137
+ const source = normalizeManagedSource(entry.source);
138
+ if (!source) {
139
+ return null;
140
+ }
141
+ return {
142
+ name: entry.name.trim(),
143
+ directory: entry.directory.trim(),
144
+ scope: entry.scope,
145
+ manifest_version: entry.manifest_version,
146
+ manifest_entry: entry.manifest_entry,
147
+ capabilities: normalizeStringList(entry.capabilities),
148
+ installed_at: entry.installed_at,
149
+ updated_at: entry.updated_at,
150
+ source,
151
+ last_update_check_at: optionalString(entry.last_update_check_at),
152
+ last_update_remote_commit: optionalString(entry.last_update_remote_commit),
153
+ update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
154
+ update_error: optionalString(entry.update_error)
155
+ };
156
+ }
100
157
  function normalizeManagedState(raw) {
101
158
  if (typeof raw !== "object" || raw === null) {
102
159
  return null;
@@ -107,49 +164,14 @@ function normalizeManagedState(raw) {
107
164
  }
108
165
  const entries = [];
109
166
  for (const rawEntry of candidate.entries) {
110
- if (typeof rawEntry !== "object" || rawEntry === null) {
111
- continue;
112
- }
113
- const entry = rawEntry;
114
- if (typeof entry.name !== "string" || entry.name.trim().length === 0 || typeof entry.directory !== "string" || entry.directory.trim().length === 0 || entry.scope !== "project" && entry.scope !== "global" || typeof entry.manifest_version !== "string" || typeof entry.manifest_entry !== "string" || !Array.isArray(entry.capabilities) || entry.capabilities.some((value) => typeof value !== "string") || typeof entry.installed_at !== "string" || typeof entry.updated_at !== "string" || typeof entry.source !== "object" || entry.source === null) {
115
- continue;
116
- }
117
- const source = entry.source;
118
- if (source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin" || typeof source.input !== "string" || typeof source.location !== "string") {
119
- continue;
167
+ const record = normalizeManagedRecord(rawEntry);
168
+ if (record) {
169
+ entries.push(record);
120
170
  }
121
- entries.push({
122
- name: entry.name.trim(),
123
- directory: entry.directory.trim(),
124
- scope: entry.scope,
125
- manifest_version: entry.manifest_version,
126
- manifest_entry: entry.manifest_entry,
127
- capabilities: normalizeStringList(entry.capabilities),
128
- installed_at: entry.installed_at,
129
- updated_at: entry.updated_at,
130
- source: {
131
- kind: source.kind,
132
- input: source.input,
133
- location: source.location,
134
- name: typeof source.name === "string" ? source.name : void 0,
135
- package: typeof source.package === "string" ? source.package : void 0,
136
- version: typeof source.version === "string" ? source.version : void 0,
137
- repository: typeof source.repository === "string" ? source.repository : void 0,
138
- owner: typeof source.owner === "string" ? source.owner : void 0,
139
- repo: typeof source.repo === "string" ? source.repo : void 0,
140
- ref: typeof source.ref === "string" ? source.ref : void 0,
141
- subpath: typeof source.subpath === "string" ? source.subpath : void 0,
142
- commit: typeof source.commit === "string" ? source.commit : void 0
143
- },
144
- last_update_check_at: typeof entry.last_update_check_at === "string" ? entry.last_update_check_at : void 0,
145
- last_update_remote_commit: typeof entry.last_update_remote_commit === "string" ? entry.last_update_remote_commit : void 0,
146
- update_available: typeof entry.update_available === "boolean" || entry.update_available === null ? entry.update_available : void 0,
147
- update_error: typeof entry.update_error === "string" ? entry.update_error : void 0
148
- });
149
171
  }
150
172
  return {
151
173
  version: MANAGED_EXTENSION_STATE_VERSION,
152
- updated_at: typeof candidate.updated_at === "string" ? candidate.updated_at : nowIso(),
174
+ updated_at: optionalString(candidate.updated_at) ?? nowIso(),
153
175
  entries: sortManagedEntries(entries)
154
176
  };
155
177
  }
@@ -969,7 +991,7 @@ import path4 from "node:path";
969
991
  !(function() {
970
992
  try {
971
993
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
972
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "706494dc-d2f2-520c-9845-71326ee5841e");
994
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0baef9c6-cdf9-5aea-89f0-088600d538e6");
973
995
  } catch (e2) {
974
996
  }
975
997
  })();
@@ -1091,6 +1113,42 @@ async function resolveBundledAliasManifestName(input) {
1091
1113
  return null;
1092
1114
  }
1093
1115
  }
1116
+ function buildBundledCatalogLinks(manifest) {
1117
+ return {
1118
+ docs: manifest.catalog?.links?.docs ?? manifest.package_homepage,
1119
+ npm: manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0),
1120
+ repository: manifest.catalog?.links?.repository ?? manifest.package_repository_url,
1121
+ report: manifest.catalog?.links?.report ?? manifest.package_bugs_url
1122
+ };
1123
+ }
1124
+ function buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations) {
1125
+ const installScopeFlag = scope === "global" ? "--global" : "--project";
1126
+ const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions").map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []]).filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
1127
+ return {
1128
+ alias: bundledEntry.alias,
1129
+ bundled: true,
1130
+ available: true,
1131
+ installed: installedBuiltinAliases.has(bundledEntry.alias) || installedLocations.has(path4.resolve(bundledEntry.package_root)),
1132
+ install_target: bundledEntry.alias,
1133
+ install_command: `pm install ${bundledEntry.alias} ${installScopeFlag}`,
1134
+ package_name: manifest.package_name,
1135
+ package_version: manifest.package_version,
1136
+ description: manifest.catalog?.summary ?? manifest.package_description,
1137
+ keywords: manifest.package_keywords ?? [],
1138
+ resources: manifest.resources,
1139
+ installable_resources: {
1140
+ extensions: manifest.resources.extensions ?? []
1141
+ },
1142
+ metadata_only_resources: metadataOnlyResources,
1143
+ catalog: {
1144
+ display_name: manifest.catalog?.display_name,
1145
+ category: manifest.catalog?.category,
1146
+ tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
1147
+ links: buildBundledCatalogLinks(manifest),
1148
+ media: manifest.catalog?.media
1149
+ }
1150
+ };
1151
+ }
1094
1152
  async function buildBundledPackageCatalog(scope, global2, options = {}) {
1095
1153
  const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global2.path), process.cwd());
1096
1154
  const selectedRoot = scope === "global" ? roots.global : roots.project;
@@ -1099,44 +1157,8 @@ async function buildBundledPackageCatalog(scope, global2, options = {}) {
1099
1157
  const installedBuiltinAliases = new Set(managedStateRead.state.entries.filter((entry) => entry.scope === scope && entry.source.kind === "builtin").flatMap((entry) => [entry.source.name, entry.source.input, entry.source.location]).filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => value.trim().toLowerCase()));
1100
1158
  const packages = [];
1101
1159
  for (const bundledEntry of await collectBundledPackageEntries()) {
1102
- const alias = bundledEntry.alias;
1103
- const packageRoot = bundledEntry.package_root;
1104
- const installScopeFlag = scope === "global" ? "--global" : "--project";
1105
- const manifest = await readPmPackageManifest(packageRoot);
1106
- const repository = manifest.catalog?.links?.repository ?? manifest.package_repository_url;
1107
- const report = manifest.catalog?.links?.report ?? manifest.package_bugs_url;
1108
- const docs = manifest.catalog?.links?.docs ?? manifest.package_homepage;
1109
- const npm = manifest.catalog?.links?.npm ?? (manifest.package_name && manifest.package_private !== true ? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}` : void 0);
1110
- const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions").map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []]).filter(([, entries]) => Array.isArray(entries) && entries.length > 0));
1111
- packages.push({
1112
- alias,
1113
- bundled: true,
1114
- available: true,
1115
- installed: installedBuiltinAliases.has(alias) || installedLocations.has(path4.resolve(packageRoot)),
1116
- install_target: alias,
1117
- install_command: `pm install ${alias} ${installScopeFlag}`,
1118
- package_name: manifest.package_name,
1119
- package_version: manifest.package_version,
1120
- description: manifest.catalog?.summary ?? manifest.package_description,
1121
- keywords: manifest.package_keywords ?? [],
1122
- resources: manifest.resources,
1123
- installable_resources: {
1124
- extensions: manifest.resources.extensions ?? []
1125
- },
1126
- metadata_only_resources: metadataOnlyResources,
1127
- catalog: {
1128
- display_name: manifest.catalog?.display_name,
1129
- category: manifest.catalog?.category,
1130
- tags: manifest.catalog?.tags ?? manifest.package_keywords ?? [],
1131
- links: {
1132
- docs,
1133
- npm,
1134
- repository,
1135
- report
1136
- },
1137
- media: manifest.catalog?.media
1138
- }
1139
- });
1160
+ const manifest = await readPmPackageManifest(bundledEntry.package_root);
1161
+ packages.push(buildBundledCatalogPackageEntry(manifest, bundledEntry, scope, installedBuiltinAliases, installedLocations));
1140
1162
  }
1141
1163
  const fields = parsePackageCatalogFields(options.fields);
1142
1164
  const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
@@ -1203,7 +1225,7 @@ function projectPackageCatalogEntry(entry, fields) {
1203
1225
  !(function() {
1204
1226
  try {
1205
1227
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1206
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "dc247256-3b2a-588f-abb5-55f7cbd9fb20");
1228
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "391a9e4b-f4b7-5176-970b-6de9523822e7");
1207
1229
  } catch (e2) {
1208
1230
  }
1209
1231
  })();
@@ -1459,6 +1481,98 @@ function classifyUnusedCapabilityWarnings(loadResult, activationResult) {
1459
1481
  }
1460
1482
  return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
1461
1483
  }
1484
+ var TRIAGE_REMEDIATION_RULES = [
1485
+ {
1486
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manifest_")),
1487
+ build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "explore")} ${ctx.scopeFlag} to inspect discovered manifests and directories.`
1488
+ },
1489
+ {
1490
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unknown:")),
1491
+ build: () => `Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`
1492
+ },
1493
+ {
1494
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:")),
1495
+ build: () => "Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema)."
1496
+ },
1497
+ {
1498
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_missing:")),
1499
+ build: (ctx) => `Extension activation failed because code registered a surface missing from manifest capabilities. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace and add the reported missing_capability to manifest.json before publishing.`
1500
+ },
1501
+ {
1502
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_capability_unused:")),
1503
+ build: (ctx) => `Extension manifests declare capabilities that are never registered against. Remove each reported unused capability from manifest.json to keep least privilege, or add the matching registration. Run ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag} --detail deep --trace for per-extension registration counts.`
1504
+ },
1505
+ {
1506
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:")),
1507
+ build: () => "Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility."
1508
+ },
1509
+ {
1510
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:")),
1511
+ build: () => "Global output service/renderer overrides are active. For output_format, return context.payload/null/undefined unless the extension owns the command. For renderers, return null for unrelated payloads so pm falls back to native rendering."
1512
+ },
1513
+ {
1514
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:")),
1515
+ build: () => "A package registers custom item types/fields (a GLOBAL schema contribution) but also declares narrow activation.commands, so it never activates for built-in commands like pm create <type> and the custom type silently fails to register. Remove activation.commands from manifest.json so pm activates the package for every command, or \u2014 if the schema is intentionally command-scoped \u2014 knowingly ignore this advisory."
1516
+ },
1517
+ {
1518
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:")),
1519
+ build: (ctx) => `Detected extension load failures caused by missing SDK dependency resolution. Ensure extension package dependencies include "@unbrained/pm-cli" and reinstall dependencies before running ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
1520
+ },
1521
+ {
1522
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:")),
1523
+ build: (ctx) => `Detected extension module-mode mismatches. For ESM-based extension entries/imports, set package.json "type": "module" or use an explicit .mjs entry and rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
1524
+ },
1525
+ {
1526
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_")),
1527
+ build: (ctx) => `Extension pm version-bound warnings detected. Align each package manifest's pm_min_version/pm_max_version with the installed pm CLI version (see the warning's required/allowed=...:current=... details), or upgrade/downgrade the pm CLI to satisfy the declared bounds, then rerun ${lifecycleFlagCommand(ctx.options, "doctor")} ${ctx.scopeFlag}.`
1528
+ },
1529
+ {
1530
+ matches: (_warnings, ctx) => ctx.updateCheckFailedTotal > 0,
1531
+ build: (ctx) => `Run ${lifecycleFlagCommand(ctx.options, "manage")} ${ctx.scopeFlag} after validating network and repository access.`
1532
+ },
1533
+ {
1534
+ matches: (warnings) => warnings.some((warning) => warning.startsWith("extension_manager_state_")),
1535
+ build: (ctx) => `Review and repair ${ctx.scope} managed extension state file if schema/read warnings persist.`
1536
+ },
1537
+ {
1538
+ matches: (_warnings, ctx) => ctx.policyWarningCount > 0,
1539
+ build: () => "Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces."
1540
+ }
1541
+ ];
1542
+ function buildExtensionTriageRemediation(params) {
1543
+ const { normalizedWarnings, options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount, updateHealthPartial, skippedUnmanagedTotal, skippedNonGithubTotal, updateAvailableTotal } = params;
1544
+ const remediation = [];
1545
+ const ctx = { options, scope, scopeFlag, updateCheckFailedTotal, policyWarningCount };
1546
+ if (normalizedWarnings.length > 0) {
1547
+ const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
1548
+ deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
1549
+ doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
1550
+ });
1551
+ if (registrationCollisionRemediation) {
1552
+ remediation.push(registrationCollisionRemediation);
1553
+ }
1554
+ for (const rule of TRIAGE_REMEDIATION_RULES) {
1555
+ if (rule.matches(normalizedWarnings, ctx)) {
1556
+ remediation.push(rule.build(ctx));
1557
+ }
1558
+ }
1559
+ }
1560
+ if (updateHealthPartial) {
1561
+ remediation.push(`Update-check coverage is partial because unmanaged extensions need adoption. Adopt existing installs via ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state (or ${lifecycleFlagCommand(options, "adopt-all")} ${scopeFlag}, ${lifecycleFlagCommand(options, "adopt")} <name> ${scopeFlag}, or reinstall via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>).`);
1562
+ } else if (skippedUnmanagedTotal > 0) {
1563
+ remediation.push(`Loaded unmanaged extensions are currently treated as informational. Use ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state to adopt them for update checks.`);
1564
+ }
1565
+ if (skippedNonGithubTotal > 0) {
1566
+ remediation.push(`Non-GitHub managed extensions are skipped by update checks. Use doctor output for non-update diagnostics.`);
1567
+ }
1568
+ if (updateAvailableTotal > 0) {
1569
+ remediation.push(`Update available managed extensions via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>.`);
1570
+ }
1571
+ if (remediation.length === 0) {
1572
+ remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
1573
+ }
1574
+ return remediation;
1575
+ }
1462
1576
  function buildExtensionTriageSummary(scope, warnings, extensions, options = {}) {
1463
1577
  const normalizedWarnings = [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
1464
1578
  const managedTotal = extensions.filter((entry) => entry.managed).length;
@@ -1488,73 +1602,19 @@ function buildExtensionTriageSummary(scope, warnings, extensions, options = {})
1488
1602
  const warningCodes = [...new Set(effectiveWarnings.map((value) => warningCode(value)))].sort((left, right) => left.localeCompare(right));
1489
1603
  const policyWarnings = summarizePolicyWarnings(effectiveWarnings);
1490
1604
  const scopeFlag = scope === "global" ? "--global" : "--project";
1491
- const remediation = [];
1492
- if (normalizedWarnings.length > 0) {
1493
- const registrationCollisionRemediation = buildRegistrationCollisionRemediation(normalizedWarnings, {
1494
- deactivate: `${lifecycleFlagCommand(options, "deactivate")} <name> ${scopeFlag}`,
1495
- doctor: `${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace`
1496
- });
1497
- if (registrationCollisionRemediation) {
1498
- remediation.push(registrationCollisionRemediation);
1499
- }
1500
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_manifest_"))) {
1501
- remediation.push(`Run ${lifecycleFlagCommand(options, "explore")} ${scopeFlag} to inspect discovered manifests and directories.`);
1502
- }
1503
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unknown:"))) {
1504
- remediation.push(`Unknown extension capabilities detected. Allowed capabilities: ${KNOWN_EXTENSION_CAPABILITIES.join(", ")}. Review extension_capability_unknown warning details for suggested replacements.`);
1505
- }
1506
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_legacy_alias:"))) {
1507
- remediation.push("Legacy extension capability aliases were auto-remapped to canonical capabilities. Update manifests to canonical names (migration/validation -> schema).");
1508
- }
1509
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_missing:"))) {
1510
- remediation.push(`Extension activation failed because code registered a surface missing from manifest capabilities. Run ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace and add the reported missing_capability to manifest.json before publishing.`);
1511
- }
1512
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_capability_unused:"))) {
1513
- remediation.push(`Extension manifests declare capabilities that are never registered against. Remove each reported unused capability from manifest.json to keep least privilege, or add the matching registration. Run ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag} --detail deep --trace for per-extension registration counts.`);
1514
- }
1515
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_command_definition_legacy_handler_alias:"))) {
1516
- remediation.push("Extension command definitions using legacy handler were auto-remapped. Update command definitions to use run: (context) => ... for forward compatibility.");
1517
- }
1518
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_output_service_override_global:") || warning.startsWith("extension_output_renderer_override_global:"))) {
1519
- remediation.push("Global output service/renderer overrides are active. For output_format, return context.payload/null/undefined unless the extension owns the command. For renderers, return null for unrelated payloads so pm falls back to native rendering.");
1520
- }
1521
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_schema_narrow_activation:"))) {
1522
- remediation.push("A package registers custom item types/fields (a GLOBAL schema contribution) but also declares narrow activation.commands, so it never activates for built-in commands like pm create <type> and the custom type silently fails to register. Remove activation.commands from manifest.json so pm activates the package for every command, or \u2014 if the schema is intentionally command-scoped \u2014 knowingly ignore this advisory.");
1523
- }
1524
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_sdk_dependency_missing:"))) {
1525
- remediation.push(`Detected extension load failures caused by missing SDK dependency resolution. Ensure extension package dependencies include "@unbrained/pm-cli" and reinstall dependencies before running ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag}.`);
1526
- }
1527
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_load_failed_module_mode_mismatch:"))) {
1528
- remediation.push(`Detected extension module-mode mismatches. For ESM-based extension entries/imports, set package.json "type": "module" or use an explicit .mjs entry and rerun ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag}.`);
1529
- }
1530
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_pm_min_version_") || warning.startsWith("extension_pm_max_version_"))) {
1531
- remediation.push(`Extension pm version-bound warnings detected. Align each package manifest's pm_min_version/pm_max_version with the installed pm CLI version (see the warning's required/allowed=...:current=... details), or upgrade/downgrade the pm CLI to satisfy the declared bounds, then rerun ${lifecycleFlagCommand(options, "doctor")} ${scopeFlag}.`);
1532
- }
1533
- if (updateCheckFailedTotal > 0) {
1534
- remediation.push(`Run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after validating network and repository access.`);
1535
- }
1536
- if (normalizedWarnings.some((warning) => warning.startsWith("extension_manager_state_"))) {
1537
- remediation.push(`Review and repair ${scope} managed extension state file if schema/read warnings persist.`);
1538
- }
1539
- if (policyWarnings.warning_count > 0) {
1540
- remediation.push("Extension governance policy warnings detected. Review settings.extensions.policy mode and allow/block lists to confirm intended capabilities and registration surfaces.");
1541
- }
1542
- }
1543
1605
  const collisionPlan = buildRegistrationCollisionPlan(scope, normalizedWarnings, extensions, options);
1544
- if (updateHealthPartial) {
1545
- remediation.push(`Update-check coverage is partial because unmanaged extensions need adoption. Adopt existing installs via ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state (or ${lifecycleFlagCommand(options, "adopt-all")} ${scopeFlag}, ${lifecycleFlagCommand(options, "adopt")} <name> ${scopeFlag}, or reinstall via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>).`);
1546
- } else if (skippedUnmanagedTotal > 0) {
1547
- remediation.push(`Loaded unmanaged extensions are currently treated as informational. Use ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} --fix-managed-state to adopt them for update checks.`);
1548
- }
1549
- if (skippedNonGithubTotal > 0) {
1550
- remediation.push(`Non-GitHub managed extensions are skipped by update checks. Use doctor output for non-update diagnostics.`);
1551
- }
1552
- if (updateAvailableTotal > 0) {
1553
- remediation.push(`Update available managed extensions via ${lifecycleFlagCommand(options, "install")} ${scopeFlag} <source>.`);
1554
- }
1555
- if (remediation.length === 0) {
1556
- remediation.push(`No immediate action required. Re-run ${lifecycleFlagCommand(options, "manage")} ${scopeFlag} after extension changes.`);
1557
- }
1606
+ const remediation = buildExtensionTriageRemediation({
1607
+ normalizedWarnings,
1608
+ options,
1609
+ scope,
1610
+ scopeFlag,
1611
+ updateCheckFailedTotal,
1612
+ policyWarningCount: policyWarnings.warning_count,
1613
+ updateHealthPartial,
1614
+ skippedUnmanagedTotal,
1615
+ skippedNonGithubTotal,
1616
+ updateAvailableTotal
1617
+ });
1558
1618
  return {
1559
1619
  status: effectiveWarnings.length === 0 ? "ok" : "warn",
1560
1620
  warning_count: effectiveWarnings.length,
@@ -1676,7 +1736,7 @@ function buildDoctorConsistencySummary(scope, installedExtensions, loadedExtensi
1676
1736
  !(function() {
1677
1737
  try {
1678
1738
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1679
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "e112e059-bf75-55f5-a0ec-652b037fe54b");
1739
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0e9a5528-9595-5a89-89b7-5a5acce477a8");
1680
1740
  } catch (e2) {
1681
1741
  }
1682
1742
  })();
@@ -1981,48 +2041,58 @@ function buildUnknownLifecycleActionError(target, options) {
1981
2041
  }
1982
2042
  });
1983
2043
  }
2044
+ var EXTENSION_ACTION_FLAG_SELECTORS = [
2045
+ ["install", "install"],
2046
+ ["uninstall", "uninstall"],
2047
+ ["explore", "explore"],
2048
+ ["manage", "manage"],
2049
+ ["describe", "describe"],
2050
+ ["reload", "reload"],
2051
+ ["doctor", "doctor"],
2052
+ ["catalog", "catalog"],
2053
+ ["init", "init"],
2054
+ ["scaffold", "init"],
2055
+ ["adopt", "adopt"],
2056
+ ["adoptAll", "adopt-all"],
2057
+ ["activate", "activate"],
2058
+ ["deactivate", "deactivate"]
2059
+ ];
2060
+ function resolveImplicitActionFromTarget(normalizedTarget) {
2061
+ if (normalizedTarget === "doctor") {
2062
+ return "doctor";
2063
+ }
2064
+ if (normalizedTarget === "reload") {
2065
+ return "reload";
2066
+ }
2067
+ if (normalizedTarget === "catalog") {
2068
+ return "catalog";
2069
+ }
2070
+ if (normalizedTarget === "init" || normalizedTarget === "scaffold") {
2071
+ return "init";
2072
+ }
2073
+ if (normalizedTarget === "explore") {
2074
+ return "explore";
2075
+ }
2076
+ if (normalizedTarget === "manage") {
2077
+ return "manage";
2078
+ }
2079
+ if (normalizedTarget === "list" || normalizedTarget === "") {
2080
+ return "explore";
2081
+ }
2082
+ return null;
2083
+ }
1984
2084
  function resolveAction(target, options) {
1985
- const selected = [...new Set([
1986
- options.install ? "install" : null,
1987
- options.uninstall ? "uninstall" : null,
1988
- options.explore ? "explore" : null,
1989
- options.manage ? "manage" : null,
1990
- options.describe ? "describe" : null,
1991
- options.reload ? "reload" : null,
1992
- options.doctor ? "doctor" : null,
1993
- options.catalog ? "catalog" : null,
1994
- options.init ? "init" : null,
1995
- options.scaffold ? "init" : null,
1996
- options.adopt ? "adopt" : null,
1997
- options.adoptAll ? "adopt-all" : null,
1998
- options.activate ? "activate" : null,
1999
- options.deactivate ? "deactivate" : null
2000
- ].filter((value) => value !== null))];
2085
+ const selected = [
2086
+ ...new Set(EXTENSION_ACTION_FLAG_SELECTORS.filter(([flag]) => options[flag] === true).map(([, mappedAction]) => mappedAction))
2087
+ ];
2001
2088
  if (selected.length === 0) {
2002
- if (typeof target === "string" && target.trim().toLowerCase() === "doctor") {
2003
- return "doctor";
2004
- }
2005
- if (typeof target === "string" && target.trim().toLowerCase() === "reload") {
2006
- return "reload";
2007
- }
2008
- if (typeof target === "string" && target.trim().toLowerCase() === "catalog") {
2009
- return "catalog";
2010
- }
2011
- if (typeof target === "string" && (target.trim().toLowerCase() === "init" || target.trim().toLowerCase() === "scaffold")) {
2012
- return "init";
2013
- }
2014
- if (typeof target === "string" && target.trim().toLowerCase() === "explore") {
2015
- return "explore";
2016
- }
2017
- if (typeof target === "string" && target.trim().toLowerCase() === "manage") {
2018
- return "manage";
2019
- }
2020
- if (typeof target === "string" && (target.trim().toLowerCase() === "list" || target.trim() === "")) {
2021
- return "explore";
2022
- }
2023
2089
  if (target === void 0) {
2024
2090
  return "explore";
2025
2091
  }
2092
+ const implicitAction = resolveImplicitActionFromTarget(target.trim().toLowerCase());
2093
+ if (implicitAction) {
2094
+ return implicitAction;
2095
+ }
2026
2096
  throw buildUnknownLifecycleActionError(target, options);
2027
2097
  }
2028
2098
  if (selected.length > 1) {
@@ -2081,6 +2151,27 @@ function resolveUpdateCheckResolution(managedEntry) {
2081
2151
  reason: "no_update_check_recorded"
2082
2152
  };
2083
2153
  }
2154
+ function buildInstalledExtensionSummary(identity, scope, managedEntry, updateCheck) {
2155
+ return {
2156
+ name: identity.name,
2157
+ directory: identity.directory,
2158
+ version: identity.version,
2159
+ entry: identity.entry,
2160
+ scope,
2161
+ active: identity.enabled,
2162
+ enabled: identity.enabled,
2163
+ runtime_active: null,
2164
+ activation_status: "unknown",
2165
+ managed: Boolean(managedEntry),
2166
+ source: managedEntry?.source,
2167
+ update_available: managedEntry?.update_available,
2168
+ last_update_check_at: managedEntry?.last_update_check_at,
2169
+ last_update_remote_commit: managedEntry?.last_update_remote_commit,
2170
+ update_error: managedEntry?.update_error,
2171
+ update_check_status: updateCheck.status,
2172
+ update_check_reason: updateCheck.reason
2173
+ };
2174
+ }
2084
2175
  async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
2085
2176
  if (!await pathExists(extensionsRoot)) {
2086
2177
  return {
@@ -2104,27 +2195,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
2104
2195
  if (!await pathExists(manifestPath)) {
2105
2196
  warnings.push(`extension_manifest_missing:${scope}:${directoryName}`);
2106
2197
  const managedEntry2 = managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
2107
- const updateCheck2 = resolveUpdateCheckResolution(managedEntry2);
2108
- const enabled2 = managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false;
2109
- summaries.push({
2198
+ summaries.push(buildInstalledExtensionSummary({
2110
2199
  name: managedEntry2?.name ?? directoryName,
2111
2200
  directory: directoryName,
2112
2201
  version: managedEntry2?.manifest_version ?? "unknown",
2113
2202
  entry: managedEntry2?.manifest_entry ?? "unknown",
2114
- scope,
2115
- active: enabled2,
2116
- enabled: enabled2,
2117
- runtime_active: null,
2118
- activation_status: "unknown",
2119
- managed: Boolean(managedEntry2),
2120
- source: managedEntry2?.source,
2121
- update_available: managedEntry2?.update_available,
2122
- last_update_check_at: managedEntry2?.last_update_check_at,
2123
- last_update_remote_commit: managedEntry2?.last_update_remote_commit,
2124
- update_error: managedEntry2?.update_error,
2125
- update_check_status: updateCheck2.status,
2126
- update_check_reason: updateCheck2.reason
2127
- });
2203
+ enabled: managedEntry2 ? isExtensionEnabled(settings, managedEntry2.name) : false
2204
+ }, scope, managedEntry2, resolveUpdateCheckResolution(managedEntry2)));
2128
2205
  continue;
2129
2206
  }
2130
2207
  let rawManifest;
@@ -2140,27 +2217,13 @@ async function listInstalledExtensions(extensionsRoot, scope, settings, state) {
2140
2217
  continue;
2141
2218
  }
2142
2219
  const managedEntry = managedByName.get(normalizeExtensionNameForMatch(manifest.name)) ?? managedByDirectory.get(normalizeExtensionNameForMatch(directoryName));
2143
- const updateCheck = resolveUpdateCheckResolution(managedEntry);
2144
- const enabled = isExtensionEnabled(settings, manifest.name);
2145
- summaries.push({
2220
+ summaries.push(buildInstalledExtensionSummary({
2146
2221
  name: manifest.name,
2147
2222
  directory: directoryName,
2148
2223
  version: manifest.version,
2149
2224
  entry: manifest.entry,
2150
- scope,
2151
- active: enabled,
2152
- enabled,
2153
- runtime_active: null,
2154
- activation_status: "unknown",
2155
- managed: Boolean(managedEntry),
2156
- source: managedEntry?.source,
2157
- update_available: managedEntry?.update_available,
2158
- last_update_check_at: managedEntry?.last_update_check_at,
2159
- last_update_remote_commit: managedEntry?.last_update_remote_commit,
2160
- update_error: managedEntry?.update_error,
2161
- update_check_status: updateCheck.status,
2162
- update_check_reason: updateCheck.reason
2163
- });
2225
+ enabled: isExtensionEnabled(settings, manifest.name)
2226
+ }, scope, managedEntry, resolveUpdateCheckResolution(managedEntry)));
2164
2227
  }
2165
2228
  return {
2166
2229
  extensions: summaries.sort((left, right) => left.name.localeCompare(right.name)),
@@ -2439,46 +2502,63 @@ function collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResul
2439
2502
  }
2440
2503
  return [...new Set(warnings)].sort((left, right) => left.localeCompare(right));
2441
2504
  }
2442
- async function runExtension(target, options, global2) {
2443
- const action = resolveAction(target, options);
2444
- if ((options.strictExit === true || options.failOnWarn === true) && action !== "doctor") {
2445
- throw new PmCliError("--strict-exit and --fail-on-warn are only valid with --doctor.", EXIT_CODE.USAGE);
2446
- }
2447
- if (options.trace === true && action !== "doctor") {
2448
- throw new PmCliError("--trace is only valid with --doctor.", EXIT_CODE.USAGE);
2449
- }
2450
- if (options.watch === true && action !== "reload") {
2451
- throw new PmCliError("--watch is only valid with --reload.", EXIT_CODE.USAGE);
2452
- }
2453
- if (options.runtimeProbe === true && action !== "manage") {
2454
- throw new PmCliError("--runtime-probe is only valid with --manage.", EXIT_CODE.USAGE);
2505
+ function assertExtensionActionOptionScope(action, options) {
2506
+ const guards = [
2507
+ {
2508
+ triggered: options.strictExit === true || options.failOnWarn === true,
2509
+ allowed: action === "doctor",
2510
+ message: "--strict-exit and --fail-on-warn are only valid with --doctor."
2511
+ },
2512
+ { triggered: options.trace === true, allowed: action === "doctor", message: "--trace is only valid with --doctor." },
2513
+ { triggered: options.watch === true, allowed: action === "reload", message: "--watch is only valid with --reload." },
2514
+ {
2515
+ triggered: options.runtimeProbe === true,
2516
+ allowed: action === "manage",
2517
+ message: "--runtime-probe is only valid with --manage."
2518
+ },
2519
+ {
2520
+ triggered: options.fixManagedState === true,
2521
+ allowed: action === "manage" || action === "doctor",
2522
+ message: "--fix-managed-state is only valid with --manage or --doctor."
2523
+ },
2524
+ {
2525
+ triggered: options.capability !== void 0,
2526
+ allowed: action === "init",
2527
+ message: "--capability is only valid with --init/--scaffold."
2528
+ },
2529
+ {
2530
+ triggered: options.declarative === true,
2531
+ allowed: action === "init",
2532
+ message: "--declarative is only valid with --init/--scaffold."
2533
+ }
2534
+ ];
2535
+ for (const guard of guards) {
2536
+ if (guard.triggered && !guard.allowed) {
2537
+ throw new PmCliError(guard.message, EXIT_CODE.USAGE);
2538
+ }
2539
+ }
2540
+ }
2541
+ function resolveNormalizedExtensionTarget(target, action, options) {
2542
+ const normalizedInput = target?.trim().toLowerCase();
2543
+ if (action === "doctor" && normalizedInput === "doctor") {
2544
+ return void 0;
2455
2545
  }
2456
- if (options.fixManagedState === true && action !== "manage" && action !== "doctor") {
2457
- throw new PmCliError("--fix-managed-state is only valid with --manage or --doctor.", EXIT_CODE.USAGE);
2546
+ if (action === "reload" && normalizedInput === "reload") {
2547
+ return void 0;
2458
2548
  }
2459
- if (options.capability !== void 0 && action !== "init") {
2460
- throw new PmCliError("--capability is only valid with --init/--scaffold.", EXIT_CODE.USAGE);
2549
+ if (action === "catalog" && normalizedInput === "catalog") {
2550
+ return void 0;
2461
2551
  }
2462
- if (options.declarative === true && action !== "init") {
2463
- throw new PmCliError("--declarative is only valid with --init/--scaffold.", EXIT_CODE.USAGE);
2552
+ const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
2553
+ if (inferredInitAlias) {
2554
+ return void 0;
2464
2555
  }
2465
- const normalizedTarget = (() => {
2466
- const normalizedInput = target?.trim().toLowerCase();
2467
- if (action === "doctor" && normalizedInput === "doctor") {
2468
- return void 0;
2469
- }
2470
- if (action === "reload" && normalizedInput === "reload") {
2471
- return void 0;
2472
- }
2473
- if (action === "catalog" && normalizedInput === "catalog") {
2474
- return void 0;
2475
- }
2476
- const inferredInitAlias = action === "init" && options.init !== true && options.scaffold !== true && (normalizedInput === "init" || normalizedInput === "scaffold");
2477
- if (inferredInitAlias) {
2478
- return void 0;
2479
- }
2480
- return target;
2481
- })();
2556
+ return target;
2557
+ }
2558
+ async function runExtension(target, options, global2) {
2559
+ const action = resolveAction(target, options);
2560
+ assertExtensionActionOptionScope(action, options);
2561
+ const normalizedTarget = resolveNormalizedExtensionTarget(target, action, options);
2482
2562
  const scope = resolveScope(options);
2483
2563
  const resolvedRoots = resolveExtensionRootsForScope(scope, global2);
2484
2564
  const warnings = [];
@@ -2510,438 +2590,736 @@ async function runExtension(target, options, global2) {
2510
2590
  }
2511
2591
  return result;
2512
2592
  };
2513
- if (action === "init") {
2514
- const githubOption = resolveGithubOption(options);
2515
- if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
2516
- throw new PmCliError('Action "init" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
2517
- }
2518
- const scaffoldTarget = requireTarget(normalizedTarget, action, options);
2519
- const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension", options.capability, options.declarative === true);
2520
- const quotedTargetPath = JSON.stringify(scaffold.target_path);
2521
- const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
2522
- return withResult({
2523
- scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
2524
- extension: {
2525
- name: scaffold.extension_name,
2526
- command: scaffold.command_name
2527
- },
2528
- capability: scaffold.capability,
2529
- style: scaffold.style,
2530
- target_path: scaffold.target_path,
2531
- created_directory: scaffold.created_directory,
2532
- files: scaffold.files,
2533
- next_steps: [
2534
- // Extensions are authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):
2535
- // the manifest entry is ./index.ts and pm strips types on load (Node
2536
- // >=22.18), so there is no compile/build step — install dependencies, then
2537
- // install the scaffold directly.
2538
- ...options.vocabulary === "package" ? [`Install dependencies: cd ${quotedShellTargetPath}, then run "npm install"`] : [
2539
- `Install type-check dependencies: cd ${quotedShellTargetPath}, then run "npm install -D typescript @types/node @unbrained/pm-cli"`
2540
- ],
2541
- `Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
2542
- `Smoke-test command path: pm ${scaffold.command_name}`,
2543
- ...options.vocabulary === "package" ? [`Validate the package: cd ${quotedShellTargetPath}, then run "npm run typecheck" and "npm test"`] : [`Type-check the source (optional): cd ${quotedShellTargetPath}, then run "npx tsc --noEmit"`],
2544
- `Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
2545
- ]
2546
- });
2593
+ const ctx = {
2594
+ action,
2595
+ normalizedTarget,
2596
+ scope,
2597
+ resolvedRoots,
2598
+ warnings,
2599
+ options,
2600
+ global: global2,
2601
+ withResult
2602
+ };
2603
+ return EXTENSION_ACTION_HANDLERS[action](ctx);
2604
+ }
2605
+ async function runExtensionInitAction(ctx) {
2606
+ const { action, normalizedTarget, options, withResult } = ctx;
2607
+ const githubOption = resolveGithubOption(options);
2608
+ if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
2609
+ throw new PmCliError('Action "init" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
2610
+ }
2611
+ const scaffoldTarget = requireTarget(normalizedTarget, action, options);
2612
+ const scaffold = await scaffoldExtensionProject(scaffoldTarget, options.vocabulary ?? "extension", options.capability, options.declarative === true);
2613
+ const quotedTargetPath = JSON.stringify(scaffold.target_path);
2614
+ const quotedShellTargetPath = JSON.stringify(scaffold.target_path.replace(/\\/g, "/"));
2615
+ return withResult({
2616
+ scaffolded: scaffold.created_directory || scaffold.files.some((entry) => entry.status === "created"),
2617
+ extension: {
2618
+ name: scaffold.extension_name,
2619
+ command: scaffold.command_name
2620
+ },
2621
+ capability: scaffold.capability,
2622
+ style: scaffold.style,
2623
+ target_path: scaffold.target_path,
2624
+ created_directory: scaffold.created_directory,
2625
+ files: scaffold.files,
2626
+ next_steps: [
2627
+ // Extensions are authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):
2628
+ // the manifest entry is ./index.ts and pm strips types on load (Node
2629
+ // >=22.18), so there is no compile/build step — install dependencies, then
2630
+ // install the scaffold directly.
2631
+ ...options.vocabulary === "package" ? [`Install dependencies: cd ${quotedShellTargetPath}, then run "npm install"`] : [
2632
+ `Install type-check dependencies: cd ${quotedShellTargetPath}, then run "npm install -D typescript @types/node @unbrained/pm-cli"`
2633
+ ],
2634
+ `Install the scaffold: ${options.vocabulary === "package" ? "pm install --project" : "pm extension --install --project"} ${quotedTargetPath}`,
2635
+ `Smoke-test command path: pm ${scaffold.command_name}`,
2636
+ ...options.vocabulary === "package" ? [`Validate the package: cd ${quotedShellTargetPath}, then run "npm run typecheck" and "npm test"`] : [`Type-check the source (optional): cd ${quotedShellTargetPath}, then run "npx tsc --noEmit"`],
2637
+ `Run diagnostics: ${options.vocabulary === "package" ? "pm package doctor" : "pm extension --doctor"} --project --detail summary`
2638
+ ]
2639
+ });
2640
+ }
2641
+ async function runExtensionReloadAction(ctx) {
2642
+ const { normalizedTarget, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
2643
+ if (normalizedTarget !== void 0) {
2644
+ throw new PmCliError('Action "reload" does not accept a target argument.', EXIT_CODE.USAGE);
2547
2645
  }
2548
- if (action === "reload") {
2549
- if (normalizedTarget !== void 0) {
2550
- throw new PmCliError('Action "reload" does not accept a target argument.', EXIT_CODE.USAGE);
2551
- }
2552
- const settings = await readSettings(resolvedRoots.settings_root);
2553
- const reloadToken = nextExtensionReloadToken();
2554
- const reloaded = await loadExtensions({
2555
- pmRoot: resolvedRoots.settings_root,
2556
- settings,
2557
- cwd: process.cwd(),
2558
- noExtensions: global2.noExtensions,
2559
- reload_token: reloadToken,
2560
- cache_bust: true
2561
- });
2562
- warnings.push(...reloaded.warnings);
2563
- const activation = await activateExtensions(reloaded);
2564
- warnings.push(...activation.warnings);
2565
- const details = {
2566
- reload: {
2567
- token: reloadToken,
2568
- cache_bust: true,
2569
- watch: options.watch === true
2570
- },
2571
- loaded_count: reloaded.loaded.length,
2572
- failed_count: reloaded.failed.length,
2573
- activated_count: Math.max(0, reloaded.loaded.length - activation.failed.length),
2574
- activation_failed_count: activation.failed.length,
2575
- loaded_extensions: reloaded.loaded.map((entry) => ({
2576
- name: entry.name,
2577
- layer: entry.layer,
2578
- version: entry.version
2579
- })),
2580
- failed_extensions: reloaded.failed.map((entry) => ({
2581
- name: entry.name,
2582
- layer: entry.layer,
2583
- error: entry.error
2584
- })),
2585
- activation_failures: activation.failed.map((entry) => ({
2586
- name: entry.name,
2587
- layer: entry.layer,
2588
- error: entry.error
2589
- }))
2646
+ const settings = await readSettings(resolvedRoots.settings_root);
2647
+ const reloadToken = nextExtensionReloadToken();
2648
+ const reloaded = await loadExtensions({
2649
+ pmRoot: resolvedRoots.settings_root,
2650
+ settings,
2651
+ cwd: process.cwd(),
2652
+ noExtensions: global2.noExtensions,
2653
+ reload_token: reloadToken,
2654
+ cache_bust: true
2655
+ });
2656
+ warnings.push(...reloaded.warnings);
2657
+ const activation = await activateExtensions(reloaded);
2658
+ warnings.push(...activation.warnings);
2659
+ const details = {
2660
+ reload: {
2661
+ token: reloadToken,
2662
+ cache_bust: true,
2663
+ watch: options.watch === true
2664
+ },
2665
+ loaded_count: reloaded.loaded.length,
2666
+ failed_count: reloaded.failed.length,
2667
+ activated_count: Math.max(0, reloaded.loaded.length - activation.failed.length),
2668
+ activation_failed_count: activation.failed.length,
2669
+ loaded_extensions: reloaded.loaded.map((entry) => ({
2670
+ name: entry.name,
2671
+ layer: entry.layer,
2672
+ version: entry.version
2673
+ })),
2674
+ failed_extensions: reloaded.failed.map((entry) => ({
2675
+ name: entry.name,
2676
+ layer: entry.layer,
2677
+ error: entry.error
2678
+ })),
2679
+ activation_failures: activation.failed.map((entry) => ({
2680
+ name: entry.name,
2681
+ layer: entry.layer,
2682
+ error: entry.error
2683
+ }))
2684
+ };
2685
+ if (options.watch === true) {
2686
+ warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
2687
+ }
2688
+ return withResult(details);
2689
+ }
2690
+ async function runExtensionCatalogAction(ctx) {
2691
+ const { normalizedTarget, scope, options, global: global2, withResult } = ctx;
2692
+ if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
2693
+ throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
2694
+ }
2695
+ return withResult(await buildBundledPackageCatalog(scope, global2, options));
2696
+ }
2697
+ function buildInstallManagedSource(bundledAliasName, installSource, resolvedSource) {
2698
+ if (bundledAliasName) {
2699
+ return {
2700
+ kind: "builtin",
2701
+ input: bundledAliasName,
2702
+ location: bundledAliasName,
2703
+ name: bundledAliasName
2590
2704
  };
2591
- if (options.watch === true) {
2592
- warnings.push("extension_reload_watch_hint:watch_mode_requested_non_interactive_single_pass_only");
2593
- }
2594
- return withResult(details);
2595
2705
  }
2596
- if (action === "catalog") {
2597
- if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
2598
- throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
2599
- }
2600
- return withResult(await buildBundledPackageCatalog(scope, global2, options));
2706
+ if (installSource.kind === "local") {
2707
+ return {
2708
+ kind: "local",
2709
+ input: installSource.input,
2710
+ location: installSource.absolute_path
2711
+ };
2601
2712
  }
2602
- if (action === "install") {
2603
- const githubOption = resolveGithubOption(options);
2604
- const explicitSourceInput = githubOption ?? requireTarget(normalizedTarget, action, options);
2605
- if (typeof githubOption !== "string" && isBundledPackageInstallAllTarget(explicitSourceInput)) {
2606
- if (typeof options.ref === "string" && options.ref.trim().length > 0) {
2607
- throw new PmCliError('Action "install all" does not accept --ref.', EXIT_CODE.USAGE);
2608
- }
2609
- const aliases = await listBundledPackageAliases();
2610
- const packages = [];
2611
- for (const alias of aliases) {
2612
- packages.push({
2613
- alias,
2614
- result: await runExtension(alias, { ...options, install: true }, global2)
2615
- });
2616
- }
2617
- for (const entry of packages) {
2618
- warnings.push(...entry.result.warnings);
2619
- }
2620
- return withResult({
2621
- installed_all: true,
2622
- installed_count: packages.length,
2623
- packages: packages.map((entry) => ({
2624
- alias: entry.alias,
2625
- ok: entry.result.ok,
2626
- extension: entry.result.details.extension,
2627
- source: entry.result.details.source,
2628
- destination_path: entry.result.details.destination_path,
2629
- activated: entry.result.details.activated,
2630
- settings_changed: entry.result.details.settings_changed,
2631
- command_paths: entry.result.details.command_paths,
2632
- action_paths: entry.result.details.action_paths,
2633
- command_discovery: entry.result.details.command_discovery,
2634
- warnings: entry.result.warnings
2635
- }))
2636
- });
2713
+ if (installSource.kind === "npm") {
2714
+ return {
2715
+ kind: "npm",
2716
+ input: installSource.input,
2717
+ location: resolvedSource.resolved_subpath ?? ".",
2718
+ package: resolvedSource.npm_package,
2719
+ version: resolvedSource.npm_version
2720
+ };
2721
+ }
2722
+ return {
2723
+ kind: "github",
2724
+ input: installSource.input,
2725
+ location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
2726
+ repository: installSource.repository,
2727
+ owner: installSource.owner,
2728
+ repo: installSource.repo,
2729
+ ref: installSource.ref,
2730
+ subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
2731
+ commit: resolvedSource.commit
2732
+ };
2733
+ }
2734
+ async function performExtensionInstallUnderLock(ctx, input) {
2735
+ const { scope, resolvedRoots, warnings, global: global2, withResult } = ctx;
2736
+ const { validated, destinationDirectoryName, bundledAliasName, installSource, resolvedSource } = input;
2737
+ const settings = await readSettings(resolvedRoots.settings_root);
2738
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2739
+ warnings.push(...managedStateRead.warnings);
2740
+ const destinationDirectory = path5.join(resolvedRoots.selected_root, destinationDirectoryName);
2741
+ const destinationExists = await pathExists(destinationDirectory);
2742
+ const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
2743
+ await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
2744
+ if (!installInPlace) {
2745
+ await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
2746
+ }
2747
+ const sourceRecord = buildInstallManagedSource(bundledAliasName, installSource, resolvedSource);
2748
+ const now = nowIso();
2749
+ const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
2750
+ const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
2751
+ const managedState = upsertManagedEntry(managedStateRead.state, {
2752
+ name: validated.manifest.name,
2753
+ directory: destinationDirectoryName,
2754
+ scope,
2755
+ manifest_version: validated.manifest.version,
2756
+ manifest_entry: validated.manifest.entry,
2757
+ capabilities: [...validated.manifest.capabilities],
2758
+ installed_at: existingManagedEntry?.installed_at ?? now,
2759
+ updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
2760
+ source: sourceRecord
2761
+ });
2762
+ await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
2763
+ const activationChanged = ensureActivated(settings, validated.manifest.name);
2764
+ if (activationChanged) {
2765
+ await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
2766
+ }
2767
+ const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
2768
+ warnings.push(...refreshedInstalled.warnings);
2769
+ const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global2);
2770
+ warnings.push(...runtimeProbe.warnings);
2771
+ const installedItemTypeDefinitions = runtimeProbe.item_type_registrations.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)).flatMap((entry) => entry.types.map((type) => ({ name: type.name, folder: type.folder })));
2772
+ if (scope === "project" && installedItemTypeDefinitions.length > 0) {
2773
+ await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
2774
+ }
2775
+ const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
2776
+ const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
2777
+ const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
2778
+ return withResult({
2779
+ extension: {
2780
+ name: validated.manifest.name,
2781
+ version: validated.manifest.version,
2782
+ entry: validated.manifest.entry,
2783
+ capabilities: validated.manifest.capabilities,
2784
+ directory: destinationDirectoryName
2785
+ },
2786
+ source: sourceRecord,
2787
+ destination_path: destinationDirectory,
2788
+ overwritten: destinationExists && !installInPlace,
2789
+ installed_in_place: installInPlace,
2790
+ activated: true,
2791
+ settings_changed: activationChanged,
2792
+ runtime_activation_status: runtimeActivationStatus,
2793
+ command_paths: commandSummary.command_paths,
2794
+ action_paths: commandSummary.action_paths,
2795
+ command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
2796
+ activation_diagnostics: {
2797
+ failed_count: runtimeProbe.activation_failures.length,
2798
+ failed: runtimeProbe.activation_failures,
2799
+ installed_extension_failed: installActivationFailure ?? null
2637
2800
  }
2638
- const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
2639
- const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
2640
- const sourceInput = bundledAliasSource ?? explicitSourceInput;
2641
- const installSource = parseExtensionInstallSource(sourceInput, {
2642
- forceGithub: typeof githubOption === "string",
2643
- ref: options.ref
2644
- });
2645
- const resolvedSource = await resolveInstallSource(installSource);
2646
- try {
2647
- const validated = await validateExtensionDirectory(resolvedSource.directory);
2648
- const destinationDirectoryName = normalizeManagedDirectoryName(validated.manifest.name);
2649
- return await withExtensionInstallLock(resolvedRoots.settings_root, destinationDirectoryName, async () => {
2650
- const settings = await readSettings(resolvedRoots.settings_root);
2651
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2652
- warnings.push(...managedStateRead.warnings);
2653
- const destinationDirectory = path5.join(resolvedRoots.selected_root, destinationDirectoryName);
2654
- const destinationExists = await pathExists(destinationDirectory);
2655
- const installInPlace = await areDirectoriesEquivalent(validated.directory, destinationDirectory);
2656
- await fs5.mkdir(resolvedRoots.selected_root, { recursive: true });
2657
- if (!installInPlace) {
2658
- await copyExtensionDirectoryForInstall(validated.directory, destinationDirectory);
2659
- }
2660
- const sourceRecord = bundledAliasName ? {
2661
- kind: "builtin",
2662
- input: bundledAliasName,
2663
- location: bundledAliasName,
2664
- name: bundledAliasName
2665
- } : installSource.kind === "local" ? {
2666
- kind: "local",
2667
- input: installSource.input,
2668
- location: installSource.absolute_path
2669
- } : installSource.kind === "npm" ? {
2670
- kind: "npm",
2671
- input: installSource.input,
2672
- location: resolvedSource.resolved_subpath ?? ".",
2673
- package: resolvedSource.npm_package,
2674
- version: resolvedSource.npm_version
2675
- } : {
2676
- kind: "github",
2677
- input: installSource.input,
2678
- location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
2679
- repository: installSource.repository,
2680
- owner: installSource.owner,
2681
- repo: installSource.repo,
2682
- ref: installSource.ref,
2683
- subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
2684
- commit: resolvedSource.commit
2685
- };
2686
- const now = nowIso();
2687
- const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
2688
- const sourceUnchanged = existingManagedEntry !== void 0 && existingManagedEntry.manifest_version === validated.manifest.version && managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
2689
- const managedState = upsertManagedEntry(managedStateRead.state, {
2690
- name: validated.manifest.name,
2691
- directory: destinationDirectoryName,
2692
- scope,
2693
- manifest_version: validated.manifest.version,
2694
- manifest_entry: validated.manifest.entry,
2695
- capabilities: [...validated.manifest.capabilities],
2696
- installed_at: existingManagedEntry?.installed_at ?? now,
2697
- updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
2698
- source: sourceRecord
2699
- });
2700
- await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
2701
- const activationChanged = ensureActivated(settings, validated.manifest.name);
2702
- if (activationChanged) {
2703
- await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
2704
- }
2705
- const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
2706
- warnings.push(...refreshedInstalled.warnings);
2707
- const runtimeProbe = await probeRuntimeCommandPathsForInstall(resolvedRoots.pm_root, settings, refreshedInstalled.extensions, global2);
2708
- warnings.push(...runtimeProbe.warnings);
2709
- const installedItemTypeDefinitions = runtimeProbe.item_type_registrations.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)).flatMap((entry) => entry.types.map((type) => ({ name: type.name, folder: type.folder })));
2710
- if (scope === "project" && installedItemTypeDefinitions.length > 0) {
2711
- await ensureTypeFolderScaffold(resolvedRoots.pm_root, installedItemTypeDefinitions, warnings, "install:type-folder");
2712
- }
2713
- const commandSummary = summarizeRuntimeCommandPathsForExtension(validated.manifest.name, runtimeProbe.installed);
2714
- const installActivationFailure = findActivationFailureByName(validated.manifest.name, runtimeProbe.activation_failures, scope);
2715
- const runtimeActivationStatus = resolveInstallRuntimeActivationStatus(validated.manifest.name, scope, runtimeProbe.installed, installActivationFailure);
2716
- return withResult({
2717
- extension: {
2718
- name: validated.manifest.name,
2719
- version: validated.manifest.version,
2720
- entry: validated.manifest.entry,
2721
- capabilities: validated.manifest.capabilities,
2722
- directory: destinationDirectoryName
2723
- },
2724
- source: sourceRecord,
2725
- destination_path: destinationDirectory,
2726
- overwritten: destinationExists && !installInPlace,
2727
- installed_in_place: installInPlace,
2728
- activated: true,
2729
- settings_changed: activationChanged,
2730
- runtime_activation_status: runtimeActivationStatus,
2731
- command_paths: commandSummary.command_paths,
2732
- action_paths: commandSummary.action_paths,
2733
- command_discovery: buildInstallCommandDiscovery(validated.manifest.name, sourceRecord, commandSummary),
2734
- activation_diagnostics: {
2735
- failed_count: runtimeProbe.activation_failures.length,
2736
- failed: runtimeProbe.activation_failures,
2737
- installed_extension_failed: installActivationFailure ?? null
2738
- }
2739
- });
2801
+ });
2802
+ }
2803
+ async function runExtensionInstallAction(ctx) {
2804
+ const { action, normalizedTarget, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
2805
+ const githubOption = resolveGithubOption(options);
2806
+ const explicitSourceInput = githubOption ?? requireTarget(normalizedTarget, action, options);
2807
+ if (typeof githubOption !== "string" && isBundledPackageInstallAllTarget(explicitSourceInput)) {
2808
+ if (typeof options.ref === "string" && options.ref.trim().length > 0) {
2809
+ throw new PmCliError('Action "install all" does not accept --ref.', EXIT_CODE.USAGE);
2810
+ }
2811
+ const aliases = await listBundledPackageAliases();
2812
+ const packages = [];
2813
+ for (const alias of aliases) {
2814
+ packages.push({
2815
+ alias,
2816
+ result: await runExtension(alias, { ...options, install: true }, global2)
2740
2817
  });
2741
- } finally {
2742
- if (resolvedSource.cleanup) {
2743
- await resolvedSource.cleanup();
2744
- }
2745
2818
  }
2746
- }
2747
- if (action === "adopt-all") {
2748
- if (normalizedTarget !== void 0) {
2749
- throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
2750
- }
2751
- const githubOption = resolveGithubOption(options);
2752
- if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
2753
- throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
2754
- }
2755
- const settings = await readSettings(resolvedRoots.settings_root);
2756
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2757
- warnings.push(...managedStateRead.warnings);
2758
- const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2759
- warnings.push(...installed.warnings);
2760
- const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
2761
- const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
2762
- warnings.push(...refreshedInstalled.warnings);
2763
- const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
2764
- warnings.push(...triage.warnings);
2765
- const adoptedDetails = adoption.adopted_entries.map((entry) => {
2766
- const refreshedEntry = refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.name) === normalizeExtensionNameForMatch(entry.name) && normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory)) ?? /* c8 ignore next 3 -- fallback only matters if a manifest renames between adopt and refresh */
2767
- refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
2768
- return {
2769
- ...entry,
2770
- update_check_status: refreshedEntry?.update_check_status ?? null,
2771
- update_check_reason: refreshedEntry?.update_check_reason ?? null
2772
- };
2773
- });
2819
+ for (const entry of packages) {
2820
+ warnings.push(...entry.result.warnings);
2821
+ }
2774
2822
  return withResult({
2775
- adopted_all: adoptedDetails.length > 0,
2776
- adopted_count: adoptedDetails.length,
2777
- already_managed_count: adoption.already_managed_count,
2778
- extensions: adoptedDetails,
2779
- triage,
2780
- warning_codes: triage.warning_codes,
2781
- update_health_partial: triage.update_health_partial,
2782
- update_health_coverage: triage.update_health_coverage
2823
+ installed_all: true,
2824
+ installed_count: packages.length,
2825
+ packages: packages.map((entry) => ({
2826
+ alias: entry.alias,
2827
+ ok: entry.result.ok,
2828
+ extension: entry.result.details.extension,
2829
+ source: entry.result.details.source,
2830
+ destination_path: entry.result.details.destination_path,
2831
+ activated: entry.result.details.activated,
2832
+ settings_changed: entry.result.details.settings_changed,
2833
+ command_paths: entry.result.details.command_paths,
2834
+ action_paths: entry.result.details.action_paths,
2835
+ command_discovery: entry.result.details.command_discovery,
2836
+ warnings: entry.result.warnings
2837
+ }))
2783
2838
  });
2784
2839
  }
2785
- if (action === "adopt") {
2786
- const extensionTarget = requireTarget(normalizedTarget, action, options);
2787
- const githubOption = resolveGithubOption(options);
2788
- const settings = await readSettings(resolvedRoots.settings_root);
2789
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2790
- warnings.push(...managedStateRead.warnings);
2791
- const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2792
- warnings.push(...installed.warnings);
2793
- const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
2794
- if (!candidate) {
2795
- throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
2796
- }
2797
- if (candidate.managed) {
2798
- return withResult({
2799
- adopted: false,
2800
- already_managed: true,
2801
- extension: {
2802
- name: candidate.name,
2803
- directory: candidate.directory
2804
- }
2805
- });
2806
- }
2807
- const extensionDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
2808
- const validated = await validateExtensionDirectory(extensionDirectory);
2809
- const now = nowIso();
2810
- const sourceRecord = githubOption === void 0 ? {
2811
- kind: "local",
2812
- input: extensionTarget,
2813
- location: extensionDirectory
2814
- } : (() => {
2815
- const parsed = parseExtensionInstallSource(githubOption, {
2816
- forceGithub: true,
2817
- ref: options.ref
2818
- });
2819
- if (parsed.kind !== "github") {
2820
- throw new PmCliError(`Invalid GitHub shorthand "${githubOption}".`, EXIT_CODE.USAGE);
2821
- }
2822
- return {
2823
- kind: "github",
2824
- input: parsed.input,
2825
- location: parsed.subpath ?? ".",
2826
- repository: parsed.repository,
2827
- owner: parsed.owner,
2828
- repo: parsed.repo,
2829
- ref: parsed.ref,
2830
- subpath: parsed.subpath
2831
- };
2832
- })();
2833
- const managedState = upsertManagedEntry(managedStateRead.state, {
2834
- name: validated.manifest.name,
2835
- directory: candidate.directory,
2836
- scope,
2837
- manifest_version: validated.manifest.version,
2838
- manifest_entry: validated.manifest.entry,
2839
- capabilities: [...validated.manifest.capabilities],
2840
- installed_at: now,
2841
- updated_at: now,
2842
- source: sourceRecord
2843
- });
2844
- await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
2845
- const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
2846
- warnings.push(...refreshedInstalled.warnings);
2847
- const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
2848
- return withResult({
2849
- adopted: true,
2850
- extension: {
2851
- name: validated.manifest.name,
2852
- directory: candidate.directory,
2853
- version: validated.manifest.version,
2854
- entry: validated.manifest.entry
2855
- },
2856
- source: sourceRecord,
2840
+ const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
2841
+ const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
2842
+ const sourceInput = bundledAliasSource ?? explicitSourceInput;
2843
+ const installSource = parseExtensionInstallSource(sourceInput, {
2844
+ forceGithub: typeof githubOption === "string",
2845
+ ref: options.ref
2846
+ });
2847
+ const resolvedSource = await resolveInstallSource(installSource);
2848
+ try {
2849
+ const validated = await validateExtensionDirectory(resolvedSource.directory);
2850
+ const destinationDirectoryName = normalizeManagedDirectoryName(validated.manifest.name);
2851
+ return await withExtensionInstallLock(resolvedRoots.settings_root, destinationDirectoryName, () => performExtensionInstallUnderLock(ctx, {
2852
+ validated,
2853
+ destinationDirectoryName,
2854
+ bundledAliasName,
2855
+ installSource,
2856
+ resolvedSource
2857
+ }));
2858
+ } finally {
2859
+ if (resolvedSource.cleanup) {
2860
+ await resolvedSource.cleanup();
2861
+ }
2862
+ }
2863
+ }
2864
+ async function runExtensionAdoptAllAction(ctx) {
2865
+ const { normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
2866
+ if (normalizedTarget !== void 0) {
2867
+ throw new PmCliError('Action "adopt-all" does not accept a target argument.', EXIT_CODE.USAGE);
2868
+ }
2869
+ const githubOption = resolveGithubOption(options);
2870
+ if (githubOption !== void 0 || typeof options.ref === "string" && options.ref.trim().length > 0) {
2871
+ throw new PmCliError('Action "adopt-all" does not accept --gh/--github/--ref options.', EXIT_CODE.USAGE);
2872
+ }
2873
+ const settings = await readSettings(resolvedRoots.settings_root);
2874
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2875
+ warnings.push(...managedStateRead.warnings);
2876
+ const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2877
+ warnings.push(...installed.warnings);
2878
+ const adoption = await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state);
2879
+ const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, adoption.state);
2880
+ warnings.push(...refreshedInstalled.warnings);
2881
+ const triage = buildExtensionTriageSummary(scope, warnings, refreshedInstalled.extensions, options);
2882
+ warnings.push(...triage.warnings);
2883
+ const adoptedDetails = adoption.adopted_entries.map((entry) => {
2884
+ const refreshedEntry = refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.name) === normalizeExtensionNameForMatch(entry.name) && normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory)) ?? /* c8 ignore next 3 -- fallback only matters if a manifest renames between adopt and refresh */
2885
+ refreshedInstalled.extensions.find((candidate) => normalizeExtensionNameForMatch(candidate.directory) === normalizeExtensionNameForMatch(entry.directory));
2886
+ return {
2887
+ ...entry,
2857
2888
  update_check_status: refreshedEntry?.update_check_status ?? null,
2858
2889
  update_check_reason: refreshedEntry?.update_check_reason ?? null
2859
- });
2860
- }
2861
- if (action === "uninstall") {
2862
- const extensionTarget = requireTarget(normalizedTarget, action, options);
2863
- const settings = await readSettings(resolvedRoots.settings_root);
2864
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2865
- warnings.push(...managedStateRead.warnings);
2866
- const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2867
- warnings.push(...installed.warnings);
2868
- const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
2869
- if (!candidate) {
2870
- throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
2871
- }
2872
- const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
2873
- await fs5.rm(destinationDirectory, { recursive: true, force: true });
2874
- const updatedState = {
2875
- ...managedStateRead.state,
2876
- updated_at: nowIso(),
2877
- /* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
2878
- entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
2879
- /* c8 ignore stop */
2880
2890
  };
2881
- await writeManagedExtensionState(resolvedRoots.selected_root, updatedState);
2882
- const stateChanged = clearExtensionState(settings, candidate.name);
2883
- if (stateChanged) {
2884
- await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
2885
- }
2891
+ });
2892
+ return withResult({
2893
+ adopted_all: adoptedDetails.length > 0,
2894
+ adopted_count: adoptedDetails.length,
2895
+ already_managed_count: adoption.already_managed_count,
2896
+ extensions: adoptedDetails,
2897
+ triage,
2898
+ warning_codes: triage.warning_codes,
2899
+ update_health_partial: triage.update_health_partial,
2900
+ update_health_coverage: triage.update_health_coverage
2901
+ });
2902
+ }
2903
+ async function runExtensionAdoptAction(ctx) {
2904
+ const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
2905
+ const extensionTarget = requireTarget(normalizedTarget, action, options);
2906
+ const githubOption = resolveGithubOption(options);
2907
+ const settings = await readSettings(resolvedRoots.settings_root);
2908
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2909
+ warnings.push(...managedStateRead.warnings);
2910
+ const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2911
+ warnings.push(...installed.warnings);
2912
+ const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
2913
+ if (!candidate) {
2914
+ throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
2915
+ }
2916
+ if (candidate.managed) {
2886
2917
  return withResult({
2887
- removed: true,
2918
+ adopted: false,
2919
+ already_managed: true,
2888
2920
  extension: {
2889
2921
  name: candidate.name,
2890
2922
  directory: candidate.directory
2891
- },
2892
- destination_path: destinationDirectory,
2893
- settings_changed: stateChanged
2923
+ }
2894
2924
  });
2895
2925
  }
2896
- if (action === "activate" || action === "deactivate") {
2897
- const extensionTarget = requireTarget(normalizedTarget, action, options);
2898
- const settings = await readSettings(resolvedRoots.settings_root);
2899
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2900
- warnings.push(...managedStateRead.warnings);
2901
- const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2902
- warnings.push(...installed.warnings);
2903
- const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
2904
- if (!candidate) {
2905
- throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
2906
- }
2907
- const settingsChanged = action === "activate" ? ensureActivated(settings, candidate.name) : ensureDeactivated(settings, candidate.name);
2908
- if (settingsChanged) {
2909
- await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
2926
+ const extensionDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
2927
+ const validated = await validateExtensionDirectory(extensionDirectory);
2928
+ const now = nowIso();
2929
+ const sourceRecord = githubOption === void 0 ? {
2930
+ kind: "local",
2931
+ input: extensionTarget,
2932
+ location: extensionDirectory
2933
+ } : (() => {
2934
+ const parsed = parseExtensionInstallSource(githubOption, {
2935
+ forceGithub: true,
2936
+ ref: options.ref
2937
+ });
2938
+ if (parsed.kind !== "github") {
2939
+ throw new PmCliError(`Invalid GitHub shorthand "${githubOption}".`, EXIT_CODE.USAGE);
2910
2940
  }
2911
- return withResult({
2912
- extension: {
2913
- name: candidate.name,
2914
- directory: candidate.directory
2941
+ return {
2942
+ kind: "github",
2943
+ input: parsed.input,
2944
+ location: parsed.subpath ?? ".",
2945
+ repository: parsed.repository,
2946
+ owner: parsed.owner,
2947
+ repo: parsed.repo,
2948
+ ref: parsed.ref,
2949
+ subpath: parsed.subpath
2950
+ };
2951
+ })();
2952
+ const managedState = upsertManagedEntry(managedStateRead.state, {
2953
+ name: validated.manifest.name,
2954
+ directory: candidate.directory,
2955
+ scope,
2956
+ manifest_version: validated.manifest.version,
2957
+ manifest_entry: validated.manifest.entry,
2958
+ capabilities: [...validated.manifest.capabilities],
2959
+ installed_at: now,
2960
+ updated_at: now,
2961
+ source: sourceRecord
2962
+ });
2963
+ await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
2964
+ const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
2965
+ warnings.push(...refreshedInstalled.warnings);
2966
+ const refreshedEntry = refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name)) ?? refreshedInstalled.extensions.find((entry) => normalizeExtensionNameForMatch(entry.directory) === normalizeExtensionNameForMatch(candidate.directory));
2967
+ return withResult({
2968
+ adopted: true,
2969
+ extension: {
2970
+ name: validated.manifest.name,
2971
+ directory: candidate.directory,
2972
+ version: validated.manifest.version,
2973
+ entry: validated.manifest.entry
2974
+ },
2975
+ source: sourceRecord,
2976
+ update_check_status: refreshedEntry?.update_check_status ?? null,
2977
+ update_check_reason: refreshedEntry?.update_check_reason ?? null
2978
+ });
2979
+ }
2980
+ async function runExtensionUninstallAction(ctx) {
2981
+ const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
2982
+ const extensionTarget = requireTarget(normalizedTarget, action, options);
2983
+ const settings = await readSettings(resolvedRoots.settings_root);
2984
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2985
+ warnings.push(...managedStateRead.warnings);
2986
+ const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2987
+ warnings.push(...installed.warnings);
2988
+ const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
2989
+ if (!candidate) {
2990
+ throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
2991
+ }
2992
+ const destinationDirectory = path5.join(resolvedRoots.selected_root, candidate.directory);
2993
+ await fs5.rm(destinationDirectory, { recursive: true, force: true });
2994
+ const updatedState = {
2995
+ ...managedStateRead.state,
2996
+ updated_at: nowIso(),
2997
+ /* c8 ignore start -- uninstall filter keeps both name+directory guards for legacy managed-state migrations */
2998
+ entries: managedStateRead.state.entries.filter((entry) => normalizeExtensionNameForMatch(entry.name) !== normalizeExtensionNameForMatch(candidate.name) && normalizeExtensionNameForMatch(entry.directory) !== normalizeExtensionNameForMatch(candidate.directory))
2999
+ /* c8 ignore stop */
3000
+ };
3001
+ await writeManagedExtensionState(resolvedRoots.selected_root, updatedState);
3002
+ const stateChanged = clearExtensionState(settings, candidate.name);
3003
+ if (stateChanged) {
3004
+ await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
3005
+ }
3006
+ return withResult({
3007
+ removed: true,
3008
+ extension: {
3009
+ name: candidate.name,
3010
+ directory: candidate.directory
3011
+ },
3012
+ destination_path: destinationDirectory,
3013
+ settings_changed: stateChanged
3014
+ });
3015
+ }
3016
+ async function runExtensionActivateDeactivateAction(ctx) {
3017
+ const { action, normalizedTarget, scope, resolvedRoots, warnings, options, withResult } = ctx;
3018
+ const extensionTarget = requireTarget(normalizedTarget, action, options);
3019
+ const settings = await readSettings(resolvedRoots.settings_root);
3020
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
3021
+ warnings.push(...managedStateRead.warnings);
3022
+ const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
3023
+ warnings.push(...installed.warnings);
3024
+ const candidate = await resolveInstalledExtensionCandidate(installed.extensions, extensionTarget);
3025
+ if (!candidate) {
3026
+ throw new PmCliError(`Installed extension "${extensionTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
3027
+ }
3028
+ const settingsChanged = action === "activate" ? ensureActivated(settings, candidate.name) : ensureDeactivated(settings, candidate.name);
3029
+ if (settingsChanged) {
3030
+ await writeSettings(resolvedRoots.settings_root, settings, "settings:write");
3031
+ }
3032
+ return withResult({
3033
+ extension: {
3034
+ name: candidate.name,
3035
+ directory: candidate.directory
3036
+ },
3037
+ active: action === "activate",
3038
+ settings_changed: settingsChanged,
3039
+ settings: {
3040
+ enabled: [...settings.extensions.enabled],
3041
+ disabled: [...settings.extensions.disabled]
3042
+ }
3043
+ });
3044
+ }
3045
+ function buildDoctorRemediation(baseRemediation, loadFailureCount, activationFailureCount, vocabulary, managedStateFix) {
3046
+ return [
3047
+ ...new Set([
3048
+ ...baseRemediation,
3049
+ /* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
3050
+ ...loadFailureCount > 0 ? [
3051
+ vocabulary === "package" ? "Run pm package explore --project and pm package explore --global to inspect load failures." : "Run pm extension --explore --project and pm extension --explore --global to inspect load failures."
3052
+ ] : [],
3053
+ ...activationFailureCount > 0 ? [
3054
+ vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
3055
+ ] : [],
3056
+ /* c8 ignore stop */
3057
+ ...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
3058
+ ].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
3059
+ ];
3060
+ }
3061
+ async function runExtensionDoctorAction(ctx) {
3062
+ const { normalizedTarget, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
3063
+ if (normalizedTarget && normalizedTarget.trim().length > 0) {
3064
+ throw new PmCliError('Action "doctor" does not accept a target argument.', EXIT_CODE.USAGE);
3065
+ }
3066
+ const detailMode = parseDoctorDetailMode(options.detail);
3067
+ const includeTrace = options.trace === true;
3068
+ if (includeTrace && detailMode !== "deep") {
3069
+ throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
3070
+ }
3071
+ const settings = await readSettings(resolvedRoots.settings_root);
3072
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
3073
+ warnings.push(...managedStateRead.warnings);
3074
+ const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
3075
+ warnings.push(...installed.warnings);
3076
+ let managedState = managedStateRead.state;
3077
+ const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
3078
+ if (managedStateFix) {
3079
+ managedState = managedStateFix.state;
3080
+ }
3081
+ const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
3082
+ warnings.push(...refreshedInstalled.warnings);
3083
+ const loadResult = await loadExtensions({
3084
+ pmRoot: resolvedRoots.pm_root,
3085
+ settings,
3086
+ cwd: process.cwd(),
3087
+ noExtensions: global2.noExtensions === true
3088
+ });
3089
+ const activationResult = await activateExtensions({
3090
+ ...loadResult,
3091
+ loaded: loadResult.loaded
3092
+ });
3093
+ warnings.push(...loadResult.warnings);
3094
+ warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
3095
+ warnings.push(...activationResult.warnings);
3096
+ warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
3097
+ warnings.push(...classifyUnusedCapabilityWarnings(loadResult, activationResult));
3098
+ warnings.push(...collectGlobalOutputOverrideDoctorWarnings(activationResult));
3099
+ warnings.push(...collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult));
3100
+ const runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
3101
+ const doctorConsistency = buildDoctorConsistencySummary(scope, runtimeInstalledExtensions, loadResult.loaded.map((entry) => ({ layer: entry.layer, name: entry.name })), loadResult.failed.map((entry) => ({ name: entry.name })), loadResult.disabled_by_flag);
3102
+ warnings.push(...doctorConsistency.warnings);
3103
+ const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
3104
+ warnings.push(...updateCheckWarnings);
3105
+ const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
3106
+ warnings.push(...triage.warnings);
3107
+ const normalizedWarnings = [...triage.warnings];
3108
+ const policySummary = {
3109
+ mode: loadResult.policy.mode,
3110
+ trust_mode: loadResult.policy.trust_mode,
3111
+ require_provenance: loadResult.policy.require_provenance,
3112
+ default_sandbox_profile: loadResult.policy.default_sandbox_profile,
3113
+ // Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
3114
+ sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
3115
+ trusted_extensions_count: loadResult.policy.trusted_extensions.length,
3116
+ allowed_extensions_count: loadResult.policy.allowed_extensions.length,
3117
+ blocked_extensions_count: loadResult.policy.blocked_extensions.length,
3118
+ allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
3119
+ blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
3120
+ allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
3121
+ blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
3122
+ allowed_commands_count: loadResult.policy.allowed_commands.length,
3123
+ blocked_commands_count: loadResult.policy.blocked_commands.length,
3124
+ allowed_actions_count: loadResult.policy.allowed_actions.length,
3125
+ blocked_actions_count: loadResult.policy.blocked_actions.length,
3126
+ allowed_services_count: loadResult.policy.allowed_services.length,
3127
+ blocked_services_count: loadResult.policy.blocked_services.length,
3128
+ extension_override_count: loadResult.policy.extension_overrides.length
3129
+ };
3130
+ const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
3131
+ const capabilityContract = buildCapabilityContractMetadata();
3132
+ const warningCodes = triage.warning_codes;
3133
+ const remediation = buildDoctorRemediation(triage.remediation, loadResult.failed.length, activationResult.failed.length, options.vocabulary, managedStateFix);
3134
+ const summary = {
3135
+ status: triage.status,
3136
+ scope,
3137
+ warning_count: triage.warning_count,
3138
+ warning_codes: warningCodes,
3139
+ total_extensions: runtimeInstalledExtensions.length,
3140
+ managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
3141
+ enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
3142
+ active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
3143
+ unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
3144
+ unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
3145
+ unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
3146
+ runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
3147
+ activation_status_totals: {
3148
+ ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
3149
+ failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
3150
+ not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
3151
+ unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
3152
+ },
3153
+ unknown_capability_count: capabilityGuidance.length,
3154
+ capability_contract_version: capabilityContract.version,
3155
+ update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
3156
+ update_health_coverage: triage.update_health_coverage,
3157
+ update_health_partial: triage.update_health_partial,
3158
+ update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
3159
+ load_failure_count: loadResult.failed.length,
3160
+ activation_failure_count: activationResult.failed.length,
3161
+ blocking_failure_count: loadResult.failed.length + activationResult.failed.length,
3162
+ has_blocking_failures: loadResult.failed.length + activationResult.failed.length > 0,
3163
+ consistency_warning_count: doctorConsistency.warnings.length,
3164
+ trace_enabled: includeTrace,
3165
+ policy: policySummary,
3166
+ remediation
3167
+ };
3168
+ const managedStateFixSummary = managedStateFix ? {
3169
+ requested: true,
3170
+ applied: managedStateFix.adopted_entries.length > 0,
3171
+ adopted_count: managedStateFix.adopted_entries.length,
3172
+ already_managed_count: managedStateFix.already_managed_count,
3173
+ adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name)
3174
+ } : {
3175
+ requested: false,
3176
+ applied: false,
3177
+ adopted_count: 0,
3178
+ already_managed_count: refreshedInstalled.extensions.filter((entry) => entry.managed).length,
3179
+ adopted_extensions: []
3180
+ };
3181
+ const details = {
3182
+ mode: detailMode,
3183
+ summary,
3184
+ triage,
3185
+ trace_enabled: includeTrace,
3186
+ capability_contract: capabilityContract,
3187
+ capability_guidance: capabilityGuidance,
3188
+ managed_state_fix: managedStateFixSummary,
3189
+ policy: loadResult.policy
3190
+ };
3191
+ if (detailMode === "deep") {
3192
+ const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
3193
+ const { trace: _trace, ...rest } = entry;
3194
+ return rest;
3195
+ });
3196
+ details.deep = {
3197
+ warnings: normalizedWarnings,
3198
+ warning_codes: warningCodes,
3199
+ capability_contract: capabilityContract,
3200
+ capability_guidance: capabilityGuidance,
3201
+ trace_enabled: includeTrace,
3202
+ managed_state: {
3203
+ path: managedStateRead.path,
3204
+ count: managedState.entries.length,
3205
+ entries: managedState.entries
2915
3206
  },
2916
- active: action === "activate",
2917
- settings_changed: settingsChanged,
2918
- settings: {
2919
- enabled: [...settings.extensions.enabled],
2920
- disabled: [...settings.extensions.disabled]
3207
+ installed_extensions: runtimeInstalledExtensions,
3208
+ load: {
3209
+ roots: loadResult.roots,
3210
+ policy: loadResult.policy,
3211
+ warnings: loadResult.warnings,
3212
+ failed: loadResult.failed,
3213
+ loaded: loadResult.loaded.map((entry) => ({
3214
+ layer: entry.layer,
3215
+ directory: entry.directory,
3216
+ name: entry.name,
3217
+ version: entry.version,
3218
+ entry: entry.entry,
3219
+ priority: entry.priority
3220
+ }))
3221
+ },
3222
+ activation: {
3223
+ failed: activationFailedDetails,
3224
+ warnings: activationResult.warnings,
3225
+ hook_counts: activationResult.hook_counts,
3226
+ registration_counts: activationResult.registration_counts,
3227
+ parser_override_count: activationResult.parser_override_count,
3228
+ preflight_override_count: activationResult.preflight_override_count,
3229
+ service_override_count: activationResult.service_override_count,
3230
+ renderer_override_count: activationResult.renderer_override_count
3231
+ },
3232
+ consistency: doctorConsistency.summary
3233
+ };
3234
+ if (includeTrace) {
3235
+ details.deep.trace = {
3236
+ activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
3237
+ layer: entry.layer,
3238
+ name: entry.name,
3239
+ entry_path: entry.entry_path,
3240
+ error: entry.error,
3241
+ method: entry.trace?.method,
3242
+ command: entry.trace?.command,
3243
+ capability: entry.trace?.capability,
3244
+ missing_capability: entry.trace?.missing_capability,
3245
+ registration_index: entry.trace?.registration_index,
3246
+ expected_schema: entry.trace?.expected_schema,
3247
+ hint: entry.trace?.hint,
3248
+ received: entry.trace?.received
3249
+ }))
3250
+ };
3251
+ }
3252
+ }
3253
+ return withResult(details);
3254
+ }
3255
+ async function runExtensionDescribeAction(ctx) {
3256
+ const { normalizedTarget, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
3257
+ const settings = await readSettings(resolvedRoots.settings_root);
3258
+ const loadResult = await loadExtensions({
3259
+ pmRoot: resolvedRoots.pm_root,
3260
+ settings,
3261
+ cwd: process.cwd(),
3262
+ noExtensions: global2.noExtensions === true
3263
+ });
3264
+ const activationResult = await activateExtensions(loadResult);
3265
+ warnings.push(...loadResult.warnings);
3266
+ warnings.push(...activationResult.warnings);
3267
+ const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
3268
+ if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
3269
+ const noun = options.vocabulary === "package" ? "package" : "extension";
3270
+ throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
3271
+ }
3272
+ return withResult({
3273
+ target: describeResult.target,
3274
+ total: describeResult.total,
3275
+ extensions: describeResult.extensions,
3276
+ union: describeResult.union
3277
+ });
3278
+ }
3279
+ async function runExtensionExploreManageAction(ctx) {
3280
+ const { action, scope, resolvedRoots, warnings, options, global: global2, withResult } = ctx;
3281
+ const settings = await readSettings(resolvedRoots.settings_root);
3282
+ const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
3283
+ const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
3284
+ warnings.push(...managedStateRead.warnings);
3285
+ const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
3286
+ warnings.push(...installed.warnings);
3287
+ let managedState = managedStateRead.state;
3288
+ const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
3289
+ if (managedStateFix) {
3290
+ managedState = managedStateFix.state;
3291
+ }
3292
+ if (action === "manage") {
3293
+ const updates = await Promise.all(managedState.entries.map(async (entry) => {
3294
+ if (entry.source.kind !== "github") {
3295
+ return entry;
2921
3296
  }
2922
- });
3297
+ const updateStatus = await checkGithubUpdate(entry.source);
3298
+ return {
3299
+ ...entry,
3300
+ last_update_check_at: updateStatus.checked_at,
3301
+ last_update_remote_commit: updateStatus.remote_commit,
3302
+ update_available: updateStatus.available,
3303
+ update_error: updateStatus.error
3304
+ };
3305
+ }));
3306
+ managedState = {
3307
+ ...managedState,
3308
+ updated_at: nowIso(),
3309
+ entries: sortManagedEntries(updates)
3310
+ };
3311
+ await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
3312
+ }
3313
+ const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
3314
+ warnings.push(...refreshedInstalled.warnings);
3315
+ if (action === "manage") {
3316
+ const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
3317
+ warnings.push(...updateWarnings);
2923
3318
  }
2924
- if (action === "doctor") {
2925
- if (normalizedTarget && normalizedTarget.trim().length > 0) {
2926
- throw new PmCliError('Action "doctor" does not accept a target argument.', EXIT_CODE.USAGE);
2927
- }
2928
- const detailMode = parseDoctorDetailMode(options.detail);
2929
- const includeTrace = options.trace === true;
2930
- if (includeTrace && detailMode !== "deep") {
2931
- throw new PmCliError("--trace requires --detail deep with --doctor.", EXIT_CODE.USAGE);
2932
- }
2933
- const settings = await readSettings(resolvedRoots.settings_root);
2934
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
2935
- warnings.push(...managedStateRead.warnings);
2936
- const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
2937
- warnings.push(...installed.warnings);
2938
- let managedState = managedStateRead.state;
2939
- const managedStateFix = options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
2940
- if (managedStateFix) {
2941
- managedState = managedStateFix.state;
2942
- }
2943
- const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
2944
- warnings.push(...refreshedInstalled.warnings);
3319
+ let runtimeProbeSummary;
3320
+ let runtimeInstalledExtensions = refreshedInstalled.extensions;
3321
+ let runtimeActivationFailures;
3322
+ if (action === "explore" || options.runtimeProbe === true) {
2945
3323
  const loadResult = await loadExtensions({
2946
3324
  pmRoot: resolvedRoots.pm_root,
2947
3325
  settings,
@@ -2953,315 +3331,77 @@ async function runExtension(target, options, global2) {
2953
3331
  loaded: loadResult.loaded
2954
3332
  });
2955
3333
  warnings.push(...loadResult.warnings);
2956
- warnings.push(...classifyDoctorLoadFailureWarnings(loadResult.failed));
2957
3334
  warnings.push(...activationResult.warnings);
2958
- warnings.push(...classifyDoctorActivationFailureWarnings(activationResult.failed));
2959
- warnings.push(...classifyUnusedCapabilityWarnings(loadResult, activationResult));
2960
- warnings.push(...collectGlobalOutputOverrideDoctorWarnings(activationResult));
2961
- warnings.push(...collectSchemaNarrowActivationDoctorWarnings(loadResult, activationResult));
2962
- const runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
2963
- const doctorConsistency = buildDoctorConsistencySummary(scope, runtimeInstalledExtensions, loadResult.loaded.map((entry) => ({ layer: entry.layer, name: entry.name })), loadResult.failed.map((entry) => ({ name: entry.name })), loadResult.disabled_by_flag);
2964
- warnings.push(...doctorConsistency.warnings);
2965
- const updateCheckWarnings = runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
2966
- warnings.push(...updateCheckWarnings);
2967
- const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
2968
- warnings.push(...triage.warnings);
2969
- const normalizedWarnings = [...triage.warnings];
2970
- const policySummary = {
2971
- mode: loadResult.policy.mode,
2972
- trust_mode: loadResult.policy.trust_mode,
2973
- require_provenance: loadResult.policy.require_provenance,
2974
- default_sandbox_profile: loadResult.policy.default_sandbox_profile,
2975
- // Honest trust model (ADR pm-6ef3): keep this caveat to one concise line.
2976
- sandbox_enforcement: "advisory: sandbox_profile/permissions are declaration-based load gates, not runtime isolation (ADR pm-6ef3)",
2977
- trusted_extensions_count: loadResult.policy.trusted_extensions.length,
2978
- allowed_extensions_count: loadResult.policy.allowed_extensions.length,
2979
- blocked_extensions_count: loadResult.policy.blocked_extensions.length,
2980
- allowed_capabilities_count: loadResult.policy.allowed_capabilities.length,
2981
- blocked_capabilities_count: loadResult.policy.blocked_capabilities.length,
2982
- allowed_surfaces_count: loadResult.policy.allowed_surfaces.length,
2983
- blocked_surfaces_count: loadResult.policy.blocked_surfaces.length,
2984
- allowed_commands_count: loadResult.policy.allowed_commands.length,
2985
- blocked_commands_count: loadResult.policy.blocked_commands.length,
2986
- allowed_actions_count: loadResult.policy.allowed_actions.length,
2987
- blocked_actions_count: loadResult.policy.blocked_actions.length,
2988
- allowed_services_count: loadResult.policy.allowed_services.length,
2989
- blocked_services_count: loadResult.policy.blocked_services.length,
2990
- extension_override_count: loadResult.policy.extension_overrides.length
2991
- };
2992
- const capabilityGuidance = collectUnknownCapabilityGuidance(normalizedWarnings);
2993
- const capabilityContract = buildCapabilityContractMetadata();
2994
- const warningCodes = triage.warning_codes;
2995
- const remediation = [
2996
- ...new Set([
2997
- ...triage.remediation,
2998
- /* c8 ignore start -- vocabulary-specific remediation branches are copy-only variants */
2999
- ...loadResult.failed.length > 0 ? [
3000
- options.vocabulary === "package" ? "Run pm package explore --project and pm package explore --global to inspect load failures." : "Run pm extension --explore --project and pm extension --explore --global to inspect load failures."
3001
- ] : [],
3002
- ...activationResult.failed.length > 0 ? [
3003
- options.vocabulary === "package" ? "Review activation failures in pm package doctor --detail deep output." : "Review activation failures in pm extension --doctor --detail deep output."
3004
- ] : [],
3005
- /* c8 ignore stop */
3006
- ...managedStateFix && managedStateFix.adopted_entries.length > 0 ? [`Managed-state fix adopted ${managedStateFix.adopted_entries.length} extension(s).`] : []
3007
- ].map((entry) => entry.trim()).filter((entry) => entry.length > 0))
3008
- ];
3009
- const summary = {
3010
- status: triage.status,
3011
- scope,
3012
- warning_count: triage.warning_count,
3013
- warning_codes: warningCodes,
3014
- total_extensions: runtimeInstalledExtensions.length,
3015
- managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
3016
- enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
3017
- active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
3018
- unmanaged_loaded_extension_count: triage.unmanaged_loaded_extension_count,
3019
- unmanaged_action_required_extension_count: triage.unmanaged_action_required_extension_count,
3020
- unmanaged_expected_extension_count: triage.unmanaged_expected_extension_count,
3021
- runtime_active_total: runtimeInstalledExtensions.filter((entry) => entry.runtime_active === true).length,
3022
- activation_status_totals: {
3023
- ok: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "ok").length,
3024
- failed: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "failed").length,
3025
- not_loaded: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "not_loaded").length,
3026
- unknown: runtimeInstalledExtensions.filter((entry) => entry.activation_status === "unknown").length
3027
- },
3028
- unknown_capability_count: capabilityGuidance.length,
3029
- capability_contract_version: capabilityContract.version,
3030
- update_available_total: runtimeInstalledExtensions.filter((entry) => entry.update_available === true).length,
3031
- update_health_coverage: triage.update_health_coverage,
3032
- update_health_partial: triage.update_health_partial,
3033
- update_check_failed_total: runtimeInstalledExtensions.filter((entry) => entry.update_check_status === "failed").length,
3335
+ runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
3336
+ runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
3337
+ runtimeProbeSummary = {
3338
+ requested: true,
3339
+ executed: true,
3340
+ reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
3034
3341
  load_failure_count: loadResult.failed.length,
3035
3342
  activation_failure_count: activationResult.failed.length,
3036
- blocking_failure_count: loadResult.failed.length + activationResult.failed.length,
3037
- has_blocking_failures: loadResult.failed.length + activationResult.failed.length > 0,
3038
- consistency_warning_count: doctorConsistency.warnings.length,
3039
- trace_enabled: includeTrace,
3040
- policy: policySummary,
3041
- remediation
3343
+ warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
3344
+ policy: loadResult.policy
3042
3345
  };
3043
- const managedStateFixSummary = managedStateFix ? {
3346
+ } else if (action === "manage") {
3347
+ runtimeProbeSummary = {
3348
+ requested: false,
3349
+ executed: false
3350
+ };
3351
+ }
3352
+ const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
3353
+ warnings.push(...triage.warnings);
3354
+ const details = {
3355
+ total: runtimeInstalledExtensions.length,
3356
+ managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
3357
+ enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
3358
+ active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
3359
+ extensions: runtimeInstalledExtensions,
3360
+ triage,
3361
+ policy: configuredPolicy
3362
+ };
3363
+ if (runtimeActivationFailures !== void 0) {
3364
+ details.activation_diagnostics = {
3365
+ failed_count: runtimeActivationFailures.length,
3366
+ failed: runtimeActivationFailures
3367
+ };
3368
+ }
3369
+ if (action === "explore") {
3370
+ details.runtime_probe = runtimeProbeSummary;
3371
+ }
3372
+ if (action === "manage") {
3373
+ details.runtime_probe = runtimeProbeSummary;
3374
+ details.managed_state_fix = managedStateFix !== null ? {
3044
3375
  requested: true,
3045
3376
  applied: managedStateFix.adopted_entries.length > 0,
3046
3377
  adopted_count: managedStateFix.adopted_entries.length,
3047
- already_managed_count: managedStateFix.already_managed_count,
3048
- adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name)
3378
+ adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
3379
+ already_managed_count: managedStateFix.already_managed_count
3049
3380
  } : {
3050
3381
  requested: false,
3051
3382
  applied: false,
3052
3383
  adopted_count: 0,
3053
- already_managed_count: refreshedInstalled.extensions.filter((entry) => entry.managed).length,
3054
- adopted_extensions: []
3055
- };
3056
- const details = {
3057
- mode: detailMode,
3058
- summary,
3059
- triage,
3060
- trace_enabled: includeTrace,
3061
- capability_contract: capabilityContract,
3062
- capability_guidance: capabilityGuidance,
3063
- managed_state_fix: managedStateFixSummary,
3064
- policy: loadResult.policy
3065
- };
3066
- if (detailMode === "deep") {
3067
- const activationFailedDetails = includeTrace ? activationResult.failed : activationResult.failed.map((entry) => {
3068
- const { trace: _trace, ...rest } = entry;
3069
- return rest;
3070
- });
3071
- details.deep = {
3072
- warnings: normalizedWarnings,
3073
- warning_codes: warningCodes,
3074
- capability_contract: capabilityContract,
3075
- capability_guidance: capabilityGuidance,
3076
- trace_enabled: includeTrace,
3077
- managed_state: {
3078
- path: managedStateRead.path,
3079
- count: managedState.entries.length,
3080
- entries: managedState.entries
3081
- },
3082
- installed_extensions: runtimeInstalledExtensions,
3083
- load: {
3084
- roots: loadResult.roots,
3085
- policy: loadResult.policy,
3086
- warnings: loadResult.warnings,
3087
- failed: loadResult.failed,
3088
- loaded: loadResult.loaded.map((entry) => ({
3089
- layer: entry.layer,
3090
- directory: entry.directory,
3091
- name: entry.name,
3092
- version: entry.version,
3093
- entry: entry.entry,
3094
- priority: entry.priority
3095
- }))
3096
- },
3097
- activation: {
3098
- failed: activationFailedDetails,
3099
- warnings: activationResult.warnings,
3100
- hook_counts: activationResult.hook_counts,
3101
- registration_counts: activationResult.registration_counts,
3102
- parser_override_count: activationResult.parser_override_count,
3103
- preflight_override_count: activationResult.preflight_override_count,
3104
- service_override_count: activationResult.service_override_count,
3105
- renderer_override_count: activationResult.renderer_override_count
3106
- },
3107
- consistency: doctorConsistency.summary
3108
- };
3109
- if (includeTrace) {
3110
- details.deep.trace = {
3111
- activation_failures: activationResult.failed.filter((entry) => entry.trace !== void 0).map((entry) => ({
3112
- layer: entry.layer,
3113
- name: entry.name,
3114
- entry_path: entry.entry_path,
3115
- error: entry.error,
3116
- method: entry.trace?.method,
3117
- command: entry.trace?.command,
3118
- capability: entry.trace?.capability,
3119
- missing_capability: entry.trace?.missing_capability,
3120
- registration_index: entry.trace?.registration_index,
3121
- expected_schema: entry.trace?.expected_schema,
3122
- hint: entry.trace?.hint,
3123
- received: entry.trace?.received
3124
- }))
3125
- };
3126
- }
3127
- }
3128
- return withResult(details);
3129
- }
3130
- if (action === "describe") {
3131
- const settings = await readSettings(resolvedRoots.settings_root);
3132
- const loadResult = await loadExtensions({
3133
- pmRoot: resolvedRoots.pm_root,
3134
- settings,
3135
- cwd: process.cwd(),
3136
- noExtensions: global2.noExtensions === true
3137
- });
3138
- const activationResult = await activateExtensions(loadResult);
3139
- warnings.push(...loadResult.warnings);
3140
- warnings.push(...activationResult.warnings);
3141
- const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
3142
- if (normalizedTarget !== void 0 && describeResult.extensions.length === 0) {
3143
- const noun = options.vocabulary === "package" ? "package" : "extension";
3144
- throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
3145
- }
3146
- return withResult({
3147
- target: describeResult.target,
3148
- total: describeResult.total,
3149
- extensions: describeResult.extensions,
3150
- union: describeResult.union
3151
- });
3152
- }
3153
- if (action === "explore" || action === "manage") {
3154
- const settings = await readSettings(resolvedRoots.settings_root);
3155
- const configuredPolicy = buildExtensionPolicyDetails(settings.extensions.policy);
3156
- const managedStateRead = await readManagedExtensionState(resolvedRoots.selected_root);
3157
- warnings.push(...managedStateRead.warnings);
3158
- const installed = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedStateRead.state);
3159
- warnings.push(...installed.warnings);
3160
- let managedState = managedStateRead.state;
3161
- const managedStateFix = action === "manage" && options.fixManagedState === true ? await adoptUnmanagedExtensions(resolvedRoots.selected_root, scope, installed.extensions, managedStateRead.state) : null;
3162
- if (managedStateFix) {
3163
- managedState = managedStateFix.state;
3164
- }
3165
- if (action === "manage") {
3166
- const updates = await Promise.all(managedState.entries.map(async (entry) => {
3167
- if (entry.source.kind !== "github") {
3168
- return entry;
3169
- }
3170
- const updateStatus = await checkGithubUpdate(entry.source);
3171
- return {
3172
- ...entry,
3173
- last_update_check_at: updateStatus.checked_at,
3174
- last_update_remote_commit: updateStatus.remote_commit,
3175
- update_available: updateStatus.available,
3176
- update_error: updateStatus.error
3177
- };
3178
- }));
3179
- managedState = {
3180
- ...managedState,
3181
- updated_at: nowIso(),
3182
- entries: sortManagedEntries(updates)
3183
- };
3184
- await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
3185
- }
3186
- const refreshedInstalled = await listInstalledExtensions(resolvedRoots.selected_root, scope, settings, managedState);
3187
- warnings.push(...refreshedInstalled.warnings);
3188
- if (action === "manage") {
3189
- const updateWarnings = refreshedInstalled.extensions.filter((entry) => entry.update_check_status === "failed").map((entry) => `extension_update_check_failed:${entry.name}`);
3190
- warnings.push(...updateWarnings);
3191
- }
3192
- let runtimeProbeSummary;
3193
- let runtimeInstalledExtensions = refreshedInstalled.extensions;
3194
- let runtimeActivationFailures;
3195
- if (action === "explore" || options.runtimeProbe === true) {
3196
- const loadResult = await loadExtensions({
3197
- pmRoot: resolvedRoots.pm_root,
3198
- settings,
3199
- cwd: process.cwd(),
3200
- noExtensions: global2.noExtensions === true
3201
- });
3202
- const activationResult = await activateExtensions({
3203
- ...loadResult,
3204
- loaded: loadResult.loaded
3205
- });
3206
- warnings.push(...loadResult.warnings);
3207
- warnings.push(...activationResult.warnings);
3208
- runtimeInstalledExtensions = applyDoctorRuntimeActivationState(refreshedInstalled.extensions, loadResult, activationResult);
3209
- runtimeActivationFailures = collectActivationFailureDiagnostics(activationResult.failed);
3210
- runtimeProbeSummary = {
3211
- requested: true,
3212
- executed: true,
3213
- reason: action === "explore" ? "explore_defaults_to_runtime_probe" : "runtime_probe_requested",
3214
- load_failure_count: loadResult.failed.length,
3215
- activation_failure_count: activationResult.failed.length,
3216
- warning_count: [.../* @__PURE__ */ new Set([...loadResult.warnings, ...activationResult.warnings])].length,
3217
- policy: loadResult.policy
3218
- };
3219
- } else if (action === "manage") {
3220
- runtimeProbeSummary = {
3221
- requested: false,
3222
- executed: false
3223
- };
3224
- }
3225
- const triage = buildExtensionTriageSummary(scope, warnings, runtimeInstalledExtensions, options);
3226
- warnings.push(...triage.warnings);
3227
- const details = {
3228
- total: runtimeInstalledExtensions.length,
3229
- managed_total: runtimeInstalledExtensions.filter((entry) => entry.managed).length,
3230
- enabled_total: runtimeInstalledExtensions.filter((entry) => entry.enabled).length,
3231
- active_total: runtimeInstalledExtensions.filter((entry) => entry.active).length,
3232
- extensions: runtimeInstalledExtensions,
3233
- triage,
3234
- policy: configuredPolicy
3384
+ adopted_extensions: [],
3385
+ already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
3235
3386
  };
3236
- if (runtimeActivationFailures !== void 0) {
3237
- details.activation_diagnostics = {
3238
- failed_count: runtimeActivationFailures.length,
3239
- failed: runtimeActivationFailures
3240
- };
3241
- }
3242
- if (action === "explore") {
3243
- details.runtime_probe = runtimeProbeSummary;
3244
- }
3245
- if (action === "manage") {
3246
- details.runtime_probe = runtimeProbeSummary;
3247
- details.managed_state_fix = managedStateFix !== null ? {
3248
- requested: true,
3249
- applied: managedStateFix.adopted_entries.length > 0,
3250
- adopted_count: managedStateFix.adopted_entries.length,
3251
- adopted_extensions: managedStateFix.adopted_entries.map((entry) => entry.name),
3252
- already_managed_count: managedStateFix.already_managed_count
3253
- } : {
3254
- requested: false,
3255
- applied: false,
3256
- adopted_count: 0,
3257
- adopted_extensions: [],
3258
- already_managed_count: runtimeInstalledExtensions.filter((entry) => entry.managed).length
3259
- };
3260
- }
3261
- return withResult(details);
3262
3387
  }
3263
- throw new PmCliError(`Unsupported extension action "${action}".`, EXIT_CODE.USAGE);
3264
- }
3388
+ return withResult(details);
3389
+ }
3390
+ var EXTENSION_ACTION_HANDLERS = {
3391
+ init: runExtensionInitAction,
3392
+ install: runExtensionInstallAction,
3393
+ uninstall: runExtensionUninstallAction,
3394
+ explore: runExtensionExploreManageAction,
3395
+ manage: runExtensionExploreManageAction,
3396
+ describe: runExtensionDescribeAction,
3397
+ reload: runExtensionReloadAction,
3398
+ doctor: runExtensionDoctorAction,
3399
+ catalog: runExtensionCatalogAction,
3400
+ adopt: runExtensionAdoptAction,
3401
+ "adopt-all": runExtensionAdoptAllAction,
3402
+ activate: runExtensionActivateDeactivateAction,
3403
+ deactivate: runExtensionActivateDeactivateAction
3404
+ };
3265
3405
  var _testOnly = {
3266
3406
  adoptUnmanagedExtensions,
3267
3407
  buildExtensionPolicyDetails,
@@ -3299,4 +3439,4 @@ export {
3299
3439
  runExtension,
3300
3440
  _testOnly
3301
3441
  };
3302
- //# sourceMappingURL=chunk-7WDETKGP.js.map
3442
+ //# sourceMappingURL=chunk-N3QCJS4M.js.map