@unbrained/pm-cli 2026.6.24 → 2026.7.1

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 (744) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +113 -1
  3. package/CONTRIBUTING.md +30 -0
  4. package/README.md +16 -3
  5. package/dist/cli/bootstrap-args.js +89 -79
  6. package/dist/cli/bootstrap-args.js.map +1 -1
  7. package/dist/cli/commander-usage.js +3 -3
  8. package/dist/cli/commander-usage.js.map +1 -1
  9. package/dist/cli/commands/aggregate.js +8 -7
  10. package/dist/cli/commands/aggregate.js.map +1 -1
  11. package/dist/cli/commands/calendar.js +63 -62
  12. package/dist/cli/commands/calendar.js.map +1 -1
  13. package/dist/cli/commands/close.d.ts +2 -4
  14. package/dist/cli/commands/close.js +5 -17
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/completion.js +158 -9
  17. package/dist/cli/commands/completion.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +1 -1
  19. package/dist/cli/commands/config.js +2 -2
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/context.d.ts +31 -4
  22. package/dist/cli/commands/context.js +33 -10
  23. package/dist/cli/commands/context.js.map +1 -1
  24. package/dist/cli/commands/contracts.js +48 -8
  25. package/dist/cli/commands/contracts.js.map +1 -1
  26. package/dist/cli/commands/create.d.ts +1 -6
  27. package/dist/cli/commands/create.js +491 -587
  28. package/dist/cli/commands/create.js.map +1 -1
  29. package/dist/cli/commands/extension/bundled-catalog.js +59 -46
  30. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
  31. package/dist/cli/commands/extension/describe.d.ts +15 -0
  32. package/dist/cli/commands/extension/describe.js +48 -2
  33. package/dist/cli/commands/extension/describe.js.map +1 -1
  34. package/dist/cli/commands/extension/doctor.js +129 -75
  35. package/dist/cli/commands/extension/doctor.js.map +1 -1
  36. package/dist/cli/commands/extension/install-sources.js +37 -7
  37. package/dist/cli/commands/extension/install-sources.js.map +1 -1
  38. package/dist/cli/commands/extension/managed-state.js +101 -57
  39. package/dist/cli/commands/extension/managed-state.js.map +1 -1
  40. package/dist/cli/commands/extension/scaffold.d.ts +38 -8
  41. package/dist/cli/commands/extension/scaffold.js +1956 -242
  42. package/dist/cli/commands/extension/scaffold.js.map +1 -1
  43. package/dist/cli/commands/extension.d.ts +28 -3
  44. package/dist/cli/commands/extension.js +1181 -880
  45. package/dist/cli/commands/extension.js.map +1 -1
  46. package/dist/cli/commands/index.d.ts +3 -1
  47. package/dist/cli/commands/index.js +5 -3
  48. package/dist/cli/commands/index.js.map +1 -1
  49. package/dist/cli/commands/item-filter-options.d.ts +63 -0
  50. package/dist/cli/commands/item-filter-options.js +10 -0
  51. package/dist/cli/commands/item-filter-options.js.map +1 -0
  52. package/dist/cli/commands/legacy-none-tokens.d.ts +14 -0
  53. package/dist/cli/commands/legacy-none-tokens.js +31 -2
  54. package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
  55. package/dist/cli/commands/linked-artifacts.d.ts +7 -0
  56. package/dist/cli/commands/linked-artifacts.js +12 -2
  57. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  58. package/dist/cli/commands/list-filter-shared.js +55 -48
  59. package/dist/cli/commands/list-filter-shared.js.map +1 -1
  60. package/dist/cli/commands/list.d.ts +16 -39
  61. package/dist/cli/commands/list.js +127 -118
  62. package/dist/cli/commands/list.js.map +1 -1
  63. package/dist/cli/commands/next.d.ts +98 -0
  64. package/dist/cli/commands/next.js +304 -0
  65. package/dist/cli/commands/next.js.map +1 -0
  66. package/dist/cli/commands/profile.d.ts +208 -0
  67. package/dist/cli/commands/profile.js +418 -0
  68. package/dist/cli/commands/profile.js.map +1 -0
  69. package/dist/cli/commands/repeatable-metadata-parsers.js +12 -13
  70. package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
  71. package/dist/cli/commands/schema.d.ts +7 -0
  72. package/dist/cli/commands/schema.js +9 -3
  73. package/dist/cli/commands/schema.js.map +1 -1
  74. package/dist/cli/commands/search.d.ts +2 -39
  75. package/dist/cli/commands/search.js +196 -172
  76. package/dist/cli/commands/search.js.map +1 -1
  77. package/dist/cli/commands/shared-unset-fields.d.ts +30 -0
  78. package/dist/cli/commands/shared-unset-fields.js +161 -0
  79. package/dist/cli/commands/shared-unset-fields.js.map +1 -0
  80. package/dist/cli/commands/stats.js +15 -3
  81. package/dist/cli/commands/stats.js.map +1 -1
  82. package/dist/cli/commands/test.js +115 -125
  83. package/dist/cli/commands/test.js.map +1 -1
  84. package/dist/cli/commands/update.d.ts +1 -6
  85. package/dist/cli/commands/update.js +37 -232
  86. package/dist/cli/commands/update.js.map +1 -1
  87. package/dist/cli/commands/validate.js +20 -5
  88. package/dist/cli/commands/validate.js.map +1 -1
  89. package/dist/cli/extension-command-options.js +48 -21
  90. package/dist/cli/extension-command-options.js.map +1 -1
  91. package/dist/cli/help-content.js +26 -2
  92. package/dist/cli/help-content.js.map +1 -1
  93. package/dist/cli/help-json-payload.js +3 -3
  94. package/dist/cli/help-json-payload.js.map +1 -1
  95. package/dist/cli/main.js +27 -12
  96. package/dist/cli/main.js.map +1 -1
  97. package/dist/cli/register-list-query.js +42 -3
  98. package/dist/cli/register-list-query.js.map +1 -1
  99. package/dist/cli/register-mutation.js +86 -2
  100. package/dist/cli/register-mutation.js.map +1 -1
  101. package/dist/cli/register-setup.js +67 -6
  102. package/dist/cli/register-setup.js.map +1 -1
  103. package/dist/cli/registration-helpers.d.ts +9 -1
  104. package/dist/cli/registration-helpers.js +149 -123
  105. package/dist/cli/registration-helpers.js.map +1 -1
  106. package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +16 -0
  107. package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js → activity-DBLQVIP6.js} +9 -11
  108. package/dist/cli-bundle/chunks/{aggregate-63NWNIBR.js → aggregate-JTEF4BP7.js} +17 -18
  109. package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +1 -0
  110. package/dist/cli-bundle/chunks/{aggregate-YHCYX2EV.js → aggregate-SDF7DUOD.js} +16 -17
  111. package/dist/cli-bundle/chunks/aggregate-SDF7DUOD.js.map +7 -0
  112. package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js → append-LOVPGVPT.js} +8 -10
  113. package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js.map → append-LOVPGVPT.js.map} +1 -1
  114. package/dist/cli-bundle/chunks/{append-PUKREFV5.js → append-QCFJSDFL.js} +10 -12
  115. package/dist/cli-bundle/chunks/{append-PUKREFV5.js.map → append-QCFJSDFL.js.map} +1 -1
  116. package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js → chunk-22WKIL3H.js} +9 -11
  117. package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js.map → chunk-22WKIL3H.js.map} +1 -1
  118. package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js → chunk-2466X6E4.js} +9 -11
  119. package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js.map → chunk-2466X6E4.js.map} +1 -1
  120. package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js → chunk-27BXPBAY.js} +3 -3
  121. package/dist/cli-bundle/chunks/{schema-QO5I4FBL.js → chunk-2D4HATP2.js} +136 -66
  122. package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +1 -0
  123. package/dist/cli-bundle/chunks/{chunk-J7I4C5ZB.js → chunk-3J6JRJ3I.js} +153 -125
  124. package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +7 -0
  125. package/dist/cli-bundle/chunks/{chunk-OHDQNKJB.js → chunk-3K2M5OYU.js} +106 -34
  126. package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +7 -0
  127. package/dist/cli-bundle/chunks/{chunk-XVYKWZNL.js → chunk-3S2KT7NG.js} +127 -127
  128. package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +7 -0
  129. package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js → chunk-3VGN2UWE.js} +2 -2
  130. package/dist/cli-bundle/chunks/{chunk-N5B6WZC5.js → chunk-3XZCOZ5J.js} +115 -123
  131. package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +1 -0
  132. package/dist/cli-bundle/chunks/chunk-4A3BJ675.js +799 -0
  133. package/dist/cli-bundle/chunks/chunk-4A3BJ675.js.map +1 -0
  134. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
  135. package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
  136. package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js → chunk-4DSGXSBL.js} +5 -7
  137. package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js.map → chunk-4DSGXSBL.js.map} +1 -1
  138. package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js → chunk-4DUVCVLZ.js} +4 -6
  139. package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js.map → chunk-4DUVCVLZ.js.map} +1 -1
  140. package/dist/cli-bundle/chunks/{chunk-IAP5KYBQ.js → chunk-4XOIEKSD.js} +563 -506
  141. package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +1 -0
  142. package/dist/cli-bundle/chunks/{context-5LB7UGKE.js → chunk-55SNVXRQ.js} +79 -82
  143. package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +7 -0
  144. package/dist/cli-bundle/chunks/{chunk-BFFO3AIB.js → chunk-5CGRF3L5.js} +128 -128
  145. package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +1 -0
  146. package/dist/cli-bundle/chunks/{chunk-JKL6HRMV.js → chunk-5QFDBI4F.js} +1260 -1046
  147. package/dist/cli-bundle/chunks/chunk-5QFDBI4F.js.map +7 -0
  148. package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js → chunk-64HNBBFQ.js} +8 -12
  149. package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js.map → chunk-64HNBBFQ.js.map} +1 -1
  150. package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js +2444 -0
  151. package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js.map +1 -0
  152. package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js +17 -0
  153. package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js.map +7 -0
  154. package/dist/cli-bundle/chunks/{chunk-VSAABFGQ.js → chunk-7R4QEMZZ.js} +1490 -734
  155. package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +1 -0
  156. package/dist/cli-bundle/chunks/{chunk-M6TUBOGW.js → chunk-A7FPBAQS.js} +19 -12
  157. package/dist/cli-bundle/chunks/chunk-A7FPBAQS.js.map +1 -0
  158. package/dist/cli-bundle/chunks/{chunk-GQYJEEFX.js → chunk-AVEE5EHK.js} +53 -54
  159. package/dist/cli-bundle/chunks/chunk-AVEE5EHK.js.map +1 -0
  160. package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js → chunk-AXIDKKAT.js} +2 -2
  161. package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js → chunk-BDTISOSD.js} +2 -2
  162. package/dist/cli-bundle/chunks/{chunk-C4C3EJCJ.js → chunk-BHO33VBQ.js} +509 -363
  163. package/dist/cli-bundle/chunks/chunk-BHO33VBQ.js.map +7 -0
  164. package/dist/cli-bundle/chunks/{chunk-6W3Y65PL.js → chunk-BZCEN4JA.js} +198 -177
  165. package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +7 -0
  166. package/dist/cli-bundle/chunks/{chunk-RRP6D345.js → chunk-CF7RL6FR.js} +12 -16
  167. package/dist/cli-bundle/chunks/{chunk-RRP6D345.js.map → chunk-CF7RL6FR.js.map} +1 -1
  168. package/dist/cli-bundle/chunks/{chunk-HC2S36NB.js → chunk-CWFNTKQJ.js} +154 -126
  169. package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +1 -0
  170. package/dist/cli-bundle/chunks/chunk-CZVISY5A.js +87 -0
  171. package/dist/cli-bundle/chunks/chunk-CZVISY5A.js.map +7 -0
  172. package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js → chunk-DDPTYJIM.js} +2 -2
  173. package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js → chunk-EJUDVUYZ.js} +3 -3
  174. package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js → chunk-EVMTBV6V.js} +3 -3
  175. package/dist/cli-bundle/chunks/{chunk-RAWA3Y7O.js → chunk-FFMQB7WR.js} +199 -178
  176. package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +1 -0
  177. package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js → chunk-G7I7DEZA.js} +4 -4
  178. package/dist/cli-bundle/chunks/{chunk-MEXZ5XUM.js → chunk-GJ326ZKX.js} +53 -54
  179. package/dist/cli-bundle/chunks/chunk-GJ326ZKX.js.map +7 -0
  180. package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js +119 -0
  181. package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js.map +7 -0
  182. package/dist/cli-bundle/chunks/{chunk-OF7V47P3.js → chunk-HXTQJXWT.js} +2172 -2146
  183. package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +1 -0
  184. package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js → chunk-HYTGA6GI.js} +3 -3
  185. package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js → chunk-HZZEHPRG.js} +2 -2
  186. package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js +14 -0
  187. package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js.map +1 -0
  188. package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js → chunk-IJYK2T43.js} +2 -2
  189. package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js → chunk-IPYBJWTE.js} +10 -14
  190. package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js.map → chunk-IPYBJWTE.js.map} +1 -1
  191. package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js → chunk-IZBR4NRW.js} +10 -14
  192. package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js.map → chunk-IZBR4NRW.js.map} +1 -1
  193. package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js → chunk-JLM7BHI7.js} +7 -9
  194. package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js.map → chunk-JLM7BHI7.js.map} +1 -1
  195. package/dist/cli-bundle/chunks/{chunk-6EL7SW5C.js → chunk-JMP4E6D7.js} +114 -122
  196. package/dist/cli-bundle/chunks/chunk-JMP4E6D7.js.map +7 -0
  197. package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js → chunk-JPECA746.js} +2 -2
  198. package/dist/cli-bundle/chunks/{chunk-KJZOSF7J.js → chunk-JSU5P7VS.js} +100 -35
  199. package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +1 -0
  200. package/dist/cli-bundle/chunks/{context-55VEOYI3.js → chunk-JWXRETDF.js} +79 -82
  201. package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +1 -0
  202. package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js → chunk-KNPEF7QG.js} +4 -4
  203. package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js → chunk-L5OEFZQG.js} +3 -3
  204. package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js → chunk-LB6TP6MC.js} +5 -7
  205. package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js.map → chunk-LB6TP6MC.js.map} +2 -2
  206. package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js → chunk-MAUKX7JC.js} +6 -8
  207. package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js.map → chunk-MAUKX7JC.js.map} +1 -1
  208. package/dist/cli-bundle/chunks/{chunk-SMXSDY7J.js → chunk-MDPEOIGN.js} +2221 -2172
  209. package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +7 -0
  210. package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js → chunk-N74UMG5H.js} +2 -2
  211. package/dist/cli-bundle/chunks/{chunk-IXAZI443.js → chunk-NFDPYAIP.js} +2 -2
  212. package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js → chunk-NKZAN7BD.js} +3 -3
  213. package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js +116 -0
  214. package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js.map +1 -0
  215. package/dist/cli-bundle/chunks/{chunk-L7UXKP2I.js → chunk-NU2UEROZ.js} +1257 -1029
  216. package/dist/cli-bundle/chunks/chunk-NU2UEROZ.js.map +1 -0
  217. package/dist/cli-bundle/chunks/{chunk-HBAEFWX3.js → chunk-NUHHPVVS.js} +65 -335
  218. package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +7 -0
  219. package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js → chunk-NWMZWYYB.js} +2 -2
  220. package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js → chunk-OGXLACHC.js} +10 -14
  221. package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js.map → chunk-OGXLACHC.js.map} +1 -1
  222. package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js +379 -0
  223. package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js.map +1 -0
  224. package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js → chunk-OTUHB4HS.js} +4 -4
  225. package/dist/cli-bundle/chunks/{chunk-ZLWRPBOW.js → chunk-QCWF6IYD.js} +510 -364
  226. package/dist/cli-bundle/chunks/chunk-QCWF6IYD.js.map +1 -0
  227. package/dist/cli-bundle/chunks/{chunk-PRVTGX64.js → chunk-RGEMWD6Q.js} +11 -23
  228. package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +7 -0
  229. package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js +809 -0
  230. package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js.map +7 -0
  231. package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js → chunk-RLDHZHQS.js} +12 -16
  232. package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js.map → chunk-RLDHZHQS.js.map} +1 -1
  233. package/dist/cli-bundle/chunks/{schema-C6QA367T.js → chunk-RMMQ74TG.js} +144 -67
  234. package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +7 -0
  235. package/dist/cli-bundle/chunks/{chunk-EYPINTFR.js → chunk-RVUALSJF.js} +1516 -753
  236. package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +7 -0
  237. package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js +2468 -0
  238. package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js.map +7 -0
  239. package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js → chunk-SLMUGTK3.js} +4 -4
  240. package/dist/cli-bundle/chunks/{chunk-SUREE24M.js → chunk-TP5Q5ZD3.js} +12 -24
  241. package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +1 -0
  242. package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js → chunk-UYUYDGIB.js} +7 -9
  243. package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js.map → chunk-UYUYDGIB.js.map} +1 -1
  244. package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js → chunk-UZIWVBE6.js} +6 -8
  245. package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js.map → chunk-UZIWVBE6.js.map} +1 -1
  246. package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js → chunk-V3NOKJF2.js} +11 -13
  247. package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js.map → chunk-V3NOKJF2.js.map} +1 -1
  248. package/dist/cli-bundle/chunks/{chunk-XXKV4UWE.js → chunk-VARHOHYV.js} +571 -507
  249. package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +7 -0
  250. package/dist/cli-bundle/chunks/{chunk-AEACLRVH.js → chunk-VICZWYGZ.js} +18 -11
  251. package/dist/cli-bundle/chunks/chunk-VICZWYGZ.js.map +7 -0
  252. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
  253. package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
  254. package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js +382 -0
  255. package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js.map +7 -0
  256. package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js → chunk-W4ULYO7Z.js} +11 -13
  257. package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js.map → chunk-W4ULYO7Z.js.map} +1 -1
  258. package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js → chunk-WYDHYJPO.js} +2 -2
  259. package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js → chunk-YITK2PJ6.js} +9 -11
  260. package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js.map → chunk-YITK2PJ6.js.map} +1 -1
  261. package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js +84 -0
  262. package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js.map +1 -0
  263. package/dist/cli-bundle/chunks/{chunk-LNEDHJNQ.js → chunk-ZETXE4SE.js} +66 -329
  264. package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +1 -0
  265. package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js → chunk-ZRP4VG5U.js} +2 -2
  266. package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js → claim-EMQLYPRW.js} +10 -12
  267. package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js.map → claim-EMQLYPRW.js.map} +1 -1
  268. package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js → claim-T3GCKV7C.js} +8 -10
  269. package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js.map → claim-T3GCKV7C.js.map} +1 -1
  270. package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +14 -0
  271. package/dist/cli-bundle/chunks/{close-QHMVWM7M.js → close-TQYAAFJP.js} +7 -8
  272. package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js → close-many-BG5QQIDQ.js} +16 -18
  273. package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js.map → close-many-BG5QQIDQ.js.map} +1 -1
  274. package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js → close-many-LDRVEQY2.js} +18 -20
  275. package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js.map → close-many-LDRVEQY2.js.map} +1 -1
  276. package/dist/cli-bundle/chunks/{comments-5YM62D75.js → comments-QCKR2YY2.js} +11 -13
  277. package/dist/cli-bundle/chunks/{comments-5YM62D75.js.map → comments-QCKR2YY2.js.map} +1 -1
  278. package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js → comments-YUXJRZPQ.js} +9 -11
  279. package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js.map → comments-YUXJRZPQ.js.map} +1 -1
  280. package/dist/cli-bundle/chunks/{config-NCNNWF6R.js → config-DMSU64QO.js} +18 -387
  281. package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +7 -0
  282. package/dist/cli-bundle/chunks/{config-SW3U7XP2.js → config-QH2DICD6.js} +18 -380
  283. package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +1 -0
  284. package/dist/cli-bundle/chunks/context-B6275WPX.js +46 -0
  285. package/dist/cli-bundle/chunks/context-OCZ3FJ4Z.js +42 -0
  286. package/dist/cli-bundle/chunks/{contracts-SY6PDFIK.js → contracts-HN7ABKLP.js} +72 -15
  287. package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +7 -0
  288. package/dist/cli-bundle/chunks/{contracts-JXFGBOYT.js → contracts-W4FZVVD6.js} +72 -15
  289. package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +1 -0
  290. package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js → copy-BTJOSKKT.js} +7 -11
  291. package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js.map → copy-BTJOSKKT.js.map} +1 -1
  292. package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js → copy-DEM4DATS.js} +9 -13
  293. package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js.map → copy-DEM4DATS.js.map} +1 -1
  294. package/dist/cli-bundle/chunks/create-OH3BDGBB.js +28 -0
  295. package/dist/cli-bundle/chunks/{create-O4VONGPG.js → create-RLRJMRTM.js} +12 -14
  296. package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js → delete-BHK7VB2Z.js} +5 -7
  297. package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js.map → delete-BHK7VB2Z.js.map} +1 -1
  298. package/dist/cli-bundle/chunks/{delete-724EQ6OS.js → delete-LSVHAB4Y.js} +7 -9
  299. package/dist/cli-bundle/chunks/{delete-724EQ6OS.js.map → delete-LSVHAB4Y.js.map} +1 -1
  300. package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js → deps-4UDFJRUA.js} +8 -11
  301. package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js.map → deps-4UDFJRUA.js.map} +1 -1
  302. package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js → deps-XHYXWEPT.js} +6 -9
  303. package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js.map → deps-XHYXWEPT.js.map} +1 -1
  304. package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js → docs-26S44RXU.js} +8 -9
  305. package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js.map → docs-26S44RXU.js.map} +1 -1
  306. package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js → docs-GYZNVS26.js} +10 -11
  307. package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js.map → docs-GYZNVS26.js.map} +1 -1
  308. package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js → eval-PGRVIJQU.js} +12 -14
  309. package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js.map → eval-PGRVIJQU.js.map} +1 -1
  310. package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js → eval-UYF3ZPVO.js} +10 -12
  311. package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js.map → eval-UYF3ZPVO.js.map} +1 -1
  312. package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js → extension-CPSLJQVE.js} +12 -7
  313. package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js → extension-CXJ6RELI.js} +12 -7
  314. package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js → files-MBNICQFM.js} +9 -11
  315. package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js.map → files-MBNICQFM.js.map} +1 -1
  316. package/dist/cli-bundle/chunks/{files-5BQWDRDT.js → files-NQHEXUZD.js} +11 -13
  317. package/dist/cli-bundle/chunks/{files-5BQWDRDT.js.map → files-NQHEXUZD.js.map} +1 -1
  318. package/dist/cli-bundle/chunks/{focus-RWGKD76E.js → focus-DWYIG7GU.js} +10 -14
  319. package/dist/cli-bundle/chunks/{focus-RWGKD76E.js.map → focus-DWYIG7GU.js.map} +1 -1
  320. package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js → focus-XZW5423D.js} +8 -12
  321. package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js.map → focus-XZW5423D.js.map} +1 -1
  322. package/dist/cli-bundle/chunks/{gc-BEJMQT64.js → gc-7GQYOS2G.js} +3 -3
  323. package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js → gc-LPVMKJQJ.js} +3 -3
  324. package/dist/cli-bundle/chunks/{get-LQG6PEVG.js → get-A7MAOHCU.js} +10 -13
  325. package/dist/cli-bundle/chunks/{get-LQG6PEVG.js.map → get-A7MAOHCU.js.map} +1 -1
  326. package/dist/cli-bundle/chunks/{get-WVN75H42.js → get-DSDEKJ3L.js} +12 -15
  327. package/dist/cli-bundle/chunks/{get-WVN75H42.js.map → get-DSDEKJ3L.js.map} +1 -1
  328. package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js → health-3IPFLKXB.js} +17 -17
  329. package/dist/cli-bundle/chunks/{health-P67NZ6TT.js → health-GZXGBZ36.js} +17 -17
  330. package/dist/cli-bundle/chunks/{history-RUKPKNY7.js → history-NERDJNUB.js} +8 -10
  331. package/dist/cli-bundle/chunks/history-WSZHY3PN.js +18 -0
  332. package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js → history-compact-2WRZ2WK4.js} +11 -14
  333. package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js.map → history-compact-2WRZ2WK4.js.map} +1 -1
  334. package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js → history-compact-HR7BB4LR.js} +13 -16
  335. package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js.map → history-compact-HR7BB4LR.js.map} +1 -1
  336. package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +19 -0
  337. package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js → history-redact-O3NBCNWC.js} +9 -11
  338. package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js → history-repair-LCMOS45X.js} +11 -14
  339. package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js.map → history-repair-LCMOS45X.js.map} +1 -1
  340. package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js → history-repair-XA3LC4GA.js} +13 -16
  341. package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js.map → history-repair-XA3LC4GA.js.map} +1 -1
  342. package/dist/cli-bundle/chunks/{init-HBFGYS66.js → init-64XDLQJB.js} +12 -11
  343. package/dist/cli-bundle/chunks/init-PAX32BJA.js +22 -0
  344. package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js → learnings-JR6MA5TI.js} +9 -11
  345. package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js.map → learnings-JR6MA5TI.js.map} +1 -1
  346. package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js → learnings-LPKCSJX7.js} +11 -13
  347. package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js.map → learnings-LPKCSJX7.js.map} +1 -1
  348. package/dist/cli-bundle/chunks/{list-C7R33MD5.js → list-DNBJVO3E.js} +10 -10
  349. package/dist/cli-bundle/chunks/{list-DSN6UNFB.js → list-G5Y65VF6.js} +10 -10
  350. package/dist/cli-bundle/chunks/next-BCERKDUR.js +277 -0
  351. package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +7 -0
  352. package/dist/cli-bundle/chunks/next-FYTQF6HG.js +274 -0
  353. package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +1 -0
  354. package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js → notes-2BMU3VVQ.js} +9 -11
  355. package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js.map → notes-2BMU3VVQ.js.map} +1 -1
  356. package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js → notes-6KTGO2OJ.js} +11 -13
  357. package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js.map → notes-6KTGO2OJ.js.map} +1 -1
  358. package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js → plan-4WXEQCTN.js} +15 -18
  359. package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js.map → plan-4WXEQCTN.js.map} +1 -1
  360. package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js → plan-RKZHQVXR.js} +17 -20
  361. package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js.map → plan-RKZHQVXR.js.map} +1 -1
  362. package/dist/cli-bundle/chunks/profile-4OMM32CD.js +1235 -0
  363. package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +7 -0
  364. package/dist/cli-bundle/chunks/profile-QLER5ENE.js +1197 -0
  365. package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +1 -0
  366. package/dist/cli-bundle/chunks/{register-list-query-OM3E2KMY.js → register-list-query-7LV46VAU.js} +45 -21
  367. package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +1 -0
  368. package/dist/cli-bundle/chunks/{register-list-query-CCMHGZTF.js → register-list-query-SNG5PGA4.js} +44 -20
  369. package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +7 -0
  370. package/dist/cli-bundle/chunks/{register-mutation-N3CDEGZU.js → register-mutation-ENNDUAZG.js} +106 -40
  371. package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +1 -0
  372. package/dist/cli-bundle/chunks/{register-mutation-UXTTWL6N.js → register-mutation-KK7PHYYU.js} +105 -39
  373. package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +7 -0
  374. package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js → register-operations-C6OWLDSH.js} +32 -34
  375. package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js.map → register-operations-C6OWLDSH.js.map} +1 -1
  376. package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js → register-operations-HZ6XERQG.js} +30 -32
  377. package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js.map → register-operations-HZ6XERQG.js.map} +1 -1
  378. package/dist/cli-bundle/chunks/{register-setup-G5LTSFYK.js → register-setup-P67EMBDJ.js} +68 -25
  379. package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +1 -0
  380. package/dist/cli-bundle/chunks/{register-setup-TWHKICM2.js → register-setup-ZKJ53RS7.js} +67 -24
  381. package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +7 -0
  382. package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js → restore-4MHZFJ2E.js} +9 -11
  383. package/dist/cli-bundle/chunks/restore-YALDGTQR.js +17 -0
  384. package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js → scheduling-shortcuts-LB6DOLRL.js} +14 -16
  385. package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js.map → scheduling-shortcuts-LB6DOLRL.js.map} +1 -1
  386. package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js → scheduling-shortcuts-UTOYKLXQ.js} +12 -14
  387. package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js.map → scheduling-shortcuts-UTOYKLXQ.js.map} +1 -1
  388. package/dist/cli-bundle/chunks/schema-73HR2OJW.js +75 -0
  389. package/dist/cli-bundle/chunks/schema-U6LJKSIR.js +71 -0
  390. package/dist/cli-bundle/chunks/{search-2EI6EAXH.js → search-AXPXKZER.js} +10 -12
  391. package/dist/cli-bundle/chunks/{search-QBFBLQRO.js → search-KILGT37L.js} +10 -12
  392. package/dist/cli-bundle/chunks/{stats-TKC6CAKB.js → stats-PSYVVTNZ.js} +21 -13
  393. package/dist/cli-bundle/chunks/stats-PSYVVTNZ.js.map +1 -0
  394. package/dist/cli-bundle/chunks/{stats-TCW2SZQG.js → stats-W5KNVJWQ.js} +20 -12
  395. package/dist/cli-bundle/chunks/stats-W5KNVJWQ.js.map +7 -0
  396. package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js → telemetry-BZUF6H7G.js} +4 -4
  397. package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js → telemetry-GAHHQTOS.js} +4 -4
  398. package/dist/cli-bundle/chunks/test-ACD52Z3S.js +35 -0
  399. package/dist/cli-bundle/chunks/test-ACD52Z3S.js.map +7 -0
  400. package/dist/cli-bundle/chunks/{test-NV2DRPUS.js → test-PWDIZ255.js} +15 -16
  401. package/dist/cli-bundle/chunks/test-PWDIZ255.js.map +1 -0
  402. package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js → test-all-L2MDDUCA.js} +20 -22
  403. package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js.map → test-all-L2MDDUCA.js.map} +1 -1
  404. package/dist/cli-bundle/chunks/{test-all-REW67LXT.js → test-all-RBZ6DLU2.js} +18 -20
  405. package/dist/cli-bundle/chunks/{test-all-REW67LXT.js.map → test-all-RBZ6DLU2.js.map} +1 -1
  406. package/dist/cli-bundle/chunks/{test-runs-PX73DMMI.js → test-runs-PLRAZEFW.js} +5 -6
  407. package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +7 -0
  408. package/dist/cli-bundle/chunks/{test-runs-FQ5WNQLP.js → test-runs-UXIXPDKU.js} +6 -7
  409. package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +1 -0
  410. package/dist/cli-bundle/chunks/update-AMRSOIWP.js +24 -0
  411. package/dist/cli-bundle/chunks/update-AMRSOIWP.js.map +7 -0
  412. package/dist/cli-bundle/chunks/update-KFX2SIAC.js +28 -0
  413. package/dist/cli-bundle/chunks/update-KFX2SIAC.js.map +1 -0
  414. package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js → update-many-RNSBX2TA.js} +35 -36
  415. package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js.map → update-many-RNSBX2TA.js.map} +1 -1
  416. package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js → update-many-Z5GJS5LC.js} +33 -34
  417. package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js.map → update-many-Z5GJS5LC.js.map} +1 -1
  418. package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js → upgrade-BRL6KCOJ.js} +13 -8
  419. package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js.map → upgrade-BRL6KCOJ.js.map} +1 -1
  420. package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js → upgrade-HAK6JG2O.js} +11 -6
  421. package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js.map → upgrade-HAK6JG2O.js.map} +1 -1
  422. package/dist/cli-bundle/chunks/{validate-HYZNIB6W.js → validate-MTUVL5VC.js} +38 -28
  423. package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +7 -0
  424. package/dist/cli-bundle/chunks/{validate-54SYJ7QW.js → validate-X5W76YJL.js} +39 -29
  425. package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +1 -0
  426. package/dist/cli-bundle/main.js +95 -724
  427. package/dist/cli-bundle/main.js.map +4 -4
  428. package/dist/core/config/positional-value.d.ts +2 -0
  429. package/dist/core/config/positional-value.js +2 -2
  430. package/dist/core/config/positional-value.js.map +1 -1
  431. package/dist/core/extensions/activation-summary-markdown.d.ts +71 -0
  432. package/dist/core/extensions/activation-summary-markdown.js +151 -0
  433. package/dist/core/extensions/activation-summary-markdown.js.map +1 -0
  434. package/dist/core/extensions/activation-summary.d.ts +2 -0
  435. package/dist/core/extensions/activation-summary.js +3 -2
  436. package/dist/core/extensions/activation-summary.js.map +1 -1
  437. package/dist/core/extensions/capability-usage.d.ts +1 -1
  438. package/dist/core/extensions/capability-usage.js +4 -3
  439. package/dist/core/extensions/capability-usage.js.map +1 -1
  440. package/dist/core/extensions/extension-policy.d.ts +18 -3
  441. package/dist/core/extensions/extension-policy.js +116 -106
  442. package/dist/core/extensions/extension-policy.js.map +1 -1
  443. package/dist/core/extensions/extension-registries.js +3 -2
  444. package/dist/core/extensions/extension-registries.js.map +1 -1
  445. package/dist/core/extensions/extension-types.d.ts +21 -1
  446. package/dist/core/extensions/extension-types.js +3 -2
  447. package/dist/core/extensions/extension-types.js.map +1 -1
  448. package/dist/core/extensions/loader.js +439 -232
  449. package/dist/core/extensions/loader.js.map +1 -1
  450. package/dist/core/fs/fs-utils.js +27 -2
  451. package/dist/core/fs/fs-utils.js.map +1 -1
  452. package/dist/core/item/actionability.d.ts +57 -0
  453. package/dist/core/item/actionability.js +178 -0
  454. package/dist/core/item/actionability.js.map +1 -0
  455. package/dist/core/item/item-format.js +523 -410
  456. package/dist/core/item/item-format.js.map +1 -1
  457. package/dist/core/item/type-registry.js +18 -45
  458. package/dist/core/item/type-registry.js.map +1 -1
  459. package/dist/core/profile/profile-describe.d.ts +64 -0
  460. package/dist/core/profile/profile-describe.js +83 -0
  461. package/dist/core/profile/profile-describe.js.map +1 -0
  462. package/dist/core/profile/profile-lint.d.ts +53 -0
  463. package/dist/core/profile/profile-lint.js +422 -0
  464. package/dist/core/profile/profile-lint.js.map +1 -0
  465. package/dist/core/profile/profile-plan.d.ts +145 -0
  466. package/dist/core/profile/profile-plan.js +0 -0
  467. package/dist/core/profile/profile-plan.js.map +1 -0
  468. package/dist/core/profile/profile-presets.d.ts +218 -0
  469. package/dist/core/profile/profile-presets.js +325 -0
  470. package/dist/core/profile/profile-presets.js.map +1 -0
  471. package/dist/core/schema/fields-file.js +25 -25
  472. package/dist/core/schema/fields-file.js.map +1 -1
  473. package/dist/core/schema/item-types-file.js +3 -3
  474. package/dist/core/schema/item-types-file.js.map +1 -1
  475. package/dist/core/schema/runtime-schema.js +4 -4
  476. package/dist/core/schema/runtime-schema.js.map +1 -1
  477. package/dist/core/schema/status-defs-file.js +3 -3
  478. package/dist/core/schema/status-defs-file.js.map +1 -1
  479. package/dist/core/shared/serialization.js +83 -62
  480. package/dist/core/shared/serialization.js.map +1 -1
  481. package/dist/core/store/item-store.d.ts +1 -0
  482. package/dist/core/store/item-store.js +16 -8
  483. package/dist/core/store/item-store.js.map +1 -1
  484. package/dist/core/store/paths.js +4 -32
  485. package/dist/core/store/paths.js.map +1 -1
  486. package/dist/core/store/settings.js +14 -14
  487. package/dist/core/store/settings.js.map +1 -1
  488. package/dist/core/telemetry/observability.js +50 -54
  489. package/dist/core/telemetry/observability.js.map +1 -1
  490. package/dist/core/telemetry/runtime.js +11 -2
  491. package/dist/core/telemetry/runtime.js.map +1 -1
  492. package/dist/core/test/background-runs.js +3 -2
  493. package/dist/core/test/background-runs.js.map +1 -1
  494. package/dist/core/validate/linked-artifact-reference.d.ts +24 -0
  495. package/dist/core/validate/linked-artifact-reference.js +41 -0
  496. package/dist/core/validate/linked-artifact-reference.js.map +1 -0
  497. package/dist/mcp/server.js +540 -420
  498. package/dist/mcp/server.js.map +1 -1
  499. package/dist/mcp/tool-definitions.js +33 -2
  500. package/dist/mcp/tool-definitions.js.map +1 -1
  501. package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
  502. package/dist/sdk/cli-contracts/commander-types.js +15 -2
  503. package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
  504. package/dist/sdk/cli-contracts/enum-contracts.d.ts +3 -3
  505. package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
  506. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  507. package/dist/sdk/cli-contracts/flag-contracts.d.ts +149 -0
  508. package/dist/sdk/cli-contracts/flag-contracts.js +1514 -0
  509. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -0
  510. package/dist/sdk/cli-contracts/string-lists.d.ts +14 -0
  511. package/dist/sdk/cli-contracts/string-lists.js +20 -0
  512. package/dist/sdk/cli-contracts/string-lists.js.map +1 -0
  513. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -1
  514. package/dist/sdk/cli-contracts/tool-option-contracts.js +51 -109
  515. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  516. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +17 -0
  517. package/dist/sdk/cli-contracts/tool-parameter-tables.js +54 -5
  518. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  519. package/dist/sdk/cli-contracts/tool-schema.d.ts +74 -0
  520. package/dist/sdk/cli-contracts/tool-schema.js +871 -0
  521. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -0
  522. package/dist/sdk/cli-contracts.d.ts +13 -193
  523. package/dist/sdk/cli-contracts.js +5 -2277
  524. package/dist/sdk/cli-contracts.js.map +1 -1
  525. package/dist/sdk/compose.d.ts +11 -5
  526. package/dist/sdk/compose.js +240 -124
  527. package/dist/sdk/compose.js.map +1 -1
  528. package/dist/sdk/define.d.ts +14 -0
  529. package/dist/sdk/define.js +17 -2
  530. package/dist/sdk/define.js.map +1 -1
  531. package/dist/sdk/index.d.ts +14 -3
  532. package/dist/sdk/index.js +14 -3
  533. package/dist/sdk/index.js.map +1 -1
  534. package/dist/sdk/testing.d.ts +82 -2
  535. package/dist/sdk/testing.js +74 -3
  536. package/dist/sdk/testing.js.map +1 -1
  537. package/docs/AGENT_GUIDE.md +2 -0
  538. package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
  539. package/docs/COMMANDS.md +37 -0
  540. package/docs/EXTENSIONS.md +12 -13
  541. package/docs/RELEASING.md +8 -4
  542. package/docs/SDK.md +184 -17
  543. package/docs/TESTING.md +12 -0
  544. package/docs/examples/policy-restricted-extension/README.md +6 -0
  545. package/docs/examples/policy-restricted-extension/index.ts +40 -0
  546. package/docs/examples/policy-restricted-extension/manifest.json +2 -2
  547. package/docs/examples/starter-extension/README.md +14 -2
  548. package/docs/examples/starter-extension/{index.js → index.ts} +51 -6
  549. package/docs/examples/starter-extension/manifest.json +2 -2
  550. package/package.json +20 -7
  551. package/packages/pm-beads/extensions/beads/index.ts +3 -3
  552. package/packages/pm-beads/extensions/beads/manifest.json +2 -2
  553. package/packages/pm-beads/extensions/beads/runtime-loader.ts +19 -7
  554. package/packages/pm-beads/extensions/beads/runtime.ts +155 -37
  555. package/packages/pm-calendar/extensions/calendar/index.ts +3 -3
  556. package/packages/pm-calendar/extensions/calendar/manifest.json +2 -2
  557. package/packages/pm-calendar/extensions/calendar/runtime.ts +2 -2
  558. package/packages/pm-command-kit/extensions/command-kit/index.ts +1 -1
  559. package/packages/pm-command-kit/extensions/command-kit/manifest.json +2 -2
  560. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +2 -2
  561. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +2 -2
  562. package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +1 -1
  563. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +2 -2
  564. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +2 -2
  565. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +1 -1
  566. package/packages/pm-kanban/README.md +97 -0
  567. package/packages/pm-kanban/extensions/kanban/index.ts +191 -0
  568. package/packages/pm-kanban/extensions/kanban/manifest.json +19 -0
  569. package/packages/pm-kanban/package.json +57 -0
  570. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +1 -1
  571. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +2 -2
  572. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +2 -2
  573. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +2 -2
  574. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +1 -1
  575. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -2
  576. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +2 -2
  577. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +1 -1
  578. package/packages/pm-templates/extensions/templates/index.ts +2 -2
  579. package/packages/pm-templates/extensions/templates/manifest.json +2 -2
  580. package/packages/pm-templates/extensions/templates/runtime.ts +1 -1
  581. package/packages/pm-todos/extensions/todos/index.ts +3 -3
  582. package/packages/pm-todos/extensions/todos/manifest.json +2 -2
  583. package/packages/pm-todos/extensions/todos/runtime-loader.ts +19 -7
  584. package/packages/pm-todos/extensions/todos/runtime.ts +177 -43
  585. package/plugins/pm-claude/scripts/pm-mcp-server.mjs +2 -2
  586. package/plugins/pm-codex/scripts/pm-mcp-server.mjs +2 -2
  587. package/scripts/bundle-cli.mjs +1 -1
  588. package/dist/cli-bundle/chunks/activity-54TXGJ2T.js +0 -18
  589. package/dist/cli-bundle/chunks/aggregate-63NWNIBR.js.map +0 -1
  590. package/dist/cli-bundle/chunks/aggregate-YHCYX2EV.js.map +0 -7
  591. package/dist/cli-bundle/chunks/chunk-6EL7SW5C.js.map +0 -7
  592. package/dist/cli-bundle/chunks/chunk-6W3Y65PL.js.map +0 -7
  593. package/dist/cli-bundle/chunks/chunk-AEACLRVH.js.map +0 -7
  594. package/dist/cli-bundle/chunks/chunk-B74BP6IS.js +0 -78
  595. package/dist/cli-bundle/chunks/chunk-B74BP6IS.js.map +0 -7
  596. package/dist/cli-bundle/chunks/chunk-BFFO3AIB.js.map +0 -1
  597. package/dist/cli-bundle/chunks/chunk-C4C3EJCJ.js.map +0 -7
  598. package/dist/cli-bundle/chunks/chunk-EYPINTFR.js.map +0 -7
  599. package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js +0 -75
  600. package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js.map +0 -1
  601. package/dist/cli-bundle/chunks/chunk-GQYJEEFX.js.map +0 -1
  602. package/dist/cli-bundle/chunks/chunk-HBAEFWX3.js.map +0 -7
  603. package/dist/cli-bundle/chunks/chunk-HC2S36NB.js.map +0 -1
  604. package/dist/cli-bundle/chunks/chunk-IAP5KYBQ.js.map +0 -1
  605. package/dist/cli-bundle/chunks/chunk-INPHFO33.js +0 -764
  606. package/dist/cli-bundle/chunks/chunk-INPHFO33.js.map +0 -7
  607. package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js +0 -86
  608. package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js.map +0 -7
  609. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
  610. package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
  611. package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js +0 -115
  612. package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js.map +0 -1
  613. package/dist/cli-bundle/chunks/chunk-J7I4C5ZB.js.map +0 -7
  614. package/dist/cli-bundle/chunks/chunk-JKL6HRMV.js.map +0 -7
  615. package/dist/cli-bundle/chunks/chunk-KJZOSF7J.js.map +0 -1
  616. package/dist/cli-bundle/chunks/chunk-L7UXKP2I.js.map +0 -1
  617. package/dist/cli-bundle/chunks/chunk-LNEDHJNQ.js.map +0 -1
  618. package/dist/cli-bundle/chunks/chunk-M6TUBOGW.js.map +0 -1
  619. package/dist/cli-bundle/chunks/chunk-MEXZ5XUM.js.map +0 -7
  620. package/dist/cli-bundle/chunks/chunk-N5B6WZC5.js.map +0 -1
  621. package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js +0 -761
  622. package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js.map +0 -1
  623. package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js +0 -83
  624. package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js.map +0 -1
  625. package/dist/cli-bundle/chunks/chunk-OF7V47P3.js.map +0 -1
  626. package/dist/cli-bundle/chunks/chunk-OHDQNKJB.js.map +0 -7
  627. package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js +0 -118
  628. package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js.map +0 -7
  629. package/dist/cli-bundle/chunks/chunk-PRVTGX64.js.map +0 -7
  630. package/dist/cli-bundle/chunks/chunk-RAWA3Y7O.js.map +0 -1
  631. package/dist/cli-bundle/chunks/chunk-SMXSDY7J.js.map +0 -7
  632. package/dist/cli-bundle/chunks/chunk-SUREE24M.js.map +0 -1
  633. package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js +0 -654
  634. package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js.map +0 -1
  635. package/dist/cli-bundle/chunks/chunk-VSAABFGQ.js.map +0 -1
  636. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
  637. package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
  638. package/dist/cli-bundle/chunks/chunk-XVYKWZNL.js.map +0 -7
  639. package/dist/cli-bundle/chunks/chunk-XXKV4UWE.js.map +0 -7
  640. package/dist/cli-bundle/chunks/chunk-ZLWRPBOW.js.map +0 -1
  641. package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js +0 -657
  642. package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js.map +0 -7
  643. package/dist/cli-bundle/chunks/close-JEBZXONN.js +0 -15
  644. package/dist/cli-bundle/chunks/config-NCNNWF6R.js.map +0 -7
  645. package/dist/cli-bundle/chunks/config-SW3U7XP2.js.map +0 -1
  646. package/dist/cli-bundle/chunks/context-55VEOYI3.js.map +0 -1
  647. package/dist/cli-bundle/chunks/context-5LB7UGKE.js.map +0 -7
  648. package/dist/cli-bundle/chunks/contracts-JXFGBOYT.js.map +0 -1
  649. package/dist/cli-bundle/chunks/contracts-SY6PDFIK.js.map +0 -7
  650. package/dist/cli-bundle/chunks/create-CLSCHGJJ.js +0 -30
  651. package/dist/cli-bundle/chunks/history-ALTM2RRP.js +0 -20
  652. package/dist/cli-bundle/chunks/history-redact-5YGLWUDH.js +0 -21
  653. package/dist/cli-bundle/chunks/init-C4CRHW22.js +0 -21
  654. package/dist/cli-bundle/chunks/register-list-query-CCMHGZTF.js.map +0 -7
  655. package/dist/cli-bundle/chunks/register-list-query-OM3E2KMY.js.map +0 -1
  656. package/dist/cli-bundle/chunks/register-mutation-N3CDEGZU.js.map +0 -1
  657. package/dist/cli-bundle/chunks/register-mutation-UXTTWL6N.js.map +0 -7
  658. package/dist/cli-bundle/chunks/register-setup-G5LTSFYK.js.map +0 -1
  659. package/dist/cli-bundle/chunks/register-setup-TWHKICM2.js.map +0 -7
  660. package/dist/cli-bundle/chunks/restore-LQHXBAY5.js +0 -19
  661. package/dist/cli-bundle/chunks/schema-C6QA367T.js.map +0 -7
  662. package/dist/cli-bundle/chunks/schema-QO5I4FBL.js.map +0 -1
  663. package/dist/cli-bundle/chunks/stats-TCW2SZQG.js.map +0 -7
  664. package/dist/cli-bundle/chunks/stats-TKC6CAKB.js.map +0 -1
  665. package/dist/cli-bundle/chunks/test-WA6RZGM2.js +0 -36
  666. package/dist/cli-bundle/chunks/test-runs-FQ5WNQLP.js.map +0 -1
  667. package/dist/cli-bundle/chunks/test-runs-PX73DMMI.js.map +0 -7
  668. package/dist/cli-bundle/chunks/update-BSKMQOYH.js +0 -28
  669. package/dist/cli-bundle/chunks/update-FIGYNQ2I.js +0 -24
  670. package/dist/cli-bundle/chunks/validate-54SYJ7QW.js.map +0 -1
  671. package/dist/cli-bundle/chunks/validate-HYZNIB6W.js.map +0 -7
  672. package/docs/examples/policy-restricted-extension/index.js +0 -21
  673. package/packages/pm-beads/extensions/beads/index.js +0 -64
  674. package/packages/pm-beads/extensions/beads/runtime-loader.js +0 -86
  675. package/packages/pm-beads/extensions/beads/runtime.js +0 -482
  676. package/packages/pm-calendar/extensions/calendar/index.js +0 -150
  677. package/packages/pm-calendar/extensions/calendar/runtime.js +0 -126
  678. package/packages/pm-command-kit/extensions/command-kit/index.js +0 -181
  679. package/packages/pm-governance-audit/extensions/governance-audit/index.js +0 -177
  680. package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +0 -153
  681. package/packages/pm-guide-shell/extensions/guide-shell/index.js +0 -98
  682. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +0 -294
  683. package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +0 -18
  684. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +0 -124
  685. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +0 -110
  686. package/packages/pm-search-advanced/extensions/search-advanced/index.js +0 -258
  687. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +0 -361
  688. package/packages/pm-templates/extensions/templates/index.js +0 -132
  689. package/packages/pm-templates/extensions/templates/runtime.js +0 -35
  690. package/packages/pm-todos/extensions/todos/index.js +0 -81
  691. package/packages/pm-todos/extensions/todos/runtime-loader.js +0 -86
  692. package/packages/pm-todos/extensions/todos/runtime.js +0 -545
  693. /package/dist/cli-bundle/chunks/{activity-54TXGJ2T.js.map → activity-AW6XVFH6.js.map} +0 -0
  694. /package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js.map → activity-DBLQVIP6.js.map} +0 -0
  695. /package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js.map → chunk-27BXPBAY.js.map} +0 -0
  696. /package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js.map → chunk-3VGN2UWE.js.map} +0 -0
  697. /package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js.map → chunk-AXIDKKAT.js.map} +0 -0
  698. /package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js.map → chunk-BDTISOSD.js.map} +0 -0
  699. /package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js.map → chunk-DDPTYJIM.js.map} +0 -0
  700. /package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js.map → chunk-EJUDVUYZ.js.map} +0 -0
  701. /package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js.map → chunk-EVMTBV6V.js.map} +0 -0
  702. /package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js.map → chunk-G7I7DEZA.js.map} +0 -0
  703. /package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js.map → chunk-HYTGA6GI.js.map} +0 -0
  704. /package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js.map → chunk-HZZEHPRG.js.map} +0 -0
  705. /package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js.map → chunk-IJYK2T43.js.map} +0 -0
  706. /package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js.map → chunk-JPECA746.js.map} +0 -0
  707. /package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js.map → chunk-KNPEF7QG.js.map} +0 -0
  708. /package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js.map → chunk-L5OEFZQG.js.map} +0 -0
  709. /package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js.map → chunk-N74UMG5H.js.map} +0 -0
  710. /package/dist/cli-bundle/chunks/{chunk-IXAZI443.js.map → chunk-NFDPYAIP.js.map} +0 -0
  711. /package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js.map → chunk-NKZAN7BD.js.map} +0 -0
  712. /package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js.map → chunk-NWMZWYYB.js.map} +0 -0
  713. /package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js.map → chunk-OTUHB4HS.js.map} +0 -0
  714. /package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js.map → chunk-SLMUGTK3.js.map} +0 -0
  715. /package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js.map → chunk-WYDHYJPO.js.map} +0 -0
  716. /package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js.map → chunk-ZRP4VG5U.js.map} +0 -0
  717. /package/dist/cli-bundle/chunks/{close-JEBZXONN.js.map → close-E6ZZGCJY.js.map} +0 -0
  718. /package/dist/cli-bundle/chunks/{close-QHMVWM7M.js.map → close-TQYAAFJP.js.map} +0 -0
  719. /package/dist/cli-bundle/chunks/{create-O4VONGPG.js.map → context-B6275WPX.js.map} +0 -0
  720. /package/dist/cli-bundle/chunks/{create-CLSCHGJJ.js.map → context-OCZ3FJ4Z.js.map} +0 -0
  721. /package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js.map → create-OH3BDGBB.js.map} +0 -0
  722. /package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js.map → create-RLRJMRTM.js.map} +0 -0
  723. /package/dist/cli-bundle/chunks/{history-ALTM2RRP.js.map → extension-CPSLJQVE.js.map} +0 -0
  724. /package/dist/cli-bundle/chunks/{history-RUKPKNY7.js.map → extension-CXJ6RELI.js.map} +0 -0
  725. /package/dist/cli-bundle/chunks/{gc-BEJMQT64.js.map → gc-7GQYOS2G.js.map} +0 -0
  726. /package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js.map → gc-LPVMKJQJ.js.map} +0 -0
  727. /package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js.map → health-3IPFLKXB.js.map} +0 -0
  728. /package/dist/cli-bundle/chunks/{health-P67NZ6TT.js.map → health-GZXGBZ36.js.map} +0 -0
  729. /package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js.map → history-NERDJNUB.js.map} +0 -0
  730. /package/dist/cli-bundle/chunks/{history-redact-5YGLWUDH.js.map → history-WSZHY3PN.js.map} +0 -0
  731. /package/dist/cli-bundle/chunks/{init-C4CRHW22.js.map → history-redact-MP6CH7U5.js.map} +0 -0
  732. /package/dist/cli-bundle/chunks/{init-HBFGYS66.js.map → history-redact-O3NBCNWC.js.map} +0 -0
  733. /package/dist/cli-bundle/chunks/{list-C7R33MD5.js.map → init-64XDLQJB.js.map} +0 -0
  734. /package/dist/cli-bundle/chunks/{list-DSN6UNFB.js.map → init-PAX32BJA.js.map} +0 -0
  735. /package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js.map → list-DNBJVO3E.js.map} +0 -0
  736. /package/dist/cli-bundle/chunks/{restore-LQHXBAY5.js.map → list-G5Y65VF6.js.map} +0 -0
  737. /package/dist/cli-bundle/chunks/{search-2EI6EAXH.js.map → restore-4MHZFJ2E.js.map} +0 -0
  738. /package/dist/cli-bundle/chunks/{search-QBFBLQRO.js.map → restore-YALDGTQR.js.map} +0 -0
  739. /package/dist/cli-bundle/chunks/{test-NV2DRPUS.js.map → schema-73HR2OJW.js.map} +0 -0
  740. /package/dist/cli-bundle/chunks/{test-WA6RZGM2.js.map → schema-U6LJKSIR.js.map} +0 -0
  741. /package/dist/cli-bundle/chunks/{update-BSKMQOYH.js.map → search-AXPXKZER.js.map} +0 -0
  742. /package/dist/cli-bundle/chunks/{update-FIGYNQ2I.js.map → search-KILGT37L.js.map} +0 -0
  743. /package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js.map → telemetry-BZUF6H7G.js.map} +0 -0
  744. /package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js.map → telemetry-GAHHQTOS.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"compose.js","sources":["sdk/compose.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/compose\n *\n * Declarative extension authoring — the capstone of the SDK authoring tripod\n * (`author → register → test`).\n *\n * The {@link ./define.js | `define*`} builders type each registration where it\n * is written, and the `assert*`/`run*` testing helpers verify and invoke it. But\n * the author still has to hand-wire every definition into an imperative\n * `activate(api)` body — calling the right `api.register*` method, in the right\n * order, without forgetting one — and then hand-sync `manifest.capabilities` to\n * match. Those are the two most common package-authoring footguns.\n *\n * {@link composeExtension} closes the loop: an author (or an agent) describes\n * *what* to register as a plain {@link ExtensionBlueprint} object, and the SDK\n * generates the `activate` that wires every surface for them.\n * {@link deriveExtensionCapabilities} computes the exact least-privilege\n * capability set that blueprint exercises, so `manifest.json` can be authored\n * with zero declared-but-unused / used-but-undeclared drift (the author-time\n * inverse of the runtime `reconcileExtensionCapabilityUsage` reconciliation).\n *\n * This module also owns {@link ExtensionModule} and {@link defineExtension} —\n * the in-module export shape every extension entry file produces and its\n * zero-cost identity helper — so both the imperative (`defineExtension`) and\n * declarative (`composeExtension`) authoring styles live together. Both are\n * re-exported from the SDK barrel, so the public API is unchanged.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n ExtensionApi,\n ExtensionCapability,\n ExtensionManifest,\n ExtensionServiceName,\n Exporter,\n FlagDefinition,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n OutputRendererFormat,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ExtensionActivationSummary } from \"../core/extensions/activation-summary.js\";\nimport type { PmMaxVersionExceededMode } from \"../core/extensions/extension-types.js\";\nimport {\n normalizeKnownExtensionCapability,\n resolveLegacyExtensionCapabilityAlias,\n} from \"../core/extensions/extension-capability-aliases.js\";\nimport { normalizeCommandName } from \"../core/extensions/extension-runtime-helpers.js\";\nimport {\n evaluatePmMaxVersionBound,\n evaluatePmMinVersionBound,\n type PmVersionBoundEvaluation,\n type PmVersionBoundKind,\n} from \"../core/extensions/version-compat.js\";\n\n/**\n * Documents the extension module payload exchanged by command, SDK, and package integrations.\n *\n * This is the shape an extension entry file exports (as its default export and,\n * conventionally, as named `manifest`/`activate` exports). Produce it directly,\n * via {@link defineExtension} for the imperative style, or via\n * {@link composeExtension} for the declarative style.\n */\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests. Type it with\n * {@link defineExtensionManifest} for full contract checking at the definition\n * site.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n /**\n * Optional teardown lifecycle hook (VS Code-style `deactivate`). Invoked by\n * the host on shutdown/reload to release resources opened during `activate`.\n */\n deactivate?(): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n *\n * Reach for {@link composeExtension} instead when you would rather declare the\n * registrations as data than wire them imperatively in `activate`.\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\n/**\n * A single importer registration entry for an {@link ExtensionBlueprint}, mirroring\n * the positional arguments of `api.registerImporter(name, importer, options?)`.\n */\nexport interface ExtensionBlueprintImporter {\n /** Registered importer name; the `<name> import` command path is derived from it. */\n name: string;\n /** The importer handler that bridges an external system into the pm context graph. */\n importer: Importer;\n /** Optional command metadata (description/flags/intent/examples) for the derived command. */\n options?: ImportExportRegistrationOptions;\n}\n\n/**\n * A single exporter registration entry for an {@link ExtensionBlueprint}, mirroring\n * the positional arguments of `api.registerExporter(name, exporter, options?)`.\n */\nexport interface ExtensionBlueprintExporter {\n /** Registered exporter name; the `<name> export` command path is derived from it. */\n name: string;\n /** The exporter handler that bridges the pm context graph out to an external system. */\n exporter: Exporter;\n /** Optional command metadata (description/flags/intent/examples) for the derived command. */\n options?: ImportExportRegistrationOptions;\n}\n\n/**\n * The lifecycle hooks an {@link ExtensionBlueprint} can register, one array per\n * kind. Each entry is registered through the matching `api.hooks.*` method in\n * the canonical order `before_command → after_command → on_write → on_read →\n * on_index`.\n */\nexport interface ExtensionBlueprintHooks {\n /** Hooks fired before a command runs (`api.hooks.beforeCommand`). */\n beforeCommand?: BeforeCommandHook[];\n /** Hooks fired after a command runs (`api.hooks.afterCommand`). */\n afterCommand?: AfterCommandHook[];\n /** Hooks fired when an item is persisted (`api.hooks.onWrite`). */\n onWrite?: OnWriteHook[];\n /** Hooks fired when an item is read (`api.hooks.onRead`). */\n onRead?: OnReadHook[];\n /** Hooks fired during index/search refresh (`api.hooks.onIndex`). */\n onIndex?: OnIndexHook[];\n}\n\n/**\n * A declarative description of everything an extension registers at activation.\n *\n * Every field is optional: populate the surfaces your extension uses (ideally\n * with {@link ./define.js | `define*`}-authored definitions) and leave the rest\n * out. {@link composeExtension} turns the blueprint into an\n * {@link ExtensionModule} whose generated `activate` calls the matching\n * `api.register*` method for each surface, and {@link deriveExtensionCapabilities}\n * computes the capability set the blueprint requires.\n *\n * Record-keyed fields map a routing key (command name, output format, or service\n * name) to its handler, mirroring the two-argument `api.register*` overloads.\n */\nexport interface ExtensionBlueprint {\n /** Optional in-module manifest mirror, copied onto the produced module verbatim. */\n manifest?: ExtensionManifest;\n /** Full command definitions registered via `api.registerCommand(definition)`. */\n commands?: CommandDefinition[];\n /** Command overrides keyed by command name, registered via `api.registerCommand(command, override)`. */\n commandOverrides?: Record<string, CommandOverride>;\n /** Additional flags keyed by target command name, registered via `api.registerFlags(command, flags)`. */\n flags?: Record<string, FlagDefinition[]>;\n /** Parser overrides keyed by command name, registered via `api.registerParser(command, override)`. */\n parsers?: Record<string, ParserOverride>;\n /** Output renderer overrides keyed by format, registered via `api.registerRenderer(format, renderer)`. */\n renderers?: Partial<Record<OutputRendererFormat, RendererOverride>>;\n /** Service overrides keyed by service name, registered via `api.registerService(service, override)`. */\n services?: Partial<Record<ExtensionServiceName, ServiceOverride>>;\n /** Preflight overrides registered via `api.registerPreflight(override)`. */\n preflights?: PreflightOverride[];\n /** Custom item types registered in a single `api.registerItemTypes(types)` call. */\n itemTypes?: SchemaItemTypeDefinition[];\n /** Custom front-matter fields registered in a single `api.registerItemFields(fields)` call. */\n itemFields?: SchemaFieldDefinition[];\n /** Schema migrations registered one at a time via `api.registerMigration(definition)`. */\n migrations?: SchemaMigrationDefinition[];\n /** Search providers registered via `api.registerSearchProvider(provider)`. */\n searchProviders?: SearchProviderDefinition[];\n /** Vector store adapters registered via `api.registerVectorStoreAdapter(adapter)`. */\n vectorStoreAdapters?: VectorStoreAdapterDefinition[];\n /** Importers registered via `api.registerImporter(name, importer, options?)`. */\n importers?: ExtensionBlueprintImporter[];\n /** Exporters registered via `api.registerExporter(name, exporter, options?)`. */\n exporters?: ExtensionBlueprintExporter[];\n /** Lifecycle hooks registered through `api.hooks.*`. */\n hooks?: ExtensionBlueprintHooks;\n /**\n * Optional imperative escape hatch run *after* every declarative registration,\n * for the rare wiring the blueprint cannot express. Receives the same `api`.\n */\n activate?: (api: ExtensionApi) => void | Promise<void>;\n /** Optional teardown hook copied onto the produced module verbatim. */\n deactivate?: () => void | Promise<void>;\n}\n\n/**\n * Typed identity helper for a (partial) {@link ExtensionBlueprint} authored as its\n * own module — the typed entry point of the modular declarative-authoring loop.\n *\n * It is the natural companion to {@link mergeExtensionBlueprints}: when an\n * extension's surface is split across files — a commands module, a search module,\n * a hooks module — wrap each fragment so it is contract-checked *at its definition\n * site* (with editor completion), exactly as {@link defineExtension} types a whole\n * module and {@link defineExtensionManifest} types a manifest. It returns its\n * argument unchanged, preserving the literal type\n * so the fragment composes into {@link mergeExtensionBlueprints},\n * {@link composeExtension}, or {@link composeExtensionPackage} with no loss of\n * inference.\n *\n * Use as:\n * `export const commandsModule = defineExtensionBlueprint({ commands: [...] })`\n */\nexport function defineExtensionBlueprint<TBlueprint extends ExtensionBlueprint>(blueprint: TBlueprint): TBlueprint {\n return blueprint;\n}\n\n/**\n * Assemble an {@link ExtensionModule} from a declarative {@link ExtensionBlueprint}.\n *\n * The returned module's `activate` registers every populated surface through the\n * matching `api.register*` method in a deterministic order (commands → overrides\n * → flags → parsers → renderers → services → preflights → item types → item\n * fields → migrations → search providers → vector store adapters → importers →\n * exporters → hooks), then awaits the blueprint's optional imperative `activate`\n * so it can layer on anything the declarative form cannot express. `manifest`\n * and `deactivate` are copied onto the module verbatim.\n *\n * This is a pure assembler: it does not validate the definitions. Per-surface\n * contract enforcement stays in `api.register*` (and the loader), exactly as it\n * does for hand-written `activate` bodies, so a malformed definition surfaces\n * the same activation diagnostic either way.\n */\nexport function composeExtension(blueprint: ExtensionBlueprint): ExtensionModule {\n const activate = async (api: ExtensionApi): Promise<void> => {\n for (const command of blueprint.commands ?? []) {\n api.registerCommand(command);\n }\n for (const [command, override] of Object.entries(blueprint.commandOverrides ?? {})) {\n api.registerCommand(command, override);\n }\n for (const [targetCommand, flags] of Object.entries(blueprint.flags ?? {})) {\n api.registerFlags(targetCommand, flags);\n }\n for (const [command, override] of Object.entries(blueprint.parsers ?? {})) {\n api.registerParser(command, override);\n }\n for (const [format, renderer] of Object.entries(blueprint.renderers ?? {}) as Array<\n [OutputRendererFormat, RendererOverride]\n >) {\n api.registerRenderer(format, renderer);\n }\n for (const [service, override] of Object.entries(blueprint.services ?? {}) as Array<\n [ExtensionServiceName, ServiceOverride]\n >) {\n api.registerService(service, override);\n }\n for (const override of blueprint.preflights ?? []) {\n api.registerPreflight(override);\n }\n const itemTypes = blueprint.itemTypes ?? [];\n if (itemTypes.length > 0) {\n api.registerItemTypes(itemTypes);\n }\n const itemFields = blueprint.itemFields ?? [];\n if (itemFields.length > 0) {\n api.registerItemFields(itemFields);\n }\n for (const migration of blueprint.migrations ?? []) {\n api.registerMigration(migration);\n }\n for (const provider of blueprint.searchProviders ?? []) {\n api.registerSearchProvider(provider);\n }\n for (const adapter of blueprint.vectorStoreAdapters ?? []) {\n api.registerVectorStoreAdapter(adapter);\n }\n for (const entry of blueprint.importers ?? []) {\n api.registerImporter(entry.name, entry.importer, entry.options);\n }\n for (const entry of blueprint.exporters ?? []) {\n api.registerExporter(entry.name, entry.exporter, entry.options);\n }\n // `?? {}` (rather than a `!== undefined` guard) so an explicit `hooks: null`\n // crossing an untyped boundary (e.g. a blueprint hydrated from JSON) is\n // treated the same as omitting it, instead of throwing on the first\n // `hooks.beforeCommand` access.\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n for (const hook of hooks.beforeCommand ?? []) {\n api.hooks.beforeCommand(hook);\n }\n for (const hook of hooks.afterCommand ?? []) {\n api.hooks.afterCommand(hook);\n }\n for (const hook of hooks.onWrite ?? []) {\n api.hooks.onWrite(hook);\n }\n for (const hook of hooks.onRead ?? []) {\n api.hooks.onRead(hook);\n }\n for (const hook of hooks.onIndex ?? []) {\n api.hooks.onIndex(hook);\n }\n await blueprint.activate?.(api);\n };\n\n // Truthy checks (rather than `!== undefined`) so an explicit `null` mirror or\n // teardown is treated as absent instead of copied onto the module.\n const module: ExtensionModule = { activate };\n if (blueprint.manifest) {\n module.manifest = blueprint.manifest;\n }\n if (blueprint.deactivate) {\n module.deactivate = blueprint.deactivate;\n }\n return module;\n}\n\n/**\n * Concatenate the populated entries of an array surface across blueprints,\n * preserving argument order. Returns `undefined` when no blueprint contributes\n * any entry, so {@link mergeExtensionBlueprints} omits the field instead of\n * emitting an empty array. `?? []` tolerates an explicit `null` field (e.g. from a\n * blueprint hydrated across an untyped boundary) exactly as {@link composeExtension} does.\n */\nfunction mergeArraySurface<TValue>(\n surfaces: ReadonlyArray<readonly TValue[] | null | undefined>,\n): TValue[] | undefined {\n const merged = surfaces.flatMap((surface) => surface ?? []);\n return merged.length > 0 ? merged : undefined;\n}\n\n/**\n * Shallow-merge single-handler record surfaces (`commandOverrides`, `parsers`,\n * `renderers`, `services`) with last-defined-wins precedence on a key collision,\n * exactly like spreading the records in argument order. Returns `undefined` when\n * no blueprint contributes any key.\n */\nfunction mergeHandlerRecord<TRecord extends object>(\n surfaces: ReadonlyArray<TRecord | null | undefined>,\n): TRecord | undefined {\n const merged = Object.assign({}, ...surfaces.map((surface) => surface ?? {})) as TRecord;\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\n/**\n * Merge `flags` records by concatenating every blueprint's flag array for a shared\n * target command, mirroring the additive `api.registerFlags` semantics so each\n * module's flags reach the command. Returns `undefined` when no blueprint declares\n * any flags.\n */\nfunction mergeFlagRecord(\n surfaces: ReadonlyArray<Record<string, FlagDefinition[]> | null | undefined>,\n): Record<string, FlagDefinition[]> | undefined {\n const merged: Record<string, FlagDefinition[]> = {};\n for (const surface of surfaces) {\n for (const [command, flags] of Object.entries(surface ?? {})) {\n // `flags` is the record's array value, never nullish in-type — `composeExtension`\n // likewise passes it to `registerFlags` unguarded — so it is spread directly.\n merged[command] = [...(merged[command] ?? []), ...flags];\n }\n }\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nconst EXTENSION_BLUEPRINT_HOOK_KEYS = [\n \"beforeCommand\",\n \"afterCommand\",\n \"onWrite\",\n \"onRead\",\n \"onIndex\",\n] as const satisfies ReadonlyArray<keyof ExtensionBlueprintHooks>;\n\ntype ExtensionBlueprintHookKey = (typeof EXTENSION_BLUEPRINT_HOOK_KEYS)[number];\ntype MissingExtensionBlueprintHookKeys = Exclude<keyof ExtensionBlueprintHooks, ExtensionBlueprintHookKey>;\ntype ExtraExtensionBlueprintHookKeys = Exclude<ExtensionBlueprintHookKey, keyof ExtensionBlueprintHooks>;\n\n// Compile-time exhaustiveness guard: adding a hook field must update the canonical\n// merge order above, and stale keys cannot remain in that list.\nconst EXTENSION_BLUEPRINT_HOOK_KEY_COVERAGE: Record<\n MissingExtensionBlueprintHookKeys | ExtraExtensionBlueprintHookKeys,\n never\n> = {};\nvoid EXTENSION_BLUEPRINT_HOOK_KEY_COVERAGE;\n\ntype ExtensionBlueprintHookArray<TKey extends keyof ExtensionBlueprintHooks> = NonNullable<ExtensionBlueprintHooks[TKey]>;\ntype ExtensionBlueprintHookValue<TKey extends keyof ExtensionBlueprintHooks> = ExtensionBlueprintHookArray<TKey>[number];\n\nfunction assignMergedHookSurface<TKey extends keyof ExtensionBlueprintHooks>(\n merged: ExtensionBlueprintHooks,\n surfaces: ReadonlyArray<ExtensionBlueprintHooks | null | undefined>,\n key: TKey,\n): void {\n const hookArrays = surfaces.map((hooks) => hooks?.[key]) as ReadonlyArray<\n ExtensionBlueprintHookArray<TKey> | null | undefined\n >;\n const value = mergeArraySurface<ExtensionBlueprintHookValue<TKey>>(hookArrays);\n if (value !== undefined) {\n const typedMerged = merged as { [K in TKey]?: ExtensionBlueprintHookArray<K> };\n typedMerged[key] = value as ExtensionBlueprintHookArray<TKey>;\n }\n}\n\n/**\n * Merge the nested `hooks` surface by concatenating each lifecycle kind's array in\n * canonical order. Returns `undefined` when no blueprint registers any hook.\n */\nfunction mergeHookSurfaces(\n surfaces: ReadonlyArray<ExtensionBlueprintHooks | null | undefined>,\n): ExtensionBlueprintHooks | undefined {\n const merged: ExtensionBlueprintHooks = {};\n for (const key of EXTENSION_BLUEPRINT_HOOK_KEYS) {\n assignMergedHookSurface(merged, surfaces, key);\n }\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\n/**\n * Merge several partial {@link ExtensionBlueprint}s into one, so an extension's\n * surface can be authored *modularly* — a commands module, a search module, a\n * hooks module — and combined into a single blueprint to feed\n * {@link composeExtension}, {@link composeExtensionPackage},\n * {@link synthesizeExtensionManifest}, {@link describeExtensionBlueprint}, or\n * {@link preflightExtension}.\n *\n * The merge is pure and deterministic and never mutates an input. Each surface\n * combines the way its underlying `api.register*` call composes:\n *\n * - **Array surfaces** — `commands`, `preflights`, `itemTypes`, `itemFields`,\n * `migrations`, `searchProviders`, `vectorStoreAdapters`, `importers`,\n * `exporters` — concatenate in argument order.\n * - **`flags`** concatenates the flag arrays of any shared target command,\n * mirroring additive `api.registerFlags`: every module's flags reach the command.\n * - **Single-handler records** — `commandOverrides`, `parsers`, `renderers`,\n * `services` — follow last-defined-wins precedence on a key collision, exactly\n * like spreading the records in argument order; a later module deliberately\n * overrides an earlier one's handler for that key.\n * - **`hooks`** concatenates each lifecycle kind's array in canonical order.\n * - The imperative **`activate`** escape hatches chain in argument order (each\n * awaited), so every module's escape-hatch wiring still runs.\n * - The **`deactivate`** teardown hooks chain in *reverse* argument order (LIFO),\n * releasing resources in the inverse of acquisition. Teardown is best-effort:\n * a throwing hook does not strand later modules' cleanup — every hook runs and\n * teardown failures are re-thrown afterwards (as the original error for one\n * failure, or an `AggregateError` for several).\n * - The **`manifest`** mirror is last-defined-wins.\n *\n * Because `composeExtension` and the derive/lint/describe helpers are pure readers\n * of this data, a merged blueprint behaves exactly as a hand-written one: a command\n * two modules both define survives as a duplicate in the merged `commands` array\n * and {@link lintExtensionBlueprint} flags it, just as it would in one file. An\n * empty field is omitted rather than emitted empty, so merging zero blueprints\n * returns an empty blueprint (`{}`).\n */\nexport function mergeExtensionBlueprints(...blueprints: ExtensionBlueprint[]): ExtensionBlueprint {\n const merged: ExtensionBlueprint = {};\n const assign = <TKey extends keyof ExtensionBlueprint>(key: TKey, value: ExtensionBlueprint[TKey]): void => {\n if (value !== undefined) {\n merged[key] = value;\n }\n };\n assign(\"commands\", mergeArraySurface(blueprints.map((blueprint) => blueprint.commands)));\n assign(\"commandOverrides\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.commandOverrides)));\n assign(\"flags\", mergeFlagRecord(blueprints.map((blueprint) => blueprint.flags)));\n assign(\"parsers\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.parsers)));\n assign(\"renderers\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.renderers)));\n assign(\"services\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.services)));\n assign(\"preflights\", mergeArraySurface(blueprints.map((blueprint) => blueprint.preflights)));\n assign(\"itemTypes\", mergeArraySurface(blueprints.map((blueprint) => blueprint.itemTypes)));\n assign(\"itemFields\", mergeArraySurface(blueprints.map((blueprint) => blueprint.itemFields)));\n assign(\"migrations\", mergeArraySurface(blueprints.map((blueprint) => blueprint.migrations)));\n assign(\"searchProviders\", mergeArraySurface(blueprints.map((blueprint) => blueprint.searchProviders)));\n assign(\"vectorStoreAdapters\", mergeArraySurface(blueprints.map((blueprint) => blueprint.vectorStoreAdapters)));\n assign(\"importers\", mergeArraySurface(blueprints.map((blueprint) => blueprint.importers)));\n assign(\"exporters\", mergeArraySurface(blueprints.map((blueprint) => blueprint.exporters)));\n assign(\"hooks\", mergeHookSurfaces(blueprints.map((blueprint) => blueprint.hooks)));\n // Last-defined-wins for the in-module manifest mirror: a later module's identity\n // supersedes an earlier one's, matching the single-handler record precedence.\n let manifest: ExtensionManifest | undefined;\n for (const blueprint of blueprints) {\n if (blueprint.manifest) {\n manifest = blueprint.manifest;\n }\n }\n assign(\"manifest\", manifest);\n // Imperative escape hatches chain forward (acquisition order); teardown chains\n // in reverse (LIFO), so resources release in the inverse of acquisition.\n const hasActivates = blueprints.some((blueprint) => blueprint.activate);\n assign(\n \"activate\",\n hasActivates\n ? async (api: ExtensionApi): Promise<void> => {\n for (const blueprint of blueprints) {\n if (blueprint.activate) {\n await blueprint.activate(api);\n }\n }\n }\n : undefined,\n );\n const hasDeactivates = blueprints.some((blueprint) => blueprint.deactivate);\n assign(\n \"deactivate\",\n hasDeactivates\n ? async (): Promise<void> => {\n // Teardown is best-effort across modules: a throwing `deactivate` must\n // not strand a later module's cleanup, so every hook runs (in reverse,\n // LIFO) and failures are surfaced after cleanup completes.\n const errors: unknown[] = [];\n for (const blueprint of [...blueprints].reverse()) {\n if (!blueprint.deactivate) {\n continue;\n }\n try {\n await blueprint.deactivate();\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n if (errors.length > 1) {\n throw new AggregateError(errors, \"Multiple extension blueprint deactivate hooks failed.\");\n }\n throw errors[0];\n }\n }\n : undefined,\n );\n return merged;\n}\n\n/**\n * Blueprint registration fields whose presence implies a capability, paired with\n * the capability each grants. Mirrors `EXTENSION_CAPABILITY_REGISTRATION_SURFACES`\n * so a blueprint's derived capabilities exactly match what the loader enforces\n * when {@link composeExtension}'s generated `activate` calls `api.register*`.\n *\n * `hooks` is handled separately (it is a nested object, not an array/record of\n * registrations) and so is intentionally absent from this table.\n */\nconst BLUEPRINT_FIELD_CAPABILITIES: ReadonlyArray<readonly [BlueprintRegistrationField, ExtensionCapability]> = [\n [\"commands\", \"commands\"],\n [\"commandOverrides\", \"commands\"],\n [\"flags\", \"schema\"],\n [\"itemTypes\", \"schema\"],\n [\"itemFields\", \"schema\"],\n [\"migrations\", \"schema\"],\n [\"parsers\", \"parser\"],\n [\"renderers\", \"renderers\"],\n [\"services\", \"services\"],\n [\"preflights\", \"preflight\"],\n [\"searchProviders\", \"search\"],\n [\"vectorStoreAdapters\", \"search\"],\n [\"importers\", \"importers\"],\n [\"exporters\", \"importers\"],\n];\n\ntype BlueprintRegistrationField =\n | \"commands\"\n | \"commandOverrides\"\n | \"flags\"\n | \"parsers\"\n | \"renderers\"\n | \"services\"\n | \"preflights\"\n | \"itemTypes\"\n | \"itemFields\"\n | \"migrations\"\n | \"searchProviders\"\n | \"vectorStoreAdapters\"\n | \"importers\"\n | \"exporters\";\n\nfunction hasEntries(value: readonly unknown[] | Record<string, unknown> | null | undefined): boolean {\n // `!value` treats both `null` and `undefined` as \"no entries\", so an untyped\n // JavaScript author cannot crash capability derivation with an explicit null\n // field — `Object.keys(null)` would otherwise throw.\n if (!value) {\n return false;\n }\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n return Object.keys(value).length > 0;\n}\n\n/**\n * Compute the minimal least-privilege capability set a {@link ExtensionBlueprint}\n * exercises, sorted and de-duplicated.\n *\n * Use it to author `manifest.json` `capabilities` exactly — declaring nothing the\n * extension does not use and nothing it does. It is the author-time inverse of\n * the runtime `reconcileExtensionCapabilityUsage` reconciliation: derive the set\n * here before activation rather than detecting drift after it. A blueprint with\n * no registration surfaces returns an empty array.\n */\nexport function deriveExtensionCapabilities(blueprint: ExtensionBlueprint): ExtensionCapability[] {\n const capabilities = new Set<ExtensionCapability>();\n for (const [field, capability] of BLUEPRINT_FIELD_CAPABILITIES) {\n if (hasEntries(blueprint[field])) {\n capabilities.add(capability);\n }\n }\n // A command definition carrying its own inline `flags` registers them through\n // `registerCommand`, which asserts the `schema` capability independently of the\n // top-level `flags` record. Mirror that here so the derived set still matches\n // what activation enforces when a command declares flags inline and the\n // blueprint has no separate `flags` field. `!== undefined` (not a truthiness or\n // length check) matches the loader's exact guard, including an empty inline array.\n if ((blueprint.commands ?? []).some((command) => command.flags !== undefined)) {\n capabilities.add(\"schema\");\n }\n // `?? {}` keeps an explicit `hooks: null` from throwing, mirroring composeExtension.\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n if ([hooks.beforeCommand, hooks.afterCommand, hooks.onWrite, hooks.onRead, hooks.onIndex].some(hasEntries)) {\n capabilities.add(\"hooks\");\n }\n return [...capabilities].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Blueprint hook fields paired with the lifecycle kind each registers, ordered to\n * match `ExtensionActivationResult.hook_counts` (and the runtime\n * {@link ../core/extensions/activation-summary.js#describeExtensionActivation}'s\n * `hooks` ordering) so a blueprint summary's `hooks` list reads in the same\n * canonical order, not alphabetically.\n */\nconst BLUEPRINT_HOOK_FIELD_TO_KIND = [\n [\"beforeCommand\", \"before_command\"],\n [\"afterCommand\", \"after_command\"],\n [\"onWrite\", \"on_write\"],\n [\"onRead\", \"on_read\"],\n [\"onIndex\", \"on_index\"],\n] as const satisfies ReadonlyArray<readonly [keyof ExtensionBlueprintHooks, string]>;\n\n/** De-duplicate and locale-sort a list of identifiers, mirroring the runtime summary. */\nfunction sortUnique<TValue extends string>(values: readonly TValue[]): TValue[] {\n return [...new Set(values)].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Compute, without activating, the exact {@link ExtensionActivationSummary} that\n * {@link composeExtension}'s generated `activate` would produce for a blueprint.\n *\n * This is the author-time inverse of the runtime\n * {@link ../core/extensions/activation-summary.js#describeExtensionActivation}:\n * the runtime verb walks an *activated* registry, while this one reads the\n * declarative {@link ExtensionBlueprint} data directly, so an author or agent can\n * preview the full named surface map (commands, overrides, handlers, hooks, item\n * types/fields, importers/exporters, search/vector adapters, parser/service/\n * renderer overrides, flag-target commands, and the preflight count) with no\n * loading, activation, or side effects. It is to the named surfaces what\n * {@link deriveExtensionCapabilities} is to the capability set.\n *\n * Fidelity is by construction: command paths are normalized with the same\n * `normalizeCommandName` the loader applies, and importer/exporter handler paths\n * are synthesized as `normalizeCommandName(\"<name> import|export\")`, exactly as\n * `registerImporter`/`registerExporter` do. A parity test pins this output equal\n * to `describeExtensionActivation` over the same composed-and-activated blueprint.\n *\n * The one surface it cannot reflect is the blueprint's optional imperative\n * `activate` escape hatch — arbitrary code a static reader cannot inspect. A\n * blueprint that registers everything through that hatch summarizes as empty.\n */\nexport function describeExtensionBlueprint(blueprint: ExtensionBlueprint): ExtensionActivationSummary {\n const commandPaths = (blueprint.commands ?? []).map((command) => normalizeCommandName(command.name));\n const importerPaths = (blueprint.importers ?? []).map((entry) => normalizeCommandName(`${entry.name} import`));\n const exporterPaths = (blueprint.exporters ?? []).map((entry) => normalizeCommandName(`${entry.name} export`));\n // A command definition with inline `flags` registers a flag target under its own\n // path in addition to any top-level `flags` record, so union both sources.\n const flagCommands = [\n ...Object.keys(blueprint.flags ?? {}).map((command) => normalizeCommandName(command)),\n ...(blueprint.commands ?? [])\n .filter((command) => command.flags !== undefined)\n .map((command) => normalizeCommandName(command.name)),\n ];\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n\n return {\n capabilities: deriveExtensionCapabilities(blueprint),\n commands: sortUnique(commandPaths),\n command_overrides: sortUnique(Object.keys(blueprint.commandOverrides ?? {}).map((command) => normalizeCommandName(command))),\n // command_handlers is a superset of commands that also carries the synthesized\n // importer/exporter command paths, but never the override-only paths.\n command_handlers: sortUnique([...commandPaths, ...importerPaths, ...exporterPaths]),\n hooks: BLUEPRINT_HOOK_FIELD_TO_KIND.filter(([field]) => (hooks[field]?.length ?? 0) > 0).map(([, kind]) => kind),\n flag_commands: sortUnique(flagCommands),\n item_types: sortUnique((blueprint.itemTypes ?? []).map((type) => type.name)),\n item_fields: sortUnique((blueprint.itemFields ?? []).map((field) => field.name)),\n // id-less migrations register but carry no identifier, so they are omitted —\n // exactly as describeExtensionActivation drops them from its `migrations` list.\n migrations: sortUnique(\n (blueprint.migrations ?? []).flatMap((migration) => (typeof migration.id === \"string\" ? [migration.id] : [])),\n ),\n importers: sortUnique((blueprint.importers ?? []).map((entry) => normalizeCommandName(entry.name))),\n exporters: sortUnique((blueprint.exporters ?? []).map((entry) => normalizeCommandName(entry.name))),\n search_providers: sortUnique((blueprint.searchProviders ?? []).map((provider) => provider.name)),\n vector_store_adapters: sortUnique((blueprint.vectorStoreAdapters ?? []).map((adapter) => adapter.name)),\n parser_overrides: sortUnique(Object.keys(blueprint.parsers ?? {}).map((command) => normalizeCommandName(command))),\n service_overrides: sortUnique(\n Object.keys(blueprint.services ?? {}).map((service) => String(service).trim().toLowerCase() as ExtensionServiceName),\n ),\n renderer_overrides: sortUnique(\n Object.keys(blueprint.renderers ?? {}).map((format) => String(format).trim().toLowerCase() as OutputRendererFormat),\n ),\n preflight_overrides: (blueprint.preflights ?? []).length,\n };\n}\n\n/**\n * The blueprint registration fields a lint flags as a dead \"empty surface\" when\n * present but empty. Mirrors {@link BlueprintRegistrationField} so adding a new\n * registration surface forces a decision here too; `hooks` is handled separately\n * because it is a nested object rather than an array/record of registrations.\n */\nconst BLUEPRINT_LINTABLE_SURFACE_FIELDS = [\n \"commands\",\n \"commandOverrides\",\n \"flags\",\n \"parsers\",\n \"renderers\",\n \"services\",\n \"preflights\",\n \"itemTypes\",\n \"itemFields\",\n \"migrations\",\n \"searchProviders\",\n \"vectorStoreAdapters\",\n \"importers\",\n \"exporters\",\n] as const satisfies ReadonlyArray<BlueprintRegistrationField>;\n\n/** Severity of an {@link ExtensionBlueprintLintFinding}: a hard `error` (activation will fail) or an advisory `warning`. */\nexport type ExtensionBlueprintLintSeverity = \"error\" | \"warning\";\n\n/**\n * Machine-readable kind of an {@link ExtensionBlueprintLintFinding}.\n *\n * - `capability_undeclared` (error): a surface exercises a capability the declared\n * set omits; the loader throws `extension_capability_missing` at activation.\n * - `capability_unused` (warning): a declared capability no surface exercises; the\n * runtime equivalent is the `pm package doctor` `extension_capability_unused` note.\n * - `duplicate_command` (warning): the same normalized command path is declared\n * more than once in `commands`; the later registration shadows the earlier.\n * - `command_override_conflict` (warning): a path is declared as both a fresh\n * command definition and a command override.\n * - `empty_surface` (warning): a registration field is present but contributes\n * nothing — a dead declaration.\n * - `manifest_capabilities_absent` (warning): the blueprint exercises capabilities\n * but offers no declared set to reconcile against.\n */\nexport type ExtensionBlueprintLintCode =\n | \"capability_undeclared\"\n | \"capability_unused\"\n | \"duplicate_command\"\n | \"command_override_conflict\"\n | \"empty_surface\"\n | \"manifest_capabilities_absent\";\n\n/**\n * A single author-time issue {@link lintExtensionBlueprint} found in a blueprint.\n */\nexport interface ExtensionBlueprintLintFinding {\n /** The machine-readable {@link ExtensionBlueprintLintCode} for programmatic handling. */\n code: ExtensionBlueprintLintCode;\n /** Whether the finding blocks activation (`error`) or is advisory (`warning`). */\n severity: ExtensionBlueprintLintSeverity;\n /** Human-readable explanation, including the suggested fix. */\n message: string;\n /** The capability involved, for capability-drift findings. */\n capability?: ExtensionCapability;\n /** The normalized command path involved, for command findings. */\n command?: string;\n /** The blueprint field involved, for `empty_surface` findings. */\n field?: string;\n}\n\n/**\n * Options for {@link lintExtensionBlueprint} and {@link ../sdk/testing.js#assertExtensionBlueprint}.\n */\nexport interface LintExtensionBlueprintOptions {\n /**\n * The capabilities the package's `manifest.json` declares (or will), used to\n * reconcile against the surfaces the blueprint exercises. Overrides\n * `blueprint.manifest.capabilities` when both are present. Omit both to lint\n * without a capability reconciliation (only the structural checks run).\n */\n declaredCapabilities?: readonly string[];\n}\n\n/**\n * The structured result of {@link lintExtensionBlueprint}.\n */\nexport interface ExtensionBlueprintLintResult {\n /** `true` when no `error`-severity finding is present (warnings still allow activation). */\n ok: boolean;\n /** Every finding, in detection order (capability drift, duplicates, conflicts, empty surfaces). */\n findings: ExtensionBlueprintLintFinding[];\n /** The least-privilege capability set the blueprint exercises (from {@link deriveExtensionCapabilities}). */\n used: ExtensionCapability[];\n /** The normalized declared capability set reconciled against, or `null` when none was provided. */\n declared: ExtensionCapability[] | null;\n}\n\n/** Normalize a raw declared-capability list to known capabilities only (legacy-alias aware, sorted, de-duplicated). */\nfunction normalizeDeclaredCapabilities(capabilities: readonly string[]): ExtensionCapability[] {\n const known = new Set<ExtensionCapability>();\n for (const capability of capabilities) {\n // Resolve a legacy alias (e.g. migration/validation → schema) exactly as the\n // loader does before reconciliation — the author's raw manifest input has not\n // been loader-normalized yet, so failing to resolve it here would misreport an\n // alias-satisfied capability as undeclared. Fall back to a canonical known\n // name; unknown capabilities are a separate diagnostic and are dropped so a\n // typo is not misreported as \"unused\".\n const normalized = resolveLegacyExtensionCapabilityAlias(capability) ?? normalizeKnownExtensionCapability(capability);\n if (normalized !== null) {\n known.add(normalized);\n }\n }\n return [...known].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} at author time, returning the\n * structured issues that would otherwise only surface at activation.\n *\n * It is the author-time inverse of the runtime extension guardrails — pure data\n * analysis with no loading, activation, or side effects:\n *\n * - capability drift in both directions: a capability a surface exercises but the\n * declared set omits is an `error` (the loader throws `extension_capability_missing`\n * at activation); a declared capability no surface exercises is a `warning` (the\n * author-time form of the `pm package doctor` `extension_capability_unused` note,\n * making this the static inverse of `reconcileExtensionCapabilityUsage`).\n * - structural footguns: a command path declared twice (`duplicate_command`), a\n * path declared as both a command and an override (`command_override_conflict`),\n * and a registration field present but empty (`empty_surface`).\n *\n * The declared set is taken from `options.declaredCapabilities` or, failing that,\n * `blueprint.manifest.capabilities`; with neither, capability reconciliation is\n * skipped and a single `manifest_capabilities_absent` warning suggests adopting\n * {@link deriveExtensionCapabilities}. Like {@link describeExtensionBlueprint},\n * the imperative `activate` escape hatch is invisible to this static check.\n */\nexport function lintExtensionBlueprint(\n blueprint: ExtensionBlueprint,\n options: LintExtensionBlueprintOptions = {},\n): ExtensionBlueprintLintResult {\n const findings: ExtensionBlueprintLintFinding[] = [];\n const used = deriveExtensionCapabilities(blueprint);\n\n // A non-array declared source (an untyped `.js` author's malformed manifest, or\n // a missing field) is treated as \"no declared set\" rather than \"declares nothing\".\n const declaredSource = options.declaredCapabilities ?? blueprint.manifest?.capabilities;\n const declared = Array.isArray(declaredSource) ? normalizeDeclaredCapabilities(declaredSource) : null;\n\n if (declared === null) {\n if (used.length > 0) {\n findings.push({\n code: \"manifest_capabilities_absent\",\n severity: \"warning\",\n message: `Blueprint exercises ${used.length === 1 ? \"capability\" : \"capabilities\"} [${used.join(\", \")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`,\n });\n }\n } else {\n const declaredSet = new Set(declared);\n const usedSet = new Set(used);\n for (const capability of used) {\n if (!declaredSet.has(capability)) {\n findings.push({\n code: \"capability_undeclared\",\n severity: \"error\",\n message: `Blueprint exercises capability \"${capability}\" but it is absent from the declared capabilities; activation throws extension_capability_missing — add \"${capability}\" to the manifest capabilities.`,\n capability,\n });\n }\n }\n for (const capability of declared) {\n if (!usedSet.has(capability)) {\n findings.push({\n code: \"capability_unused\",\n severity: \"warning\",\n message: `Capability \"${capability}\" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,\n capability,\n });\n }\n }\n }\n\n // Duplicate command paths within the declared command definitions.\n const commandPathCounts = new Map<string, number>();\n for (const command of blueprint.commands ?? []) {\n const path = normalizeCommandName(command.name);\n commandPathCounts.set(path, (commandPathCounts.get(path) ?? 0) + 1);\n }\n for (const [path, count] of commandPathCounts) {\n if (count > 1) {\n findings.push({\n code: \"duplicate_command\",\n severity: \"warning\",\n message: `Command \"${path}\" is declared ${count} times in commands; the later registration shadows the earlier one at dispatch.`,\n command: path,\n });\n }\n }\n\n // A command path declared as both a fresh definition and an override.\n const overridePaths = new Set(\n Object.keys(blueprint.commandOverrides ?? {}).map((command) => normalizeCommandName(command)),\n );\n for (const path of commandPathCounts.keys()) {\n if (overridePaths.has(path)) {\n findings.push({\n code: \"command_override_conflict\",\n severity: \"warning\",\n message: `Command \"${path}\" is declared both as a new command definition and as a command override; register one or the other.`,\n command: path,\n });\n }\n }\n\n // Registration fields present on the blueprint but contributing nothing.\n for (const field of BLUEPRINT_LINTABLE_SURFACE_FIELDS) {\n if (field in blueprint && !hasEntries(blueprint[field])) {\n findings.push({\n code: \"empty_surface\",\n severity: \"warning\",\n message: `Blueprint field \"${field}\" is present but empty; remove it or populate it.`,\n field,\n });\n }\n }\n if (\"hooks\" in blueprint) {\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n const registersHook = [hooks.beforeCommand, hooks.afterCommand, hooks.onWrite, hooks.onRead, hooks.onIndex].some(\n hasEntries,\n );\n if (!registersHook) {\n findings.push({\n code: \"empty_surface\",\n severity: \"warning\",\n message: `Blueprint field \"hooks\" is present but registers no lifecycle hooks; remove it or populate it.`,\n field: \"hooks\",\n });\n }\n }\n\n return {\n ok: findings.every((finding) => finding.severity !== \"error\"),\n findings,\n used,\n declared,\n };\n}\n\n/**\n * The author-supplied identity fields {@link synthesizeExtensionManifest} cannot\n * derive from a blueprint: every {@link ExtensionManifest} field except the\n * generated `capabilities`.\n *\n * The blueprint determines `capabilities` (the surfaces it registers) and nothing\n * else, so `name`/`version`/`entry`/`priority` and any optional metadata\n * (engines, permissions, provenance, version floors/ceilings, sandbox profile,\n * manifest version, activation, legacy aliases) are the author's to supply here.\n */\nexport interface SynthesizeExtensionManifestIdentity extends Omit<ExtensionManifest, \"capabilities\"> {\n /**\n * Extra capabilities to grant beyond the blueprint's derived set, for surfaces\n * registered through the blueprint's imperative `activate` escape hatch that\n * static derivation cannot see (e.g. a renderer wired in `activate`). Each is\n * legacy-alias resolved and normalized like a declared manifest capability;\n * unknown names are dropped (the synthesized manifest is validated at load).\n */\n additionalCapabilities?: readonly string[];\n}\n\n/**\n * Generate a complete, least-privilege {@link ExtensionManifest} from a\n * declarative {@link ExtensionBlueprint} and the author's identity fields.\n *\n * This is the *generate* verb that completes the declarative authoring loop\n * (`compose → derive → describe/lint → synthesize`). Where\n * {@link defineExtensionManifest} only *types* a hand-written manifest and\n * {@link deriveExtensionCapabilities} computes only the capability set, this\n * function assembles the whole manifest: it copies every author-supplied identity\n * field verbatim and fills `capabilities` with `deriveExtensionCapabilities`\n * unioned with any {@link SynthesizeExtensionManifestIdentity.additionalCapabilities | additionalCapabilities},\n * sorted and de-duplicated. The author writes the blueprint once and never\n * hand-syncs `manifest.capabilities` — declaring nothing the extension does not\n * use and nothing it does.\n *\n * It is a pure assembler: it neither validates the blueprint definitions (that\n * stays in `api.register*` at activation) nor the identity fields (the loader\n * validates the on-disk manifest). Pair it with\n * {@link ../sdk/testing.js#assertExtensionManifestMatchesBlueprint} to guard a\n * hand-maintained `manifest.json` against drift in CI.\n */\nexport function synthesizeExtensionManifest(\n blueprint: ExtensionBlueprint,\n identity: SynthesizeExtensionManifestIdentity,\n): ExtensionManifest {\n const { additionalCapabilities, ...manifestIdentity } = identity;\n // `Array.isArray` keeps a non-array value (or an omitted field) crossing an\n // untyped boundary from crashing the spread, mirroring the rest of the SDK.\n const extra = Array.isArray(additionalCapabilities) ? normalizeDeclaredCapabilities(additionalCapabilities) : [];\n const capabilities = [...new Set<ExtensionCapability>([...deriveExtensionCapabilities(blueprint), ...extra])].sort(\n (left, right) => left.localeCompare(right),\n );\n return { ...manifestIdentity, capabilities };\n}\n\n/**\n * The two generated halves of a shippable extension package, returned by\n * {@link composeExtensionPackage}.\n */\nexport interface ExtensionPackage {\n /**\n * The runtime {@link ExtensionModule} to export as the package entry's default\n * export. Its `manifest` mirror is set to the same {@link ExtensionPackage.manifest}\n * object, so the in-module metadata and the on-disk manifest never diverge.\n */\n module: ExtensionModule;\n /**\n * The complete least-privilege {@link ExtensionManifest} to write as the\n * package's `manifest.json`, with `capabilities` derived from the blueprint.\n */\n manifest: ExtensionManifest;\n}\n\n/**\n * Assemble both halves of a shippable extension package from one declarative\n * {@link ExtensionBlueprint} and the author's identity fields — the author-once\n * capstone of the declarative loop.\n *\n * Where {@link composeExtension} produces only the runtime module and\n * {@link synthesizeExtensionManifest} produces only the manifest, this unifies\n * them: it synthesizes the complete least-privilege manifest from the blueprint\n * and identity, then composes the module with that synthesized manifest set as its\n * authoritative in-module `manifest` mirror. Both halves are therefore generated\n * from a single source and cannot drift — the module's `manifest` is the very\n * object returned as `manifest`. Export `module` as the package entry's default\n * export and write `manifest` as `manifest.json`.\n *\n * It is a pure assembler with no validation, loading, or filesystem access,\n * exactly like the two functions it composes; pair it with\n * {@link preflightExtension} (or {@link ../sdk/testing.js#assertExtensionPreflight})\n * for the author-time verify step. Use {@link mergeExtensionBlueprints} first to\n * assemble the blueprint modularly, then this to ship it.\n */\nexport function composeExtensionPackage(\n blueprint: ExtensionBlueprint,\n identity: SynthesizeExtensionManifestIdentity,\n): ExtensionPackage {\n const manifest = synthesizeExtensionManifest(blueprint, identity);\n const module = composeExtension({ ...blueprint, manifest });\n return { module, manifest };\n}\n\n/**\n * The target a {@link checkExtensionManifestCompatibility} call evaluates a\n * manifest's version bounds against.\n */\nexport interface ExtensionManifestCompatibilityTarget {\n /**\n * The pm CLI version to check the manifest against, e.g. the running CLI's\n * `version` or a version floor a package commits to supporting. Plain\n * dotted-numeric (`2026.6.23`) or `v`-prefixed values are compared; anything\n * uninterpretable yields an `unchecked` finding rather than a false verdict.\n */\n pmVersion: string;\n /**\n * How a `pm_max_version` overrun is treated, mirroring the runtime\n * `extensions.policy.pm_max_version_exceeded_mode`. `\"block\"` (the default)\n * reports an exceeded upper bound as a blocking incompatibility; `\"warn\"`\n * reports it as a non-blocking advisory, matching an operator who relaxed the\n * gate during a CLI upgrade window.\n */\n pmMaxVersionExceededMode?: PmMaxVersionExceededMode;\n}\n\n/**\n * The manifest fields {@link checkExtensionManifestCompatibility} evaluates.\n *\n * Values are intentionally `unknown` rather than `string` so an author can\n * preflight the same malformed blank/non-string bounds (e.g. read from a JSON\n * manifest) the loader's manifest parser rejects as `extension_manifest_invalid`.\n */\nexport interface ExtensionManifestCompatibilityManifest {\n /** Inclusive lower pm CLI version bound from `manifest.json`. */\n pm_min_version?: unknown;\n /** Inclusive upper pm CLI version bound from `manifest.json`. */\n pm_max_version?: unknown;\n}\n\n/**\n * The machine-readable kind of an {@link ExtensionManifestCompatibilityFinding},\n * one per `<bound>_<outcome>` the loader can reach. Each mirrors a loader\n * `extension_pm_*_version_*` warning: `*_invalid`/`*_unmet`/`*_exceeded` block the\n * load, while `*_unchecked`/`*_exceeded_warn` are advisory (the extension still\n * loads).\n */\nexport type ExtensionManifestCompatibilityCode =\n | \"pm_min_version_invalid\"\n | \"pm_min_version_unchecked\"\n | \"pm_min_version_unmet\"\n | \"pm_max_version_invalid\"\n | \"pm_max_version_unchecked\"\n | \"pm_max_version_exceeded\"\n | \"pm_max_version_exceeded_warn\";\n\n/**\n * A single version-bound issue {@link checkExtensionManifestCompatibility} found\n * when evaluating a manifest against a target pm version.\n */\nexport interface ExtensionManifestCompatibilityFinding {\n /** The machine-readable {@link ExtensionManifestCompatibilityCode} for programmatic handling. */\n code: ExtensionManifestCompatibilityCode;\n /** `error` when the bound blocks the load against the target version, `warning` when it is advisory. */\n severity: \"error\" | \"warning\";\n /** Which manifest bound produced the finding. */\n constraint: PmVersionBoundKind;\n /** The declared bound value, verbatim. */\n required: string;\n /** The target pm version the bound was evaluated against. */\n current: string;\n /** Human-readable explanation of the outcome and its effect on loading. */\n message: string;\n}\n\n/**\n * The structured result of {@link checkExtensionManifestCompatibility}.\n */\nexport interface ExtensionManifestCompatibilityResult {\n /** `true` when no `error`-severity finding blocks the load against the target version. */\n compatible: boolean;\n /** Every bound finding, lower bound before upper bound; empty when both bounds are absent or satisfied. */\n findings: ExtensionManifestCompatibilityFinding[];\n /** The target pm version the manifest was checked against, echoed back for messaging. */\n pmVersion: string;\n}\n\n/** Map a non-trivial bound evaluation to a compatibility finding, or `null` when the bound is absent or satisfied. */\nfunction toCompatibilityFinding(\n evaluation: PmVersionBoundEvaluation,\n pmVersion: string,\n): ExtensionManifestCompatibilityFinding | null {\n if (evaluation.status === \"absent\" || evaluation.status === \"ok\") {\n return null;\n }\n const code = `${evaluation.kind}_${evaluation.status}` as ExtensionManifestCompatibilityCode;\n let message: string;\n switch (code) {\n case \"pm_min_version_invalid\":\n message = `pm_min_version \"${evaluation.required}\" is not a valid version; the extension is treated as incompatible and the loader skips it.`;\n break;\n case \"pm_min_version_unchecked\":\n message = `pm_min_version \"${evaluation.required}\" could not be compared against pm ${pmVersion}; compatibility is unverified.`;\n break;\n case \"pm_min_version_unmet\":\n message = `Requires pm >= ${evaluation.required} but the target is pm ${pmVersion}; the loader skips the extension.`;\n break;\n case \"pm_max_version_invalid\":\n message = `pm_max_version \"${evaluation.required}\" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;\n break;\n case \"pm_max_version_unchecked\":\n message = `pm_max_version \"${evaluation.required}\" could not be compared against pm ${pmVersion}; compatibility is unverified.`;\n break;\n case \"pm_max_version_exceeded\":\n message = `Allows pm <= ${evaluation.required} but the target is pm ${pmVersion}; the loader skips the extension.`;\n break;\n case \"pm_max_version_exceeded_warn\":\n message = `Target pm ${pmVersion} is newer than pm_max_version ${evaluation.required}, but the \"warn\" exceeded mode lets it load with a warning.`;\n break;\n }\n return {\n code,\n severity: evaluation.allowed ? \"warning\" : \"error\",\n constraint: evaluation.kind,\n required: evaluation.required,\n current: pmVersion,\n message,\n };\n}\n\n/**\n * Check, without loading anything, whether an extension manifest's declared\n * version bounds permit it to load on a given pm CLI version.\n *\n * This is the author-time inverse of the loader's runtime version gate: where the\n * loader resolves the *installed* CLI version (asynchronously, from `package.json`)\n * and emits `extension_pm_*_version_*` warnings, this pure synchronous function\n * takes the {@link ExtensionManifestCompatibilityTarget.pmVersion | target version}\n * the author supplies and returns structured findings. Both share the\n * {@link ../core/extensions/version-compat.js | version-compat core}, so the\n * author-time verdict and the runtime decision agree by construction — a package\n * author can pin a CI test to the pm version they support and catch a too-tight\n * `pm_min_version`, a malformed `pm_max_version`, or an upper bound a newer CLI\n * would exceed, long before publishing.\n *\n * `compatible` is `true` only when no bound blocks the load (`*_invalid`,\n * `*_unmet`, and a `block`-mode `*_exceeded`); `*_unchecked` (an uninterpretable\n * bound or target) and a `warn`-mode `*_exceeded_warn` are advisory `warning`\n * findings that still load. Pair it with\n * {@link ../sdk/testing.js#assertExtensionManifestCompatible} to fail CI on a\n * blocking incompatibility.\n */\nexport function checkExtensionManifestCompatibility(\n manifest: ExtensionManifestCompatibilityManifest,\n target: ExtensionManifestCompatibilityTarget,\n): ExtensionManifestCompatibilityResult {\n const minEvaluation = evaluatePmMinVersionBound(manifest.pm_min_version, target.pmVersion);\n const maxEvaluation = evaluatePmMaxVersionBound(\n manifest.pm_max_version,\n target.pmVersion,\n target.pmMaxVersionExceededMode ?? \"block\",\n );\n const findings: ExtensionManifestCompatibilityFinding[] = [];\n const minFinding = toCompatibilityFinding(minEvaluation, target.pmVersion);\n if (minFinding !== null) {\n findings.push(minFinding);\n }\n const maxFinding = toCompatibilityFinding(maxEvaluation, target.pmVersion);\n if (maxFinding !== null) {\n findings.push(maxFinding);\n }\n return {\n compatible: minEvaluation.allowed && maxEvaluation.allowed,\n findings,\n pmVersion: target.pmVersion,\n };\n}\n\n/**\n * The lint codes whose verdict depends on the *declared* capability set rather\n * than the blueprint's structure. {@link preflightExtension} drops these from its\n * consolidated view when it synthesizes the manifest from an `identity` without an\n * explicit declared set, because the synthesized manifest — not the blueprint's\n * stale in-module `manifest` mirror — is what the package ships, so a drift against\n * the mirror is a false positive. Structural codes (`duplicate_command`,\n * `command_override_conflict`, `empty_surface`) are never suppressed.\n */\nconst CAPABILITY_DRIFT_LINT_CODES = new Set<ExtensionBlueprintLintCode>([\n \"capability_undeclared\",\n \"capability_unused\",\n \"manifest_capabilities_absent\",\n]);\n\n/**\n * Options for {@link preflightExtension} and\n * {@link ../sdk/testing.js#assertExtensionPreflight}. Every field is optional:\n * each one a check enables, so an author opts into exactly the stages whose\n * inputs they can supply.\n */\nexport interface PreflightExtensionOptions {\n /**\n * The author-supplied identity fields the blueprint cannot determine\n * (`name`/`version`/`entry`/`priority`, version bounds, etc.). Provide them to\n * have preflight {@link synthesizeExtensionManifest | synthesize} the complete\n * least-privilege manifest and include it in the report; the synthesized\n * version bounds then feed the {@link PreflightExtensionOptions.target | target}\n * compatibility check. Omit to skip manifest synthesis.\n */\n identity?: SynthesizeExtensionManifestIdentity;\n /**\n * The pm CLI version (and optional max-version overrun mode) to evaluate the\n * manifest's `pm_min_version`/`pm_max_version` bounds against. Provide it to run\n * {@link checkExtensionManifestCompatibility} against the synthesized manifest\n * (or, absent an `identity`, the blueprint's in-module `manifest` mirror). Omit\n * to skip the version-compatibility check.\n */\n target?: ExtensionManifestCompatibilityTarget;\n /**\n * The capabilities the package's `manifest.json` declares, reconciled against\n * the surfaces the blueprint exercises. Passed straight to\n * {@link lintExtensionBlueprint}; when omitted it falls back to\n * `blueprint.manifest.capabilities`, so the blueprint's in-module mirror is\n * linted by default.\n */\n declaredCapabilities?: readonly string[];\n}\n\n/** Which preflight stage produced an {@link ExtensionPreflightFinding}. */\nexport type ExtensionPreflightFindingSource = \"blueprint\" | \"compatibility\";\n\n/**\n * A single finding in an {@link ExtensionPreflightReport}, flattened from one of\n * the underlying stages and tagged with its {@link ExtensionPreflightFindingSource}\n * so a consolidated report stays traceable to the check that raised it.\n */\nexport interface ExtensionPreflightFinding {\n /** The stage that produced the finding: blueprint lint or version compatibility. */\n source: ExtensionPreflightFindingSource;\n /** Whether the finding blocks publish/activation (`error`) or is advisory (`warning`). */\n severity: ExtensionBlueprintLintSeverity;\n /** The underlying stage's machine-readable code, for programmatic handling. */\n code: ExtensionBlueprintLintCode | ExtensionManifestCompatibilityCode;\n /** The underlying stage's human-readable explanation, verbatim. */\n message: string;\n}\n\n/**\n * The consolidated result of {@link preflightExtension}: every author-time stage's\n * structured output plus a flattened, source-tagged finding list.\n */\nexport interface ExtensionPreflightReport {\n /** `true` when no `error`-severity finding appears across any stage (warnings still pass). */\n ok: boolean;\n /** The least-privilege capability set the blueprint exercises (from {@link deriveExtensionCapabilities}). */\n capabilities: ExtensionCapability[];\n /** The full {@link lintExtensionBlueprint} result (structural + capability-drift findings). */\n blueprint: ExtensionBlueprintLintResult;\n /** The manifest synthesized from `options.identity`, or `null` when no identity was supplied. */\n manifest: ExtensionManifest | null;\n /** The {@link checkExtensionManifestCompatibility} result, or `null` when no `options.target` was supplied. */\n compatibility: ExtensionManifestCompatibilityResult | null;\n /**\n * Every finding from all stages, blueprint-lint findings before compatibility\n * findings, each tagged by `source`. This is the consolidated, curated view: when\n * `options.identity` synthesizes the manifest without an explicit\n * `declaredCapabilities` set, capability-drift findings the lint raised against the\n * blueprint's now-superseded in-module `manifest` mirror are omitted here (the raw\n * `blueprint` result still carries them).\n */\n findings: ExtensionPreflightFinding[];\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} through every author-time\n * check in one call, returning a single consolidated {@link ExtensionPreflightReport}.\n *\n * This is the author-time capstone — the static analog of\n * {@link ../sdk/testing.js#createExtensionTestHarness}, which unified the\n * runtime-test helpers. Instead of chaining {@link lintExtensionBlueprint},\n * {@link synthesizeExtensionManifest}, and {@link checkExtensionManifestCompatibility}\n * (and reconciling their separate results) before publishing a package, an author\n * runs `preflightExtension(blueprint, { identity, target })` and reads one report:\n *\n * - the blueprint is always linted (structural footguns + capability drift);\n * - when `options.identity` is given, the complete least-privilege manifest is\n * synthesized and returned, so the author never hand-syncs `capabilities`;\n * - when `options.target` is given, the synthesized manifest's version bounds\n * (or, absent an identity, the blueprint's in-module `manifest` mirror) are\n * checked against that pm version.\n *\n * It is pure and side-effect-free — no loading, activation, or filesystem access,\n * exactly like the stages it composes — so it is safe in any author-time or CI\n * context. The per-stage structured results are exposed unmodified\n * (`report.blueprint`/`manifest`/`compatibility`) alongside the flattened,\n * source-tagged `report.findings`; `report.ok` is `false` if any stage produced an\n * `error`-severity finding. The flattened `findings` are curated for the author-once\n * flow: once an `identity` synthesizes the manifest (and no explicit\n * `declaredCapabilities` was pinned), the synthesized manifest — not the blueprint's\n * in-module `manifest` mirror — is what ships, so capability-drift findings the lint\n * raised against that mirror are false positives and are omitted from\n * `report.findings` (the raw `report.blueprint` result still reports them). Pair it\n * with {@link ../sdk/testing.js#assertExtensionPreflight} to fail CI in one line.\n */\nexport function preflightExtension(\n blueprint: ExtensionBlueprint,\n options: PreflightExtensionOptions = {},\n): ExtensionPreflightReport {\n const blueprintResult = lintExtensionBlueprint(blueprint, { declaredCapabilities: options.declaredCapabilities });\n const manifest = options.identity ? synthesizeExtensionManifest(blueprint, options.identity) : null;\n // Compatibility evaluates the bounds the package will ship: the synthesized\n // manifest when an identity drives generation, else the blueprint's in-module\n // manifest mirror, else an empty manifest (no bounds → trivially compatible).\n const compatibility = options.target\n ? checkExtensionManifestCompatibility(manifest ?? blueprint.manifest ?? {}, options.target)\n : null;\n // When preflight synthesizes the manifest from an identity (and the caller did not\n // pin an explicit declaredCapabilities set), the blueprint lint reconciled against\n // the blueprint's in-module `manifest` mirror — which the synthesized manifest\n // supersedes. Capability-drift findings against that stale mirror are false\n // positives in the consolidated view (a missing capability would even flip `ok` to\n // false though the synthesized manifest declares it), so drop them; structural\n // findings are unaffected and the raw lint result on `report.blueprint` keeps all of\n // them. An explicit declaredCapabilities set is a deliberate \"check exactly this\"\n // request, so it is never suppressed.\n const suppressCapabilityDrift = manifest !== null && options.declaredCapabilities === undefined;\n const blueprintFindings = suppressCapabilityDrift\n ? blueprintResult.findings.filter((finding) => !CAPABILITY_DRIFT_LINT_CODES.has(finding.code))\n : blueprintResult.findings;\n const findings: ExtensionPreflightFinding[] = [\n ...blueprintFindings.map(\n (finding): ExtensionPreflightFinding => ({\n source: \"blueprint\",\n severity: finding.severity,\n code: finding.code,\n message: finding.message,\n }),\n ),\n ...(compatibility?.findings ?? []).map(\n (finding): ExtensionPreflightFinding => ({\n source: \"compatibility\",\n severity: finding.severity,\n code: finding.code,\n message: finding.message,\n }),\n ),\n ];\n return {\n ok: findings.every((finding) => finding.severity !== \"error\"),\n capabilities: blueprintResult.used,\n blueprint: blueprintResult,\n manifest,\n compatibility,\n findings,\n };\n}\n"],"names":[],"mappings":";;AAwDA,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAA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C,CAAC,OAAO,EAA6B,EAAE,CAAC,CAAC;YACvC,MAAM,EAAE,eAAe;YACvB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CACH;KACF,CAAC;IACF,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;QAC7D,YAAY,EAAE,eAAe,CAAC,IAAI;QAClC,SAAS,EAAE,eAAe;QAC1B,QAAQ;QACR,aAAa;QACb,QAAQ;KACT,CAAC;AACJ,CAAC","debugId":"376f0804-a437-515f-a653-485531d98f13"}
