@unbrained/pm-cli 2026.6.22 → 2026.6.23

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 (416) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cli/commands/completion.js +5 -4
  3. package/dist/cli/commands/completion.js.map +1 -1
  4. package/dist/cli/commands/contracts.js +4 -3
  5. package/dist/cli/commands/contracts.js.map +1 -1
  6. package/dist/cli/commands/extension/describe.d.ts +70 -0
  7. package/dist/cli/commands/extension/describe.js +76 -0
  8. package/dist/cli/commands/extension/describe.js.map +1 -0
  9. package/dist/cli/commands/extension/scaffold.js +50 -2
  10. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  11. package/dist/cli/commands/extension.d.ts +2 -1
  12. package/dist/cli/commands/extension.js +28 -3
  13. package/dist/cli/commands/extension.js.map +1 -1
  14. package/dist/cli/help-content.js +6 -2
  15. package/dist/cli/help-content.js.map +1 -1
  16. package/dist/cli/register-setup.js +10 -2
  17. package/dist/cli/register-setup.js.map +1 -1
  18. package/dist/cli-bundle/chunks/{activity-DXS2XMQU.js → activity-H2LMOSSW.js} +11 -11
  19. package/dist/cli-bundle/chunks/activity-XUZ2AHCW.js +18 -0
  20. package/dist/cli-bundle/chunks/{aggregate-NMYDVQF7.js → aggregate-EGJLZQBI.js} +10 -10
  21. package/dist/cli-bundle/chunks/{aggregate-IHM4KMQ3.js → aggregate-R725FC3S.js} +10 -10
  22. package/dist/cli-bundle/chunks/{append-3HY5G7ET.js → append-5J345QGU.js} +8 -8
  23. package/dist/cli-bundle/chunks/{append-K54MDQYC.js → append-O5HPBMRN.js} +8 -8
  24. package/dist/cli-bundle/chunks/{chunk-GU7YHKYP.js → chunk-2A34E3BA.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-7MPTFYT3.js → chunk-2BFPAUAF.js} +15 -4
  26. package/dist/cli-bundle/chunks/chunk-2BFPAUAF.js.map +1 -0
  27. package/dist/cli-bundle/chunks/{chunk-DHBPJ7VG.js → chunk-2CKH2LMV.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-2LEYMXI6.js → chunk-2RDVQEWV.js} +4 -4
  29. package/dist/cli-bundle/chunks/{chunk-PCH2JTEO.js → chunk-2T3JG6V4.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-TZQKEBKF.js → chunk-34EONI5F.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-DU64SZUQ.js → chunk-3VY3YQO6.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-SFKQAVZA.js → chunk-46G6RSB6.js} +8 -8
  33. package/dist/cli-bundle/chunks/{chunk-DMT4ODVN.js → chunk-4BHT5VDC.js} +2 -2
  34. package/dist/cli-bundle/chunks/{chunk-UKK2VTTH.js → chunk-4KD54S3Z.js} +9 -9
  35. package/dist/cli-bundle/chunks/{chunk-DBQUQ3AS.js → chunk-55ISXAQH.js} +7 -4
  36. package/dist/cli-bundle/chunks/{chunk-DBQUQ3AS.js.map → chunk-55ISXAQH.js.map} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-GGAXE22C.js → chunk-5UVVASSA.js} +6 -6
  38. package/dist/cli-bundle/chunks/{chunk-25XZN3JD.js → chunk-5VOINNKT.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-KRJJPDUO.js → chunk-66MEDTUD.js} +2 -2
  40. package/dist/cli-bundle/chunks/{chunk-MD7XKVWI.js → chunk-7AUB5HNA.js} +7 -7
  41. package/dist/cli-bundle/chunks/{chunk-TJABI6PR.js → chunk-7K2XXO4I.js} +5 -5
  42. package/dist/cli-bundle/chunks/{chunk-AJXYOYJV.js → chunk-7MRQ4HMK.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-THKDPOS5.js → chunk-7SV63ZHD.js} +8 -8
  44. package/dist/cli-bundle/chunks/{chunk-7MALIV5H.js → chunk-7UGEAPRY.js} +9 -9
  45. package/dist/cli-bundle/chunks/{chunk-TIKJAXQW.js → chunk-7XGQXHFB.js} +3 -3
  46. package/dist/cli-bundle/chunks/{chunk-YJICYNAV.js → chunk-AD3A7ZD6.js} +8 -8
  47. package/dist/cli-bundle/chunks/{chunk-FK6MV5F5.js → chunk-AONIHR2C.js} +12 -12
  48. package/dist/cli-bundle/chunks/{chunk-YRLLL5TY.js → chunk-BB6MDVNQ.js} +8 -8
  49. package/dist/cli-bundle/chunks/{chunk-3GL6LTUL.js → chunk-C5AOG6D2.js} +53 -5
  50. package/dist/cli-bundle/chunks/{chunk-3GL6LTUL.js.map → chunk-C5AOG6D2.js.map} +1 -1
  51. package/dist/cli-bundle/chunks/{chunk-I6XE47J2.js → chunk-CE5P2NQR.js} +5 -5
  52. package/dist/cli-bundle/chunks/{chunk-GXBSFKSX.js → chunk-CIIK67GW.js} +4 -4
  53. package/dist/cli-bundle/chunks/{chunk-TRUFOER3.js → chunk-CKGNPJAG.js} +15 -4
  54. package/dist/cli-bundle/chunks/chunk-CKGNPJAG.js.map +7 -0
  55. package/dist/cli-bundle/chunks/{chunk-XKNF3VRJ.js → chunk-DT5LPYOD.js} +5 -5
  56. package/dist/cli-bundle/chunks/{chunk-4SDKF5BG.js → chunk-FIGAZ4Y7.js} +3 -3
  57. package/dist/cli-bundle/chunks/{chunk-CWPBGUC7.js → chunk-FXR67XVQ.js} +2 -2
  58. package/dist/cli-bundle/chunks/{chunk-NIWY4V4Z.js → chunk-G6N5VEOK.js} +3 -3
  59. package/dist/cli-bundle/chunks/{chunk-7GCCDXXN.js → chunk-G6PYHBBR.js} +117 -7
  60. package/dist/cli-bundle/chunks/chunk-G6PYHBBR.js.map +7 -0
  61. package/dist/cli-bundle/chunks/{chunk-C5SWTISA.js → chunk-GAJVRGGA.js} +12 -12
  62. package/dist/cli-bundle/chunks/{chunk-B2KR24R4.js → chunk-H2IP4QLJ.js} +9 -9
  63. package/dist/cli-bundle/chunks/{chunk-VB54F347.js → chunk-H4IIJDE4.js} +2 -2
  64. package/dist/cli-bundle/chunks/{chunk-7PBGTIN3.js → chunk-HFFUQR73.js} +5 -5
  65. package/dist/cli-bundle/chunks/{chunk-RPRFBXND.js → chunk-IB3GYLQE.js} +3 -3
  66. package/dist/cli-bundle/chunks/{chunk-GNDHOR64.js → chunk-IPKJ6B36.js} +6 -6
  67. package/dist/cli-bundle/chunks/{chunk-V4SM4UAL.js → chunk-JR2LV3M4.js} +13 -13
  68. package/dist/cli-bundle/chunks/{chunk-JY25IOEZ.js → chunk-KFWBJPSG.js} +5 -5
  69. package/dist/cli-bundle/chunks/{chunk-D35LTIFR.js → chunk-KQMUV6LX.js} +104 -8
  70. package/dist/cli-bundle/chunks/chunk-KQMUV6LX.js.map +1 -0
  71. package/dist/cli-bundle/chunks/{chunk-Y335KFHD.js → chunk-LRKKONT2.js} +9 -9
  72. package/dist/cli-bundle/chunks/{chunk-QQWEROGS.js → chunk-M4T5DXD5.js} +7 -7
  73. package/dist/cli-bundle/chunks/{chunk-JLSC5NPC.js → chunk-MJTINN54.js} +10 -10
  74. package/dist/cli-bundle/chunks/{chunk-RZZMSY4P.js → chunk-MJTSZKK5.js} +21 -2
  75. package/dist/cli-bundle/chunks/{chunk-RZZMSY4P.js.map → chunk-MJTSZKK5.js.map} +2 -2
  76. package/dist/cli-bundle/chunks/{chunk-4YJA4LGU.js → chunk-MVKFOLLM.js} +52 -4
  77. package/dist/cli-bundle/chunks/{chunk-4YJA4LGU.js.map → chunk-MVKFOLLM.js.map} +2 -2
  78. package/dist/cli-bundle/chunks/{chunk-CR7KFPAQ.js → chunk-NCVCO3NZ.js} +3 -3
  79. package/dist/cli-bundle/chunks/{chunk-CLLVBO3I.js → chunk-NK3UPBVG.js} +2 -2
  80. package/dist/cli-bundle/chunks/{chunk-A25LOPRG.js → chunk-O6LLO73I.js} +2 -2
  81. package/dist/cli-bundle/chunks/{chunk-4JXWVHMN.js → chunk-P77P2ILI.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-I367IDZP.js → chunk-Q2KNGP7C.js} +7 -7
  83. package/dist/cli-bundle/chunks/{chunk-77VKGH4L.js → chunk-QH3PJYON.js} +10 -10
  84. package/dist/cli-bundle/chunks/{chunk-5SESR24H.js → chunk-QL5RVYOA.js} +8 -8
  85. package/dist/cli-bundle/chunks/{chunk-WBSYW3NT.js → chunk-S26C36QC.js} +2 -2
  86. package/dist/cli-bundle/chunks/{chunk-Y4BZEND6.js → chunk-S2RUQSX2.js} +2 -2
  87. package/dist/cli-bundle/chunks/{chunk-NVUATMTC.js → chunk-SBQTAVJZ.js} +3 -3
  88. package/dist/cli-bundle/chunks/{chunk-A7E4ZXG2.js → chunk-SKH7OGE5.js} +2 -2
  89. package/dist/cli-bundle/chunks/{chunk-H6FNDCDI.js → chunk-SKN7LC5W.js} +5 -5
  90. package/dist/cli-bundle/chunks/{chunk-MNGAQB2E.js → chunk-SR3EKWZG.js} +8 -8
  91. package/dist/cli-bundle/chunks/{chunk-PJS2J7Z4.js → chunk-T5472OMV.js} +3 -3
  92. package/dist/cli-bundle/chunks/{chunk-6FQHNHQQ.js → chunk-T72AZDBA.js} +3 -3
  93. package/dist/cli-bundle/chunks/{chunk-YATDFWYK.js → chunk-TQZH6OD6.js} +7 -7
  94. package/dist/cli-bundle/chunks/{chunk-HYQV75IB.js → chunk-U2Z5YUSO.js} +7 -7
  95. package/dist/cli-bundle/chunks/{chunk-KL5ELX2X.js → chunk-UELRKQQU.js} +22 -3
  96. package/dist/cli-bundle/chunks/chunk-UELRKQQU.js.map +1 -0
  97. package/dist/cli-bundle/chunks/{chunk-J2TSPY5L.js → chunk-UVC5LOR7.js} +4 -4
  98. package/dist/cli-bundle/chunks/{chunk-P7ZU73BO.js → chunk-VAYA4XFX.js} +3 -3
  99. package/dist/cli-bundle/chunks/{chunk-47HTJ6BU.js → chunk-VFAQ4LMN.js} +5 -5
  100. package/dist/cli-bundle/chunks/{chunk-WQDX7DVG.js → chunk-W72GHSJE.js} +7 -7
  101. package/dist/cli-bundle/chunks/{chunk-EVPVCE4R.js → chunk-WBRKK5QR.js} +3 -3
  102. package/dist/cli-bundle/chunks/{chunk-YQSWTVZF.js → chunk-WM5ZVBPE.js} +4 -4
  103. package/dist/cli-bundle/chunks/{chunk-NKZOJPXK.js → chunk-WZQWHN4R.js} +3 -3
  104. package/dist/cli-bundle/chunks/{chunk-75VEYQJS.js → chunk-XVF4YARA.js} +3 -3
  105. package/dist/cli-bundle/chunks/{chunk-KBTREGVO.js → chunk-Y4SUQQYH.js} +8 -5
  106. package/dist/cli-bundle/chunks/{chunk-KBTREGVO.js.map → chunk-Y4SUQQYH.js.map} +1 -1
  107. package/dist/cli-bundle/chunks/{chunk-KK4TQ3ZP.js → chunk-YDEXO24S.js} +2 -2
  108. package/dist/cli-bundle/chunks/{chunk-3VLPDG3J.js → chunk-YJ3SUEPD.js} +2 -2
  109. package/dist/cli-bundle/chunks/{chunk-6UPTNMVW.js → chunk-YUDJD3XO.js} +5 -5
  110. package/dist/cli-bundle/chunks/{chunk-K25UDYJ4.js → chunk-ZQ3ZVXX2.js} +2 -2
  111. package/dist/cli-bundle/chunks/{chunk-44O4JIN6.js → chunk-ZRK4O56R.js} +13 -13
  112. package/dist/cli-bundle/chunks/{claim-MPXNVBZQ.js → claim-4KHAA2RN.js} +10 -10
  113. package/dist/cli-bundle/chunks/{claim-SKHJDLW6.js → claim-CSPJFLNH.js} +10 -10
  114. package/dist/cli-bundle/chunks/close-A3EMKBBY.js +15 -0
  115. package/dist/cli-bundle/chunks/{close-4RKSL5L6.js → close-W56IOGYG.js} +8 -8
  116. package/dist/cli-bundle/chunks/{close-many-SXODYBDP.js → close-many-BX5DCSVV.js} +15 -15
  117. package/dist/cli-bundle/chunks/{close-many-AWTPXLHJ.js → close-many-TQU5F4E4.js} +15 -15
  118. package/dist/cli-bundle/chunks/{comments-YYW5P7AG.js → comments-U5KUC4EU.js} +10 -10
  119. package/dist/cli-bundle/chunks/{comments-OOH64LWW.js → comments-VRECH75R.js} +10 -10
  120. package/dist/cli-bundle/chunks/{config-3445MCQQ.js → config-D3OKQO52.js} +8 -8
  121. package/dist/cli-bundle/chunks/{config-LCDMKRB2.js → config-MMJA4LLK.js} +8 -8
  122. package/dist/cli-bundle/chunks/{context-DZMIBIVP.js → context-BLBD3PUB.js} +13 -13
  123. package/dist/cli-bundle/chunks/{context-PJCURODY.js → context-DHLVPXN3.js} +13 -13
  124. package/dist/cli-bundle/chunks/{contracts-7YDFEJB3.js → contracts-C3SZCXXG.js} +7 -5
  125. package/dist/cli-bundle/chunks/contracts-C3SZCXXG.js.map +7 -0
  126. package/dist/cli-bundle/chunks/{contracts-MP2P3HL5.js → contracts-XGVMMPC5.js} +8 -6
  127. package/dist/cli-bundle/chunks/contracts-XGVMMPC5.js.map +1 -0
  128. package/dist/cli-bundle/chunks/{copy-63IQQRRS.js → copy-5D5DX3VK.js} +7 -7
  129. package/dist/cli-bundle/chunks/{copy-TASIH2AZ.js → copy-HHL3K4QP.js} +7 -7
  130. package/dist/cli-bundle/chunks/{create-TGSB5GV4.js → create-IXY43O4H.js} +14 -14
  131. package/dist/cli-bundle/chunks/create-QVGFYA2X.js +30 -0
  132. package/dist/cli-bundle/chunks/{delete-ARILQQLB.js → delete-IBUR3M42.js} +7 -7
  133. package/dist/cli-bundle/chunks/{delete-ZQKBZYNK.js → delete-QQC2FGUH.js} +7 -7
  134. package/dist/cli-bundle/chunks/{deps-NJFJIMQ5.js → deps-KWKRHXIN.js} +7 -7
  135. package/dist/cli-bundle/chunks/{deps-MSHQR2GY.js → deps-VTPO4BSE.js} +7 -7
  136. package/dist/cli-bundle/chunks/{docs-XK2UVUXX.js → docs-7CHFHXLN.js} +9 -9
  137. package/dist/cli-bundle/chunks/{docs-SS4UKYYA.js → docs-IIO3FEUO.js} +9 -9
  138. package/dist/cli-bundle/chunks/{eval-FVZGX5IZ.js → eval-CEYYEPSX.js} +12 -12
  139. package/dist/cli-bundle/chunks/{eval-JOTG2YHU.js → eval-IO7LREOL.js} +12 -12
  140. package/dist/cli-bundle/chunks/{extension-OQPS27B4.js → extension-KCPUWSY2.js} +6 -6
  141. package/dist/cli-bundle/chunks/{extension-NLMS47I4.js → extension-UTTQDUYI.js} +6 -6
  142. package/dist/cli-bundle/chunks/{files-3EVJQZ2N.js → files-TPUL6KWB.js} +9 -9
  143. package/dist/cli-bundle/chunks/{files-Y2P6LN5A.js → files-Z2HHEFGP.js} +9 -9
  144. package/dist/cli-bundle/chunks/{focus-D5ZUPTII.js → focus-JVJCGC2D.js} +8 -8
  145. package/dist/cli-bundle/chunks/{focus-ZPIFTY4R.js → focus-YRNNH7IP.js} +8 -8
  146. package/dist/cli-bundle/chunks/{gc-LXXDY456.js → gc-O5GUO3SU.js} +3 -3
  147. package/dist/cli-bundle/chunks/{gc-RNOEQHSX.js → gc-PYVVEELM.js} +3 -3
  148. package/dist/cli-bundle/chunks/{get-Q3SZGQHD.js → get-ENLTEGTX.js} +11 -11
  149. package/dist/cli-bundle/chunks/{get-W23G7MJX.js → get-X4O3HBEY.js} +11 -11
  150. package/dist/cli-bundle/chunks/{health-5LHSX365.js → health-5EXTY44Q.js} +14 -14
  151. package/dist/cli-bundle/chunks/{health-UDDGJLPP.js → health-BOTB7YSU.js} +14 -14
  152. package/dist/cli-bundle/chunks/{history-6CZVFIUJ.js → history-AJTXLT6S.js} +10 -10
  153. package/dist/cli-bundle/chunks/history-AK3E5Z3C.js +20 -0
  154. package/dist/cli-bundle/chunks/{history-compact-VWUSQH6Z.js → history-compact-43OOUAWD.js} +12 -12
  155. package/dist/cli-bundle/chunks/{history-compact-M35PDQ4G.js → history-compact-46MRHW3I.js} +12 -12
  156. package/dist/cli-bundle/chunks/{history-redact-AJGARHT3.js → history-redact-KUUUVUFM.js} +11 -11
  157. package/dist/cli-bundle/chunks/history-redact-TWIYQV5J.js +21 -0
  158. package/dist/cli-bundle/chunks/{history-repair-5RDMF7K4.js → history-repair-B5PZBOPU.js} +12 -12
  159. package/dist/cli-bundle/chunks/{history-repair-YUAHIPIN.js → history-repair-VQTYOSRS.js} +12 -12
  160. package/dist/cli-bundle/chunks/{init-HASX3YNJ.js → init-BNLVFPRG.js} +11 -11
  161. package/dist/cli-bundle/chunks/init-RCRKW5PL.js +21 -0
  162. package/dist/cli-bundle/chunks/{learnings-M4KA6MQE.js → learnings-MUUU5KMC.js} +10 -10
  163. package/dist/cli-bundle/chunks/{learnings-JNGUIJDK.js → learnings-XSGX52S7.js} +10 -10
  164. package/dist/cli-bundle/chunks/{list-6FMKTIH3.js → list-32U7BSKE.js} +10 -10
  165. package/dist/cli-bundle/chunks/{list-5UU2W24O.js → list-ZEEOHLTQ.js} +10 -10
  166. package/dist/cli-bundle/chunks/{notes-PYCPLA5Y.js → notes-NJ45OZGF.js} +10 -10
  167. package/dist/cli-bundle/chunks/{notes-MODH5CBT.js → notes-OHU25L3M.js} +10 -10
  168. package/dist/cli-bundle/chunks/{plan-DXRIRYRU.js → plan-KQA7CAKI.js} +14 -14
  169. package/dist/cli-bundle/chunks/{plan-EHQALWSC.js → plan-LWWAEV5Y.js} +14 -14
  170. package/dist/cli-bundle/chunks/{register-list-query-QAASVP2J.js → register-list-query-DDCHPONM.js} +19 -19
  171. package/dist/cli-bundle/chunks/{register-list-query-WE54YJMH.js → register-list-query-YNPBVIKM.js} +19 -19
  172. package/dist/cli-bundle/chunks/{register-mutation-B6DZJTY2.js → register-mutation-7ALWDDAX.js} +33 -33
  173. package/dist/cli-bundle/chunks/{register-mutation-CPV4C2KR.js → register-mutation-LAVKYY63.js} +33 -33
  174. package/dist/cli-bundle/chunks/{register-operations-AT3BVVX2.js → register-operations-R4VOQ6EF.js} +32 -32
  175. package/dist/cli-bundle/chunks/{register-operations-RC4C3423.js → register-operations-U5JAW3WE.js} +32 -32
  176. package/dist/cli-bundle/chunks/{register-setup-HXEHMDHE.js → register-setup-KBXQDCXE.js} +23 -19
  177. package/dist/cli-bundle/chunks/register-setup-KBXQDCXE.js.map +7 -0
  178. package/dist/cli-bundle/chunks/{register-setup-JSMJEFCJ.js → register-setup-RCRUHMSZ.js} +24 -20
  179. package/dist/cli-bundle/chunks/register-setup-RCRUHMSZ.js.map +1 -0
  180. package/dist/cli-bundle/chunks/restore-2ZKT6UDC.js +19 -0
  181. package/dist/cli-bundle/chunks/{restore-FNBV4GWE.js → restore-6K53WOWO.js} +11 -11
  182. package/dist/cli-bundle/chunks/{scheduling-shortcuts-JRIUREEU.js → scheduling-shortcuts-NJ5UVJFB.js} +14 -14
  183. package/dist/cli-bundle/chunks/{scheduling-shortcuts-ECL6GBMZ.js → scheduling-shortcuts-OQVJXG3M.js} +14 -14
  184. package/dist/cli-bundle/chunks/{schema-TCW3I7QR.js → schema-MNTAVQCY.js} +9 -9
  185. package/dist/cli-bundle/chunks/{schema-74YENAJL.js → schema-RBTJ2YXW.js} +9 -9
  186. package/dist/cli-bundle/chunks/{search-7USZ6XZA.js → search-6HOIVZDU.js} +12 -12
  187. package/dist/cli-bundle/chunks/{search-GNAUE65M.js → search-ZWYEMASC.js} +12 -12
  188. package/dist/cli-bundle/chunks/{stats-DQMKJMFT.js → stats-FS742AMA.js} +8 -8
  189. package/dist/cli-bundle/chunks/{stats-CVHASAEU.js → stats-R5OAJVZK.js} +8 -8
  190. package/dist/cli-bundle/chunks/{telemetry-7P5EUWCS.js → telemetry-7DIGDQUO.js} +4 -4
  191. package/dist/cli-bundle/chunks/{telemetry-PQTL5YS2.js → telemetry-FWEXSJLQ.js} +4 -4
  192. package/dist/cli-bundle/chunks/{test-FDQZQNZ4.js → test-NZF7OT2F.js} +16 -16
  193. package/dist/cli-bundle/chunks/test-QJXLKV26.js +36 -0
  194. package/dist/cli-bundle/chunks/{test-all-WQIAZVA6.js → test-all-DPN62TX7.js} +16 -16
  195. package/dist/cli-bundle/chunks/{test-all-PIPPS4S5.js → test-all-KL7TLMJF.js} +16 -16
  196. package/dist/cli-bundle/chunks/{test-runs-JS6DNCCI.js → test-runs-C6CFIVOS.js} +5 -5
  197. package/dist/cli-bundle/chunks/{test-runs-NZD2QGL5.js → test-runs-IAJDL6CA.js} +5 -5
  198. package/dist/cli-bundle/chunks/update-2XCQNOD6.js +28 -0
  199. package/dist/cli-bundle/chunks/update-IWUCXVH2.js +24 -0
  200. package/dist/cli-bundle/chunks/{update-many-6NTZ5J5D.js → update-many-MUTIOAP3.js} +23 -23
  201. package/dist/cli-bundle/chunks/{update-many-B3TH5TDS.js → update-many-YEH2DQL6.js} +23 -23
  202. package/dist/cli-bundle/chunks/{upgrade-4C7VE7MS.js → upgrade-HYJ3SWWU.js} +6 -6
  203. package/dist/cli-bundle/chunks/{upgrade-76IKZ6EZ.js → upgrade-UBNLBZNR.js} +6 -6
  204. package/dist/cli-bundle/chunks/{validate-AQU7OCL3.js → validate-6QWQVCX2.js} +21 -21
  205. package/dist/cli-bundle/chunks/{validate-BPM6Z3OT.js → validate-W5V5ZGQX.js} +21 -21
  206. package/dist/cli-bundle/main.js +22 -18
  207. package/dist/cli-bundle/main.js.map +2 -2
  208. package/dist/core/extensions/activation-summary.d.ts +109 -0
  209. package/dist/core/extensions/activation-summary.js +60 -0
  210. package/dist/core/extensions/activation-summary.js.map +1 -0
  211. package/dist/core/extensions/capability-usage.d.ts +10 -0
  212. package/dist/core/extensions/capability-usage.js +12 -3
  213. package/dist/core/extensions/capability-usage.js.map +1 -1
  214. package/dist/core/telemetry/runtime.js +5 -2
  215. package/dist/core/telemetry/runtime.js.map +1 -1
  216. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  217. package/dist/sdk/cli-contracts/enum-contracts.js +4 -2
  218. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  219. package/dist/sdk/cli-contracts.d.ts +1 -0
  220. package/dist/sdk/cli-contracts.js +10 -2
  221. package/dist/sdk/cli-contracts.js.map +1 -1
  222. package/dist/sdk/compose.d.ts +297 -0
  223. package/dist/sdk/compose.js +420 -0
  224. package/dist/sdk/compose.js.map +1 -0
  225. package/dist/sdk/define.d.ts +194 -0
  226. package/dist/sdk/define.js +205 -0
  227. package/dist/sdk/define.js.map +1 -0
  228. package/dist/sdk/index.d.ts +4 -27
  229. package/dist/sdk/index.js +5 -12
  230. package/dist/sdk/index.js.map +1 -1
  231. package/dist/sdk/testing.d.ts +147 -1
  232. package/dist/sdk/testing.js +179 -2
  233. package/dist/sdk/testing.js.map +1 -1
  234. package/docs/COMMANDS.md +1 -0
  235. package/docs/EXTENSIONS.md +8 -5
  236. package/docs/SDK.md +245 -16
  237. package/package.json +1 -1
  238. package/dist/cli-bundle/chunks/activity-NEOI45NX.js +0 -18
  239. package/dist/cli-bundle/chunks/chunk-7GCCDXXN.js.map +0 -7
  240. package/dist/cli-bundle/chunks/chunk-7MPTFYT3.js.map +0 -1
  241. package/dist/cli-bundle/chunks/chunk-D35LTIFR.js.map +0 -1
  242. package/dist/cli-bundle/chunks/chunk-KL5ELX2X.js.map +0 -1
  243. package/dist/cli-bundle/chunks/chunk-TRUFOER3.js.map +0 -7
  244. package/dist/cli-bundle/chunks/close-Z6AI736U.js +0 -15
  245. package/dist/cli-bundle/chunks/contracts-7YDFEJB3.js.map +0 -7
  246. package/dist/cli-bundle/chunks/contracts-MP2P3HL5.js.map +0 -1
  247. package/dist/cli-bundle/chunks/create-3BV2VA3Q.js +0 -30
  248. package/dist/cli-bundle/chunks/history-YRQUD4YM.js +0 -20
  249. package/dist/cli-bundle/chunks/history-redact-27OEOZRZ.js +0 -21
  250. package/dist/cli-bundle/chunks/init-DWAKYRXI.js +0 -21
  251. package/dist/cli-bundle/chunks/register-setup-HXEHMDHE.js.map +0 -7
  252. package/dist/cli-bundle/chunks/register-setup-JSMJEFCJ.js.map +0 -1
  253. package/dist/cli-bundle/chunks/restore-XY4YE2OV.js +0 -19
  254. package/dist/cli-bundle/chunks/test-COWPCGBE.js +0 -36
  255. package/dist/cli-bundle/chunks/update-7IYQHX4Q.js +0 -24
  256. package/dist/cli-bundle/chunks/update-IJKDRBIX.js +0 -28
  257. /package/dist/cli-bundle/chunks/{activity-DXS2XMQU.js.map → activity-H2LMOSSW.js.map} +0 -0
  258. /package/dist/cli-bundle/chunks/{activity-NEOI45NX.js.map → activity-XUZ2AHCW.js.map} +0 -0
  259. /package/dist/cli-bundle/chunks/{aggregate-NMYDVQF7.js.map → aggregate-EGJLZQBI.js.map} +0 -0
  260. /package/dist/cli-bundle/chunks/{aggregate-IHM4KMQ3.js.map → aggregate-R725FC3S.js.map} +0 -0
  261. /package/dist/cli-bundle/chunks/{append-3HY5G7ET.js.map → append-5J345QGU.js.map} +0 -0
  262. /package/dist/cli-bundle/chunks/{append-K54MDQYC.js.map → append-O5HPBMRN.js.map} +0 -0
  263. /package/dist/cli-bundle/chunks/{chunk-GU7YHKYP.js.map → chunk-2A34E3BA.js.map} +0 -0
  264. /package/dist/cli-bundle/chunks/{chunk-DHBPJ7VG.js.map → chunk-2CKH2LMV.js.map} +0 -0
  265. /package/dist/cli-bundle/chunks/{chunk-2LEYMXI6.js.map → chunk-2RDVQEWV.js.map} +0 -0
  266. /package/dist/cli-bundle/chunks/{chunk-PCH2JTEO.js.map → chunk-2T3JG6V4.js.map} +0 -0
  267. /package/dist/cli-bundle/chunks/{chunk-TZQKEBKF.js.map → chunk-34EONI5F.js.map} +0 -0
  268. /package/dist/cli-bundle/chunks/{chunk-DU64SZUQ.js.map → chunk-3VY3YQO6.js.map} +0 -0
  269. /package/dist/cli-bundle/chunks/{chunk-SFKQAVZA.js.map → chunk-46G6RSB6.js.map} +0 -0
  270. /package/dist/cli-bundle/chunks/{chunk-DMT4ODVN.js.map → chunk-4BHT5VDC.js.map} +0 -0
  271. /package/dist/cli-bundle/chunks/{chunk-UKK2VTTH.js.map → chunk-4KD54S3Z.js.map} +0 -0
  272. /package/dist/cli-bundle/chunks/{chunk-GGAXE22C.js.map → chunk-5UVVASSA.js.map} +0 -0
  273. /package/dist/cli-bundle/chunks/{chunk-25XZN3JD.js.map → chunk-5VOINNKT.js.map} +0 -0
  274. /package/dist/cli-bundle/chunks/{chunk-KRJJPDUO.js.map → chunk-66MEDTUD.js.map} +0 -0
  275. /package/dist/cli-bundle/chunks/{chunk-MD7XKVWI.js.map → chunk-7AUB5HNA.js.map} +0 -0
  276. /package/dist/cli-bundle/chunks/{chunk-TJABI6PR.js.map → chunk-7K2XXO4I.js.map} +0 -0
  277. /package/dist/cli-bundle/chunks/{chunk-AJXYOYJV.js.map → chunk-7MRQ4HMK.js.map} +0 -0
  278. /package/dist/cli-bundle/chunks/{chunk-THKDPOS5.js.map → chunk-7SV63ZHD.js.map} +0 -0
  279. /package/dist/cli-bundle/chunks/{chunk-7MALIV5H.js.map → chunk-7UGEAPRY.js.map} +0 -0
  280. /package/dist/cli-bundle/chunks/{chunk-TIKJAXQW.js.map → chunk-7XGQXHFB.js.map} +0 -0
  281. /package/dist/cli-bundle/chunks/{chunk-YJICYNAV.js.map → chunk-AD3A7ZD6.js.map} +0 -0
  282. /package/dist/cli-bundle/chunks/{chunk-FK6MV5F5.js.map → chunk-AONIHR2C.js.map} +0 -0
  283. /package/dist/cli-bundle/chunks/{chunk-YRLLL5TY.js.map → chunk-BB6MDVNQ.js.map} +0 -0
  284. /package/dist/cli-bundle/chunks/{chunk-I6XE47J2.js.map → chunk-CE5P2NQR.js.map} +0 -0
  285. /package/dist/cli-bundle/chunks/{chunk-GXBSFKSX.js.map → chunk-CIIK67GW.js.map} +0 -0
  286. /package/dist/cli-bundle/chunks/{chunk-XKNF3VRJ.js.map → chunk-DT5LPYOD.js.map} +0 -0
  287. /package/dist/cli-bundle/chunks/{chunk-4SDKF5BG.js.map → chunk-FIGAZ4Y7.js.map} +0 -0
  288. /package/dist/cli-bundle/chunks/{chunk-CWPBGUC7.js.map → chunk-FXR67XVQ.js.map} +0 -0
  289. /package/dist/cli-bundle/chunks/{chunk-NIWY4V4Z.js.map → chunk-G6N5VEOK.js.map} +0 -0
  290. /package/dist/cli-bundle/chunks/{chunk-C5SWTISA.js.map → chunk-GAJVRGGA.js.map} +0 -0
  291. /package/dist/cli-bundle/chunks/{chunk-B2KR24R4.js.map → chunk-H2IP4QLJ.js.map} +0 -0
  292. /package/dist/cli-bundle/chunks/{chunk-VB54F347.js.map → chunk-H4IIJDE4.js.map} +0 -0
  293. /package/dist/cli-bundle/chunks/{chunk-7PBGTIN3.js.map → chunk-HFFUQR73.js.map} +0 -0
  294. /package/dist/cli-bundle/chunks/{chunk-RPRFBXND.js.map → chunk-IB3GYLQE.js.map} +0 -0
  295. /package/dist/cli-bundle/chunks/{chunk-GNDHOR64.js.map → chunk-IPKJ6B36.js.map} +0 -0
  296. /package/dist/cli-bundle/chunks/{chunk-V4SM4UAL.js.map → chunk-JR2LV3M4.js.map} +0 -0
  297. /package/dist/cli-bundle/chunks/{chunk-JY25IOEZ.js.map → chunk-KFWBJPSG.js.map} +0 -0
  298. /package/dist/cli-bundle/chunks/{chunk-Y335KFHD.js.map → chunk-LRKKONT2.js.map} +0 -0
  299. /package/dist/cli-bundle/chunks/{chunk-QQWEROGS.js.map → chunk-M4T5DXD5.js.map} +0 -0
  300. /package/dist/cli-bundle/chunks/{chunk-JLSC5NPC.js.map → chunk-MJTINN54.js.map} +0 -0
  301. /package/dist/cli-bundle/chunks/{chunk-CR7KFPAQ.js.map → chunk-NCVCO3NZ.js.map} +0 -0
  302. /package/dist/cli-bundle/chunks/{chunk-CLLVBO3I.js.map → chunk-NK3UPBVG.js.map} +0 -0
  303. /package/dist/cli-bundle/chunks/{chunk-A25LOPRG.js.map → chunk-O6LLO73I.js.map} +0 -0
  304. /package/dist/cli-bundle/chunks/{chunk-4JXWVHMN.js.map → chunk-P77P2ILI.js.map} +0 -0
  305. /package/dist/cli-bundle/chunks/{chunk-I367IDZP.js.map → chunk-Q2KNGP7C.js.map} +0 -0
  306. /package/dist/cli-bundle/chunks/{chunk-77VKGH4L.js.map → chunk-QH3PJYON.js.map} +0 -0
  307. /package/dist/cli-bundle/chunks/{chunk-5SESR24H.js.map → chunk-QL5RVYOA.js.map} +0 -0
  308. /package/dist/cli-bundle/chunks/{chunk-WBSYW3NT.js.map → chunk-S26C36QC.js.map} +0 -0
  309. /package/dist/cli-bundle/chunks/{chunk-Y4BZEND6.js.map → chunk-S2RUQSX2.js.map} +0 -0
  310. /package/dist/cli-bundle/chunks/{chunk-NVUATMTC.js.map → chunk-SBQTAVJZ.js.map} +0 -0
  311. /package/dist/cli-bundle/chunks/{chunk-A7E4ZXG2.js.map → chunk-SKH7OGE5.js.map} +0 -0
  312. /package/dist/cli-bundle/chunks/{chunk-H6FNDCDI.js.map → chunk-SKN7LC5W.js.map} +0 -0
  313. /package/dist/cli-bundle/chunks/{chunk-MNGAQB2E.js.map → chunk-SR3EKWZG.js.map} +0 -0
  314. /package/dist/cli-bundle/chunks/{chunk-PJS2J7Z4.js.map → chunk-T5472OMV.js.map} +0 -0
  315. /package/dist/cli-bundle/chunks/{chunk-6FQHNHQQ.js.map → chunk-T72AZDBA.js.map} +0 -0
  316. /package/dist/cli-bundle/chunks/{chunk-YATDFWYK.js.map → chunk-TQZH6OD6.js.map} +0 -0
  317. /package/dist/cli-bundle/chunks/{chunk-HYQV75IB.js.map → chunk-U2Z5YUSO.js.map} +0 -0
  318. /package/dist/cli-bundle/chunks/{chunk-J2TSPY5L.js.map → chunk-UVC5LOR7.js.map} +0 -0
  319. /package/dist/cli-bundle/chunks/{chunk-P7ZU73BO.js.map → chunk-VAYA4XFX.js.map} +0 -0
  320. /package/dist/cli-bundle/chunks/{chunk-47HTJ6BU.js.map → chunk-VFAQ4LMN.js.map} +0 -0
  321. /package/dist/cli-bundle/chunks/{chunk-WQDX7DVG.js.map → chunk-W72GHSJE.js.map} +0 -0
  322. /package/dist/cli-bundle/chunks/{chunk-EVPVCE4R.js.map → chunk-WBRKK5QR.js.map} +0 -0
  323. /package/dist/cli-bundle/chunks/{chunk-YQSWTVZF.js.map → chunk-WM5ZVBPE.js.map} +0 -0
  324. /package/dist/cli-bundle/chunks/{chunk-NKZOJPXK.js.map → chunk-WZQWHN4R.js.map} +0 -0
  325. /package/dist/cli-bundle/chunks/{chunk-75VEYQJS.js.map → chunk-XVF4YARA.js.map} +0 -0
  326. /package/dist/cli-bundle/chunks/{chunk-KK4TQ3ZP.js.map → chunk-YDEXO24S.js.map} +0 -0
  327. /package/dist/cli-bundle/chunks/{chunk-3VLPDG3J.js.map → chunk-YJ3SUEPD.js.map} +0 -0
  328. /package/dist/cli-bundle/chunks/{chunk-6UPTNMVW.js.map → chunk-YUDJD3XO.js.map} +0 -0
  329. /package/dist/cli-bundle/chunks/{chunk-K25UDYJ4.js.map → chunk-ZQ3ZVXX2.js.map} +0 -0
  330. /package/dist/cli-bundle/chunks/{chunk-44O4JIN6.js.map → chunk-ZRK4O56R.js.map} +0 -0
  331. /package/dist/cli-bundle/chunks/{claim-MPXNVBZQ.js.map → claim-4KHAA2RN.js.map} +0 -0
  332. /package/dist/cli-bundle/chunks/{claim-SKHJDLW6.js.map → claim-CSPJFLNH.js.map} +0 -0
  333. /package/dist/cli-bundle/chunks/{close-Z6AI736U.js.map → close-A3EMKBBY.js.map} +0 -0
  334. /package/dist/cli-bundle/chunks/{close-4RKSL5L6.js.map → close-W56IOGYG.js.map} +0 -0
  335. /package/dist/cli-bundle/chunks/{close-many-SXODYBDP.js.map → close-many-BX5DCSVV.js.map} +0 -0
  336. /package/dist/cli-bundle/chunks/{close-many-AWTPXLHJ.js.map → close-many-TQU5F4E4.js.map} +0 -0
  337. /package/dist/cli-bundle/chunks/{comments-YYW5P7AG.js.map → comments-U5KUC4EU.js.map} +0 -0
  338. /package/dist/cli-bundle/chunks/{comments-OOH64LWW.js.map → comments-VRECH75R.js.map} +0 -0
  339. /package/dist/cli-bundle/chunks/{config-3445MCQQ.js.map → config-D3OKQO52.js.map} +0 -0
  340. /package/dist/cli-bundle/chunks/{config-LCDMKRB2.js.map → config-MMJA4LLK.js.map} +0 -0
  341. /package/dist/cli-bundle/chunks/{context-DZMIBIVP.js.map → context-BLBD3PUB.js.map} +0 -0
  342. /package/dist/cli-bundle/chunks/{context-PJCURODY.js.map → context-DHLVPXN3.js.map} +0 -0
  343. /package/dist/cli-bundle/chunks/{copy-63IQQRRS.js.map → copy-5D5DX3VK.js.map} +0 -0
  344. /package/dist/cli-bundle/chunks/{copy-TASIH2AZ.js.map → copy-HHL3K4QP.js.map} +0 -0
  345. /package/dist/cli-bundle/chunks/{create-TGSB5GV4.js.map → create-IXY43O4H.js.map} +0 -0
  346. /package/dist/cli-bundle/chunks/{create-3BV2VA3Q.js.map → create-QVGFYA2X.js.map} +0 -0
  347. /package/dist/cli-bundle/chunks/{delete-ARILQQLB.js.map → delete-IBUR3M42.js.map} +0 -0
  348. /package/dist/cli-bundle/chunks/{delete-ZQKBZYNK.js.map → delete-QQC2FGUH.js.map} +0 -0
  349. /package/dist/cli-bundle/chunks/{deps-NJFJIMQ5.js.map → deps-KWKRHXIN.js.map} +0 -0
  350. /package/dist/cli-bundle/chunks/{deps-MSHQR2GY.js.map → deps-VTPO4BSE.js.map} +0 -0
  351. /package/dist/cli-bundle/chunks/{docs-XK2UVUXX.js.map → docs-7CHFHXLN.js.map} +0 -0
  352. /package/dist/cli-bundle/chunks/{docs-SS4UKYYA.js.map → docs-IIO3FEUO.js.map} +0 -0
  353. /package/dist/cli-bundle/chunks/{eval-FVZGX5IZ.js.map → eval-CEYYEPSX.js.map} +0 -0
  354. /package/dist/cli-bundle/chunks/{eval-JOTG2YHU.js.map → eval-IO7LREOL.js.map} +0 -0
  355. /package/dist/cli-bundle/chunks/{extension-OQPS27B4.js.map → extension-KCPUWSY2.js.map} +0 -0
  356. /package/dist/cli-bundle/chunks/{extension-NLMS47I4.js.map → extension-UTTQDUYI.js.map} +0 -0
  357. /package/dist/cli-bundle/chunks/{files-3EVJQZ2N.js.map → files-TPUL6KWB.js.map} +0 -0
  358. /package/dist/cli-bundle/chunks/{files-Y2P6LN5A.js.map → files-Z2HHEFGP.js.map} +0 -0
  359. /package/dist/cli-bundle/chunks/{focus-D5ZUPTII.js.map → focus-JVJCGC2D.js.map} +0 -0
  360. /package/dist/cli-bundle/chunks/{focus-ZPIFTY4R.js.map → focus-YRNNH7IP.js.map} +0 -0
  361. /package/dist/cli-bundle/chunks/{gc-LXXDY456.js.map → gc-O5GUO3SU.js.map} +0 -0
  362. /package/dist/cli-bundle/chunks/{gc-RNOEQHSX.js.map → gc-PYVVEELM.js.map} +0 -0
  363. /package/dist/cli-bundle/chunks/{get-Q3SZGQHD.js.map → get-ENLTEGTX.js.map} +0 -0
  364. /package/dist/cli-bundle/chunks/{get-W23G7MJX.js.map → get-X4O3HBEY.js.map} +0 -0
  365. /package/dist/cli-bundle/chunks/{health-5LHSX365.js.map → health-5EXTY44Q.js.map} +0 -0
  366. /package/dist/cli-bundle/chunks/{health-UDDGJLPP.js.map → health-BOTB7YSU.js.map} +0 -0
  367. /package/dist/cli-bundle/chunks/{history-6CZVFIUJ.js.map → history-AJTXLT6S.js.map} +0 -0
  368. /package/dist/cli-bundle/chunks/{history-YRQUD4YM.js.map → history-AK3E5Z3C.js.map} +0 -0
  369. /package/dist/cli-bundle/chunks/{history-compact-VWUSQH6Z.js.map → history-compact-43OOUAWD.js.map} +0 -0
  370. /package/dist/cli-bundle/chunks/{history-compact-M35PDQ4G.js.map → history-compact-46MRHW3I.js.map} +0 -0
  371. /package/dist/cli-bundle/chunks/{history-redact-AJGARHT3.js.map → history-redact-KUUUVUFM.js.map} +0 -0
  372. /package/dist/cli-bundle/chunks/{history-redact-27OEOZRZ.js.map → history-redact-TWIYQV5J.js.map} +0 -0
  373. /package/dist/cli-bundle/chunks/{history-repair-5RDMF7K4.js.map → history-repair-B5PZBOPU.js.map} +0 -0
  374. /package/dist/cli-bundle/chunks/{history-repair-YUAHIPIN.js.map → history-repair-VQTYOSRS.js.map} +0 -0
  375. /package/dist/cli-bundle/chunks/{init-HASX3YNJ.js.map → init-BNLVFPRG.js.map} +0 -0
  376. /package/dist/cli-bundle/chunks/{init-DWAKYRXI.js.map → init-RCRKW5PL.js.map} +0 -0
  377. /package/dist/cli-bundle/chunks/{learnings-M4KA6MQE.js.map → learnings-MUUU5KMC.js.map} +0 -0
  378. /package/dist/cli-bundle/chunks/{learnings-JNGUIJDK.js.map → learnings-XSGX52S7.js.map} +0 -0
  379. /package/dist/cli-bundle/chunks/{list-6FMKTIH3.js.map → list-32U7BSKE.js.map} +0 -0
  380. /package/dist/cli-bundle/chunks/{list-5UU2W24O.js.map → list-ZEEOHLTQ.js.map} +0 -0
  381. /package/dist/cli-bundle/chunks/{notes-PYCPLA5Y.js.map → notes-NJ45OZGF.js.map} +0 -0
  382. /package/dist/cli-bundle/chunks/{notes-MODH5CBT.js.map → notes-OHU25L3M.js.map} +0 -0
  383. /package/dist/cli-bundle/chunks/{plan-DXRIRYRU.js.map → plan-KQA7CAKI.js.map} +0 -0
  384. /package/dist/cli-bundle/chunks/{plan-EHQALWSC.js.map → plan-LWWAEV5Y.js.map} +0 -0
  385. /package/dist/cli-bundle/chunks/{register-list-query-QAASVP2J.js.map → register-list-query-DDCHPONM.js.map} +0 -0
  386. /package/dist/cli-bundle/chunks/{register-list-query-WE54YJMH.js.map → register-list-query-YNPBVIKM.js.map} +0 -0
  387. /package/dist/cli-bundle/chunks/{register-mutation-B6DZJTY2.js.map → register-mutation-7ALWDDAX.js.map} +0 -0
  388. /package/dist/cli-bundle/chunks/{register-mutation-CPV4C2KR.js.map → register-mutation-LAVKYY63.js.map} +0 -0
  389. /package/dist/cli-bundle/chunks/{register-operations-AT3BVVX2.js.map → register-operations-R4VOQ6EF.js.map} +0 -0
  390. /package/dist/cli-bundle/chunks/{register-operations-RC4C3423.js.map → register-operations-U5JAW3WE.js.map} +0 -0
  391. /package/dist/cli-bundle/chunks/{restore-XY4YE2OV.js.map → restore-2ZKT6UDC.js.map} +0 -0
  392. /package/dist/cli-bundle/chunks/{restore-FNBV4GWE.js.map → restore-6K53WOWO.js.map} +0 -0
  393. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-JRIUREEU.js.map → scheduling-shortcuts-NJ5UVJFB.js.map} +0 -0
  394. /package/dist/cli-bundle/chunks/{scheduling-shortcuts-ECL6GBMZ.js.map → scheduling-shortcuts-OQVJXG3M.js.map} +0 -0
  395. /package/dist/cli-bundle/chunks/{schema-TCW3I7QR.js.map → schema-MNTAVQCY.js.map} +0 -0
  396. /package/dist/cli-bundle/chunks/{schema-74YENAJL.js.map → schema-RBTJ2YXW.js.map} +0 -0
  397. /package/dist/cli-bundle/chunks/{search-7USZ6XZA.js.map → search-6HOIVZDU.js.map} +0 -0
  398. /package/dist/cli-bundle/chunks/{search-GNAUE65M.js.map → search-ZWYEMASC.js.map} +0 -0
  399. /package/dist/cli-bundle/chunks/{stats-DQMKJMFT.js.map → stats-FS742AMA.js.map} +0 -0
  400. /package/dist/cli-bundle/chunks/{stats-CVHASAEU.js.map → stats-R5OAJVZK.js.map} +0 -0
  401. /package/dist/cli-bundle/chunks/{telemetry-7P5EUWCS.js.map → telemetry-7DIGDQUO.js.map} +0 -0
  402. /package/dist/cli-bundle/chunks/{telemetry-PQTL5YS2.js.map → telemetry-FWEXSJLQ.js.map} +0 -0
  403. /package/dist/cli-bundle/chunks/{test-FDQZQNZ4.js.map → test-NZF7OT2F.js.map} +0 -0
  404. /package/dist/cli-bundle/chunks/{test-COWPCGBE.js.map → test-QJXLKV26.js.map} +0 -0
  405. /package/dist/cli-bundle/chunks/{test-all-WQIAZVA6.js.map → test-all-DPN62TX7.js.map} +0 -0
  406. /package/dist/cli-bundle/chunks/{test-all-PIPPS4S5.js.map → test-all-KL7TLMJF.js.map} +0 -0
  407. /package/dist/cli-bundle/chunks/{test-runs-JS6DNCCI.js.map → test-runs-C6CFIVOS.js.map} +0 -0
  408. /package/dist/cli-bundle/chunks/{test-runs-NZD2QGL5.js.map → test-runs-IAJDL6CA.js.map} +0 -0
  409. /package/dist/cli-bundle/chunks/{update-IJKDRBIX.js.map → update-2XCQNOD6.js.map} +0 -0
  410. /package/dist/cli-bundle/chunks/{update-7IYQHX4Q.js.map → update-IWUCXVH2.js.map} +0 -0
  411. /package/dist/cli-bundle/chunks/{update-many-6NTZ5J5D.js.map → update-many-MUTIOAP3.js.map} +0 -0
  412. /package/dist/cli-bundle/chunks/{update-many-B3TH5TDS.js.map → update-many-YEH2DQL6.js.map} +0 -0
  413. /package/dist/cli-bundle/chunks/{upgrade-4C7VE7MS.js.map → upgrade-HYJ3SWWU.js.map} +0 -0
  414. /package/dist/cli-bundle/chunks/{upgrade-76IKZ6EZ.js.map → upgrade-UBNLBZNR.js.map} +0 -0
  415. /package/dist/cli-bundle/chunks/{validate-AQU7OCL3.js.map → validate-6QWQVCX2.js.map} +0 -0
  416. /package/dist/cli-bundle/chunks/{validate-BPM6Z3OT.js.map → validate-W5V5ZGQX.js.map} +0 -0
