@unbrained/pm-cli 2026.7.14 → 2026.7.15

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 (708) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +48 -0
  3. package/README.md +14 -11
  4. package/dist/cli/argv-utils.d.ts +1 -4
  5. package/dist/cli/argv-utils.js +3 -13
  6. package/dist/cli/argv-utils.js.map +1 -1
  7. package/dist/cli/bootstrap-args.d.ts +6 -4
  8. package/dist/cli/bootstrap-args.js +51 -16
  9. package/dist/cli/bootstrap-args.js.map +1 -1
  10. package/dist/cli/bundle-integrity.d.ts +49 -0
  11. package/dist/cli/bundle-integrity.js +111 -0
  12. package/dist/cli/bundle-integrity.js.map +1 -0
  13. package/dist/cli/commands/completion.js +7 -2
  14. package/dist/cli/commands/completion.js.map +1 -1
  15. package/dist/cli/commands/config.d.ts +6 -163
  16. package/dist/cli/commands/config.js +4 -1133
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/context.d.ts +2 -4
  19. package/dist/cli/commands/context.js +10 -85
  20. package/dist/cli/commands/context.js.map +1 -1
  21. package/dist/cli/commands/create.d.ts +1 -0
  22. package/dist/cli/commands/create.js +3 -2
  23. package/dist/cli/commands/create.js.map +1 -1
  24. package/dist/cli/commands/extension/describe.d.ts +2 -91
  25. package/dist/cli/commands/extension/describe.js +4 -142
  26. package/dist/cli/commands/extension/describe.js.map +1 -1
  27. package/dist/cli/commands/extension/scaffold.d.ts +2 -36
  28. package/dist/cli/commands/extension/scaffold.js +4 -2435
  29. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  30. package/dist/cli/commands/extension/shared.d.ts +2 -28
  31. package/dist/cli/commands/extension/shared.js +4 -130
  32. package/dist/cli/commands/extension/shared.js.map +1 -1
  33. package/dist/cli/commands/extension.d.ts +3 -400
  34. package/dist/cli/commands/extension.js +4 -2183
  35. package/dist/cli/commands/extension.js.map +1 -1
  36. package/dist/cli/commands/gc.d.ts +6 -56
  37. package/dist/cli/commands/gc.js +4 -270
  38. package/dist/cli/commands/gc.js.map +1 -1
  39. package/dist/cli/commands/get.d.ts +18 -5
  40. package/dist/cli/commands/get.js +117 -58
  41. package/dist/cli/commands/get.js.map +1 -1
  42. package/dist/cli/commands/health.d.ts +6 -184
  43. package/dist/cli/commands/health.js +4 -1747
  44. package/dist/cli/commands/health.js.map +1 -1
  45. package/dist/cli/commands/history-compact.d.ts +4 -139
  46. package/dist/cli/commands/history-compact.js +5 -510
  47. package/dist/cli/commands/history-compact.js.map +1 -1
  48. package/dist/cli/commands/history-redact.d.ts +8 -120
  49. package/dist/cli/commands/history-redact.js +6 -581
  50. package/dist/cli/commands/history-redact.js.map +1 -1
  51. package/dist/cli/commands/history-repair.d.ts +7 -89
  52. package/dist/cli/commands/history-repair.js +5 -257
  53. package/dist/cli/commands/history-repair.js.map +1 -1
  54. package/dist/cli/commands/history.d.ts +1 -2
  55. package/dist/cli/commands/history.js +6 -48
  56. package/dist/cli/commands/history.js.map +1 -1
  57. package/dist/cli/commands/index.d.ts +1 -0
  58. package/dist/cli/commands/index.js +3 -2
  59. package/dist/cli/commands/index.js.map +1 -1
  60. package/dist/cli/commands/init-agent-guidance.d.ts +6 -113
  61. package/dist/cli/commands/init-agent-guidance.js +4 -431
  62. package/dist/cli/commands/init-agent-guidance.js.map +1 -1
  63. package/dist/cli/commands/init.d.ts +6 -181
  64. package/dist/cli/commands/init.js +4 -690
  65. package/dist/cli/commands/init.js.map +1 -1
  66. package/dist/cli/commands/next.js +3 -3
  67. package/dist/cli/commands/next.js.map +1 -1
  68. package/dist/cli/commands/profile.d.ts +4 -174
  69. package/dist/cli/commands/profile.js +4 -425
  70. package/dist/cli/commands/profile.js.map +1 -1
  71. package/dist/cli/commands/restore.d.ts +4 -19
  72. package/dist/cli/commands/restore.js +9 -158
  73. package/dist/cli/commands/restore.js.map +1 -1
  74. package/dist/cli/commands/schema.d.ts +7 -507
  75. package/dist/cli/commands/schema.js +5 -1254
  76. package/dist/cli/commands/schema.js.map +1 -1
  77. package/dist/cli/commands/test.d.ts +2 -4
  78. package/dist/cli/commands/test.js +7 -97
  79. package/dist/cli/commands/test.js.map +1 -1
  80. package/dist/cli/commands/validate.d.ts +9 -249
  81. package/dist/cli/commands/validate.js +9 -2150
  82. package/dist/cli/commands/validate.js.map +1 -1
  83. package/dist/cli/extension-command-help.js +18 -4
  84. package/dist/cli/extension-command-help.js.map +1 -1
  85. package/dist/cli/extension-command-options.js +3 -3
  86. package/dist/cli/extension-command-options.js.map +1 -1
  87. package/dist/cli/help-content.js +7 -3
  88. package/dist/cli/help-content.js.map +1 -1
  89. package/dist/cli/main.js +20 -30
  90. package/dist/cli/main.js.map +1 -1
  91. package/dist/cli/register-list-query.js +4 -2
  92. package/dist/cli/register-list-query.js.map +1 -1
  93. package/dist/cli/register-mutation.js +11 -3
  94. package/dist/cli/register-mutation.js.map +1 -1
  95. package/dist/cli/register-setup.js +4 -2
  96. package/dist/cli/register-setup.js.map +1 -1
  97. package/dist/cli/registration-helpers.js +3 -2
  98. package/dist/cli/registration-helpers.js.map +1 -1
  99. package/dist/cli-bundle/bundle-manifest.json +782 -0
  100. package/dist/cli-bundle/chunks/{append-PVZJDM6J.js → append-OJQFUQ4T.js} +5 -5
  101. package/dist/cli-bundle/chunks/append-UZVHUO74.js +11 -0
  102. package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js → chunk-2IFFUZLC.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js → chunk-2JKGO6QX.js} +4 -4
  104. package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js → chunk-2NCIPMQP.js} +2 -2
  105. package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js → chunk-2VPAVL7O.js} +2 -2
  106. package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js → chunk-2WSE6PO2.js} +4 -4
  107. package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js → chunk-34L5OT3Y.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js → chunk-3AUGG2DP.js} +3 -3
  109. package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js → chunk-3CLU2XZO.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-N3CMP4NI.js → chunk-3S5QVM5H.js} +43 -7
  111. package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +1 -0
  112. package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js +64 -0
  113. package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js.map +7 -0
  114. package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js → chunk-3WM75PWC.js} +3 -3
  115. package/dist/cli-bundle/chunks/chunk-4223PVZT.js +121 -0
  116. package/dist/cli-bundle/chunks/chunk-4223PVZT.js.map +7 -0
  117. package/dist/cli-bundle/chunks/{chunk-5URI7TPJ.js → chunk-4XQ3BDV4.js} +281 -164
  118. package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +7 -0
  119. package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js → chunk-5JLUII3O.js} +13 -13
  120. package/dist/cli-bundle/chunks/{chunk-MKL4CP2I.js → chunk-5ZSLZLDN.js} +631 -246
  121. package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +1 -0
  122. package/dist/cli-bundle/chunks/{chunk-Q37E63AM.js → chunk-6CFNAVTF.js} +21 -141
  123. package/dist/cli-bundle/chunks/chunk-6CFNAVTF.js.map +7 -0
  124. package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js → chunk-6N2VXVTQ.js} +2 -2
  125. package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js → chunk-6S3YSUYG.js} +3 -3
  126. package/dist/cli-bundle/chunks/{chunk-ZUKSZVBW.js → chunk-7B67ZL4N.js} +8 -7
  127. package/dist/cli-bundle/chunks/chunk-7B67ZL4N.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-IA3YFTXT.js → chunk-7PIWCHTW.js} +11 -13
  129. package/dist/cli-bundle/chunks/chunk-7PIWCHTW.js.map +1 -0
  130. package/dist/cli-bundle/chunks/{chunk-BPD26E3P.js → chunk-7Z4LKRS4.js} +291 -81
  131. package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +1 -0
  132. package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js → chunk-AHVTB5I5.js} +4 -4
  133. package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js → chunk-APRVSW2O.js} +3 -3
  134. package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js → chunk-B7PE22W6.js} +4 -4
  135. package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js → chunk-BCOFWYW4.js} +3 -3
  136. package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js → chunk-BEP7WJA2.js} +4 -4
  137. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js +1114 -0
  138. package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +7 -0
  139. package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js → chunk-BSEQUTQP.js} +2 -2
  140. package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js.map → chunk-BSEQUTQP.js.map} +2 -2
  141. package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js → chunk-CRVF2JDM.js} +10 -10
  142. package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js → chunk-DM4H7FP4.js} +3 -3
  143. package/dist/cli-bundle/chunks/chunk-DUT67M43.js +5 -0
  144. package/dist/cli-bundle/chunks/{chunk-44LNIULG.js → chunk-DYH63FX7.js} +4 -4
  145. package/dist/cli-bundle/chunks/{chunk-LWTIRS3Y.js → chunk-E2OJMKML.js} +306 -82
  146. package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +7 -0
  147. package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js → chunk-EAB64KLB.js} +4 -4
  148. package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js → chunk-EACOH7AU.js} +10 -10
  149. package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js → chunk-EH2OPHBI.js} +10 -10
  150. package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js.map → chunk-EH2OPHBI.js.map} +1 -1
  151. package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js → chunk-EJEXHTY5.js} +2 -2
  152. package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js → chunk-EYLCSJAI.js} +2 -2
  153. package/dist/cli-bundle/chunks/{chunk-655STMGA.js → chunk-FMBNM2EN.js} +2 -2
  154. package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js → chunk-FNSPG7MU.js} +12 -12
  155. package/dist/cli-bundle/chunks/{chunk-5CT5BW6E.js → chunk-GM5QHQU6.js} +46 -40
  156. package/dist/cli-bundle/chunks/chunk-GM5QHQU6.js.map +7 -0
  157. package/dist/cli-bundle/chunks/{chunk-FTQLW4JD.js → chunk-GOSLKLFE.js} +418 -24
  158. package/dist/cli-bundle/chunks/chunk-GOSLKLFE.js.map +1 -0
  159. package/dist/cli-bundle/chunks/{chunk-KB726FMH.js → chunk-H2Z3FYXQ.js} +4 -4
  160. package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js +162 -0
  161. package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js.map +1 -0
  162. package/dist/cli-bundle/chunks/{chunk-2QIQGYPW.js → chunk-H5APFTHZ.js} +53 -10
  163. package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js +118 -0
  165. package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js.map +1 -0
  166. package/dist/cli-bundle/chunks/{chunk-ZAYYDNB3.js → chunk-HO4KXD6I.js} +22 -142
  167. package/dist/cli-bundle/chunks/chunk-HO4KXD6I.js.map +1 -0
  168. package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js → chunk-HYB5AZ63.js} +203 -62
  169. package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js.map → chunk-HYB5AZ63.js.map} +3 -3
  170. package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js → chunk-IA5FKNII.js} +2 -2
  171. package/dist/cli-bundle/chunks/{chunk-JL7WZ4O2.js → chunk-IG3SWA4A.js} +33 -9
  172. package/dist/cli-bundle/chunks/chunk-IG3SWA4A.js.map +7 -0
  173. package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js → chunk-IJIICKVW.js} +2 -2
  174. package/dist/cli-bundle/chunks/{chunk-IGED7NH2.js → chunk-ILX33QXL.js} +668 -251
  175. package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +7 -0
  176. package/dist/cli-bundle/chunks/{chunk-UGTVWL3E.js → chunk-INU6DKT5.js} +47 -41
  177. package/dist/cli-bundle/chunks/chunk-INU6DKT5.js.map +1 -0
  178. package/dist/cli-bundle/chunks/{chunk-UB2QYSTO.js → chunk-J5AOEGDC.js} +26 -18
  179. package/dist/cli-bundle/chunks/chunk-J5AOEGDC.js.map +1 -0
  180. package/dist/cli-bundle/chunks/{chunk-4DY4KPQI.js → chunk-J6364LFM.js} +1330 -937
  181. package/dist/cli-bundle/chunks/chunk-J6364LFM.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-DVOLZJ3C.js → chunk-J6EY5V4N.js} +1295 -939
  183. package/dist/cli-bundle/chunks/chunk-J6EY5V4N.js.map +1 -0
  184. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js +1097 -0
  185. package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +1 -0
  186. package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js → chunk-JOUQZENX.js} +3 -3
  187. package/dist/cli-bundle/chunks/{chunk-J4NZOP3I.js → chunk-JXQUXVMI.js} +9 -8
  188. package/dist/cli-bundle/chunks/chunk-JXQUXVMI.js.map +1 -0
  189. package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js → chunk-JYFOV7FC.js} +4 -4
  190. package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js → chunk-K2X6U4UA.js} +4 -4
  191. package/dist/cli-bundle/chunks/{chunk-6OTZMORS.js → chunk-K3WII2ME.js} +27 -27
  192. package/dist/cli-bundle/chunks/chunk-K3WII2ME.js.map +7 -0
  193. package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js → chunk-KG44YSKD.js} +4 -4
  194. package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js → chunk-KPMKHGEA.js} +4 -4
  195. package/dist/cli-bundle/chunks/{chunk-QASRVKUQ.js → chunk-LPYWLWDS.js} +257 -163
  196. package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +1 -0
  197. package/dist/cli-bundle/chunks/{chunk-RGXD5JJR.js → chunk-LSG2U345.js} +19 -12
  198. package/dist/cli-bundle/chunks/chunk-LSG2U345.js.map +7 -0
  199. package/dist/cli-bundle/chunks/chunk-MIQDDLB5.js +5 -0
  200. package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js → chunk-NLDFBC6J.js} +2 -2
  201. package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js → chunk-NP22ERDF.js} +3 -3
  202. package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js → chunk-NU3IMIEA.js} +2 -2
  203. package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js → chunk-NVPZIJVR.js} +2 -2
  204. package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js → chunk-ODALILG3.js} +2 -2
  205. package/dist/cli-bundle/chunks/{chunk-CDJYP7OQ.js → chunk-ONG5V5CI.js} +190 -63
  206. package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +1 -0
  207. package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js → chunk-ONREO4ST.js} +3 -3
  208. package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js +61 -0
  209. package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js.map +1 -0
  210. package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js → chunk-P74IZQ7A.js} +12 -12
  211. package/dist/cli-bundle/chunks/chunk-PENXZX3U.js +172 -0
  212. package/dist/cli-bundle/chunks/chunk-PENXZX3U.js.map +7 -0
  213. package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js → chunk-PGY23YTC.js} +3 -3
  214. package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js → chunk-PMOSXADO.js} +3 -3
  215. package/dist/cli-bundle/chunks/chunk-PNTULOGU.js +9 -0
  216. package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js → chunk-Q7A43DS4.js} +2 -2
  217. package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js → chunk-QEHQ2GVG.js} +2 -2
  218. package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js → chunk-QIPLHNP7.js} +7 -7
  219. package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js → chunk-QKECXBBG.js} +3 -3
  220. package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js.map → chunk-QKECXBBG.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js → chunk-QKJGPFAF.js} +3 -3
  222. package/dist/cli-bundle/chunks/{chunk-F7PSHRNO.js → chunk-QKXHFPYM.js} +27 -10
  223. package/dist/cli-bundle/chunks/chunk-QKXHFPYM.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js → chunk-RLCHOOHC.js} +2 -2
  225. package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js → chunk-RMLWNPH2.js} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js → chunk-RRM5JYJC.js} +2 -2
  227. package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js → chunk-S6MQESFR.js} +4 -4
  228. package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js → chunk-SDQLJWBO.js} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js → chunk-SELVXEZK.js} +2 -2
  230. package/dist/cli-bundle/chunks/{chunk-DYEX6NFH.js → chunk-TD3LVC7D.js} +438 -23
  231. package/dist/cli-bundle/chunks/chunk-TD3LVC7D.js.map +7 -0
  232. package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js → chunk-TKOVBP6C.js} +2 -2
  233. package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js → chunk-TQSZFPIS.js} +4 -4
  234. package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js → chunk-TSMHDIW4.js} +2 -2
  235. package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js → chunk-UFXU44HV.js} +4 -4
  236. package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js → chunk-ULTHRDBP.js} +3 -3
  237. package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js → chunk-UMOPHQSU.js} +9 -9
  238. package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js.map → chunk-UMOPHQSU.js.map} +2 -2
  239. package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js → chunk-UOHFKBUV.js} +3 -3
  240. package/dist/cli-bundle/chunks/{chunk-PHKP3AGR.js → chunk-UWQHLMEB.js} +35 -18
  241. package/dist/cli-bundle/chunks/chunk-UWQHLMEB.js.map +7 -0
  242. package/dist/cli-bundle/chunks/{chunk-6TTOHMTB.js → chunk-UXONS674.js} +45 -112
  243. package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +1 -0
  244. package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js → chunk-UY2ACEMF.js} +7 -7
  245. package/dist/cli-bundle/chunks/{chunk-6PKA3SJQ.js → chunk-WQPUU7XD.js} +19 -28
  246. package/dist/cli-bundle/chunks/chunk-WQPUU7XD.js.map +1 -0
  247. package/dist/cli-bundle/chunks/{chunk-7TQMR6LK.js → chunk-WT3ZEOGH.js} +70 -20
  248. package/dist/cli-bundle/chunks/chunk-WT3ZEOGH.js.map +7 -0
  249. package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js → chunk-WUJQK4YV.js} +4 -4
  250. package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js → chunk-XSJUSQAE.js} +2 -2
  251. package/dist/cli-bundle/chunks/{chunk-6MHSBDGD.js → chunk-XXXF6PAQ.js} +50 -117
  252. package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +7 -0
  253. package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js → chunk-YAQEBNY7.js} +4 -4
  254. package/dist/cli-bundle/chunks/{chunk-7QDSYUMF.js → chunk-YAROI3PD.js} +44 -21
  255. package/dist/cli-bundle/chunks/chunk-YAROI3PD.js.map +1 -0
  256. package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js → chunk-YBLZ2VE7.js} +13 -13
  257. package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js → chunk-YCQET3OT.js} +2 -2
  258. package/dist/cli-bundle/chunks/chunk-YUSOJDWM.js +9 -0
  259. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +58 -0
  260. package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +1 -0
  261. package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js → chunk-ZI6VQWQ7.js} +4 -4
  262. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +68 -0
  263. package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +7 -0
  264. package/dist/cli-bundle/chunks/{close-LZECOMHO.js → close-CWODTPKG.js} +5 -5
  265. package/dist/cli-bundle/chunks/close-W6LI2PKM.js +12 -0
  266. package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js → close-many-CQFUY7MR.js} +15 -13
  267. package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +23 -0
  268. package/dist/cli-bundle/chunks/comments-E3TNTK24.js +13 -0
  269. package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js → comments-WGLHR7LB.js} +7 -7
  270. package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js → copy-LXVDXH7B.js} +4 -4
  271. package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +9 -0
  272. package/dist/cli-bundle/chunks/{create-F53OBTOU.js → create-J5U6ND4K.js} +9 -9
  273. package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js → create-LBVCYMEG.js} +9 -9
  274. package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js → delete-PMJBNY5G.js} +4 -4
  275. package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +10 -0
  276. package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js → deps-JZ7TMVCB.js} +7 -4
  277. package/dist/cli-bundle/chunks/{deps-U57I7EAK.js → deps-OA26IS25.js} +7 -4
  278. package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js → docs-FEWB2DQB.js} +6 -6
  279. package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +14 -0
  280. package/dist/cli-bundle/chunks/{files-TBZD7V6H.js → files-6YFBJRBG.js} +6 -6
  281. package/dist/cli-bundle/chunks/{files-TTY6N2AV.js → files-EFIWKFTM.js} +6 -6
  282. package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js → focus-4QJR7FOQ.js} +5 -5
  283. package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +10 -0
  284. package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js → history-compact-CKRPDTJN.js} +6 -10
  285. package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +16 -0
  286. package/dist/cli-bundle/chunks/history-redact-BB3TGDAE.js +15 -0
  287. package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js → history-redact-D225BHOZ.js} +5 -6
  288. package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +16 -0
  289. package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js → history-repair-RQXKQHL4.js} +6 -8
  290. package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js → learnings-JLNLCOL5.js} +7 -7
  291. package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +13 -0
  292. package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +13 -0
  293. package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js → notes-GB47XXQQ.js} +7 -7
  294. package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +24 -0
  295. package/dist/cli-bundle/chunks/{plan-2NNEO46V.js → plan-VDCJ2PCN.js} +10 -10
  296. package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js → profile-FAU7NZML.js} +10 -10
  297. package/dist/cli-bundle/chunks/{profile-U725ATWZ.js → profile-IVXQEL3D.js} +10 -10
  298. package/dist/cli-bundle/chunks/{register-list-query-BUWCYHBT.js → register-list-query-DKA3EH5D.js} +22 -19
  299. package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +7 -0
  300. package/dist/cli-bundle/chunks/{register-list-query-KTZ6AGE7.js → register-list-query-UL4UKBBN.js} +23 -20
  301. package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +1 -0
  302. package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js → register-mutation-ARFHRW55.js} +36 -32
  303. package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js.map → register-mutation-ARFHRW55.js.map} +2 -2
  304. package/dist/cli-bundle/chunks/{register-mutation-4FMGJJF7.js → register-mutation-RBBJ52DK.js} +37 -33
  305. package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +1 -0
  306. package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js → register-operations-ZIBBRSED.js} +41 -39
  307. package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js.map → register-operations-ZIBBRSED.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js → register-operations-ZUJ5JWPE.js} +39 -37
  309. package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js.map → register-operations-ZUJ5JWPE.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js → register-setup-BCVLFEYS.js} +29 -17
  311. package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js.map → register-setup-BCVLFEYS.js.map} +2 -2
  312. package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js → register-setup-TDCGWIOS.js} +19 -18
  313. package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js.map → register-setup-TDCGWIOS.js.map} +1 -1
  314. package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js → restore-25DLT2Q2.js} +6 -6
  315. package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +14 -0
  316. package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js → schema-FNU3WE4O.js} +7 -6
  317. package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js → schema-NBCM3RAD.js} +7 -6
  318. package/dist/cli-bundle/chunks/update-WWBYOPXO.js +21 -0
  319. package/dist/cli-bundle/chunks/update-WWBYOPXO.js.map +7 -0
  320. package/dist/cli-bundle/chunks/{update-Q3UCILNR.js → update-XHSIAIXE.js} +12 -12
  321. package/dist/cli-bundle/chunks/update-XHSIAIXE.js.map +1 -0
  322. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +32 -0
  323. package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js.map +7 -0
  324. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +36 -0
  325. package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js.map +1 -0
  326. package/dist/cli-bundle/main.js +826 -43
  327. package/dist/cli-bundle/main.js.map +4 -4
  328. package/dist/cli-bundle/sdk-runtime.js +70 -57
  329. package/dist/cli-bundle/sdk-testing.js +6 -6
  330. package/dist/cli-bundle/sdk.js +876 -74
  331. package/dist/cli-bundle/sdk.js.map +4 -4
  332. package/dist/cli.js +5 -4
  333. package/dist/cli.js.map +1 -1
  334. package/dist/core/diagnostics/remediation.js +12 -2
  335. package/dist/core/diagnostics/remediation.js.map +1 -1
  336. package/dist/core/history/projection.d.ts +39 -0
  337. package/dist/core/history/projection.js +164 -0
  338. package/dist/core/history/projection.js.map +1 -0
  339. package/dist/core/history/read.d.ts +3 -0
  340. package/dist/core/history/read.js +55 -0
  341. package/dist/core/history/read.js.map +1 -0
  342. package/dist/core/output/output-control.d.ts +18 -0
  343. package/dist/core/output/output-control.js +26 -0
  344. package/dist/core/output/output-control.js.map +1 -0
  345. package/dist/core/output/output.js +20 -8
  346. package/dist/core/output/output.js.map +1 -1
  347. package/dist/core/sentry/helpers.js +10 -2
  348. package/dist/core/sentry/helpers.js.map +1 -1
  349. package/dist/core/shared/command-types.d.ts +2 -0
  350. package/dist/core/shared/command-types.js +2 -2
  351. package/dist/core/shared/command-types.js.map +1 -1
  352. package/dist/core/shared/errors.d.ts +11 -0
  353. package/dist/core/shared/errors.js +2 -2
  354. package/dist/core/shared/errors.js.map +1 -1
  355. package/dist/mcp/server.d.ts +2 -2
  356. package/dist/mcp/tool-definitions.js +5 -5
  357. package/dist/mcp/tool-definitions.js.map +1 -1
  358. package/dist/sdk/author-attribution.d.ts +35 -0
  359. package/dist/sdk/author-attribution.js +118 -0
  360. package/dist/sdk/author-attribution.js.map +1 -0
  361. package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -0
  362. package/dist/sdk/cli-contracts/command-aliases.js +17 -0
  363. package/dist/sdk/cli-contracts/command-aliases.js.map +1 -0
  364. package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
  365. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  366. package/dist/sdk/cli-contracts/tool-option-contracts.js +6 -2
  367. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  368. package/dist/sdk/cli-contracts/tool-parameter-tables.js +21 -2
  369. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  370. package/dist/sdk/cli-contracts/tool-schema.js +3 -3
  371. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  372. package/dist/sdk/cli-contracts.d.ts +1 -0
  373. package/dist/sdk/cli-contracts.js +3 -2
  374. package/dist/sdk/cli-contracts.js.map +1 -1
  375. package/dist/sdk/cli-program.d.ts +8 -0
  376. package/dist/sdk/cli-program.js +39 -0
  377. package/dist/sdk/cli-program.js.map +1 -0
  378. package/dist/sdk/command-line.d.ts +11 -0
  379. package/dist/sdk/command-line.js +40 -0
  380. package/dist/sdk/command-line.js.map +1 -0
  381. package/dist/sdk/config.d.ts +163 -0
  382. package/dist/sdk/config.js +1087 -0
  383. package/dist/sdk/config.js.map +1 -0
  384. package/dist/sdk/context-relevance.d.ts +21 -0
  385. package/dist/sdk/context-relevance.js +70 -2
  386. package/dist/sdk/context-relevance.js.map +1 -1
  387. package/dist/sdk/dependencies.d.ts +15 -2
  388. package/dist/sdk/dependencies.js +97 -8
  389. package/dist/sdk/dependencies.js.map +1 -1
  390. package/dist/{cli/commands → sdk}/extension/bundled-catalog.d.ts +1 -1
  391. package/dist/{cli/commands → sdk}/extension/bundled-catalog.js +12 -12
  392. package/dist/sdk/extension/bundled-catalog.js.map +1 -0
  393. package/dist/sdk/extension/concurrency.d.ts +7 -0
  394. package/dist/sdk/extension/concurrency.js +26 -0
  395. package/dist/sdk/extension/concurrency.js.map +1 -0
  396. package/dist/sdk/extension/describe.d.ts +91 -0
  397. package/dist/sdk/extension/describe.js +144 -0
  398. package/dist/sdk/extension/describe.js.map +1 -0
  399. package/dist/{cli/commands → sdk}/extension/doctor.d.ts +3 -3
  400. package/dist/{cli/commands → sdk}/extension/doctor.js +7 -7
  401. package/dist/sdk/extension/doctor.js.map +1 -0
  402. package/dist/sdk/extension/install-runtime.d.ts +26 -0
  403. package/dist/sdk/extension/install-runtime.js +269 -0
  404. package/dist/sdk/extension/install-runtime.js.map +1 -0
  405. package/dist/sdk/extension/install-snapshot.d.ts +23 -0
  406. package/dist/sdk/extension/install-snapshot.js +66 -0
  407. package/dist/sdk/extension/install-snapshot.js.map +1 -0
  408. package/dist/{cli/commands → sdk}/extension/install-sources.d.ts +3 -3
  409. package/dist/{cli/commands → sdk}/extension/install-sources.js +15 -12
  410. package/dist/sdk/extension/install-sources.js.map +1 -0
  411. package/dist/{cli/commands → sdk}/extension/managed-state.js +6 -6
  412. package/dist/sdk/extension/managed-state.js.map +1 -0
  413. package/dist/sdk/extension/scaffold.d.ts +36 -0
  414. package/dist/sdk/extension/scaffold.js +2436 -0
  415. package/dist/sdk/extension/scaffold.js.map +1 -0
  416. package/dist/sdk/extension/shared.d.ts +28 -0
  417. package/dist/sdk/extension/shared.js +140 -0
  418. package/dist/sdk/extension/shared.js.map +1 -0
  419. package/dist/sdk/extension/update-check.d.ts +15 -0
  420. package/dist/sdk/extension/update-check.js +68 -0
  421. package/dist/sdk/extension/update-check.js.map +1 -0
  422. package/dist/sdk/extension.d.ts +367 -0
  423. package/dist/sdk/extension.js +2174 -0
  424. package/dist/sdk/extension.js.map +1 -0
  425. package/dist/sdk/governance/gc.d.ts +56 -0
  426. package/dist/sdk/governance/gc.js +276 -0
  427. package/dist/sdk/governance/gc.js.map +1 -0
  428. package/dist/sdk/governance/health.d.ts +187 -0
  429. package/dist/sdk/governance/health.js +1796 -0
  430. package/dist/sdk/governance/health.js.map +1 -0
  431. package/dist/sdk/governance/validate.d.ts +255 -0
  432. package/dist/sdk/governance/validate.js +2175 -0
  433. package/dist/sdk/governance/validate.js.map +1 -0
  434. package/dist/sdk/history-compact.d.ts +142 -0
  435. package/dist/sdk/history-compact.js +508 -0
  436. package/dist/sdk/history-compact.js.map +1 -0
  437. package/dist/sdk/history-mcp.d.ts +17 -0
  438. package/dist/sdk/history-mcp.js +68 -0
  439. package/dist/sdk/history-mcp.js.map +1 -0
  440. package/dist/sdk/history-read.d.ts +31 -0
  441. package/dist/sdk/history-read.js +58 -0
  442. package/dist/sdk/history-read.js.map +1 -0
  443. package/dist/sdk/history-redact.d.ts +120 -0
  444. package/dist/sdk/history-redact.js +577 -0
  445. package/dist/sdk/history-redact.js.map +1 -0
  446. package/dist/sdk/history-repair.d.ts +89 -0
  447. package/dist/sdk/history-repair.js +263 -0
  448. package/dist/sdk/history-repair.js.map +1 -0
  449. package/dist/sdk/index.d.ts +25 -1
  450. package/dist/sdk/index.js +27 -3
  451. package/dist/sdk/index.js.map +1 -1
  452. package/dist/sdk/init-agent-guidance.d.ts +113 -0
  453. package/dist/sdk/init-agent-guidance.js +437 -0
  454. package/dist/sdk/init-agent-guidance.js.map +1 -0
  455. package/dist/sdk/init.d.ts +186 -0
  456. package/dist/sdk/init.js +733 -0
  457. package/dist/sdk/init.js.map +1 -0
  458. package/dist/sdk/invocation-author.d.ts +2 -0
  459. package/dist/sdk/invocation-author.js +39 -0
  460. package/dist/sdk/invocation-author.js.map +1 -0
  461. package/dist/sdk/item-children.d.ts +45 -0
  462. package/dist/sdk/item-children.js +75 -0
  463. package/dist/sdk/item-children.js.map +1 -0
  464. package/dist/sdk/item-schedule.d.ts +26 -0
  465. package/dist/sdk/item-schedule.js +28 -0
  466. package/dist/sdk/item-schedule.js.map +1 -0
  467. package/dist/sdk/output.d.ts +7 -0
  468. package/dist/sdk/output.js +11 -0
  469. package/dist/sdk/output.js.map +1 -0
  470. package/dist/sdk/pagination.d.ts +4 -1
  471. package/dist/sdk/pagination.js +13 -5
  472. package/dist/sdk/pagination.js.map +1 -1
  473. package/dist/sdk/profile.d.ts +176 -0
  474. package/dist/sdk/profile.js +431 -0
  475. package/dist/sdk/profile.js.map +1 -0
  476. package/dist/sdk/relationship-analytics.d.ts +108 -0
  477. package/dist/sdk/relationship-analytics.js +292 -0
  478. package/dist/sdk/relationship-analytics.js.map +1 -0
  479. package/dist/sdk/relationship-context.d.ts +67 -0
  480. package/dist/sdk/relationship-context.js +207 -0
  481. package/dist/sdk/relationship-context.js.map +1 -0
  482. package/dist/sdk/relationship-history.d.ts +109 -0
  483. package/dist/sdk/relationship-history.js +401 -0
  484. package/dist/sdk/relationship-history.js.map +1 -0
  485. package/dist/sdk/relationships.d.ts +145 -0
  486. package/dist/sdk/relationships.js +551 -0
  487. package/dist/sdk/relationships.js.map +1 -0
  488. package/dist/sdk/runtime-input.d.ts +10 -0
  489. package/dist/sdk/runtime-input.js +60 -0
  490. package/dist/sdk/runtime-input.js.map +1 -0
  491. package/dist/sdk/runtime.d.ts +31 -8
  492. package/dist/sdk/runtime.js +61 -57
  493. package/dist/sdk/runtime.js.map +1 -1
  494. package/dist/sdk/schema.d.ts +507 -0
  495. package/dist/sdk/schema.js +1269 -0
  496. package/dist/sdk/schema.js.map +1 -0
  497. package/dist/{cli/commands → sdk}/templates.d.ts +1 -1
  498. package/dist/{cli/commands → sdk}/templates.js +9 -9
  499. package/dist/sdk/templates.js.map +1 -0
  500. package/dist/{cli/commands → sdk}/test/linked-command-detection.d.ts +10 -2
  501. package/dist/sdk/test/linked-command-detection.js +525 -0
  502. package/dist/sdk/test/linked-command-detection.js.map +1 -0
  503. package/docs/COMMANDS.md +58 -40
  504. package/docs/EXTENSIONS.md +10 -1
  505. package/docs/RELATIONSHIP_GRAPH.md +113 -0
  506. package/docs/RELEASING.md +2 -0
  507. package/docs/SDK.md +156 -9
  508. package/docs/SDK_CUSTOMIZATION_PRIMITIVES.md +79 -0
  509. package/marketplace.json +2 -2
  510. package/package.json +3 -2
  511. package/packages/pm-beads/package.json +1 -1
  512. package/packages/pm-calendar/package.json +1 -1
  513. package/packages/pm-command-kit/package.json +1 -1
  514. package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +76 -16
  515. package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +8 -0
  516. package/packages/pm-governance-audit/package.json +1 -1
  517. package/packages/pm-guide-shell/package.json +1 -1
  518. package/packages/pm-kanban/package.json +1 -1
  519. package/packages/pm-lifecycle-hooks/package.json +1 -1
  520. package/packages/pm-linked-test-adapters/package.json +1 -1
  521. package/packages/pm-search-advanced/package.json +1 -1
  522. package/packages/pm-templates/package.json +1 -1
  523. package/packages/pm-todos/package.json +1 -1
  524. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  525. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  526. package/scripts/bundle-cli.mjs +66 -23
  527. package/dist/cli/commands/extension/bundled-catalog.js.map +0 -1
  528. package/dist/cli/commands/extension/doctor.js.map +0 -1
  529. package/dist/cli/commands/extension/install-sources.js.map +0 -1
  530. package/dist/cli/commands/extension/managed-state.js.map +0 -1
  531. package/dist/cli/commands/templates.js.map +0 -1
  532. package/dist/cli/commands/test/linked-command-detection.js +0 -248
  533. package/dist/cli/commands/test/linked-command-detection.js.map +0 -1
  534. package/dist/cli-bundle/chunks/append-DYQWQK2J.js +0 -11
  535. package/dist/cli-bundle/chunks/chunk-2GA3NK35.js +0 -530
  536. package/dist/cli-bundle/chunks/chunk-2GA3NK35.js.map +0 -1
  537. package/dist/cli-bundle/chunks/chunk-2QIQGYPW.js.map +0 -7
  538. package/dist/cli-bundle/chunks/chunk-4DY4KPQI.js.map +0 -7
  539. package/dist/cli-bundle/chunks/chunk-4WREH7RT.js +0 -554
  540. package/dist/cli-bundle/chunks/chunk-4WREH7RT.js.map +0 -7
  541. package/dist/cli-bundle/chunks/chunk-5CT5BW6E.js.map +0 -7
  542. package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +0 -7
  543. package/dist/cli-bundle/chunks/chunk-6MHSBDGD.js.map +0 -7
  544. package/dist/cli-bundle/chunks/chunk-6OTZMORS.js.map +0 -7
  545. package/dist/cli-bundle/chunks/chunk-6PKA3SJQ.js.map +0 -1
  546. package/dist/cli-bundle/chunks/chunk-6TTOHMTB.js.map +0 -1
  547. package/dist/cli-bundle/chunks/chunk-7QDSYUMF.js.map +0 -1
  548. package/dist/cli-bundle/chunks/chunk-7TQMR6LK.js.map +0 -7
  549. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js +0 -312
  550. package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +0 -7
  551. package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +0 -1
  552. package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +0 -1
  553. package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js +0 -858
  554. package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js.map +0 -1
  555. package/dist/cli-bundle/chunks/chunk-DVOLZJ3C.js.map +0 -1
  556. package/dist/cli-bundle/chunks/chunk-DYEX6NFH.js.map +0 -7
  557. package/dist/cli-bundle/chunks/chunk-F7PSHRNO.js.map +0 -1
  558. package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js +0 -875
  559. package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js.map +0 -7
  560. package/dist/cli-bundle/chunks/chunk-FTQLW4JD.js.map +0 -1
  561. package/dist/cli-bundle/chunks/chunk-IA3YFTXT.js.map +0 -1
  562. package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +0 -7
  563. package/dist/cli-bundle/chunks/chunk-J4NZOP3I.js.map +0 -1
  564. package/dist/cli-bundle/chunks/chunk-JL7WZ4O2.js.map +0 -7
  565. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js +0 -309
  566. package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +0 -1
  567. package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +0 -7
  568. package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +0 -1
  569. package/dist/cli-bundle/chunks/chunk-N3CMP4NI.js.map +0 -1
  570. package/dist/cli-bundle/chunks/chunk-PHKP3AGR.js.map +0 -7
  571. package/dist/cli-bundle/chunks/chunk-Q37E63AM.js.map +0 -7
  572. package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +0 -1
  573. package/dist/cli-bundle/chunks/chunk-RGXD5JJR.js.map +0 -7
  574. package/dist/cli-bundle/chunks/chunk-UB2QYSTO.js.map +0 -1
  575. package/dist/cli-bundle/chunks/chunk-UGTVWL3E.js.map +0 -1
  576. package/dist/cli-bundle/chunks/chunk-ZAYYDNB3.js.map +0 -1
  577. package/dist/cli-bundle/chunks/chunk-ZUKSZVBW.js.map +0 -7
  578. package/dist/cli-bundle/chunks/close-RI4JQQHU.js +0 -12
  579. package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +0 -21
  580. package/dist/cli-bundle/chunks/comments-35M273DN.js +0 -13
  581. package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +0 -9
  582. package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +0 -10
  583. package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +0 -14
  584. package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +0 -10
  585. package/dist/cli-bundle/chunks/history-compact-M7GHYVFN.js +0 -20
  586. package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +0 -16
  587. package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +0 -18
  588. package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +0 -13
  589. package/dist/cli-bundle/chunks/notes-BSD53H2W.js +0 -13
  590. package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +0 -24
  591. package/dist/cli-bundle/chunks/register-list-query-BUWCYHBT.js.map +0 -7
  592. package/dist/cli-bundle/chunks/register-list-query-KTZ6AGE7.js.map +0 -1
  593. package/dist/cli-bundle/chunks/register-mutation-4FMGJJF7.js.map +0 -1
  594. package/dist/cli-bundle/chunks/restore-66GLMHIX.js +0 -14
  595. package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +0 -21
  596. package/dist/cli-bundle/chunks/update-many-75K57FS3.js +0 -34
  597. package/dist/cli-bundle/chunks/update-many-U42YA445.js +0 -30
  598. /package/dist/cli-bundle/chunks/{append-PVZJDM6J.js.map → append-OJQFUQ4T.js.map} +0 -0
  599. /package/dist/cli-bundle/chunks/{append-DYQWQK2J.js.map → append-UZVHUO74.js.map} +0 -0
  600. /package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js.map → chunk-2IFFUZLC.js.map} +0 -0
  601. /package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js.map → chunk-2JKGO6QX.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js.map → chunk-2NCIPMQP.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js.map → chunk-2VPAVL7O.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js.map → chunk-2WSE6PO2.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js.map → chunk-34L5OT3Y.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js.map → chunk-3AUGG2DP.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js.map → chunk-3CLU2XZO.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js.map → chunk-3WM75PWC.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js.map → chunk-5JLUII3O.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js.map → chunk-6N2VXVTQ.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js.map → chunk-6S3YSUYG.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js.map → chunk-AHVTB5I5.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js.map → chunk-APRVSW2O.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js.map → chunk-B7PE22W6.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js.map → chunk-BCOFWYW4.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js.map → chunk-BEP7WJA2.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js.map → chunk-CRVF2JDM.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js.map → chunk-DM4H7FP4.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{close-LZECOMHO.js.map → chunk-DUT67M43.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-44LNIULG.js.map → chunk-DYH63FX7.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js.map → chunk-EAB64KLB.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js.map → chunk-EACOH7AU.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js.map → chunk-EJEXHTY5.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js.map → chunk-EYLCSJAI.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{chunk-655STMGA.js.map → chunk-FMBNM2EN.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js.map → chunk-FNSPG7MU.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{chunk-KB726FMH.js.map → chunk-H2Z3FYXQ.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js.map → chunk-IA5FKNII.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js.map → chunk-IJIICKVW.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js.map → chunk-JOUQZENX.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js.map → chunk-JYFOV7FC.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js.map → chunk-K2X6U4UA.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js.map → chunk-KG44YSKD.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js.map → chunk-KPMKHGEA.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js.map → chunk-MIQDDLB5.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js.map → chunk-NLDFBC6J.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js.map → chunk-NP22ERDF.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js.map → chunk-NU3IMIEA.js.map} +0 -0
  639. /package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js.map → chunk-NVPZIJVR.js.map} +0 -0
  640. /package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js.map → chunk-ODALILG3.js.map} +0 -0
  641. /package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js.map → chunk-ONREO4ST.js.map} +0 -0
  642. /package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js.map → chunk-P74IZQ7A.js.map} +0 -0
  643. /package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js.map → chunk-PGY23YTC.js.map} +0 -0
  644. /package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js.map → chunk-PMOSXADO.js.map} +0 -0
  645. /package/dist/cli-bundle/chunks/{close-RI4JQQHU.js.map → chunk-PNTULOGU.js.map} +0 -0
  646. /package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js.map → chunk-Q7A43DS4.js.map} +0 -0
  647. /package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js.map → chunk-QEHQ2GVG.js.map} +0 -0
  648. /package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js.map → chunk-QIPLHNP7.js.map} +0 -0
  649. /package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js.map → chunk-QKJGPFAF.js.map} +0 -0
  650. /package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js.map → chunk-RLCHOOHC.js.map} +0 -0
  651. /package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js.map → chunk-RMLWNPH2.js.map} +0 -0
  652. /package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js.map → chunk-RRM5JYJC.js.map} +0 -0
  653. /package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js.map → chunk-S6MQESFR.js.map} +0 -0
  654. /package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js.map → chunk-SDQLJWBO.js.map} +0 -0
  655. /package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js.map → chunk-SELVXEZK.js.map} +0 -0
  656. /package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js.map → chunk-TKOVBP6C.js.map} +0 -0
  657. /package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js.map → chunk-TQSZFPIS.js.map} +0 -0
  658. /package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js.map → chunk-TSMHDIW4.js.map} +0 -0
  659. /package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js.map → chunk-UFXU44HV.js.map} +0 -0
  660. /package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js.map → chunk-ULTHRDBP.js.map} +0 -0
  661. /package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js.map → chunk-UOHFKBUV.js.map} +0 -0
  662. /package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js.map → chunk-UY2ACEMF.js.map} +0 -0
  663. /package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js.map → chunk-WUJQK4YV.js.map} +0 -0
  664. /package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js.map → chunk-XSJUSQAE.js.map} +0 -0
  665. /package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js.map → chunk-YAQEBNY7.js.map} +0 -0
  666. /package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js.map → chunk-YBLZ2VE7.js.map} +0 -0
  667. /package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js.map → chunk-YCQET3OT.js.map} +0 -0
  668. /package/dist/cli-bundle/chunks/{close-many-LY2XJ52M.js.map → chunk-YUSOJDWM.js.map} +0 -0
  669. /package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js.map → chunk-ZI6VQWQ7.js.map} +0 -0
  670. /package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js.map → close-CWODTPKG.js.map} +0 -0
  671. /package/dist/cli-bundle/chunks/{comments-35M273DN.js.map → close-W6LI2PKM.js.map} +0 -0
  672. /package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js.map → close-many-CQFUY7MR.js.map} +0 -0
  673. /package/dist/cli-bundle/chunks/{copy-NPYM7M7U.js.map → close-many-DLDDVSH5.js.map} +0 -0
  674. /package/dist/cli-bundle/chunks/{create-F53OBTOU.js.map → comments-E3TNTK24.js.map} +0 -0
  675. /package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js.map → comments-WGLHR7LB.js.map} +0 -0
  676. /package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js.map → copy-LXVDXH7B.js.map} +0 -0
  677. /package/dist/cli-bundle/chunks/{delete-ODRWJWAM.js.map → copy-Q5ZJPUKR.js.map} +0 -0
  678. /package/dist/cli-bundle/chunks/{deps-U57I7EAK.js.map → create-J5U6ND4K.js.map} +0 -0
  679. /package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js.map → create-LBVCYMEG.js.map} +0 -0
  680. /package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js.map → delete-PMJBNY5G.js.map} +0 -0
  681. /package/dist/cli-bundle/chunks/{docs-G7N4E2JO.js.map → delete-WNHB3LYW.js.map} +0 -0
  682. /package/dist/cli-bundle/chunks/{files-TTY6N2AV.js.map → deps-JZ7TMVCB.js.map} +0 -0
  683. /package/dist/cli-bundle/chunks/{files-TBZD7V6H.js.map → deps-OA26IS25.js.map} +0 -0
  684. /package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js.map → docs-FEWB2DQB.js.map} +0 -0
  685. /package/dist/cli-bundle/chunks/{focus-U5TRVCRS.js.map → docs-HA2AIDBB.js.map} +0 -0
  686. /package/dist/cli-bundle/chunks/{history-compact-M7GHYVFN.js.map → files-6YFBJRBG.js.map} +0 -0
  687. /package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js.map → files-EFIWKFTM.js.map} +0 -0
  688. /package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js.map → focus-4QJR7FOQ.js.map} +0 -0
  689. /package/dist/cli-bundle/chunks/{history-redact-JIHZLHDP.js.map → focus-POIW5LTJ.js.map} +0 -0
  690. /package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js.map → history-compact-CKRPDTJN.js.map} +0 -0
  691. /package/dist/cli-bundle/chunks/{history-repair-NAFCHLH7.js.map → history-compact-FWG2C7FZ.js.map} +0 -0
  692. /package/dist/cli-bundle/chunks/{learnings-SONGPSHI.js.map → history-redact-BB3TGDAE.js.map} +0 -0
  693. /package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js.map → history-redact-D225BHOZ.js.map} +0 -0
  694. /package/dist/cli-bundle/chunks/{notes-BSD53H2W.js.map → history-repair-6GEAM7HE.js.map} +0 -0
  695. /package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js.map → history-repair-RQXKQHL4.js.map} +0 -0
  696. /package/dist/cli-bundle/chunks/{plan-2NNEO46V.js.map → learnings-JLNLCOL5.js.map} +0 -0
  697. /package/dist/cli-bundle/chunks/{plan-AWLYGBNV.js.map → learnings-RSNLSWDC.js.map} +0 -0
  698. /package/dist/cli-bundle/chunks/{profile-U725ATWZ.js.map → notes-2WDH6DXU.js.map} +0 -0
  699. /package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js.map → notes-GB47XXQQ.js.map} +0 -0
  700. /package/dist/cli-bundle/chunks/{restore-66GLMHIX.js.map → plan-DOVI2VMW.js.map} +0 -0
  701. /package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js.map → plan-VDCJ2PCN.js.map} +0 -0
  702. /package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js.map → profile-FAU7NZML.js.map} +0 -0
  703. /package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js.map → profile-IVXQEL3D.js.map} +0 -0
  704. /package/dist/cli-bundle/chunks/{update-Q3UCILNR.js.map → restore-25DLT2Q2.js.map} +0 -0
  705. /package/dist/cli-bundle/chunks/{update-2XGHIVQ2.js.map → restore-YPMVUUEX.js.map} +0 -0
  706. /package/dist/cli-bundle/chunks/{update-many-75K57FS3.js.map → schema-FNU3WE4O.js.map} +0 -0
  707. /package/dist/cli-bundle/chunks/{update-many-U42YA445.js.map → schema-NBCM3RAD.js.map} +0 -0
  708. /package/dist/{cli/commands → sdk}/extension/managed-state.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-sources.js","sources":["sdk/extension/install-sources.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/install-sources\n *\n * Implements extension package-management support for Install Sources.\n */\nimport { execFile } from \"node:child_process\";\nimport fs from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { promisify } from \"node:util\";\nimport { collectPackageExtensionDirectories } from \"../../core/packages/manifest.js\";\nimport { resolvePmPackageRootFromModule } from \"../../core/packages/root.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { isPathWithinDirectory } from \"../../core/fs/path-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport {\n PmCliError,\n type PmCliErrorContext,\n} from \"../../core/shared/errors.js\";\nimport { listBundledPackageAliases } from \"./bundled-catalog.js\";\n\nconst execFileAsync = promisify(execFile);\nconst PM_CLI_PACKAGE_NAME = \"@unbrained/pm-cli\";\nlet bundledPackageAliasesCache: { key: string; aliases: string[] } | undefined;\n\ninterface LocalInstallSource {\n kind: \"local\";\n input: string;\n absolute_path: string;\n}\n\ninterface GithubInstallSource {\n kind: \"github\";\n input: string;\n owner: string;\n repo: string;\n repository: string;\n ref?: string;\n subpath?: string;\n}\n\ninterface NpmInstallSource {\n kind: \"npm\";\n input: string;\n spec: string;\n}\n\ntype InstallSource =\n | LocalInstallSource\n | GithubInstallSource\n | NpmInstallSource;\n\ninterface ResolvedInstallSource {\n source: InstallSource;\n directory: string;\n resolved_subpath?: string;\n commit?: string;\n npm_package?: string;\n npm_version?: string;\n cleanup?: () => Promise<void>;\n}\n\nfunction parseGithubPathSpec(\n pathSpec: string,\n input: string,\n refOverride?: string,\n): GithubInstallSource | null {\n const segments = pathSpec\n .split(\"/\")\n .map((segment) => segment.trim())\n .filter((segment) => segment.length > 0);\n if (segments.length < 2) {\n return null;\n }\n const owner = segments[0];\n const repo = segments[1].replace(/\\.git$/i, \"\");\n if (owner.length === 0 || repo.length === 0) {\n return null;\n }\n const tail = segments.slice(2);\n let ref: string | undefined;\n let subpath: string | undefined;\n if (tail[0] === \"tree\" && tail.length >= 2) {\n ref = tail[1];\n subpath = tail.slice(2).join(\"/\");\n } else if (tail.length > 0) {\n subpath = tail.join(\"/\");\n }\n if (typeof refOverride === \"string\" && refOverride.trim().length > 0) {\n ref = refOverride.trim();\n }\n return {\n kind: \"github\",\n input,\n owner,\n repo,\n repository: `https://github.com/${owner}/${repo}.git`,\n ref,\n subpath: subpath && subpath.length > 0 ? subpath : undefined,\n };\n}\n\nfunction parseNpmInstallSource(\n normalizedInput: string,\n forceGithub: boolean,\n refOverride: string | undefined,\n): InstallSource {\n const spec = normalizedInput.slice(\"npm:\".length).trim();\n if (spec.length === 0) {\n throw new PmCliError(\n 'npm package source must include a package spec after \"npm:\".',\n EXIT_CODE.USAGE,\n );\n }\n if (forceGithub) {\n throw new PmCliError(\n 'Options \"--gh/--github\" cannot be combined with npm: package sources.',\n EXIT_CODE.USAGE,\n );\n }\n if (refOverride) {\n throw new PmCliError(\n 'Option \"--ref\" cannot be combined with npm: package sources.',\n EXIT_CODE.USAGE,\n );\n }\n return {\n kind: \"npm\",\n input: normalizedInput,\n spec,\n };\n}\n\n/** Implements parse extension install source for the public runtime surface of this module. */\nexport function parseExtensionInstallSource(\n input: string,\n options: { forceGithub?: boolean; ref?: string } = {},\n): InstallSource {\n const normalizedInput = input.trim();\n if (normalizedInput.length === 0) {\n throw new PmCliError(\n \"Extension source is required for --install.\",\n EXIT_CODE.USAGE,\n );\n }\n const refOverride =\n typeof options.ref === \"string\" && options.ref.trim().length > 0\n ? options.ref.trim()\n : undefined;\n\n if (normalizedInput.startsWith(\"npm:\")) {\n return parseNpmInstallSource(\n normalizedInput,\n options.forceGithub === true,\n refOverride,\n );\n }\n\n const maybeGithubByUrl = (() => {\n try {\n const parsed = new URL(normalizedInput);\n if (parsed.hostname !== \"github.com\") {\n return null;\n }\n const pathSpec = parsed.pathname.replace(/^\\/+/, \"\");\n return parseGithubPathSpec(pathSpec, normalizedInput, refOverride);\n } catch {\n return null;\n }\n })();\n if (maybeGithubByUrl) {\n return maybeGithubByUrl;\n }\n\n const strippedDomainInput = normalizedInput.startsWith(\"github.com/\")\n ? normalizedInput.slice(\"github.com/\".length)\n : null;\n if (strippedDomainInput) {\n const parsed = parseGithubPathSpec(\n strippedDomainInput,\n normalizedInput,\n refOverride,\n );\n if (!parsed) {\n throw new PmCliError(\n `Invalid GitHub source \"${normalizedInput}\".`,\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n }\n\n if (options.forceGithub) {\n const parsed = parseGithubPathSpec(\n normalizedInput,\n normalizedInput,\n refOverride,\n );\n if (!parsed) {\n throw new PmCliError(\n `Invalid GitHub shorthand \"${normalizedInput}\".`,\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n }\n\n if (/^https?:\\/\\//i.test(normalizedInput)) {\n throw new PmCliError(\n `Unsupported extension source URL \"${normalizedInput}\". Supported remote source host: github.com.`,\n EXIT_CODE.USAGE,\n );\n }\n\n return {\n kind: \"local\",\n input: normalizedInput,\n absolute_path: path.resolve(process.cwd(), normalizedInput),\n };\n}\n\n/** Implements run git command for the public runtime surface of this module. */\nexport async function runGitCommand(\n args: string[],\n execRunner: typeof execFileAsync = execFileAsync,\n timeoutMs?: number,\n): Promise<string> {\n try {\n const result = await execRunner(\"git\", args, {\n encoding: \"utf8\",\n timeout: timeoutMs,\n });\n return (result.stdout ?? \"\").trim();\n } catch (error: unknown) {\n /* c8 ignore start -- stderr-vs-error-message precedence is validated in integration command-runner paths */\n const stderr =\n typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr: unknown }).stderr)\n : \"\";\n const message =\n stderr.trim().length > 0\n ? stderr.trim()\n : error instanceof Error\n ? error.message\n : String(error);\n /* c8 ignore stop */\n throw new PmCliError(\n `Git command failed: git ${args.join(\" \")}\\n${message}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\n/** Implements resolve npm command name for the public runtime surface of this module. */\nexport function resolveNpmCommandName(\n platform: NodeJS.Platform = process.platform,\n): \"npm\" | \"npm.cmd\" {\n return platform === \"win32\" ? \"npm.cmd\" : \"npm\";\n}\n\n/** Implements should run npm command in shell for the public runtime surface of this module. */\nexport function shouldRunNpmCommandInShell(\n platform: NodeJS.Platform = process.platform,\n): boolean {\n return platform === \"win32\";\n}\n\nasync function runNpmCommand(\n args: string[],\n cwd?: string,\n execRunner: typeof execFileAsync = execFileAsync,\n): Promise<string> {\n const npmCommand = resolveNpmCommandName();\n try {\n const result = await execRunner(npmCommand, args, {\n cwd,\n encoding: \"utf8\",\n shell: shouldRunNpmCommandInShell(),\n });\n return (result.stdout ?? \"\").trim();\n } catch (error: unknown) {\n const stderr =\n typeof error === \"object\" && error !== null && \"stderr\" in error\n ? String((error as { stderr: unknown }).stderr)\n : \"\";\n const message =\n stderr.trim().length > 0\n ? stderr.trim()\n : error instanceof Error\n ? error.message\n : String(error);\n throw new PmCliError(\n `npm command failed: ${npmCommand} ${args.join(\" \")}\\n${message}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\nfunction npmPackageNameFromSpec(spec: string): string {\n const trimmed = spec.trim();\n const withoutAlias = trimmed.includes(\"@file:\")\n ? trimmed.slice(0, trimmed.lastIndexOf(\"@file:\"))\n : trimmed;\n if (withoutAlias.startsWith(\"@\")) {\n const scoped = withoutAlias.match(/^(@[^/@\\s]+\\/[^/@\\s]+)/);\n return scoped?.[1] ?? withoutAlias;\n }\n const unscoped = withoutAlias.match(/^([^/@\\s]+)/);\n return unscoped?.[1] ?? withoutAlias;\n}\n\n/** Implements check whether npm not found error for the public runtime surface of this module. */\nexport function isNpmNotFoundError(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n const normalized = message.toLowerCase();\n return (\n normalized.includes(\"npm err! code e404\") ||\n normalized.includes(\"404 not found\") ||\n normalized.includes(\"is not in this registry\")\n );\n}\n\n/** Implements check whether npm pack not found error for the public runtime surface of this module. */\nexport function isNpmPackNotFoundError(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n const normalized = message.toLowerCase();\n return isNpmNotFoundError(error) || normalized.includes(\"not found\");\n}\n\nfunction isFirstPartyPmPackageName(packageName: string): boolean {\n const normalized = packageName.trim().toLowerCase();\n return (\n normalized.startsWith(\"@unbrained/pm-\") || normalized.startsWith(\"pm-\")\n );\n}\n\n/** Implements build npm not found recovery for the public runtime surface of this module. */\nexport function buildNpmNotFoundRecovery(spec: string): {\n message: string;\n context: PmCliErrorContext;\n} {\n const packageName = npmPackageNameFromSpec(spec);\n const isFirstPartyPackage = isFirstPartyPmPackageName(packageName);\n const repoName = packageName.replace(/^.*\\//, \"\");\n const githubSource = isFirstPartyPackage\n ? `github.com/unbraind/${repoName}`\n : undefined;\n const nextBestCommand = githubSource\n ? `pm install --project ${githubSource}`\n : undefined;\n return {\n message: isFirstPartyPackage\n ? `npm package \"${spec}\" was not found in the registry. If this is an unpublished first-party pm package, install its GitHub repository instead.`\n : `npm package \"${spec}\" was not found in the registry.`,\n context: {\n code: \"npm_package_not_found\",\n required:\n \"Use an install source that exists, or publish the npm package before installing it with npm:<name>.\",\n why: \"Classifying npm 404s avoids repeated registry retries and gives agents a deterministic fallback path.\",\n examples: nextBestCommand\n ? [nextBestCommand, `pm package catalog --project --json`]\n : [`npm view ${packageName}`, `pm package catalog --project --json`],\n nextSteps: nextBestCommand\n ? [\n `Try ${nextBestCommand} if the repository exists.`,\n \"Use pm package catalog --project --json to inspect bundled package aliases before installing.\",\n ]\n : [\n `Verify ${packageName} exists in the npm registry and that you have access to it.`,\n \"Use pm package catalog --project --json to inspect bundled package aliases before installing.\",\n ],\n recovery: {\n attempted_command: `pm install --project npm:${spec}`,\n normalized_args: [\"install\", \"--project\", `npm:${spec}`],\n ...(githubSource && nextBestCommand\n ? {\n fallback_candidates: [\n {\n source: githubSource,\n command: nextBestCommand,\n reason:\n \"canonical first-party GitHub repository fallback for unpublished pm packages\",\n },\n ],\n next_best_command: nextBestCommand,\n }\n : {}),\n },\n },\n };\n}\n\n/** Implements wrap npm pack resolution error for the public runtime surface of this module. */\nexport function wrapNpmPackResolutionError(\n spec: string,\n error: unknown,\n): PmCliError | null {\n if (!isNpmPackNotFoundError(error)) {\n return null;\n }\n const recovery = buildNpmNotFoundRecovery(spec);\n return new PmCliError(\n recovery.message,\n EXIT_CODE.NOT_FOUND,\n recovery.context,\n );\n}\n\nasync function resolveLocalNpmPackagePath(\n spec: string,\n): Promise<string | null> {\n if (path.isAbsolute(spec) || spec.startsWith(\".\") || spec.startsWith(\"..\")) {\n const absolutePath = path.resolve(process.cwd(), spec);\n return (await pathExists(absolutePath)) ? absolutePath : null;\n }\n\n try {\n const parsed = new URL(spec);\n if (parsed.protocol === \"file:\") {\n const absolutePath = fileURLToPath(parsed);\n return (await pathExists(absolutePath)) ? absolutePath : null;\n }\n } catch {\n // Registry package specs are not URLs.\n }\n\n if (!/^[a-z][a-z0-9+.-]*:/i.test(spec)) {\n const absolutePath = path.resolve(process.cwd(), spec);\n if (await pathExists(absolutePath)) {\n return absolutePath;\n }\n }\n\n return null;\n}\n\nasync function resolveNpmPackSpec(spec: string): Promise<string> {\n const localPath = await resolveLocalNpmPackagePath(spec);\n if (localPath) {\n // Hand npm pack a NATIVE filesystem path, never a percent-encoded file URL:\n // npm opens the spec literally, so spaces (`%20`) or a Windows 8.3 `~` short\n // name (`%7E`) escaped by pathToFileURL make pack fail ENOENT on every\n // platform (GH-363). resolveLocalNpmPackagePath already decoded the path.\n return localPath;\n }\n\n const localFileAlias = normalizeNpmLocalFileAliasSpec(spec);\n if (localFileAlias !== spec) {\n return localFileAlias;\n }\n\n if (/^[a-z][a-z0-9+.-]*:/i.test(spec)) {\n return spec;\n }\n\n return spec;\n}\n\n/** Implements normalize npm local file alias spec for the public runtime surface of this module. */\nexport function normalizeNpmLocalFileAliasSpec(\n spec: string,\n cwd: string = process.cwd(),\n): string {\n const marker = \"@file:\";\n const markerIndex = spec.lastIndexOf(marker);\n if (markerIndex <= 0) {\n return spec;\n }\n const packageName = spec.slice(0, markerIndex);\n const target = spec.slice(markerIndex + marker.length);\n if (packageName.trim().length === 0 || target.trim().length === 0) {\n return spec;\n }\n // `file://host/share` (exactly two leading slashes) is a UNC / network spec,\n // not a local path — leave it for npm to resolve.\n if (target.startsWith(\"//\") && !target.startsWith(\"///\")) {\n return spec;\n }\n // A bare relative target resolves against cwd.\n if (!target.startsWith(\"/\")) {\n return `${packageName}@${path.resolve(cwd, target)}`;\n }\n // Resolve an absolute `file:` URL target to a NATIVE, percent-DECODED path\n // (never an encoded file URL): npm opens the alias target literally, so an\n // escaped path — spaces (`%20`) or a Windows 8.3 `~` short name escaped to\n // `%7E` — fails ENOENT on every platform (GH-363). Decode via URL +\n // decodeURIComponent rather than fileURLToPath, which throws\n // ERR_INVALID_FILE_URL_PATH for a driveless absolute path supplied on Windows;\n // strip the leading slash before a Windows drive letter (`/C:/x` -> `C:/x`).\n let decodedPath: string;\n try {\n decodedPath = decodeURIComponent(new URL(`file:${target}`).pathname);\n } catch {\n // Malformed percent-encoding (e.g. `%ZZ`) makes decodeURIComponent throw a\n // URIError; leave the spec untouched so npm surfaces a clear error instead\n // of crashing the CLI on an uncaught exception.\n return spec;\n }\n const nativePath = /^\\/[A-Za-z]:/.test(decodedPath)\n ? decodedPath.slice(1)\n : decodedPath;\n return `${packageName}@${nativePath}`;\n}\n\nfunction parsePackedNpmPackage(\n stdout: string,\n packDirectory: string,\n): { tarball: string; package?: string; version?: string } {\n try {\n const parsed = JSON.parse(stdout) as Array<{\n filename?: unknown;\n name?: unknown;\n version?: unknown;\n }>;\n const first = Array.isArray(parsed) ? parsed[0] : undefined;\n if (\n first &&\n typeof first.filename === \"string\" &&\n first.filename.trim().length > 0\n ) {\n return {\n tarball: path.resolve(packDirectory, first.filename),\n package: typeof first.name === \"string\" ? first.name : undefined,\n version: typeof first.version === \"string\" ? first.version : undefined,\n };\n }\n } catch {\n // Fall back to the last stdout line for older npm output.\n }\n const lastLine = stdout\n .split(/\\r?\\n/)\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .at(-1);\n if (!lastLine) {\n throw new PmCliError(\n \"npm pack did not report a tarball filename.\",\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return {\n tarball: path.resolve(packDirectory, lastLine),\n };\n}\n\nasync function resolveNpmSourceDirectory(source: NpmInstallSource): Promise<{\n directory: string;\n package?: string;\n version?: string;\n cleanup: () => Promise<void>;\n}> {\n return resolveNpmSourceDirectoryWithRunner(source, runNpmCommand);\n}\n\nasync function resolveNpmSourceDirectoryWithRunner(\n source: NpmInstallSource,\n npmRunner: typeof runNpmCommand,\n): Promise<{\n directory: string;\n package?: string;\n version?: string;\n cleanup: () => Promise<void>;\n}> {\n const localPackageRoot = await resolveLocalNpmPackagePath(source.spec);\n if (localPackageRoot) {\n const packageJsonPath = path.join(localPackageRoot, \"package.json\");\n const packageJson = (await pathExists(packageJsonPath))\n ? (JSON.parse(await fs.readFile(packageJsonPath, \"utf8\")) as {\n name?: unknown;\n version?: unknown;\n })\n : {};\n return {\n directory: await resolvePackageExtensionDirectory(\n localPackageRoot,\n source.input,\n ),\n package:\n typeof packageJson.name === \"string\" ? packageJson.name : undefined,\n version:\n typeof packageJson.version === \"string\"\n ? packageJson.version\n : undefined,\n cleanup: async () => {},\n };\n }\n\n const tempRoot = await fs.mkdtemp(\n path.join(os.tmpdir(), \"pm-npm-package-source-\"),\n );\n const packDirectory = path.join(tempRoot, \"pack\");\n const extractDirectory = path.join(tempRoot, \"extract\");\n await fs.mkdir(packDirectory, { recursive: true });\n await fs.mkdir(extractDirectory, { recursive: true });\n\n try {\n const packSpec = await resolveNpmPackSpec(source.spec);\n const packStdout = await npmRunner([\n \"pack\",\n packSpec,\n \"--json\",\n \"--pack-destination\",\n packDirectory,\n ]);\n const packed = parsePackedNpmPackage(packStdout, packDirectory);\n await execFileAsync(\n \"tar\",\n [\"-xzf\", packed.tarball, \"-C\", extractDirectory],\n { encoding: \"utf8\" },\n );\n const packageRoot = path.join(extractDirectory, \"package\");\n await installNpmPackageRuntimeDependencies(packageRoot);\n const directory = await resolvePackageExtensionDirectory(\n packageRoot,\n source.input,\n );\n return {\n directory,\n package: packed.package,\n version: packed.version,\n cleanup: async () => {\n await fs.rm(tempRoot, { recursive: true, force: true });\n },\n };\n } catch (error: unknown) {\n await fs.rm(tempRoot, { recursive: true, force: true });\n const wrappedError = wrapNpmPackResolutionError(source.spec, error);\n if (wrappedError) {\n throw wrappedError;\n }\n throw error;\n }\n}\n\nasync function installNpmPackageRuntimeDependencies(\n packageRoot: string,\n): Promise<void> {\n const packageJsonPath = path.join(packageRoot, \"package.json\");\n if (!(await pathExists(packageJsonPath))) {\n return;\n }\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(await fs.readFile(packageJsonPath, \"utf8\")) as unknown;\n } catch {\n return;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return;\n }\n\n const manifest = parsed as {\n dependencies?: unknown;\n optionalDependencies?: unknown;\n peerDependencies?: unknown;\n };\n const dependencySpecs = runtimeDependencyInstallSpecs(manifest);\n const shouldLinkHostedPmCli = hasHostedPmCliDependency(manifest);\n if (dependencySpecs.length === 0 && !shouldLinkHostedPmCli) {\n return;\n }\n\n const runtimeOnlyManifest = { ...(parsed as Record<string, unknown>) };\n delete runtimeOnlyManifest.devDependencies;\n const installManifest = { ...runtimeOnlyManifest };\n removeHostedPmCliDependency(installManifest);\n await fs.writeFile(\n packageJsonPath,\n `${JSON.stringify(installManifest, null, 2)}\\n`,\n \"utf8\",\n );\n try {\n await Promise.all([\n fs.rm(path.join(packageRoot, \"package-lock.json\"), { force: true }),\n fs.rm(path.join(packageRoot, \"npm-shrinkwrap.json\"), { force: true }),\n ]);\n\n if (dependencySpecs.length > 0) {\n await runNpmCommand(\n [\n \"install\",\n \"--ignore-scripts\",\n \"--no-audit\",\n \"--fund=false\",\n \"--package-lock=false\",\n \"--no-save\",\n \"--omit=peer\",\n ...dependencySpecs,\n ],\n packageRoot,\n );\n }\n\n if (shouldLinkHostedPmCli) {\n await linkHostedPmCliDependency(packageRoot);\n }\n } finally {\n await fs.writeFile(\n packageJsonPath,\n `${JSON.stringify(runtimeOnlyManifest, null, 2)}\\n`,\n \"utf8\",\n );\n }\n}\n\nfunction hasHostedPmCliDependency(manifest: {\n dependencies?: unknown;\n optionalDependencies?: unknown;\n peerDependencies?: unknown;\n}): boolean {\n for (const dependencyMap of [\n manifest.dependencies,\n manifest.optionalDependencies,\n manifest.peerDependencies,\n ]) {\n if (\n typeof dependencyMap === \"object\" &&\n dependencyMap !== null &&\n PM_CLI_PACKAGE_NAME in dependencyMap\n ) {\n return true;\n }\n }\n return false;\n}\n\nfunction removeHostedPmCliDependency(manifest: Record<string, unknown>): void {\n for (const field of [\n \"dependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n ] as const) {\n const dependencyMap = manifest[field];\n if (typeof dependencyMap !== \"object\" || dependencyMap === null) {\n continue;\n }\n const nextMap = { ...(dependencyMap as Record<string, unknown>) };\n delete nextMap[PM_CLI_PACKAGE_NAME];\n if (Object.keys(nextMap).length === 0) {\n delete manifest[field];\n } else {\n manifest[field] = nextMap;\n }\n }\n}\n\nasync function linkHostedPmCliDependency(packageRoot: string): Promise<void> {\n const hostPackageRoot = resolvePmPackageRootFromModule(import.meta.url, [\n \"../../..\",\n ]);\n const [scope, packageName] = PM_CLI_PACKAGE_NAME.split(\"/\");\n const scopedDirectory = path.join(packageRoot, \"node_modules\", scope);\n const linkPath = path.join(scopedDirectory, packageName);\n await fs.mkdir(scopedDirectory, { recursive: true });\n await fs.rm(linkPath, { recursive: true, force: true });\n await fs.symlink(\n hostPackageRoot,\n linkPath,\n resolveDirectorySymlinkType(process.platform),\n );\n}\n\nfunction resolveDirectorySymlinkType(\n platform: NodeJS.Platform,\n): \"dir\" | \"junction\" {\n return platform === \"win32\" ? \"junction\" : \"dir\";\n}\n\nfunction runtimeDependencyInstallSpecs(manifest: {\n dependencies?: unknown;\n optionalDependencies?: unknown;\n peerDependencies?: unknown;\n}): string[] {\n const specs = new Map<string, string>();\n for (const dependencyMap of [\n manifest.dependencies,\n manifest.optionalDependencies,\n manifest.peerDependencies,\n ]) {\n if (typeof dependencyMap !== \"object\" || dependencyMap === null) {\n continue;\n }\n for (const [name, version] of Object.entries(dependencyMap)) {\n if (\n name === PM_CLI_PACKAGE_NAME ||\n typeof version !== \"string\" ||\n version.trim().length === 0 ||\n specs.has(name)\n ) {\n continue;\n }\n specs.set(name, `${name}@${version.trim()}`);\n }\n }\n return [...specs.values()];\n}\n\nasync function resolvePackageExtensionDirectory(\n packageRoot: string,\n sourceLabel: string,\n): Promise<string> {\n const discovered = await collectPackageExtensionDirectories(packageRoot);\n if (discovered.length === 1) {\n return discovered[0];\n }\n if (discovered.length > 1) {\n const choices = discovered\n .map((entry) =>\n path.relative(packageRoot, entry).replaceAll(path.sep, \"/\"),\n )\n .sort((left, right) => left.localeCompare(right));\n throw new PmCliError(\n `Package source \"${sourceLabel}\" contains multiple extension manifests. Provide an explicit extension path. Candidates: ${choices.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n throw new PmCliError(\n `Unable to locate a pm extension manifest in package source \"${sourceLabel}\". Package installs currently activate only extension resources, so add package.json pm.extensions or an extensions/ directory. Metadata-only resources like pm.docs/pm.examples are catalog metadata and do not activate commands.`,\n EXIT_CODE.USAGE,\n );\n}\n\nasync function resolveGithubSourceDirectory(\n cloneDirectory: string,\n source: GithubInstallSource,\n): Promise<{ directory: string; resolved_subpath?: string }> {\n const candidatePaths: string[] = [];\n /* c8 ignore start -- subpath candidate expansion permutations are covered by source-resolution integration suites */\n if (source.subpath) {\n candidatePaths.push(source.subpath);\n candidatePaths.push(\n path.posix.join(\".agents/pm/extensions\", source.subpath),\n );\n candidatePaths.push(\n path.posix.join(\".custom/pm-extensions\", source.subpath),\n );\n candidatePaths.push(\n path.posix.join(\".custom/pm-extension\", source.subpath),\n );\n }\n /* c8 ignore stop */\n\n for (const candidate of candidatePaths) {\n const absolute = path.resolve(cloneDirectory, candidate);\n if (!isPathWithinDirectory(cloneDirectory, absolute)) {\n // source.subpath is user-controlled; never resolve a manifest outside the\n // cloned repository (path-traversal guard).\n continue;\n }\n if (await pathExists(path.join(absolute, \"manifest.json\"))) {\n return { directory: absolute, resolved_subpath: candidate };\n }\n }\n\n if (await pathExists(path.join(cloneDirectory, \"manifest.json\"))) {\n return { directory: cloneDirectory, resolved_subpath: \".\" };\n }\n\n const discoveredDirectory = await resolvePackageExtensionDirectory(\n cloneDirectory,\n source.input,\n );\n return {\n directory: discoveredDirectory,\n resolved_subpath: path\n .relative(cloneDirectory, discoveredDirectory)\n .replaceAll(path.sep, \"/\"),\n };\n}\n\n/** Bare package-ish names (no path separators, or a single-scope npm name) that miss local resolution are almost always intended as npm or bundled installs, so the not-found error must route agents to those sources instead of dead-ending. */\nfunction looksLikeBarePackageName(input: string): boolean {\n const trimmed = input.trim();\n if (\n trimmed.length === 0 ||\n trimmed.startsWith(\".\") ||\n trimmed.startsWith(\"~\")\n ) {\n return false;\n }\n if (trimmed.startsWith(\"@\")) {\n return trimmed.split(\"/\").length === 2;\n }\n return !trimmed.includes(\"/\") && !trimmed.includes(\"\\\\\");\n}\n\nasync function buildLocalSourceNotFoundError(\n source: LocalInstallSource,\n): Promise<PmCliError> {\n const baseMessage = `Local extension source does not exist: \"${source.absolute_path}\".`;\n const input = source.input.trim();\n if (!looksLikeBarePackageName(input)) {\n return new PmCliError(baseMessage, EXIT_CODE.NOT_FOUND);\n }\n let bundledAliases: string[] = [];\n try {\n const envPackageRoot = process.env.PM_CLI_PACKAGE_ROOT;\n const cacheKey =\n typeof envPackageRoot === \"string\" && envPackageRoot.trim().length > 0\n ? path.resolve(envPackageRoot.trim())\n : \"\";\n if (bundledPackageAliasesCache?.key !== cacheKey) {\n bundledPackageAliasesCache = {\n key: cacheKey,\n aliases: await listBundledPackageAliases(),\n };\n }\n bundledAliases = bundledPackageAliasesCache.aliases;\n } catch {\n // Alias discovery is best-effort; the npm: hint alone still unblocks agents.\n }\n const nextSteps = [\n `Retry with pm install npm:${input} if the package is published to npm.`,\n `Or inspect bundled packages with pm package catalog --project --json before installing by alias. Known aliases (blank means none found): ${bundledAliases.join(\", \")}`,\n ];\n return new PmCliError(\n `${baseMessage} \"${input}\" did not match a local directory, bundled package alias, or bundled package name; if you meant an npm package, install it as \"npm:${input}\".`,\n EXIT_CODE.NOT_FOUND,\n {\n code: \"local_source_not_found_bare_name\",\n required: `Use \"npm:${input}\" for npm registry packages, a bundled catalog alias, or an existing local directory path.`,\n why: \"Bare names resolve as local paths only after bundled aliases, so unmatched names need an explicit npm: source.\",\n examples: [\n `pm install npm:${input}`,\n \"pm package catalog --project --json\",\n ],\n nextSteps,\n recovery: {\n attempted_command: `pm install ${input}`,\n normalized_args: [\"install\", input],\n next_best_command: `pm install npm:${input}`,\n },\n },\n );\n}\n\n/** Implements resolve install source for the public runtime surface of this module. */\nexport async function resolveInstallSource(\n source: InstallSource,\n): Promise<ResolvedInstallSource> {\n if (source.kind === \"local\") {\n let localStats;\n try {\n localStats = await fs.stat(source.absolute_path);\n } catch {\n throw await buildLocalSourceNotFoundError(source);\n }\n if (!localStats.isDirectory()) {\n throw new PmCliError(\n `Local extension source must be a directory: \"${source.absolute_path}\".`,\n EXIT_CODE.USAGE,\n );\n }\n const directory = await resolvePackageExtensionDirectory(\n source.absolute_path,\n source.input,\n );\n return {\n source,\n directory,\n };\n }\n\n if (source.kind === \"npm\") {\n const resolved = await resolveNpmSourceDirectory(source);\n return {\n source,\n directory: resolved.directory,\n cleanup: resolved.cleanup,\n resolved_subpath: path\n .relative(path.dirname(resolved.directory), resolved.directory)\n .replaceAll(path.sep, \"/\"),\n npm_package: resolved.package,\n npm_version: resolved.version,\n };\n }\n\n const cloneDirectory = await fs.mkdtemp(\n path.join(os.tmpdir(), \"pm-extension-source-\"),\n );\n const cloneArgs = [\"clone\", \"--depth\", \"1\"];\n if (source.ref) {\n cloneArgs.push(\"--branch\", source.ref);\n }\n cloneArgs.push(source.repository, cloneDirectory);\n\n try {\n await runGitCommand(cloneArgs);\n const commit = await runGitCommand([\n \"-C\",\n cloneDirectory,\n \"rev-parse\",\n \"HEAD\",\n ]);\n const resolved = await resolveGithubSourceDirectory(cloneDirectory, source);\n return {\n source,\n directory: resolved.directory,\n resolved_subpath: resolved.resolved_subpath,\n commit,\n cleanup: async () => {\n await fs.rm(cloneDirectory, { recursive: true, force: true });\n },\n };\n } catch (error: unknown) {\n await fs.rm(cloneDirectory, { recursive: true, force: true });\n throw error;\n }\n}\n\n/** Implements are directories equivalent for the public runtime surface of this module. */\nexport async function areDirectoriesEquivalent(\n left: string,\n right: string,\n): Promise<boolean> {\n if (!(await pathExists(left)) || !(await pathExists(right))) {\n return false;\n }\n const [leftRealPath, rightRealPath] = await Promise.all([\n fs.realpath(left),\n fs.realpath(right),\n ]);\n return leftRealPath === rightRealPath;\n}\n\n/** Public contract for test only install sources, shared by SDK and presentation-layer consumers. */\nexport const _testOnlyInstallSources = {\n installNpmPackageRuntimeDependencies,\n npmPackageNameFromSpec,\n parsePackedNpmPackage,\n resolveNpmSourceDirectoryWithRunner,\n resolveNpmSourceDirectory,\n resolveNpmPackSpec,\n resolvePackageExtensionDirectory,\n runtimeDependencyInstallSpecs,\n hasHostedPmCliDependency,\n removeHostedPmCliDependency,\n linkHostedPmCliDependency,\n resolveDirectorySymlinkType,\n runNpmCommand,\n};\n"],"names":[],"mapp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C;IAChC,6BAA6B;IAC7B,wBAAwB;IACxB,2BAA2B;IAC3B,yBAAyB;IACzB,2BAA2B;IAC3B,aAAa;CACd,CAAC","debugId":"38193531-eca3-557b-ab40-d4af159b9192"}
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @module cli/commands/extension/managed-state
2
+ * @module sdk/extension/managed-state
3
3
  *
