@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
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8ed8bc69-334a-5d95-a6b7-00ce71f6b477")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
runExtension
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-J4KNRDI3.js";
|
|
6
6
|
import {
|
|
7
7
|
TYPE_PRESET_NAMES,
|
|
8
8
|
normalizeTypePresetName,
|
|
9
9
|
resolveTypePresetDefinitions
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YZWXMDNH.js";
|
|
11
11
|
import {
|
|
12
12
|
parseItemTypesFile,
|
|
13
13
|
serializeItemTypesFile,
|
|
14
14
|
upsertItemType
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YZR7UMZ6.js";
|
|
16
16
|
import {
|
|
17
17
|
normalizePrefix
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UYLA5ROU.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
|
|
21
21
|
EXIT_CODE,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
runActiveOnWriteHooks,
|
|
36
36
|
writeFileAtomic,
|
|
37
37
|
writeSettings
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-SL2ANJSV.js";
|
|
39
39
|
|
|
40
40
|
// dist/cli/commands/init.js
|
|
41
41
|
import fs2 from "node:fs/promises";
|
|
@@ -68,6 +68,7 @@ var AGENT_GUIDANCE_TEMPLATE_VERSION = 1;
|
|
|
68
68
|
var AGENT_GUIDANCE_START_MARKER_PREFIX = "<!-- pm-cli:agent-guidance:start:";
|
|
69
69
|
var AGENT_GUIDANCE_START_MARKER = `<!-- pm-cli:agent-guidance:start:v${AGENT_GUIDANCE_TEMPLATE_VERSION} -->`;
|
|
70
70
|
var AGENT_GUIDANCE_END_MARKER = "<!-- pm-cli:agent-guidance:end -->";
|
|
71
|
+
var AGENT_GUIDANCE_ADD_LATER_HINT = "Add workflow guidance later: pm init --agent-guidance add";
|
|
71
72
|
var createAgentGuidanceReadlineInterface = () => readline.createInterface({ input, output });
|
|
72
73
|
function toPortableRelativePath(projectRoot, targetPath) {
|
|
73
74
|
const relative = path.relative(projectRoot, targetPath);
|
|
@@ -246,119 +247,174 @@ async function writeGuidanceFile(filePath) {
|
|
|
246
247
|
})
|
|
247
248
|
};
|
|
248
249
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const markState = (partial) => {
|
|
264
|
-
state = {
|
|
265
|
-
...state,
|
|
266
|
-
...partial,
|
|
267
|
-
template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,
|
|
268
|
-
last_checked_files: checkedFiles
|
|
269
|
-
};
|
|
250
|
+
function buildInitAgentGuidanceSummary(params) {
|
|
251
|
+
return {
|
|
252
|
+
mode: params.mode,
|
|
253
|
+
present: params.scans.some((entry) => entry.has_guidance),
|
|
254
|
+
prompted: params.prompted,
|
|
255
|
+
applied: params.applied,
|
|
256
|
+
skipped: params.skipped,
|
|
257
|
+
declined: params.state.declined,
|
|
258
|
+
prompt_completed: params.state.prompt_completed,
|
|
259
|
+
template_version: params.state.template_version,
|
|
260
|
+
target_file: params.targetRelativePath,
|
|
261
|
+
checked_files: params.scans.map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),
|
|
262
|
+
files_with_guidance: params.scans.filter((entry) => entry.has_guidance).map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),
|
|
263
|
+
missing_files: params.scans.filter((entry) => !entry.exists).map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path))
|
|
270
264
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
265
|
+
}
|
|
266
|
+
async function refreshGuidanceScansAfterApply(applied, scans, projectRoot) {
|
|
267
|
+
return applied ? await scanGuidanceFiles(projectRoot) : scans;
|
|
268
|
+
}
|
|
269
|
+
function markAgentGuidanceRunState(flow, checkedFiles, partial) {
|
|
270
|
+
flow.state = {
|
|
271
|
+
...flow.state,
|
|
272
|
+
...partial,
|
|
273
|
+
template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,
|
|
274
|
+
last_checked_files: checkedFiles
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
async function addAgentGuidanceBlockIfMissing(flow, context) {
|
|
278
|
+
if (context.presentBefore) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const writeResult = await writeGuidanceFile(context.targetPath);
|
|
282
|
+
flow.warnings.push(...writeResult.warnings);
|
|
283
|
+
if (writeResult.changed) {
|
|
284
|
+
flow.applied = true;
|
|
285
|
+
flow.warnings.push(`agent_guidance:added:${context.targetRelativePath}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function handleAgentGuidanceStatusMode(flow, presentBefore) {
|
|
289
|
+
if (!presentBefore) {
|
|
290
|
+
flow.warnings.push("agent_guidance:missing");
|
|
291
|
+
pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function handleAgentGuidanceSkipMode(flow, checkedFiles) {
|
|
295
|
+
flow.skipped = true;
|
|
296
|
+
markAgentGuidanceRunState(flow, checkedFiles, {
|
|
297
|
+
prompt_completed: true,
|
|
298
|
+
declined: true,
|
|
299
|
+
declined_at: flow.state.declined_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
300
|
+
});
|
|
301
|
+
flow.warnings.push("agent_guidance:explicit_skip");
|
|
302
|
+
pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
|
|
303
|
+
}
|
|
304
|
+
async function handleAgentGuidanceAddMode(flow, context) {
|
|
305
|
+
await addAgentGuidanceBlockIfMissing(flow, context);
|
|
306
|
+
markAgentGuidanceRunState(flow, context.checkedFiles, {
|
|
307
|
+
prompt_completed: true,
|
|
308
|
+
declined: false,
|
|
309
|
+
declined_at: ""
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
function handlePresentAgentGuidance(flow, checkedFiles) {
|
|
313
|
+
if (flow.state.declined) {
|
|
314
|
+
markAgentGuidanceRunState(flow, checkedFiles, {
|
|
279
315
|
prompt_completed: true,
|
|
280
|
-
declined:
|
|
281
|
-
declined_at:
|
|
316
|
+
declined: false,
|
|
317
|
+
declined_at: ""
|
|
282
318
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function handleDeclinedAgentGuidance(flow) {
|
|
322
|
+
flow.skipped = true;
|
|
323
|
+
flow.warnings.push("agent_guidance:skipped_declined");
|
|
324
|
+
pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
|
|
325
|
+
}
|
|
326
|
+
async function handleInteractiveAgentGuidancePrompt(flow, context) {
|
|
327
|
+
flow.prompted = true;
|
|
328
|
+
const approved = await promptForGuidanceWrite(context.targetRelativePath);
|
|
329
|
+
if (approved) {
|
|
330
|
+
await addAgentGuidanceBlockIfMissing(flow, context);
|
|
331
|
+
markAgentGuidanceRunState(flow, context.checkedFiles, {
|
|
295
332
|
prompt_completed: true,
|
|
296
333
|
declined: false,
|
|
297
334
|
declined_at: ""
|
|
298
335
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
flow.skipped = true;
|
|
339
|
+
markAgentGuidanceRunState(flow, context.checkedFiles, {
|
|
340
|
+
prompt_completed: true,
|
|
341
|
+
declined: true,
|
|
342
|
+
declined_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
343
|
+
});
|
|
344
|
+
flow.warnings.push("agent_guidance:declined");
|
|
345
|
+
pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
|
|
346
|
+
}
|
|
347
|
+
function handleNonInteractiveMissingAgentGuidance(flow) {
|
|
348
|
+
flow.warnings.push("agent_guidance:missing_non_interactive");
|
|
349
|
+
pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);
|
|
350
|
+
}
|
|
351
|
+
async function applyAgentGuidanceMode(initialState, context) {
|
|
352
|
+
const flow = {
|
|
353
|
+
warnings: [],
|
|
354
|
+
nextSteps: [],
|
|
355
|
+
prompted: false,
|
|
356
|
+
applied: false,
|
|
357
|
+
skipped: false,
|
|
358
|
+
state: initialState
|
|
359
|
+
};
|
|
360
|
+
if (context.mode === "status") {
|
|
361
|
+
handleAgentGuidanceStatusMode(flow, context.presentBefore);
|
|
362
|
+
return flow;
|
|
363
|
+
}
|
|
364
|
+
if (context.mode === "skip") {
|
|
365
|
+
handleAgentGuidanceSkipMode(flow, context.checkedFiles);
|
|
366
|
+
return flow;
|
|
367
|
+
}
|
|
368
|
+
if (context.mode === "add") {
|
|
369
|
+
await handleAgentGuidanceAddMode(flow, context);
|
|
370
|
+
return flow;
|
|
371
|
+
}
|
|
372
|
+
if (context.presentBefore) {
|
|
373
|
+
handlePresentAgentGuidance(flow, context.checkedFiles);
|
|
374
|
+
return flow;
|
|
375
|
+
}
|
|
376
|
+
if (flow.state.prompt_completed && flow.state.declined) {
|
|
377
|
+
handleDeclinedAgentGuidance(flow);
|
|
378
|
+
return flow;
|
|
339
379
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
380
|
+
if (context.interactive) {
|
|
381
|
+
await handleInteractiveAgentGuidancePrompt(flow, context);
|
|
382
|
+
return flow;
|
|
343
383
|
}
|
|
344
|
-
|
|
384
|
+
handleNonInteractiveMissingAgentGuidance(flow);
|
|
385
|
+
return flow;
|
|
386
|
+
}
|
|
387
|
+
async function runInitAgentGuidance(options) {
|
|
388
|
+
const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);
|
|
389
|
+
let scans = await scanGuidanceFiles(projectRoot);
|
|
390
|
+
const targetPath = resolveTargetGuidancePath(scans, projectRoot);
|
|
391
|
+
const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);
|
|
392
|
+
const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));
|
|
393
|
+
const presentBefore = scans.some((entry) => entry.has_guidance);
|
|
394
|
+
const flow = await applyAgentGuidanceMode(normalizeAgentGuidanceState(options.settings), {
|
|
345
395
|
mode: options.mode,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
396
|
+
interactive: options.interactive,
|
|
397
|
+
targetPath,
|
|
398
|
+
targetRelativePath,
|
|
399
|
+
checkedFiles,
|
|
400
|
+
presentBefore
|
|
401
|
+
});
|
|
402
|
+
const stateUpdate = applyAgentGuidanceState(options.settings, flow.state);
|
|
403
|
+
scans = await refreshGuidanceScansAfterApply(flow.applied, scans, projectRoot);
|
|
404
|
+
const summary = buildInitAgentGuidanceSummary({
|
|
405
|
+
mode: options.mode,
|
|
406
|
+
scans,
|
|
407
|
+
projectRoot,
|
|
408
|
+
targetRelativePath,
|
|
409
|
+
prompted: flow.prompted,
|
|
410
|
+
applied: flow.applied,
|
|
411
|
+
skipped: flow.skipped,
|
|
412
|
+
state: flow.state
|
|
413
|
+
});
|
|
358
414
|
return {
|
|
359
415
|
summary,
|
|
360
|
-
warnings,
|
|
361
|
-
next_steps: nextSteps,
|
|
416
|
+
warnings: flow.warnings,
|
|
417
|
+
next_steps: flow.nextSteps,
|
|
362
418
|
settings_changed: stateUpdate.changed
|
|
363
419
|
};
|
|
364
420
|
}
|
|
@@ -875,7 +931,7 @@ async function runInit(prefixArg, global, options = {}) {
|
|
|
875
931
|
const settingsPath = path2.join(pmRoot, "settings.json");
|
|
876
932
|
const settingsExists = await pathExists(settingsPath);
|
|
877
933
|
const normalizedOptions = normalizeInitCommandOptions(options);
|
|
878
|
-
|
|
934
|
+
const settingsResolution = await resolveInitSettings({
|
|
879
935
|
pmRoot,
|
|
880
936
|
settingsPath,
|
|
881
937
|
settingsExists,
|
|
@@ -932,6 +988,6 @@ export {
|
|
|
932
988
|
_testOnly,
|
|
933
989
|
runInit
|
|
934
990
|
};
|
|
935
|
-
//# sourceMappingURL=chunk-
|
|
991
|
+
//# sourceMappingURL=chunk-4KPQQ42D.js.map
|
|
936
992
|
|
|
937
|
-
//# debugId=
|
|
993
|
+
//# debugId=8ed8bc69-334a-5d95-a6b7-00ce71f6b477
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/init.ts","../../../../../../../../cli/commands/init-agent-guidance.ts"],"sourcesContent":["/**\n * @module cli/commands/init\n *\n * Implements the pm init command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { getActiveExtensionRegistrations, runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { normalizePrefix } from \"../../core/item/id.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ensureRuntimeSchemaFileScaffold,\n filePathForSchemaSection,\n normalizeRuntimeSchemaSettings,\n} from \"../../core/schema/runtime-schema.js\";\nimport {\n parseItemTypesFile,\n serializeItemTypesFile,\n upsertItemType,\n} from \"../../core/schema/item-types-file.js\";\nimport {\n normalizeTypePresetName,\n resolveTypePresetDefinitions,\n TYPE_PRESET_NAMES,\n type TypePresetName,\n} from \"../../core/schema/type-presets.js\";\nimport { EXIT_CODE, GOVERNANCE_PRESET_DEFAULTS, PM_REQUIRED_SUBDIRS, SETTINGS_DEFAULTS } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings, writeSettings } from \"../../core/store/settings.js\";\nimport type { GovernancePreset, PmSettings } from \"../../types/index.js\";\nimport { runExtension, type ExtensionCommandResult } from \"./extension.js\";\nimport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n} from \"./init-agent-guidance.js\";\n\n/**\n * Documents the init installed packages summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitInstalledPackagesSummary {\n installed_all: boolean;\n installed_count: number;\n packages: Array<{\n alias: string;\n ok: boolean;\n }>;\n}\n\n/**\n * Restricts init type preset name values accepted by command, SDK, and storage contracts.\n */\nexport type InitTypePresetName = TypePresetName;\n\n/**\n * Documents the init registered type preset summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitRegisteredTypePresetSummary {\n name: InitTypePresetName;\n registered: string[];\n updated: string[];\n file: string;\n}\n\n/**\n * Documents the init agent-guidance summary plus generated next-step hints returned by init.\n */\nexport type InitAgentGuidanceResult = InitAgentGuidanceSummary & { next_steps: string[] };\n\n/**\n * Documents the init result payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitResult {\n ok: boolean;\n path: string;\n settings: PmSettings;\n created_dirs: string[];\n warnings: string[];\n governance_preset: GovernancePreset;\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceResult;\n}\n\n/**\n * Documents the init command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitCommandOptions {\n preset?: string;\n defaults?: boolean;\n author?: string;\n withPackages?: boolean;\n agentGuidance?: string;\n typePreset?: string;\n force?: boolean;\n}\n\n/**\n * Concise projection of an InitResult for the default (toon) renderer. It keeps\n * every piece of information that only init can surface — the resolved path, id\n * prefix, governance preset, telemetry capture level, created-directory count,\n * the full warnings list (including `already_exists:` markers), agent-guidance\n * summary, and next steps — but replaces the verbose full settings tree (~190\n * lines) with a compact `settings` summary. Use --verbose for the full tree.\n */\nexport interface InitConciseResult {\n ok: boolean;\n path: string;\n id_prefix: string;\n governance_preset: GovernancePreset;\n telemetry: {\n enabled: boolean;\n capture_level: string;\n };\n output_format: string;\n created_dirs_count: number;\n created_dirs: string[];\n warnings: string[];\n wizard_used: boolean;\n registered_type_preset?: InitRegisteredTypePresetSummary;\n installed_packages?: InitInstalledPackagesSummary;\n next_steps: string[];\n agent_guidance: InitAgentGuidanceResult;\n hint: string;\n}\n\n/**\n * Implements summarize init result for the public runtime surface of this module.\n */\nexport function summarizeInitResult(result: InitResult): InitConciseResult {\n return {\n ok: result.ok,\n path: result.path,\n id_prefix: result.settings.id_prefix,\n governance_preset: result.governance_preset,\n telemetry: {\n enabled: result.settings.telemetry.enabled,\n capture_level: result.settings.telemetry.capture_level,\n },\n output_format: result.settings.output.default_format,\n created_dirs_count: result.created_dirs.length,\n created_dirs: result.created_dirs,\n warnings: result.warnings,\n wizard_used: result.wizard_used,\n ...(result.registered_type_preset ? { registered_type_preset: result.registered_type_preset } : {}),\n ...(result.installed_packages ? { installed_packages: result.installed_packages } : {}),\n next_steps: result.next_steps,\n agent_guidance: result.agent_guidance,\n hint: \"Re-run with --verbose for the full settings tree.\",\n };\n}\n\nexport const _testOnly = {\n normalizeInitGovernancePreset,\n normalizeInitTypePreset,\n normalizeOptionalInitAuthor,\n normalizeInitAgentGuidanceMode,\n isPathLikeInitTarget,\n resolveInitInvocation,\n parseYesNoChoice,\n applyGovernancePreset,\n runInitWizard,\n setInitReadlineFactoryForTests,\n summarizeInstalledPackages,\n registerInitTypePreset,\n assertExplicitTrackerPathIsNotWorkspaceRoot,\n isLikelyWorkspaceRoot,\n};\n\ntype InitReadlineInterface = ReturnType<typeof readline.createInterface>;\nlet createInitReadlineInterface = (): InitReadlineInterface => readline.createInterface({ input, output });\n\ninterface InitNormalizedOptions {\n presetFromOption: BuiltinGovernancePreset | undefined;\n useDefaults: boolean;\n authorFromOption: string | undefined;\n installBundledPackages: boolean;\n agentGuidanceMode: InitAgentGuidanceMode;\n typePreset: InitTypePresetName | undefined;\n}\n\ninterface InitSettingsResolution {\n settings: PmSettings;\n normalizedPrefix: string;\n chosenPreset: BuiltinGovernancePreset | undefined;\n wizardUsed: boolean;\n}\n\nfunction setInitReadlineFactoryForTests(factory: (() => InitReadlineInterface) | undefined): void {\n createInitReadlineInterface = factory ?? (() => readline.createInterface({ input, output }));\n}\n\nfunction cloneDefaults(): PmSettings {\n return structuredClone(SETTINGS_DEFAULTS);\n}\n\ntype BuiltinGovernancePreset = Exclude<GovernancePreset, \"custom\">;\nconst BUILTIN_GOVERNANCE_PRESETS: BuiltinGovernancePreset[] = [\"minimal\", \"default\", \"strict\"];\nfunction normalizeInitGovernancePreset(rawValue: string | undefined): BuiltinGovernancePreset | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"minimal\" || normalized === \"default\" || normalized === \"strict\") {\n return normalized;\n }\n if (normalized === \"lite\" || normalized === \"minimum\") {\n return \"minimal\";\n }\n throw new PmCliError(\n `Invalid --preset value \"${rawValue}\". Allowed: ${BUILTIN_GOVERNANCE_PRESETS.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction normalizeInitTypePreset(rawValue: string | undefined): InitTypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n if (rawValue.trim().length === 0) {\n throw new PmCliError(\"--type-preset must not be empty\", EXIT_CODE.USAGE);\n }\n try {\n // Non-undefined input never returns undefined; the shared normalizer throws\n // a plain Error for empty/unknown values, which we re-map to init's --type-preset\n // PmCliError wording for a consistent CLI surface.\n return normalizeTypePresetName(rawValue) as InitTypePresetName;\n } catch {\n throw new PmCliError(\n `Invalid --type-preset value \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction normalizeOptionalInitAuthor(rawValue: string | undefined): string | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim();\n if (normalized.length === 0) {\n throw new PmCliError(\"--author must not be empty\", EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\nfunction isPathLikeInitTarget(rawValue: string | undefined): boolean {\n if (rawValue === undefined) {\n return false;\n }\n const trimmed = rawValue.trim();\n if (trimmed.length === 0) {\n return false;\n }\n return path.isAbsolute(trimmed) || trimmed.startsWith(\".\") || trimmed.includes(\"/\") || trimmed.includes(\"\\\\\");\n}\n\nfunction resolveInitInvocation(\n cwd: string,\n global: GlobalOptions,\n prefixArg: string | undefined,\n): { pmRoot: string; prefixArg: string | undefined; positional_target?: string } {\n if (global.path === undefined && isPathLikeInitTarget(prefixArg)) {\n const positionalTarget = path.resolve(cwd, prefixArg!.trim());\n return {\n pmRoot: positionalTarget,\n prefixArg: undefined,\n positional_target: positionalTarget,\n };\n }\n return {\n pmRoot: resolvePmRoot(cwd, global.path),\n prefixArg,\n };\n}\n\nfunction normalizeInitAgentGuidanceMode(rawValue: string | undefined): InitAgentGuidanceMode {\n if (rawValue === undefined) {\n return \"ask\";\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new PmCliError(\"--agent-guidance must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"ask\" || normalized === \"add\" || normalized === \"skip\" || normalized === \"status\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --agent-guidance value \"${rawValue}\". Allowed: ${INIT_AGENT_GUIDANCE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction parseYesNoChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nfunction applyGovernancePreset(settings: PmSettings, preset: BuiltinGovernancePreset): void {\n const knobs = GOVERNANCE_PRESET_DEFAULTS[preset];\n settings.governance = {\n preset,\n ...knobs,\n };\n settings.validation.parent_reference = knobs.parent_reference;\n settings.validation.metadata_profile = knobs.metadata_profile;\n}\n\nfunction isInstalledPackageEntry(value: unknown): value is { alias?: unknown; ok?: unknown } {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction summarizeInstalledPackages(result: ExtensionCommandResult): InitInstalledPackagesSummary {\n const details = result.details as {\n installed_all?: unknown;\n installed_count?: unknown;\n packages?: Array<{\n alias?: unknown;\n ok?: unknown;\n }>;\n };\n return {\n installed_all: details.installed_all === true,\n installed_count: typeof details.installed_count === \"number\" ? details.installed_count : 0,\n packages: Array.isArray(details.packages)\n ? details.packages.filter(isInstalledPackageEntry).map((entry) => ({\n alias: typeof entry.alias === \"string\" ? entry.alias : \"\",\n ok: entry.ok === true,\n }))\n : [],\n };\n}\n\nasync function registerInitTypePreset(\n pmRoot: string,\n settings: PmSettings,\n preset: InitTypePresetName,\n): Promise<InitRegisteredTypePresetSummary> {\n const schema = normalizeRuntimeSchemaSettings(settings.schema);\n const typesPath = filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const parsed = parseItemTypesFile(await readFileIfExists(typesPath));\n let nextFile = parsed;\n const registered: string[] = [];\n const updated: string[] = [];\n for (const normalized of resolveTypePresetDefinitions(preset)) {\n const upsert = upsertItemType(nextFile, normalized);\n nextFile = upsert.file;\n (upsert.replaced ? updated : registered).push(upsert.definition.name);\n }\n await writeFileAtomic(typesPath, serializeItemTypesFile(nextFile));\n return {\n name: preset,\n registered,\n updated,\n file: typesPath,\n };\n}\n\nasync function isLikelyWorkspaceRoot(candidate: string): Promise<boolean> {\n const indicators = [\n \".git\",\n \"package.json\",\n \"pnpm-workspace.yaml\",\n \"AGENTS.md\",\n path.join(\".agents\", \"pm\"),\n ];\n for (const indicator of indicators) {\n if (await pathExists(path.join(candidate, indicator))) {\n return true;\n }\n }\n return false;\n}\n\nasync function assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot: string, global: GlobalOptions, force: boolean): Promise<void> {\n if (global.path === undefined || force) {\n return;\n }\n if (await pathExists(path.join(pmRoot, \"settings.json\"))) {\n return;\n }\n if (!(await isLikelyWorkspaceRoot(pmRoot))) {\n return;\n }\n const nestedTracker = path.join(pmRoot, \".agents\", \"pm\");\n throw new PmCliError(\n `Refusing to initialize tracker files directly in workspace root \"${pmRoot}\".`,\n EXIT_CODE.USAGE,\n {\n code: \"workspace_root_pm_path\",\n type: \"urn:pm-cli:error:workspace_root_pm_path\",\n why: \"--pm-path/--path points at the tracker storage directory itself, not the repository workspace. Point it at .agents/pm or pass --force if you intentionally want root-level tracker files.\",\n examples: [\n `pm --pm-path ${nestedTracker} init --yes`,\n \"pm init --yes\",\n `pm --pm-path ${pmRoot} init --yes --force`,\n ],\n nextSteps: [\n \"Use --pm-path <repo>/.agents/pm for repository-local tracker storage.\",\n \"Use PM_PATH only for sandboxed tests or explicit tracker roots.\",\n \"Pass --force only when root-level tracker files are intentional.\",\n ],\n recovery: {\n next_best_command: `pm --pm-path ${nestedTracker} init --yes`,\n },\n },\n );\n}\n\nasync function ensureInitDirectories(pmRoot: string, subdirs: readonly string[]): Promise<{\n createdDirs: string[];\n warnings: string[];\n}> {\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n for (const subdir of subdirs) {\n const target = subdir ? path.join(pmRoot, subdir) : pmRoot;\n const existed = await pathExists(target);\n await fs.mkdir(target, { recursive: true });\n if (existed) {\n warnings.push(`already_exists:${target}`);\n } else {\n createdDirs.push(target);\n }\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: target,\n scope: \"project\",\n op: \"init:ensure_dir\",\n })),\n );\n }\n return { createdDirs, warnings };\n}\n\nasync function runInitWizard(initialPrefix: string, telemetryDefault: boolean): Promise<{\n prefix: string;\n preset: BuiltinGovernancePreset;\n telemetry_enabled: boolean;\n}> {\n const rl = createInitReadlineInterface();\n try {\n output.write(\"pm init setup wizard (agent-optimized)\\n\");\n output.write(\"This walkthrough is non-destructive and each choice can be changed later with pm config.\\n\\n\");\n\n output.write(\"1/3 Item ID prefix\\n\");\n output.write(\"Prefix is prepended to generated IDs (for example pm-a1b2).\\n\");\n const prefixAnswer = await rl.question(`Item ID prefix [${initialPrefix}]: `);\n const resolvedPrefix = prefixAnswer.trim().length > 0 ? normalizePrefix(prefixAnswer) : initialPrefix;\n\n output.write(\"\\n2/3 Governance preset\\n\");\n output.write(\"minimal: no ownership blocking, progressive create defaults, close validation off.\\n\");\n output.write(\"default: ownership conflict warnings, progressive create defaults, close validation warn.\\n\");\n output.write(\"strict: ownership blocking, strict create defaults, close validation strict.\\n\");\n const presetAnswer = await rl.question(\"Governance preset [minimal/default/strict] (default: minimal): \");\n const presetChoice = presetAnswer.trim().length > 0 ? presetAnswer.trim() : \"minimal\";\n // The wizard is forgiving: a typo'd/unknown preset defaults to minimal with a\n // notice instead of throwing and aborting an in-progress interactive setup.\n // normalizeInitGovernancePreset returns a concrete preset for valid input and\n // throws (never returns undefined) for invalid non-empty input, so the result is\n // always a BuiltinGovernancePreset on the success path.\n let resolvedPreset: BuiltinGovernancePreset = \"minimal\";\n try {\n resolvedPreset = normalizeInitGovernancePreset(presetChoice) as BuiltinGovernancePreset;\n } catch {\n output.write(`Unrecognized governance preset \"${presetChoice}\"; using minimal.\\n`);\n }\n\n output.write(\"\\n3/3 Project telemetry\\n\");\n output.write(\"Telemetry helps improve reliability and can be disabled anytime via pm config.\\n\");\n const telemetryLabel = telemetryDefault ? \"Y/n\" : \"y/N\";\n const telemetryAnswer = await rl.question(`Enable telemetry for this project? [${telemetryLabel}] `);\n const telemetryEnabled = parseYesNoChoice(telemetryAnswer, telemetryDefault);\n\n output.write(\"\\n\");\n return {\n prefix: resolvedPrefix,\n preset: resolvedPreset,\n telemetry_enabled: telemetryEnabled,\n };\n } finally {\n rl.close();\n }\n}\n\nfunction normalizeInitCommandOptions(options: InitCommandOptions): InitNormalizedOptions {\n return {\n presetFromOption: normalizeInitGovernancePreset(options.preset),\n useDefaults: options.defaults === true,\n authorFromOption: normalizeOptionalInitAuthor(options.author),\n installBundledPackages: options.withPackages === true,\n agentGuidanceMode: normalizeInitAgentGuidanceMode(options.agentGuidance),\n typePreset: normalizeInitTypePreset(options.typePreset),\n };\n}\n\nfunction collectExistingSettingsPendingChanges(params: {\n settings: PmSettings;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n presetFromOption: BuiltinGovernancePreset | undefined;\n authorFromOption: string | undefined;\n}): string[] {\n const pendingChanges: string[] = [];\n if (params.prefixArg !== undefined && params.settings.id_prefix !== params.normalizedPrefix) {\n pendingChanges.push(\"id_prefix\");\n }\n if (params.presetFromOption !== undefined && params.settings.governance.preset !== params.presetFromOption) {\n pendingChanges.push(\"governance_preset\");\n }\n if (params.authorFromOption !== undefined && params.settings.author_default !== params.authorFromOption) {\n pendingChanges.push(\"author_default\");\n }\n return pendingChanges;\n}\n\nfunction assertExistingSettingsUpdateAllowed(settingsPath: string, pendingChanges: string[], force: boolean): void {\n if (pendingChanges.length === 0 || force) {\n return;\n }\n throw new PmCliError(\n `Refusing to update existing tracker settings at ${settingsPath} without --force.`,\n EXIT_CODE.USAGE,\n {\n code: \"init_existing_settings_requires_force\",\n type: \"urn:pm-cli:error:init_existing_settings_requires_force\",\n required: `--force for ${pendingChanges.join(\", \")}`,\n why: \"pm init is safe to rerun, but changing id prefix, governance preset, or default author on an existing tracker can corrupt long-lived project context when an agent meant to initialize a sandbox path.\",\n examples: [\n \"pm init --yes\",\n \"pm init ./sandbox-pm --yes\",\n \"pm init acme --yes --force\",\n ],\n nextSteps: [\n \"If you meant to initialize a sandbox tracker, pass a path-like positional such as ./sandbox-pm or /tmp/pm-test.\",\n \"If you intentionally want to rewrite this existing tracker's init-managed settings, rerun with --force.\",\n ],\n },\n );\n}\n\nfunction applyExistingSettingsUpdates(params: {\n settings: PmSettings;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n presetFromOption: BuiltinGovernancePreset | undefined;\n authorFromOption: string | undefined;\n warnings: string[];\n}): boolean {\n let changed = false;\n if (params.prefixArg !== undefined && params.settings.id_prefix !== params.normalizedPrefix) {\n params.settings.id_prefix = params.normalizedPrefix;\n params.warnings.push(`updated:id_prefix:${params.normalizedPrefix}`);\n changed = true;\n }\n if (params.presetFromOption !== undefined && params.settings.governance.preset !== params.presetFromOption) {\n applyGovernancePreset(params.settings, params.presetFromOption);\n params.warnings.push(`updated:governance_preset:${params.presetFromOption}`);\n changed = true;\n }\n if (params.authorFromOption !== undefined && params.settings.author_default !== params.authorFromOption) {\n params.settings.author_default = params.authorFromOption;\n params.warnings.push(`updated:author_default:${params.authorFromOption}`);\n changed = true;\n }\n return changed;\n}\n\nasync function loadExistingInitSettings(params: {\n pmRoot: string;\n settingsPath: string;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n options: InitCommandOptions;\n normalizedOptions: InitNormalizedOptions;\n warnings: string[];\n}): Promise<InitSettingsResolution> {\n const settings = await readSettings(params.pmRoot);\n params.warnings.push(`already_exists:${params.settingsPath}`);\n const pendingChanges = collectExistingSettingsPendingChanges({\n settings,\n normalizedPrefix: params.normalizedPrefix,\n prefixArg: params.prefixArg,\n presetFromOption: params.normalizedOptions.presetFromOption,\n authorFromOption: params.normalizedOptions.authorFromOption,\n });\n assertExistingSettingsUpdateAllowed(params.settingsPath, pendingChanges, params.options.force === true);\n if (\n applyExistingSettingsUpdates({\n settings,\n normalizedPrefix: params.normalizedPrefix,\n prefixArg: params.prefixArg,\n presetFromOption: params.normalizedOptions.presetFromOption,\n authorFromOption: params.normalizedOptions.authorFromOption,\n warnings: params.warnings,\n })\n ) {\n await writeSettings(params.pmRoot, settings);\n }\n return {\n settings,\n normalizedPrefix: params.normalizedPrefix,\n chosenPreset: params.normalizedOptions.presetFromOption,\n wizardUsed: false,\n };\n}\n\nasync function createNewInitSettings(params: {\n pmRoot: string;\n normalizedPrefix: string;\n normalizedOptions: InitNormalizedOptions;\n}): Promise<InitSettingsResolution> {\n let normalizedPrefix = params.normalizedPrefix;\n let chosenPreset = params.normalizedOptions.presetFromOption;\n let chosenTelemetryEnabled: boolean | undefined;\n let wizardUsed = false;\n if (\n params.normalizedOptions.presetFromOption === undefined &&\n !params.normalizedOptions.useDefaults &&\n process.stdin.isTTY === true &&\n process.stdout.isTTY === true\n ) {\n const wizardChoices = await runInitWizard(normalizedPrefix, SETTINGS_DEFAULTS.telemetry.enabled);\n normalizedPrefix = wizardChoices.prefix;\n chosenPreset = wizardChoices.preset;\n chosenTelemetryEnabled = wizardChoices.telemetry_enabled;\n wizardUsed = true;\n }\n const effectivePreset = chosenPreset ?? \"minimal\";\n const settings = cloneDefaults();\n settings.id_prefix = normalizedPrefix;\n applyGovernancePreset(settings, effectivePreset);\n if (params.normalizedOptions.authorFromOption !== undefined) {\n settings.author_default = params.normalizedOptions.authorFromOption;\n }\n if (chosenTelemetryEnabled !== undefined) {\n settings.telemetry.enabled = chosenTelemetryEnabled;\n settings.telemetry.first_run_prompt_completed = true;\n }\n await writeSettings(params.pmRoot, settings);\n return {\n settings,\n normalizedPrefix,\n chosenPreset,\n wizardUsed,\n };\n}\n\nasync function resolveInitSettings(params: {\n pmRoot: string;\n settingsPath: string;\n settingsExists: boolean;\n normalizedPrefix: string;\n prefixArg: string | undefined;\n options: InitCommandOptions;\n normalizedOptions: InitNormalizedOptions;\n warnings: string[];\n}): Promise<InitSettingsResolution> {\n if (params.settingsExists) {\n return await loadExistingInitSettings(params);\n }\n return await createNewInitSettings({\n pmRoot: params.pmRoot,\n normalizedPrefix: params.normalizedPrefix,\n normalizedOptions: params.normalizedOptions,\n });\n}\n\nasync function applyInitAgentGuidance(params: {\n pmRoot: string;\n cwd: string;\n agentGuidanceMode: InitAgentGuidanceMode;\n settings: PmSettings;\n warnings: string[];\n}): Promise<InitAgentGuidanceResult> {\n const agentGuidanceResult = await runInitAgentGuidance({\n pm_root: params.pmRoot,\n cwd: params.cwd,\n mode: params.agentGuidanceMode,\n interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,\n settings: params.settings,\n });\n params.warnings.push(...agentGuidanceResult.warnings);\n if (agentGuidanceResult.settings_changed) {\n await writeSettings(params.pmRoot, params.settings);\n }\n return {\n ...agentGuidanceResult.summary,\n next_steps: agentGuidanceResult.next_steps,\n };\n}\n\nasync function ensureInitRuntimeSchemaFiles(\n pmRoot: string,\n settings: PmSettings,\n): Promise<{\n createdDirs: string[];\n warnings: string[];\n}> {\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n const runtimeSchemaScaffold = await ensureRuntimeSchemaFileScaffold(pmRoot, settings.schema);\n for (const createdPath of runtimeSchemaScaffold.created_paths) {\n createdDirs.push(createdPath);\n warnings.push(\n ...(await runActiveOnWriteHooks({\n path: createdPath,\n scope: \"project\",\n op: \"init:runtime_schema_file\",\n })),\n );\n }\n return { createdDirs, warnings };\n}\n\nasync function maybeRegisterInitTypePreset(params: {\n pmRoot: string;\n settings: PmSettings;\n typePreset: InitTypePresetName | undefined;\n warnings: string[];\n}): Promise<InitRegisteredTypePresetSummary | undefined> {\n if (params.typePreset === undefined) {\n return undefined;\n }\n const registeredTypePreset = await registerInitTypePreset(params.pmRoot, params.settings, params.typePreset);\n params.warnings.push(`registered_type_preset:${params.typePreset}`);\n params.warnings.push(\n ...(await runActiveOnWriteHooks({\n path: registeredTypePreset.file,\n scope: \"project\",\n op: \"init:type_preset\",\n })),\n );\n return registeredTypePreset;\n}\n\nasync function ensureInitTypeDirectories(params: {\n pmRoot: string;\n settings: PmSettings;\n createdDirs: string[];\n warnings: string[];\n}): Promise<void> {\n const typeRegistry = resolveItemTypeRegistry(params.settings, getActiveExtensionRegistrations());\n const customTypeFolders = typeRegistry.folders.filter((folder) => !(PM_REQUIRED_SUBDIRS as readonly string[]).includes(folder));\n const scaffold = await ensureInitDirectories(params.pmRoot, customTypeFolders);\n params.createdDirs.push(...scaffold.createdDirs);\n params.warnings.push(...scaffold.warnings);\n}\n\nasync function maybeInstallInitBundledPackages(\n installBundledPackages: boolean,\n global: GlobalOptions,\n warnings: string[],\n): Promise<InitInstalledPackagesSummary | undefined> {\n if (!installBundledPackages) {\n return undefined;\n }\n const packageInstallResult = await runExtension(\"all\", { install: true, project: true }, global);\n warnings.push(...packageInstallResult.warnings);\n const installedPackages = summarizeInstalledPackages(packageInstallResult);\n if (!installedPackages.installed_all || installedPackages.packages.some((entry) => !entry.ok)) {\n throw new PmCliError(\"pm init --with-packages did not install all bundled packages successfully.\", EXIT_CODE.GENERIC_FAILURE);\n }\n return installedPackages;\n}\n\nfunction buildInitNextSteps(params: {\n installBundledPackages: boolean;\n registeredTypePreset: InitRegisteredTypePresetSummary | undefined;\n agentGuidanceNextSteps: string[];\n}): string[] {\n const nextSteps: string[] = [\n 'Create your first item: pm create --type Task --title \"<title>\"',\n 'List active items: pm list',\n 'Get agent-friendly project context: pm context',\n ];\n if (!params.installBundledPackages) {\n nextSteps.push(\n \"Add optional packages for richer workflows: pm install calendar --project, pm install templates --project, pm install guide-shell --project\",\n );\n nextSteps.push(\"Or install everything bundled: pm init --with-packages (idempotent on re-run)\");\n } else {\n nextSteps.push(\"Explore newly-available commands: pm cal, pm templates, pm guide\");\n }\n if (params.registeredTypePreset) {\n nextSteps.push(`Inspect registered preset types: pm schema list, pm schema show ${params.registeredTypePreset.registered[0] ?? params.registeredTypePreset.updated[0]}`);\n }\n nextSteps.push(\"Set PM_AUTHOR=<your-agent-id> so mutations attribute to the right caller.\");\n for (const guidanceNextStep of params.agentGuidanceNextSteps) {\n if (!nextSteps.includes(guidanceNextStep)) {\n nextSteps.push(guidanceNextStep);\n }\n }\n return nextSteps;\n}\n\n/**\n * Implements run init for the public runtime surface of this module.\n */\nexport async function runInit(\n prefixArg: string | undefined,\n global: GlobalOptions,\n options: InitCommandOptions = {},\n): Promise<InitResult> {\n const cwd = process.cwd();\n const invocation = resolveInitInvocation(cwd, global, prefixArg);\n const pmRoot = invocation.pmRoot;\n prefixArg = invocation.prefixArg;\n await assertExplicitTrackerPathIsNotWorkspaceRoot(pmRoot, global, options.force === true);\n const createdDirs: string[] = [];\n const warnings: string[] = [];\n const baseDirs = await ensureInitDirectories(pmRoot, PM_REQUIRED_SUBDIRS);\n createdDirs.push(...baseDirs.createdDirs);\n warnings.push(...baseDirs.warnings);\n\n const settingsPath = path.join(pmRoot, \"settings.json\");\n const settingsExists = await pathExists(settingsPath);\n const normalizedOptions = normalizeInitCommandOptions(options);\n const settingsResolution = await resolveInitSettings({\n pmRoot,\n settingsPath,\n settingsExists,\n normalizedPrefix: normalizePrefix(prefixArg),\n prefixArg,\n options,\n normalizedOptions,\n warnings,\n });\n let { settings } = settingsResolution;\n\n const agentGuidance = await applyInitAgentGuidance({\n pmRoot,\n cwd,\n agentGuidanceMode: normalizedOptions.agentGuidanceMode,\n settings,\n warnings,\n });\n\n const schemaFiles = await ensureInitRuntimeSchemaFiles(pmRoot, settings);\n createdDirs.push(...schemaFiles.createdDirs);\n warnings.push(...schemaFiles.warnings);\n\n const registeredTypePreset = await maybeRegisterInitTypePreset({\n pmRoot,\n settings,\n typePreset: normalizedOptions.typePreset,\n warnings,\n });\n if (registeredTypePreset) {\n settings = await readSettings(pmRoot);\n }\n\n await ensureInitTypeDirectories({ pmRoot, settings, createdDirs, warnings });\n const installedPackages = await maybeInstallInitBundledPackages(normalizedOptions.installBundledPackages, global, warnings);\n\n const nextSteps = buildInitNextSteps({\n installBundledPackages: normalizedOptions.installBundledPackages,\n registeredTypePreset,\n agentGuidanceNextSteps: agentGuidance.next_steps,\n });\n\n return {\n ok: true,\n path: pmRoot,\n settings,\n created_dirs: createdDirs,\n warnings,\n governance_preset: settings.governance.preset,\n wizard_used: settingsResolution.wizardUsed,\n ...(registeredTypePreset ? { registered_type_preset: registeredTypePreset } : {}),\n ...(installedPackages ? { installed_packages: installedPackages } : {}),\n next_steps: nextSteps,\n agent_guidance: agentGuidance,\n };\n}\n","/**\n * @module cli/commands/init-agent-guidance\n *\n * Implements the pm init agent guidance command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport readline from \"node:readline/promises\";\nimport { stdin as input, stdout as output } from \"node:process\";\nimport { runActiveOnWriteHooks } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport type { PmSettings } from \"../../types/index.js\";\n\n/**\n * Restricts init agent guidance mode values accepted by command, SDK, and storage contracts.\n */\nexport type InitAgentGuidanceMode = \"ask\" | \"add\" | \"skip\" | \"status\";\n\nexport const INIT_AGENT_GUIDANCE_MODE_VALUES: InitAgentGuidanceMode[] = [\"ask\", \"add\", \"skip\", \"status\"];\n\nconst AGENT_GUIDANCE_TARGET_FILENAMES = [\"AGENTS.md\", \"CLAUDE.md\"] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKENS = [\n \"pm init\",\n \"pm context\",\n \"pm search\",\n \"pm create\",\n \"pm claim\",\n \"pm files\",\n \"pm docs\",\n \"pm test --run\",\n \"pm close\",\n \"pm release\",\n \"pm_author\",\n] as const;\nconst AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD = 8;\nconst AGENT_GUIDANCE_TEMPLATE_VERSION = 1;\nconst AGENT_GUIDANCE_START_MARKER_PREFIX = \"<!-- pm-cli:agent-guidance:start:\";\nconst AGENT_GUIDANCE_START_MARKER = `<!-- pm-cli:agent-guidance:start:v${AGENT_GUIDANCE_TEMPLATE_VERSION} -->`;\nconst AGENT_GUIDANCE_END_MARKER = \"<!-- pm-cli:agent-guidance:end -->\";\nconst AGENT_GUIDANCE_ADD_LATER_HINT = \"Add workflow guidance later: pm init --agent-guidance add\";\n\nexport const _testOnly = {\n toPortableRelativePath,\n ensureTrailingNewline,\n detectLineEnding,\n findGuidanceBlockRange,\n buildAgentGuidanceBlock,\n upsertAgentGuidanceBlock,\n resolveProjectRoot,\n resolveTargetGuidancePath,\n parsePromptChoice,\n pushUnique,\n promptForGuidanceWrite,\n normalizeAgentGuidanceState,\n applyAgentGuidanceState,\n writeGuidanceFile,\n setAgentGuidanceReadlineFactoryForTests,\n};\n\ntype AgentGuidanceReadlineInterface = ReturnType<typeof readline.createInterface>;\nlet createAgentGuidanceReadlineInterface = (): AgentGuidanceReadlineInterface => readline.createInterface({ input, output });\n\nfunction setAgentGuidanceReadlineFactoryForTests(factory: (() => AgentGuidanceReadlineInterface) | undefined): void {\n createAgentGuidanceReadlineInterface = factory ?? (() => readline.createInterface({ input, output }));\n}\n\ninterface AgentGuidanceFileScan {\n file_path: string;\n exists: boolean;\n has_guidance: boolean;\n has_marker: boolean;\n}\n\ninterface AgentGuidanceBlockRange {\n start_index: number;\n end_index: number;\n}\n\n/**\n * Documents the init agent guidance summary payload exchanged by command, SDK, and package integrations.\n */\nexport interface InitAgentGuidanceSummary {\n mode: InitAgentGuidanceMode;\n present: boolean;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n declined: boolean;\n prompt_completed: boolean;\n template_version: number;\n target_file: string;\n checked_files: string[];\n files_with_guidance: string[];\n missing_files: string[];\n}\n\n/**\n * Documents the run init agent guidance options payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceOptions {\n pm_root: string;\n cwd: string;\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n settings: PmSettings;\n}\n\n/**\n * Documents the run init agent guidance result payload exchanged by command, SDK, and package integrations.\n */\nexport interface RunInitAgentGuidanceResult {\n summary: InitAgentGuidanceSummary;\n warnings: string[];\n next_steps: string[];\n settings_changed: boolean;\n}\n\nfunction toPortableRelativePath(projectRoot: string, targetPath: string): string {\n const relative = path.relative(projectRoot, targetPath);\n if (relative.length === 0) {\n return path.basename(targetPath);\n }\n return relative.split(path.sep).join(\"/\");\n}\n\nfunction ensureTrailingNewline(value: string): string {\n return value.endsWith(\"\\n\") ? value : `${value}\\n`;\n}\n\nfunction detectLineEnding(value: string): \"\\n\" | \"\\r\\n\" {\n return value.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n}\n\nfunction findGuidanceBlockRange(content: string): AgentGuidanceBlockRange | null {\n const startIndex = content.indexOf(AGENT_GUIDANCE_START_MARKER_PREFIX);\n if (startIndex === -1) {\n return null;\n }\n const endMarkerIndex = content.indexOf(AGENT_GUIDANCE_END_MARKER, startIndex);\n if (endMarkerIndex === -1) {\n return null;\n }\n return {\n start_index: startIndex,\n end_index: endMarkerIndex + AGENT_GUIDANCE_END_MARKER.length,\n };\n}\n\nfunction hasGuidanceMarker(content: string): boolean {\n return findGuidanceBlockRange(content) !== null;\n}\n\nfunction buildAgentGuidanceBlock(lineEnding: \"\\n\" | \"\\r\\n\"): string {\n const lines = [\n AGENT_GUIDANCE_START_MARKER,\n \"## pm Workflow (Agent Quickstart)\",\n \"\",\n \"- Orient before mutate: `pm context --limit 10`, `pm search \\\"<keywords>\\\" --limit 10`, `pm list-open --limit 20`.\",\n \"- Claim and execute: `pm claim <id>` then `pm update <id> --status in_progress`.\",\n \"- Link evidence while coding: `pm files <id> --add ...`, `pm docs <id> --add ...`, `pm test <id> --add command=\\\"node scripts/run-tests.mjs test -- ...\\\"`.\",\n \"- Verify and close: `pm test <id> --run --progress`, `pm close <id> \\\"<evidence>\\\" --validate-close warn`, `pm release <id>`.\",\n \"- Set `PM_AUTHOR=<stable-agent-id>` before mutation commands.\",\n \"\",\n AGENT_GUIDANCE_END_MARKER,\n \"\",\n ];\n return lines.join(lineEnding);\n}\n\nfunction upsertAgentGuidanceBlock(existingContent: string): { next_content: string; changed: boolean } {\n const lineEnding = detectLineEnding(existingContent);\n const nextBlock = buildAgentGuidanceBlock(lineEnding);\n const existingRange = findGuidanceBlockRange(existingContent);\n if (existingRange) {\n const trailingContent = existingContent.slice(existingRange.end_index);\n const normalizedTrailingContent = trailingContent.startsWith(\"\\r\\n\")\n ? trailingContent.slice(2)\n : trailingContent.startsWith(\"\\n\")\n ? trailingContent.slice(1)\n : trailingContent;\n const nextContent = ensureTrailingNewline(\n `${existingContent.slice(0, existingRange.start_index)}${nextBlock}${normalizedTrailingContent}`,\n );\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n }\n const separator = existingContent.length === 0 ? \"\" : existingContent.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const nextContent = ensureTrailingNewline(`${existingContent}${separator}${nextBlock}`);\n return {\n next_content: nextContent,\n changed: nextContent !== existingContent,\n };\n}\n\nfunction resolveProjectRoot(pmRoot: string, cwd: string): string {\n const parent = path.dirname(pmRoot);\n if (path.basename(pmRoot) === \"pm\" && path.basename(parent) === \".agents\") {\n return path.dirname(parent);\n }\n return path.resolve(cwd, pmRoot);\n}\n\nfunction resolveTargetGuidancePath(scans: AgentGuidanceFileScan[], projectRoot: string): string {\n const existingAgents = scans.find((entry) => path.basename(entry.file_path) === \"AGENTS.md\" && entry.exists);\n if (existingAgents) {\n return existingAgents.file_path;\n }\n const existingAny = scans.find((entry) => entry.exists);\n if (existingAny) {\n return existingAny.file_path;\n }\n return path.join(projectRoot, \"AGENTS.md\");\n}\n\nfunction parsePromptChoice(answer: string, currentDefault: boolean): boolean {\n const normalized = answer.trim().toLowerCase();\n if (normalized.length === 0) {\n return currentDefault;\n }\n if (normalized === \"y\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"n\" || normalized === \"no\") {\n return false;\n }\n return currentDefault;\n}\n\nasync function promptForGuidanceWrite(targetRelativePath: string): Promise<boolean> {\n const rl = createAgentGuidanceReadlineInterface();\n try {\n output.write(\"\\nAgent guidance check\\n\");\n output.write(\"No AGENTS.md/CLAUDE.md file currently contains compact pm workflow guidance.\\n\");\n const answer = await rl.question(`Add a compact pm workflow section to ${targetRelativePath}? [Y/n] `);\n output.write(\"\\n\");\n return parsePromptChoice(answer, true);\n } finally {\n rl.close();\n }\n}\n\nfunction normalizeAgentGuidanceState(settings: PmSettings): PmSettings[\"agent_guidance\"] {\n const current = settings.agent_guidance;\n return {\n prompt_completed: current?.prompt_completed === true,\n declined: current?.declined === true,\n declined_at: typeof current?.declined_at === \"string\" ? current.declined_at : \"\",\n template_version:\n typeof current?.template_version === \"number\" && Number.isInteger(current.template_version) && current.template_version > 0\n ? current.template_version\n : AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: Array.isArray(current?.last_checked_files)\n ? [...new Set(current.last_checked_files.map((value) => value.trim()).filter((value) => value.length > 0))].sort(\n (left, right) => left.localeCompare(right),\n )\n : [],\n };\n}\n\nasync function scanGuidanceFiles(projectRoot: string): Promise<AgentGuidanceFileScan[]> {\n const scans: AgentGuidanceFileScan[] = [];\n for (const filename of AGENT_GUIDANCE_TARGET_FILENAMES) {\n const filePath = path.join(projectRoot, filename);\n const exists = await pathExists(filePath);\n if (!exists) {\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: false,\n has_marker: false,\n });\n continue;\n }\n const content = await fs.readFile(filePath, \"utf8\");\n const contentLower = content.toLowerCase();\n const tokenHits = AGENT_GUIDANCE_REQUIRED_TOKENS.filter((token) => contentLower.includes(token));\n const hasMarker = hasGuidanceMarker(content);\n scans.push({\n file_path: filePath,\n exists,\n has_guidance: hasMarker || tokenHits.length >= AGENT_GUIDANCE_REQUIRED_TOKEN_THRESHOLD,\n has_marker: hasMarker,\n });\n }\n return scans;\n}\n\nfunction pushUnique(target: string[], value: string): void {\n if (!target.includes(value)) {\n target.push(value);\n }\n}\n\nfunction applyAgentGuidanceState(\n settings: PmSettings,\n currentState: PmSettings[\"agent_guidance\"],\n): { changed: boolean; state: PmSettings[\"agent_guidance\"] } {\n const existing = normalizeAgentGuidanceState(settings);\n const changed = JSON.stringify(existing) !== JSON.stringify(currentState);\n if (changed) {\n settings.agent_guidance = currentState;\n }\n return { changed, state: currentState };\n}\n\nasync function writeGuidanceFile(filePath: string): Promise<{ changed: boolean; warnings: string[] }> {\n const exists = await pathExists(filePath);\n const currentContent = exists ? await fs.readFile(filePath, \"utf8\") : \"\";\n const nextContent = upsertAgentGuidanceBlock(currentContent);\n if (!nextContent.changed) {\n return { changed: false, warnings: [] };\n }\n await fs.writeFile(filePath, nextContent.next_content, \"utf8\");\n return {\n changed: true,\n warnings: await runActiveOnWriteHooks({\n path: filePath,\n scope: \"project\",\n op: \"init:agent_guidance_file\",\n }),\n };\n}\n\nfunction buildInitAgentGuidanceSummary(params: {\n mode: InitAgentGuidanceMode;\n scans: AgentGuidanceFileScan[];\n projectRoot: string;\n targetRelativePath: string;\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n state: PmSettings[\"agent_guidance\"];\n}): InitAgentGuidanceSummary {\n return {\n mode: params.mode,\n present: params.scans.some((entry) => entry.has_guidance),\n prompted: params.prompted,\n applied: params.applied,\n skipped: params.skipped,\n declined: params.state.declined,\n prompt_completed: params.state.prompt_completed,\n template_version: params.state.template_version,\n target_file: params.targetRelativePath,\n checked_files: params.scans.map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n files_with_guidance: params.scans\n .filter((entry) => entry.has_guidance)\n .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n missing_files: params.scans\n .filter((entry) => !entry.exists)\n .map((entry) => toPortableRelativePath(params.projectRoot, entry.file_path)),\n };\n}\n\nasync function refreshGuidanceScansAfterApply(\n applied: boolean,\n scans: AgentGuidanceFileScan[],\n projectRoot: string,\n): Promise<AgentGuidanceFileScan[]> {\n return applied ? await scanGuidanceFiles(projectRoot) : scans;\n}\n\ninterface InitAgentGuidanceFlowState {\n warnings: string[];\n nextSteps: string[];\n prompted: boolean;\n applied: boolean;\n skipped: boolean;\n state: PmSettings[\"agent_guidance\"];\n}\n\ninterface InitAgentGuidanceModeContext {\n mode: InitAgentGuidanceMode;\n interactive: boolean;\n targetPath: string;\n targetRelativePath: string;\n checkedFiles: string[];\n presentBefore: boolean;\n}\n\nfunction markAgentGuidanceRunState(\n flow: InitAgentGuidanceFlowState,\n checkedFiles: string[],\n partial: Partial<PmSettings[\"agent_guidance\"]>,\n): void {\n flow.state = {\n ...flow.state,\n ...partial,\n template_version: AGENT_GUIDANCE_TEMPLATE_VERSION,\n last_checked_files: checkedFiles,\n };\n}\n\nasync function addAgentGuidanceBlockIfMissing(\n flow: InitAgentGuidanceFlowState,\n context: Pick<InitAgentGuidanceModeContext, \"presentBefore\" | \"targetPath\" | \"targetRelativePath\">,\n): Promise<void> {\n if (context.presentBefore) {\n return;\n }\n const writeResult = await writeGuidanceFile(context.targetPath);\n flow.warnings.push(...writeResult.warnings);\n if (writeResult.changed) {\n flow.applied = true;\n flow.warnings.push(`agent_guidance:added:${context.targetRelativePath}`);\n }\n}\n\nfunction handleAgentGuidanceStatusMode(flow: InitAgentGuidanceFlowState, presentBefore: boolean): void {\n if (!presentBefore) {\n flow.warnings.push(\"agent_guidance:missing\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n }\n}\n\nfunction handleAgentGuidanceSkipMode(flow: InitAgentGuidanceFlowState, checkedFiles: string[]): void {\n flow.skipped = true;\n markAgentGuidanceRunState(flow, checkedFiles, {\n prompt_completed: true,\n declined: true,\n declined_at: flow.state.declined_at || new Date().toISOString(),\n });\n flow.warnings.push(\"agent_guidance:explicit_skip\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function handleAgentGuidanceAddMode(\n flow: InitAgentGuidanceFlowState,\n context: InitAgentGuidanceModeContext,\n): Promise<void> {\n await addAgentGuidanceBlockIfMissing(flow, context);\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n}\n\nfunction handlePresentAgentGuidance(flow: InitAgentGuidanceFlowState, checkedFiles: string[]): void {\n if (flow.state.declined) {\n markAgentGuidanceRunState(flow, checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n }\n}\n\nfunction handleDeclinedAgentGuidance(flow: InitAgentGuidanceFlowState): void {\n flow.skipped = true;\n flow.warnings.push(\"agent_guidance:skipped_declined\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function handleInteractiveAgentGuidancePrompt(\n flow: InitAgentGuidanceFlowState,\n context: InitAgentGuidanceModeContext,\n): Promise<void> {\n flow.prompted = true;\n const approved = await promptForGuidanceWrite(context.targetRelativePath);\n if (approved) {\n await addAgentGuidanceBlockIfMissing(flow, context);\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: false,\n declined_at: \"\",\n });\n return;\n }\n flow.skipped = true;\n markAgentGuidanceRunState(flow, context.checkedFiles, {\n prompt_completed: true,\n declined: true,\n declined_at: new Date().toISOString(),\n });\n flow.warnings.push(\"agent_guidance:declined\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nfunction handleNonInteractiveMissingAgentGuidance(flow: InitAgentGuidanceFlowState): void {\n flow.warnings.push(\"agent_guidance:missing_non_interactive\");\n pushUnique(flow.nextSteps, AGENT_GUIDANCE_ADD_LATER_HINT);\n}\n\nasync function applyAgentGuidanceMode(\n initialState: PmSettings[\"agent_guidance\"],\n context: InitAgentGuidanceModeContext,\n): Promise<InitAgentGuidanceFlowState> {\n const flow: InitAgentGuidanceFlowState = {\n warnings: [],\n nextSteps: [],\n prompted: false,\n applied: false,\n skipped: false,\n state: initialState,\n };\n\n if (context.mode === \"status\") {\n handleAgentGuidanceStatusMode(flow, context.presentBefore);\n return flow;\n }\n if (context.mode === \"skip\") {\n handleAgentGuidanceSkipMode(flow, context.checkedFiles);\n return flow;\n }\n if (context.mode === \"add\") {\n await handleAgentGuidanceAddMode(flow, context);\n return flow;\n }\n if (context.presentBefore) {\n handlePresentAgentGuidance(flow, context.checkedFiles);\n return flow;\n }\n if (flow.state.prompt_completed && flow.state.declined) {\n handleDeclinedAgentGuidance(flow);\n return flow;\n }\n if (context.interactive) {\n await handleInteractiveAgentGuidancePrompt(flow, context);\n return flow;\n }\n handleNonInteractiveMissingAgentGuidance(flow);\n return flow;\n}\n\n/**\n * Implements run init agent guidance for the public runtime surface of this module.\n */\nexport async function runInitAgentGuidance(options: RunInitAgentGuidanceOptions): Promise<RunInitAgentGuidanceResult> {\n const projectRoot = resolveProjectRoot(options.pm_root, options.cwd);\n let scans = await scanGuidanceFiles(projectRoot);\n const targetPath = resolveTargetGuidancePath(scans, projectRoot);\n const targetRelativePath = toPortableRelativePath(projectRoot, targetPath);\n const checkedFiles = scans.map((entry) => toPortableRelativePath(projectRoot, entry.file_path));\n const presentBefore = scans.some((entry) => entry.has_guidance);\n const flow = await applyAgentGuidanceMode(normalizeAgentGuidanceState(options.settings), {\n mode: options.mode,\n interactive: options.interactive,\n targetPath,\n targetRelativePath,\n checkedFiles,\n presentBefore,\n });\n\n const stateUpdate = applyAgentGuidanceState(options.settings, flow.state);\n scans = await refreshGuidanceScansAfterApply(flow.applied, scans, projectRoot);\n\n const summary = buildInitAgentGuidanceSummary({\n mode: options.mode,\n scans,\n projectRoot,\n targetRelativePath,\n prompted: flow.prompted,\n applied: flow.applied,\n skipped: flow.skipped,\n state: flow.state,\n });\n\n return {\n summary,\n warnings: flow.warnings,\n next_steps: flow.nextSteps,\n settings_changed: stateUpdate.changed,\n };\n}\n"],"names":["fs","path","readline","input","output","nextContent","readline","input","output","path","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAOA,SAAQ;AACf,OAAOC,WAAU;AACjB,OAAOC,eAAc;AACrB,SAAS,SAASC,QAAO,UAAUC,eAAc;;;ACHjD,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,SAAS,SAAS,OAAO,UAAU,cAAc;AAU1C,IAAM,kCAA2D,CAAC,OAAO,OAAO,QAAQ,QAAQ;AAEvG,IAAM,kCAAkC,CAAC,aAAa,WAAW;AACjE,IAAM,iCAAiC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEF,IAAM,0CAA0C;AAChD,IAAM,kCAAkC;AACxC,IAAM,qCAAqC;AAC3C,IAAM,8BAA8B,qCAAqC,+BAA+B;AACxG,IAAM,4BAA4B;AAClC,IAAM,gCAAgC;AAqBtC,IAAI,uCAAuC,MAAsC,SAAS,gBAAgB,EAAE,OAAO,OAAM,CAAE;AAyD3H,SAAS,uBAAuB,aAAqB,YAAkB;AACrE,QAAM,WAAW,KAAK,SAAS,aAAa,UAAU;AACtD,MAAI,SAAS,WAAW,GAAG;AACzB,WAAO,KAAK,SAAS,UAAU;EACjC;AACA,SAAO,SAAS,MAAM,KAAK,GAAG,EAAE,KAAK,GAAG;AAC1C;AAEA,SAAS,sBAAsB,OAAa;AAC1C,SAAO,MA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-00ce71f6b477"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSubcommandFlagContractsForCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7745CXNI.js";
|
|
4
4
|
import {
|
|
5
5
|
EXIT_CODE,
|
|
6
6
|
PmCliError,
|
|
7
7
|
isPathWithinDirectory,
|
|
8
8
|
levenshteinDistanceWithinLimit,
|
|
9
9
|
pathExists
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BDDYM4LH.js";
|
|
11
11
|
|
|
12
12
|
// dist/cli/bootstrap-args.js
|
|
13
13
|
!(function() {
|
|
@@ -694,7 +694,7 @@ import path from "node:path";
|
|
|
694
694
|
!(function() {
|
|
695
695
|
try {
|
|
696
696
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
697
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
697
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "860ac58e-284f-5ddb-a310-0aa423b2b4fd");
|
|
698
698
|
} catch (e2) {
|
|
699
699
|
}
|
|
700
700
|
})();
|
|
@@ -715,6 +715,21 @@ function normalizeManagedDirectoryName(name) {
|
|
|
715
715
|
}
|
|
716
716
|
return normalized;
|
|
717
717
|
}
|
|
718
|
+
function parseOptionalManifestPriority(value) {
|
|
719
|
+
if (value === void 0 || value === null) {
|
|
720
|
+
return DEFAULT_EXTENSION_PRIORITY;
|
|
721
|
+
}
|
|
722
|
+
return typeof value === "number" && Number.isInteger(value) ? value : null;
|
|
723
|
+
}
|
|
724
|
+
function parseOptionalManifestCapabilities(value) {
|
|
725
|
+
if (value === void 0 || value === null) {
|
|
726
|
+
return [];
|
|
727
|
+
}
|
|
728
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
|
|
729
|
+
return null;
|
|
730
|
+
}
|
|
731
|
+
return normalizeStringList(value.map((entry) => String(entry).toLowerCase()));
|
|
732
|
+
}
|
|
718
733
|
function parseExtensionManifest(raw) {
|
|
719
734
|
if (typeof raw !== "object" || raw === null) {
|
|
720
735
|
return null;
|
|
@@ -729,19 +744,10 @@ function parseExtensionManifest(raw) {
|
|
|
729
744
|
if (typeof candidate.entry !== "string" || candidate.entry.trim().length === 0) {
|
|
730
745
|
return null;
|
|
731
746
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}
|
|
737
|
-
priority = candidate.priority;
|
|
738
|
-
}
|
|
739
|
-
let capabilities = [];
|
|
740
|
-
if (candidate.capabilities !== void 0 && candidate.capabilities !== null) {
|
|
741
|
-
if (!Array.isArray(candidate.capabilities) || candidate.capabilities.some((value) => typeof value !== "string")) {
|
|
742
|
-
return null;
|
|
743
|
-
}
|
|
744
|
-
capabilities = normalizeStringList(candidate.capabilities.map((value) => String(value).toLowerCase()));
|
|
747
|
+
const priority = parseOptionalManifestPriority(candidate.priority);
|
|
748
|
+
const capabilities = parseOptionalManifestCapabilities(candidate.capabilities);
|
|
749
|
+
if (priority === null || capabilities === null) {
|
|
750
|
+
return null;
|
|
745
751
|
}
|
|
746
752
|
return {
|
|
747
753
|
name: candidate.name.trim(),
|
|
@@ -806,4 +812,4 @@ export {
|
|
|
806
812
|
parseExtensionManifest,
|
|
807
813
|
validateExtensionDirectory
|
|
808
814
|
};
|
|
809
|
-
//# sourceMappingURL=chunk-
|
|
815
|
+
//# sourceMappingURL=chunk-4OXNQHKQ.js.map
|