@@ -0,0 +1,70 @@
1
+ /**
2
+ * @module cli/commands/extension/describe
3
+ *
4
+ * Builds the `pm extension describe` / `pm package describe` payload: a flat,
5
+ * by-name map of every surface each loaded extension registered.
6
+ *
7
+ * The SDK already ships {@link describeExtensionActivation} -- the `describe`
8
+ * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`
9
+ * (invoke-one) testing helpers -- but until now it was reachable only from a test
10
+ * that hand-built an {@link ExtensionActivationResult}. This module is the thin
11
+ * orchestration that lets an agent at the CLI (or over MCP) ask "what does this
12
+ * installed extension add to my context?" in one call, instead of stitching
13
+ * together `doctor` (errors), `manage` (update metadata), and a manifest read.
14
+ *
15
+ * It is intentionally pure: the caller performs the load+activate cycle (exactly
16
+ * as `explore`/`doctor` already do) and hands the results here, so the same
17
+ * builder is trivially unit-testable against synthetic activations.
18
+ */
19
+ import { type ExtensionActivationSummary } from "../../../core/extensions/activation-summary.js";
20
+ import type { ExtensionActivationResult, ExtensionLayer, ExtensionLoadResult } from "../../../core/extensions/loader.js";
21
+ /**
22
+ * Runtime state of a described extension. `ok` loaded and activated cleanly,
23
+ * `failed` loaded but threw during `activate`, and `not_loaded` failed to import
24
+ * at all -- the latter two register nothing, so their `surfaces` are empty and
25
+ * the status explains why (rather than implying the extension contributes
26
+ * nothing).
27
+ */
28
+ export type ExtensionDescribeActivationStatus = "ok" | "failed" | "not_loaded";
29
+ /**
30
+ * One extension's contribution to the workspace: its identity plus the
31
+ * {@link ExtensionActivationSummary} of every surface it registered.
32
+ *
33
+ * `surfaces` is matched by extension *name* (mirroring
34
+ * {@link describeExtensionActivation}'s name filter), so when the same name is
35
+ * loaded in both the project and global layers each entry reflects that name's
36
+ * combined surfaces -- the `layer`/`version` fields still distinguish the
37
+ * physical entries.
38
+ */
39
+ export interface ExtensionSurfaceDescription {
40
+ name: string;
41
+ layer: ExtensionLayer;
42
+ version: string;
43
+ activation_status: ExtensionDescribeActivationStatus;
44
+ surfaces: ExtensionActivationSummary;
45
+ }
46
+ /**
47
+ * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps
48
+ * plus a deduplicated `union` across the described set. `target` echoes the
49
+ * requested name filter (or `null` for the whole workspace) and `total` counts
50
+ * the described entries so callers need not re-measure `extensions`.
51
+ */
52
+ export interface ExtensionDescribeResult {
53
+ target: string | null;
54
+ total: number;
55
+ extensions: ExtensionSurfaceDescription[];
56
+ union: ExtensionActivationSummary;
57
+ }
58
+ /**
59
+ * Summarize, by name, every registration surface the loaded extensions exercised.
60
+ *
61
+ * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is
62
+ * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts
63
+ * the entries by name then layer for deterministic output, and attaches each
64
+ * extension's {@link describeExtensionActivation} summary. When `target` is
65
+ * provided only the case-insensitively matching extensions are described and the
66
+ * `union` is scoped to that name; otherwise every loaded extension contributes.
67
+ * An unmatched `target` yields an empty `extensions` array -- the caller decides
68
+ * whether that is a not-found error.
69
+ */
70
+ export declare function buildExtensionDescribeResult(target: string | undefined, loadResult: ExtensionLoadResult, activationResult: ExtensionActivationResult): ExtensionDescribeResult;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @module cli/commands/extension/describe
3
+ *
4
+ * Builds the `pm extension describe` / `pm package describe` payload: a flat,
5
+ * by-name map of every surface each loaded extension registered.
6
+ *
7
+ * The SDK already ships {@link describeExtensionActivation} -- the `describe`
8
+ * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`
9
+ * (invoke-one) testing helpers -- but until now it was reachable only from a test
10
+ * that hand-built an {@link ExtensionActivationResult}. This module is the thin
11
+ * orchestration that lets an agent at the CLI (or over MCP) ask "what does this
12
+ * installed extension add to my context?" in one call, instead of stitching
13
+ * together `doctor` (errors), `manage` (update metadata), and a manifest read.
14
+ *
15
+ * It is intentionally pure: the caller performs the load+activate cycle (exactly
16
+ * as `explore`/`doctor` already do) and hands the results here, so the same
17
+ * builder is trivially unit-testable against synthetic activations.
18
+ */
19
+
20
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7a92163a-99b2-5969-acc2-e2b6b0336c2e")}catch(e){}}();
21
+ import { describeExtensionActivation } from "../../../core/extensions/activation-summary.js";
22
+ import { normalizeExtensionNameForMatch } from "./shared.js";
23
+ /**
24
+ * Compose a collision-free identity key for an extension from its layer and
25
+ * normalized name. The two parts are joined with a colon; the layer prefix is
26
+ * always a colon-free enum value, so distinct (layer, name) pairs never collide
27
+ * even when a name itself contains a colon.
28
+ */
29
+ function layerNameKey(layer, name) {
30
+ return `${layer}:${normalizeExtensionNameForMatch(name)}`;
31
+ }
32
+ /**
33
+ * Summarize, by name, every registration surface the loaded extensions exercised.
34
+ *
35
+ * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is
36
+ * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts
37
+ * the entries by name then layer for deterministic output, and attaches each
38
+ * extension's {@link describeExtensionActivation} summary. When `target` is
39
+ * provided only the case-insensitively matching extensions are described and the
40
+ * `union` is scoped to that name; otherwise every loaded extension contributes.
41
+ * An unmatched `target` yields an empty `extensions` array -- the caller decides
42
+ * whether that is a not-found error.
43
+ */
44
+ export function buildExtensionDescribeResult(target, loadResult, activationResult) {
45
+ const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));
46
+ const candidates = [
47
+ ...loadResult.loaded.map((entry) => ({
48
+ name: entry.name,
49
+ layer: entry.layer,
50
+ version: entry.version,
51
+ activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name))
52
+ ? "failed"
53
+ : "ok",
54
+ surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),
55
+ })),
56
+ ...loadResult.failed.map((entry) => ({
57
+ name: entry.name,
58
+ layer: entry.layer,
59
+ version: "unknown",
60
+ activation_status: "not_loaded",
61
+ surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),
62
+ })),
63
+ ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));
64
+ const normalizedTarget = typeof target === "string" ? normalizeExtensionNameForMatch(target) : null;
65
+ const extensions = normalizedTarget === null
66
+ ? candidates
67
+ : candidates.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget);
68
+ return {
69
+ target: typeof target === "string" ? target.trim() : null,
70
+ total: extensions.length,
71
+ extensions,
72
+ union: describeExtensionActivation(activationResult, normalizedTarget === null ? {} : { extensionName: target }),
73
+ };
74
+ }
75
+ //# sourceMappingURL=describe.js.map
76
+ //# debugId=7a92163a-99b2-5969-acc2-e2b6b0336c2e
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.js","sources":["cli/commands/extension/describe.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/extension/describe\n *\n * Builds the `pm extension describe` / `pm package describe` payload: a flat,\n * by-name map of every surface each loaded extension registered.\n *\n * The SDK already ships {@link describeExtensionActivation} -- the `describe`\n * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`\n * (invoke-one) testing helpers -- but until now it was reachable only from a test\n * that hand-built an {@link ExtensionActivationResult}. This module is the thin\n * orchestration that lets an agent at the CLI (or over MCP) ask \"what does this\n * installed extension add to my context?\" in one call, instead of stitching\n * together `doctor` (errors), `manage` (update metadata), and a manifest read.\n *\n * It is intentionally pure: the caller performs the load+activate cycle (exactly\n * as `explore`/`doctor` already do) and hands the results here, so the same\n * builder is trivially unit-testable against synthetic activations.\n */\nimport { describeExtensionActivation, type ExtensionActivationSummary } from \"../../../core/extensions/activation-summary.js\";\nimport type { ExtensionActivationResult, ExtensionLayer, ExtensionLoadResult } from \"../../../core/extensions/loader.js\";\nimport { normalizeExtensionNameForMatch } from \"./shared.js\";\n\n/**\n * Runtime state of a described extension. `ok` loaded and activated cleanly,\n * `failed` loaded but threw during `activate`, and `not_loaded` failed to import\n * at all -- the latter two register nothing, so their `surfaces` are empty and\n * the status explains why (rather than implying the extension contributes\n * nothing).\n */\nexport type ExtensionDescribeActivationStatus = \"ok\" | \"failed\" | \"not_loaded\";\n\n/**\n * One extension's contribution to the workspace: its identity plus the\n * {@link ExtensionActivationSummary} of every surface it registered.\n *\n * `surfaces` is matched by extension *name* (mirroring\n * {@link describeExtensionActivation}'s name filter), so when the same name is\n * loaded in both the project and global layers each entry reflects that name's\n * combined surfaces -- the `layer`/`version` fields still distinguish the\n * physical entries.\n */\nexport interface ExtensionSurfaceDescription {\n name: string;\n layer: ExtensionLayer;\n version: string;\n activation_status: ExtensionDescribeActivationStatus;\n surfaces: ExtensionActivationSummary;\n}\n\n/**\n * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps\n * plus a deduplicated `union` across the described set. `target` echoes the\n * requested name filter (or `null` for the whole workspace) and `total` counts\n * the described entries so callers need not re-measure `extensions`.\n */\nexport interface ExtensionDescribeResult {\n target: string | null;\n total: number;\n extensions: ExtensionSurfaceDescription[];\n union: ExtensionActivationSummary;\n}\n\n/**\n * Compose a collision-free identity key for an extension from its layer and\n * normalized name. The two parts are joined with a colon; the layer prefix is\n * always a colon-free enum value, so distinct (layer, name) pairs never collide\n * even when a name itself contains a colon.\n */\nfunction layerNameKey(layer: ExtensionLayer, name: string): string {\n return `${layer}:${normalizeExtensionNameForMatch(name)}`;\n}\n\n/**\n * Summarize, by name, every registration surface the loaded extensions exercised.\n *\n * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is\n * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts\n * the entries by name then layer for deterministic output, and attaches each\n * extension's {@link describeExtensionActivation} summary. When `target` is\n * provided only the case-insensitively matching extensions are described and the\n * `union` is scoped to that name; otherwise every loaded extension contributes.\n * An unmatched `target` yields an empty `extensions` array -- the caller decides\n * whether that is a not-found error.\n */\nexport function buildExtensionDescribeResult(\n target: string | undefined,\n loadResult: ExtensionLoadResult,\n activationResult: ExtensionActivationResult,\n): ExtensionDescribeResult {\n const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));\n const candidates: ExtensionSurfaceDescription[] = [\n ...loadResult.loaded.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: entry.version,\n activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name))\n ? (\"failed\" as const)\n : (\"ok\" as const),\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ...loadResult.failed.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: \"unknown\",\n activation_status: \"not_loaded\" as const,\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));\n\n const normalizedTarget = typeof target === \"string\" ? normalizeExtensionNameForMatch(target) : null;\n const extensions =\n normalizedTarget === null\n ? candidates\n : candidates.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget);\n\n return {\n target: typeof target === \"string\" ? target.trim() : null,\n total: extensions.length,\n extensions,\n union: describeExtensionActivation(activationResult, normalizedTarget === null ? {} : { extensionName: target }),\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AACH,OAAO,EAAE,2BAA2B,EAAmC,MAAM,gDAAgD,CAAC;AAE9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,aAAa,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;SACvF,CAAC,CAAC;KACJ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAEtG,MAAM,gBAAgB,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACpG,MAAM,UAAU,GACd,gBAAgB,KAAK,IAAI;QACvB,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,gBAAgB,CAAC,CAAC;IAEpG,OAAO;QACL,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI;QACzD,KAAK,EAAE,UAAU,CAAC,MAAM;QACxB,UAAU;QACV,KAAK,EAAE,2BAA2B,CAAC,gBAAgB,EAAE,gBAAgB,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;KACjH,CAAC;AACJ,CAAC","debugId":"7a92163a-99b2-5969-acc2-e2b6b0336c2e"}
@@ -4,7 +4,7 @@
4
4
  * Implements extension package-management support for Scaffold.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="61e2eb79-305a-5636-b5ca-ab0c6aa4afcc")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4513e1ea-24a5-55b1-9465-78d5d9febba7")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { pathExists } from "../../../core/fs/fs-utils.js";
