@unbrained/pm-cli 2026.7.19 → 2026.7.20

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 (600) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +2 -0
  3. package/CHANGELOG.md +36 -0
  4. package/dist/cli/commands/append.js +13 -6
  5. package/dist/cli/commands/append.js.map +1 -1
  6. package/dist/cli/commands/calendar.d.ts +1 -1
  7. package/dist/cli/commands/calendar.js +2 -2
  8. package/dist/cli/commands/calendar.js.map +1 -1
  9. package/dist/cli/commands/comments.js +2 -5
  10. package/dist/cli/commands/comments.js.map +1 -1
  11. package/dist/cli/commands/completion.js +11 -3
  12. package/dist/cli/commands/completion.js.map +1 -1
  13. package/dist/cli/commands/context.d.ts +1 -1
  14. package/dist/cli/commands/context.js +2 -2
  15. package/dist/cli/commands/context.js.map +1 -1
  16. package/dist/cli/commands/contracts.js +4 -3
  17. package/dist/cli/commands/contracts.js.map +1 -1
  18. package/dist/cli/commands/copy.js +5 -3
  19. package/dist/cli/commands/copy.js.map +1 -1
  20. package/dist/cli/commands/create.d.ts +3 -1
  21. package/dist/cli/commands/create.js +5 -3
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/merge.d.ts +8 -0
  24. package/dist/cli/commands/merge.js +12 -0
  25. package/dist/cli/commands/merge.js.map +1 -0
  26. package/dist/cli/commands/plan.d.ts +1 -1
  27. package/dist/cli/commands/plan.js +2 -2
  28. package/dist/cli/commands/plan.js.map +1 -1
  29. package/dist/cli/commands/update-many.d.ts +5 -0
  30. package/dist/cli/commands/update-many.js +81 -6
  31. package/dist/cli/commands/update-many.js.map +1 -1
  32. package/dist/cli/commands/update.d.ts +5 -1
  33. package/dist/cli/commands/update.js +50 -4
  34. package/dist/cli/commands/update.js.map +1 -1
  35. package/dist/cli/register-list-query.js +14 -2
  36. package/dist/cli/register-list-query.js.map +1 -1
  37. package/dist/cli/register-mutation.js +61 -2
  38. package/dist/cli/register-mutation.js.map +1 -1
  39. package/dist/cli/register-operations.js +5 -3
  40. package/dist/cli/register-operations.js.map +1 -1
  41. package/dist/cli/registration-helpers.js +4 -2
  42. package/dist/cli/registration-helpers.js.map +1 -1
  43. package/dist/cli-bundle/bundle-manifest.json +365 -333
  44. package/dist/cli-bundle/chunks/{append-MBXHNWSX.js → append-E6V54WOQ.js} +5 -5
  45. package/dist/cli-bundle/chunks/append-NNJ3EFIT.js +11 -0
  46. package/dist/cli-bundle/chunks/{chunk-M4B4RK4J.js → chunk-2BO4CA46.js} +14 -238
  47. package/dist/cli-bundle/chunks/{chunk-M4B4RK4J.js.map → chunk-2BO4CA46.js.map} +1 -1
  48. package/dist/cli-bundle/chunks/{chunk-MQOSMBWV.js → chunk-3AO5VSDR.js} +25 -6
  49. package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +7 -0
  50. package/dist/cli-bundle/chunks/{chunk-ODEIDKGW.js → chunk-3LPFHE3P.js} +596 -154
  51. package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +1 -0
  52. package/dist/cli-bundle/chunks/{chunk-YGEA4CLH.js → chunk-3MCTMJXI.js} +4 -4
  53. package/dist/cli-bundle/chunks/{chunk-N7FCFJ76.js → chunk-3P7UJQOX.js} +2 -2
  54. package/dist/cli-bundle/chunks/{chunk-7B7IHMLH.js → chunk-3VY6MIEO.js} +3 -3
  55. package/dist/cli-bundle/chunks/{chunk-3EZZTFL2.js → chunk-4F6BWJ4J.js} +51 -43
  56. package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +7 -0
  57. package/dist/cli-bundle/chunks/{chunk-VA3H7VVC.js → chunk-4L23AGQ7.js} +9 -7
  58. package/dist/cli-bundle/chunks/chunk-4L23AGQ7.js.map +1 -0
  59. package/dist/cli-bundle/chunks/{chunk-5S6IZXK7.js → chunk-4U4Z6AHI.js} +7 -7
  60. package/dist/cli-bundle/chunks/{chunk-UOIFZ66L.js → chunk-4XGJLADW.js} +3 -3
  61. package/dist/cli-bundle/chunks/{chunk-SUNZKVAH.js → chunk-5IZJWSDB.js} +5 -5
  62. package/dist/cli-bundle/chunks/{chunk-QQ77W23U.js → chunk-5NTE36LD.js} +4 -4
  63. package/dist/cli-bundle/chunks/{chunk-EVAN5VJA.js → chunk-5OK4UGFV.js} +5 -8
  64. package/dist/cli-bundle/chunks/{chunk-EVAN5VJA.js.map → chunk-5OK4UGFV.js.map} +2 -2
  65. package/dist/cli-bundle/chunks/{chunk-H3YKUVDR.js → chunk-5UX66S6U.js} +26 -7
  66. package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +1 -0
  67. package/dist/cli-bundle/chunks/{chunk-KGPLSHJD.js → chunk-6C2ZZX5Z.js} +2 -2
  68. package/dist/cli-bundle/chunks/{chunk-Q5NHJ6RO.js → chunk-6JUTHVQS.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-NTS2RKHN.js → chunk-6VIJ7UA5.js} +15 -15
  70. package/dist/cli-bundle/chunks/{chunk-BBGR4FKQ.js → chunk-6XMUURSS.js} +6 -6
  71. package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-XVB6BATY.js → chunk-72LQ4TKV.js} +3 -3
  73. package/dist/cli-bundle/chunks/{chunk-WCBB6VI3.js → chunk-7AVEY74G.js} +8 -5
  74. package/dist/cli-bundle/chunks/chunk-7AVEY74G.js.map +7 -0
  75. package/dist/cli-bundle/chunks/{chunk-YG56M3NE.js → chunk-7DOJC3HS.js} +8 -8
  76. package/dist/cli-bundle/chunks/chunk-7DOJC3HS.js.map +1 -0
  77. package/dist/cli-bundle/chunks/{chunk-KZ5AC6B5.js → chunk-7WCE6Y64.js} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-VQOG2ETB.js → chunk-AF2CCM5U.js} +4 -4
  79. package/dist/cli-bundle/chunks/{chunk-P24ZU5QV.js → chunk-AOEOYL3S.js} +49 -12
  80. package/dist/cli-bundle/chunks/chunk-AOEOYL3S.js.map +7 -0
  81. package/dist/cli-bundle/chunks/{chunk-BZKE2O5V.js → chunk-BKIAH72N.js} +8 -6
  82. package/dist/cli-bundle/chunks/chunk-BKIAH72N.js.map +1 -0
  83. package/dist/cli-bundle/chunks/{chunk-RWAIRGBC.js → chunk-C3KD7U3T.js} +12 -243
  84. package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +7 -0
  85. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +334 -0
  86. package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +1 -0
  87. package/dist/cli-bundle/chunks/{chunk-TELI67UP.js → chunk-CQTQKUUV.js} +6 -9
  88. package/dist/cli-bundle/chunks/{chunk-TELI67UP.js.map → chunk-CQTQKUUV.js.map} +1 -1
  89. package/dist/cli-bundle/chunks/{chunk-ZUCBPXNA.js → chunk-D6NXDNP3.js} +5 -5
  90. package/dist/cli-bundle/chunks/chunk-D6NXDNP3.js.map +7 -0
  91. package/dist/cli-bundle/chunks/{chunk-EAV3P54W.js → chunk-DAQ45GCS.js} +5 -5
  92. package/dist/cli-bundle/chunks/{chunk-6V4T4RD3.js → chunk-DVDBQA3B.js} +79 -22
  93. package/dist/cli-bundle/chunks/chunk-DVDBQA3B.js.map +1 -0
  94. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +249 -0
  95. package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +7 -0
  96. package/dist/cli-bundle/chunks/{chunk-ZF52NVRT.js → chunk-E7ICD63T.js} +131 -179
  97. package/dist/cli-bundle/chunks/chunk-E7ICD63T.js.map +7 -0
  98. package/dist/cli-bundle/chunks/{chunk-RX53WHFI.js → chunk-EJDGV4GR.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-IXG5CMBR.js → chunk-FDHPAVVB.js} +4 -4
  100. package/dist/cli-bundle/chunks/{chunk-KAE727L2.js → chunk-FSRHYUDA.js} +2 -2
  101. package/dist/cli-bundle/chunks/chunk-FSRHYUDA.js.map +7 -0
  102. package/dist/cli-bundle/chunks/{chunk-46Z6FAVP.js → chunk-G3COA6GS.js} +51 -43
  103. package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +1 -0
  104. package/dist/cli-bundle/chunks/{chunk-A4FVWFZY.js → chunk-GFQP7HAZ.js} +8 -6
  105. package/dist/cli-bundle/chunks/chunk-GFQP7HAZ.js.map +7 -0
  106. package/dist/cli-bundle/chunks/{chunk-2XPDCXK5.js → chunk-GIQSU6S2.js} +6 -6
  107. package/dist/cli-bundle/chunks/chunk-GIQSU6S2.js.map +1 -0
  108. package/dist/cli-bundle/chunks/{chunk-V4QHAMI5.js → chunk-GROYI4RB.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-77XFQRTD.js → chunk-GSJSM5BJ.js} +3 -3
  110. package/dist/cli-bundle/chunks/{chunk-QYGK2XQ3.js → chunk-GTLCVJOE.js} +3 -3
  111. package/dist/cli-bundle/chunks/{chunk-VSQE43NO.js → chunk-GV2262OF.js} +4 -4
  112. package/dist/cli-bundle/chunks/{chunk-N2TEEOXJ.js → chunk-GVI6FAFG.js} +8 -6
  113. package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-A5EQPNV7.js → chunk-GVT754PX.js} +44 -3
  115. package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-Y2VSGFT4.js → chunk-HB3P4M52.js} +22 -7
  117. package/dist/cli-bundle/chunks/chunk-HB3P4M52.js.map +1 -0
  118. package/dist/cli-bundle/chunks/{chunk-STBCBDKF.js → chunk-HCEBZNC3.js} +6 -6
  119. package/dist/cli-bundle/chunks/{chunk-EEECAV5M.js → chunk-HEWM6CEN.js} +80 -25
  120. package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +7 -0
  121. package/dist/cli-bundle/chunks/{chunk-GKCEEXMA.js → chunk-HQ3SB4CN.js} +21 -6
  122. package/dist/cli-bundle/chunks/{chunk-GKCEEXMA.js.map → chunk-HQ3SB4CN.js.map} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-U6RYD446.js → chunk-HRW7GF6T.js} +7 -7
  124. package/dist/cli-bundle/chunks/{chunk-D35WYXWC.js → chunk-HYW67VJ5.js} +6 -3
  125. package/dist/cli-bundle/chunks/chunk-HYW67VJ5.js.map +1 -0
  126. package/dist/cli-bundle/chunks/{chunk-OKWJUL6F.js → chunk-I577UHC7.js} +16 -9
  127. package/dist/cli-bundle/chunks/{chunk-OKWJUL6F.js.map → chunk-I577UHC7.js.map} +2 -2
  128. package/dist/cli-bundle/chunks/{chunk-XDWXPG2E.js → chunk-IAQE32BI.js} +4 -4
  129. package/dist/cli-bundle/chunks/{chunk-66SRNEBK.js → chunk-IJNK6WW2.js} +3 -3
  130. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js +623 -0
  131. package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +7 -0
  132. package/dist/cli-bundle/chunks/{chunk-A3GAQLBH.js → chunk-IX677TRO.js} +75 -12
  133. package/dist/cli-bundle/chunks/chunk-IX677TRO.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{chunk-RLLOZAM2.js → chunk-IY6VZ3IW.js} +29 -8
  135. package/dist/cli-bundle/chunks/chunk-IY6VZ3IW.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-SVAWG7EE.js → chunk-J4FBIFU6.js} +45 -4
  137. package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-AGEBQRBG.js → chunk-JAPE62Y5.js} +9 -9
  139. package/dist/cli-bundle/chunks/{chunk-UWAQI3B7.js → chunk-JGUKMMRS.js} +3 -3
  140. package/dist/cli-bundle/chunks/{chunk-UU6EP25G.js → chunk-JH2ZSLO3.js} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-GRDK25BN.js → chunk-JHJSFOAM.js} +6 -6
  142. package/dist/cli-bundle/chunks/{chunk-FQO5THHM.js → chunk-JM6YAXTR.js} +2 -2
  143. package/dist/cli-bundle/chunks/{chunk-E7KBMWEF.js → chunk-JSLT7WVE.js} +2 -2
  144. package/dist/cli-bundle/chunks/{chunk-FIUTBFC6.js → chunk-K4CI6Y45.js} +2 -2
  145. package/dist/cli-bundle/chunks/{chunk-IEMXESIS.js → chunk-KSPWRNVP.js} +7 -7
  146. package/dist/cli-bundle/chunks/{chunk-3QNUDDY2.js → chunk-KZEANWJS.js} +14 -12
  147. package/dist/cli-bundle/chunks/{chunk-3QNUDDY2.js.map → chunk-KZEANWJS.js.map} +2 -2
  148. package/dist/cli-bundle/chunks/{chunk-BFJP4VYC.js → chunk-L7BH7IWU.js} +4 -4
  149. package/dist/cli-bundle/chunks/{chunk-2UCG5H6B.js → chunk-LPEYZRUR.js} +3 -3
  150. package/dist/cli-bundle/chunks/{chunk-FQF6VVPH.js → chunk-MYSS5H2A.js} +9 -7
  151. package/dist/cli-bundle/chunks/{chunk-FQF6VVPH.js.map → chunk-MYSS5H2A.js.map} +1 -1
  152. package/dist/cli-bundle/chunks/{chunk-IR3GOO6E.js → chunk-NHT3F4WZ.js} +15 -15
  153. package/dist/cli-bundle/chunks/{chunk-6BNV3G6C.js → chunk-NLR32VFS.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-BDC4TW4B.js → chunk-OV7MSW3I.js} +15 -13
  155. package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +1 -0
  156. package/dist/cli-bundle/chunks/{chunk-EI3UIMZM.js → chunk-OWXOPDHD.js} +4 -4
  157. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +246 -0
  158. package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-AQUNTB7G.js → chunk-PEQGTJ5Q.js} +3 -3
  160. package/dist/cli-bundle/chunks/{chunk-QFG4MB7P.js → chunk-POG76WWZ.js} +28 -7
  161. package/dist/cli-bundle/chunks/chunk-POG76WWZ.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-MI3346YW.js → chunk-QANSTTC7.js} +129 -170
  163. package/dist/cli-bundle/chunks/chunk-QANSTTC7.js.map +1 -0
  164. package/dist/cli-bundle/chunks/{chunk-T6MOTLOJ.js → chunk-QJKL5PHS.js} +2 -2
  165. package/dist/cli-bundle/chunks/{chunk-SBW7EQC4.js → chunk-QLZ643FM.js} +76 -13
  166. package/dist/cli-bundle/chunks/chunk-QLZ643FM.js.map +1 -0
  167. package/dist/cli-bundle/chunks/{chunk-XKVHL3MB.js → chunk-QWRVBJ4D.js} +2 -2
  168. package/dist/cli-bundle/chunks/chunk-R3EWPG4A.js +106 -0
  169. package/dist/cli-bundle/chunks/chunk-R3EWPG4A.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +344 -0
  171. package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{chunk-VFA5EIEN.js → chunk-R7QV7ICM.js} +4 -4
  173. package/dist/cli-bundle/chunks/{chunk-NPEYH6CE.js → chunk-RDV4ZFYS.js} +12 -10
  174. package/dist/cli-bundle/chunks/{chunk-NPEYH6CE.js.map → chunk-RDV4ZFYS.js.map} +1 -1
  175. package/dist/cli-bundle/chunks/{chunk-K2L6FZBX.js → chunk-RJO3YAFM.js} +4 -4
  176. package/dist/cli-bundle/chunks/{chunk-YIC5NGXF.js → chunk-RMF7LMBS.js} +7 -7
  177. package/dist/cli-bundle/chunks/{chunk-YIC5NGXF.js.map → chunk-RMF7LMBS.js.map} +2 -2
  178. package/dist/cli-bundle/chunks/{chunk-MRXAHR4B.js → chunk-RZJLNXFG.js} +50 -13
  179. package/dist/cli-bundle/chunks/chunk-RZJLNXFG.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-DJAGYYCQ.js → chunk-SC2HMDGB.js} +19 -3
  181. package/dist/cli-bundle/chunks/chunk-SC2HMDGB.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-SGJB6PXA.js → chunk-SF3DT5HJ.js} +3 -3
  183. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js +604 -0
  184. package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +1 -0
  185. package/dist/cli-bundle/chunks/{chunk-Q3K5XPAQ.js → chunk-SR3JOATZ.js} +18 -2
  186. package/dist/cli-bundle/chunks/chunk-SR3JOATZ.js.map +7 -0
  187. package/dist/cli-bundle/chunks/{chunk-DUDLSQFG.js → chunk-SSKOQNMS.js} +14 -12
  188. package/dist/cli-bundle/chunks/{chunk-DUDLSQFG.js.map → chunk-SSKOQNMS.js.map} +1 -1
  189. package/dist/cli-bundle/chunks/{chunk-UNNCT5QY.js → chunk-SZVB53Y3.js} +3 -3
  190. package/dist/cli-bundle/chunks/{chunk-JBW2S2C6.js → chunk-T44FMVRL.js} +613 -157
  191. package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +7 -0
  192. package/dist/cli-bundle/chunks/{chunk-GFZB5CLP.js → chunk-T6PPNM7V.js} +4 -4
  193. package/dist/cli-bundle/chunks/{chunk-UE7LK3RE.js → chunk-THAOZG4U.js} +9 -7
  194. package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +1 -0
  195. package/dist/cli-bundle/chunks/{chunk-IGBBTPM5.js → chunk-TOBGV45Y.js} +4 -4
  196. package/dist/cli-bundle/chunks/chunk-TOBGV45Y.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-W6IEJXNC.js → chunk-TVYYO5A7.js} +2 -2
  198. package/dist/cli-bundle/chunks/chunk-TYHJDFYW.js +109 -0
  199. package/dist/cli-bundle/chunks/chunk-TYHJDFYW.js.map +7 -0
  200. package/dist/cli-bundle/chunks/{chunk-DOASIOQR.js → chunk-UQLXSG72.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-IDUTGRDM.js → chunk-URXVHN3L.js} +3 -3
  202. package/dist/cli-bundle/chunks/chunk-URXVHN3L.js.map +1 -0
  203. package/dist/cli-bundle/chunks/{chunk-7CHWLT2J.js → chunk-UVN66B3M.js} +2 -2
  204. package/dist/cli-bundle/chunks/{chunk-Q6JPYR7I.js → chunk-UX6SSO2I.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-JPWUZOMR.js → chunk-UZDQXNUB.js} +75 -20
  206. package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-OK7VSX3N.js → chunk-UZLJOEAC.js} +3 -3
  208. package/dist/cli-bundle/chunks/{chunk-4PSJVGRE.js → chunk-VDO2JMD4.js} +7 -7
  209. package/dist/cli-bundle/chunks/{chunk-IRJ6F23W.js → chunk-VQIHNHMJ.js} +2 -2
  210. package/dist/cli-bundle/chunks/{chunk-FQODDTE7.js → chunk-WUVEBQW6.js} +7 -5
  211. package/dist/cli-bundle/chunks/{chunk-FQODDTE7.js.map → chunk-WUVEBQW6.js.map} +1 -1
  212. package/dist/cli-bundle/chunks/{chunk-Q4PSG2GV.js → chunk-WVA4DVNV.js} +5 -5
  213. package/dist/cli-bundle/chunks/{chunk-Q4PSG2GV.js.map → chunk-WVA4DVNV.js.map} +1 -1
  214. package/dist/cli-bundle/chunks/{chunk-4M6RZJXF.js → chunk-WWNL6WMH.js} +3 -3
  215. package/dist/cli-bundle/chunks/chunk-WWNL6WMH.js.map +7 -0
  216. package/dist/cli-bundle/chunks/{chunk-3KPNOZOH.js → chunk-X6K5XTTN.js} +78 -21
  217. package/dist/cli-bundle/chunks/chunk-X6K5XTTN.js.map +7 -0
  218. package/dist/cli-bundle/chunks/{chunk-G33XIMRT.js → chunk-XJF7CDNH.js} +17 -10
  219. package/dist/cli-bundle/chunks/{chunk-G33XIMRT.js.map → chunk-XJF7CDNH.js.map} +1 -1
  220. package/dist/cli-bundle/chunks/{chunk-AR24KW26.js → chunk-YBT7O4KT.js} +17 -112
  221. package/dist/cli-bundle/chunks/chunk-YBT7O4KT.js.map +7 -0
  222. package/dist/cli-bundle/chunks/{chunk-CZA2DXCV.js → chunk-YQQNAKW3.js} +17 -105
  223. package/dist/cli-bundle/chunks/chunk-YQQNAKW3.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-OKPZDH43.js → chunk-YQWCZ5AC.js} +7 -5
  225. package/dist/cli-bundle/chunks/{chunk-OKPZDH43.js.map → chunk-YQWCZ5AC.js.map} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-LT5UWU7H.js → chunk-ZOJ3LR7O.js} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-3HSRP6T2.js → chunk-ZOY5K4D3.js} +2 -2
  228. package/dist/cli-bundle/chunks/{chunk-XXWDEQ6O.js → chunk-ZV2NTVMJ.js} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-UW6HCMP2.js → chunk-ZYPFOO3L.js} +9 -9
  230. package/dist/cli-bundle/chunks/close-O5QVZ6ET.js +12 -0
  231. package/dist/cli-bundle/chunks/{close-7NWA3GLA.js → close-QEMOYZN3.js} +5 -5
  232. package/dist/cli-bundle/chunks/close-many-SDA426VT.js +24 -0
  233. package/dist/cli-bundle/chunks/{close-many-YALQ7AXS.js → close-many-UTZANOCQ.js} +15 -14
  234. package/dist/cli-bundle/chunks/{comments-SQIQ5WYR.js → comments-LZN6FXXC.js} +7 -7
  235. package/dist/cli-bundle/chunks/comments-VBQ345ND.js +13 -0
  236. package/dist/cli-bundle/chunks/{copy-YDAMENCP.js → copy-DKTSSCK7.js} +4 -4
  237. package/dist/cli-bundle/chunks/copy-M7DDI6LS.js +9 -0
  238. package/dist/cli-bundle/chunks/{create-JSL6CXU3.js → create-GG4RBCGC.js} +11 -11
  239. package/dist/cli-bundle/chunks/create-JBC5KUW6.js +29 -0
  240. package/dist/cli-bundle/chunks/{delete-IGVOZEU2.js → delete-LCS3VPDH.js} +4 -4
  241. package/dist/cli-bundle/chunks/delete-MD7YXQLH.js +10 -0
  242. package/dist/cli-bundle/chunks/{deps-BQAXUQAK.js → deps-DELOO4TL.js} +6 -6
  243. package/dist/cli-bundle/chunks/{deps-CBPPSS6J.js → deps-FI4O6NQS.js} +6 -6
  244. package/dist/cli-bundle/chunks/docs-2UYBP5D6.js +14 -0
  245. package/dist/cli-bundle/chunks/{docs-NS2AZWCN.js → docs-6Z2MP526.js} +6 -6
  246. package/dist/cli-bundle/chunks/{files-XUUBQ76I.js → files-HEUGSJZL.js} +6 -6
  247. package/dist/cli-bundle/chunks/{files-PVWEPT5J.js → files-HKEAN5MA.js} +6 -6
  248. package/dist/cli-bundle/chunks/{focus-DHBHKK3E.js → focus-7SOUT5PZ.js} +5 -5
  249. package/dist/cli-bundle/chunks/focus-DRQ6FQH6.js +10 -0
  250. package/dist/cli-bundle/chunks/history-compact-65YVN5DB.js +17 -0
  251. package/dist/cli-bundle/chunks/{history-compact-3TNPYVFG.js → history-compact-7NDVP3PT.js} +7 -6
  252. package/dist/cli-bundle/chunks/{history-redact-KKFDICCF.js → history-redact-7YBL4XSG.js} +5 -4
  253. package/dist/cli-bundle/chunks/{history-redact-ELRL73XN.js → history-redact-IZGNJBU4.js} +5 -4
  254. package/dist/cli-bundle/chunks/{history-repair-J7WKZFAG.js → history-repair-7M4PYQUH.js} +8 -6
  255. package/dist/cli-bundle/chunks/history-repair-GNGETJLI.js +18 -0
  256. package/dist/cli-bundle/chunks/learnings-3YXDRWFT.js +13 -0
  257. package/dist/cli-bundle/chunks/{learnings-X4D6JCCG.js → learnings-ALC6IMNL.js} +7 -7
  258. package/dist/cli-bundle/chunks/notes-7JMLQ447.js +13 -0
  259. package/dist/cli-bundle/chunks/{notes-UQC6VS6N.js → notes-JFCLTC5C.js} +7 -7
  260. package/dist/cli-bundle/chunks/plan-KOIPWVOZ.js +26 -0
  261. package/dist/cli-bundle/chunks/{plan-5GKRBJJO.js → plan-T3XB3WTK.js} +12 -12
  262. package/dist/cli-bundle/chunks/{profile-5PQAPCLF.js → profile-OILJHKUW.js} +12 -11
  263. package/dist/cli-bundle/chunks/{profile-CW4BD3FO.js → profile-RJXA7PGS.js} +12 -11
  264. package/dist/cli-bundle/chunks/{register-list-query-PHIPDFP2.js → register-list-query-CFVG75P3.js} +30 -21
  265. package/dist/cli-bundle/chunks/{register-list-query-PHIPDFP2.js.map → register-list-query-CFVG75P3.js.map} +1 -1
  266. package/dist/cli-bundle/chunks/{register-list-query-HTDQE6VI.js → register-list-query-E7UVY4TN.js} +29 -20
  267. package/dist/cli-bundle/chunks/{register-list-query-HTDQE6VI.js.map → register-list-query-E7UVY4TN.js.map} +2 -2
  268. package/dist/cli-bundle/chunks/{register-mutation-BLEWM5I6.js → register-mutation-4VJTXBZW.js} +86 -32
  269. package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-mutation-OTYHR7J6.js → register-mutation-IQ55E25C.js} +78 -33
  271. package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +1 -0
  272. package/dist/cli-bundle/chunks/{register-operations-AMCUFYEW.js → register-operations-AR7RMX4W.js} +42 -38
  273. package/dist/cli-bundle/chunks/register-operations-AR7RMX4W.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-operations-MRLHOZYR.js → register-operations-NOLZGORC.js} +41 -37
  275. package/dist/cli-bundle/chunks/register-operations-NOLZGORC.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-ZVKTDL4G.js → register-setup-BB77VUEE.js} +17 -16
  277. package/dist/cli-bundle/chunks/{register-setup-ZVKTDL4G.js.map → register-setup-BB77VUEE.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{register-setup-N2FOSWAG.js → register-setup-EYZ7VTPZ.js} +15 -14
  279. package/dist/cli-bundle/chunks/{register-setup-N2FOSWAG.js.map → register-setup-EYZ7VTPZ.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/restore-L6IAGOD7.js +15 -0
  281. package/dist/cli-bundle/chunks/{restore-HEQAG6EK.js → restore-ZH65GZFB.js} +7 -6
  282. package/dist/cli-bundle/chunks/{schema-Q5DAWJ2S.js → schema-4ERWM5QJ.js} +7 -6
  283. package/dist/cli-bundle/chunks/{schema-MAXAIHEC.js → schema-55DL3Q52.js} +7 -6
  284. package/dist/cli-bundle/chunks/{update-DWFXXJKP.js → update-FW6FKDOP.js} +15 -15
  285. package/dist/cli-bundle/chunks/update-TJHSPRPT.js +23 -0
  286. package/dist/cli-bundle/chunks/update-many-NNALYQCN.js +35 -0
  287. package/dist/cli-bundle/chunks/update-many-PWXX5WHO.js +39 -0
  288. package/dist/cli-bundle/main.js +62 -59
  289. package/dist/cli-bundle/main.js.map +1 -1
  290. package/dist/cli-bundle/sdk-runtime.js +62 -59
  291. package/dist/cli-bundle/sdk-testing.js +8 -8
  292. package/dist/cli-bundle/sdk.js +327 -57
  293. package/dist/cli-bundle/sdk.js.map +4 -4
  294. package/dist/core/config/nested-settings.d.ts +2 -0
  295. package/dist/core/config/nested-settings.js +18 -2
  296. package/dist/core/config/nested-settings.js.map +1 -1
  297. package/dist/core/diagnostics/remediation.js +38 -2
  298. package/dist/core/diagnostics/remediation.js.map +1 -1
  299. package/dist/core/extensions/extension-types.d.ts +1 -1
  300. package/dist/core/extensions/extension-types.js +2 -2
  301. package/dist/core/extensions/extension-types.js.map +1 -1
  302. package/dist/core/item/id.d.ts +19 -2
  303. package/dist/core/item/id.js +27 -6
  304. package/dist/core/item/id.js.map +1 -1
  305. package/dist/core/item/parse.d.ts +7 -0
  306. package/dist/core/item/parse.js +48 -2
  307. package/dist/core/item/parse.js.map +1 -1
  308. package/dist/core/schema/item-types-file.d.ts +2 -2
  309. package/dist/core/schema/item-types-file.js +2 -2
  310. package/dist/core/schema/item-types-file.js.map +1 -1
  311. package/dist/core/schema/runtime-schema.d.ts +3 -3
  312. package/dist/core/schema/runtime-schema.js +2 -2
  313. package/dist/core/schema/runtime-schema.js.map +1 -1
  314. package/dist/core/schema/type-workflows.d.ts +2 -2
  315. package/dist/core/schema/type-workflows.js +2 -2
  316. package/dist/core/schema/type-workflows.js.map +1 -1
  317. package/dist/core/shared/constants.js +5 -2
  318. package/dist/core/shared/constants.js.map +1 -1
  319. package/dist/core/store/settings-validator.d.ts +4 -0
  320. package/dist/core/store/settings-validator.js +8 -2
  321. package/dist/core/store/settings-validator.js.map +1 -1
  322. package/dist/core/store/settings.js +8 -2
  323. package/dist/core/store/settings.js.map +1 -1
  324. package/dist/sdk/annotations.js +24 -2
  325. package/dist/sdk/annotations.js.map +1 -1
  326. package/dist/sdk/cli-bootstrap.d.ts +1 -1
  327. package/dist/sdk/cli-bootstrap.js +3 -3
  328. package/dist/sdk/cli-bootstrap.js.map +1 -1
  329. package/dist/sdk/cli-contracts/commander-mutation-options.js +22 -2
  330. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
  331. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  332. package/dist/sdk/cli-contracts/enum-contracts.js +3 -2
  333. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  334. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  335. package/dist/sdk/cli-contracts/flag-contracts.js +17 -2
  336. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  337. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +512 -0
  338. package/dist/sdk/cli-contracts/tool-option-contracts.js +21 -11
  339. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  340. package/dist/sdk/cli-contracts/tool-parameter-tables.js +13 -3
  341. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  342. package/dist/sdk/cli-contracts/tool-schema.d.ts +2 -0
  343. package/dist/sdk/cli-contracts/tool-schema.js +14 -10
  344. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  345. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +69 -0
  346. package/dist/sdk/cli-contracts/typed-action-inputs.js +5 -0
  347. package/dist/sdk/cli-contracts/typed-action-inputs.js.map +1 -0
  348. package/dist/sdk/cli-contracts.d.ts +4 -3
  349. package/dist/sdk/cli-contracts.js +5 -5
  350. package/dist/sdk/cli-contracts.js.map +1 -1
  351. package/dist/sdk/extension/describe.d.ts +1 -1
  352. package/dist/sdk/extension/describe.js +2 -2
  353. package/dist/sdk/extension/describe.js.map +1 -1
  354. package/dist/sdk/extension/install-runtime.js +5 -3
  355. package/dist/sdk/extension/install-runtime.js.map +1 -1
  356. package/dist/sdk/extension.d.ts +2 -2
  357. package/dist/sdk/extension.js +2 -2
  358. package/dist/sdk/extension.js.map +1 -1
  359. package/dist/sdk/governance/gc.d.ts +14 -1
  360. package/dist/sdk/governance/gc.js +38 -2
  361. package/dist/sdk/governance/gc.js.map +1 -1
  362. package/dist/sdk/governance/storage-integrity.d.ts +84 -0
  363. package/dist/sdk/governance/storage-integrity.js +240 -0
  364. package/dist/sdk/governance/storage-integrity.js.map +1 -0
  365. package/dist/sdk/governance/validate.d.ts +3 -1
  366. package/dist/sdk/governance/validate.js +56 -2
  367. package/dist/sdk/governance/validate.js.map +1 -1
  368. package/dist/sdk/history-read.d.ts +1 -1
  369. package/dist/sdk/history-read.js +2 -2
  370. package/dist/sdk/history-read.js.map +1 -1
  371. package/dist/sdk/history-repair.d.ts +36 -0
  372. package/dist/sdk/history-repair.js +69 -4
  373. package/dist/sdk/history-repair.js.map +1 -1
  374. package/dist/sdk/index.d.ts +5 -2
  375. package/dist/sdk/index.js +5 -2
  376. package/dist/sdk/index.js.map +1 -1
  377. package/dist/sdk/init.js +3 -3
  378. package/dist/sdk/init.js.map +1 -1
  379. package/dist/sdk/item-transaction.d.ts +131 -0
  380. package/dist/sdk/item-transaction.js +280 -0
  381. package/dist/sdk/item-transaction.js.map +1 -0
  382. package/dist/sdk/merge/driver.d.ts +75 -0
  383. package/dist/sdk/merge/driver.js +166 -0
  384. package/dist/sdk/merge/driver.js.map +1 -0
  385. package/dist/sdk/merge/index.d.ts +11 -0
  386. package/dist/sdk/merge/index.js +15 -0
  387. package/dist/sdk/merge/index.js.map +1 -0
  388. package/dist/sdk/merge/install.d.ts +90 -0
  389. package/dist/sdk/merge/install.js +318 -0
  390. package/dist/sdk/merge/install.js.map +1 -0
  391. package/dist/sdk/merge/three-way.d.ts +126 -0
  392. package/dist/sdk/merge/three-way.js +545 -0
  393. package/dist/sdk/merge/three-way.js.map +1 -0
  394. package/dist/sdk/query/list.d.ts +19 -2
  395. package/dist/sdk/query/list.js +5 -2
  396. package/dist/sdk/query/list.js.map +1 -1
  397. package/dist/sdk/runtime.d.ts +17 -14
  398. package/dist/sdk/runtime.js +5 -5
  399. package/dist/sdk/runtime.js.map +1 -1
  400. package/dist/sdk/schema.d.ts +2 -2
  401. package/dist/sdk/schema.js +29 -2
  402. package/dist/sdk/schema.js.map +1 -1
  403. package/dist/sdk/stats.d.ts +1 -1
  404. package/dist/sdk/stats.js +2 -2
  405. package/dist/sdk/stats.js.map +1 -1
  406. package/dist/sdk/workspace-transaction-gc.d.ts +46 -0
  407. package/dist/sdk/workspace-transaction-gc.js +155 -0
  408. package/dist/sdk/workspace-transaction-gc.js.map +1 -0
  409. package/dist/sdk/workspace.d.ts +28 -4
  410. package/dist/sdk/workspace.js +61 -15
  411. package/dist/sdk/workspace.js.map +1 -1
  412. package/dist/types.d.ts +11 -7
  413. package/dist/types.js +2 -2
  414. package/dist/types.js.map +1 -1
  415. package/docs/AGENT_GUIDE.md +58 -47
  416. package/docs/COMMANDS.md +7 -0
  417. package/docs/CONFIGURATION.md +2 -0
  418. package/docs/MERGE_SAFETY.md +99 -0
  419. package/docs/README.md +1 -0
  420. package/docs/SDK.md +56 -0
  421. package/marketplace.json +2 -2
  422. package/package.json +3 -2
  423. package/packages/pm-beads/package.json +1 -1
  424. package/packages/pm-calendar/package.json +1 -1
  425. package/packages/pm-command-kit/package.json +1 -1
  426. package/packages/pm-governance-audit/package.json +1 -1
  427. package/packages/pm-guide-shell/package.json +1 -1
  428. package/packages/pm-kanban/package.json +1 -1
  429. package/packages/pm-lifecycle-hooks/package.json +1 -1
  430. package/packages/pm-linked-test-adapters/package.json +1 -1
  431. package/packages/pm-search-advanced/package.json +1 -1
  432. package/packages/pm-templates/package.json +1 -1
  433. package/packages/pm-todos/package.json +1 -1
  434. package/packages/pm-vcs/package.json +1 -1
  435. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  436. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  437. package/dist/cli-bundle/chunks/append-XUYF7NON.js +0 -11
  438. package/dist/cli-bundle/chunks/chunk-2XPDCXK5.js.map +0 -1
  439. package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +0 -7
  440. package/dist/cli-bundle/chunks/chunk-3KPNOZOH.js.map +0 -7
  441. package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +0 -1
  442. package/dist/cli-bundle/chunks/chunk-4M6RZJXF.js.map +0 -7
  443. package/dist/cli-bundle/chunks/chunk-6V4T4RD3.js.map +0 -1
  444. package/dist/cli-bundle/chunks/chunk-A3GAQLBH.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-A4FVWFZY.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-A5EQPNV7.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +0 -7
  448. package/dist/cli-bundle/chunks/chunk-BBGR4FKQ.js.map +0 -1
  449. package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-BZKE2O5V.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +0 -1
  452. package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-DJAGYYCQ.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-EEECAV5M.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-H3YKUVDR.js.map +0 -1
  456. package/dist/cli-bundle/chunks/chunk-IDUTGRDM.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-IGBBTPM5.js.map +0 -1
  458. package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +0 -7
  459. package/dist/cli-bundle/chunks/chunk-JPWUZOMR.js.map +0 -1
  460. package/dist/cli-bundle/chunks/chunk-KAE727L2.js.map +0 -7
  461. package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-MQOSMBWV.js.map +0 -7
  463. package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +0 -1
  464. package/dist/cli-bundle/chunks/chunk-N2TEEOXJ.js.map +0 -7
  465. package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +0 -1
  466. package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +0 -7
  467. package/dist/cli-bundle/chunks/chunk-Q3K5XPAQ.js.map +0 -7
  468. package/dist/cli-bundle/chunks/chunk-QFG4MB7P.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-RLLOZAM2.js.map +0 -7
  470. package/dist/cli-bundle/chunks/chunk-RWAIRGBC.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-SBW7EQC4.js.map +0 -1
  472. package/dist/cli-bundle/chunks/chunk-SVAWG7EE.js.map +0 -1
  473. package/dist/cli-bundle/chunks/chunk-UE7LK3RE.js.map +0 -1
  474. package/dist/cli-bundle/chunks/chunk-VA3H7VVC.js.map +0 -1
  475. package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +0 -7
  476. package/dist/cli-bundle/chunks/chunk-Y2VSGFT4.js.map +0 -1
  477. package/dist/cli-bundle/chunks/chunk-YG56M3NE.js.map +0 -1
  478. package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +0 -7
  479. package/dist/cli-bundle/chunks/chunk-ZUCBPXNA.js.map +0 -7
  480. package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +0 -12
  481. package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +0 -23
  482. package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +0 -13
  483. package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +0 -9
  484. package/dist/cli-bundle/chunks/create-LXMLYJNM.js +0 -29
  485. package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +0 -10
  486. package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +0 -14
  487. package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +0 -10
  488. package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +0 -16
  489. package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +0 -16
  490. package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +0 -13
  491. package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +0 -13
  492. package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +0 -26
  493. package/dist/cli-bundle/chunks/register-mutation-BLEWM5I6.js.map +0 -7
  494. package/dist/cli-bundle/chunks/register-mutation-OTYHR7J6.js.map +0 -1
  495. package/dist/cli-bundle/chunks/register-operations-AMCUFYEW.js.map +0 -1
  496. package/dist/cli-bundle/chunks/register-operations-MRLHOZYR.js.map +0 -7
  497. package/dist/cli-bundle/chunks/restore-A55MLFAI.js +0 -14
  498. package/dist/cli-bundle/chunks/update-5DTSCWVF.js +0 -23
  499. package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +0 -34
  500. package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +0 -38
  501. /package/dist/cli-bundle/chunks/{append-MBXHNWSX.js.map → append-E6V54WOQ.js.map} +0 -0
  502. /package/dist/cli-bundle/chunks/{append-XUYF7NON.js.map → append-NNJ3EFIT.js.map} +0 -0
  503. /package/dist/cli-bundle/chunks/{chunk-YGEA4CLH.js.map → chunk-3MCTMJXI.js.map} +0 -0
  504. /package/dist/cli-bundle/chunks/{chunk-N7FCFJ76.js.map → chunk-3P7UJQOX.js.map} +0 -0
  505. /package/dist/cli-bundle/chunks/{chunk-7B7IHMLH.js.map → chunk-3VY6MIEO.js.map} +0 -0
  506. /package/dist/cli-bundle/chunks/{chunk-5S6IZXK7.js.map → chunk-4U4Z6AHI.js.map} +0 -0
  507. /package/dist/cli-bundle/chunks/{chunk-UOIFZ66L.js.map → chunk-4XGJLADW.js.map} +0 -0
  508. /package/dist/cli-bundle/chunks/{chunk-SUNZKVAH.js.map → chunk-5IZJWSDB.js.map} +0 -0
  509. /package/dist/cli-bundle/chunks/{chunk-QQ77W23U.js.map → chunk-5NTE36LD.js.map} +0 -0
  510. /package/dist/cli-bundle/chunks/{chunk-KGPLSHJD.js.map → chunk-6C2ZZX5Z.js.map} +0 -0
  511. /package/dist/cli-bundle/chunks/{chunk-Q5NHJ6RO.js.map → chunk-6JUTHVQS.js.map} +0 -0
  512. /package/dist/cli-bundle/chunks/{chunk-NTS2RKHN.js.map → chunk-6VIJ7UA5.js.map} +0 -0
  513. /package/dist/cli-bundle/chunks/{chunk-XVB6BATY.js.map → chunk-72LQ4TKV.js.map} +0 -0
  514. /package/dist/cli-bundle/chunks/{chunk-KZ5AC6B5.js.map → chunk-7WCE6Y64.js.map} +0 -0
  515. /package/dist/cli-bundle/chunks/{chunk-VQOG2ETB.js.map → chunk-AF2CCM5U.js.map} +0 -0
  516. /package/dist/cli-bundle/chunks/{chunk-EAV3P54W.js.map → chunk-DAQ45GCS.js.map} +0 -0
  517. /package/dist/cli-bundle/chunks/{chunk-RX53WHFI.js.map → chunk-EJDGV4GR.js.map} +0 -0
  518. /package/dist/cli-bundle/chunks/{chunk-IXG5CMBR.js.map → chunk-FDHPAVVB.js.map} +0 -0
  519. /package/dist/cli-bundle/chunks/{chunk-V4QHAMI5.js.map → chunk-GROYI4RB.js.map} +0 -0
  520. /package/dist/cli-bundle/chunks/{chunk-77XFQRTD.js.map → chunk-GSJSM5BJ.js.map} +0 -0
  521. /package/dist/cli-bundle/chunks/{chunk-QYGK2XQ3.js.map → chunk-GTLCVJOE.js.map} +0 -0
  522. /package/dist/cli-bundle/chunks/{chunk-VSQE43NO.js.map → chunk-GV2262OF.js.map} +0 -0
  523. /package/dist/cli-bundle/chunks/{chunk-STBCBDKF.js.map → chunk-HCEBZNC3.js.map} +0 -0
  524. /package/dist/cli-bundle/chunks/{chunk-U6RYD446.js.map → chunk-HRW7GF6T.js.map} +0 -0
  525. /package/dist/cli-bundle/chunks/{chunk-XDWXPG2E.js.map → chunk-IAQE32BI.js.map} +0 -0
  526. /package/dist/cli-bundle/chunks/{chunk-66SRNEBK.js.map → chunk-IJNK6WW2.js.map} +0 -0
  527. /package/dist/cli-bundle/chunks/{chunk-AGEBQRBG.js.map → chunk-JAPE62Y5.js.map} +0 -0
  528. /package/dist/cli-bundle/chunks/{chunk-UWAQI3B7.js.map → chunk-JGUKMMRS.js.map} +0 -0
  529. /package/dist/cli-bundle/chunks/{chunk-UU6EP25G.js.map → chunk-JH2ZSLO3.js.map} +0 -0
  530. /package/dist/cli-bundle/chunks/{chunk-GRDK25BN.js.map → chunk-JHJSFOAM.js.map} +0 -0
  531. /package/dist/cli-bundle/chunks/{chunk-FQO5THHM.js.map → chunk-JM6YAXTR.js.map} +0 -0
  532. /package/dist/cli-bundle/chunks/{chunk-E7KBMWEF.js.map → chunk-JSLT7WVE.js.map} +0 -0
  533. /package/dist/cli-bundle/chunks/{chunk-FIUTBFC6.js.map → chunk-K4CI6Y45.js.map} +0 -0
  534. /package/dist/cli-bundle/chunks/{chunk-IEMXESIS.js.map → chunk-KSPWRNVP.js.map} +0 -0
  535. /package/dist/cli-bundle/chunks/{chunk-BFJP4VYC.js.map → chunk-L7BH7IWU.js.map} +0 -0
  536. /package/dist/cli-bundle/chunks/{chunk-2UCG5H6B.js.map → chunk-LPEYZRUR.js.map} +0 -0
  537. /package/dist/cli-bundle/chunks/{chunk-IR3GOO6E.js.map → chunk-NHT3F4WZ.js.map} +0 -0
  538. /package/dist/cli-bundle/chunks/{chunk-6BNV3G6C.js.map → chunk-NLR32VFS.js.map} +0 -0
  539. /package/dist/cli-bundle/chunks/{chunk-EI3UIMZM.js.map → chunk-OWXOPDHD.js.map} +0 -0
  540. /package/dist/cli-bundle/chunks/{chunk-AQUNTB7G.js.map → chunk-PEQGTJ5Q.js.map} +0 -0
  541. /package/dist/cli-bundle/chunks/{chunk-T6MOTLOJ.js.map → chunk-QJKL5PHS.js.map} +0 -0
  542. /package/dist/cli-bundle/chunks/{chunk-XKVHL3MB.js.map → chunk-QWRVBJ4D.js.map} +0 -0
  543. /package/dist/cli-bundle/chunks/{chunk-VFA5EIEN.js.map → chunk-R7QV7ICM.js.map} +0 -0
  544. /package/dist/cli-bundle/chunks/{chunk-K2L6FZBX.js.map → chunk-RJO3YAFM.js.map} +0 -0
  545. /package/dist/cli-bundle/chunks/{chunk-SGJB6PXA.js.map → chunk-SF3DT5HJ.js.map} +0 -0
  546. /package/dist/cli-bundle/chunks/{chunk-UNNCT5QY.js.map → chunk-SZVB53Y3.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{chunk-GFZB5CLP.js.map → chunk-T6PPNM7V.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-W6IEJXNC.js.map → chunk-TVYYO5A7.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-DOASIOQR.js.map → chunk-UQLXSG72.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-7CHWLT2J.js.map → chunk-UVN66B3M.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-Q6JPYR7I.js.map → chunk-UX6SSO2I.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-OK7VSX3N.js.map → chunk-UZLJOEAC.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-4PSJVGRE.js.map → chunk-VDO2JMD4.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-IRJ6F23W.js.map → chunk-VQIHNHMJ.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-LT5UWU7H.js.map → chunk-ZOJ3LR7O.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-3HSRP6T2.js.map → chunk-ZOY5K4D3.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-XXWDEQ6O.js.map → chunk-ZV2NTVMJ.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-UW6HCMP2.js.map → chunk-ZYPFOO3L.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{close-ZZCDDWJT.js.map → close-O5QVZ6ET.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{close-7NWA3GLA.js.map → close-QEMOYZN3.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{close-many-QCZHFCON.js.map → close-many-SDA426VT.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{close-many-YALQ7AXS.js.map → close-many-UTZANOCQ.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{comments-SQIQ5WYR.js.map → comments-LZN6FXXC.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{comments-FMQNYPSZ.js.map → comments-VBQ345ND.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{copy-YDAMENCP.js.map → copy-DKTSSCK7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{copy-GI3RCVZP.js.map → copy-M7DDI6LS.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{create-JSL6CXU3.js.map → create-GG4RBCGC.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{create-LXMLYJNM.js.map → create-JBC5KUW6.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{delete-IGVOZEU2.js.map → delete-LCS3VPDH.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{delete-5DFAXJNI.js.map → delete-MD7YXQLH.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{deps-BQAXUQAK.js.map → deps-DELOO4TL.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{deps-CBPPSS6J.js.map → deps-FI4O6NQS.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{docs-KCWPLQOV.js.map → docs-2UYBP5D6.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{docs-NS2AZWCN.js.map → docs-6Z2MP526.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{files-XUUBQ76I.js.map → files-HEUGSJZL.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{files-PVWEPT5J.js.map → files-HKEAN5MA.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{focus-DHBHKK3E.js.map → focus-7SOUT5PZ.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{focus-3EJVFI3D.js.map → focus-DRQ6FQH6.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-compact-JHYVDYLW.js.map → history-compact-65YVN5DB.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-compact-3TNPYVFG.js.map → history-compact-7NDVP3PT.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{history-redact-KKFDICCF.js.map → history-redact-7YBL4XSG.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{history-redact-ELRL73XN.js.map → history-redact-IZGNJBU4.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{history-repair-J7WKZFAG.js.map → history-repair-7M4PYQUH.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{history-repair-REMI7DDI.js.map → history-repair-GNGETJLI.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{learnings-O6V5WDCV.js.map → learnings-3YXDRWFT.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{learnings-X4D6JCCG.js.map → learnings-ALC6IMNL.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{notes-ZSZREWZA.js.map → notes-7JMLQ447.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{notes-UQC6VS6N.js.map → notes-JFCLTC5C.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{plan-EZW2YDDY.js.map → plan-KOIPWVOZ.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{plan-5GKRBJJO.js.map → plan-T3XB3WTK.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{profile-5PQAPCLF.js.map → profile-OILJHKUW.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{profile-CW4BD3FO.js.map → profile-RJXA7PGS.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{restore-A55MLFAI.js.map → restore-L6IAGOD7.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{restore-HEQAG6EK.js.map → restore-ZH65GZFB.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{schema-Q5DAWJ2S.js.map → schema-4ERWM5QJ.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{schema-MAXAIHEC.js.map → schema-55DL3Q52.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-DWFXXJKP.js.map → update-FW6FKDOP.js.map} +0 -0
  598. /package/dist/cli-bundle/chunks/{update-5DTSCWVF.js.map → update-TJHSPRPT.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{update-many-6T4ZLZS7.js.map → update-many-NNALYQCN.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{update-many-MYRK6VBJ.js.map → update-many-PWXX5WHO.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"describe.js","sources":["sdk/extension/describe.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/describe\n *\n * Builds the `pm extension describe` / `pm package describe` payload: a flat,\n * by-name map of every surface each loaded extension registered.\n *\n * The SDK already ships {@link describeExtensionActivation} -- the `describe`\n * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`\n * (invoke-one) testing helpers -- but until now it was reachable only from a test\n * that hand-built an {@link ExtensionActivationResult}. This module is the thin\n * orchestration that lets an agent at the CLI (or over MCP) ask \"what does this\n * installed extension add to my context?\" in one call, instead of stitching\n * together `doctor` (errors), `manage` (update metadata), and a manifest read.\n *\n * It is intentionally pure: the caller performs the load+activate cycle (exactly\n * as `explore`/`doctor` already do) and hands the results here, so the same\n * builder is trivially unit-testable against synthetic activations.\n */\nimport {\n describeExtensionActivation,\n type ExtensionActivationSummary,\n} from \"../../core/extensions/activation-summary.js\";\nimport { renderExtensionSurfaceMarkdown } from \"../../core/extensions/activation-summary-markdown.js\";\nimport type {\n ExtensionActivationResult,\n ExtensionLayer,\n ExtensionLoadResult,\n} from \"../../core/extensions/loader.js\";\nimport { normalizeExtensionNameForMatch } from \"./shared.js\";\n\n/** Runtime state of a described extension. `ok` loaded and activated cleanly, `failed` loaded but threw during `activate`, and `not_loaded` failed to import at all -- the latter two register nothing, so their `surfaces` are empty and the status explains why (rather than implying the extension contributes nothing). */\nexport type ExtensionDescribeActivationStatus = \"ok\" | \"failed\" | \"not_loaded\";\n\n/**\n * One extension's contribution to the workspace: its identity plus the\n * {@link ExtensionActivationSummary} of every surface it registered.\n *\n * `surfaces` is matched by extension *name* (mirroring\n * {@link describeExtensionActivation}'s name filter), so when the same name is\n * loaded in both the project and global layers each entry reflects that name's\n * combined surfaces -- the `layer`/`version` fields still distinguish the\n * physical entries.\n */\nexport interface ExtensionSurfaceDescription {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports version for this contract. */\n version: string;\n /** Lifecycle state reported for activationthe record. */\n activation_status: ExtensionDescribeActivationStatus;\n /** Value that configures or reports surfaces for this contract. */\n surfaces: ExtensionActivationSummary;\n}\n\n/**\n * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps\n * plus a deduplicated `union` across the described set. `target` echoes the\n * requested name filter (or `null` for the whole workspace) and `total` counts\n * the described entries so callers need not re-measure `extensions`.\n */\nexport interface ExtensionDescribeResult {\n /** Value that configures or reports target for this contract. */\n target: string | null;\n /** Value that configures or reports total for this contract. */\n total: number;\n /** Value that configures or reports extensions for this contract. */\n extensions: ExtensionSurfaceDescription[];\n /** Value that configures or reports union for this contract. */\n union: ExtensionActivationSummary;\n}\n\n/** Compose a collision-free identity key for an extension from its layer and normalized name. The two parts are joined with a colon; the layer prefix is always a colon-free enum value, so distinct (layer, name) pairs never collide even when a name itself contains a colon. */\nfunction layerNameKey(layer: ExtensionLayer, name: string): string {\n return `${layer}:${normalizeExtensionNameForMatch(name)}`;\n}\n\n/**\n * Summarize, by name, every registration surface the loaded extensions exercised.\n *\n * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is\n * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts\n * the entries by name then layer for deterministic output, and attaches each\n * extension's {@link describeExtensionActivation} summary. When `target` is\n * provided only the case-insensitively matching extensions are described and the\n * `union` is scoped to that resolved name set; otherwise every loaded extension contributes.\n * A target may name either the extension itself or its source npm package\n * (`source_package`), so agents can reuse the `package_name` values surfaced by\n * `pm extension list` / install discovery without a second lookup. An unmatched\n * `target` yields an empty `extensions` array -- the caller decides whether that\n * is a not-found error.\n */\nexport function buildExtensionDescribeResult(\n target: string | undefined,\n loadResult: ExtensionLoadResult,\n activationResult: ExtensionActivationResult,\n): ExtensionDescribeResult {\n const activationFailedKeys = new Set(\n activationResult.failed.map((entry) =>\n layerNameKey(entry.layer, entry.name),\n ),\n );\n const candidates: ExtensionSurfaceDescription[] = [\n ...loadResult.loaded.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: entry.version,\n activation_status: activationFailedKeys.has(\n layerNameKey(entry.layer, entry.name),\n )\n ? (\"failed\" as const)\n : (\"ok\" as const),\n surfaces: describeExtensionActivation(activationResult, {\n extensionName: entry.name,\n }),\n })),\n ...loadResult.failed.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: \"unknown\",\n activation_status: \"not_loaded\" as const,\n surfaces: describeExtensionActivation(activationResult, {\n extensionName: entry.name,\n }),\n })),\n ].sort(\n (left, right) =>\n left.name.localeCompare(right.name) ||\n left.layer.localeCompare(right.layer),\n );\n\n const normalizedTarget =\n typeof target === \"string\" ? normalizeExtensionNameForMatch(target) : null;\n const matchedNames =\n normalizedTarget === null\n ? null\n : new Set(\n loadResult.loaded\n .filter(\n (entry) =>\n normalizeExtensionNameForMatch(entry.name) ===\n normalizedTarget ||\n (typeof entry.source_package === \"string\" &&\n normalizeExtensionNameForMatch(entry.source_package) ===\n normalizedTarget),\n )\n .map((entry) => normalizeExtensionNameForMatch(entry.name))\n .concat(normalizedTarget),\n );\n const extensions =\n matchedNames === null\n ? candidates\n : candidates.filter((entry) =>\n matchedNames.has(normalizeExtensionNameForMatch(entry.name)),\n );\n const unionOptions =\n matchedNames === null ? {} : { extensionNames: [...matchedNames] };\n\n return {\n target: typeof target === \"string\" ? target.trim() : null,\n total: extensions.length,\n extensions,\n union: describeExtensionActivation(activationResult, unionOptions),\n };\n}\n\n/**\n * Human-readable label for each {@link ExtensionDescribeActivationStatus}, used\n * in the Markdown per-extension heading so a reader sees *why* an entry has no\n * surfaces (activation failed / never loaded) rather than assuming it\n * contributes nothing.\n */\nconst ACTIVATION_STATUS_LABELS: Record<\n ExtensionDescribeActivationStatus,\n string\n> = {\n ok: \"loaded\",\n failed: \"activation failed\",\n not_loaded: \"not loaded\",\n};\n\n/**\n * Render an {@link ExtensionDescribeResult} as a Markdown reference document: a\n * top-level title and scope line, one section per described extension (titled\n * with its identity and activation status), and — only when more than one\n * extension was described — a final union section spanning them all. Each\n * extension and the union are rendered with the shared\n * {@link renderExtensionSurfaceMarkdown} primitive at heading level 2, so the\n * document nests cleanly under the level-1 title.\n *\n * `noun` is the lifecycle vocabulary (`\"extension\"` or `\"package\"`) so the prose\n * matches the command the agent invoked. When no extensions match (an unmatched\n * target is already a not-found error upstream, so this is the \"nothing loaded\"\n * case) the document is the title plus a single explanatory note.\n */\nexport function renderExtensionDescribeMarkdown(\n result: ExtensionDescribeResult,\n noun: string,\n): string {\n const titleNoun = `${noun[0]!.toUpperCase()}${noun.slice(1)}`;\n const lines = [`# ${titleNoun} surface reference`, \"\"];\n lines.push(\n result.target === null\n ? `Scope: all loaded ${noun}s`\n : `Scope: \\`${result.target}\\``,\n );\n lines.push(\n `Described: ${result.total} ${noun}${result.total === 1 ? \"\" : \"s\"}`,\n \"\",\n );\n\n if (result.extensions.length === 0) {\n lines.push(`_No ${noun}s are loaded._`, \"\");\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n }\n\n for (const entry of result.extensions) {\n const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;\n // renderExtensionSurfaceMarkdown already ends with a newline; the join adds a\n // single blank line between sections, so no extra \"\" separator is pushed.\n lines.push(\n renderExtensionSurfaceMarkdown(entry.surfaces, {\n title,\n headingLevel: 2,\n }),\n );\n }\n\n if (result.extensions.length > 1) {\n lines.push(\n renderExtensionSurfaceMarkdown(result.union, {\n title: `Union across all described ${noun}s`,\n headingLevel: 2,\n }),\n );\n }\n\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AACH,OAAO,EACL,2BAA2B,GAE5B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAC;AAMtG,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AA6C7D,oRAAoR;AACpR,SAAS,YAAY,CAAC,KAAqB,EAAE,IAAY;IACvD,OAAO,GAAG,KAAK,IAAI,8BAA8B,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAA0B,EAC1B,UAA+B,EAC/B,gBAA2C;IAE3C,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAClC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACpC,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CACtC,CACF,CAAC;IACF,MAAM,UAAU,GAAkC;QAChD,GAAG,UAAU,CAAC,MAAM,CAAC,GA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8BAA8B,IAAI,GAAG;YAC5C,YAAY,EAAE,CAAC;SAChB,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;AAC3C,CAAC","debugId":"fecfae4c-ebb9-5dad-abf6-4c4b147da177"}
1
+ {"version":3,"file":"describe.js","sources":["sdk/extension/describe.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/describe\n *\n * Builds the `pm extension describe` / `pm package describe` payload: a flat,\n * by-name map of every surface each loaded extension registered.\n *\n * The SDK already ships {@link describeExtensionActivation} -- the `describe`\n * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`\n * (invoke-one) testing helpers -- but until now it was reachable only from a test\n * that hand-built an {@link ExtensionActivationResult}. This module is the thin\n * orchestration that lets an agent at the CLI (or over MCP) ask \"what does this\n * installed extension add to my context?\" in one call, instead of stitching\n * together `doctor` (errors), `manage` (update metadata), and a manifest read.\n *\n * It is intentionally pure: the caller performs the load+activate cycle (exactly\n * as `explore`/`doctor` already do) and hands the results here, so the same\n * builder is trivially unit-testable against synthetic activations.\n */\nimport {\n describeExtensionActivation,\n type ExtensionActivationSummary,\n} from \"../../core/extensions/activation-summary.js\";\nimport { renderExtensionSurfaceMarkdown } from \"../../core/extensions/activation-summary-markdown.js\";\nimport type {\n ExtensionActivationResult,\n ExtensionLayer,\n ExtensionLoadResult,\n} from \"../../core/extensions/loader.js\";\nimport { normalizeExtensionNameForMatch } from \"./shared.js\";\n\n/** Runtime state of a described extension. `ok` loaded and activated cleanly, `failed` loaded but threw during `activate`, and `not_loaded` failed to import at all -- the latter two register nothing, so their `surfaces` are empty and the status explains why (rather than implying the extension contributes nothing). */\nexport type ExtensionDescribeActivationStatus = \"ok\" | \"failed\" | \"not_loaded\";\n\n/**\n * One extension's contribution to the workspace: its identity plus the\n * {@link ExtensionActivationSummary} of every surface it registered.\n *\n * `surfaces` is matched by extension *name* (mirroring\n * {@link describeExtensionActivation}'s name filter), so when the same name is\n * loaded in both the project and global layers each entry reflects that name's\n * combined surfaces -- the `layer`/`version` fields still distinguish the\n * physical entries.\n */\nexport interface ExtensionSurfaceDescription {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports layer for this contract. */\n layer: ExtensionLayer;\n /** Value that configures or reports version for this contract. */\n version: string;\n /** Activation outcome reported for this extension. */\n activation_status: ExtensionDescribeActivationStatus;\n /** Value that configures or reports surfaces for this contract. */\n surfaces: ExtensionActivationSummary;\n}\n\n/**\n * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps\n * plus a deduplicated `union` across the described set. `target` echoes the\n * requested name filter (or `null` for the whole workspace) and `total` counts\n * the described entries so callers need not re-measure `extensions`.\n */\nexport interface ExtensionDescribeResult {\n /** Value that configures or reports target for this contract. */\n target: string | null;\n /** Value that configures or reports total for this contract. */\n total: number;\n /** Value that configures or reports extensions for this contract. */\n extensions: ExtensionSurfaceDescription[];\n /** Value that configures or reports union for this contract. */\n union: ExtensionActivationSummary;\n}\n\n/** Compose a collision-free identity key for an extension from its layer and normalized name. The two parts are joined with a colon; the layer prefix is always a colon-free enum value, so distinct (layer, name) pairs never collide even when a name itself contains a colon. */\nfunction layerNameKey(layer: ExtensionLayer, name: string): string {\n return `${layer}:${normalizeExtensionNameForMatch(name)}`;\n}\n\n/**\n * Summarize, by name, every registration surface the loaded extensions exercised.\n *\n * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is\n * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts\n * the entries by name then layer for deterministic output, and attaches each\n * extension's {@link describeExtensionActivation} summary. When `target` is\n * provided only the case-insensitively matching extensions are described and the\n * `union` is scoped to that resolved name set; otherwise every loaded extension contributes.\n * A target may name either the extension itself or its source npm package\n * (`source_package`), so agents can reuse the `package_name` values surfaced by\n * `pm extension list` / install discovery without a second lookup. An unmatched\n * `target` yields an empty `extensions` array -- the caller decides whether that\n * is a not-found error.\n */\nexport function buildExtensionDescribeResult(\n target: string | undefined,\n loadResult: ExtensionLoadResult,\n activationResult: ExtensionActivationResult,\n): ExtensionDescribeResult {\n const activationFailedKeys = new Set(\n activationResult.failed.map((entry) =>\n layerNameKey(entry.layer, entry.name),\n ),\n );\n const candidates: ExtensionSurfaceDescription[] = [\n ...loadResult.loaded.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: entry.version,\n activation_status: activationFailedKeys.has(\n layerNameKey(entry.layer, entry.name),\n )\n ? (\"failed\" as const)\n : (\"ok\" as const),\n surfaces: describeExtensionActivation(activationResult, {\n extensionName: entry.name,\n }),\n })),\n ...loadResult.failed.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: \"unknown\",\n activation_status: \"not_loaded\" as const,\n surfaces: describeExtensionActivation(activationResult, {\n extensionName: entry.name,\n }),\n })),\n ].sort(\n (left, right) =>\n left.name.localeCompare(right.name) ||\n left.layer.localeCompare(right.layer),\n );\n\n const normalizedTarget =\n typeof target === \"string\" ? normalizeExtensionNameForMatch(target) : null;\n const matchedNames =\n normalizedTarget === null\n ? null\n : new Set(\n loadResult.loaded\n .filter(\n (entry) =>\n normalizeExtensionNameForMatch(entry.name) ===\n normalizedTarget ||\n (typeof entry.source_package === \"string\" &&\n normalizeExtensionNameForMatch(entry.source_package) ===\n normalizedTarget),\n )\n .map((entry) => normalizeExtensionNameForMatch(entry.name))\n .concat(normalizedTarget),\n );\n const extensions =\n matchedNames === null\n ? candidates\n : candidates.filter((entry) =>\n matchedNames.has(normalizeExtensionNameForMatch(entry.name)),\n );\n const unionOptions =\n matchedNames === null ? {} : { extensionNames: [...matchedNames] };\n\n return {\n target: typeof target === \"string\" ? target.trim() : null,\n total: extensions.length,\n extensions,\n union: describeExtensionActivation(activationResult, unionOptions),\n };\n}\n\n/**\n * Human-readable label for each {@link ExtensionDescribeActivationStatus}, used\n * in the Markdown per-extension heading so a reader sees *why* an entry has no\n * surfaces (activation failed / never loaded) rather than assuming it\n * contributes nothing.\n */\nconst ACTIVATION_STATUS_LABELS: Record<\n ExtensionDescribeActivationStatus,\n string\n> = {\n ok: \"loaded\",\n failed: \"activation failed\",\n not_loaded: \"not loaded\",\n};\n\n/**\n * Render an {@link ExtensionDescribeResult} as a Markdown reference document: a\n * top-level title and scope line, one section per described extension (titled\n * with its identity and activation status), and — only when more than one\n * extension was described — a final union section spanning them all. Each\n * extension and the union are rendered with the shared\n * {@link renderExtensionSurfaceMarkdown} primitive at heading level 2, so the\n * document nests cleanly under the level-1 title.\n *\n * `noun` is the lifecycle vocabulary (`\"extension\"` or `\"package\"`) so the prose\n * matches the command the agent invoked. When no extensions match (an unmatched\n * target is already a not-found error upstream, so this is the \"nothing loaded\"\n * case) the document is the title plus a single explanatory note.\n */\nexport function renderExtensionDescribeMarkdown(\n result: ExtensionDescribeResult,\n noun: string,\n): string {\n const titleNoun = `${noun[0]!.toUpperCase()}${noun.slice(1)}`;\n const lines = [`# ${titleNoun} surface reference`, \"\"];\n lines.push(\n result.target === null\n ? `Scope: all loaded ${noun}s`\n : `Scope: \\`${result.target}\\``,\n );\n lines.push(\n `Described: ${result.total} ${noun}${result.total === 1 ? \"\" : \"s\"}`,\n \"\",\n );\n\n if (result.extensions.length === 0) {\n lines.push(`_No ${noun}s are loaded._`, \"\");\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n }\n\n for (const entry of result.extensions) {\n const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;\n // renderExtensionSurfaceMarkdown already ends with a newline; the join adds a\n // single blank line between sections, so no extra \"\" separator is pushed.\n lines.push(\n renderExtensionSurfaceMarkdown(entry.surfaces, {\n title,\n headingLevel: 2,\n }),\n );\n }\n\n if (result.extensions.length > 1) {\n lines.push(\n renderExtensionSurfaceMarkdown(result.union, {\n title: `Union across all described ${noun}s`,\n headingLevel: 2,\n }),\n );\n }\n\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n"],"names":[],"mappings":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AAC,OAAO,IAAI,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAC5C,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;IAC3C,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtC,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,OAAO,KAAK,wBAAwB,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC;QACvH,8EAA8E;QAC9E,0EAA0E;QAC1E,KAAK,CAAC,IAAI,CACR,8BAA8B,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC7C,KAAK;YACL,YAAY,EAAE,CAAC;SAChB,CAAC,CACH,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjC,KAAK,CAAC,IAAI,CACR,8BAA8B,CAAC,MAAM,CAAC,KAAK,EAAE;YAC3C,KAAK,EAAE,8BAA8B,IAAI,GAAG;YAC5C,YAAY,EAAE,CAAC;SAChB,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC;AAC3C,CAAC","debugId":"127aa7ea-f1a6-57e6-85da-837f09670dc4"}
@@ -4,7 +4,7 @@
4
4
  * Provides cross-platform extension copy safety and owner-bound install locks.
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]="ef5442ae-3385-544e-889f-d4d78ee473c1")}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]="1ced281f-c8b0-5424-a9d7-68c3512b835e")}catch(e){}}();
8
8
  import { randomUUID } from "node:crypto";
9
9
  import fs from "node:fs/promises";
10
10
  import os from "node:os";
@@ -84,7 +84,9 @@ export const copyExtensionDirectoryWithoutSelfNesting = async (sourceDirectory,
84
84
  });
85
85
  return;
86
86
  }
87
- const systemTempDirectory = path.resolve(temporaryDirectory);
87
+ const systemTempDirectory = await fs
88
+ .realpath(path.resolve(temporaryDirectory))
89
+ .catch(() => resolveCanonicalExtensionInstallDestination(temporaryDirectory));
88
90
  const stagingBase = isPathWithinDirectory(canonicalSource, systemTempDirectory)
89
91
  ? path.dirname(canonicalSource)
90
92
  : systemTempDirectory;
@@ -266,4 +268,4 @@ export const withExtensionInstallLock = async (settingsRoot, destinationDirector
266
268
  }
267
269
  };
268
270
  //# sourceMappingURL=install-runtime.js.map
269
- //# debugId=ef5442ae-3385-544e-889f-d4d78ee473c1
271
+ //# debugId=1ced281f-c8b0-5424-a9d7-68c3512b835e
@@ -1 +1 @@
1
- {"version":3,"file":"install-runtime.js","sources":["sdk/extension/install-runtime.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/install-runtime\n *\n * Provides cross-platform extension copy safety and owner-bound install locks.\n */\nimport { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\n\nconst EXTENSION_INSTALL_COPY_ATTEMPTS = 3;\nconst EXTENSION_INSTALL_LOCK_ATTEMPTS = 120;\nconst EXTENSION_INSTALL_LOCK_DELAY_MS = 250;\nconst EXTENSION_INSTALL_LOCK_STALE_MS = 120_000;\nconst RETRIABLE_EXTENSION_INSTALL_COPY_CODES = new Set([\n \"EEXIST\",\n \"ENOTEMPTY\",\n \"ENOENT\",\n]);\n\ninterface ExtensionInstallLockOwner {\n pid: number;\n token: string;\n created_at: string;\n destination: string;\n}\n\n/** Retry and lease timing overrides for one extension install lock. */\nexport interface ExtensionInstallLockOptions {\n /** Maximum lock-acquisition attempts. */\n attempts?: number;\n /** Delay between contended acquisition attempts. */\n delay_ms?: number;\n /** Age after which an unchanged owner lease can be reclaimed. */\n stale_ms?: number;\n /** Lease heartbeat interval while the operation runs. */\n heartbeat_ms?: number;\n}\n\n/** Return an errno-style code from an unknown failure when one is present. */\nconst errnoCode = (error: unknown): unknown =>\n typeof error === \"object\" && error !== null && \"code\" in error\n ? (error as { code?: unknown }).code\n : undefined;\n\n/** Identify transient copy races that are safe to retry during extension installation. */\nexport const isRetriableExtensionInstallCopyError = (error: unknown): boolean =>\n RETRIABLE_EXTENSION_INSTALL_COPY_CODES.has(String(errnoCode(error)));\n\n/** Test an unknown failure against one expected errno-style code. */\nexport const isErrnoCode = (error: unknown, code: string): boolean =>\n errnoCode(error) === code;\n\n/** Delay an extension filesystem retry without blocking the event loop. */\nconst sleep = (ms: number): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n\n/** Ensure an installed extension carries an ESM package boundary marker. */\nexport const ensureExtensionModuleTypeMarker = async (\n destinationDirectory: string,\n): Promise<void> => {\n const markerPath = path.join(destinationDirectory, \"package.json\");\n if (await pathExists(markerPath)) {\n return;\n }\n await fs.writeFile(\n markerPath,\n `${JSON.stringify({ type: \"module\" }, null, 2)}\\n`,\n \"utf8\",\n );\n};\n\n/** Resolve a possibly partial extension destination through every existing symlink segment. */\nexport const resolveCanonicalExtensionInstallDestination = async (\n destinationDirectory: string,\n): Promise<string> => {\n const resolvedDestination = path.resolve(destinationDirectory);\n const destinationParent = path.dirname(resolvedDestination);\n const destinationRoot = path.parse(destinationParent).root;\n let canonicalDestinationParent = await fs\n .realpath(destinationRoot)\n .catch(() => destinationRoot);\n const relativeDestinationParent = path.relative(\n destinationRoot,\n destinationParent,\n );\n const destinationSegments =\n relativeDestinationParent === \"\"\n ? []\n : relativeDestinationParent.split(path.sep);\n for (const [index, segment] of destinationSegments.entries()) {\n const candidate = path.join(canonicalDestinationParent, segment);\n try {\n canonicalDestinationParent = await fs.realpath(candidate);\n } catch {\n canonicalDestinationParent = path.join(\n canonicalDestinationParent,\n ...destinationSegments.slice(index),\n );\n break;\n }\n }\n return path.join(\n canonicalDestinationParent,\n path.basename(resolvedDestination),\n );\n};\n\n/** Copy an extension without recursively copying a destination nested below its source. */\nexport const copyExtensionDirectoryWithoutSelfNesting = async (\n sourceDirectory: string,\n destinationDirectory: string,\n copyDirectory: typeof fs.cp,\n temporaryDirectory = os.tmpdir(),\n): Promise<void> => {\n const resolvedSource = path.resolve(sourceDirectory);\n const canonicalSource = await fs\n .realpath(resolvedSource)\n .catch(() => resolvedSource);\n const canonicalDestination =\n await resolveCanonicalExtensionInstallDestination(destinationDirectory);\n if (canonicalSource === canonicalDestination) {\n return;\n }\n if (!isPathWithinDirectory(canonicalSource, canonicalDestination)) {\n await copyDirectory(sourceDirectory, destinationDirectory, {\n recursive: true,\n force: true,\n });\n return;\n }\n\n const systemTempDirectory = path.resolve(temporaryDirectory);\n const stagingBase = isPathWithinDirectory(\n canonicalSource,\n systemTempDirectory,\n )\n ? path.dirname(canonicalSource)\n : systemTempDirectory;\n if (isPathWithinDirectory(canonicalSource, stagingBase)) {\n throw new PmCliError(\n `Extension source \"${sourceDirectory}\" contains its install destination and no external staging directory is available. Install a narrower package directory instead.`,\n EXIT_CODE.USAGE,\n { code: \"extension_install_source_contains_destination\" },\n );\n }\n const stagingRoot = await fs.mkdtemp(\n path.join(stagingBase, \"pm-extension-copy-\"),\n );\n const stagedDirectory = path.join(stagingRoot, \"extension\");\n try {\n await copyDirectory(sourceDirectory, stagedDirectory, {\n recursive: true,\n force: true,\n });\n await copyDirectory(stagedDirectory, destinationDirectory, {\n recursive: true,\n force: true,\n });\n } finally {\n await fs.rm(stagingRoot, { recursive: true, force: true });\n }\n};\n\n/** Copy one extension directory with bounded transient-race retries. */\nexport const copyExtensionDirectoryForInstall = async (\n sourceDirectory: string,\n destinationDirectory: string,\n copyDirectory: typeof fs.cp = fs.cp,\n): Promise<void> => {\n for (\n let attempt = 1;\n attempt <= EXTENSION_INSTALL_COPY_ATTEMPTS;\n attempt += 1\n ) {\n try {\n await fs.rm(destinationDirectory, { recursive: true, force: true });\n await copyExtensionDirectoryWithoutSelfNesting(\n sourceDirectory,\n destinationDirectory,\n copyDirectory,\n );\n return;\n } catch (error: unknown) {\n if (\n !isRetriableExtensionInstallCopyError(error) ||\n attempt === EXTENSION_INSTALL_COPY_ATTEMPTS\n ) {\n throw error;\n }\n await sleep(EXTENSION_INSTALL_LOCK_DELAY_MS);\n }\n }\n};\n\n/** Read the unique owner token recorded for one extension scope lock. */\nconst readExtensionInstallLockOwnerToken = async (\n lockPath: string,\n): Promise<string | null> => {\n let ownerContents: string;\n try {\n ownerContents = await fs.readFile(\n path.join(lockPath, \"owner.json\"),\n \"utf8\",\n );\n } catch (error: unknown) {\n if (!isErrnoCode(error, \"ENOENT\")) throw error;\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(ownerContents);\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null || !(\"token\" in parsed)) {\n return null;\n }\n const token = (parsed as { token?: unknown }).token;\n return typeof token === \"string\" && token.length > 0 ? token : null;\n};\n\n/** Remove an extension scope lock only while its persisted owner token still matches. */\nconst removeExtensionInstallLockIfOwned = async (\n lockPath: string,\n ownerToken: string,\n): Promise<boolean> => {\n const currentOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);\n if (currentOwnerToken !== ownerToken) {\n return false;\n }\n await fs.rm(lockPath, { recursive: true, force: true });\n return true;\n};\n\n/** Reclaim an expired extension scope lock when its persisted owner remains unchanged. */\nconst reclaimStaleExtensionInstallLock = async (\n lockPath: string,\n staleMs: number,\n): Promise<boolean> => {\n let stat: Awaited<ReturnType<typeof fs.stat>>;\n try {\n stat = await fs.stat(lockPath);\n } catch {\n return false;\n }\n if (Date.now() - stat.mtimeMs <= staleMs) {\n return false;\n }\n const staleOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);\n if (staleOwnerToken === null) {\n await fs.rm(lockPath, { recursive: true, force: true });\n return true;\n }\n return removeExtensionInstallLockIfOwned(lockPath, staleOwnerToken);\n};\n\n/** Start an owner-bound lease heartbeat and return an async stop barrier. */\nconst startExtensionInstallLockHeartbeat = (\n lockPath: string,\n ownerToken: string,\n intervalMs: number,\n): (() => Promise<void>) => {\n let heartbeat = Promise.resolve();\n const timer = setInterval(() => {\n heartbeat = heartbeat\n .then(async () => {\n if (\n (await readExtensionInstallLockOwnerToken(lockPath)) !== ownerToken\n ) {\n return;\n }\n const heartbeatAt = new Date();\n await fs.utimes(lockPath, heartbeatAt, heartbeatAt);\n })\n .catch(() => undefined);\n }, intervalMs);\n timer.unref();\n return async () => {\n clearInterval(timer);\n await heartbeat;\n };\n};\n\n/** Create one owner-bound extension install lock, removing partial state on failure. */\nconst createExtensionInstallLock = async (\n lockPath: string,\n owner: ExtensionInstallLockOwner,\n): Promise<void> => {\n await fs.mkdir(lockPath);\n try {\n await fs.writeFile(\n path.join(lockPath, \"owner.json\"),\n `${JSON.stringify(owner, null, 2)}\\n`,\n \"utf8\",\n );\n } catch (error: unknown) {\n await fs.rm(lockPath, { recursive: true, force: true }).catch(() => {});\n throw error;\n }\n};\n\n/** Retry owner-bound extension lock acquisition while reclaiming stale owners. */\nconst acquireExtensionInstallLock = async (\n lockPath: string,\n owner: ExtensionInstallLockOwner,\n attempts: number,\n delayMs: number,\n staleMs: number,\n): Promise<boolean> => {\n for (let attempt = 1; attempt <= attempts; attempt += 1) {\n try {\n await createExtensionInstallLock(lockPath, owner);\n return true;\n } catch (error: unknown) {\n if (!isErrnoCode(error, \"EEXIST\")) {\n throw error;\n }\n if (await reclaimStaleExtensionInstallLock(lockPath, staleMs)) {\n attempt -= 1;\n } else {\n await sleep(delayMs);\n }\n }\n }\n return false;\n};\n\n/** Run one operation under an owner-bound extension install lock and heartbeat lease. */\nexport const withExtensionInstallLock = async <T>(\n settingsRoot: string,\n destinationDirectoryName: string,\n run: () => Promise<T>,\n options?: ExtensionInstallLockOptions,\n): Promise<T> => {\n const lockRoot = path.join(\n settingsRoot,\n \"runtime\",\n \"extension-install-locks\",\n );\n const lockPath = path.join(lockRoot, \"scope.lock\");\n await fs.mkdir(lockRoot, { recursive: true });\n const {\n attempts: rawAttempts = EXTENSION_INSTALL_LOCK_ATTEMPTS,\n delay_ms: rawDelayMs = EXTENSION_INSTALL_LOCK_DELAY_MS,\n stale_ms: rawStaleMs = EXTENSION_INSTALL_LOCK_STALE_MS,\n heartbeat_ms: rawHeartbeatMs,\n } = options ?? {};\n if (\n ![rawAttempts, rawDelayMs, rawStaleMs, rawHeartbeatMs]\n .filter((value): value is number => value !== undefined)\n .every(Number.isFinite)\n ) {\n throw new PmCliError(\n \"Extension install lock timings must be finite numbers.\",\n EXIT_CODE.USAGE,\n );\n }\n const attempts = Math.max(1, Math.floor(rawAttempts));\n const delayMs = Math.max(0, Math.floor(rawDelayMs));\n const staleMs = Math.floor(rawStaleMs);\n const heartbeatMs = Math.floor(rawHeartbeatMs ?? staleMs / 3);\n if (staleMs <= 0 || heartbeatMs <= 0 || heartbeatMs >= staleMs) {\n throw new PmCliError(\n \"Extension install lock timings require stale_ms > 0 and 0 < heartbeat_ms < stale_ms.\",\n EXIT_CODE.USAGE,\n );\n }\n const owner: ExtensionInstallLockOwner = {\n pid: process.pid,\n token: randomUUID(),\n created_at: nowIso(),\n destination: destinationDirectoryName,\n };\n const acquired = await acquireExtensionInstallLock(\n lockPath,\n owner,\n attempts,\n delayMs,\n staleMs,\n );\n if (!acquired) {\n throw new PmCliError(\n `Timed out waiting for extension install lock for \"${destinationDirectoryName}\".`,\n EXIT_CODE.CONFLICT,\n );\n }\n\n const stopHeartbeat = startExtensionInstallLockHeartbeat(\n lockPath,\n owner.token,\n heartbeatMs,\n );\n try {\n return await run();\n } finally {\n await stopHeartbeat();\n await removeExtensionInstallLockIfOwned(lockPath, owner.token).catch(\n () => false,\n );\n }\n};\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAC1C,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAC5C,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAC5C,MAAM,+BAA+B,GAAG,OAAO,CAAC;AAChD,MAAM,sCAAsC,GAAG,IAAI,GAAG,CAAC;IACrD,QAAQ;IACR,WAAW;IACX,QAAQ;CACT,CAAC,CAAC;AAqBH,8EAA8E;AAC9E,MAAM,SAAS,GAAG,CAAC,KAAc,EAAW,EAAE,CAC5C,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK;IAC5D,CAAC,CAAE,KAA4B,CAAC,IAAI;IACpC,CAAC,CAAC,SAAS,CAAC;AAEhB,0FAA0F;AAC1F,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,KAAc,EAAW,EAAE,CAC9E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AE,CAAC;QAC/D,MAAM,IAAI,UAAU,CAClB,sFAAsF,EACtF,SAAS,CAAC,KAAK,CAChB,CAAC;IACJ,CAAC;IACD,MAAM,KAAK,GAA8B;QACvC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,UAAU,EAAE;QACnB,UAAU,EAAE,MAAM,EAAE;QACpB,WAAW,EAAE,wBAAwB;KACtC,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,2BAA2B,CAChD,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,CACR,CAAC;IACF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,UAAU,CAClB,qDAAqD,wBAAwB,IAAI,EACjF,SAAS,CAAC,QAAQ,CACnB,CAAC;IACJ,CAAC;IAED,MAAM,aAAa,GAAG,kCAAkC,CACtD,QAAQ,EACR,KAAK,CAAC,KAAK,EACX,WAAW,CACZ,CAAC;IACF,IAAI,CAAC;QACH,OAAO,MAAM,GAAG,EAAE,CAAC;IACrB,CAAC;YAAS,CAAC;QACT,MAAM,aAAa,EAAE,CAAC;QACtB,MAAM,iCAAiC,CAAC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAClE,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC","debugId":"ef5442ae-3385-544e-889f-d4d78ee473c1"}
1
+ {"version":3,"file":"install-runtime.js","sources":["sdk/extension/install-runtime.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/install-runtime\n *\n * Provides cross-platform extension copy safety and owner-bound install locks.\n */\nimport { randomUUID } from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\n\nconst EXTENSION_INSTALL_COPY_ATTEMPTS = 3;\nconst EXTENSION_INSTALL_LOCK_ATTEMPTS = 120;\nconst EXTENSION_INSTALL_LOCK_DELAY_MS = 250;\nconst EXTENSION_INSTALL_LOCK_STALE_MS = 120_000;\nconst RETRIABLE_EXTENSION_INSTALL_COPY_CODES = new Set([\n \"EEXIST\",\n \"ENOTEMPTY\",\n \"ENOENT\",\n]);\n\ninterface ExtensionInstallLockOwner {\n pid: number;\n token: string;\n created_at: string;\n destination: string;\n}\n\n/** Retry and lease timing overrides for one extension install lock. */\nexport interface ExtensionInstallLockOptions {\n /** Maximum lock-acquisition attempts. */\n attempts?: number;\n /** Delay between contended acquisition attempts. */\n delay_ms?: number;\n /** Age after which an unchanged owner lease can be reclaimed. */\n stale_ms?: number;\n /** Lease heartbeat interval while the operation runs. */\n heartbeat_ms?: number;\n}\n\n/** Return an errno-style code from an unknown failure when one is present. */\nconst errnoCode = (error: unknown): unknown =>\n typeof error === \"object\" && error !== null && \"code\" in error\n ? (error as { code?: unknown }).code\n : undefined;\n\n/** Identify transient copy races that are safe to retry during extension installation. */\nexport const isRetriableExtensionInstallCopyError = (error: unknown): boolean =>\n RETRIABLE_EXTENSION_INSTALL_COPY_CODES.has(String(errnoCode(error)));\n\n/** Test an unknown failure against one expected errno-style code. */\nexport const isErrnoCode = (error: unknown, code: string): boolean =>\n errnoCode(error) === code;\n\n/** Delay an extension filesystem retry without blocking the event loop. */\nconst sleep = (ms: number): Promise<void> =>\n new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n\n/** Ensure an installed extension carries an ESM package boundary marker. */\nexport const ensureExtensionModuleTypeMarker = async (\n destinationDirectory: string,\n): Promise<void> => {\n const markerPath = path.join(destinationDirectory, \"package.json\");\n if (await pathExists(markerPath)) {\n return;\n }\n await fs.writeFile(\n markerPath,\n `${JSON.stringify({ type: \"module\" }, null, 2)}\\n`,\n \"utf8\",\n );\n};\n\n/** Resolve a possibly partial extension destination through every existing symlink segment. */\nexport const resolveCanonicalExtensionInstallDestination = async (\n destinationDirectory: string,\n): Promise<string> => {\n const resolvedDestination = path.resolve(destinationDirectory);\n const destinationParent = path.dirname(resolvedDestination);\n const destinationRoot = path.parse(destinationParent).root;\n let canonicalDestinationParent = await fs\n .realpath(destinationRoot)\n .catch(() => destinationRoot);\n const relativeDestinationParent = path.relative(\n destinationRoot,\n destinationParent,\n );\n const destinationSegments =\n relativeDestinationParent === \"\"\n ? []\n : relativeDestinationParent.split(path.sep);\n for (const [index, segment] of destinationSegments.entries()) {\n const candidate = path.join(canonicalDestinationParent, segment);\n try {\n canonicalDestinationParent = await fs.realpath(candidate);\n } catch {\n canonicalDestinationParent = path.join(\n canonicalDestinationParent,\n ...destinationSegments.slice(index),\n );\n break;\n }\n }\n return path.join(\n canonicalDestinationParent,\n path.basename(resolvedDestination),\n );\n};\n\n/** Copy an extension without recursively copying a destination nested below its source. */\nexport const copyExtensionDirectoryWithoutSelfNesting = async (\n sourceDirectory: string,\n destinationDirectory: string,\n copyDirectory: typeof fs.cp,\n temporaryDirectory = os.tmpdir(),\n): Promise<void> => {\n const resolvedSource = path.resolve(sourceDirectory);\n const canonicalSource = await fs\n .realpath(resolvedSource)\n .catch(() => resolvedSource);\n const canonicalDestination =\n await resolveCanonicalExtensionInstallDestination(destinationDirectory);\n if (canonicalSource === canonicalDestination) {\n return;\n }\n if (!isPathWithinDirectory(canonicalSource, canonicalDestination)) {\n await copyDirectory(sourceDirectory, destinationDirectory, {\n recursive: true,\n force: true,\n });\n return;\n }\n\n const systemTempDirectory = await fs\n .realpath(path.resolve(temporaryDirectory))\n .catch(() => resolveCanonicalExtensionInstallDestination(temporaryDirectory));\n const stagingBase = isPathWithinDirectory(\n canonicalSource,\n systemTempDirectory,\n )\n ? path.dirname(canonicalSource)\n : systemTempDirectory;\n if (isPathWithinDirectory(canonicalSource, stagingBase)) {\n throw new PmCliError(\n `Extension source \"${sourceDirectory}\" contains its install destination and no external staging directory is available. Install a narrower package directory instead.`,\n EXIT_CODE.USAGE,\n { code: \"extension_install_source_contains_destination\" },\n );\n }\n const stagingRoot = await fs.mkdtemp(\n path.join(stagingBase, \"pm-extension-copy-\"),\n );\n const stagedDirectory = path.join(stagingRoot, \"extension\");\n try {\n await copyDirectory(sourceDirectory, stagedDirectory, {\n recursive: true,\n force: true,\n });\n await copyDirectory(stagedDirectory, destinationDirectory, {\n recursive: true,\n force: true,\n });\n } finally {\n await fs.rm(stagingRoot, { recursive: true, force: true });\n }\n};\n\n/** Copy one extension directory with bounded transient-race retries. */\nexport const copyExtensionDirectoryForInstall = async (\n sourceDirectory: string,\n destinationDirectory: string,\n copyDirectory: typeof fs.cp = fs.cp,\n): Promise<void> => {\n for (\n let attempt = 1;\n attempt <= EXTENSION_INSTALL_COPY_ATTEMPTS;\n attempt += 1\n ) {\n try {\n await fs.rm(destinationDirectory, { recursive: true, force: true });\n await copyExtensionDirectoryWithoutSelfNesting(\n sourceDirectory,\n destinationDirectory,\n copyDirectory,\n );\n return;\n } catch (error: unknown) {\n if (\n !isRetriableExtensionInstallCopyError(error) ||\n attempt === EXTENSION_INSTALL_COPY_ATTEMPTS\n ) {\n throw error;\n }\n await sleep(EXTENSION_INSTALL_LOCK_DELAY_MS);\n }\n }\n};\n\n/** Read the unique owner token recorded for one extension scope lock. */\nconst readExtensionInstallLockOwnerToken = async (\n lockPath: string,\n): Promise<string | null> => {\n let ownerContents: string;\n try {\n ownerContents = await fs.readFile(\n path.join(lockPath, \"owner.json\"),\n \"utf8\",\n );\n } catch (error: unknown) {\n if (!isErrnoCode(error, \"ENOENT\")) throw error;\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(ownerContents);\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null || !(\"token\" in parsed)) {\n return null;\n }\n const token = (parsed as { token?: unknown }).token;\n return typeof token === \"string\" && token.length > 0 ? token : null;\n};\n\n/** Remove an extension scope lock only while its persisted owner token still matches. */\nconst removeExtensionInstallLockIfOwned = async (\n lockPath: string,\n ownerToken: string,\n): Promise<boolean> => {\n const currentOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);\n if (currentOwnerToken !== ownerToken) {\n return false;\n }\n await fs.rm(lockPath, { recursive: true, force: true });\n return true;\n};\n\n/** Reclaim an expired extension scope lock when its persisted owner remains unchanged. */\nconst reclaimStaleExtensionInstallLock = async (\n lockPath: string,\n staleMs: number,\n): Promise<boolean> => {\n let stat: Awaited<ReturnType<typeof fs.stat>>;\n try {\n stat = await fs.stat(lockPath);\n } catch {\n return false;\n }\n if (Date.now() - stat.mtimeMs <= staleMs) {\n return false;\n }\n const staleOwnerToken = await readExtensionInstallLockOwnerToken(lockPath);\n if (staleOwnerToken === null) {\n await fs.rm(lockPath, { recursive: true, force: true });\n return true;\n }\n return removeExtensionInstallLockIfOwned(lockPath, staleOwnerToken);\n};\n\n/** Start an owner-bound lease heartbeat and return an async stop barrier. */\nconst startExtensionInstallLockHeartbeat = (\n lockPath: string,\n ownerToken: string,\n intervalMs: number,\n): (() => Promise<void>) => {\n let heartbeat = Promise.resolve();\n const timer = setInterval(() => {\n heartbeat = heartbeat\n .then(async () => {\n if (\n (await readExtensionInstallLockOwnerToken(lockPath)) !== ownerToken\n ) {\n return;\n }\n const heartbeatAt = new Date();\n await fs.utimes(lockPath, heartbeatAt, heartbeatAt);\n })\n .catch(() => undefined);\n }, intervalMs);\n timer.unref();\n return async () => {\n clearInterval(timer);\n await heartbeat;\n };\n};\n\n/** Create one owner-bound extension install lock, removing partial state on failure. */\nconst createExtensionInstallLock = async (\n lockPath: string,\n owner: ExtensionInstallLockOwner,\n): Promise<void> => {\n await fs.mkdir(lockPath);\n try {\n await fs.writeFile(\n path.join(lockPath, \"owner.json\"),\n `${JSON.stringify(owner, null, 2)}\\n`,\n \"utf8\",\n );\n } catch (error: unknown) {\n await fs.rm(lockPath, { recursive: true, force: true }).catch(() => {});\n throw error;\n }\n};\n\n/** Retry owner-bound extension lock acquisition while reclaiming stale owners. */\nconst acquireExtensionInstallLock = async (\n lockPath: string,\n owner: ExtensionInstallLockOwner,\n attempts: number,\n delayMs: number,\n staleMs: number,\n): Promise<boolean> => {\n for (let attempt = 1; attempt <= attempts; attempt += 1) {\n try {\n await createExtensionInstallLock(lockPath, owner);\n return true;\n } catch (error: unknown) {\n if (!isErrnoCode(error, \"EEXIST\")) {\n throw error;\n }\n if (await reclaimStaleExtensionInstallLock(lockPath, staleMs)) {\n attempt -= 1;\n } else {\n await sleep(delayMs);\n }\n }\n }\n return false;\n};\n\n/** Run one operation under an owner-bound extension install lock and heartbeat lease. */\nexport const withExtensionInstallLock = async <T>(\n settingsRoot: string,\n destinationDirectoryName: string,\n run: () => Promise<T>,\n options?: ExtensionInstallLockOptions,\n): Promise<T> => {\n const lockRoot = path.join(\n settingsRoot,\n \"runtime\",\n \"extension-install-locks\",\n );\n const lockPath = path.join(lockRoot, \"scope.lock\");\n await fs.mkdir(lockRoot, { recursive: true });\n const {\n attempts: rawAttempts = EXTENSION_INSTALL_LOCK_ATTEMPTS,\n delay_ms: rawDelayMs = EXTENSION_INSTALL_LOCK_DELAY_MS,\n stale_ms: rawStaleMs = EXTENSION_INSTALL_LOCK_STALE_MS,\n heartbeat_ms: rawHeartbeatMs,\n } = options ?? {};\n if (\n ![rawAttempts, rawDelayMs, rawStaleMs, rawHeartbeatMs]\n .filter((value): value is number => value !== undefined)\n .every(Number.isFinite)\n ) {\n throw new PmCliError(\n \"Extension install lock timings must be finite numbers.\",\n EXIT_CODE.USAGE,\n );\n }\n const attempts = Math.max(1, Math.floor(rawAttempts));\n const delayMs = Math.max(0, Math.floor(rawDelayMs));\n const staleMs = Math.floor(rawStaleMs);\n const heartbeatMs = Math.floor(rawHeartbeatMs ?? staleMs / 3);\n if (staleMs <= 0 || heartbeatMs <= 0 || heartbeatMs >= staleMs) {\n throw new PmCliError(\n \"Extension install lock timings require stale_ms > 0 and 0 < heartbeat_ms < stale_ms.\",\n EXIT_CODE.USAGE,\n );\n }\n const owner: ExtensionInstallLockOwner = {\n pid: process.pid,\n token: randomUUID(),\n created_at: nowIso(),\n destination: destinationDirectoryName,\n };\n const acquired = await acquireExtensionInstallLock(\n lockPath,\n owner,\n attempts,\n delayMs,\n staleMs,\n );\n if (!acquired) {\n throw new PmCliError(\n `Timed out waiting for extension install lock for \"${destinationDirectoryName}\".`,\n EXIT_CODE.CONFLICT,\n );\n }\n\n const stopHeartbeat = startExtensionInstallLockHeartbeat(\n lockPath,\n owner.token,\n heartbeatMs,\n );\n try {\n return await run();\n } finally {\n await stopHeartbeat();\n await removeExtensionInstallLockIfOwned(lockPath, owner.token).catch(\n () => false,\n );\n }\n};\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAC1C,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAC5C,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAC5C,MAAM,+BAA+B,GAAG,OAAO,CAAC;AAChD,MAAM,sCAAsC,GAAG,IAAI,GAAG,CAAC;IACrD,QAAQ;IACR,WAAW;IACX,QAAQ;CACT,CAAC,CAAC;AAqBH,8EAA8E;AAC9E,MAAM,SAAS,GAAG,CAAC,KAAc,EAAW,EAAE,CAC5C,OAAO,KAAK,KA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ExtensionSummary {
111
111
  enabled: boolean;
112
112
  /** Value that configures or reports runtime active for this contract. */
113
113
  runtime_active: boolean | null;
114
- /** Lifecycle state reported for activationthe record. */
114
+ /** Activation outcome reported for this extension. */
115
115
  activation_status: ExtensionActivationStatus;
116
116
  /** Value that configures or reports command paths for this contract. */
117
117
  command_paths?: string[];
@@ -129,7 +129,7 @@ export interface ManagedExtensionSummary {
129
129
  last_update_remote_commit?: string;
130
130
  /** Value that configures or reports update error for this contract. */
131
131
  update_error?: string;
132
- /** Lifecycle state reported for update checkthe record. */
132
+ /** Outcome of the registry update check for this extension. */
133
133
  update_check_status: ExtensionUpdateCheckStatus;
134
134
  /** Value that configures or reports update check reason for this contract. */
135
135
  update_check_reason: string;
@@ -4,7 +4,7 @@
4
4
  * Implements the pm extension command surface and its agent-facing runtime behavior.
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]="fe21d8bd-795f-5bed-b4fc-e6efe6ee6120")}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]="dbfbb3c7-f6d7-573b-a90e-808e78a68c28")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { activateExtensions, createSerialQueue, loadExtensions, nextExtensionReloadToken, } from "../core/extensions/index.js";
@@ -2171,4 +2171,4 @@ export const _testOnly = {
2171
2171
  withExtensionInstallLock,
2172
2172
  };
2173
2173
  //# sourceMappingURL=extension.js.map
2174
- //# debugId=fe21d8bd-795f-5bed-b4fc-e6efe6ee6120
2174
+ //# debugId=dbfbb3c7-f6d7-573b-a90e-808e78a68c28