@unbrained/pm-cli 2026.7.6 → 2026.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (666) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/cli/commands/annotation-command.d.ts +1 -0
  3. package/dist/cli/commands/annotation-command.js +29 -2
  4. package/dist/cli/commands/annotation-command.js.map +1 -1
  5. package/dist/cli/commands/comments.js +3 -4
  6. package/dist/cli/commands/comments.js.map +1 -1
  7. package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
  8. package/dist/cli/commands/extension/bundled-catalog.js +38 -28
  9. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  10. package/dist/cli/commands/extension/install-sources.js +81 -18
  11. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  12. package/dist/cli/commands/health.js +9 -5
  13. package/dist/cli/commands/health.js.map +1 -1
  14. package/dist/cli/commands/learnings.js +5 -3
  15. package/dist/cli/commands/learnings.js.map +1 -1
  16. package/dist/cli/commands/notes.js +5 -3
  17. package/dist/cli/commands/notes.js.map +1 -1
  18. package/dist/cli/commands/reindex.js +4 -3
  19. package/dist/cli/commands/reindex.js.map +1 -1
  20. package/dist/cli/commands/search.js +3 -3
  21. package/dist/cli/commands/search.js.map +1 -1
  22. package/dist/cli/commands/test.d.ts +9 -0
  23. package/dist/cli/commands/test.js +144 -105
  24. package/dist/cli/commands/test.js.map +1 -1
  25. package/dist/cli/extension-command-help.js +10 -2
  26. package/dist/cli/extension-command-help.js.map +1 -1
  27. package/dist/cli/register-list-query.d.ts +1 -1
  28. package/dist/cli/register-list-query.js +18 -27
  29. package/dist/cli/register-list-query.js.map +1 -1
  30. package/dist/cli/register-operations.d.ts +0 -8
  31. package/dist/cli/register-operations.js +41 -46
  32. package/dist/cli/register-operations.js.map +1 -1
  33. package/dist/cli/register-setup.js +113 -13
  34. package/dist/cli/register-setup.js.map +1 -1
  35. package/dist/cli/registration-helpers.d.ts +5 -1
  36. package/dist/cli/registration-helpers.js +14 -2
  37. package/dist/cli/registration-helpers.js.map +1 -1
  38. package/dist/cli-bundle/chunks/append-F7WPGIQL.js +11 -0
  39. package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-PVCTBVJG.js} +8 -9
  40. package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-2APXX4TZ.js} +16 -14
  41. package/dist/cli-bundle/chunks/chunk-2APXX4TZ.js.map +1 -0
  42. package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-2LEJGRQ7.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-2TILG6F2.js} +3 -3
  44. package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-3G6UMXT3.js} +6 -8
  45. package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-3G6UMXT3.js.map} +1 -1
  46. package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-3TYOW6RR.js} +8 -8
  47. package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-3X542TEY.js} +7 -7
  48. package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-42LXP4VO.js} +12 -16
  49. package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-42LXP4VO.js.map} +1 -1
  50. package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-43SIHQND.js} +36 -15
  51. package/dist/cli-bundle/chunks/chunk-43SIHQND.js.map +7 -0
  52. package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-43UQN754.js} +10 -14
  53. package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-43UQN754.js.map} +1 -1
  54. package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-43YSKY75.js} +4 -6
  55. package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-43YSKY75.js.map} +1 -1
  56. package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-4BKDAEDF.js} +5 -5
  57. package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-4BKDAEDF.js.map} +2 -2
  58. package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-4IQKDKGE.js} +15 -23
  59. package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-4IQKDKGE.js.map} +1 -1
  60. package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-4MZOKTI2.js} +6 -8
  61. package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-4MZOKTI2.js.map} +1 -1
  62. package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-52NS7JDP.js} +14 -20
  63. package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-52NS7JDP.js.map} +1 -1
  64. package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-565WYS5W.js} +12 -16
  65. package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-565WYS5W.js.map} +1 -1
  66. package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-5FIQ4EX3.js} +12 -18
  67. package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-5FIQ4EX3.js.map} +1 -1
  68. package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-6G6O3OPQ.js} +256 -36
  69. package/dist/cli-bundle/chunks/chunk-6G6O3OPQ.js.map +1 -0
  70. package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-6LCJRGPD.js} +9 -13
  71. package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-6LCJRGPD.js.map} +1 -1
  72. package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-6UQCNWFV.js} +6 -8
  73. package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-6UQCNWFV.js.map} +1 -1
  74. package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-6XTSYPPO.js} +1216 -387
  75. package/dist/cli-bundle/chunks/chunk-6XTSYPPO.js.map +7 -0
  76. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js +5434 -0
  77. package/dist/cli-bundle/chunks/chunk-7ML7JONU.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-7PNQA24K.js} +30 -36
  79. package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-7PNQA24K.js.map} +1 -1
  80. package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-7VQ3JJN5.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-7Y5N34HX.js} +8 -12
  82. package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-7Y5N34HX.js.map} +1 -1
  83. package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-AGAVEDIE.js} +7 -7
  84. package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-AJUON7E6.js} +3 -3
  85. package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-ARKHKYYS.js} +13 -21
  86. package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-ARKHKYYS.js.map} +1 -1
  87. package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-C5ACVMOI.js} +99 -51
  88. package/dist/cli-bundle/chunks/chunk-C5ACVMOI.js.map +7 -0
  89. package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-CJQM7O7R.js} +16 -20
  90. package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-CJQM7O7R.js.map} +1 -1
  91. package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-D2DCTFTL.js} +10 -12
  92. package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-D2DCTFTL.js.map} +1 -1
  93. package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-DDDWVPID.js} +8 -10
  94. package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-DDDWVPID.js.map} +1 -1
  95. package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-DG6BSXZ7.js} +5 -5
  96. package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-DG6BSXZ7.js.map} +2 -2
  97. package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-DR2V5OIV.js} +3 -3
  98. package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-E3LWJUGF.js} +4 -6
  99. package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-E3LWJUGF.js.map} +1 -1
  100. package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-E3YQFSFE.js} +6 -10
  101. package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-E3YQFSFE.js.map} +1 -1
  102. package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EDO7VXSO.js} +2 -2
  103. package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-EIUBK2LT.js} +12 -18
  104. package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-EIUBK2LT.js.map} +1 -1
  105. package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-EMXPI36L.js} +14 -20
  106. package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-EMXPI36L.js.map} +1 -1
  107. package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-EOUVR7JN.js} +12 -8
  108. package/dist/cli-bundle/chunks/chunk-EOUVR7JN.js.map +1 -0
  109. package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-EVEPHNXJ.js} +4 -4
  110. package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-F6MT7KKE.js} +4 -6
  111. package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-F6MT7KKE.js.map} +1 -1
  112. package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-F6YC2A6X.js} +7 -11
  113. package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-F6YC2A6X.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js +5514 -0
  115. package/dist/cli-bundle/chunks/chunk-FILL6BB2.js.map +7 -0
  116. package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-FN6SB4HU.js} +2 -2
  117. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js +5359 -0
  118. package/dist/cli-bundle/chunks/chunk-GH73UOSJ.js.map +1 -0
  119. package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-GLS6VMWI.js} +37 -16
  120. package/dist/cli-bundle/chunks/chunk-GLS6VMWI.js.map +1 -0
  121. package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-GPIDUMMN.js} +9 -11
  122. package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-GPIDUMMN.js.map} +1 -1
  123. package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-GTM5HQL4.js} +11 -15
  124. package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-GTM5HQL4.js.map} +1 -1
  125. package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-H2SMKL2N.js} +8 -8
  126. package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-HHEWQXPD.js} +6 -6
  127. package/dist/cli-bundle/chunks/chunk-HHEWQXPD.js.map +7 -0
  128. package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-HX6QXV5P.js} +2 -2
  129. package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-I74FMIWA.js} +10 -16
  130. package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-I74FMIWA.js.map} +1 -1
  131. package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-IDIBF4E2.js} +20 -24
  132. package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-IDIBF4E2.js.map} +1 -1
  133. package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-II7R6KD4.js} +8 -7
  134. package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-II7R6KD4.js.map} +1 -1
  135. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js +10320 -0
  136. package/dist/cli-bundle/chunks/chunk-J2VGADNG.js.map +1 -0
  137. package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-J7BOLHAV.js} +5 -7
  138. package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-J7BOLHAV.js.map} +1 -1
  139. package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-KTGJ2CBU.js} +4 -6
  140. package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-KTGJ2CBU.js.map} +1 -1
  141. package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-LCFJ7XAM.js} +22 -2
  142. package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js.map → chunk-LCFJ7XAM.js.map} +3 -3
  143. package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-LZQU6XJG.js} +28 -34
  144. package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-LZQU6XJG.js.map} +1 -1
  145. package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-M62RO3XK.js} +10 -14
  146. package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-M62RO3XK.js.map} +1 -1
  147. package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-MCEUKJKW.js} +12 -14
  148. package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-MCEUKJKW.js.map} +1 -1
  149. package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-MHNMCDWR.js} +343 -195
  150. package/dist/cli-bundle/chunks/chunk-MHNMCDWR.js.map +1 -0
  151. package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-MRFWUSVA.js} +4 -6
  152. package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-MRFWUSVA.js.map} +1 -1
  153. package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-N6ZHDLUY.js} +6 -8
  154. package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-N6ZHDLUY.js.map} +1 -1
  155. package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-NWWL22C7.js} +7 -9
  156. package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-NWWL22C7.js.map} +1 -1
  157. package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-P3MJJW7P.js} +2 -2
  158. package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-PDXJXEZJ.js} +2 -2
  159. package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-Q64AYQYW.js} +10 -12
  160. package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-Q64AYQYW.js.map} +1 -1
  161. package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-QDABF2RB.js} +26 -34
  162. package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-QDABF2RB.js.map} +1 -1
  163. package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-QFBSP3NI.js} +529 -46
  164. package/dist/cli-bundle/chunks/chunk-QFBSP3NI.js.map +1 -0
  165. package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-RB3KLPAH.js} +10 -14
  166. package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-RB3KLPAH.js.map} +1 -1
  167. package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-RY7PTTUB.js} +94 -53
  168. package/dist/cli-bundle/chunks/chunk-RY7PTTUB.js.map +1 -0
  169. package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-S547WBYG.js} +343 -195
  170. package/dist/cli-bundle/chunks/chunk-S547WBYG.js.map +7 -0
  171. package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-S5BNGFN5.js} +24 -32
  172. package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-S5BNGFN5.js.map} +1 -1
  173. package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-S6VC2A2K.js} +8 -12
  174. package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-S6VC2A2K.js.map} +1 -1
  175. package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-SIM5JDON.js} +6 -6
  176. package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-SIM5JDON.js.map} +1 -1
  177. package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-SY75LYXR.js} +11 -7
  178. package/dist/cli-bundle/chunks/chunk-SY75LYXR.js.map +7 -0
  179. package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-TEISGNSH.js} +7 -7
  180. package/dist/cli-bundle/chunks/chunk-TEISGNSH.js.map +1 -0
  181. package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-TEKZOS7M.js} +2 -2
  182. package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-TGUK6XN6.js} +14 -18
  183. package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-TGUK6XN6.js.map} +1 -1
  184. package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-TNC6MZUD.js} +8 -12
  185. package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-TNC6MZUD.js.map} +1 -1
  186. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js +10498 -0
  187. package/dist/cli-bundle/chunks/chunk-TZLYO4PP.js.map +7 -0
  188. package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-UO7XAZK6.js} +17 -4
  189. package/dist/cli-bundle/chunks/chunk-UO7XAZK6.js.map +1 -0
  190. package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-V5ZWKJNY.js} +2 -2
  191. package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-VGO73OCK.js} +6 -6
  192. package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-VGO73OCK.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-VLEA2UTQ.js} +2 -2
  194. package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-W5HXHC7C.js} +7 -9
  195. package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-W5HXHC7C.js.map} +1 -1
  196. package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-WCWVEXGA.js} +2 -2
  197. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js +6690 -0
  198. package/dist/cli-bundle/chunks/chunk-X47MKQXU.js.map +7 -0
  199. package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-XBX5CBRQ.js} +5 -7
  200. package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-XBX5CBRQ.js.map} +1 -1
  201. package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XC3X7BQR.js} +541 -44
  202. package/dist/cli-bundle/chunks/chunk-XC3X7BQR.js.map +7 -0
  203. package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-XHCVAZGM.js} +13 -17
  204. package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-XHCVAZGM.js.map} +1 -1
  205. package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-XPMXPR7K.js} +7 -9
  206. package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-XPMXPR7K.js.map} +1 -1
  207. package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-XS2TMNXR.js} +6 -8
  208. package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-XS2TMNXR.js.map} +1 -1
  209. package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-XXIYUTLK.js} +10 -14
  210. package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-XXIYUTLK.js.map} +1 -1
  211. package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-XZWL7VNE.js} +1220 -398
  212. package/dist/cli-bundle/chunks/chunk-XZWL7VNE.js.map +1 -0
  213. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js +6624 -0
  214. package/dist/cli-bundle/chunks/chunk-Y5IKRUEM.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-Y7KYVCZM.js} +12 -18
  216. package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-Y7KYVCZM.js.map} +1 -1
  217. package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-YCVWWIKY.js} +16 -14
  218. package/dist/cli-bundle/chunks/chunk-YCVWWIKY.js.map +7 -0
  219. package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-YH5NBDFA.js} +22 -26
  220. package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-YH5NBDFA.js.map} +1 -1
  221. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js +5509 -0
  222. package/dist/cli-bundle/chunks/chunk-YNCFP5AR.js.map +7 -0
  223. package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-YPD7SQ5P.js} +7 -6
  224. package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-YPD7SQ5P.js.map} +2 -2
  225. package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-YPMZMKN7.js} +2 -2
  226. package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-YTD5GICJ.js} +4 -4
  227. package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-ZNEG2UDO.js} +261 -34
  228. package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-ZNEG2UDO.js.map} +4 -4
  229. package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-ZO7CLOY2.js} +3 -3
  230. package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-3YYQ5OG2.js} +5 -9
  231. package/dist/cli-bundle/chunks/close-Z3Q4U7TS.js +12 -0
  232. package/dist/cli-bundle/chunks/close-many-3L2RXH3M.js +22 -0
  233. package/dist/cli-bundle/chunks/close-many-D366FTIG.js +26 -0
  234. package/dist/cli-bundle/chunks/comments-54XDJNFE.js +17 -0
  235. package/dist/cli-bundle/chunks/comments-HGHC2PN6.js +13 -0
  236. package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-44RT5GDW.js} +4 -8
  237. package/dist/cli-bundle/chunks/copy-UGMUGHZA.js +9 -0
  238. package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-4GWJWPXG.js} +9 -14
  239. package/dist/cli-bundle/chunks/create-AZXCUYKP.js +25 -0
  240. package/dist/cli-bundle/chunks/delete-Y6SXIQ4X.js +10 -0
  241. package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-YQ2VPXNF.js} +4 -8
  242. package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-BU5EBJDU.js} +4 -8
  243. package/dist/cli-bundle/chunks/deps-FMANWFRP.js +13 -0
  244. package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-OQBSJNIA.js} +6 -10
  245. package/dist/cli-bundle/chunks/docs-VNPBZXEL.js +14 -0
  246. package/dist/cli-bundle/chunks/files-72HZEBOE.js +18 -0
  247. package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-HTSB2KJG.js} +6 -10
  248. package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-FOG4ALC2.js} +7 -9
  249. package/dist/cli-bundle/chunks/focus-SUTMKXGX.js +10 -0
  250. package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-M6IFAMBP.js} +9 -13
  251. package/dist/cli-bundle/chunks/history-compact-NEXRPP2O.js +21 -0
  252. package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-NQX3OGZP.js} +7 -11
  253. package/dist/cli-bundle/chunks/history-redact-WQJBZ3PX.js +17 -0
  254. package/dist/cli-bundle/chunks/history-repair-CBHMHAJO.js +19 -0
  255. package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-NHOJG7WO.js} +9 -13
  256. package/dist/cli-bundle/chunks/learnings-M64NTSOR.js +13 -0
  257. package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-T63JGKKN.js} +9 -11
  258. package/dist/cli-bundle/chunks/notes-73WE2UV2.js +13 -0
  259. package/dist/cli-bundle/chunks/notes-U7L6HQQ2.js +17 -0
  260. package/dist/cli-bundle/chunks/plan-OSCNYFGC.js +24 -0
  261. package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-TN537L24.js} +10 -15
  262. package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-MHAMXMHQ.js} +9 -13
  263. package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-TIGLAKJ7.js} +9 -13
  264. package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-OHXD7G5N.js} +41 -33
  265. package/dist/cli-bundle/chunks/register-list-query-OHXD7G5N.js.map +7 -0
  266. package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-ZCRABAPN.js} +42 -34
  267. package/dist/cli-bundle/chunks/register-list-query-ZCRABAPN.js.map +1 -0
  268. package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-P3G4XP6Q.js} +36 -41
  269. package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-P3G4XP6Q.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-XX4H56PE.js} +34 -39
  271. package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-XX4H56PE.js.map} +1 -1
  272. package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-V6PIYEDU.js} +79 -46
  273. package/dist/cli-bundle/chunks/register-operations-V6PIYEDU.js.map +1 -0
  274. package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-V6VKTG54.js} +78 -45
  275. package/dist/cli-bundle/chunks/register-operations-V6VKTG54.js.map +7 -0
  276. package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-6RVAWT6W.js} +129 -29
  277. package/dist/cli-bundle/chunks/register-setup-6RVAWT6W.js.map +7 -0
  278. package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-6YVUSQYD.js} +130 -30
  279. package/dist/cli-bundle/chunks/register-setup-6YVUSQYD.js.map +1 -0
  280. package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-HC3YSWF7.js} +7 -11
  281. package/dist/cli-bundle/chunks/restore-LFAMMRYZ.js +15 -0
  282. package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DAGSYO6E.js} +6 -10
  283. package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-UBXJCQAC.js} +6 -10
  284. package/dist/cli-bundle/chunks/update-CJGG5WMV.js +21 -0
  285. package/dist/cli-bundle/chunks/update-LKD64AFP.js +25 -0
  286. package/dist/cli-bundle/chunks/update-many-G4SM7BHC.js +31 -0
  287. package/dist/cli-bundle/chunks/update-many-VLIV3D7R.js +35 -0
  288. package/dist/cli-bundle/main.js +29 -31
  289. package/dist/cli-bundle/main.js.map +2 -2
  290. package/dist/cli-bundle/sdk-runtime.js +129 -107
  291. package/dist/cli-bundle/sdk-testing.js +7 -8
  292. package/dist/cli-bundle/sdk.js +122 -117
  293. package/dist/cli-bundle/sdk.js.map +2 -2
  294. package/dist/core/history/drift-scan.js +3 -8
  295. package/dist/core/history/drift-scan.js.map +1 -1
  296. package/dist/core/output/mutation-projection.js +11 -5
  297. package/dist/core/output/mutation-projection.js.map +1 -1
  298. package/dist/core/search/cache.js +3 -3
  299. package/dist/core/search/cache.js.map +1 -1
  300. package/dist/core/search/semantic-defaults.d.ts +2 -0
  301. package/dist/core/search/semantic-defaults.js +11 -4
  302. package/dist/core/search/semantic-defaults.js.map +1 -1
  303. package/dist/core/search/vector-stores.d.ts +1 -1
  304. package/dist/core/search/vector-stores.js +33 -7
  305. package/dist/core/search/vector-stores.js.map +1 -1
  306. package/dist/mcp/server.d.ts +1 -1
  307. package/dist/sdk/cli-contracts/flag-contracts.js +7 -7
  308. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  309. package/dist/sdk/cli-contracts/tool-schema.js +9 -7
  310. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  311. package/dist/sdk/index.d.ts +1 -1
  312. package/dist/sdk/index.js +3 -3
  313. package/dist/sdk/index.js.map +1 -1
  314. package/dist/sdk/runtime.d.ts +151 -8
  315. package/dist/sdk/runtime.js +255 -14
  316. package/dist/sdk/runtime.js.map +1 -1
  317. package/dist/sdk/start-task-status.d.ts +13 -0
  318. package/dist/sdk/start-task-status.js +19 -0
  319. package/dist/sdk/start-task-status.js.map +1 -0
  320. package/docs/COMMANDS.md +10 -1
  321. package/docs/SDK.md +35 -0
  322. package/docs/TESTING.md +3 -0
  323. package/package.json +1 -1
  324. package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
  325. package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
  326. package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
  327. package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
  328. package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
  329. package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
  330. package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
  331. package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
  332. package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
  333. package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
  334. package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
  335. package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
  336. package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
  337. package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
  338. package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
  339. package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
  340. package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
  341. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
  342. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
  343. package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
  344. package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
  345. package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
  346. package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
  347. package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
  348. package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
  349. package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
  350. package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
  351. package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
  352. package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
  353. package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
  354. package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
  355. package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
  356. package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
  357. package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
  358. package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
  359. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
  360. package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
  361. package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
  362. package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
  363. package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
  364. package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
  365. package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
  366. package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
  367. package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
  368. package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
  369. package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
  370. package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
  371. package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
  372. package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
  373. package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
  374. package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
  375. package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
  376. package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
  377. package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
  378. package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
  379. package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
  380. package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
  381. package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
  382. package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
  383. package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
  384. package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
  385. package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
  386. package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
  387. package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
  388. package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
  389. package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
  390. package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
  391. package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
  392. package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
  393. package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
  394. package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
  395. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
  396. package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
  397. package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
  398. package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
  399. package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
  400. package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
  401. package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
  402. package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
  403. package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
  404. package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
  405. package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
  406. package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
  407. package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
  408. package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
  409. package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
  410. package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
  411. package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
  412. package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
  413. package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
  414. package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
  415. package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
  416. package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
  417. package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
  418. package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
  419. package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
  420. package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
  421. package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
  422. package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
  423. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
  424. package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
  425. package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
  426. package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
  427. package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
  428. package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
  429. package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
  430. package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
  431. package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
  432. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
  433. package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
  434. package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
  435. package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
  436. package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
  437. package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
  438. package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
  439. package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
  440. package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
  441. package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
  442. package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
  443. package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
  444. package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
  445. package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
  446. package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
  447. package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
  448. package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
  449. package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
  450. package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
  451. package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
  452. package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
  453. package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
  454. package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
  455. package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
  456. package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
  457. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
  458. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
  459. package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
  460. package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
  461. package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
  462. package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
  463. package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
  464. package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
  465. package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
  466. package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
  467. package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
  468. package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
  469. package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
  470. package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
  471. package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
  472. package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
  473. package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
  474. package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
  475. package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
  476. package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
  477. package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
  478. package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
  479. package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
  480. package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
  481. package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
  482. package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
  483. package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
  484. package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
  485. package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
  486. package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
  487. package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
  488. package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
  489. package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
  490. package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
  491. package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
  492. package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
  493. package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
  494. package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
  495. package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
  496. package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
  497. package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
  498. package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
  499. package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
  500. package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
  501. package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
  502. package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
  503. package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
  504. package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
  505. package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
  506. package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
  507. package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
  508. package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
  509. package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
  510. package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
  511. package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
  512. package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
  513. package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
  514. package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
  515. package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
  516. package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
  517. package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
  518. package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
  519. package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
  520. package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
  521. package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
  522. package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
  523. package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
  524. package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
  525. package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
  526. package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
  527. package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
  528. package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
  529. package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
  530. package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
  531. package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
  532. package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
  533. package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
  534. package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
  535. package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
  536. package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
  537. package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
  538. package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
  539. package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
  540. package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
  541. package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
  542. package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
  543. package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
  544. package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
  545. package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
  546. package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
  547. package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
  548. package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
  549. package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
  550. package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
  551. package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
  552. package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
  553. package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
  554. package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
  555. package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
  556. package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
  557. package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
  558. package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
  559. package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
  560. package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
  561. package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
  562. package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
  563. package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
  564. package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
  565. package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
  566. package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
  567. package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
  568. package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
  569. package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
  570. package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
  571. package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
  572. package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
  573. package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
  574. package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
  575. package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
  576. package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
  577. package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
  578. package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
  579. package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
  580. package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
  581. package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
  582. package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
  583. package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
  584. package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
  585. package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
  586. package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
  587. package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
  588. package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
  589. package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
  590. package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
  591. package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
  592. package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
  593. package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
  594. package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
  595. package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
  596. package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
  597. package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
  598. package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
  599. package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
  600. package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
  601. /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-F7WPGIQL.js.map} +0 -0
  602. /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-PVCTBVJG.js.map} +0 -0
  603. /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-2LEJGRQ7.js.map} +0 -0
  604. /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-2TILG6F2.js.map} +0 -0
  605. /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-3TYOW6RR.js.map} +0 -0
  606. /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-3X542TEY.js.map} +0 -0
  607. /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-7VQ3JJN5.js.map} +0 -0
  608. /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-AGAVEDIE.js.map} +0 -0
  609. /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-AJUON7E6.js.map} +0 -0
  610. /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-DR2V5OIV.js.map} +0 -0
  611. /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EDO7VXSO.js.map} +0 -0
  612. /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-EVEPHNXJ.js.map} +0 -0
  613. /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-FN6SB4HU.js.map} +0 -0
  614. /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-H2SMKL2N.js.map} +0 -0
  615. /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-HX6QXV5P.js.map} +0 -0
  616. /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-P3MJJW7P.js.map} +0 -0
  617. /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-PDXJXEZJ.js.map} +0 -0
  618. /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-TEKZOS7M.js.map} +0 -0
  619. /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-V5ZWKJNY.js.map} +0 -0
  620. /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-VLEA2UTQ.js.map} +0 -0
  621. /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-WCWVEXGA.js.map} +0 -0
  622. /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-YPMZMKN7.js.map} +0 -0
  623. /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-YTD5GICJ.js.map} +0 -0
  624. /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-ZO7CLOY2.js.map} +0 -0
  625. /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-3YYQ5OG2.js.map} +0 -0
  626. /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-Z3Q4U7TS.js.map} +0 -0
  627. /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-3L2RXH3M.js.map} +0 -0
  628. /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-D366FTIG.js.map} +0 -0
  629. /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-54XDJNFE.js.map} +0 -0
  630. /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-HGHC2PN6.js.map} +0 -0
  631. /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-44RT5GDW.js.map} +0 -0
  632. /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-UGMUGHZA.js.map} +0 -0
  633. /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-4GWJWPXG.js.map} +0 -0
  634. /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AZXCUYKP.js.map} +0 -0
  635. /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-Y6SXIQ4X.js.map} +0 -0
  636. /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-YQ2VPXNF.js.map} +0 -0
  637. /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-BU5EBJDU.js.map} +0 -0
  638. /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-FMANWFRP.js.map} +0 -0
  639. /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-OQBSJNIA.js.map} +0 -0
  640. /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-VNPBZXEL.js.map} +0 -0
  641. /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-72HZEBOE.js.map} +0 -0
  642. /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-HTSB2KJG.js.map} +0 -0
  643. /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-FOG4ALC2.js.map} +0 -0
  644. /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-SUTMKXGX.js.map} +0 -0
  645. /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-M6IFAMBP.js.map} +0 -0
  646. /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-NEXRPP2O.js.map} +0 -0
  647. /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-NQX3OGZP.js.map} +0 -0
  648. /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-WQJBZ3PX.js.map} +0 -0
  649. /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-CBHMHAJO.js.map} +0 -0
  650. /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-NHOJG7WO.js.map} +0 -0
  651. /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-M64NTSOR.js.map} +0 -0
  652. /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-T63JGKKN.js.map} +0 -0
  653. /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-73WE2UV2.js.map} +0 -0
  654. /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-U7L6HQQ2.js.map} +0 -0
  655. /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-OSCNYFGC.js.map} +0 -0
  656. /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-TN537L24.js.map} +0 -0
  657. /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-MHAMXMHQ.js.map} +0 -0
  658. /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-TIGLAKJ7.js.map} +0 -0
  659. /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-HC3YSWF7.js.map} +0 -0
  660. /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-LFAMMRYZ.js.map} +0 -0
  661. /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DAGSYO6E.js.map} +0 -0
  662. /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-UBXJCQAC.js.map} +0 -0
  663. /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-CJGG5WMV.js.map} +0 -0
  664. /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-LKD64AFP.js.map} +0 -0
  665. /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-G4SM7BHC.js.map} +0 -0
  666. /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-VLIV3D7R.js.map} +0 -0