1
+ {"version":3,"file":"compose.js","sources":["sdk/compose.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/compose\n *\n * Declarative extension authoring — the capstone of the SDK authoring tripod\n * (`author → register → test`).\n *\n * The {@link ./define.js | `define*`} builders type each registration where it\n * is written, and the `assert*`/`run*` testing helpers verify and invoke it. But\n * the author still has to hand-wire every definition into an imperative\n * `activate(api)` body — calling the right `api.register*` method, in the right\n * order, without forgetting one — and then hand-sync `manifest.capabilities` to\n * match. Those are the two most common package-authoring footguns.\n *\n * {@link composeExtension} closes the loop: an author (or an agent) describes\n * *what* to register as a plain {@link ExtensionBlueprint} object, and the SDK\n * generates the `activate` that wires every surface for them.\n * {@link deriveExtensionCapabilities} computes the exact least-privilege\n * capability set that blueprint exercises, so `manifest.json` can be authored\n * with zero declared-but-unused / used-but-undeclared drift (the author-time\n * inverse of the runtime `reconcileExtensionCapabilityUsage` reconciliation).\n *\n * This module also owns {@link ExtensionModule} and {@link defineExtension} —\n * the in-module export shape every extension entry file produces and its\n * zero-cost identity helper — so both the imperative (`defineExtension`) and\n * declarative (`composeExtension`) authoring styles live together. Both are\n * re-exported from the SDK barrel, so the public API is unchanged.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n ExtensionApi,\n ExtensionCapability,\n ExtensionManifest,\n ExtensionServiceName,\n Exporter,\n FlagDefinition,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n OutputRendererFormat,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ExtensionActivationSummary } from \"../core/extensions/activation-summary.js\";\nimport type { ProjectProfileRegistrationInput } from \"../core/profile/profile-presets.js\";\nimport type { PmMaxVersionExceededMode } from \"../core/extensions/extension-types.js\";\nimport {\n normalizeKnownExtensionCapability,\n resolveLegacyExtensionCapabilityAlias,\n} from \"../core/extensions/extension-capability-aliases.js\";\nimport { normalizeCommandName } from \"../core/extensions/extension-runtime-helpers.js\";\nimport {\n evaluatePmMaxVersionBound,\n evaluatePmMinVersionBound,\n type PmVersionBoundEvaluation,\n type PmVersionBoundKind,\n} from \"../core/extensions/version-compat.js\";\n\n/**\n * Documents the extension module payload exchanged by command, SDK, and package integrations.\n *\n * This is the shape an extension entry file exports (as its default export and,\n * conventionally, as named `manifest`/`activate` exports). Produce it directly,\n * via {@link defineExtension} for the imperative style, or via\n * {@link composeExtension} for the declarative style.\n */\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests. Type it with\n * {@link defineExtensionManifest} for full contract checking at the definition\n * site.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n /**\n * Optional teardown lifecycle hook (VS Code-style `deactivate`). Invoked by\n * the host on shutdown/reload to release resources opened during `activate`.\n */\n deactivate?(): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n *\n * Reach for {@link composeExtension} instead when you would rather declare the\n * registrations as data than wire them imperatively in `activate`.\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\n/**\n * A single importer registration entry for an {@link ExtensionBlueprint}, mirroring\n * the positional arguments of `api.registerImporter(name, importer, options?)`.\n */\nexport interface ExtensionBlueprintImporter {\n /** Registered importer name; the `<name> import` command path is derived from it. */\n name: string;\n /** The importer handler that bridges an external system into the pm context graph. */\n importer: Importer;\n /** Optional command metadata (description/flags/intent/examples) for the derived command. */\n options?: ImportExportRegistrationOptions;\n}\n\n/**\n * A single exporter registration entry for an {@link ExtensionBlueprint}, mirroring\n * the positional arguments of `api.registerExporter(name, exporter, options?)`.\n */\nexport interface ExtensionBlueprintExporter {\n /** Registered exporter name; the `<name> export` command path is derived from it. */\n name: string;\n /** The exporter handler that bridges the pm context graph out to an external system. */\n exporter: Exporter;\n /** Optional command metadata (description/flags/intent/examples) for the derived command. */\n options?: ImportExportRegistrationOptions;\n}\n\n/**\n * The lifecycle hooks an {@link ExtensionBlueprint} can register, one array per\n * kind. Each entry is registered through the matching `api.hooks.*` method in\n * the canonical order `before_command → after_command → on_write → on_read →\n * on_index`.\n */\nexport interface ExtensionBlueprintHooks {\n /** Hooks fired before a command runs (`api.hooks.beforeCommand`). */\n beforeCommand?: BeforeCommandHook[];\n /** Hooks fired after a command runs (`api.hooks.afterCommand`). */\n afterCommand?: AfterCommandHook[];\n /** Hooks fired when an item is persisted (`api.hooks.onWrite`). */\n onWrite?: OnWriteHook[];\n /** Hooks fired when an item is read (`api.hooks.onRead`). */\n onRead?: OnReadHook[];\n /** Hooks fired during index/search refresh (`api.hooks.onIndex`). */\n onIndex?: OnIndexHook[];\n}\n\n/**\n * A declarative description of everything an extension registers at activation.\n *\n * Every field is optional: populate the surfaces your extension uses (ideally\n * with {@link ./define.js | `define*`}-authored definitions) and leave the rest\n * out. {@link composeExtension} turns the blueprint into an\n * {@link ExtensionModule} whose generated `activate` calls the matching\n * `api.register*` method for each surface, and {@link deriveExtensionCapabilities}\n * computes the capability set the blueprint requires.\n *\n * Record-keyed fields map a routing key (command name, output format, or service\n * name) to its handler, mirroring the two-argument `api.register*` overloads.\n */\nexport interface ExtensionBlueprint {\n /** Optional in-module manifest mirror, copied onto the produced module verbatim. */\n manifest?: ExtensionManifest;\n /** Full command definitions registered via `api.registerCommand(definition)`. */\n commands?: CommandDefinition[];\n /** Command overrides keyed by command name, registered via `api.registerCommand(command, override)`. */\n commandOverrides?: Record<string, CommandOverride>;\n /** Additional flags keyed by target command name, registered via `api.registerFlags(command, flags)`. */\n flags?: Record<string, FlagDefinition[]>;\n /** Parser overrides keyed by command name, registered via `api.registerParser(command, override)`. */\n parsers?: Record<string, ParserOverride>;\n /** Output renderer overrides keyed by format, registered via `api.registerRenderer(format, renderer)`. */\n renderers?: Partial<Record<OutputRendererFormat, RendererOverride>>;\n /** Service overrides keyed by service name, registered via `api.registerService(service, override)`. */\n services?: Partial<Record<ExtensionServiceName, ServiceOverride>>;\n /** Preflight overrides registered via `api.registerPreflight(override)`. */\n preflights?: PreflightOverride[];\n /** Custom item types registered in a single `api.registerItemTypes(types)` call. */\n itemTypes?: SchemaItemTypeDefinition[];\n /** Custom front-matter fields registered in a single `api.registerItemFields(fields)` call. */\n itemFields?: SchemaFieldDefinition[];\n /** Schema migrations registered one at a time via `api.registerMigration(definition)`. */\n migrations?: SchemaMigrationDefinition[];\n /** Project profiles registered one at a time via `api.registerProfile(profile)`. */\n profiles?: ProjectProfileRegistrationInput[];\n /** Search providers registered via `api.registerSearchProvider(provider)`. */\n searchProviders?: SearchProviderDefinition[];\n /** Vector store adapters registered via `api.registerVectorStoreAdapter(adapter)`. */\n vectorStoreAdapters?: VectorStoreAdapterDefinition[];\n /** Importers registered via `api.registerImporter(name, importer, options?)`. */\n importers?: ExtensionBlueprintImporter[];\n /** Exporters registered via `api.registerExporter(name, exporter, options?)`. */\n exporters?: ExtensionBlueprintExporter[];\n /** Lifecycle hooks registered through `api.hooks.*`. */\n hooks?: ExtensionBlueprintHooks;\n /**\n * Optional imperative escape hatch run *after* every declarative registration,\n * for the rare wiring the blueprint cannot express. Receives the same `api`.\n */\n activate?: (api: ExtensionApi) => void | Promise<void>;\n /** Optional teardown hook copied onto the produced module verbatim. */\n deactivate?: () => void | Promise<void>;\n}\n\n/**\n * Typed identity helper for a (partial) {@link ExtensionBlueprint} authored as its\n * own module — the typed entry point of the modular declarative-authoring loop.\n *\n * It is the natural companion to {@link mergeExtensionBlueprints}: when an\n * extension's surface is split across files — a commands module, a search module,\n * a hooks module — wrap each fragment so it is contract-checked *at its definition\n * site* (with editor completion), exactly as {@link defineExtension} types a whole\n * module and {@link defineExtensionManifest} types a manifest. It returns its\n * argument unchanged, preserving the literal type\n * so the fragment composes into {@link mergeExtensionBlueprints},\n * {@link composeExtension}, or {@link composeExtensionPackage} with no loss of\n * inference.\n *\n * Use as:\n * `export const commandsModule = defineExtensionBlueprint({ commands: [...] })`\n */\nexport function defineExtensionBlueprint<TBlueprint extends ExtensionBlueprint>(blueprint: TBlueprint): TBlueprint {\n return blueprint;\n}\n\n/**\n * Register a blueprint's command-layer surfaces — fresh command definitions,\n * command overrides, flag tables, and parser/renderer/service overrides — in the\n * deterministic order {@link composeExtension} documents.\n */\nfunction registerBlueprintCommandSurfaces(api: ExtensionApi, blueprint: ExtensionBlueprint): void {\n for (const command of blueprint.commands ?? []) {\n api.registerCommand(command);\n }\n for (const [command, override] of Object.entries(blueprint.commandOverrides ?? {})) {\n api.registerCommand(command, override);\n }\n for (const [targetCommand, flags] of Object.entries(blueprint.flags ?? {})) {\n api.registerFlags(targetCommand, flags);\n }\n for (const [command, override] of Object.entries(blueprint.parsers ?? {})) {\n api.registerParser(command, override);\n }\n for (const [format, renderer] of Object.entries(blueprint.renderers ?? {}) as Array<\n [OutputRendererFormat, RendererOverride]\n >) {\n api.registerRenderer(format, renderer);\n }\n for (const [service, override] of Object.entries(blueprint.services ?? {}) as Array<\n [ExtensionServiceName, ServiceOverride]\n >) {\n api.registerService(service, override);\n }\n}\n\n/**\n * Register a blueprint's schema-layer surfaces — preflight overrides, item types,\n * item fields, schema migrations, and project profiles — preserving the\n * batch-registration semantics of `registerItemTypes`/`registerItemFields`\n * (only invoked when at least one entry is present).\n */\nfunction registerBlueprintSchemaSurfaces(api: ExtensionApi, blueprint: ExtensionBlueprint): void {\n for (const override of blueprint.preflights ?? []) {\n api.registerPreflight(override);\n }\n const itemTypes = blueprint.itemTypes ?? [];\n if (itemTypes.length > 0) {\n api.registerItemTypes(itemTypes);\n }\n const itemFields = blueprint.itemFields ?? [];\n if (itemFields.length > 0) {\n api.registerItemFields(itemFields);\n }\n for (const migration of blueprint.migrations ?? []) {\n api.registerMigration(migration);\n }\n for (const profile of blueprint.profiles ?? []) {\n api.registerProfile(profile);\n }\n}\n\n/**\n * Register a blueprint's retrieval and interchange surfaces — search providers,\n * vector store adapters, importers, and exporters — passing each importer's and\n * exporter's optional registration options through verbatim.\n */\nfunction registerBlueprintRetrievalSurfaces(api: ExtensionApi, blueprint: ExtensionBlueprint): void {\n for (const provider of blueprint.searchProviders ?? []) {\n api.registerSearchProvider(provider);\n }\n for (const adapter of blueprint.vectorStoreAdapters ?? []) {\n api.registerVectorStoreAdapter(adapter);\n }\n for (const entry of blueprint.importers ?? []) {\n api.registerImporter(entry.name, entry.importer, entry.options);\n }\n for (const entry of blueprint.exporters ?? []) {\n api.registerExporter(entry.name, entry.exporter, entry.options);\n }\n}\n\n/**\n * Register a blueprint's lifecycle hooks in canonical order\n * (beforeCommand → afterCommand → onWrite → onRead → onIndex).\n */\nfunction registerBlueprintHooks(api: ExtensionApi, hooks: ExtensionBlueprintHooks): void {\n for (const hook of hooks.beforeCommand ?? []) {\n api.hooks.beforeCommand(hook);\n }\n for (const hook of hooks.afterCommand ?? []) {\n api.hooks.afterCommand(hook);\n }\n for (const hook of hooks.onWrite ?? []) {\n api.hooks.onWrite(hook);\n }\n for (const hook of hooks.onRead ?? []) {\n api.hooks.onRead(hook);\n }\n for (const hook of hooks.onIndex ?? []) {\n api.hooks.onIndex(hook);\n }\n}\n\n/**\n * Assemble an {@link ExtensionModule} from a declarative {@link ExtensionBlueprint}.\n *\n * The returned module's `activate` registers every populated surface through the\n * matching `api.register*` method in a deterministic order (commands → overrides\n * → flags → parsers → renderers → services → preflights → item types → item\n * fields → migrations → profiles → search providers → vector store adapters →\n * importers → exporters → hooks), then awaits the blueprint's optional imperative `activate`\n * so it can layer on anything the declarative form cannot express. `manifest`\n * and `deactivate` are copied onto the module verbatim.\n *\n * This is a pure assembler: it does not validate the definitions. Per-surface\n * contract enforcement stays in `api.register*` (and the loader), exactly as it\n * does for hand-written `activate` bodies, so a malformed definition surfaces\n * the same activation diagnostic either way.\n */\nexport function composeExtension(blueprint: ExtensionBlueprint): ExtensionModule {\n const activate = async (api: ExtensionApi): Promise<void> => {\n registerBlueprintCommandSurfaces(api, blueprint);\n registerBlueprintSchemaSurfaces(api, blueprint);\n registerBlueprintRetrievalSurfaces(api, blueprint);\n // `?? {}` (rather than a `!== undefined` guard) so an explicit `hooks: null`\n // crossing an untyped boundary (e.g. a blueprint hydrated from JSON) is\n // treated the same as omitting it, instead of throwing on the first\n // `hooks.beforeCommand` access.\n registerBlueprintHooks(api, blueprint.hooks ?? {});\n await blueprint.activate?.(api);\n };\n\n // Truthy checks (rather than `!== undefined`) so an explicit `null` mirror or\n // teardown is treated as absent instead of copied onto the module.\n const module: ExtensionModule = { activate };\n if (blueprint.manifest) {\n module.manifest = blueprint.manifest;\n }\n if (blueprint.deactivate) {\n module.deactivate = blueprint.deactivate;\n }\n return module;\n}\n\n/**\n * Concatenate the populated entries of an array surface across blueprints,\n * preserving argument order. Returns `undefined` when no blueprint contributes\n * any entry, so {@link mergeExtensionBlueprints} omits the field instead of\n * emitting an empty array. `?? []` tolerates an explicit `null` field (e.g. from a\n * blueprint hydrated across an untyped boundary) exactly as {@link composeExtension} does.\n */\nfunction mergeArraySurface<TValue>(\n surfaces: ReadonlyArray<readonly TValue[] | null | undefined>,\n): TValue[] | undefined {\n const merged = surfaces.flatMap((surface) => surface ?? []);\n return merged.length > 0 ? merged : undefined;\n}\n\n/**\n * Shallow-merge single-handler record surfaces (`commandOverrides`, `parsers`,\n * `renderers`, `services`) with last-defined-wins precedence on a key collision,\n * exactly like spreading the records in argument order. Returns `undefined` when\n * no blueprint contributes any key.\n */\nfunction mergeHandlerRecord<TRecord extends object>(\n surfaces: ReadonlyArray<TRecord | null | undefined>,\n): TRecord | undefined {\n const merged = Object.assign({}, ...surfaces.map((surface) => surface ?? {})) as TRecord;\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\n/**\n * Merge `flags` records by concatenating every blueprint's flag array for a shared\n * target command, mirroring the additive `api.registerFlags` semantics so each\n * module's flags reach the command. Returns `undefined` when no blueprint declares\n * any flags.\n */\nfunction mergeFlagRecord(\n surfaces: ReadonlyArray<Record<string, FlagDefinition[]> | null | undefined>,\n): Record<string, FlagDefinition[]> | undefined {\n const merged: Record<string, FlagDefinition[]> = {};\n for (const surface of surfaces) {\n for (const [command, flags] of Object.entries(surface ?? {})) {\n // `flags` is the record's array value, never nullish in-type — `composeExtension`\n // likewise passes it to `registerFlags` unguarded — so it is spread directly.\n merged[command] = [...(merged[command] ?? []), ...flags];\n }\n }\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nconst EXTENSION_BLUEPRINT_HOOK_KEYS = [\n \"beforeCommand\",\n \"afterCommand\",\n \"onWrite\",\n \"onRead\",\n \"onIndex\",\n] as const satisfies ReadonlyArray<keyof ExtensionBlueprintHooks>;\n\ntype ExtensionBlueprintHookKey = (typeof EXTENSION_BLUEPRINT_HOOK_KEYS)[number];\ntype MissingExtensionBlueprintHookKeys = Exclude<keyof ExtensionBlueprintHooks, ExtensionBlueprintHookKey>;\ntype ExtraExtensionBlueprintHookKeys = Exclude<ExtensionBlueprintHookKey, keyof ExtensionBlueprintHooks>;\n\n// Compile-time exhaustiveness guard: adding a hook field must update the canonical\n// merge order above, and stale keys cannot remain in that list.\nconst EXTENSION_BLUEPRINT_HOOK_KEY_COVERAGE: Record<\n MissingExtensionBlueprintHookKeys | ExtraExtensionBlueprintHookKeys,\n never\n> = {};\nvoid EXTENSION_BLUEPRINT_HOOK_KEY_COVERAGE;\n\ntype ExtensionBlueprintHookArray<TKey extends keyof ExtensionBlueprintHooks> = NonNullable<ExtensionBlueprintHooks[TKey]>;\ntype ExtensionBlueprintHookValue<TKey extends keyof ExtensionBlueprintHooks> = ExtensionBlueprintHookArray<TKey>[number];\n\nfunction assignMergedHookSurface<TKey extends keyof ExtensionBlueprintHooks>(\n merged: ExtensionBlueprintHooks,\n surfaces: ReadonlyArray<ExtensionBlueprintHooks | null | undefined>,\n key: TKey,\n): void {\n const hookArrays = surfaces.map((hooks) => hooks?.[key]) as ReadonlyArray<\n ExtensionBlueprintHookArray<TKey> | null | undefined\n >;\n const value = mergeArraySurface<ExtensionBlueprintHookValue<TKey>>(hookArrays);\n if (value !== undefined) {\n const typedMerged = merged as { [K in TKey]?: ExtensionBlueprintHookArray<K> };\n typedMerged[key] = value as ExtensionBlueprintHookArray<TKey>;\n }\n}\n\n/**\n * Merge the nested `hooks` surface by concatenating each lifecycle kind's array in\n * canonical order. Returns `undefined` when no blueprint registers any hook.\n */\nfunction mergeHookSurfaces(\n surfaces: ReadonlyArray<ExtensionBlueprintHooks | null | undefined>,\n): ExtensionBlueprintHooks | undefined {\n const merged: ExtensionBlueprintHooks = {};\n for (const key of EXTENSION_BLUEPRINT_HOOK_KEYS) {\n assignMergedHookSurface(merged, surfaces, key);\n }\n return Object.keys(merged).length > 0 ? merged : undefined;\n}\n\n/**\n * Merge several partial {@link ExtensionBlueprint}s into one, so an extension's\n * surface can be authored *modularly* — a commands module, a search module, a\n * hooks module — and combined into a single blueprint to feed\n * {@link composeExtension}, {@link composeExtensionPackage},\n * {@link synthesizeExtensionManifest}, {@link describeExtensionBlueprint}, or\n * {@link preflightExtension}.\n *\n * The merge is pure and deterministic and never mutates an input. Each surface\n * combines the way its underlying `api.register*` call composes:\n *\n * - **Array surfaces** — `commands`, `preflights`, `itemTypes`, `itemFields`,\n * `migrations`, `profiles`, `searchProviders`, `vectorStoreAdapters`,\n * `importers`, `exporters` — concatenate in argument order.\n * - **`flags`** concatenates the flag arrays of any shared target command,\n * mirroring additive `api.registerFlags`: every module's flags reach the command.\n * - **Single-handler records** — `commandOverrides`, `parsers`, `renderers`,\n * `services` — follow last-defined-wins precedence on a key collision, exactly\n * like spreading the records in argument order; a later module deliberately\n * overrides an earlier one's handler for that key.\n * - **`hooks`** concatenates each lifecycle kind's array in canonical order.\n * - The imperative **`activate`** escape hatches chain in argument order (each\n * awaited), so every module's escape-hatch wiring still runs.\n * - The **`deactivate`** teardown hooks chain in *reverse* argument order (LIFO),\n * releasing resources in the inverse of acquisition. Teardown is best-effort:\n * a throwing hook does not strand later modules' cleanup — every hook runs and\n * teardown failures are re-thrown afterwards (as the original error for one\n * failure, or an `AggregateError` for several).\n * - The **`manifest`** mirror is last-defined-wins.\n *\n * Because `composeExtension` and the derive/lint/describe helpers are pure readers\n * of this data, a merged blueprint behaves exactly as a hand-written one: a command\n * two modules both define survives as a duplicate in the merged `commands` array\n * and {@link lintExtensionBlueprint} flags it, just as it would in one file. An\n * empty field is omitted rather than emitted empty, so merging zero blueprints\n * returns an empty blueprint (`{}`).\n */\nexport function mergeExtensionBlueprints(...blueprints: ExtensionBlueprint[]): ExtensionBlueprint {\n const merged: ExtensionBlueprint = {};\n const assign = <TKey extends keyof ExtensionBlueprint>(key: TKey, value: ExtensionBlueprint[TKey]): void => {\n if (value !== undefined) {\n merged[key] = value;\n }\n };\n assign(\"commands\", mergeArraySurface(blueprints.map((blueprint) => blueprint.commands)));\n assign(\"commandOverrides\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.commandOverrides)));\n assign(\"flags\", mergeFlagRecord(blueprints.map((blueprint) => blueprint.flags)));\n assign(\"parsers\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.parsers)));\n assign(\"renderers\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.renderers)));\n assign(\"services\", mergeHandlerRecord(blueprints.map((blueprint) => blueprint.services)));\n assign(\"preflights\", mergeArraySurface(blueprints.map((blueprint) => blueprint.preflights)));\n assign(\"itemTypes\", mergeArraySurface(blueprints.map((blueprint) => blueprint.itemTypes)));\n assign(\"itemFields\", mergeArraySurface(blueprints.map((blueprint) => blueprint.itemFields)));\n assign(\"migrations\", mergeArraySurface(blueprints.map((blueprint) => blueprint.migrations)));\n assign(\"profiles\", mergeArraySurface(blueprints.map((blueprint) => blueprint.profiles)));\n assign(\"searchProviders\", mergeArraySurface(blueprints.map((blueprint) => blueprint.searchProviders)));\n assign(\"vectorStoreAdapters\", mergeArraySurface(blueprints.map((blueprint) => blueprint.vectorStoreAdapters)));\n assign(\"importers\", mergeArraySurface(blueprints.map((blueprint) => blueprint.importers)));\n assign(\"exporters\", mergeArraySurface(blueprints.map((blueprint) => blueprint.exporters)));\n assign(\"hooks\", mergeHookSurfaces(blueprints.map((blueprint) => blueprint.hooks)));\n // Last-defined-wins for the in-module manifest mirror: a later module's identity\n // supersedes an earlier one's, matching the single-handler record precedence.\n let manifest: ExtensionManifest | undefined;\n for (const blueprint of blueprints) {\n if (blueprint.manifest) {\n manifest = blueprint.manifest;\n }\n }\n assign(\"manifest\", manifest);\n // Imperative escape hatches chain forward (acquisition order); teardown chains\n // in reverse (LIFO), so resources release in the inverse of acquisition.\n const hasActivates = blueprints.some((blueprint) => blueprint.activate);\n assign(\n \"activate\",\n hasActivates\n ? async (api: ExtensionApi): Promise<void> => {\n for (const blueprint of blueprints) {\n if (blueprint.activate) {\n await blueprint.activate(api);\n }\n }\n }\n : undefined,\n );\n const hasDeactivates = blueprints.some((blueprint) => blueprint.deactivate);\n assign(\n \"deactivate\",\n hasDeactivates\n ? async (): Promise<void> => {\n // Teardown is best-effort across modules: a throwing `deactivate` must\n // not strand a later module's cleanup, so every hook runs (in reverse,\n // LIFO) and failures are surfaced after cleanup completes.\n const errors: unknown[] = [];\n for (const blueprint of [...blueprints].reverse()) {\n if (!blueprint.deactivate) {\n continue;\n }\n try {\n await blueprint.deactivate();\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length > 0) {\n if (errors.length > 1) {\n throw new AggregateError(errors, \"Multiple extension blueprint deactivate hooks failed.\");\n }\n throw errors[0];\n }\n }\n : undefined,\n );\n return merged;\n}\n\n/**\n * Blueprint registration fields whose presence implies a capability, paired with\n * the capability each grants. Mirrors `EXTENSION_CAPABILITY_REGISTRATION_SURFACES`\n * so a blueprint's derived capabilities exactly match what the loader enforces\n * when {@link composeExtension}'s generated `activate` calls `api.register*`.\n *\n * `hooks` is handled separately (it is a nested object, not an array/record of\n * registrations) and so is intentionally absent from this table.\n */\nconst BLUEPRINT_FIELD_CAPABILITIES: ReadonlyArray<readonly [BlueprintRegistrationField, ExtensionCapability]> = [\n [\"commands\", \"commands\"],\n [\"commandOverrides\", \"commands\"],\n [\"flags\", \"schema\"],\n [\"itemTypes\", \"schema\"],\n [\"itemFields\", \"schema\"],\n [\"migrations\", \"schema\"],\n [\"profiles\", \"schema\"],\n [\"parsers\", \"parser\"],\n [\"renderers\", \"renderers\"],\n [\"services\", \"services\"],\n [\"preflights\", \"preflight\"],\n [\"searchProviders\", \"search\"],\n [\"vectorStoreAdapters\", \"search\"],\n [\"importers\", \"importers\"],\n [\"exporters\", \"importers\"],\n];\n\ntype BlueprintRegistrationField =\n | \"commands\"\n | \"commandOverrides\"\n | \"flags\"\n | \"parsers\"\n | \"renderers\"\n | \"services\"\n | \"preflights\"\n | \"itemTypes\"\n | \"itemFields\"\n | \"migrations\"\n | \"profiles\"\n | \"searchProviders\"\n | \"vectorStoreAdapters\"\n | \"importers\"\n | \"exporters\";\n\nfunction hasEntries(value: readonly unknown[] | Record<string, unknown> | null | undefined): boolean {\n // `!value` treats both `null` and `undefined` as \"no entries\", so an untyped\n // JavaScript author cannot crash capability derivation with an explicit null\n // field — `Object.keys(null)` would otherwise throw.\n if (!value) {\n return false;\n }\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n return Object.keys(value).length > 0;\n}\n\n/**\n * Compute the minimal least-privilege capability set a {@link ExtensionBlueprint}\n * exercises, sorted and de-duplicated.\n *\n * Use it to author `manifest.json` `capabilities` exactly — declaring nothing the\n * extension does not use and nothing it does. It is the author-time inverse of\n * the runtime `reconcileExtensionCapabilityUsage` reconciliation: derive the set\n * here before activation rather than detecting drift after it. A blueprint with\n * no registration surfaces returns an empty array.\n */\nexport function deriveExtensionCapabilities(blueprint: ExtensionBlueprint): ExtensionCapability[] {\n const capabilities = new Set<ExtensionCapability>();\n for (const [field, capability] of BLUEPRINT_FIELD_CAPABILITIES) {\n if (hasEntries(blueprint[field])) {\n capabilities.add(capability);\n }\n }\n // A command definition carrying its own inline `flags` registers them through\n // `registerCommand`, which asserts the `schema` capability independently of the\n // top-level `flags` record. Mirror that here so the derived set still matches\n // what activation enforces when a command declares flags inline and the\n // blueprint has no separate `flags` field. `!== undefined` (not a truthiness or\n // length check) matches the loader's exact guard, including an empty inline array.\n if ((blueprint.commands ?? []).filter(isPresent).some((command) => command.flags !== undefined)) {\n capabilities.add(\"schema\");\n }\n // `registerImporter`/`registerExporter` with `options.flags` register flag\n // metadata through the same surface as `registerFlags`, asserting the `schema`\n // capability on top of `importers` (loader `applyImportExportCommandMetadata`).\n // Mirror that guard so a flag-bearing importer/exporter derives `schema` too —\n // otherwise a least-privilege manifest synthesized from the blueprint would\n // under-grant `schema` and fail activation. `!== undefined` matches the loader's\n // exact `options.flags` guard, including an empty flag array. `entry?.` keeps a\n // malformed null array entry (from an untyped `.js`/JSON boundary) from crashing\n // derivation, consistent with the null-field robustness above.\n const importExportEntries = [...(blueprint.importers ?? []), ...(blueprint.exporters ?? [])].filter(isPresent);\n if (importExportEntries.some((entry) => entry?.options?.flags !== undefined)) {\n capabilities.add(\"schema\");\n }\n // Importers/exporters always synthesize command handlers (`<name> import` /\n // `<name> export`), so runtime capability summaries attribute them to the\n // commands surface as well as the importers surface. Keep the author-time\n // capability preview aligned with describeExtensionActivation.\n if (importExportEntries.some((entry) => typeof entry === \"object\")) {\n capabilities.add(\"commands\");\n }\n // `?? {}` keeps an explicit `hooks: null` from throwing, mirroring composeExtension.\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n if ([hooks.beforeCommand, hooks.afterCommand, hooks.onWrite, hooks.onRead, hooks.onIndex].some(hasEntries)) {\n capabilities.add(\"hooks\");\n }\n return [...capabilities].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Blueprint hook fields paired with the lifecycle kind each registers, ordered to\n * match `ExtensionActivationResult.hook_counts` (and the runtime\n * {@link ../core/extensions/activation-summary.js#describeExtensionActivation}'s\n * `hooks` ordering) so a blueprint summary's `hooks` list reads in the same\n * canonical order, not alphabetically.\n */\nconst BLUEPRINT_HOOK_FIELD_TO_KIND = [\n [\"beforeCommand\", \"before_command\"],\n [\"afterCommand\", \"after_command\"],\n [\"onWrite\", \"on_write\"],\n [\"onRead\", \"on_read\"],\n [\"onIndex\", \"on_index\"],\n] as const satisfies ReadonlyArray<readonly [keyof ExtensionBlueprintHooks, string]>;\n\n/** De-duplicate and locale-sort a list of identifiers, mirroring the runtime summary. */\nfunction sortUnique<TValue extends string>(values: readonly TValue[]): TValue[] {\n return [...new Set(values)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction isPresent<TValue>(value: TValue | null | undefined): value is TValue {\n return value !== null && value !== undefined;\n}\n\n/**\n * Compute, without activating, the exact {@link ExtensionActivationSummary} that\n * {@link composeExtension}'s generated `activate` would produce for a blueprint.\n *\n * This is the author-time inverse of the runtime\n * {@link ../core/extensions/activation-summary.js#describeExtensionActivation}:\n * the runtime verb walks an *activated* registry, while this one reads the\n * declarative {@link ExtensionBlueprint} data directly, so an author or agent can\n * preview the full named surface map (commands, overrides, handlers, hooks, item\n * types/fields, importers/exporters, search/vector adapters, parser/service/\n * renderer overrides, flag-target commands, and the preflight count) with no\n * loading, activation, or side effects. It is to the named surfaces what\n * {@link deriveExtensionCapabilities} is to the capability set.\n *\n * Fidelity is by construction: command paths are normalized with the same\n * `normalizeCommandName` the loader applies, and importer/exporter handler paths\n * are synthesized as `normalizeCommandName(\"<name> import|export\")`, exactly as\n * `registerImporter`/`registerExporter` do. A parity test pins this output equal\n * to `describeExtensionActivation` over the same composed-and-activated blueprint.\n *\n * The one surface it cannot reflect is the blueprint's optional imperative\n * `activate` escape hatch — arbitrary code a static reader cannot inspect. A\n * blueprint that registers everything through that hatch summarizes as empty.\n */\nexport function describeExtensionBlueprint(blueprint: ExtensionBlueprint): ExtensionActivationSummary {\n const commands = (blueprint.commands ?? []).filter(isPresent);\n const importers = (blueprint.importers ?? []).filter(isPresent);\n const exporters = (blueprint.exporters ?? []).filter(isPresent);\n const importerPaths = importers.map((entry) => normalizeCommandName(`${entry.name} import`));\n const exporterPaths = exporters.map((entry) => normalizeCommandName(`${entry.name} export`));\n const importerCommandDefinitionPaths = importers\n .filter((entry) => entry.options !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} import`));\n const exporterCommandDefinitionPaths = exporters\n .filter((entry) => entry.options !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} export`));\n const commandPaths = [\n ...commands.map((command) => normalizeCommandName(command.name)),\n ...importerCommandDefinitionPaths,\n ...exporterCommandDefinitionPaths,\n ];\n // A command definition with inline `flags` registers a flag target under its own\n // path in addition to any top-level `flags` record. Import/export options with\n // `flags` register through the same runtime metadata path, so union all sources.\n const flagCommands = [\n ...Object.keys(blueprint.flags ?? {}).map((command) => normalizeCommandName(command)),\n ...commands\n .filter((command) => command.flags !== undefined)\n .map((command) => normalizeCommandName(command.name)),\n ...importers\n .filter((entry) => entry.options?.flags !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} import`)),\n ...exporters\n .filter((entry) => entry.options?.flags !== undefined)\n .map((entry) => normalizeCommandName(`${entry.name} export`)),\n ];\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n\n return {\n capabilities: deriveExtensionCapabilities(blueprint),\n commands: sortUnique(commandPaths),\n command_overrides: sortUnique(Object.keys(blueprint.commandOverrides ?? {}).map((command) => normalizeCommandName(command))),\n // command_handlers is a superset of commands that also carries the synthesized\n // importer/exporter command paths, but never the override-only paths.\n command_handlers: sortUnique([...commandPaths, ...importerPaths, ...exporterPaths]),\n hooks: BLUEPRINT_HOOK_FIELD_TO_KIND.filter(([field]) => (hooks[field]?.length ?? 0) > 0).map(([, kind]) => kind),\n flag_commands: sortUnique(flagCommands),\n item_types: sortUnique((blueprint.itemTypes ?? []).map((type) => type.name)),\n item_fields: sortUnique((blueprint.itemFields ?? []).map((field) => field.name)),\n // id-less migrations register but carry no identifier, so they are omitted —\n // exactly as describeExtensionActivation drops them from its `migrations` list.\n migrations: sortUnique(\n (blueprint.migrations ?? []).flatMap((migration) => (typeof migration.id === \"string\" ? [migration.id] : [])),\n ),\n profiles: sortUnique((blueprint.profiles ?? []).map((profile) => profile.name)),\n importers: sortUnique(importers.map((entry) => normalizeCommandName(entry.name))),\n exporters: sortUnique(exporters.map((entry) => normalizeCommandName(entry.name))),\n search_providers: sortUnique((blueprint.searchProviders ?? []).map((provider) => provider.name)),\n vector_store_adapters: sortUnique((blueprint.vectorStoreAdapters ?? []).map((adapter) => adapter.name)),\n parser_overrides: sortUnique(Object.keys(blueprint.parsers ?? {}).map((command) => normalizeCommandName(command))),\n service_overrides: sortUnique(\n Object.keys(blueprint.services ?? {}).map((service) => String(service).trim().toLowerCase() as ExtensionServiceName),\n ),\n renderer_overrides: sortUnique(\n Object.keys(blueprint.renderers ?? {}).map((format) => String(format).trim().toLowerCase() as OutputRendererFormat),\n ),\n preflight_overrides: (blueprint.preflights ?? []).length,\n };\n}\n\n/**\n * The blueprint registration fields a lint flags as a dead \"empty surface\" when\n * present but empty. Mirrors {@link BlueprintRegistrationField} so adding a new\n * registration surface forces a decision here too; `hooks` is handled separately\n * because it is a nested object rather than an array/record of registrations.\n */\nconst BLUEPRINT_LINTABLE_SURFACE_FIELDS = [\n \"commands\",\n \"commandOverrides\",\n \"flags\",\n \"parsers\",\n \"renderers\",\n \"services\",\n \"preflights\",\n \"itemTypes\",\n \"itemFields\",\n \"migrations\",\n \"profiles\",\n \"searchProviders\",\n \"vectorStoreAdapters\",\n \"importers\",\n \"exporters\",\n] as const satisfies ReadonlyArray<BlueprintRegistrationField>;\n\n/** Severity of an {@link ExtensionBlueprintLintFinding}: a hard `error` (activation will fail) or an advisory `warning`. */\nexport type ExtensionBlueprintLintSeverity = \"error\" | \"warning\";\n\n/**\n * Machine-readable kind of an {@link ExtensionBlueprintLintFinding}.\n *\n * - `capability_undeclared` (error): a surface exercises a capability the declared\n * set omits; the loader throws `extension_capability_missing` at activation.\n * - `capability_unused` (warning): a declared capability no surface exercises; the\n * runtime equivalent is the `pm package doctor` `extension_capability_unused` note.\n * - `duplicate_command` (warning): the same normalized command path is declared\n * more than once in `commands`; the later registration shadows the earlier.\n * - `command_override_conflict` (warning): a path is declared as both a fresh\n * command definition and a command override.\n * - `empty_surface` (warning): a registration field is present but contributes\n * nothing — a dead declaration.\n * - `manifest_capabilities_absent` (warning): the blueprint exercises capabilities\n * but offers no declared set to reconcile against.\n */\nexport type ExtensionBlueprintLintCode =\n | \"capability_undeclared\"\n | \"capability_unused\"\n | \"duplicate_command\"\n | \"command_override_conflict\"\n | \"empty_surface\"\n | \"manifest_capabilities_absent\";\n\n/**\n * A single author-time issue {@link lintExtensionBlueprint} found in a blueprint.\n */\nexport interface ExtensionBlueprintLintFinding {\n /** The machine-readable {@link ExtensionBlueprintLintCode} for programmatic handling. */\n code: ExtensionBlueprintLintCode;\n /** Whether the finding blocks activation (`error`) or is advisory (`warning`). */\n severity: ExtensionBlueprintLintSeverity;\n /** Human-readable explanation, including the suggested fix. */\n message: string;\n /** The capability involved, for capability-drift findings. */\n capability?: ExtensionCapability;\n /** The normalized command path involved, for command findings. */\n command?: string;\n /** The blueprint field involved, for `empty_surface` findings. */\n field?: string;\n}\n\n/**\n * Options for {@link lintExtensionBlueprint} and {@link ../sdk/testing.js#assertExtensionBlueprint}.\n */\nexport interface LintExtensionBlueprintOptions {\n /**\n * The capabilities the package's `manifest.json` declares (or will), used to\n * reconcile against the surfaces the blueprint exercises. Overrides\n * `blueprint.manifest.capabilities` when both are present. Omit both to lint\n * without a capability reconciliation (only the structural checks run).\n */\n declaredCapabilities?: readonly string[];\n}\n\n/**\n * The structured result of {@link lintExtensionBlueprint}.\n */\nexport interface ExtensionBlueprintLintResult {\n /** `true` when no `error`-severity finding is present (warnings still allow activation). */\n ok: boolean;\n /** Every finding, in detection order (capability drift, duplicates, conflicts, empty surfaces). */\n findings: ExtensionBlueprintLintFinding[];\n /** The least-privilege capability set the blueprint exercises (from {@link deriveExtensionCapabilities}). */\n used: ExtensionCapability[];\n /** The normalized declared capability set reconciled against, or `null` when none was provided. */\n declared: ExtensionCapability[] | null;\n}\n\n/** Normalize a raw declared-capability list to known capabilities only (legacy-alias aware, sorted, de-duplicated). */\nfunction normalizeDeclaredCapabilities(capabilities: readonly string[]): ExtensionCapability[] {\n const known = new Set<ExtensionCapability>();\n for (const capability of capabilities) {\n // Resolve a legacy alias (e.g. migration/validation → schema) exactly as the\n // loader does before reconciliation — the author's raw manifest input has not\n // been loader-normalized yet, so failing to resolve it here would misreport an\n // alias-satisfied capability as undeclared. Fall back to a canonical known\n // name; unknown capabilities are a separate diagnostic and are dropped so a\n // typo is not misreported as \"unused\".\n const normalized = resolveLegacyExtensionCapabilityAlias(capability) ?? normalizeKnownExtensionCapability(capability);\n if (normalized !== null) {\n known.add(normalized);\n }\n }\n return [...known].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Reconcile a blueprint's exercised capabilities against its declared set: a\n * used-but-undeclared capability is an `error` (activation throws\n * `extension_capability_missing`), a declared-but-unused one a `warning`, and a\n * wholly absent declared set (`declared === null`) yields the single\n * `manifest_capabilities_absent` adoption hint.\n */\nfunction collectBlueprintCapabilityFindings(\n used: ExtensionCapability[],\n declared: ExtensionCapability[] | null,\n): ExtensionBlueprintLintFinding[] {\n const findings: ExtensionBlueprintLintFinding[] = [];\n if (declared === null) {\n if (used.length > 0) {\n findings.push({\n code: \"manifest_capabilities_absent\",\n severity: \"warning\",\n message: `Blueprint exercises ${used.length === 1 ? \"capability\" : \"capabilities\"} [${used.join(\", \")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`,\n });\n }\n return findings;\n }\n const declaredSet = new Set(declared);\n const usedSet = new Set(used);\n for (const capability of used) {\n if (!declaredSet.has(capability)) {\n findings.push({\n code: \"capability_undeclared\",\n severity: \"error\",\n message: `Blueprint exercises capability \"${capability}\" but it is absent from the declared capabilities; activation throws extension_capability_missing — add \"${capability}\" to the manifest capabilities.`,\n capability,\n });\n }\n }\n for (const capability of declared) {\n if (!usedSet.has(capability)) {\n findings.push({\n code: \"capability_unused\",\n severity: \"warning\",\n message: `Capability \"${capability}\" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,\n capability,\n });\n }\n }\n return findings;\n}\n\n/**\n * Detect structural command footguns in a blueprint: a command path declared\n * more than once (`duplicate_command`, the later registration shadowing the\n * earlier at dispatch) and a path declared both as a fresh command definition\n * and as an override (`command_override_conflict`).\n */\nfunction collectBlueprintCommandFindings(blueprint: ExtensionBlueprint): ExtensionBlueprintLintFinding[] {\n const findings: ExtensionBlueprintLintFinding[] = [];\n const commandPathCounts = new Map<string, number>();\n for (const command of blueprint.commands ?? []) {\n const path = normalizeCommandName(command.name);\n commandPathCounts.set(path, (commandPathCounts.get(path) ?? 0) + 1);\n }\n for (const [path, count] of commandPathCounts) {\n if (count > 1) {\n findings.push({\n code: \"duplicate_command\",\n severity: \"warning\",\n message: `Command \"${path}\" is declared ${count} times in commands; the later registration shadows the earlier one at dispatch.`,\n command: path,\n });\n }\n }\n const overridePaths = new Set(\n Object.keys(blueprint.commandOverrides ?? {}).map((command) => normalizeCommandName(command)),\n );\n for (const path of commandPathCounts.keys()) {\n if (overridePaths.has(path)) {\n findings.push({\n code: \"command_override_conflict\",\n severity: \"warning\",\n message: `Command \"${path}\" is declared both as a new command definition and as a command override; register one or the other.`,\n command: path,\n });\n }\n }\n return findings;\n}\n\n/**\n * Flag blueprint registration fields that are present but contribute nothing —\n * an empty array/record surface, or a `hooks` object registering no lifecycle\n * hook — each reported as an `empty_surface` warning (fields first, then hooks).\n */\nfunction collectBlueprintEmptySurfaceFindings(blueprint: ExtensionBlueprint): ExtensionBlueprintLintFinding[] {\n const findings: ExtensionBlueprintLintFinding[] = [];\n for (const field of BLUEPRINT_LINTABLE_SURFACE_FIELDS) {\n if (field in blueprint && !hasEntries(blueprint[field])) {\n findings.push({\n code: \"empty_surface\",\n severity: \"warning\",\n message: `Blueprint field \"${field}\" is present but empty; remove it or populate it.`,\n field,\n });\n }\n }\n if (\"hooks\" in blueprint) {\n const hooks: ExtensionBlueprintHooks = blueprint.hooks ?? {};\n const registersHook = [hooks.beforeCommand, hooks.afterCommand, hooks.onWrite, hooks.onRead, hooks.onIndex].some(\n hasEntries,\n );\n if (!registersHook) {\n findings.push({\n code: \"empty_surface\",\n severity: \"warning\",\n message: `Blueprint field \"hooks\" is present but registers no lifecycle hooks; remove it or populate it.`,\n field: \"hooks\",\n });\n }\n }\n return findings;\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} at author time, returning the\n * structured issues that would otherwise only surface at activation.\n *\n * It is the author-time inverse of the runtime extension guardrails — pure data\n * analysis with no loading, activation, or side effects:\n *\n * - capability drift in both directions: a capability a surface exercises but the\n * declared set omits is an `error` (the loader throws `extension_capability_missing`\n * at activation); a declared capability no surface exercises is a `warning` (the\n * author-time form of the `pm package doctor` `extension_capability_unused` note,\n * making this the static inverse of `reconcileExtensionCapabilityUsage`).\n * - structural footguns: a command path declared twice (`duplicate_command`), a\n * path declared as both a command and an override (`command_override_conflict`),\n * and a registration field present but empty (`empty_surface`).\n *\n * The declared set is taken from `options.declaredCapabilities` or, failing that,\n * `blueprint.manifest.capabilities`; with neither, capability reconciliation is\n * skipped and a single `manifest_capabilities_absent` warning suggests adopting\n * {@link deriveExtensionCapabilities}. Like {@link describeExtensionBlueprint},\n * the imperative `activate` escape hatch is invisible to this static check. The\n * findings are assembled from the per-dimension collectors\n * ({@link collectBlueprintCapabilityFindings}, {@link collectBlueprintCommandFindings},\n * {@link collectBlueprintEmptySurfaceFindings}) in that detection order.\n */\nexport function lintExtensionBlueprint(\n blueprint: ExtensionBlueprint,\n options: LintExtensionBlueprintOptions = {},\n): ExtensionBlueprintLintResult {\n const used = deriveExtensionCapabilities(blueprint);\n\n // A non-array declared source (an untyped `.js` author's malformed manifest, or\n // a missing field) is treated as \"no declared set\" rather than \"declares nothing\".\n const declaredSource = options.declaredCapabilities ?? blueprint.manifest?.capabilities;\n const declared = Array.isArray(declaredSource) ? normalizeDeclaredCapabilities(declaredSource) : null;\n\n // Findings accumulate in detection order: capability drift, then command\n // duplicates/conflicts, then empty surfaces.\n const findings: ExtensionBlueprintLintFinding[] = [\n ...collectBlueprintCapabilityFindings(used, declared),\n ...collectBlueprintCommandFindings(blueprint),\n ...collectBlueprintEmptySurfaceFindings(blueprint),\n ];\n\n return {\n ok: findings.every((finding) => finding.severity !== \"error\"),\n findings,\n used,\n declared,\n };\n}\n\n/**\n * The author-supplied identity fields {@link synthesizeExtensionManifest} cannot\n * derive from a blueprint: every {@link ExtensionManifest} field except the\n * generated `capabilities`.\n *\n * The blueprint determines `capabilities` (the surfaces it registers) and nothing\n * else, so `name`/`version`/`entry`/`priority` and any optional metadata\n * (engines, permissions, provenance, version floors/ceilings, sandbox profile,\n * manifest version, activation, legacy aliases) are the author's to supply here.\n */\nexport interface SynthesizeExtensionManifestIdentity extends Omit<ExtensionManifest, \"capabilities\"> {\n /**\n * Extra capabilities to grant beyond the blueprint's derived set, for surfaces\n * registered through the blueprint's imperative `activate` escape hatch that\n * static derivation cannot see (e.g. a renderer wired in `activate`). Each is\n * legacy-alias resolved and normalized like a declared manifest capability;\n * unknown names are dropped (the synthesized manifest is validated at load).\n */\n additionalCapabilities?: readonly string[];\n}\n\n/**\n * Generate a complete, least-privilege {@link ExtensionManifest} from a\n * declarative {@link ExtensionBlueprint} and the author's identity fields.\n *\n * This is the *generate* verb that completes the declarative authoring loop\n * (`compose → derive → describe/lint → synthesize`). Where\n * {@link defineExtensionManifest} only *types* a hand-written manifest and\n * {@link deriveExtensionCapabilities} computes only the capability set, this\n * function assembles the whole manifest: it copies every author-supplied identity\n * field verbatim and fills `capabilities` with `deriveExtensionCapabilities`\n * unioned with any {@link SynthesizeExtensionManifestIdentity.additionalCapabilities | additionalCapabilities},\n * sorted and de-duplicated. The author writes the blueprint once and never\n * hand-syncs `manifest.capabilities` — declaring nothing the extension does not\n * use and nothing it does.\n *\n * It is a pure assembler: it neither validates the blueprint definitions (that\n * stays in `api.register*` at activation) nor the identity fields (the loader\n * validates the on-disk manifest). Pair it with\n * {@link ../sdk/testing.js#assertExtensionManifestMatchesBlueprint} to guard a\n * hand-maintained `manifest.json` against drift in CI.\n */\nexport function synthesizeExtensionManifest(\n blueprint: ExtensionBlueprint,\n identity: SynthesizeExtensionManifestIdentity,\n): ExtensionManifest {\n const { additionalCapabilities, ...manifestIdentity } = identity;\n // `Array.isArray` keeps a non-array value (or an omitted field) crossing an\n // untyped boundary from crashing the spread, mirroring the rest of the SDK.\n const extra = Array.isArray(additionalCapabilities) ? normalizeDeclaredCapabilities(additionalCapabilities) : [];\n const capabilities = [...new Set<ExtensionCapability>([...deriveExtensionCapabilities(blueprint), ...extra])].sort(\n (left, right) => left.localeCompare(right),\n );\n return { ...manifestIdentity, capabilities };\n}\n\n/**\n * The two generated halves of a shippable extension package, returned by\n * {@link composeExtensionPackage}.\n */\nexport interface ExtensionPackage {\n /**\n * The runtime {@link ExtensionModule} to export as the package entry's default\n * export. Its `manifest` mirror is set to the same {@link ExtensionPackage.manifest}\n * object, so the in-module metadata and the on-disk manifest never diverge.\n */\n module: ExtensionModule;\n /**\n * The complete least-privilege {@link ExtensionManifest} to write as the\n * package's `manifest.json`, with `capabilities` derived from the blueprint.\n */\n manifest: ExtensionManifest;\n}\n\n/**\n * Assemble both halves of a shippable extension package from one declarative\n * {@link ExtensionBlueprint} and the author's identity fields — the author-once\n * capstone of the declarative loop.\n *\n * Where {@link composeExtension} produces only the runtime module and\n * {@link synthesizeExtensionManifest} produces only the manifest, this unifies\n * them: it synthesizes the complete least-privilege manifest from the blueprint\n * and identity, then composes the module with that synthesized manifest set as its\n * authoritative in-module `manifest` mirror. Both halves are therefore generated\n * from a single source and cannot drift — the module's `manifest` is the very\n * object returned as `manifest`. Export `module` as the package entry's default\n * export and write `manifest` as `manifest.json`.\n *\n * It is a pure assembler with no validation, loading, or filesystem access,\n * exactly like the two functions it composes; pair it with\n * {@link preflightExtension} (or {@link ../sdk/testing.js#assertExtensionPreflight})\n * for the author-time verify step. Use {@link mergeExtensionBlueprints} first to\n * assemble the blueprint modularly, then this to ship it.\n */\nexport function composeExtensionPackage(\n blueprint: ExtensionBlueprint,\n identity: SynthesizeExtensionManifestIdentity,\n): ExtensionPackage {\n const manifest = synthesizeExtensionManifest(blueprint, identity);\n const module = composeExtension({ ...blueprint, manifest });\n return { module, manifest };\n}\n\n/**\n * The target a {@link checkExtensionManifestCompatibility} call evaluates a\n * manifest's version bounds against.\n */\nexport interface ExtensionManifestCompatibilityTarget {\n /**\n * The pm CLI version to check the manifest against, e.g. the running CLI's\n * `version` or a version floor a package commits to supporting. Plain\n * dotted-numeric (`2026.6.23`) or `v`-prefixed values are compared; anything\n * uninterpretable yields an `unchecked` finding rather than a false verdict.\n */\n pmVersion: string;\n /**\n * How a `pm_max_version` overrun is treated, mirroring the runtime\n * `extensions.policy.pm_max_version_exceeded_mode`. `\"block\"` (the default)\n * reports an exceeded upper bound as a blocking incompatibility; `\"warn\"`\n * reports it as a non-blocking advisory, matching an operator who relaxed the\n * gate during a CLI upgrade window.\n */\n pmMaxVersionExceededMode?: PmMaxVersionExceededMode;\n}\n\n/**\n * The manifest fields {@link checkExtensionManifestCompatibility} evaluates.\n *\n * Values are intentionally `unknown` rather than `string` so an author can\n * preflight the same malformed blank/non-string bounds (e.g. read from a JSON\n * manifest) the loader's manifest parser rejects as `extension_manifest_invalid`.\n */\nexport interface ExtensionManifestCompatibilityManifest {\n /** Inclusive lower pm CLI version bound from `manifest.json`. */\n pm_min_version?: unknown;\n /** Inclusive upper pm CLI version bound from `manifest.json`. */\n pm_max_version?: unknown;\n}\n\n/**\n * The machine-readable kind of an {@link ExtensionManifestCompatibilityFinding},\n * one per `<bound>_<outcome>` the loader can reach. Each mirrors a loader\n * `extension_pm_*_version_*` warning: `*_invalid`/`*_unmet`/`*_exceeded` block the\n * load, while `*_unchecked`/`*_exceeded_warn` are advisory (the extension still\n * loads).\n */\nexport type ExtensionManifestCompatibilityCode =\n | \"pm_min_version_invalid\"\n | \"pm_min_version_unchecked\"\n | \"pm_min_version_unmet\"\n | \"pm_max_version_invalid\"\n | \"pm_max_version_unchecked\"\n | \"pm_max_version_exceeded\"\n | \"pm_max_version_exceeded_warn\";\n\n/**\n * A single version-bound issue {@link checkExtensionManifestCompatibility} found\n * when evaluating a manifest against a target pm version.\n */\nexport interface ExtensionManifestCompatibilityFinding {\n /** The machine-readable {@link ExtensionManifestCompatibilityCode} for programmatic handling. */\n code: ExtensionManifestCompatibilityCode;\n /** `error` when the bound blocks the load against the target version, `warning` when it is advisory. */\n severity: \"error\" | \"warning\";\n /** Which manifest bound produced the finding. */\n constraint: PmVersionBoundKind;\n /** The declared bound value, verbatim. */\n required: string;\n /** The target pm version the bound was evaluated against. */\n current: string;\n /** Human-readable explanation of the outcome and its effect on loading. */\n message: string;\n}\n\n/**\n * The structured result of {@link checkExtensionManifestCompatibility}.\n */\nexport interface ExtensionManifestCompatibilityResult {\n /** `true` when no `error`-severity finding blocks the load against the target version. */\n compatible: boolean;\n /** Every bound finding, lower bound before upper bound; empty when both bounds are absent or satisfied. */\n findings: ExtensionManifestCompatibilityFinding[];\n /** The target pm version the manifest was checked against, echoed back for messaging. */\n pmVersion: string;\n}\n\n/** Map a non-trivial bound evaluation to a compatibility finding, or `null` when the bound is absent or satisfied. */\nfunction toCompatibilityFinding(\n evaluation: PmVersionBoundEvaluation,\n pmVersion: string,\n): ExtensionManifestCompatibilityFinding | null {\n if (evaluation.status === \"absent\" || evaluation.status === \"ok\") {\n return null;\n }\n const code = `${evaluation.kind}_${evaluation.status}` as ExtensionManifestCompatibilityCode;\n let message: string;\n switch (code) {\n case \"pm_min_version_invalid\":\n message = `pm_min_version \"${evaluation.required}\" is not a valid version; the extension is treated as incompatible and the loader skips it.`;\n break;\n case \"pm_min_version_unchecked\":\n message = `pm_min_version \"${evaluation.required}\" could not be compared against pm ${pmVersion}; compatibility is unverified.`;\n break;\n case \"pm_min_version_unmet\":\n message = `Requires pm >= ${evaluation.required} but the target is pm ${pmVersion}; the loader skips the extension.`;\n break;\n case \"pm_max_version_invalid\":\n message = `pm_max_version \"${evaluation.required}\" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;\n break;\n case \"pm_max_version_unchecked\":\n message = `pm_max_version \"${evaluation.required}\" could not be compared against pm ${pmVersion}; compatibility is unverified.`;\n break;\n case \"pm_max_version_exceeded\":\n message = `Allows pm <= ${evaluation.required} but the target is pm ${pmVersion}; the loader skips the extension.`;\n break;\n case \"pm_max_version_exceeded_warn\":\n message = `Target pm ${pmVersion} is newer than pm_max_version ${evaluation.required}, but the \"warn\" exceeded mode lets it load with a warning.`;\n break;\n }\n return {\n code,\n severity: evaluation.allowed ? \"warning\" : \"error\",\n constraint: evaluation.kind,\n required: evaluation.required,\n current: pmVersion,\n message,\n };\n}\n\n/**\n * Check, without loading anything, whether an extension manifest's declared\n * version bounds permit it to load on a given pm CLI version.\n *\n * This is the author-time inverse of the loader's runtime version gate: where the\n * loader resolves the *installed* CLI version (asynchronously, from `package.json`)\n * and emits `extension_pm_*_version_*` warnings, this pure synchronous function\n * takes the {@link ExtensionManifestCompatibilityTarget.pmVersion | target version}\n * the author supplies and returns structured findings. Both share the\n * {@link ../core/extensions/version-compat.js | version-compat core}, so the\n * author-time verdict and the runtime decision agree by construction — a package\n * author can pin a CI test to the pm version they support and catch a too-tight\n * `pm_min_version`, a malformed `pm_max_version`, or an upper bound a newer CLI\n * would exceed, long before publishing.\n *\n * `compatible` is `true` only when no bound blocks the load (`*_invalid`,\n * `*_unmet`, and a `block`-mode `*_exceeded`); `*_unchecked` (an uninterpretable\n * bound or target) and a `warn`-mode `*_exceeded_warn` are advisory `warning`\n * findings that still load. Pair it with\n * {@link ../sdk/testing.js#assertExtensionManifestCompatible} to fail CI on a\n * blocking incompatibility.\n */\nexport function checkExtensionManifestCompatibility(\n manifest: ExtensionManifestCompatibilityManifest,\n target: ExtensionManifestCompatibilityTarget,\n): ExtensionManifestCompatibilityResult {\n const minEvaluation = evaluatePmMinVersionBound(manifest.pm_min_version, target.pmVersion);\n const maxEvaluation = evaluatePmMaxVersionBound(\n manifest.pm_max_version,\n target.pmVersion,\n target.pmMaxVersionExceededMode ?? \"block\",\n );\n const findings: ExtensionManifestCompatibilityFinding[] = [];\n const minFinding = toCompatibilityFinding(minEvaluation, target.pmVersion);\n if (minFinding !== null) {\n findings.push(minFinding);\n }\n const maxFinding = toCompatibilityFinding(maxEvaluation, target.pmVersion);\n if (maxFinding !== null) {\n findings.push(maxFinding);\n }\n return {\n compatible: minEvaluation.allowed && maxEvaluation.allowed,\n findings,\n pmVersion: target.pmVersion,\n };\n}\n\n/**\n * The lint codes whose verdict depends on the *declared* capability set rather\n * than the blueprint's structure. {@link preflightExtension} drops these from its\n * consolidated view when it synthesizes the manifest from an `identity` without an\n * explicit declared set, because the synthesized manifest — not the blueprint's\n * stale in-module `manifest` mirror — is what the package ships, so a drift against\n * the mirror is a false positive. Structural codes (`duplicate_command`,\n * `command_override_conflict`, `empty_surface`) are never suppressed.\n */\nconst CAPABILITY_DRIFT_LINT_CODES = new Set<ExtensionBlueprintLintCode>([\n \"capability_undeclared\",\n \"capability_unused\",\n \"manifest_capabilities_absent\",\n]);\n\n/**\n * Options for {@link preflightExtension} and\n * {@link ../sdk/testing.js#assertExtensionPreflight}. Every field is optional:\n * each one a check enables, so an author opts into exactly the stages whose\n * inputs they can supply.\n */\nexport interface PreflightExtensionOptions {\n /**\n * The author-supplied identity fields the blueprint cannot determine\n * (`name`/`version`/`entry`/`priority`, version bounds, etc.). Provide them to\n * have preflight {@link synthesizeExtensionManifest | synthesize} the complete\n * least-privilege manifest and include it in the report; the synthesized\n * version bounds then feed the {@link PreflightExtensionOptions.target | target}\n * compatibility check. Omit to skip manifest synthesis.\n */\n identity?: SynthesizeExtensionManifestIdentity;\n /**\n * The pm CLI version (and optional max-version overrun mode) to evaluate the\n * manifest's `pm_min_version`/`pm_max_version` bounds against. Provide it to run\n * {@link checkExtensionManifestCompatibility} against the synthesized manifest\n * (or, absent an `identity`, the blueprint's in-module `manifest` mirror). Omit\n * to skip the version-compatibility check.\n */\n target?: ExtensionManifestCompatibilityTarget;\n /**\n * The capabilities the package's `manifest.json` declares, reconciled against\n * the surfaces the blueprint exercises. Passed straight to\n * {@link lintExtensionBlueprint}; when omitted it falls back to\n * `blueprint.manifest.capabilities`, so the blueprint's in-module mirror is\n * linted by default.\n */\n declaredCapabilities?: readonly string[];\n}\n\n/** Which preflight stage produced an {@link ExtensionPreflightFinding}. */\nexport type ExtensionPreflightFindingSource = \"blueprint\" | \"compatibility\";\n\n/**\n * A single finding in an {@link ExtensionPreflightReport}, flattened from one of\n * the underlying stages and tagged with its {@link ExtensionPreflightFindingSource}\n * so a consolidated report stays traceable to the check that raised it.\n */\nexport interface ExtensionPreflightFinding {\n /** The stage that produced the finding: blueprint lint or version compatibility. */\n source: ExtensionPreflightFindingSource;\n /** Whether the finding blocks publish/activation (`error`) or is advisory (`warning`). */\n severity: ExtensionBlueprintLintSeverity;\n /** The underlying stage's machine-readable code, for programmatic handling. */\n code: ExtensionBlueprintLintCode | ExtensionManifestCompatibilityCode;\n /** The underlying stage's human-readable explanation, verbatim. */\n message: string;\n}\n\n/**\n * The consolidated result of {@link preflightExtension}: every author-time stage's\n * structured output plus a flattened, source-tagged finding list.\n */\nexport interface ExtensionPreflightReport {\n /** `true` when no `error`-severity finding appears across any stage (warnings still pass). */\n ok: boolean;\n /** The least-privilege capability set the blueprint exercises (from {@link deriveExtensionCapabilities}). */\n capabilities: ExtensionCapability[];\n /** The full {@link lintExtensionBlueprint} result (structural + capability-drift findings). */\n blueprint: ExtensionBlueprintLintResult;\n /** The manifest synthesized from `options.identity`, or `null` when no identity was supplied. */\n manifest: ExtensionManifest | null;\n /** The {@link checkExtensionManifestCompatibility} result, or `null` when no `options.target` was supplied. */\n compatibility: ExtensionManifestCompatibilityResult | null;\n /**\n * Every finding from all stages, blueprint-lint findings before compatibility\n * findings, each tagged by `source`. This is the consolidated, curated view: when\n * `options.identity` synthesizes the manifest without an explicit\n * `declaredCapabilities` set, capability-drift findings the lint raised against the\n * blueprint's now-superseded in-module `manifest` mirror are omitted here (the raw\n * `blueprint` result still carries them).\n */\n findings: ExtensionPreflightFinding[];\n}\n\n/**\n * Preflight a declarative {@link ExtensionBlueprint} through every author-time\n * check in one call, returning a single consolidated {@link ExtensionPreflightReport}.\n *\n * This is the author-time capstone — the static analog of\n * {@link ../sdk/testing.js#createExtensionTestHarness}, which unified the\n * runtime-test helpers. Instead of chaining {@link lintExtensionBlueprint},\n * {@link synthesizeExtensionManifest}, and {@link checkExtensionManifestCompatibility}\n * (and reconciling their separate results) before publishing a package, an author\n * runs `preflightExtension(blueprint, { identity, target })` and reads one report:\n *\n * - the blueprint is always linted (structural footguns + capability drift);\n * - when `options.identity` is given, the complete least-privilege manifest is\n * synthesized and returned, so the author never hand-syncs `capabilities`;\n * - when `options.target` is given, the synthesized manifest's version bounds\n * (or, absent an identity, the blueprint's in-module `manifest` mirror) are\n * checked against that pm version.\n *\n * It is pure and side-effect-free — no loading, activation, or filesystem access,\n * exactly like the stages it composes — so it is safe in any author-time or CI\n * context. The per-stage structured results are exposed unmodified\n * (`report.blueprint`/`manifest`/`compatibility`) alongside the flattened,\n * source-tagged `report.findings`; `report.ok` is `false` if any stage produced an\n * `error`-severity finding. The flattened `findings` are curated for the author-once\n * flow: once an `identity` synthesizes the manifest (and no explicit\n * `declaredCapabilities` was pinned), the synthesized manifest — not the blueprint's\n * in-module `manifest` mirror — is what ships, so capability-drift findings the lint\n * raised against that mirror are false positives and are omitted from\n * `report.findings` (the raw `report.blueprint` result still reports them). Pair it\n * with {@link ../sdk/testing.js#assertExtensionPreflight} to fail CI in one line.\n */\nexport function preflightExtension(\n blueprint: ExtensionBlueprint,\n options: PreflightExtensionOptions = {},\n): ExtensionPreflightReport {\n const blueprintResult = lintExtensionBlueprint(blueprint, { declaredCapabilities: options.declaredCapabilities });\n const manifest = options.identity ? synthesizeExtensionManifest(blueprint, options.identity) : null;\n // Compatibility evaluates the bounds the package will ship: the synthesized\n // manifest when an identity drives generation, else the blueprint's in-module\n // manifest mirror, else an empty manifest (no bounds → trivially compatible).\n const compatibility = options.target\n ? checkExtensionManifestCompatibility(manifest ?? blueprint.manifest ?? {}, options.target)\n : null;\n // When preflight synthesizes the manifest from an identity (and the caller did not\n // pin an explicit declaredCapabilities set), the blueprint lint reconciled against\n // the blueprint's in-module `manifest` mirror — which the synthesized manifest\n // supersedes. Capability-drift findings against that stale mirror are false\n // positives in the consolidated view (a missing capability would even flip `ok` to\n // false though the synthesized manifest declares it), so drop them; structural\n // findings are unaffected and the raw lint result on `report.blueprint` keeps all of\n // them. An explicit declaredCapabilities set is a deliberate \"check exactly this\"\n // request, so it is never suppressed.\n const suppressCapabilityDrift = manifest !== null && options.declaredCapabilities === undefined;\n const blueprintFindings = suppressCapabilityDrift\n ? blueprintResult.findings.filter((finding) => !CAPABILITY_DRIFT_LINT_CODES.has(finding.code))\n : blueprintResult.findings;\n const findings: ExtensionPreflightFinding[] = [\n ...blueprintFindings.map(\n (finding): ExtensionPreflightFinding => ({\n source: \"blueprint\",\n severity: finding.severity,\n code: finding.code,\n message: finding.message,\n }),\n ),\n ...(compatibility?.findings ?? []).map(\n (finding): ExtensionPreflightFinding => ({\n source: \"compatibility\",\n severity: finding.severity,\n code: finding.code,\n message: finding.message,\n }),\n ),\n ];\n return {\n ok: findings.every((finding) => finding.severity !== \"error\"),\n capabilities: blueprintResult.used,\n blueprint: blueprintResult,\n manifest,\n compatibility,\n findings,\n };\n}\n"],"names":[],"mappings":";;AAyDA,OAAO,EACL,iCAAiC,EACjC,qCAAqC,GACtC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAG1B,MAAM,sCAAsC,CAAC;AA4B9C;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAkC,MAAe;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC;AAwGD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB,CAAwC,SAAqB;IACnG,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,SAAS,gCAAgC,CAAC,GAAiB,EAAE,SAA6B;IACxF,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QAC/C,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IACD,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,IAAI,EAAE,CAAC,EAAE,CAAC;QACnF,GAAG,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IACD,KAAK,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAA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AAC,OAAO;SACzB,CAAC,CACH;QACD,GAAG,CAAC,aAAa,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CACpC,CAAC,OAAO,EAA6B,EAAE,CAAC,CAAC;YACvC,MAAM,EAAE,eAAe;YACvB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC,CACH;KACF,CAAC;IACF,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;QAC7D,YAAY,EAAE,eAAe,CAAC,IAAI;QAClC,SAAS,EAAE,eAAe;QAC1B,QAAQ;QACR,aAAa;QACb,QAAQ;KACT,CAAC;AACJ,CAAC","debugId":"ef101a7b-f751-5242-8a7b-099f2a969a46"}
@@ -33,6 +33,7 @@
33
33
  * declared function type.