@@ -525,6 +525,45 @@ export function buildStarterExtensionScaffoldFiles(extensionName, commandName, v
525
525
  const sampleTest = buildSampleTestSource(extensionName, commandName, capability);
526
526
  const sampleTestBullet = SAMPLE_TEST_BULLETS[capability];
527
527
  const gitignore = ["node_modules/", "*.log", ""].join("\n");
528
+ const searchProviderName = `${extensionName}-search`;
529
+ const vectorAdapterName = `${extensionName}-vector`;
530
+ const adapterName = `${extensionName.replace(/-/g, " ")} items`;
531
+ const defineBuilderImports = [
532
+ "defineCommand",
533
+ ...(capability === "hooks" ? ["defineAfterCommandHook"] : []),
534
+ ...(capability === "search" ? ["defineSearchProvider", "defineVectorStoreAdapter"] : []),
535
+ ...(capability === "importers" ? ["defineImporter", "defineExporter"] : []),
536
+ ].join(", ");
537
+ const defineBuilderSnippet = [
538
+ "```js",
539
+ `import { ${defineBuilderImports} } from "@unbrained/pm-cli/sdk";`,
540
+ "",
541
+ "export const pingCommand = defineCommand({",
542
+ ` name: ${JSON.stringify(commandName)},`,
543
+ ' description: "Starter scaffold command. Replace with your own behavior.",',
544
+ " run: (context) => ({ ok: true, command: context.command }),",
545
+ "});",
546
+ ];
547
+ if (capability === "hooks") {
548
+ defineBuilderSnippet.push("", "export const afterCommandHook = defineAfterCommandHook((context) => {", " if (!context.ok) return;", " // React to context.affected here as your package grows.", "});");
549
+ }
550
+ if (capability === "search") {
551
+ defineBuilderSnippet.push("", "export const searchProvider = defineSearchProvider({", ` name: ${JSON.stringify(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(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 }),", "});");
552
+ }
553
+ if (capability === "importers") {
554
+ defineBuilderSnippet.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,", "}));");
555
+ }
556
+ defineBuilderSnippet.push("", "export function activate(api) {", " api.registerCommand(pingCommand);");
557
+ if (capability === "hooks") {
558
+ defineBuilderSnippet.push(" api.hooks.afterCommand(afterCommandHook);");
559
+ }
560
+ if (capability === "search") {
561
+ defineBuilderSnippet.push(" api.registerSearchProvider(searchProvider);", " api.registerVectorStoreAdapter(vectorStoreAdapter);");
562
+ }
563
+ if (capability === "importers") {
564
+ defineBuilderSnippet.push(` api.registerImporter(${JSON.stringify(adapterName)}, importer, {`, ` 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.",', " },", " ],", " });", ` api.registerExporter(${JSON.stringify(adapterName)}, exporter, {`, ` 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.",', " },", " ],", " });");
565
+ }
566
+ defineBuilderSnippet.push("}", "", "export function deactivate() {}", "", "export default { activate, deactivate };", "```");
528
567
  const packageReadme = [
529
568
  `# ${packageName}`,
530
569
  "",
@@ -552,6 +591,15 @@ export function buildStarterExtensionScaffoldFiles(extensionName, commandName, v
552
591
  "```",
553
592
  "`npm test` runs `node --test`, which executes `index.test.js` against the",
554
593
  "`@unbrained/pm-cli/sdk/testing` helpers - no extra test runner required.",
594
+ "",
595
+ "## Authoring With define* Builders",
596
+ "`index.js` stays import-free so the package can be installed locally before",
597
+ "`npm install` materializes peer dependencies. After installing dependencies,",
598
+ "use the public SDK authoring builders for exported definitions you want",
599
+ "editor type-checking, contextual handler inference, and direct unit tests for:",
600
+ ...defineBuilderSnippet,
601
+ "The builders return their argument unchanged; runtime validation still lives",
602
+ "in `api.register*`, and behavior validation lives in `sdk/testing`.",
555
603
  ...PACKAGE_CAPABILITY_README_SECTIONS[capability],
556
604
  "",
557
605
  "## Compatibility Bounds",
@@ -682,4 +730,4 @@ export async function scaffoldExtensionProject(target, vocabulary = "extension",
682
730
  };
683
731
  }
684
732
  //# sourceMappingURL=scaffold.js.map
685
- //# debugId=61e2eb79-305a-5636-b5ca-ab0c6aa4afcc
733
+ //# debugId=4513e1ea-24a5-55b1-9465-78d5d9febba7
@@ -1 +1 @@
1
- {"version":3,"file":"scaffold.js","sources":["cli/commands/extension/scaffold.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/extension/scaffold\n *\n * Implements extension package-management support for Scaffold.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport { normalizeManagedDirectoryName } from \"./shared.js\";\n\n// Safe compatibility floor emitted into scaffolded manifests. Mirrors the\n// first-party package manifests (pm-nf2q): every current 2026.5.x CLI\n// satisfies it, and it models the field for external authors. manifest_version\n// tracks the manifest schema generation (currently 1).\nconst SCAFFOLD_MANIFEST_VERSION = 1;\nconst SCAFFOLD_PM_MIN_VERSION = \"2026.5.0\";\nconst SCAFFOLD_DECLARED_PERMISSIONS = {\n fs_read: false,\n fs_write: false,\n network: false,\n env_read: false,\n env_write: false,\n process_spawn: false,\n};\n\n/**\n * Capability shapes the package/extension scaffolder can target via the\n * `--capability` selector. `commands` emits the default command-only starter;\n * `hooks` additionally wires an `after_command` lifecycle reactor, `search`\n * wires an in-memory provider/adapter pair, and `importers` wires importer and\n * exporter command primitives so authors can customize project context movement\n * without starting from a blank extension.\n */\nexport const SCAFFOLD_CAPABILITIES = [\"commands\", \"hooks\", \"search\", \"importers\"] as const;\n\n/**\n * Restricts the `--capability` selector to a {@link SCAFFOLD_CAPABILITIES} value.\n */\nexport type ExtensionScaffoldCapability = (typeof SCAFFOLD_CAPABILITIES)[number];\n\nconst SCAFFOLD_MANIFEST_CAPABILITIES: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [\"commands\"],\n hooks: [\"commands\", \"hooks\"],\n search: [\"commands\", \"search\"],\n importers: [\"commands\", \"schema\", \"importers\"],\n};\n\nconst SAMPLE_TEST_CAPABILITIES_LITERAL: Record<ExtensionScaffoldCapability, string> = {\n commands: '[\"commands\"]',\n hooks: '[\"commands\", \"hooks\"]',\n search: '[\"commands\", \"search\"]',\n importers: '[\"commands\", \"schema\", \"importers\"]',\n};\n\nconst ENTRYPOINT_BULLETS: Record<ExtensionScaffoldCapability, string> = {\n commands: \"- `index.js`: starter command registration plus a `deactivate` teardown stub.\",\n hooks:\n \"- `index.js`: starter command registration, an `after_command` lifecycle hook, and a `deactivate` teardown stub.\",\n search:\n \"- `index.js`: starter command registration, a search provider, a vector-store adapter, and a `deactivate` teardown stub.\",\n importers:\n \"- `index.js`: starter command registration, importer/exporter command registrations, and a `deactivate` teardown stub.\",\n};\n\nconst SAMPLE_TEST_BULLETS: Record<ExtensionScaffoldCapability, string> = {\n commands:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, and teardown via the SDK testing helpers.\",\n hooks:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, the after_command hook, and teardown via the SDK testing helpers.\",\n search:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, search provider/vector adapter invocation, and teardown via the SDK testing helpers.\",\n importers:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, importer/exporter invocation, and teardown via the SDK testing helpers.\",\n};\n\nconst PACKAGE_CAPABILITY_README_SECTIONS: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [],\n hooks: [\n \"\",\n \"## Lifecycle Hook\",\n \"`index.js` registers an `after_command` hook via `api.hooks.afterCommand`.\",\n \"pm fires it once a command finishes, passing the command outcome and the\",\n \"items it mutated (`context.affected`). React there to keep external context\",\n \"in sync - sync records, emit telemetry, or refresh derived state. The\",\n \"`hooks` capability in `manifest.json` is what grants the hook registration;\",\n \"remove it (and the hook) if your package only needs commands.\",\n ],\n search: [\n \"\",\n \"## Search Provider\",\n \"`index.js` registers a deterministic in-memory search provider and\",\n \"vector-store adapter through `api.registerSearchProvider` and\",\n \"`api.registerVectorStoreAdapter`. Replace the sample scoring,\",\n \"embedding, and storage behavior with your project-specific retrieval\",\n \"logic. The `search` capability in `manifest.json` grants both\",\n \"registrations.\",\n ],\n importers: [\n \"\",\n \"## Importer and Exporter\",\n \"`index.js` registers paired project-context import/export commands through\",\n \"`api.registerImporter` and `api.registerExporter`. Replace the starter\",\n \"payloads with your domain adapter: GitHub issues, CSV rows, documents,\",\n \"tickets, or another project-management source of truth. The `importers`\",\n \"capability grants both registrations, and `schema` grants the example\",\n \"command flag metadata.\",\n ],\n};\n\nconst EXTENSION_CAPABILITY_README_SECTIONS: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [],\n hooks: [\n \"\",\n \"## Lifecycle Hook\",\n \"`index.js` registers an `after_command` hook via `api.hooks.afterCommand`.\",\n \"pm fires it once a command finishes, passing the command outcome and the\",\n \"items it mutated (`context.affected`). React there to keep external context\",\n \"in sync. The `hooks` capability in `manifest.json` grants the registration;\",\n \"remove it (and the hook) if your extension only needs commands.\",\n ],\n search: [\n \"\",\n \"## Search Provider\",\n \"`index.js` registers a deterministic in-memory search provider and\",\n \"vector-store adapter through `api.registerSearchProvider` and\",\n \"`api.registerVectorStoreAdapter`. Replace the sample scoring, embedding,\",\n \"and storage behavior with your project-specific retrieval logic. The\",\n \"`search` capability in `manifest.json` grants both registrations.\",\n ],\n importers: [\n \"\",\n \"## Importer and Exporter\",\n \"`index.js` registers paired project-context import/export commands through\",\n \"`api.registerImporter` and `api.registerExporter`. Replace the starter\",\n \"payloads with your domain adapter. The `importers` capability grants both\",\n \"registrations, and `schema` grants the example command flag metadata.\",\n ],\n};\n\ninterface ExtensionScaffoldFileResult {\n path: string;\n status: \"created\" | \"unchanged\";\n}\n\ninterface ExtensionScaffoldResult {\n extension_name: string;\n command_name: string;\n capability: ExtensionScaffoldCapability;\n target_path: string;\n created_directory: boolean;\n files: ExtensionScaffoldFileResult[];\n}\n\n/**\n * Build the `activate` body lines for the starter entrypoint. The base body\n * always registers the starter command; capability-specific variants append\n * the matching SDK surface so generated packages demonstrate one runnable\n * customization primitive end to end.\n */\nfunction buildActivateBodyLines(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string[] {\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const commandLines = [\n \" api.registerCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \" });\",\n ];\n if (capability === \"commands\") {\n return commandLines;\n }\n if (capability === \"search\") {\n return [\n ...commandLines,\n \"\",\n \" // Search providers let packages customize how pm ranks and retrieves\",\n \" // project context. This starter is deterministic and dependency-free:\",\n \" // replace the scoring with your domain retrieval, embedding, or rerank\",\n \" // logic as the package grows.\",\n \" api.registerSearchProvider({\",\n ` name: ${JSON.stringify(searchProviderName)},`,\n \" query: async (context) => {\",\n \" const needle = context.query.toLowerCase();\",\n \" const hits = context.documents\",\n \" .filter((document) => {\",\n \" const title = String(document.metadata.title ?? \\\"\\\").toLowerCase();\",\n \" return title.includes(needle);\",\n \" })\",\n \" .map((document) => ({\",\n \" id: document.metadata.id,\",\n \" score: 1,\",\n ' matched_fields: [\"title\"],',\n \" }));\",\n \" return { hits };\",\n \" },\",\n \" embed: async (context) => [context.input.length],\",\n \" });\",\n \"\",\n \" // Vector-store adapters let packages own semantic index storage. This\",\n \" // starter returns a stable in-memory hit so generated tests can exercise\",\n \" // the adapter without external services.\",\n \" api.registerVectorStoreAdapter({\",\n ` name: ${JSON.stringify(vectorAdapterName)},`,\n \" query: async (context) => [{ id: \\\"starter-vector-hit\\\", score: context.limit }],\",\n \" upsert: async (context) => ({ upserted: context.points.length }),\",\n \" delete: async (context) => ({ deleted: context.ids.length }),\",\n \" });\",\n ];\n }\n if (capability === \"importers\") {\n return [\n ...commandLines,\n \"\",\n \" // Importers/exporters are the bridge between pm's context graph and\",\n \" // another project-management system. Keep the starter deterministic so\",\n \" // package tests can run without touching the network or filesystem; replace\",\n \" // these payloads with your adapter's real mapping as the package grows.\",\n \" api.registerImporter(\",\n ` ${JSON.stringify(adapterName)},`,\n \" async (context) => ({\",\n \" imported: 1,\",\n \" source: context.options.source ?? \\\"starter\\\",\",\n \" args: context.args,\",\n \" }),\",\n \" {\",\n ` action: ${JSON.stringify(`${adapterName} import`)},`,\n ' description: \"Import starter records into pm context.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--source\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Source name or path to import from.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" );\",\n \"\",\n \" api.registerExporter(\",\n ` ${JSON.stringify(adapterName)},`,\n \" async (context) => ({\",\n \" exported: true,\",\n \" destination: context.options.destination ?? \\\"stdout\\\",\",\n \" args: context.args,\",\n \" }),\",\n \" {\",\n ` action: ${JSON.stringify(`${adapterName} export`)},`,\n ' description: \"Export pm context into starter records.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--destination\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Destination name or path to export to.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" );\",\n ];\n }\n return [\n ...commandLines,\n \"\",\n \" // after_command hooks fire once pm finishes a command, receiving the items\",\n \" // it mutated. This is the natural place to react to every change - sync to\",\n \" // an external system, emit telemetry, or refresh derived context\",\n ' // (\"project management = context management\"). This starter is a documented',\n \" // no-op on the success path; replace the body with your own reaction.\",\n \" api.hooks.afterCommand((context) => {\",\n \" if (!context.ok) {\",\n \" return;\",\n \" }\",\n \" // `context.affected` lists the items pm mutated (id, status,\",\n \" // changed_fields). React here, e.g.:\",\n \" // for (const item of context.affected ?? []) { /* ...item.id... */ }\",\n \" });\",\n ];\n}\n\n/**\n * Build the colocated `node:test` sample suite for the chosen capability. Every\n * variant covers activation, command invocation, and teardown via the SDK\n * testing helpers; the `hooks` variant adds a test that asserts the\n * `after_command` hook is registered and fires cleanly through the public SDK\n * testing helper `runRegisteredHookForTest`.\n */\nfunction buildSampleTestSource(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string {\n const hooksEnabled = capability === \"hooks\";\n const searchEnabled = capability === \"search\";\n const importersEnabled = capability === \"importers\";\n const capabilitiesLiteral = SAMPLE_TEST_CAPABILITIES_LITERAL[capability];\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const importNames = [\n \" activateExtensionForTest,\",\n \" assertExtensionDeactivated,\",\n \" assertRegisteredCommandContract,\",\n ...(hooksEnabled ? [\" assertRegisteredHook,\"] : []),\n ...(searchEnabled ? [\" assertRegisteredSearchProvider,\", \" assertRegisteredVectorStoreAdapter,\"] : []),\n ...(importersEnabled ? [\" assertRegisteredImporter,\", \" assertRegisteredExporter,\"] : []),\n \" deactivateExtensionForTest,\",\n \" runRegisteredCommandForTest,\",\n ...(hooksEnabled ? [\" runRegisteredHookForTest,\"] : []),\n ...(searchEnabled ? [\" runRegisteredSearchProviderForTest,\", \" runRegisteredVectorStoreAdapterForTest,\"] : []),\n ...(importersEnabled ? [\" runRegisteredImporterForTest,\", \" runRegisteredExporterForTest,\"] : []),\n ];\n const hookTestLines = hooksEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} reacts to commands via its after_command hook`)}, async () => {`,\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" // assertRegisteredHook throws unless an after_command hook is registered,\",\n \" // so reaching the next line already proves the hook is wired.\",\n \" assertRegisteredHook(activation.hooks, {\",\n ' kind: \"after_command\",',\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" // runRegisteredHookForTest fires the hook through pm's real runner with a\",\n \" // synthetic context and returns the warnings it produced; a clean hook\",\n \" // returns none. Replace the context/assertions as your hook grows.\",\n \" const warnings = await runRegisteredHookForTest(activation.hooks, {\",\n ' kind: \"after_command\",',\n \" context: {\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n ' pm_root: \"\",',\n \" ok: true,\",\n \" affected: [],\",\n \" },\",\n \" });\",\n \" assert.deepEqual(warnings, []);\",\n \"});\",\n \"\",\n ]\n : [];\n const searchTestLines = searchEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers and invokes search primitives`)}, async () => {`,\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" assertRegisteredSearchProvider(activation.registrations, {\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" assertRegisteredVectorStoreAdapter(activation.registrations, {\",\n ` adapter: ${JSON.stringify(vectorAdapterName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \"\",\n \" const query = await runRegisteredSearchProviderForTest(activation.registrations, {\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ' operation: \"query\",',\n \" context: {\",\n ' query: \"sync\",',\n ' mode: \"semantic\",',\n ' tokens: [\"sync\"],',\n \" options: {},\",\n \" settings: {},\",\n \" documents: [\",\n ' { metadata: { id: \"pm-1\", title: \"Sync external context\" }, body: \"\" },',\n ' { metadata: { id: \"pm-2\", title: \"Unrelated task\" }, body: \"\" },',\n \" ],\",\n \" },\",\n \" });\",\n ' assert.deepEqual(query, { hits: [{ id: \"pm-1\", score: 1, matched_fields: [\"title\"] }] });',\n \"\",\n \" const embedding = await runRegisteredSearchProviderForTest(activation.registrations, {\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ' operation: \"embed\",',\n ' context: { input: \"abc\", settings: {}, model: \"starter-model\" },',\n \" });\",\n \" assert.deepEqual(embedding, [3]);\",\n \"\",\n \" const vectorHits = await runRegisteredVectorStoreAdapterForTest(activation.registrations, {\",\n ` adapter: ${JSON.stringify(vectorAdapterName)},`,\n ' operation: \"query\",',\n \" context: { vector: [0.1, 0.2], limit: 2, settings: {} },\",\n \" });\",\n ' assert.deepEqual(vectorHits, [{ id: \"starter-vector-hit\", score: 2 }]);',\n \"});\",\n \"\",\n ]\n : [];\n const importerTestLines = importersEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers and invokes import/export primitives`)}, async () => {`,\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" assertRegisteredImporter(activation.registrations, {\",\n ` importer: ${JSON.stringify(adapterName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" assertRegisteredExporter(activation.registrations, {\",\n ` exporter: ${JSON.stringify(adapterName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \"\",\n \" const imported = await runRegisteredImporterForTest(activation, {\",\n ` importer: ${JSON.stringify(adapterName)},`,\n ' options: { source: \"tickets\" },',\n ' args: [\"batch-1\"],',\n \" });\",\n \" assert.equal(imported.handled, true);\",\n ' assert.deepEqual(imported.result, { imported: 1, source: \"tickets\", args: [\"batch-1\"] });',\n \"\",\n \" const exported = await runRegisteredExporterForTest(activation, {\",\n ` exporter: ${JSON.stringify(adapterName)},`,\n ' options: { destination: \"archive\" },',\n ' args: [\"done\"],',\n \" });\",\n \" assert.equal(exported.handled, true);\",\n ' assert.deepEqual(exported.result, { exported: true, destination: \"archive\", args: [\"done\"] });',\n \"});\",\n \"\",\n ]\n : [];\n return [\n 'import assert from \"node:assert/strict\";',\n 'import { test } from \"node:test\";',\n \"import {\",\n ...importNames,\n '} from \"@unbrained/pm-cli/sdk/testing\";',\n 'import extension from \"./index.js\";',\n \"\",\n `test(${JSON.stringify(`${extensionName} registers its starter command`)}, async () => {`,\n \" // `capabilities` mirrors manifest.json so the in-memory activation grants\",\n \" // the capabilities the entrypoint relies on.\",\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" // assertRegisteredCommandContract throws if the command is not\",\n \" // registered, so reaching here already proves the wiring; assert on the\",\n \" // returned definition to demonstrate inspecting registered metadata.\",\n \" const registered = assertRegisteredCommandContract(activation.registrations, {\",\n ` command: ${JSON.stringify(commandName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n ' assert.equal(typeof registered.command.description, \"string\");',\n \"\",\n \" // runRegisteredCommandForTest invokes the handler through pm's real\",\n \" // dispatch engine, so this asserts behavior - not just that the command\",\n \" // is wired. Replace these assertions as you flesh out your command.\",\n \" const invocation = await runRegisteredCommandForTest(activation.commands, {\",\n ` command: ${JSON.stringify(commandName)},`,\n \" });\",\n \" assert.equal(invocation.handled, true);\",\n \" assert.equal(invocation.result.ok, true);\",\n ` assert.equal(invocation.result.command, ${JSON.stringify(commandName)});`,\n \"});\",\n \"\",\n ...hookTestLines,\n ...searchTestLines,\n ...importerTestLines,\n `test(${JSON.stringify(`${extensionName} tears down cleanly via deactivate`)}, async () => {`,\n \" // deactivateExtensionForTest runs pm's real teardown engine over the\",\n \" // module, so this proves your `deactivate` hook runs without throwing.\",\n \" const teardown = await deactivateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" // assertExtensionDeactivated throws unless exactly one extension tore down\",\n \" // with no failures, so reaching the next line already proves teardown ran.\",\n \" assertExtensionDeactivated(teardown);\",\n \" assert.equal(teardown.deactivated, 1);\",\n \"});\",\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * Implements build starter extension scaffold files for the public runtime surface of this module.\n */\nexport function buildStarterExtensionScaffoldFiles(\n extensionName: string,\n commandName: string,\n vocabulary: \"extension\" | \"package\",\n capability: ExtensionScaffoldCapability = \"commands\",\n): Record<string, string> {\n const packageName = `pm-${extensionName}`;\n const capabilities = SCAFFOLD_MANIFEST_CAPABILITIES[capability];\n const manifest = `${JSON.stringify(\n {\n name: extensionName,\n version: \"0.1.0\",\n entry: \"./index.js\",\n manifest_version: SCAFFOLD_MANIFEST_VERSION,\n pm_min_version: SCAFFOLD_PM_MIN_VERSION,\n trusted: true,\n sandbox_profile: \"strict\",\n permissions: { ...SCAFFOLD_DECLARED_PERMISSIONS },\n capabilities,\n },\n null,\n 2,\n )}\\n`;\n // Keep scaffolds dependency-light by default: even package mode can be\n // installed before peer dependencies are materialized in the generated root.\n // The JSDoc import preserves editor narrowing without forcing the runtime\n // loader to resolve @unbrained/pm-cli/sdk from a freshly generated scaffold.\n const entrypoint = [\n '/** @param {import(\"@unbrained/pm-cli/sdk\").ExtensionApi} api */',\n \"export function activate(api) {\",\n ...buildActivateBodyLines(extensionName, commandName, capability),\n \"}\",\n \"\",\n \"// `deactivate` is the teardown counterpart to `activate`: pm runs it on host\",\n \"// shutdown/reload (e.g. the MCP server between requests) to release anything\",\n \"// `activate` opened - timers, connections, caches. This starter holds no such\",\n \"// resources, so it stays a documented no-op; add cleanup here as you grow.\",\n \"export function deactivate() {}\",\n \"\",\n \"export default {\",\n \" activate,\",\n \" deactivate,\",\n \"};\",\n \"\",\n ].join(\"\\n\");\n // README bullet describing what index.js wires, kept in sync with the chosen\n // capability so the generated docs match the generated code.\n const entrypointBullet = ENTRYPOINT_BULLETS[capability];\n if (vocabulary === \"package\") {\n const packageJson = `${JSON.stringify(\n {\n name: packageName,\n version: \"0.1.0\",\n private: true,\n type: \"module\",\n keywords: [\"pm-package\"],\n // `node --test` runs the colocated *.test.js sample against the peer SDK\n // testing helpers; no extra dev-dependency or test runner is required.\n scripts: {\n test: \"node --test\",\n },\n peerDependencies: {\n \"@unbrained/pm-cli\": \"*\",\n },\n pm: {\n aliases: [extensionName],\n extensions: [\".\"],\n docs: [\"README.md\"],\n examples: [\"README.md\"],\n catalog: {\n display_name: extensionName,\n category: \"workflow\",\n summary: \"Starter pm package scaffold.\",\n tags: [\"starter\"],\n },\n },\n },\n null,\n 2,\n )}\\n`;\n // node:test sample: demonstrates validating the package with the SDK testing\n // helpers without adding a third-party test runner. The suite covers the\n // capability the scaffold targets (command invocation, and for the hooks\n // capability, the after_command lifecycle hook).\n const sampleTest = buildSampleTestSource(extensionName, commandName, capability);\n const sampleTestBullet = SAMPLE_TEST_BULLETS[capability];\n const gitignore = [\"node_modules/\", \"*.log\", \"\"].join(\"\\n\");\n const packageReadme = [\n `# ${packageName}`,\n \"\",\n \"Generated by `pm package init`.\",\n \"\",\n \"## Included Files\",\n \"- `package.json`: package metadata, `test` script, and `pm` resource manifest.\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n entrypointBullet,\n sampleTestBullet,\n \"- `.gitignore`: ignores `node_modules/` and log files.\",\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm install --project <package-path>\",\n `pm ${commandName}`,\n \"pm package doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Validate the Package\",\n \"Install the peer SDK once, then run the colocated sample test:\",\n \"```bash\",\n \"npm install\",\n \"npm test\",\n \"```\",\n \"`npm test` runs `node --test`, which executes `index.test.js` against the\",\n \"`@unbrained/pm-cli/sdk/testing` helpers - no extra test runner required.\",\n ...PACKAGE_CAPABILITY_README_SECTIONS[capability],\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`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.`,\n \"- `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.\",\n \"\",\n \"## Policy Metadata\",\n \"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`.\",\n \"\",\n \"## Notes\",\n \"- Keep simple starter runtime behavior at the package root so local installs work without dependency bootstrapping.\",\n \"- Move larger runtimes into subdirectories only after adding package dependencies and validating `pm package doctor`.\",\n \"- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.\",\n \"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"package.json\": packageJson,\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"index.test.js\": sampleTest,\n \".gitignore\": gitignore,\n \"README.md\": packageReadme,\n };\n }\n const readme = [\n `# ${extensionName}`,\n \"\",\n \"Generated by `pm extension init`.\",\n \"\",\n \"## Included Files\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n entrypointBullet,\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm extension --install --project <scaffold-path>\",\n `pm ${commandName}`,\n \"pm extension --doctor --project --detail summary\",\n \"```\",\n ...EXTENSION_CAPABILITY_README_SECTIONS[capability],\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`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.`,\n \"- `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.\",\n \"\",\n \"## Policy Metadata\",\n \"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`.\",\n \"\",\n \"## Notes\",\n \"- This scaffold uses ESM exports so it works in package scopes with `type: module`.\",\n \"- Update `manifest.json` capabilities and `index.js` command behavior as your extension evolves.\",\n \"- Release any resources `activate` opens (timers, connections, caches) in the `deactivate` teardown hook.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"README.md\": readme,\n };\n}\n\n/**\n * Implements scaffold extension project for the public runtime surface of this module.\n */\nexport async function scaffoldExtensionProject(\n target: string,\n vocabulary: \"extension\" | \"package\" = \"extension\",\n capability: string = \"commands\",\n): Promise<ExtensionScaffoldResult> {\n const normalizedCapability = capability.trim().toLowerCase();\n if (!(SCAFFOLD_CAPABILITIES as readonly string[]).includes(normalizedCapability)) {\n throw new PmCliError(\n `Unknown scaffold capability \"${capability}\". Supported capabilities: ${SCAFFOLD_CAPABILITIES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n const resolvedCapability = normalizedCapability as ExtensionScaffoldCapability;\n const normalizedTarget = target.trim();\n const targetPath = path.resolve(process.cwd(), normalizedTarget);\n const extensionName = normalizeManagedDirectoryName(path.basename(targetPath));\n // Hyphenated top-level command groups can surface in help but fail dispatch in\n // Commander, so generated starters use space-separated command words while the\n // manifest and package identity keep their normalized directory names.\n const commandName = `${extensionName.replace(/-/g, \" \")} ping`;\n const scaffoldFiles = buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary, resolvedCapability);\n\n let createdDirectory = false;\n if (await pathExists(targetPath)) {\n const existingTargetStats = await fs.stat(targetPath);\n if (!existingTargetStats.isDirectory()) {\n throw new PmCliError(\n `Scaffold target \"${targetPath}\" exists and is not a directory.`,\n EXIT_CODE.CONFLICT,\n );\n }\n } else {\n await fs.mkdir(targetPath, { recursive: true });\n createdDirectory = true;\n }\n\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (!(await pathExists(absolutePath))) {\n continue;\n }\n const existingContent = await fs.readFile(absolutePath, \"utf8\");\n if (existingContent !== content) {\n throw new PmCliError(\n `Scaffold file \"${relativePath}\" already exists with different content in \"${targetPath}\". Choose a new target path or remove conflicting files.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n\n const files: ExtensionScaffoldFileResult[] = [];\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (await pathExists(absolutePath)) {\n files.push({\n path: relativePath,\n status: \"unchanged\",\n });\n continue;\n }\n await fs.mkdir(path.dirname(absolutePath), { recursive: true });\n await fs.writeFile(absolutePath, content, \"utf8\");\n files.push({\n path: relativePath,\n status: \"created\",\n });\n }\n\n return {\n extension_name: extensionName,\n command_name: commandName,\n capability: resolvedCapability,\n target_path: targetPath,\n created_directory: createdDirectory,\n files,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,k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E,gBAAgB;QACnC,KAAK;KACN,CAAC;AACJ,CAAC","debugId":"61e2eb79-305a-5636-b5ca-ab0c6aa4afcc"}
1
+ {"version":3,"file":"scaffold.js","sources":["cli/commands/extension/scaffold.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/extension/scaffold\n *\n * Implements extension package-management support for Scaffold.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport { normalizeManagedDirectoryName } from \"./shared.js\";\n\n// Safe compatibility floor emitted into scaffolded manifests. Mirrors the\n// first-party package manifests (pm-nf2q): every current 2026.5.x CLI\n// satisfies it, and it models the field for external authors. manifest_version\n// tracks the manifest schema generation (currently 1).\nconst SCAFFOLD_MANIFEST_VERSION = 1;\nconst SCAFFOLD_PM_MIN_VERSION = \"2026.5.0\";\nconst SCAFFOLD_DECLARED_PERMISSIONS = {\n fs_read: false,\n fs_write: false,\n network: false,\n env_read: false,\n env_write: false,\n process_spawn: false,\n};\n\n/**\n * Capability shapes the package/extension scaffolder can target via the\n * `--capability` selector. `commands` emits the default command-only starter;\n * `hooks` additionally wires an `after_command` lifecycle reactor, `search`\n * wires an in-memory provider/adapter pair, and `importers` wires importer and\n * exporter command primitives so authors can customize project context movement\n * without starting from a blank extension.\n */\nexport const SCAFFOLD_CAPABILITIES = [\"commands\", \"hooks\", \"search\", \"importers\"] as const;\n\n/**\n * Restricts the `--capability` selector to a {@link SCAFFOLD_CAPABILITIES} value.\n */\nexport type ExtensionScaffoldCapability = (typeof SCAFFOLD_CAPABILITIES)[number];\n\nconst SCAFFOLD_MANIFEST_CAPABILITIES: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [\"commands\"],\n hooks: [\"commands\", \"hooks\"],\n search: [\"commands\", \"search\"],\n importers: [\"commands\", \"schema\", \"importers\"],\n};\n\nconst SAMPLE_TEST_CAPABILITIES_LITERAL: Record<ExtensionScaffoldCapability, string> = {\n commands: '[\"commands\"]',\n hooks: '[\"commands\", \"hooks\"]',\n search: '[\"commands\", \"search\"]',\n importers: '[\"commands\", \"schema\", \"importers\"]',\n};\n\nconst ENTRYPOINT_BULLETS: Record<ExtensionScaffoldCapability, string> = {\n commands: \"- `index.js`: starter command registration plus a `deactivate` teardown stub.\",\n hooks:\n \"- `index.js`: starter command registration, an `after_command` lifecycle hook, and a `deactivate` teardown stub.\",\n search:\n \"- `index.js`: starter command registration, a search provider, a vector-store adapter, and a `deactivate` teardown stub.\",\n importers:\n \"- `index.js`: starter command registration, importer/exporter command registrations, and a `deactivate` teardown stub.\",\n};\n\nconst SAMPLE_TEST_BULLETS: Record<ExtensionScaffoldCapability, string> = {\n commands:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, and teardown via the SDK testing helpers.\",\n hooks:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, the after_command hook, and teardown via the SDK testing helpers.\",\n search:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, search provider/vector adapter invocation, and teardown via the SDK testing helpers.\",\n importers:\n \"- `index.test.js`: sample `node:test` suite covering activation, command invocation, importer/exporter invocation, and teardown via the SDK testing helpers.\",\n};\n\nconst PACKAGE_CAPABILITY_README_SECTIONS: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [],\n hooks: [\n \"\",\n \"## Lifecycle Hook\",\n \"`index.js` registers an `after_command` hook via `api.hooks.afterCommand`.\",\n \"pm fires it once a command finishes, passing the command outcome and the\",\n \"items it mutated (`context.affected`). React there to keep external context\",\n \"in sync - sync records, emit telemetry, or refresh derived state. The\",\n \"`hooks` capability in `manifest.json` is what grants the hook registration;\",\n \"remove it (and the hook) if your package only needs commands.\",\n ],\n search: [\n \"\",\n \"## Search Provider\",\n \"`index.js` registers a deterministic in-memory search provider and\",\n \"vector-store adapter through `api.registerSearchProvider` and\",\n \"`api.registerVectorStoreAdapter`. Replace the sample scoring,\",\n \"embedding, and storage behavior with your project-specific retrieval\",\n \"logic. The `search` capability in `manifest.json` grants both\",\n \"registrations.\",\n ],\n importers: [\n \"\",\n \"## Importer and Exporter\",\n \"`index.js` registers paired project-context import/export commands through\",\n \"`api.registerImporter` and `api.registerExporter`. Replace the starter\",\n \"payloads with your domain adapter: GitHub issues, CSV rows, documents,\",\n \"tickets, or another project-management source of truth. The `importers`\",\n \"capability grants both registrations, and `schema` grants the example\",\n \"command flag metadata.\",\n ],\n};\n\nconst EXTENSION_CAPABILITY_README_SECTIONS: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [],\n hooks: [\n \"\",\n \"## Lifecycle Hook\",\n \"`index.js` registers an `after_command` hook via `api.hooks.afterCommand`.\",\n \"pm fires it once a command finishes, passing the command outcome and the\",\n \"items it mutated (`context.affected`). React there to keep external context\",\n \"in sync. The `hooks` capability in `manifest.json` grants the registration;\",\n \"remove it (and the hook) if your extension only needs commands.\",\n ],\n search: [\n \"\",\n \"## Search Provider\",\n \"`index.js` registers a deterministic in-memory search provider and\",\n \"vector-store adapter through `api.registerSearchProvider` and\",\n \"`api.registerVectorStoreAdapter`. Replace the sample scoring, embedding,\",\n \"and storage behavior with your project-specific retrieval logic. The\",\n \"`search` capability in `manifest.json` grants both registrations.\",\n ],\n importers: [\n \"\",\n \"## Importer and Exporter\",\n \"`index.js` registers paired project-context import/export commands through\",\n \"`api.registerImporter` and `api.registerExporter`. Replace the starter\",\n \"payloads with your domain adapter. The `importers` capability grants both\",\n \"registrations, and `schema` grants the example command flag metadata.\",\n ],\n};\n\ninterface ExtensionScaffoldFileResult {\n path: string;\n status: \"created\" | \"unchanged\";\n}\n\ninterface ExtensionScaffoldResult {\n extension_name: string;\n command_name: string;\n capability: ExtensionScaffoldCapability;\n target_path: string;\n created_directory: boolean;\n files: ExtensionScaffoldFileResult[];\n}\n\n/**\n * Build the `activate` body lines for the starter entrypoint. The base body\n * always registers the starter command; capability-specific variants append\n * the matching SDK surface so generated packages demonstrate one runnable\n * customization primitive end to end.\n */\nfunction buildActivateBodyLines(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string[] {\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const commandLines = [\n \" api.registerCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \" });\",\n ];\n if (capability === \"commands\") {\n return commandLines;\n }\n if (capability === \"search\") {\n return [\n ...commandLines,\n \"\",\n \" // Search providers let packages customize how pm ranks and retrieves\",\n \" // project context. This starter is deterministic and dependency-free:\",\n \" // replace the scoring with your domain retrieval, embedding, or rerank\",\n \" // logic as the package grows.\",\n \" api.registerSearchProvider({\",\n ` name: ${JSON.stringify(searchProviderName)},`,\n \" query: async (context) => {\",\n \" const needle = context.query.toLowerCase();\",\n \" const hits = context.documents\",\n \" .filter((document) => {\",\n \" const title = String(document.metadata.title ?? \\\"\\\").toLowerCase();\",\n \" return title.includes(needle);\",\n \" })\",\n \" .map((document) => ({\",\n \" id: document.metadata.id,\",\n \" score: 1,\",\n ' matched_fields: [\"title\"],',\n \" }));\",\n \" return { hits };\",\n \" },\",\n \" embed: async (context) => [context.input.length],\",\n \" });\",\n \"\",\n \" // Vector-store adapters let packages own semantic index storage. This\",\n \" // starter returns a stable in-memory hit so generated tests can exercise\",\n \" // the adapter without external services.\",\n \" api.registerVectorStoreAdapter({\",\n ` name: ${JSON.stringify(vectorAdapterName)},`,\n \" query: async (context) => [{ id: \\\"starter-vector-hit\\\", score: context.limit }],\",\n \" upsert: async (context) => ({ upserted: context.points.length }),\",\n \" delete: async (context) => ({ deleted: context.ids.length }),\",\n \" });\",\n ];\n }\n if (capability === \"importers\") {\n return [\n ...commandLines,\n \"\",\n \" // Importers/exporters are the bridge between pm's context graph and\",\n \" // another project-management system. Keep the starter deterministic so\",\n \" // package tests can run without touching the network or filesystem; replace\",\n \" // these payloads with your adapter's real mapping as the package grows.\",\n \" api.registerImporter(\",\n ` ${JSON.stringify(adapterName)},`,\n \" async (context) => ({\",\n \" imported: 1,\",\n \" source: context.options.source ?? \\\"starter\\\",\",\n \" args: context.args,\",\n \" }),\",\n \" {\",\n ` action: ${JSON.stringify(`${adapterName} import`)},`,\n ' description: \"Import starter records into pm context.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--source\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Source name or path to import from.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" );\",\n \"\",\n \" api.registerExporter(\",\n ` ${JSON.stringify(adapterName)},`,\n \" async (context) => ({\",\n \" exported: true,\",\n \" destination: context.options.destination ?? \\\"stdout\\\",\",\n \" args: context.args,\",\n \" }),\",\n \" {\",\n ` action: ${JSON.stringify(`${adapterName} export`)},`,\n ' description: \"Export pm context into starter records.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--destination\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Destination name or path to export to.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" );\",\n ];\n }\n return [\n ...commandLines,\n \"\",\n \" // after_command hooks fire once pm finishes a command, receiving the items\",\n \" // it mutated. This is the natural place to react to every change - sync to\",\n \" // an external system, emit telemetry, or refresh derived context\",\n ' // (\"project management = context management\"). This starter is a documented',\n \" // no-op on the success path; replace the body with your own reaction.\",\n \" api.hooks.afterCommand((context) => {\",\n \" if (!context.ok) {\",\n \" return;\",\n \" }\",\n \" // `context.affected` lists the items pm mutated (id, status,\",\n \" // changed_fields). React here, e.g.:\",\n \" // for (const item of context.affected ?? []) { /* ...item.id... */ }\",\n \" });\",\n ];\n}\n\n/**\n * Build the colocated `node:test` sample suite for the chosen capability. Every\n * variant covers activation, command invocation, and teardown via the SDK\n * testing helpers; the `hooks` variant adds a test that asserts the\n * `after_command` hook is registered and fires cleanly through the public SDK\n * testing helper `runRegisteredHookForTest`.\n */\nfunction buildSampleTestSource(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string {\n const hooksEnabled = capability === \"hooks\";\n const searchEnabled = capability === \"search\";\n const importersEnabled = capability === \"importers\";\n const capabilitiesLiteral = SAMPLE_TEST_CAPABILITIES_LITERAL[capability];\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const importNames = [\n \" activateExtensionForTest,\",\n \" assertExtensionDeactivated,\",\n \" assertRegisteredCommandContract,\",\n ...(hooksEnabled ? [\" assertRegisteredHook,\"] : []),\n ...(searchEnabled ? [\" assertRegisteredSearchProvider,\", \" assertRegisteredVectorStoreAdapter,\"] : []),\n ...(importersEnabled ? [\" assertRegisteredImporter,\", \" assertRegisteredExporter,\"] : []),\n \" deactivateExtensionForTest,\",\n \" runRegisteredCommandForTest,\",\n ...(hooksEnabled ? [\" runRegisteredHookForTest,\"] : []),\n ...(searchEnabled ? [\" runRegisteredSearchProviderForTest,\", \" runRegisteredVectorStoreAdapterForTest,\"] : []),\n ...(importersEnabled ? [\" runRegisteredImporterForTest,\", \" runRegisteredExporterForTest,\"] : []),\n ];\n const hookTestLines = hooksEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} reacts to commands via its after_command hook`)}, async () => {`,\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" // assertRegisteredHook throws unless an after_command hook is registered,\",\n \" // so reaching the next line already proves the hook is wired.\",\n \" assertRegisteredHook(activation.hooks, {\",\n ' kind: \"after_command\",',\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" // runRegisteredHookForTest fires the hook through pm's real runner with a\",\n \" // synthetic context and returns the warnings it produced; a clean hook\",\n \" // returns none. Replace the context/assertions as your hook grows.\",\n \" const warnings = await runRegisteredHookForTest(activation.hooks, {\",\n ' kind: \"after_command\",',\n \" context: {\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n ' pm_root: \"\",',\n \" ok: true,\",\n \" affected: [],\",\n \" },\",\n \" });\",\n \" assert.deepEqual(warnings, []);\",\n \"});\",\n \"\",\n ]\n : [];\n const searchTestLines = searchEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers and invokes search primitives`)}, async () => {`,\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" assertRegisteredSearchProvider(activation.registrations, {\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" assertRegisteredVectorStoreAdapter(activation.registrations, {\",\n ` adapter: ${JSON.stringify(vectorAdapterName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \"\",\n \" const query = await runRegisteredSearchProviderForTest(activation.registrations, {\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ' operation: \"query\",',\n \" context: {\",\n ' query: \"sync\",',\n ' mode: \"semantic\",',\n ' tokens: [\"sync\"],',\n \" options: {},\",\n \" settings: {},\",\n \" documents: [\",\n ' { metadata: { id: \"pm-1\", title: \"Sync external context\" }, body: \"\" },',\n ' { metadata: { id: \"pm-2\", title: \"Unrelated task\" }, body: \"\" },',\n \" ],\",\n \" },\",\n \" });\",\n ' assert.deepEqual(query, { hits: [{ id: \"pm-1\", score: 1, matched_fields: [\"title\"] }] });',\n \"\",\n \" const embedding = await runRegisteredSearchProviderForTest(activation.registrations, {\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ' operation: \"embed\",',\n ' context: { input: \"abc\", settings: {}, model: \"starter-model\" },',\n \" });\",\n \" assert.deepEqual(embedding, [3]);\",\n \"\",\n \" const vectorHits = await runRegisteredVectorStoreAdapterForTest(activation.registrations, {\",\n ` adapter: ${JSON.stringify(vectorAdapterName)},`,\n ' operation: \"query\",',\n \" context: { vector: [0.1, 0.2], limit: 2, settings: {} },\",\n \" });\",\n ' assert.deepEqual(vectorHits, [{ id: \"starter-vector-hit\", score: 2 }]);',\n \"});\",\n \"\",\n ]\n : [];\n const importerTestLines = importersEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers and invokes import/export primitives`)}, async () => {`,\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" assertRegisteredImporter(activation.registrations, {\",\n ` importer: ${JSON.stringify(adapterName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" assertRegisteredExporter(activation.registrations, {\",\n ` exporter: ${JSON.stringify(adapterName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \"\",\n \" const imported = await runRegisteredImporterForTest(activation, {\",\n ` importer: ${JSON.stringify(adapterName)},`,\n ' options: { source: \"tickets\" },',\n ' args: [\"batch-1\"],',\n \" });\",\n \" assert.equal(imported.handled, true);\",\n ' assert.deepEqual(imported.result, { imported: 1, source: \"tickets\", args: [\"batch-1\"] });',\n \"\",\n \" const exported = await runRegisteredExporterForTest(activation, {\",\n ` exporter: ${JSON.stringify(adapterName)},`,\n ' options: { destination: \"archive\" },',\n ' args: [\"done\"],',\n \" });\",\n \" assert.equal(exported.handled, true);\",\n ' assert.deepEqual(exported.result, { exported: true, destination: \"archive\", args: [\"done\"] });',\n \"});\",\n \"\",\n ]\n : [];\n return [\n 'import assert from \"node:assert/strict\";',\n 'import { test } from \"node:test\";',\n \"import {\",\n ...importNames,\n '} from \"@unbrained/pm-cli/sdk/testing\";',\n 'import extension from \"./index.js\";',\n \"\",\n `test(${JSON.stringify(`${extensionName} registers its starter command`)}, async () => {`,\n \" // `capabilities` mirrors manifest.json so the in-memory activation grants\",\n \" // the capabilities the entrypoint relies on.\",\n \" const activation = await activateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" // assertRegisteredCommandContract throws if the command is not\",\n \" // registered, so reaching here already proves the wiring; assert on the\",\n \" // returned definition to demonstrate inspecting registered metadata.\",\n \" const registered = assertRegisteredCommandContract(activation.registrations, {\",\n ` command: ${JSON.stringify(commandName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n ' assert.equal(typeof registered.command.description, \"string\");',\n \"\",\n \" // runRegisteredCommandForTest invokes the handler through pm's real\",\n \" // dispatch engine, so this asserts behavior - not just that the command\",\n \" // is wired. Replace these assertions as you flesh out your command.\",\n \" const invocation = await runRegisteredCommandForTest(activation.commands, {\",\n ` command: ${JSON.stringify(commandName)},`,\n \" });\",\n \" assert.equal(invocation.handled, true);\",\n \" assert.equal(invocation.result.ok, true);\",\n ` assert.equal(invocation.result.command, ${JSON.stringify(commandName)});`,\n \"});\",\n \"\",\n ...hookTestLines,\n ...searchTestLines,\n ...importerTestLines,\n `test(${JSON.stringify(`${extensionName} tears down cleanly via deactivate`)}, async () => {`,\n \" // deactivateExtensionForTest runs pm's real teardown engine over the\",\n \" // module, so this proves your `deactivate` hook runs without throwing.\",\n \" const teardown = await deactivateExtensionForTest(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" // assertExtensionDeactivated throws unless exactly one extension tore down\",\n \" // with no failures, so reaching the next line already proves teardown ran.\",\n \" assertExtensionDeactivated(teardown);\",\n \" assert.equal(teardown.deactivated, 1);\",\n \"});\",\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * Implements build starter extension scaffold files for the public runtime surface of this module.\n */\nexport function buildStarterExtensionScaffoldFiles(\n extensionName: string,\n commandName: string,\n vocabulary: \"extension\" | \"package\",\n capability: ExtensionScaffoldCapability = \"commands\",\n): Record<string, string> {\n const packageName = `pm-${extensionName}`;\n const capabilities = SCAFFOLD_MANIFEST_CAPABILITIES[capability];\n const manifest = `${JSON.stringify(\n {\n name: extensionName,\n version: \"0.1.0\",\n entry: \"./index.js\",\n manifest_version: SCAFFOLD_MANIFEST_VERSION,\n pm_min_version: SCAFFOLD_PM_MIN_VERSION,\n trusted: true,\n sandbox_profile: \"strict\",\n permissions: { ...SCAFFOLD_DECLARED_PERMISSIONS },\n capabilities,\n },\n null,\n 2,\n )}\\n`;\n // Keep scaffolds dependency-light by default: even package mode can be\n // installed before peer dependencies are materialized in the generated root.\n // The JSDoc import preserves editor narrowing without forcing the runtime\n // loader to resolve @unbrained/pm-cli/sdk from a freshly generated scaffold.\n const entrypoint = [\n '/** @param {import(\"@unbrained/pm-cli/sdk\").ExtensionApi} api */',\n \"export function activate(api) {\",\n ...buildActivateBodyLines(extensionName, commandName, capability),\n \"}\",\n \"\",\n \"// `deactivate` is the teardown counterpart to `activate`: pm runs it on host\",\n \"// shutdown/reload (e.g. the MCP server between requests) to release anything\",\n \"// `activate` opened - timers, connections, caches. This starter holds no such\",\n \"// resources, so it stays a documented no-op; add cleanup here as you grow.\",\n \"export function deactivate() {}\",\n \"\",\n \"export default {\",\n \" activate,\",\n \" deactivate,\",\n \"};\",\n \"\",\n ].join(\"\\n\");\n // README bullet describing what index.js wires, kept in sync with the chosen\n // capability so the generated docs match the generated code.\n const entrypointBullet = ENTRYPOINT_BULLETS[capability];\n if (vocabulary === \"package\") {\n const packageJson = `${JSON.stringify(\n {\n name: packageName,\n version: \"0.1.0\",\n private: true,\n type: \"module\",\n keywords: [\"pm-package\"],\n // `node --test` runs the colocated *.test.js sample against the peer SDK\n // testing helpers; no extra dev-dependency or test runner is required.\n scripts: {\n test: \"node --test\",\n },\n peerDependencies: {\n \"@unbrained/pm-cli\": \"*\",\n },\n pm: {\n aliases: [extensionName],\n extensions: [\".\"],\n docs: [\"README.md\"],\n examples: [\"README.md\"],\n catalog: {\n display_name: extensionName,\n category: \"workflow\",\n summary: \"Starter pm package scaffold.\",\n tags: [\"starter\"],\n },\n },\n },\n null,\n 2,\n )}\\n`;\n // node:test sample: demonstrates validating the package with the SDK testing\n // helpers without adding a third-party test runner. The suite covers the\n // capability the scaffold targets (command invocation, and for the hooks\n // capability, the after_command lifecycle hook).\n const sampleTest = buildSampleTestSource(extensionName, commandName, capability);\n const sampleTestBullet = SAMPLE_TEST_BULLETS[capability];\n const gitignore = [\"node_modules/\", \"*.log\", \"\"].join(\"\\n\");\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const defineBuilderImports = [\n \"defineCommand\",\n ...(capability === \"hooks\" ? [\"defineAfterCommandHook\"] : []),\n ...(capability === \"search\" ? [\"defineSearchProvider\", \"defineVectorStoreAdapter\"] : []),\n ...(capability === \"importers\" ? [\"defineImporter\", \"defineExporter\"] : []),\n ].join(\", \");\n const defineBuilderSnippet = [\n \"```js\",\n `import { ${defineBuilderImports} } from \"@unbrained/pm-cli/sdk\";`,\n \"\",\n \"export const pingCommand = defineCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" run: (context) => ({ ok: true, command: context.command }),\",\n \"});\",\n ];\n if (capability === \"hooks\") {\n defineBuilderSnippet.push(\n \"\",\n \"export const afterCommandHook = defineAfterCommandHook((context) => {\",\n \" if (!context.ok) return;\",\n \" // React to context.affected here as your package grows.\",\n \"});\",\n );\n }\n if (capability === \"search\") {\n defineBuilderSnippet.push(\n \"\",\n \"export const searchProvider = defineSearchProvider({\",\n ` name: ${JSON.stringify(searchProviderName)},`,\n \" query: async (context) => ({\",\n \" hits: context.documents\",\n \" .filter((document) => String(document.metadata.title ?? \\\"\\\").toLowerCase().includes(context.query.toLowerCase()))\",\n \" .map((document) => ({ id: document.metadata.id, score: 1, matched_fields: [\\\"title\\\"] })),\",\n \" }),\",\n \" embed: async (context) => [context.input.length],\",\n \"});\",\n \"\",\n \"export const vectorStoreAdapter = defineVectorStoreAdapter({\",\n ` name: ${JSON.stringify(vectorAdapterName)},`,\n \" query: async (context) => [{ id: \\\"starter-vector-hit\\\", score: context.limit }],\",\n \" upsert: async (context) => ({ upserted: context.points.length }),\",\n \" delete: async (context) => ({ deleted: context.ids.length }),\",\n \"});\",\n );\n }\n if (capability === \"importers\") {\n defineBuilderSnippet.push(\n \"\",\n \"export const importer = defineImporter(async (context) => ({\",\n \" imported: 1,\",\n \" source: context.options.source ?? \\\"starter\\\",\",\n \" args: context.args,\",\n \"}));\",\n \"\",\n \"export const exporter = defineExporter(async (context) => ({\",\n \" exported: true,\",\n \" destination: context.options.destination ?? \\\"stdout\\\",\",\n \" args: context.args,\",\n \"}));\",\n );\n }\n defineBuilderSnippet.push(\n \"\",\n \"export function activate(api) {\",\n \" api.registerCommand(pingCommand);\",\n );\n if (capability === \"hooks\") {\n defineBuilderSnippet.push(\" api.hooks.afterCommand(afterCommandHook);\");\n }\n if (capability === \"search\") {\n defineBuilderSnippet.push(\" api.registerSearchProvider(searchProvider);\", \" api.registerVectorStoreAdapter(vectorStoreAdapter);\");\n }\n if (capability === \"importers\") {\n defineBuilderSnippet.push(\n ` api.registerImporter(${JSON.stringify(adapterName)}, importer, {`,\n ` action: ${JSON.stringify(`${adapterName} import`)},`,\n ' description: \"Import starter records into pm context.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--source\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Source name or path to import from.\",',\n \" },\",\n \" ],\",\n \" });\",\n ` api.registerExporter(${JSON.stringify(adapterName)}, exporter, {`,\n ` action: ${JSON.stringify(`${adapterName} export`)},`,\n ' description: \"Export pm context into starter records.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--destination\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Destination name or path to export to.\",',\n \" },\",\n \" ],\",\n \" });\",\n );\n }\n defineBuilderSnippet.push(\n \"}\",\n \"\",\n \"export function deactivate() {}\",\n \"\",\n \"export default { activate, deactivate };\",\n \"```\",\n );\n const packageReadme = [\n `# ${packageName}`,\n \"\",\n \"Generated by `pm package init`.\",\n \"\",\n \"## Included Files\",\n \"- `package.json`: package metadata, `test` script, and `pm` resource manifest.\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n entrypointBullet,\n sampleTestBullet,\n \"- `.gitignore`: ignores `node_modules/` and log files.\",\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm install --project <package-path>\",\n `pm ${commandName}`,\n \"pm package doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Validate the Package\",\n \"Install the peer SDK once, then run the colocated sample test:\",\n \"```bash\",\n \"npm install\",\n \"npm test\",\n \"```\",\n \"`npm test` runs `node --test`, which executes `index.test.js` against the\",\n \"`@unbrained/pm-cli/sdk/testing` helpers - no extra test runner required.\",\n \"\",\n \"## Authoring With define* Builders\",\n \"`index.js` stays import-free so the package can be installed locally before\",\n \"`npm install` materializes peer dependencies. After installing dependencies,\",\n \"use the public SDK authoring builders for exported definitions you want\",\n \"editor type-checking, contextual handler inference, and direct unit tests for:\",\n ...defineBuilderSnippet,\n \"The builders return their argument unchanged; runtime validation still lives\",\n \"in `api.register*`, and behavior validation lives in `sdk/testing`.\",\n ...PACKAGE_CAPABILITY_README_SECTIONS[capability],\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`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.`,\n \"- `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.\",\n \"\",\n \"## Policy Metadata\",\n \"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`.\",\n \"\",\n \"## Notes\",\n \"- Keep simple starter runtime behavior at the package root so local installs work without dependency bootstrapping.\",\n \"- Move larger runtimes into subdirectories only after adding package dependencies and validating `pm package doctor`.\",\n \"- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.\",\n \"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"package.json\": packageJson,\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"index.test.js\": sampleTest,\n \".gitignore\": gitignore,\n \"README.md\": packageReadme,\n };\n }\n const readme = [\n `# ${extensionName}`,\n \"\",\n \"Generated by `pm extension init`.\",\n \"\",\n \"## Included Files\",\n \"- `manifest.json`: extension metadata and capabilities.\",\n entrypointBullet,\n \"\",\n \"## Quick Start\",\n \"```bash\",\n \"pm extension --install --project <scaffold-path>\",\n `pm ${commandName}`,\n \"pm extension --doctor --project --detail summary\",\n \"```\",\n ...EXTENSION_CAPABILITY_README_SECTIONS[capability],\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`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.`,\n \"- `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.\",\n \"\",\n \"## Policy Metadata\",\n \"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`.\",\n \"\",\n \"## Notes\",\n \"- This scaffold uses ESM exports so it works in package scopes with `type: module`.\",\n \"- Update `manifest.json` capabilities and `index.js` command behavior as your extension evolves.\",\n \"- Release any resources `activate` opens (timers, connections, caches) in the `deactivate` teardown hook.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"manifest.json\": manifest,\n \"index.js\": entrypoint,\n \"README.md\": readme,\n };\n}\n\n/**\n * Implements scaffold extension project for the public runtime surface of this module.\n */\nexport async function scaffoldExtensionProject(\n target: string,\n vocabulary: \"extension\" | \"package\" = \"extension\",\n capability: string = \"commands\",\n): Promise<ExtensionScaffoldResult> {\n const normalizedCapability = capability.trim().toLowerCase();\n if (!(SCAFFOLD_CAPABILITIES as readonly string[]).includes(normalizedCapability)) {\n throw new PmCliError(\n `Unknown scaffold capability \"${capability}\". Supported capabilities: ${SCAFFOLD_CAPABILITIES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n const resolvedCapability = normalizedCapability as ExtensionScaffoldCapability;\n const normalizedTarget = target.trim();\n const targetPath = path.resolve(process.cwd(), normalizedTarget);\n const extensionName = normalizeManagedDirectoryName(path.basename(targetPath));\n // Hyphenated top-level command groups can surface in help but fail dispatch in\n // Commander, so generated starters use space-separated command words while the\n // manifest and package identity keep their normalized directory names.\n const commandName = `${extensionName.replace(/-/g, \" \")} ping`;\n const scaffoldFiles = buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary, resolvedCapability);\n\n let createdDirectory = false;\n if (await pathExists(targetPath)) {\n const existingTargetStats = await fs.stat(targetPath);\n if (!existingTargetStats.isDirectory()) {\n throw new PmCliError(\n `Scaffold target \"${targetPath}\" exists and is not a directory.`,\n EXIT_CODE.CONFLICT,\n );\n }\n } else {\n await fs.mkdir(targetPath, { recursive: true });\n createdDirectory = true;\n }\n\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (!(await pathExists(absolutePath))) {\n continue;\n }\n const existingContent = await fs.readFile(absolutePath, \"utf8\");\n if (existingContent !== content) {\n throw new PmCliError(\n `Scaffold file \"${relativePath}\" already exists with different content in \"${targetPath}\". Choose a new target path or remove conflicting files.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n\n const files: ExtensionScaffoldFileResult[] = [];\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (await pathExists(absolutePath)) {\n files.push({\n path: relativePath,\n status: \"unchanged\",\n });\n continue;\n }\n await fs.mkdir(path.dirname(absolutePath), { recursive: true });\n await fs.writeFile(absolutePath, content, \"utf8\");\n files.push({\n path: relativePath,\n status: \"created\",\n });\n }\n\n return {\n extension_name: extensionName,\n command_name: commandName,\n capability: resolvedCapability,\n target_path: targetPath,\n created_directory: createdDirectory,\n files,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE5D,0EAA0E;AAC1E,sEAAsE;AACtE,+EAA+E;AAC/E,uDAAuD;AACvD,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAC3C,MAAM,6BAA6B,GAAG;IACpC,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,KAAK;IAChB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF;;;;;;;G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AAe,KAAK,OAAO,EAAE,CAAC;YAChC,MAAM,IAAI,UAAU,CAClB,kBAAkB,YAAY,+CAA+C,UAAU,0DAA0D,EACjJ,SAAS,CAAC,QAAQ,CACnB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAkC,EAAE,CAAC;IAChD,KAAK,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACpE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QACzD,IAAI,MAAM,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,YAAY;gBAClB,MAAM,EAAE,WAAW;aACpB,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChE,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,YAAY;YAClB,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,cAAc,EAAE,aAAa;QAC7B,YAAY,EAAE,WAAW;QACzB,UAAU,EAAE,kBAAkB;QAC9B,WAAW,EAAE,UAAU;QACvB,iBAAiB,EAAE,gBAAgB;QACnC,KAAK;KACN,CAAC;AACJ,CAAC","debugId":"4513e1ea-24a5-55b1-9465-78d5d9febba7"}
@@ -11,7 +11,7 @@ export type { ManagedExtensionStateReadResult } from "./extension/managed-state.
11
11
  /**
12
12
  * Restricts extension command action values accepted by command, SDK, and storage contracts.
13
13
  */
14
- export type ExtensionCommandAction = "install" | "uninstall" | "explore" | "manage" | "reload" | "doctor" | "catalog" | "adopt" | "adopt-all" | "activate" | "deactivate" | "init";
14
+ export type ExtensionCommandAction = "install" | "uninstall" | "explore" | "manage" | "describe" | "reload" | "doctor" | "catalog" | "adopt" | "adopt-all" | "activate" | "deactivate" | "init";
15
15
  /**
16
16
  * Restricts extension scope values accepted by command, SDK, and storage contracts.
17
17
  */
@@ -28,6 +28,7 @@ export interface ExtensionCommandOptions {
28
28
  uninstall?: boolean;
29
29
  explore?: boolean;
30
30
  manage?: boolean;
31
+ describe?: boolean;
31
32
  reload?: boolean;
32
33
  doctor?: boolean;
33
34
  catalog?: boolean;
@@ -4,7 +4,7 @@
4
4
  * Implements the pm extension command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1402dcb1-4fe9-5ec7-a34f-990b54437d1e")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bc327a80-93b0-5be9-9ebf-8864cf67d23d")}catch(e){}}();
