@unbrained/pm-cli 2026.7.2 → 2026.7.4
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.
- package/.claude-plugin/marketplace.json +3 -3
- package/CHANGELOG.md +29 -0
- package/CONTRIBUTING.md +38 -9
- package/README.md +1 -5
- package/dist/cli/commander-usage.js +54 -41
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +79 -57
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +106 -65
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/completion.js +231 -345
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.d.ts +2 -59
- package/dist/cli/commands/create.js +38 -39
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +56 -67
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.js +54 -133
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.js +21 -15
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/files.js +3 -3
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/health.js +101 -112
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +9 -18
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +9 -19
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.js +160 -111
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.js +3 -3
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item-filter-options.d.ts +2 -0
- package/dist/cli/commands/item-filter-options.js +2 -2
- package/dist/cli/commands/item-filter-options.js.map +1 -1
- package/dist/cli/commands/mutation-command-options.d.ts +78 -0
- package/dist/cli/commands/mutation-command-options.js +10 -0
- package/dist/cli/commands/mutation-command-options.js.map +1 -0
- package/dist/cli/commands/next.js +13 -10
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/profile.js +23 -15
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/reindex.js +3 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/shared-unset-fields.d.ts +19 -0
- package/dist/cli/commands/shared-unset-fields.js +31 -2
- package/dist/cli/commands/shared-unset-fields.js.map +1 -1
- package/dist/cli/commands/update.d.ts +2 -59
- package/dist/cli/commands/update.js +26 -97
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +2 -0
- package/dist/cli/commands/validate.js +16 -4
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +9 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +27 -19
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-json-payload.js +57 -49
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +48 -32
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +215 -213
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +368 -368
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +303 -299
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +51 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-IDS5GSYG.js +16 -0
- package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js → activity-OENQCYZD.js} +9 -9
- package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js → aggregate-EC4LWS3U.js} +8 -8
- package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js → aggregate-RCB3QJJE.js} +8 -8
- package/dist/cli-bundle/chunks/{append-H32VOR2Y.js → append-ADBOI3A6.js} +8 -8
- package/dist/cli-bundle/chunks/{append-UBM632FK.js → append-XLEKVVWB.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js → chunk-2LRMWMZ6.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-2227673O.js → chunk-2ONH3WG6.js} +32 -13
- package/dist/cli-bundle/chunks/{chunk-2227673O.js.map → chunk-2ONH3WG6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MNBPX5JS.js → chunk-2VK677OA.js} +72 -49
- package/dist/cli-bundle/chunks/chunk-2VK677OA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js → chunk-3C5T3ZEO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js → chunk-3MLQZI3H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js → chunk-4EVY7CQN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js → chunk-4IW7STMB.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-6YCYF2AI.js → chunk-4KPQQ42D.js} +166 -110
- package/dist/cli-bundle/chunks/chunk-4KPQQ42D.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js → chunk-4OXNQHKQ.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-BVZZN2LH.js.map → chunk-4OXNQHKQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js → chunk-4PJYRA3V.js} +31 -12
- package/dist/cli-bundle/chunks/{chunk-UWKEJMZU.js.map → chunk-4PJYRA3V.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js → chunk-4SHME4VR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6ITZLD4T.js → chunk-5FYY76HR.js} +28 -99
- package/dist/cli-bundle/chunks/chunk-5FYY76HR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js → chunk-6QY2NA2M.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-OTUJZKGI.js.map → chunk-6QY2NA2M.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js → chunk-6YB7HG2J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js → chunk-724VLYDJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XCHUVHKU.js → chunk-75VMARGO.js} +11 -11
- package/dist/cli-bundle/chunks/chunk-75VMARGO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XWGEMNBR.js → chunk-7745CXNI.js} +119 -195
- package/dist/cli-bundle/chunks/chunk-7745CXNI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YPKFV2JR.js → chunk-7G5SUU6F.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-7G5SUU6F.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js → chunk-7ITQSEBL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W47SML5B.js → chunk-A222YWOQ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js → chunk-A2W3XKAD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js → chunk-AOP2EMK3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RM37OPYK.js → chunk-AZMPKLIA.js} +72 -49
- package/dist/cli-bundle/chunks/chunk-AZMPKLIA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7NSPKJUS.js → chunk-BDDYM4LH.js} +262 -252
- package/dist/cli-bundle/chunks/chunk-BDDYM4LH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JXAUVO6X.js → chunk-CN4OAA2G.js} +55 -20
- package/dist/cli-bundle/chunks/chunk-CN4OAA2G.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js → chunk-CQFZRLXQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js → chunk-CQISNF3Z.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-S62UANU7.js → chunk-D2LDM35X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GRRG3MCT.js → chunk-DEIDJQZK.js} +57 -136
- package/dist/cli-bundle/chunks/chunk-DEIDJQZK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js → chunk-DJ5S2LDY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js → chunk-EB4BBEZD.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js → chunk-EH23N5FX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js → chunk-FDNJMYZB.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-K2VYLVX4.js → chunk-FMWQRMHS.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-FMWQRMHS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js → chunk-HL742IBM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js → chunk-J4KNRDI3.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-3AZUFQK6.js.map → chunk-J4KNRDI3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-66Z3X7ZG.js → chunk-JYLFF7GJ.js} +166 -110
- package/dist/cli-bundle/chunks/chunk-JYLFF7GJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GFMSLORL.js → chunk-JZJJEJBR.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-JZJJEJBR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7TH5NMVB.js → chunk-KKHIQOTN.js} +25 -19
- package/dist/cli-bundle/chunks/chunk-KKHIQOTN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5GVTFFTC.js → chunk-LLQLLAKU.js} +118 -194
- package/dist/cli-bundle/chunks/chunk-LLQLLAKU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KIYCOJ63.js → chunk-M34MVAOP.js} +58 -137
- package/dist/cli-bundle/chunks/chunk-M34MVAOP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js → chunk-M6PR5BC6.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-XEWQKDYZ.js → chunk-MTB4PRA3.js} +10 -10
- package/dist/cli-bundle/chunks/chunk-MTB4PRA3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js → chunk-MZ4NH46V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AIAIXG7I.js → chunk-MZG6I2Q2.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-MZG6I2Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js → chunk-N2LOJUBB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js → chunk-NGDK3KEZ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SYNKD3ZG.js → chunk-NHDR3UCW.js} +46 -60
- package/dist/cli-bundle/chunks/chunk-NHDR3UCW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js → chunk-NHKXOMZ5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js → chunk-OTSP6UEX.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js → chunk-PUVPC5DL.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js → chunk-PV5JS7MP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js → chunk-Q2266G4S.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js → chunk-Q3XVLRCJ.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-AJEBCRIY.js → chunk-QFXFKYNQ.js} +47 -61
- package/dist/cli-bundle/chunks/chunk-QFXFKYNQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js → chunk-R7EMP4JG.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-SPM2XLWI.js → chunk-SBNT6SLO.js} +22 -7
- package/dist/cli-bundle/chunks/chunk-SBNT6SLO.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-I66WE2HE.js → chunk-SL2ANJSV.js} +260 -250
- package/dist/cli-bundle/chunks/chunk-SL2ANJSV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js → chunk-T5RTYLZJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js → chunk-TGYDJEJH.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js → chunk-TO4KCIOT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js → chunk-TUV7SIWZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js → chunk-UGDONITK.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-N3QCJS4M.js.map → chunk-UGDONITK.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NRZS637N.js → chunk-UYLA5ROU.js} +56 -21
- package/dist/cli-bundle/chunks/chunk-UYLA5ROU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js → chunk-V655JQ5J.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js → chunk-W5X3AHJN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js → chunk-WBWRQS32.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js → chunk-WOOB7PV7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js → chunk-WSDIALO4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js → chunk-WTXDLBSZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js → chunk-XBIYI23P.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-7W4H4K26.js → chunk-XFO2NJY6.js} +29 -100
- package/dist/cli-bundle/chunks/chunk-XFO2NJY6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TPOFWBMY.js → chunk-XQCWTSLO.js} +26 -20
- package/dist/cli-bundle/chunks/chunk-XQCWTSLO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js → chunk-Y2VSCQ77.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js → chunk-YZR7UMZ6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YLZZ6T54.js → chunk-YZWXMDNH.js} +23 -8
- package/dist/cli-bundle/chunks/chunk-YZWXMDNH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js → chunk-ZIEGTQCY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js → chunk-ZZWMJVW2.js} +4 -4
- package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js → claim-D6L33A5Y.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-SENTPZBN.js → claim-YAFUTPVK.js} +8 -8
- package/dist/cli-bundle/chunks/close-KLDLHAOP.js +14 -0
- package/dist/cli-bundle/chunks/{close-424MX4CU.js → close-TGYXG7TV.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-SWY34BII.js → close-many-4QSWKCRU.js} +119 -76
- package/dist/cli-bundle/chunks/close-many-4QSWKCRU.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-2IV4J2TR.js → close-many-SNA6LNZH.js} +120 -77
- package/dist/cli-bundle/chunks/close-many-SNA6LNZH.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js → comments-QC6ARR5X.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js → comments-ZHVYGUVC.js} +9 -9
- package/dist/cli-bundle/chunks/{config-G74GISC4.js → config-O6W2EU2G.js} +7 -7
- package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js → config-XQRFJXJP.js} +7 -7
- package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js → context-IHE3IXN5.js} +12 -12
- package/dist/cli-bundle/chunks/{context-ZQY54JNS.js → context-WSYWBEUL.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js → contracts-CVBINC7C.js} +3 -3
- package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js → contracts-NLCDIZAT.js} +3 -3
- package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js → copy-7MUQC44A.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js → copy-ANWXDJVC.js} +5 -5
- package/dist/cli-bundle/chunks/create-AJ6HUR5W.js +28 -0
- package/dist/cli-bundle/chunks/{create-VSKYSOCD.js → create-JIA2IFCO.js} +12 -12
- package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js → delete-5OLYWQIC.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js → delete-INHKCIRN.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js → deps-CCSWGZW7.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js → deps-IYEID3QX.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js → docs-3XZK22WF.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js → docs-PKO7OEIM.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js → eval-5XYP6NMY.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js → eval-O4WGQYDI.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js → extension-PVGRRZZG.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js → extension-T7JNTAAA.js} +11 -11
- package/dist/cli-bundle/chunks/{files-5D65CHGE.js → files-7IU56S6R.js} +10 -10
- package/dist/cli-bundle/chunks/files-7IU56S6R.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-GPIG77EN.js → files-W7HH5EOD.js} +9 -9
- package/dist/cli-bundle/chunks/{files-GPIG77EN.js.map → files-W7HH5EOD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js → focus-6FA5KYRY.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js → focus-CQ63JFDG.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js → gc-3BG67KTO.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-VZIXDL32.js → gc-PEZYGNVB.js} +3 -3
- package/dist/cli-bundle/chunks/{get-GIBRUUOP.js → get-J6CSJ4SX.js} +10 -10
- package/dist/cli-bundle/chunks/{get-IOVAN6RU.js → get-KJTKGNEQ.js} +10 -10
- package/dist/cli-bundle/chunks/{health-L2U3AFKV.js → health-32UQICEL.js} +115 -123
- package/dist/cli-bundle/chunks/health-32UQICEL.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-MM7AWXYF.js → health-ZUZG5ULV.js} +114 -122
- package/dist/cli-bundle/chunks/health-ZUZG5ULV.js.map +7 -0
- package/dist/cli-bundle/chunks/history-IOH6FKG7.js +18 -0
- package/dist/cli-bundle/chunks/{history-IL7XCEX2.js → history-W6QVR6FA.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-HALOTOU7.js → history-compact-F355EGL4.js} +20 -27
- package/dist/cli-bundle/chunks/history-compact-F355EGL4.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-compact-MV25P7DM.js → history-compact-JQ6ZGYSJ.js} +19 -26
- package/dist/cli-bundle/chunks/history-compact-JQ6ZGYSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js → history-redact-TUWOUYX5.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-VVDOARNO.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-44MODPQF.js → history-repair-MPCAIKYE.js} +20 -28
- package/dist/cli-bundle/chunks/history-repair-MPCAIKYE.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-CPNAOCNF.js → history-repair-ZKS3LKPV.js} +19 -27
- package/dist/cli-bundle/chunks/history-repair-ZKS3LKPV.js.map +7 -0
- package/dist/cli-bundle/chunks/init-CZLEEE6Q.js +22 -0
- package/dist/cli-bundle/chunks/{init-F27NHENZ.js → init-MAA6UMNQ.js} +12 -12
- package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js → learnings-EYC3OKS2.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js → learnings-HKJJUVTA.js} +9 -9
- package/dist/cli-bundle/chunks/{list-VMPWTURB.js → list-HFD5737R.js} +8 -8
- package/dist/cli-bundle/chunks/{list-HPMEKCAA.js → list-KN3TL5Y5.js} +8 -8
- package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js → next-DQUMFAHG.js} +25 -22
- package/dist/cli-bundle/chunks/{next-ETXF2ZCN.js.map → next-DQUMFAHG.js.map} +2 -2
- package/dist/cli-bundle/chunks/{next-QM6YJIIS.js → next-JUEYC5HE.js} +26 -23
- package/dist/cli-bundle/chunks/next-JUEYC5HE.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js → notes-XATYT43P.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js → notes-ZG6RLZXB.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js → plan-5NWQL2DH.js} +12 -12
- package/dist/cli-bundle/chunks/{plan-C5IMM335.js → plan-DVVLX7LK.js} +12 -12
- package/dist/cli-bundle/chunks/{profile-CCOKZ2IQ.js → profile-54DZ4CLB.js} +27 -19
- package/dist/cli-bundle/chunks/profile-54DZ4CLB.js.map +1 -0
- package/dist/cli-bundle/chunks/{profile-HUCENIEQ.js → profile-PLIQVEOY.js} +26 -18
- package/dist/cli-bundle/chunks/profile-PLIQVEOY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-ROSNIL52.js → register-list-query-PNRAHNIQ.js} +181 -172
- package/dist/cli-bundle/chunks/register-list-query-PNRAHNIQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-XN4ZRHSV.js → register-list-query-WRS6ACUW.js} +180 -171
- package/dist/cli-bundle/chunks/register-list-query-WRS6ACUW.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-KRLAHEL2.js → register-mutation-ET6E4VLE.js} +367 -361
- package/dist/cli-bundle/chunks/register-mutation-ET6E4VLE.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-CFSB2MS3.js → register-mutation-K2MNRWGI.js} +368 -362
- package/dist/cli-bundle/chunks/register-mutation-K2MNRWGI.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-MBN4KGUM.js → register-operations-6DQRUTIX.js} +310 -305
- package/dist/cli-bundle/chunks/register-operations-6DQRUTIX.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-4PASGJDB.js → register-operations-73UDWMVB.js} +309 -304
- package/dist/cli-bundle/chunks/register-operations-73UDWMVB.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js → register-setup-FXZJ2CEJ.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js → register-setup-LYYCMQFV.js} +15 -15
- package/dist/cli-bundle/chunks/restore-L27TMMCF.js +17 -0
- package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js → restore-R6YJHQK3.js} +9 -9
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js → scheduling-shortcuts-LE4S7OI7.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js → scheduling-shortcuts-OGODPUBL.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js → schema-ICCD3HOP.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js → schema-RHH23PQX.js} +7 -7
- package/dist/cli-bundle/chunks/{search-FP7MEU4S.js → search-HDDKOPFE.js} +10 -10
- package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js → search-Z2VGP2Q5.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js → stats-DHMRXHOB.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js → stats-ETFP37MB.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js → telemetry-NUZNKDCP.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js → telemetry-ZRBM22QD.js} +4 -4
- package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js → test-H36PM746.js} +15 -15
- package/dist/cli-bundle/chunks/{test-YCDAUBWF.js → test-XNKTIP4Y.js} +15 -15
- package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js → test-all-APCBSXQI.js} +17 -17
- package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js → test-all-KIK3OYBY.js} +17 -17
- package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js → test-runs-5SLLV3XU.js} +4 -4
- package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js → test-runs-L3WKLO67.js} +4 -4
- package/dist/cli-bundle/chunks/update-RQKI3AMW.js +24 -0
- package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js → update-ZM7NJWHY.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js → update-many-GFCQG6ZQ.js} +28 -28
- package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js → update-many-XGTJ7QIU.js} +28 -28
- package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js → upgrade-KJ3JGELR.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js → upgrade-RBRQ7PQU.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-732RWS5W.js → validate-EW6TGC7R.js} +31 -21
- package/dist/cli-bundle/chunks/validate-EW6TGC7R.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-W7H5TEDC.js → validate-T6PR5WAL.js} +32 -22
- package/dist/cli-bundle/chunks/validate-T6PR5WAL.js.map +1 -0
- package/dist/cli-bundle/main.js +180 -122
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/extensions/extension-types.d.ts +1 -2
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/history/history-rewrite.d.ts +10 -0
- package/dist/core/history/history-rewrite.js +27 -3
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +1 -0
- package/dist/core/item/type-registry.js +180 -194
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +65 -54
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +26 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/search/corpus.js +25 -19
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/shared/memo.d.ts +12 -0
- package/dist/core/shared/memo.js +25 -0
- package/dist/core/shared/memo.js.map +1 -0
- package/dist/core/shared/serialization.js +24 -14
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/time.js +26 -4
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +5 -0
- package/dist/core/store/front-matter-cache.js +79 -20
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +73 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +4 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +55 -94
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.js.map +1 -1
- package/dist/sdk/package-import-adapters.d.ts +90 -2
- package/dist/sdk/package-import-adapters.js +274 -2
- package/dist/sdk/package-import-adapters.js.map +1 -1
- package/dist/sdk/runtime.d.ts +1 -1
- package/dist/sdk/runtime.js +3 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/COMMANDS.md +8 -4
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +12 -12
- package/docs/ONBOARDING.md +4 -2
- package/docs/README.md +2 -0
- package/docs/examples/starter-extension/README.md +11 -10
- package/marketplace.json +3 -3
- package/package.json +4 -3
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +27 -40
- package/packages/pm-beads/extensions/beads/runtime.ts +106 -223
- package/packages/pm-calendar/extensions/calendar/runtime.ts +21 -18
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +9 -11
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +48 -76
- package/packages/pm-todos/extensions/todos/runtime.ts +61 -257
- package/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-claude/README.md +6 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +73 -31
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +80 -34
- package/scripts/install.ps1 +7 -7
- package/dist/cli-bundle/chunks/activity-WEIEMM73.js +0 -16
- package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AIAIXG7I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GFMSLORL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JXAUVO6X.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K2VYLVX4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YPKFV2JR.js.map +0 -1
- package/dist/cli-bundle/chunks/close-YCWQQPDS.js +0 -14
- package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +0 -7
- package/dist/cli-bundle/chunks/create-XTMAPS7I.js +0 -28
- package/dist/cli-bundle/chunks/files-5D65CHGE.js.map +0 -1
- package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +0 -1
- package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +0 -7
- package/dist/cli-bundle/chunks/history-DD7L7BNL.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +0 -7
- package/dist/cli-bundle/chunks/init-HHVQQP6C.js +0 -22
- package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-CCOKZ2IQ.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-HUCENIEQ.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +0 -17
- package/dist/cli-bundle/chunks/update-MTCFES6X.js +0 -24
- package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-WEIEMM73.js.map → activity-IDS5GSYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-CUC4JY3U.js.map → activity-OENQCYZD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-SW5PNGCS.js.map → aggregate-EC4LWS3U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-DKUTRY6R.js.map → aggregate-RCB3QJJE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-H32VOR2Y.js.map → append-ADBOI3A6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-UBM632FK.js.map → append-XLEKVVWB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q6NXOHS6.js.map → chunk-2LRMWMZ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KLXF7NCC.js.map → chunk-3C5T3ZEO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JMK5GCK2.js.map → chunk-3MLQZI3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BTX5MIQF.js.map → chunk-4EVY7CQN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q6K2OACU.js.map → chunk-4IW7STMB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EMPGXBUF.js.map → chunk-4SHME4VR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2KWL5NPW.js.map → chunk-6YB7HG2J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-36UGKF4O.js.map → chunk-724VLYDJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4NRKBFW.js.map → chunk-7ITQSEBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W47SML5B.js.map → chunk-A222YWOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3LCUASYG.js.map → chunk-A2W3XKAD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KN3URLKS.js.map → chunk-AOP2EMK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IEEJQCZ4.js.map → chunk-CQFZRLXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4NUOWFBT.js.map → chunk-CQISNF3Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S62UANU7.js.map → chunk-D2LDM35X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IG5JYZGU.js.map → chunk-DJ5S2LDY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A6VOGKBA.js.map → chunk-EB4BBEZD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QH3FSKRJ.js.map → chunk-EH23N5FX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HQTPRV4D.js.map → chunk-FDNJMYZB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N2JSWVWG.js.map → chunk-HL742IBM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CZPVDLD2.js.map → chunk-M6PR5BC6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MRD4T5LF.js.map → chunk-MZ4NH46V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNHEYCDD.js.map → chunk-N2LOJUBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WJAMWAHZ.js.map → chunk-NGDK3KEZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2CHRYUXL.js.map → chunk-NHKXOMZ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7MYWF4ZX.js.map → chunk-OTSP6UEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UGLU6Q2I.js.map → chunk-PUVPC5DL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LTRAF2D7.js.map → chunk-PV5JS7MP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KCO2EAN5.js.map → chunk-Q2266G4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SYVUU7EK.js.map → chunk-Q3XVLRCJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ZMBJRDJ.js.map → chunk-R7EMP4JG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-U2BEEM2X.js.map → chunk-T5RTYLZJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UTSH5GWX.js.map → chunk-TGYDJEJH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H4GRLYJS.js.map → chunk-TO4KCIOT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EUKTMRN3.js.map → chunk-TUV7SIWZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-55XRYWEG.js.map → chunk-V655JQ5J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3Q2HBMTI.js.map → chunk-W5X3AHJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XTHQWXVC.js.map → chunk-WBWRQS32.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UT73HUPC.js.map → chunk-WOOB7PV7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5PGBHRY3.js.map → chunk-WSDIALO4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LRKMWUUV.js.map → chunk-WTXDLBSZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FFOQHGNH.js.map → chunk-XBIYI23P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2ASNV4DH.js.map → chunk-Y2VSCQ77.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNT7KEWE.js.map → chunk-YZR7UMZ6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CYBDUHNO.js.map → chunk-ZIEGTQCY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TTHCEV5Q.js.map → chunk-ZZWMJVW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-Z7MEQCBT.js.map → claim-D6L33A5Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-SENTPZBN.js.map → claim-YAFUTPVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-YCWQQPDS.js.map → close-KLDLHAOP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-424MX4CU.js.map → close-TGYXG7TV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-4FGNTSNV.js.map → comments-QC6ARR5X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-7YS5MY5X.js.map → comments-ZHVYGUVC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-G74GISC4.js.map → config-O6W2EU2G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-BZJKK7FZ.js.map → config-XQRFJXJP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-LHVKJSPJ.js.map → context-IHE3IXN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-ZQY54JNS.js.map → context-WSYWBEUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-FIZLMP7O.js.map → contracts-CVBINC7C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-CP2EZJC7.js.map → contracts-NLCDIZAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-TLW7JTQT.js.map → copy-7MUQC44A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-GYNQQPW2.js.map → copy-ANWXDJVC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-XTMAPS7I.js.map → create-AJ6HUR5W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-VSKYSOCD.js.map → create-JIA2IFCO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ANTOTI2I.js.map → delete-5OLYWQIC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-4W5JYCEG.js.map → delete-INHKCIRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-HPPE6MJN.js.map → deps-CCSWGZW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-ZQZN54EZ.js.map → deps-IYEID3QX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-XJNYBJGE.js.map → docs-3XZK22WF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RPOVFMP3.js.map → docs-PKO7OEIM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-RFBI5FGS.js.map → eval-5XYP6NMY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-DM6JBZTS.js.map → eval-O4WGQYDI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-TTSEFQTS.js.map → extension-PVGRRZZG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-B3YY4WY5.js.map → extension-T7JNTAAA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-ZHN7WIGX.js.map → focus-6FA5KYRY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-C3PEJV2C.js.map → focus-CQ63JFDG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-D4JQ6OWN.js.map → gc-3BG67KTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-VZIXDL32.js.map → gc-PEZYGNVB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-GIBRUUOP.js.map → get-J6CSJ4SX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-IOVAN6RU.js.map → get-KJTKGNEQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-DD7L7BNL.js.map → history-IOH6FKG7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IL7XCEX2.js.map → history-W6QVR6FA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-VYCWQFK7.js.map → history-redact-TUWOUYX5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IX4YEWMY.js.map → history-redact-VVDOARNO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HHVQQP6C.js.map → init-CZLEEE6Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-F27NHENZ.js.map → init-MAA6UMNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-XSFSUUWK.js.map → learnings-EYC3OKS2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-HJVDQIGY.js.map → learnings-HKJJUVTA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-VMPWTURB.js.map → list-HFD5737R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-HPMEKCAA.js.map → list-KN3TL5Y5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-WDDBPC4D.js.map → notes-XATYT43P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GDZIKGR6.js.map → notes-ZG6RLZXB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-BGDR73Z6.js.map → plan-5NWQL2DH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-C5IMM335.js.map → plan-DVVLX7LK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-ZCGKHDKL.js.map → register-setup-FXZJ2CEJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-VIAWYFP5.js.map → register-setup-LYYCMQFV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-5UEAGG3W.js.map → restore-L27TMMCF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4CBWUMCX.js.map → restore-R6YJHQK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-6VFKNKCM.js.map → scheduling-shortcuts-LE4S7OI7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-ERHCVTEM.js.map → scheduling-shortcuts-OGODPUBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-UE5KKAUX.js.map → schema-ICCD3HOP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-TDGK6N3I.js.map → schema-RHH23PQX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-FP7MEU4S.js.map → search-HDDKOPFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-K4CFLQ5S.js.map → search-Z2VGP2Q5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-NJJCALEZ.js.map → stats-DHMRXHOB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-XT6QRKQY.js.map → stats-ETFP37MB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-HVXFZA2U.js.map → telemetry-NUZNKDCP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-5SQ5UDXC.js.map → telemetry-ZRBM22QD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-UFSJ5YIO.js.map → test-H36PM746.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-YCDAUBWF.js.map → test-XNKTIP4Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-2BWKY3GQ.js.map → test-all-APCBSXQI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-PM7UYN42.js.map → test-all-KIK3OYBY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-H4TGWGRN.js.map → test-runs-5SLLV3XU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-FK5E75AA.js.map → test-runs-L3WKLO67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-MTCFES6X.js.map → update-RQKI3AMW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-Y5WQVT5O.js.map → update-ZM7NJWHY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-JTKKSA7Y.js.map → update-many-GFCQG6ZQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-6YAYYRLE.js.map → update-many-XGTJ7QIU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-DTAHZ236.js.map → upgrade-KJ3JGELR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-JUDU7YL4.js.map → upgrade-RBRQ7PQU.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/extension/scaffold.ts","../../../../../../../../core/extensions/activation-summary.ts","../../../../../../../../core/extensions/activation-summary-markdown.ts","../../../../../../../../cli/commands/extension/describe.ts"],"sourcesContent":["/**\n * @module cli/commands/extension/scaffold\n *\n * Implements extension package-management support for Scaffold.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { EXECUTABLE_COMMAND_ALIASES } from \"../../bootstrap-args.js\";\nimport { pathExists } from \"../../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../../core/shared/constants.js\";\nimport { PmCliError } from \"../../../core/shared/errors.js\";\nimport { PM_CORE_COMMAND_NAMES } from \"../../../sdk/cli-contracts.js\";\nimport { normalizeManagedDirectoryName } from \"./shared.js\";\n\n// Safe compatibility floor emitted into scaffolded manifests. The current\n// starters are loaded as TypeScript and use the SDK define*/testing helpers; the\n// first released host that supports that full generated contract is v2026.6.24.\n// manifest_version tracks the manifest schema generation (currently 1).\nconst SCAFFOLD_MANIFEST_VERSION = 1;\nexport const SCAFFOLD_PM_MIN_VERSION = \"2026.6.24\";\nconst SCAFFOLD_NODE_ENGINE = \">=22.18.0\";\nconst SCAFFOLD_DECLARED_PERMISSIONS = {\n fs_read: false,\n fs_write: false,\n network: false,\n env_read: false,\n env_write: false,\n process_spawn: false,\n};\n\nconst RESERVED_SCAFFOLD_COMMAND_ROOTS = new Set([\n ...PM_CORE_COMMAND_NAMES.map((commandName) => commandName.split(\"-\")[0]!.toLowerCase()),\n ...Object.keys(EXECUTABLE_COMMAND_ALIASES).map((alias) => alias.toLowerCase()),\n // \"scaffold\" is a Commander command that currently lives outside both\n // PM_CORE_COMMAND_NAMES and EXECUTABLE_COMMAND_ALIASES.\n \"scaffold\",\n]);\n\n// TypeScript dev-dependency floor for scaffolded packages, matching the CLI's own\n// toolchain so generated packages compile against the same compiler generation.\nconst SCAFFOLD_TYPESCRIPT_VERSION = \"^6.0.0\";\n\n// `@types/node` floor for scaffolded packages: the colocated `index.test.ts`\n// imports `node:test`/`node:assert`, which need Node's ambient type definitions\n// to type-check. Pinned to the engines floor (Node >=22.18), matching the CLI\n// itself — the version where Node strips TypeScript types on load by default.\nconst SCAFFOLD_TYPES_NODE_VERSION = \"^22.0.0\";\n\nconst SAMPLE_HARNESS_CLEANUP_LINES = [\n \"type StarterHarness = Awaited<ReturnType<typeof createExtensionTestHarness>>;\",\n \"\",\n \"async function deactivateIfNeeded(ext: StarterHarness, deactivated: boolean): Promise<void> {\",\n \" if (!deactivated) {\",\n \" try {\",\n \" await ext.deactivate();\",\n \" } catch {\",\n \" // Preserve the original assertion error; cleanup is best effort.\",\n \" }\",\n \" }\",\n \"}\",\n \"\",\n] as const;\n\nconst SAMPLE_HARNESS_FINALLY_LINES = [\n \" } finally {\",\n \" await deactivateIfNeeded(ext, deactivated);\",\n \" }\",\n] as const;\n\nfunction indentGeneratedLines(lines: readonly string[], prefix: string): string[] {\n return lines.map((line) => (line === \"\" ? line : `${prefix}${line}`));\n}\n\nfunction buildSchemaCapabilityAssertionLines(options: {\n readonly extensionName: string;\n readonly itemTypeName: string;\n readonly itemTypeFolder: string;\n readonly fieldName: string;\n readonly migrationId: string;\n readonly includeMigrationReplacementHint?: boolean;\n}): string[] {\n const migrationHint = options.includeMigrationReplacementHint === true ? [\" // as your migration grows.\"] : [];\n return [\n \" // assertItemType/Field/Migration throw unless the registration is present, so\",\n \" // reaching each next line already proves the wiring; assert on the returned\",\n \" // definitions to demonstrate inspecting registered metadata.\",\n ` const itemType = ext.assertItemType({ itemType: ${JSON.stringify(options.itemTypeName)}, extensionName: ${JSON.stringify(options.extensionName)} });`,\n ` assert.equal(itemType.itemType.folder, ${JSON.stringify(options.itemTypeFolder)});`,\n ` const itemField = ext.assertItemField({ field: ${JSON.stringify(options.fieldName)}, extensionName: ${JSON.stringify(options.extensionName)} });`,\n ' assert.equal(itemField.field.type, \"string\");',\n ` ext.assertMigration({ migration: ${JSON.stringify(options.migrationId)}, extensionName: ${JSON.stringify(options.extensionName)}, mandatory: false });`,\n \"\",\n \" // runMigration invokes the migration through pm's real runner with a synthetic\",\n \" // context and returns its result.\",\n ...migrationHint,\n ` const migrated = await ext.runMigration({ migration: ${JSON.stringify(options.migrationId)} });`,\n ` assert.deepEqual(migrated, { migrated: true, id: ${JSON.stringify(options.migrationId)} });`,\n ];\n}\n\nfunction buildProfileCapabilityAssertionLines(extensionName: string): string[] {\n return [\n \" // assertProfile throws unless the profile is registered, so reaching the next\",\n \" // line already proves the wiring; assert on the returned definition to inspect\",\n \" // the bundled archetype dimensions.\",\n ` const { profile } = ext.assertProfile({ profile: ${JSON.stringify(extensionName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n ` assert.equal(profile.title, ${JSON.stringify(`${extensionName} archetype`)});`,\n \" assert.equal(profile.types.length, 1);\",\n \" assert.equal(profile.workflows.length, 1);\",\n ];\n}\n\n// Strict NodeNext tsconfig emitted into every scaffold (ADR pm-2c28 / pm-m1uz:\n// extensions are authored AND loaded as TypeScript). It is a type-check-only\n// config (`noEmit`): there is no compile step — pm loads the `./index.ts`\n// manifest entry directly via Node's native type stripping (Node >=22.18), so\n// no `.js` is emitted or committed. `allowImportingTsExtensions` lets the\n// colocated `index.test.ts` import the sibling `./index.ts` entry with its real\n// extension, exactly as Node resolves it at load time. NodeNext resolution keeps\n// the module graph identical to the runtime loader.\nconst SCAFFOLD_TSCONFIG = {\n compilerOptions: {\n target: \"ES2022\",\n module: \"NodeNext\",\n moduleResolution: \"NodeNext\",\n strict: true,\n esModuleInterop: true,\n skipLibCheck: true,\n noEmit: true,\n allowImportingTsExtensions: true,\n // `node:test`/`node:assert` in the colocated test (and Node globals) resolve\n // from `@types/node`; name it explicitly so it is loaded regardless of how the\n // package manager lays out `node_modules/@types`.\n types: [\"node\"],\n },\n // Recursive so a package that grows into subdirectory `*.ts` modules still\n // type-checks; tsc excludes `node_modules` by default.\n include: [\"**/*.ts\"],\n};\n\n/**\n * Capability shapes the package/extension scaffolder can target via the\n * `--capability` selector — one per SDK extension capability, so every\n * registration surface has a runnable starter. `commands` emits the default\n * command-only starter; `hooks` additionally wires an `after_command` lifecycle\n * reactor; `search` wires an in-memory provider/adapter pair; `importers` wires\n * importer and exporter command primitives so authors can customize project\n * context movement; `schema` registers a custom item type, item field, and\n * migration so authors can model their own project domain; `profile` registers a\n * complete project-profile archetype (item types, statuses, fields, a workflow,\n * config, a template, and package recommendations) via `api.registerProfile` so\n * `pm profile apply` can tailor a tracker in one shot; `renderers` overrides how\n * a command's output is serialized for a format; `parser` rewrites a command's\n * parsed options before its handler runs; `preflight` adjusts pm's pre-run\n * migration/format gate decision; and `services` overrides a built-in pm service\n * (e.g. output formatting) — without starting from a blank extension.\n */\nexport const SCAFFOLD_CAPABILITIES = [\n \"commands\",\n \"hooks\",\n \"search\",\n \"importers\",\n \"schema\",\n \"profile\",\n \"renderers\",\n \"parser\",\n \"preflight\",\n \"services\",\n] as const;\n\n/**\n * Restricts the `--capability` selector to a {@link SCAFFOLD_CAPABILITIES} value.\n */\nexport type ExtensionScaffoldCapability = (typeof SCAFFOLD_CAPABILITIES)[number];\n\nconst SCAFFOLD_MANIFEST_CAPABILITIES: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [\"commands\"],\n hooks: [\"commands\", \"hooks\"],\n search: [\"commands\", \"search\"],\n importers: [\"commands\", \"schema\", \"importers\"],\n schema: [\"commands\", \"schema\"],\n // A profile registration IS a schema+config bundle, so the loader gate requires\n // the `schema` capability (no separate `profile` capability) — same grant as the\n // schema starter, mirroring the bundled pm-kanban exemplar.\n profile: [\"commands\", \"schema\"],\n renderers: [\"commands\", \"renderers\"],\n // The parser starter declares `--shout`/`--upper` command flags so the\n // override is runnable through `pm <command> --shout`; flag metadata is\n // schema-governed, so the manifest also declares `schema`.\n parser: [\"commands\", \"parser\", \"schema\"],\n preflight: [\"commands\", \"preflight\"],\n services: [\"commands\", \"services\"],\n};\n\nconst SAMPLE_TEST_CAPABILITIES_LITERAL: Record<ExtensionScaffoldCapability, string> = {\n commands: '[\"commands\"]',\n hooks: '[\"commands\", \"hooks\"]',\n search: '[\"commands\", \"search\"]',\n importers: '[\"commands\", \"schema\", \"importers\"]',\n schema: '[\"commands\", \"schema\"]',\n profile: '[\"commands\", \"schema\"]',\n renderers: '[\"commands\", \"renderers\"]',\n parser: '[\"commands\", \"parser\", \"schema\"]',\n preflight: '[\"commands\", \"preflight\"]',\n services: '[\"commands\", \"services\"]',\n};\n\nconst ENTRYPOINT_BULLETS: Record<ExtensionScaffoldCapability, string> = {\n commands: \"- `index.ts`: the TypeScript manifest entry — starter command registration plus a `deactivate` teardown stub.\",\n hooks:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, an `after_command` lifecycle hook, and a `deactivate` teardown stub.\",\n search:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, a search provider, a vector-store adapter, and a `deactivate` teardown stub.\",\n importers:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, importer/exporter command registrations, and a `deactivate` teardown stub.\",\n schema:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, a custom item type, a custom item field, a schema migration, and a `deactivate` teardown stub.\",\n profile:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, a project profile (item types, statuses, fields, a workflow, config, a template, and package recommendations) registered via `api.registerProfile`, and a `deactivate` teardown stub.\",\n renderers:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, a `toon` output renderer override, and a `deactivate` teardown stub.\",\n parser:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, a parser override that rewrites the command's parsed options, and a `deactivate` teardown stub.\",\n preflight:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, a preflight override over pm's pre-run gate decision, and a `deactivate` teardown stub.\",\n services:\n \"- `index.ts`: the TypeScript manifest entry — starter command registration, an `output_format` service override, and a `deactivate` teardown stub.\",\n};\n\nconst SAMPLE_TEST_BULLETS: Record<ExtensionScaffoldCapability, string> = {\n commands:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, and teardown via the SDK testing helpers.\",\n hooks:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, the after_command hook, and teardown via the SDK testing helpers.\",\n search:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, search provider/vector adapter invocation, and teardown via the SDK testing helpers.\",\n importers:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, importer/exporter invocation, and teardown via the SDK testing helpers.\",\n schema:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, item type/field/migration registration, migration invocation, and teardown via the SDK testing helpers.\",\n profile:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, project-profile registration (asserting the bundled archetype dimensions), and teardown via the SDK testing helpers.\",\n renderers:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, renderer override registration and invocation (including format pass-through), and teardown via the SDK testing helpers.\",\n parser:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, parser override registration and the option rewrite it produces, and teardown via the SDK testing helpers.\",\n preflight:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, preflight override registration and the gate decision it returns, and teardown via the SDK testing helpers.\",\n services:\n \"- `index.test.ts`: sample `node:test` suite covering activation, command invocation, service override registration and invocation (including command pass-through), and teardown via the SDK testing helpers.\",\n};\n\nconst TSCONFIG_BULLET = \"- `tsconfig.json`: strict type-check-only TypeScript config (`noEmit`) for the `.ts` source the loader runs directly.\";\n\nconst PACKAGE_CAPABILITY_README_SECTIONS: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [],\n hooks: [\n \"\",\n \"## Lifecycle Hook\",\n \"`index.ts` registers an `after_command` hook via `api.hooks.afterCommand`.\",\n \"pm fires it once a command finishes, passing the command outcome and the\",\n \"items it mutated (`context.affected`). React there to keep external context\",\n \"in sync - sync records, emit telemetry, or refresh derived state. The\",\n \"`hooks` capability in `manifest.json` is what grants the hook registration;\",\n \"remove it (and the hook) if your package only needs commands.\",\n ],\n search: [\n \"\",\n \"## Search Provider\",\n \"`index.ts` registers a deterministic in-memory search provider and\",\n \"vector-store adapter through `api.registerSearchProvider` and\",\n \"`api.registerVectorStoreAdapter`. Replace the sample scoring,\",\n \"embedding, and storage behavior with your project-specific retrieval\",\n \"logic. The `search` capability in `manifest.json` grants both\",\n \"registrations.\",\n ],\n importers: [\n \"\",\n \"## Importer and Exporter\",\n \"`index.ts` registers paired project-context import/export commands through\",\n \"`api.registerImporter` and `api.registerExporter`. Replace the starter\",\n \"payloads with your domain adapter: GitHub issues, CSV rows, documents,\",\n \"tickets, or another project-management source of truth. The `importers`\",\n \"capability grants both registrations, and `schema` grants the example\",\n \"command flag metadata.\",\n ],\n schema: [\n \"\",\n \"## Custom Schema\",\n \"`index.ts` models a project domain by registering a custom item type, a\",\n \"custom item field, and a schema migration through `api.registerItemTypes`,\",\n \"`api.registerItemFields`, and `api.registerMigration`. This is how a package\",\n \"turns pm into a domain-specific tracker — `project management = context\",\n \"management`. Replace the sample type/field/migration with your own domain\",\n \"model; the `schema` capability in `manifest.json` grants all three\",\n \"registrations. Once installed, the custom type is usable everywhere, e.g.\",\n \"`pm create <type> \\\"<title>\\\"` and `pm list --type <type>`.\",\n ],\n profile: [\n \"\",\n \"## Project Profile\",\n \"`index.ts` registers a complete project-profile archetype through\",\n \"`api.registerProfile`. A profile is the broadest customization primitive pm\",\n \"has — one declarative bundle of item types, custom statuses, fields, a per-type\",\n \"workflow, config knobs, create templates, and package recommendations. Once the\",\n \"package is installed the profile resolves by name through `pm profile list`,\",\n \"`pm profile show <name>`, and `pm profile apply <name>`, which stages every\",\n \"dimension idempotently — exactly like a core archetype (agile/ops/research),\",\n \"with no consumer code required. Replace the sample archetype with your own\",\n \"domain; the `schema` capability in `manifest.json` grants the registration (a\",\n \"profile is a schema+config bundle, so it needs no separate capability).\",\n ],\n renderers: [\n \"\",\n \"## Output Renderer\",\n \"`index.ts` registers a `toon` output renderer override through\",\n \"`api.registerRenderer`. Renderer overrides run for every command's output in\",\n \"that format, so this starter scopes itself to THIS package's own command and\",\n \"returns `null` (pass-through to pm's default renderer) for everything else.\",\n \"Return a string to take over rendering. Replace the sample serialization with\",\n \"your own; the `renderers` capability in `manifest.json` grants the\",\n \"registration.\",\n ],\n parser: [\n \"\",\n \"## Parser Override\",\n \"`index.ts` registers a parser override for the starter command through\",\n \"`api.registerParser`. pm runs it on the command's parsed options BEFORE the\",\n \"handler, merging the delta you return. This starter rewrites a deprecated\",\n \"`--shout` alias to the canonical `--upper` flag; replace it with your\",\n \"command's real normalization. The `parser` capability in `manifest.json`\",\n \"grants the registration.\",\n ],\n preflight: [\n \"\",\n \"## Preflight Override\",\n \"`index.ts` registers a preflight override through `api.registerPreflight`. pm\",\n \"calls it before every command to compute the migration/format gate decision —\",\n \"the last registered override wins. Return only the decision keys you want to\",\n \"change; this starter echoes the current decision unchanged (a safe no-op) so\",\n \"installing the package does not alter gate behavior. The `preflight`\",\n \"capability in `manifest.json` grants the registration.\",\n ],\n services: [\n \"\",\n \"## Service Override\",\n \"`index.ts` overrides the built-in `output_format` service through\",\n \"`api.registerService`. The service renders a command's structured result;\",\n \"returning the payload unchanged passes through to pm's default formatting.\",\n \"This starter scopes itself to THIS package's own command and passes every\",\n \"other command through, so it never disrupts unrelated output. The `services`\",\n \"capability in `manifest.json` grants the registration.\",\n ],\n};\n\nconst EXTENSION_CAPABILITY_README_SECTIONS: Record<ExtensionScaffoldCapability, readonly string[]> = {\n commands: [],\n hooks: [\n \"\",\n \"## Lifecycle Hook\",\n \"`index.ts` registers an `after_command` hook via `api.hooks.afterCommand`.\",\n \"pm fires it once a command finishes, passing the command outcome and the\",\n \"items it mutated (`context.affected`). React there to keep external context\",\n \"in sync. The `hooks` capability in `manifest.json` grants the registration;\",\n \"remove it (and the hook) if your extension only needs commands.\",\n ],\n search: [\n \"\",\n \"## Search Provider\",\n \"`index.ts` registers a deterministic in-memory search provider and\",\n \"vector-store adapter through `api.registerSearchProvider` and\",\n \"`api.registerVectorStoreAdapter`. Replace the sample scoring, embedding,\",\n \"and storage behavior with your project-specific retrieval logic. The\",\n \"`search` capability in `manifest.json` grants both registrations.\",\n ],\n importers: [\n \"\",\n \"## Importer and Exporter\",\n \"`index.ts` registers paired project-context import/export commands through\",\n \"`api.registerImporter` and `api.registerExporter`. Replace the starter\",\n \"payloads with your domain adapter. The `importers` capability grants both\",\n \"registrations, and `schema` grants the example command flag metadata.\",\n ],\n schema: [\n \"\",\n \"## Custom Schema\",\n \"`index.ts` models a project domain by registering a custom item type, a\",\n \"custom item field, and a schema migration through `api.registerItemTypes`,\",\n \"`api.registerItemFields`, and `api.registerMigration`. Replace the sample\",\n \"type/field/migration with your own domain model; the `schema` capability in\",\n \"`manifest.json` grants all three registrations. Once installed, the custom\",\n 'type is usable everywhere, e.g. `pm create <type> \"<title>\"`.',\n ],\n profile: [\n \"\",\n \"## Project Profile\",\n \"`index.ts` registers a complete project-profile archetype through\",\n \"`api.registerProfile` — one declarative bundle of item types, custom statuses,\",\n \"fields, a per-type workflow, config knobs, create templates, and package\",\n \"recommendations. Once installed the profile resolves by name through\",\n \"`pm profile list`, `pm profile show <name>`, and `pm profile apply <name>`,\",\n \"which stages every dimension idempotently like a core archetype. Replace the\",\n \"sample archetype with your own domain; the `schema` capability in\",\n \"`manifest.json` grants the registration.\",\n ],\n renderers: [\n \"\",\n \"## Output Renderer\",\n \"`index.ts` registers a `toon` output renderer override through\",\n \"`api.registerRenderer`. Renderer overrides run for every command's output in\",\n \"that format, so this starter scopes itself to its own command and returns\",\n \"`null` (pass-through to pm's default renderer) for everything else. Replace\",\n \"the sample serialization with your own; the `renderers` capability in\",\n \"`manifest.json` grants the registration.\",\n ],\n parser: [\n \"\",\n \"## Parser Override\",\n \"`index.ts` registers a parser override for the starter command through\",\n \"`api.registerParser`. pm runs it on the command's parsed options BEFORE the\",\n \"handler, merging the delta you return. This starter rewrites a deprecated\",\n \"`--shout` alias to the canonical `--upper` flag; replace it with your own\",\n \"normalization. The `parser` capability in `manifest.json` grants the\",\n \"registration.\",\n ],\n preflight: [\n \"\",\n \"## Preflight Override\",\n \"`index.ts` registers a preflight override through `api.registerPreflight`. pm\",\n \"calls it before every command to compute the migration/format gate decision —\",\n \"the last registered override wins. This starter echoes the current decision\",\n \"unchanged (a safe no-op); return only the decision keys you want to change.\",\n \"The `preflight` capability in `manifest.json` grants the registration.\",\n ],\n services: [\n \"\",\n \"## Service Override\",\n \"`index.ts` overrides the built-in `output_format` service through\",\n \"`api.registerService`. Returning the payload unchanged passes through to pm's\",\n \"default formatting, so this starter scopes itself to its own command and\",\n \"passes every other command through. The `services` capability in\",\n \"`manifest.json` grants the registration.\",\n ],\n};\n\n// README activation explainer for command-bearing starters (commands/hooks/\n// search/importers): they declare `activation.commands` so pm loads them lazily.\nconst LAZY_ACTIVATION_README_SECTION: Record<\"package\" | \"extension\", readonly string[]> = {\n package: [\n \"\",\n \"## Lazy Activation\",\n \"`manifest.json` declares `activation.commands`: the exact command paths this\",\n \"package's `activate` registers. pm imports and activates the package lazily —\",\n \"only when an invoked command path matches one of these entries — so unrelated\",\n \"commands (`pm list`, `pm search`, ...) never pay to load it. Keep this list in\",\n \"sync with the registrations in `index.ts`: add an entry when you register a new\",\n \"command, importer, or exporter, and remove one you drop. An omitted or stale\",\n \"entry means the matching command will not dispatch from the CLI. Globally-scoped\",\n \"surfaces (hooks, parser/preflight/renderer overrides, and search providers for\",\n \"built-in search commands) still activate regardless of this list.\",\n ],\n extension: [\n \"\",\n \"## Lazy Activation\",\n \"`manifest.json` declares `activation.commands`: the exact command paths this\",\n \"extension's `activate` registers. pm imports and activates the extension lazily —\",\n \"only when an invoked command path matches one of these entries — so unrelated\",\n \"commands never pay to load it. Keep this list in sync with the registrations in\",\n \"`index.ts`: an omitted or stale entry means the matching command will not dispatch\",\n \"from the CLI. Globally-scoped surfaces (hooks, parser/preflight/renderer overrides,\",\n \"and search providers for built-in search commands) still activate regardless.\",\n ],\n};\n\n// README activation explainer for the `schema` starter: it contributes a GLOBAL\n// custom item type/field, so it intentionally omits `activation.commands` and\n// relies on pm's conservative activation tier (see buildScaffoldActivationCommands).\nconst SCHEMA_ACTIVATION_README_SECTION: Record<\"package\" | \"extension\", readonly string[]> = {\n package: [\n \"\",\n \"## Activation\",\n \"This package contributes a GLOBAL custom item type and field, so `manifest.json`\",\n \"intentionally declares no `activation.commands`. pm activates the package\",\n \"conservatively — for every command — so the custom type is present wherever it is\",\n \"used: `pm create <type>`, `pm list --type <type>`, `pm validate`, and so on.\",\n \"Declaring narrow `activation.commands` here would gate activation to only those\",\n \"commands and silently leave the custom type unregistered for `pm create`. If you\",\n \"drop the schema registrations and keep only command/hook/search/importer surfaces,\",\n \"add `activation.commands` back so pm can load the package lazily.\",\n ],\n extension: [\n \"\",\n \"## Activation\",\n \"This extension contributes a GLOBAL custom item type and field, so `manifest.json`\",\n \"intentionally declares no `activation.commands`. pm activates the extension\",\n \"conservatively — for every command — so the custom type is present wherever it is\",\n \"used: `pm create <type>`, `pm list --type <type>`, `pm validate`, and so on.\",\n \"Declaring narrow `activation.commands` here would gate activation to only those\",\n \"commands and silently leave the custom type unregistered for `pm create`.\",\n ],\n};\n\n// README activation explainer for the `profile` starter: the contributed profile\n// is resolved by the built-in `pm profile list/show/apply` commands (which the\n// package does not own), so it intentionally omits `activation.commands` and relies\n// on pm's conservative activation tier (granted by the `schema` capability).\nconst PROFILE_ACTIVATION_README_SECTION: Record<\"package\" | \"extension\", readonly string[]> = {\n package: [\n \"\",\n \"## Activation\",\n \"This package contributes a project profile resolved by the built-in\",\n \"`pm profile list`, `pm profile show <name>`, and `pm profile apply <name>`\",\n \"commands — commands the package does not own — so `manifest.json` intentionally\",\n \"declares no `activation.commands`. pm activates the package conservatively (for\",\n \"every command, granted by the `schema` capability) so the profile is present\",\n \"whenever `pm profile` runs. Declaring narrow `activation.commands` here would\",\n \"gate activation to only the listed commands and silently leave the profile\",\n \"unregistered for `pm profile`.\",\n ],\n extension: [\n \"\",\n \"## Activation\",\n \"This extension contributes a project profile resolved by the built-in\",\n \"`pm profile list`, `pm profile show <name>`, and `pm profile apply <name>`\",\n \"commands, so `manifest.json` intentionally declares no `activation.commands`. pm\",\n \"activates the extension conservatively (for every command, granted by the\",\n \"`schema` capability) so the profile is present whenever `pm profile` runs.\",\n \"Declaring narrow `activation.commands` here would silently leave the profile\",\n \"unregistered for `pm profile`.\",\n ],\n};\n\n/**\n * Build the README \"Included Files\" bullet describing `manifest.json` for the\n * chosen capability and vocabulary. The `schema` and `profile` starters omit\n * `activation.commands` (see {@link buildScaffoldActivationCommands}), so their\n * bullet explains the global-contribution tradeoff instead of referencing a field\n * they deliberately lack.\n */\nfunction buildScaffoldManifestBullet(capability: ExtensionScaffoldCapability, vocabulary: \"extension\" | \"package\"): string {\n if (capability === \"schema\") {\n return `- \\`manifest.json\\`: ${vocabulary} metadata and capabilities (no \\`activation.commands\\` — the custom item type activates for every command).`;\n }\n if (capability === \"profile\") {\n return `- \\`manifest.json\\`: ${vocabulary} metadata and capabilities (no \\`activation.commands\\` — the contributed profile resolves through \\`pm profile\\` for every command).`;\n }\n return `- \\`manifest.json\\`: ${vocabulary} metadata, capabilities, and \\`activation.commands\\` (the command paths that lazily activate this ${vocabulary}).`;\n}\n\n/**\n * Select the README activation section for the chosen capability and vocabulary:\n * the `schema` and `profile` starters explain conservative activation (they omit\n * `activation.commands`); every other capability documents lazy activation.\n */\nfunction buildScaffoldActivationReadmeSection(\n capability: ExtensionScaffoldCapability,\n vocabulary: \"extension\" | \"package\",\n): readonly string[] {\n if (capability === \"schema\") {\n return SCHEMA_ACTIVATION_README_SECTION[vocabulary];\n }\n if (capability === \"profile\") {\n return PROFILE_ACTIVATION_README_SECTION[vocabulary];\n }\n return LAZY_ACTIVATION_README_SECTION[vocabulary];\n}\n\ninterface ExtensionScaffoldFileResult {\n path: string;\n status: \"created\" | \"unchanged\";\n}\n\ninterface ExtensionScaffoldResult {\n extension_name: string;\n command_name: string;\n capability: ExtensionScaffoldCapability;\n /**\n * Authoring style of the generated entrypoint: `\"imperative\"` (a hand-written\n * `activate` body, the default) or `\"declarative\"` (a `composeExtension`\n * blueprint). The declarative style is package-mode only (any capability).\n */\n style: ExtensionScaffoldStyle;\n target_path: string;\n created_directory: boolean;\n files: ExtensionScaffoldFileResult[];\n}\n\n/**\n * Authoring style the scaffolder targets for the generated entrypoint. The\n * default `\"imperative\"` emits a hand-written `activate` body; `\"declarative\"`\n * emits the SDK's `composeExtension` blueprint loop (package-mode only, for any\n * capability — see {@link buildDeclarativeEntrypoint}).\n */\nexport type ExtensionScaffoldStyle = \"imperative\" | \"declarative\";\n\n/**\n * Builds the starter command path from the normalized package/extension name.\n * Names that start with a built-in pm command or executable alias are prefixed\n * with `starter` so the generated command dispatches to the package instead of\n * being consumed by core command parsing.\n */\nexport function buildScaffoldCommandName(extensionName: string): string {\n const commandWords = extensionName\n .replace(/-/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n if (commandWords.length === 0) {\n return \"starter ping\";\n }\n const firstWordLower = commandWords[0]!.toLowerCase();\n let leadingStarterWords = 0;\n while (commandWords[leadingStarterWords]?.toLowerCase() === \"starter\") {\n leadingStarterWords += 1;\n }\n const nextStarterWord = commandWords[leadingStarterWords]?.toLowerCase();\n const starterRootCollision =\n leadingStarterWords > 0 &&\n (leadingStarterWords === commandWords.length || (nextStarterWord !== undefined && RESERVED_SCAFFOLD_COMMAND_ROOTS.has(nextStarterWord)));\n const reservedRoot = RESERVED_SCAFFOLD_COMMAND_ROOTS.has(firstWordLower) || starterRootCollision;\n const resolvedWords = reservedRoot ? [\"starter\", ...commandWords] : commandWords;\n return `${resolvedWords.join(\" \")} ping`;\n}\n\n/**\n * Build the project-profile archetype object literal the `profile` starter\n * registers — a complete {@link ProjectProfileDefinition} derived from the package\n * name: one custom item type, a custom status, a custom field, a per-type workflow,\n * offline search config, a create template, and an advisory package recommendation.\n *\n * Returned as the lines BETWEEN the object braces at a two-space base indent. Both\n * authoring styles read from this single source so they never drift: the imperative\n * {@link buildActivateBodyLines} wraps them in `api.registerProfile({ ... })`\n * (re-indenting by the `activate` body offset) and the declarative\n * {@link buildDeclarativeBlueprintSurface} wraps them in\n * `defineProjectProfile({ ... })`.\n */\nfunction buildProfileArchetypeFieldLines(extensionName: string): string[] {\n const typeName = extensionName;\n const typeFolder = `${extensionName}s`;\n // De-hyphenate for a short alias; omit a redundant self-alias for single-word names.\n const typeAlias = extensionName.replace(/-/g, \"\");\n const typeAliases = typeAlias === typeName ? [] : [typeAlias];\n const fieldKey = `${extensionName.replace(/-/g, \"_\")}_owner`;\n const statusId = \"reviewing\";\n return [\n ` name: ${JSON.stringify(extensionName)},`,\n ` title: ${JSON.stringify(`${extensionName} archetype`)},`,\n ' summary: \"Starter project profile. Replace these dimensions with your own archetype.\",',\n \" // Item types the profile upserts into the project schema when applied.\",\n \" types: [\",\n \" {\",\n ` name: ${JSON.stringify(typeName)},`,\n ` folder: ${JSON.stringify(typeFolder)},`,\n ` aliases: ${JSON.stringify(typeAliases)},`,\n ` description: ${JSON.stringify(`A ${extensionName} work item that flows to done.`)},`,\n \" },\",\n \" ],\",\n \" // Custom statuses upserted into the project status set.\",\n \" statuses: [\",\n \" {\",\n ` id: ${JSON.stringify(statusId)},`,\n ' roles: [\"active\"],',\n ' aliases: [\"in-review\"],',\n ' description: \"Work is implementation-complete and awaiting review.\",',\n \" },\",\n \" ],\",\n \" // Custom front-matter fields the archetype tracks.\",\n \" fields: [\",\n \" {\",\n ` key: ${JSON.stringify(fieldKey)},`,\n ' type: \"string\",',\n ' commands: [\"create\", \"update\", \"list\"],',\n ' description: \"Stakeholder accountable for the item.\",',\n \" },\",\n \" ],\",\n \" // Per-type workflow transition allow-list staged into settings.\",\n \" workflows: [\",\n \" {\",\n ` type: ${JSON.stringify(typeName)},`,\n \" allowed_transitions: [\",\n ' [\"open\", \"in_progress\"],',\n ` [\"in_progress\", ${JSON.stringify(statusId)}],`,\n ` [${JSON.stringify(statusId)}, \"in_progress\"],`,\n ` [${JSON.stringify(statusId)}, \"closed\"],`,\n ' [\"in_progress\", \"blocked\"],',\n ' [\"blocked\", \"in_progress\"],',\n \" ],\",\n \" },\",\n \" ],\",\n \" // Nested-settings knobs staged when the profile is applied.\",\n \" config: [\",\n ' { key: \"search_provider\", value: \"bm25\", summary: \"Offline BM25 lexical search needs no embedding service.\" },',\n ' { key: \"search_max_results\", value: \"20\", summary: \"Result cap tuned for quick triage.\" },',\n \" ],\",\n \" // Create templates staged into <pmRoot>/templates.\",\n \" templates: [\",\n \" {\",\n ` name: ${JSON.stringify(extensionName)},`,\n \" options: {\",\n ` type: ${JSON.stringify(typeName)},`,\n ' priority: \"2\",',\n ` tags: ${JSON.stringify(extensionName)},`,\n ' acceptanceCriteria: \"Item delivers the stated outcome with tests and docs updated.\",',\n ' body: \"## Context\\\\n\\\\n## Acceptance\\\\n- [ ] \\\\n\",',\n \" },\",\n \" },\",\n \" ],\",\n \" // Advisory package recommendations (never auto-installed).\",\n \" packages: [\",\n ' { spec: \"templates\", reason: \"Reusable create templates for recurring item shapes.\" },',\n \" ],\",\n ];\n}\n\n/**\n * Build the `activate` body lines for the starter entrypoint. The base body\n * always registers the starter command; capability-specific variants append\n * the matching SDK surface so generated packages demonstrate one runnable\n * customization primitive end to end.\n */\nfunction buildActivateBodyLines(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string[] {\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const commandLines = [\n \" api.registerCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \" });\",\n ];\n if (capability === \"commands\") {\n return commandLines;\n }\n if (capability === \"search\") {\n return [\n ...commandLines,\n \"\",\n \" // Search providers let packages customize how pm ranks and retrieves\",\n \" // project context. This starter is deterministic and dependency-free:\",\n \" // replace the scoring with your domain retrieval, embedding, or rerank\",\n \" // logic as the package grows.\",\n \" api.registerSearchProvider({\",\n ` name: ${JSON.stringify(searchProviderName)},`,\n \" query: async (context) => {\",\n \" const needle = context.query.toLowerCase();\",\n \" const hits = context.documents\",\n \" .filter((document) => {\",\n \" const title = String(document.metadata.title ?? \\\"\\\").toLowerCase();\",\n \" return title.includes(needle);\",\n \" })\",\n \" .map((document) => ({\",\n \" id: document.metadata.id,\",\n \" score: 1,\",\n ' matched_fields: [\"title\"],',\n \" }));\",\n \" return { hits };\",\n \" },\",\n \" embed: async (context) => [context.input.length],\",\n \" });\",\n \"\",\n \" // Vector-store adapters let packages own semantic index storage. This\",\n \" // starter returns a stable in-memory hit so generated tests can exercise\",\n \" // the adapter without external services.\",\n \" api.registerVectorStoreAdapter({\",\n ` name: ${JSON.stringify(vectorAdapterName)},`,\n \" query: async (context) => [{ id: \\\"starter-vector-hit\\\", score: context.limit }],\",\n \" upsert: async (context) => ({ upserted: context.points.length }),\",\n \" delete: async (context) => ({ deleted: context.ids.length }),\",\n \" });\",\n ];\n }\n if (capability === \"schema\") {\n const itemTypeName = extensionName;\n const itemTypeFolder = `${extensionName}s`;\n // De-hyphenate for a short alias (e.g. \"my-tracker\" -> \"mytracker\"). For a\n // single-word name the de-hyphenated form equals the type name, so omit the\n // alias rather than register a redundant self-alias in the starter.\n const itemTypeAlias = extensionName.replace(/-/g, \"\");\n const itemTypeAliases = itemTypeAlias === itemTypeName ? [] : [itemTypeAlias];\n const fieldName = `${extensionName.replace(/-/g, \"_\")}_note`;\n const migrationId = `${extensionName}-0001-init`;\n return [\n ...commandLines,\n \"\",\n \" // Schema registrations let a package model its own project domain — the\",\n \" // heart of \\\"project management = context management\\\". Item types and fields\",\n \" // are GLOBAL contributions: built-in commands like `pm create <type>` and\",\n \" // `pm list --type <type>` must see them, so this package declares no\",\n \" // `activation.commands` and pm activates it conservatively for every command.\",\n \" // The `schema` capability in manifest.json grants all three registrations.\",\n \" api.registerItemFields([\",\n \" {\",\n ` name: ${JSON.stringify(fieldName)},`,\n ' type: \"string\",',\n \" optional: true,\",\n \" },\",\n \" ]);\",\n \"\",\n \" api.registerItemTypes([\",\n \" {\",\n ` name: ${JSON.stringify(itemTypeName)},`,\n \" // Replace with your domain's canonical plural folder name.\",\n ` folder: ${JSON.stringify(itemTypeFolder)},`,\n ` aliases: ${JSON.stringify(itemTypeAliases)},`,\n \" // Add field names here to force them at `pm create` time.\",\n \" required_create_fields: [],\",\n \" },\",\n \" ]);\",\n \"\",\n \" // Migrations let a package evolve stored items as its schema changes. pm\",\n \" // runs each migration ONCE through the preflight gate (not once per item),\",\n \" // passing a context that identifies the migration itself: `context.id` is\",\n \" // the migration id (not an item id), alongside `context.pm_root` — iterate\",\n \" // the corpus yourself from there. This starter is a deterministic no-op so\",\n \" // package tests can invoke it without touching the corpus; replace the body\",\n \" // with your real rewrite.\",\n \" api.registerMigration({\",\n ` id: ${JSON.stringify(migrationId)},`,\n ` description: ${JSON.stringify(`Initialize ${extensionName} schema state.`)},`,\n \" mandatory: false,\",\n \" run: async (context) => ({ migrated: true, id: context.id }),\",\n \" });\",\n ];\n }\n if (capability === \"profile\") {\n return [\n ...commandLines,\n \"\",\n \" // A project profile is the broadest customization primitive pm has: one\",\n \" // declarative bundle of item types, custom statuses, fields, a per-type\",\n \" // workflow, config knobs, create templates, and package recommendations. Once\",\n \" // this package is installed the profile resolves by name through `pm profile\",\n \" // list`, `pm profile show`, and `pm profile apply`, which stages every dimension\",\n \" // idempotently like a core archetype. A profile registration is a schema+config\",\n \" // bundle, so the `schema` capability in manifest.json grants it.\",\n \" api.registerProfile({\",\n // The archetype field lines are all non-empty, so re-indent each by the\n // `activate` body offset (object braces sit at two spaces, fields at four).\n ...buildProfileArchetypeFieldLines(extensionName).map((line) => ` ${line}`),\n \" });\",\n ];\n }\n if (capability === \"importers\") {\n return [\n ...commandLines,\n \"\",\n \" // Importers/exporters are the bridge between pm's context graph and\",\n \" // another project-management system. Keep the starter deterministic so\",\n \" // package tests can run without touching the network or filesystem; replace\",\n \" // these payloads with your adapter's real mapping as the package grows.\",\n \" api.registerImporter(\",\n ` ${JSON.stringify(adapterName)},`,\n \" async (context) => ({\",\n \" imported: 1,\",\n \" source: context.options.source ?? \\\"starter\\\",\",\n \" args: context.args,\",\n \" }),\",\n \" {\",\n ` action: ${JSON.stringify(`${adapterName} import`)},`,\n ' description: \"Import starter records into pm context.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--source\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Source name or path to import from.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" );\",\n \"\",\n \" api.registerExporter(\",\n ` ${JSON.stringify(adapterName)},`,\n \" async (context) => ({\",\n \" exported: true,\",\n \" destination: context.options.destination ?? \\\"stdout\\\",\",\n \" args: context.args,\",\n \" }),\",\n \" {\",\n ` action: ${JSON.stringify(`${adapterName} export`)},`,\n ' description: \"Export pm context into starter records.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--destination\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Destination name or path to export to.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" );\",\n ];\n }\n if (capability === \"renderers\") {\n return [\n ...commandLines,\n \"\",\n \" // Renderer overrides customize how pm serializes a command's structured\",\n \" // result for an output format (\\\"toon\\\" or \\\"json\\\"). pm runs this override for\",\n \" // EVERY command's output in that format, so it scopes itself to THIS\",\n \" // package's own command and returns null — pass-through to pm's default\",\n \" // renderer — for everything else. Return a string to take over rendering.\",\n \" // The `renderers` capability in manifest.json grants the registration.\",\n ' api.registerRenderer(\"toon\", (context) => {',\n ` if (context.command !== ${JSON.stringify(commandName)}) {`,\n \" return null;\",\n \" }\",\n ` return ${JSON.stringify(`${extensionName}: `)} + JSON.stringify(context.result);`,\n \" });\",\n ];\n }\n if (capability === \"parser\") {\n return [\n // The parser starter declares its own flags so the override is runnable end\n // to end through `pm <command> --shout`: the command defines the deprecated\n // `--shout` alias and canonical `--upper` flag, the parser rewrites one to\n // the other, and the handler surfaces the normalized value. Flag metadata\n // needs the `schema` capability (declared in manifest.json).\n \" api.registerCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--shout\",',\n ' value_type: \"boolean\",',\n ' description: \"Deprecated alias for --upper; the parser override rewrites it.\",',\n \" },\",\n \" {\",\n ' long: \"--upper\",',\n ' value_type: \"boolean\",',\n ' description: \"Echo the canonical flag the parser override produces.\",',\n \" },\",\n \" ],\",\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n \" // Surfaces the normalized option so `--shout`/`--upper` is observable.\",\n \" upper: context.options.upper === true,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \" });\",\n \"\",\n \" // Parser overrides preprocess a command's parsed options BEFORE its handler\",\n \" // runs, returning a delta — only the keys you set are merged over the parsed\",\n \" // input. This override is scoped to THIS package's own command. Here it\",\n \" // rewrites the deprecated `--shout` boolean alias to the canonical `--upper`\",\n \" // flag; replace it with your command's real normalization. The `parser`\",\n \" // capability in manifest.json grants the registration.\",\n ` api.registerParser(${JSON.stringify(commandName)}, (context) => {`,\n \" const options = { ...context.options };\",\n \" if (options.shout === true) {\",\n \" options.upper = true;\",\n \" }\",\n \" delete options.shout;\",\n \" return { options };\",\n \" });\",\n ];\n }\n if (capability === \"preflight\") {\n return [\n ...commandLines,\n \"\",\n \" // Preflight overrides adjust pm's pre-run gate decision (extension\",\n \" // migrations + item-format checks) before EVERY command — the last\",\n \" // registered override wins. Return a delta of the keys you want to change\",\n \" // (enforce_item_format_gate, run_preflight_item_format_sync,\",\n \" // run_extension_migrations, enforce_mandatory_migration_gate); returning\",\n \" // context.decision unchanged is a safe no-op so installing the package does\",\n \" // not alter gate behavior — replace it with your policy, e.g.\",\n \" // `{ run_extension_migrations: false }`. The `preflight` capability in\",\n \" // manifest.json grants the registration.\",\n \" api.registerPreflight((context) => context.decision);\",\n ];\n }\n if (capability === \"services\") {\n return [\n ...commandLines,\n \"\",\n \" // Service overrides replace a built-in pm service. The `output_format`\",\n \" // service renders a command's structured result; returning the payload\",\n \" // unchanged passes through to pm's default formatting. This override scopes\",\n \" // itself to THIS package's own command and passes every other command\",\n \" // through, so it never disrupts unrelated output. The `services` capability\",\n \" // in manifest.json grants the registration.\",\n ' api.registerService(\"output_format\", (context) => {',\n ` if (context.command !== ${JSON.stringify(commandName)}) {`,\n \" return context.payload;\",\n \" }\",\n ` return { rendered_by: ${JSON.stringify(extensionName)}, payload: context.payload };`,\n \" });\",\n ];\n }\n return [\n ...commandLines,\n \"\",\n \" // after_command hooks fire once pm finishes a command, receiving the items\",\n \" // it mutated. This is the natural place to react to every change - sync to\",\n \" // an external system, emit telemetry, or refresh derived context\",\n ' // (\"project management = context management\"). This starter is a documented',\n \" // no-op on the success path; replace the body with your own reaction.\",\n \" api.hooks.afterCommand((context) => {\",\n \" if (!context.ok) {\",\n \" return;\",\n \" }\",\n \" // `context.affected` lists the items pm mutated (id, status,\",\n \" // changed_fields). React here, e.g.:\",\n \" // for (const item of context.affected ?? []) { /* ...item.id... */ }\",\n \" });\",\n ];\n}\n\n/**\n * Build the colocated `node:test` sample suite (`index.test.ts`) for the chosen\n * capability. Authored in TypeScript and run through the generated package's\n * `npm test` script (typecheck first, then `node --test`, which strips types on\n * Node >=22.18), it imports the `./index.ts` manifest entry directly under\n * NodeNext resolution.\n * Every variant covers activation, command invocation, and teardown via\n * `createExtensionTestHarness`; capability variants add tests that use the\n * harness-bound `assert*`/`run*` helpers and deactivate in `finally`.\n */\nfunction buildSampleTestSource(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string {\n const hooksEnabled = capability === \"hooks\";\n const searchEnabled = capability === \"search\";\n const importersEnabled = capability === \"importers\";\n const schemaEnabled = capability === \"schema\";\n const profileEnabled = capability === \"profile\";\n const renderersEnabled = capability === \"renderers\";\n const parserEnabled = capability === \"parser\";\n const preflightEnabled = capability === \"preflight\";\n const servicesEnabled = capability === \"services\";\n const capabilitiesLiteral = SAMPLE_TEST_CAPABILITIES_LITERAL[capability];\n const itemTypeName = extensionName;\n const itemTypeFolder = `${extensionName}s`;\n const fieldName = `${extensionName.replace(/-/g, \"_\")}_note`;\n const migrationId = `${extensionName}-0001-init`;\n const importNames = [\n \" assertExtensionDeactivated,\",\n \" createExtensionTestHarness,\",\n ];\n const hookTestLines = hooksEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} reacts to commands via its after_command hook`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertHook throws unless an after_command hook is registered, so\",\n \" // reaching the next line already proves the hook is wired.\",\n \" ext.assertHook({\",\n ' kind: \"after_command\",',\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n \" // runHook fires the hook through pm's real runner with a synthetic\",\n \" // context and returns the warnings it produced; a clean hook returns none.\",\n \" // Replace the context/assertions as your hook grows.\",\n \" const warnings = await ext.runHook({\",\n ' kind: \"after_command\",',\n \" context: {\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n ' pm_root: \"\",',\n \" ok: true,\",\n \" affected: [],\",\n \" },\",\n \" });\",\n \" assert.deepEqual(warnings, []);\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n const searchTestLines = searchEnabled\n ? buildDeclarativeCapabilityTestBlock(extensionName, commandName, \"search\", capabilitiesLiteral)\n : [];\n const importerTestLines = importersEnabled\n ? buildDeclarativeCapabilityTestBlock(extensionName, commandName, \"importers\", capabilitiesLiteral)\n : [];\n const schemaTestLines = schemaEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers and runs its custom schema`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n ...indentGeneratedLines(\n buildSchemaCapabilityAssertionLines({\n extensionName,\n itemTypeName,\n itemTypeFolder,\n fieldName,\n migrationId,\n includeMigrationReplacementHint: true,\n }),\n \" \",\n ),\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n const profileTestLines = profileEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers its project profile`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n ...indentGeneratedLines(buildProfileCapabilityAssertionLines(extensionName), \" \"),\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n const rendererTestLines = renderersEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} registers and invokes its renderer override`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertRendererOverride throws unless a renderer is registered for the\",\n \" // format, so reaching the next line already proves the wiring.\",\n ` const override = ext.assertRendererOverride({ format: \"toon\", extensionName: ${JSON.stringify(extensionName)} });`,\n ' assert.equal(override.format, \"toon\");',\n \"\",\n \" // runRendererOverride renders through pm's real runner. The override\",\n \" // customizes only THIS package's command output and returns a string the\",\n \" // host uses verbatim. Replace the assertions as it grows.\",\n \" const rendered = await ext.runRendererOverride({\",\n ' format: \"toon\",',\n ` command: ${JSON.stringify(commandName)},`,\n \" result: { ok: true },\",\n \" });\",\n \" assert.equal(rendered.overridden, true);\",\n ` assert.equal(rendered.rendered, ${JSON.stringify(`${extensionName}: `)} + JSON.stringify({ ok: true }));`,\n \"\",\n \" // Output for any other command passes through to pm's default renderer.\",\n \" const passthrough = await ext.runRendererOverride({\",\n ' format: \"toon\",',\n ' command: \"list\",',\n \" result: { ok: true },\",\n \" });\",\n \" assert.equal(passthrough.overridden, false);\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n const parserTestLines = parserEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} rewrites command options via its parser override`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertParserOverride throws unless a parser is registered for the\",\n \" // command, so reaching the next line already proves the wiring.\",\n ` ext.assertParserOverride({ command: ${JSON.stringify(commandName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // runParserOverride runs the override through pm's real parser runner and\",\n \" // returns the rewritten context. The starter rewrites the deprecated\",\n \" // `shout` alias to the canonical `upper` flag.\",\n \" const result = await ext.runParserOverride({\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n \" options: { shout: true },\",\n \" global: {},\",\n ' pm_root: \"\",',\n \" });\",\n \" assert.equal(result.overridden, true);\",\n \" assert.deepEqual(result.context.options, { upper: true });\",\n \"\",\n \" // End to end: feed the rewritten options into the command handler to\",\n \" // prove `pm <command> --shout` surfaces the normalized `upper` flag in\",\n \" // the result.\",\n ` const invocation = await ext.runCommand({ command: ${JSON.stringify(commandName)}, options: result.context.options });`,\n \" assert.equal(invocation.handled, true);\",\n \" assert.deepEqual(invocation.result, {\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n ` command: ${JSON.stringify(commandName)},`,\n \" upper: true,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" });\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n const preflightTestLines = preflightEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} returns a preflight gate decision via its override`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertPreflightOverride throws unless a preflight override is\",\n \" // registered, so reaching the next line already proves the wiring.\",\n ` ext.assertPreflightOverride({ extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // runPreflightOverride runs the override through pm's real runner with a\",\n \" // synthetic gate decision. The starter echoes the decision unchanged;\",\n \" // replace the values/assertions with your real policy.\",\n \" const decision = {\",\n \" enforce_item_format_gate: true,\",\n \" run_preflight_item_format_sync: false,\",\n \" run_extension_migrations: true,\",\n \" enforce_mandatory_migration_gate: false,\",\n \" };\",\n \" const result = await ext.runPreflightOverride({\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n \" options: {},\",\n \" global: {},\",\n ' pm_root: \"\",',\n \" decision,\",\n \" });\",\n \" assert.equal(result.overridden, true);\",\n \" assert.deepEqual(result.decision, decision);\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n const serviceTestLines = servicesEnabled\n ? [\n `test(${JSON.stringify(`${extensionName} customizes command output via its service override`)}, async () => {`,\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertServiceOverride throws unless a service override is registered\",\n \" // for the service, so reaching the next line proves the wiring.\",\n ` ext.assertServiceOverride({ service: \"output_format\", extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // runServiceOverride runs the override through pm's real service runner.\",\n \" // The override customizes only THIS package's command output (handled),\",\n \" // passing every other command through (not handled).\",\n \" const handled = await ext.runServiceOverride({\",\n ' service: \"output_format\",',\n ` command: ${JSON.stringify(commandName)},`,\n \" payload: { ok: true },\",\n \" });\",\n \" assert.equal(handled.handled, true);\",\n ` assert.deepEqual(handled.result, { rendered_by: ${JSON.stringify(extensionName)}, payload: { ok: true } });`,\n \"\",\n \" // Output for any other command passes through to pm's default formatter.\",\n \" const passthrough = await ext.runServiceOverride({\",\n ' service: \"output_format\",',\n ' command: \"list\",',\n \" payload: { ok: true },\",\n \" });\",\n \" assert.equal(passthrough.handled, false);\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ]\n : [];\n return [\n 'import assert from \"node:assert/strict\";',\n 'import { test } from \"node:test\";',\n \"import {\",\n ...importNames,\n '} from \"@unbrained/pm-cli/sdk/testing\";',\n // The search sample's synthetic query/vector contexts reference these SDK types\n // for their typed-stub fixtures; other capabilities need no extra type imports.\n ...(searchEnabled ? ['import type { ItemDocument, PmSettings } from \"@unbrained/pm-cli/sdk\";'] : []),\n 'import extension from \"./index.ts\";',\n \"\",\n ...SAMPLE_HARNESS_CLEANUP_LINES,\n `test(${JSON.stringify(`${extensionName} registers its starter command`)}, async () => {`,\n \" // `capabilities` mirrors manifest.json so the in-memory activation grants\",\n \" // the capabilities the entrypoint relies on.\",\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertCommandContract is bound to the right activation registry and throws\",\n \" // if the command is not registered, so reaching here already proves the\",\n \" // wiring; assert on the returned definition to inspect metadata.\",\n \" const registered = ext.assertCommandContract({\",\n ` command: ${JSON.stringify(commandName)},`,\n ` extensionName: ${JSON.stringify(extensionName)},`,\n \" });\",\n ' assert.equal(typeof registered.command.description, \"string\");',\n \"\",\n \" // runCommand invokes the handler through pm's real dispatch engine, so this\",\n \" // asserts behavior - not just that the command is wired. Replace these\",\n \" // assertions as you flesh out your command.\",\n \" const invocation = await ext.runCommand({\",\n ` command: ${JSON.stringify(commandName)},`,\n \" });\",\n \" assert.equal(invocation.handled, true);\",\n \" // The handler result is typed `unknown`, so deep-equality on the whole\",\n \" // structured payload keeps the assertion type-safe without a cast.\",\n \" assert.deepEqual(invocation.result, {\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n ` command: ${JSON.stringify(commandName)},`,\n // The parser starter's command surfaces the normalized `upper` flag, which\n // defaults to false when the command is invoked without `--shout`/`--upper`.\n ...(parserEnabled ? [\" upper: false,\"] : []),\n ' message: \"Starter extension scaffold is active.\",',\n \" });\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ...hookTestLines,\n ...searchTestLines,\n ...importerTestLines,\n ...schemaTestLines,\n ...profileTestLines,\n ...rendererTestLines,\n ...parserTestLines,\n ...preflightTestLines,\n ...serviceTestLines,\n `test(${JSON.stringify(`${extensionName} tears down cleanly via deactivate`)}, async () => {`,\n \" // createExtensionTestHarness binds teardown to the same name/layer used for\",\n \" // activation, so this proves your `deactivate` hook runs without throwing.\",\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" const teardown = await ext.deactivate();\",\n \" // assertExtensionDeactivated throws unless exactly one extension tore down\",\n \" // with no failures, so reaching the next line already proves teardown ran.\",\n \" assertExtensionDeactivated(teardown);\",\n \" assert.equal(teardown.deactivated, 1);\",\n \"});\",\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * Build the manifest `activation.commands` list for the chosen capability: the\n * exact command paths the starter `activate` registers.\n *\n * pm uses this list for lazy activation — it imports and activates the package\n * only when an invoked command path matches one of these entries — so it must\n * stay in sync with the registrations in {@link buildActivateBodyLines}. Every\n * first-party bundled package declares the same field; emitting it keeps\n * generated packages on that convention so they get precise, lazy, correct\n * activation instead of falling back to capability heuristics (which cannot\n * enumerate the contributed commands). The `importers` variant additionally\n * registers paired import/export command handlers under the adapter name.\n *\n * The `schema` and `profile` variants are the deliberate exceptions: each returns\n * an empty list so the manifest omits `activation.commands`. Custom item types and\n * fields are GLOBAL schema contributions that built-in commands (`pm create\n * <type>`, `pm list --type <type>`, `pm validate`) must see, and a contributed\n * project profile is resolved by the built-in `pm profile list/show/apply` commands\n * — commands the package does not own and cannot enumerate. Declaring narrow\n * `activation.commands` there would gate activation to only the listed commands and\n * silently leave the custom type or profile unregistered for those built-ins;\n * omitting it lets pm's conservative activation tier (which covers `schema`) load\n * the package for every command.\n */\nfunction buildScaffoldActivationCommands(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string[] {\n if (capability === \"schema\" || capability === \"profile\") {\n return [];\n }\n if (capability === \"importers\") {\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n return [commandName, `${adapterName} import`, `${adapterName} export`];\n }\n return [commandName];\n}\n\n// One-line surface phrase per capability, listing the registration surfaces the\n// declarative blueprint populates beyond the always-present starter command. Used\n// to keep the generated README's entrypoint bullet accurate per capability.\nconst DECLARATIVE_ENTRYPOINT_SURFACE_PHRASE: Record<ExtensionScaffoldCapability, string> = {\n commands: \"starter command\",\n hooks: \"starter command and after_command hook\",\n search: \"starter command, search provider, and vector-store adapter\",\n importers: \"starter command, importer, and exporter\",\n schema: \"starter command, custom item type, item field, and migration\",\n profile: \"starter command and project profile\",\n renderers: \"starter command and toon renderer override\",\n parser: \"starter command and parser override\",\n preflight: \"starter command and preflight override\",\n services: \"starter command and output_format service override\",\n};\n\n// The `ExtensionBlueprint` fields each capability populates, rendered as inline\n// code in the README's Declarative Authoring section so authors can see which\n// blueprint surface maps to the capability they scaffolded.\nconst DECLARATIVE_CAPABILITY_BLUEPRINT_FIELDS: Record<ExtensionScaffoldCapability, string> = {\n commands: \"`commands`\",\n hooks: \"`commands` and `hooks.afterCommand`\",\n search: \"`commands`, `searchProviders`, and `vectorStoreAdapters`\",\n importers: \"`commands`, `importers`, and `exporters`\",\n schema: \"`commands`, `itemTypes`, `itemFields`, and `migrations`\",\n profile: \"`commands` and `profiles`\",\n renderers: \"`commands` and `renderers`\",\n parser: \"`commands` and `parsers`\",\n preflight: \"`commands` and `preflights`\",\n services: \"`commands` and `services`\",\n};\n\n/**\n * The shared per-capability registration-definition builder for the declarative\n * starter: the `define*`-authored definitions, the `ExtensionBlueprint` fields that\n * collect them, and the extra `define*` builder names to import. It is the single\n * source the declarative {@link buildDeclarativeEntrypoint} and its colocated test\n * ({@link buildDeclarativeCapabilityTestBlock}) both read from, so the two never\n * drift on what the capability registers.\n */\ninterface DeclarativeBlueprintSurface {\n /** Extra `define*` builder names to import beyond the always-present trio. */\n builderImports: string[];\n /** The `export const <name> = define*({...})` definition blocks (blank-separated). */\n definitions: string[];\n /** The `ExtensionBlueprint` object field lines, e.g. ` searchProviders: [searchProvider],`. */\n blueprintFields: string[];\n}\n\n/**\n * Build the `defineCommand` starter-command definition for the declarative\n * entrypoint. Mirrors the imperative {@link buildActivateBodyLines} command body\n * (same name/description/run result), and for the `parser` capability declares the\n * `--shout`/`--upper` flags and surfaces the normalized `upper` option so the\n * override is runnable end to end through `pm <command> --shout`.\n */\nfunction buildDeclarativePingCommandLines(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string[] {\n const parserEnabled = capability === \"parser\";\n return [\n \"// The starter command, authored with the `defineCommand` builder so its literal\",\n \"// name is preserved and the handler `context` is inferred. Exporting it lets you\",\n \"// unit-test the definition in isolation, apart from the blueprint.\",\n \"export const pingCommand = defineCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n ...(parserEnabled\n ? [\n \" flags: [\",\n \" {\",\n ' long: \"--shout\",',\n ' value_type: \"boolean\",',\n ' description: \"Deprecated alias for --upper; the parser override rewrites it.\",',\n \" },\",\n \" {\",\n ' long: \"--upper\",',\n ' value_type: \"boolean\",',\n ' description: \"Echo the canonical flag the parser override produces.\",',\n \" },\",\n \" ],\",\n ]\n : []),\n \" run: async (context) => ({\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n \" command: context.command,\",\n ...(parserEnabled ? [\" upper: context.options.upper === true,\"] : []),\n ' message: \"Starter extension scaffold is active.\",',\n \" }),\",\n \"});\",\n ];\n}\n\n/**\n * Build the {@link DeclarativeBlueprintSurface} for a capability: the starter\n * command plus the capability's `define*`-authored registration definitions and\n * the `ExtensionBlueprint` fields that collect them.\n *\n * Blueprint fields are emitted in {@link composeExtension}'s registration order so\n * the generated `activate` wires them deterministically. Each surface mirrors the\n * imperative {@link buildActivateBodyLines} registration (same names, same handler\n * behavior) so a package scaffolded in either style installs and dispatches\n * identically — the manifest, derived capabilities, and registered surfaces match.\n */\nfunction buildDeclarativeBlueprintSurface(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): DeclarativeBlueprintSurface {\n const builderImports: string[] = [];\n const definitions: string[] = [...buildDeclarativePingCommandLines(extensionName, commandName, capability)];\n const blueprintFields: string[] = [\" commands: [pingCommand],\"];\n\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const itemTypeName = extensionName;\n const itemTypeFolder = `${extensionName}s`;\n // De-hyphenate for a short alias; omit a redundant self-alias for single-word names.\n const itemTypeAlias = extensionName.replace(/-/g, \"\");\n const itemTypeAliases = itemTypeAlias === itemTypeName ? [] : [itemTypeAlias];\n const fieldName = `${extensionName.replace(/-/g, \"_\")}_note`;\n const migrationId = `${extensionName}-0001-init`;\n\n switch (capability) {\n case \"commands\":\n break;\n case \"hooks\":\n builderImports.push(\"defineAfterCommandHook\");\n definitions.push(\n \"\",\n \"// after_command hooks fire once pm finishes a command, receiving the items it\",\n \"// mutated. React here - sync to an external system, emit telemetry, or refresh\",\n '// derived context (\"project management = context management\"). This starter is a',\n \"// documented no-op on the success path; replace the body with your own reaction.\",\n \"export const afterCommandHook = defineAfterCommandHook((context) => {\",\n \" if (!context.ok) {\",\n \" return;\",\n \" }\",\n \" // `context.affected` lists the items pm mutated (id, status, changed_fields):\",\n \" // for (const item of context.affected ?? []) { /* ...item.id... */ }\",\n \"});\",\n );\n blueprintFields.push(\" hooks: { afterCommand: [afterCommandHook] },\");\n break;\n case \"search\":\n builderImports.push(\"defineSearchProvider\", \"defineVectorStoreAdapter\");\n definitions.push(\n \"\",\n \"// Search providers let packages customize how pm ranks and retrieves project\",\n \"// context. This starter is deterministic and dependency-free: replace the scoring\",\n \"// with your domain retrieval, embedding, or rerank logic as the package grows.\",\n \"export const searchProvider = defineSearchProvider({\",\n ` name: ${JSON.stringify(searchProviderName)},`,\n \" query: async (context) => {\",\n \" const needle = context.query.toLowerCase();\",\n \" const hits = context.documents\",\n \" .filter((document) => {\",\n ' const title = String(document.metadata.title ?? \"\").toLowerCase();',\n \" return title.includes(needle);\",\n \" })\",\n \" .map((document) => ({\",\n \" id: document.metadata.id,\",\n \" score: 1,\",\n ' matched_fields: [\"title\"],',\n \" }));\",\n \" return { hits };\",\n \" },\",\n \" embed: async (context) => [context.input.length],\",\n \"});\",\n \"\",\n \"// Vector-store adapters let packages own semantic index storage. This starter\",\n \"// returns a stable in-memory hit so generated tests can exercise the adapter\",\n \"// without external services.\",\n \"export const vectorStoreAdapter = defineVectorStoreAdapter({\",\n ` name: ${JSON.stringify(vectorAdapterName)},`,\n ' query: async (context) => [{ id: \"starter-vector-hit\", score: context.limit }],',\n \" upsert: async (context) => ({ upserted: context.points.length }),\",\n \" delete: async (context) => ({ deleted: context.ids.length }),\",\n \"});\",\n );\n blueprintFields.push(\" searchProviders: [searchProvider],\", \" vectorStoreAdapters: [vectorStoreAdapter],\");\n break;\n case \"importers\":\n builderImports.push(\"defineExporter\", \"defineImporter\");\n definitions.push(\n \"\",\n \"// Importers/exporters are the bridge between pm's context graph and another\",\n \"// project-management system. Keep the starter deterministic so package tests can\",\n \"// run without touching the network or filesystem; replace these payloads with\",\n \"// your adapter's real mapping as the package grows.\",\n \"export const importer = defineImporter(async (context) => ({\",\n \" imported: 1,\",\n ' source: context.options.source ?? \"starter\",',\n \" args: context.args,\",\n \"}));\",\n \"\",\n \"export const exporter = defineExporter(async (context) => ({\",\n \" exported: true,\",\n ' destination: context.options.destination ?? \"stdout\",',\n \" args: context.args,\",\n \"}));\",\n );\n blueprintFields.push(\n \" importers: [\",\n \" {\",\n ` name: ${JSON.stringify(adapterName)},`,\n \" importer,\",\n \" options: {\",\n ` action: ${JSON.stringify(`${adapterName} import`)},`,\n ' description: \"Import starter records into pm context.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--source\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Source name or path to import from.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" },\",\n \" ],\",\n \" exporters: [\",\n \" {\",\n ` name: ${JSON.stringify(adapterName)},`,\n \" exporter,\",\n \" options: {\",\n ` action: ${JSON.stringify(`${adapterName} export`)},`,\n ' description: \"Export pm context into starter records.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--destination\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Destination name or path to export to.\",',\n \" },\",\n \" ],\",\n \" },\",\n \" },\",\n \" ],\",\n );\n break;\n case \"schema\":\n builderImports.push(\"defineItemField\", \"defineItemType\", \"defineMigration\");\n definitions.push(\n \"\",\n \"// Schema registrations let a package model its own project domain - the heart of\",\n '// \"project management = context management\". Item types and fields are GLOBAL',\n \"// contributions, so this package declares no `activation.commands` and pm\",\n \"// activates it conservatively for every command.\",\n \"export const noteField = defineItemField({\",\n ` name: ${JSON.stringify(fieldName)},`,\n ' type: \"string\",',\n \" optional: true,\",\n \"});\",\n \"\",\n \"export const itemType = defineItemType({\",\n ` name: ${JSON.stringify(itemTypeName)},`,\n \" // Replace with your domain's canonical plural folder name.\",\n ` folder: ${JSON.stringify(itemTypeFolder)},`,\n ` aliases: ${JSON.stringify(itemTypeAliases)},`,\n \" // Add field names here to force them at `pm create` time.\",\n \" required_create_fields: [],\",\n \"});\",\n \"\",\n \"// Migrations let a package evolve stored items as its schema changes. pm runs each\",\n \"// migration ONCE through the preflight gate (not once per item), passing a context\",\n \"// that identifies the migration itself: `context.id` is the migration id (not an\",\n \"// item id), alongside `context.pm_root`. This starter is a deterministic no-op so\",\n \"// package tests can invoke it without touching the corpus; replace the body with\",\n \"// your real rewrite.\",\n \"export const initMigration = defineMigration({\",\n ` id: ${JSON.stringify(migrationId)},`,\n ` description: ${JSON.stringify(`Initialize ${extensionName} schema state.`)},`,\n \" mandatory: false,\",\n \" run: async (context) => ({ migrated: true, id: context.id }),\",\n \"});\",\n );\n blueprintFields.push(\" itemTypes: [itemType],\", \" itemFields: [noteField],\", \" migrations: [initMigration],\");\n break;\n case \"profile\":\n builderImports.push(\"defineProjectProfile\");\n definitions.push(\n \"\",\n \"// A project profile is the broadest customization primitive pm has: one\",\n \"// declarative bundle of item types, custom statuses, fields, a per-type workflow,\",\n \"// config knobs, create templates, and package recommendations. Once installed it\",\n \"// resolves by name through `pm profile list/show/apply`, which stages every\",\n \"// dimension idempotently like a core archetype. A profile registration is a\",\n \"// schema+config bundle, so the `schema` capability grants it.\",\n \"export const starterProfile = defineProjectProfile({\",\n ...buildProfileArchetypeFieldLines(extensionName),\n \"});\",\n );\n blueprintFields.push(\" profiles: [starterProfile],\");\n break;\n case \"renderers\":\n builderImports.push(\"defineRendererOverride\");\n definitions.push(\n \"\",\n \"// Renderer overrides customize how pm serializes a command's structured result\",\n '// for an output format (\"toon\" or \"json\"). pm runs this override for EVERY',\n \"// command's output in that format, so it scopes itself to THIS package's own\",\n \"// command and returns null - pass-through to pm's default renderer - for\",\n \"// everything else. Return a string to take over rendering.\",\n \"export const toonRenderer = defineRendererOverride((context) => {\",\n ` if (context.command !== ${JSON.stringify(commandName)}) {`,\n \" return null;\",\n \" }\",\n ` return ${JSON.stringify(`${extensionName}: `)} + JSON.stringify(context.result);`,\n \"});\",\n );\n blueprintFields.push(\" renderers: { toon: toonRenderer },\");\n break;\n case \"parser\":\n builderImports.push(\"defineParserOverride\");\n definitions.push(\n \"\",\n \"// Parser overrides preprocess a command's parsed options BEFORE its handler runs,\",\n \"// returning a delta - only the keys you set are merged over the parsed input. This\",\n \"// override is scoped to THIS package's own command; here it rewrites the deprecated\",\n \"// `--shout` boolean alias to the canonical `--upper` flag.\",\n \"export const pingParser = defineParserOverride((context) => {\",\n \" const options = { ...context.options };\",\n \" if (options.shout === true) {\",\n \" options.upper = true;\",\n \" }\",\n \" delete options.shout;\",\n \" return { options };\",\n \"});\",\n );\n blueprintFields.push(` parsers: { ${JSON.stringify(commandName)}: pingParser },`);\n break;\n case \"preflight\":\n builderImports.push(\"definePreflightOverride\");\n definitions.push(\n \"\",\n \"// Preflight overrides adjust pm's pre-run gate decision (extension migrations +\",\n \"// item-format checks) before EVERY command - the last registered override wins.\",\n \"// Return a delta of the keys you want to change (enforce_item_format_gate,\",\n \"// run_preflight_item_format_sync, run_extension_migrations,\",\n \"// enforce_mandatory_migration_gate); returning context.decision unchanged is a\",\n \"// safe no-op - replace it with your policy, e.g. { run_extension_migrations: false }.\",\n \"export const preflightOverride = definePreflightOverride((context) => context.decision);\",\n );\n blueprintFields.push(\" preflights: [preflightOverride],\");\n break;\n case \"services\":\n builderImports.push(\"defineServiceOverride\");\n definitions.push(\n \"\",\n \"// Service overrides replace a built-in pm service. The `output_format` service\",\n \"// renders a command's structured result; returning the payload unchanged passes\",\n \"// through to pm's default formatting. This override scopes itself to THIS\",\n \"// package's own command and passes every other command through.\",\n \"export const outputService = defineServiceOverride((context) => {\",\n ` if (context.command !== ${JSON.stringify(commandName)}) {`,\n \" return context.payload;\",\n \" }\",\n ` return { rendered_by: ${JSON.stringify(extensionName)}, payload: context.payload };`,\n \"});\",\n );\n blueprintFields.push(\" services: { output_format: outputService },\");\n break;\n }\n\n return { builderImports, definitions, blueprintFields };\n}\n\n/**\n * Build the declarative (`composeExtension`) variant of the starter `index.ts` for\n * the chosen capability.\n *\n * Where {@link buildActivateBodyLines} emits an imperative `activate` that calls\n * `api.register*` directly, this emits the SDK's flagship declarative loop: the\n * capability's surfaces are authored with the `define*` builders (via the shared\n * {@link buildDeclarativeBlueprintSurface}), collected into an `ExtensionBlueprint`\n * by `defineExtensionBlueprint`, and turned into the runtime module by\n * `composeExtension` (which generates the `activate` that registers every blueprint\n * surface in order). Every definition, the blueprint, and the module are exported\n * so the colocated test can preflight the blueprint and exercise the module — see\n * {@link buildDeclarativeSampleTestSource}.\n *\n * It is package-mode by construction: `composeExtension` is a runtime SDK *value*\n * import, so it belongs in package-mode authoring where the SDK is a linked\n * dependency, not in the import-free extension-only starters.\n * {@link scaffoldExtensionProject} enforces that constraint before this is reached.\n */\nfunction buildDeclarativeEntrypoint(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string {\n const surface = buildDeclarativeBlueprintSurface(extensionName, commandName, capability);\n // `composeExtension`/`defineCommand`/`defineExtensionBlueprint` are always needed;\n // sort the full set so the import line is stable and idiomatic per capability.\n const builderImports = [\n \"composeExtension\",\n \"defineCommand\",\n \"defineExtensionBlueprint\",\n ...surface.builderImports,\n ].sort((left, right) => left.localeCompare(right));\n return [\n `import { ${builderImports.join(\", \")} } from \"@unbrained/pm-cli/sdk\";`,\n \"\",\n ...surface.definitions,\n \"\",\n \"// Declarative authoring: describe WHAT the package registers as a blueprint and\",\n \"// let `composeExtension` generate the `activate` that wires every surface in order,\",\n \"// instead of hand-writing each `api.register*` call. `defineExtensionBlueprint`\",\n \"// contract-checks the blueprint where it is authored. Keep `manifest.json`'s\",\n \"// `capabilities` equal to the set this blueprint derives.\",\n \"export const blueprint = defineExtensionBlueprint({\",\n ...surface.blueprintFields,\n \" // `deactivate` is the teardown counterpart to the generated `activate`: pm runs\",\n \" // it on host shutdown/reload to release anything the package opened (timers,\",\n \" // connections, caches). This starter holds none, so it stays a no-op.\",\n \" deactivate: () => {},\",\n \"});\",\n \"\",\n \"// `composeExtension(blueprint)` is the package's default export — the runtime\",\n \"// `ExtensionModule` pm loads. Guard the blueprint with `assertExtensionPreflight`\",\n \"// in index.test.ts before publishing.\",\n \"export default composeExtension(blueprint);\",\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * Build the capability-specific `node:test` block for the declarative starter:\n * a dedicated test that activates the composed module through\n * {@link ExtensionTestHarness} and asserts + invokes the capability's surface\n * (hook, search provider/adapter, importer/exporter, schema, renderer, parser,\n * preflight, or service override). Returns `[]` for the `commands` capability,\n * whose only surface — the starter command — is already covered by the base test.\n *\n * Each block mirrors the imperative {@link buildSampleTestSource} capability test\n * but reaches it through the harness's bound `assert*`/`run*` helpers instead of\n * the standalone helpers, so the declarative starter never threads\n * `activation.registrations` / `activation.parsers` / ... by hand.\n */\nfunction buildDeclarativeCapabilityTestBlock(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n capabilitiesLiteral: string,\n): string[] {\n if (capability === \"commands\") {\n return [];\n }\n const searchProviderName = `${extensionName}-search`;\n const vectorAdapterName = `${extensionName}-vector`;\n const adapterName = `${extensionName.replace(/-/g, \" \")} items`;\n const itemTypeName = extensionName;\n const itemTypeFolder = `${extensionName}s`;\n const fieldName = `${extensionName.replace(/-/g, \"_\")}_note`;\n const migrationId = `${extensionName}-0001-init`;\n const harness = [\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n ];\n const withHarnessCleanup = (body: string[]): string[] => [\n ...harness,\n \" let deactivated = false;\",\n \" try {\",\n ...body.map((line) => (line === \"\" ? line : ` ${line}`)),\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n ];\n switch (capability) {\n case \"hooks\":\n return [\n `test(${JSON.stringify(`${extensionName} reacts to commands via its after_command hook`)}, async () => {`,\n ...withHarnessCleanup([\n \" // assertHook throws unless an after_command hook is registered, so reaching the\",\n \" // next line already proves the hook is wired.\",\n ` ext.assertHook({ kind: \"after_command\", extensionName: ${JSON.stringify(extensionName)} });`,\n \" // runHook fires the hook through pm's real runner with a synthetic context and\",\n \" // returns the warnings it produced; a clean hook returns none.\",\n \" const warnings = await ext.runHook({\",\n ' kind: \"after_command\",',\n \" context: {\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n ' pm_root: \"\",',\n \" ok: true,\",\n \" affected: [],\",\n \" },\",\n \" });\",\n \" assert.deepEqual(warnings, []);\",\n ]),\n \"});\",\n \"\",\n ];\n case \"search\":\n return [\n `test(${JSON.stringify(`${extensionName} registers and invokes search primitives`)}, async () => {`,\n ...withHarnessCleanup([\n ` ext.assertSearchProvider({ provider: ${JSON.stringify(searchProviderName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n ` ext.assertVectorStoreAdapter({ adapter: ${JSON.stringify(vectorAdapterName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // The starter provider reads only document title/id, so `settings` is a minimal\",\n \" // typed stub and `documents` carry just the fields it inspects.\",\n \" const query = await ext.runSearchProvider({\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ' operation: \"query\",',\n \" context: {\",\n ' query: \"sync\",',\n ' mode: \"semantic\",',\n ' tokens: [\"sync\"],',\n \" options: {},\",\n \" settings: {} as PmSettings,\",\n \" documents: [\",\n ' { metadata: { id: \"pm-1\", title: \"Sync external context\" }, body: \"\" },',\n ' { metadata: { id: \"pm-2\", title: \"Unrelated task\" }, body: \"\" },',\n \" ] as ItemDocument[],\",\n \" },\",\n \" });\",\n ' assert.deepEqual(query, { hits: [{ id: \"pm-1\", score: 1, matched_fields: [\"title\"] }] });',\n \"\",\n \" const embedding = await ext.runSearchProvider({\",\n ` provider: ${JSON.stringify(searchProviderName)},`,\n ' operation: \"embed\",',\n ' context: { input: \"abc\", settings: {} as PmSettings, model: \"starter-model\" },',\n \" });\",\n \" assert.deepEqual(embedding, [3]);\",\n \"\",\n \" const vectorHits = await ext.runVectorStoreAdapter({\",\n ` adapter: ${JSON.stringify(vectorAdapterName)},`,\n ' operation: \"query\",',\n \" context: { vector: [0.1, 0.2], limit: 2, settings: {} as PmSettings },\",\n \" });\",\n ' assert.deepEqual(vectorHits, [{ id: \"starter-vector-hit\", score: 2 }]);',\n ]),\n \"});\",\n \"\",\n ];\n case \"importers\":\n return [\n `test(${JSON.stringify(`${extensionName} registers and invokes import/export primitives`)}, async () => {`,\n ...withHarnessCleanup([\n ` ext.assertImporter({ importer: ${JSON.stringify(adapterName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n ` ext.assertExporter({ exporter: ${JSON.stringify(adapterName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" const imported = await ext.runImporter({\",\n ` importer: ${JSON.stringify(adapterName)},`,\n ' options: { source: \"tickets\" },',\n ' args: [\"batch-1\"],',\n \" });\",\n \" assert.equal(imported.handled, true);\",\n ' assert.deepEqual(imported.result, { imported: 1, source: \"tickets\", args: [\"batch-1\"] });',\n \"\",\n \" const exported = await ext.runExporter({\",\n ` exporter: ${JSON.stringify(adapterName)},`,\n ' options: { destination: \"archive\" },',\n ' args: [\"done\"],',\n \" });\",\n \" assert.equal(exported.handled, true);\",\n ' assert.deepEqual(exported.result, { exported: true, destination: \"archive\", args: [\"done\"] });',\n ]),\n \"});\",\n \"\",\n ];\n case \"schema\":\n return [\n `test(${JSON.stringify(`${extensionName} registers and runs its custom schema`)}, async () => {`,\n ...withHarnessCleanup(\n buildSchemaCapabilityAssertionLines({\n extensionName,\n itemTypeName,\n itemTypeFolder,\n fieldName,\n migrationId,\n }),\n ),\n \"});\",\n \"\",\n ];\n case \"profile\":\n return [\n `test(${JSON.stringify(`${extensionName} registers its project profile`)}, async () => {`,\n ...withHarnessCleanup(buildProfileCapabilityAssertionLines(extensionName)),\n \"});\",\n \"\",\n ];\n case \"renderers\":\n return [\n `test(${JSON.stringify(`${extensionName} registers and invokes its renderer override`)}, async () => {`,\n ...withHarnessCleanup([\n \" // assertRendererOverride throws unless a renderer is registered for the format,\",\n \" // so reaching the next line already proves the wiring.\",\n ` const override = ext.assertRendererOverride({ format: \"toon\", extensionName: ${JSON.stringify(extensionName)} });`,\n ' assert.equal(override.format, \"toon\");',\n \"\",\n \" // runRendererOverride renders through pm's real runner. The override customizes\",\n \" // only THIS package's command output and returns a string the host uses verbatim.\",\n \" const rendered = await ext.runRendererOverride({\",\n ' format: \"toon\",',\n ` command: ${JSON.stringify(commandName)},`,\n \" result: { ok: true },\",\n \" });\",\n \" assert.equal(rendered.overridden, true);\",\n ` assert.equal(rendered.rendered, ${JSON.stringify(`${extensionName}: `)} + JSON.stringify({ ok: true }));`,\n \"\",\n \" // Output for any other command passes through to pm's default renderer.\",\n \" const passthrough = await ext.runRendererOverride({\",\n ' format: \"toon\",',\n ' command: \"list\",',\n \" result: { ok: true },\",\n \" });\",\n \" assert.equal(passthrough.overridden, false);\",\n ]),\n \"});\",\n \"\",\n ];\n case \"parser\":\n return [\n `test(${JSON.stringify(`${extensionName} rewrites command options via its parser override`)}, async () => {`,\n ...withHarnessCleanup([\n \" // assertParserOverride throws unless a parser is registered for the command, so\",\n \" // reaching the next line already proves the wiring.\",\n ` ext.assertParserOverride({ command: ${JSON.stringify(commandName)}, extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // runParserOverride runs the override through pm's real parser runner and returns\",\n \" // the rewritten context. The starter rewrites the deprecated `shout` alias to the\",\n \" // canonical `upper` flag.\",\n \" const result = await ext.runParserOverride({\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n \" options: { shout: true },\",\n \" global: {},\",\n ' pm_root: \"\",',\n \" });\",\n \" assert.equal(result.overridden, true);\",\n \" assert.deepEqual(result.context.options, { upper: true });\",\n \"\",\n \" // End to end: feed the rewritten options into the command handler to prove\",\n \" // `pm <command> --shout` surfaces the normalized `upper` flag in the result.\",\n ` const invocation = await ext.runCommand({ command: ${JSON.stringify(commandName)}, options: result.context.options });`,\n \" assert.equal(invocation.handled, true);\",\n \" assert.deepEqual(invocation.result, {\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n ` command: ${JSON.stringify(commandName)},`,\n \" upper: true,\",\n ' message: \"Starter extension scaffold is active.\",',\n \" });\",\n ]),\n \"});\",\n \"\",\n ];\n case \"preflight\":\n return [\n `test(${JSON.stringify(`${extensionName} returns a preflight gate decision via its override`)}, async () => {`,\n ...withHarnessCleanup([\n \" // assertPreflightOverride throws unless a preflight override is registered, so\",\n \" // reaching the next line already proves the wiring.\",\n ` ext.assertPreflightOverride({ extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // runPreflightOverride runs the override through pm's real runner with a synthetic\",\n \" // gate decision. The starter echoes the decision unchanged; replace the\",\n \" // values/assertions with your real policy.\",\n \" const decision = {\",\n \" enforce_item_format_gate: true,\",\n \" run_preflight_item_format_sync: false,\",\n \" run_extension_migrations: true,\",\n \" enforce_mandatory_migration_gate: false,\",\n \" };\",\n \" const result = await ext.runPreflightOverride({\",\n ` command: ${JSON.stringify(commandName)},`,\n \" args: [],\",\n \" options: {},\",\n \" global: {},\",\n ' pm_root: \"\",',\n \" decision,\",\n \" });\",\n \" assert.equal(result.overridden, true);\",\n \" assert.deepEqual(result.decision, decision);\",\n ]),\n \"});\",\n \"\",\n ];\n case \"services\":\n return [\n `test(${JSON.stringify(`${extensionName} customizes command output via its service override`)}, async () => {`,\n ...withHarnessCleanup([\n \" // assertServiceOverride throws unless a service override is registered for the\",\n \" // service, so reaching the next line proves the wiring.\",\n ` ext.assertServiceOverride({ service: \"output_format\", extensionName: ${JSON.stringify(extensionName)} });`,\n \"\",\n \" // runServiceOverride runs the override through pm's real service runner. The\",\n \" // override customizes only THIS package's command output (handled), passing every\",\n \" // other command through (not handled).\",\n \" const handled = await ext.runServiceOverride({\",\n ' service: \"output_format\",',\n ` command: ${JSON.stringify(commandName)},`,\n \" payload: { ok: true },\",\n \" });\",\n \" assert.equal(handled.handled, true);\",\n ` assert.deepEqual(handled.result, { rendered_by: ${JSON.stringify(extensionName)}, payload: { ok: true } });`,\n \"\",\n \" // Output for any other command passes through to pm's default formatter.\",\n \" const passthrough = await ext.runServiceOverride({\",\n ' service: \"output_format\",',\n ' command: \"list\",',\n \" payload: { ok: true },\",\n \" });\",\n \" assert.equal(passthrough.handled, false);\",\n ]),\n \"});\",\n \"\",\n ];\n }\n}\n\n/**\n * Build the declarative variant of the colocated `node:test` suite\n * (`index.test.ts`) for the chosen capability's `composeExtension` starter.\n *\n * Like {@link buildSampleTestSource}, this uses the harness-bound runtime\n * helpers; it also exercises the author-time capstone the declarative loop\n * unlocks:\n * `assertExtensionPreflight(blueprint, { identity, target })` (lint + manifest\n * synthesis + version-compat in one call) over the exported `blueprint`, and the\n * ergonomic runtime `createExtensionTestHarness(module)` whose `assert*`/`run*`/\n * `deactivate` methods are pre-bound to the right activation sub-registry. The base\n * suite covers preflight, the starter command, and teardown; for non-`commands`\n * capabilities {@link buildDeclarativeCapabilityTestBlock} adds a dedicated test for\n * the capability's surface. The `identity`/`target` versions are pinned to the\n * scaffolded `pm_min_version` so the synthesized manifest is trivially compatible\n * and the suite stays deterministic; an author edits them as the package matures.\n */\nfunction buildDeclarativeSampleTestSource(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string {\n const parserEnabled = capability === \"parser\";\n // The preflight report's capability set is DERIVED from the blueprint and SORTED,\n // so assert against the sorted manifest capabilities (a set match in canonical\n // order); the harness `capabilities` grant uses the same literal.\n const capabilitiesLiteral = JSON.stringify([...SCAFFOLD_MANIFEST_CAPABILITIES[capability]].sort());\n return [\n 'import assert from \"node:assert/strict\";',\n 'import { test } from \"node:test\";',\n 'import { assertExtensionDeactivated, assertExtensionPreflight, createExtensionTestHarness } from \"@unbrained/pm-cli/sdk/testing\";',\n // The search sample's synthetic query/vector contexts reference these SDK types\n // for their typed-stub fixtures; other capabilities need no extra type imports.\n ...(capability === \"search\" ? ['import type { ItemDocument, PmSettings } from \"@unbrained/pm-cli/sdk\";'] : []),\n 'import extension, { blueprint } from \"./index.ts\";',\n \"\",\n ...SAMPLE_HARNESS_CLEANUP_LINES,\n `test(${JSON.stringify(`${extensionName} passes author-time preflight`)}, () => {`,\n \" // assertExtensionPreflight is the author-time capstone: it lints the blueprint,\",\n \" // synthesizes the least-privilege manifest from `identity`, and checks the version\",\n \" // bounds against `target` in one call, throwing on any blocking finding. It returns\",\n \" // the full report so you can inspect the derived data.\",\n \" const report = assertExtensionPreflight(blueprint, {\",\n \" identity: {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ' version: \"0.1.0\",',\n ' entry: \"./index.ts\",',\n \" priority: 0,\",\n ` pm_min_version: ${JSON.stringify(SCAFFOLD_PM_MIN_VERSION)},`,\n \" },\",\n ` target: { pmVersion: ${JSON.stringify(SCAFFOLD_PM_MIN_VERSION)} },`,\n \" });\",\n \" // The capability set is DERIVED from the blueprint, never hand-synced. Keep\",\n \" // manifest.json's `capabilities` equal to this list (set match, sorted).\",\n ` assert.deepEqual(report.capabilities, ${capabilitiesLiteral});`,\n ` assert.deepEqual(report.manifest?.capabilities, ${capabilitiesLiteral});`,\n \"});\",\n \"\",\n `test(${JSON.stringify(`${extensionName} registers and runs its starter command`)}, async () => {`,\n \" // createExtensionTestHarness activates the composed module once and binds the\",\n \" // assert*/run*/deactivate helpers to the right activation sub-registry, so you\",\n \" // never thread activation.registrations vs activation.commands by hand.\",\n \" // `capabilities` mirrors manifest.json so the in-memory activation grants what the\",\n \" // blueprint needs.\",\n \" const ext = await createExtensionTestHarness(extension, {\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` capabilities: ${capabilitiesLiteral},`,\n \" });\",\n \" let deactivated = false;\",\n \" try {\",\n \" // assertCommandContract throws unless the command is registered, so reaching\",\n \" // the next line already proves the wiring; assert on the returned definition\",\n \" // to demonstrate inspecting registered metadata.\",\n ` const registered = ext.assertCommandContract({ command: ${JSON.stringify(commandName)} });`,\n ' assert.equal(typeof registered.command.description, \"string\");',\n \"\",\n \" // runCommand invokes the handler through pm's real dispatch engine, so this\",\n \" // asserts behavior - not just that the command is wired. Replace these\",\n \" // assertions as you flesh out your command.\",\n ` const invocation = await ext.runCommand({ command: ${JSON.stringify(commandName)} });`,\n \" assert.equal(invocation.handled, true);\",\n \" assert.deepEqual(invocation.result, {\",\n \" ok: true,\",\n ` source: ${JSON.stringify(extensionName)},`,\n ` command: ${JSON.stringify(commandName)},`,\n // The parser starter's command surfaces the normalized `upper` flag, false when\n // the command is invoked without `--shout`/`--upper`.\n ...(parserEnabled ? [\" upper: false,\"] : []),\n ' message: \"Starter extension scaffold is active.\",',\n \" });\",\n \" // deactivate runs pm's real teardown engine over the module; exactly one\",\n \" // extension tears down with no failures.\",\n \" const teardown = await ext.deactivate();\",\n \" assertExtensionDeactivated(teardown);\",\n \" deactivated = true;\",\n ...SAMPLE_HARNESS_FINALLY_LINES,\n \"});\",\n \"\",\n ...buildDeclarativeCapabilityTestBlock(extensionName, commandName, capability, capabilitiesLiteral),\n ].join(\"\\n\");\n}\n\n/**\n * Build the README for the declarative (`composeExtension`) package starter for\n * the chosen capability.\n *\n * It documents the same metadata/validation sections as the imperative package\n * README but frames the entrypoint around the declarative loop and the author-time\n * preflight test, so the generated docs match the generated `index.ts`/\n * `index.test.ts`. The included-files bullets, the Declarative Authoring blueprint\n * fields, and the activation section are capability-aware: the `schema` starter\n * contributes a global item type (so it omits `activation.commands`), while every\n * other capability declares the command paths that lazily activate the package.\n */\nfunction buildDeclarativePackageReadme(\n packageName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n): string {\n // The schema/profile starters omit `activation.commands` (their surface is a\n // global contribution), so describe the manifest accurately and use the\n // conservative-activation section.\n const manifestBullet = buildScaffoldManifestBullet(capability, \"package\");\n const activationSection = buildScaffoldActivationReadmeSection(capability, \"package\");\n return [\n `# ${packageName}`,\n \"\",\n \"Generated by `pm package init --declarative`.\",\n \"\",\n \"## Included Files\",\n \"- `package.json`: package metadata, `typecheck`/`test` scripts, and `pm` resource manifest.\",\n manifestBullet,\n `- \\`index.ts\\`: the TypeScript manifest entry — a \\`defineExtensionBlueprint\\` blueprint (${DECLARATIVE_ENTRYPOINT_SURFACE_PHRASE[capability]}) composed into the runtime module by \\`composeExtension\\`, plus a \\`deactivate\\` teardown stub.`,\n \"- `index.test.ts`: sample `node:test` suite covering author-time preflight (`assertExtensionPreflight`) and runtime surface invocation/teardown via `createExtensionTestHarness`.\",\n TSCONFIG_BULLET,\n \"- `.gitignore`: ignores `node_modules/`, logs, and the TypeScript build cache.\",\n \"\",\n \"## Quick Start\",\n \"This package is authored AND loaded as TypeScript: the manifest `entry` is\",\n \"`./index.ts` and pm imports it directly via Node's native type stripping\",\n \"(Node >=22.18), so there is no build step — install and run:\",\n \"```bash\",\n \"npm install\",\n \"pm install --project <package-path>\",\n `pm ${commandName}`,\n \"pm package doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Declarative Authoring\",\n \"`index.ts` uses the SDK's declarative authoring loop instead of an imperative\",\n \"`activate` body. You describe WHAT the package registers as an\",\n \"`ExtensionBlueprint` and `composeExtension` generates the `activate` that wires\",\n \"every surface in order:\",\n \"- The `define*` builders author each surface with literal-type preservation and\",\n \" contextual handler inference (`defineCommand`, `defineSearchProvider`,\",\n \" `defineItemType`, `defineParserOverride`, ...).\",\n `- \\`defineExtensionBlueprint({ ... })\\` collects the definitions into the blueprint;`,\n ` this starter populates ${DECLARATIVE_CAPABILITY_BLUEPRINT_FIELDS[capability]}. Add more`,\n \" fields as the package grows.\",\n \"- `composeExtension(blueprint)` is the default export — the runtime module pm\",\n \" loads. Its generated `activate` requires exactly the capabilities the blueprint\",\n \" derives, so `manifest.json`'s `capabilities` never drift.\",\n \"\",\n \"## Validate the Package\",\n \"`npm install` pulls the peer SDK and TypeScript. `npm test` is the default\",\n \"validation gate: it type-checks the package, then runs the colocated sample:\",\n \"```bash\",\n \"npm install\",\n \"npm test\",\n \"```\",\n \"`index.test.ts` exercises both authoring capstones: `assertExtensionPreflight`\",\n \"(the author-time lint + manifest synthesis + version-compatibility check over the\",\n \"exported `blueprint`) and `createExtensionTestHarness` (the runtime fixture whose\",\n \"`assert*`/`run*`/`deactivate` methods bind to the right activation sub-registry).\",\n \"`npm run typecheck` is available when you only want the SDK contract check.\",\n \"`npm run test:runtime` runs just `node --test`, which strips types on load and\",\n \"executes `index.test.ts` directly against the `@unbrained/pm-cli/sdk/testing`\",\n \"helpers - no compile step and no extra test runner required.\",\n ...activationSection,\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this package. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the package on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this package. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the package when the CLI exceeds this bound.\",\n \"\",\n \"## Policy Metadata\",\n \"The starter command is pure compute, so `manifest.json` declares `trusted: true`, `sandbox_profile: \\\"strict\\\"`, and all six permission keys as `false`. Keep that least-privilege shape for pure packages; relax only the specific permission your package actually needs and verify with `pm package doctor --project --detail deep --trace`.\",\n \"\",\n \"## Notes\",\n \"- Author in `index.ts`; pm loads it directly (no build), so edits take effect on the next install/reload — there is no `.js` to regenerate.\",\n \"- Move larger runtimes into sibling or subdirectory `*.ts` modules and import them with their real `.ts` extension; `tsconfig.json` type-checks every `*.ts` in the package (recursively).\",\n \"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.\",\n \"\",\n ].join(\"\\n\");\n}\n\n/**\n * Derived, deterministic identifier set the package `define*` README snippets\n * reference: the search/vector adapter names, the importer/exporter adapter\n * label, the custom item type/folder/aliases, the note field, and the seed\n * migration id. All are projected from `extensionName` so the generated snippet\n * matches the generated `index.ts`.\n */\ninterface ScaffoldSnippetNames {\n searchProviderName: string;\n vectorAdapterName: string;\n adapterName: string;\n itemTypeName: string;\n itemTypeFolder: string;\n itemTypeAliases: string[];\n fieldName: string;\n migrationId: string;\n}\n\n/**\n * Project the {@link ScaffoldSnippetNames} for `extensionName`, omitting a\n * redundant self-alias when the de-hyphenated form already equals the type name.\n */\nfunction buildScaffoldSnippetNames(extensionName: string): ScaffoldSnippetNames {\n const itemTypeName = extensionName;\n const itemTypeAlias = extensionName.replace(/-/g, \"\");\n return {\n searchProviderName: `${extensionName}-search`,\n vectorAdapterName: `${extensionName}-vector`,\n adapterName: `${extensionName.replace(/-/g, \" \")} items`,\n itemTypeName,\n itemTypeFolder: `${extensionName}s`,\n itemTypeAliases: itemTypeAlias === itemTypeName ? [] : [itemTypeAlias],\n fieldName: `${extensionName.replace(/-/g, \"_\")}_note`,\n migrationId: `${extensionName}-0001-init`,\n };\n}\n\n/**\n * Build the comma-separated `define*` builder import list for the README\n * snippet, including only the builders the chosen capability demonstrates.\n */\nfunction buildDefineBuilderImports(capability: ExtensionScaffoldCapability): string {\n return [\n \"defineCommand\",\n ...(capability === \"hooks\" ? [\"defineAfterCommandHook\"] : []),\n ...(capability === \"search\" ? [\"defineSearchProvider\", \"defineVectorStoreAdapter\"] : []),\n ...(capability === \"importers\" ? [\"defineImporter\", \"defineExporter\"] : []),\n ...(capability === \"schema\" ? [\"defineItemType\", \"defineItemField\", \"defineMigration\"] : []),\n ...(capability === \"profile\" ? [\"defineProjectProfile\"] : []),\n ...(capability === \"renderers\" ? [\"defineRendererOverride\"] : []),\n ...(capability === \"parser\" ? [\"defineParserOverride\"] : []),\n ...(capability === \"preflight\" ? [\"definePreflightOverride\"] : []),\n ...(capability === \"services\" ? [\"defineServiceOverride\"] : []),\n ].join(\", \");\n}\n\n/**\n * Build the exported `define*` declarations for the README snippet: the base\n * `pingCommand` (with parser flags for the parser capability) plus the one\n * capability-specific export the chosen capability demonstrates.\n */\nfunction buildDefineBuilderExports(\n extensionName: string,\n commandName: string,\n capability: ExtensionScaffoldCapability,\n names: ScaffoldSnippetNames,\n): string[] {\n const lines = [\n \"export const pingCommand = defineCommand({\",\n ` name: ${JSON.stringify(commandName)},`,\n ' description: \"Starter scaffold command. Replace with your own behavior.\",',\n // The parser starter's command declares the flags its override normalizes so\n // the demo is runnable through `pm <command> --shout`, and surfaces the\n // canonical `upper` flag in the result.\n ...(capability === \"parser\"\n ? [\n \" flags: [\",\n ' { long: \"--shout\", value_type: \"boolean\", description: \"Deprecated alias for --upper.\" },',\n ' { long: \"--upper\", value_type: \"boolean\", description: \"Canonical flag the parser produces.\" },',\n \" ],\",\n \" run: (context) => ({ ok: true, command: context.command, upper: context.options.upper === true }),\",\n ]\n : [\" run: (context) => ({ ok: true, command: context.command }),\"]),\n \"});\",\n ];\n if (capability === \"hooks\") {\n lines.push(\n \"\",\n \"export const afterCommandHook = defineAfterCommandHook((context) => {\",\n \" if (!context.ok) return;\",\n \" // React to context.affected here as your package grows.\",\n \"});\",\n );\n }\n if (capability === \"search\") {\n lines.push(\n \"\",\n \"export const searchProvider = defineSearchProvider({\",\n ` name: ${JSON.stringify(names.searchProviderName)},`,\n \" query: async (context) => ({\",\n \" hits: context.documents\",\n \" .filter((document) => String(document.metadata.title ?? \\\"\\\").toLowerCase().includes(context.query.toLowerCase()))\",\n \" .map((document) => ({ id: document.metadata.id, score: 1, matched_fields: [\\\"title\\\"] })),\",\n \" }),\",\n \" embed: async (context) => [context.input.length],\",\n \"});\",\n \"\",\n \"export const vectorStoreAdapter = defineVectorStoreAdapter({\",\n ` name: ${JSON.stringify(names.vectorAdapterName)},`,\n \" query: async (context) => [{ id: \\\"starter-vector-hit\\\", score: context.limit }],\",\n \" upsert: async (context) => ({ upserted: context.points.length }),\",\n \" delete: async (context) => ({ deleted: context.ids.length }),\",\n \"});\",\n );\n }\n if (capability === \"importers\") {\n lines.push(\n \"\",\n \"export const importer = defineImporter(async (context) => ({\",\n \" imported: 1,\",\n \" source: context.options.source ?? \\\"starter\\\",\",\n \" args: context.args,\",\n \"}));\",\n \"\",\n \"export const exporter = defineExporter(async (context) => ({\",\n \" exported: true,\",\n \" destination: context.options.destination ?? \\\"stdout\\\",\",\n \" args: context.args,\",\n \"}));\",\n );\n }\n if (capability === \"schema\") {\n lines.push(\n \"\",\n `export const noteField = defineItemField({ name: ${JSON.stringify(names.fieldName)}, type: \"string\", optional: true });`,\n \"\",\n \"export const itemType = defineItemType({\",\n ` name: ${JSON.stringify(names.itemTypeName)},`,\n ` folder: ${JSON.stringify(names.itemTypeFolder)},`,\n ` aliases: ${JSON.stringify(names.itemTypeAliases)},`,\n \" required_create_fields: [],\",\n \"});\",\n \"\",\n \"export const initMigration = defineMigration({\",\n ` id: ${JSON.stringify(names.migrationId)},`,\n ` description: ${JSON.stringify(`Initialize ${extensionName} schema state.`)},`,\n \" mandatory: false,\",\n \" run: async (context) => ({ migrated: true, id: context.id }),\",\n \"});\",\n );\n }\n if (capability === \"profile\") {\n // Abbreviated illustration; the generated index.ts populates every archetype\n // dimension (types, statuses, fields, workflow, config, template, packages).\n lines.push(\n \"\",\n \"export const starterProfile = defineProjectProfile({\",\n ` name: ${JSON.stringify(extensionName)},`,\n ` title: ${JSON.stringify(`${extensionName} archetype`)},`,\n ' summary: \"Starter project profile. Replace these dimensions with your own archetype.\",',\n \" types: [\",\n ` { name: ${JSON.stringify(names.itemTypeName)}, folder: ${JSON.stringify(names.itemTypeFolder)} },`,\n \" ],\",\n \" // ...plus statuses, fields, workflows, config, templates, and packages.\",\n \"});\",\n );\n }\n if (capability === \"renderers\") {\n lines.push(\n \"\",\n \"export const toonRenderer = defineRendererOverride((context) => {\",\n ` if (context.command !== ${JSON.stringify(commandName)}) return null;`,\n ` return ${JSON.stringify(`${extensionName}: `)} + JSON.stringify(context.result);`,\n \"});\",\n );\n }\n if (capability === \"parser\") {\n lines.push(\n \"\",\n \"export const pingParser = defineParserOverride((context) => {\",\n \" const options = { ...context.options };\",\n \" if (options.shout === true) options.upper = true;\",\n \" delete options.shout;\",\n \" return { options };\",\n \"});\",\n );\n }\n if (capability === \"preflight\") {\n lines.push(\n \"\",\n \"// Return a delta of the gate-decision keys you want to change; returning\",\n \"// context.decision unchanged is a safe no-op (e.g. { run_extension_migrations: false }).\",\n \"export const preflightOverride = definePreflightOverride((context) => context.decision);\",\n );\n }\n if (capability === \"services\") {\n lines.push(\n \"\",\n \"export const outputService = defineServiceOverride((context) => {\",\n ` if (context.command !== ${JSON.stringify(commandName)}) return context.payload;`,\n ` return { rendered_by: ${JSON.stringify(extensionName)}, payload: context.payload };`,\n \"});\",\n );\n }\n return lines;\n}\n\n/**\n * Build the `activate` body registrations for the README snippet: one\n * `api.register*`/`api.hooks.*` call wiring the capability-specific exports\n * produced by {@link buildDefineBuilderExports}.\n */\nfunction buildDefineBuilderActivate(\n commandName: string,\n capability: ExtensionScaffoldCapability,\n names: ScaffoldSnippetNames,\n): string[] {\n const lines: string[] = [];\n if (capability === \"renderers\") {\n lines.push(' api.registerRenderer(\"toon\", toonRenderer);');\n }\n if (capability === \"parser\") {\n lines.push(` api.registerParser(${JSON.stringify(commandName)}, pingParser);`);\n }\n if (capability === \"preflight\") {\n lines.push(\" api.registerPreflight(preflightOverride);\");\n }\n if (capability === \"services\") {\n lines.push(' api.registerService(\"output_format\", outputService);');\n }\n if (capability === \"hooks\") {\n lines.push(\" api.hooks.afterCommand(afterCommandHook);\");\n }\n if (capability === \"search\") {\n lines.push(\" api.registerSearchProvider(searchProvider);\", \" api.registerVectorStoreAdapter(vectorStoreAdapter);\");\n }\n if (capability === \"schema\") {\n lines.push(\n \" api.registerItemFields([noteField]);\",\n \" api.registerItemTypes([itemType]);\",\n \" api.registerMigration(initMigration);\",\n );\n }\n if (capability === \"profile\") {\n lines.push(\" api.registerProfile(starterProfile);\");\n }\n if (capability === \"importers\") {\n lines.push(\n ` api.registerImporter(${JSON.stringify(names.adapterName)}, importer, {`,\n ` action: ${JSON.stringify(`${names.adapterName} import`)},`,\n ' description: \"Import starter records into pm context.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--source\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Source name or path to import from.\",',\n \" },\",\n \" ],\",\n \" });\",\n ` api.registerExporter(${JSON.stringify(names.adapterName)}, exporter, {`,\n ` action: ${JSON.stringify(`${names.adapterName} export`)},`,\n ' description: \"Export pm context into starter records.\",',\n \" flags: [\",\n \" {\",\n ' long: \"--destination\",',\n ' value_name: \"name\",',\n ' value_type: \"string\",',\n ' description: \"Destination name or path to export to.\",',\n \" },\",\n \" ],\",\n \" });\",\n );\n }\n return lines;\n}\n\n/**\n * Implements build starter extension scaffold files for the public runtime surface of this module.\n */\nexport function buildStarterExtensionScaffoldFiles(\n extensionName: string,\n commandName: string,\n vocabulary: \"extension\" | \"package\",\n capability: ExtensionScaffoldCapability = \"commands\",\n declarative: boolean = false,\n): Record<string, string> {\n const packageName = `pm-${extensionName}`;\n const capabilities = SCAFFOLD_MANIFEST_CAPABILITIES[capability];\n const activationCommands = buildScaffoldActivationCommands(extensionName, commandName, capability);\n const manifest = `${JSON.stringify(\n {\n name: extensionName,\n version: \"0.1.0\",\n entry: \"./index.ts\",\n manifest_version: SCAFFOLD_MANIFEST_VERSION,\n pm_min_version: SCAFFOLD_PM_MIN_VERSION,\n trusted: true,\n sandbox_profile: \"strict\",\n permissions: { ...SCAFFOLD_DECLARED_PERMISSIONS },\n capabilities,\n // Declares the exact command paths `activate` registers so pm activates\n // this package lazily — only when an invoked command matches — mirroring\n // every first-party bundled package. Keep it in sync with the entrypoint.\n // The schema and profile starters omit this field (empty list) so their\n // global contribution — a custom item type/field, or a project profile\n // resolved by `pm profile` — stays available to built-in commands (see\n // buildScaffoldActivationCommands).\n ...(activationCommands.length > 0 ? { activation: { commands: activationCommands } } : {}),\n },\n null,\n 2,\n )}\\n`;\n // The entrypoint is authored AND loaded as TypeScript (ADR pm-2c28 / pm-m1uz):\n // the manifest `entry` points at `./index.ts` and pm imports it directly via\n // Node's native type stripping (Node >=22.18) — there is no compile step and no\n // `.js` artifact. The typed `ExtensionApi` parameter is checked against the SDK\n // contract at author time (`npm run typecheck`).\n const entrypoint = [\n 'import type { ExtensionApi } from \"@unbrained/pm-cli/sdk\";',\n \"\",\n \"export function activate(api: ExtensionApi): void {\",\n ...buildActivateBodyLines(extensionName, commandName, capability),\n \"}\",\n \"\",\n \"// `deactivate` is the teardown counterpart to `activate`: pm runs it on host\",\n \"// shutdown/reload (e.g. the MCP server between requests) to release anything\",\n \"// `activate` opened - timers, connections, caches. This starter holds no such\",\n \"// resources, so it stays a documented no-op; add cleanup here as you grow.\",\n \"export function deactivate(): void {}\",\n \"\",\n \"export default {\",\n \" activate,\",\n \" deactivate,\",\n \"};\",\n \"\",\n ].join(\"\\n\");\n const tsconfig = `${JSON.stringify(SCAFFOLD_TSCONFIG, null, 2)}\\n`;\n // README bullet describing what index.ts wires, kept in sync with the chosen\n // capability so the generated docs match the generated code.\n const entrypointBullet = ENTRYPOINT_BULLETS[capability];\n // The schema/profile starters omit `activation.commands` (their surface is a\n // global contribution), so describe the manifest accurately instead of\n // referencing a field they deliberately lack.\n const manifestBullet = buildScaffoldManifestBullet(capability, vocabulary);\n if (vocabulary === \"package\") {\n const packageJson = `${JSON.stringify(\n {\n name: packageName,\n version: \"0.1.0\",\n private: true,\n type: \"module\",\n keywords: [\"pm-package\"],\n engines: {\n node: SCAFFOLD_NODE_ENGINE,\n },\n // There is no build step: pm loads the `./index.ts` manifest entry\n // directly via Node's native type stripping (Node >=22.18). `typecheck`\n // validates the source against the SDK contracts (`tsc --noEmit`), and\n // `test` is the self-validating author gate: typecheck first, then run\n // the colocated sample with Node's built-in runner (which strips types\n // on load) against the peer SDK testing helpers — no third-party test\n // runner or compile output required. `test:runtime` remains available\n // for tight loops after a separate `npm run typecheck`.\n scripts: {\n typecheck: \"tsc --noEmit\",\n \"test:runtime\": \"node --test\",\n test: \"npm run typecheck && npm run test:runtime\",\n },\n peerDependencies: {\n \"@unbrained/pm-cli\": `>=${SCAFFOLD_PM_MIN_VERSION}`,\n },\n devDependencies: {\n \"@types/node\": SCAFFOLD_TYPES_NODE_VERSION,\n typescript: SCAFFOLD_TYPESCRIPT_VERSION,\n },\n pm: {\n aliases: [extensionName],\n extensions: [\".\"],\n docs: [\"README.md\"],\n examples: [\"README.md\"],\n catalog: {\n display_name: extensionName,\n category: \"workflow\",\n summary: \"Starter pm package scaffold.\",\n tags: [\"starter\"],\n },\n },\n },\n null,\n 2,\n )}\\n`;\n // node:test sample: demonstrates validating the package with the SDK testing\n // helpers without adding a third-party test runner. The suite covers the\n // capability the scaffold targets (command invocation, and for the hooks\n // capability, the after_command lifecycle hook).\n const sampleTest = buildSampleTestSource(extensionName, commandName, capability);\n const sampleTestBullet = SAMPLE_TEST_BULLETS[capability];\n // The package commits only TypeScript source — pm loads the `.ts` entry\n // directly, so there is no compiled output to ignore. Keep dependencies and\n // the tsc incremental cache out of version control.\n const gitignore = [\n \"node_modules/\",\n \"*.log\",\n \"*.tsbuildinfo\",\n \"\",\n ].join(\"\\n\");\n const names = buildScaffoldSnippetNames(extensionName);\n const defineBuilderImports = buildDefineBuilderImports(capability);\n const defineBuilderSnippet = [\n \"```ts\",\n `import { ${defineBuilderImports} } from \"@unbrained/pm-cli/sdk\";`,\n 'import type { ExtensionApi } from \"@unbrained/pm-cli/sdk\";',\n \"\",\n ...buildDefineBuilderExports(extensionName, commandName, capability, names),\n \"\",\n \"export function activate(api: ExtensionApi): void {\",\n \" api.registerCommand(pingCommand);\",\n ...buildDefineBuilderActivate(commandName, capability, names),\n \"}\",\n \"\",\n \"export function deactivate(): void {}\",\n \"\",\n \"export default { activate, deactivate };\",\n \"```\",\n ];\n const packageReadme = [\n `# ${packageName}`,\n \"\",\n \"Generated by `pm package init`.\",\n \"\",\n \"## Included Files\",\n \"- `package.json`: package metadata, `typecheck`/`test` scripts, and `pm` resource manifest.\",\n manifestBullet,\n entrypointBullet,\n sampleTestBullet,\n TSCONFIG_BULLET,\n \"- `.gitignore`: ignores `node_modules/`, logs, and the TypeScript build cache.\",\n \"\",\n \"## Quick Start\",\n \"This package is authored AND loaded as TypeScript: the manifest `entry` is\",\n \"`./index.ts` and pm imports it directly via Node's native type stripping\",\n \"(Node >=22.18), so there is no build step — install and run:\",\n \"```bash\",\n \"npm install\",\n \"pm install --project <package-path>\",\n `pm ${commandName}`,\n \"pm package doctor --project --detail summary\",\n \"```\",\n \"\",\n \"## Validate the Package\",\n \"`npm install` pulls the peer SDK and TypeScript. `npm test` is the default\",\n \"validation gate: it type-checks the package, then runs the colocated sample:\",\n \"```bash\",\n \"npm install\",\n \"npm test\",\n \"```\",\n \"`npm run typecheck` is available when you only want the SDK contract check.\",\n \"`npm run test:runtime` runs just `node --test`, which strips types on load and\",\n \"executes `index.test.ts` directly against the `@unbrained/pm-cli/sdk/testing`\",\n \"helpers - no compile step and no extra test runner required.\",\n \"\",\n \"## Authoring With define* Builders\",\n \"`index.ts` is authored fully in TypeScript so every registration is checked\",\n \"against the SDK contracts at author time. Use the public SDK authoring\",\n \"builders for exported definitions you want literal-type preservation,\",\n \"contextual handler inference, and direct unit tests for:\",\n ...defineBuilderSnippet,\n \"The builders return their argument unchanged; runtime validation still lives\",\n \"in `api.register*`, and behavior validation lives in `sdk/testing`.\",\n ...PACKAGE_CAPABILITY_README_SECTIONS[capability],\n ...buildScaffoldActivationReadmeSection(capability, \"package\"),\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this package. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the package on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this package. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the package when the CLI exceeds this bound.\",\n \"\",\n \"## Policy Metadata\",\n \"The starter command is pure compute, so `manifest.json` declares `trusted: true`, `sandbox_profile: \\\"strict\\\"`, and all six permission keys as `false`. Keep that least-privilege shape for pure packages; relax only the specific permission your package actually needs and verify with `pm package doctor --project --detail deep --trace`.\",\n \"\",\n \"## Notes\",\n \"- Author in `index.ts`; pm loads it directly (no build), so edits take effect on the next install/reload — there is no `.js` to regenerate.\",\n \"- Move larger runtimes into sibling or subdirectory `*.ts` modules and import them with their real `.ts` extension; `tsconfig.json` type-checks every `*.ts` in the package (recursively).\",\n \"- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.\",\n \"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.\",\n \"\",\n ].join(\"\\n\");\n // The declarative starter swaps the imperative entrypoint/test/README for the\n // `composeExtension` blueprint form (package-mode, any capability, enforced by\n // scaffoldExtensionProject). package.json, manifest.json, tsconfig.json, and\n // .gitignore are identical to the imperative starter for the same capability.\n return {\n \"package.json\": packageJson,\n \"manifest.json\": manifest,\n \"index.ts\": declarative ? buildDeclarativeEntrypoint(extensionName, commandName, capability) : entrypoint,\n \"index.test.ts\": declarative ? buildDeclarativeSampleTestSource(extensionName, commandName, capability) : sampleTest,\n \"tsconfig.json\": tsconfig,\n \".gitignore\": gitignore,\n \"README.md\": declarative ? buildDeclarativePackageReadme(packageName, commandName, capability) : packageReadme,\n };\n }\n const readme = [\n `# ${extensionName}`,\n \"\",\n \"Generated by `pm extension init`.\",\n \"\",\n \"## Included Files\",\n manifestBullet,\n entrypointBullet,\n TSCONFIG_BULLET,\n \"\",\n \"## Quick Start\",\n \"This extension is authored AND loaded as TypeScript: the manifest `entry` is\",\n \"`./index.ts` and pm imports it directly via Node's native type stripping\",\n \"(Node >=22.18), so there is no compile step. Install the dev dependencies for\",\n \"type-checking, then install and run the extension:\",\n \"```bash\",\n \"npm install -D typescript @types/node @unbrained/pm-cli\",\n \"npx tsc --noEmit\",\n \"pm extension --install --project <scaffold-path>\",\n `pm ${commandName}`,\n \"pm extension --doctor --project --detail summary\",\n \"```\",\n ...EXTENSION_CAPABILITY_README_SECTIONS[capability],\n ...buildScaffoldActivationReadmeSection(capability, \"extension\"),\n \"\",\n \"## Compatibility Bounds\",\n \"`manifest.json` cannot hold comments, so the version-compatibility fields are documented here:\",\n `- \\`manifest_version\\` (integer): manifest schema generation. Leave at \\`${SCAFFOLD_MANIFEST_VERSION}\\` unless you adopt a newer manifest schema.`,\n `- \\`pm_min_version\\` (string): lowest pm CLI version that may load this extension. Scaffolded as \\`${SCAFFOLD_PM_MIN_VERSION}\\`. The loader blocks the extension on older CLIs.`,\n \"- `pm_max_version` (string, optional): highest pm CLI version that may load this extension. Add it to block CLIs that are newer than the version you have validated against. The loader blocks the extension when the CLI exceeds this bound.\",\n \"\",\n \"## Policy Metadata\",\n \"The starter command is pure compute, so `manifest.json` declares `trusted: true`, `sandbox_profile: \\\"strict\\\"`, and all six permission keys as `false`. Keep that least-privilege shape for pure extensions; relax only the specific permission your extension actually needs and verify with `pm extension --doctor --project --detail deep --trace`.\",\n \"\",\n \"- This scaffold is TypeScript ESM source loaded directly by pm (no compile), so it works in package scopes with `type: module`.\",\n \"- Author in `index.ts` (the manifest entry); edits take effect on the next install/reload — there is no `.js` to regenerate.\",\n \"- Release any resources `activate` opens (timers, connections, caches) in the `deactivate` teardown hook.\",\n \"\",\n ].join(\"\\n\");\n return {\n \"manifest.json\": manifest,\n \"index.ts\": entrypoint,\n \"tsconfig.json\": tsconfig,\n \"README.md\": readme,\n };\n}\n\n/**\n * Implements scaffold extension project for the public runtime surface of this module.\n */\nexport async function scaffoldExtensionProject(\n target: string,\n vocabulary: \"extension\" | \"package\" = \"extension\",\n capability: string = \"commands\",\n declarative: boolean = false,\n): Promise<ExtensionScaffoldResult> {\n const normalizedCapability = capability.trim().toLowerCase();\n if (!(SCAFFOLD_CAPABILITIES as readonly string[]).includes(normalizedCapability)) {\n throw new PmCliError(\n `Unknown scaffold capability \"${capability}\". Supported capabilities: ${SCAFFOLD_CAPABILITIES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n }\n const resolvedCapability = normalizedCapability as ExtensionScaffoldCapability;\n // The declarative (`composeExtension` blueprint) starter is package-mode only.\n // `composeExtension` is a runtime SDK *value* import, so it belongs in\n // package-mode authoring where the SDK is a linked dependency — not in the\n // import-free extension-only starters that must load without it. Every capability\n // emits its blueprint form (see buildDeclarativeBlueprintSurface).\n if (declarative && vocabulary !== \"package\") {\n throw new PmCliError(\n \"--declarative scaffolds a package-mode blueprint starter (composeExtension is a runtime SDK import). Use `pm package init`, not `pm extension init`.\",\n EXIT_CODE.USAGE,\n );\n }\n const style: ExtensionScaffoldStyle = declarative ? \"declarative\" : \"imperative\";\n const normalizedTarget = target.trim();\n const targetPath = path.resolve(process.cwd(), normalizedTarget);\n const extensionName = normalizeManagedDirectoryName(path.basename(targetPath));\n // Hyphenated names become space-separated command words; reserved roots get a\n // `starter` prefix so core commands and aliases cannot intercept dispatch.\n const commandName = buildScaffoldCommandName(extensionName);\n const scaffoldFiles = buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary, resolvedCapability, declarative);\n\n let createdDirectory = false;\n if (await pathExists(targetPath)) {\n const existingTargetStats = await fs.stat(targetPath);\n if (!existingTargetStats.isDirectory()) {\n throw new PmCliError(\n `Scaffold target \"${targetPath}\" exists and is not a directory.`,\n EXIT_CODE.CONFLICT,\n );\n }\n } else {\n await fs.mkdir(targetPath, { recursive: true });\n createdDirectory = true;\n }\n\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (!(await pathExists(absolutePath))) {\n continue;\n }\n const existingContent = await fs.readFile(absolutePath, \"utf8\");\n if (existingContent !== content) {\n throw new PmCliError(\n `Scaffold file \"${relativePath}\" already exists with different content in \"${targetPath}\". Choose a new target path or remove conflicting files.`,\n EXIT_CODE.CONFLICT,\n );\n }\n }\n\n const files: ExtensionScaffoldFileResult[] = [];\n for (const [relativePath, content] of Object.entries(scaffoldFiles)) {\n const absolutePath = path.join(targetPath, relativePath);\n if (await pathExists(absolutePath)) {\n files.push({\n path: relativePath,\n status: \"unchanged\",\n });\n continue;\n }\n await fs.mkdir(path.dirname(absolutePath), { recursive: true });\n await fs.writeFile(absolutePath, content, \"utf8\");\n files.push({\n path: relativePath,\n status: \"created\",\n });\n }\n\n return {\n extension_name: extensionName,\n command_name: commandName,\n capability: resolvedCapability,\n style,\n target_path: targetPath,\n created_directory: createdDirectory,\n files,\n };\n}\n","/**\n * @module core/extensions/activation-summary\n *\n * Enumerates *what* an extension activation registered, by name, in one pass.\n *\n * {@link ./extension-types.js#ExtensionActivationResult | `ExtensionActivationResult`}\n * already carries per-surface *counts* (`hook_counts`, `registration_counts`,\n * the various `*_count` fields), but answering \"what does this extension\n * register?\" otherwise means walking fifteen-plus sub-registries by hand\n * (`registrations.commands`/`flags`/`item_types`/`item_fields`/`migrations`/\n * `importers`/`exporters`/`search_providers`/`vector_store_adapters`,\n * `commands.overrides`/`handlers`, the `parsers`/`preflight`/`services`/\n * `renderers` override registries, and the five `hooks.*` arrays).\n *\n * {@link describeExtensionActivation} flattens all of them into one sorted,\n * deterministic {@link ExtensionActivationSummary} of identifiers — the\n * `describe` (enumerate-all) verb that complements the SDK's `assert*`\n * (verify-one) and `run*` (invoke-one) testing helpers. It serves two callers:\n *\n * - **Agents** get a single token-efficient view of an activation instead of\n * traversing every registry (\"project management = context management\").\n * - **Package authors** can assert their *entire* registration surface in one\n * `deepEqual` — a least-privilege \"I register exactly these surfaces and\n * nothing more\" check, the positive counterpart to\n * {@link ./capability-usage.js#reconcileExtensionCapabilityUsage}.\n */\nimport type {\n ExtensionActivationResult,\n ExtensionCapability,\n ExtensionHookRegistry,\n ExtensionServiceName,\n OutputRendererFormat,\n} from \"./extension-types.js\";\nimport { collectUsedExtensionCapabilities, normalizeExtensionName } from \"./capability-usage.js\";\n\n/**\n * Canonical lifecycle hook kinds paired with their {@link ExtensionHookRegistry}\n * field, ordered to match `ExtensionActivationResult.hook_counts` so a summary's\n * `hooks` list reads in the same stable order the runtime reports counts in.\n */\nconst HOOK_REGISTRY_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 ExtensionHookRegistry, string]>;\n\n/**\n * Flat, name-level enumeration of every surface an activation registered.\n *\n * Arrays are de-duplicated for deterministic equality. Most are locale-sorted;\n * {@link ExtensionActivationSummary.hooks} is the exception — it is emitted in\n * canonical lifecycle order to mirror `ExtensionActivationResult.hook_counts`,\n * not alphabetically. The three command fields capture distinct dimensions and\n * can overlap: a command\n * registered via `api.registerCommand(definition)` appears in both\n * {@link ExtensionActivationSummary.commands} (its declared definition) and\n * {@link ExtensionActivationSummary.command_handlers} (its executable handler),\n * whereas a built-in command replaced via `api.registerCommand(name, override)`\n * appears only in {@link ExtensionActivationSummary.command_overrides}.\n */\nexport interface ExtensionActivationSummary {\n /** Known capabilities the registered surfaces exercise (sorted, de-duplicated). */\n capabilities: ExtensionCapability[];\n /** Full command paths declared via `registerCommand`'s definition form. */\n commands: string[];\n /** Built-in command paths replaced by an `registerCommand(name, override)` handler. */\n command_overrides: string[];\n /**\n * Full command paths backed by an extension-provided handler. A superset of\n * {@link ExtensionActivationSummary.commands} that also includes the\n * `<name> import`/`<name> export` paths synthesized for importers/exporters.\n */\n command_handlers: string[];\n /** Lifecycle hook kinds with at least one registered hook (canonical order). */\n hooks: string[];\n /** Command paths that received extension-registered flags. */\n flag_commands: string[];\n /** Custom item-type names registered via `registerItemTypes`. */\n item_types: string[];\n /** Custom front-matter field names registered via `registerItemFields`. */\n item_fields: string[];\n /** Schema migration ids registered via `registerMigration` (id-less migrations are omitted — they carry no identifier). */\n migrations: string[];\n /** Project profile names registered via `registerProfile`. */\n profiles: string[];\n /** Importer names registered via `registerImporter`. */\n importers: string[];\n /** Exporter names registered via `registerExporter`. */\n exporters: string[];\n /** Search-provider names registered via `registerSearchProvider`. */\n search_providers: string[];\n /** Vector-store adapter names registered via `registerVectorStoreAdapter`. */\n vector_store_adapters: string[];\n /** Command paths with a parser override registered via `registerParser`. */\n parser_overrides: string[];\n /** Built-in service names overridden via `registerService`. */\n service_overrides: ExtensionServiceName[];\n /** Output formats with a renderer override registered via `registerRenderer`. */\n renderer_overrides: OutputRendererFormat[];\n /**\n * Count of registered preflight overrides. The surface carries no per-entry\n * identifier, so this is a `number` rather than `string[]` — the only numeric\n * field in the summary.\n */\n preflight_overrides: number;\n}\n\n/**\n * Options for {@link describeExtensionActivation}.\n */\nexport interface DescribeExtensionActivationOptions {\n /**\n * Restrict the summary to a single extension by name. Names are matched\n * case-insensitively after trimming, mirroring\n * {@link ./capability-usage.js#collectUsedExtensionCapabilities}. Omit to\n * union across every extension in the activation result.\n */\n extensionName?: string;\n}\n\n/**\n * Summarize, by name, every registration surface an activation exercised.\n *\n * Walks the same sub-registries the loader populates and the capability\n * reconciler attributes, returning a flat {@link ExtensionActivationSummary}\n * whose arrays are sorted and de-duplicated. With\n * {@link DescribeExtensionActivationOptions.extensionName} only the matching\n * extension's registrations contribute (across both layers); without it the\n * summary unions every extension in the activation. Failed activations register\n * nothing, so they contribute only an empty summary.\n */\nexport function describeExtensionActivation(\n activation: ExtensionActivationResult,\n options: DescribeExtensionActivationOptions = {},\n): ExtensionActivationSummary {\n // Match both sides with the same normalizer collectUsedExtensionCapabilities\n // uses for the `capabilities` field below, so a filtered summary's named\n // surfaces and capabilities never disagree for a stored name with whitespace.\n const filter = options.extensionName !== undefined ? normalizeExtensionName(options.extensionName) : null;\n const matches = (name: string): boolean => filter === null || normalizeExtensionName(name) === filter;\n const collect = <TEntry extends { name: string }, TValue extends string>(\n entries: readonly TEntry[],\n identify: (entry: TEntry) => TValue,\n ): TValue[] => sortUnique(entries.filter((entry) => matches(entry.name)).map(identify));\n const collectFlat = <TEntry extends { name: string }>(\n entries: readonly TEntry[],\n expand: (entry: TEntry) => readonly string[],\n ): string[] => sortUnique(entries.filter((entry) => matches(entry.name)).flatMap(expand));\n const { registrations, commands, parsers, preflight, services, renderers, hooks } = activation;\n return {\n capabilities: collectUsedExtensionCapabilities(activation, options),\n commands: collect(registrations.commands, (entry) => entry.command),\n command_overrides: collect(commands.overrides, (entry) => entry.command),\n command_handlers: collect(commands.handlers, (entry) => entry.command),\n hooks: HOOK_REGISTRY_FIELD_TO_KIND.filter(([field]) => hooks[field].some((entry) => matches(entry.name))).map(\n ([, kind]) => kind,\n ),\n flag_commands: collect(registrations.flags, (entry) => entry.target_command),\n item_types: collectFlat(registrations.item_types, (entry) => entry.types.map((type) => type.name)),\n item_fields: collectFlat(registrations.item_fields, (entry) => entry.fields.map((field) => field.name)),\n migrations: collectFlat(registrations.migrations, (entry) =>\n typeof entry.definition.id === \"string\" ? [entry.definition.id] : [],\n ),\n profiles: collect(registrations.profiles, (entry) => entry.profile.name),\n importers: collect(registrations.importers, (entry) => entry.importer),\n exporters: collect(registrations.exporters, (entry) => entry.exporter),\n search_providers: collect(registrations.search_providers, (entry) => entry.definition.name),\n vector_store_adapters: collect(registrations.vector_store_adapters, (entry) => entry.definition.name),\n parser_overrides: collect(parsers.overrides, (entry) => entry.command),\n service_overrides: collect(services.overrides, (entry) => entry.service),\n renderer_overrides: collect(renderers.overrides, (entry) => entry.format),\n preflight_overrides: preflight.overrides.filter((entry) => matches(entry.name)).length,\n };\n}\n\nfunction sortUnique<TValue extends string>(values: readonly TValue[]): TValue[] {\n return [...new Set(values)].sort((left, right) => left.localeCompare(right));\n}\n","/**\n * @module core/extensions/activation-summary-markdown\n *\n * Renders an {@link ExtensionActivationSummary} to a deterministic Markdown\n * reference document — the *render* leg that completes the `describe`\n * (enumerate-all) verb.\n *\n * {@link ./activation-summary.js#describeExtensionActivation | `describeExtensionActivation`}\n * (and its author-time twin\n * {@link ../../sdk/compose.js#describeExtensionBlueprint | `describeExtensionBlueprint`})\n * already answer \"what does this package register?\" as a structured summary, and\n * the `assert*`/`run*` testing helpers verify and invoke each surface. What was\n * missing is a way to turn that summary into human-readable docs: package\n * authors hand-wrote the README \"commands & capabilities\" reference, which\n * silently drifted from the surface the loader actually registers.\n *\n * {@link renderExtensionSurfaceMarkdown} closes that gap. It is a pure,\n * dependency-free projection of the summary, so an author can pipe\n * `describeExtensionBlueprint(blueprint)` straight into it during their build or\n * test step and embed the result in their README — a reference that can never\n * drift from the registered surface (\"project management = context management\").\n * The CLI's `pm extension|package describe --markdown` composes the same\n * primitive across every loaded extension.\n */\nimport type { ExtensionActivationSummary } from \"./activation-summary.js\";\n\n/**\n * The lowest and highest ATX heading levels Markdown supports, used to validate\n * {@link ExtensionSurfaceMarkdownOptions.headingLevel} and to clamp nested\n * section headings so a deep title never emits an invalid `#######` run.\n */\nconst MIN_HEADING_LEVEL = 1;\nconst MAX_HEADING_LEVEL = 6;\n\n/**\n * Options for {@link renderExtensionSurfaceMarkdown}.\n */\nexport interface ExtensionSurfaceMarkdownOptions {\n /**\n * Heading text for the document title. Defaults to `\"Extension surfaces\"`.\n * The title always renders as an ATX heading at\n * {@link ExtensionSurfaceMarkdownOptions.headingLevel}; per-surface sections\n * render one level deeper.\n */\n title?: string;\n /**\n * ATX heading level for the title, an integer in `[1, 6]` (default `2`, i.e.\n * `##`, so the document embeds cleanly under a `# Package` README heading).\n * Section headings render at `headingLevel + 1`, clamped to `6`. Values\n * outside `[1, 6]` throw a {@link RangeError}.\n */\n headingLevel?: number;\n /**\n * When `true`, render every surface section even when it has no entries\n * (emitting `_None._` under the heading) and always emit the capabilities\n * line. Defaults to `false`, which omits empty sections so the reference lists\n * only what the package actually contributes.\n */\n includeEmpty?: boolean;\n}\n\n/**\n * A surface section paired with the {@link ExtensionActivationSummary} field\n * whose identifiers populate it. Ordered for an author-facing reference:\n * commands first, then schema, then importers/exporters, retrieval, lifecycle\n * hooks, and finally the override surfaces. {@link ExtensionActivationSummary.command_handlers}\n * is intentionally omitted — it is a documented superset of `commands` plus the\n * synthesized `<name> import`/`<name> export` paths already covered by the\n * Importers and Exporters sections, so rendering it would duplicate information.\n */\nconst SURFACE_SECTIONS = [\n [\"commands\", \"Commands\"],\n [\"command_overrides\", \"Command overrides\"],\n [\"flag_commands\", \"Flag commands\"],\n [\"item_types\", \"Item types\"],\n [\"item_fields\", \"Item fields\"],\n [\"migrations\", \"Migrations\"],\n [\"profiles\", \"Profiles\"],\n [\"importers\", \"Importers\"],\n [\"exporters\", \"Exporters\"],\n [\"search_providers\", \"Search providers\"],\n [\"vector_store_adapters\", \"Vector store adapters\"],\n [\"hooks\", \"Lifecycle hooks\"],\n [\"parser_overrides\", \"Parser overrides\"],\n [\"service_overrides\", \"Service overrides\"],\n [\"renderer_overrides\", \"Renderer overrides\"],\n] as const satisfies ReadonlyArray<\n readonly [\n {\n [K in keyof ExtensionActivationSummary]: ExtensionActivationSummary[K] extends readonly string[] ? K : never;\n }[keyof ExtensionActivationSummary],\n string,\n ]\n>;\n\n/**\n * Repeat `#` `level` times to form an ATX heading prefix.\n */\nfunction headingPrefix(level: number): string {\n return \"#\".repeat(level);\n}\n\n/**\n * Render `value` as an inline Markdown code span. Backslash escapes do not work\n * inside CommonMark code spans, so when `value` contains backticks the span is\n * delimited by a run of backticks one longer than the longest internal run, and\n * padded with a space when the value borders a backtick — the CommonMark rule\n * for embedding literal backticks in a code span.\n */\nfunction code(value: string): string {\n if (!value.includes(\"`\")) {\n return `\\`${value}\\``;\n }\n let longestRun = 0;\n let currentRun = 0;\n for (const char of value) {\n currentRun = char === \"`\" ? currentRun + 1 : 0;\n longestRun = Math.max(longestRun, currentRun);\n }\n const fence = \"`\".repeat(longestRun + 1);\n const pad = value.startsWith(\"`\") || value.endsWith(\"`\") ? \" \" : \"\";\n return `${fence}${pad}${value}${pad}${fence}`;\n}\n\n/**\n * Render the comma-separated capabilities summary line (or `_none registered_`\n * when the activation exercised no known capability).\n */\nfunction renderCapabilitiesLine(capabilities: readonly string[]): string {\n if (capabilities.length === 0) {\n return \"Capabilities: _none registered_\";\n }\n return `Capabilities: ${capabilities.map(code).join(\", \")}`;\n}\n\n/**\n * Render one surface section as `heading` + a bullet per identifier, or, when\n * `entries` is empty, `heading` + `_None._`. Callers decide whether an empty\n * section is rendered at all via {@link ExtensionSurfaceMarkdownOptions.includeEmpty}.\n */\nfunction renderSection(heading: string, level: number, entries: readonly string[]): string[] {\n const lines = [`${headingPrefix(level)} ${heading}`, \"\"];\n if (entries.length === 0) {\n lines.push(\"_None._\", \"\");\n return lines;\n }\n lines.push(...entries.map((entry) => `- ${code(entry)}`), \"\");\n return lines;\n}\n\n/**\n * Render the preflight-overrides section: a count line when any are registered,\n * `_None._` when {@link ExtensionSurfaceMarkdownOptions.includeEmpty} forces the\n * empty section, or no lines at all otherwise. Preflight overrides carry no\n * per-entry identifier, so they have a bespoke renderer rather than reusing\n * {@link renderSection}.\n */\nfunction renderPreflightSection(count: number, level: number, includeEmpty: boolean): string[] {\n if (count === 0 && !includeEmpty) {\n return [];\n }\n return [\n `${headingPrefix(level)} Preflight overrides`,\n \"\",\n count > 0 ? `- ${count} registered (this surface carries no per-entry identifier)` : \"_None._\",\n \"\",\n ];\n}\n\n/**\n * Render an {@link ExtensionActivationSummary} as a deterministic Markdown\n * reference document.\n *\n * The output is a title heading, a one-line capabilities summary, and a section\n * per registered surface (commands, overrides, flags, item types/fields,\n * migrations, importers/exporters, search providers, vector adapters, lifecycle\n * hooks, and the parser/service/renderer override surfaces), followed by a\n * preflight-override count line when any are registered. Section order and\n * within-section identifier order both come straight from the summary, so the\n * same summary always renders byte-for-byte the same document.\n *\n * By default empty sections are omitted so the reference lists only what the\n * package contributes; set {@link ExtensionSurfaceMarkdownOptions.includeEmpty}\n * to render every section. A summary with no surfaces at all renders the title,\n * the capabilities line, and a `_This extension registers no surfaces._` note.\n *\n * @throws {RangeError} when `options.headingLevel` is not an integer in `[1, 6]`.\n */\nexport function renderExtensionSurfaceMarkdown(\n summary: ExtensionActivationSummary,\n options: ExtensionSurfaceMarkdownOptions = {},\n): string {\n const titleLevel = options.headingLevel ?? 2;\n if (!Number.isInteger(titleLevel) || titleLevel < MIN_HEADING_LEVEL || titleLevel > MAX_HEADING_LEVEL) {\n throw new RangeError(\n `headingLevel must be an integer in [${MIN_HEADING_LEVEL}, ${MAX_HEADING_LEVEL}], received ${String(options.headingLevel)}`,\n );\n }\n const sectionLevel = Math.min(titleLevel + 1, MAX_HEADING_LEVEL);\n const includeEmpty = options.includeEmpty === true;\n const title = options.title ?? \"Extension surfaces\";\n\n const lines = [`${headingPrefix(titleLevel)} ${title}`, \"\"];\n if (includeEmpty || summary.capabilities.length > 0) {\n lines.push(renderCapabilitiesLine(summary.capabilities), \"\");\n }\n\n for (const [field, heading] of SURFACE_SECTIONS) {\n const entries = summary[field];\n if (entries.length === 0 && !includeEmpty) {\n continue;\n }\n lines.push(...renderSection(heading, sectionLevel, entries));\n }\n\n lines.push(...renderPreflightSection(summary.preflight_overrides, sectionLevel, includeEmpty));\n\n const hasAnySurface =\n summary.preflight_overrides > 0 || SURFACE_SECTIONS.some(([field]) => summary[field].length > 0);\n if (!hasAnySurface && !includeEmpty) {\n lines.push(\"_This extension registers no surfaces._\", \"\");\n }\n\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n","/**\n * @module cli/commands/extension/describe\n *\n * Builds the `pm extension describe` / `pm package describe` payload: a flat,\n * by-name map of every surface each loaded extension registered.\n *\n * The SDK already ships {@link describeExtensionActivation} -- the `describe`\n * (enumerate-all) verb that complements the `assert*` (verify-one) and `run*`\n * (invoke-one) testing helpers -- but until now it was reachable only from a test\n * that hand-built an {@link ExtensionActivationResult}. This module is the thin\n * orchestration that lets an agent at the CLI (or over MCP) ask \"what does this\n * installed extension add to my context?\" in one call, instead of stitching\n * together `doctor` (errors), `manage` (update metadata), and a manifest read.\n *\n * It is intentionally pure: the caller performs the load+activate cycle (exactly\n * as `explore`/`doctor` already do) and hands the results here, so the same\n * builder is trivially unit-testable against synthetic activations.\n */\nimport { describeExtensionActivation, type ExtensionActivationSummary } from \"../../../core/extensions/activation-summary.js\";\nimport { renderExtensionSurfaceMarkdown } from \"../../../core/extensions/activation-summary-markdown.js\";\nimport type { ExtensionActivationResult, ExtensionLayer, ExtensionLoadResult } from \"../../../core/extensions/loader.js\";\nimport { normalizeExtensionNameForMatch } from \"./shared.js\";\n\n/**\n * Runtime state of a described extension. `ok` loaded and activated cleanly,\n * `failed` loaded but threw during `activate`, and `not_loaded` failed to import\n * at all -- the latter two register nothing, so their `surfaces` are empty and\n * the status explains why (rather than implying the extension contributes\n * nothing).\n */\nexport type ExtensionDescribeActivationStatus = \"ok\" | \"failed\" | \"not_loaded\";\n\n/**\n * One extension's contribution to the workspace: its identity plus the\n * {@link ExtensionActivationSummary} of every surface it registered.\n *\n * `surfaces` is matched by extension *name* (mirroring\n * {@link describeExtensionActivation}'s name filter), so when the same name is\n * loaded in both the project and global layers each entry reflects that name's\n * combined surfaces -- the `layer`/`version` fields still distinguish the\n * physical entries.\n */\nexport interface ExtensionSurfaceDescription {\n name: string;\n layer: ExtensionLayer;\n version: string;\n activation_status: ExtensionDescribeActivationStatus;\n surfaces: ExtensionActivationSummary;\n}\n\n/**\n * Result of {@link buildExtensionDescribeResult}: the per-extension surface maps\n * plus a deduplicated `union` across the described set. `target` echoes the\n * requested name filter (or `null` for the whole workspace) and `total` counts\n * the described entries so callers need not re-measure `extensions`.\n */\nexport interface ExtensionDescribeResult {\n target: string | null;\n total: number;\n extensions: ExtensionSurfaceDescription[];\n union: ExtensionActivationSummary;\n}\n\n/**\n * Compose a collision-free identity key for an extension from its layer and\n * normalized name. The two parts are joined with a colon; the layer prefix is\n * always a colon-free enum value, so distinct (layer, name) pairs never collide\n * even when a name itself contains a colon.\n */\nfunction layerNameKey(layer: ExtensionLayer, name: string): string {\n return `${layer}:${normalizeExtensionNameForMatch(name)}`;\n}\n\n/**\n * Summarize, by name, every registration surface the loaded extensions exercised.\n *\n * Walks `loadResult.loaded` (annotating each with `failed` when its layer+name is\n * in `activationResult.failed`) and `loadResult.failed` (as `not_loaded`), sorts\n * the entries by name then layer for deterministic output, and attaches each\n * extension's {@link describeExtensionActivation} summary. When `target` is\n * provided only the case-insensitively matching extensions are described and the\n * `union` is scoped to that name; otherwise every loaded extension contributes.\n * An unmatched `target` yields an empty `extensions` array -- the caller decides\n * whether that is a not-found error.\n */\nexport function buildExtensionDescribeResult(\n target: string | undefined,\n loadResult: ExtensionLoadResult,\n activationResult: ExtensionActivationResult,\n): ExtensionDescribeResult {\n const activationFailedKeys = new Set(activationResult.failed.map((entry) => layerNameKey(entry.layer, entry.name)));\n const candidates: ExtensionSurfaceDescription[] = [\n ...loadResult.loaded.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: entry.version,\n activation_status: activationFailedKeys.has(layerNameKey(entry.layer, entry.name))\n ? (\"failed\" as const)\n : (\"ok\" as const),\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ...loadResult.failed.map((entry) => ({\n name: entry.name,\n layer: entry.layer,\n version: \"unknown\",\n activation_status: \"not_loaded\" as const,\n surfaces: describeExtensionActivation(activationResult, { extensionName: entry.name }),\n })),\n ].sort((left, right) => left.name.localeCompare(right.name) || left.layer.localeCompare(right.layer));\n\n const normalizedTarget = typeof target === \"string\" ? normalizeExtensionNameForMatch(target) : null;\n const extensions =\n normalizedTarget === null\n ? candidates\n : candidates.filter((entry) => normalizeExtensionNameForMatch(entry.name) === normalizedTarget);\n\n return {\n target: typeof target === \"string\" ? target.trim() : null,\n total: extensions.length,\n extensions,\n union: describeExtensionActivation(activationResult, normalizedTarget === null ? {} : { extensionName: target }),\n };\n}\n\n/**\n * Human-readable label for each {@link ExtensionDescribeActivationStatus}, used\n * in the Markdown per-extension heading so a reader sees *why* an entry has no\n * surfaces (activation failed / never loaded) rather than assuming it\n * contributes nothing.\n */\nconst ACTIVATION_STATUS_LABELS: Record<ExtensionDescribeActivationStatus, string> = {\n ok: \"loaded\",\n failed: \"activation failed\",\n not_loaded: \"not loaded\",\n};\n\n/**\n * Render an {@link ExtensionDescribeResult} as a Markdown reference document: a\n * top-level title and scope line, one section per described extension (titled\n * with its identity and activation status), and — only when more than one\n * extension was described — a final union section spanning them all. Each\n * extension and the union are rendered with the shared\n * {@link renderExtensionSurfaceMarkdown} primitive at heading level 2, so the\n * document nests cleanly under the level-1 title.\n *\n * `noun` is the lifecycle vocabulary (`\"extension\"` or `\"package\"`) so the prose\n * matches the command the agent invoked. When no extensions match (an unmatched\n * target is already a not-found error upstream, so this is the \"nothing loaded\"\n * case) the document is the title plus a single explanatory note.\n */\nexport function renderExtensionDescribeMarkdown(result: ExtensionDescribeResult, noun: string): string {\n const titleNoun = `${noun[0]!.toUpperCase()}${noun.slice(1)}`;\n const lines = [`# ${titleNoun} surface reference`, \"\"];\n lines.push(result.target === null ? `Scope: all loaded ${noun}s` : `Scope: \\`${result.target}\\``);\n lines.push(`Described: ${result.total} ${noun}${result.total === 1 ? \"\" : \"s\"}`, \"\");\n\n if (result.extensions.length === 0) {\n lines.push(`_No ${noun}s are loaded._`, \"\");\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n }\n\n for (const entry of result.extensions) {\n const title = `${entry.name} (${entry.layer} v${entry.version}, ${ACTIVATION_STATUS_LABELS[entry.activation_status]})`;\n // renderExtensionSurfaceMarkdown already ends with a newline; the join adds a\n // single blank line between sections, so no extra \"\" separator is pushed.\n lines.push(renderExtensionSurfaceMarkdown(entry.surfaces, { title, headingLevel: 2 }));\n }\n\n if (result.extensions.length > 1) {\n lines.push(renderExtensionSurfaceMarkdown(result.union, { title: `Union across all described ${noun}s`, headingLevel: 2 }));\n }\n\n return `${lines.join(\"\\n\").trimEnd()}\\n`;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;AAYjB,IAAM,4BAA4B;AAC3B,IAAM,0BAA0B;AACvC,IAAM,uBAAuB;AAC7B,IAAM,gCAAgC;EACpC,SAAS;EACT,UAAU;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX,eAAe;;AAGjB,IAAM,kCAAkC,oBAAI,IAAI;EAC9C,GAAG,sBAAsB,IAAI,CAAC,gBAAgB,YAAY,MAAM,GAAG,EAAE,CAAC,EAAG,YAAW,CAAE;EACtF,GAAG,OAAO,KAAK,0BAA0B,EAAE,IAAI,CAAC,UAAU,MAAM,YAAW,CAAE;;;EAG7E;CACD;AAID,IAAM,8BAA8B;AAMpC,IAAM,8BAA8B;AAEpC,IAAM,+BAA+B;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGF,IAAM,+BAA+B;EACnC;EACA;EACA;;AAGF,SAAS,qBAAqB,OAA0B,QAAc;AACpE,SAAO,MAAM,IAAI,CAAC,SAAU,SAAS,KAAK,OAAO,GAAG,MAAM,GAAG,IAAI,EAAG;AACtE;AAEA,SAAS,oCAAoC,SAO5C;AACC,QAAM,gBAAgB,QAAQ,oCAAoC,OAAO,CAAC,+BAA+B,IAAI,CAAA;AAC7G,SAAO;IACL;IACA;IACA;IACA,qDAAqD,KAAK,UAAU,QAAQ,YAAY,CAAC,oBAAoB,KAAK,UAAU,QAAQ,aAAa,CAAC;IAClJ,4CAA4C,KAAK,UAAU,QAAQ,cAAc,CAAC;IAClF,oDAAoD,KAAK,UAAU,QAAQ,SAAS,CAAC,oBAAoB,KAAK,UAAU,QAAQ,aAAa,CAAC;IAC9I;I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ACF,SACE;EACF,WACE;EACF,QACE;EACF,WACE;EACF,UACE;;AAGJ,IAAM,sBAAmE;EACvE,UACE;EACF,OACE;EACF,QACE;EACF,WACE;EACF,QACE;EACF,SACE;EACF,WACE;EACF,QACE;EACF,WACE;EACF,UACE;;AAGJ,IAAM,kBAAkB;AAExB,IAAM,qCAA6F;EACjG,UAAU,CAAA;EACV,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;;AAIJ,IAAM,uCAA+F;EACnG,UAAU,CAAA;EACV,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,QAAQ;IACN;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,WAAW;IACT;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;IACA;;;AAMJ,IAA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ACA;MACA;MACA;MACA;MACA;MACA;MACA,WAAW,KAAK,UAAU,WAAW,CAAC;MACtC,oBAAoB,KAAK,UAAU,cAAc,aAAa,gBAAgB,CAAC;MAC/E;MACA;MACA;;EAEJ;AACA,MAAI,eAAe,WAAW;AAC5B,WAAO;MACL,GAAG;MACH;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;;;MAGA,GAAG,gCAAgC,aAAa,EAAE,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE;MAC3E;;EAEJ;AACA,MAAI,eAAe,aAAa;AAC9B,WAAO;MACL,GAAG;MACH;MACA;MACA;MACA;MACA;MACA;MACA,OAAO,KAAK,UAAU,WAAW,CAAC;MAClC;MACA;MACA;MACA;MACA;MACA;MACA,iBAAiB,KAAK,UAAU,GAAG,WAAW,SAAS,CAAC;MACxD;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,OAAO,KAAK,UAAU,WAAW,CAAC;MAClC;MACA;MACA;MACA;MACA;MACA;MACA,iBAAiB,KAAK,UAAU,GAAG,WAAW,SAAS,CAAC;MACxD;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;;EAEJ;AACA,MAAI,eAAe,aAAa;AAC9B,WAAO;MACL,GAAG;MACH;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,+BAA+B,KAAK,UAAU,WAAW,CAAC;MAC1D;MACA;MACA,cAAc,KAAK,UAAU,GAAG,aAAa,IAAI,CAAC;MAClD;;EAEJ;AACA,MAAI,eAAe,UAAU;AAC3B,WAAO;;;;;;MAML;MACA,aAAa,KAAK,UAAU,WAAW,CAAC;MACxC;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,iBAAiB,KAAK,UAAU,aAAa,CAAC;MAC9C;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA;MACA,wBAAwB,KAAK,UAAU,WAAW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wBAAwB;AAC5C,kBAAY,KACV,IACA,kFACA,mFACA,qFACA,qFACA,yEACA,wBACA,eACA,OACA,oFACA,6EACA,KAAK;AAEP,sBAAgB,KAAK,gDAAgD;AACrE;IACF,KAAK;AACH,qBAAe,KAAK,wBAAwB,0BAA0B;AACtE,kBAAY,KACV,IACA,iFACA,sFACA,mFACA,wDACA,WAAW,KAAK,UAAU,kBAAkB,CAAC,KAC7C,iCACA,mDACA,sCACA,iCACA,8EACA,0CACA,YACA,+BACA,qCACA,qBACA,sCACA,cACA,wBACA,QACA,uDACA,OACA,IACA,kFACA,iFACA,iCACA,gEACA,WAAW,KAAK,UAAU,iBAAiB,CAAC,KAC5C,qFACA,uEACA,mEACA,KAAK;AAEP,sBAAgB,KAAK,wCAAwC,8CAA8C;AAC3G;IACF,KAAK;AACH,qBAAe,KAAK,kBAAkB,gBAAgB;AACtD,kBAAY,KACV,IACA,gFACA,qFACA,kFACA,wDACA,gEACA,kBACA,kDACA,yBACA,QACA,IACA,gEACA,qBACA,2DACA,yBACA,MAAM;AAER,sBAAgB,KACd,kBACA,SACA,eAAe,KAAK,UAAU,WAAW,CAAC,KAC1C,mBACA,oBACA,mBAAmB,KAAK,UAAU,GAAG,WAAW,SAAS,CAAC,KAC1D,mEACA,oBACA,eACA,iCACA,mCACA,qCACA,mEACA,gBACA,cACA,YACA,UACA,QACA,kBACA,SACA,eAAe,KAAK,UAAU,WAAW,CAAC,KAC1C,mBACA,oBACA,mBAAmB,KAAK,UAAU,GAAG,WAAW,SAAS,CAAC,KAC1D,mEACA,oBACA,eACA,sCACA,mCACA,qCACA,sEACA,gBACA,cACA,YACA,UACA,MAAM;AAER;IACF,KAAK;AACH,qBAAe,KAAK,mBAAmB,kBAAkB,iBAAiB;AAC1E,kBAAY,KACV,IACA,qFACA,kFACA,8EACA,qDACA,8CACA,WAAW,KAAK,UAAU,SAAS,CAAC,KACpC,qBACA,qBACA,OACA,IACA,4CACA,WAAW,KAAK,UAAU,YAAY,CAAC,K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,EAAE;AACrD,QAAM,KAAK,OAAO,WAAW,OAAO,qBAAqB,IAAI,MAAM,YAAY,OAAO,MAAM,IAAI;AAChG,QAAM,KAAK,cAAc,OAAO,KAAK,IAAI,IAAI,GAAG,OAAO,UAAU,IAAI,KAAK,GAAG,IAAI,EAAE;AAEnF,MAAI,OAAO,WAAW,WAAW,GAAG;AAClC,UAAM,KAAK,OAAO,IAAI,kBAAkB,EAAE;AAC1C,WAAO,GAAG,MAAM,KAAK,IAAI,EAAE,QAAO,CAAE;;EACtC;AAEA,aAAW,SAAS,OAAO,YAAY;AACrC,UAAM,QAAQ,GAAG,MAAM,IAAI,KAAK,MAAM,KAAK,KAAK,MAAM,OAAO,KAAK,yBAAyB,MAAM,iBAAiB,CAAC;AAGnH,UAAM,KAAK,+BAA+B,MAAM,UAAU,EAAE,OAAO,cAAc,EAAC,CAAE,CAAC;EACvF;AAEA,MAAI,OAAO,WAAW,SAAS,GAAG;AAChC,UAAM,KAAK,+BAA+B,OAAO,OAAO,EAAE,OAAO,8BAA8B,IAAI,KAAK,cAAc,EAAC,CAAE,CAAC;EAC5H;AAEA,SAAO,GAAG,MAAM,KAAK,IAAI,EAAE,QAAO,CAAE;;AACtC","debugId":"4ae6de33-ef9d-5355-9db6-897bab80e250"}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import {
|
|
4
4
|
isRemoteLinkedArtifactReference
|
|
5
5
|
} from "./chunk-IBMFIKVS.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveAuthor
|
|
8
|
+
} from "./chunk-T5RRNDA7.js";
|
|
6
9
|
import {
|
|
7
10
|
assertNoUnknownCsvKeys,
|
|
8
11
|
createStdinTokenResolver,
|
|
9
12
|
looksLikeGenericKeyValueEntry,
|
|
10
13
|
parseCsvKv
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
resolveAuthor
|
|
14
|
-
} from "./chunk-T5RRNDA7.js";
|
|
14
|
+
} from "./chunk-3C5T3ZEO.js";
|
|
15
15
|
import {
|
|
16
16
|
splitCommaList
|
|
17
17
|
} from "./chunk-P4SESZGT.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
locateItem,
|
|
21
21
|
mutateItem,
|
|
22
22
|
readLocatedItem
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UYLA5ROU.js";
|
|
24
24
|
import {
|
|
25
25
|
EXIT_CODE,
|
|
26
26
|
PmCliError,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
readSettings,
|
|
32
32
|
resolveItemTypeRegistry,
|
|
33
33
|
resolvePmRoot
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SL2ANJSV.js";
|
|
35
35
|
|
|
36
36
|
// dist/cli/commands/linked-artifacts.js
|
|
37
37
|
import fs from "node:fs/promises";
|
|
@@ -391,6 +391,6 @@ export {
|
|
|
391
391
|
runLinkedArtifacts,
|
|
392
392
|
renameArtifactsResultKey
|
|
393
393
|
};
|
|
394
|
-
//# sourceMappingURL=chunk-
|
|
394
|
+
//# sourceMappingURL=chunk-M6PR5BC6.js.map
|
|
395
395
|
|
|
396
396
|
//# debugId=e455daa2-7c3a-5a87-ad9a-570e05956efd
|