34
34
  */
35
35
  import type { AfterCommandHook, BeforeCommandHook, CommandDefinition, CommandOverride, Exporter, ExtensionManifest, FlagDefinition, Importer, OnIndexHook, OnReadHook, OnWriteHook, ParserOverride, PreflightOverride, RendererOverride, SchemaFieldDefinition, SchemaItemTypeDefinition, SchemaMigrationDefinition, SearchProviderDefinition, ServiceOverride, VectorStoreAdapterDefinition } from "../core/extensions/loader.js";
36
+ import type { ProjectProfileDefinition } from "../core/profile/profile-presets.js";
36
37
  /**
37
38
  * Type an extension's in-module manifest mirror (the `manifest` export / field).
38
39
  *
@@ -44,6 +45,19 @@ import type { AfterCommandHook, BeforeCommandHook, CommandDefinition, CommandOve
44
45
  * to keep `capabilities` matched to the surfaces the extension actually registers.
45
46
  */
46
47
  export declare function defineExtensionManifest<TManifest extends ExtensionManifest>(manifest: TManifest): TManifest;
48
+ /**
49
+ * Type a project-profile definition for the profile registry.
50
+ *
51
+ * A profile bundles item types, statuses, fields, per-type workflows, config
52
+ * knobs, create templates, and package recommendations into one declarative
53
+ * archetype that `pm profile apply` stages idempotently. This builder checks the
54
+ * object against {@link ProjectProfileDefinition} where it is authored — catching
55
+ * an invalid field type or a malformed workflow at edit time — while preserving
56
+ * the literal `name`/`types`/`statuses` so a package's archetype stays strongly
57
+ * typed at the definition site, mirroring {@link defineItemType}. It is the
58
+ * authoring anchor a first-party or third-party profile package builds on.
59
+ */
60
+ export declare function defineProjectProfile<TProfile extends ProjectProfileDefinition>(profile: TProfile): TProfile;
47
61
  /**
48
62
  * Type a command definition for `api.registerCommand(definition)`.
49
63
  *
@@ -9,10 +9,25 @@
9
9
  * to keep `capabilities` matched to the surfaces the extension actually registers.
10
10
  */
