@unbrained/pm-cli 2026.6.7 → 2026.6.9

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 (494) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +1 -1
  3. package/CHANGELOG.md +68 -6
  4. package/CONTRIBUTING.md +1 -1
  5. package/README.md +1 -1
  6. package/dist/cli/bootstrap-args.js +30 -13
  7. package/dist/cli/bootstrap-args.js.map +1 -1
  8. package/dist/cli/commands/close-many.js +9 -3
  9. package/dist/cli/commands/close-many.js.map +1 -1
  10. package/dist/cli/commands/close.js +15 -3
  11. package/dist/cli/commands/close.js.map +1 -1
  12. package/dist/cli/commands/comments-audit.js +4 -3
  13. package/dist/cli/commands/comments-audit.js.map +1 -1
  14. package/dist/cli/commands/completion.js +40 -33
  15. package/dist/cli/commands/completion.js.map +1 -1
  16. package/dist/cli/commands/extension/scaffold.js +6 -14
  17. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  18. package/dist/cli/commands/gc.js +10 -2
  19. package/dist/cli/commands/gc.js.map +1 -1
  20. package/dist/cli/commands/health.js +10 -2
  21. package/dist/cli/commands/health.js.map +1 -1
  22. package/dist/cli/commands/index.d.ts +1 -1
  23. package/dist/cli/commands/index.js +3 -3
  24. package/dist/cli/commands/index.js.map +1 -1
  25. package/dist/cli/commands/init.d.ts +1 -0
  26. package/dist/cli/commands/init.js +48 -2
  27. package/dist/cli/commands/init.js.map +1 -1
  28. package/dist/cli/commands/list.d.ts +11 -2
  29. package/dist/cli/commands/list.js +104 -2
  30. package/dist/cli/commands/list.js.map +1 -1
  31. package/dist/cli/commands/normalize.js +6 -4
  32. package/dist/cli/commands/normalize.js.map +1 -1
  33. package/dist/cli/commands/schema.d.ts +13 -2
  34. package/dist/cli/commands/schema.js +66 -12
  35. package/dist/cli/commands/schema.js.map +1 -1
  36. package/dist/cli/commands/search.d.ts +10 -2
  37. package/dist/cli/commands/search.js +94 -5
  38. package/dist/cli/commands/search.js.map +1 -1
  39. package/dist/cli/commands/upgrade.js +4 -12
  40. package/dist/cli/commands/upgrade.js.map +1 -1
  41. package/dist/cli/extension-command-options.js +40 -17
  42. package/dist/cli/extension-command-options.js.map +1 -1
  43. package/dist/cli/main.js +7 -18
  44. package/dist/cli/main.js.map +1 -1
  45. package/dist/cli/register-list-query.js +5 -3
  46. package/dist/cli/register-list-query.js.map +1 -1
  47. package/dist/cli/register-mutation.js +33 -24
  48. package/dist/cli/register-mutation.js.map +1 -1
  49. package/dist/cli/register-setup.js +4 -2
  50. package/dist/cli/register-setup.js.map +1 -1
  51. package/dist/cli/registration-helpers.js +7 -3
  52. package/dist/cli/registration-helpers.js.map +1 -1
  53. package/dist/cli-bundle/chunks/activity-HF3VJYKH.js +16 -0
  54. package/dist/cli-bundle/chunks/{activity-YVB3QRTE.js → activity-RUJATACW.js} +11 -11
  55. package/dist/cli-bundle/chunks/{aggregate-LH66F75F.js → aggregate-IQ27NFBI.js} +10 -11
  56. package/dist/cli-bundle/chunks/{aggregate-LH66F75F.js.map → aggregate-IQ27NFBI.js.map} +1 -1
  57. package/dist/cli-bundle/chunks/{aggregate-OHSWFQJM.js → aggregate-TT7OCHHT.js} +12 -13
  58. package/dist/cli-bundle/chunks/{aggregate-OHSWFQJM.js.map → aggregate-TT7OCHHT.js.map} +1 -1
  59. package/dist/cli-bundle/chunks/{append-2PPYFAG5.js → append-CWQZBUWV.js} +8 -8
  60. package/dist/cli-bundle/chunks/{append-AUGT5W6J.js → append-E7AJ5RTR.js} +8 -8
  61. package/dist/cli-bundle/chunks/{chunk-UIIQC5YO.js → chunk-23WNCJBA.js} +2 -2
  62. package/dist/cli-bundle/chunks/{chunk-GPXQBR3H.js → chunk-3RHE76G6.js} +12 -12
  63. package/dist/cli-bundle/chunks/{chunk-GUZBNB3G.js → chunk-42IULX44.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-HLC3KTLP.js → chunk-44JP4PYY.js} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-MWRS7Z4P.js → chunk-4LRVXVJK.js} +15 -13
  66. package/dist/cli-bundle/chunks/chunk-4LRVXVJK.js.map +7 -0
  67. package/dist/cli-bundle/chunks/{chunk-HV5SSZXF.js → chunk-4TJWRPIH.js} +2 -2
  68. package/dist/cli-bundle/chunks/{chunk-UYQ7HXH4.js → chunk-5ATRWEZO.js} +3 -3
  69. package/dist/cli-bundle/chunks/{chunk-X4IZKYHP.js → chunk-5JF76OJF.js} +246 -17
  70. package/dist/cli-bundle/chunks/chunk-5JF76OJF.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-WYEXLDDY.js → chunk-5MMLINZB.js} +3 -3
  72. package/dist/cli-bundle/chunks/{chunk-2IF7WLB7.js → chunk-6IGTNFE3.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-UT6WFXW2.js → chunk-7CR4GAYN.js} +2 -2
  74. package/dist/cli-bundle/chunks/{chunk-NHR2QXXZ.js → chunk-7YTWXGE3.js} +20 -8
  75. package/dist/cli-bundle/chunks/chunk-7YTWXGE3.js.map +1 -0
  76. package/dist/cli-bundle/chunks/{chunk-SQPKRA54.js → chunk-A5342JVL.js} +12 -12
  77. package/dist/cli-bundle/chunks/{chunk-H7EO3QA3.js → chunk-AM2AXVFS.js} +5 -5
  78. package/dist/cli-bundle/chunks/{chunk-LIN2BPJ7.js → chunk-ANKG2JKL.js} +2 -2
  79. package/dist/cli-bundle/chunks/{chunk-YBZW2QQ7.js → chunk-AVGOVJGV.js} +10 -13
  80. package/dist/cli-bundle/chunks/chunk-AVGOVJGV.js.map +1 -0
  81. package/dist/cli-bundle/chunks/{chunk-4GHZR3BA.js → chunk-BACSNVWE.js} +10 -14
  82. package/dist/cli-bundle/chunks/chunk-BACSNVWE.js.map +1 -0
  83. package/dist/cli-bundle/chunks/{chunk-NQL32HQ5.js → chunk-BIRVSIM2.js} +12 -12
  84. package/dist/cli-bundle/chunks/{chunk-UJUT6AHZ.js → chunk-C72IQIBT.js} +271 -21
  85. package/dist/cli-bundle/chunks/chunk-C72IQIBT.js.map +7 -0
  86. package/dist/cli-bundle/chunks/{chunk-42LOFGJS.js → chunk-CAXUGAAF.js} +108 -9
  87. package/dist/cli-bundle/chunks/chunk-CAXUGAAF.js.map +7 -0
  88. package/dist/cli-bundle/chunks/{chunk-QQL5QSTZ.js → chunk-D5D7VKIC.js} +6 -5
  89. package/dist/cli-bundle/chunks/chunk-D5D7VKIC.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{chunk-C5W2UH56.js → chunk-E7LOIIFP.js} +3 -3
  91. package/dist/cli-bundle/chunks/{chunk-TINUJMWN.js → chunk-EFRHTZO4.js} +109 -10
  92. package/dist/cli-bundle/chunks/chunk-EFRHTZO4.js.map +1 -0
  93. package/dist/cli-bundle/chunks/{chunk-LXO6V66E.js → chunk-ENCVPOID.js} +12 -12
  94. package/dist/cli-bundle/chunks/{chunk-4CHEG6UK.js → chunk-EQ6N6IDR.js} +8 -8
  95. package/dist/cli-bundle/chunks/{chunk-B5RF3IP7.js → chunk-F2REA7VW.js} +4 -6
  96. package/dist/cli-bundle/chunks/{chunk-B5RF3IP7.js.map → chunk-F2REA7VW.js.map} +1 -1
  97. package/dist/cli-bundle/chunks/{chunk-6J4K6JLA.js → chunk-FHUI7AXS.js} +6 -8
  98. package/dist/cli-bundle/chunks/{chunk-6J4K6JLA.js.map → chunk-FHUI7AXS.js.map} +1 -1
  99. package/dist/cli-bundle/chunks/{chunk-6RZXO5M2.js → chunk-FJNJEWU4.js} +8 -8
  100. package/dist/cli-bundle/chunks/{chunk-R3V3YCMH.js → chunk-FKH7K6YP.js} +9 -9
  101. package/dist/cli-bundle/chunks/{chunk-CLD3XNCH.js → chunk-GPOSGWCN.js} +14 -12
  102. package/dist/cli-bundle/chunks/chunk-GPOSGWCN.js.map +1 -0
  103. package/dist/cli-bundle/chunks/{chunk-3EOBJOF4.js → chunk-H37YPWLM.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-XYNT7UFP.js → chunk-I26E6XA7.js} +17 -7
  105. package/dist/cli-bundle/chunks/chunk-I26E6XA7.js.map +1 -0
  106. package/dist/cli-bundle/chunks/{chunk-THDEID2Z.js → chunk-I3UILOUU.js} +2 -2
  107. package/dist/cli-bundle/chunks/{chunk-YPH4ESA2.js → chunk-I4FGL3K2.js} +11 -6
  108. package/dist/cli-bundle/chunks/chunk-I4FGL3K2.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-HMMMWBK2.js → chunk-JEGFLKSI.js} +2 -2
  110. package/dist/cli-bundle/chunks/{chunk-OKSKJKHX.js → chunk-JN3BT7UY.js} +9 -9
  111. package/dist/cli-bundle/chunks/{chunk-XS3O2TFJ.js → chunk-JVMAOD54.js} +8 -8
  112. package/dist/cli-bundle/chunks/chunk-JVMAOD54.js.map +1 -0
  113. package/dist/cli-bundle/chunks/{chunk-KNGVP5WJ.js → chunk-KDX6VC3P.js} +3 -3
  114. package/dist/cli-bundle/chunks/{chunk-TNPBPNII.js → chunk-KTVXLI54.js} +7 -7
  115. package/dist/cli-bundle/chunks/{chunk-TP4DDY27.js → chunk-LF2VNLEZ.js} +9 -12
  116. package/dist/cli-bundle/chunks/chunk-LF2VNLEZ.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-X7UHMKPE.js → chunk-LU2HE272.js} +3 -3
  118. package/dist/cli-bundle/chunks/{chunk-WAA7UI6M.js → chunk-LU54Z4QI.js} +10 -14
  119. package/dist/cli-bundle/chunks/chunk-LU54Z4QI.js.map +7 -0
  120. package/dist/cli-bundle/chunks/{chunk-MOYM2C3J.js → chunk-MNXJ6YDO.js} +9 -9
  121. package/dist/cli-bundle/chunks/{chunk-WCQZBDDH.js → chunk-NHRZSYAA.js} +3 -3
  122. package/dist/cli-bundle/chunks/{chunk-3A2CMEM7.js → chunk-NJRZIJ4N.js} +4 -4
  123. package/dist/cli-bundle/chunks/{chunk-2OJHLWBZ.js → chunk-NUGAWYEN.js} +2 -2
  124. package/dist/cli-bundle/chunks/{chunk-LQHBENVW.js → chunk-O4L7Z6LB.js} +3 -3
  125. package/dist/cli-bundle/chunks/{chunk-V6EYFTRL.js → chunk-OPYA2HIU.js} +7 -7
  126. package/dist/cli-bundle/chunks/{chunk-KR6R465K.js → chunk-OT6XAMO5.js} +17 -7
  127. package/dist/cli-bundle/chunks/chunk-OT6XAMO5.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-FY6Z3FYY.js → chunk-P2NVFE4L.js} +3 -3
  129. package/dist/cli-bundle/chunks/{chunk-UEWA73ZZ.js → chunk-PUSOAQCR.js} +5 -5
  130. package/dist/cli-bundle/chunks/{chunk-B2KZGPM2.js → chunk-PW7C262O.js} +2 -2
  131. package/dist/cli-bundle/chunks/{chunk-AVJD6VTA.js → chunk-RE2JQJZJ.js} +3 -3
  132. package/dist/cli-bundle/chunks/{chunk-GNIUOLZ2.js → chunk-RKCJ2JMA.js} +7 -7
  133. package/dist/cli-bundle/chunks/{chunk-5AXMRKN5.js → chunk-RLVI7KDW.js} +8 -8
  134. package/dist/cli-bundle/chunks/{chunk-IMCJBN2Q.js → chunk-RMTI5R76.js} +19 -7
  135. package/dist/cli-bundle/chunks/chunk-RMTI5R76.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-FHHBD7PN.js → chunk-SAUXUI6U.js} +2 -2
  137. package/dist/cli-bundle/chunks/{chunk-O7HSSFCC.js → chunk-SD6H3RLA.js} +10 -5
  138. package/dist/cli-bundle/chunks/{chunk-O7HSSFCC.js.map → chunk-SD6H3RLA.js.map} +2 -2
  139. package/dist/cli-bundle/chunks/{chunk-M2PW7EZU.js → chunk-T7B5VAKD.js} +7 -7
  140. package/dist/cli-bundle/chunks/chunk-T7B5VAKD.js.map +7 -0
  141. package/dist/cli-bundle/chunks/{chunk-YO3THIJF.js → chunk-T7NWFVOA.js} +7 -7
  142. package/dist/cli-bundle/chunks/{chunk-WR5567FH.js → chunk-TLD3UYGY.js} +5 -4
  143. package/dist/cli-bundle/chunks/chunk-TLD3UYGY.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-HRMHZ4RV.js → chunk-U3Z4OCZC.js} +2 -2
  145. package/dist/cli-bundle/chunks/{chunk-SFFVGNHC.js → chunk-VDVVOLR6.js} +3 -3
  146. package/dist/cli-bundle/chunks/{chunk-2IXCHCLM.js → chunk-WCWIDJII.js} +2 -2
  147. package/dist/cli-bundle/chunks/{chunk-LI65XLJR.js → chunk-WQZCEEQN.js} +8 -8
  148. package/dist/cli-bundle/chunks/{chunk-RVPTZKBC.js → chunk-XEOO6K5J.js} +9 -9
  149. package/dist/cli-bundle/chunks/{chunk-TYJJOTUA.js → chunk-YI6W2DBN.js} +54 -8
  150. package/dist/cli-bundle/chunks/chunk-YI6W2DBN.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-UAQOQ7IE.js → chunk-YSANBZAE.js} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-LMTOY5HE.js → chunk-YX5LAKFJ.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-CKLBZHS7.js → chunk-ZPXDD6RQ.js} +53 -7
  154. package/dist/cli-bundle/chunks/chunk-ZPXDD6RQ.js.map +7 -0
  155. package/dist/cli-bundle/chunks/{claim-BJ4QMPJC.js → claim-RV6WYUF7.js} +10 -10
  156. package/dist/cli-bundle/chunks/{claim-KW743OSW.js → claim-UXFGCF3P.js} +10 -10
  157. package/dist/cli-bundle/chunks/close-JTTGW7TS.js +13 -0
  158. package/dist/cli-bundle/chunks/{close-SYHSRZDC.js → close-O4JK2JKD.js} +8 -8
  159. package/dist/cli-bundle/chunks/{close-many-LAC5VR4G.js → close-many-EQO4TPIE.js} +24 -19
  160. package/dist/cli-bundle/chunks/close-many-EQO4TPIE.js.map +1 -0
  161. package/dist/cli-bundle/chunks/{close-many-DBLEYFOY.js → close-many-SRDBV3SI.js} +23 -18
  162. package/dist/cli-bundle/chunks/close-many-SRDBV3SI.js.map +7 -0
  163. package/dist/cli-bundle/chunks/{comments-YT2PQ5DD.js → comments-OMB7YE27.js} +10 -10
  164. package/dist/cli-bundle/chunks/{comments-JEO6HHVM.js → comments-TTZUIB2O.js} +10 -10
  165. package/dist/cli-bundle/chunks/{config-RZRVS3ZV.js → config-5VPR42A6.js} +10 -11
  166. package/dist/cli-bundle/chunks/config-5VPR42A6.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{config-YJSAAADD.js → config-NNLXVGVC.js} +9 -10
  168. package/dist/cli-bundle/chunks/config-NNLXVGVC.js.map +7 -0
  169. package/dist/cli-bundle/chunks/{context-ZUH5IOOI.js → context-4N7GYTVQ.js} +16 -18
  170. package/dist/cli-bundle/chunks/{context-ZUH5IOOI.js.map → context-4N7GYTVQ.js.map} +1 -1
  171. package/dist/cli-bundle/chunks/{context-LGYEEKAW.js → context-4QK6GRXO.js} +14 -16
  172. package/dist/cli-bundle/chunks/{context-LGYEEKAW.js.map → context-4QK6GRXO.js.map} +1 -1
  173. package/dist/cli-bundle/chunks/{contracts-YXJ6NXKH.js → contracts-AOBNEBVT.js} +4 -4
  174. package/dist/cli-bundle/chunks/{contracts-ZIBXROPE.js → contracts-DXCWXOSP.js} +4 -4
  175. package/dist/cli-bundle/chunks/{copy-BZALX5MQ.js → copy-5NM3SVJA.js} +7 -7
  176. package/dist/cli-bundle/chunks/{copy-YPWEIAPD.js → copy-XSYEQTLA.js} +7 -7
  177. package/dist/cli-bundle/chunks/{create-CF7EVRX7.js → create-FCCAATQV.js} +13 -13
  178. package/dist/cli-bundle/chunks/create-JAPLFDGJ.js +27 -0
  179. package/dist/cli-bundle/chunks/{delete-XLZRTRKR.js → delete-5JFP6OG7.js} +7 -7
  180. package/dist/cli-bundle/chunks/{delete-KR4VBWVE.js → delete-PQXJQXQ7.js} +7 -7
  181. package/dist/cli-bundle/chunks/{deps-GZMFMTGS.js → deps-S5322EOQ.js} +7 -7
  182. package/dist/cli-bundle/chunks/{deps-2YTXD3VM.js → deps-XXKBOQUA.js} +7 -7
  183. package/dist/cli-bundle/chunks/{docs-SLROFEQ4.js → docs-C7CCVWAJ.js} +9 -9
  184. package/dist/cli-bundle/chunks/{docs-ZHISRR2D.js → docs-DZRPAW5S.js} +9 -9
  185. package/dist/cli-bundle/chunks/{extension-3C7OOI4F.js → extension-CSHP6FZX.js} +5 -5
  186. package/dist/cli-bundle/chunks/{extension-XYCUXICD.js → extension-XNNVUVAY.js} +5 -5
  187. package/dist/cli-bundle/chunks/{files-J4I5IU4O.js → files-OBWYYPKM.js} +9 -9
  188. package/dist/cli-bundle/chunks/{files-FUWF2FYJ.js → files-UPCNKEIZ.js} +9 -9
  189. package/dist/cli-bundle/chunks/{gc-34NXSNSN.js → gc-FA2ONELT.js} +13 -5
  190. package/dist/cli-bundle/chunks/gc-FA2ONELT.js.map +1 -0
  191. package/dist/cli-bundle/chunks/{gc-SPIIZX3A.js → gc-KXK6KBRN.js} +12 -4
  192. package/dist/cli-bundle/chunks/gc-KXK6KBRN.js.map +7 -0
  193. package/dist/cli-bundle/chunks/{get-VITKYP6S.js → get-FLHYTOBA.js} +11 -11
  194. package/dist/cli-bundle/chunks/{get-SZKNRHMA.js → get-PNTSONGB.js} +11 -11
  195. package/dist/cli-bundle/chunks/{health-7G3EPM57.js → health-CS5RNTJX.js} +21 -14
  196. package/dist/cli-bundle/chunks/health-CS5RNTJX.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{health-4SNTA2TF.js → health-KCRVYIYY.js} +20 -13
  198. package/dist/cli-bundle/chunks/health-KCRVYIYY.js.map +7 -0
  199. package/dist/cli-bundle/chunks/history-6624XISO.js +20 -0
  200. package/dist/cli-bundle/chunks/{history-SDAWYZR3.js → history-COQTPBEU.js} +10 -10
  201. package/dist/cli-bundle/chunks/{history-compact-POTZGG7K.js → history-compact-66PSRYL3.js} +11 -11
  202. package/dist/cli-bundle/chunks/{history-compact-DMW536VH.js → history-compact-PVS2A3FS.js} +11 -11
  203. package/dist/cli-bundle/chunks/{history-redact-EPJ7GENL.js → history-redact-DCXAWGTF.js} +11 -11
  204. package/dist/cli-bundle/chunks/history-redact-ZRQTI7NB.js +19 -0
  205. package/dist/cli-bundle/chunks/{history-repair-YNESJRT6.js → history-repair-SEQDFTGW.js} +11 -11
  206. package/dist/cli-bundle/chunks/{history-repair-IJ7LLBET.js → history-repair-TA3NRIFO.js} +11 -11
  207. package/dist/cli-bundle/chunks/{init-YHVBTEET.js → init-IQJE3EKJ.js} +9 -9
  208. package/dist/cli-bundle/chunks/init-ZVE2HMKK.js +17 -0
  209. package/dist/cli-bundle/chunks/{learnings-T4PF24YN.js → learnings-RJPGH2ME.js} +10 -10
  210. package/dist/cli-bundle/chunks/{learnings-4YBMIVCZ.js → learnings-XC6EMW5E.js} +10 -10
  211. package/dist/cli-bundle/chunks/{list-3KEVBOYW.js → list-NJV6WBT4.js} +10 -11
  212. package/dist/cli-bundle/chunks/list-OO5P472O.js +19 -0
  213. package/dist/cli-bundle/chunks/{notes-GJKALVZM.js → notes-2KWHADK3.js} +10 -10
  214. package/dist/cli-bundle/chunks/{notes-FLUCNJSH.js → notes-FNCDMZW2.js} +10 -10
  215. package/dist/cli-bundle/chunks/{plan-T5MMZLI3.js → plan-CYK2P5PD.js} +13 -13
  216. package/dist/cli-bundle/chunks/{plan-YYMIL3HV.js → plan-MQO5JTSV.js} +13 -13
  217. package/dist/cli-bundle/chunks/{register-list-query-I65EZ3HB.js → register-list-query-6RA24SIZ.js} +23 -21
  218. package/dist/cli-bundle/chunks/register-list-query-6RA24SIZ.js.map +1 -0
  219. package/dist/cli-bundle/chunks/{register-list-query-OECMHO4G.js → register-list-query-IO3RR5K6.js} +22 -20
  220. package/dist/cli-bundle/chunks/register-list-query-IO3RR5K6.js.map +7 -0
  221. package/dist/cli-bundle/chunks/{register-mutation-5GPDEKHR.js → register-mutation-KVFUXCAZ.js} +40 -36
  222. package/dist/cli-bundle/chunks/{register-mutation-5GPDEKHR.js.map → register-mutation-KVFUXCAZ.js.map} +2 -2
  223. package/dist/cli-bundle/chunks/{register-mutation-2FLXORLR.js → register-mutation-VV2SC2KL.js} +41 -37
  224. package/dist/cli-bundle/chunks/{register-mutation-2FLXORLR.js.map → register-mutation-VV2SC2KL.js.map} +1 -1
  225. package/dist/cli-bundle/chunks/{register-operations-BNGAUMGK.js → register-operations-DFNVRSJ5.js} +30 -30
  226. package/dist/cli-bundle/chunks/{register-operations-GQKT35H5.js → register-operations-TAUUTRJ4.js} +30 -30
  227. package/dist/cli-bundle/chunks/{register-setup-DNDCGZ4O.js → register-setup-GAQZZRUA.js} +20 -19
  228. package/dist/cli-bundle/chunks/register-setup-GAQZZRUA.js.map +1 -0
  229. package/dist/cli-bundle/chunks/{register-setup-EJY44FPH.js → register-setup-X2R5CFDV.js} +19 -18
  230. package/dist/cli-bundle/chunks/{register-setup-EJY44FPH.js.map → register-setup-X2R5CFDV.js.map} +2 -2
  231. package/dist/cli-bundle/chunks/{restore-DDJGVZIN.js → restore-E3GZKRRK.js} +11 -11
  232. package/dist/cli-bundle/chunks/restore-F4ALFV4D.js +17 -0
  233. package/dist/cli-bundle/chunks/{schema-HEGYH6CE.js → schema-3CPFLDAY.js} +77 -21
  234. package/dist/cli-bundle/chunks/schema-3CPFLDAY.js.map +1 -0
  235. package/dist/cli-bundle/chunks/{schema-B7NQ6XVP.js → schema-7EHBPNXM.js} +76 -20
  236. package/dist/cli-bundle/chunks/schema-7EHBPNXM.js.map +7 -0
  237. package/dist/cli-bundle/chunks/{search-DVVQ4UO2.js → search-2T3NCCUR.js} +104 -16
  238. package/dist/cli-bundle/chunks/search-2T3NCCUR.js.map +1 -0
  239. package/dist/cli-bundle/chunks/{search-JNEZJV7H.js → search-OBZVYJJ2.js} +103 -15
  240. package/dist/cli-bundle/chunks/search-OBZVYJJ2.js.map +7 -0
  241. package/dist/cli-bundle/chunks/{stats-SYTJRR4Z.js → stats-6LVK4JER.js} +7 -7
  242. package/dist/cli-bundle/chunks/{stats-7JDIJRDH.js → stats-ULGQACF7.js} +7 -7
  243. package/dist/cli-bundle/chunks/{telemetry-4HHWD5Y7.js → telemetry-6G27FLCP.js} +4 -4
  244. package/dist/cli-bundle/chunks/{telemetry-EGWP7ZUX.js → telemetry-HHKRTMZA.js} +4 -4
  245. package/dist/cli-bundle/chunks/{test-IIELLSZX.js → test-2PP4YBV6.js} +14 -14
  246. package/dist/cli-bundle/chunks/test-PPOLRIBA.js +32 -0
  247. package/dist/cli-bundle/chunks/{test-all-7DNCMML7.js → test-all-6Z272JRI.js} +14 -14
  248. package/dist/cli-bundle/chunks/{test-all-IHTUJRRC.js → test-all-NETGVNM6.js} +14 -14
  249. package/dist/cli-bundle/chunks/{test-runs-RNKZ37PS.js → test-runs-CRPQVMMG.js} +5 -5
  250. package/dist/cli-bundle/chunks/{test-runs-5FEMBV3A.js → test-runs-M24WA6TI.js} +5 -5
  251. package/dist/cli-bundle/chunks/update-MCPCPMHV.js +25 -0
  252. package/dist/cli-bundle/chunks/update-O7TBOUVQ.js +21 -0
  253. package/dist/cli-bundle/chunks/{update-many-BSZZZYXY.js → update-many-JSRF5EH5.js} +22 -23
  254. package/dist/cli-bundle/chunks/{update-many-BSZZZYXY.js.map → update-many-JSRF5EH5.js.map} +1 -1
  255. package/dist/cli-bundle/chunks/{update-many-BWKJJEBF.js → update-many-Y3HOL7WA.js} +24 -25
  256. package/dist/cli-bundle/chunks/{update-many-BWKJJEBF.js.map → update-many-Y3HOL7WA.js.map} +1 -1
  257. package/dist/cli-bundle/chunks/{upgrade-YWI5DJFA.js → upgrade-5RTQVKKE.js} +8 -15
  258. package/dist/cli-bundle/chunks/upgrade-5RTQVKKE.js.map +7 -0
  259. package/dist/cli-bundle/chunks/{upgrade-RSE5PC44.js → upgrade-ECB6GH3M.js} +9 -16
  260. package/dist/cli-bundle/chunks/upgrade-ECB6GH3M.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{validate-NK3WKB7C.js → validate-J6Q444SD.js} +16 -16
  262. package/dist/cli-bundle/chunks/{validate-UCEOB7S6.js → validate-MCNMAXVA.js} +16 -16
  263. package/dist/cli-bundle/main.js +77 -81
  264. package/dist/cli-bundle/main.js.map +3 -3
  265. package/dist/core/config/nested-settings.d.ts +0 -2
  266. package/dist/core/config/nested-settings.js +2 -4
  267. package/dist/core/config/nested-settings.js.map +1 -1
  268. package/dist/core/diagnostics/remediation.js +7 -2
  269. package/dist/core/diagnostics/remediation.js.map +1 -1
  270. package/dist/core/extensions/extension-types.d.ts +59 -1
  271. package/dist/core/extensions/extension-types.js +2 -2
  272. package/dist/core/extensions/extension-types.js.map +1 -1
  273. package/dist/core/extensions/flag-value-types.d.ts +29 -0
  274. package/dist/core/extensions/flag-value-types.js +78 -0
  275. package/dist/core/extensions/flag-value-types.js.map +1 -0
  276. package/dist/core/extensions/item-field-types.d.ts +22 -0
  277. package/dist/core/extensions/item-field-types.js +43 -0
  278. package/dist/core/extensions/item-field-types.js.map +1 -0
  279. package/dist/core/extensions/item-fields.js +4 -11
  280. package/dist/core/extensions/item-fields.js.map +1 -1
  281. package/dist/core/extensions/loader.d.ts +14 -1
  282. package/dist/core/extensions/loader.js +141 -10
  283. package/dist/core/extensions/loader.js.map +1 -1
  284. package/dist/core/fs/fs-utils.js +29 -4
  285. package/dist/core/fs/fs-utils.js.map +1 -1
  286. package/dist/core/packages/manifest.d.ts +1 -1
  287. package/dist/core/packages/manifest.js +12 -2
  288. package/dist/core/packages/manifest.js.map +1 -1
  289. package/dist/core/packages/root.d.ts +10 -0
  290. package/dist/core/packages/root.js +24 -2
  291. package/dist/core/packages/root.js.map +1 -1
  292. package/dist/core/schema/runtime-schema.js +3 -6
  293. package/dist/core/schema/runtime-schema.js.map +1 -1
  294. package/dist/core/search/background-refresh.d.ts +0 -8
  295. package/dist/core/search/background-refresh.js +2 -9
  296. package/dist/core/search/background-refresh.js.map +1 -1
  297. package/dist/core/search/vector-stores.js +6 -8
  298. package/dist/core/search/vector-stores.js.map +1 -1
  299. package/dist/core/sentry/instrument.js +4 -17
  300. package/dist/core/sentry/instrument.js.map +1 -1
  301. package/dist/core/store/paths.js +17 -3
  302. package/dist/core/store/paths.js.map +1 -1
  303. package/dist/core/telemetry/runtime.d.ts +1 -0
  304. package/dist/core/telemetry/runtime.js +3 -3
  305. package/dist/core/telemetry/runtime.js.map +1 -1
  306. package/dist/mcp/server.js +131 -42
  307. package/dist/mcp/server.js.map +1 -1
  308. package/dist/sdk/cli-contracts/commander-types.js +4 -4
  309. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  310. package/dist/sdk/cli-contracts/tool-parameter-tables.js +3 -3
  311. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  312. package/dist/sdk/cli-contracts.js +10 -8
  313. package/dist/sdk/cli-contracts.js.map +1 -1
  314. package/dist/sdk/index.d.ts +7 -2
  315. package/dist/sdk/index.js +3 -3
  316. package/dist/sdk/index.js.map +1 -1
  317. package/dist/sdk/testing.d.ts +55 -1
  318. package/dist/sdk/testing.js +92 -2
  319. package/dist/sdk/testing.js.map +1 -1
  320. package/docs/AGENT_GUIDE.md +3 -1
  321. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  322. package/docs/COMMANDS.md +6 -4
  323. package/docs/CONFIGURATION.md +6 -0
  324. package/docs/EXTENSIONS.md +7 -8
  325. package/docs/RELEASING.md +17 -0
  326. package/docs/SDK.md +98 -0
  327. package/marketplace.json +1 -1
  328. package/package.json +1 -1
  329. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  330. package/plugins/pm-claude/README.md +3 -3
  331. package/plugins/pm-claude/commands/pm-init.md +1 -1
  332. package/dist/cli-bundle/chunks/activity-5UROHJ3D.js +0 -16
  333. package/dist/cli-bundle/chunks/chunk-42LOFGJS.js.map +0 -7
  334. package/dist/cli-bundle/chunks/chunk-4GHZR3BA.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-CKLBZHS7.js.map +0 -7
  336. package/dist/cli-bundle/chunks/chunk-CLD3XNCH.js.map +0 -1
  337. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js +0 -56
  338. package/dist/cli-bundle/chunks/chunk-EAOG77HM.js.map +0 -7
  339. package/dist/cli-bundle/chunks/chunk-IMCJBN2Q.js.map +0 -7
  340. package/dist/cli-bundle/chunks/chunk-KR6R465K.js.map +0 -7
  341. package/dist/cli-bundle/chunks/chunk-M2PW7EZU.js.map +0 -7
  342. package/dist/cli-bundle/chunks/chunk-MWRS7Z4P.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-NHR2QXXZ.js.map +0 -1
  344. package/dist/cli-bundle/chunks/chunk-QQL5QSTZ.js.map +0 -1
  345. package/dist/cli-bundle/chunks/chunk-TINUJMWN.js.map +0 -1
  346. package/dist/cli-bundle/chunks/chunk-TP4DDY27.js.map +0 -7
  347. package/dist/cli-bundle/chunks/chunk-TYJJOTUA.js.map +0 -1
  348. package/dist/cli-bundle/chunks/chunk-UJUT6AHZ.js.map +0 -7
  349. package/dist/cli-bundle/chunks/chunk-WAA7UI6M.js.map +0 -7
  350. package/dist/cli-bundle/chunks/chunk-WR5567FH.js.map +0 -7
  351. package/dist/cli-bundle/chunks/chunk-X4IZKYHP.js.map +0 -1
  352. package/dist/cli-bundle/chunks/chunk-XS3O2TFJ.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js +0 -53
  354. package/dist/cli-bundle/chunks/chunk-XSLQSXAH.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-XYNT7UFP.js.map +0 -1
  356. package/dist/cli-bundle/chunks/chunk-YBZW2QQ7.js.map +0 -1
  357. package/dist/cli-bundle/chunks/chunk-YPH4ESA2.js.map +0 -1
  358. package/dist/cli-bundle/chunks/close-P4ZBKODL.js +0 -13
  359. package/dist/cli-bundle/chunks/close-many-DBLEYFOY.js.map +0 -7
  360. package/dist/cli-bundle/chunks/close-many-LAC5VR4G.js.map +0 -1
  361. package/dist/cli-bundle/chunks/config-RZRVS3ZV.js.map +0 -1
  362. package/dist/cli-bundle/chunks/config-YJSAAADD.js.map +0 -7
  363. package/dist/cli-bundle/chunks/create-4DS2QWQC.js +0 -27
  364. package/dist/cli-bundle/chunks/gc-34NXSNSN.js.map +0 -1
  365. package/dist/cli-bundle/chunks/gc-SPIIZX3A.js.map +0 -7
  366. package/dist/cli-bundle/chunks/health-4SNTA2TF.js.map +0 -7
  367. package/dist/cli-bundle/chunks/health-7G3EPM57.js.map +0 -1
  368. package/dist/cli-bundle/chunks/history-YDUEILKP.js +0 -20
  369. package/dist/cli-bundle/chunks/history-redact-KASLLPE7.js +0 -19
  370. package/dist/cli-bundle/chunks/init-IGSS4GNH.js +0 -17
  371. package/dist/cli-bundle/chunks/list-E44O2K64.js +0 -20
  372. package/dist/cli-bundle/chunks/register-list-query-I65EZ3HB.js.map +0 -1
  373. package/dist/cli-bundle/chunks/register-list-query-OECMHO4G.js.map +0 -7
  374. package/dist/cli-bundle/chunks/register-setup-DNDCGZ4O.js.map +0 -1
  375. package/dist/cli-bundle/chunks/restore-SJSASGZP.js +0 -17
  376. package/dist/cli-bundle/chunks/schema-B7NQ6XVP.js.map +0 -7
  377. package/dist/cli-bundle/chunks/schema-HEGYH6CE.js.map +0 -1
  378. package/dist/cli-bundle/chunks/search-DVVQ4UO2.js.map +0 -1
  379. package/dist/cli-bundle/chunks/search-JNEZJV7H.js.map +0 -7
  380. package/dist/cli-bundle/chunks/test-ML5RLWXE.js +0 -32
  381. package/dist/cli-bundle/chunks/update-6C67X4KS.js +0 -21
  382. package/dist/cli-bundle/chunks/update-VF26YPT3.js +0 -25
  383. package/dist/cli-bundle/chunks/upgrade-RSE5PC44.js.map +0 -1
  384. package/dist/cli-bundle/chunks/upgrade-YWI5DJFA.js.map +0 -7
  385. /package/dist/cli-bundle/chunks/{activity-5UROHJ3D.js.map → activity-HF3VJYKH.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{activity-YVB3QRTE.js.map → activity-RUJATACW.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{append-2PPYFAG5.js.map → append-CWQZBUWV.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{append-AUGT5W6J.js.map → append-E7AJ5RTR.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{chunk-UIIQC5YO.js.map → chunk-23WNCJBA.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{chunk-GPXQBR3H.js.map → chunk-3RHE76G6.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{chunk-GUZBNB3G.js.map → chunk-42IULX44.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{chunk-HLC3KTLP.js.map → chunk-44JP4PYY.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{chunk-HV5SSZXF.js.map → chunk-4TJWRPIH.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{chunk-UYQ7HXH4.js.map → chunk-5ATRWEZO.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{chunk-WYEXLDDY.js.map → chunk-5MMLINZB.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{chunk-2IF7WLB7.js.map → chunk-6IGTNFE3.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{chunk-UT6WFXW2.js.map → chunk-7CR4GAYN.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{chunk-SQPKRA54.js.map → chunk-A5342JVL.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{chunk-H7EO3QA3.js.map → chunk-AM2AXVFS.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{chunk-LIN2BPJ7.js.map → chunk-ANKG2JKL.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{chunk-NQL32HQ5.js.map → chunk-BIRVSIM2.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{chunk-C5W2UH56.js.map → chunk-E7LOIIFP.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{chunk-LXO6V66E.js.map → chunk-ENCVPOID.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{chunk-4CHEG6UK.js.map → chunk-EQ6N6IDR.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{chunk-6RZXO5M2.js.map → chunk-FJNJEWU4.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{chunk-R3V3YCMH.js.map → chunk-FKH7K6YP.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{chunk-3EOBJOF4.js.map → chunk-H37YPWLM.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{chunk-THDEID2Z.js.map → chunk-I3UILOUU.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{chunk-HMMMWBK2.js.map → chunk-JEGFLKSI.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{chunk-OKSKJKHX.js.map → chunk-JN3BT7UY.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{chunk-KNGVP5WJ.js.map → chunk-KDX6VC3P.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{chunk-TNPBPNII.js.map → chunk-KTVXLI54.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{chunk-X7UHMKPE.js.map → chunk-LU2HE272.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{chunk-MOYM2C3J.js.map → chunk-MNXJ6YDO.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{chunk-WCQZBDDH.js.map → chunk-NHRZSYAA.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{chunk-3A2CMEM7.js.map → chunk-NJRZIJ4N.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{chunk-2OJHLWBZ.js.map → chunk-NUGAWYEN.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{chunk-LQHBENVW.js.map → chunk-O4L7Z6LB.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{chunk-V6EYFTRL.js.map → chunk-OPYA2HIU.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{chunk-FY6Z3FYY.js.map → chunk-P2NVFE4L.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{chunk-UEWA73ZZ.js.map → chunk-PUSOAQCR.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{chunk-B2KZGPM2.js.map → chunk-PW7C262O.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{chunk-AVJD6VTA.js.map → chunk-RE2JQJZJ.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{chunk-GNIUOLZ2.js.map → chunk-RKCJ2JMA.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{chunk-5AXMRKN5.js.map → chunk-RLVI7KDW.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{chunk-FHHBD7PN.js.map → chunk-SAUXUI6U.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{chunk-YO3THIJF.js.map → chunk-T7NWFVOA.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{chunk-HRMHZ4RV.js.map → chunk-U3Z4OCZC.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{chunk-SFFVGNHC.js.map → chunk-VDVVOLR6.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{chunk-2IXCHCLM.js.map → chunk-WCWIDJII.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{chunk-LI65XLJR.js.map → chunk-WQZCEEQN.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{chunk-RVPTZKBC.js.map → chunk-XEOO6K5J.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{chunk-UAQOQ7IE.js.map → chunk-YSANBZAE.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{chunk-LMTOY5HE.js.map → chunk-YX5LAKFJ.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{claim-BJ4QMPJC.js.map → claim-RV6WYUF7.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{claim-KW743OSW.js.map → claim-UXFGCF3P.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{close-P4ZBKODL.js.map → close-JTTGW7TS.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{close-SYHSRZDC.js.map → close-O4JK2JKD.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{comments-YT2PQ5DD.js.map → comments-OMB7YE27.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{comments-JEO6HHVM.js.map → comments-TTZUIB2O.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{contracts-YXJ6NXKH.js.map → contracts-AOBNEBVT.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{contracts-ZIBXROPE.js.map → contracts-DXCWXOSP.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{copy-BZALX5MQ.js.map → copy-5NM3SVJA.js.map} +0 -0
  444. /package/dist/cli-bundle/chunks/{copy-YPWEIAPD.js.map → copy-XSYEQTLA.js.map} +0 -0
  445. /package/dist/cli-bundle/chunks/{create-CF7EVRX7.js.map → create-FCCAATQV.js.map} +0 -0
  446. /package/dist/cli-bundle/chunks/{create-4DS2QWQC.js.map → create-JAPLFDGJ.js.map} +0 -0
  447. /package/dist/cli-bundle/chunks/{delete-XLZRTRKR.js.map → delete-5JFP6OG7.js.map} +0 -0
  448. /package/dist/cli-bundle/chunks/{delete-KR4VBWVE.js.map → delete-PQXJQXQ7.js.map} +0 -0
  449. /package/dist/cli-bundle/chunks/{deps-GZMFMTGS.js.map → deps-S5322EOQ.js.map} +0 -0
  450. /package/dist/cli-bundle/chunks/{deps-2YTXD3VM.js.map → deps-XXKBOQUA.js.map} +0 -0
  451. /package/dist/cli-bundle/chunks/{docs-SLROFEQ4.js.map → docs-C7CCVWAJ.js.map} +0 -0
  452. /package/dist/cli-bundle/chunks/{docs-ZHISRR2D.js.map → docs-DZRPAW5S.js.map} +0 -0
  453. /package/dist/cli-bundle/chunks/{extension-3C7OOI4F.js.map → extension-CSHP6FZX.js.map} +0 -0
  454. /package/dist/cli-bundle/chunks/{extension-XYCUXICD.js.map → extension-XNNVUVAY.js.map} +0 -0
  455. /package/dist/cli-bundle/chunks/{files-J4I5IU4O.js.map → files-OBWYYPKM.js.map} +0 -0
  456. /package/dist/cli-bundle/chunks/{files-FUWF2FYJ.js.map → files-UPCNKEIZ.js.map} +0 -0
  457. /package/dist/cli-bundle/chunks/{get-VITKYP6S.js.map → get-FLHYTOBA.js.map} +0 -0
  458. /package/dist/cli-bundle/chunks/{get-SZKNRHMA.js.map → get-PNTSONGB.js.map} +0 -0
  459. /package/dist/cli-bundle/chunks/{history-YDUEILKP.js.map → history-6624XISO.js.map} +0 -0
  460. /package/dist/cli-bundle/chunks/{history-SDAWYZR3.js.map → history-COQTPBEU.js.map} +0 -0
  461. /package/dist/cli-bundle/chunks/{history-compact-POTZGG7K.js.map → history-compact-66PSRYL3.js.map} +0 -0
  462. /package/dist/cli-bundle/chunks/{history-compact-DMW536VH.js.map → history-compact-PVS2A3FS.js.map} +0 -0
  463. /package/dist/cli-bundle/chunks/{history-redact-EPJ7GENL.js.map → history-redact-DCXAWGTF.js.map} +0 -0
  464. /package/dist/cli-bundle/chunks/{history-redact-KASLLPE7.js.map → history-redact-ZRQTI7NB.js.map} +0 -0
  465. /package/dist/cli-bundle/chunks/{history-repair-YNESJRT6.js.map → history-repair-SEQDFTGW.js.map} +0 -0
  466. /package/dist/cli-bundle/chunks/{history-repair-IJ7LLBET.js.map → history-repair-TA3NRIFO.js.map} +0 -0
  467. /package/dist/cli-bundle/chunks/{init-YHVBTEET.js.map → init-IQJE3EKJ.js.map} +0 -0
  468. /package/dist/cli-bundle/chunks/{init-IGSS4GNH.js.map → init-ZVE2HMKK.js.map} +0 -0
  469. /package/dist/cli-bundle/chunks/{learnings-T4PF24YN.js.map → learnings-RJPGH2ME.js.map} +0 -0
  470. /package/dist/cli-bundle/chunks/{learnings-4YBMIVCZ.js.map → learnings-XC6EMW5E.js.map} +0 -0
  471. /package/dist/cli-bundle/chunks/{list-3KEVBOYW.js.map → list-NJV6WBT4.js.map} +0 -0
  472. /package/dist/cli-bundle/chunks/{list-E44O2K64.js.map → list-OO5P472O.js.map} +0 -0
  473. /package/dist/cli-bundle/chunks/{notes-GJKALVZM.js.map → notes-2KWHADK3.js.map} +0 -0
  474. /package/dist/cli-bundle/chunks/{notes-FLUCNJSH.js.map → notes-FNCDMZW2.js.map} +0 -0
  475. /package/dist/cli-bundle/chunks/{plan-T5MMZLI3.js.map → plan-CYK2P5PD.js.map} +0 -0
  476. /package/dist/cli-bundle/chunks/{plan-YYMIL3HV.js.map → plan-MQO5JTSV.js.map} +0 -0
  477. /package/dist/cli-bundle/chunks/{register-operations-BNGAUMGK.js.map → register-operations-DFNVRSJ5.js.map} +0 -0
  478. /package/dist/cli-bundle/chunks/{register-operations-GQKT35H5.js.map → register-operations-TAUUTRJ4.js.map} +0 -0
  479. /package/dist/cli-bundle/chunks/{restore-DDJGVZIN.js.map → restore-E3GZKRRK.js.map} +0 -0
  480. /package/dist/cli-bundle/chunks/{restore-SJSASGZP.js.map → restore-F4ALFV4D.js.map} +0 -0
  481. /package/dist/cli-bundle/chunks/{stats-SYTJRR4Z.js.map → stats-6LVK4JER.js.map} +0 -0
  482. /package/dist/cli-bundle/chunks/{stats-7JDIJRDH.js.map → stats-ULGQACF7.js.map} +0 -0
  483. /package/dist/cli-bundle/chunks/{telemetry-4HHWD5Y7.js.map → telemetry-6G27FLCP.js.map} +0 -0
  484. /package/dist/cli-bundle/chunks/{telemetry-EGWP7ZUX.js.map → telemetry-HHKRTMZA.js.map} +0 -0
  485. /package/dist/cli-bundle/chunks/{test-IIELLSZX.js.map → test-2PP4YBV6.js.map} +0 -0
  486. /package/dist/cli-bundle/chunks/{test-ML5RLWXE.js.map → test-PPOLRIBA.js.map} +0 -0
  487. /package/dist/cli-bundle/chunks/{test-all-7DNCMML7.js.map → test-all-6Z272JRI.js.map} +0 -0
  488. /package/dist/cli-bundle/chunks/{test-all-IHTUJRRC.js.map → test-all-NETGVNM6.js.map} +0 -0
  489. /package/dist/cli-bundle/chunks/{test-runs-RNKZ37PS.js.map → test-runs-CRPQVMMG.js.map} +0 -0
  490. /package/dist/cli-bundle/chunks/{test-runs-5FEMBV3A.js.map → test-runs-M24WA6TI.js.map} +0 -0
  491. /package/dist/cli-bundle/chunks/{update-VF26YPT3.js.map → update-MCPCPMHV.js.map} +0 -0
  492. /package/dist/cli-bundle/chunks/{update-6C67X4KS.js.map → update-O7TBOUVQ.js.map} +0 -0
  493. /package/dist/cli-bundle/chunks/{validate-NK3WKB7C.js.map → validate-J6Q444SD.js.map} +0 -0
  494. /package/dist/cli-bundle/chunks/{validate-UCEOB7S6.js.map → validate-MCNMAXVA.js.map} +0 -0
@@ -0,0 +1,78 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="63f541d2-f7f5-50d9-afbe-4ce8659063f8")}catch(e){}}();
3
+ const FLAG_VALUE_KIND_BY_ALIAS = Object.freeze({
4
+ string: "string",
5
+ number: "number",
6
+ int: "number",
7
+ integer: "number",
8
+ float: "number",
9
+ boolean: "boolean",
10
+ bool: "boolean",
11
+ });
12
+ /**
13
+ * Resolve a declared flag value type (string) to its canonical kind, or `null`
14
+ * when it is not a recognized type/alias. Matching is trim- and
15
+ * case-insensitive.
16
+ */
17
+ export function resolveFlagValueKind(raw) {
18
+ if (typeof raw !== "string") {
19
+ return null;
20
+ }
21
+ return FLAG_VALUE_KIND_BY_ALIAS[raw.trim().toLowerCase()] ?? null;
22
+ }
23
+ /**
24
+ * Flatten a `list` flag value (or default) into its individual entries the same
25
+ * way the runtime does: nested arrays are flattened and comma-joined strings are
26
+ * split, with surrounding whitespace trimmed and empty segments dropped. No
27
+ * type coercion is applied. Shared by the CLI coercion path and the
28
+ * registration-time default validator so the two never disagree.
29
+ */
30
+ export function flattenFlagListValue(value) {
31
+ const entries = [];
32
+ const collect = (input) => {
33
+ if (Array.isArray(input)) {
34
+ for (const item of input) {
35
+ collect(item);
36
+ }
37
+ return;
38
+ }
39
+ if (typeof input === "string") {
40
+ for (const part of input.split(",")) {
41
+ const trimmed = part.trim();
42
+ if (trimmed.length > 0) {
43
+ entries.push(trimmed);
44
+ }
45
+ }
46
+ return;
47
+ }
48
+ if (input !== undefined && input !== null) {
49
+ entries.push(input);
50
+ }
51
+ };
52
+ collect(value);
53
+ return entries;
54
+ }
55
+ /**
56
+ * Whether a scalar flag default would cleanly coerce under the declared kind,
57
+ * mirroring the runtime coercion rules in `coerceLooseCommandOptionsWithFlagDefinitions`.
58
+ * Used to reject contradictory definitions (e.g. `value_type: "number"` with
59
+ * `default: "abc"`) at registration instead of letting an untyped value pass
60
+ * through to activation.
61
+ */
62
+ export function isFlagDefaultValueCoercible(value, kind) {
63
+ if (kind === "string") {
64
+ return true;
65
+ }
66
+ if (kind === "number") {
67
+ if (typeof value === "number") {
68
+ return Number.isFinite(value);
69
+ }
70
+ return typeof value === "string" && value.trim().length > 0 && Number.isFinite(Number(value));
71
+ }
72
+ if (typeof value === "boolean") {
73
+ return true;
74
+ }
75
+ return typeof value === "string" && ["true", "false", "1", "0"].includes(value.trim().toLowerCase());
76
+ }
77
+ //# sourceMappingURL=flag-value-types.js.map
78
+ //# debugId=63f541d2-f7f5-50d9-afbe-4ce8659063f8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flag-value-types.js","sources":["core/extensions/flag-value-types.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Canonical coercion kinds an extension flag can declare via `value_type`\n * (or the deprecated `type` alias). The runtime also accepts a few common\n * aliases (`int`/`integer`/`float` -> number, `bool` -> boolean) so author\n * intent is honored without surprises.\n */\nexport type FlagValueKind = \"string\" | \"number\" | \"boolean\";\n\nconst FLAG_VALUE_KIND_BY_ALIAS: Readonly<Record<string, FlagValueKind>> = Object.freeze({\n string: \"string\",\n number: \"number\",\n int: \"number\",\n integer: \"number\",\n float: \"number\",\n boolean: \"boolean\",\n bool: \"boolean\",\n});\n\n/**\n * Resolve a declared flag value type (string) to its canonical kind, or `null`\n * when it is not a recognized type/alias. Matching is trim- and\n * case-insensitive.\n */\nexport function resolveFlagValueKind(raw: unknown): FlagValueKind | null {\n if (typeof raw !== \"string\") {\n return null;\n }\n return FLAG_VALUE_KIND_BY_ALIAS[raw.trim().toLowerCase()] ?? null;\n}\n\n/**\n * Flatten a `list` flag value (or default) into its individual entries the same\n * way the runtime does: nested arrays are flattened and comma-joined strings are\n * split, with surrounding whitespace trimmed and empty segments dropped. No\n * type coercion is applied. Shared by the CLI coercion path and the\n * registration-time default validator so the two never disagree.\n */\nexport function flattenFlagListValue(value: unknown): unknown[] {\n const entries: unknown[] = [];\n const collect = (input: unknown): void => {\n if (Array.isArray(input)) {\n for (const item of input) {\n collect(item);\n }\n return;\n }\n if (typeof input === \"string\") {\n for (const part of input.split(\",\")) {\n const trimmed = part.trim();\n if (trimmed.length > 0) {\n entries.push(trimmed);\n }\n }\n return;\n }\n if (input !== undefined && input !== null) {\n entries.push(input);\n }\n };\n collect(value);\n return entries;\n}\n\n/**\n * Whether a scalar flag default would cleanly coerce under the declared kind,\n * mirroring the runtime coercion rules in `coerceLooseCommandOptionsWithFlagDefinitions`.\n * Used to reject contradictory definitions (e.g. `value_type: \"number\"` with\n * `default: \"abc\"`) at registration instead of letting an untyped value pass\n * through to activation.\n */\nexport function isFlagDefaultValueCoercible(value: string | number | boolean, kind: FlagValueKind): boolean {\n if (kind === \"string\") {\n return true;\n }\n if (kind === \"number\") {\n if (typeof value === \"number\") {\n return Number.isFinite(value);\n }\n return typeof value === \"string\" && value.trim().length > 0 && Number.isFinite(Number(value));\n }\n if (typeof value === \"boolean\") {\n return true;\n }\n return typeof value === \"string\" && [\"true\", \"false\", \"1\", \"0\"].includes(value.trim().toLowerCase());\n}\n"],"names":[],"mappings":";;AAQA,MAAM,wBAAwB,GAA4C,MAAM,CAAC,MAAM,CAAC;IACtF,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,QAAQ;IACb,OAAO,EAAE,Q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M,UAAU,2BAA2B,CAAC,KAAgC,EAAE,IAAmB;IAC/F,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAChG,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACvG,CAAC","debugId":"63f541d2-f7f5-50d9-afbe-4ce8659063f8"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Canonical coercion kinds accepted for extension-registered custom item fields.
3
+ *
4
+ * A `registerItemFields` definition declares one of these as its `type`; the
5
+ * value is later coerced by that kind (see `coerceRegisteredFieldValue`). Keep
6
+ * this list in lock-step with the coercion switch in `item-fields.ts`.
7
+ */
8
+ export declare const KNOWN_ITEM_FIELD_TYPES: readonly ["string", "number", "boolean", "array", "object"];
9
+ export type KnownItemFieldType = (typeof KNOWN_ITEM_FIELD_TYPES)[number];
10
+ /**
11
+ * Normalize a declared field type to its canonical kind, or `null` when the
12
+ * value is not a known type. Matching is trim- and case-insensitive.
13
+ */
14
+ export declare function normalizeItemFieldType(value: string): KnownItemFieldType | null;
15
+ /**
16
+ * Suggest a known field type for a typo'd declaration (e.g. `"strnig"` ->
17
+ * `"string"`), using the shared OSA Damerau–Levenshtein helper so adjacent
18
+ * transpositions count as a single edit. Returns the first canonical type within
19
+ * the proportional edit budget (in declaration order — the kinds are distinct
20
+ * enough that at most one matches), or `null` when nothing is close enough.
21
+ */
22
+ export declare function suggestKnownItemFieldType(value: string): KnownItemFieldType | null;
@@ -0,0 +1,43 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="557146c8-cf60-5bbf-a59a-606928c536de")}catch(e){}}();
3
+ import { levenshteinDistanceWithinLimit } from "../shared/levenshtein.js";
4
+ /**
5
+ * Canonical coercion kinds accepted for extension-registered custom item fields.
6
+ *
7
+ * A `registerItemFields` definition declares one of these as its `type`; the
8
+ * value is later coerced by that kind (see `coerceRegisteredFieldValue`). Keep
9
+ * this list in lock-step with the coercion switch in `item-fields.ts`.
10
+ */
11
+ export const KNOWN_ITEM_FIELD_TYPES = ["string", "number", "boolean", "array", "object"];
12
+ /**
13
+ * Normalize a declared field type to its canonical kind, or `null` when the
14
+ * value is not a known type. Matching is trim- and case-insensitive.
15
+ */
16
+ export function normalizeItemFieldType(value) {
17
+ const normalized = value.trim().toLowerCase();
18
+ return KNOWN_ITEM_FIELD_TYPES.includes(normalized)
19
+ ? normalized
20
+ : null;
21
+ }
22
+ /**
23
+ * Suggest a known field type for a typo'd declaration (e.g. `"strnig"` ->
24
+ * `"string"`), using the shared OSA Damerau–Levenshtein helper so adjacent
25
+ * transpositions count as a single edit. Returns the first canonical type within
26
+ * the proportional edit budget (in declaration order — the kinds are distinct
27
+ * enough that at most one matches), or `null` when nothing is close enough.
28
+ */
29
+ export function suggestKnownItemFieldType(value) {
30
+ const normalized = value.trim().toLowerCase();
31
+ if (normalized.length === 0) {
32
+ return null;
33
+ }
34
+ const limit = Math.max(1, Math.floor(normalized.length * 0.34));
35
+ for (const candidate of KNOWN_ITEM_FIELD_TYPES) {
36
+ if (levenshteinDistanceWithinLimit(normalized, candidate, limit) !== null) {
37
+ return candidate;
38
+ }
39
+ }
40
+ return null;
41
+ }
42
+ //# sourceMappingURL=item-field-types.js.map
43
+ //# debugId=557146c8-cf60-5bbf-a59a-606928c536de
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-field-types.js","sources":["core/extensions/item-field-types.ts"],"sourceRoot":"/","sourcesContent":["import { levenshteinDistanceWithinLimit } from \"../shared/levenshtein.js\";\n\n/**\n * Canonical coercion kinds accepted for extension-registered custom item fields.\n *\n * A `registerItemFields` definition declares one of these as its `type`; the\n * value is later coerced by that kind (see `coerceRegisteredFieldValue`). Keep\n * this list in lock-step with the coercion switch in `item-fields.ts`.\n */\nexport const KNOWN_ITEM_FIELD_TYPES = [\"string\", \"number\", \"boolean\", \"array\", \"object\"] as const;\nexport type KnownItemFieldType = (typeof KNOWN_ITEM_FIELD_TYPES)[number];\n\n/**\n * Normalize a declared field type to its canonical kind, or `null` when the\n * value is not a known type. Matching is trim- and case-insensitive.\n */\nexport function normalizeItemFieldType(value: string): KnownItemFieldType | null {\n const normalized = value.trim().toLowerCase();\n return (KNOWN_ITEM_FIELD_TYPES as readonly string[]).includes(normalized)\n ? (normalized as KnownItemFieldType)\n : null;\n}\n\n/**\n * Suggest a known field type for a typo'd declaration (e.g. `\"strnig\"` ->\n * `\"string\"`), using the shared OSA Damerau–Levenshtein helper so adjacent\n * transpositions count as a single edit. Returns the first canonical type within\n * the proportional edit budget (in declaration order — the kinds are distinct\n * enough that at most one matches), or `null` when nothing is close enough.\n */\nexport function suggestKnownItemFieldType(value: string): KnownItemFieldType | null {\n const normalized = value.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n const limit = Math.max(1, Math.floor(normalized.length * 0.34));\n for (const candidate of KNOWN_ITEM_FIELD_TYPES) {\n if (levenshteinDistanceWithinLimit(normalized, candidate, limit) !== null) {\n return candidate;\n }\n }\n return null;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAGlG;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAQ,sBAA4C,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvE,CAAC,CAAE,UAAiC;QACpC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAa;IACrD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAChE,KAAK,MAAM,SAAS,IAAI,sBAAsB,EAAE,CAAC;QAC/C,IAAI,8BAA8B,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YAC1E,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","debugId":"557146c8-cf60-5bbf-a59a-606928c536de"}
@@ -1,5 +1,6 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="60ed024d-4341-5166-bd9e-abed9b240b11")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1d92831e-54a7-5c1f-af04-7441908e8e5a")}catch(e){}}();
3
+ import { normalizeItemFieldType } from "./item-field-types.js";
3
4
  import { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from "../shared/constants.js";
4
5
  import { PmCliError } from "../shared/errors.js";
5
6
  const RESERVED_ITEM_FIELD_NAMES = new Set(FRONT_MATTER_KEY_ORDER);
@@ -14,15 +15,7 @@ function normalizeFieldType(value) {
14
15
  if (typeof value !== "string") {
15
16
  return null;
16
17
  }
17
- const normalized = value.trim().toLowerCase();
18
- if (normalized === "string" ||
19
- normalized === "number" ||
20
- normalized === "boolean" ||
21
- normalized === "array" ||
22
- normalized === "object") {
23
- return normalized;
24
- }
25
- return null;
18
+ return normalizeItemFieldType(value);
26
19
  }
27
20
  function cloneFieldValue(value) {
28
21
  try {
@@ -201,4 +194,4 @@ export function applyRegisteredItemFieldDefaultsAndValidation(frontMatter, regis
201
194
  }
202
195
  }
203
196
  //# sourceMappingURL=item-fields.js.map
204
- //# debugId=60ed024d-4341-5166-bd9e-abed9b240b11
197
+ //# debugId=1d92831e-54a7-5c1f-af04-7441908e8e5a
@@ -1 +1 @@
1
- {"version":3,"file":"item-fields.js","sources":["core/extensions/item-fields.ts"],"sourceRoot":"/","sourcesContent":["import type { ExtensionRegistrationRegistry } from \"./loader.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst RESERVED_ITEM_FIELD_NAMES = new Set(FRONT_MATTER_KEY_ORDER);\n\nfunction normalizeFieldName(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction normalizeFieldType(value: unknown): \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim().toLowerCase();\n if (\n normalized === \"string\" ||\n normalized === \"number\" ||\n normalized === \"boolean\" ||\n normalized === \"array\" ||\n normalized === \"object\"\n ) {\n return normalized;\n }\n return null;\n}\n\nfunction cloneFieldValue<T>(value: T): T {\n try {\n return structuredClone(value);\n } catch {\n return value;\n }\n}\n\nfunction parseFieldAssignment(raw: string): { key: string; value: string } {\n const trimmed = raw.trim();\n const separatorIndex = trimmed.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(`--field entries must use name=value syntax, received: ${raw}`, EXIT_CODE.USAGE);\n }\n const key = trimmed.slice(0, separatorIndex).trim();\n const value = trimmed.slice(separatorIndex + 1);\n if (key.length === 0) {\n throw new PmCliError(\"--field entries require a non-empty field name\", EXIT_CODE.USAGE);\n }\n return { key, value };\n}\n\nfunction parseJsonFieldValue(raw: string, fieldName: string, expectedType: \"array\" | \"object\"): unknown {\n try {\n const parsed = JSON.parse(raw);\n if (expectedType === \"array\" && Array.isArray(parsed)) {\n return parsed;\n }\n if (expectedType === \"object\" && typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed)) {\n return parsed;\n }\n } catch {\n // Fall through to the typed usage error below.\n }\n throw new PmCliError(`--field ${fieldName}=... must be valid JSON ${expectedType}`, EXIT_CODE.USAGE);\n}\n\nfunction coerceRegisteredFieldValue(fieldName: string, fieldType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\", raw: string): unknown {\n if (fieldType === \"string\") {\n return raw;\n }\n if (fieldType === \"number\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(`--field ${fieldName}=... must be a number`, EXIT_CODE.USAGE);\n }\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`--field ${fieldName}=... must be a number`, EXIT_CODE.USAGE);\n }\n return parsed;\n }\n if (fieldType === \"boolean\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(`--field ${fieldName}=... must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n }\n return parseJsonFieldValue(raw, fieldName, fieldType);\n}\n\nfunction collectRegisteredFieldDefinitions(\n registrations: ExtensionRegistrationRegistry | null,\n): Map<string, { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }> {\n const definitions = new Map<string, { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }>();\n if (!registrations) {\n return definitions;\n }\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n const fieldType = normalizeFieldType(definition.type);\n if (!fieldName || !fieldType) {\n continue;\n }\n const existing = definitions.get(fieldName);\n if (existing && existing.type !== fieldType) {\n throw new PmCliError(\n `Extension item field \"${fieldName}\" is declared with conflicting types: ${existing.type}, ${fieldType}`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_type_conflict\",\n nextSteps: [\"Make every active extension declaration for this field use the same type.\"],\n },\n );\n }\n definitions.set(fieldName, { name: fieldName, type: fieldType });\n }\n }\n return definitions;\n}\n\nfunction assertNotReservedItemFieldName(fieldName: string): void {\n if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {\n return;\n }\n throw new PmCliError(`Extension item field \"${fieldName}\" collides with reserved item metadata`, EXIT_CODE.USAGE, {\n code: \"extension_item_field_reserved\",\n nextSteps: [\"Rename the extension item field, preferably with an extension-specific prefix.\"],\n });\n}\n\nexport function collectRegisteredItemFieldNames(registrations: ExtensionRegistrationRegistry | null): string[] {\n return [...collectRegisteredFieldDefinitions(registrations).keys()].sort((left, right) => left.localeCompare(right));\n}\n\nexport function parseRegisteredItemFieldAssignments(\n rawFields: string[] | undefined,\n registrations: ExtensionRegistrationRegistry | null,\n): Record<string, unknown> {\n if (!rawFields || rawFields.length === 0) {\n return {};\n }\n const definitions = collectRegisteredFieldDefinitions(registrations);\n const values: Record<string, unknown> = {};\n for (const raw of rawFields) {\n const { key, value } = parseFieldAssignment(raw);\n const definition = definitions.get(key);\n if (!definition) {\n const known = [...definitions.keys()].sort((left, right) => left.localeCompare(right));\n throw new PmCliError(`--field ${key} is not declared by an active extension item-field registration`, EXIT_CODE.USAGE, {\n code: \"extension_item_field_unknown\",\n recovery: { provided_fields: known },\n nextSteps: known.length > 0\n ? [`Use one of the declared fields: ${known.join(\", \")}`]\n : [\"Activate an extension that calls registerItemFields before setting extension fields.\"],\n });\n }\n assertNotReservedItemFieldName(definition.name);\n values[definition.name] = coerceRegisteredFieldValue(definition.name, definition.type, value);\n }\n return values;\n}\n\nfunction isValidFieldType(value: unknown, expectedType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\"): boolean {\n if (expectedType === \"string\") {\n return typeof value === \"string\";\n }\n if (expectedType === \"number\") {\n return typeof value === \"number\" && Number.isFinite(value);\n }\n if (expectedType === \"boolean\") {\n return typeof value === \"boolean\";\n }\n if (expectedType === \"array\") {\n return Array.isArray(value);\n }\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isAllowedFieldValue(value: unknown, allowed: unknown[] | undefined): boolean {\n if (!allowed || allowed.length === 0) {\n return true;\n }\n return allowed.some((candidate) => Object.is(candidate, value));\n}\n\nexport function applyRegisteredItemFieldDefaultsAndValidation(\n frontMatter: Record<string, unknown>,\n registrations: ExtensionRegistrationRegistry | null,\n options: { skipDefaultFields?: ReadonlySet<string> } = {},\n): void {\n if (!registrations) {\n return;\n }\n collectRegisteredFieldDefinitions(registrations);\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n if (!fieldName) {\n continue;\n }\n assertNotReservedItemFieldName(fieldName);\n if (\n !(fieldName in frontMatter) &&\n !options.skipDefaultFields?.has(fieldName) &&\n Object.prototype.hasOwnProperty.call(definition, \"default\")\n ) {\n frontMatter[fieldName] = cloneFieldValue(definition.default);\n }\n\n const currentValue = frontMatter[fieldName];\n if (currentValue === undefined) {\n continue;\n }\n const expectedType = normalizeFieldType(definition.type);\n if (expectedType && !isValidFieldType(currentValue, expectedType)) {\n throw new TypeError(`Item field \"${fieldName}\" must be of type ${expectedType}`);\n }\n\n const allowedValues = Array.isArray(definition.values) ? definition.values : undefined;\n if (!isAllowedFieldValue(currentValue, allowedValues)) {\n throw new TypeError(`Item field \"${fieldName}\" must match one of the configured allowed values`);\n }\n }\n }\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAElE,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IACE,UAAU,KAAK,QAAQ;QACvB,UAAU,KAAK,QAAQ;QACvB,UAAU,KAAK,SAAS;QACxB,UAAU,KAAK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zD,IAAI,YAAY,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,CAAC;gBAClE,MAAM,IAAI,SAAS,CAAC,eAAe,SAAS,qBAAqB,YAAY,EAAE,CAAC,CAAC;YACnF,CAAC;YAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YACvF,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;gBACtD,MAAM,IAAI,SAAS,CAAC,eAAe,SAAS,mDAAmD,CAAC,CAAC;YACnG,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","debugId":"60ed024d-4341-5166-bd9e-abed9b240b11"}
1
+ {"version":3,"file":"item-fields.js","sources":["core/extensions/item-fields.ts"],"sourceRoot":"/","sourcesContent":["import type { ExtensionRegistrationRegistry } from \"./loader.js\";\nimport { normalizeItemFieldType, type KnownItemFieldType } from \"./item-field-types.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst RESERVED_ITEM_FIELD_NAMES = new Set(FRONT_MATTER_KEY_ORDER);\n\nfunction normalizeFieldName(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction normalizeFieldType(value: unknown): KnownItemFieldType | null {\n if (typeof value !== \"string\") {\n return null;\n }\n return normalizeItemFieldType(value);\n}\n\nfunction cloneFieldValue<T>(value: T): T {\n try {\n return structuredClone(value);\n } catch {\n return value;\n }\n}\n\nfunction parseFieldAssignment(raw: string): { key: string; value: string } {\n const trimmed = raw.trim();\n const separatorIndex = trimmed.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(`--field entries must use name=value syntax, received: ${raw}`, EXIT_CODE.USAGE);\n }\n const key = trimmed.slice(0, separatorIndex).trim();\n const value = trimmed.slice(separatorIndex + 1);\n if (key.length === 0) {\n throw new PmCliError(\"--field entries require a non-empty field name\", EXIT_CODE.USAGE);\n }\n return { key, value };\n}\n\nfunction parseJsonFieldValue(raw: string, fieldName: string, expectedType: \"array\" | \"object\"): unknown {\n try {\n const parsed = JSON.parse(raw);\n if (expectedType === \"array\" && Array.isArray(parsed)) {\n return parsed;\n }\n if (expectedType === \"object\" && typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed)) {\n return parsed;\n }\n } catch {\n // Fall through to the typed usage error below.\n }\n throw new PmCliError(`--field ${fieldName}=... must be valid JSON ${expectedType}`, EXIT_CODE.USAGE);\n}\n\nfunction coerceRegisteredFieldValue(fieldName: string, fieldType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\", raw: string): unknown {\n if (fieldType === \"string\") {\n return raw;\n }\n if (fieldType === \"number\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(`--field ${fieldName}=... must be a number`, EXIT_CODE.USAGE);\n }\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`--field ${fieldName}=... must be a number`, EXIT_CODE.USAGE);\n }\n return parsed;\n }\n if (fieldType === \"boolean\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(`--field ${fieldName}=... must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n }\n return parseJsonFieldValue(raw, fieldName, fieldType);\n}\n\nfunction collectRegisteredFieldDefinitions(\n registrations: ExtensionRegistrationRegistry | null,\n): Map<string, { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }> {\n const definitions = new Map<string, { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }>();\n if (!registrations) {\n return definitions;\n }\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n const fieldType = normalizeFieldType(definition.type);\n if (!fieldName || !fieldType) {\n continue;\n }\n const existing = definitions.get(fieldName);\n if (existing && existing.type !== fieldType) {\n throw new PmCliError(\n `Extension item field \"${fieldName}\" is declared with conflicting types: ${existing.type}, ${fieldType}`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_type_conflict\",\n nextSteps: [\"Make every active extension declaration for this field use the same type.\"],\n },\n );\n }\n definitions.set(fieldName, { name: fieldName, type: fieldType });\n }\n }\n return definitions;\n}\n\nfunction assertNotReservedItemFieldName(fieldName: string): void {\n if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {\n return;\n }\n throw new PmCliError(`Extension item field \"${fieldName}\" collides with reserved item metadata`, EXIT_CODE.USAGE, {\n code: \"extension_item_field_reserved\",\n nextSteps: [\"Rename the extension item field, preferably with an extension-specific prefix.\"],\n });\n}\n\nexport function collectRegisteredItemFieldNames(registrations: ExtensionRegistrationRegistry | null): string[] {\n return [...collectRegisteredFieldDefinitions(registrations).keys()].sort((left, right) => left.localeCompare(right));\n}\n\nexport function parseRegisteredItemFieldAssignments(\n rawFields: string[] | undefined,\n registrations: ExtensionRegistrationRegistry | null,\n): Record<string, unknown> {\n if (!rawFields || rawFields.length === 0) {\n return {};\n }\n const definitions = collectRegisteredFieldDefinitions(registrations);\n const values: Record<string, unknown> = {};\n for (const raw of rawFields) {\n const { key, value } = parseFieldAssignment(raw);\n const definition = definitions.get(key);\n if (!definition) {\n const known = [...definitions.keys()].sort((left, right) => left.localeCompare(right));\n throw new PmCliError(`--field ${key} is not declared by an active extension item-field registration`, EXIT_CODE.USAGE, {\n code: \"extension_item_field_unknown\",\n recovery: { provided_fields: known },\n nextSteps: known.length > 0\n ? [`Use one of the declared fields: ${known.join(\", \")}`]\n : [\"Activate an extension that calls registerItemFields before setting extension fields.\"],\n });\n }\n assertNotReservedItemFieldName(definition.name);\n values[definition.name] = coerceRegisteredFieldValue(definition.name, definition.type, value);\n }\n return values;\n}\n\nfunction isValidFieldType(value: unknown, expectedType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\"): boolean {\n if (expectedType === \"string\") {\n return typeof value === \"string\";\n }\n if (expectedType === \"number\") {\n return typeof value === \"number\" && Number.isFinite(value);\n }\n if (expectedType === \"boolean\") {\n return typeof value === \"boolean\";\n }\n if (expectedType === \"array\") {\n return Array.isArray(value);\n }\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isAllowedFieldValue(value: unknown, allowed: unknown[] | undefined): boolean {\n if (!allowed || allowed.length === 0) {\n return true;\n }\n return allowed.some((candidate) => Object.is(candidate, value));\n}\n\nexport function applyRegisteredItemFieldDefaultsAndValidation(\n frontMatter: Record<string, unknown>,\n registrations: ExtensionRegistrationRegistry | null,\n options: { skipDefaultFields?: ReadonlySet<string> } = {},\n): void {\n if (!registrations) {\n return;\n }\n collectRegisteredFieldDefinitions(registrations);\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n if (!fieldName) {\n continue;\n }\n assertNotReservedItemFieldName(fieldName);\n if (\n !(fieldName in frontMatter) &&\n !options.skipDefaultFields?.has(fieldName) &&\n Object.prototype.hasOwnProperty.call(definition, \"default\")\n ) {\n frontMatter[fieldName] = cloneFieldValue(definition.default);\n }\n\n const currentValue = frontMatter[fieldName];\n if (currentValue === undefined) {\n continue;\n }\n const expectedType = normalizeFieldType(definition.type);\n if (expectedType && !isValidFieldType(currentValue, expectedType)) {\n throw new TypeError(`Item field \"${fieldName}\" must be of type ${expectedType}`);\n }\n\n const allowedValues = Array.isArray(definition.values) ? definition.values : undefined;\n if (!isAllowedFieldValue(currentValue, allowedValues)) {\n throw new TypeError(`Item field \"${fieldName}\" must match one of the configured allowed values`);\n }\n }\n }\n}\n"],"names":[],"mappings":";;AACA,OAAO,EAAE,sBAAsB,EAA2B,M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S;YACX,CAAC;YACD,8BAA8B,CAAC,SAAS,CAAC,CAAC;YAC1C,IACE,CAAC,CAAC,SAAS,IAAI,WAAW,CAAC;gBAC3B,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,SAAS,CAAC;gBAC1C,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,EAC3D,CAAC;gBACD,WAAW,CAAC,SAAS,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAC/D,CAAC;YAED,MAAM,YAAY,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/B,SAAS;YACX,CAAC;YACD,MAAM,YAAY,GAAG,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACzD,IAAI,YAAY,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,YAAY,CAAC,EAAE,CAAC;gBAClE,MAAM,IAAI,SAAS,CAAC,eAAe,SAAS,qBAAqB,YAAY,EAAE,CAAC,CAAC;YACnF,CAAC;YAED,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YACvF,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;gBACtD,MAAM,IAAI,SAAS,CAAC,eAAe,SAAS,mDAAmD,CAAC,CAAC;YACnG,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","debugId":"1d92831e-54a7-5c1f-af04-7441908e8e5a"}
@@ -1,7 +1,7 @@
1
1
  export { parseUnknownExtensionCapabilityWarning, parseLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
2
2
  export { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
3
3
  export { runBeforeCommandHooks, runAfterCommandHooks, runOnWriteHooks, runOnReadHooks, runOnIndexHooks, runCommandHandler, runParserOverride, runPreflightOverride, runServiceOverrideSync, runServiceOverride, runCommandOverride, runRendererOverride, } from "./extension-hook-runtime.js";
4
- import { type ExtensionDiscoveryResult, type ExtensionLoadResult, type ExtensionActivationResult, type DiscoverExtensionsOptions } from "./extension-types.js";
4
+ import { type ExtensionDeactivationResult, type ExtensionDiscoveryResult, type ExtensionLoadResult, type ExtensionActivationResult, type DiscoverExtensionsOptions } from "./extension-types.js";
5
5
  export * from "./extension-types.js";
6
6
  export declare function nextExtensionReloadToken(seed?: number): string;
7
7
  export declare function resolveExtensionRoots(pmRoot: string, cwd?: string): {
@@ -10,4 +10,17 @@ export declare function resolveExtensionRoots(pmRoot: string, cwd?: string): {
10
10
  };
11
11
  export declare function discoverExtensions(options: DiscoverExtensionsOptions): Promise<ExtensionDiscoveryResult>;
12
12
  export declare function loadExtensions(options: DiscoverExtensionsOptions): Promise<ExtensionLoadResult>;
13
+ /**
14
+ * Run the optional `deactivate` teardown hook for every loaded extension that
15
+ * exports one. Best-effort: a throwing teardown is captured as a warning and a
16
+ * failure entry rather than propagated, so one extension cannot block another's
17
+ * cleanup. Hosts call this on shutdown/reload (e.g. the MCP server between
18
+ * native-action requests) to release resources opened during `activate`.
19
+ *
20
+ * Pass the `activationResult` to skip extensions whose `activate` failed — they
21
+ * never fully initialized, so (VS Code-style) their `deactivate` must not run.
22
+ * Teardowns run concurrently so one slow hook cannot serialize the rest; the
23
+ * returned warnings/failures preserve loaded order.
24
+ */
25
+ export declare function deactivateExtensions(loadResult: ExtensionLoadResult, activationResult?: Pick<ExtensionActivationResult, "failed">): Promise<ExtensionDeactivationResult>;
13
26
  export declare function activateExtensions(loadResult: ExtensionLoadResult): Promise<ExtensionActivationResult>;
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="54365547-c7be-5bd4-be2e-ca02f27aa365")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e5c4c469-142a-5854-82ca-a920130d2104")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import { pathToFileURL } from "node:url";
@@ -8,6 +8,8 @@ import { isPathWithinDirectory } from "../fs/path-utils.js";
8
8
  import { resolvePmPackageRootFromModule } from "../packages/root.js";
9
9
  import { resolveGlobalPmRoot } from "../store/paths.js";
10
10
  import { asRecordLoose } from "../shared/primitives.js";
11
+ import { flattenFlagListValue, isFlagDefaultValueCoercible, resolveFlagValueKind } from "./flag-value-types.js";
12
+ import { KNOWN_ITEM_FIELD_TYPES, normalizeItemFieldType, suggestKnownItemFieldType } from "./item-field-types.js";
11
13
  // Cohesive helper groups now live in sibling modules. They are imported for the
12
14
  // discovery/activation code that stays here and re-exported below so existing
13
15
  // import sites (sdk/index.ts, commands/extension.ts, health.ts, tests, …) keep
@@ -19,7 +21,7 @@ import { normalizeCommandName, cloneContextSnapshot, } from "./extension-runtime
19
21
  export { parseUnknownExtensionCapabilityWarning, parseLegacyExtensionCapabilityAliasWarning, } from "./extension-capability-aliases.js";
20
22
  export { createEmptyExtensionHookRegistry, createEmptyExtensionCommandRegistry, createEmptyExtensionParserRegistry, createEmptyExtensionPreflightRegistry, createEmptyExtensionServiceRegistry, createEmptyExtensionRendererRegistry, createEmptyExtensionRegistrationRegistry, } from "./extension-registries.js";
21
23
  export { runBeforeCommandHooks, runAfterCommandHooks, runOnWriteHooks, runOnReadHooks, runOnIndexHooks, runCommandHandler, runParserOverride, runPreflightOverride, runServiceOverrideSync, runServiceOverride, runCommandOverride, runRendererOverride, } from "./extension-hook-runtime.js";
22
- import { KNOWN_EXTENSION_SERVICE_NAMES, createDefaultExtensionGovernancePolicy, } from "./extension-types.js";
24
+ import { KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_SERVICE_NAMES, createDefaultExtensionGovernancePolicy, } from "./extension-types.js";
23
25
  export * from "./extension-types.js";
24
26
  const DEFAULT_EXTENSION_PRIORITY = 100;
25
27
  let currentPmCliVersionPromise = null;
@@ -727,24 +729,82 @@ export async function loadExtensions(options) {
727
729
  failed,
728
730
  };
729
731
  }
732
+ function toActivatableExtension(source) {
733
+ // Bind to `source` so a module/default-export authored with methods (or a class
734
+ // instance) keeps its `this` across both lifecycle calls — `activate` is a
735
+ // method call on a fresh object and `deactivate` is invoked bare, so without
736
+ // binding the two would see different (or undefined) `this`.
737
+ const activate = source.activate;
738
+ const activatable = {
739
+ activate: activate.bind(source),
740
+ };
741
+ if (typeof source.deactivate === "function") {
742
+ const deactivate = source.deactivate;
743
+ activatable.deactivate = deactivate.bind(source);
744
+ }
745
+ return activatable;
746
+ }
730
747
  function resolveActivatableExtension(module) {
731
748
  const moduleRecord = asRecordLoose(module);
732
749
  if (!moduleRecord) {
733
750
  return null;
734
751
  }
735
752
  if (typeof moduleRecord.activate === "function") {
736
- return {
737
- activate: moduleRecord.activate,
738
- };
753
+ return toActivatableExtension(moduleRecord);
739
754
  }
740
755
  const defaultExport = asRecordLoose(moduleRecord.default);
741
756
  if (defaultExport && typeof defaultExport.activate === "function") {
742
- return {
743
- activate: defaultExport.activate,
744
- };
757
+ return toActivatableExtension(defaultExport);
745
758
  }
746
759
  return null;
747
760
  }
761
+ /**
762
+ * Run the optional `deactivate` teardown hook for every loaded extension that
763
+ * exports one. Best-effort: a throwing teardown is captured as a warning and a
764
+ * failure entry rather than propagated, so one extension cannot block another's
765
+ * cleanup. Hosts call this on shutdown/reload (e.g. the MCP server between
766
+ * native-action requests) to release resources opened during `activate`.
767
+ *
768
+ * Pass the `activationResult` to skip extensions whose `activate` failed — they
769
+ * never fully initialized, so (VS Code-style) their `deactivate` must not run.
770
+ * Teardowns run concurrently so one slow hook cannot serialize the rest; the
771
+ * returned warnings/failures preserve loaded order.
772
+ */
773
+ export async function deactivateExtensions(loadResult, activationResult) {
774
+ const failedActivationKeys = new Set((activationResult?.failed ?? []).map((entry) => `${entry.layer}:${entry.name}`));
775
+ const targets = [];
776
+ for (const extension of loadResult.loaded) {
777
+ if (failedActivationKeys.has(`${extension.layer}:${extension.name}`)) {
778
+ continue;
779
+ }
780
+ const activatable = resolveActivatableExtension(extension.module);
781
+ if (!activatable || typeof activatable.deactivate !== "function") {
782
+ continue;
783
+ }
784
+ targets.push({ extension, deactivate: activatable.deactivate });
785
+ }
786
+ const outcomes = await Promise.all(targets.map(async ({ extension, deactivate }) => {
787
+ try {
788
+ await deactivate();
789
+ return { ok: true };
790
+ }
791
+ catch (error) {
792
+ return { ok: false, layer: extension.layer, name: extension.name, error: formatUnknownError(error) };
793
+ }
794
+ }));
795
+ const warnings = [];
796
+ const failed = [];
797
+ let deactivated = 0;
798
+ for (const outcome of outcomes) {
799
+ if (outcome.ok) {
800
+ deactivated += 1;
801
+ continue;
802
+ }
803
+ warnings.push(`extension_deactivate_failed:${outcome.layer}:${outcome.name}`);
804
+ failed.push({ layer: outcome.layer, name: outcome.name, error: outcome.error });
805
+ }
806
+ return { deactivated, warnings, failed };
807
+ }
748
808
  function isOutputRendererFormat(value) {
749
809
  return value === "toon" || value === "json";
750
810
  }
@@ -873,6 +933,25 @@ function assertOptionalStringField(name, value) {
873
933
  throw new TypeError(`${name} must be a non-empty string when provided`);
874
934
  }
875
935
  }
936
+ function isFlagDefaultScalar(value) {
937
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
938
+ }
939
+ function assertOptionalFlagDefaultField(name, value) {
940
+ if (value === undefined) {
941
+ return;
942
+ }
943
+ if (Array.isArray(value)) {
944
+ for (const [index, item] of value.entries()) {
945
+ if (!isFlagDefaultScalar(item)) {
946
+ throw new TypeError(`${name}[${index}] must be a string, number, or boolean`);
947
+ }
948
+ }
949
+ return;
950
+ }
951
+ if (!isFlagDefaultScalar(value)) {
952
+ throw new TypeError(`${name} must be a string, number, or boolean, or an array of these when provided`);
953
+ }
954
+ }
876
955
  function assertOptionalStringArrayField(name, value) {
877
956
  if (value === undefined) {
878
957
  return;
@@ -992,6 +1071,42 @@ function validateFlagDefinitions(flags) {
992
1071
  assertOptionalBooleanField(`registerFlags flags[${index}].required`, record.required);
993
1072
  assertOptionalBooleanField(`registerFlags flags[${index}].enabled`, record.enabled);
994
1073
  assertOptionalBooleanField(`registerFlags flags[${index}].visible`, record.visible);
1074
+ assertOptionalBooleanField(`registerFlags flags[${index}].list`, record.list);
1075
+ assertOptionalFlagDefaultField(`registerFlags flags[${index}].default`, record.default);
1076
+ if (Array.isArray(record.default) && record.list !== true) {
1077
+ throw new TypeError(`registerFlags flags[${index}].default cannot be an array unless list is true.`);
1078
+ }
1079
+ assertFlagValueTypeAndDefault(`registerFlags flags[${index}]`, record);
1080
+ }
1081
+ }
1082
+ /**
1083
+ * Reject a declared `value_type`/`type` that is not a known flag value kind, and
1084
+ * a `default` whose value(s) would not cleanly coerce under that kind — so the
1085
+ * typed-flag contract is enforced at registration instead of silently leaving
1086
+ * an untyped value to surface at use time.
1087
+ */
1088
+ function assertFlagValueTypeAndDefault(label, record) {
1089
+ const declaredType = (typeof record.value_type === "string" ? record.value_type : undefined) ??
1090
+ (typeof record.type === "string" ? record.type : undefined);
1091
+ if (declaredType === undefined) {
1092
+ return;
1093
+ }
1094
+ const kind = resolveFlagValueKind(declaredType);
1095
+ if (kind === null) {
1096
+ throw new TypeError(`${label} value_type "${declaredType}" is not a known flag value type (expected one of: string, number, boolean).`);
1097
+ }
1098
+ if (record.default === undefined) {
1099
+ return;
1100
+ }
1101
+ // For list flags, validate the default exactly as the runtime will see it —
1102
+ // comma-joined strings and nested arrays are flattened first — so a valid
1103
+ // default like `value_type: "number", default: "10,20"` is not wrongly rejected.
1104
+ const defaults = record.list === true ? flattenFlagListValue(record.default) : [record.default];
1105
+ for (const [defaultIndex, defaultValue] of defaults.entries()) {
1106
+ if (!isFlagDefaultValueCoercible(defaultValue, kind)) {
1107
+ const suffix = defaults.length > 1 ? `default[${defaultIndex}]` : "default";
1108
+ throw new TypeError(`${label}.${suffix} (${JSON.stringify(defaultValue)}) is not coercible to ${kind}.`);
1109
+ }
995
1110
  }
996
1111
  }
997
1112
  function validateItemFieldDefinitions(fields) {
@@ -1001,7 +1116,13 @@ function validateItemFieldDefinitions(fields) {
1001
1116
  for (const [index, raw] of fields.entries()) {
1002
1117
  const record = asRegistrationRecord(`registerItemFields fields[${index}]`, raw);
1003
1118
  assertNonEmptyString(`registerItemFields fields[${index}].name`, record.name);
1004
- assertNonEmptyString(`registerItemFields fields[${index}].type`, record.type);
1119
+ const fieldType = assertNonEmptyString(`registerItemFields fields[${index}].type`, record.type);
1120
+ if (normalizeItemFieldType(fieldType) === null) {
1121
+ const suggestion = suggestKnownItemFieldType(fieldType);
1122
+ const hint = suggestion ? ` Did you mean "${suggestion}"?` : "";
1123
+ throw new TypeError(`registerItemFields fields[${index}].type "${fieldType}" is not a known field type ` +
1124
+ `(expected one of: ${KNOWN_ITEM_FIELD_TYPES.join(", ")}).${hint}`);
1125
+ }
1005
1126
  assertOptionalBooleanField(`registerItemFields fields[${index}].optional`, record.optional);
1006
1127
  }
1007
1128
  }
@@ -1102,6 +1223,15 @@ function assertExtensionCapability(extension, capability, method) {
1102
1223
  }
1103
1224
  }
1104
1225
  function createExtensionApi(extension, hooks, commands, parsers, preflight, services, renderers, registrations, activationWarnings, policy) {
1226
+ const selfIdentity = Object.freeze({
1227
+ name: extension.name,
1228
+ layer: extension.layer,
1229
+ version: extension.version,
1230
+ capabilities: Object.freeze((extension.capabilities ?? []).filter((capability) => KNOWN_EXTENSION_CAPABILITIES.includes(capability))),
1231
+ pm_min_version: extension.pm_min_version,
1232
+ pm_max_version: extension.pm_max_version,
1233
+ source_package: extension.source_package,
1234
+ });
1105
1235
  const extensionRef = {
1106
1236
  layer: extension.layer,
1107
1237
  name: extension.name,
@@ -1552,6 +1682,7 @@ function createExtensionApi(extension, hooks, commands, parsers, preflight, serv
1552
1682
  });
1553
1683
  };
1554
1684
  return {
1685
+ extension: selfIdentity,
1555
1686
  registerCommand,
1556
1687
  registerParser,
1557
1688
  registerPreflight,
@@ -1769,4 +1900,4 @@ export async function activateExtensions(loadResult) {
1769
1900
  };
1770
1901
  }
1771
1902
  //# sourceMappingURL=loader.js.map
1772
- //# debugId=54365547-c7be-5bd4-be2e-ca02f27aa365
1903
+ //# debugId=e5c4c469-142a-5854-82ca-a920130d2104