4
4
  * Implements extension package-management support for Managed State.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a0286c96-941d-587e-b4a6-19f4248823ab")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="34e6fdd1-e124-5995-81aa-0de1092d36f8")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
- import { EXIT_CODE } from "../../../core/shared/constants.js";
11
- import { PmCliError } from "../../../core/shared/errors.js";
12
- import { nowIso } from "../../../core/shared/time.js";
10
+ import { EXIT_CODE } from "../../core/shared/constants.js";
11
+ import { PmCliError } from "../../core/shared/errors.js";
12
+ import { nowIso } from "../../core/shared/time.js";
13
13
  import { normalizeExtensionNameForMatch, normalizeStringList, } from "./shared.js";
14
14
  const MANAGED_EXTENSION_STATE_FILENAME = ".managed-extensions.json";
15
15
  const MANAGED_EXTENSION_STATE_VERSION = 1;
@@ -233,4 +233,4 @@ export function upsertManagedEntry(state, entry) {
233
233
  };
234
234
  }
235
235
  //# sourceMappingURL=managed-state.js.map
236
- //# debugId=a0286c96-941d-587e-b4a6-19f4248823ab
236
+ //# debugId=34e6fdd1-e124-5995-81aa-0de1092d36f8
@@ -0,0 +1 @@
1
+ {"version":3,"file":"managed-state.js","sources":["sdk/extension/managed-state.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension/managed-state\n *\n * Implements extension package-management support for Managed State.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport {\n normalizeExtensionNameForMatch,\n normalizeStringList,\n} from \"./shared.js\";\nimport type { ExtensionScope } from \"../extension.js\";\n\nconst MANAGED_EXTENSION_STATE_FILENAME = \".managed-extensions.json\";\nconst MANAGED_EXTENSION_STATE_VERSION = 1;\n\n/** Documents the managed extension source payload exchanged by command, SDK, and package integrations. */\nexport interface ManagedExtensionSource {\n /** Value that configures or reports kind for this contract. */\n kind: \"local\" | \"github\" | \"npm\" | \"builtin\";\n /** Value that configures or reports input for this contract. */\n input: string;\n /** Value that configures or reports location for this contract. */\n location: string;\n /** Value that configures or reports name for this contract. */\n name?: string;\n /** Value that configures or reports package for this contract. */\n package?: string;\n /** Value that configures or reports version for this contract. */\n version?: string;\n /** Value that configures or reports repository for this contract. */\n repository?: string;\n /** Value that configures or reports owner for this contract. */\n owner?: string;\n /** Value that configures or reports repo for this contract. */\n repo?: string;\n /** Value that configures or reports ref for this contract. */\n ref?: string;\n /** Value that configures or reports subpath for this contract. */\n subpath?: string;\n /** Value that configures or reports commit for this contract. */\n commit?: string;\n}\n\n/** Documents the managed extension record payload exchanged by command, SDK, and package integrations. */\nexport interface ManagedExtensionRecord {\n /** Value that configures or reports name for this contract. */\n name: string;\n /** Value that configures or reports directory for this contract. */\n directory: string;\n /** Value that configures or reports scope for this contract. */\n scope: ExtensionScope;\n /** Value that configures or reports manifest version for this contract. */\n manifest_version: string;\n /** Value that configures or reports manifest entry for this contract. */\n manifest_entry: string;\n /** Value that configures or reports capabilities for this contract. */\n capabilities: string[];\n /** ISO 8601 timestamp recording when installed occurred. */\n installed_at: string;\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Value that configures or reports source for this contract. */\n source: ManagedExtensionSource;\n /** ISO 8601 timestamp recording when last update check occurred. */\n last_update_check_at?: string;\n /** Value that configures or reports last update remote commit for this contract. */\n last_update_remote_commit?: string;\n /** Value that configures or reports update available for this contract. */\n update_available?: boolean | null;\n /** Value that configures or reports update error for this contract. */\n update_error?: string;\n}\n\n/** Documents the managed extension state payload exchanged by command, SDK, and package integrations. */\nexport interface ManagedExtensionState {\n /** Value that configures or reports version for this contract. */\n version: number;\n /** ISO 8601 timestamp recording when updated occurred. */\n updated_at: string;\n /** Value that configures or reports entries for this contract. */\n entries: ManagedExtensionRecord[];\n}\n\n/** Documents the managed extension state read result payload exchanged by command, SDK, and package integrations. */\nexport interface ManagedExtensionStateReadResult {\n /** Filesystem path used for path resolution. */\n path: string;\n /** Value that configures or reports state for this contract. */\n state: ManagedExtensionState;\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\n/** Implements resolve managed extension state path for the public runtime surface of this module. */\nexport function resolveManagedExtensionStatePath(\n extensionsRoot: string,\n): string {\n return path.join(extensionsRoot, MANAGED_EXTENSION_STATE_FILENAME);\n}\n\n/** Implements create empty managed extension state for the public runtime surface of this module. */\nexport function createEmptyManagedExtensionState(): ManagedExtensionState {\n return {\n version: MANAGED_EXTENSION_STATE_VERSION,\n updated_at: nowIso(),\n entries: [],\n };\n}\n\n/** Implements sort managed entries for the public runtime surface of this module. */\nexport function sortManagedEntries(\n entries: ManagedExtensionRecord[],\n): ManagedExtensionRecord[] {\n return [...entries].sort((left, right) => {\n const byScope = left.scope.localeCompare(right.scope);\n if (byScope !== 0) {\n return byScope;\n }\n const byName = left.name.localeCompare(right.name);\n if (byName !== 0) {\n return byName;\n }\n return left.directory.localeCompare(right.directory);\n });\n}\n\n/** Implements managed extension sources equivalent for the public runtime surface of this module. */\nexport function managedExtensionSourcesEquivalent(\n left: ManagedExtensionSource,\n right: ManagedExtensionSource,\n): boolean {\n if (\n left.kind !== right.kind ||\n left.input !== right.input ||\n left.location !== right.location\n ) {\n return false;\n }\n if (left.kind === \"npm\" && right.kind === \"npm\") {\n return left.package === right.package && left.version === right.version;\n }\n if (left.kind === \"github\" && right.kind === \"github\") {\n return (\n left.repository === right.repository &&\n left.ref === right.ref &&\n left.subpath === right.subpath &&\n left.commit === right.commit\n );\n }\n if (left.kind === \"builtin\" && right.kind === \"builtin\") {\n return left.name === right.name;\n }\n return true;\n}\n\n/** Narrow `value` to a string, or `undefined` for any other type — the normalization applied to every optional managed-state string field so an absent or malformed value is dropped rather than carried through as `unknown`. */\nfunction optionalString(value: unknown): string | undefined {\n return typeof value === \"string\" ? value : undefined;\n}\n\n/**\n * Type guard asserting `entry` carries every always-present managed-record field\n * with the right primitive type: a non-empty `name`/`directory`, a known\n * {@link ExtensionScope}, string manifest metadata, a `string[]` capability\n * list, and string `installed_at`/`updated_at` timestamps. The optional columns\n * (`source` plus the update-check fields) are validated separately by the\n * caller, so this guard narrows only the required columns.\n */\nfunction hasRequiredManagedRecordFields(\n entry: Record<string, unknown>,\n): entry is Record<string, unknown> &\n Pick<\n ManagedExtensionRecord,\n | \"name\"\n | \"directory\"\n | \"scope\"\n | \"manifest_version\"\n | \"manifest_entry\"\n | \"capabilities\"\n | \"installed_at\"\n | \"updated_at\"\n > {\n return (\n typeof entry.name === \"string\" &&\n entry.name.trim().length > 0 &&\n typeof entry.directory === \"string\" &&\n entry.directory.trim().length > 0 &&\n (entry.scope === \"project\" || entry.scope === \"global\") &&\n typeof entry.manifest_version === \"string\" &&\n typeof entry.manifest_entry === \"string\" &&\n Array.isArray(entry.capabilities) &&\n entry.capabilities.every(\n (value): value is string => typeof value === \"string\",\n ) &&\n typeof entry.installed_at === \"string\" &&\n typeof entry.updated_at === \"string\"\n );\n}\n\n/** Normalize one persisted managed-extension source object, returning `null` when the discriminant (`kind`) or the required `input`/`location` strings are missing or malformed so the caller can skip the owning record. */\nfunction normalizeManagedSource(raw: unknown): ManagedExtensionSource | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const source = raw as Record<string, unknown>;\n if (\n (source.kind !== \"local\" &&\n source.kind !== \"github\" &&\n source.kind !== \"npm\" &&\n source.kind !== \"builtin\") ||\n typeof source.input !== \"string\" ||\n typeof source.location !== \"string\"\n ) {\n return null;\n }\n return {\n kind: source.kind,\n input: source.input,\n location: source.location,\n name: optionalString(source.name),\n package: optionalString(source.package),\n version: optionalString(source.version),\n repository: optionalString(source.repository),\n owner: optionalString(source.owner),\n repo: optionalString(source.repo),\n ref: optionalString(source.ref),\n subpath: optionalString(source.subpath),\n commit: optionalString(source.commit),\n };\n}\n\n/**\n * Normalize one persisted managed-extension record, returning `null` when any\n * required field or its `source` is missing or malformed so {@link\n * normalizeManagedState} can drop the entry without discarding the rest of the\n * file.\n */\nfunction normalizeManagedRecord(raw: unknown): ManagedExtensionRecord | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const entry = raw as Record<string, unknown>;\n if (!hasRequiredManagedRecordFields(entry)) {\n return null;\n }\n const source = normalizeManagedSource(entry.source);\n if (!source) {\n return null;\n }\n return {\n name: entry.name.trim(),\n directory: entry.directory.trim(),\n scope: entry.scope,\n manifest_version: entry.manifest_version,\n manifest_entry: entry.manifest_entry,\n capabilities: normalizeStringList(entry.capabilities),\n installed_at: entry.installed_at,\n updated_at: entry.updated_at,\n source,\n last_update_check_at: optionalString(entry.last_update_check_at),\n last_update_remote_commit: optionalString(entry.last_update_remote_commit),\n update_available:\n typeof entry.update_available === \"boolean\" ||\n entry.update_available === null\n ? entry.update_available\n : undefined,\n update_error: optionalString(entry.update_error),\n };\n}\n\n/** Implements normalize managed state for the public runtime surface of this module. */\nexport function normalizeManagedState(\n raw: unknown,\n): ManagedExtensionState | null {\n if (typeof raw !== \"object\" || raw === null) {\n return null;\n }\n const candidate = raw as Record<string, unknown>;\n if (\n candidate.version !== MANAGED_EXTENSION_STATE_VERSION ||\n !Array.isArray(candidate.entries)\n ) {\n return null;\n }\n\n const entries: ManagedExtensionRecord[] = [];\n for (const rawEntry of candidate.entries) {\n const record = normalizeManagedRecord(rawEntry);\n if (record) {\n entries.push(record);\n }\n }\n return {\n version: MANAGED_EXTENSION_STATE_VERSION,\n updated_at: optionalString(candidate.updated_at) ?? nowIso(),\n entries: sortManagedEntries(entries),\n };\n}\n\n/** Implements read managed extension state for the public runtime surface of this module. */\nexport async function readManagedExtensionState(\n extensionsRoot: string,\n): Promise<ManagedExtensionStateReadResult> {\n const statePath = resolveManagedExtensionStatePath(extensionsRoot);\n const fallback = createEmptyManagedExtensionState();\n try {\n const raw = await fs.readFile(statePath, \"utf8\");\n const parsed = JSON.parse(raw) as unknown;\n const normalized = normalizeManagedState(parsed);\n if (!normalized) {\n throw new PmCliError(\n `Managed extension state file \"${statePath}\" has an invalid schema. Repair or remove it before mutating extension state.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return {\n path: statePath,\n state: normalized,\n warnings: [],\n };\n } catch (error: unknown) {\n if (error instanceof PmCliError) {\n throw error;\n }\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"code\" in error &&\n (error as { code?: string }).code === \"ENOENT\"\n ) {\n return {\n path: statePath,\n state: fallback,\n warnings: [],\n };\n }\n throw new PmCliError(\n `Managed extension state file \"${statePath}\" could not be read. Repair or remove it before mutating extension state.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\n/** Implements write managed extension state for the public runtime surface of this module. */\nexport async function writeManagedExtensionState(\n extensionsRoot: string,\n state: ManagedExtensionState,\n): Promise<void> {\n const statePath = resolveManagedExtensionStatePath(extensionsRoot);\n const normalized: ManagedExtensionState = {\n version: MANAGED_EXTENSION_STATE_VERSION,\n updated_at: nowIso(),\n entries: sortManagedEntries(state.entries),\n };\n await fs.mkdir(extensionsRoot, { recursive: true });\n await fs.writeFile(\n statePath,\n `${JSON.stringify(normalized, null, 2)}\\n`,\n \"utf8\",\n );\n}\n\n/** Implements upsert managed entry for the public runtime surface of this module. */\nexport function upsertManagedEntry(\n state: ManagedExtensionState,\n entry: ManagedExtensionRecord,\n): ManagedExtensionState {\n const updatedEntries = state.entries.filter(\n (candidate) =>\n normalizeExtensionNameForMatch(candidate.name) !==\n normalizeExtensionNameForMatch(entry.name) &&\n normalizeExtensionNameForMatch(candidate.directory) !==\n normalizeExtensionNameForMatch(entry.directory),\n );\n updatedEntries.push(entry);\n return {\n ...state,\n updated_at: nowIso(),\n entries: sortManagedEntries(updatedEntries),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,aAAa,CAAC;AAGrB,MAAM,gCAAgC,GAAG,0BAA0B,CAAC;AACpE,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAgF1C,qGAAqG;AACrG,MAAM,UAAU,gCAAgC,CAC9C,cAAsB;IAEtB,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,gCAAgC,CAAC,CAAC;AACrE,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,gCAAgC;IAC9C,OAAO;QACL,OAAO,EAAE,+BAA+B;QACxC,UAAU,EAAE,MAAM,EAAE;QACpB,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,kBAAkB,CAChC,OAAiC;IAEjC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAA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AM,EAAE;QACpB,OAAO,EAAE,kBAAkB,CAAC,cAAc,CAAC;KAC5C,CAAC;AACJ,CAAC","debugId":"34e6fdd1-e124-5995-81aa-0de1092d36f8"}
@@ -0,0 +1,36 @@
1
+ /** Public contract for scaffold pm min version, shared by SDK and presentation-layer consumers. */
2
+ export declare const SCAFFOLD_PM_MIN_VERSION = "2026.6.24";
3
+ /** Capability shapes the package/extension scaffolder can target via the `--capability` selector — one per SDK extension capability, so every registration surface has a runnable starter. `commands` emits the default command-only starter; `hooks` additionally wires an `after_command` lifecycle reactor; `search` wires an in-memory provider/adapter pair; `importers` wires importer and exporter command primitives so authors can customize project context movement; `schema` registers a custom item type, item field, and migration so authors can model their own project domain; `profile` registers a complete project-profile archetype (item types, statuses, fields, a workflow, config, a template, and package recommendations) via `api.registerProfile` so `pm profile apply` can tailor a tracker in one shot; `renderers` overrides how a command's output is serialized for a format; `parser` rewrites a command's parsed options before its handler runs; `preflight` adjusts pm's pre-run migration/format gate decision; and `services` overrides a built-in pm service (e.g. output formatting) — without starting from a blank extension. */
4
+ export declare const SCAFFOLD_CAPABILITIES: readonly ["commands", "hooks", "search", "importers", "schema", "profile", "renderers", "parser", "preflight", "services"];
5
+ /**
6
+ * Restricts the `--capability` selector to a {@link SCAFFOLD_CAPABILITIES} value.
7
+ */
8
+ export type ExtensionScaffoldCapability = (typeof SCAFFOLD_CAPABILITIES)[number];
9
+ interface ExtensionScaffoldFileResult {
10
+ path: string;
11
+ status: "created" | "unchanged";
12
+ }
13
+ interface ExtensionScaffoldResult {
14
+ extension_name: string;
15
+ command_name: string;
16
+ capability: ExtensionScaffoldCapability;
17
+ /** Authoring style of the generated entrypoint: `"imperative"` (a hand-written `activate` body, the default) or `"declarative"` (a `composeExtension` blueprint). The declarative style is package-mode only (any capability). */
18
+ style: ExtensionScaffoldStyle;
19
+ target_path: string;
20
+ created_directory: boolean;
21
+ files: ExtensionScaffoldFileResult[];
22
+ }
23
+ /**
24
+ * Authoring style the scaffolder targets for the generated entrypoint. The
25
+ * default `"imperative"` emits a hand-written `activate` body; `"declarative"`
26
+ * emits the SDK's `composeExtension` blueprint loop (package-mode only, for any
27
+ * capability — see {@link buildDeclarativeEntrypoint}).
28
+ */
29
+ export type ExtensionScaffoldStyle = "imperative" | "declarative";
30
+ /** Builds the starter command path from the normalized package/extension name. Names that start with a built-in pm command or executable alias are prefixed with `starter` so the generated command dispatches to the package instead of being consumed by core command parsing. */
31
+ export declare function buildScaffoldCommandName(extensionName: string): string;
32
+ /** Implements build starter extension scaffold files for the public runtime surface of this module. */
33
+ export declare function buildStarterExtensionScaffoldFiles(extensionName: string, commandName: string, vocabulary: "extension" | "package", capability?: ExtensionScaffoldCapability, declarative?: boolean): Record<string, string>;
34
+ /** Implements scaffold extension project for the public runtime surface of this module. */
35
+ export declare function scaffoldExtensionProject(target: string, vocabulary?: "extension" | "package", capability?: string, declarative?: boolean): Promise<ExtensionScaffoldResult>;
36
+ export {};