@unbrained/pm-cli 2026.7.5 → 2026.7.7

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 (597) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/cli/commands/annotation-command.d.ts +1 -0
  3. package/dist/cli/commands/annotation-command.js +29 -2
  4. package/dist/cli/commands/annotation-command.js.map +1 -1
  5. package/dist/cli/commands/comments.js +3 -4
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
  8. package/dist/cli/commands/extension/bundled-catalog.js +38 -28
  9. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  10. package/dist/cli/commands/extension/install-sources.js +81 -18
  11. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  12. package/dist/cli/commands/health.js +9 -5
  13. package/dist/cli/commands/health.js.map +1 -1
  14. package/dist/cli/commands/learnings.js +5 -3
  15. package/dist/cli/commands/learnings.js.map +1 -1
  16. package/dist/cli/commands/notes.js +5 -3
  17. package/dist/cli/commands/notes.js.map +1 -1
  18. package/dist/cli/commands/reindex.js +4 -3
  19. package/dist/cli/commands/reindex.js.map +1 -1
  20. package/dist/cli/commands/search.js +3 -3
  21. package/dist/cli/commands/search.js.map +1 -1
  22. package/dist/cli/commands/test.d.ts +9 -0
  23. package/dist/cli/commands/test.js +144 -105
  24. package/dist/cli/commands/test.js.map +1 -1
  25. package/dist/cli/extension-command-help.js +10 -2
  26. package/dist/cli/extension-command-help.js.map +1 -1
  27. package/dist/cli/register-list-query.d.ts +1 -1
  28. package/dist/cli/register-list-query.js +18 -27
  29. package/dist/cli/register-list-query.js.map +1 -1
  30. package/dist/cli/register-operations.d.ts +0 -8
  31. package/dist/cli/register-operations.js +41 -46
  32. package/dist/cli/register-operations.js.map +1 -1
  33. package/dist/cli/register-setup.js +113 -13
  34. package/dist/cli/register-setup.js.map +1 -1
  35. package/dist/cli/registration-helpers.d.ts +5 -1
  36. package/dist/cli/registration-helpers.js +14 -2
  37. package/dist/cli/registration-helpers.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
  39. package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js → append-PVCTBVJG.js} +8 -9
  40. package/dist/cli-bundle/chunks/{chunk-PPE4YUQM.js → chunk-2APXX4TZ.js} +17 -28
  41. package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
  42. package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js → chunk-2LEJGRQ7.js} +3 -12
  43. package/dist/cli-bundle/chunks/{docs-S6UTOTO5.js.map → chunk-2LEJGRQ7.js.map} +1 -1
  44. package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js → chunk-2TILG6F2.js} +3 -3
  45. package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js → chunk-3G6UMXT3.js} +6 -8
  46. package/dist/cli-bundle/chunks/{chunk-S5AYOUT5.js.map → chunk-3G6UMXT3.js.map} +1 -1
  47. package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js → chunk-3TYOW6RR.js} +8 -8
  48. package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js → chunk-3X542TEY.js} +7 -7
  49. package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js → chunk-42LXP4VO.js} +14 -21
  50. package/dist/cli-bundle/chunks/{history-repair-EVTO6LIH.js.map → chunk-42LXP4VO.js.map} +1 -1
  51. package/dist/cli-bundle/chunks/{chunk-5J2XPTAD.js → chunk-43SIHQND.js} +36 -15
  52. package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
  53. package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js → chunk-43UQN754.js} +12 -19
  54. package/dist/cli-bundle/chunks/{history-repair-4N6SDVHK.js.map → chunk-43UQN754.js.map} +1 -1
  55. package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js → chunk-43YSKY75.js} +4 -6
  56. package/dist/cli-bundle/chunks/{chunk-OWTIRHX4.js.map → chunk-43YSKY75.js.map} +1 -1
  57. package/dist/cli-bundle/chunks/{notes-72YXN5JX.js → chunk-4BKDAEDF.js} +6 -13
  58. package/dist/cli-bundle/chunks/{notes-72YXN5JX.js.map → chunk-4BKDAEDF.js.map} +2 -2
  59. package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js → chunk-4IQKDKGE.js} +18 -32
  60. package/dist/cli-bundle/chunks/{close-many-AP4MWU36.js.map → chunk-4IQKDKGE.js.map} +1 -1
  61. package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js → chunk-4MZOKTI2.js} +6 -8
  62. package/dist/cli-bundle/chunks/{chunk-ZCJAA3JK.js.map → chunk-4MZOKTI2.js.map} +1 -1
  63. package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js → chunk-52NS7JDP.js} +14 -20
  64. package/dist/cli-bundle/chunks/{chunk-IJ6CO3JV.js.map → chunk-52NS7JDP.js.map} +1 -1
  65. package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js → chunk-565WYS5W.js} +12 -16
  66. package/dist/cli-bundle/chunks/{chunk-T3F4DF23.js.map → chunk-565WYS5W.js.map} +1 -1
  67. package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js → chunk-5FIQ4EX3.js} +13 -19
  68. package/dist/cli-bundle/chunks/{copy-OTJOWFL6.js.map → chunk-5FIQ4EX3.js.map} +1 -1
  69. package/dist/cli-bundle/chunks/{config-V57QD47V.js → chunk-6G6O3OPQ.js} +259 -41
  70. package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js → chunk-6LCJRGPD.js} +9 -13
  72. package/dist/cli-bundle/chunks/{chunk-K3AGVXSF.js.map → chunk-6LCJRGPD.js.map} +1 -1
  73. package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js → chunk-6UQCNWFV.js} +6 -8
  74. package/dist/cli-bundle/chunks/{chunk-7MDXZAZS.js.map → chunk-6UQCNWFV.js.map} +1 -1
  75. package/dist/cli-bundle/chunks/{chunk-LEKT4K7I.js → chunk-6XTSYPPO.js} +1216 -387
  76. package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
  77. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
  78. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
  79. package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js → chunk-7PNQA24K.js} +30 -36
  80. package/dist/cli-bundle/chunks/{chunk-TSPKZRRW.js.map → chunk-7PNQA24K.js.map} +1 -1
  81. package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js → chunk-7VQ3JJN5.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js → chunk-7Y5N34HX.js} +8 -12
  83. package/dist/cli-bundle/chunks/{chunk-BFVHCAOO.js.map → chunk-7Y5N34HX.js.map} +1 -1
  84. package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js → chunk-AGAVEDIE.js} +7 -7
  85. package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js → chunk-AJUON7E6.js} +3 -3
  86. package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js → chunk-ARKHKYYS.js} +16 -30
  87. package/dist/cli-bundle/chunks/{close-many-OMZIGZB4.js.map → chunk-ARKHKYYS.js.map} +1 -1
  88. package/dist/cli-bundle/chunks/{chunk-7EQNAZX2.js → chunk-C5ACVMOI.js} +99 -51
  89. package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
  90. package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js → chunk-CJQM7O7R.js} +16 -20
  91. package/dist/cli-bundle/chunks/{chunk-PJ3A56YF.js.map → chunk-CJQM7O7R.js.map} +1 -1
  92. package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js → chunk-D2DCTFTL.js} +7 -9
  93. package/dist/cli-bundle/chunks/{chunk-WISPVC2E.js.map → chunk-D2DCTFTL.js.map} +1 -1
  94. package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js → chunk-DDDWVPID.js} +7 -11
  95. package/dist/cli-bundle/chunks/{append-CZGUZ45Q.js.map → chunk-DDDWVPID.js.map} +1 -1
  96. package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js → chunk-DG6BSXZ7.js} +6 -13
  97. package/dist/cli-bundle/chunks/{learnings-2HTPZNGZ.js.map → chunk-DG6BSXZ7.js.map} +2 -2
  98. package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js → chunk-DR2V5OIV.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js → chunk-E3LWJUGF.js} +4 -6
  100. package/dist/cli-bundle/chunks/{chunk-YQMMMONE.js.map → chunk-E3LWJUGF.js.map} +1 -1
  101. package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js → chunk-E3YQFSFE.js} +6 -10
  102. package/dist/cli-bundle/chunks/{chunk-D3UCE7RW.js.map → chunk-E3YQFSFE.js.map} +1 -1
  103. package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js → chunk-EDO7VXSO.js} +2 -2
  104. package/dist/cli-bundle/chunks/{chunk-FDBARR33.js → chunk-EIUBK2LT.js} +12 -18
  105. package/dist/cli-bundle/chunks/{chunk-FDBARR33.js.map → chunk-EIUBK2LT.js.map} +1 -1
  106. package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js → chunk-EMXPI36L.js} +14 -20
  107. package/dist/cli-bundle/chunks/{chunk-HBYZDSK5.js.map → chunk-EMXPI36L.js.map} +1 -1
  108. package/dist/cli-bundle/chunks/{chunk-4OFLJHX6.js → chunk-EOUVR7JN.js} +13 -8
  109. package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js → chunk-EVEPHNXJ.js} +4 -4
  111. package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js → chunk-F6MT7KKE.js} +6 -10
  112. package/dist/cli-bundle/chunks/{deps-L2FPIAD3.js.map → chunk-F6MT7KKE.js.map} +1 -1
  113. package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js → chunk-F6YC2A6X.js} +7 -11
  114. package/dist/cli-bundle/chunks/{chunk-FGQKEDE4.js.map → chunk-F6YC2A6X.js.map} +1 -1
  115. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
  116. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js → chunk-FN6SB4HU.js} +2 -2
  118. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
  119. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
  120. package/dist/cli-bundle/chunks/{chunk-JLA7EVYV.js → chunk-GLS6VMWI.js} +37 -16
  121. package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js → chunk-GPIDUMMN.js} +10 -17
  123. package/dist/cli-bundle/chunks/{files-JPU3FNJ7.js.map → chunk-GPIDUMMN.js.map} +1 -1
  124. package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js → chunk-GTM5HQL4.js} +15 -21
  125. package/dist/cli-bundle/chunks/{history-compact-3F6VELO7.js.map → chunk-GTM5HQL4.js.map} +1 -1
  126. package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js → chunk-H2SMKL2N.js} +8 -8
  127. package/dist/cli-bundle/chunks/{chunk-S4APD35C.js → chunk-HHEWQXPD.js} +6 -6
  128. package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js → chunk-HX6QXV5P.js} +2 -2
  130. package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js → chunk-I74FMIWA.js} +11 -17
  131. package/dist/cli-bundle/chunks/{copy-LEE6P6EM.js.map → chunk-I74FMIWA.js.map} +1 -1
  132. package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js +804 -0
  133. package/dist/cli-bundle/chunks/chunk-IDIBF4E2.js.map +7 -0
  134. package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js → chunk-II7R6KD4.js} +9 -13
  135. package/dist/cli-bundle/chunks/{comments-SAG5LSKL.js.map → chunk-II7R6KD4.js.map} +1 -1
  136. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
  137. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
  138. package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js → chunk-J7BOLHAV.js} +5 -7
  139. package/dist/cli-bundle/chunks/{chunk-Y76TWC45.js.map → chunk-J7BOLHAV.js.map} +1 -1
  140. package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js → chunk-KTGJ2CBU.js} +4 -6
  141. package/dist/cli-bundle/chunks/{chunk-QHZO65XW.js.map → chunk-KTGJ2CBU.js.map} +1 -1
  142. package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js → chunk-LCFJ7XAM.js} +32 -2
  143. package/dist/cli-bundle/chunks/{chunk-5VVUKE3U.js.map → chunk-LCFJ7XAM.js.map} +3 -3
  144. package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js → chunk-LZQU6XJG.js} +28 -34
  145. package/dist/cli-bundle/chunks/{chunk-YMABYTNG.js.map → chunk-LZQU6XJG.js.map} +1 -1
  146. package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js → chunk-M62RO3XK.js} +10 -14
  147. package/dist/cli-bundle/chunks/{chunk-3Y4OESPP.js.map → chunk-M62RO3XK.js.map} +1 -1
  148. package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js → chunk-MCEUKJKW.js} +9 -11
  149. package/dist/cli-bundle/chunks/{chunk-YPPVU5GX.js.map → chunk-MCEUKJKW.js.map} +1 -1
  150. package/dist/cli-bundle/chunks/{chunk-T5Y3QSNF.js → chunk-MHNMCDWR.js} +1447 -86
  151. package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
  152. package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js → chunk-MRFWUSVA.js} +4 -6
  153. package/dist/cli-bundle/chunks/{chunk-HJE4JTKQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
  154. package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js → chunk-N6ZHDLUY.js} +6 -8
  155. package/dist/cli-bundle/chunks/{chunk-P3VRG72Q.js.map → chunk-N6ZHDLUY.js.map} +1 -1
  156. package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js → chunk-NWWL22C7.js} +8 -12
  157. package/dist/cli-bundle/chunks/{delete-HQKGRNRZ.js.map → chunk-NWWL22C7.js.map} +1 -1
  158. package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js → chunk-P3MJJW7P.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js → chunk-PDXJXEZJ.js} +2 -2
  160. package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js → chunk-Q64AYQYW.js} +9 -13
  161. package/dist/cli-bundle/chunks/{append-NSQBCXZJ.js.map → chunk-Q64AYQYW.js.map} +1 -1
  162. package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js → chunk-QDABF2RB.js} +26 -47
  163. package/dist/cli-bundle/chunks/{update-many-SLLAMHT7.js.map → chunk-QDABF2RB.js.map} +1 -1
  164. package/dist/cli-bundle/chunks/{chunk-NBFCNJ7Q.js → chunk-QFBSP3NI.js} +529 -46
  165. package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
  166. package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js → chunk-RB3KLPAH.js} +11 -16
  167. package/dist/cli-bundle/chunks/{focus-LFZ6IDBR.js.map → chunk-RB3KLPAH.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-YSAH5FY5.js → chunk-RY7PTTUB.js} +94 -53
  169. package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
  170. package/dist/cli-bundle/chunks/{chunk-WVSGSZ6J.js → chunk-S547WBYG.js} +1477 -86
  171. package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js → chunk-S5BNGFN5.js} +24 -45
  173. package/dist/cli-bundle/chunks/{update-many-DC7X3EWM.js.map → chunk-S5BNGFN5.js.map} +1 -1
  174. package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js → chunk-S6VC2A2K.js} +9 -14
  175. package/dist/cli-bundle/chunks/{focus-WNMYCVYA.js.map → chunk-S6VC2A2K.js.map} +1 -1
  176. package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js → chunk-SIM5JDON.js} +7 -14
  177. package/dist/cli-bundle/chunks/{learnings-YBIHY3D6.js.map → chunk-SIM5JDON.js.map} +1 -1
  178. package/dist/cli-bundle/chunks/{chunk-ZD34OFFQ.js → chunk-SY75LYXR.js} +12 -7
  179. package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
  180. package/dist/cli-bundle/chunks/{chunk-TT42JUMF.js → chunk-TEISGNSH.js} +7 -7
  181. package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
  182. package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js → chunk-TEKZOS7M.js} +2 -2
  183. package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js → chunk-TGUK6XN6.js} +14 -18
  184. package/dist/cli-bundle/chunks/{chunk-4QQ6PM7M.js.map → chunk-TGUK6XN6.js.map} +1 -1
  185. package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js → chunk-TNC6MZUD.js} +10 -21
  186. package/dist/cli-bundle/chunks/{plan-R4NDQ27E.js.map → chunk-TNC6MZUD.js.map} +1 -1
  187. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
  188. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
  189. package/dist/cli-bundle/chunks/{chunk-YD5FML7K.js → chunk-UO7XAZK6.js} +27 -4
  190. package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
  191. package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js → chunk-V5ZWKJNY.js} +5 -14
  192. package/dist/cli-bundle/chunks/{docs-6CRCSVKK.js.map → chunk-V5ZWKJNY.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js → chunk-VGO73OCK.js} +7 -14
  194. package/dist/cli-bundle/chunks/{notes-NJ7IQJX4.js.map → chunk-VGO73OCK.js.map} +1 -1
  195. package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js → chunk-VLEA2UTQ.js} +2 -2
  196. package/dist/cli-bundle/chunks/{files-6P57MRKL.js → chunk-W5HXHC7C.js} +8 -15
  197. package/dist/cli-bundle/chunks/{files-6P57MRKL.js.map → chunk-W5HXHC7C.js.map} +1 -1
  198. package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js → chunk-WCWVEXGA.js} +2 -2
  199. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
  200. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
  201. package/dist/cli-bundle/chunks/{delete-62JQTYT4.js → chunk-XBX5CBRQ.js} +6 -10
  202. package/dist/cli-bundle/chunks/{delete-62JQTYT4.js.map → chunk-XBX5CBRQ.js.map} +1 -1
  203. package/dist/cli-bundle/chunks/{chunk-MTTXDAK4.js → chunk-XC3X7BQR.js} +541 -44
  204. package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
  205. package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js → chunk-XHCVAZGM.js} +17 -23
  206. package/dist/cli-bundle/chunks/{history-compact-656Y2TN4.js.map → chunk-XHCVAZGM.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js → chunk-XPMXPR7K.js} +7 -9
  208. package/dist/cli-bundle/chunks/{chunk-ZAHXPXVY.js.map → chunk-XPMXPR7K.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js → chunk-XS2TMNXR.js} +8 -12
  210. package/dist/cli-bundle/chunks/{deps-55FTG6Z5.js.map → chunk-XS2TMNXR.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/{plan-XWY5T67S.js → chunk-XXIYUTLK.js} +12 -23
  212. package/dist/cli-bundle/chunks/{plan-XWY5T67S.js.map → chunk-XXIYUTLK.js.map} +1 -1
  213. package/dist/cli-bundle/chunks/{chunk-7QH7DHUB.js → chunk-XZWL7VNE.js} +1220 -398
  214. package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
  215. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
  216. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js → chunk-Y7KYVCZM.js} +12 -18
  218. package/dist/cli-bundle/chunks/{chunk-ABRA3BHY.js.map → chunk-Y7KYVCZM.js.map} +1 -1
  219. package/dist/cli-bundle/chunks/{chunk-UI5BJ6DO.js → chunk-YCVWWIKY.js} +17 -28
  220. package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
  221. package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js +780 -0
  222. package/dist/cli-bundle/chunks/chunk-YH5NBDFA.js.map +1 -0
  223. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
  224. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
  225. package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js → chunk-YPD7SQ5P.js} +8 -12
  226. package/dist/cli-bundle/chunks/{comments-MIW5MZOX.js.map → chunk-YPD7SQ5P.js.map} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js → chunk-YPMZMKN7.js} +2 -2
  228. package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js → chunk-YTD5GICJ.js} +4 -4
  229. package/dist/cli-bundle/chunks/{config-DJJKZB5R.js → chunk-ZNEG2UDO.js} +264 -39
  230. package/dist/cli-bundle/chunks/{config-DJJKZB5R.js.map → chunk-ZNEG2UDO.js.map} +4 -4
  231. package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js → chunk-ZO7CLOY2.js} +3 -3
  232. package/dist/cli-bundle/chunks/{close-3YRR3XY6.js → close-3YYQ5OG2.js} +5 -9
  233. package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
  234. package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
  235. package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
  236. package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
  237. package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
  238. package/dist/cli-bundle/chunks/copy-44RT5GDW.js +13 -0
  239. package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
  240. package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js → create-4GWJWPXG.js} +9 -14
  241. package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
  242. package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
  243. package/dist/cli-bundle/chunks/delete-YQ2VPXNF.js +14 -0
  244. package/dist/cli-bundle/chunks/deps-BU5EBJDU.js +17 -0
  245. package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
  246. package/dist/cli-bundle/chunks/docs-OQBSJNIA.js +18 -0
  247. package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
  248. package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
  249. package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js → files-HTSB2KJG.js} +13 -13
  250. package/dist/cli-bundle/chunks/focus-FOG4ALC2.js +14 -0
  251. package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
  252. package/dist/cli-bundle/chunks/history-compact-M6IFAMBP.js +25 -0
  253. package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
  254. package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js → history-redact-NQX3OGZP.js} +7 -11
  255. package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
  256. package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
  257. package/dist/cli-bundle/chunks/history-repair-NHOJG7WO.js +23 -0
  258. package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
  259. package/dist/cli-bundle/chunks/learnings-T63JGKKN.js +17 -0
  260. package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
  261. package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
  262. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
  263. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js.map +7 -0
  264. package/dist/cli-bundle/chunks/plan-TN537L24.js +28 -0
  265. package/dist/cli-bundle/chunks/plan-TN537L24.js.map +1 -0
  266. package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js +37 -0
  267. package/dist/cli-bundle/chunks/profile-MHAMXMHQ.js.map +1 -0
  268. package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js +33 -0
  269. package/dist/cli-bundle/chunks/profile-TIGLAKJ7.js.map +7 -0
  270. package/dist/cli-bundle/chunks/{register-list-query-5H66WFYF.js → register-list-query-OHXD7G5N.js} +41 -33
  271. package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
  272. package/dist/cli-bundle/chunks/{register-list-query-FB3FNDLZ.js → register-list-query-ZCRABAPN.js} +42 -34
  273. package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js → register-mutation-P3G4XP6Q.js} +36 -41
  275. package/dist/cli-bundle/chunks/{register-mutation-UJO23C7R.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js → register-mutation-XX4H56PE.js} +34 -39
  277. package/dist/cli-bundle/chunks/{register-mutation-Z2ETYHKS.js.map → register-mutation-XX4H56PE.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{register-operations-A3XAM5J7.js → register-operations-V6PIYEDU.js} +80 -52
  279. package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
  280. package/dist/cli-bundle/chunks/{register-operations-SG7HBSUP.js → register-operations-V6VKTG54.js} +79 -51
  281. package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
  282. package/dist/cli-bundle/chunks/{register-setup-K6U3NVY5.js → register-setup-6RVAWT6W.js} +129 -31
  283. package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
  284. package/dist/cli-bundle/chunks/{register-setup-I45OGJUV.js → register-setup-6YVUSQYD.js} +130 -32
  285. package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
  286. package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js → restore-HC3YSWF7.js} +7 -11
  287. package/dist/cli-bundle/chunks/restore-HC3YSWF7.js.map +1 -0
  288. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
  289. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js.map +7 -0
  290. package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js → schema-DAGSYO6E.js} +6 -10
  291. package/dist/cli-bundle/chunks/schema-DAGSYO6E.js.map +7 -0
  292. package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js → schema-UBXJCQAC.js} +6 -10
  293. package/dist/cli-bundle/chunks/schema-UBXJCQAC.js.map +1 -0
  294. package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
  295. package/dist/cli-bundle/chunks/update-CJGG5WMV.js.map +7 -0
  296. package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
  297. package/dist/cli-bundle/chunks/update-LKD64AFP.js.map +1 -0
  298. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
  299. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js.map +7 -0
  300. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
  301. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js.map +1 -0
  302. package/dist/cli-bundle/main.js +29 -31
  303. package/dist/cli-bundle/main.js.map +2 -2
  304. package/dist/cli-bundle/sdk-runtime.js +136 -54
  305. package/dist/cli-bundle/sdk-testing.js +7 -8
  306. package/dist/cli-bundle/sdk.js +132 -84
  307. package/dist/cli-bundle/sdk.js.map +2 -2
  308. package/dist/core/history/drift-scan.js +3 -8
  309. package/dist/core/history/drift-scan.js.map +1 -1
  310. package/dist/core/output/mutation-projection.js +11 -5
  311. package/dist/core/output/mutation-projection.js.map +1 -1
  312. package/dist/core/search/cache.js +3 -3
  313. package/dist/core/search/cache.js.map +1 -1
  314. package/dist/core/search/semantic-defaults.d.ts +2 -0
  315. package/dist/core/search/semantic-defaults.js +11 -4
  316. package/dist/core/search/semantic-defaults.js.map +1 -1
  317. package/dist/core/search/vector-stores.d.ts +1 -1
  318. package/dist/core/search/vector-stores.js +33 -7
  319. package/dist/core/search/vector-stores.js.map +1 -1
  320. package/dist/mcp/server.d.ts +22 -50
  321. package/dist/mcp/server.js +62 -916
  322. package/dist/mcp/server.js.map +1 -1
  323. package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
  324. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  325. package/dist/sdk/cli-contracts/tool-schema.js +9 -7
  326. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  327. package/dist/sdk/index.d.ts +4 -2
  328. package/dist/sdk/index.js +4 -4
  329. package/dist/sdk/index.js.map +1 -1
  330. package/dist/sdk/runtime.d.ts +312 -5
  331. package/dist/sdk/runtime.js +1391 -26
  332. package/dist/sdk/runtime.js.map +1 -1
  333. package/dist/sdk/start-task-status.d.ts +13 -0
  334. package/dist/sdk/start-task-status.js +19 -0
  335. package/dist/sdk/start-task-status.js.map +1 -0
  336. package/dist/sdk/workspace-contracts-cache.d.ts +17 -0
  337. package/dist/sdk/workspace-contracts-cache.js +36 -0
  338. package/dist/sdk/workspace-contracts-cache.js.map +1 -0
  339. package/docs/COMMANDS.md +10 -1
  340. package/docs/RELEASING.md +3 -1
  341. package/docs/SDK.md +81 -0
  342. package/docs/TESTING.md +3 -0
  343. package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +16 -2
  344. package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +16 -1
  345. package/package.json +1 -1
  346. package/dist/cli-bundle/chunks/activity-4XQIDNM5.js +0 -18
  347. package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js +0 -375
  348. package/dist/cli-bundle/chunks/aggregate-EQX2RGB7.js.map +0 -7
  349. package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js +0 -372
  350. package/dist/cli-bundle/chunks/aggregate-PEGZGJXD.js.map +0 -1
  351. package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
  352. package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js +0 -1961
  354. package/dist/cli-bundle/chunks/chunk-3PL6LEKP.js.map +0 -1
  355. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js +0 -1749
  356. package/dist/cli-bundle/chunks/chunk-3U3VEWK6.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
  358. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
  359. package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js +0 -822
  360. package/dist/cli-bundle/chunks/chunk-4LRVSBO6.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-4OFLJHX6.js.map +0 -1
  362. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js +0 -2181
  363. package/dist/cli-bundle/chunks/chunk-53BTLLAF.js.map +0 -1
  364. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js +0 -1704
  365. package/dist/cli-bundle/chunks/chunk-57C2RLW5.js.map +0 -1
  366. package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js +0 -2330
  367. package/dist/cli-bundle/chunks/chunk-5B3X4Y22.js.map +0 -7
  368. package/dist/cli-bundle/chunks/chunk-5J2XPTAD.js.map +0 -7
  369. package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js +0 -995
  370. package/dist/cli-bundle/chunks/chunk-5JZ7APJU.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js +0 -819
  372. package/dist/cli-bundle/chunks/chunk-75U6M5ZD.js.map +0 -1
  373. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
  374. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
  375. package/dist/cli-bundle/chunks/chunk-7EQNAZX2.js.map +0 -7
  376. package/dist/cli-bundle/chunks/chunk-7QH7DHUB.js.map +0 -1
  377. package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js +0 -530
  378. package/dist/cli-bundle/chunks/chunk-BVEUCSH2.js.map +0 -7
  379. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js +0 -275
  380. package/dist/cli-bundle/chunks/chunk-DC3QJQWI.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js +0 -231
  382. package/dist/cli-bundle/chunks/chunk-DRBV5UC2.js.map +0 -7
  383. package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js +0 -2184
  384. package/dist/cli-bundle/chunks/chunk-E2FUG6GD.js.map +0 -7
  385. package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js +0 -1615
  386. package/dist/cli-bundle/chunks/chunk-EZFKWSC7.js.map +0 -7
  387. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js +0 -228
  388. package/dist/cli-bundle/chunks/chunk-FJRKQREY.js.map +0 -1
  389. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js +0 -3237
  390. package/dist/cli-bundle/chunks/chunk-GIWXVMZ3.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js +0 -1570
  392. package/dist/cli-bundle/chunks/chunk-HK72NWAD.js.map +0 -1
  393. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js +0 -3206
  394. package/dist/cli-bundle/chunks/chunk-JFCVQXZX.js.map +0 -1
  395. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
  396. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
  397. package/dist/cli-bundle/chunks/chunk-JLA7EVYV.js.map +0 -1
  398. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js +0 -76
  399. package/dist/cli-bundle/chunks/chunk-K32L7HZO.js.map +0 -1
  400. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js +0 -79
  401. package/dist/cli-bundle/chunks/chunk-KDZ6K25I.js.map +0 -7
  402. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js +0 -915
  403. package/dist/cli-bundle/chunks/chunk-KL22PY6L.js.map +0 -1
  404. package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js +0 -218
  405. package/dist/cli-bundle/chunks/chunk-KLG4ZULO.js.map +0 -7
  406. package/dist/cli-bundle/chunks/chunk-LEKT4K7I.js.map +0 -7
  407. package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js +0 -1858
  408. package/dist/cli-bundle/chunks/chunk-MNZ7DRNC.js.map +0 -1
  409. package/dist/cli-bundle/chunks/chunk-MTTXDAK4.js.map +0 -7
  410. package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js +0 -520
  411. package/dist/cli-bundle/chunks/chunk-MZ7VNEVY.js.map +0 -1
  412. package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js +0 -1041
  413. package/dist/cli-bundle/chunks/chunk-N7X4WP6L.js.map +0 -7
  414. package/dist/cli-bundle/chunks/chunk-NBFCNJ7Q.js.map +0 -1
  415. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
  416. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
  417. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js +0 -918
  418. package/dist/cli-bundle/chunks/chunk-OBA2WH65.js.map +0 -7
  419. package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js +0 -1985
  420. package/dist/cli-bundle/chunks/chunk-OESSOFJ4.js.map +0 -7
  421. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js +0 -238
  422. package/dist/cli-bundle/chunks/chunk-OK5NXCZB.js.map +0 -1
  423. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js +0 -1977
  424. package/dist/cli-bundle/chunks/chunk-P5YORJRH.js.map +0 -7
  425. package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js +0 -1031
  426. package/dist/cli-bundle/chunks/chunk-PPAJG4GB.js.map +0 -1
  427. package/dist/cli-bundle/chunks/chunk-PPE4YUQM.js.map +0 -1
  428. package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
  429. package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
  430. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
  431. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
  432. package/dist/cli-bundle/chunks/chunk-S4APD35C.js.map +0 -7
  433. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js +0 -1149
  434. package/dist/cli-bundle/chunks/chunk-STPSZ2XY.js.map +0 -1
  435. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js +0 -272
  436. package/dist/cli-bundle/chunks/chunk-T4MX77AK.js.map +0 -1
  437. package/dist/cli-bundle/chunks/chunk-T5Y3QSNF.js.map +0 -1
  438. package/dist/cli-bundle/chunks/chunk-TT42JUMF.js.map +0 -1
  439. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js +0 -165
  440. package/dist/cli-bundle/chunks/chunk-UHKX7I75.js.map +0 -1
  441. package/dist/cli-bundle/chunks/chunk-UI5BJ6DO.js.map +0 -7
  442. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js +0 -1932
  443. package/dist/cli-bundle/chunks/chunk-US3T3W5J.js.map +0 -1
  444. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js +0 -175
  445. package/dist/cli-bundle/chunks/chunk-UZRDBL6W.js.map +0 -7
  446. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
  447. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
  448. package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js +0 -1868
  449. package/dist/cli-bundle/chunks/chunk-VZIYHZDX.js.map +0 -7
  450. package/dist/cli-bundle/chunks/chunk-WVSGSZ6J.js.map +0 -7
  451. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js +0 -1152
  452. package/dist/cli-bundle/chunks/chunk-XQCG2JGW.js.map +0 -7
  453. package/dist/cli-bundle/chunks/chunk-YD5FML7K.js.map +0 -1
  454. package/dist/cli-bundle/chunks/chunk-YSAH5FY5.js.map +0 -1
  455. package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js +0 -1005
  456. package/dist/cli-bundle/chunks/chunk-YZIR4R3U.js.map +0 -7
  457. package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js +0 -215
  458. package/dist/cli-bundle/chunks/chunk-Z2CRRZYF.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-ZD34OFFQ.js.map +0 -7
  460. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js +0 -2306
  461. package/dist/cli-bundle/chunks/chunk-ZJB3UV5U.js.map +0 -1
  462. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js +0 -241
  463. package/dist/cli-bundle/chunks/chunk-ZVDL32GJ.js.map +0 -7
  464. package/dist/cli-bundle/chunks/claim-4DROPSIS.js +0 -144
  465. package/dist/cli-bundle/chunks/claim-4DROPSIS.js.map +0 -1
  466. package/dist/cli-bundle/chunks/claim-VX54TV5U.js +0 -147
  467. package/dist/cli-bundle/chunks/claim-VX54TV5U.js.map +0 -7
  468. package/dist/cli-bundle/chunks/close-OB2Y4QP5.js +0 -16
  469. package/dist/cli-bundle/chunks/config-V57QD47V.js.map +0 -1
  470. package/dist/cli-bundle/chunks/context-4OQGIPSO.js +0 -45
  471. package/dist/cli-bundle/chunks/context-WLA6IAWE.js +0 -49
  472. package/dist/cli-bundle/chunks/contracts-HXJLKCRI.js +0 -12
  473. package/dist/cli-bundle/chunks/create-WKOZKPQR.js +0 -30
  474. package/dist/cli-bundle/chunks/eval-N6UHFWVO.js +0 -288
  475. package/dist/cli-bundle/chunks/eval-N6UHFWVO.js.map +0 -7
  476. package/dist/cli-bundle/chunks/eval-PHOTWYHI.js +0 -278
  477. package/dist/cli-bundle/chunks/eval-PHOTWYHI.js.map +0 -1
  478. package/dist/cli-bundle/chunks/extension-NBAH62ML.js +0 -40
  479. package/dist/cli-bundle/chunks/extension-ZF6ZZPOU.js +0 -44
  480. package/dist/cli-bundle/chunks/gc-AETFKZ44.js +0 -398
  481. package/dist/cli-bundle/chunks/gc-AETFKZ44.js.map +0 -7
  482. package/dist/cli-bundle/chunks/gc-RLBP4QVN.js +0 -388
  483. package/dist/cli-bundle/chunks/gc-RLBP4QVN.js.map +0 -1
  484. package/dist/cli-bundle/chunks/get-NH2MPBCI.js +0 -283
  485. package/dist/cli-bundle/chunks/get-NH2MPBCI.js.map +0 -1
  486. package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js +0 -286
  487. package/dist/cli-bundle/chunks/get-P4ZQXCPZ.js.map +0 -7
  488. package/dist/cli-bundle/chunks/health-3GVPMQBL.js +0 -1612
  489. package/dist/cli-bundle/chunks/health-3GVPMQBL.js.map +0 -1
  490. package/dist/cli-bundle/chunks/health-DNTM72GJ.js +0 -1615
  491. package/dist/cli-bundle/chunks/health-DNTM72GJ.js.map +0 -7
  492. package/dist/cli-bundle/chunks/history-RYKLC72X.js +0 -20
  493. package/dist/cli-bundle/chunks/history-SGPYRAFT.js +0 -24
  494. package/dist/cli-bundle/chunks/history-redact-4H3FCKF3.js +0 -21
  495. package/dist/cli-bundle/chunks/init-RPIPQUNV.js +0 -32
  496. package/dist/cli-bundle/chunks/init-SKQAESQS.js +0 -28
  497. package/dist/cli-bundle/chunks/list-64LHZ3HM.js +0 -32
  498. package/dist/cli-bundle/chunks/list-7LXBTEKI.js +0 -36
  499. package/dist/cli-bundle/chunks/next-7ODPAQ4U.js +0 -306
  500. package/dist/cli-bundle/chunks/next-7ODPAQ4U.js.map +0 -7
  501. package/dist/cli-bundle/chunks/next-ODJUM4ZM.js +0 -303
  502. package/dist/cli-bundle/chunks/next-ODJUM4ZM.js.map +0 -1
  503. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js +0 -397
  504. package/dist/cli-bundle/chunks/profile-XQWEQKS3.js.map +0 -1
  505. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js +0 -400
  506. package/dist/cli-bundle/chunks/profile-YRDHLMRO.js.map +0 -7
  507. package/dist/cli-bundle/chunks/register-list-query-5H66WFYF.js.map +0 -7
  508. package/dist/cli-bundle/chunks/register-list-query-FB3FNDLZ.js.map +0 -1
  509. package/dist/cli-bundle/chunks/register-operations-A3XAM5J7.js.map +0 -1
  510. package/dist/cli-bundle/chunks/register-operations-SG7HBSUP.js.map +0 -7
  511. package/dist/cli-bundle/chunks/register-setup-I45OGJUV.js.map +0 -1
  512. package/dist/cli-bundle/chunks/register-setup-K6U3NVY5.js.map +0 -7
  513. package/dist/cli-bundle/chunks/restore-PXOFL6AM.js +0 -19
  514. package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js +0 -91
  515. package/dist/cli-bundle/chunks/scheduling-shortcuts-SSC4MYWQ.js.map +0 -7
  516. package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js +0 -88
  517. package/dist/cli-bundle/chunks/scheduling-shortcuts-ULRG7MNP.js.map +0 -1
  518. package/dist/cli-bundle/chunks/search-3S72CTD6.js +0 -38
  519. package/dist/cli-bundle/chunks/search-WNUNBQXO.js +0 -34
  520. package/dist/cli-bundle/chunks/stats-IJYTRQGV.js +0 -250
  521. package/dist/cli-bundle/chunks/stats-IJYTRQGV.js.map +0 -7
  522. package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js +0 -240
  523. package/dist/cli-bundle/chunks/stats-L2D5Y2O5.js.map +0 -1
  524. package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js +0 -309
  525. package/dist/cli-bundle/chunks/telemetry-L2CVOKVN.js.map +0 -7
  526. package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js +0 -306
  527. package/dist/cli-bundle/chunks/telemetry-QBYWQA76.js.map +0 -1
  528. package/dist/cli-bundle/chunks/test-DQ2QFJ7W.js +0 -45
  529. package/dist/cli-bundle/chunks/test-W7QBLVJS.js +0 -41
  530. package/dist/cli-bundle/chunks/test-all-636NTRTT.js +0 -434
  531. package/dist/cli-bundle/chunks/test-all-636NTRTT.js.map +0 -1
  532. package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js +0 -437
  533. package/dist/cli-bundle/chunks/test-all-DWYK3RG6.js.map +0 -7
  534. package/dist/cli-bundle/chunks/test-runs-245OINZR.js +0 -28
  535. package/dist/cli-bundle/chunks/test-runs-ZRD4GCTT.js +0 -24
  536. package/dist/cli-bundle/chunks/update-SFLZPJXX.js +0 -30
  537. package/dist/cli-bundle/chunks/update-SJZ6S77U.js +0 -26
  538. package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js +0 -290
  539. package/dist/cli-bundle/chunks/upgrade-HFFXLZJA.js.map +0 -7
  540. package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js +0 -287
  541. package/dist/cli-bundle/chunks/upgrade-UYQKM7RF.js.map +0 -1
  542. package/dist/cli-bundle/chunks/validate-PA4FDTOV.js +0 -2143
  543. package/dist/cli-bundle/chunks/validate-PA4FDTOV.js.map +0 -7
  544. package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js +0 -2105
  545. package/dist/cli-bundle/chunks/validate-Z7L75YEJ.js.map +0 -1
  546. /package/dist/cli-bundle/chunks/{activity-4XQIDNM5.js.map → append-F7WPGIQL.js.map} +0 -0
  547. /package/dist/cli-bundle/chunks/{activity-YKAKZTZ4.js.map → append-PVCTBVJG.js.map} +0 -0
  548. /package/dist/cli-bundle/chunks/{chunk-T3ABIMGW.js.map → chunk-2TILG6F2.js.map} +0 -0
  549. /package/dist/cli-bundle/chunks/{chunk-RCT3YJOK.js.map → chunk-3TYOW6RR.js.map} +0 -0
  550. /package/dist/cli-bundle/chunks/{chunk-3JZNEQBA.js.map → chunk-3X542TEY.js.map} +0 -0
  551. /package/dist/cli-bundle/chunks/{chunk-YOF5VPKM.js.map → chunk-7VQ3JJN5.js.map} +0 -0
  552. /package/dist/cli-bundle/chunks/{chunk-P5TFTLWW.js.map → chunk-AGAVEDIE.js.map} +0 -0
  553. /package/dist/cli-bundle/chunks/{chunk-YFIE7YK6.js.map → chunk-AJUON7E6.js.map} +0 -0
  554. /package/dist/cli-bundle/chunks/{chunk-7WYXBPYQ.js.map → chunk-DR2V5OIV.js.map} +0 -0
  555. /package/dist/cli-bundle/chunks/{chunk-PDXT6Q55.js.map → chunk-EDO7VXSO.js.map} +0 -0
  556. /package/dist/cli-bundle/chunks/{chunk-FUM6UMY4.js.map → chunk-EVEPHNXJ.js.map} +0 -0
  557. /package/dist/cli-bundle/chunks/{chunk-RX3HQSYG.js.map → chunk-FN6SB4HU.js.map} +0 -0
  558. /package/dist/cli-bundle/chunks/{chunk-DLQ4ZTCU.js.map → chunk-H2SMKL2N.js.map} +0 -0
  559. /package/dist/cli-bundle/chunks/{chunk-C3PMDWGX.js.map → chunk-HX6QXV5P.js.map} +0 -0
  560. /package/dist/cli-bundle/chunks/{chunk-N6DNM2FA.js.map → chunk-P3MJJW7P.js.map} +0 -0
  561. /package/dist/cli-bundle/chunks/{chunk-5JE6SMYS.js.map → chunk-PDXJXEZJ.js.map} +0 -0
  562. /package/dist/cli-bundle/chunks/{chunk-AAEQMOC6.js.map → chunk-TEKZOS7M.js.map} +0 -0
  563. /package/dist/cli-bundle/chunks/{chunk-NER3KUUS.js.map → chunk-VLEA2UTQ.js.map} +0 -0
  564. /package/dist/cli-bundle/chunks/{chunk-ZMD35NYG.js.map → chunk-WCWVEXGA.js.map} +0 -0
  565. /package/dist/cli-bundle/chunks/{chunk-T35XLYZF.js.map → chunk-YPMZMKN7.js.map} +0 -0
  566. /package/dist/cli-bundle/chunks/{chunk-R3ZBLGTC.js.map → chunk-YTD5GICJ.js.map} +0 -0
  567. /package/dist/cli-bundle/chunks/{chunk-EEY54JMF.js.map → chunk-ZO7CLOY2.js.map} +0 -0
  568. /package/dist/cli-bundle/chunks/{close-3YRR3XY6.js.map → close-3YYQ5OG2.js.map} +0 -0
  569. /package/dist/cli-bundle/chunks/{close-OB2Y4QP5.js.map → close-Z3Q4U7TS.js.map} +0 -0
  570. /package/dist/cli-bundle/chunks/{context-4OQGIPSO.js.map → close-many-3L2RXH3M.js.map} +0 -0
  571. /package/dist/cli-bundle/chunks/{context-WLA6IAWE.js.map → close-many-D366FTIG.js.map} +0 -0
  572. /package/dist/cli-bundle/chunks/{contracts-OJEXMKVW.js.map → comments-54XDJNFE.js.map} +0 -0
  573. /package/dist/cli-bundle/chunks/{contracts-HXJLKCRI.js.map → comments-HGHC2PN6.js.map} +0 -0
  574. /package/dist/cli-bundle/chunks/{create-XWWQFQ6S.js.map → copy-44RT5GDW.js.map} +0 -0
  575. /package/dist/cli-bundle/chunks/{create-WKOZKPQR.js.map → copy-UGMUGHZA.js.map} +0 -0
  576. /package/dist/cli-bundle/chunks/{extension-ZF6ZZPOU.js.map → create-4GWJWPXG.js.map} +0 -0
  577. /package/dist/cli-bundle/chunks/{extension-NBAH62ML.js.map → create-AZXCUYKP.js.map} +0 -0
  578. /package/dist/cli-bundle/chunks/{history-RYKLC72X.js.map → delete-Y6SXIQ4X.js.map} +0 -0
  579. /package/dist/cli-bundle/chunks/{history-SGPYRAFT.js.map → delete-YQ2VPXNF.js.map} +0 -0
  580. /package/dist/cli-bundle/chunks/{history-redact-54ICFKXM.js.map → deps-BU5EBJDU.js.map} +0 -0
  581. /package/dist/cli-bundle/chunks/{history-redact-4H3FCKF3.js.map → deps-FMANWFRP.js.map} +0 -0
  582. /package/dist/cli-bundle/chunks/{init-RPIPQUNV.js.map → docs-OQBSJNIA.js.map} +0 -0
  583. /package/dist/cli-bundle/chunks/{init-SKQAESQS.js.map → docs-VNPBZXEL.js.map} +0 -0
  584. /package/dist/cli-bundle/chunks/{list-64LHZ3HM.js.map → files-72HZEBOE.js.map} +0 -0
  585. /package/dist/cli-bundle/chunks/{list-7LXBTEKI.js.map → files-HTSB2KJG.js.map} +0 -0
  586. /package/dist/cli-bundle/chunks/{restore-YJ2ET6AT.js.map → focus-FOG4ALC2.js.map} +0 -0
  587. /package/dist/cli-bundle/chunks/{restore-PXOFL6AM.js.map → focus-SUTMKXGX.js.map} +0 -0
  588. /package/dist/cli-bundle/chunks/{schema-Y6DXXK2F.js.map → history-compact-M6IFAMBP.js.map} +0 -0
  589. /package/dist/cli-bundle/chunks/{schema-2PUXCZ25.js.map → history-compact-NEXRPP2O.js.map} +0 -0
  590. /package/dist/cli-bundle/chunks/{search-3S72CTD6.js.map → history-redact-NQX3OGZP.js.map} +0 -0
  591. /package/dist/cli-bundle/chunks/{search-WNUNBQXO.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
  592. /package/dist/cli-bundle/chunks/{test-W7QBLVJS.js.map → history-repair-CBHMHAJO.js.map} +0 -0
  593. /package/dist/cli-bundle/chunks/{test-DQ2QFJ7W.js.map → history-repair-NHOJG7WO.js.map} +0 -0
  594. /package/dist/cli-bundle/chunks/{test-runs-ZRD4GCTT.js.map → learnings-M64NTSOR.js.map} +0 -0
  595. /package/dist/cli-bundle/chunks/{test-runs-245OINZR.js.map → learnings-T63JGKKN.js.map} +0 -0
  596. /package/dist/cli-bundle/chunks/{update-SJZ6S77U.js.map → notes-73WE2UV2.js.map} +0 -0
  597. /package/dist/cli-bundle/chunks/{update-SFLZPJXX.js.map → notes-U7L6HQQ2.js.map} +0 -0
@@ -1,290 +0,0 @@
1
- import {
2
- readManagedExtensionState,
3
- runExtension
4
- } from "./chunk-GIWXVMZ3.js";
5
- import "./chunk-KDZ6K25I.js";
6
- import "./chunk-ZVDL32GJ.js";
7
- import "./chunk-E2FUG6GD.js";
8
- import "./chunk-5HIZDR5A.js";
9
- import "./chunk-R3ZBLGTC.js";
10
- import "./chunk-UI5BJ6DO.js";
11
- import "./chunk-C3PMDWGX.js";
12
- import "./chunk-4QQ6PM7M.js";
13
- import "./chunk-3U3VEWK6.js";
14
- import "./chunk-Y76TWC45.js";
15
- import "./chunk-EZFKWSC7.js";
16
- import "./chunk-DRBV5UC2.js";
17
- import {
18
- PmCliError
19
- } from "./chunk-P5YORJRH.js";
20
- import "./chunk-T35XLYZF.js";
21
- import "./chunk-7C2O74AE.js";
22
- import {
23
- EXIT_CODE,
24
- pathExists,
25
- resolveExtensionRoots,
26
- resolvePmCliVersion,
27
- resolvePmRoot
28
- } from "./chunk-5VVUKE3U.js";
29
-
30
- // dist/cli/commands/upgrade.js
31
- import { execFile } from "node:child_process";
32
- import path from "node:path";
33
- import { promisify } from "node:util";
34
- !(function() {
35
- try {
36
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
37
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "23e180a8-5d22-5a29-9970-219fbdc3d967");
38
- } catch (e2) {
39
- }
40
- })();
41
- var execFileAsync = promisify(execFile);
42
- var DEFAULT_CLI_PACKAGE = "@unbrained/pm-cli";
43
- var DEFAULT_TAG = "latest";
44
- var _testOnly = {
45
- defaultCommandRunner,
46
- isLocalNpmSpec,
47
- normalizeTarget,
48
- packageRecordMatchesTarget,
49
- resolveCliPackage,
50
- resolvePackageInstallSource,
51
- resolveRunnablePackageSource,
52
- resolveScope,
53
- resolveTag,
54
- packageCommandFor,
55
- summarize
56
- };
57
- function resolveScope(options) {
58
- const projectLike = options.project === true || options.local === true;
59
- const global2 = options.global === true;
60
- if (projectLike && global2) {
61
- throw new PmCliError('Options "--project/--local" and "--global" are mutually exclusive.', EXIT_CODE.USAGE);
62
- }
63
- return global2 ? "global" : "project";
64
- }
65
- function normalizeTarget(value) {
66
- return value.trim().toLowerCase();
67
- }
68
- function packageRecordMatchesTarget(record, target) {
69
- const normalizedTarget = normalizeTarget(target);
70
- const values = [
71
- record.name,
72
- record.directory,
73
- record.source.input,
74
- record.source.location,
75
- record.source.package,
76
- record.source.repository,
77
- record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : void 0
78
- ];
79
- return values.some((value) => typeof value === "string" && normalizeTarget(value) === normalizedTarget);
80
- }
81
- function resolveRoots(scope, global2) {
82
- const pmRoot = resolvePmRoot(process.cwd(), global2.path);
83
- const roots = resolveExtensionRoots(pmRoot, process.cwd());
84
- return {
85
- selected_root: scope === "global" ? roots.global : roots.project
86
- };
87
- }
88
- async function defaultCommandRunner(command, args, options) {
89
- try {
90
- const result = await execFileAsync(command, args, {
91
- cwd: options?.cwd,
92
- encoding: "utf8"
93
- });
94
- return {
95
- stdout: result.stdout,
96
- stderr: result.stderr
97
- };
98
- } catch (error) {
99
- const stderr = typeof error === "object" && error !== null && "stderr" in error ? String(error.stderr ?? "") : "";
100
- const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);
101
- throw new PmCliError(`Command failed: ${command} ${args.join(" ")}
102
- ${message}`, EXIT_CODE.GENERIC_FAILURE);
103
- }
104
- }
105
- async function readCurrentVersion() {
106
- return resolvePmCliVersion(import.meta.url, ["../../.."]);
107
- }
108
- function resolveTag(options) {
109
- return typeof options.tag === "string" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;
110
- }
111
- function resolveCliPackage(options) {
112
- return typeof options.packageName === "string" && options.packageName.trim().length > 0 ? options.packageName.trim() : DEFAULT_CLI_PACKAGE;
113
- }
114
- async function upgradeCli(options, dryRun) {
115
- const runner = options.commandRunner ?? defaultCommandRunner;
116
- const packageName = resolveCliPackage(options);
117
- const tag = resolveTag(options);
118
- const target = `${packageName}@${tag}`;
119
- const command = ["npm", "install", "-g", target];
120
- if (options.repair === true) {
121
- command.push("--force");
122
- }
123
- const beforeVersion = await readCurrentVersion();
124
- const planned = {
125
- requested: true,
126
- status: "planned",
127
- package: packageName,
128
- target,
129
- command,
130
- before_version: beforeVersion,
131
- repair: options.repair === true
132
- };
133
- if (dryRun) {
134
- return planned;
135
- }
136
- try {
137
- await runner(command[0], command.slice(1));
138
- const verified = await runner("pm", ["--version"]);
139
- return {
140
- ...planned,
141
- status: "updated",
142
- after_version: verified.stdout.trim() || void 0
143
- };
144
- } catch (error) {
145
- return {
146
- ...planned,
147
- status: "failed",
148
- error: error instanceof Error ? error.message : String(error)
149
- };
150
- }
151
- }
152
- function isLocalNpmSpec(spec) {
153
- return path.isAbsolute(spec) || spec.startsWith(".") || spec.startsWith("..") || spec.startsWith("file:");
154
- }
155
- function resolvePackageInstallSource(source, tag) {
156
- if (source.kind === "npm") {
157
- const rawSpec = source.input.startsWith("npm:") ? source.input.slice("npm:".length).trim() : source.input.trim();
158
- if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {
159
- return `npm:${source.package.trim()}@${tag}`;
160
- }
161
- return source.input.startsWith("npm:") ? source.input : `npm:${source.input}`;
162
- }
163
- return source.input;
164
- }
165
- async function resolveRunnablePackageSource(source, tag) {
166
- const installSource = resolvePackageInstallSource(source, tag);
167
- if (source.kind !== "local") {
168
- return installSource;
169
- }
170
- if (await pathExists(installSource)) {
171
- return installSource;
172
- }
173
- if (await pathExists(source.location)) {
174
- return source.location;
175
- }
176
- return installSource;
177
- }
178
- function packageCommandFor(source, installSource, scope, ref) {
179
- const command = ["pm", "install", installSource, scope === "global" ? "--global" : "--project"];
180
- if (source.kind === "github" && ref && ref.trim().length > 0) {
181
- command.push("--ref", ref.trim());
182
- }
183
- return command;
184
- }
185
- async function readManagedRecords(scope, global2) {
186
- const roots = resolveRoots(scope, global2);
187
- const managedState = await readManagedExtensionState(roots.selected_root);
188
- return managedState.state.entries.filter((entry) => entry.scope === scope);
189
- }
190
- async function refreshManagedRecord(scope, global2, record) {
191
- const records = await readManagedRecords(scope, global2);
192
- return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ?? records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));
193
- }
194
- async function upgradePackageRecord(record, options, global2, scope, dryRun) {
195
- const tag = resolveTag(options);
196
- const installSource = await resolveRunnablePackageSource(record.source, tag);
197
- const command = packageCommandFor(record.source, installSource, scope, record.source.ref);
198
- const planned = {
199
- name: record.name,
200
- directory: record.directory,
201
- scope,
202
- source: record.source,
203
- status: "planned",
204
- command,
205
- previous_version: record.manifest_version
206
- };
207
- if (dryRun) {
208
- return planned;
209
- }
210
- try {
211
- await runExtension(installSource, {
212
- install: true,
213
- project: scope === "project",
214
- global: scope === "global",
215
- ref: record.source.kind === "github" ? record.source.ref : void 0
216
- }, global2);
217
- const refreshed = await refreshManagedRecord(scope, global2, record);
218
- return {
219
- ...planned,
220
- status: "updated",
221
- installed_version: refreshed?.manifest_version
222
- };
223
- } catch (error) {
224
- return {
225
- ...planned,
226
- status: "failed",
227
- error: error instanceof Error ? error.message : String(error)
228
- };
229
- }
230
- }
231
- function summarize(cli, packages, includeCli, includePackages) {
232
- const statuses = [includeCli ? cli.status : void 0, ...packages.map((entry) => entry.status)].filter((value) => typeof value === "string");
233
- return {
234
- requested_cli: includeCli,
235
- requested_packages: includePackages,
236
- planned: statuses.filter((status) => status === "planned").length,
237
- updated: statuses.filter((status) => status === "updated").length,
238
- skipped: statuses.filter((status) => status === "skipped").length,
239
- failed: statuses.filter((status) => status === "failed").length
240
- };
241
- }
242
- async function runUpgrade(target, options, global2) {
243
- if (options.cliOnly === true && options.packagesOnly === true) {
244
- throw new PmCliError('Options "--cli-only" and "--packages-only" are mutually exclusive.', EXIT_CODE.USAGE);
245
- }
246
- const scope = resolveScope(options);
247
- const dryRun = options.dryRun === true;
248
- const normalizedTarget = typeof target === "string" && target.trim().length > 0 ? target.trim() : void 0;
249
- if (options.cliOnly === true && normalizedTarget) {
250
- throw new PmCliError('A package target cannot be used with "--cli-only".', EXIT_CODE.USAGE);
251
- }
252
- const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;
253
- const includePackages = options.cliOnly === true ? false : true;
254
- const cli = includeCli ? await upgradeCli(options, dryRun) : {
255
- requested: false,
256
- status: "skipped",
257
- package: resolveCliPackage(options),
258
- target: `${resolveCliPackage(options)}@${resolveTag(options)}`,
259
- command: ["npm", "install", "-g", `${resolveCliPackage(options)}@${resolveTag(options)}`],
260
- repair: options.repair === true,
261
- reason: "not_requested"
262
- };
263
- let packageRecords = includePackages ? await readManagedRecords(scope, global2) : [];
264
- if (normalizedTarget) {
265
- packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));
266
- if (packageRecords.length === 0) {
267
- throw new PmCliError(`Managed package "${normalizedTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
268
- }
269
- }
270
- const packages = [];
271
- for (const record of packageRecords) {
272
- packages.push(await upgradePackageRecord(record, options, global2, scope, dryRun));
273
- }
274
- const summary = summarize(cli, packages, includeCli, includePackages);
275
- return {
276
- ok: summary.failed === 0,
277
- action: "upgrade",
278
- dry_run: dryRun,
279
- scope,
280
- target: normalizedTarget,
281
- cli,
282
- packages,
283
- summary
284
- };
285
- }
286
- export {
287
- _testOnly,
288
- runUpgrade
289
- };
290
- //# sourceMappingURL=upgrade-HFFXLZJA.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../../cli/commands/upgrade.ts"],
4
- "sourcesContent": ["/**\n * @module cli/commands/upgrade\n *\n * Implements the pm upgrade command surface and its agent-facing runtime behavior.\n */\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport {\n readManagedExtensionState,\n runExtension,\n type ExtensionScope,\n type ManagedExtensionRecord,\n type ManagedExtensionSource,\n} from \"./extension.js\";\nimport { resolveExtensionRoots } from \"../../core/extensions/loader.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { resolvePmCliVersion } from \"../../core/packages/root.js\";\n\nconst execFileAsync = promisify(execFile);\nconst DEFAULT_CLI_PACKAGE = \"@unbrained/pm-cli\";\nconst DEFAULT_TAG = \"latest\";\n\n/**\n * Documents the upgrade command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandOptions {\n dryRun?: boolean;\n cliOnly?: boolean;\n packagesOnly?: boolean;\n project?: boolean;\n local?: boolean;\n global?: boolean;\n repair?: boolean;\n tag?: string;\n packageName?: string;\n commandRunner?: UpgradeCommandRunner;\n}\n\nexport const _testOnly = {\n defaultCommandRunner,\n isLocalNpmSpec,\n normalizeTarget,\n packageRecordMatchesTarget,\n resolveCliPackage,\n resolvePackageInstallSource,\n resolveRunnablePackageSource,\n resolveScope,\n resolveTag,\n packageCommandFor,\n summarize,\n};\n\n/**\n * Documents the upgrade command runner result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandRunnerResult {\n stdout: string;\n stderr: string;\n}\n\n/**\n * Restricts upgrade command runner values accepted by command, SDK, and storage contracts.\n */\nexport type UpgradeCommandRunner = (\n command: string,\n args: string[],\n options?: { cwd?: string },\n) => Promise<UpgradeCommandRunnerResult>;\n\n/**\n * Documents the upgrade cli result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCliResult {\n requested: boolean;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n package: string;\n target: string;\n command: string[];\n before_version?: string;\n after_version?: string;\n repair: boolean;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade package result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradePackageResult {\n name: string;\n directory: string;\n scope: ExtensionScope;\n source: ManagedExtensionSource;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n command: string[];\n previous_version: string;\n installed_version?: string;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeResult {\n ok: boolean;\n action: \"upgrade\";\n dry_run: boolean;\n scope: ExtensionScope;\n target?: string;\n cli: UpgradeCliResult;\n packages: UpgradePackageResult[];\n summary: {\n requested_cli: boolean;\n requested_packages: boolean;\n planned: number;\n updated: number;\n skipped: number;\n failed: number;\n };\n}\n\nfunction resolveScope(options: UpgradeCommandOptions): ExtensionScope {\n const projectLike = options.project === true || options.local === true;\n const global = options.global === true;\n if (projectLike && global) {\n throw new PmCliError('Options \"--project/--local\" and \"--global\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n return global ? \"global\" : \"project\";\n}\n\nfunction normalizeTarget(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction packageRecordMatchesTarget(record: ManagedExtensionRecord, target: string): boolean {\n const normalizedTarget = normalizeTarget(target);\n const values = [\n record.name,\n record.directory,\n record.source.input,\n record.source.location,\n record.source.package,\n record.source.repository,\n record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : undefined,\n ];\n return values.some((value) => typeof value === \"string\" && normalizeTarget(value) === normalizedTarget);\n}\n\nfunction resolveRoots(scope: ExtensionScope, global: GlobalOptions): {\n selected_root: string;\n} {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const roots = resolveExtensionRoots(pmRoot, process.cwd());\n return {\n selected_root: scope === \"global\" ? roots.global : roots.project,\n };\n}\n\nasync function defaultCommandRunner(\n command: string,\n args: string[],\n options?: { cwd?: string },\n): Promise<UpgradeCommandRunnerResult> {\n try {\n const result = await execFileAsync(command, args, {\n cwd: options?.cwd,\n encoding: \"utf8\",\n });\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n };\n } catch (error: unknown) {\n const stderr = typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr?: unknown }).stderr ?? \"\")\n : \"\";\n const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);\n throw new PmCliError(`Command failed: ${command} ${args.join(\" \")}\\n${message}`, EXIT_CODE.GENERIC_FAILURE);\n }\n}\n\nasync function readCurrentVersion(): Promise<string | undefined> {\n return resolvePmCliVersion(import.meta.url, [\"../../..\"]);\n}\n\nfunction resolveTag(options: UpgradeCommandOptions): string {\n return typeof options.tag === \"string\" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;\n}\n\nfunction resolveCliPackage(options: UpgradeCommandOptions): string {\n return typeof options.packageName === \"string\" && options.packageName.trim().length > 0\n ? options.packageName.trim()\n : DEFAULT_CLI_PACKAGE;\n}\n\nasync function upgradeCli(options: UpgradeCommandOptions, dryRun: boolean): Promise<UpgradeCliResult> {\n const runner = options.commandRunner ?? defaultCommandRunner;\n const packageName = resolveCliPackage(options);\n const tag = resolveTag(options);\n const target = `${packageName}@${tag}`;\n const command = [\"npm\", \"install\", \"-g\", target];\n if (options.repair === true) {\n command.push(\"--force\");\n }\n const beforeVersion = await readCurrentVersion();\n const planned: UpgradeCliResult = {\n requested: true,\n status: \"planned\",\n package: packageName,\n target,\n command,\n before_version: beforeVersion,\n repair: options.repair === true,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runner(command[0]!, command.slice(1));\n const verified = await runner(\"pm\", [\"--version\"]);\n return {\n ...planned,\n status: \"updated\",\n after_version: verified.stdout.trim() || undefined,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction isLocalNpmSpec(spec: string): boolean {\n return path.isAbsolute(spec) || spec.startsWith(\".\") || spec.startsWith(\"..\") || spec.startsWith(\"file:\");\n}\n\nfunction resolvePackageInstallSource(source: ManagedExtensionSource, tag: string): string {\n if (source.kind === \"npm\") {\n const rawSpec = source.input.startsWith(\"npm:\") ? source.input.slice(\"npm:\".length).trim() : source.input.trim();\n if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {\n return `npm:${source.package.trim()}@${tag}`;\n }\n return source.input.startsWith(\"npm:\") ? source.input : `npm:${source.input}`;\n }\n return source.input;\n}\n\nasync function resolveRunnablePackageSource(source: ManagedExtensionSource, tag: string): Promise<string> {\n const installSource = resolvePackageInstallSource(source, tag);\n if (source.kind !== \"local\") {\n return installSource;\n }\n if (await pathExists(installSource)) {\n return installSource;\n }\n if (await pathExists(source.location)) {\n return source.location;\n }\n return installSource;\n}\n\nfunction packageCommandFor(source: ManagedExtensionSource, installSource: string, scope: ExtensionScope, ref?: string): string[] {\n const command = [\"pm\", \"install\", installSource, scope === \"global\" ? \"--global\" : \"--project\"];\n if (source.kind === \"github\" && ref && ref.trim().length > 0) {\n command.push(\"--ref\", ref.trim());\n }\n return command;\n}\n\nasync function readManagedRecords(scope: ExtensionScope, global: GlobalOptions): Promise<ManagedExtensionRecord[]> {\n const roots = resolveRoots(scope, global);\n const managedState = await readManagedExtensionState(roots.selected_root);\n return managedState.state.entries.filter((entry) => entry.scope === scope);\n}\n\nasync function refreshManagedRecord(\n scope: ExtensionScope,\n global: GlobalOptions,\n record: ManagedExtensionRecord,\n): Promise<ManagedExtensionRecord | undefined> {\n const records = await readManagedRecords(scope, global);\n return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ??\n records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));\n}\n\nasync function upgradePackageRecord(\n record: ManagedExtensionRecord,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n scope: ExtensionScope,\n dryRun: boolean,\n): Promise<UpgradePackageResult> {\n const tag = resolveTag(options);\n const installSource = await resolveRunnablePackageSource(record.source, tag);\n const command = packageCommandFor(record.source, installSource, scope, record.source.ref);\n const planned: UpgradePackageResult = {\n name: record.name,\n directory: record.directory,\n scope,\n source: record.source,\n status: \"planned\",\n command,\n previous_version: record.manifest_version,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runExtension(\n installSource,\n {\n install: true,\n project: scope === \"project\",\n global: scope === \"global\",\n ref: record.source.kind === \"github\" ? record.source.ref : undefined,\n },\n global,\n );\n const refreshed = await refreshManagedRecord(scope, global, record);\n return {\n ...planned,\n status: \"updated\",\n installed_version: refreshed?.manifest_version,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction summarize(\n cli: UpgradeCliResult,\n packages: UpgradePackageResult[],\n includeCli: boolean,\n includePackages: boolean,\n): UpgradeResult[\"summary\"] {\n const statuses = [includeCli ? cli.status : undefined, ...packages.map((entry) => entry.status)].filter(\n (value): value is UpgradeCliResult[\"status\"] => typeof value === \"string\",\n );\n return {\n requested_cli: includeCli,\n requested_packages: includePackages,\n planned: statuses.filter((status) => status === \"planned\").length,\n updated: statuses.filter((status) => status === \"updated\").length,\n skipped: statuses.filter((status) => status === \"skipped\").length,\n failed: statuses.filter((status) => status === \"failed\").length,\n };\n}\n\n/**\n * Implements run upgrade for the public runtime surface of this module.\n */\nexport async function runUpgrade(\n target: string | undefined,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n): Promise<UpgradeResult> {\n if (options.cliOnly === true && options.packagesOnly === true) {\n throw new PmCliError('Options \"--cli-only\" and \"--packages-only\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n\n const scope = resolveScope(options);\n const dryRun = options.dryRun === true;\n const normalizedTarget = typeof target === \"string\" && target.trim().length > 0 ? target.trim() : undefined;\n if (options.cliOnly === true && normalizedTarget) {\n throw new PmCliError('A package target cannot be used with \"--cli-only\".', EXIT_CODE.USAGE);\n }\n const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;\n const includePackages = options.cliOnly === true ? false : true;\n const cli = includeCli\n ? await upgradeCli(options, dryRun)\n : {\n requested: false,\n status: \"skipped\",\n package: resolveCliPackage(options),\n target: `${resolveCliPackage(options)}@${resolveTag(options)}`,\n command: [\"npm\", \"install\", \"-g\", `${resolveCliPackage(options)}@${resolveTag(options)}`],\n repair: options.repair === true,\n reason: \"not_requested\",\n } as UpgradeCliResult;\n\n let packageRecords = includePackages ? await readManagedRecords(scope, global) : [];\n if (normalizedTarget) {\n packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));\n if (packageRecords.length === 0) {\n throw new PmCliError(`Managed package \"${normalizedTarget}\" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);\n }\n }\n\n const packages: UpgradePackageResult[] = [];\n for (const record of packageRecords) {\n packages.push(await upgradePackageRecord(record, options, global, scope, dryRun));\n }\n\n const summary = summarize(cli, packages, includeCli, includePackages);\n return {\n ok: summary.failed === 0,\n action: \"upgrade\",\n dry_run: dryRun,\n scope,\n target: normalizedTarget,\n cli,\n packages,\n summary,\n };\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,SAAS,iBAAiB;;;;;;;;AAgB1B,IAAM,gBAAgB,UAAU,QAAQ;AACxC,IAAM,sBAAsB;AAC5B,IAAM,cAAc;AAkBb,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAyEF,SAAS,aAAa,SAA8B;AAClD,QAAM,cAAc,QAAQ,YAAY,QAAQ,QAAQ,UAAU;AAClE,QAAMA,UAAS,QAAQ,WAAW;AAClC,MAAI,e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B;AACnC,aAAS,KAAK,MAAM,qBAAqB,QAAQ,SAASA,SAAQ,OAAO,MAAM,CAAC;EAClF;AAEA,QAAM,UAAU,UAAU,KAAK,UAAU,YAAY,eAAe;AACpE,SAAO;IACL,IAAI,QAAQ,WAAW;IACvB,QAAQ;IACR,SAAS;IACT;IACA,QAAQ;IACR;IACA;IACA;;AAEJ;",
6
- "names": ["global"]
7
- }
@@ -1,287 +0,0 @@
1
-
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78b1d487-b05d-50ab-b2ae-6253f5611d85")}catch(e){}}();
3
- import {
4
- readManagedExtensionState,
5
- runExtension
6
- } from "./chunk-JFCVQXZX.js";
7
- import "./chunk-K32L7HZO.js";
8
- import "./chunk-OK5NXCZB.js";
9
- import "./chunk-53BTLLAF.js";
10
- import "./chunk-P4SESZGT.js";
11
- import "./chunk-FUM6UMY4.js";
12
- import "./chunk-PPE4YUQM.js";
13
- import "./chunk-AAEQMOC6.js";
14
- import "./chunk-PJ3A56YF.js";
15
- import "./chunk-57C2RLW5.js";
16
- import "./chunk-ZAHXPXVY.js";
17
- import "./chunk-HK72NWAD.js";
18
- import "./chunk-FJRKQREY.js";
19
- import {
20
- PmCliError
21
- } from "./chunk-US3T3W5J.js";
22
- import "./chunk-NER3KUUS.js";
23
- import "./chunk-NNHHXJB2.js";
24
- import {
25
- EXIT_CODE,
26
- pathExists,
27
- resolveExtensionRoots,
28
- resolvePmCliVersion,
29
- resolvePmRoot
30
- } from "./chunk-YD5FML7K.js";
31
-
32
- // dist/cli/commands/upgrade.js
33
- import { execFile } from "node:child_process";
34
- import path from "node:path";
35
- import { promisify } from "node:util";
36
- var execFileAsync = promisify(execFile);
37
- var DEFAULT_CLI_PACKAGE = "@unbrained/pm-cli";
38
- var DEFAULT_TAG = "latest";
39
- var _testOnly = {
40
- defaultCommandRunner,
41
- isLocalNpmSpec,
42
- normalizeTarget,
43
- packageRecordMatchesTarget,
44
- resolveCliPackage,
45
- resolvePackageInstallSource,
46
- resolveRunnablePackageSource,
47
- resolveScope,
48
- resolveTag,
49
- packageCommandFor,
50
- summarize
51
- };
52
- function resolveScope(options) {
53
- const projectLike = options.project === true || options.local === true;
54
- const global = options.global === true;
55
- if (projectLike && global) {
56
- throw new PmCliError('Options "--project/--local" and "--global" are mutually exclusive.', EXIT_CODE.USAGE);
57
- }
58
- return global ? "global" : "project";
59
- }
60
- function normalizeTarget(value) {
61
- return value.trim().toLowerCase();
62
- }
63
- function packageRecordMatchesTarget(record, target) {
64
- const normalizedTarget = normalizeTarget(target);
65
- const values = [
66
- record.name,
67
- record.directory,
68
- record.source.input,
69
- record.source.location,
70
- record.source.package,
71
- record.source.repository,
72
- record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : void 0
73
- ];
74
- return values.some((value) => typeof value === "string" && normalizeTarget(value) === normalizedTarget);
75
- }
76
- function resolveRoots(scope, global) {
77
- const pmRoot = resolvePmRoot(process.cwd(), global.path);
78
- const roots = resolveExtensionRoots(pmRoot, process.cwd());
79
- return {
80
- selected_root: scope === "global" ? roots.global : roots.project
81
- };
82
- }
83
- async function defaultCommandRunner(command, args, options) {
84
- try {
85
- const result = await execFileAsync(command, args, {
86
- cwd: options?.cwd,
87
- encoding: "utf8"
88
- });
89
- return {
90
- stdout: result.stdout,
91
- stderr: result.stderr
92
- };
93
- } catch (error) {
94
- const stderr = typeof error === "object" && error !== null && "stderr" in error ? String(error.stderr ?? "") : "";
95
- const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);
96
- throw new PmCliError(`Command failed: ${command} ${args.join(" ")}
97
- ${message}`, EXIT_CODE.GENERIC_FAILURE);
98
- }
99
- }
100
- async function readCurrentVersion() {
101
- return resolvePmCliVersion(import.meta.url, ["../../.."]);
102
- }
103
- function resolveTag(options) {
104
- return typeof options.tag === "string" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;
105
- }
106
- function resolveCliPackage(options) {
107
- return typeof options.packageName === "string" && options.packageName.trim().length > 0 ? options.packageName.trim() : DEFAULT_CLI_PACKAGE;
108
- }
109
- async function upgradeCli(options, dryRun) {
110
- const runner = options.commandRunner ?? defaultCommandRunner;
111
- const packageName = resolveCliPackage(options);
112
- const tag = resolveTag(options);
113
- const target = `${packageName}@${tag}`;
114
- const command = ["npm", "install", "-g", target];
115
- if (options.repair === true) {
116
- command.push("--force");
117
- }
118
- const beforeVersion = await readCurrentVersion();
119
- const planned = {
120
- requested: true,
121
- status: "planned",
122
- package: packageName,
123
- target,
124
- command,
125
- before_version: beforeVersion,
126
- repair: options.repair === true
127
- };
128
- if (dryRun) {
129
- return planned;
130
- }
131
- try {
132
- await runner(command[0], command.slice(1));
133
- const verified = await runner("pm", ["--version"]);
134
- return {
135
- ...planned,
136
- status: "updated",
137
- after_version: verified.stdout.trim() || void 0
138
- };
139
- } catch (error) {
140
- return {
141
- ...planned,
142
- status: "failed",
143
- error: error instanceof Error ? error.message : String(error)
144
- };
145
- }
146
- }
147
- function isLocalNpmSpec(spec) {
148
- return path.isAbsolute(spec) || spec.startsWith(".") || spec.startsWith("..") || spec.startsWith("file:");
149
- }
150
- function resolvePackageInstallSource(source, tag) {
151
- if (source.kind === "npm") {
152
- const rawSpec = source.input.startsWith("npm:") ? source.input.slice("npm:".length).trim() : source.input.trim();
153
- if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {
154
- return `npm:${source.package.trim()}@${tag}`;
155
- }
156
- return source.input.startsWith("npm:") ? source.input : `npm:${source.input}`;
157
- }
158
- return source.input;
159
- }
160
- async function resolveRunnablePackageSource(source, tag) {
161
- const installSource = resolvePackageInstallSource(source, tag);
162
- if (source.kind !== "local") {
163
- return installSource;
164
- }
165
- if (await pathExists(installSource)) {
166
- return installSource;
167
- }
168
- if (await pathExists(source.location)) {
169
- return source.location;
170
- }
171
- return installSource;
172
- }
173
- function packageCommandFor(source, installSource, scope, ref) {
174
- const command = ["pm", "install", installSource, scope === "global" ? "--global" : "--project"];
175
- if (source.kind === "github" && ref && ref.trim().length > 0) {
176
- command.push("--ref", ref.trim());
177
- }
178
- return command;
179
- }
180
- async function readManagedRecords(scope, global) {
181
- const roots = resolveRoots(scope, global);
182
- const managedState = await readManagedExtensionState(roots.selected_root);
183
- return managedState.state.entries.filter((entry) => entry.scope === scope);
184
- }
185
- async function refreshManagedRecord(scope, global, record) {
186
- const records = await readManagedRecords(scope, global);
187
- return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ?? records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));
188
- }
189
- async function upgradePackageRecord(record, options, global, scope, dryRun) {
190
- const tag = resolveTag(options);
191
- const installSource = await resolveRunnablePackageSource(record.source, tag);
192
- const command = packageCommandFor(record.source, installSource, scope, record.source.ref);
193
- const planned = {
194
- name: record.name,
195
- directory: record.directory,
196
- scope,
197
- source: record.source,
198
- status: "planned",
199
- command,
200
- previous_version: record.manifest_version
201
- };
202
- if (dryRun) {
203
- return planned;
204
- }
205
- try {
206
- await runExtension(installSource, {
207
- install: true,
208
- project: scope === "project",
209
- global: scope === "global",
210
- ref: record.source.kind === "github" ? record.source.ref : void 0
211
- }, global);
212
- const refreshed = await refreshManagedRecord(scope, global, record);
213
- return {
214
- ...planned,
215
- status: "updated",
216
- installed_version: refreshed?.manifest_version
217
- };
218
- } catch (error) {
219
- return {
220
- ...planned,
221
- status: "failed",
222
- error: error instanceof Error ? error.message : String(error)
223
- };
224
- }
225
- }
226
- function summarize(cli, packages, includeCli, includePackages) {
227
- const statuses = [includeCli ? cli.status : void 0, ...packages.map((entry) => entry.status)].filter((value) => typeof value === "string");
228
- return {
229
- requested_cli: includeCli,
230
- requested_packages: includePackages,
231
- planned: statuses.filter((status) => status === "planned").length,
232
- updated: statuses.filter((status) => status === "updated").length,
233
- skipped: statuses.filter((status) => status === "skipped").length,
234
- failed: statuses.filter((status) => status === "failed").length
235
- };
236
- }
237
- async function runUpgrade(target, options, global) {
238
- if (options.cliOnly === true && options.packagesOnly === true) {
239
- throw new PmCliError('Options "--cli-only" and "--packages-only" are mutually exclusive.', EXIT_CODE.USAGE);
240
- }
241
- const scope = resolveScope(options);
242
- const dryRun = options.dryRun === true;
243
- const normalizedTarget = typeof target === "string" && target.trim().length > 0 ? target.trim() : void 0;
244
- if (options.cliOnly === true && normalizedTarget) {
245
- throw new PmCliError('A package target cannot be used with "--cli-only".', EXIT_CODE.USAGE);
246
- }
247
- const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;
248
- const includePackages = options.cliOnly === true ? false : true;
249
- const cli = includeCli ? await upgradeCli(options, dryRun) : {
250
- requested: false,
251
- status: "skipped",
252
- package: resolveCliPackage(options),
253
- target: `${resolveCliPackage(options)}@${resolveTag(options)}`,
254
- command: ["npm", "install", "-g", `${resolveCliPackage(options)}@${resolveTag(options)}`],
255
- repair: options.repair === true,
256
- reason: "not_requested"
257
- };
258
- let packageRecords = includePackages ? await readManagedRecords(scope, global) : [];
259
- if (normalizedTarget) {
260
- packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));
261
- if (packageRecords.length === 0) {
262
- throw new PmCliError(`Managed package "${normalizedTarget}" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);
263
- }
264
- }
265
- const packages = [];
266
- for (const record of packageRecords) {
267
- packages.push(await upgradePackageRecord(record, options, global, scope, dryRun));
268
- }
269
- const summary = summarize(cli, packages, includeCli, includePackages);
270
- return {
271
- ok: summary.failed === 0,
272
- action: "upgrade",
273
- dry_run: dryRun,
274
- scope,
275
- target: normalizedTarget,
276
- cli,
277
- packages,
278
- summary
279
- };
280
- }
281
- export {
282
- _testOnly,
283
- runUpgrade
284
- };
285
- //# sourceMappingURL=upgrade-UYQKM7RF.js.map
286
-
287
- //# debugId=78b1d487-b05d-50ab-b2ae-6253f5611d85
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../../../cli/commands/upgrade.ts"],"sourcesContent":["/**\n * @module cli/commands/upgrade\n *\n * Implements the pm upgrade command surface and its agent-facing runtime behavior.\n */\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport {\n readManagedExtensionState,\n runExtension,\n type ExtensionScope,\n type ManagedExtensionRecord,\n type ManagedExtensionSource,\n} from \"./extension.js\";\nimport { resolveExtensionRoots } from \"../../core/extensions/loader.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { resolvePmCliVersion } from \"../../core/packages/root.js\";\n\nconst execFileAsync = promisify(execFile);\nconst DEFAULT_CLI_PACKAGE = \"@unbrained/pm-cli\";\nconst DEFAULT_TAG = \"latest\";\n\n/**\n * Documents the upgrade command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandOptions {\n dryRun?: boolean;\n cliOnly?: boolean;\n packagesOnly?: boolean;\n project?: boolean;\n local?: boolean;\n global?: boolean;\n repair?: boolean;\n tag?: string;\n packageName?: string;\n commandRunner?: UpgradeCommandRunner;\n}\n\nexport const _testOnly = {\n defaultCommandRunner,\n isLocalNpmSpec,\n normalizeTarget,\n packageRecordMatchesTarget,\n resolveCliPackage,\n resolvePackageInstallSource,\n resolveRunnablePackageSource,\n resolveScope,\n resolveTag,\n packageCommandFor,\n summarize,\n};\n\n/**\n * Documents the upgrade command runner result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCommandRunnerResult {\n stdout: string;\n stderr: string;\n}\n\n/**\n * Restricts upgrade command runner values accepted by command, SDK, and storage contracts.\n */\nexport type UpgradeCommandRunner = (\n command: string,\n args: string[],\n options?: { cwd?: string },\n) => Promise<UpgradeCommandRunnerResult>;\n\n/**\n * Documents the upgrade cli result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeCliResult {\n requested: boolean;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n package: string;\n target: string;\n command: string[];\n before_version?: string;\n after_version?: string;\n repair: boolean;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade package result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradePackageResult {\n name: string;\n directory: string;\n scope: ExtensionScope;\n source: ManagedExtensionSource;\n status: \"planned\" | \"updated\" | \"failed\" | \"skipped\";\n command: string[];\n previous_version: string;\n installed_version?: string;\n reason?: string;\n error?: string;\n}\n\n/**\n * Documents the upgrade result payload exchanged by command, SDK, and package integrations.\n */\nexport interface UpgradeResult {\n ok: boolean;\n action: \"upgrade\";\n dry_run: boolean;\n scope: ExtensionScope;\n target?: string;\n cli: UpgradeCliResult;\n packages: UpgradePackageResult[];\n summary: {\n requested_cli: boolean;\n requested_packages: boolean;\n planned: number;\n updated: number;\n skipped: number;\n failed: number;\n };\n}\n\nfunction resolveScope(options: UpgradeCommandOptions): ExtensionScope {\n const projectLike = options.project === true || options.local === true;\n const global = options.global === true;\n if (projectLike && global) {\n throw new PmCliError('Options \"--project/--local\" and \"--global\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n return global ? \"global\" : \"project\";\n}\n\nfunction normalizeTarget(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction packageRecordMatchesTarget(record: ManagedExtensionRecord, target: string): boolean {\n const normalizedTarget = normalizeTarget(target);\n const values = [\n record.name,\n record.directory,\n record.source.input,\n record.source.location,\n record.source.package,\n record.source.repository,\n record.source.owner && record.source.repo ? `${record.source.owner}/${record.source.repo}` : undefined,\n ];\n return values.some((value) => typeof value === \"string\" && normalizeTarget(value) === normalizedTarget);\n}\n\nfunction resolveRoots(scope: ExtensionScope, global: GlobalOptions): {\n selected_root: string;\n} {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n const roots = resolveExtensionRoots(pmRoot, process.cwd());\n return {\n selected_root: scope === \"global\" ? roots.global : roots.project,\n };\n}\n\nasync function defaultCommandRunner(\n command: string,\n args: string[],\n options?: { cwd?: string },\n): Promise<UpgradeCommandRunnerResult> {\n try {\n const result = await execFileAsync(command, args, {\n cwd: options?.cwd,\n encoding: \"utf8\",\n });\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n };\n } catch (error: unknown) {\n const stderr = typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr?: unknown }).stderr ?? \"\")\n : \"\";\n const message = stderr.trim().length > 0 ? stderr.trim() : error instanceof Error ? error.message : String(error);\n throw new PmCliError(`Command failed: ${command} ${args.join(\" \")}\\n${message}`, EXIT_CODE.GENERIC_FAILURE);\n }\n}\n\nasync function readCurrentVersion(): Promise<string | undefined> {\n return resolvePmCliVersion(import.meta.url, [\"../../..\"]);\n}\n\nfunction resolveTag(options: UpgradeCommandOptions): string {\n return typeof options.tag === \"string\" && options.tag.trim().length > 0 ? options.tag.trim() : DEFAULT_TAG;\n}\n\nfunction resolveCliPackage(options: UpgradeCommandOptions): string {\n return typeof options.packageName === \"string\" && options.packageName.trim().length > 0\n ? options.packageName.trim()\n : DEFAULT_CLI_PACKAGE;\n}\n\nasync function upgradeCli(options: UpgradeCommandOptions, dryRun: boolean): Promise<UpgradeCliResult> {\n const runner = options.commandRunner ?? defaultCommandRunner;\n const packageName = resolveCliPackage(options);\n const tag = resolveTag(options);\n const target = `${packageName}@${tag}`;\n const command = [\"npm\", \"install\", \"-g\", target];\n if (options.repair === true) {\n command.push(\"--force\");\n }\n const beforeVersion = await readCurrentVersion();\n const planned: UpgradeCliResult = {\n requested: true,\n status: \"planned\",\n package: packageName,\n target,\n command,\n before_version: beforeVersion,\n repair: options.repair === true,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runner(command[0]!, command.slice(1));\n const verified = await runner(\"pm\", [\"--version\"]);\n return {\n ...planned,\n status: \"updated\",\n after_version: verified.stdout.trim() || undefined,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction isLocalNpmSpec(spec: string): boolean {\n return path.isAbsolute(spec) || spec.startsWith(\".\") || spec.startsWith(\"..\") || spec.startsWith(\"file:\");\n}\n\nfunction resolvePackageInstallSource(source: ManagedExtensionSource, tag: string): string {\n if (source.kind === \"npm\") {\n const rawSpec = source.input.startsWith(\"npm:\") ? source.input.slice(\"npm:\".length).trim() : source.input.trim();\n if (!isLocalNpmSpec(rawSpec) && source.package && source.package.trim().length > 0) {\n return `npm:${source.package.trim()}@${tag}`;\n }\n return source.input.startsWith(\"npm:\") ? source.input : `npm:${source.input}`;\n }\n return source.input;\n}\n\nasync function resolveRunnablePackageSource(source: ManagedExtensionSource, tag: string): Promise<string> {\n const installSource = resolvePackageInstallSource(source, tag);\n if (source.kind !== \"local\") {\n return installSource;\n }\n if (await pathExists(installSource)) {\n return installSource;\n }\n if (await pathExists(source.location)) {\n return source.location;\n }\n return installSource;\n}\n\nfunction packageCommandFor(source: ManagedExtensionSource, installSource: string, scope: ExtensionScope, ref?: string): string[] {\n const command = [\"pm\", \"install\", installSource, scope === \"global\" ? \"--global\" : \"--project\"];\n if (source.kind === \"github\" && ref && ref.trim().length > 0) {\n command.push(\"--ref\", ref.trim());\n }\n return command;\n}\n\nasync function readManagedRecords(scope: ExtensionScope, global: GlobalOptions): Promise<ManagedExtensionRecord[]> {\n const roots = resolveRoots(scope, global);\n const managedState = await readManagedExtensionState(roots.selected_root);\n return managedState.state.entries.filter((entry) => entry.scope === scope);\n}\n\nasync function refreshManagedRecord(\n scope: ExtensionScope,\n global: GlobalOptions,\n record: ManagedExtensionRecord,\n): Promise<ManagedExtensionRecord | undefined> {\n const records = await readManagedRecords(scope, global);\n return records.find((candidate) => packageRecordMatchesTarget(candidate, record.name)) ??\n records.find((candidate) => normalizeTarget(candidate.directory) === normalizeTarget(record.directory));\n}\n\nasync function upgradePackageRecord(\n record: ManagedExtensionRecord,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n scope: ExtensionScope,\n dryRun: boolean,\n): Promise<UpgradePackageResult> {\n const tag = resolveTag(options);\n const installSource = await resolveRunnablePackageSource(record.source, tag);\n const command = packageCommandFor(record.source, installSource, scope, record.source.ref);\n const planned: UpgradePackageResult = {\n name: record.name,\n directory: record.directory,\n scope,\n source: record.source,\n status: \"planned\",\n command,\n previous_version: record.manifest_version,\n };\n if (dryRun) {\n return planned;\n }\n try {\n await runExtension(\n installSource,\n {\n install: true,\n project: scope === \"project\",\n global: scope === \"global\",\n ref: record.source.kind === \"github\" ? record.source.ref : undefined,\n },\n global,\n );\n const refreshed = await refreshManagedRecord(scope, global, record);\n return {\n ...planned,\n status: \"updated\",\n installed_version: refreshed?.manifest_version,\n };\n } catch (error: unknown) {\n return {\n ...planned,\n status: \"failed\",\n error: error instanceof Error ? error.message : String(error),\n };\n }\n}\n\nfunction summarize(\n cli: UpgradeCliResult,\n packages: UpgradePackageResult[],\n includeCli: boolean,\n includePackages: boolean,\n): UpgradeResult[\"summary\"] {\n const statuses = [includeCli ? cli.status : undefined, ...packages.map((entry) => entry.status)].filter(\n (value): value is UpgradeCliResult[\"status\"] => typeof value === \"string\",\n );\n return {\n requested_cli: includeCli,\n requested_packages: includePackages,\n planned: statuses.filter((status) => status === \"planned\").length,\n updated: statuses.filter((status) => status === \"updated\").length,\n skipped: statuses.filter((status) => status === \"skipped\").length,\n failed: statuses.filter((status) => status === \"failed\").length,\n };\n}\n\n/**\n * Implements run upgrade for the public runtime surface of this module.\n */\nexport async function runUpgrade(\n target: string | undefined,\n options: UpgradeCommandOptions,\n global: GlobalOptions,\n): Promise<UpgradeResult> {\n if (options.cliOnly === true && options.packagesOnly === true) {\n throw new PmCliError('Options \"--cli-only\" and \"--packages-only\" are mutually exclusive.', EXIT_CODE.USAGE);\n }\n\n const scope = resolveScope(options);\n const dryRun = options.dryRun === true;\n const normalizedTarget = typeof target === \"string\" && target.trim().length > 0 ? target.trim() : undefined;\n if (options.cliOnly === true && normalizedTarget) {\n throw new PmCliError('A package target cannot be used with \"--cli-only\".', EXIT_CODE.USAGE);\n }\n const includeCli = options.packagesOnly === true || normalizedTarget ? false : true;\n const includePackages = options.cliOnly === true ? false : true;\n const cli = includeCli\n ? await upgradeCli(options, dryRun)\n : {\n requested: false,\n status: \"skipped\",\n package: resolveCliPackage(options),\n target: `${resolveCliPackage(options)}@${resolveTag(options)}`,\n command: [\"npm\", \"install\", \"-g\", `${resolveCliPackage(options)}@${resolveTag(options)}`],\n repair: options.repair === true,\n reason: \"not_requested\",\n } as UpgradeCliResult;\n\n let packageRecords = includePackages ? await readManagedRecords(scope, global) : [];\n if (normalizedTarget) {\n packageRecords = packageRecords.filter((entry) => packageRecordMatchesTarget(entry, normalizedTarget));\n if (packageRecords.length === 0) {\n throw new PmCliError(`Managed package \"${normalizedTarget}\" was not found in ${scope} scope.`, EXIT_CODE.NOT_FOUND);\n }\n }\n\n const packages: UpgradePackageResult[] = [];\n for (const record of packageRecords) {\n packages.push(await upgradePackageRecord(record, options, global, scope, dryRun));\n }\n\n const summary = summarize(cli, packages, includeCli, includePackages);\n return {\n ok: summary.failed === 0,\n action: \"upgrade\",\n dry_run: dryRun,\n scope,\n target: normalizedTarget,\n cli,\n packages,\n summary,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,SAAS,iBAAiB;AAgB1B,IAAM,gBAAgB,UAAU,QAAQ;AACxC,IAAM,sBAAsB;AAC5B,IAAM,cAAc;AAkBb,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAyEF,SAAS,aAAa,SAA8B;AAClD,QAAM,cAAc,QAAQ,YAAY,QAAQ,QAAQ,UAAU;AAClE,QAAM,SAAS,QAAQ,WAAW;AAClC,MAAI,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