@unbrained/pm-cli 2026.6.20 → 2026.6.22

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 (443) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/cli/commands/completion.js +5 -3
  3. package/dist/cli/commands/completion.js.map +1 -1
  4. package/dist/cli/commands/extension/doctor.d.ts +11 -0
  5. package/dist/cli/commands/extension/doctor.js +31 -2
  6. package/dist/cli/commands/extension/doctor.js.map +1 -1
  7. package/dist/cli/commands/extension/scaffold.d.ts +16 -2
  8. package/dist/cli/commands/extension/scaffold.js +499 -20
  9. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  10. package/dist/cli/commands/extension.d.ts +1 -0
  11. package/dist/cli/commands/extension.js +16 -4
  12. package/dist/cli/commands/extension.js.map +1 -1
  13. package/dist/cli/commands/health.js +15 -3
  14. package/dist/cli/commands/health.js.map +1 -1
  15. package/dist/cli/commands/validate.d.ts +1 -1
  16. package/dist/cli/commands/validate.js +44 -2
  17. package/dist/cli/commands/validate.js.map +1 -1
  18. package/dist/cli/help-content.js +16 -4
  19. package/dist/cli/help-content.js.map +1 -1
  20. package/dist/cli/register-setup.js +6 -2
  21. package/dist/cli/register-setup.js.map +1 -1
  22. package/dist/cli-bundle/chunks/{activity-KEEITOTB.js → activity-DXS2XMQU.js} +11 -11
  23. package/dist/cli-bundle/chunks/activity-NEOI45NX.js +18 -0
  24. package/dist/cli-bundle/chunks/{aggregate-5BTHOHW2.js → aggregate-IHM4KMQ3.js} +10 -10
  25. package/dist/cli-bundle/chunks/{aggregate-GB2LJNTZ.js → aggregate-NMYDVQF7.js} +10 -10
  26. package/dist/cli-bundle/chunks/{append-BBM4MNVD.js → append-3HY5G7ET.js} +8 -8
  27. package/dist/cli-bundle/chunks/{append-BFV5UYWS.js → append-K54MDQYC.js} +8 -8
  28. package/dist/cli-bundle/chunks/{chunk-DKWIPIJY.js → chunk-25XZN3JD.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-GF44HVZL.js → chunk-2LEYMXI6.js} +4 -4
  30. package/dist/cli-bundle/chunks/chunk-3GL6LTUL.js +643 -0
  31. package/dist/cli-bundle/chunks/chunk-3GL6LTUL.js.map +1 -0
  32. package/dist/cli-bundle/chunks/{chunk-XNQ3YH6N.js → chunk-3VLPDG3J.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-W2ZESOQE.js → chunk-44O4JIN6.js} +13 -13
  34. package/dist/cli-bundle/chunks/{chunk-RADIHKJ3.js → chunk-47HTJ6BU.js} +5 -5
  35. package/dist/cli-bundle/chunks/{chunk-B3LROPTV.js → chunk-4JXWVHMN.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-HWHZ7EY7.js → chunk-4SDKF5BG.js} +3 -3
  37. package/dist/cli-bundle/chunks/chunk-4YJA4LGU.js +646 -0
  38. package/dist/cli-bundle/chunks/chunk-4YJA4LGU.js.map +7 -0
  39. package/dist/cli-bundle/chunks/{chunk-RNKUCHUQ.js → chunk-5SESR24H.js} +8 -8
  40. package/dist/cli-bundle/chunks/{chunk-RICT5QYR.js → chunk-6FQHNHQQ.js} +3 -3
  41. package/dist/cli-bundle/chunks/{chunk-FA5O2DEG.js → chunk-6UPTNMVW.js} +5 -5
  42. package/dist/cli-bundle/chunks/{chunk-4KFL5OYK.js → chunk-75VEYQJS.js} +3 -3
  43. package/dist/cli-bundle/chunks/{chunk-2ZY5SLNR.js → chunk-77VKGH4L.js} +10 -10
  44. package/dist/cli-bundle/chunks/{chunk-H3ZTSYPA.js → chunk-7GCCDXXN.js} +57 -223
  45. package/dist/cli-bundle/chunks/chunk-7GCCDXXN.js.map +7 -0
  46. package/dist/cli-bundle/chunks/{chunk-6Y7IQ6XN.js → chunk-7MALIV5H.js} +9 -9
  47. package/dist/cli-bundle/chunks/{chunk-MFCFHL27.js → chunk-7MPTFYT3.js} +20 -15
  48. package/dist/cli-bundle/chunks/chunk-7MPTFYT3.js.map +1 -0
  49. package/dist/cli-bundle/chunks/{chunk-NMQNXH4U.js → chunk-7PBGTIN3.js} +5 -5
  50. package/dist/cli-bundle/chunks/{chunk-3KVCMB2M.js → chunk-A25LOPRG.js} +2 -2
  51. package/dist/cli-bundle/chunks/{chunk-6KSFULO6.js → chunk-A7E4ZXG2.js} +2 -2
  52. package/dist/cli-bundle/chunks/{chunk-ZHCSGIUX.js → chunk-AJXYOYJV.js} +2 -2
  53. package/dist/cli-bundle/chunks/{chunk-PF5GLFPU.js → chunk-B2KR24R4.js} +9 -9
  54. package/dist/cli-bundle/chunks/{chunk-ZYG4TR32.js → chunk-C5SWTISA.js} +12 -12
  55. package/dist/cli-bundle/chunks/{chunk-F4EYOSNC.js → chunk-CLLVBO3I.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-5MWA46UN.js → chunk-CR7KFPAQ.js} +61 -4
  57. package/dist/cli-bundle/chunks/chunk-CR7KFPAQ.js.map +7 -0
  58. package/dist/cli-bundle/chunks/{chunk-4PW4C3ZB.js → chunk-CWPBGUC7.js} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-LTUB7ARL.js → chunk-D35LTIFR.js} +57 -216
  60. package/dist/cli-bundle/chunks/chunk-D35LTIFR.js.map +1 -0
  61. package/dist/cli-bundle/chunks/{chunk-J7VSEFWB.js → chunk-DBQUQ3AS.js} +3 -3
  62. package/dist/cli-bundle/chunks/{chunk-2LUNPA3U.js → chunk-DHBPJ7VG.js} +2 -2
  63. package/dist/cli-bundle/chunks/{chunk-6FSPWUBI.js → chunk-DMT4ODVN.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-XXGAWTH5.js → chunk-DU64SZUQ.js} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-CNPWCUDR.js → chunk-EVPVCE4R.js} +3 -3
  66. package/dist/cli-bundle/chunks/{chunk-ACULWT7G.js → chunk-FK6MV5F5.js} +12 -12
  67. package/dist/cli-bundle/chunks/{chunk-XKJDCJEH.js → chunk-GGAXE22C.js} +6 -6
  68. package/dist/cli-bundle/chunks/{chunk-SL233DQD.js → chunk-GNDHOR64.js} +6 -6
  69. package/dist/cli-bundle/chunks/{chunk-U3WTMYBX.js → chunk-GU7YHKYP.js} +2 -2
  70. package/dist/cli-bundle/chunks/{chunk-26OQTCGH.js → chunk-GXBSFKSX.js} +4 -4
  71. package/dist/cli-bundle/chunks/{chunk-AOCYDQLT.js → chunk-H6FNDCDI.js} +5 -5
  72. package/dist/cli-bundle/chunks/{chunk-ICEWMJYH.js → chunk-HYQV75IB.js} +7 -7
  73. package/dist/cli-bundle/chunks/{chunk-5XK2RYJR.js → chunk-I367IDZP.js} +7 -7
  74. package/dist/cli-bundle/chunks/{chunk-E4E7UQBT.js → chunk-I6XE47J2.js} +5 -5
  75. package/dist/cli-bundle/chunks/{chunk-NKTUBA2C.js → chunk-J2TSPY5L.js} +4 -4
  76. package/dist/cli-bundle/chunks/{chunk-IWKD7B33.js → chunk-JINYH2DB.js} +23 -2
  77. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +7 -0
  78. package/dist/cli-bundle/chunks/{chunk-DYOJJTCG.js → chunk-JLSC5NPC.js} +10 -10
  79. package/dist/cli-bundle/chunks/{chunk-FXKPUMIR.js → chunk-JY25IOEZ.js} +5 -5
  80. package/dist/cli-bundle/chunks/{chunk-NCGQ27PK.js → chunk-K25UDYJ4.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-3WAKNI2W.js → chunk-KBTREGVO.js} +3 -3
  82. package/dist/cli-bundle/chunks/{chunk-KCJZREBI.js → chunk-KK4TQ3ZP.js} +2 -2
  83. package/dist/cli-bundle/chunks/{chunk-AZ75OVK4.js → chunk-KL5ELX2X.js} +82 -3
  84. package/dist/cli-bundle/chunks/chunk-KL5ELX2X.js.map +1 -0
  85. package/dist/cli-bundle/chunks/{chunk-7MMXBIRZ.js → chunk-KRJJPDUO.js} +2 -2
  86. package/dist/cli-bundle/chunks/{chunk-BYNJWB5F.js → chunk-MD7XKVWI.js} +7 -7
  87. package/dist/cli-bundle/chunks/{chunk-WFOITX4A.js → chunk-MNGAQB2E.js} +8 -8
  88. package/dist/cli-bundle/chunks/{chunk-II4BRHKM.js → chunk-NIWY4V4Z.js} +3 -3
  89. package/dist/cli-bundle/chunks/{chunk-YT4Z2OVB.js → chunk-NKZOJPXK.js} +3 -3
  90. package/dist/cli-bundle/chunks/{chunk-YBQF4CAW.js → chunk-NVUATMTC.js} +3 -3
  91. package/dist/cli-bundle/chunks/{chunk-FSOJCFDS.js → chunk-P7ZU73BO.js} +55 -5
  92. package/dist/cli-bundle/chunks/chunk-P7ZU73BO.js.map +1 -0
  93. package/dist/cli-bundle/chunks/{chunk-MTQK5ZSB.js → chunk-PCH2JTEO.js} +2 -2
  94. package/dist/cli-bundle/chunks/{chunk-VE3BUO3R.js → chunk-PJS2J7Z4.js} +3 -3
  95. package/dist/cli-bundle/chunks/{chunk-2QJLN4KM.js → chunk-QQWEROGS.js} +7 -7
  96. package/dist/cli-bundle/chunks/{chunk-OLEP5TJH.js → chunk-R2EMWY7Q.js} +24 -3
  97. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +1 -0
  98. package/dist/cli-bundle/chunks/{chunk-6DZO5NN7.js → chunk-RPRFBXND.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-QWAJPGEI.js → chunk-RZZMSY4P.js} +91 -5
  100. package/dist/cli-bundle/chunks/chunk-RZZMSY4P.js.map +7 -0
  101. package/dist/cli-bundle/chunks/{chunk-BBSUVIIT.js → chunk-SFKQAVZA.js} +8 -8
  102. package/dist/cli-bundle/chunks/{chunk-X3CD2VUI.js → chunk-THKDPOS5.js} +8 -8
  103. package/dist/cli-bundle/chunks/{chunk-OVSFW4KD.js → chunk-TIKJAXQW.js} +3 -3
  104. package/dist/cli-bundle/chunks/{chunk-4YMX7XFI.js → chunk-TJABI6PR.js} +5 -5
  105. package/dist/cli-bundle/chunks/{chunk-VONJSFUW.js → chunk-TRUFOER3.js} +19 -14
  106. package/dist/cli-bundle/chunks/{chunk-VONJSFUW.js.map → chunk-TRUFOER3.js.map} +2 -2
  107. package/dist/cli-bundle/chunks/{chunk-AW4PYYNF.js → chunk-TZQKEBKF.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-QUTJOHGK.js → chunk-UKK2VTTH.js} +9 -9
  109. package/dist/cli-bundle/chunks/{chunk-ATRXPXAL.js → chunk-V4SM4UAL.js} +13 -13
  110. package/dist/cli-bundle/chunks/{chunk-6KARQMC6.js → chunk-VB54F347.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-6LTSLEHD.js → chunk-WBSYW3NT.js} +2 -2
  112. package/dist/cli-bundle/chunks/{chunk-4S4INK3B.js → chunk-WQDX7DVG.js} +7 -7
  113. package/dist/cli-bundle/chunks/{chunk-ETJKPURB.js → chunk-XKNF3VRJ.js} +5 -5
  114. package/dist/cli-bundle/chunks/{chunk-BZWIDTDE.js → chunk-Y335KFHD.js} +9 -9
  115. package/dist/cli-bundle/chunks/{chunk-K2LBDYDC.js → chunk-Y4BZEND6.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-EOFROIC5.js → chunk-YATDFWYK.js} +7 -7
  117. package/dist/cli-bundle/chunks/{chunk-EKMHDL6Z.js → chunk-YJICYNAV.js} +8 -8
  118. package/dist/cli-bundle/chunks/{chunk-WMQBNVZL.js → chunk-YQSWTVZF.js} +4 -4
  119. package/dist/cli-bundle/chunks/{chunk-FBBPCSJM.js → chunk-YRLLL5TY.js} +8 -8
  120. package/dist/cli-bundle/chunks/{claim-G57ZJLZ4.js → claim-MPXNVBZQ.js} +10 -10
  121. package/dist/cli-bundle/chunks/{claim-TRSDQO6L.js → claim-SKHJDLW6.js} +10 -10
  122. package/dist/cli-bundle/chunks/{close-4QMUQMON.js → close-4RKSL5L6.js} +8 -8
  123. package/dist/cli-bundle/chunks/close-Z6AI736U.js +15 -0
  124. package/dist/cli-bundle/chunks/{close-many-3UWKJRQK.js → close-many-AWTPXLHJ.js} +15 -15
  125. package/dist/cli-bundle/chunks/{close-many-A7U62CRI.js → close-many-SXODYBDP.js} +15 -15
  126. package/dist/cli-bundle/chunks/{comments-URWDZP2I.js → comments-OOH64LWW.js} +10 -10
  127. package/dist/cli-bundle/chunks/{comments-4EM7XR74.js → comments-YYW5P7AG.js} +10 -10
  128. package/dist/cli-bundle/chunks/{config-PSZ5GWAK.js → config-3445MCQQ.js} +8 -8
  129. package/dist/cli-bundle/chunks/{config-GRJYZ2O3.js → config-LCDMKRB2.js} +8 -8
  130. package/dist/cli-bundle/chunks/{context-BCR34RKM.js → context-DZMIBIVP.js} +13 -13
  131. package/dist/cli-bundle/chunks/{context-A46YAV2F.js → context-PJCURODY.js} +13 -13
  132. package/dist/cli-bundle/chunks/{contracts-JOPCQNDP.js → contracts-7YDFEJB3.js} +4 -4
  133. package/dist/cli-bundle/chunks/{contracts-HPT25X4D.js → contracts-MP2P3HL5.js} +4 -4
  134. package/dist/cli-bundle/chunks/{copy-KBTIUW7L.js → copy-63IQQRRS.js} +7 -7
  135. package/dist/cli-bundle/chunks/{copy-X7V6AEDB.js → copy-TASIH2AZ.js} +7 -7
  136. package/dist/cli-bundle/chunks/create-3BV2VA3Q.js +30 -0
  137. package/dist/cli-bundle/chunks/{create-ZPZKJDFQ.js → create-TGSB5GV4.js} +14 -14
  138. package/dist/cli-bundle/chunks/{delete-FGKVPUQZ.js → delete-ARILQQLB.js} +7 -7
  139. package/dist/cli-bundle/chunks/{delete-2ZI6CJZM.js → delete-ZQKBZYNK.js} +7 -7
  140. package/dist/cli-bundle/chunks/{deps-IUJOBF2H.js → deps-MSHQR2GY.js} +7 -7
  141. package/dist/cli-bundle/chunks/{deps-SJCEFU3C.js → deps-NJFJIMQ5.js} +7 -7
  142. package/dist/cli-bundle/chunks/{docs-UWJ75CKR.js → docs-SS4UKYYA.js} +9 -9
  143. package/dist/cli-bundle/chunks/{docs-2LXF5SVC.js → docs-XK2UVUXX.js} +9 -9
  144. package/dist/cli-bundle/chunks/{eval-ZTT3F3SL.js → eval-FVZGX5IZ.js} +12 -12
  145. package/dist/cli-bundle/chunks/{eval-FRIDCTM2.js → eval-JOTG2YHU.js} +12 -12
  146. package/dist/cli-bundle/chunks/{extension-VRYTNNSV.js → extension-NLMS47I4.js} +6 -5
  147. package/dist/cli-bundle/chunks/{extension-XFQG3BXL.js → extension-OQPS27B4.js} +6 -5
  148. package/dist/cli-bundle/chunks/{files-AJOGTTAN.js → files-3EVJQZ2N.js} +9 -9
  149. package/dist/cli-bundle/chunks/{files-B2RUCA32.js → files-Y2P6LN5A.js} +9 -9
  150. package/dist/cli-bundle/chunks/{focus-7N36RIMT.js → focus-D5ZUPTII.js} +8 -8
  151. package/dist/cli-bundle/chunks/{focus-CFE33IYC.js → focus-ZPIFTY4R.js} +8 -8
  152. package/dist/cli-bundle/chunks/{gc-SBF2FGHK.js → gc-LXXDY456.js} +3 -3
  153. package/dist/cli-bundle/chunks/{gc-OYJK4YBY.js → gc-RNOEQHSX.js} +3 -3
  154. package/dist/cli-bundle/chunks/{get-LLFWSPXW.js → get-Q3SZGQHD.js} +11 -11
  155. package/dist/cli-bundle/chunks/{get-577VLZZ7.js → get-W23G7MJX.js} +11 -11
  156. package/dist/cli-bundle/chunks/{health-PBJS7W2T.js → health-5LHSX365.js} +33 -19
  157. package/dist/cli-bundle/chunks/health-5LHSX365.js.map +7 -0
  158. package/dist/cli-bundle/chunks/{health-C2PUT6JZ.js → health-UDDGJLPP.js} +34 -20
  159. package/dist/cli-bundle/chunks/health-UDDGJLPP.js.map +1 -0
  160. package/dist/cli-bundle/chunks/{history-4FJK6Y3O.js → history-6CZVFIUJ.js} +10 -10
  161. package/dist/cli-bundle/chunks/history-YRQUD4YM.js +20 -0
  162. package/dist/cli-bundle/chunks/{history-compact-AXR6R6GU.js → history-compact-M35PDQ4G.js} +12 -12
  163. package/dist/cli-bundle/chunks/{history-compact-HXF3OT7G.js → history-compact-VWUSQH6Z.js} +12 -12
  164. package/dist/cli-bundle/chunks/history-redact-27OEOZRZ.js +21 -0
  165. package/dist/cli-bundle/chunks/{history-redact-UMPD4G3K.js → history-redact-AJGARHT3.js} +11 -11
  166. package/dist/cli-bundle/chunks/{history-repair-WHOK2ICG.js → history-repair-5RDMF7K4.js} +12 -12
  167. package/dist/cli-bundle/chunks/{history-repair-X57HE5EA.js → history-repair-YUAHIPIN.js} +12 -12
  168. package/dist/cli-bundle/chunks/init-DWAKYRXI.js +21 -0
  169. package/dist/cli-bundle/chunks/{init-N7MIIYCU.js → init-HASX3YNJ.js} +11 -10
  170. package/dist/cli-bundle/chunks/{learnings-GZRBIEAN.js → learnings-JNGUIJDK.js} +10 -10
  171. package/dist/cli-bundle/chunks/{learnings-FPG7WAVW.js → learnings-M4KA6MQE.js} +10 -10
  172. package/dist/cli-bundle/chunks/{list-ZDQ2OBSO.js → list-5UU2W24O.js} +10 -10
  173. package/dist/cli-bundle/chunks/{list-MZBCSKLU.js → list-6FMKTIH3.js} +10 -10
  174. package/dist/cli-bundle/chunks/{notes-LW53PFLH.js → notes-MODH5CBT.js} +10 -10
  175. package/dist/cli-bundle/chunks/{notes-WQAP67EC.js → notes-PYCPLA5Y.js} +10 -10
  176. package/dist/cli-bundle/chunks/{plan-VZKICKIJ.js → plan-DXRIRYRU.js} +14 -14
  177. package/dist/cli-bundle/chunks/{plan-AVJ4VJQO.js → plan-EHQALWSC.js} +14 -14
  178. package/dist/cli-bundle/chunks/{register-list-query-7BD6ZHU5.js → register-list-query-QAASVP2J.js} +19 -19
  179. package/dist/cli-bundle/chunks/{register-list-query-CM4SVAQA.js → register-list-query-WE54YJMH.js} +19 -19
  180. package/dist/cli-bundle/chunks/{register-mutation-ANZIWHUF.js → register-mutation-B6DZJTY2.js} +33 -33
  181. package/dist/cli-bundle/chunks/{register-mutation-PLFHAS4N.js → register-mutation-CPV4C2KR.js} +33 -33
  182. package/dist/cli-bundle/chunks/{register-operations-KQPQIFF2.js → register-operations-AT3BVVX2.js} +32 -32
  183. package/dist/cli-bundle/chunks/{register-operations-VLGCAWIW.js → register-operations-RC4C3423.js} +32 -32
  184. package/dist/cli-bundle/chunks/{register-setup-KPTZ36D4.js → register-setup-HXEHMDHE.js} +23 -18
  185. package/dist/cli-bundle/chunks/register-setup-HXEHMDHE.js.map +7 -0
  186. package/dist/cli-bundle/chunks/{register-setup-TMEF6V7O.js → register-setup-JSMJEFCJ.js} +24 -19
  187. package/dist/cli-bundle/chunks/register-setup-JSMJEFCJ.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{restore-64JKQV7G.js → restore-FNBV4GWE.js} +11 -11
  189. package/dist/cli-bundle/chunks/restore-XY4YE2OV.js +19 -0
  190. package/dist/cli-bundle/chunks/{scheduling-shortcuts-X6D6VSZR.js → scheduling-shortcuts-ECL6GBMZ.js} +14 -14
  191. package/dist/cli-bundle/chunks/{scheduling-shortcuts-4ION7QAX.js → scheduling-shortcuts-JRIUREEU.js} +14 -14
  192. package/dist/cli-bundle/chunks/{schema-TA3NF3RG.js → schema-74YENAJL.js} +9 -9
  193. package/dist/cli-bundle/chunks/{schema-OA4RSVMI.js → schema-TCW3I7QR.js} +9 -9
  194. package/dist/cli-bundle/chunks/{search-UAIHEQZL.js → search-7USZ6XZA.js} +12 -12
  195. package/dist/cli-bundle/chunks/{search-INCM5I4J.js → search-GNAUE65M.js} +12 -12
  196. package/dist/cli-bundle/chunks/{stats-RHEMG4CE.js → stats-CVHASAEU.js} +8 -8
  197. package/dist/cli-bundle/chunks/{stats-WQWTIA5Y.js → stats-DQMKJMFT.js} +8 -8
  198. package/dist/cli-bundle/chunks/{telemetry-XA5D2QEO.js → telemetry-7P5EUWCS.js} +4 -4
  199. package/dist/cli-bundle/chunks/{telemetry-G6UKGKJU.js → telemetry-PQTL5YS2.js} +4 -4
  200. package/dist/cli-bundle/chunks/test-COWPCGBE.js +36 -0
  201. package/dist/cli-bundle/chunks/{test-ZMQF23P3.js → test-FDQZQNZ4.js} +16 -15
  202. package/dist/cli-bundle/chunks/{test-all-ZNQBMUOI.js → test-all-PIPPS4S5.js} +18 -17
  203. package/dist/cli-bundle/chunks/{test-all-ZNQBMUOI.js.map → test-all-PIPPS4S5.js.map} +1 -1
  204. package/dist/cli-bundle/chunks/{test-all-WUBBJCPU.js → test-all-WQIAZVA6.js} +16 -15
  205. package/dist/cli-bundle/chunks/{test-all-WUBBJCPU.js.map → test-all-WQIAZVA6.js.map} +1 -1
  206. package/dist/cli-bundle/chunks/{test-runs-N7LI7HLH.js → test-runs-JS6DNCCI.js} +5 -5
  207. package/dist/cli-bundle/chunks/{test-runs-RFA42EEX.js → test-runs-NZD2QGL5.js} +5 -5
  208. package/dist/cli-bundle/chunks/update-7IYQHX4Q.js +24 -0
  209. package/dist/cli-bundle/chunks/update-IJKDRBIX.js +28 -0
  210. package/dist/cli-bundle/chunks/{update-many-6XFR7TFG.js → update-many-6NTZ5J5D.js} +23 -23
  211. package/dist/cli-bundle/chunks/{update-many-NMRUQZL2.js → update-many-B3TH5TDS.js} +23 -23
  212. package/dist/cli-bundle/chunks/{upgrade-QMCSONWR.js → upgrade-4C7VE7MS.js} +8 -7
  213. package/dist/cli-bundle/chunks/{upgrade-QMCSONWR.js.map → upgrade-4C7VE7MS.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/{upgrade-EJTME2YQ.js → upgrade-76IKZ6EZ.js} +6 -5
  215. package/dist/cli-bundle/chunks/{upgrade-EJTME2YQ.js.map → upgrade-76IKZ6EZ.js.map} +1 -1
  216. package/dist/cli-bundle/chunks/{validate-KIIJY5RC.js → validate-AQU7OCL3.js} +62 -23
  217. package/dist/cli-bundle/chunks/validate-AQU7OCL3.js.map +7 -0
  218. package/dist/cli-bundle/chunks/{validate-3SUCHXXX.js → validate-BPM6Z3OT.js} +63 -24
  219. package/dist/cli-bundle/chunks/validate-BPM6Z3OT.js.map +1 -0
  220. package/dist/cli-bundle/main.js +34 -22
  221. package/dist/cli-bundle/main.js.map +2 -2
  222. package/dist/cli.js +3 -3
  223. package/dist/cli.js.map +1 -1
  224. package/dist/core/diagnostics/remediation.js +23 -2
  225. package/dist/core/diagnostics/remediation.js.map +1 -1
  226. package/dist/core/extensions/capability-usage.d.ts +82 -0
  227. package/dist/core/extensions/capability-usage.js +133 -0
  228. package/dist/core/extensions/capability-usage.js.map +1 -0
  229. package/dist/core/extensions/extension-capability-aliases.d.ts +7 -0
  230. package/dist/core/extensions/extension-capability-aliases.js +12 -2
  231. package/dist/core/extensions/extension-capability-aliases.js.map +1 -1
  232. package/dist/core/extensions/index.d.ts +1 -0
  233. package/dist/core/extensions/index.js +3 -2
  234. package/dist/core/extensions/index.js.map +1 -1
  235. package/dist/core/item/item-format-version.d.ts +87 -0
  236. package/dist/core/item/item-format-version.js +85 -0
  237. package/dist/core/item/item-format-version.js.map +1 -0
  238. package/dist/core/item/item-format.js +8 -2
  239. package/dist/core/item/item-format.js.map +1 -1
  240. package/dist/core/shared/constants.js +3 -2
  241. package/dist/core/shared/constants.js.map +1 -1
  242. package/dist/sdk/cli-contracts.d.ts +1 -0
  243. package/dist/sdk/cli-contracts.js +18 -13
  244. package/dist/sdk/cli-contracts.js.map +1 -1
  245. package/dist/sdk/index.d.ts +7 -2
  246. package/dist/sdk/index.js +8 -3
  247. package/dist/sdk/index.js.map +1 -1
  248. package/dist/sdk/runtime.d.ts +1 -0
  249. package/dist/sdk/runtime.js +3 -2
  250. package/dist/sdk/runtime.js.map +1 -1
  251. package/dist/sdk/testing.d.ts +567 -1
  252. package/dist/sdk/testing.js +573 -18
  253. package/dist/sdk/testing.js.map +1 -1
  254. package/dist/types.d.ts +7 -0
  255. package/dist/types.js +2 -2
  256. package/dist/types.js.map +1 -1
  257. package/docs/ARCHITECTURE.md +2 -0
  258. package/docs/COMMANDS.md +2 -0
  259. package/docs/EXTENSIONS.md +4 -8
  260. package/docs/SDK.md +328 -0
  261. package/package.json +2 -2
  262. package/packages/pm-command-kit/README.md +4 -0
  263. package/packages/pm-todos/extensions/todos/runtime.js +191 -8
  264. package/packages/pm-todos/extensions/todos/runtime.ts +207 -7
  265. package/dist/cli-bundle/chunks/activity-7G7NNNZQ.js +0 -18
  266. package/dist/cli-bundle/chunks/chunk-5MWA46UN.js.map +0 -7
  267. package/dist/cli-bundle/chunks/chunk-AZ75OVK4.js.map +0 -1
  268. package/dist/cli-bundle/chunks/chunk-FSOJCFDS.js.map +0 -1
  269. package/dist/cli-bundle/chunks/chunk-H3ZTSYPA.js.map +0 -7
  270. package/dist/cli-bundle/chunks/chunk-IWKD7B33.js.map +0 -7
  271. package/dist/cli-bundle/chunks/chunk-LTUB7ARL.js.map +0 -1
  272. package/dist/cli-bundle/chunks/chunk-MFCFHL27.js.map +0 -1
  273. package/dist/cli-bundle/chunks/chunk-OLEP5TJH.js.map +0 -1
  274. package/dist/cli-bundle/chunks/chunk-QWAJPGEI.js.map +0 -7
  275. package/dist/cli-bundle/chunks/close-NNZZTZ5V.js +0 -15
  276. package/dist/cli-bundle/chunks/create-4KOAQ6ME.js +0 -30
  277. package/dist/cli-bundle/chunks/health-C2PUT6JZ.js.map +0 -1
  278. package/dist/cli-bundle/chunks/health-PBJS7W2T.js.map +0 -7
  279. package/dist/cli-bundle/chunks/history-ZXNWG6H4.js +0 -20
  280. package/dist/cli-bundle/chunks/history-redact-GV633Z4H.js +0 -21
  281. package/dist/cli-bundle/chunks/init-KQWZSNBX.js +0 -20
  282. package/dist/cli-bundle/chunks/register-setup-KPTZ36D4.js.map +0 -7
  283. package/dist/cli-bundle/chunks/register-setup-TMEF6V7O.js.map +0 -1
  284. package/dist/cli-bundle/chunks/restore-GKM26SAW.js +0 -19
  285. package/dist/cli-bundle/chunks/test-XF7BYLMZ.js +0 -35
  286. package/dist/cli-bundle/chunks/update-CPNOG73P.js +0 -24
  287. package/dist/cli-bundle/chunks/update-T5AYT6ZN.js +0 -28
  288. package/dist/cli-bundle/chunks/validate-3SUCHXXX.js.map +0 -1
  289. package/dist/cli-bundle/chunks/validate-KIIJY5RC.js.map +0 -7
  290. /package/dist/cli-bundle/chunks/{activity-KEEITOTB.js.map → activity-DXS2XMQU.js.map} +0 -0
  291. /package/dist/cli-bundle/chunks/{activity-7G7NNNZQ.js.map → activity-NEOI45NX.js.map} +0 -0
  292. /package/dist/cli-bundle/chunks/{aggregate-5BTHOHW2.js.map → aggregate-IHM4KMQ3.js.map} +0 -0
  293. /package/dist/cli-bundle/chunks/{aggregate-GB2LJNTZ.js.map → aggregate-NMYDVQF7.js.map} +0 -0
  294. /package/dist/cli-bundle/chunks/{append-BBM4MNVD.js.map → append-3HY5G7ET.js.map} +0 -0
  295. /package/dist/cli-bundle/chunks/{append-BFV5UYWS.js.map → append-K54MDQYC.js.map} +0 -0
  296. /package/dist/cli-bundle/chunks/{chunk-DKWIPIJY.js.map → chunk-25XZN3JD.js.map} +0 -0
  297. /package/dist/cli-bundle/chunks/{chunk-GF44HVZL.js.map → chunk-2LEYMXI6.js.map} +0 -0
  298. /package/dist/cli-bundle/chunks/{chunk-XNQ3YH6N.js.map → chunk-3VLPDG3J.js.map} +0 -0
  299. /package/dist/cli-bundle/chunks/{chunk-W2ZESOQE.js.map → chunk-44O4JIN6.js.map} +0 -0
  300. /package/dist/cli-bundle/chunks/{chunk-RADIHKJ3.js.map → chunk-47HTJ6BU.js.map} +0 -0
  301. /package/dist/cli-bundle/chunks/{chunk-B3LROPTV.js.map → chunk-4JXWVHMN.js.map} +0 -0
  302. /package/dist/cli-bundle/chunks/{chunk-HWHZ7EY7.js.map → chunk-4SDKF5BG.js.map} +0 -0
  303. /package/dist/cli-bundle/chunks/{chunk-RNKUCHUQ.js.map → chunk-5SESR24H.js.map} +0 -0
  304. /package/dist/cli-bundle/chunks/{chunk-RICT5QYR.js.map → chunk-6FQHNHQQ.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{chunk-FA5O2DEG.js.map → chunk-6UPTNMVW.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{chunk-4KFL5OYK.js.map → chunk-75VEYQJS.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-2ZY5SLNR.js.map → chunk-77VKGH4L.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-6Y7IQ6XN.js.map → chunk-7MALIV5H.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-NMQNXH4U.js.map → chunk-7PBGTIN3.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-3KVCMB2M.js.map → chunk-A25LOPRG.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-6KSFULO6.js.map → chunk-A7E4ZXG2.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-ZHCSGIUX.js.map → chunk-AJXYOYJV.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-PF5GLFPU.js.map → chunk-B2KR24R4.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-ZYG4TR32.js.map → chunk-C5SWTISA.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-F4EYOSNC.js.map → chunk-CLLVBO3I.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-4PW4C3ZB.js.map → chunk-CWPBGUC7.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-J7VSEFWB.js.map → chunk-DBQUQ3AS.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-2LUNPA3U.js.map → chunk-DHBPJ7VG.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-6FSPWUBI.js.map → chunk-DMT4ODVN.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-XXGAWTH5.js.map → chunk-DU64SZUQ.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-CNPWCUDR.js.map → chunk-EVPVCE4R.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-ACULWT7G.js.map → chunk-FK6MV5F5.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-XKJDCJEH.js.map → chunk-GGAXE22C.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-SL233DQD.js.map → chunk-GNDHOR64.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-U3WTMYBX.js.map → chunk-GU7YHKYP.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-26OQTCGH.js.map → chunk-GXBSFKSX.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-AOCYDQLT.js.map → chunk-H6FNDCDI.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-ICEWMJYH.js.map → chunk-HYQV75IB.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-5XK2RYJR.js.map → chunk-I367IDZP.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-E4E7UQBT.js.map → chunk-I6XE47J2.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{chunk-NKTUBA2C.js.map → chunk-J2TSPY5L.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{chunk-DYOJJTCG.js.map → chunk-JLSC5NPC.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{chunk-FXKPUMIR.js.map → chunk-JY25IOEZ.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{chunk-NCGQ27PK.js.map → chunk-K25UDYJ4.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{chunk-3WAKNI2W.js.map → chunk-KBTREGVO.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{chunk-KCJZREBI.js.map → chunk-KK4TQ3ZP.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{chunk-7MMXBIRZ.js.map → chunk-KRJJPDUO.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{chunk-BYNJWB5F.js.map → chunk-MD7XKVWI.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{chunk-WFOITX4A.js.map → chunk-MNGAQB2E.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{chunk-II4BRHKM.js.map → chunk-NIWY4V4Z.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{chunk-YT4Z2OVB.js.map → chunk-NKZOJPXK.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{chunk-YBQF4CAW.js.map → chunk-NVUATMTC.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{chunk-MTQK5ZSB.js.map → chunk-PCH2JTEO.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{chunk-VE3BUO3R.js.map → chunk-PJS2J7Z4.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{chunk-2QJLN4KM.js.map → chunk-QQWEROGS.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{chunk-6DZO5NN7.js.map → chunk-RPRFBXND.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{chunk-BBSUVIIT.js.map → chunk-SFKQAVZA.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{chunk-X3CD2VUI.js.map → chunk-THKDPOS5.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{chunk-OVSFW4KD.js.map → chunk-TIKJAXQW.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{chunk-4YMX7XFI.js.map → chunk-TJABI6PR.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{chunk-AW4PYYNF.js.map → chunk-TZQKEBKF.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{chunk-QUTJOHGK.js.map → chunk-UKK2VTTH.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{chunk-ATRXPXAL.js.map → chunk-V4SM4UAL.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{chunk-6KARQMC6.js.map → chunk-VB54F347.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{chunk-6LTSLEHD.js.map → chunk-WBSYW3NT.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{chunk-4S4INK3B.js.map → chunk-WQDX7DVG.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{chunk-ETJKPURB.js.map → chunk-XKNF3VRJ.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{chunk-BZWIDTDE.js.map → chunk-Y335KFHD.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{chunk-K2LBDYDC.js.map → chunk-Y4BZEND6.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{chunk-EOFROIC5.js.map → chunk-YATDFWYK.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{chunk-EKMHDL6Z.js.map → chunk-YJICYNAV.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{chunk-WMQBNVZL.js.map → chunk-YQSWTVZF.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{chunk-FBBPCSJM.js.map → chunk-YRLLL5TY.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{claim-G57ZJLZ4.js.map → claim-MPXNVBZQ.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{claim-TRSDQO6L.js.map → claim-SKHJDLW6.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{close-4QMUQMON.js.map → close-4RKSL5L6.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{close-NNZZTZ5V.js.map → close-Z6AI736U.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{close-many-3UWKJRQK.js.map → close-many-AWTPXLHJ.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{close-many-A7U62CRI.js.map → close-many-SXODYBDP.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{comments-URWDZP2I.js.map → comments-OOH64LWW.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{comments-4EM7XR74.js.map → comments-YYW5P7AG.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{config-PSZ5GWAK.js.map → config-3445MCQQ.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{config-GRJYZ2O3.js.map → config-LCDMKRB2.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{context-BCR34RKM.js.map → context-DZMIBIVP.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{context-A46YAV2F.js.map → context-PJCURODY.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{contracts-JOPCQNDP.js.map → contracts-7YDFEJB3.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{contracts-HPT25X4D.js.map → contracts-MP2P3HL5.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{copy-KBTIUW7L.js.map → copy-63IQQRRS.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{copy-X7V6AEDB.js.map → copy-TASIH2AZ.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{create-4KOAQ6ME.js.map → create-3BV2VA3Q.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{create-ZPZKJDFQ.js.map → create-TGSB5GV4.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{delete-FGKVPUQZ.js.map → delete-ARILQQLB.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{delete-2ZI6CJZM.js.map → delete-ZQKBZYNK.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{deps-IUJOBF2H.js.map → deps-MSHQR2GY.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{deps-SJCEFU3C.js.map → deps-NJFJIMQ5.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{docs-UWJ75CKR.js.map → docs-SS4UKYYA.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{docs-2LXF5SVC.js.map → docs-XK2UVUXX.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{eval-ZTT3F3SL.js.map → eval-FVZGX5IZ.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{eval-FRIDCTM2.js.map → eval-JOTG2YHU.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{extension-VRYTNNSV.js.map → extension-NLMS47I4.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{extension-XFQG3BXL.js.map → extension-OQPS27B4.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{files-AJOGTTAN.js.map → files-3EVJQZ2N.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{files-B2RUCA32.js.map → files-Y2P6LN5A.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{focus-7N36RIMT.js.map → focus-D5ZUPTII.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{focus-CFE33IYC.js.map → focus-ZPIFTY4R.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{gc-SBF2FGHK.js.map → gc-LXXDY456.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{gc-OYJK4YBY.js.map → gc-RNOEQHSX.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{get-LLFWSPXW.js.map → get-Q3SZGQHD.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{get-577VLZZ7.js.map → get-W23G7MJX.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{history-4FJK6Y3O.js.map → history-6CZVFIUJ.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{history-ZXNWG6H4.js.map → history-YRQUD4YM.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{history-compact-AXR6R6GU.js.map → history-compact-M35PDQ4G.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{history-compact-HXF3OT7G.js.map → history-compact-VWUSQH6Z.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{history-redact-GV633Z4H.js.map → history-redact-27OEOZRZ.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{history-redact-UMPD4G3K.js.map → history-redact-AJGARHT3.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{history-repair-WHOK2ICG.js.map → history-repair-5RDMF7K4.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{history-repair-X57HE5EA.js.map → history-repair-YUAHIPIN.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{init-KQWZSNBX.js.map → init-DWAKYRXI.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{init-N7MIIYCU.js.map → init-HASX3YNJ.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{learnings-GZRBIEAN.js.map → learnings-JNGUIJDK.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{learnings-FPG7WAVW.js.map → learnings-M4KA6MQE.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{list-ZDQ2OBSO.js.map → list-5UU2W24O.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{list-MZBCSKLU.js.map → list-6FMKTIH3.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{notes-LW53PFLH.js.map → notes-MODH5CBT.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{notes-WQAP67EC.js.map → notes-PYCPLA5Y.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{plan-VZKICKIJ.js.map → plan-DXRIRYRU.js.map} +0 -0
  417. /package/dist/cli-bundle/chunks/{plan-AVJ4VJQO.js.map → plan-EHQALWSC.js.map} +0 -0
  418. /package/dist/cli-bundle/chunks/{register-list-query-7BD6ZHU5.js.map → register-list-query-QAASVP2J.js.map} +0 -0
  419. /package/dist/cli-bundle/chunks/{register-list-query-CM4SVAQA.js.map → register-list-query-WE54YJMH.js.map} +0 -0
  420. /package/dist/cli-bundle/chunks/{register-mutation-ANZIWHUF.js.map → register-mutation-B6DZJTY2.js.map} +0 -0
  421. /package/dist/cli-bundle/chunks/{register-mutation-PLFHAS4N.js.map → register-mutation-CPV4C2KR.js.map} +0 -0
  422. /package/dist/cli-bundle/chunks/{register-operations-KQPQIFF2.js.map → register-operations-AT3BVVX2.js.map} +0 -0
  423. /package/dist/cli-bundle/chunks/{register-operations-VLGCAWIW.js.map → register-operations-RC4C3423.js.map} +0 -0
  424. /package/dist/cli-bundle/chunks/{restore-64JKQV7G.js.map → restore-FNBV4GWE.js.map} +0 -0
  425. /package/dist/cli-bundle/chunks/{restore-GKM26SAW.js.map → restore-XY4YE2OV.js.map} +0 -0
  426. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-X6D6VSZR.js.map → scheduling-shortcuts-ECL6GBMZ.js.map} +0 -0
  427. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-4ION7QAX.js.map → scheduling-shortcuts-JRIUREEU.js.map} +0 -0
  428. /package/dist/cli-bundle/chunks/{schema-TA3NF3RG.js.map → schema-74YENAJL.js.map} +0 -0
  429. /package/dist/cli-bundle/chunks/{schema-OA4RSVMI.js.map → schema-TCW3I7QR.js.map} +0 -0
  430. /package/dist/cli-bundle/chunks/{search-UAIHEQZL.js.map → search-7USZ6XZA.js.map} +0 -0
  431. /package/dist/cli-bundle/chunks/{search-INCM5I4J.js.map → search-GNAUE65M.js.map} +0 -0
  432. /package/dist/cli-bundle/chunks/{stats-RHEMG4CE.js.map → stats-CVHASAEU.js.map} +0 -0
  433. /package/dist/cli-bundle/chunks/{stats-WQWTIA5Y.js.map → stats-DQMKJMFT.js.map} +0 -0
  434. /package/dist/cli-bundle/chunks/{telemetry-XA5D2QEO.js.map → telemetry-7P5EUWCS.js.map} +0 -0
  435. /package/dist/cli-bundle/chunks/{telemetry-G6UKGKJU.js.map → telemetry-PQTL5YS2.js.map} +0 -0
  436. /package/dist/cli-bundle/chunks/{test-XF7BYLMZ.js.map → test-COWPCGBE.js.map} +0 -0
  437. /package/dist/cli-bundle/chunks/{test-ZMQF23P3.js.map → test-FDQZQNZ4.js.map} +0 -0
  438. /package/dist/cli-bundle/chunks/{test-runs-N7LI7HLH.js.map → test-runs-JS6DNCCI.js.map} +0 -0
  439. /package/dist/cli-bundle/chunks/{test-runs-RFA42EEX.js.map → test-runs-NZD2QGL5.js.map} +0 -0
  440. /package/dist/cli-bundle/chunks/{update-CPNOG73P.js.map → update-7IYQHX4Q.js.map} +0 -0
  441. /package/dist/cli-bundle/chunks/{update-T5AYT6ZN.js.map → update-IJKDRBIX.js.map} +0 -0
  442. /package/dist/cli-bundle/chunks/{update-many-6XFR7TFG.js.map → update-many-6NTZ5J5D.js.map} +0 -0
  443. /package/dist/cli-bundle/chunks/{update-many-NMRUQZL2.js.map → update-many-B3TH5TDS.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -5,14 +5,14 @@
5
5
  * Bootstraps the executable pm CLI entrypoint and startup optimizations.
6
6
  */
7
7
 
8
- !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]="50b88050-16c3-5d09-886d-d265e0c50a2c")}catch(e){}}();
8
+ !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]="b1ba95ef-36cf-582b-8e85-d085a047afd2")}catch(e){}}();
9
9
  import fs from "node:fs";
10
10
  import * as nodeModule from "node:module";
11
11
  import os from "node:os";
12
12
  import path from "node:path";
13
13
  import { fileURLToPath } from "node:url";
14
14
  function enableNodeCompileCache() {
15
- const enableCompileCache = nodeModule.enableCompileCache;
15
+ const { enableCompileCache } = nodeModule;
16
16
  if (typeof enableCompileCache !== "function" || process.env.PM_CLI_DISABLE_COMPILE_CACHE === "1") {
17
17
  return;
18
18
  }
@@ -82,4 +82,4 @@ if (!printFastVersionIfRequested()) {
82
82
  await runPmCli(process.argv.slice(2));
83
83
  }
84
84
  //# sourceMappingURL=cli.js.map
85
- //# debugId=50b88050-16c3-5d09-886d-d265e0c50a2c
85
+ //# debugId=b1ba95ef-36cf-582b-8e85-d085a047afd2
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n/**\n * @module cli\n *\n * Bootstraps the executable pm CLI entrypoint and startup optimizations.\n */\nimport fs from \"node:fs\";\nimport * as nodeModule from \"node:module\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nfunction enableNodeCompileCache(): void {\n const enableCompileCache = nodeModule.enableCompileCache as\n | ((cacheDir?: string) => { status?: number; message?: string })\n | undefined;\n if (typeof enableCompileCache !== \"function\" || process.env.PM_CLI_DISABLE_COMPILE_CACHE === \"1\") {\n return;\n }\n const userCacheKey =\n typeof process.getuid === \"function\"\n ? String(process.getuid())\n : os.userInfo().username.replace(/[^a-zA-Z0-9._-]/g, \"_\");\n const cacheDir =\n process.env.PM_CLI_COMPILE_CACHE_DIR ?? path.join(os.tmpdir(), `pm-cli-node-compile-cache-${userCacheKey}`);\n try {\n enableCompileCache(cacheDir);\n } catch {\n // Compile caching is a startup optimization only; never block CLI execution.\n }\n}\n\nfunction findPackageJson(startPath: string): string | undefined {\n let current = path.dirname(path.resolve(startPath));\n while (true) {\n const candidate = path.join(current, \"package.json\");\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\nfunction printFastVersionIfRequested(): boolean {\n const args = process.argv.slice(2);\n const versionArgs = args.filter((arg) => arg !== \"--no-extensions\");\n if (versionArgs.length !== 1 || (versionArgs[0] !== \"--version\" && versionArgs[0] !== \"-V\")) {\n return false;\n }\n const version = readPackageVersionForPath(fileURLToPath(import.meta.url));\n if (version === undefined) {\n return false;\n }\n console.log(version);\n return true;\n}\n\nfunction readPackageVersionForPath(startPath: string): string | undefined {\n const packageJsonPath = findPackageJson(startPath);\n if (!packageJsonPath) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as { version?: unknown };\n if (typeof parsed.version !== \"string\") {\n return undefined;\n }\n return parsed.version;\n } catch {\n return undefined;\n }\n}\n\nexport const _testOnly = {\n enableNodeCompileCache,\n findPackageJson,\n printFastVersionIfRequested,\n readPackageVersionForPath,\n};\n\nif (!printFastVersionIfRequested()) {\n enableNodeCompileCache();\n const { runPmCli } = await import(\"./cli/main.js\");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O,KAAK,QAAQ,EAAE,CAAC;YACvC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,sBAAsB;IACtB,eAAe;IACf,2BAA2B;IAC3B,yBAAyB;CAC1B,CAAC;AAEF,IAAI,CAAC,2BAA2B,EAAE,EAAE,CAAC;IACnC,sBAAsB,EAAE,CAAC;IACzB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IACnD,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC","debugId":"50b88050-16c3-5d09-886d-d265e0c50a2c"}
1
+ {"version":3,"file":"cli.js","sources":["cli.ts"],"sourceRoot":"/","sourcesContent":["#!/usr/bin/env node\n/**\n * @module cli\n *\n * Bootstraps the executable pm CLI entrypoint and startup optimizations.\n */\nimport fs from \"node:fs\";\nimport * as nodeModule from \"node:module\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\ntype NodeModuleWithCompileCache = typeof nodeModule & {\n enableCompileCache?: (cacheDir?: string) => { status?: number; message?: string };\n};\n\nfunction enableNodeCompileCache(): void {\n const { enableCompileCache } = nodeModule as NodeModuleWithCompileCache;\n if (typeof enableCompileCache !== \"function\" || process.env.PM_CLI_DISABLE_COMPILE_CACHE === \"1\") {\n return;\n }\n const userCacheKey =\n typeof process.getuid === \"function\"\n ? String(process.getuid())\n : os.userInfo().username.replace(/[^a-zA-Z0-9._-]/g, \"_\");\n const cacheDir =\n process.env.PM_CLI_COMPILE_CACHE_DIR ?? path.join(os.tmpdir(), `pm-cli-node-compile-cache-${userCacheKey}`);\n try {\n enableCompileCache(cacheDir);\n } catch {\n // Compile caching is a startup optimization only; never block CLI execution.\n }\n}\n\nfunction findPackageJson(startPath: string): string | undefined {\n let current = path.dirname(path.resolve(startPath));\n while (true) {\n const candidate = path.join(current, \"package.json\");\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n return undefined;\n }\n current = parent;\n }\n}\n\nfunction printFastVersionIfRequested(): boolean {\n const args = process.argv.slice(2);\n const versionArgs = args.filter((arg) => arg !== \"--no-extensions\");\n if (versionArgs.length !== 1 || (versionArgs[0] !== \"--version\" && versionArgs[0] !== \"-V\")) {\n return false;\n }\n const version = readPackageVersionForPath(fileURLToPath(import.meta.url));\n if (version === undefined) {\n return false;\n }\n console.log(version);\n return true;\n}\n\nfunction readPackageVersionForPath(startPath: string): string | undefined {\n const packageJsonPath = findPackageJson(startPath);\n if (!packageJsonPath) {\n return undefined;\n }\n try {\n const parsed = JSON.parse(fs.readFileSync(packageJsonPath, \"utf8\")) as { version?: unknown };\n if (typeof parsed.version !== \"string\") {\n return undefined;\n }\n return parsed.version;\n } catch {\n return undefined;\n }\n}\n\nexport const _testOnly = {\n enableNodeCompileCache,\n findPackageJson,\n printFastVersionIfRequested,\n readPackageVersionForPath,\n};\n\nif (!printFastVersionIfRequested()) {\n enableNodeCompileCache();\n const { runPmCli } = await import(\"./cli/main.js\");\n await runPmCli(process.argv.slice(2));\n}\n"],"names":[],"mappings":";AACA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAMzC,SAAS,sBAAsB;IAC7B,MAAM,EAAE,kBAAkB,EAAE,GAAG,UAAwC,CAAC;IACxE,IAAI,OAAO,kBAAkB,KAAK,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,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AC,CAAC;IACnD,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC","debugId":"b1ba95ef-36cf-582b-8e85-d085a047afd2"}
@@ -24,7 +24,7 @@
24
24
  * intentionally excluded here (see pm-0hnu: "all non-extension checks").
25
25
  */
26
26
 
27
- !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]="18ec090a-cfc4-5acf-90b6-7e6fade40d8d")}catch(e){}}();
27
+ !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]="6700669e-bb33-5b85-a194-73e559d13abd")}catch(e){}}();
28
28
  export const REMEDIATION_REGISTRY = Object.freeze([
29
29
  // --- pm health: directories ---
30
30
  {
@@ -131,6 +131,17 @@ export const REMEDIATION_REGISTRY = Object.freeze([
131
131
  command: "pm history-repair <id>",
132
132
  summary: "A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.",
133
133
  },
134
+ // --- pm health (integrity) + pm validate (format_version): item format version ---
135
+ {
136
+ code: "integrity_item_outdated_format_version",
137
+ command: "pm validate --verbose-diagnostics",
138
+ summary: "An item predates the current storage format version; a pm storage migration rewrites it. Use --verbose-diagnostics to list the affected items.",
139
+ },
140
+ {
141
+ code: "integrity_item_ahead_format_version",
142
+ command: "npm install -g @unbrained/pm-cli@latest",
143
+ summary: "An item was written by a newer pm format version than this runtime supports; upgrade pm to read and validate it safely.",
144
+ },
134
145
  // --- pm health: history_drift ---
135
146
  // `pm health` rewrites these commands to `pm history-repair --all` in the
136
147
  // per-check remediation_map when more than one stream is drifted.
@@ -335,6 +346,16 @@ export const REMEDIATION_REGISTRY = Object.freeze([
335
346
  command: 'pm update <id> --replace-tests --test "command=<corrected-command>" [--test ...]',
336
347
  summary: "Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.",
337
348
  },
349
+ {
350
+ code: "validate_format_version_outdated_items",
351
+ command: "pm validate --verbose-diagnostics",
352
+ summary: "One or more items predate the current storage format version; a pm storage migration rewrites them. Use --verbose-diagnostics to list the affected items.",
353
+ },
354
+ {
355
+ code: "validate_format_version_ahead_items",
356
+ command: "npm install -g @unbrained/pm-cli@latest",
357
+ summary: "One or more items were written by a newer pm format version than this runtime supports; upgrade pm to read and validate them safely.",
358
+ },
338
359
  ]);
339
360
  /**
340
361
  * Resolve the remediation entry for a warning token, or `undefined` when no
@@ -391,4 +412,4 @@ export function buildRemediationCommands(warnings) {
391
412
  return Object.values(buildRemediationMap(warnings));
392
413
  }
393
414
  //# sourceMappingURL=remediation.js.map
394
- //# debugId=18ec090a-cfc4-5acf-90b6-7e6fade40d8d
415
+ //# debugId=6700669e-bb33-5b85-a194-73e559d13abd
@@ -1 +1 @@
1
- {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary: \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: extensions ---\n // Most extension findings keep their richer, contextual\n // `details.triage.remediation` and are intentionally absent here. The\n // partial-coverage code is the exception: it is not a per-extension triage\n // result but a system-wide adoption gap (unmanaged installs the update-health\n // scan had to skip), so it has a single deterministic fix and belongs in the\n // shared registry like any other health finding (pm-bdvm).\n {\n code: \"extension_update_health_partial_coverage\",\n command: \"pm extension --adopt-all --project\",\n summary:\n \"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages).\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n {\n code: \"validate_metadata_duplicate_issue_codes\",\n command: 'pm update <id> --title \"<distinct title>\"',\n summary:\n \"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check).\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAAyH;KAC5H;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,6GAA6G;KACvH;IACD,qCAAqC;IACrC;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,yGAAyG;KACnH;IACD;QACE,IAAI,EAAE,iCAAiC;QACvC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,0FAA0F;KACpG;IACD,0CAA0C;IAC1C;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,0FAA0F;KACpG;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,8FAA8F;KACxG;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,OAAO,EAAE,6BAA6B;QACtC,OAAO,EAAE,qGAAqG;KAC/G;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EACL,gIAAgI;KACnI;IACD;QACE,IAAI,EAAE,iCAAiC;QACvC,OA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AC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA0B;IAC5D,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"18ec090a-cfc4-5acf-90b6-7e6fade40d8d"}
1
+ {"version":3,"file":"remediation.js","sources":["core/diagnostics/remediation.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared machine-executable remediation registry.\n *\n * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens\n * (for example `history_drift_missing_stream:pm-abcd` or\n * `validate_resolution_missing_fields:3`). Agents that gate on these commands\n * previously had to hardcode the mapping from a warning code to the `pm` command\n * that fixes it. This module is the single source of truth for that mapping so\n * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`\n * (per-check `fix_hints`) can both surface executable remediation without any\n * duplicated, drift-prone lookup tables.\n *\n * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command\n * an operator/agent should run to resolve findings with that code. Per-item\n * findings use an `<id>` placeholder (callers that have the concrete id may\n * substitute it); findings whose only fix is a manual file edit point at the\n * most useful diagnostic/repair command and describe the manual step in\n * {@link RemediationEntry.summary}.\n */\n\n/** Maps a stable diagnostic warning code to the command and summary that resolve it. */\nexport interface RemediationEntry {\n /**\n * Stable warning-code prefix this entry resolves. A warning matches when it\n * equals this code or begins with `<code>:`. Registry codes are mutually\n * exclusive under that colon-boundary rule (no code is a `:`-delimited prefix\n * of another — e.g. `settings:id_prefix_empty` is distinct from a bare\n * `settings`, which is intentionally not registered), so `resolveRemediation`\n * uses first-match with no ordering dependency.\n */\n readonly code: string;\n /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */\n readonly command: string;\n /** One-line description of what the command does / which manual step it covers. */\n readonly summary: string;\n}\n\n/**\n * Registry of every non-extension `pm health` / `pm validate` warning code and\n * its remediation. Extension findings keep their richer, contextual\n * `details.triage.remediation` produced by the extension health triage and are\n * intentionally excluded here (see pm-0hnu: \"all non-extension checks\").\n */\nexport const REMEDIATION_REGISTRY: readonly RemediationEntry[] = Object.freeze([\n // --- pm health: directories ---\n {\n code: \"missing_directory\",\n command: \"pm init\",\n summary: \"Recreate missing tracker directories (pm init is idempotent and restores the scaffold).\",\n },\n // --- pm health: settings (read/parse) ---\n {\n code: \"settings_read_invalid_json\",\n command: \"pm config list --json\",\n summary:\n \"settings.json is not valid JSON and pm fell back to defaults; fix the syntax error in the reported path, then re-run.\",\n },\n {\n code: \"settings_read_invalid_schema\",\n command: \"pm config list --json\",\n summary:\n \"settings.json failed schema validation and pm fell back to defaults; correct the reported key in the file, then re-run.\",\n },\n {\n code: \"settings_read_merge_failed\",\n command: \"pm config list --json\",\n summary: \"Global/project settings could not be merged; reconcile the conflicting keys in the reported settings files.\",\n },\n // --- pm health: settings_values ---\n {\n code: \"settings:id_prefix_empty\",\n command: \"pm config list --json\",\n summary: 'id_prefix is empty; set a non-empty \"id_prefix\" in settings.json so generated item ids are well-formed.',\n },\n {\n code: \"settings:locks_ttl_non_positive\",\n command: \"pm config list --json\",\n summary: 'locks.ttl_seconds must be positive; set a positive \"locks.ttl_seconds\" in settings.json.',\n },\n // --- pm health: telemetry (advisory) ---\n {\n code: \"telemetry_state_invalid_json\",\n command: \"pm health --check-telemetry\",\n summary: \"Local telemetry state file is corrupt; pm recreates it on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_invalid_rows\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry queue has unparseable rows; they are skipped on the next flush. Advisory only.\",\n },\n {\n code: \"telemetry_queue_pending\",\n command: \"pm health --check-telemetry\",\n summary: \"Telemetry events are queued; they flush automatically on the next reachable command. Advisory only.\",\n },\n {\n code: \"telemetry_queue_high_retries\",\n command: \"pm telemetry flush\",\n summary:\n \"Some queued telemetry events are near retry exhaustion; flush now and verify endpoint reachability before entries are dropped.\",\n },\n {\n code: \"telemetry_endpoint_probe_failed\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint is unreachable; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_endpoint_probe_http_status\",\n command: \"pm health --check-telemetry\",\n summary: \"The telemetry endpoint returned a non-success status; events stay queued until it recovers. Advisory only.\",\n },\n {\n code: \"telemetry_schema_version_behind\",\n command: \"pm health --check-telemetry\",\n summary: \"Client schema is behind server; upgrade pm-cli to emit the latest event shape.\",\n },\n {\n code: \"telemetry_otel_export_failing\",\n command: \"pm health --check-telemetry\",\n summary:\n \"OTLP trace spans are queued but the traces endpoint export is failing; spans retry automatically on the next reachable command, or set PM_TELEMETRY_OTEL_DISABLED=1 to skip OTLP export. Advisory only.\",\n },\n // --- pm health: integrity ---\n {\n code: \"integrity_item_unreadable\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file could not be read; restore or repair the file at the reported path.\",\n },\n {\n code: \"integrity_item_parse_failed\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file failed to parse; fix the malformed front matter at the reported path.\",\n },\n {\n code: \"integrity_item_conflict_marker\",\n command: \"pm validate --check-files --verbose-diagnostics\",\n summary: \"An item file contains Git conflict markers; resolve the <<<<<<< / >>>>>>> markers at the reported line.\",\n },\n {\n code: \"integrity_history_unreadable\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream could not be read; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_invalid_json\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains invalid JSON; re-anchor the affected item's history chain.\",\n },\n {\n code: \"integrity_history_conflict_marker\",\n command: \"pm history-repair <id>\",\n summary: \"A history stream contains Git conflict markers; resolve the markers, then re-anchor the chain.\",\n },\n // --- pm health (integrity) + pm validate (format_version): item format version ---\n {\n code: \"integrity_item_outdated_format_version\",\n command: \"pm validate --verbose-diagnostics\",\n summary: \"An item predates the current storage format version; a pm storage migration rewrites it. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"integrity_item_ahead_format_version\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary: \"An item was written by a newer pm format version than this runtime supports; upgrade pm to read and validate it safely.\",\n },\n // --- pm health: history_drift ---\n // `pm health` rewrites these commands to `pm history-repair --all` in the\n // per-check remediation_map when more than one stream is drifted.\n {\n code: \"history_drift_missing_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item has no history stream; re-anchor the chain to rebuild it (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_unreadable_stream\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history stream is unreadable; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_hash_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's content hash no longer matches its history; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n {\n code: \"history_drift_chain_mismatch\",\n command: \"pm history-repair <id>\",\n summary: \"The item's history chain is broken; re-anchor the chain (pm history-repair --all repairs every drifted stream in one pass).\",\n },\n // --- pm health: storage (history compaction policy) ---\n {\n code: \"history_stream_over_compact_threshold\",\n command: \"pm history-compact <id>\",\n summary: \"The history stream exceeds the configured compaction threshold; compact it (pm history-compact --all-streams sweeps every over-threshold stream in one pass).\",\n },\n // --- pm health: locks ---\n {\n code: \"locks_stale_count\",\n command: \"pm gc --scope locks\",\n summary:\n \"Stale item-claim locks (embedded ttl elapsed) can block mutations; sweep them — gc retains active and unparseable locks.\",\n },\n {\n code: \"locks_unreadable\",\n command: \"pm gc --scope locks --dry-run\",\n summary:\n \"Some lock files could not be read; preview the sweep and inspect the unreadable files manually — gc never deletes what it cannot read.\",\n },\n // --- pm health: extensions ---\n // Most extension findings keep their richer, contextual\n // `details.triage.remediation` and are intentionally absent here. The\n // partial-coverage code is the exception: it is not a per-extension triage\n // result but a system-wide adoption gap (unmanaged installs the update-health\n // scan had to skip), so it has a single deterministic fix and belongs in the\n // shared registry like any other health finding (pm-bdvm).\n {\n code: \"extension_update_health_partial_coverage\",\n command: \"pm extension --adopt-all --project\",\n summary:\n \"Update-health coverage is partial because unmanaged extensions were skipped; adopt the existing installs into managed metadata so the update scan covers them (use --global for global-scope extensions, or pm package --adopt-all when working with packages).\",\n },\n // --- pm health: vectorization ---\n {\n code: \"vectorization_stale_items_remaining\",\n command: \"pm health --refresh-vectors\",\n summary: \"Some items have stale embeddings; refresh vectors so semantic search results stay current.\",\n },\n {\n code: \"vectorization_embedding_identity_changed\",\n command: \"pm reindex --mode semantic\",\n summary: \"Embedding provider/model changed since the last index; run a semantic reindex to rebuild vectors.\",\n },\n // --- pm validate: metadata ---\n // Note: validate_metadata_missing_author has no entry on purpose. `pm update\n // --author` sets the mutation/audit author (history), not the item's\n // `metadata.author` front-matter field, and there is no CLI flag that writes\n // that field — so emitting a command here would record an audit entry without\n // clearing the finding. A missing item author must be restored at the source.\n {\n code: \"validate_metadata_missing_acceptance_criteria\",\n command: 'pm update <id> --acceptance-criteria \"<criteria>\"',\n summary: \"Backfill the missing acceptance criteria on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_estimate\",\n command: 'pm update <id> --estimate \"<estimate>\"',\n summary: \"Backfill the missing estimate on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_close_reason\",\n command: 'pm update <id> --close-reason \"<reason>\"',\n summary: \"Backfill the missing close reason on the reported closed item(s).\",\n },\n {\n code: \"validate_metadata_missing_reviewer\",\n command: 'pm update <id> --reviewer \"<name>\"',\n summary: \"Backfill the missing reviewer on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_risk\",\n command: 'pm update <id> --risk \"<level>\"',\n summary: \"Backfill the missing risk on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_confidence\",\n command: 'pm update <id> --confidence \"<level>\"',\n summary: \"Backfill the missing confidence on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_sprint\",\n command: 'pm update <id> --sprint \"<sprint>\"',\n summary: \"Backfill the missing sprint on the reported item(s).\",\n },\n {\n code: \"validate_metadata_missing_release\",\n command: 'pm update <id> --release \"<release>\"',\n summary: \"Backfill the missing release on the reported item(s).\",\n },\n {\n code: \"validate_metadata_custom_profile_missing_required_fields\",\n command: 'pm config set metadata-required-fields --criterion \"<field>\"',\n summary:\n \"Config-driven finding: the custom metadata profile has no required fields configured and falls back to core, so configure the fields rather than mutating items.\",\n },\n {\n code: \"validate_metadata_duplicate_issue_codes\",\n command: 'pm update <id> --title \"<distinct title>\"',\n summary:\n \"Two or more items share one logical issue code (GH-235); give each a distinct title so the derived code is unique, or close the redundant item with pm close <id> --duplicate-of <canonical-id> (closed-as-duplicate items are excluded from the check).\",\n },\n // --- pm validate: resolution ---\n {\n code: \"validate_resolution_missing_fields\",\n command: 'pm update <id> --resolution \"<how resolved>\"',\n summary: \"Backfill resolution / expected_result / actual_result on the reported closed item(s).\",\n },\n // --- pm validate: lifecycle ---\n {\n code: \"validate_lifecycle_active_closure_like_metadata\",\n command: \"pm update <id> --unset <closure-like-field>\",\n summary:\n \"Clear the closure-like field the validator flags on this active item — the detail row names it (resolution / actual-result / blocked-reason) — or close the item if it is actually done.\",\n },\n {\n code: \"validate_lifecycle_active_terminal_parent\",\n command: \"pm update <id> --parent <active-parent-id>\",\n summary: \"Reopen the terminal parent or move the active child under a non-terminal parent.\",\n },\n {\n code: \"validate_lifecycle_stale_blockers\",\n command: \"pm update <id> --unset blocked-by --unset blocked-reason\",\n summary:\n \"Resolve the stale blocker the validator flags: clear blocked-by/blocked-reason when they linger on a non-blocked item or report a resolved blocker; if instead a blocked item is missing blocker context, add the context or move it out of a blocked status.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles_error\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_lifecycle_dependency_cycles\",\n command: \"pm update <id> --dep-remove <dep-id>\",\n summary: \"Break the dependency cycle by removing one edge from the reported cycle.\",\n },\n {\n code: \"validate_hierarchy_parent_cycle_error\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n {\n code: \"validate_hierarchy_parent_cycle\",\n command: \"pm update <id> --parent <other-id>\",\n summary:\n \"Break the parent-hierarchy cycle by reparenting one item in the reported cycle to a non-cyclic parent (or clear it with pm update <id> --unset parent).\",\n },\n // --- pm validate: files ---\n {\n code: \"validate_files_missing_linked_paths\",\n command: \"pm <files|docs> <id> --remove <path>\",\n summary:\n \"The check spans both item.files and item.docs under one code: restore the missing linked artifact, or unlink it with pm files (linked file) or pm docs (linked doc).\",\n },\n {\n code: \"validate_files_orphaned_paths\",\n command: \"pm <files|docs> <id> --add <path>\",\n summary:\n \"Link the orphaned artifact with pm files (file) or pm docs (doc), or remove it from the workspace.\",\n },\n {\n code: \"validate_files_tracked_all_strict_forces_pm_internals\",\n command: \"pm validate --check-files --include-pm-internals\",\n summary: \"tracked-all-strict scan flagged pm internals; re-run with --include-pm-internals or a softer --scan-mode.\",\n },\n // --- pm validate: history_drift ---\n {\n code: \"validate_history_drift_missing_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items missing a history stream.\",\n },\n {\n code: \"validate_history_drift_unreadable_streams\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with an unreadable history stream.\",\n },\n {\n code: \"validate_history_drift_hash_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items whose content hash drifted.\",\n },\n {\n code: \"validate_history_drift_chain_mismatches\",\n command: \"pm history-repair <id>\",\n summary: \"Re-anchor the history chains of the items with a broken history chain.\",\n },\n // --- pm validate: command_references ---\n {\n code: \"validate_command_references_stale_pm_ids\",\n command: 'pm update <id> --replace-tests --test \"command=<corrected-command>\" [--test ...]',\n summary:\n \"Correct the stale pm-ID inside the item's linked test command (the check scans tests[].command, not the body). --replace-tests overwrites the entire tests list, so re-include the item's other linked tests in the same call.\",\n },\n {\n code: \"validate_format_version_outdated_items\",\n command: \"pm validate --verbose-diagnostics\",\n summary: \"One or more items predate the current storage format version; a pm storage migration rewrites them. Use --verbose-diagnostics to list the affected items.\",\n },\n {\n code: \"validate_format_version_ahead_items\",\n command: \"npm install -g @unbrained/pm-cli@latest\",\n summary: \"One or more items were written by a newer pm format version than this runtime supports; upgrade pm to read and validate them safely.\",\n },\n]);\n\n/**\n * Resolve the remediation entry for a warning token, or `undefined` when no\n * entry is registered. A warning matches an entry when it equals the entry code\n * or begins with `<code>:` (the colon boundary keeps sibling codes such as\n * `validate_lifecycle_dependency_cycles` and\n * `validate_lifecycle_dependency_cycles_error` disjoint).\n *\n * First match is intentional and correct: registry codes are mutually exclusive\n * under the colon-boundary rule, so at most one entry can ever match a warning\n * and order is irrelevant. That invariant is enforced by a test (see\n * remediation-registry.spec.ts \"keeps every registry code mutually exclusive\"),\n * which is why this stays a simple linear scan rather than a longest-prefix\n * search — a longest-prefix tie-break is unreachable with disjoint codes.\n *\n * Accepts unknown input defensively (this is an exported helper SDK consumers\n * may call from untyped JS): a non-string `warning` resolves to `undefined`.\n */\nexport function resolveRemediation(warning: string): RemediationEntry | undefined {\n if (typeof warning !== \"string\") {\n return undefined;\n }\n const normalized = warning.trim();\n for (const entry of REMEDIATION_REGISTRY) {\n if (normalized === entry.code || normalized.startsWith(`${entry.code}:`)) {\n return entry;\n }\n }\n return undefined;\n}\n\n/**\n * Build a compact `remediation_map` (code -> command) for a set of warning\n * tokens. First match wins per code; unknown codes are skipped. Used by\n * `pm health --json` per-check details and as the source of deduped executable\n * commands for `pm validate --fix-hints`.\n */\nexport function buildRemediationMap(warnings: Iterable<string>): Record<string, string> {\n const map: Record<string, string> = {};\n for (const warning of warnings) {\n const entry = resolveRemediation(warning);\n if (entry !== undefined && !Object.prototype.hasOwnProperty.call(map, entry.code)) {\n map[entry.code] = entry.command;\n }\n }\n return map;\n}\n\n/**\n * Build a deduped, ordered list of executable remediation commands for a set of\n * warning tokens (one command per distinct matched code). Used by\n * `pm validate --fix-hints` for checks that do not already emit per-row\n * remediation commands.\n */\nexport function buildRemediationCommands(warnings: Iterable<string>): string[] {\n return Object.values(buildRemediationMap(warnings));\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH;;;;;GAKG;;;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC7E,iCAAiC;IACjC;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,yFAAyF;KACnG;IACD,2CAA2C;IAC3C;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,uHAAuH;KAC1H;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EACL,yHAAyH;KAC5H;IACD;QACE,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,6GAA6G;KACvH;IACD,qCAAqC;IACrC;QACE,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,uBAAuB;QAChC,OAAO,EAAE,yGAAyG;KACnH;IACD;QAC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AI,CAAC,EAAE,CAAC;YAClF,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAA0B;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACtD,CAAC","debugId":"6700669e-bb33-5b85-a194-73e559d13abd"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @module core/extensions/capability-usage
3
+ *
4
+ * Reconciles the capabilities an extension manifest *declares* against the
5
+ * capabilities it actually *exercises* during activation.
6
+ *
7
+ * The loader already enforces the opposite direction — registering a surface
8
+ * whose capability is absent from `manifest.capabilities` throws an
9
+ * `extension_capability_missing` activation failure. This module closes the
10
+ * least-privilege loop by detecting capabilities a manifest declares but never
11
+ * registers against, so package authors can trim manifests to the minimum
12
+ * grant. Every declared-but-unused capability is an over-broad permission a
13
+ * reviewer would otherwise have to catch by hand.
14
+ */
15
+ import type { ExtensionActivationResult, ExtensionCapability, ExtensionLayer } from "./extension-types.js";
16
+ /**
17
+ * Canonical map from each known extension capability to the human-readable
18
+ * registration surfaces that exercise it.
19
+ *
20
+ * The `satisfies Record<ExtensionCapability, ...>` guard makes this exhaustive
21
+ * at compile time: adding a capability to `KNOWN_EXTENSION_CAPABILITIES`
22
+ * without giving it a registration surface here fails the build, which prevents
23
+ * a capability that has *no* surface from being perpetually flagged as unused.
24
+ */
25
+ export declare const EXTENSION_CAPABILITY_REGISTRATION_SURFACES: {
26
+ readonly commands: readonly ["registerCommand", "command override", "command handler"];
27
+ readonly renderers: readonly ["registerRenderer"];
28
+ readonly hooks: readonly ["hooks.beforeCommand", "hooks.afterCommand", "hooks.onWrite", "hooks.onRead", "hooks.onIndex"];
29
+ readonly schema: readonly ["registerFlags", "registerItemFields", "registerItemTypes", "registerMigration"];
30
+ readonly importers: readonly ["registerImporter", "registerExporter"];
31
+ readonly search: readonly ["registerSearchProvider", "registerVectorStoreAdapter"];
32
+ readonly parser: readonly ["registerParser"];
33
+ readonly preflight: readonly ["registerPreflight"];
34
+ readonly services: readonly ["registerService"];
35
+ };
36
+ /**
37
+ * Per-extension reconciliation of declared versus exercised capabilities.
38
+ */
39
+ export interface ExtensionCapabilityUsageReconciliation {
40
+ /** Layer the extension was loaded from (`global` or `project`). */
41
+ layer: ExtensionLayer;
42
+ /** Extension name as it appears in the manifest. */
43
+ name: string;
44
+ /** Known capabilities declared in the manifest, sorted and de-duplicated. */
45
+ declared: ExtensionCapability[];
46
+ /** Known capabilities the extension actually registered against, sorted. */
47
+ used: ExtensionCapability[];
48
+ /** Declared capabilities with no matching registration (least-privilege gap). */
49
+ unused: ExtensionCapability[];
50
+ }
51
+ /**
52
+ * Options for {@link collectUsedExtensionCapabilities}.
53
+ */
54
+ export interface CollectUsedExtensionCapabilitiesOptions {
55
+ /**
56
+ * Restrict the result to a single extension by name. Names are matched
57
+ * case-insensitively after trimming. Omit to union across every extension in
58
+ * the activation result.
59
+ */
60
+ extensionName?: string;
61
+ }
62
+ /**
63
+ * Collect the known capabilities exercised across an activation result.
64
+ *
65
+ * Without {@link CollectUsedExtensionCapabilitiesOptions.extensionName} the
66
+ * result unions every extension in the activation; with it, only the matching
67
+ * extension's registrations contribute (across both layers).
68
+ */
69
+ export declare function collectUsedExtensionCapabilities(activation: ExtensionActivationResult, options?: CollectUsedExtensionCapabilitiesOptions): ExtensionCapability[];
70
+ /**
71
+ * Reconcile each loaded extension's declared capabilities against what it
72
+ * exercised during activation.
73
+ *
74
+ * Extensions with no known declared capabilities are skipped — there is nothing
75
+ * to reconcile. The returned entries preserve every reconcilable extension even
76
+ * when `unused` is empty so callers can report fully-minimal manifests too.
77
+ */
78
+ export declare function reconcileExtensionCapabilityUsage(loaded: ReadonlyArray<{
79
+ layer: ExtensionLayer;
80
+ name: string;
81
+ capabilities?: readonly string[];
82
+ }>, activation: ExtensionActivationResult): ExtensionCapabilityUsageReconciliation[];
@@ -0,0 +1,133 @@
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]="b74f7cd3-95ed-5473-a724-d3afb634a68b")}catch(e){}}();
3
+ import { normalizeKnownExtensionCapability } from "./extension-capability-aliases.js";
4
+ /**
5
+ * Canonical map from each known extension capability to the human-readable
6
+ * registration surfaces that exercise it.
7
+ *
8
+ * The `satisfies Record<ExtensionCapability, ...>` guard makes this exhaustive
9
+ * at compile time: adding a capability to `KNOWN_EXTENSION_CAPABILITIES`
10
+ * without giving it a registration surface here fails the build, which prevents
11
+ * a capability that has *no* surface from being perpetually flagged as unused.
12
+ */
13
+ export const EXTENSION_CAPABILITY_REGISTRATION_SURFACES = {
14
+ commands: ["registerCommand", "command override", "command handler"],
15
+ renderers: ["registerRenderer"],
16
+ hooks: ["hooks.beforeCommand", "hooks.afterCommand", "hooks.onWrite", "hooks.onRead", "hooks.onIndex"],
17
+ schema: ["registerFlags", "registerItemFields", "registerItemTypes", "registerMigration"],
18
+ importers: ["registerImporter", "registerExporter"],
19
+ search: ["registerSearchProvider", "registerVectorStoreAdapter"],
20
+ parser: ["registerParser"],
21
+ preflight: ["registerPreflight"],
22
+ services: ["registerService"],
23
+ };
24
+ // `layer` is a closed enum (`"global" | "project"`) that never contains a
25
+ // colon, so the first colon always separates the layer from the (possibly
26
+ // colon-bearing) name — making the key collision-proof without serialization.
27
+ const USAGE_KEY_SEPARATOR = ":";
28
+ function usageKey(layer, name) {
29
+ return `${layer}${USAGE_KEY_SEPARATOR}${normalizeExtensionName(name)}`;
30
+ }
31
+ function usageKeyName(key) {
32
+ return key.slice(key.indexOf(USAGE_KEY_SEPARATOR) + 1);
33
+ }
34
+ function normalizeExtensionName(name) {
35
+ return name.trim().toLowerCase();
36
+ }
37
+ function normalizeDeclaredCapabilities(capabilities) {
38
+ if (!Array.isArray(capabilities)) {
39
+ return [];
40
+ }
41
+ const known = new Set();
42
+ for (const capability of capabilities) {
43
+ // Unknown capabilities are reported by the separate unknown-capability
44
+ // diagnostic; reconciling them here would double-report a typo as "unused".
45
+ const normalized = normalizeKnownExtensionCapability(capability);
46
+ if (normalized !== null) {
47
+ known.add(normalized);
48
+ }
49
+ }
50
+ return [...known].sort((left, right) => left.localeCompare(right));
51
+ }
52
+ function attributeCapabilityUsage(activation) {
53
+ const usage = new Map();
54
+ const record = (entries, capability) => {
55
+ for (const entry of entries) {
56
+ const key = usageKey(entry.layer, entry.name);
57
+ let exercised = usage.get(key);
58
+ if (exercised === undefined) {
59
+ exercised = new Set();
60
+ usage.set(key, exercised);
61
+ }
62
+ exercised.add(capability);
63
+ }
64
+ };
65
+ const { registrations, commands, parsers, preflight, services, renderers, hooks } = activation;
66
+ record(registrations.commands, "commands");
67
+ record(commands.overrides, "commands");
68
+ record(commands.handlers, "commands");
69
+ record(registrations.flags, "schema");
70
+ record(registrations.item_fields, "schema");
71
+ record(registrations.item_types, "schema");
72
+ record(registrations.migrations, "schema");
73
+ record(registrations.importers, "importers");
74
+ record(registrations.exporters, "importers");
75
+ record(registrations.search_providers, "search");
76
+ record(registrations.vector_store_adapters, "search");
77
+ record(parsers.overrides, "parser");
78
+ record(preflight.overrides, "preflight");
79
+ record(services.overrides, "services");
80
+ record(renderers.overrides, "renderers");
81
+ record(hooks.beforeCommand, "hooks");
82
+ record(hooks.afterCommand, "hooks");
83
+ record(hooks.onWrite, "hooks");
84
+ record(hooks.onRead, "hooks");
85
+ record(hooks.onIndex, "hooks");
86
+ return usage;
87
+ }
88
+ /**
89
+ * Collect the known capabilities exercised across an activation result.
90
+ *
91
+ * Without {@link CollectUsedExtensionCapabilitiesOptions.extensionName} the
92
+ * result unions every extension in the activation; with it, only the matching
93
+ * extension's registrations contribute (across both layers).
94
+ */
95
+ export function collectUsedExtensionCapabilities(activation, options = {}) {
96
+ const usage = attributeCapabilityUsage(activation);
97
+ const filter = options.extensionName !== undefined ? normalizeExtensionName(options.extensionName) : null;
98
+ const used = new Set();
99
+ for (const [key, capabilities] of usage) {
100
+ if (filter !== null && usageKeyName(key) !== filter) {
101
+ continue;
102
+ }
103
+ for (const capability of capabilities) {
104
+ used.add(capability);
105
+ }
106
+ }
107
+ return [...used].sort((left, right) => left.localeCompare(right));
108
+ }
109
+ /**
110
+ * Reconcile each loaded extension's declared capabilities against what it
111
+ * exercised during activation.
112
+ *
113
+ * Extensions with no known declared capabilities are skipped — there is nothing
114
+ * to reconcile. The returned entries preserve every reconcilable extension even
115
+ * when `unused` is empty so callers can report fully-minimal manifests too.
116
+ */
117
+ export function reconcileExtensionCapabilityUsage(loaded, activation) {
118
+ const usage = attributeCapabilityUsage(activation);
119
+ const reconciliations = [];
120
+ for (const extension of loaded) {
121
+ const declared = normalizeDeclaredCapabilities(extension.capabilities);
122
+ if (declared.length === 0) {
123
+ continue;
124
+ }
125
+ const exercised = usage.get(usageKey(extension.layer, extension.name)) ?? new Set();
126
+ const used = [...exercised].sort((left, right) => left.localeCompare(right));
127
+ const unused = declared.filter((capability) => !exercised.has(capability));
128
+ reconciliations.push({ layer: extension.layer, name: extension.name, declared, used, unused });
129
+ }
130
+ return reconciliations;
131
+ }
132
+ //# sourceMappingURL=capability-usage.js.map
133
+ //# debugId=b74f7cd3-95ed-5473-a724-d3afb634a68b
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-usage.js","sources":["core/extensions/capability-usage.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/extensions/capability-usage\n *\n * Reconciles the capabilities an extension manifest *declares* against the\n * capabilities it actually *exercises* during activation.\n *\n * The loader already enforces the opposite direction — registering a surface\n * whose capability is absent from `manifest.capabilities` throws an\n * `extension_capability_missing` activation failure. This module closes the\n * least-privilege loop by detecting capabilities a manifest declares but never\n * registers against, so package authors can trim manifests to the minimum\n * grant. Every declared-but-unused capability is an over-broad permission a\n * reviewer would otherwise have to catch by hand.\n */\nimport type { ExtensionActivationResult, ExtensionCapability, ExtensionLayer } from \"./extension-types.js\";\nimport { normalizeKnownExtensionCapability } from \"./extension-capability-aliases.js\";\n\n/**\n * Canonical map from each known extension capability to the human-readable\n * registration surfaces that exercise it.\n *\n * The `satisfies Record<ExtensionCapability, ...>` guard makes this exhaustive\n * at compile time: adding a capability to `KNOWN_EXTENSION_CAPABILITIES`\n * without giving it a registration surface here fails the build, which prevents\n * a capability that has *no* surface from being perpetually flagged as unused.\n */\nexport const EXTENSION_CAPABILITY_REGISTRATION_SURFACES = {\n commands: [\"registerCommand\", \"command override\", \"command handler\"],\n renderers: [\"registerRenderer\"],\n hooks: [\"hooks.beforeCommand\", \"hooks.afterCommand\", \"hooks.onWrite\", \"hooks.onRead\", \"hooks.onIndex\"],\n schema: [\"registerFlags\", \"registerItemFields\", \"registerItemTypes\", \"registerMigration\"],\n importers: [\"registerImporter\", \"registerExporter\"],\n search: [\"registerSearchProvider\", \"registerVectorStoreAdapter\"],\n parser: [\"registerParser\"],\n preflight: [\"registerPreflight\"],\n services: [\"registerService\"],\n} as const satisfies Record<ExtensionCapability, readonly string[]>;\n\n/**\n * Per-extension reconciliation of declared versus exercised capabilities.\n */\nexport interface ExtensionCapabilityUsageReconciliation {\n /** Layer the extension was loaded from (`global` or `project`). */\n layer: ExtensionLayer;\n /** Extension name as it appears in the manifest. */\n name: string;\n /** Known capabilities declared in the manifest, sorted and de-duplicated. */\n declared: ExtensionCapability[];\n /** Known capabilities the extension actually registered against, sorted. */\n used: ExtensionCapability[];\n /** Declared capabilities with no matching registration (least-privilege gap). */\n unused: ExtensionCapability[];\n}\n\n/**\n * Options for {@link collectUsedExtensionCapabilities}.\n */\nexport interface CollectUsedExtensionCapabilitiesOptions {\n /**\n * Restrict the result to a single extension by name. Names are matched\n * case-insensitively after trimming. Omit to union across every extension in\n * the activation result.\n */\n extensionName?: string;\n}\n\n// `layer` is a closed enum (`\"global\" | \"project\"`) that never contains a\n// colon, so the first colon always separates the layer from the (possibly\n// colon-bearing) name — making the key collision-proof without serialization.\nconst USAGE_KEY_SEPARATOR = \":\";\n\nfunction usageKey(layer: ExtensionLayer, name: string): string {\n return `${layer}${USAGE_KEY_SEPARATOR}${normalizeExtensionName(name)}`;\n}\n\nfunction usageKeyName(key: string): string {\n return key.slice(key.indexOf(USAGE_KEY_SEPARATOR) + 1);\n}\n\nfunction normalizeExtensionName(name: string): string {\n return name.trim().toLowerCase();\n}\n\nfunction normalizeDeclaredCapabilities(capabilities: readonly string[] | undefined): ExtensionCapability[] {\n if (!Array.isArray(capabilities)) {\n return [];\n }\n const known = new Set<ExtensionCapability>();\n for (const capability of capabilities) {\n // Unknown capabilities are reported by the separate unknown-capability\n // diagnostic; reconciling them here would double-report a typo as \"unused\".\n const normalized = normalizeKnownExtensionCapability(capability);\n if (normalized !== null) {\n known.add(normalized);\n }\n }\n return [...known].sort((left, right) => left.localeCompare(right));\n}\n\nfunction attributeCapabilityUsage(activation: ExtensionActivationResult): Map<string, Set<ExtensionCapability>> {\n const usage = new Map<string, Set<ExtensionCapability>>();\n const record = (\n entries: ReadonlyArray<{ layer: ExtensionLayer; name: string }>,\n capability: ExtensionCapability,\n ): void => {\n for (const entry of entries) {\n const key = usageKey(entry.layer, entry.name);\n let exercised = usage.get(key);\n if (exercised === undefined) {\n exercised = new Set<ExtensionCapability>();\n usage.set(key, exercised);\n }\n exercised.add(capability);\n }\n };\n const { registrations, commands, parsers, preflight, services, renderers, hooks } = activation;\n record(registrations.commands, \"commands\");\n record(commands.overrides, \"commands\");\n record(commands.handlers, \"commands\");\n record(registrations.flags, \"schema\");\n record(registrations.item_fields, \"schema\");\n record(registrations.item_types, \"schema\");\n record(registrations.migrations, \"schema\");\n record(registrations.importers, \"importers\");\n record(registrations.exporters, \"importers\");\n record(registrations.search_providers, \"search\");\n record(registrations.vector_store_adapters, \"search\");\n record(parsers.overrides, \"parser\");\n record(preflight.overrides, \"preflight\");\n record(services.overrides, \"services\");\n record(renderers.overrides, \"renderers\");\n record(hooks.beforeCommand, \"hooks\");\n record(hooks.afterCommand, \"hooks\");\n record(hooks.onWrite, \"hooks\");\n record(hooks.onRead, \"hooks\");\n record(hooks.onIndex, \"hooks\");\n return usage;\n}\n\n/**\n * Collect the known capabilities exercised across an activation result.\n *\n * Without {@link CollectUsedExtensionCapabilitiesOptions.extensionName} the\n * result unions every extension in the activation; with it, only the matching\n * extension's registrations contribute (across both layers).\n */\nexport function collectUsedExtensionCapabilities(\n activation: ExtensionActivationResult,\n options: CollectUsedExtensionCapabilitiesOptions = {},\n): ExtensionCapability[] {\n const usage = attributeCapabilityUsage(activation);\n const filter = options.extensionName !== undefined ? normalizeExtensionName(options.extensionName) : null;\n const used = new Set<ExtensionCapability>();\n for (const [key, capabilities] of usage) {\n if (filter !== null && usageKeyName(key) !== filter) {\n continue;\n }\n for (const capability of capabilities) {\n used.add(capability);\n }\n }\n return [...used].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Reconcile each loaded extension's declared capabilities against what it\n * exercised during activation.\n *\n * Extensions with no known declared capabilities are skipped — there is nothing\n * to reconcile. The returned entries preserve every reconcilable extension even\n * when `unused` is empty so callers can report fully-minimal manifests too.\n */\nexport function reconcileExtensionCapabilityUsage(\n loaded: ReadonlyArray<{ layer: ExtensionLayer; name: string; capabilities?: readonly string[] }>,\n activation: ExtensionActivationResult,\n): ExtensionCapabilityUsageReconciliation[] {\n const usage = attributeCapabilityUsage(activation);\n const reconciliations: ExtensionCapabilityUsageReconciliation[] = [];\n for (const extension of loaded) {\n const declared = normalizeDeclaredCapabilities(extension.capabilities);\n if (declared.length === 0) {\n continue;\n }\n const exercised = usage.get(usageKey(extension.layer, extension.name)) ?? new Set<ExtensionCapability>();\n const used = [...exercised].sort((left, right) => left.localeCompare(right));\n const unused = declared.filter((capability) => !exercised.has(capability));\n reconciliations.push({ layer: extension.layer, name: extension.name, declared, used, unused });\n }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,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,GAAG,EAAuB,CAAC;QACzG,MAAM,IAAI,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7E,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3E,eAAe,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC","debugId":"b74f7cd3-95ed-5473-a724-d3afb634a68b"}
@@ -12,6 +12,13 @@ export declare function normalizeNames(values: string[]): string[];
12
12
  * Implements check whether known extension capability for the public runtime surface of this module.
13
13
  */
14
14
  export declare function isKnownExtensionCapability(value: string): value is ExtensionCapability;
15
+ /**
16
+ * Trim and lower-case a capability token, returning it only when it is a known
17
+ * canonical capability (otherwise `null`). Shared so capability normalization
18
+ * and known-capability filtering stay identical across the doctor and the SDK
19
+ * least-privilege helpers.
20
+ */
21
+ export declare function normalizeKnownExtensionCapability(value: string): ExtensionCapability | null;
15
22
  /**
16
23
  * Implements collect unknown extension capabilities for the public runtime surface of this module.
17
24
  */
@@ -4,7 +4,7 @@
4
4
  * Implements extension runtime contracts and governance for Extension Capability Aliases.
5
5
  */
6
6
 
7
- !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]="0be603c7-ab83-5880-a57f-8140caf82657")}catch(e){}}();
7
+ !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]="5723464e-1f10-5a39-96a9-787c0052a036")}catch(e){}}();
8
8
  import { KNOWN_EXTENSION_CAPABILITIES, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES, } from "./extension-types.js";
9
9
  import { levenshteinDistanceWithinLimit } from "../shared/levenshtein.js";
10
10
  /**
@@ -19,6 +19,16 @@ export function normalizeNames(values) {
19
19
  export function isKnownExtensionCapability(value) {
20
20
  return KNOWN_EXTENSION_CAPABILITIES.includes(value);
21
21
  }
22
+ /**
23
+ * Trim and lower-case a capability token, returning it only when it is a known
24
+ * canonical capability (otherwise `null`). Shared so capability normalization
25
+ * and known-capability filtering stay identical across the doctor and the SDK
26
+ * least-privilege helpers.
27
+ */
28
+ export function normalizeKnownExtensionCapability(value) {
29
+ const normalized = value.trim().toLowerCase();
30
+ return isKnownExtensionCapability(normalized) ? normalized : null;
31
+ }
22
32
  /**
23
33
  * Implements collect unknown extension capabilities for the public runtime surface of this module.
24
34
  */
@@ -165,4 +175,4 @@ export function parseLegacyExtensionCapabilityAliasWarning(warning) {
165
175
  return parsed;
166
176
  }
167
177
  //# sourceMappingURL=extension-capability-aliases.js.map
168
- //# debugId=0be603c7-ab83-5880-a57f-8140caf82657
178
+ //# debugId=5723464e-1f10-5a39-96a9-787c0052a036
@@ -1 +1 @@
1
- {"version":3,"file":"extension-capability-aliases.js","sources":["core/extensions/extension-capability-aliases.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/extensions/extension-capability-aliases\n *\n * Implements extension runtime contracts and governance for Extension Capability Aliases.\n */\nimport {\n KNOWN_EXTENSION_CAPABILITIES,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n type ExtensionCapability,\n type ExtensionLayer,\n type LegacyExtensionCapabilityAliasMapping,\n type UnknownExtensionCapabilityWarningDetails,\n} from \"./extension-types.js\";\nimport { levenshteinDistanceWithinLimit } from \"../shared/levenshtein.js\";\n\n/**\n * Implements normalize names for the public runtime surface of this module.\n */\nexport function normalizeNames(values: string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n );\n}\n\n/**\n * Implements check whether known extension capability for the public runtime surface of this module.\n */\nexport function isKnownExtensionCapability(value: string): value is ExtensionCapability {\n return (KNOWN_EXTENSION_CAPABILITIES as readonly string[]).includes(value);\n}\n\n/**\n * Implements collect unknown extension capabilities for the public runtime surface of this module.\n */\nexport function collectUnknownExtensionCapabilities(capabilities: readonly string[]): string[] {\n return capabilities.filter((capability) => !isKnownExtensionCapability(capability));\n}\n\n/**\n * Implements resolve legacy extension capability alias for the public runtime surface of this module.\n */\nexport function resolveLegacyExtensionCapabilityAlias(capability: string): ExtensionCapability | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n return EXTENSION_CAPABILITY_LEGACY_ALIASES[normalized] ?? null;\n}\n\n/**\n * Implements normalize manifest capabilities for the public runtime surface of this module.\n */\nexport function normalizeManifestCapabilities(rawCapabilities: readonly string[]): {\n capabilities: string[];\n legacy_aliases: LegacyExtensionCapabilityAliasMapping[];\n} {\n const normalizedCapabilities = normalizeNames([...rawCapabilities].map((value) => value.toLowerCase()));\n const remappedCapabilities: string[] = [];\n const legacyAliases: LegacyExtensionCapabilityAliasMapping[] = [];\n for (const capability of normalizedCapabilities) {\n const legacyAliasTarget = resolveLegacyExtensionCapabilityAlias(capability);\n if (legacyAliasTarget) {\n remappedCapabilities.push(legacyAliasTarget);\n legacyAliases.push({\n alias: capability,\n target: legacyAliasTarget,\n });\n continue;\n }\n remappedCapabilities.push(capability);\n }\n const dedupedLegacyAliases = [...new Map(legacyAliases.map((entry) => [`${entry.alias}>${entry.target}`, entry])).values()].sort(\n (left, right) => left.alias.localeCompare(right.alias),\n );\n return {\n capabilities: normalizeNames(remappedCapabilities),\n legacy_aliases: dedupedLegacyAliases,\n };\n}\n\n/**\n * Implements suggest known extension capability for the public runtime surface of this module.\n */\nexport function suggestKnownExtensionCapability(capability: string): string | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(normalized);\n if (legacyAlias) {\n return legacyAlias;\n }\n const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));\n let bestMatch: string | null = null;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {\n const distance = levenshteinDistanceWithinLimit(normalized, candidate, maxDistance);\n if (distance !== null && distance < bestDistance) {\n bestDistance = distance;\n bestMatch = candidate;\n }\n }\n return bestMatch;\n}\n\n/**\n * Implements format unknown extension capability warning for the public runtime surface of this module.\n */\nexport function formatUnknownExtensionCapabilityWarning(layer: ExtensionLayer, name: string, capability: string): string {\n const allowed = KNOWN_EXTENSION_CAPABILITIES.join(\",\");\n const suggested = suggestKnownExtensionCapability(capability) ?? \"none\";\n return `extension_capability_unknown:${layer}:${name}:${capability}:allowed=${allowed}:suggested=${suggested}`;\n}\n\n/**\n * Implements format legacy extension capability alias warning for the public runtime surface of this module.\n */\nexport function formatLegacyExtensionCapabilityAliasWarning(\n layer: ExtensionLayer,\n name: string,\n aliases: readonly LegacyExtensionCapabilityAliasMapping[],\n): string {\n const aliasesToken = aliases.map((entry) => `${entry.alias}>${entry.target}`).join(\",\");\n return `extension_capability_legacy_alias:${layer}:${name}:aliases=${aliasesToken}`;\n}\n\n\n/**\n * Implements parse unknown extension capability warning for the public runtime surface of this module.\n */\nexport function parseUnknownExtensionCapabilityWarning(\n warning: string,\n): UnknownExtensionCapabilityWarningDetails | null {\n const match = /^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(\n warning.trim(),\n );\n if (!match) {\n return null;\n }\n const [, layerRaw, name, capability, allowedRaw, suggestedRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowed_capabilities = allowedRaw\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(capability);\n const suggestedFromWarning = suggestedRaw === \"none\" ? undefined : suggestedRaw;\n const suggested_capability = suggestedFromWarning ?? legacyAlias ?? undefined;\n const suggestion_source = suggested_capability\n ? legacyAlias === suggested_capability\n ? \"legacy_alias\"\n : \"nearest_match\"\n : undefined;\n return {\n layer,\n name,\n capability,\n allowed_capabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability,\n suggestion_source,\n legacy_alias_target: legacyAlias ?? undefined,\n };\n}\n\n/**\n * Implements parse legacy extension capability alias warning for the public runtime surface of this module.\n */\nexport function parseLegacyExtensionCapabilityAliasWarning(warning: string): UnknownExtensionCapabilityWarningDetails[] {\n const match = /^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(warning.trim());\n if (!match) {\n return [];\n }\n const [, layerRaw, name, aliasesRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowedCapabilities = [...KNOWN_EXTENSION_CAPABILITIES];\n const parsed: UnknownExtensionCapabilityWarningDetails[] = [];\n for (const token of aliasesRaw.split(\",\")) {\n const [rawAlias, rawTarget] = token.split(\">\");\n const alias = rawAlias?.trim();\n const target = rawTarget?.trim().toLowerCase();\n if (!alias || !target || !isKnownExtensionCapability(target)) {\n continue;\n }\n parsed.push({\n layer,\n name,\n capability: alias,\n allowed_capabilities: allowedCapabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability: target,\n suggestion_source: \"legacy_alias\",\n legacy_alias_target: target,\n });\n }\n return parsed;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH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AM,KAAK,GAAG,2EAA2E,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/G,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;IAC7C,MAAM,KAAK,GAAG,QAA0B,CAAC;IACzC,MAAM,mBAAmB,GAAG,CAAC,GAAG,4BAA4B,CAAC,CAAC;IAC9D,MAAM,MAAM,GAA+C,EAAE,CAAC;IAC9D,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7D,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;YACV,KAAK;YACL,IAAI;YACJ,UAAU,EAAE,KAAK;YACjB,oBAAoB,EAAE,mBAAmB;YACzC,2BAA2B,EAAE,qCAAqC;YAClE,oBAAoB,EAAE,MAAM;YAC5B,iBAAiB,EAAE,cAAc;YACjC,mBAAmB,EAAE,MAAM;SAC5B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"0be603c7-ab83-5880-a57f-8140caf82657"}
1
+ {"version":3,"file":"extension-capability-aliases.js","sources":["core/extensions/extension-capability-aliases.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/extensions/extension-capability-aliases\n *\n * Implements extension runtime contracts and governance for Extension Capability Aliases.\n */\nimport {\n KNOWN_EXTENSION_CAPABILITIES,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n type ExtensionCapability,\n type ExtensionLayer,\n type LegacyExtensionCapabilityAliasMapping,\n type UnknownExtensionCapabilityWarningDetails,\n} from \"./extension-types.js\";\nimport { levenshteinDistanceWithinLimit } from \"../shared/levenshtein.js\";\n\n/**\n * Implements normalize names for the public runtime surface of this module.\n */\nexport function normalizeNames(values: string[]): string[] {\n return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))].sort((a, b) =>\n a.localeCompare(b),\n );\n}\n\n/**\n * Implements check whether known extension capability for the public runtime surface of this module.\n */\nexport function isKnownExtensionCapability(value: string): value is ExtensionCapability {\n return (KNOWN_EXTENSION_CAPABILITIES as readonly string[]).includes(value);\n}\n\n/**\n * Trim and lower-case a capability token, returning it only when it is a known\n * canonical capability (otherwise `null`). Shared so capability normalization\n * and known-capability filtering stay identical across the doctor and the SDK\n * least-privilege helpers.\n */\nexport function normalizeKnownExtensionCapability(value: string): ExtensionCapability | null {\n const normalized = value.trim().toLowerCase();\n return isKnownExtensionCapability(normalized) ? normalized : null;\n}\n\n/**\n * Implements collect unknown extension capabilities for the public runtime surface of this module.\n */\nexport function collectUnknownExtensionCapabilities(capabilities: readonly string[]): string[] {\n return capabilities.filter((capability) => !isKnownExtensionCapability(capability));\n}\n\n/**\n * Implements resolve legacy extension capability alias for the public runtime surface of this module.\n */\nexport function resolveLegacyExtensionCapabilityAlias(capability: string): ExtensionCapability | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n return EXTENSION_CAPABILITY_LEGACY_ALIASES[normalized] ?? null;\n}\n\n/**\n * Implements normalize manifest capabilities for the public runtime surface of this module.\n */\nexport function normalizeManifestCapabilities(rawCapabilities: readonly string[]): {\n capabilities: string[];\n legacy_aliases: LegacyExtensionCapabilityAliasMapping[];\n} {\n const normalizedCapabilities = normalizeNames([...rawCapabilities].map((value) => value.toLowerCase()));\n const remappedCapabilities: string[] = [];\n const legacyAliases: LegacyExtensionCapabilityAliasMapping[] = [];\n for (const capability of normalizedCapabilities) {\n const legacyAliasTarget = resolveLegacyExtensionCapabilityAlias(capability);\n if (legacyAliasTarget) {\n remappedCapabilities.push(legacyAliasTarget);\n legacyAliases.push({\n alias: capability,\n target: legacyAliasTarget,\n });\n continue;\n }\n remappedCapabilities.push(capability);\n }\n const dedupedLegacyAliases = [...new Map(legacyAliases.map((entry) => [`${entry.alias}>${entry.target}`, entry])).values()].sort(\n (left, right) => left.alias.localeCompare(right.alias),\n );\n return {\n capabilities: normalizeNames(remappedCapabilities),\n legacy_aliases: dedupedLegacyAliases,\n };\n}\n\n/**\n * Implements suggest known extension capability for the public runtime surface of this module.\n */\nexport function suggestKnownExtensionCapability(capability: string): string | null {\n const normalized = capability.trim().toLowerCase();\n if (normalized.length === 0) {\n return null;\n }\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(normalized);\n if (legacyAlias) {\n return legacyAlias;\n }\n const maxDistance = Math.max(1, Math.floor(normalized.length * 0.34));\n let bestMatch: string | null = null;\n let bestDistance = Number.POSITIVE_INFINITY;\n for (const candidate of KNOWN_EXTENSION_CAPABILITIES) {\n const distance = levenshteinDistanceWithinLimit(normalized, candidate, maxDistance);\n if (distance !== null && distance < bestDistance) {\n bestDistance = distance;\n bestMatch = candidate;\n }\n }\n return bestMatch;\n}\n\n/**\n * Implements format unknown extension capability warning for the public runtime surface of this module.\n */\nexport function formatUnknownExtensionCapabilityWarning(layer: ExtensionLayer, name: string, capability: string): string {\n const allowed = KNOWN_EXTENSION_CAPABILITIES.join(\",\");\n const suggested = suggestKnownExtensionCapability(capability) ?? \"none\";\n return `extension_capability_unknown:${layer}:${name}:${capability}:allowed=${allowed}:suggested=${suggested}`;\n}\n\n/**\n * Implements format legacy extension capability alias warning for the public runtime surface of this module.\n */\nexport function formatLegacyExtensionCapabilityAliasWarning(\n layer: ExtensionLayer,\n name: string,\n aliases: readonly LegacyExtensionCapabilityAliasMapping[],\n): string {\n const aliasesToken = aliases.map((entry) => `${entry.alias}>${entry.target}`).join(\",\");\n return `extension_capability_legacy_alias:${layer}:${name}:aliases=${aliasesToken}`;\n}\n\n\n/**\n * Implements parse unknown extension capability warning for the public runtime surface of this module.\n */\nexport function parseUnknownExtensionCapabilityWarning(\n warning: string,\n): UnknownExtensionCapabilityWarningDetails | null {\n const match = /^extension_capability_unknown:(global|project):([^:]+):([^:]+):allowed=([^:]+):suggested=([^:]+)$/.exec(\n warning.trim(),\n );\n if (!match) {\n return null;\n }\n const [, layerRaw, name, capability, allowedRaw, suggestedRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowed_capabilities = allowedRaw\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n const legacyAlias = resolveLegacyExtensionCapabilityAlias(capability);\n const suggestedFromWarning = suggestedRaw === \"none\" ? undefined : suggestedRaw;\n const suggested_capability = suggestedFromWarning ?? legacyAlias ?? undefined;\n const suggestion_source = suggested_capability\n ? legacyAlias === suggested_capability\n ? \"legacy_alias\"\n : \"nearest_match\"\n : undefined;\n return {\n layer,\n name,\n capability,\n allowed_capabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability,\n suggestion_source,\n legacy_alias_target: legacyAlias ?? undefined,\n };\n}\n\n/**\n * Implements parse legacy extension capability alias warning for the public runtime surface of this module.\n */\nexport function parseLegacyExtensionCapabilityAliasWarning(warning: string): UnknownExtensionCapabilityWarningDetails[] {\n const match = /^extension_capability_legacy_alias:(global|project):([^:]+):aliases=(.+)$/.exec(warning.trim());\n if (!match) {\n return [];\n }\n const [, layerRaw, name, aliasesRaw] = match;\n const layer = layerRaw as ExtensionLayer;\n const allowedCapabilities = [...KNOWN_EXTENSION_CAPABILITIES];\n const parsed: UnknownExtensionCapabilityWarningDetails[] = [];\n for (const token of aliasesRaw.split(\",\")) {\n const [rawAlias, rawTarget] = token.split(\">\");\n const alias = rawAlias?.trim();\n const target = rawTarget?.trim().toLowerCase();\n if (!alias || !target || !isKnownExtensionCapability(target)) {\n continue;\n }\n parsed.push({\n layer,\n name,\n capability: alias,\n allowed_capabilities: allowedCapabilities,\n capability_contract_version: EXTENSION_CAPABILITY_CONTRACT_VERSION,\n suggested_capability: target,\n suggestion_source: \"legacy_alias\",\n legacy_alias_target: target,\n });\n }\n return parsed;\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EACL,4BAA4B,EAC5B,qCAAqC,EACrC,mCAAmC,GAKpC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAgB;IAC7C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACzG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CACnB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAa;IACtD,OAAQ,4BAAkD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAAa;IAC7D,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,OAAO,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UA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IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7D,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC;YACV,KAAK;YACL,IAAI;YACJ,UAAU,EAAE,KAAK;YACjB,oBAAoB,EAAE,mBAAmB;YACzC,2BAA2B,EAAE,qCAAqC;YAClE,oBAAoB,EAAE,MAAM;YAC5B,iBAAiB,EAAE,cAAc;YACjC,mBAAmB,EAAE,MAAM;SAC5B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","debugId":"5723464e-1f10-5a39-96a9-787c0052a036"}
@@ -113,3 +113,4 @@ export declare function runActiveServiceOverride(service: ExtensionServiceName,
113
113
  */
114
114
  export declare function runActiveServiceOverrideSync(service: ExtensionServiceName, payload: unknown): ServiceOverrideResult;
115
115
  export * from "./loader.js";
116
+ export { EXTENSION_CAPABILITY_REGISTRATION_SURFACES, collectUsedExtensionCapabilities, reconcileExtensionCapabilityUsage, type CollectUsedExtensionCapabilitiesOptions, type ExtensionCapabilityUsageReconciliation, } from "./capability-usage.js";