@@ -1,2257 +0,0 @@
1
- import {
2
- EXECUTABLE_COMMAND_ALIASES,
3
- normalizeExtensionNameForMatch,
4
- normalizeManagedDirectoryName
5
- } from "./chunk-KGFUY7WN.js";
6
- import {
7
- PM_CORE_COMMAND_NAMES
8
- } from "./chunk-VIIUS6N6.js";
9
- import {
10
- describeExtensionActivation,
11
- renderExtensionSurfaceMarkdown
12
- } from "./chunk-EGY6JBQ3.js";
13
- import {
14
- PmCliError
15
- } from "./chunk-SHQY2IDC.js";
16
- import {
17
- EXIT_CODE,
18
- pathExists
19
- } from "./chunk-LK6XLOGP.js";
20
-
21
- // dist/cli/commands/extension/scaffold.js
22
- import fs from "node:fs/promises";
23
- import path from "node:path";
24
- !(function() {
25
- try {
26
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
27
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "41f2ec97-a92c-5a0d-a117-ffea360fad5c");
28
- } catch (e2) {
29
- }
30
- })();
31
- var SCAFFOLD_MANIFEST_VERSION = 1;
32
- var SCAFFOLD_PM_MIN_VERSION = "2026.6.24";
33
- var SCAFFOLD_NODE_ENGINE = ">=22.18.0";
34
- var SCAFFOLD_DECLARED_PERMISSIONS = {
35
- fs_read: false,
36
- fs_write: false,
37
- network: false,
38
- env_read: false,
39
- env_write: false,
40
- process_spawn: false
41
- };
42
- var RESERVED_SCAFFOLD_COMMAND_ROOTS = /* @__PURE__ */ new Set([
43
- ...PM_CORE_COMMAND_NAMES.map((commandName) => commandName.split("-")[0].toLowerCase()),
44
- ...Object.keys(EXECUTABLE_COMMAND_ALIASES).map((alias) => alias.toLowerCase()),
45
- // "scaffold" is a Commander command that currently lives outside both
46
- // PM_CORE_COMMAND_NAMES and EXECUTABLE_COMMAND_ALIASES.
47
- "scaffold"
48
- ]);
49
- var SCAFFOLD_TYPESCRIPT_VERSION = "^6.0.0";
50
- var SCAFFOLD_TYPES_NODE_VERSION = "^22.0.0";
51
- var SAMPLE_HARNESS_CLEANUP_LINES = [
52
- "type StarterHarness = Awaited<ReturnType<typeof createExtensionTestHarness>>;",
53
- "",
54
- "async function deactivateIfNeeded(ext: StarterHarness, deactivated: boolean): Promise<void> {",
55
- " if (!deactivated) {",
56
- " try {",
57
- " await ext.deactivate();",
58
- " } catch {",
59
- " // Preserve the original assertion error; cleanup is best effort.",
60
- " }",
61
- " }",
62
- "}",
63
- ""
64
- ];
65
- var SAMPLE_HARNESS_FINALLY_LINES = [
66
- " } finally {",
67
- " await deactivateIfNeeded(ext, deactivated);",
68
- " }"
69
- ];
70
- function indentGeneratedLines(lines, prefix) {
71
- return lines.map((line) => line === "" ? line : `${prefix}${line}`);
72
- }
73
- function buildSchemaCapabilityAssertionLines(options) {
74
- const migrationHint = options.includeMigrationReplacementHint === true ? [" // as your migration grows."] : [];
75
- return [
76
- " // assertItemType/Field/Migration throw unless the registration is present, so",
77
- " // reaching each next line already proves the wiring; assert on the returned",
78
- " // definitions to demonstrate inspecting registered metadata.",
79
- ` const itemType = ext.assertItemType({ itemType: ${JSON.stringify(options.itemTypeName)}, extensionName: ${JSON.stringify(options.extensionName)} });`,
80
- ` assert.equal(itemType.itemType.folder, ${JSON.stringify(options.itemTypeFolder)});`,
81
- ` const itemField = ext.assertItemField({ field: ${JSON.stringify(options.fieldName)}, extensionName: ${JSON.stringify(options.extensionName)} });`,
82
- ' assert.equal(itemField.field.type, "string");',
83
- ` ext.assertMigration({ migration: ${JSON.stringify(options.migrationId)}, extensionName: ${JSON.stringify(options.extensionName)}, mandatory: false });`,
84
- "",
85
- " // runMigration invokes the migration through pm's real runner with a synthetic",
86
- " // context and returns its result.",
87
- ...migrationHint,
88
- ` const migrated = await ext.runMigration({ migration: ${JSON.stringify(options.migrationId)} });`,
89
- ` assert.deepEqual(migrated, { migrated: true, id: ${JSON.stringify(options.migrationId)} });`
90
- ];
91
- }
92
- function buildProfileCapabilityAssertionLines(extensionName) {
93
- return [
94
- " // assertProfile throws unless the profile is registered, so reaching the next",
95
- " // line already proves the wiring; assert on the returned definition to inspect",
96
- " // the bundled archetype dimensions.",
97
- ` const { profile } = ext.assertProfile({ profile: ${JSON.stringify(extensionName)}, extensionName: ${JSON.stringify(extensionName)} });`,
98
- ` assert.equal(profile.title, ${JSON.stringify(`${extensionName} archetype`)});`,
99
- " assert.equal(profile.types.length, 1);",
100
- " assert.equal(profile.workflows.length, 1);"
101
- ];
102
- }
103
- var SCAFFOLD_TSCONFIG = {
104
- compilerOptions: {
105
- target: "ES2022",
106
- module: "NodeNext",
107
- moduleResolution: "NodeNext",
108
- strict: true,
109
- esModuleInterop: true,
110
- skipLibCheck: true,
111
- noEmit: true,
112
- allowImportingTsExtensions: true,
113
- // `node:test`/`node:assert` in the colocated test (and Node globals) resolve
114
- // from `@types/node`; name it explicitly so it is loaded regardless of how the
115
- // package manager lays out `node_modules/@types`.
116
- types: ["node"]
117
- },
118
- // Recursive so a package that grows into subdirectory `*.ts` modules still
119
- // type-checks; tsc excludes `node_modules` by default.
120
- include: ["**/*.ts"]
121
- };
122
- var SCAFFOLD_CAPABILITIES = [
123
- "commands",
124
- "hooks",
125
- "search",
126
- "importers",
127
- "schema",
128
- "profile",
129
- "renderers",
130
- "parser",
131
- "preflight",
132
- "services"
133
- ];
134
- var SCAFFOLD_MANIFEST_CAPABILITIES = {
135
- commands: ["commands"],
136
- hooks: ["commands", "hooks"],
137
- search: ["commands", "search"],
138
- importers: ["commands", "schema", "importers"],
139
- schema: ["commands", "schema"],
140
- // A profile registration IS a schema+config bundle, so the loader gate requires
141
- // the `schema` capability (no separate `profile` capability) — same grant as the
142
- // schema starter, mirroring the bundled pm-kanban exemplar.
143
- profile: ["commands", "schema"],
144
- renderers: ["commands", "renderers"],
145
- // The parser starter declares `--shout`/`--upper` command flags so the
146
- // override is runnable through `pm <command> --shout`; flag metadata is
147
- // schema-governed, so the manifest also declares `schema`.
148
- parser: ["commands", "parser", "schema"],
149
- preflight: ["commands", "preflight"],
150
- services: ["commands", "services"]
151
- };
152
- var SAMPLE_TEST_CAPABILITIES_LITERAL = {
153
- commands: '["commands"]',
154
- hooks: '["commands", "hooks"]',
155
- search: '["commands", "search"]',
156
- importers: '["commands", "schema", "importers"]',
157
- schema: '["commands", "schema"]',
158
- profile: '["commands", "schema"]',
159
- renderers: '["commands", "renderers"]',
160
- parser: '["commands", "parser", "schema"]',
161
- preflight: '["commands", "preflight"]',
162
- services: '["commands", "services"]'
163
- };
164
- var ENTRYPOINT_BULLETS = {
165
- commands: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration plus a `deactivate` teardown stub.",
166
- hooks: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, an `after_command` lifecycle hook, and a `deactivate` teardown stub.",
167
- search: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, a search provider, a vector-store adapter, and a `deactivate` teardown stub.",
168
- importers: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, importer/exporter command registrations, and a `deactivate` teardown stub.",
169
- schema: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, a custom item type, a custom item field, a schema migration, and a `deactivate` teardown stub.",
170
- profile: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, a project profile (item types, statuses, fields, a workflow, config, a template, and package recommendations) registered via `api.registerProfile`, and a `deactivate` teardown stub.",
171
- renderers: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, a `toon` output renderer override, and a `deactivate` teardown stub.",
172
- parser: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, a parser override that rewrites the command's parsed options, and a `deactivate` teardown stub.",
173
- preflight: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, a preflight override over pm's pre-run gate decision, and a `deactivate` teardown stub.",
174
- services: "- `index.ts`: the TypeScript manifest entry \u2014 starter command registration, an `output_format` service override, and a `deactivate` teardown stub."
175
- };
176
- var SAMPLE_TEST_BULLETS = {
177
- commands: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, and teardown via the SDK testing helpers.",
178
- hooks: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, the after_command hook, and teardown via the SDK testing helpers.",
179
- search: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, search provider/vector adapter invocation, and teardown via the SDK testing helpers.",
180
- importers: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, importer/exporter invocation, and teardown via the SDK testing helpers.",
181
- schema: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, item type/field/migration registration, migration invocation, and teardown via the SDK testing helpers.",
182
- profile: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, project-profile registration (asserting the bundled archetype dimensions), and teardown via the SDK testing helpers.",
183
- renderers: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, renderer override registration and invocation (including format pass-through), and teardown via the SDK testing helpers.",
184
- parser: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, parser override registration and the option rewrite it produces, and teardown via the SDK testing helpers.",
185
- preflight: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, preflight override registration and the gate decision it returns, and teardown via the SDK testing helpers.",
186
- services: "- `index.test.ts`: sample `node:test` suite covering activation, command invocation, service override registration and invocation (including command pass-through), and teardown via the SDK testing helpers."
187
- };
188
- var TSCONFIG_BULLET = "- `tsconfig.json`: strict type-check-only TypeScript config (`noEmit`) for the `.ts` source the loader runs directly.";
189
- var PACKAGE_CAPABILITY_README_SECTIONS = {
190
- commands: [],
191
- hooks: [
192
- "",
193
- "## Lifecycle Hook",
194
- "`index.ts` registers an `after_command` hook via `api.hooks.afterCommand`.",
195
- "pm fires it once a command finishes, passing the command outcome and the",
196
- "items it mutated (`context.affected`). React there to keep external context",
197
- "in sync - sync records, emit telemetry, or refresh derived state. The",
198
- "`hooks` capability in `manifest.json` is what grants the hook registration;",
199
- "remove it (and the hook) if your package only needs commands."
200
- ],
201
- search: [
202
- "",
203
- "## Search Provider",
204
- "`index.ts` registers a deterministic in-memory search provider and",
205
- "vector-store adapter through `api.registerSearchProvider` and",
206
- "`api.registerVectorStoreAdapter`. Replace the sample scoring,",
207
- "embedding, and storage behavior with your project-specific retrieval",
208
- "logic. The `search` capability in `manifest.json` grants both",
209
- "registrations."
210
- ],
211
- importers: [
212
- "",
213
- "## Importer and Exporter",
214
- "`index.ts` registers paired project-context import/export commands through",
215
- "`api.registerImporter` and `api.registerExporter`. Replace the starter",
216
- "payloads with your domain adapter: GitHub issues, CSV rows, documents,",
217
- "tickets, or another project-management source of truth. The `importers`",
218
- "capability grants both registrations, and `schema` grants the example",
219
- "command flag metadata."
220
- ],
221
- schema: [
222
- "",
223
- "## Custom Schema",
224
- "`index.ts` models a project domain by registering a custom item type, a",
225
- "custom item field, and a schema migration through `api.registerItemTypes`,",
226
- "`api.registerItemFields`, and `api.registerMigration`. This is how a package",
227
- "turns pm into a domain-specific tracker \u2014 `project management = context",
228
- "management`. Replace the sample type/field/migration with your own domain",
229
- "model; the `schema` capability in `manifest.json` grants all three",
230
- "registrations. Once installed, the custom type is usable everywhere, e.g.",
231
- '`pm create <type> "<title>"` and `pm list --type <type>`.'
232
- ],
233
- profile: [
234
- "",
235
- "## Project Profile",
236
- "`index.ts` registers a complete project-profile archetype through",
237
- "`api.registerProfile`. A profile is the broadest customization primitive pm",
238
- "has \u2014 one declarative bundle of item types, custom statuses, fields, a per-type",
239
- "workflow, config knobs, create templates, and package recommendations. Once the",
240
- "package is installed the profile resolves by name through `pm profile list`,",
241
- "`pm profile show <name>`, and `pm profile apply <name>`, which stages every",
242
- "dimension idempotently \u2014 exactly like a core archetype (agile/ops/research),",
243
- "with no consumer code required. Replace the sample archetype with your own",
244
- "domain; the `schema` capability in `manifest.json` grants the registration (a",
245
- "profile is a schema+config bundle, so it needs no separate capability)."
246
- ],
247
- renderers: [
248
- "",
249
- "## Output Renderer",
250
- "`index.ts` registers a `toon` output renderer override through",
251
- "`api.registerRenderer`. Renderer overrides run for every command's output in",
252
- "that format, so this starter scopes itself to THIS package's own command and",
253
- "returns `null` (pass-through to pm's default renderer) for everything else.",
254
- "Return a string to take over rendering. Replace the sample serialization with",
255
- "your own; the `renderers` capability in `manifest.json` grants the",
256
- "registration."
257
- ],
258
- parser: [
259
- "",
260
- "## Parser Override",
261
- "`index.ts` registers a parser override for the starter command through",
262
- "`api.registerParser`. pm runs it on the command's parsed options BEFORE the",
263
- "handler, merging the delta you return. This starter rewrites a deprecated",
264
- "`--shout` alias to the canonical `--upper` flag; replace it with your",
265
- "command's real normalization. The `parser` capability in `manifest.json`",
266
- "grants the registration."
267
- ],
268
- preflight: [
269
- "",
270
- "## Preflight Override",
271
- "`index.ts` registers a preflight override through `api.registerPreflight`. pm",
272
- "calls it before every command to compute the migration/format gate decision \u2014",
273
- "the last registered override wins. Return only the decision keys you want to",
274
- "change; this starter echoes the current decision unchanged (a safe no-op) so",
275
- "installing the package does not alter gate behavior. The `preflight`",
276
- "capability in `manifest.json` grants the registration."
277
- ],
278
- services: [
279
- "",
280
- "## Service Override",
281
- "`index.ts` overrides the built-in `output_format` service through",
282
- "`api.registerService`. The service renders a command's structured result;",
283
- "returning the payload unchanged passes through to pm's default formatting.",
284
- "This starter scopes itself to THIS package's own command and passes every",
285
- "other command through, so it never disrupts unrelated output. The `services`",
286
- "capability in `manifest.json` grants the registration."
287
- ]
288
- };
289
- var EXTENSION_CAPABILITY_README_SECTIONS = {
290
- commands: [],
291
- hooks: [
292
- "",
293
- "## Lifecycle Hook",
294
- "`index.ts` registers an `after_command` hook via `api.hooks.afterCommand`.",
295
- "pm fires it once a command finishes, passing the command outcome and the",
296
- "items it mutated (`context.affected`). React there to keep external context",
297
- "in sync. The `hooks` capability in `manifest.json` grants the registration;",
298
- "remove it (and the hook) if your extension only needs commands."
299
- ],
300
- search: [
301
- "",
302
- "## Search Provider",
303
- "`index.ts` registers a deterministic in-memory search provider and",
304
- "vector-store adapter through `api.registerSearchProvider` and",
305
- "`api.registerVectorStoreAdapter`. Replace the sample scoring, embedding,",
306
- "and storage behavior with your project-specific retrieval logic. The",
307
- "`search` capability in `manifest.json` grants both registrations."
308
- ],
309
- importers: [
310
- "",
311
- "## Importer and Exporter",
312
- "`index.ts` registers paired project-context import/export commands through",
313
- "`api.registerImporter` and `api.registerExporter`. Replace the starter",
314
- "payloads with your domain adapter. The `importers` capability grants both",
315
- "registrations, and `schema` grants the example command flag metadata."
316
- ],
317
- schema: [
318
- "",
319
- "## Custom Schema",
320
- "`index.ts` models a project domain by registering a custom item type, a",
321
- "custom item field, and a schema migration through `api.registerItemTypes`,",
322
- "`api.registerItemFields`, and `api.registerMigration`. Replace the sample",
323
- "type/field/migration with your own domain model; the `schema` capability in",
324
- "`manifest.json` grants all three registrations. Once installed, the custom",
325
- 'type is usable everywhere, e.g. `pm create <type> "<title>"`.'
326
- ],
327
- profile: [
328
- "",
329
- "## Project Profile",
330
- "`index.ts` registers a complete project-profile archetype through",
331
- "`api.registerProfile` \u2014 one declarative bundle of item types, custom statuses,",
332
- "fields, a per-type workflow, config knobs, create templates, and package",
333
- "recommendations. Once installed the profile resolves by name through",
334
- "`pm profile list`, `pm profile show <name>`, and `pm profile apply <name>`,",
335
- "which stages every dimension idempotently like a core archetype. Replace the",
336
- "sample archetype with your own domain; the `schema` capability in",
337
- "`manifest.json` grants the registration."
338
- ],
339
- renderers: [
340
- "",
341
- "## Output Renderer",
342
- "`index.ts` registers a `toon` output renderer override through",
343
- "`api.registerRenderer`. Renderer overrides run for every command's output in",
344
- "that format, so this starter scopes itself to its own command and returns",
345
- "`null` (pass-through to pm's default renderer) for everything else. Replace",
346
- "the sample serialization with your own; the `renderers` capability in",
347
- "`manifest.json` grants the registration."
348
- ],
349
- parser: [
350
- "",
351
- "## Parser Override",
352
- "`index.ts` registers a parser override for the starter command through",
353
- "`api.registerParser`. pm runs it on the command's parsed options BEFORE the",
354
- "handler, merging the delta you return. This starter rewrites a deprecated",
355
- "`--shout` alias to the canonical `--upper` flag; replace it with your own",
356
- "normalization. The `parser` capability in `manifest.json` grants the",
357
- "registration."
358
- ],
359
- preflight: [
360
- "",
361
- "## Preflight Override",
362
- "`index.ts` registers a preflight override through `api.registerPreflight`. pm",
363
- "calls it before every command to compute the migration/format gate decision \u2014",
364
- "the last registered override wins. This starter echoes the current decision",
365
- "unchanged (a safe no-op); return only the decision keys you want to change.",
366
- "The `preflight` capability in `manifest.json` grants the registration."
367
- ],
368
- services: [
369
- "",
370
- "## Service Override",
371
- "`index.ts` overrides the built-in `output_format` service through",
372
- "`api.registerService`. Returning the payload unchanged passes through to pm's",
373
- "default formatting, so this starter scopes itself to its own command and",
374
- "passes every other command through. The `services` capability in",
375
- "`manifest.json` grants the registration."
376
- ]
377
- };
378
- var LAZY_ACTIVATION_README_SECTION = {
379
- package: [
380
- "",
381
- "## Lazy Activation",
382
- "`manifest.json` declares `activation.commands`: the exact command paths this",
383
- "package's `activate` registers. pm imports and activates the package lazily \u2014",
384
- "only when an invoked command path matches one of these entries \u2014 so unrelated",
385
- "commands (`pm list`, `pm search`, ...) never pay to load it. Keep this list in",
386
- "sync with the registrations in `index.ts`: add an entry when you register a new",
387
- "command, importer, or exporter, and remove one you drop. An omitted or stale",
388
- "entry means the matching command will not dispatch from the CLI. Globally-scoped",
389
- "surfaces (hooks, parser/preflight/renderer overrides, and search providers for",
390
- "built-in search commands) still activate regardless of this list."
391
- ],
392
- extension: [
393
- "",
394
- "## Lazy Activation",
395
- "`manifest.json` declares `activation.commands`: the exact command paths this",
396
- "extension's `activate` registers. pm imports and activates the extension lazily \u2014",
397
- "only when an invoked command path matches one of these entries \u2014 so unrelated",
398
- "commands never pay to load it. Keep this list in sync with the registrations in",
399
- "`index.ts`: an omitted or stale entry means the matching command will not dispatch",
400
- "from the CLI. Globally-scoped surfaces (hooks, parser/preflight/renderer overrides,",
401
- "and search providers for built-in search commands) still activate regardless."
402
- ]
403
- };
404
- var SCHEMA_ACTIVATION_README_SECTION = {
405
- package: [
406
- "",
407
- "## Activation",
408
- "This package contributes a GLOBAL custom item type and field, so `manifest.json`",
409
- "intentionally declares no `activation.commands`. pm activates the package",
410
- "conservatively \u2014 for every command \u2014 so the custom type is present wherever it is",
411
- "used: `pm create <type>`, `pm list --type <type>`, `pm validate`, and so on.",
412
- "Declaring narrow `activation.commands` here would gate activation to only those",
413
- "commands and silently leave the custom type unregistered for `pm create`. If you",
414
- "drop the schema registrations and keep only command/hook/search/importer surfaces,",
415
- "add `activation.commands` back so pm can load the package lazily."
416
- ],
417
- extension: [
418
- "",
419
- "## Activation",
420
- "This extension contributes a GLOBAL custom item type and field, so `manifest.json`",
421
- "intentionally declares no `activation.commands`. pm activates the extension",
422
- "conservatively \u2014 for every command \u2014 so the custom type is present wherever it is",
423
- "used: `pm create <type>`, `pm list --type <type>`, `pm validate`, and so on.",
424
- "Declaring narrow `activation.commands` here would gate activation to only those",
425
- "commands and silently leave the custom type unregistered for `pm create`."
426
- ]
427
- };
428
- var PROFILE_ACTIVATION_README_SECTION = {
429
- package: [
430
- "",
431
- "## Activation",
432
- "This package contributes a project profile resolved by the built-in",
433
- "`pm profile list`, `pm profile show <name>`, and `pm profile apply <name>`",
434
- "commands \u2014 commands the package does not own \u2014 so `manifest.json` intentionally",
435
- "declares no `activation.commands`. pm activates the package conservatively (for",
436
- "every command, granted by the `schema` capability) so the profile is present",
437
- "whenever `pm profile` runs. Declaring narrow `activation.commands` here would",
438
- "gate activation to only the listed commands and silently leave the profile",
439
- "unregistered for `pm profile`."
440
- ],
441
- extension: [
442
- "",
443
- "## Activation",
444
- "This extension contributes a project profile resolved by the built-in",
445
- "`pm profile list`, `pm profile show <name>`, and `pm profile apply <name>`",
446
- "commands, so `manifest.json` intentionally declares no `activation.commands`. pm",
447
- "activates the extension conservatively (for every command, granted by the",
448
- "`schema` capability) so the profile is present whenever `pm profile` runs.",
449
- "Declaring narrow `activation.commands` here would silently leave the profile",
450
- "unregistered for `pm profile`."
451
- ]
452
- };
453
- function buildScaffoldManifestBullet(capability, vocabulary) {
454
- if (capability === "schema") {
455
- return `- \`manifest.json\`: ${vocabulary} metadata and capabilities (no \`activation.commands\` \u2014 the custom item type activates for every command).`;
456
- }
457
- if (capability === "profile") {
458
- return `- \`manifest.json\`: ${vocabulary} metadata and capabilities (no \`activation.commands\` \u2014 the contributed profile resolves through \`pm profile\` for every command).`;
459
- }
460
- return `- \`manifest.json\`: ${vocabulary} metadata, capabilities, and \`activation.commands\` (the command paths that lazily activate this ${vocabulary}).`;
461
- }
462
- function buildScaffoldActivationReadmeSection(capability, vocabulary) {
463
- if (capability === "schema") {
464
- return SCHEMA_ACTIVATION_README_SECTION[vocabulary];
465
- }
466
- if (capability === "profile") {
467
- return PROFILE_ACTIVATION_README_SECTION[vocabulary];
468
- }
469
- return LAZY_ACTIVATION_README_SECTION[vocabulary];
470
- }
471
- function buildScaffoldCommandName(extensionName) {
472
- const commandWords = extensionName.replace(/-/g, " ").trim().split(/\s+/).filter((word) => word.length > 0);
473
- if (commandWords.length === 0) {
474
- return "starter ping";
475
- }
476
- const firstWordLower = commandWords[0].toLowerCase();
477
- let leadingStarterWords = 0;
478
- while (commandWords[leadingStarterWords]?.toLowerCase() === "starter") {
479
- leadingStarterWords += 1;
480
- }
481
- const nextStarterWord = commandWords[leadingStarterWords]?.toLowerCase();
482
- const starterRootCollision = leadingStarterWords > 0 && (leadingStarterWords === commandWords.length || nextStarterWord !== void 0 && RESERVED_SCAFFOLD_COMMAND_ROOTS.has(nextStarterWord));
483
- const reservedRoot = RESERVED_SCAFFOLD_COMMAND_ROOTS.has(firstWordLower) || starterRootCollision;
484
- const resolvedWords = reservedRoot ? ["starter", ...commandWords] : commandWords;
485
- return `${resolvedWords.join(" ")} ping`;
486
- }
487
- function buildProfileArchetypeFieldLines(extensionName) {
488
- const typeName = extensionName;
489
- const typeFolder = `${extensionName}s`;
490
- const typeAlias = extensionName.replace(/-/g, "");
491
- const typeAliases = typeAlias === typeName ? [] : [typeAlias];
492
- const fieldKey = `${extensionName.replace(/-/g, "_")}_owner`;
493
- const statusId = "reviewing";
494
- return [
495
- ` name: ${JSON.stringify(extensionName)},`,
496
- ` title: ${JSON.stringify(`${extensionName} archetype`)},`,
497
- ' summary: "Starter project profile. Replace these dimensions with your own archetype.",',
498
- " // Item types the profile upserts into the project schema when applied.",
499
- " types: [",
500
- " {",
501
- ` name: ${JSON.stringify(typeName)},`,
502
- ` folder: ${JSON.stringify(typeFolder)},`,
503
- ` aliases: ${JSON.stringify(typeAliases)},`,
504
- ` description: ${JSON.stringify(`A ${extensionName} work item that flows to done.`)},`,
505
- " },",
506
- " ],",
507
- " // Custom statuses upserted into the project status set.",
508
- " statuses: [",
509
- " {",
510
- ` id: ${JSON.stringify(statusId)},`,
511
- ' roles: ["active"],',
512
- ' aliases: ["in-review"],',
513
- ' description: "Work is implementation-complete and awaiting review.",',
514
- " },",
515
- " ],",
516
- " // Custom front-matter fields the archetype tracks.",
517
- " fields: [",
518
- " {",
519
- ` key: ${JSON.stringify(fieldKey)},`,
520
- ' type: "string",',
521
- ' commands: ["create", "update", "list"],',
522
- ' description: "Stakeholder accountable for the item.",',
523
- " },",
524
- " ],",
525
- " // Per-type workflow transition allow-list staged into settings.",
526
- " workflows: [",
527
- " {",
528
- ` type: ${JSON.stringify(typeName)},`,
529
- " allowed_transitions: [",
530
- ' ["open", "in_progress"],',
531
- ` ["in_progress", ${JSON.stringify(statusId)}],`,
532
- ` [${JSON.stringify(statusId)}, "in_progress"],`,
533
- ` [${JSON.stringify(statusId)}, "closed"],`,
534
- ' ["in_progress", "blocked"],',
535
- ' ["blocked", "in_progress"],',
536
- " ],",
537
- " },",
538
- " ],",
539
- " // Nested-settings knobs staged when the profile is applied.",
540
- " config: [",
541
- ' { key: "search_provider", value: "bm25", summary: "Offline BM25 lexical search needs no embedding service." },',
542
- ' { key: "search_max_results", value: "20", summary: "Result cap tuned for quick triage." },',
543
- " ],",
544
- " // Create templates staged into <pmRoot>/templates.",
545
- " templates: [",
546
- " {",
547
- ` name: ${JSON.stringify(extensionName)},`,
548
- " options: {",
549
- ` type: ${JSON.stringify(typeName)},`,
550
- ' priority: "2",',
551
- ` tags: ${JSON.stringify(extensionName)},`,
552
- ' acceptanceCriteria: "Item delivers the stated outcome with tests and docs updated.",',
553
- ' body: "## Context\\n\\n## Acceptance\\n- [ ] \\n",',
554
- " },",
555
- " },",
556
- " ],",
557
- " // Advisory package recommendations (never auto-installed).",
558
- " packages: [",
559
- ' { spec: "templates", reason: "Reusable create templates for recurring item shapes." },',
560
- " ],"
561
- ];
562
- }
563
- function buildActivateBodyLines(extensionName, commandName, capability) {
564
- const searchProviderName = `${extensionName}-search`;
565
- const vectorAdapterName = `${extensionName}-vector`;
566
- const adapterName = `${extensionName.replace(/-/g, " ")} items`;
567
- const commandLines = [
568
- " api.registerCommand({",
569
- ` name: ${JSON.stringify(commandName)},`,
570
- ' description: "Starter scaffold command. Replace with your own behavior.",',
571
- " run: async (context) => ({",
572
- " ok: true,",
573
- ` source: ${JSON.stringify(extensionName)},`,
574
- " command: context.command,",
575
- ' message: "Starter extension scaffold is active.",',
576
- " }),",
577
- " });"
578
- ];
579
- if (capability === "commands") {
580
- return commandLines;
581
- }
582
- if (capability === "search") {
583
- return [
584
- ...commandLines,
585
- "",
586
- " // Search providers let packages customize how pm ranks and retrieves",
587
- " // project context. This starter is deterministic and dependency-free:",
588
- " // replace the scoring with your domain retrieval, embedding, or rerank",
589
- " // logic as the package grows.",
590
- " api.registerSearchProvider({",
591
- ` name: ${JSON.stringify(searchProviderName)},`,
592
- " query: async (context) => {",
593
- " const needle = context.query.toLowerCase();",
594
- " const hits = context.documents",
595
- " .filter((document) => {",
596
- ' const title = String(document.metadata.title ?? "").toLowerCase();',
597
- " return title.includes(needle);",
598
- " })",
599
- " .map((document) => ({",
600
- " id: document.metadata.id,",
601
- " score: 1,",
602
- ' matched_fields: ["title"],',
603
- " }));",
604
- " return { hits };",
605
- " },",
606
- " embed: async (context) => [context.input.length],",
607
- " });",
608
- "",
609
- " // Vector-store adapters let packages own semantic index storage. This",
610
- " // starter returns a stable in-memory hit so generated tests can exercise",
611
- " // the adapter without external services.",
612
- " api.registerVectorStoreAdapter({",
613
- ` name: ${JSON.stringify(vectorAdapterName)},`,
614
- ' query: async (context) => [{ id: "starter-vector-hit", score: context.limit }],',
615
- " upsert: async (context) => ({ upserted: context.points.length }),",
616
- " delete: async (context) => ({ deleted: context.ids.length }),",
617
- " });"
618
- ];
619
- }
620
- if (capability === "schema") {
621
- const itemTypeName = extensionName;
622
- const itemTypeFolder = `${extensionName}s`;
623
- const itemTypeAlias = extensionName.replace(/-/g, "");
624
- const itemTypeAliases = itemTypeAlias === itemTypeName ? [] : [itemTypeAlias];
625
- const fieldName = `${extensionName.replace(/-/g, "_")}_note`;
626
- const migrationId = `${extensionName}-0001-init`;
627
- return [
628
- ...commandLines,
629
- "",
630
- " // Schema registrations let a package model its own project domain \u2014 the",
631
- ' // heart of "project management = context management". Item types and fields',
632
- " // are GLOBAL contributions: built-in commands like `pm create <type>` and",
633
- " // `pm list --type <type>` must see them, so this package declares no",
634
- " // `activation.commands` and pm activates it conservatively for every command.",
635
- " // The `schema` capability in manifest.json grants all three registrations.",
636
- " api.registerItemFields([",
637
- " {",
638
- ` name: ${JSON.stringify(fieldName)},`,
639
- ' type: "string",',
640
- " optional: true,",
641
- " },",
642
- " ]);",
643
- "",
644
- " api.registerItemTypes([",
645
- " {",
646
- ` name: ${JSON.stringify(itemTypeName)},`,
647
- " // Replace with your domain's canonical plural folder name.",
648
- ` folder: ${JSON.stringify(itemTypeFolder)},`,
649
- ` aliases: ${JSON.stringify(itemTypeAliases)},`,
650
- " // Add field names here to force them at `pm create` time.",
651
- " required_create_fields: [],",
652
- " },",
653
- " ]);",
654
- "",
655
- " // Migrations let a package evolve stored items as its schema changes. pm",
656
- " // runs each migration ONCE through the preflight gate (not once per item),",
657
- " // passing a context that identifies the migration itself: `context.id` is",
658
- " // the migration id (not an item id), alongside `context.pm_root` \u2014 iterate",
659
- " // the corpus yourself from there. This starter is a deterministic no-op so",
660
- " // package tests can invoke it without touching the corpus; replace the body",
661
- " // with your real rewrite.",
662
- " api.registerMigration({",
663
- ` id: ${JSON.stringify(migrationId)},`,
664
- ` description: ${JSON.stringify(`Initialize ${extensionName} schema state.`)},`,
665
- " mandatory: false,",
666
- " run: async (context) => ({ migrated: true, id: context.id }),",
667
- " });"
668
- ];
669
- }
670
- if (capability === "profile") {
671
- return [
672
- ...commandLines,
673
- "",
674
- " // A project profile is the broadest customization primitive pm has: one",
675
- " // declarative bundle of item types, custom statuses, fields, a per-type",
676
- " // workflow, config knobs, create templates, and package recommendations. Once",
677
- " // this package is installed the profile resolves by name through `pm profile",
678
- " // list`, `pm profile show`, and `pm profile apply`, which stages every dimension",
679
- " // idempotently like a core archetype. A profile registration is a schema+config",
680
- " // bundle, so the `schema` capability in manifest.json grants it.",
681
- " api.registerProfile({",
682
- // The archetype field lines are all non-empty, so re-indent each by the
683
- // `activate` body offset (object braces sit at two spaces, fields at four).
684
- ...buildProfileArchetypeFieldLines(extensionName).map((line) => ` ${line}`),
685
- " });"
686
- ];
687
- }
688
- if (capability === "importers") {
689
- return [
690
- ...commandLines,
691
- "",
692
- " // Importers/exporters are the bridge between pm's context graph and",
693
- " // another project-management system. Keep the starter deterministic so",
694
- " // package tests can run without touching the network or filesystem; replace",
695
- " // these payloads with your adapter's real mapping as the package grows.",
696
- " api.registerImporter(",
697
- ` ${JSON.stringify(adapterName)},`,
698
- " async (context) => ({",
699
- " imported: 1,",
700
- ' source: context.options.source ?? "starter",',
701
- " args: context.args,",
702
- " }),",
703
- " {",
704
- ` action: ${JSON.stringify(`${adapterName} import`)},`,
705
- ' description: "Import starter records into pm context.",',
706
- " flags: [",
707
- " {",
708
- ' long: "--source",',
709
- ' value_name: "name",',
710
- ' value_type: "string",',
711
- ' description: "Source name or path to import from.",',
712
- " },",
713
- " ],",
714
- " },",
715
- " );",
716
- "",
717
- " api.registerExporter(",
718
- ` ${JSON.stringify(adapterName)},`,
719
- " async (context) => ({",
720
- " exported: true,",
721
- ' destination: context.options.destination ?? "stdout",',
722
- " args: context.args,",
723
- " }),",
724
- " {",
725
- ` action: ${JSON.stringify(`${adapterName} export`)},`,
726
- ' description: "Export pm context into starter records.",',
727
- " flags: [",
728
- " {",
729
- ' long: "--destination",',
730
- ' value_name: "name",',
731
- ' value_type: "string",',
732
- ' description: "Destination name or path to export to.",',
733
- " },",
734
- " ],",
735
- " },",
736
- " );"
737
- ];
738
- }
739
- if (capability === "renderers") {
740
- return [
741
- ...commandLines,
742
- "",
743
- " // Renderer overrides customize how pm serializes a command's structured",
744
- ' // result for an output format ("toon" or "json"). pm runs this override for',
745
- " // EVERY command's output in that format, so it scopes itself to THIS",
746
- " // package's own command and returns null \u2014 pass-through to pm's default",
747
- " // renderer \u2014 for everything else. Return a string to take over rendering.",
748
- " // The `renderers` capability in manifest.json grants the registration.",
749
- ' api.registerRenderer("toon", (context) => {',
750
- ` if (context.command !== ${JSON.stringify(commandName)}) {`,
751
- " return null;",
752
- " }",
753
- ` return ${JSON.stringify(`${extensionName}: `)} + JSON.stringify(context.result);`,
754
- " });"
755
- ];
756
- }
757
- if (capability === "parser") {
758
- return [
759
- // The parser starter declares its own flags so the override is runnable end
760
- // to end through `pm <command> --shout`: the command defines the deprecated
761
- // `--shout` alias and canonical `--upper` flag, the parser rewrites one to
762
- // the other, and the handler surfaces the normalized value. Flag metadata
763
- // needs the `schema` capability (declared in manifest.json).
764
- " api.registerCommand({",
765
- ` name: ${JSON.stringify(commandName)},`,
766
- ' description: "Starter scaffold command. Replace with your own behavior.",',
767
- " flags: [",
768
- " {",
769
- ' long: "--shout",',
770
- ' value_type: "boolean",',
771
- ' description: "Deprecated alias for --upper; the parser override rewrites it.",',
772
- " },",
773
- " {",
774
- ' long: "--upper",',
775
- ' value_type: "boolean",',
776
- ' description: "Echo the canonical flag the parser override produces.",',
777
- " },",
778
- " ],",
779
- " run: async (context) => ({",
780
- " ok: true,",
781
- ` source: ${JSON.stringify(extensionName)},`,
782
- " command: context.command,",
783
- " // Surfaces the normalized option so `--shout`/`--upper` is observable.",
784
- " upper: context.options.upper === true,",
785
- ' message: "Starter extension scaffold is active.",',
786
- " }),",
787
- " });",
788
- "",
789
- " // Parser overrides preprocess a command's parsed options BEFORE its handler",
790
- " // runs, returning a delta \u2014 only the keys you set are merged over the parsed",
791
- " // input. This override is scoped to THIS package's own command. Here it",
792
- " // rewrites the deprecated `--shout` boolean alias to the canonical `--upper`",
793
- " // flag; replace it with your command's real normalization. The `parser`",
794
- " // capability in manifest.json grants the registration.",
795
- ` api.registerParser(${JSON.stringify(commandName)}, (context) => {`,
796
- " const options = { ...context.options };",
797
- " if (options.shout === true) {",
798
- " options.upper = true;",
799
- " }",
800
- " delete options.shout;",
801
- " return { options };",
802
- " });"
803
- ];
804
- }
805
- if (capability === "preflight") {
806
- return [
807
- ...commandLines,
808
- "",
809
- " // Preflight overrides adjust pm's pre-run gate decision (extension",
810
- " // migrations + item-format checks) before EVERY command \u2014 the last",
811
- " // registered override wins. Return a delta of the keys you want to change",
812
- " // (enforce_item_format_gate, run_preflight_item_format_sync,",
813
- " // run_extension_migrations, enforce_mandatory_migration_gate); returning",
814
- " // context.decision unchanged is a safe no-op so installing the package does",
815
- " // not alter gate behavior \u2014 replace it with your policy, e.g.",
816
- " // `{ run_extension_migrations: false }`. The `preflight` capability in",
817
- " // manifest.json grants the registration.",
818
- " api.registerPreflight((context) => context.decision);"
819
- ];
820
- }
821
- if (capability === "services") {
822
- return [
823
- ...commandLines,
824
- "",
825
- " // Service overrides replace a built-in pm service. The `output_format`",
826
- " // service renders a command's structured result; returning the payload",
827
- " // unchanged passes through to pm's default formatting. This override scopes",
828
- " // itself to THIS package's own command and passes every other command",
829
- " // through, so it never disrupts unrelated output. The `services` capability",
830
- " // in manifest.json grants the registration.",
831
- ' api.registerService("output_format", (context) => {',
832
- ` if (context.command !== ${JSON.stringify(commandName)}) {`,
833
- " return context.payload;",
834
- " }",
835
- ` return { rendered_by: ${JSON.stringify(extensionName)}, payload: context.payload };`,
836
- " });"
837
- ];
838
- }
839
- return [
840
- ...commandLines,
841
- "",
842
- " // after_command hooks fire once pm finishes a command, receiving the items",
843
- " // it mutated. This is the natural place to react to every change - sync to",
844
- " // an external system, emit telemetry, or refresh derived context",
845
- ' // ("project management = context management"). This starter is a documented',
846
- " // no-op on the success path; replace the body with your own reaction.",
847
- " api.hooks.afterCommand((context) => {",
848
- " if (!context.ok) {",
849
- " return;",
850
- " }",
851
- " // `context.affected` lists the items pm mutated (id, status,",
852
- " // changed_fields). React here, e.g.:",
853
- " // for (const item of context.affected ?? []) { /* ...item.id... */ }",
854
- " });"
855
- ];
856
- }
857
- function buildSampleTestSource(extensionName, commandName, capability) {
858
- const hooksEnabled = capability === "hooks";
859
- const searchEnabled = capability === "search";
860
- const importersEnabled = capability === "importers";
861
- const schemaEnabled = capability === "schema";
862
- const profileEnabled = capability === "profile";
863
- const renderersEnabled = capability === "renderers";
864
- const parserEnabled = capability === "parser";
865
- const preflightEnabled = capability === "preflight";
866
- const servicesEnabled = capability === "services";
867
- const capabilitiesLiteral = SAMPLE_TEST_CAPABILITIES_LITERAL[capability];
868
- const itemTypeName = extensionName;
869
- const itemTypeFolder = `${extensionName}s`;
870
- const fieldName = `${extensionName.replace(/-/g, "_")}_note`;
871
- const migrationId = `${extensionName}-0001-init`;
872
- const importNames = [
873
- " assertExtensionDeactivated,",
874
- " createExtensionTestHarness,"
875
- ];
876
- const hookTestLines = hooksEnabled ? [
877
- `test(${JSON.stringify(`${extensionName} reacts to commands via its after_command hook`)}, async () => {`,
878
- " const ext = await createExtensionTestHarness(extension, {",
879
- ` name: ${JSON.stringify(extensionName)},`,
880
- ` capabilities: ${capabilitiesLiteral},`,
881
- " });",
882
- " let deactivated = false;",
883
- " try {",
884
- " // assertHook throws unless an after_command hook is registered, so",
885
- " // reaching the next line already proves the hook is wired.",
886
- " ext.assertHook({",
887
- ' kind: "after_command",',
888
- ` extensionName: ${JSON.stringify(extensionName)},`,
889
- " });",
890
- " // runHook fires the hook through pm's real runner with a synthetic",
891
- " // context and returns the warnings it produced; a clean hook returns none.",
892
- " // Replace the context/assertions as your hook grows.",
893
- " const warnings = await ext.runHook({",
894
- ' kind: "after_command",',
895
- " context: {",
896
- ` command: ${JSON.stringify(commandName)},`,
897
- " args: [],",
898
- ' pm_root: "",',
899
- " ok: true,",
900
- " affected: [],",
901
- " },",
902
- " });",
903
- " assert.deepEqual(warnings, []);",
904
- " const teardown = await ext.deactivate();",
905
- " assertExtensionDeactivated(teardown);",
906
- " deactivated = true;",
907
- ...SAMPLE_HARNESS_FINALLY_LINES,
908
- "});",
909
- ""
910
- ] : [];
911
- const searchTestLines = searchEnabled ? buildDeclarativeCapabilityTestBlock(extensionName, commandName, "search", capabilitiesLiteral) : [];
912
- const importerTestLines = importersEnabled ? buildDeclarativeCapabilityTestBlock(extensionName, commandName, "importers", capabilitiesLiteral) : [];
913
- const schemaTestLines = schemaEnabled ? [
914
- `test(${JSON.stringify(`${extensionName} registers and runs its custom schema`)}, async () => {`,
915
- " const ext = await createExtensionTestHarness(extension, {",
916
- ` name: ${JSON.stringify(extensionName)},`,
917
- ` capabilities: ${capabilitiesLiteral},`,
918
- " });",
919
- " let deactivated = false;",
920
- " try {",
921
- ...indentGeneratedLines(buildSchemaCapabilityAssertionLines({
922
- extensionName,
923
- itemTypeName,
924
- itemTypeFolder,
925
- fieldName,
926
- migrationId,
927
- includeMigrationReplacementHint: true
928
- }), " "),
929
- " const teardown = await ext.deactivate();",
930
- " assertExtensionDeactivated(teardown);",
931
- " deactivated = true;",
932
- ...SAMPLE_HARNESS_FINALLY_LINES,
933
- "});",
934
- ""
935
- ] : [];
936
- const profileTestLines = profileEnabled ? [
937
- `test(${JSON.stringify(`${extensionName} registers its project profile`)}, async () => {`,
938
- " const ext = await createExtensionTestHarness(extension, {",
939
- ` name: ${JSON.stringify(extensionName)},`,
940
- ` capabilities: ${capabilitiesLiteral},`,
941
- " });",
942
- " let deactivated = false;",
943
- " try {",
944
- ...indentGeneratedLines(buildProfileCapabilityAssertionLines(extensionName), " "),
945
- " const teardown = await ext.deactivate();",
946
- " assertExtensionDeactivated(teardown);",
947
- " deactivated = true;",
948
- ...SAMPLE_HARNESS_FINALLY_LINES,
949
- "});",
950
- ""
951
- ] : [];
952
- const rendererTestLines = renderersEnabled ? [
953
- `test(${JSON.stringify(`${extensionName} registers and invokes its renderer override`)}, async () => {`,
954
- " const ext = await createExtensionTestHarness(extension, {",
955
- ` name: ${JSON.stringify(extensionName)},`,
956
- ` capabilities: ${capabilitiesLiteral},`,
957
- " });",
958
- " let deactivated = false;",
959
- " try {",
960
- " // assertRendererOverride throws unless a renderer is registered for the",
961
- " // format, so reaching the next line already proves the wiring.",
962
- ` const override = ext.assertRendererOverride({ format: "toon", extensionName: ${JSON.stringify(extensionName)} });`,
963
- ' assert.equal(override.format, "toon");',
964
- "",
965
- " // runRendererOverride renders through pm's real runner. The override",
966
- " // customizes only THIS package's command output and returns a string the",
967
- " // host uses verbatim. Replace the assertions as it grows.",
968
- " const rendered = await ext.runRendererOverride({",
969
- ' format: "toon",',
970
- ` command: ${JSON.stringify(commandName)},`,
971
- " result: { ok: true },",
972
- " });",
973
- " assert.equal(rendered.overridden, true);",
974
- ` assert.equal(rendered.rendered, ${JSON.stringify(`${extensionName}: `)} + JSON.stringify({ ok: true }));`,
975
- "",
976
- " // Output for any other command passes through to pm's default renderer.",
977
- " const passthrough = await ext.runRendererOverride({",
978
- ' format: "toon",',
979
- ' command: "list",',
980
- " result: { ok: true },",
981
- " });",
982
- " assert.equal(passthrough.overridden, false);",
983
- " const teardown = await ext.deactivate();",
984
- " assertExtensionDeactivated(teardown);",
985
- " deactivated = true;",
986
- ...SAMPLE_HARNESS_FINALLY_LINES,
987
- "});",
988
- ""
989
- ] : [];
990
- const parserTestLines = parserEnabled ? [
991
- `test(${JSON.stringify(`${extensionName} rewrites command options via its parser override`)}, async () => {`,
992
- " const ext = await createExtensionTestHarness(extension, {",
993
- ` name: ${JSON.stringify(extensionName)},`,
994
- ` capabilities: ${capabilitiesLiteral},`,
995
- " });",
996
- " let deactivated = false;",
997
- " try {",
998
- " // assertParserOverride throws unless a parser is registered for the",
999
- " // command, so reaching the next line already proves the wiring.",
1000
- ` ext.assertParserOverride({ command: ${JSON.stringify(commandName)}, extensionName: ${JSON.stringify(extensionName)} });`,
1001
- "",
1002
- " // runParserOverride runs the override through pm's real parser runner and",
1003
- " // returns the rewritten context. The starter rewrites the deprecated",
1004
- " // `shout` alias to the canonical `upper` flag.",
1005
- " const result = await ext.runParserOverride({",
1006
- ` command: ${JSON.stringify(commandName)},`,
1007
- " args: [],",
1008
- " options: { shout: true },",
1009
- " global: {},",
1010
- ' pm_root: "",',
1011
- " });",
1012
- " assert.equal(result.overridden, true);",
1013
- " assert.deepEqual(result.context.options, { upper: true });",
1014
- "",
1015
- " // End to end: feed the rewritten options into the command handler to",
1016
- " // prove `pm <command> --shout` surfaces the normalized `upper` flag in",
1017
- " // the result.",
1018
- ` const invocation = await ext.runCommand({ command: ${JSON.stringify(commandName)}, options: result.context.options });`,
1019
- " assert.equal(invocation.handled, true);",
1020
- " assert.deepEqual(invocation.result, {",
1021
- " ok: true,",
1022
- ` source: ${JSON.stringify(extensionName)},`,
1023
- ` command: ${JSON.stringify(commandName)},`,
1024
- " upper: true,",
1025
- ' message: "Starter extension scaffold is active.",',
1026
- " });",
1027
- " const teardown = await ext.deactivate();",
1028
- " assertExtensionDeactivated(teardown);",
1029
- " deactivated = true;",
1030
- ...SAMPLE_HARNESS_FINALLY_LINES,
1031
- "});",
1032
- ""
1033
- ] : [];
1034
- const preflightTestLines = preflightEnabled ? [
1035
- `test(${JSON.stringify(`${extensionName} returns a preflight gate decision via its override`)}, async () => {`,
1036
- " const ext = await createExtensionTestHarness(extension, {",
1037
- ` name: ${JSON.stringify(extensionName)},`,
1038
- ` capabilities: ${capabilitiesLiteral},`,
1039
- " });",
1040
- " let deactivated = false;",
1041
- " try {",
1042
- " // assertPreflightOverride throws unless a preflight override is",
1043
- " // registered, so reaching the next line already proves the wiring.",
1044
- ` ext.assertPreflightOverride({ extensionName: ${JSON.stringify(extensionName)} });`,
1045
- "",
1046
- " // runPreflightOverride runs the override through pm's real runner with a",
1047
- " // synthetic gate decision. The starter echoes the decision unchanged;",
1048
- " // replace the values/assertions with your real policy.",
1049
- " const decision = {",
1050
- " enforce_item_format_gate: true,",
1051
- " run_preflight_item_format_sync: false,",
1052
- " run_extension_migrations: true,",
1053
- " enforce_mandatory_migration_gate: false,",
1054
- " };",
1055
- " const result = await ext.runPreflightOverride({",
1056
- ` command: ${JSON.stringify(commandName)},`,
1057
- " args: [],",
1058
- " options: {},",
1059
- " global: {},",
1060
- ' pm_root: "",',
1061
- " decision,",
1062
- " });",
1063
- " assert.equal(result.overridden, true);",
1064
- " assert.deepEqual(result.decision, decision);",
1065
- " const teardown = await ext.deactivate();",
1066
- " assertExtensionDeactivated(teardown);",
1067
- " deactivated = true;",
1068
- ...SAMPLE_HARNESS_FINALLY_LINES,
1069
- "});",
1070
- ""
1071
- ] : [];
1072
- const serviceTestLines = servicesEnabled ? [
1073
- `test(${JSON.stringify(`${extensionName} customizes command output via its service override`)}, async () => {`,
1074
- " const ext = await createExtensionTestHarness(extension, {",
1075
- ` name: ${JSON.stringify(extensionName)},`,
1076
- ` capabilities: ${capabilitiesLiteral},`,
1077
- " });",
1078
- " let deactivated = false;",
1079
- " try {",
1080
- " // assertServiceOverride throws unless a service override is registered",
1081
- " // for the service, so reaching the next line proves the wiring.",
1082
- ` ext.assertServiceOverride({ service: "output_format", extensionName: ${JSON.stringify(extensionName)} });`,
1083
- "",
1084
- " // runServiceOverride runs the override through pm's real service runner.",
1085
- " // The override customizes only THIS package's command output (handled),",
1086
- " // passing every other command through (not handled).",
1087
- " const handled = await ext.runServiceOverride({",
1088
- ' service: "output_format",',
1089
- ` command: ${JSON.stringify(commandName)},`,
1090
- " payload: { ok: true },",
1091
- " });",
1092
- " assert.equal(handled.handled, true);",
1093
- ` assert.deepEqual(handled.result, { rendered_by: ${JSON.stringify(extensionName)}, payload: { ok: true } });`,
1094
- "",
1095
- " // Output for any other command passes through to pm's default formatter.",
1096
- " const passthrough = await ext.runServiceOverride({",
1097
- ' service: "output_format",',
1098
- ' command: "list",',
1099
- " payload: { ok: true },",
1100
- " });",
1101
- " assert.equal(passthrough.handled, false);",
1102
- " const teardown = await ext.deactivate();",
1103
- " assertExtensionDeactivated(teardown);",
1104
- " deactivated = true;",
1105
- ...SAMPLE_HARNESS_FINALLY_LINES,
1106
- "});",
1107
- ""
1108
- ] : [];
1109
- return [
1110
- 'import assert from "node:assert/strict";',
1111
- 'import { test } from "node:test";',
1112
- "import {",
1113
- ...importNames,
1114
- '} from "@unbrained/pm-cli/sdk/testing";',
1115
- // The search sample's synthetic query/vector contexts reference these SDK types
1116
- // for their typed-stub fixtures; other capabilities need no extra type imports.
1117
- ...searchEnabled ? ['import type { ItemDocument, PmSettings } from "@unbrained/pm-cli/sdk";'] : [],
1118
- 'import extension from "./index.ts";',
1119
- "",
1120
- ...SAMPLE_HARNESS_CLEANUP_LINES,
1121
- `test(${JSON.stringify(`${extensionName} registers its starter command`)}, async () => {`,
1122
- " // `capabilities` mirrors manifest.json so the in-memory activation grants",
1123
- " // the capabilities the entrypoint relies on.",
1124
- " const ext = await createExtensionTestHarness(extension, {",
1125
- ` name: ${JSON.stringify(extensionName)},`,
1126
- ` capabilities: ${capabilitiesLiteral},`,
1127
- " });",
1128
- " let deactivated = false;",
1129
- " try {",
1130
- " // assertCommandContract is bound to the right activation registry and throws",
1131
- " // if the command is not registered, so reaching here already proves the",
1132
- " // wiring; assert on the returned definition to inspect metadata.",
1133
- " const registered = ext.assertCommandContract({",
1134
- ` command: ${JSON.stringify(commandName)},`,
1135
- ` extensionName: ${JSON.stringify(extensionName)},`,
1136
- " });",
1137
- ' assert.equal(typeof registered.command.description, "string");',
1138
- "",
1139
- " // runCommand invokes the handler through pm's real dispatch engine, so this",
1140
- " // asserts behavior - not just that the command is wired. Replace these",
1141
- " // assertions as you flesh out your command.",
1142
- " const invocation = await ext.runCommand({",
1143
- ` command: ${JSON.stringify(commandName)},`,
1144
- " });",
1145
- " assert.equal(invocation.handled, true);",
1146
- " // The handler result is typed `unknown`, so deep-equality on the whole",
1147
- " // structured payload keeps the assertion type-safe without a cast.",
1148
- " assert.deepEqual(invocation.result, {",
1149
- " ok: true,",
1150
- ` source: ${JSON.stringify(extensionName)},`,
1151
- ` command: ${JSON.stringify(commandName)},`,
1152
- // The parser starter's command surfaces the normalized `upper` flag, which
1153
- // defaults to false when the command is invoked without `--shout`/`--upper`.
1154
- ...parserEnabled ? [" upper: false,"] : [],
1155
- ' message: "Starter extension scaffold is active.",',
1156
- " });",
1157
- " const teardown = await ext.deactivate();",
1158
- " assertExtensionDeactivated(teardown);",
1159
- " deactivated = true;",
1160
- ...SAMPLE_HARNESS_FINALLY_LINES,
1161
- "});",
1162
- "",
1163
- ...hookTestLines,
1164
- ...searchTestLines,
1165
- ...importerTestLines,
1166
- ...schemaTestLines,
1167
- ...profileTestLines,
1168
- ...rendererTestLines,
1169
- ...parserTestLines,
1170
- ...preflightTestLines,
1171
- ...serviceTestLines,
1172
- `test(${JSON.stringify(`${extensionName} tears down cleanly via deactivate`)}, async () => {`,
1173
- " // createExtensionTestHarness binds teardown to the same name/layer used for",
1174
- " // activation, so this proves your `deactivate` hook runs without throwing.",
1175
- " const ext = await createExtensionTestHarness(extension, {",
1176
- ` name: ${JSON.stringify(extensionName)},`,
1177
- ` capabilities: ${capabilitiesLiteral},`,
1178
- " });",
1179
- " const teardown = await ext.deactivate();",
1180
- " // assertExtensionDeactivated throws unless exactly one extension tore down",
1181
- " // with no failures, so reaching the next line already proves teardown ran.",
1182
- " assertExtensionDeactivated(teardown);",
1183
- " assert.equal(teardown.deactivated, 1);",
1184
- "});",
1185
- ""
1186
- ].join("\n");
1187
- }
1188
- function buildScaffoldActivationCommands(extensionName, commandName, capability) {
1189
- if (capability === "schema" || capability === "profile") {
1190
- return [];
1191
- }
1192
- if (capability === "importers") {
1193
- const adapterName = `${extensionName.replace(/-/g, " ")} items`;
1194
- return [commandName, `${adapterName} import`, `${adapterName} export`];
1195
- }
1196
- return [commandName];
1197
- }
1198
- var DECLARATIVE_ENTRYPOINT_SURFACE_PHRASE = {
1199
- commands: "starter command",
1200
- hooks: "starter command and after_command hook",
1201
- search: "starter command, search provider, and vector-store adapter",
1202
- importers: "starter command, importer, and exporter",
1203
- schema: "starter command, custom item type, item field, and migration",
1204
- profile: "starter command and project profile",
1205
- renderers: "starter command and toon renderer override",
1206
- parser: "starter command and parser override",
1207
- preflight: "starter command and preflight override",
1208
- services: "starter command and output_format service override"
1209
- };
1210
- var DECLARATIVE_CAPABILITY_BLUEPRINT_FIELDS = {
1211
- commands: "`commands`",
1212
- hooks: "`commands` and `hooks.afterCommand`",
1213
- search: "`commands`, `searchProviders`, and `vectorStoreAdapters`",
1214
- importers: "`commands`, `importers`, and `exporters`",
1215
- schema: "`commands`, `itemTypes`, `itemFields`, and `migrations`",
1216
- profile: "`commands` and `profiles`",
1217
- renderers: "`commands` and `renderers`",
1218
- parser: "`commands` and `parsers`",
1219
- preflight: "`commands` and `preflights`",
1220
- services: "`commands` and `services`"
1221
- };
1222
- function buildDeclarativePingCommandLines(extensionName, commandName, capability) {
1223
- const parserEnabled = capability === "parser";
1224
- return [
1225
- "// The starter command, authored with the `defineCommand` builder so its literal",
1226
- "// name is preserved and the handler `context` is inferred. Exporting it lets you",
1227
- "// unit-test the definition in isolation, apart from the blueprint.",
1228
- "export const pingCommand = defineCommand({",
1229
- ` name: ${JSON.stringify(commandName)},`,
1230
- ' description: "Starter scaffold command. Replace with your own behavior.",',
1231
- ...parserEnabled ? [
1232
- " flags: [",
1233
- " {",
1234
- ' long: "--shout",',
1235
- ' value_type: "boolean",',
1236
- ' description: "Deprecated alias for --upper; the parser override rewrites it.",',
1237
- " },",
1238
- " {",
1239
- ' long: "--upper",',
1240
- ' value_type: "boolean",',
1241
- ' description: "Echo the canonical flag the parser override produces.",',
1242
- " },",
1243
- " ],"
1244
- ] : [],
1245
- " run: async (context) => ({",
1246
- " ok: true,",
1247
- ` source: ${JSON.stringify(extensionName)},`,
1248
- " command: context.command,",
1249
- ...parserEnabled ? [" upper: context.options.upper === true,"] : [],
1250
- ' message: "Starter extension scaffold is active.",',
1251
- " }),",
1252
- "});"
1253
- ];
1254
- }
1255
- function buildDeclarativeBlueprintSurface(extensionName, commandName, capability) {
1256
- const builderImports = [];
1257
- const definitions = [...buildDeclarativePingCommandLines(extensionName, commandName, capability)];
1258
- const blueprintFields = [" commands: [pingCommand],"];
1259
- const searchProviderName = `${extensionName}-search`;
1260
- const vectorAdapterName = `${extensionName}-vector`;
1261
- const adapterName = `${extensionName.replace(/-/g, " ")} items`;
1262
- const itemTypeName = extensionName;
1263
- const itemTypeFolder = `${extensionName}s`;
1264
- const itemTypeAlias = extensionName.replace(/-/g, "");
1265
- const itemTypeAliases = itemTypeAlias === itemTypeName ? [] : [itemTypeAlias];
1266
- const fieldName = `${extensionName.replace(/-/g, "_")}_note`;
1267
- const migrationId = `${extensionName}-0001-init`;
1268
- switch (capability) {
1269
- case "commands":
1270
- break;
1271
- case "hooks":
1272
- builderImports.push("defineAfterCommandHook");
1273
- definitions.push("", "// after_command hooks fire once pm finishes a command, receiving the items it", "// mutated. React here - sync to an external system, emit telemetry, or refresh", '// derived context ("project management = context management"). This starter is a', "// documented no-op on the success path; replace the body with your own reaction.", "export const afterCommandHook = defineAfterCommandHook((context) => {", " if (!context.ok) {", " return;", " }", " // `context.affected` lists the items pm mutated (id, status, changed_fields):", " // for (const item of context.affected ?? []) { /* ...item.id... */ }", "});");
1274
- blueprintFields.push(" hooks: { afterCommand: [afterCommandHook] },");
1275
- break;
1276
- case "search":
1277
- builderImports.push("defineSearchProvider", "defineVectorStoreAdapter");
1278
- definitions.push("", "// Search providers let packages customize how pm ranks and retrieves project", "// context. This starter is deterministic and dependency-free: replace the scoring", "// with your domain retrieval, embedding, or rerank logic as the package grows.", "export const searchProvider = defineSearchProvider({", ` name: ${JSON.stringify(searchProviderName)},`, " query: async (context) => {", " const needle = context.query.toLowerCase();", " const hits = context.documents", " .filter((document) => {", ' const title = String(document.metadata.title ?? "").toLowerCase();', " return title.includes(needle);", " })", " .map((document) => ({", " id: document.metadata.id,", " score: 1,", ' matched_fields: ["title"],', " }));", " return { hits };", " },", " embed: async (context) => [context.input.length],", "});", "", "// Vector-store adapters let packages own semantic index storage. This starter", "// returns a stable in-memory hit so generated tests can exercise the adapter", "// without external services.", "export const vectorStoreAdapter = defineVectorStoreAdapter({", ` name: ${JSON.stringify(vectorAdapterName)},`, ' query: async (context) => [{ id: "starter-vector-hit", score: context.limit }],', " upsert: async (context) => ({ upserted: context.points.length }),", " delete: async (context) => ({ deleted: context.ids.length }),", "});");
1279
- blueprintFields.push(" searchProviders: [searchProvider],", " vectorStoreAdapters: [vectorStoreAdapter],");
1280
- break;
1281
- case "importers":
1282
- builderImports.push("defineExporter", "defineImporter");
1283
- definitions.push("", "// Importers/exporters are the bridge between pm's context graph and another", "// project-management system. Keep the starter deterministic so package tests can", "// run without touching the network or filesystem; replace these payloads with", "// your adapter's real mapping as the package grows.", "export const importer = defineImporter(async (context) => ({", " imported: 1,", ' source: context.options.source ?? "starter",', " args: context.args,", "}));", "", "export const exporter = defineExporter(async (context) => ({", " exported: true,", ' destination: context.options.destination ?? "stdout",', " args: context.args,", "}));");
1284
- blueprintFields.push(" importers: [", " {", ` name: ${JSON.stringify(adapterName)},`, " importer,", " options: {", ` action: ${JSON.stringify(`${adapterName} import`)},`, ' description: "Import starter records into pm context.",', " flags: [", " {", ' long: "--source",', ' value_name: "name",', ' value_type: "string",', ' description: "Source name or path to import from.",', " },", " ],", " },", " },", " ],", " exporters: [", " {", ` name: ${JSON.stringify(adapterName)},`, " exporter,", " options: {", ` action: ${JSON.stringify(`${adapterName} export`)},`, ' description: "Export pm context into starter records.",', " flags: [", " {", ' long: "--destination",', ' value_name: "name",', ' value_type: "string",', ' description: "Destination name or path to export to.",', " },", " ],", " },", " },", " ],");
1285
- break;
1286
- case "schema":
1287
- builderImports.push("defineItemField", "defineItemType", "defineMigration");
1288
- definitions.push("", "// Schema registrations let a package model its own project domain - the heart of", '// "project management = context management". Item types and fields are GLOBAL', "// contributions, so this package declares no `activation.commands` and pm", "// activates it conservatively for every command.", "export const noteField = defineItemField({", ` name: ${JSON.stringify(fieldName)},`, ' type: "string",', " optional: true,", "});", "", "export const itemType = defineItemType({", ` name: ${JSON.stringify(itemTypeName)},`, " // Replace with your domain's canonical plural folder name.", ` folder: ${JSON.stringify(itemTypeFolder)},`, ` aliases: ${JSON.stringify(itemTypeAliases)},`, " // Add field names here to force them at `pm create` time.", " required_create_fields: [],", "});", "", "// Migrations let a package evolve stored items as its schema changes. pm runs each", "// migration ONCE through the preflight gate (not once per item), passing a context", "// that identifies the migration itself: `context.id` is the migration id (not an", "// item id), alongside `context.pm_root`. This starter is a deterministic no-op so", "// package tests can invoke it without touching the corpus; replace the body with", "// your real rewrite.", "export const initMigration = defineMigration({", ` id: ${JSON.stringify(migrationId)},`, ` description: ${JSON.stringify(`Initialize ${extensionName} schema state.`)},`, " mandatory: false,", " run: async (context) => ({ migrated: true, id: context.id }),", "});");
1289
- blueprintFields.push(" itemTypes: [itemType],", " itemFields: [noteField],", " migrations: [initMigration],");
1290
- break;
1291
- case "profile":
1292
- builderImports.push("defineProjectProfile");
1293
- definitions.push("", "// A project profile is the broadest customization primitive pm has: one", "// declarative bundle of item types, custom statuses, fields, a per-type workflow,", "// config knobs, create templates, and package recommendations. Once installed it", "// resolves by name through `pm profile list/show/apply`, which stages every", "// dimension idempotently like a core archetype. A profile registration is a", "// schema+config bundle, so the `schema` capability grants it.", "export const starterProfile = defineProjectProfile({", ...buildProfileArchetypeFieldLines(extensionName), "});");
1294
- blueprintFields.push(" profiles: [starterProfile],");
1295
- break;
1296
- case "renderers":
1297
- builderImports.push("defineRendererOverride");
1298
- definitions.push("", "// Renderer overrides customize how pm serializes a command's structured result", '// for an output format ("toon" or "json"). pm runs this override for EVERY', "// command's output in that format, so it scopes itself to THIS package's own", "// command and returns null - pass-through to pm's default renderer - for", "// everything else. Return a string to take over rendering.", "export const toonRenderer = defineRendererOverride((context) => {", ` if (context.command !== ${JSON.stringify(commandName)}) {`, " return null;", " }", ` return ${JSON.stringify(`${extensionName}: `)} + JSON.stringify(context.result);`, "});");
1299
- blueprintFields.push(" renderers: { toon: toonRenderer },");
1300
- break;
1301
- case "parser":
1302
- builderImports.push("defineParserOverride");
1303
- definitions.push("", "// Parser overrides preprocess a command's parsed options BEFORE its handler runs,", "// returning a delta - only the keys you set are merged over the parsed input. This", "// override is scoped to THIS package's own command; here it rewrites the deprecated", "// `--shout` boolean alias to the canonical `--upper` flag.", "export const pingParser = defineParserOverride((context) => {", " const options = { ...context.options };", " if (options.shout === true) {", " options.upper = true;", " }", " delete options.shout;", " return { options };", "});");
1304
- blueprintFields.push(` parsers: { ${JSON.stringify(commandName)}: pingParser },`);
1305
- break;
1306
- case "preflight":
1307
- builderImports.push("definePreflightOverride");
1308
- definitions.push("", "// Preflight overrides adjust pm's pre-run gate decision (extension migrations +", "// item-format checks) before EVERY command - the last registered override wins.", "// Return a delta of the keys you want to change (enforce_item_format_gate,", "// run_preflight_item_format_sync, run_extension_migrations,", "// enforce_mandatory_migration_gate); returning context.decision unchanged is a", "// safe no-op - replace it with your policy, e.g. { run_extension_migrations: false }.", "export const preflightOverride = definePreflightOverride((context) => context.decision);");
1309
- blueprintFields.push(" preflights: [preflightOverride],");
1310
- break;
1311
- case "services":
1312
- builderImports.push("defineServiceOverride");
1313
- definitions.push("", "// Service overrides replace a built-in pm service. The `output_format` service", "// renders a command's structured result; returning the payload unchanged passes", "// through to pm's default formatting. This override scopes itself to THIS", "// package's own command and passes every other command through.", "export const outputService = defineServiceOverride((context) => {", ` if (context.command !== ${JSON.stringify(commandName)}) {`, " return context.payload;", " }", ` return { rendered_by: ${JSON.stringify(extensionName)}, payload: context.payload };`, "});");
1314
- blueprintFields.push(" services: { output_format: outputService },");
1315
- break;
1316
- }
1317
- return { builderImports, definitions, blueprintFields };
1318
- }
1319
- function buildDeclarativeEntrypoint(extensionName, commandName, capability) {
1320
- const surface = buildDeclarativeBlueprintSurface(extensionName, commandName, capability);
1321
- const builderImports = [
1322
- "composeExtension",
1323
- "defineCommand",
1324
- "defineExtensionBlueprint",
1325
- ...surface.builderImports
1326
- ].sort((left, right) => left.localeCompare(right));
1327
- return [
1328
- `import { ${builderImports.join(", ")} } from "@unbrained/pm-cli/sdk";`,
1329
- "",
1330
- ...surface.definitions,
1331
- "",
1332
- "// Declarative authoring: describe WHAT the package registers as a blueprint and",
1333
- "// let `composeExtension` generate the `activate` that wires every surface in order,",
1334
- "// instead of hand-writing each `api.register*` call. `defineExtensionBlueprint`",
1335
- "// contract-checks the blueprint where it is authored. Keep `manifest.json`'s",
1336
- "// `capabilities` equal to the set this blueprint derives.",
1337
- "export const blueprint = defineExtensionBlueprint({",
1338
- ...surface.blueprintFields,
1339
- " // `deactivate` is the teardown counterpart to the generated `activate`: pm runs",
1340
- " // it on host shutdown/reload to release anything the package opened (timers,",
1341
- " // connections, caches). This starter holds none, so it stays a no-op.",
1342
- " deactivate: () => {},",
1343
- "});",
1344
- "",
1345
- "// `composeExtension(blueprint)` is the package's default export \u2014 the runtime",
1346
- "// `ExtensionModule` pm loads. Guard the blueprint with `assertExtensionPreflight`",
1347
- "// in index.test.ts before publishing.",
1348
- "export default composeExtension(blueprint);",
1349
- ""
1350
- ].join("\n");
1351
- }
1352
- function buildDeclarativeCapabilityTestBlock(extensionName, commandName, capability, capabilitiesLiteral) {
1353
- if (capability === "commands") {
1354
- return [];
1355
- }
1356
- const searchProviderName = `${extensionName}-search`;
1357
- const vectorAdapterName = `${extensionName}-vector`;
1358
- const adapterName = `${extensionName.replace(/-/g, " ")} items`;
1359
- const itemTypeName = extensionName;
1360
- const itemTypeFolder = `${extensionName}s`;
1361
- const fieldName = `${extensionName.replace(/-/g, "_")}_note`;
1362
- const migrationId = `${extensionName}-0001-init`;
1363
- const harness = [
1364
- " const ext = await createExtensionTestHarness(extension, {",
1365
- ` name: ${JSON.stringify(extensionName)},`,
1366
- ` capabilities: ${capabilitiesLiteral},`,
1367
- " });"
1368
- ];
1369
- const withHarnessCleanup = (body) => [
1370
- ...harness,
1371
- " let deactivated = false;",
1372
- " try {",
1373
- ...body.map((line) => line === "" ? line : ` ${line}`),
1374
- " const teardown = await ext.deactivate();",
1375
- " assertExtensionDeactivated(teardown);",
1376
- " deactivated = true;",
1377
- ...SAMPLE_HARNESS_FINALLY_LINES
1378
- ];
1379
- switch (capability) {
1380
- case "hooks":
1381
- return [
1382
- `test(${JSON.stringify(`${extensionName} reacts to commands via its after_command hook`)}, async () => {`,
1383
- ...withHarnessCleanup([
1384
- " // assertHook throws unless an after_command hook is registered, so reaching the",
1385
- " // next line already proves the hook is wired.",
1386
- ` ext.assertHook({ kind: "after_command", extensionName: ${JSON.stringify(extensionName)} });`,
1387
- " // runHook fires the hook through pm's real runner with a synthetic context and",
1388
- " // returns the warnings it produced; a clean hook returns none.",
1389
- " const warnings = await ext.runHook({",
1390
- ' kind: "after_command",',
1391
- " context: {",
1392
- ` command: ${JSON.stringify(commandName)},`,
1393
- " args: [],",
1394
- ' pm_root: "",',
1395
- " ok: true,",
1396
- " affected: [],",
1397
- " },",
1398
- " });",
1399
- " assert.deepEqual(warnings, []);"
1400
- ]),
1401
- "});",
1402
- ""
1403
- ];
1404
- case "search":
1405
- return [
1406
- `test(${JSON.stringify(`${extensionName} registers and invokes search primitives`)}, async () => {`,
1407
- ...withHarnessCleanup([
1408
- ` ext.assertSearchProvider({ provider: ${JSON.stringify(searchProviderName)}, extensionName: ${JSON.stringify(extensionName)} });`,
1409
- ` ext.assertVectorStoreAdapter({ adapter: ${JSON.stringify(vectorAdapterName)}, extensionName: ${JSON.stringify(extensionName)} });`,
1410
- "",
1411
- " // The starter provider reads only document title/id, so `settings` is a minimal",
1412
- " // typed stub and `documents` carry just the fields it inspects.",
1413
- " const query = await ext.runSearchProvider({",
1414
- ` provider: ${JSON.stringify(searchProviderName)},`,
1415
- ' operation: "query",',
1416
- " context: {",
1417
- ' query: "sync",',
1418
- ' mode: "semantic",',
1419
- ' tokens: ["sync"],',
1420
- " options: {},",
1421
- " settings: {} as PmSettings,",
1422
- " documents: [",
1423
- ' { metadata: { id: "pm-1", title: "Sync external context" }, body: "" },',
1424
- ' { metadata: { id: "pm-2", title: "Unrelated task" }, body: "" },',
1425
- " ] as ItemDocument[],",
1426
- " },",
1427
- " });",
1428
- ' assert.deepEqual(query, { hits: [{ id: "pm-1", score: 1, matched_fields: ["title"] }] });',
1429
- "",
1430
- " const embedding = await ext.runSearchProvider({",
1431
- ` provider: ${JSON.stringify(searchProviderName)},`,
1432
- ' operation: "embed",',
1433
- ' context: { input: "abc", settings: {} as PmSettings, model: "starter-model" },',
1434
- " });",
1435
- " assert.deepEqual(embedding, [3]);",
1436
- "",
1437
- " const vectorHits = await ext.runVectorStoreAdapter({",
1438
- ` adapter: ${JSON.stringify(vectorAdapterName)},`,
1439
- ' operation: "query",',
1440
- " context: { vector: [0.1, 0.2], limit: 2, settings: {} as PmSettings },",
1441
- " });",
1442
- ' assert.deepEqual(vectorHits, [{ id: "starter-vector-hit", score: 2 }]);'
1443
- ]),
1444
- "});",
1445
- ""
1446
- ];
1447
- case "importers":
1448
- return [
1449
- `test(${JSON.stringify(`${extensionName} registers and invokes import/export primitives`)}, async () => {`,
1450
- ...withHarnessCleanup([
1451
- ` ext.assertImporter({ importer: ${JSON.stringify(adapterName)}, extensionName: ${JSON.stringify(extensionName)} });`,
1452
- ` ext.assertExporter({ exporter: ${JSON.stringify(adapterName)}, extensionName: ${JSON.stringify(extensionName)} });`,
1453
- "",
1454
- " const imported = await ext.runImporter({",
1455
- ` importer: ${JSON.stringify(adapterName)},`,
1456
- ' options: { source: "tickets" },',
1457
- ' args: ["batch-1"],',
1458
- " });",
1459
- " assert.equal(imported.handled, true);",
1460
- ' assert.deepEqual(imported.result, { imported: 1, source: "tickets", args: ["batch-1"] });',
1461
- "",
1462
- " const exported = await ext.runExporter({",
1463
- ` exporter: ${JSON.stringify(adapterName)},`,
1464
- ' options: { destination: "archive" },',
1465
- ' args: ["done"],',
1466
- " });",
1467
- " assert.equal(exported.handled, true);",
1468
- ' assert.deepEqual(exported.result, { exported: true, destination: "archive", args: ["done"] });'
1469
- ]),
1470
- "});",
1471
- ""
1472
- ];
1473
- case "schema":
1474
- return [
1475
- `test(${JSON.stringify(`${extensionName} registers and runs its custom schema`)}, async () => {`,
1476
- ...withHarnessCleanup(buildSchemaCapabilityAssertionLines({
1477
- extensionName,
1478
- itemTypeName,
1479
- itemTypeFolder,
1480
- fieldName,
1481
- migrationId
1482
- })),
1483
- "});",
1484
- ""
1485
- ];
1486
- case "profile":
1487
- return [
1488
- `test(${JSON.stringify(`${extensionName} registers its project profile`)}, async () => {`,
1489
- ...withHarnessCleanup(buildProfileCapabilityAssertionLines(extensionName)),
1490
- "});",
1491
- ""
1492
- ];
1493
- case "renderers":
1494
- return [
1495
- `test(${JSON.stringify(`${extensionName} registers and invokes its renderer override`)}, async () => {`,
1496
- ...withHarnessCleanup([
1497
- " // assertRendererOverride throws unless a renderer is registered for the format,",
1498
- " // so reaching the next line already proves the wiring.",
1499
- ` const override = ext.assertRendererOverride({ format: "toon", extensionName: ${JSON.stringify(extensionName)} });`,
1500
- ' assert.equal(override.format, "toon");',
1501
- "",
1502
- " // runRendererOverride renders through pm's real runner. The override customizes",
1503
- " // only THIS package's command output and returns a string the host uses verbatim.",
1504
- " const rendered = await ext.runRendererOverride({",
1505
- ' format: "toon",',
1506
- ` command: ${JSON.stringify(commandName)},`,
1507
- " result: { ok: true },",
1508
- " });",
1509
- " assert.equal(rendered.overridden, true);",
1510
- ` assert.equal(rendered.rendered, ${JSON.stringify(`${extensionName}: `)} + JSON.stringify({ ok: true }));`,
1511
- "",
1512
- " // Output for any other command passes through to pm's default renderer.",
1513
- " const passthrough = await ext.runRendererOverride({",
1514
- ' format: "toon",',
1515
- ' command: "list",',
1516
- " result: { ok: true },",
1517
- " });",
1518
- " assert.equal(passthrough.overridden, false);"
1519
- ]),
1520
- "});",
1521
- ""
1522
- ];
1523
- case "parser":
1524
- return [
1525
- `test(${JSON.stringify(`${extensionName} rewrites command options via its parser override`)}, async () => {`,
1526
- ...withHarnessCleanup([
1527
- " // assertParserOverride throws unless a parser is registered for the command, so",
1528
- " // reaching the next line already proves the wiring.",
1529
- ` ext.assertParserOverride({ command: ${JSON.stringify(commandName)}, extensionName: ${JSON.stringify(extensionName)} });`,
1530
- "",
1531
- " // runParserOverride runs the override through pm's real parser runner and returns",
1532
- " // the rewritten context. The starter rewrites the deprecated `shout` alias to the",
1533
- " // canonical `upper` flag.",
1534
- " const result = await ext.runParserOverride({",
1535
- ` command: ${JSON.stringify(commandName)},`,
1536
- " args: [],",
1537
- " options: { shout: true },",
1538
- " global: {},",
1539
- ' pm_root: "",',
1540
- " });",
1541
- " assert.equal(result.overridden, true);",
1542
- " assert.deepEqual(result.context.options, { upper: true });",
1543
- "",
1544
- " // End to end: feed the rewritten options into the command handler to prove",
1545
- " // `pm <command> --shout` surfaces the normalized `upper` flag in the result.",
1546
- ` const invocation = await ext.runCommand({ command: ${JSON.stringify(commandName)}, options: result.context.options });`,
1547
- " assert.equal(invocation.handled, true);",
1548
- " assert.deepEqual(invocation.result, {",
1549
- " ok: true,",
1550
- ` source: ${JSON.stringify(extensionName)},`,
1551
- ` command: ${JSON.stringify(commandName)},`,
1552
- " upper: true,",
1553
- ' message: "Starter extension scaffold is active.",',
1554
- " });"
1555
- ]),
1556
- "});",
1557
- ""
1558
- ];
1559
- case "preflight":
1560
- return [
1561
- `test(${JSON.stringify(`${extensionName} returns a preflight gate decision via its override`)}, async () => {`,
1562
- ...withHarnessCleanup([
1563
- " // assertPreflightOverride throws unless a preflight override is registered, so",
1564
- " // reaching the next line already proves the wiring.",
1565
- ` ext.assertPreflightOverride({ extensionName: ${JSON.stringify(extensionName)} });`,
1566
- "",
1567
- " // runPreflightOverride runs the override through pm's real runner with a synthetic",
1568
- " // gate decision. The starter echoes the decision unchanged; replace the",
1569
- " // values/assertions with your real policy.",
1570
- " const decision = {",
1571
- " enforce_item_format_gate: true,",
1572
- " run_preflight_item_format_sync: false,",
1573
- " run_extension_migrations: true,",
1574
- " enforce_mandatory_migration_gate: false,",
1575
- " };",
1576
- " const result = await ext.runPreflightOverride({",
1577
- ` command: ${JSON.stringify(commandName)},`,
1578
- " args: [],",
1579
- " options: {},",
1580
- " global: {},",
1581
- ' pm_root: "",',
1582
- " decision,",
1583
- " });",
1584
- " assert.equal(result.overridden, true);",
1585
- " assert.deepEqual(result.decision, decision);"
1586
- ]),
1587
- "});",
1588
- ""
1589
- ];
1590
- case "services":
1591
- return [
1592
- `test(${JSON.stringify(`${extensionName} customizes command output via its service override`)}, async () => {`,
1593
- ...withHarnessCleanup([
1594
- " // assertServiceOverride throws unless a service override is registered for the",
1595
- " // service, so reaching the next line proves the wiring.",
1596
- ` ext.assertServiceOverride({ service: "output_format", extensionName: ${JSON.stringify(extensionName)} });`,
1597
- "",
1598
- " // runServiceOverride runs the override through pm's real service runner. The",
1599
- " // override customizes only THIS package's command output (handled), passing every",
1600
- " // other command through (not handled).",
1601
- " const handled = await ext.runServiceOverride({",
1602
- ' service: "output_format",',
1603
- ` command: ${JSON.stringify(commandName)},`,
1604
- " payload: { ok: true },",
1605
- " });",
1606
- " assert.equal(handled.handled, true);",
1607
- ` assert.deepEqual(handled.result, { rendered_by: ${JSON.stringify(extensionName)}, payload: { ok: true } });`,
1608
- "",
1609
- " // Output for any other command passes through to pm's default formatter.",
1610
- " const passthrough = await ext.runServiceOverride({",
1611
- ' service: "output_format",',
1612
- ' command: "list",',
1613
- " payload: { ok: true },",
1614
- " });",
1615
- " assert.equal(passthrough.handled, false);"
1616
- ]),
1617
- "});",
1618
- ""
1619
- ];
1620
- }
1621
- }
1622
- function buildDeclarativeSampleTestSource(extensionName, commandName, capability) {
1623
- const parserEnabled = capability === "parser";
1624
- const capabilitiesLiteral = JSON.stringify([...SCAFFOLD_MANIFEST_CAPABILITIES[capability]].sort());
1625
- return [
1626
- 'import assert from "node:assert/strict";',
1627
- 'import { test } from "node:test";',
1628
- 'import { assertExtensionDeactivated, assertExtensionPreflight, createExtensionTestHarness } from "@unbrained/pm-cli/sdk/testing";',
1629
- // The search sample's synthetic query/vector contexts reference these SDK types
1630
- // for their typed-stub fixtures; other capabilities need no extra type imports.
1631
- ...capability === "search" ? ['import type { ItemDocument, PmSettings } from "@unbrained/pm-cli/sdk";'] : [],
1632
- 'import extension, { blueprint } from "./index.ts";',
1633
- "",
1634
- ...SAMPLE_HARNESS_CLEANUP_LINES,
1635
- `test(${JSON.stringify(`${extensionName} passes author-time preflight`)}, () => {`,
1636
- " // assertExtensionPreflight is the author-time capstone: it lints the blueprint,",
1637
- " // synthesizes the least-privilege manifest from `identity`, and checks the version",
1638
- " // bounds against `target` in one call, throwing on any blocking finding. It returns",
1639
- " // the full report so you can inspect the derived data.",
1640
- " const report = assertExtensionPreflight(blueprint, {",
1641
- " identity: {",
1642
- ` name: ${JSON.stringify(extensionName)},`,
1643
- ' version: "0.1.0",',
1644
- ' entry: "./index.ts",',
1645
- " priority: 0,",
1646
- ` pm_min_version: ${JSON.stringify(SCAFFOLD_PM_MIN_VERSION)},`,
1647
- " },",
1648
- ` target: { pmVersion: ${JSON.stringify(SCAFFOLD_PM_MIN_VERSION)} },`,
1649
- " });",
1650
- " // The capability set is DERIVED from the blueprint, never hand-synced. Keep",
1651
- " // manifest.json's `capabilities` equal to this list (set match, sorted).",
1652
- ` assert.deepEqual(report.capabilities, ${capabilitiesLiteral});`,
1653
- ` assert.deepEqual(report.manifest?.capabilities, ${capabilitiesLiteral});`,
1654
- "});",
1655
- "",
1656
- `test(${JSON.stringify(`${extensionName} registers and runs its starter command`)}, async () => {`,
1657
- " // createExtensionTestHarness activates the composed module once and binds the",
1658
- " // assert*/run*/deactivate helpers to the right activation sub-registry, so you",
1659
- " // never thread activation.registrations vs activation.commands by hand.",
1660
- " // `capabilities` mirrors manifest.json so the in-memory activation grants what the",
1661
- " // blueprint needs.",
1662
- " const ext = await createExtensionTestHarness(extension, {",
1663
- ` name: ${JSON.stringify(extensionName)},`,
1664
- ` capabilities: ${capabilitiesLiteral},`,
1665
- " });",
1666
- " let deactivated = false;",
1667
- " try {",
1668
- " // assertCommandContract throws unless the command is registered, so reaching",
1669
- " // the next line already proves the wiring; assert on the returned definition",
1670
- " // to demonstrate inspecting registered metadata.",
1671
- ` const registered = ext.assertCommandContract({ command: ${JSON.stringify(commandName)} });`,
1672
- ' assert.equal(typeof registered.command.description, "string");',
1673
- "",
1674
- " // runCommand invokes the handler through pm's real dispatch engine, so this",
1675
- " // asserts behavior - not just that the command is wired. Replace these",
1676
- " // assertions as you flesh out your command.",
1677
- ` const invocation = await ext.runCommand({ command: ${JSON.stringify(commandName)} });`,
1678
- " assert.equal(invocation.handled, true);",
1679
- " assert.deepEqual(invocation.result, {",
1680
- " ok: true,",
1681
- ` source: ${JSON.stringify(extensionName)},`,
1682
- ` command: ${JSON.stringify(commandName)},`,
1683
- // The parser starter's command surfaces the normalized `upper` flag, false when
1684
- // the command is invoked without `--shout`/`--upper`.
1685
- ...parserEnabled ? [" upper: false,"] : [],
1686
- ' message: "Starter extension scaffold is active.",',
1687
- " });",
1688
- " // deactivate runs pm's real teardown engine over the module; exactly one",
1689
- " // extension tears down with no failures.",
1690
- " const teardown = await ext.deactivate();",
1691
- " assertExtensionDeactivated(teardown);",
1692
- " deactivated = true;",
1693
- ...SAMPLE_HARNESS_FINALLY_LINES,
1694
- "});",
1695
- "",
1696
- ...buildDeclarativeCapabilityTestBlock(extensionName, commandName, capability, capabilitiesLiteral)
1697
- ].join("\n");
1698
- }
1699
- function buildDeclarativePackageReadme(packageName, commandName, capability) {
1700
- const manifestBullet = buildScaffoldManifestBullet(capability, "package");
1701
- const activationSection = buildScaffoldActivationReadmeSection(capability, "package");
1702
- return [
1703
- `# ${packageName}`,
1704
- "",
1705
- "Generated by `pm package init --declarative`.",
1706
- "",
1707
- "## Included Files",
1708
- "- `package.json`: package metadata, `typecheck`/`test` scripts, and `pm` resource manifest.",
1709
- manifestBullet,
1710
- `- \`index.ts\`: the TypeScript manifest entry \u2014 a \`defineExtensionBlueprint\` blueprint (${DECLARATIVE_ENTRYPOINT_SURFACE_PHRASE[capability]}) composed into the runtime module by \`composeExtension\`, plus a \`deactivate\` teardown stub.`,
1711
- "- `index.test.ts`: sample `node:test` suite covering author-time preflight (`assertExtensionPreflight`) and runtime surface invocation/teardown via `createExtensionTestHarness`.",
1712
- TSCONFIG_BULLET,
1713
- "- `.gitignore`: ignores `node_modules/`, logs, and the TypeScript build cache.",
1714
- "",
1715
- "## Quick Start",
1716
- "This package is authored AND loaded as TypeScript: the manifest `entry` is",
1717
- "`./index.ts` and pm imports it directly via Node's native type stripping",
1718
- "(Node >=22.18), so there is no build step \u2014 install and run:",
1719
- "```bash",
1720
- "npm install",
1721
- "pm install --project <package-path>",
1722
- `pm ${commandName}`,
1723
- "pm package doctor --project --detail summary",
1724
- "```",
1725
- "",
1726
- "## Declarative Authoring",
1727
- "`index.ts` uses the SDK's declarative authoring loop instead of an imperative",
1728
- "`activate` body. You describe WHAT the package registers as an",
1729
- "`ExtensionBlueprint` and `composeExtension` generates the `activate` that wires",
1730
- "every surface in order:",
1731
- "- The `define*` builders author each surface with literal-type preservation and",
1732
- " contextual handler inference (`defineCommand`, `defineSearchProvider`,",
1733
- " `defineItemType`, `defineParserOverride`, ...).",
1734
- `- \`defineExtensionBlueprint({ ... })\` collects the definitions into the blueprint;`,
1735
- ` this starter populates ${DECLARATIVE_CAPABILITY_BLUEPRINT_FIELDS[capability]}. Add more`,
1736
- " fields as the package grows.",
1737
- "- `composeExtension(blueprint)` is the default export \u2014 the runtime module pm",
1738
- " loads. Its generated `activate` requires exactly the capabilities the blueprint",
1739
- " derives, so `manifest.json`'s `capabilities` never drift.",
1740
- "",
1741
- "## Validate the Package",
1742
- "`npm install` pulls the peer SDK and TypeScript. `npm test` is the default",
1743
- "validation gate: it type-checks the package, then runs the colocated sample:",
1744
- "```bash",
1745
- "npm install",
1746
- "npm test",
1747
- "```",
1748
- "`index.test.ts` exercises both authoring capstones: `assertExtensionPreflight`",
1749
- "(the author-time lint + manifest synthesis + version-compatibility check over the",
1750
- "exported `blueprint`) and `createExtensionTestHarness` (the runtime fixture whose",
1751
- "`assert*`/`run*`/`deactivate` methods bind to the right activation sub-registry).",
1752
- "`npm run typecheck` is available when you only want the SDK contract check.",
1753
- "`npm run test:runtime` runs just `node --test`, which strips types on load and",
1754
- "executes `index.test.ts` directly against the `@unbrained/pm-cli/sdk/testing`",
1755
- "helpers - no compile step and no extra test runner required.",
1756
- ...activationSection,
1757
- "",
1758
- "## Compatibility Bounds",
1759
- "`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:",
1760
- `- \`manifest_version\` (integer): manifest schema generation. Leave at \`${SCAFFOLD_MANIFEST_VERSION}\` unless you adopt a newer manifest schema.`,
1761
- `- \`pm_min_version\` (string): lowest pm CLI version that may load this package. Scaffolded as \`${SCAFFOLD_PM_MIN_VERSION}\`. The loader blocks the package on older CLIs.`,
1762
- "- `pm_max_version` (string, optional): highest pm CLI version that may load this package. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the package when the CLI exceeds this bound.",
1763
- "",
1764
- "## Policy Metadata",
1765
- 'The starter command is pure compute, so `manifest.json` declares `trusted: true`, `sandbox_profile: "strict"`, and all six permission keys as `false`. Keep that least-privilege shape for pure packages; relax only the specific permission your package actually needs and verify with `pm package doctor --project --detail deep --trace`.',
1766
- "",
1767
- "## Notes",
1768
- "- Author in `index.ts`; pm loads it directly (no build), so edits take effect on the next install/reload \u2014 there is no `.js` to regenerate.",
1769
- "- Move larger runtimes into sibling or subdirectory `*.ts` modules and import them with their real `.ts` extension; `tsconfig.json` type-checks every `*.ts` in the package (recursively).",
1770
- "- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.",
1771
- ""
1772
- ].join("\n");
1773
- }
1774
- function buildScaffoldSnippetNames(extensionName) {
1775
- const itemTypeName = extensionName;
1776
- const itemTypeAlias = extensionName.replace(/-/g, "");
1777
- return {
1778
- searchProviderName: `${extensionName}-search`,
1779
- vectorAdapterName: `${extensionName}-vector`,
1780
- adapterName: `${extensionName.replace(/-/g, " ")} items`,
1781
- itemTypeName,
1782
- itemTypeFolder: `${extensionName}s`,
1783
- itemTypeAliases: itemTypeAlias === itemTypeName ? [] : [itemTypeAlias],
1784
- fieldName: `${extensionName.replace(/-/g, "_")}_note`,
1785
- migrationId: `${extensionName}-0001-init`
1786
- };
1787
- }
1788
- function buildDefineBuilderImports(capability) {
1789
- return [
1790
- "defineCommand",
1791
- ...capability === "hooks" ? ["defineAfterCommandHook"] : [],
1792
- ...capability === "search" ? ["defineSearchProvider", "defineVectorStoreAdapter"] : [],
1793
- ...capability === "importers" ? ["defineImporter", "defineExporter"] : [],
1794
- ...capability === "schema" ? ["defineItemType", "defineItemField", "defineMigration"] : [],
1795
- ...capability === "profile" ? ["defineProjectProfile"] : [],
1796
- ...capability === "renderers" ? ["defineRendererOverride"] : [],
1797
- ...capability === "parser" ? ["defineParserOverride"] : [],
1798
- ...capability === "preflight" ? ["definePreflightOverride"] : [],
1799
- ...capability === "services" ? ["defineServiceOverride"] : []
1800
- ].join(", ");
1801
- }
1802
- function buildDefineBuilderExports(extensionName, commandName, capability, names) {
1803
- const lines = [
1804
- "export const pingCommand = defineCommand({",
1805
- ` name: ${JSON.stringify(commandName)},`,
1806
- ' description: "Starter scaffold command. Replace with your own behavior.",',
1807
- // The parser starter's command declares the flags its override normalizes so
1808
- // the demo is runnable through `pm <command> --shout`, and surfaces the
1809
- // canonical `upper` flag in the result.
1810
- ...capability === "parser" ? [
1811
- " flags: [",
1812
- ' { long: "--shout", value_type: "boolean", description: "Deprecated alias for --upper." },',
1813
- ' { long: "--upper", value_type: "boolean", description: "Canonical flag the parser produces." },',
1814
- " ],",
1815
- " run: (context) => ({ ok: true, command: context.command, upper: context.options.upper === true }),"
1816
- ] : [" run: (context) => ({ ok: true, command: context.command }),"],
1817
- "});"
1818
- ];
1819
- if (capability === "hooks") {
1820
- lines.push("", "export const afterCommandHook = defineAfterCommandHook((context) => {", " if (!context.ok) return;", " // React to context.affected here as your package grows.", "});");
1821
- }
1822
- if (capability === "search") {
1823
- lines.push("", "export const searchProvider = defineSearchProvider({", ` name: ${JSON.stringify(names.searchProviderName)},`, " query: async (context) => ({", " hits: context.documents", ' .filter((document) => String(document.metadata.title ?? "").toLowerCase().includes(context.query.toLowerCase()))', ' .map((document) => ({ id: document.metadata.id, score: 1, matched_fields: ["title"] })),', " }),", " embed: async (context) => [context.input.length],", "});", "", "export const vectorStoreAdapter = defineVectorStoreAdapter({", ` name: ${JSON.stringify(names.vectorAdapterName)},`, ' query: async (context) => [{ id: "starter-vector-hit", score: context.limit }],', " upsert: async (context) => ({ upserted: context.points.length }),", " delete: async (context) => ({ deleted: context.ids.length }),", "});");
1824
- }
1825
- if (capability === "importers") {
1826
- lines.push("", "export const importer = defineImporter(async (context) => ({", " imported: 1,", ' source: context.options.source ?? "starter",', " args: context.args,", "}));", "", "export const exporter = defineExporter(async (context) => ({", " exported: true,", ' destination: context.options.destination ?? "stdout",', " args: context.args,", "}));");
1827
- }
1828
- if (capability === "schema") {
1829
- lines.push("", `export const noteField = defineItemField({ name: ${JSON.stringify(names.fieldName)}, type: "string", optional: true });`, "", "export const itemType = defineItemType({", ` name: ${JSON.stringify(names.itemTypeName)},`, ` folder: ${JSON.stringify(names.itemTypeFolder)},`, ` aliases: ${JSON.stringify(names.itemTypeAliases)},`, " required_create_fields: [],", "});", "", "export const initMigration = defineMigration({", ` id: ${JSON.stringify(names.migrationId)},`, ` description: ${JSON.stringify(`Initialize ${extensionName} schema state.`)},`, " mandatory: false,", " run: async (context) => ({ migrated: true, id: context.id }),", "});");
1830
- }
1831
- if (capability === "profile") {
1832
- lines.push("", "export const starterProfile = defineProjectProfile({", ` name: ${JSON.stringify(extensionName)},`, ` title: ${JSON.stringify(`${extensionName} archetype`)},`, ' summary: "Starter project profile. Replace these dimensions with your own archetype.",', " types: [", ` { name: ${JSON.stringify(names.itemTypeName)}, folder: ${JSON.stringify(names.itemTypeFolder)} },`, " ],", " // ...plus statuses, fields, workflows, config, templates, and packages.", "});");
1833
- }
1834
- if (capability === "renderers") {
1835
- lines.push("", "export const toonRenderer = defineRendererOverride((context) => {", ` if (context.command !== ${JSON.stringify(commandName)}) return null;`, ` return ${JSON.stringify(`${extensionName}: `)} + JSON.stringify(context.result);`, "});");
1836
- }
1837
- if (capability === "parser") {
1838
- lines.push("", "export const pingParser = defineParserOverride((context) => {", " const options = { ...context.options };", " if (options.shout === true) options.upper = true;", " delete options.shout;", " return { options };", "});");
1839
- }
1840
- if (capability === "preflight") {
1841
- lines.push("", "// Return a delta of the gate-decision keys you want to change; returning", "// context.decision unchanged is a safe no-op (e.g. { run_extension_migrations: false }).", "export const preflightOverride = definePreflightOverride((context) => context.decision);");
1842
- }
1843
- if (capability === "services") {
1844
- lines.push("", "export const outputService = defineServiceOverride((context) => {", ` if (context.command !== ${JSON.stringify(commandName)}) return context.payload;`, ` return { rendered_by: ${JSON.stringify(extensionName)}, payload: context.payload };`, "});");
1845
- }
1846
- return lines;
1847
- }
1848
- function buildDefineBuilderActivate(commandName, capability, names) {
1849
- const lines = [];
1850
- if (capability === "renderers") {
1851
- lines.push(' api.registerRenderer("toon", toonRenderer);');
1852
- }
1853
- if (capability === "parser") {
1854
- lines.push(` api.registerParser(${JSON.stringify(commandName)}, pingParser);`);
1855
- }
1856
- if (capability === "preflight") {
1857
- lines.push(" api.registerPreflight(preflightOverride);");
1858
- }
1859
- if (capability === "services") {
1860
- lines.push(' api.registerService("output_format", outputService);');
1861
- }
1862
- if (capability === "hooks") {
1863
- lines.push(" api.hooks.afterCommand(afterCommandHook);");
1864
- }
1865
- if (capability === "search") {
1866
- lines.push(" api.registerSearchProvider(searchProvider);", " api.registerVectorStoreAdapter(vectorStoreAdapter);");
1867
- }
1868
- if (capability === "schema") {
1869
- lines.push(" api.registerItemFields([noteField]);", " api.registerItemTypes([itemType]);", " api.registerMigration(initMigration);");
1870
- }
1871
- if (capability === "profile") {
1872
- lines.push(" api.registerProfile(starterProfile);");
1873
- }
1874
- if (capability === "importers") {
1875
- lines.push(` api.registerImporter(${JSON.stringify(names.adapterName)}, importer, {`, ` action: ${JSON.stringify(`${names.adapterName} import`)},`, ' description: "Import starter records into pm context.",', " flags: [", " {", ' long: "--source",', ' value_name: "name",', ' value_type: "string",', ' description: "Source name or path to import from.",', " },", " ],", " });", ` api.registerExporter(${JSON.stringify(names.adapterName)}, exporter, {`, ` action: ${JSON.stringify(`${names.adapterName} export`)},`, ' description: "Export pm context into starter records.",', " flags: [", " {", ' long: "--destination",', ' value_name: "name",', ' value_type: "string",', ' description: "Destination name or path to export to.",', " },", " ],", " });");
1876
- }
1877
- return lines;
1878
- }
1879
- function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary, capability = "commands", declarative = false) {
1880
- const packageName = `pm-${extensionName}`;
1881
- const capabilities = SCAFFOLD_MANIFEST_CAPABILITIES[capability];
1882
- const activationCommands = buildScaffoldActivationCommands(extensionName, commandName, capability);
1883
- const manifest = `${JSON.stringify({
1884
- name: extensionName,
1885
- version: "0.1.0",
1886
- entry: "./index.ts",
1887
- manifest_version: SCAFFOLD_MANIFEST_VERSION,
1888
- pm_min_version: SCAFFOLD_PM_MIN_VERSION,
1889
- trusted: true,
1890
- sandbox_profile: "strict",
1891
- permissions: { ...SCAFFOLD_DECLARED_PERMISSIONS },
1892
- capabilities,
1893
- // Declares the exact command paths `activate` registers so pm activates
1894
- // this package lazily — only when an invoked command matches — mirroring
1895
- // every first-party bundled package. Keep it in sync with the entrypoint.
1896
- // The schema and profile starters omit this field (empty list) so their
1897
- // global contribution — a custom item type/field, or a project profile
1898
- // resolved by `pm profile` — stays available to built-in commands (see
1899
- // buildScaffoldActivationCommands).
1900
- ...activationCommands.length > 0 ? { activation: { commands: activationCommands } } : {}
1901
- }, null, 2)}
1902
- `;
1903
- const entrypoint = [
1904
- 'import type { ExtensionApi } from "@unbrained/pm-cli/sdk";',
1905
- "",
1906
- "export function activate(api: ExtensionApi): void {",
1907
- ...buildActivateBodyLines(extensionName, commandName, capability),
1908
- "}",
1909
- "",
1910
- "// `deactivate` is the teardown counterpart to `activate`: pm runs it on host",
1911
- "// shutdown/reload (e.g. the MCP server between requests) to release anything",
1912
- "// `activate` opened - timers, connections, caches. This starter holds no such",
1913
- "// resources, so it stays a documented no-op; add cleanup here as you grow.",
1914
- "export function deactivate(): void {}",
1915
- "",
1916
- "export default {",
1917
- " activate,",
1918
- " deactivate,",
1919
- "};",
1920
- ""
1921
- ].join("\n");
1922
- const tsconfig = `${JSON.stringify(SCAFFOLD_TSCONFIG, null, 2)}
1923
- `;
1924
- const entrypointBullet = ENTRYPOINT_BULLETS[capability];
1925
- const manifestBullet = buildScaffoldManifestBullet(capability, vocabulary);
1926
- if (vocabulary === "package") {
1927
- const packageJson = `${JSON.stringify({
1928
- name: packageName,
1929
- version: "0.1.0",
1930
- private: true,
1931
- type: "module",
1932
- keywords: ["pm-package"],
1933
- engines: {
1934
- node: SCAFFOLD_NODE_ENGINE
1935
- },
1936
- // There is no build step: pm loads the `./index.ts` manifest entry
1937
- // directly via Node's native type stripping (Node >=22.18). `typecheck`
1938
- // validates the source against the SDK contracts (`tsc --noEmit`), and
1939
- // `test` is the self-validating author gate: typecheck first, then run
1940
- // the colocated sample with Node's built-in runner (which strips types
1941
- // on load) against the peer SDK testing helpers — no third-party test
1942
- // runner or compile output required. `test:runtime` remains available
1943
- // for tight loops after a separate `npm run typecheck`.
1944
- scripts: {
1945
- typecheck: "tsc --noEmit",
1946
- "test:runtime": "node --test",
1947
- test: "npm run typecheck && npm run test:runtime"
1948
- },
1949
- peerDependencies: {
1950
- "@unbrained/pm-cli": `>=${SCAFFOLD_PM_MIN_VERSION}`
1951
- },
1952
- devDependencies: {
1953
- "@types/node": SCAFFOLD_TYPES_NODE_VERSION,
1954
- typescript: SCAFFOLD_TYPESCRIPT_VERSION
1955
- },
1956
- pm: {
1957
- aliases: [extensionName],
1958
- extensions: ["."],
1959
- docs: ["README.md"],
1960
- examples: ["README.md"],
1961
- catalog: {
1962
- display_name: extensionName,
1963
- category: "workflow",
1964
- summary: "Starter pm package scaffold.",
1965
- tags: ["starter"]
1966
- }
1967
- }
1968
- }, null, 2)}
1969
- `;
1970
- const sampleTest = buildSampleTestSource(extensionName, commandName, capability);
1971
- const sampleTestBullet = SAMPLE_TEST_BULLETS[capability];
1972
- const gitignore = [
1973
- "node_modules/",
1974
- "*.log",
1975
- "*.tsbuildinfo",
1976
- ""
1977
- ].join("\n");
1978
- const names = buildScaffoldSnippetNames(extensionName);
1979
- const defineBuilderImports = buildDefineBuilderImports(capability);
1980
- const defineBuilderSnippet = [
1981
- "```ts",
1982
- `import { ${defineBuilderImports} } from "@unbrained/pm-cli/sdk";`,
1983
- 'import type { ExtensionApi } from "@unbrained/pm-cli/sdk";',
1984
- "",
1985
- ...buildDefineBuilderExports(extensionName, commandName, capability, names),
1986
- "",
1987
- "export function activate(api: ExtensionApi): void {",
1988
- " api.registerCommand(pingCommand);",
1989
- ...buildDefineBuilderActivate(commandName, capability, names),
1990
- "}",
1991
- "",
1992
- "export function deactivate(): void {}",
1993
- "",
1994
- "export default { activate, deactivate };",
1995
- "```"
1996
- ];
1997
- const packageReadme = [
1998
- `# ${packageName}`,
1999
- "",
2000
- "Generated by `pm package init`.",
2001
- "",
2002
- "## Included Files",
2003
- "- `package.json`: package metadata, `typecheck`/`test` scripts, and `pm` resource manifest.",
2004
- manifestBullet,
2005
- entrypointBullet,
2006
- sampleTestBullet,
2007
- TSCONFIG_BULLET,
2008
- "- `.gitignore`: ignores `node_modules/`, logs, and the TypeScript build cache.",
2009
- "",
2010
- "## Quick Start",
2011
- "This package is authored AND loaded as TypeScript: the manifest `entry` is",
2012
- "`./index.ts` and pm imports it directly via Node's native type stripping",
2013
- "(Node >=22.18), so there is no build step \u2014 install and run:",
2014
- "```bash",
2015
- "npm install",
2016
- "pm install --project <package-path>",
2017
- `pm ${commandName}`,
2018
- "pm package doctor --project --detail summary",
2019
- "```",
2020
- "",
2021
- "## Validate the Package",
2022
- "`npm install` pulls the peer SDK and TypeScript. `npm test` is the default",
2023
- "validation gate: it type-checks the package, then runs the colocated sample:",
2024
- "```bash",
2025
- "npm install",
2026
- "npm test",
2027
- "```",
2028
- "`npm run typecheck` is available when you only want the SDK contract check.",
2029
- "`npm run test:runtime` runs just `node --test`, which strips types on load and",
2030
- "executes `index.test.ts` directly against the `@unbrained/pm-cli/sdk/testing`",
2031
- "helpers - no compile step and no extra test runner required.",
2032
- "",
2033
- "## Authoring With define* Builders",
2034
- "`index.ts` is authored fully in TypeScript so every registration is checked",
2035
- "against the SDK contracts at author time. Use the public SDK authoring",
2036
- "builders for exported definitions you want literal-type preservation,",
2037
- "contextual handler inference, and direct unit tests for:",
2038
- ...defineBuilderSnippet,
2039
- "The builders return their argument unchanged; runtime validation still lives",
2040
- "in `api.register*`, and behavior validation lives in `sdk/testing`.",
2041
- ...PACKAGE_CAPABILITY_README_SECTIONS[capability],
2042
- ...buildScaffoldActivationReadmeSection(capability, "package"),
2043
- "",
2044
- "## Compatibility Bounds",
2045
- "`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:",
2046
- `- \`manifest_version\` (integer): manifest schema generation. Leave at \`${SCAFFOLD_MANIFEST_VERSION}\` unless you adopt a newer manifest schema.`,
2047
- `- \`pm_min_version\` (string): lowest pm CLI version that may load this package. Scaffolded as \`${SCAFFOLD_PM_MIN_VERSION}\`. The loader blocks the package on older CLIs.`,
2048
- "- `pm_max_version` (string, optional): highest pm CLI version that may load this package. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the package when the CLI exceeds this bound.",
2049
- "",
2050
- "## Policy Metadata",
2051
- 'The starter command is pure compute, so `manifest.json` declares `trusted: true`, `sandbox_profile: "strict"`, and all six permission keys as `false`. Keep that least-privilege shape for pure packages; relax only the specific permission your package actually needs and verify with `pm package doctor --project --detail deep --trace`.',
2052
- "",
2053
- "## Notes",
2054
- "- Author in `index.ts`; pm loads it directly (no build), so edits take effect on the next install/reload \u2014 there is no `.js` to regenerate.",
2055
- "- Move larger runtimes into sibling or subdirectory `*.ts` modules and import them with their real `.ts` extension; `tsconfig.json` type-checks every `*.ts` in the package (recursively).",
2056
- "- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.",
2057
- "- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.",
2058
- ""
2059
- ].join("\n");
2060
- return {
2061
- "package.json": packageJson,
2062
- "manifest.json": manifest,
2063
- "index.ts": declarative ? buildDeclarativeEntrypoint(extensionName, commandName, capability) : entrypoint,
2064
- "index.test.ts": declarative ? buildDeclarativeSampleTestSource(extensionName, commandName, capability) : sampleTest,
2065
- "tsconfig.json": tsconfig,
2066
- ".gitignore": gitignore,
2067
- "README.md": declarative ? buildDeclarativePackageReadme(packageName, commandName, capability) : packageReadme
2068
- };
2069
- }
2070
- const readme = [
2071
- `# ${extensionName}`,
2072
- "",
2073
- "Generated by `pm extension init`.",
2074
- "",
2075
- "## Included Files",
2076
- manifestBullet,
2077
- entrypointBullet,
2078
- '- `package.json`: `{ "type": "module" }` marker so the ESM entrypoint loads even when the host project is CommonJS.',
2079
- TSCONFIG_BULLET,
2080
- "",
2081
- "## Quick Start",
2082
- "This extension is authored AND loaded as TypeScript: the manifest `entry` is",
2083
- "`./index.ts` and pm imports it directly via Node's native type stripping",
2084
- "(Node >=22.18), so there is no compile step. Install the dev dependencies for",
2085
- "type-checking, then install and run the extension:",
2086
- "```bash",
2087
- "npm install -D typescript @types/node @unbrained/pm-cli",
2088
- "npx tsc --noEmit",
2089
- "pm extension --install --project <scaffold-path>",
2090
- `pm ${commandName}`,
2091
- "pm extension --doctor --project --detail summary",
2092
- "```",
2093
- ...EXTENSION_CAPABILITY_README_SECTIONS[capability],
2094
- ...buildScaffoldActivationReadmeSection(capability, "extension"),
2095
- "",
2096
- "## Compatibility Bounds",
2097
- "`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:",
2098
- `- \`manifest_version\` (integer): manifest schema generation. Leave at \`${SCAFFOLD_MANIFEST_VERSION}\` unless you adopt a newer manifest schema.`,
2099
- `- \`pm_min_version\` (string): lowest pm CLI version that may load this extension. Scaffolded as \`${SCAFFOLD_PM_MIN_VERSION}\`. The loader blocks the extension on older CLIs.`,
2100
- "- `pm_max_version` (string, optional): highest pm CLI version that may load this extension. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the extension when the CLI exceeds this bound.",
2101
- "",
2102
- "## Policy Metadata",
2103
- 'The starter command is pure compute, so `manifest.json` declares `trusted: true`, `sandbox_profile: "strict"`, and all six permission keys as `false`. Keep that least-privilege shape for pure extensions; relax only the specific permission your extension actually needs and verify with `pm extension --doctor --project --detail deep --trace`.',
2104
- "",
2105
- "- This scaffold is TypeScript ESM source loaded directly by pm (no compile), so it works in package scopes with `type: module`.",
2106
- "- Author in `index.ts` (the manifest entry); edits take effect on the next install/reload \u2014 there is no `.js` to regenerate.",
2107
- "- Release any resources `activate` opens (timers, connections, caches) in the `deactivate` teardown hook.",
2108
- ""
2109
- ].join("\n");
2110
- return {
2111
- "manifest.json": manifest,
2112
- "index.ts": entrypoint,
2113
- // Module-type marker: pm loads index.ts as ESM, and without a nearby
2114
- // package.json Node inherits the host project's module type, breaking
2115
- // installs into "type": "commonjs" projects (pm-r0m4).
2116
- "package.json": `${JSON.stringify({ type: "module" }, null, 2)}
2117
- `,
2118
- "tsconfig.json": tsconfig,
2119
- "README.md": readme
2120
- };
2121
- }
2122
- async function scaffoldExtensionProject(target, vocabulary = "extension", capability = "commands", declarative = false) {
2123
- const normalizedCapability = capability.trim().toLowerCase();
2124
- if (!SCAFFOLD_CAPABILITIES.includes(normalizedCapability)) {
2125
- throw new PmCliError(`Unknown scaffold capability "${capability}". Supported capabilities: ${SCAFFOLD_CAPABILITIES.join(", ")}.`, EXIT_CODE.USAGE);
2126
- }
2127
- const resolvedCapability = normalizedCapability;
2128
- if (declarative && vocabulary !== "package") {
2129
- throw new PmCliError("--declarative scaffolds a package-mode blueprint starter (composeExtension is a runtime SDK import). Use `pm package init`, not `pm extension init`.", EXIT_CODE.USAGE);
2130
- }
2131
- const style = declarative ? "declarative" : "imperative";
2132
- const normalizedTarget = target.trim();
2133
- const targetPath = path.resolve(process.cwd(), normalizedTarget);
2134
- const extensionName = normalizeManagedDirectoryName(path.basename(targetPath));
2135
- const commandName = buildScaffoldCommandName(extensionName);
2136
- const scaffoldFiles = buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary, resolvedCapability, declarative);
2137
- let createdDirectory = false;
2138
- if (await pathExists(targetPath)) {
2139
- const existingTargetStats = await fs.stat(targetPath);
2140
- if (!existingTargetStats.isDirectory()) {
2141
- throw new PmCliError(`Scaffold target "${targetPath}" exists and is not a directory.`, EXIT_CODE.CONFLICT);
2142
- }
2143
- } else {
2144
- await fs.mkdir(targetPath, { recursive: true });
2145
- createdDirectory = true;
2146
- }
2147
- for (const [relativePath, content] of Object.entries(scaffoldFiles)) {
2148
- const absolutePath = path.join(targetPath, relativePath);
2149
- if (!await pathExists(absolutePath)) {
2150
- continue;
2151
- }
2152
- const existingContent = await fs.readFile(absolutePath, "utf8");
2153
- if (existingContent !== content) {
2154
- throw new PmCliError(`Scaffold file "${relativePath}" already exists with different content in "${targetPath}". Choose a new target path or remove conflicting files.`, EXIT_CODE.CONFLICT);
2155
- }
2156
- }
2157
- const files = [];
2158
- for (const [relativePath, content] of Object.entries(scaffoldFiles)) {
2159
- const absolutePath = path.join(targetPath, relativePath);
2160
- if (await pathExists(absolutePath)) {
2161
- files.push({
2162
- path: relativePath,
2163
- status: "unchanged"
2164
- });
2165
- continue;
2166
- }
2167
- await fs.mkdir(path.dirname(absolutePath), { recursive: true });
2168
- await fs.writeFile(absolutePath, content, "utf8");
2169
- files.push({
2170
- path: relativePath,
2171
- status: "created"
2172
- });
2173
- }
2174
- return {
2175
- extension_name: extensionName,
2176
- command_name: commandName,
2177
- capability: resolvedCapability,
2178
- style,
2179
- target_path: targetPath,
2180
- created_directory: createdDirectory,
2181
- files
2182
- };
2183
- }
2184
-
2185
- // dist/cli/commands/extension/describe.js
2186
- !(function() {
2187
- try {
2188
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
2189
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a0c1f4a6-427b-5cd4-bf6e-9bf77f83bf3f");
2190
- } catch (e2) {
2191
- }
2192
- })();
2193
- function layerNameKey(layer, name) {
2194
- return `${layer}:${normalizeExtensionNameForMatch(name)}`;
2195
- }
2196
- function buildExtensionDescribeResult(target, loadResult, activationResult) {
2197
- const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));
2198
- const candidates = [
2199
- ...loadResult.loaded.map((entry) => ({
2200
- name: entry.name,
2201
- layer: entry.layer,
2202
- version: entry.version,
2203
- activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name)) ? "failed" : "ok",
2204
- surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
2205
- })),
2206
- ...loadResult.failed.map((entry) => ({
2207
- name: entry.name,
2208
- layer: entry.layer,
2209
- version: "unknown",
2210
- activation_status: "not_loaded",
2211
- surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name })
2212
- }))
2213
- ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));
2214
- const normalizedTarget = typeof target === "string" ? normalizeExtensionNameForMatch(target) : null;
2215
- const matchedNames = normalizedTarget === null ? null : new Set(loadResult.loaded.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget || typeof entry.source_package === "string" && normalizeExtensionNameForMatch(entry.source_package) === normalizedTarget).map((entry) => normalizeExtensionNameForMatch(entry.name)).concat(normalizedTarget));
2216
- const extensions = matchedNames === null ? candidates : candidates.filter((entry) => matchedNames.has(normalizeExtensionNameForMatch(entry.name)));
2217
- const unionOptions = matchedNames === null ? {} : { extensionNames: [...matchedNames] };
2218
- return {
2219
- target: typeof target === "string" ? target.trim() : null,
2220
- total: extensions.length,
2221
- extensions,
2222
- union: describeExtensionActivation(activationResult, unionOptions)
2223
- };
2224
- }
2225
- var ACTIVATION_STATUS_LABELS = {
2226
- ok: "loaded",
2227
- failed: "activation failed",
2228
- not_loaded: "not loaded"
2229
- };
2230
- function renderExtensionDescribeMarkdown(result, noun) {
2231
- const titleNoun = `${noun[0].toUpperCase()}${noun.slice(1)}`;
2232
- const lines = [`# ${titleNoun} surface reference`, ""];
2233
- lines.push(result.target === null ? `Scope: all loaded ${noun}s` : `Scope: \`${result.target}\``);
2234
- lines.push(`Described: ${result.total} ${noun}${result.total === 1 ? "" : "s"}`, "");
2235
- if (result.extensions.length === 0) {
2236
- lines.push(`_No ${noun}s are loaded._`, "");
2237
- return `${lines.join("\n").trimEnd()}
2238
- `;
2239
- }
2240
- for (const entry of result.extensions) {
2241
- const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;
2242
- lines.push(renderExtensionSurfaceMarkdown(entry.surfaces, { title, headingLevel: 2 }));
2243
- }
2244
- if (result.extensions.length > 1) {
2245
- lines.push(renderExtensionSurfaceMarkdown(result.union, { title: `Union across all described ${noun}s`, headingLevel: 2 }));
2246
- }
2247
- return `${lines.join("\n").trimEnd()}
2248
- `;
2249
- }
2250
-
2251
- export {
2252
- SCAFFOLD_CAPABILITIES,
2253
- scaffoldExtensionProject,
2254
- buildExtensionDescribeResult,
2255
- renderExtensionDescribeMarkdown
2256
- };
2257
- //# sourceMappingURL=chunk-JQXPY7DN.js.map