8
8
  import { execFile } from "node:child_process";
9
9
  import fs from "node:fs/promises";
10
10
  import os from "node:os";
@@ -29,6 +29,7 @@ import { sortManagedEntries, managedExtensionSourcesEquivalent, readManagedExten
29
29
  import { parseExtensionInstallSource, resolveInstallSource, areDirectoriesEquivalent, runGitCommand, } from "./extension/install-sources.js";
30
30
  import { resolveBundledExtensionAliasSource, isBundledPackageInstallAllTarget, listBundledPackageAliases, resolveBundledAliasManifestName, buildBundledPackageCatalog, } from "./extension/bundled-catalog.js";
31
31
  import { scaffoldExtensionProject } from "./extension/scaffold.js";
32
+ import { buildExtensionDescribeResult } from "./extension/describe.js";
32
33
  import { applyDoctorRuntimeActivationState, classifyDoctorLoadFailureWarnings, classifyDoctorActivationFailureWarnings, classifyUnusedCapabilityWarnings, buildExtensionTriageSummary, parseDoctorDetailMode, collectUnknownCapabilityGuidance, buildCapabilityContractMetadata, buildDoctorConsistencySummary, } from "./extension/doctor.js";
33
34
  // Re-export the public surface that lives in sibling modules but was previously
34
35
  // exported from this file (used by sdk barrels, upgrade.ts, and tests).
@@ -273,6 +274,7 @@ function resolveAction(target, options) {
273
274
  options.uninstall ? "uninstall" : null,
274
275
  options.explore ? "explore" : null,
275
276
  options.manage ? "manage" : null,
277
+ options.describe ? "describe" : null,
276
278
  options.reload ? "reload" : null,
277
279
  options.doctor ? "doctor" : null,
278
280
  options.catalog ? "catalog" : null,
@@ -308,7 +310,7 @@ function resolveAction(target, options) {
308
310
  if (target === undefined) {
309
311
  return "explore";
310
312
  }
311
- throw new PmCliError("One action flag is required. Use one of: --install, --uninstall, --explore, --manage, --reload, --doctor, --catalog, --init/--scaffold, --adopt, --adopt-all, --activate, --deactivate. Bare `pm package` and `pm extension` default to --explore.", EXIT_CODE.USAGE);
313
+ throw new PmCliError("One action flag is required. Use one of: --install, --uninstall, --explore, --manage, --describe, --reload, --doctor, --catalog, --init/--scaffold, --adopt, --adopt-all, --activate, --deactivate. Bare `pm package` and `pm extension` default to --explore.", EXIT_CODE.USAGE);
312
314
  }
313
315
  if (selected.length > 1) {
314
316
  throw new PmCliError("Extension action flags are mutually exclusive.", EXIT_CODE.USAGE);
@@ -1436,6 +1438,29 @@ export async function runExtension(target, options, global) {
1436
1438
  }
1437
1439
  return withResult(details);
1438
1440
  }
1441
+ if (action === "describe") {
1442
+ const settings = await readSettings(resolvedRoots.settings_root);
1443
+ const loadResult = await loadExtensions({
1444
+ pmRoot: resolvedRoots.pm_root,
1445
+ settings,
1446
+ cwd: process.cwd(),
1447
+ noExtensions: global.noExtensions === true,
1448
+ });
1449
+ const activationResult = await activateExtensions(loadResult);
1450
+ warnings.push(...loadResult.warnings);
1451
+ warnings.push(...activationResult.warnings);
1452
+ const describeResult = buildExtensionDescribeResult(normalizedTarget, loadResult, activationResult);
1453
+ if (normalizedTarget !== undefined && describeResult.extensions.length === 0) {
1454
+ const noun = options.vocabulary === "package" ? "package" : "extension";
1455
+ throw new PmCliError(`No loaded ${noun} named "${normalizedTarget}" was found in ${scope} scope. Run pm ${noun} explore to list discovered ${noun}s.`, EXIT_CODE.NOT_FOUND);
1456
+ }
1457
+ return withResult({
1458
+ target: describeResult.target,
1459
+ total: describeResult.total,
1460
+ extensions: describeResult.extensions,
1461
+ union: describeResult.union,
1462
+ });
1463
+ }
1439
1464
  /* c8 ignore start -- explore/manage action split is validated by dedicated command-action tests */
1440
1465
  if (action === "explore" || action === "manage") {
1441
1466
  const settings = await readSettings(resolvedRoots.settings_root);
@@ -1584,4 +1609,4 @@ export const _testOnly = {
1584
1609
  withExtensionInstallLock,
1585
1610
  };
1586
1611
  //# sourceMappingURL=extension.js.map
1587
- //# debugId=1402dcb1-4fe9-5ec7-a34f-990b54437d1e
1612
+ //# debugId=bc327a80-93b0-5be9-9ebf-8864cf67d23d