11
11
 
12
- !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]="20a69cdc-ebc4-5a43-8701-0a5c867f8229")}catch(e){}}();
12
+ !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]="05cec702-a7e9-5a6c-8843-546559e31dc9")}catch(e){}}();
13
13
  export function defineExtensionManifest(manifest) {
14
14
  return manifest;
15
15
  }
16
+ /**
17
+ * Type a project-profile definition for the profile registry.
18
+ *
19
+ * A profile bundles item types, statuses, fields, per-type workflows, config
20
+ * knobs, create templates, and package recommendations into one declarative
21
+ * archetype that `pm profile apply` stages idempotently. This builder checks the
22
+ * object against {@link ProjectProfileDefinition} where it is authored — catching
23
+ * an invalid field type or a malformed workflow at edit time — while preserving
24
+ * the literal `name`/`types`/`statuses` so a package's archetype stays strongly
25
+ * typed at the definition site, mirroring {@link defineItemType}. It is the
26
+ * authoring anchor a first-party or third-party profile package builds on.
27
+ */
28
+ export function defineProjectProfile(profile) {
29
+ return profile;
30
+ }
16
31
  /**
17
32
  * Type a command definition for `api.registerCommand(definition)`.
18
33
  *
@@ -201,4 +216,4 @@ export function defineOnIndexHook(hook) {
201
216
  return hook;
202
217
  }
203
218
  //# sourceMappingURL=define.js.map
204
- //# debugId=20a69cdc-ebc4-5a43-8701-0a5c867f8229
219
+ //# debugId=05cec702-a7e9-5a6c-8843-546559e31dc9
@@ -1 +1 @@
1
- {"version":3,"file":"define.js","sources":["sdk/define.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/define\n *\n * Authoring-time typed builders for every extension registration surface.\n *\n * These `define*` helpers are the third leg of the SDK ergonomics tripod:\n * {@link ../core/extensions/loader.js#ExtensionApi | `api.register*`} registers\n * a definition at activation, the `assert*`/`run*` testing helpers verify and\n * invoke it, and these builders let authors *write* the definition with full\n * type-checking and editor inference before it ever reaches `activate`.\n *\n * Every builder is a zero-cost identity function that returns its argument\n * unchanged — exactly like the SDK's {@link ./index.js#defineExtension} and the\n * wider `defineConfig`/`defineComponent` ecosystem convention. Extensions are\n * authored fully in TypeScript (ADR pm-2c28); these builders are where that type\n * safety is anchored at the definition site. Their value is entirely at the type\n * level:\n *\n * - A bare `const cmd = { ... }` satisfies the registration type only\n * structurally and widens its literals; `const cmd = defineCommand({ ... })`\n * checks the object against the contract *and* preserves the narrow literal\n * type, while inferring the nested handler's `context` parameter from the\n * builder signature.\n * - Definitions can be colocated, exported, reused, and unit-tested apart from\n * the `activate` call instead of being trapped as inline literals.\n *\n * Object-definition builders use a generic constraint (`<T extends Def>`) so the\n * narrow literal type survives the round-trip, mirroring `defineExtension`.\n * Function-definition builders are intentionally non-generic: a generic\n * constrained to a whole function type suppresses contextual typing of a bare\n * arrow's parameter (it would fall back to implicit `any`), whereas the\n * non-generic signature lets TypeScript type the handler parameter from the\n * declared function type.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n Exporter,\n ExtensionManifest,\n FlagDefinition,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\n\n/**\n * Type an extension's in-module manifest mirror (the `manifest` export / field).\n *\n * Completes the `define*` family: the manifest is the one authoring surface that\n * otherwise had no builder. Contract-checks the object against\n * {@link ExtensionManifest} where it is authored, catching a missing required\n * field or a mistyped key at edit time instead of at load time. Pair with\n * {@link ./compose.js#deriveExtensionCapabilities | `deriveExtensionCapabilities`}\n * to keep `capabilities` matched to the surfaces the extension actually registers.\n */\nexport function defineExtensionManifest<TManifest extends ExtensionManifest>(manifest: TManifest): TManifest {\n return manifest;\n}\n\n/**\n * Type a command definition for `api.registerCommand(definition)`.\n *\n * Checks the object against {@link CommandDefinition} and infers the `run`\n * handler's `context` parameter while preserving the literal `name`/`action`\n * types. Pass the result straight to `registerCommand`, or export it so the\n * command can be invoked in tests via `runRegisteredCommandForTest`.\n */\nexport function defineCommand<TDefinition extends CommandDefinition>(definition: TDefinition): TDefinition {\n return definition;\n}\n\n/**\n * Type a single flag definition for a `api.registerFlags(command, flags)` array.\n *\n * Authors compose builders into the array\n * (`api.registerFlags(\"list\", [defineFlag({ long: \"--mine\" })])`) to get\n * per-flag contract checking — `value_type`, `list`, and `default` included —\n * instead of validating a loosely-typed literal array all at once.\n */\nexport function defineFlag<TFlag extends FlagDefinition>(flag: TFlag): TFlag {\n return flag;\n}\n\n/**\n * Type a custom item-type definition for `api.registerItemTypes([...])`.\n *\n * Preserves the literal `name`/`folder`/`aliases` so a project archetype's\n * domain types stay strongly typed where the definition is declared and reused.\n */\nexport function defineItemType<TType extends SchemaItemTypeDefinition>(type: TType): TType {\n return type;\n}\n\n/**\n * Type a custom front-matter field definition for `api.registerItemFields([...])`.\n *\n * Checks `name`/`type`/`optional` against {@link SchemaFieldDefinition} while\n * keeping the field's extra metadata (the contract carries an index signature)\n * intact.\n */\nexport function defineItemField<TField extends SchemaFieldDefinition>(field: TField): TField {\n return field;\n}\n\n/**\n * Type a schema migration definition for `api.registerMigration(definition)`.\n *\n * Preserves the literal `id` and, when `run` is provided, infers the migration\n * runner's context, so the same definition can be registered and later exercised\n * through `runRegisteredMigrationForTest`.\n */\nexport function defineMigration<TMigration extends SchemaMigrationDefinition>(migration: TMigration): TMigration {\n return migration;\n}\n\n/**\n * Type a search-provider definition for `api.registerSearchProvider(provider)`.\n *\n * Infers the `query`/`embed`/`embedBatch` operation contexts and result shapes\n * so a custom retrieval backend is type-checked at the definition site and\n * reusable in `runRegisteredSearchProviderForTest`.\n */\nexport function defineSearchProvider<TProvider extends SearchProviderDefinition>(provider: TProvider): TProvider {\n return provider;\n}\n\n/**\n * Type a vector-store adapter definition for `api.registerVectorStoreAdapter(adapter)`.\n *\n * Infers the `query`/`upsert`/`delete` operation contexts so a package that owns\n * its own semantic index storage gets contract checking before activation and a\n * definition it can drive through `runRegisteredVectorStoreAdapterForTest`.\n */\nexport function defineVectorStoreAdapter<TAdapter extends VectorStoreAdapterDefinition>(adapter: TAdapter): TAdapter {\n return adapter;\n}\n\n/**\n * Type a command-override handler for `api.registerCommand(command, override)`.\n *\n * The non-generic signature lets TypeScript contextually type the override's\n * `context` parameter from {@link CommandOverride}, so a bare arrow authored in\n * a `.js` package still gets a fully-typed argument.\n */\nexport function defineCommandOverride(override: CommandOverride): CommandOverride {\n return override;\n}\n\n/**\n * Type a parser-override handler for `api.registerParser(command, override)`.\n *\n * Contextually types the `context` parameter and the returned\n * {@link ParserOverride} delta so an argument-rewriting override is checked\n * where it is written.\n */\nexport function defineParserOverride(override: ParserOverride): ParserOverride {\n return override;\n}\n\n/**\n * Type a preflight-override handler for `api.registerPreflight(override)`.\n *\n * Contextually types the `context` parameter and the returned gate decision so a\n * package's pre-run validation override is checked at the definition site.\n */\nexport function definePreflightOverride(override: PreflightOverride): PreflightOverride {\n return override;\n}\n\n/**\n * Type a service-override handler for `api.registerService(service, override)`.\n *\n * Contextually types the `context` parameter from {@link ServiceOverride} so a\n * package overriding a built-in service (output formatting, embeddings, and the\n * like) keeps its handler argument typed without an explicit annotation.\n */\nexport function defineServiceOverride(override: ServiceOverride): ServiceOverride {\n return override;\n}\n\n/**\n * Type a renderer-override handler for `api.registerRenderer(format, renderer)`.\n *\n * Contextually types the `context` parameter and the `string | null | undefined`\n * return contract so a custom output renderer is checked where it is authored.\n */\nexport function defineRendererOverride(renderer: RendererOverride): RendererOverride {\n return renderer;\n}\n\n/**\n * Type an importer handler for `api.registerImporter(name, importer, options)`.\n *\n * Contextually types the {@link Importer} `context` (registration, args,\n * options, pm root) so the bridge from an external system into the pm context\n * graph is type-checked and reusable in `runRegisteredImporterForTest`.\n */\nexport function defineImporter(importer: Importer): Importer {\n return importer;\n}\n\n/**\n * Type an exporter handler for `api.registerExporter(name, exporter, options)`.\n *\n * Contextually types the {@link Exporter} `context` so the bridge from the pm\n * context graph out to an external system is checked at the definition site and\n * reusable in `runRegisteredExporterForTest`.\n */\nexport function defineExporter(exporter: Exporter): Exporter {\n return exporter;\n}\n\n/**\n * Type a `before_command` hook for `api.hooks.beforeCommand(hook)`.\n *\n * Contextually types the {@link BeforeCommandHook} `context` so a hook that\n * inspects or annotates a command before it runs keeps its argument typed when\n * authored as a standalone, exportable, testable value.\n */\nexport function defineBeforeCommandHook(hook: BeforeCommandHook): BeforeCommandHook {\n return hook;\n}\n\n/**\n * Type an `after_command` hook for `api.hooks.afterCommand(hook)`.\n *\n * Contextually types the {@link AfterCommandHook} `context` — including the\n * `affected` items pm mutated — so the natural place to react to every change\n * (\"project management = context management\") is checked where it is written.\n */\nexport function defineAfterCommandHook(hook: AfterCommandHook): AfterCommandHook {\n return hook;\n}\n\n/**\n * Type an `on_write` hook for `api.hooks.onWrite(hook)`.\n *\n * Contextually types the {@link OnWriteHook} `context` so a hook reacting to\n * item persistence keeps its argument typed without an explicit annotation.\n */\nexport function defineOnWriteHook(hook: OnWriteHook): OnWriteHook {\n return hook;\n}\n\n/**\n * Type an `on_read` hook for `api.hooks.onRead(hook)`.\n *\n * Contextually types the {@link OnReadHook} `context` so a hook augmenting items\n * as they are read is type-checked at the definition site.\n */\nexport function defineOnReadHook(hook: OnReadHook): OnReadHook {\n return hook;\n}\n\n/**\n * Type an `on_index` hook for `api.hooks.onIndex(hook)`.\n *\n * Contextually types the {@link OnIndexHook} `context` so a hook participating\n * in index/search refresh keeps its argument typed even without TypeScript\n * annotations.\n */\nexport function defineOnIndexHook(hook: OnIndexHook): OnIndexHook {\n return hook;\n}\n"],"names":[],"mappings":"AAyDA;;;;;;;;;GASG;;;AACH,MAAM,UAAU,uBAAuB,CAAsC,QAAmB;IAC9F,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAwC,UAAuB;IAC1F,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAA+B,IAAW;IAClE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAyC,IAAW;IAChF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAuC,KAAa;IACjF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAA+C,SAAqB;IACjG,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAA6C,QAAmB;IAClG,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAgD,OAAiB;IACvG,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAyB;IAC7D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAwB;IAC3D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAyB;IAC7D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAA0B;IAC/D,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,QAAkB;IAC/C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,QAAkB;IAC/C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAuB;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAsB;IAC3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAiB;IACjD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgB;IAC/C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAiB;IACjD,OAAO,IAAI,CAAC;AACd,CAAC","debugId":"20a69cdc-ebc4-5a43-8701-0a5c867f8229"}
1
+ {"version":3,"file":"define.js","sources":["sdk/define.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/define\n *\n * Authoring-time typed builders for every extension registration surface.\n *\n * These `define*` helpers are the third leg of the SDK ergonomics tripod:\n * {@link ../core/extensions/loader.js#ExtensionApi | `api.register*`} registers\n * a definition at activation, the `assert*`/`run*` testing helpers verify and\n * invoke it, and these builders let authors *write* the definition with full\n * type-checking and editor inference before it ever reaches `activate`.\n *\n * Every builder is a zero-cost identity function that returns its argument\n * unchanged — exactly like the SDK's {@link ./index.js#defineExtension} and the\n * wider `defineConfig`/`defineComponent` ecosystem convention. Extensions are\n * authored fully in TypeScript (ADR pm-2c28); these builders are where that type\n * safety is anchored at the definition site. Their value is entirely at the type\n * level:\n *\n * - A bare `const cmd = { ... }` satisfies the registration type only\n * structurally and widens its literals; `const cmd = defineCommand({ ... })`\n * checks the object against the contract *and* preserves the narrow literal\n * type, while inferring the nested handler's `context` parameter from the\n * builder signature.\n * - Definitions can be colocated, exported, reused, and unit-tested apart from\n * the `activate` call instead of being trapped as inline literals.\n *\n * Object-definition builders use a generic constraint (`<T extends Def>`) so the\n * narrow literal type survives the round-trip, mirroring `defineExtension`.\n * Function-definition builders are intentionally non-generic: a generic\n * constrained to a whole function type suppresses contextual typing of a bare\n * arrow's parameter (it would fall back to implicit `any`), whereas the\n * non-generic signature lets TypeScript type the handler parameter from the\n * declared function type.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n Exporter,\n ExtensionManifest,\n FlagDefinition,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ProjectProfileDefinition } from \"../core/profile/profile-presets.js\";\n\n/**\n * Type an extension's in-module manifest mirror (the `manifest` export / field).\n *\n * Completes the `define*` family: the manifest is the one authoring surface that\n * otherwise had no builder. Contract-checks the object against\n * {@link ExtensionManifest} where it is authored, catching a missing required\n * field or a mistyped key at edit time instead of at load time. Pair with\n * {@link ./compose.js#deriveExtensionCapabilities | `deriveExtensionCapabilities`}\n * to keep `capabilities` matched to the surfaces the extension actually registers.\n */\nexport function defineExtensionManifest<TManifest extends ExtensionManifest>(manifest: TManifest): TManifest {\n return manifest;\n}\n\n/**\n * Type a project-profile definition for the profile registry.\n *\n * A profile bundles item types, statuses, fields, per-type workflows, config\n * knobs, create templates, and package recommendations into one declarative\n * archetype that `pm profile apply` stages idempotently. This builder checks the\n * object against {@link ProjectProfileDefinition} where it is authored — catching\n * an invalid field type or a malformed workflow at edit time — while preserving\n * the literal `name`/`types`/`statuses` so a package's archetype stays strongly\n * typed at the definition site, mirroring {@link defineItemType}. It is the\n * authoring anchor a first-party or third-party profile package builds on.\n */\nexport function defineProjectProfile<TProfile extends ProjectProfileDefinition>(profile: TProfile): TProfile {\n return profile;\n}\n\n/**\n * Type a command definition for `api.registerCommand(definition)`.\n *\n * Checks the object against {@link CommandDefinition} and infers the `run`\n * handler's `context` parameter while preserving the literal `name`/`action`\n * types. Pass the result straight to `registerCommand`, or export it so the\n * command can be invoked in tests via `runRegisteredCommandForTest`.\n */\nexport function defineCommand<TDefinition extends CommandDefinition>(definition: TDefinition): TDefinition {\n return definition;\n}\n\n/**\n * Type a single flag definition for a `api.registerFlags(command, flags)` array.\n *\n * Authors compose builders into the array\n * (`api.registerFlags(\"list\", [defineFlag({ long: \"--mine\" })])`) to get\n * per-flag contract checking — `value_type`, `list`, and `default` included —\n * instead of validating a loosely-typed literal array all at once.\n */\nexport function defineFlag<TFlag extends FlagDefinition>(flag: TFlag): TFlag {\n return flag;\n}\n\n/**\n * Type a custom item-type definition for `api.registerItemTypes([...])`.\n *\n * Preserves the literal `name`/`folder`/`aliases` so a project archetype's\n * domain types stay strongly typed where the definition is declared and reused.\n */\nexport function defineItemType<TType extends SchemaItemTypeDefinition>(type: TType): TType {\n return type;\n}\n\n/**\n * Type a custom front-matter field definition for `api.registerItemFields([...])`.\n *\n * Checks `name`/`type`/`optional` against {@link SchemaFieldDefinition} while\n * keeping the field's extra metadata (the contract carries an index signature)\n * intact.\n */\nexport function defineItemField<TField extends SchemaFieldDefinition>(field: TField): TField {\n return field;\n}\n\n/**\n * Type a schema migration definition for `api.registerMigration(definition)`.\n *\n * Preserves the literal `id` and, when `run` is provided, infers the migration\n * runner's context, so the same definition can be registered and later exercised\n * through `runRegisteredMigrationForTest`.\n */\nexport function defineMigration<TMigration extends SchemaMigrationDefinition>(migration: TMigration): TMigration {\n return migration;\n}\n\n/**\n * Type a search-provider definition for `api.registerSearchProvider(provider)`.\n *\n * Infers the `query`/`embed`/`embedBatch` operation contexts and result shapes\n * so a custom retrieval backend is type-checked at the definition site and\n * reusable in `runRegisteredSearchProviderForTest`.\n */\nexport function defineSearchProvider<TProvider extends SearchProviderDefinition>(provider: TProvider): TProvider {\n return provider;\n}\n\n/**\n * Type a vector-store adapter definition for `api.registerVectorStoreAdapter(adapter)`.\n *\n * Infers the `query`/`upsert`/`delete` operation contexts so a package that owns\n * its own semantic index storage gets contract checking before activation and a\n * definition it can drive through `runRegisteredVectorStoreAdapterForTest`.\n */\nexport function defineVectorStoreAdapter<TAdapter extends VectorStoreAdapterDefinition>(adapter: TAdapter): TAdapter {\n return adapter;\n}\n\n/**\n * Type a command-override handler for `api.registerCommand(command, override)`.\n *\n * The non-generic signature lets TypeScript contextually type the override's\n * `context` parameter from {@link CommandOverride}, so a bare arrow authored in\n * a `.js` package still gets a fully-typed argument.\n */\nexport function defineCommandOverride(override: CommandOverride): CommandOverride {\n return override;\n}\n\n/**\n * Type a parser-override handler for `api.registerParser(command, override)`.\n *\n * Contextually types the `context` parameter and the returned\n * {@link ParserOverride} delta so an argument-rewriting override is checked\n * where it is written.\n */\nexport function defineParserOverride(override: ParserOverride): ParserOverride {\n return override;\n}\n\n/**\n * Type a preflight-override handler for `api.registerPreflight(override)`.\n *\n * Contextually types the `context` parameter and the returned gate decision so a\n * package's pre-run validation override is checked at the definition site.\n */\nexport function definePreflightOverride(override: PreflightOverride): PreflightOverride {\n return override;\n}\n\n/**\n * Type a service-override handler for `api.registerService(service, override)`.\n *\n * Contextually types the `context` parameter from {@link ServiceOverride} so a\n * package overriding a built-in service (output formatting, embeddings, and the\n * like) keeps its handler argument typed without an explicit annotation.\n */\nexport function defineServiceOverride(override: ServiceOverride): ServiceOverride {\n return override;\n}\n\n/**\n * Type a renderer-override handler for `api.registerRenderer(format, renderer)`.\n *\n * Contextually types the `context` parameter and the `string | null | undefined`\n * return contract so a custom output renderer is checked where it is authored.\n */\nexport function defineRendererOverride(renderer: RendererOverride): RendererOverride {\n return renderer;\n}\n\n/**\n * Type an importer handler for `api.registerImporter(name, importer, options)`.\n *\n * Contextually types the {@link Importer} `context` (registration, args,\n * options, pm root) so the bridge from an external system into the pm context\n * graph is type-checked and reusable in `runRegisteredImporterForTest`.\n */\nexport function defineImporter(importer: Importer): Importer {\n return importer;\n}\n\n/**\n * Type an exporter handler for `api.registerExporter(name, exporter, options)`.\n *\n * Contextually types the {@link Exporter} `context` so the bridge from the pm\n * context graph out to an external system is checked at the definition site and\n * reusable in `runRegisteredExporterForTest`.\n */\nexport function defineExporter(exporter: Exporter): Exporter {\n return exporter;\n}\n\n/**\n * Type a `before_command` hook for `api.hooks.beforeCommand(hook)`.\n *\n * Contextually types the {@link BeforeCommandHook} `context` so a hook that\n * inspects or annotates a command before it runs keeps its argument typed when\n * authored as a standalone, exportable, testable value.\n */\nexport function defineBeforeCommandHook(hook: BeforeCommandHook): BeforeCommandHook {\n return hook;\n}\n\n/**\n * Type an `after_command` hook for `api.hooks.afterCommand(hook)`.\n *\n * Contextually types the {@link AfterCommandHook} `context` — including the\n * `affected` items pm mutated — so the natural place to react to every change\n * (\"project management = context management\") is checked where it is written.\n */\nexport function defineAfterCommandHook(hook: AfterCommandHook): AfterCommandHook {\n return hook;\n}\n\n/**\n * Type an `on_write` hook for `api.hooks.onWrite(hook)`.\n *\n * Contextually types the {@link OnWriteHook} `context` so a hook reacting to\n * item persistence keeps its argument typed without an explicit annotation.\n */\nexport function defineOnWriteHook(hook: OnWriteHook): OnWriteHook {\n return hook;\n}\n\n/**\n * Type an `on_read` hook for `api.hooks.onRead(hook)`.\n *\n * Contextually types the {@link OnReadHook} `context` so a hook augmenting items\n * as they are read is type-checked at the definition site.\n */\nexport function defineOnReadHook(hook: OnReadHook): OnReadHook {\n return hook;\n}\n\n/**\n * Type an `on_index` hook for `api.hooks.onIndex(hook)`.\n *\n * Contextually types the {@link OnIndexHook} `context` so a hook participating\n * in index/search refresh keeps its argument typed even without TypeScript\n * annotations.\n */\nexport function defineOnIndexHook(hook: OnIndexHook): OnIndexHook {\n return hook;\n}\n"],"names":[],"mappings":"AA0DA;;;;;;;;;GASG;;;AACH,MAAM,UAAU,uBAAuB,CAAsC,QAAmB;IAC9F,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAA4C,OAAiB;IAC/F,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAwC,UAAuB;IAC1F,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAA+B,IAAW;IAClE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAyC,IAAW;IAChF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAuC,KAAa;IACjF,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAA+C,SAAqB;IACjG,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAA6C,QAAmB;IAClG,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAgD,OAAiB;IACvG,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAM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